Add batch 1 (YosysHQ_picorv32, alexforencich_verilog-ethernet, The-OpenROAD-Project_OpenROAD, darklife_darkriscv, corundum_corundum)
f61bac1 verified Download The-OpenROAD-Project_OpenROAD/src/odb/test/cpp/Test3DBloxChecker.cpp from SAIFIINDUSTRIES/verilog_data-1: direct link, hf CLI and curl.
- Browser
- Download file 18.7 kB
-
https://huggingface.co/datasets/SAIFIINDUSTRIES/verilog_data-1/resolve/main/The-OpenROAD-Project_OpenROAD/src/odb/test/cpp/Test3DBloxChecker.cpp
- Command line
-
hf download hf://datasets/SAIFIINDUSTRIES/verilog_data-1/The-OpenROAD-Project_OpenROAD/src/odb/test/cpp/Test3DBloxChecker.cpp
-
curl -L -o Test3DBloxChecker.cpp https://huggingface.co/datasets/SAIFIINDUSTRIES/verilog_data-1/resolve/main/The-OpenROAD-Project_OpenROAD/src/odb/test/cpp/Test3DBloxChecker.cpp
18.7 kB
| // SPDX-License-Identifier: BSD-3-Clause | |
| // Copyright (c) 2023-2026, The OpenROAD Authors | |
| namespace odb { | |
| namespace { | |
| TEST_F(CheckerFixture, test_no_violations) | |
| { | |
| auto inst1 = dbChipInst::create(top_chip_, chip1_, "inst1"); | |
| inst1->setLoc(Point3D(0, 0, 0)); | |
| inst1->setOrient(dbOrientType3D(dbOrientType::R0, false)); | |
| auto inst2 = dbChipInst::create(top_chip_, chip2_, "inst2"); | |
| inst2->setLoc(Point3D(0, 0, 500)); // Stacked on top | |
| inst2->setOrient(dbOrientType3D(dbOrientType::R0, false)); | |
| auto* ri1 = inst1->findChipRegionInst("r1_fr"); | |
| auto* ri2 = inst2->findChipRegionInst("r2_bk"); | |
| auto* conn1 = dbChipConn::create("c1", top_chip_, {inst2}, ri2, {inst1}, ri1); | |
| conn1->setThickness(0); | |
| check(); | |
| EXPECT_TRUE(getMarkers(floating_chips_category).empty()); | |
| EXPECT_TRUE(getMarkers(overlapping_chips_category).empty()); | |
| EXPECT_TRUE(getMarkers(connected_regions_category).empty()); | |
| } | |
| TEST_F(CheckerFixture, test_overlapping_chips) | |
| { | |
| auto inst1 = dbChipInst::create(top_chip_, chip1_, "inst1"); | |
| inst1->setLoc(Point3D(0, 0, 0)); | |
| inst1->setOrient(dbOrientType3D(dbOrientType::R0, false)); | |
| auto inst2 = dbChipInst::create(top_chip_, chip2_, "inst2"); | |
| inst2->setLoc(Point3D(500, 500, 0)); // Overlaps in 3D | |
| inst2->setOrient(dbOrientType3D(dbOrientType::R0, false)); | |
| check(); | |
| auto markers = getMarkers(overlapping_chips_category); | |
| EXPECT_EQ(markers.size(), 1); | |
| if (!markers.empty()) { | |
| auto sources = markers[0]->getSources(); | |
| EXPECT_EQ(sources.size(), 2); | |
| } | |
| } | |
| TEST_F(CheckerFixture, test_single_floating_chip) | |
| { | |
| // inst1 and inst2 connected, inst3 floating | |
| auto inst1 = dbChipInst::create(top_chip_, chip1_, "inst1"); | |
| inst1->setLoc(Point3D(0, 0, 0)); | |
| inst1->setOrient(dbOrientType3D(dbOrientType::R0, false)); | |
| auto inst2 = dbChipInst::create(top_chip_, chip2_, "inst2"); | |
| inst2->setLoc(Point3D(0, 0, 500)); | |
| inst2->setOrient(dbOrientType3D(dbOrientType::R0, false)); | |
| auto inst3 = dbChipInst::create(top_chip_, chip1_, "inst3"); | |
| inst3->setLoc(Point3D(5000, 5000, 0)); // Floating | |
| inst3->setOrient(dbOrientType3D(dbOrientType::R0, false)); | |
| auto* ri1 = inst1->findChipRegionInst("r1_fr"); | |
| auto* ri2 = inst2->findChipRegionInst("r2_bk"); | |
| auto* conn1 = dbChipConn::create("c1", top_chip_, {inst2}, ri2, {inst1}, ri1); | |
| conn1->setThickness(0); | |
| check(); | |
| auto markers = getMarkers(floating_chips_category); | |
| EXPECT_EQ(markers.size(), 1); | |
| if (!markers.empty()) { | |
| auto sources = markers[0]->getSources(); | |
| EXPECT_EQ(sources.size(), 1); | |
| } | |
| } | |
| TEST_F(CheckerFixture, test_multiple_floating_groups) | |
| { | |
| // Group 1: inst1 -> inst2 (Connected) | |
| // Group 2: inst3 (Floating) | |
| // Group 3: inst4 (Floating) | |
| auto inst1 = dbChipInst::create(top_chip_, chip1_, "inst1"); | |
| inst1->setLoc(Point3D(0, 0, 0)); | |
| inst1->setOrient(dbOrientType3D(dbOrientType::R0, false)); | |
| auto inst2 = dbChipInst::create(top_chip_, chip2_, "inst2"); | |
| inst2->setLoc(Point3D(0, 0, 500)); | |
| inst2->setOrient(dbOrientType3D(dbOrientType::R0, false)); | |
| auto inst3 = dbChipInst::create(top_chip_, chip1_, "inst3"); | |
| inst3->setLoc(Point3D(5000, 5000, 0)); | |
| inst3->setOrient(dbOrientType3D(dbOrientType::R0, false)); | |
| auto inst4 = dbChipInst::create(top_chip_, chip2_, "inst4"); | |
| inst4->setLoc(Point3D(7000, 7000, 0)); | |
| inst4->setOrient(dbOrientType3D(dbOrientType::R0, false)); | |
| auto* ri1 = inst1->findChipRegionInst("r1_fr"); | |
| auto* ri2 = inst2->findChipRegionInst("r2_bk"); | |
| auto* conn1 = dbChipConn::create("c1", top_chip_, {inst2}, ri2, {inst1}, ri1); | |
| conn1->setThickness(0); | |
| check(); | |
| auto markers = getMarkers(floating_chips_category); | |
| EXPECT_EQ(markers.size(), 2); | |
| } | |
| TEST_F(CheckerFixture, test_connectivity_gap) | |
| { | |
| auto inst1 = dbChipInst::create(top_chip_, chip1_, "inst1"); | |
| inst1->setLoc(Point3D(0, 0, 0)); | |
| inst1->setOrient(dbOrientType3D(dbOrientType::R0, false)); | |
| auto inst2 = dbChipInst::create(top_chip_, chip2_, "inst2"); | |
| auto* ri1 = inst1->findChipRegionInst("r1_fr"); | |
| auto* ri2 = inst2->findChipRegionInst("r2_bk"); | |
| auto* conn = dbChipConn::create("c1", top_chip_, {inst2}, ri2, {inst1}, ri1); | |
| conn->setThickness(100); // Expect gap of 100 | |
| // Case 1: Valid connection | |
| // inst1 top is at 500. inst2 bot should be at 500 + 100 = 600 | |
| inst2->setLoc(Point3D(0, 0, 600)); | |
| inst2->setOrient(dbOrientType3D(dbOrientType::R0, false)); | |
| check(); | |
| EXPECT_TRUE(getMarkers(floating_chips_category).empty()); | |
| // Case 2: Broken connection (gap too large) | |
| // Move inst2 to 800 | |
| inst2->setLoc(Point3D(0, 0, 800)); | |
| check(); | |
| EXPECT_EQ(getMarkers(floating_chips_category).size(), 1); | |
| } | |
| TEST_F(CheckerFixture, test_abutment_no_overlap) | |
| { | |
| auto inst1 = dbChipInst::create(top_chip_, chip1_, "inst1"); | |
| inst1->setLoc(Point3D(0, 0, 0)); | |
| inst1->setOrient(dbOrientType3D(dbOrientType::R0, false)); | |
| auto inst2 = dbChipInst::create(top_chip_, chip1_, "inst2"); | |
| inst2->setLoc(Point3D(2000, 0, 0)); // Abuts at x=2000 (since width is 2000) | |
| inst2->setOrient(dbOrientType3D(dbOrientType::R0, false)); | |
| check(); | |
| EXPECT_TRUE(getMarkers(overlapping_chips_category).empty()); | |
| } | |
| TEST_F(CheckerFixture, test_close_proximity_no_overlap) | |
| { | |
| auto inst1 = dbChipInst::create(top_chip_, chip1_, "inst1"); | |
| inst1->setLoc(Point3D(0, 0, 0)); | |
| inst1->setOrient(dbOrientType3D(dbOrientType::R0, false)); | |
| auto inst2 = dbChipInst::create(top_chip_, chip1_, "inst2"); | |
| inst2->setLoc(Point3D(2001, 0, 0)); // 1 unit gap | |
| inst2->setOrient(dbOrientType3D(dbOrientType::R0, false)); | |
| check(); | |
| EXPECT_TRUE(getMarkers(overlapping_chips_category).empty()); | |
| } | |
| TEST_F(CheckerFixture, test_z_separation_no_overlap) | |
| { | |
| auto inst1 = dbChipInst::create(top_chip_, chip1_, "inst1"); | |
| inst1->setLoc(Point3D(0, 0, 0)); | |
| inst1->setOrient(dbOrientType3D(dbOrientType::R0, false)); | |
| auto inst2 = dbChipInst::create(top_chip_, chip1_, "inst2"); | |
| inst2->setLoc(Point3D(0, 0, 600)); // gap in Z (thick=500, so gap=100) | |
| inst2->setOrient(dbOrientType3D(dbOrientType::R0, false)); | |
| check(); | |
| EXPECT_TRUE(getMarkers(overlapping_chips_category).empty()); | |
| } | |
| TEST_F(CheckerFixture, test_overlap_despite_valid_connection) | |
| { | |
| // Create INTERNAL_EXT regions for masking | |
| auto r1_int = dbChipRegion::create( | |
| chip1_, "r1_int", dbChipRegion::Side::INTERNAL_EXT, nullptr); | |
| r1_int->setBox(Rect(0, 0, 2000, 2000)); | |
| auto r2_int = dbChipRegion::create( | |
| chip2_, "r2_int", dbChipRegion::Side::INTERNAL_EXT, nullptr); | |
| r2_int->setBox(Rect(0, 0, 1500, 1500)); | |
| auto inst1 = dbChipInst::create(top_chip_, chip1_, "inst1"); | |
| inst1->setLoc(Point3D(0, 0, 0)); | |
| inst1->setOrient(dbOrientType3D(dbOrientType::R0, false)); | |
| auto inst2 = dbChipInst::create(top_chip_, chip2_, "inst2"); | |
| inst2->setLoc(Point3D(100, 100, 0)); // Geometric overlap | |
| inst2->setOrient(dbOrientType3D(dbOrientType::R0, false)); | |
| // Connect them | |
| auto* ri1 = inst1->findChipRegionInst("r1_int"); | |
| auto* ri2 = inst2->findChipRegionInst("r2_int"); | |
| auto* conn = dbChipConn::create("c1", top_chip_, {inst1}, ri1, {inst2}, ri2); | |
| conn->setThickness(0); | |
| check(); | |
| EXPECT_EQ(getMarkers(overlapping_chips_category).size(), 1); | |
| } | |
| TEST_F(CheckerFixture, test_overlap_partially_covered_by_connection) | |
| { | |
| // Create small INTERNAL_EXT regions that don't cover the full overlap | |
| auto r1_int = dbChipRegion::create( | |
| chip1_, "r1_int_small", dbChipRegion::Side::INTERNAL_EXT, nullptr); | |
| r1_int->setBox(Rect(0, 0, 50, 50)); | |
| auto r2_int = dbChipRegion::create( | |
| chip2_, "r2_int_small", dbChipRegion::Side::INTERNAL_EXT, nullptr); | |
| r2_int->setBox(Rect(0, 0, 50, 50)); | |
| auto inst1 = dbChipInst::create(top_chip_, chip1_, "inst1"); | |
| inst1->setLoc(Point3D(0, 0, 0)); | |
| inst1->setOrient(dbOrientType3D(dbOrientType::R0, false)); | |
| auto inst2 = dbChipInst::create(top_chip_, chip2_, "inst2"); | |
| inst2->setLoc(Point3D(0, 0, 0)); // Full overlap of chip2 inside chip1 | |
| inst2->setOrient(dbOrientType3D(dbOrientType::R0, false)); | |
| // Connect them with small regions | |
| auto* ri1 = inst1->findChipRegionInst("r1_int_small"); | |
| auto* ri2 = inst2->findChipRegionInst("r2_int_small"); | |
| auto* conn = dbChipConn::create("c1", top_chip_, {inst1}, ri1, {inst2}, ri2); | |
| conn->setThickness(0); | |
| check(); | |
| EXPECT_EQ(getMarkers(overlapping_chips_category).size(), 1); | |
| } | |
| TEST_F(CheckerFixture, test_overlap_with_invalid_connection) | |
| { | |
| // Use FRONT/BACK regions - these should NOT mask overlaps | |
| // because masking requires INTERNAL regions | |
| auto inst1 = dbChipInst::create(top_chip_, chip1_, "inst1"); | |
| inst1->setLoc(Point3D(0, 0, 0)); | |
| inst1->setOrient(dbOrientType3D(dbOrientType::R0, false)); | |
| auto inst2 = dbChipInst::create(top_chip_, chip2_, "inst2"); | |
| inst2->setLoc(Point3D(0, 0, 0)); // Overlap | |
| inst2->setOrient(dbOrientType3D(dbOrientType::R0, false)); | |
| auto* ri1 = inst1->findChipRegionInst("r1_fr"); | |
| auto* ri2 = inst2->findChipRegionInst("r2_bk"); | |
| auto* conn = dbChipConn::create("c1", top_chip_, {inst1}, ri1, {inst2}, ri2); | |
| conn->setThickness(0); | |
| check(); | |
| EXPECT_EQ(getMarkers(overlapping_chips_category).size(), 1); | |
| } | |
| TEST_F(CheckerFixture, test_multiple_chips_complex_overlap) | |
| { | |
| // inst1: 0..2000 | |
| // inst2: 100..1600 (chip2 w=1500) overlaps inst1 | |
| // inst3: 3000..5000 (chip1 w=2000) no overlap | |
| // inst4: 3100..5100 (chip1 w=2000) overlaps inst3 | |
| auto inst1 = dbChipInst::create(top_chip_, chip1_, "inst1"); | |
| inst1->setLoc(Point3D(0, 0, 0)); | |
| inst1->setOrient(dbOrientType3D(dbOrientType::R0, false)); | |
| auto inst2 = dbChipInst::create(top_chip_, chip2_, "inst2"); | |
| inst2->setLoc(Point3D(100, 0, 0)); | |
| inst2->setOrient(dbOrientType3D(dbOrientType::R0, false)); | |
| auto inst3 = dbChipInst::create(top_chip_, chip1_, "inst3"); | |
| inst3->setLoc(Point3D(3000, 0, 0)); | |
| inst3->setOrient(dbOrientType3D(dbOrientType::R0, false)); | |
| auto inst4 = dbChipInst::create(top_chip_, chip1_, "inst4"); | |
| inst4->setLoc(Point3D(3100, 0, 0)); | |
| inst4->setOrient(dbOrientType3D(dbOrientType::R0, false)); | |
| check(); | |
| auto markers = getMarkers(overlapping_chips_category); | |
| EXPECT_EQ(markers.size(), 2); | |
| } | |
| TEST_F(CheckerFixture, test_unused_internal_ext) | |
| { | |
| // internal_ext region on chip1. Not connected. | |
| auto r1_int = dbChipRegion::create( | |
| chip1_, "r1_int", dbChipRegion::Side::INTERNAL_EXT, nullptr); | |
| r1_int->setBox(Rect(0, 0, 2000, 2000)); | |
| auto inst1 = dbChipInst::create(top_chip_, chip1_, "inst1"); | |
| inst1->setLoc(Point3D(0, 0, 0)); | |
| inst1->setOrient(dbOrientType3D(dbOrientType::R0, false)); | |
| check(); | |
| auto markers = getMarkers(unused_internal_ext_category); | |
| EXPECT_EQ(markers.size(), 1); | |
| if (!markers.empty()) { | |
| auto sources = markers[0]->getSources(); | |
| EXPECT_EQ(sources.size(), 1); | |
| // Source should be the region instance | |
| if (!sources.empty()) { | |
| auto* source = *sources.begin(); | |
| EXPECT_EQ(source->getObjectType(), dbChipRegionInstObj); | |
| auto* region_inst = static_cast<dbChipRegionInst*>(source); | |
| EXPECT_NE(region_inst, nullptr); | |
| if (region_inst) { | |
| EXPECT_EQ(region_inst->getChipRegion()->getName(), "r1_int"); | |
| } | |
| } | |
| } | |
| } | |
| TEST_F(CheckerFixture, test_used_internal_ext) | |
| { | |
| // internal_ext region on chip1 | |
| auto r1_int = dbChipRegion::create( | |
| chip1_, "r1_int", dbChipRegion::Side::INTERNAL_EXT, nullptr); | |
| r1_int->setBox(Rect(0, 0, 2000, 2000)); | |
| auto inst1 = dbChipInst::create(top_chip_, chip1_, "inst1"); | |
| inst1->setLoc(Point3D(0, 0, 0)); | |
| inst1->setOrient(dbOrientType3D(dbOrientType::R0, false)); | |
| auto inst2 = dbChipInst::create(top_chip_, chip2_, "inst2"); | |
| inst2->setLoc(Point3D(0, 0, 500)); | |
| inst2->setOrient(dbOrientType3D(dbOrientType::R0, false)); | |
| // Connect them | |
| auto* ri1 = inst1->findChipRegionInst("r1_int"); | |
| auto* ri2 = inst2->findChipRegionInst("r2_bk"); | |
| auto* conn = dbChipConn::create("c1", top_chip_, {inst1}, ri1, {inst2}, ri2); | |
| conn->setThickness(0); | |
| check(); | |
| EXPECT_TRUE(getMarkers(unused_internal_ext_category).empty()); | |
| } | |
| TEST_F(CheckerFixture, test_connection_invalid_xy) | |
| { | |
| auto inst1 = dbChipInst::create(top_chip_, chip1_, "inst1"); | |
| inst1->setLoc(Point3D(0, 0, 0)); | |
| inst1->setOrient(dbOrientType3D(dbOrientType::R0, false)); | |
| auto inst2 = dbChipInst::create(top_chip_, chip2_, "inst2"); | |
| inst2->setLoc(Point3D(3000, 3000, 500)); // No XY overlap | |
| inst2->setOrient(dbOrientType3D(dbOrientType::R0, false)); | |
| auto* ri1 = inst1->findChipRegionInst("r1_fr"); | |
| auto* ri2 = inst2->findChipRegionInst("r2_bk"); | |
| auto* conn = dbChipConn::create("c1", top_chip_, {inst2}, ri2, {inst1}, ri1); | |
| conn->setThickness(0); | |
| check(); | |
| auto markers = getMarkers(connected_regions_category); | |
| ASSERT_EQ(markers.size(), 1); | |
| EXPECT_NE(markers[0]->getComment().find("do not overlap in the XY plane"), | |
| std::string::npos); | |
| } | |
| TEST_F(CheckerFixture, test_connection_invalid_sides) | |
| { | |
| auto inst1 = dbChipInst::create(top_chip_, chip1_, "inst1"); | |
| inst1->setLoc(Point3D(0, 0, 0)); | |
| inst1->setOrient(dbOrientType3D(dbOrientType::R0, false)); | |
| auto inst2 = dbChipInst::create(top_chip_, chip2_, "inst2"); | |
| inst2->setLoc(Point3D(0, 0, 500)); | |
| inst2->setOrient(dbOrientType3D(dbOrientType::R0, false)); | |
| // Both regions are on the FRONT side, but facing each other requires one to | |
| // be BACK | |
| auto* ri1 = inst1->findChipRegionInst("r1_fr"); | |
| auto* ri2 = inst2->findChipRegionInst("r2_fr"); | |
| auto* conn = dbChipConn::create("c1", top_chip_, {inst1}, ri1, {inst2}, ri2); | |
| conn->setThickness(0); | |
| check(); | |
| auto markers = getMarkers(connected_regions_category); | |
| ASSERT_EQ(markers.size(), 1); | |
| EXPECT_NE(markers[0]->getComment().find("Ill-defined stacking direction"), | |
| std::string::npos); | |
| } | |
| TEST_F(CheckerFixture, test_connection_swapped_top_bottom) | |
| { | |
| auto inst1 = dbChipInst::create(top_chip_, chip1_, "inst1"); | |
| inst1->setLoc(Point3D(0, 0, 0)); | |
| inst1->setOrient(dbOrientType3D(dbOrientType::R0, false)); | |
| auto inst2 = dbChipInst::create(top_chip_, chip2_, "inst2"); | |
| inst2->setLoc(Point3D(0, 0, 500)); // Stacked on top | |
| inst2->setOrient(dbOrientType3D(dbOrientType::R0, false)); | |
| auto* ri1 = inst1->findChipRegionInst("r1_fr"); | |
| auto* ri2 = inst2->findChipRegionInst("r2_bk"); | |
| // The regions mate physically, but the connection declares the lower die's | |
| // region as top and the upper die's region as bottom. | |
| auto* conn = dbChipConn::create("c1", top_chip_, {inst1}, ri1, {inst2}, ri2); | |
| conn->setThickness(0); | |
| check(); | |
| auto markers = getMarkers(connected_regions_category); | |
| ASSERT_EQ(markers.size(), 1); | |
| EXPECT_NE(markers[0]->getComment().find("Ill-defined stacking direction"), | |
| std::string::npos); | |
| } | |
| TEST_F(CheckerFixture, test_connection_in_z_mirrored_assembly) | |
| { | |
| // Assembly with chip2 stacked on chip1 and a properly declared connection: | |
| // top is the upper die's down-facing region. | |
| auto* assembly | |
| = dbChip::create(db_.get(), nullptr, "Assembly", dbChip::ChipType::HIER); | |
| auto inst1 = dbChipInst::create(assembly, chip1_, "inst1"); | |
| inst1->setLoc(Point3D(0, 0, 0)); | |
| inst1->setOrient(dbOrientType3D(dbOrientType::R0, false)); | |
| auto inst2 = dbChipInst::create(assembly, chip2_, "inst2"); | |
| inst2->setLoc(Point3D(0, 0, 500)); // Stacked on top | |
| inst2->setOrient(dbOrientType3D(dbOrientType::R0, false)); | |
| auto* ri1 = inst1->findChipRegionInst("r1_fr"); | |
| auto* ri2 = inst2->findChipRegionInst("r2_bk"); | |
| auto* conn = dbChipConn::create("c1", assembly, {inst2}, ri2, {inst1}, ri1); | |
| conn->setThickness(0); | |
| // Mirror the whole assembly in Z at the top level. In world coordinates | |
| // r1_fr now faces down from above and r2_bk faces up from below. | |
| auto asm_inst = dbChipInst::create(top_chip_, assembly, "asm_inst"); | |
| asm_inst->setOrient(dbOrientType3D(dbOrientType::R0, true)); | |
| asm_inst->setLoc(Point3D(0, 0, 0)); | |
| check(); | |
| EXPECT_TRUE(getMarkers(connected_regions_category).empty()); | |
| // The unfolded connection reflects world orientation: the declared roles | |
| // swap under the mirror. | |
| auto conns = db_->getUnfoldedChipConns(); | |
| ASSERT_EQ(conns.size(), 1); | |
| dbUnfoldedChipConn* uf_conn = *conns.begin(); | |
| EXPECT_EQ( | |
| uf_conn->getTopRegion()->getChipRegionInst()->getChipRegion()->getName(), | |
| "r1_fr"); | |
| EXPECT_EQ(uf_conn->getBottomRegion() | |
| ->getChipRegionInst() | |
| ->getChipRegion() | |
| ->getName(), | |
| "r2_bk"); | |
| } | |
| TEST_F(CheckerFixture, test_connection_thickness_mismatch) | |
| { | |
| auto inst1 = dbChipInst::create(top_chip_, chip1_, "inst1"); | |
| inst1->setLoc(Point3D(0, 0, 0)); | |
| inst1->setOrient(dbOrientType3D(dbOrientType::R0, false)); | |
| auto inst2 = dbChipInst::create(top_chip_, chip2_, "inst2"); | |
| inst2->setLoc(Point3D(0, 0, 600)); // Distance is 100 | |
| inst2->setOrient(dbOrientType3D(dbOrientType::R0, false)); | |
| auto* ri1 = inst1->findChipRegionInst("r1_fr"); | |
| auto* ri2 = inst2->findChipRegionInst("r2_bk"); | |
| auto* conn = dbChipConn::create("c1", top_chip_, {inst2}, ri2, {inst1}, ri1); | |
| conn->setThickness(50); // Mismatch (100 != 50) | |
| check(); | |
| auto markers = getMarkers(connected_regions_category); | |
| ASSERT_EQ(markers.size(), 1); | |
| EXPECT_NE( | |
| markers[0]->getComment().find("does not match connection thickness"), | |
| std::string::npos); | |
| } | |
| TEST_F(CheckerFixture, test_connection_internal_ext) | |
| { | |
| // internal_ext regions overlap in Z | |
| auto r1_int = dbChipRegion::create( | |
| chip1_, "r1_int", dbChipRegion::Side::INTERNAL_EXT, nullptr); | |
| r1_int->setBox(Rect(0, 0, 2000, 2000)); | |
| auto r2_int = dbChipRegion::create( | |
| chip2_, "r2_int", dbChipRegion::Side::INTERNAL_EXT, nullptr); | |
| r2_int->setBox(Rect(0, 0, 1500, 1500)); | |
| auto inst1 = dbChipInst::create(top_chip_, chip1_, "inst1"); | |
| inst1->setLoc(Point3D(0, 0, 0)); | |
| inst1->setOrient(dbOrientType3D(dbOrientType::R0, false)); | |
| auto inst2 = dbChipInst::create(top_chip_, chip2_, "inst2"); | |
| inst2->setLoc(Point3D(0, 0, 100)); // Z overlap since chip1 thickness is 500 | |
| inst2->setOrient(dbOrientType3D(dbOrientType::R0, false)); | |
| auto* ri1 = inst1->findChipRegionInst("r1_int"); | |
| auto* ri2 = inst2->findChipRegionInst("r2_int"); | |
| auto* conn = dbChipConn::create("c1", top_chip_, {inst1}, ri1, {inst2}, ri2); | |
| conn->setThickness(0); | |
| check(); | |
| EXPECT_TRUE(getMarkers(connected_regions_category).empty()); | |
| // Test failure: move inst2 outside Z-range of inst1 | |
| inst2->setLoc(Point3D(0, 0, 600)); | |
| check(); | |
| auto markers = getMarkers(connected_regions_category); | |
| ASSERT_EQ(markers.size(), 1); | |
| EXPECT_NE(markers[0]->getComment().find("do not overlap in Z"), | |
| std::string::npos); | |
| } | |
| } // namespace | |
| } // namespace odb | |