mirror of
https://github.com/KLayout/klayout.git
synced 2026-09-03 06:43:29 +02:00
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:
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
*
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user