diff --git a/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFImporter.h b/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFImporter.h index ec1da4076..078361d33 100644 --- a/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFImporter.h +++ b/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFImporter.h @@ -775,7 +775,7 @@ public: } /** - * @brief Specify the LEF macro resolution strategy + * @brief Specify the LEF macro resolution strategy when reading DEF files * Values are: * 0: propduce LEF geometry unless a FOREIGN cell is specified (default) * 1: produce LEF geometry always and ignore FOREIGN diff --git a/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFPlugin.cc b/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFPlugin.cc index c874ab814..470e87d19 100644 --- a/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFPlugin.cc +++ b/src/plugins/streamers/lefdef/db_plugin/dbLEFDEFPlugin.cc @@ -113,22 +113,25 @@ private: const db::LayerMap &read_lefdef (db::Layout &layout, const db::LoadLayoutOptions &options, bool import_lef) { const db::LEFDEFReaderOptions *lefdef_options = dynamic_cast (options.get_options (format ())); - static db::LEFDEFReaderOptions default_options; - if (! lefdef_options) { - lefdef_options = &default_options; + db::LEFDEFReaderOptions effective_options; + if (lefdef_options) { + effective_options = *lefdef_options; } - db::LEFDEFReaderState state (lefdef_options, layout, tl::dirname (m_stream.absolute_path ())); + db::LEFDEFReaderState state (&effective_options, layout, tl::dirname (m_stream.absolute_path ())); - layout.dbu (lefdef_options->dbu ()); + layout.dbu (effective_options.dbu ()); if (import_lef) { + // Always produce LEF geometry when reading LEF + effective_options.set_macro_resolution_mode (1); + tl::SelfTimer timer (tl::verbosity () >= 21, tl::to_string (tr ("Reading LEF file"))); db::LEFImporter importer; - for (std::vector::const_iterator l = lefdef_options->begin_lef_files (); l != lefdef_options->end_lef_files (); ++l) { + for (std::vector::const_iterator l = effective_options.begin_lef_files (); l != effective_options.end_lef_files (); ++l) { std::string lp = correct_path (*l, layout, tl::dirname (m_stream.absolute_path ())); @@ -149,7 +152,7 @@ private: DEFImporter importer; - for (std::vector::const_iterator l = lefdef_options->begin_lef_files (); l != lefdef_options->end_lef_files (); ++l) { + for (std::vector::const_iterator l = effective_options.begin_lef_files (); l != effective_options.end_lef_files (); ++l) { std::string lp = correct_path (*l, layout, tl::dirname (m_stream.absolute_path ())); @@ -163,7 +166,7 @@ private: // Additionally read all LEF files next to the DEF file - if (lefdef_options->read_lef_with_def ()) { + if (effective_options.read_lef_with_def ()) { std::string input_dir = tl::absolute_path (m_stream.absolute_path ()); @@ -198,7 +201,7 @@ private: std::map foreign_cells = state.foreign_cells (); db::cell_index_type seen = std::numeric_limits::max (); - std::vector macro_layouts = lefdef_options->macro_layouts (); + std::vector macro_layouts = effective_options.macro_layouts (); for (std::vector::const_iterator m = macro_layouts.begin (); m != macro_layouts.end (); ++m) { std::vector target_cells, source_cells; diff --git a/src/plugins/streamers/lefdef/db_plugin/gsiDeclDbLEFDEF.cc b/src/plugins/streamers/lefdef/db_plugin/gsiDeclDbLEFDEF.cc index b86a4fd21..2643028f6 100644 --- a/src/plugins/streamers/lefdef/db_plugin/gsiDeclDbLEFDEF.cc +++ b/src/plugins/streamers/lefdef/db_plugin/gsiDeclDbLEFDEF.cc @@ -770,8 +770,8 @@ gsi::Class decl_lefdef_config ("db", "LEFDEFReaderConfi "This property has been added in version 0.27.\n" ) + gsi::method ("macro_resolution_mode", &db::LEFDEFReaderOptions::macro_resolution_mode, - "@brief Gets the macro resolution mode.\n" - "This property describes the way LEF macros are turned into GDS cells. There " + "@brief Gets the macro resolution mode (LEF macros into DEF).\n" + "This property describes the way LEF macros are turned into layout cells when reading DEF. There " "are three modes available:\n" "\n" "@ul\n" @@ -786,7 +786,7 @@ gsi::Class decl_lefdef_config ("db", "LEFDEFReaderConfi "This property has been added in version 0.27.\n" ) + gsi::method ("macro_resolution_mode=", &db::LEFDEFReaderOptions::set_macro_resolution_mode, gsi::arg ("mode"), - "@brief Sets the macro resolution mode.\n" + "@brief Sets the macro resolution mode (LEF macros into DEF).\n" "See \\macro_resolution_mode for details about this property.\n" "\n" "This property has been added in version 0.27.\n" diff --git a/src/plugins/streamers/lefdef/lay_plugin/LEFDEFTechnologyComponentEditor.ui b/src/plugins/streamers/lefdef/lay_plugin/LEFDEFTechnologyComponentEditor.ui index 18825ffa5..73212cb25 100644 --- a/src/plugins/streamers/lefdef/lay_plugin/LEFDEFTechnologyComponentEditor.ui +++ b/src/plugins/streamers/lefdef/lay_plugin/LEFDEFTechnologyComponentEditor.ui @@ -294,7 +294,7 @@ - LEF import + LEF import into DEF @@ -708,6 +708,8 @@ If a layer map file is given, pattern based rules are ignored. If used inside a technology, the file will be looked up relative to the technology's base path. +Otherwise it's looked up relative to the LEF or DEF file. + (2*) Die area, Blockage and Region layers in map file will have priority over global production rules above. diff --git a/testdata/lefdef/density/.in.lef.swp b/testdata/lefdef/density/.in.lef.swp deleted file mode 100644 index b3c13c94d..000000000 Binary files a/testdata/lefdef/density/.in.lef.swp and /dev/null differ diff --git a/testdata/lefdef/density/in.lef b/testdata/lefdef/density/in.lef index 889d5763d..abc0ccbf6 100644 --- a/testdata/lefdef/density/in.lef +++ b/testdata/lefdef/density/in.lef @@ -8,6 +8,7 @@ END VIA1 MACRO dense CLASS CORE ; ORIGIN 0.0 0.0 ; + FOREIGN dense ; SIZE 0.7 BY 0.9 ; OBS LAYER M1 DESIGNRULEWIDTH 0.05 ;