DEF reader patched: after via continue with the new metal layer with the width given by the rule.

This commit is contained in:
Matthias Koefferlein 2020-03-29 21:52:51 +02:00
parent ee3ee5bd8e
commit 8796b65ddb
2 changed files with 29 additions and 19 deletions

View File

@ -136,6 +136,25 @@ struct Group
std::vector<tl::GlobPattern> comp_match;
};
db::Coord
DEFImporter::get_wire_width_for_rule (const std::string &rulename, const std::string &ln, double dbu)
{
double w = db::coord_traits<db::Coord>::rounded (m_lef_importer.layer_width (ln, rulename, 0.0) / dbu);
// try to find local nondefault rule
if (! rulename.empty ()) {
std::map<std::string, std::map<std::string, double> >::const_iterator nd = m_nondefault_widths.find (rulename);
if (nd != m_nondefault_widths.end ()) {
std::map<std::string, double>::const_iterator ld = nd->second.find (ln);
if (ld != nd->second.end ()) {
w = ld->second;
}
}
}
return w;
}
void
DEFImporter::do_read (db::Layout &layout)
{
@ -521,29 +540,14 @@ DEFImporter::do_read (db::Layout &layout)
}
if (! specialnets) {
if (! rulename) {
rulename = &nondefaultrule;
}
w = db::coord_traits<db::Coord>::rounded (m_lef_importer.layer_width (ln, *rulename, 0.0) / layout.dbu ());
// try to find local nondefault rule
if (! rulename->empty ()) {
std::map<std::string, std::map<std::string, double> >::const_iterator nd = m_nondefault_widths.find (*rulename);
if (nd != m_nondefault_widths.end ()) {
std::map<std::string, double>::const_iterator ld = nd->second.find (ln);
if (ld != nd->second.end ()) {
w = ld->second;
}
}
}
if (! rulename) {
rulename = &nondefaultrule;
}
db::Coord def_ext = 0;
if (! specialnets) {
w = get_wire_width_for_rule (*rulename, ln, layout.dbu ());
def_ext = db::coord_traits<db::Coord>::rounded (m_lef_importer.layer_ext (ln, w * 0.5 * layout.dbu ()) / layout.dbu ());
}
@ -733,6 +737,11 @@ DEFImporter::do_read (db::Layout &layout)
}
}
if (! specialnets) {
w = get_wire_width_for_rule (*rulename, ln, layout.dbu ());
def_ext = db::coord_traits<db::Coord>::rounded (m_lef_importer.layer_ext (ln, w * 0.5 * layout.dbu ()) / layout.dbu ());
}
// continue a segment with the current point and the new layer
if (pts.size () > 1) {
pts.erase (pts.begin (), pts.end () - 1);

View File

@ -66,6 +66,7 @@ private:
db::FTrans get_orient (bool optional);
void read_polygon (db::Polygon &poly, double scale);
void read_rect (db::Polygon &poly, double scale);
db::Coord get_wire_width_for_rule(const std::string &rule, const std::string &ln, double dbu);
};
}