From 23ec53e1b20ad48006a9d152c628f8238b6c6448 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 2 Aug 2020 12:01:28 +0200 Subject: [PATCH] Abbreviated LEF/DEF layer names for map files. --- .../lefdef/db_plugin/dbLEFDEFImporter.cc | 32 +++++++++++++----- .../oasis/db_plugin/dbOASISWriter.cc | 2 +- testdata/lefdef/mapfile/au.oas.gz | Bin 508 -> 1091 bytes 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFImporter.cc b/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFImporter.cc index 669ed3baa..56b5fcf3a 100644 --- a/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFImporter.cc +++ b/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFImporter.cc @@ -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; diff --git a/src/plugins/streamers/oasis/db_plugin/dbOASISWriter.cc b/src/plugins/streamers/oasis/db_plugin/dbOASISWriter.cc index 7791b9e98..a3e5b8c21 100644 --- a/src/plugins/streamers/oasis/db_plugin/dbOASISWriter.cc +++ b/src/plugins/streamers/oasis/db_plugin/dbOASISWriter.cc @@ -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); } diff --git a/testdata/lefdef/mapfile/au.oas.gz b/testdata/lefdef/mapfile/au.oas.gz index 629c7144bc827d1420891ebf3db05ad7bec45729..d0ee614aea2d2210123b3fc51fdfea624971a6e1 100644 GIT binary patch literal 1091 zcmd^-KX21O6u|F%ah%+p8%4cXYUG6h0RwK5iG{(bFTuk9lyl3U#fs`8AyENE43Gt> zD@!L04`fLna;{oc>_-r3ic4E@`&t9)frO!`g_%?-4= z>`qr@q5CjX{y36e=0~X<%SraY_tJZfnr+%8-jCK5*d3~}G)}TT83f!op1yeU^x2WI zrLwW7vSbn`a*{r3){m!$C(rv$a^QJQ0`;WI5PIOd*{heYrzb~bsq6T$zNlnIyq^Ys zBuP#XUk#WQ_LA5MNoxE`R5;Kj zIC|k!`@#v_p$ve~!ub;w4zvbDE1YW2ns83pH6X;VhD!>=0L4pMg^Yna4C1}}?pOl< zfcak;Cc?p*TiJr6HWFsRK)p2i&KV7)V{>x zj4(uvM9gwD`a;HE$@UC!+WDl3H~eOP_l$@;=lB*9Z*hrDt$l&##@uLMECl-oYTyaT?9SNY0W+&HBN7@9_DkNq23#Ns*^) z*R|4DFJI3O_vuBKUdC1OSj|bUg*%Do29jnJMA`67e;9>*PfjB@7~n0O#DiQ0G8x2C ze#QBeVQgiR*Zol+Jr$ISlI9K61&OXEDz3=nc|lcC(nZFzCelO4M8y>u+yJ#AN}4xw zs@M}Ph^oEp;`(Tbs9Mg^PP}mYzU4?Pd?4bl3cv1;uY3<{_}~>ezKLS^2Z^OBO?mze zRwav>qbo`MV&+Pu4#qbILf4HWp&CaVbkaTthos?^;fn*RVypzXTPn yUJuB}`UyE_MOEqktZmc@$uU@R>kA^-c-k2&M0rm#P~QE|2jDl8kqyDK1ONa$2?68)