Abbreviated LEF/DEF layer names for map files.

This commit is contained in:
Matthias Koefferlein 2020-08-02 12:01:28 +02:00
parent 84573a21ce
commit 23ec53e1b2
3 changed files with 25 additions and 9 deletions

View File

@ -730,6 +730,8 @@ LEFDEFReaderState::read_map_file (const std::string &path, db::Layout &layout)
std::string w1, w2;
int layer = 0, datatype = 0;
size_t max_purpose_str = 10;
bool purpose_abbreviated = false;
if (ex.try_read_word (w1) && ex.try_read_word (w2, "._$,/:") && ex.try_read (layer) && ex.try_read (datatype)) {
@ -798,18 +800,32 @@ LEFDEFReaderState::read_map_file (const std::string &path, db::Layout &layout)
translated_purposes.insert (std::make_pair (i->second, mask));
if (! purpose_str.empty ()) {
purpose_str += "/";
if (! purpose_abbreviated) {
if (! purpose_str.empty ()) {
purpose_str += "/";
}
if (purpose_str.size () > max_purpose_str) {
purpose_abbreviated = true;
purpose_str += "...";
} else {
purpose_str += i->first;
if (mask > 0) {
purpose_str += ":";
purpose_str += tl::to_string (mask);
}
}
}
purpose_str += i->first;
}
if (mask > 0) {
purpose_str += ":";
purpose_str += tl::to_string (mask);
}
}
std::string final_name = w1 + "." + purpose_str;

View File

@ -2754,7 +2754,7 @@ OASISWriter::write (const db::Path &path, db::properties_id_type prop_id, const
if (hw * 2 != w) {
std::string msg = tl::to_string (tr ("Paths with odd width cannot be written to OASIS files (cell ")) + mp_layout->cell_name (mp_cell->cell_index ()) + tl::to_string (tr (", position ")) + tl::to_string (start.x ()) + ", " + tl::to_string (start.y ()) + " DBU)";
if (m_options.permissive) {
tl::warn << msg << " - " << tl::to_string (tr ("path diameter is rounded"));
tl::warn << msg << " - " << tl::sprintf (tl::to_string (tr ("path width is rounded from %d to %d DBU")), w, hw * 2);
} else {
throw tl::Exception (msg);
}

Binary file not shown.