Bugfix LEF/DEF reader: via needs to change the layer also if it's inside a DEF. Added more test cases.

This commit is contained in:
Matthias Koefferlein 2020-03-31 23:07:42 +02:00
parent 2c60338ae8
commit bcaf28c94c
8 changed files with 99 additions and 0 deletions

View File

@ -967,6 +967,25 @@ DEFImporter::do_read (db::Layout &layout)
}
if (vd.m1.empty () && vd.m2.empty ()) {
// analyze the layers to find the metals
std::vector<std::string> routing_layers;
for (std::map<std::string, std::vector<db::Polygon> >::const_iterator b = geometry.begin (); b != geometry.end (); ++b) {
if (m_lef_importer.is_routing_layer (b->first)) {
routing_layers.push_back (b->first);
}
}
if (routing_layers.size () == 2) {
vd.m1 = routing_layers[0];
vd.m2 = routing_layers[1];
} else {
warn ("Can't determine routing layers for via: " + n);
}
}
test (";");
if (has_via_rule && top && cut && bottom) {

View File

@ -86,6 +86,22 @@ public:
*/
double layer_ext (const std::string &layer, double def_ext = 0.0) const;
/**
* @brief Returns true if the given layer is a routing layer
*/
bool is_routing_layer (const std::string &layer) const
{
return m_routing_layers.find (layer) != m_routing_layers.end ();
}
/**
* @brief Returns true if the given layer is a cut layer
*/
bool is_cut_layer (const std::string &layer) const
{
return m_cut_layers.find (layer) != m_cut_layers.end ();
}
/**
* @brief Gets a map of the vias defined in this LEF file
*

View File

@ -274,3 +274,8 @@ TEST(104)
{
run_test (_this, "doxy_vias", "def:test.def", "au.oas.gz", default_options (), false);
}
TEST(105)
{
run_test (_this, "specialnets_geo", "lef:test.lef+def:test.def", "au.oas.gz", default_options (), false);
}

Binary file not shown.

View File

@ -16,4 +16,13 @@ SPECIALNETS 1 ;
+ ROUTED M1 150 + SHAPE IOWIRE ( 40000 3600 ) VIA1_dummy DO 16000 BY 1 STEP 700 0
;
END SPECIALNETS
SCANCHAINS 77 ;
- chain1_clock1
+ PARTITION clock1
+ START block1/bsr_reg_0 Q
+ FLOATING
block1/pgm_cgm_en_reg_reg ( IN SD ) ( OUT QZ )
block1/start_reset_dd_reg ( IN SD ) ( OUT QZ )
+ STOP block1/start_reset_d_reg SD ;
END SCANCHAINS
END DESIGN

Binary file not shown.

View File

@ -0,0 +1,26 @@
VERSION 5.8 ;
DIVIDERCHAR "/" ;
BUSBITCHARS "[]" ;
DESIGN chip_top ;
UNITS DISTANCE MICRONS 1000 ;
DIEAREA ( 0 0 ) ( 300 300 ) ;
STYLES 2 ;
- STYLE 1 ( 30 10 ) ( 10 30 ) ( -10 30 ) ( -30 10 ) ( -30 -10 ) ( -10 -30 ) ( 10 -30 ) ( 30 -10 ) ;
END STYLES
VIAS 1 ;
- VIA1_dummy
+ RECT M1 ( -20 -15 ) ( 20 15 )
+ RECT VIA1 ( -10 -10 ) ( 10 10 )
+ RECT M2 ( -25 -25 ) ( 25 25 ) ;
END VIAS
SPECIALNETS 1 ;
- dummy
+ POLYGON M1 ( 300 0 ) ( 300 50 ) ( 350 50 ) ( 400 100 ) ( 400 0 )
+ POLYGON M2 ( 300 150 ) ( 300 200 ) ( 350 200 ) ( 400 250 ) ( 400 150 )
+ RECT M1 ( 0 0 ) ( 100 200 )
+ ROUTED M1 30 ( 0 0 15 ) ( 100 0 0 ) VIA1_dummy ( 100 100 10 )
+ ROUTED M2 50 + SHAPE RING + STYLE 1 ( 0 100 ) ( 100 200 ) ( 200 200 )
;
END SPECIALNETS
END DESIGN

View File

@ -0,0 +1,24 @@
VERSION 5.8 ;
BUSBITCHARS "[]" ;
DIVIDERCHAR "/" ;
UNITS
DATABASE MICRONS 1000 ;
END UNITS
MANUFACTURINGGRID 0.001 ;
LAYER M1
TYPE ROUTING ;
END M1
LAYER VIA1
TYPE CUT ;
END VIA1
LAYER M2
TYPE ROUTING ;
WIDTH 0.05 ;
END M2
END LIBRARY