LEF/DEF reader: Macro resolution mode is only effective now when reading DEF. Not when reading LEF.

This commit is contained in:
Matthias Koefferlein 2020-12-14 22:46:07 +01:00
parent 85311d414c
commit b5c0193a0a
6 changed files with 20 additions and 14 deletions

View File

@ -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

View File

@ -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<const db::LEFDEFReaderOptions *> (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<std::string>::const_iterator l = lefdef_options->begin_lef_files (); l != lefdef_options->end_lef_files (); ++l) {
for (std::vector<std::string>::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<std::string>::const_iterator l = lefdef_options->begin_lef_files (); l != lefdef_options->end_lef_files (); ++l) {
for (std::vector<std::string>::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<std::string, db::cell_index_type> foreign_cells = state.foreign_cells ();
db::cell_index_type seen = std::numeric_limits<db::cell_index_type>::max ();
std::vector<db::Layout *> macro_layouts = lefdef_options->macro_layouts ();
std::vector<db::Layout *> macro_layouts = effective_options.macro_layouts ();
for (std::vector<db::Layout *>::const_iterator m = macro_layouts.begin (); m != macro_layouts.end (); ++m) {
std::vector<db::cell_index_type> target_cells, source_cells;

View File

@ -770,8 +770,8 @@ gsi::Class<db::LEFDEFReaderOptions> 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<db::LEFDEFReaderOptions> 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"

View File

@ -294,7 +294,7 @@
<item row="1" column="4">
<widget class="QLabel" name="label">
<property name="text">
<string>LEF import</string>
<string>LEF import into DEF</string>
</property>
</widget>
</item>
@ -708,6 +708,8 @@
<property name="text">
<string>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.</string>
</property>
<property name="wordWrap">

Binary file not shown.

View File

@ -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 ;