Implemented LEF DENSITY statement properly

This commit is contained in:
Matthias Koefferlein 2020-12-14 22:20:29 +01:00
parent 6a9a024d64
commit 85311d414c
5 changed files with 51 additions and 0 deletions

View File

@ -937,6 +937,24 @@ LEFImporter::read_macro (Layout &layout)
expect ("END");
} else if (test ("DENSITY")) {
// read over DENSITY statements
while (! test ("END")) {
if (test ("LAYER")) {
get ();
expect (";");
} else {
expect ("RECT");
for (int i = 0; i < 5; ++i) {
get_double ();
}
expect (";");
}
}
expect ("END");
} else if (test ("FIXEDMASK")) {
mg->set_fixedmask (true);

View File

@ -719,6 +719,11 @@ TEST(117_mapfile_all)
)
}
TEST(118_density)
{
run_test (_this, "density", "read:in.lef", "au.oas.gz", default_options (), false);
}
TEST(200_lefdef_plugin)
{
db::Layout ly;
@ -764,3 +769,4 @@ TEST(201_lefdef_plugin_explicit_lef)
db::compare_layouts (_this, ly, fn_path + "au_plugin_alt_lef.oas.gz", db::WriteOAS);
}

BIN
testdata/lefdef/density/.in.lef.swp vendored Normal file

Binary file not shown.

BIN
testdata/lefdef/density/au.oas.gz vendored Normal file

Binary file not shown.

27
testdata/lefdef/density/in.lef vendored Normal file
View File

@ -0,0 +1,27 @@
LAYER M1
TYPE ROUTING ;
END M1
LAYER VIA1
TYPE CUT ;
END VIA1
MACRO dense
CLASS CORE ;
ORIGIN 0.0 0.0 ;
SIZE 0.7 BY 0.9 ;
OBS
LAYER M1 DESIGNRULEWIDTH 0.05 ;
RECT 0.04 0.095 0.66 0.685 ;
LAYER VIA1 ;
RECT 0.285 0.31 0.415 0.36 ;
RECT 0.285 0.18 0.415 0.23 ;
END
DENSITY
LAYER M1 ;
RECT 0.04 0.09 0.66 0.685 100.0 ;
LAYER VIA1 ;
RECT 0 0 100 100 45.5 ; #rect from (0,0) to (100,100), density of 45.5%
RECT 100 0 200 100 42.2 ; #rect from (100,0) to (200, 100), density of 42.2%
END
END dense
END LIBRARY