From dc0f549ab4676ac0ec458c3619c54a91667276b1 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Mon, 14 Oct 2024 23:41:55 +0200 Subject: [PATCH] Embedding fix for issue #1892 which is closely related to #1877 --- .../lefdef/db_plugin/dbLEFDEFImporter.cc | 23 +++++++++++-------- .../lefdef/db_plugin/dbLEFDEFImporter.h | 14 +++++++++-- 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFImporter.cc b/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFImporter.cc index 75864f591..a8dac54e5 100644 --- a/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFImporter.cc +++ b/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFImporter.cc @@ -225,6 +225,9 @@ RuleBasedViaGenerator::create_cell (LEFDEFReaderState &reader, Layout &layout, d // special rounding to ensure the dimensions are correct for non-even width or height (issue #1877) db::Vector vs ((m_cutsize.x () * m_columns + m_cutspacing.x () * (m_columns - 1)), (m_cutsize.y () * m_rows + m_cutspacing.y () * (m_rows - 1))); + if (vs.x () % 2 != 0 || vs.y () % 2 != 0) { + reader.warn (tl::sprintf (tl::to_string (tr ("Via has odd width or height (x,y dimension of cut array is %s database units) - this may lead to inaccurate positioning of the via")), vs.to_string ())); + } db::Point via_ll = m_offset - db::Vector (vs.x () / 2, vs.y () / 2); db::Box via_box (via_ll, via_ll + vs); @@ -977,7 +980,7 @@ LEFDEFReaderState::~LEFDEFReaderState () } void -LEFDEFReaderState::common_reader_error (const std::string &msg) +LEFDEFReaderState::error (const std::string &msg) { if (mp_importer) { mp_importer->error (msg); @@ -985,7 +988,7 @@ LEFDEFReaderState::common_reader_error (const std::string &msg) } void -LEFDEFReaderState::common_reader_warn (const std::string &msg, int warn_level) +LEFDEFReaderState::warn (const std::string &msg, int warn_level) { if (mp_importer) { mp_importer->warn (msg, warn_level); @@ -1119,7 +1122,7 @@ LEFDEFReaderState::read_single_map_file (const std::string &path, std::map::const_iterator l = layers.begin (); l != layers.end (); ++l) { @@ -1178,7 +1181,7 @@ LEFDEFReaderState::read_single_map_file (const std::string &path, std::mapsecond == ViaGeometry) { @@ -1286,7 +1289,7 @@ LEFDEFReaderState::read_single_map_file (const std::string &path, std::mapsecond == All) { @@ -1381,7 +1384,7 @@ LEFDEFReaderState::open_layer (db::Layout &layout, const std::string &n, LayerPu msg += tl::to_string (tr (" Via size ")) + via_size.to_string (); } #endif - common_reader_warn (msg + tl::to_string (tr (" - layer is ignored"))); + warn (msg + tl::to_string (tr (" - layer is ignored"))); } return ll; diff --git a/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFImporter.h b/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFImporter.h index 647e3afd2..9720d6edf 100644 --- a/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFImporter.h +++ b/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFImporter.h @@ -1354,9 +1354,19 @@ class DB_PLUGIN_PUBLIC LEFDEFReaderState return m_foreign_cells; } + /** + * @brief Issues an error + */ + void error (const std::string &msg); + + /** + * @brief Issues a warning + */ + void warn (const std::string &msg, int warn_level = 1); + protected: - virtual void common_reader_error (const std::string &msg); - virtual void common_reader_warn (const std::string &msg, int warn_level = 1); + virtual void common_reader_error (const std::string &msg) { error (msg); } + virtual void common_reader_warn (const std::string &msg, int warn_level) { warn (msg, warn_level); } private: /**