diff --git a/src/drc/unit_tests/drcFullTests.cc b/src/drc/unit_tests/drcFullTests.cc index 36aecd8a7..916977cfa 100644 --- a/src/drc/unit_tests/drcFullTests.cc +++ b/src/drc/unit_tests/drcFullTests.cc @@ -30,13 +30,99 @@ TEST(1_IHPMetal1Fill) test_is_long_runner (); std::string rs = tl::testdata (); - rs += "/drc/drcFullTest_1.drc"; + rs += "/drc/drcFullTest_1a.drc"; std::string input = tl::testdata (); input += "/drc/drcFullTest_1.oas"; std::string au = tl::testdata (); - au += "/drc/drcFullTest_au1.oas"; + au += "/drc/drcFullTest_au1a.oas"; + + std::string output = this->tmp_file ("tmp.oas"); + + { + // Set some variables + lym::Macro config; + config.set_text (tl::sprintf ( + "$drc_force_gc = true\n" + "$drc_test_source = '%s'\n" + "$drc_test_target = '%s'\n" + , input, output) + ); + config.set_interpreter (lym::Macro::Ruby); + EXPECT_EQ (config.run (), 0); + } + + lym::Macro drc; + drc.load_from (rs); + EXPECT_EQ (drc.run (), 0); + + db::Layout layout; + + { + tl::InputStream stream (output); + db::Reader reader (stream); + reader.read (layout); + } + + db::compare_layouts (_this, layout, au, db::NoNormalization); +} + +TEST(1b_IHPMetal1FillAutoOrigin) +{ + test_is_long_runner (); + + std::string rs = tl::testdata (); + rs += "/drc/drcFullTest_1b.drc"; + + std::string input = tl::testdata (); + input += "/drc/drcFullTest_1.oas"; + + std::string au = tl::testdata (); + au += "/drc/drcFullTest_au1b.oas"; + + std::string output = this->tmp_file ("tmp.oas"); + + { + // Set some variables + lym::Macro config; + config.set_text (tl::sprintf ( + "$drc_force_gc = true\n" + "$drc_test_source = '%s'\n" + "$drc_test_target = '%s'\n" + , input, output) + ); + config.set_interpreter (lym::Macro::Ruby); + EXPECT_EQ (config.run (), 0); + } + + lym::Macro drc; + drc.load_from (rs); + EXPECT_EQ (drc.run (), 0); + + db::Layout layout; + + { + tl::InputStream stream (output); + db::Reader reader (stream); + reader.read (layout); + } + + db::compare_layouts (_this, layout, au, db::NoNormalization); +} + +TEST(1c_IHPMetal1FillSingleOrigin) +{ + test_is_long_runner (); + + std::string rs = tl::testdata (); + rs += "/drc/drcFullTest_1c.drc"; + + std::string input = tl::testdata (); + input += "/drc/drcFullTest_1.oas"; + + std::string au = tl::testdata (); + au += "/drc/drcFullTest_au1c.oas"; std::string output = this->tmp_file ("tmp.oas"); diff --git a/testdata/drc/drcFullTest_1.drc b/testdata/drc/drcFullTest_1a.drc similarity index 100% rename from testdata/drc/drcFullTest_1.drc rename to testdata/drc/drcFullTest_1a.drc diff --git a/testdata/drc/drcFullTest_1b.drc b/testdata/drc/drcFullTest_1b.drc new file mode 100644 index 000000000..06300c7e9 --- /dev/null +++ b/testdata/drc/drcFullTest_1b.drc @@ -0,0 +1,58 @@ + +source($drc_test_source) +target($drc_test_target) + +verbose + +ncpu = 4 + +chip = input(189, 4) +chip.output(189, 4) + +# NOTE: this must not happen in tiled mode as the sealring +# is only visible as a whole in flat mode +sealring = source.cell("sealring") + +metal1_seal = sealring.input(8, 0) +metal1_seal_inner = metal1_seal.holes +# NOTE: metal1_seal_outer is empty if there is no sealring -> +# the full chip will be filled +metal1_seal_outer = chip.interacting(metal1_seal_inner) - metal1_seal_inner + +# Everything else can be done in tiled mode + +tiles(500) +tile_borders(2.0) +threads(ncpu) + +metal1 = input(8, 0) +metal1.output(8, 0) +metal1_fill = input(8, 22) +metal1_nofill = input(8, 23) + metal1_seal_outer + +metal1_dist = 0.42 +min_space_to_fill = 1.0 + +pattern = fill_pattern("METAL1_FILL1") +pattern.shape(8, 22, box(0.0, 0.0, 5.0, 5.0)) +pattern.dim(5.0, 5.0) +pattern.margin(metal1_dist, metal1_dist) + +to_fill = chip - metal1_nofill - metal1 + +to_fill = to_fill.fill_with_left(pattern, hstep(7.0, 0), vstep(1.5, 7.0), auto_origin) + +pattern = fill_pattern("METAL1_FILL2") +pattern.shape(8, 22, box(0.0, 0.0, 2.0, 2.0)) +pattern.dim(2.0, 2.0) +pattern.margin(metal1_dist, metal1_dist) + +to_fill = to_fill.fill_with_left(pattern, hstep(2.42, 0), vstep(0.65, 2.42), auto_origin) + +pattern = fill_pattern("METAL1_FILL3") +pattern.shape(8, 22, box(0.0, 0.0, 1.2, 1.2)) +pattern.dim(1.2, 1.2) +pattern.margin(metal1_dist, metal1_dist) + +to_fill = to_fill.fill_with_left(pattern, hstep(1.62, 0), vstep(0.3, 1.62), auto_origin) + diff --git a/testdata/drc/drcFullTest_1c.drc b/testdata/drc/drcFullTest_1c.drc new file mode 100644 index 000000000..d263ff5eb --- /dev/null +++ b/testdata/drc/drcFullTest_1c.drc @@ -0,0 +1,58 @@ + +source($drc_test_source) +target($drc_test_target) + +verbose + +ncpu = 4 + +chip = input(189, 4) +chip.output(189, 4) + +# NOTE: this must not happen in tiled mode as the sealring +# is only visible as a whole in flat mode +sealring = source.cell("sealring") + +metal1_seal = sealring.input(8, 0) +metal1_seal_inner = metal1_seal.holes +# NOTE: metal1_seal_outer is empty if there is no sealring -> +# the full chip will be filled +metal1_seal_outer = chip.interacting(metal1_seal_inner) - metal1_seal_inner + +# Everything else can be done in tiled mode + +tiles(500) +tile_borders(2.0) +threads(ncpu) + +metal1 = input(8, 0) +metal1.output(8, 0) +metal1_fill = input(8, 22) +metal1_nofill = input(8, 23) + metal1_seal_outer + +metal1_dist = 0.42 +min_space_to_fill = 1.0 + +pattern = fill_pattern("METAL1_FILL1") +pattern.shape(8, 22, box(0.0, 0.0, 5.0, 5.0)) +pattern.dim(5.0, 5.0) +pattern.margin(metal1_dist, metal1_dist) + +to_fill = chip - metal1_nofill - metal1 + +to_fill = to_fill.fill_with_left(pattern, hstep(7.0, 0), vstep(1.5, 7.0), origin(0, 0)) + +pattern = fill_pattern("METAL1_FILL2") +pattern.shape(8, 22, box(0.0, 0.0, 2.0, 2.0)) +pattern.dim(2.0, 2.0) +pattern.margin(metal1_dist, metal1_dist) + +to_fill = to_fill.fill_with_left(pattern, hstep(2.42, 0), vstep(0.65, 2.42), origin(0, 0)) + +pattern = fill_pattern("METAL1_FILL3") +pattern.shape(8, 22, box(0.0, 0.0, 1.2, 1.2)) +pattern.dim(1.2, 1.2) +pattern.margin(metal1_dist, metal1_dist) + +to_fill = to_fill.fill_with_left(pattern, hstep(1.62, 0), vstep(0.3, 1.62), origin(0, 0)) + diff --git a/testdata/drc/drcFullTest_au1.oas b/testdata/drc/drcFullTest_au1.oas deleted file mode 100644 index 437274197..000000000 Binary files a/testdata/drc/drcFullTest_au1.oas and /dev/null differ diff --git a/testdata/drc/drcFullTest_au1a.oas b/testdata/drc/drcFullTest_au1a.oas new file mode 100644 index 000000000..ccbff5e2b Binary files /dev/null and b/testdata/drc/drcFullTest_au1a.oas differ diff --git a/testdata/drc/drcFullTest_au1b.oas b/testdata/drc/drcFullTest_au1b.oas new file mode 100644 index 000000000..2199934f7 Binary files /dev/null and b/testdata/drc/drcFullTest_au1b.oas differ diff --git a/testdata/drc/drcFullTest_au1c.oas b/testdata/drc/drcFullTest_au1c.oas new file mode 100644 index 000000000..d70ef978e Binary files /dev/null and b/testdata/drc/drcFullTest_au1c.oas differ