mirror of https://github.com/YosysHQ/yosys.git
abc9_ops -prep_box: Adjust for repeated invocation
`abc9_ops -prep_box` command interprets the `abc9_box` attribute and prepares a .box file for ABC consumption. Previously this command was removing the attribute as it was processing each module which prevented repeated invocation of this command unless the box definitions were refreshed from a source file. Also the command was keeping existing `abc9_box_id` attributes instead of overwriting them with values from a new number sequence. Change both behaviors to allow repeated invocations of the command on the same design.
This commit is contained in:
parent
66734f522d
commit
481d596c43
|
@ -969,13 +969,10 @@ void prep_box(RTLIL::Design *design)
|
||||||
if (it == module->attributes.end())
|
if (it == module->attributes.end())
|
||||||
continue;
|
continue;
|
||||||
bool box = it->second.as_bool();
|
bool box = it->second.as_bool();
|
||||||
module->attributes.erase(it);
|
|
||||||
if (!box)
|
if (!box)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
auto r = module->attributes.insert(ID::abc9_box_id);
|
auto r = module->attributes.insert(ID::abc9_box_id);
|
||||||
if (!r.second)
|
|
||||||
continue;
|
|
||||||
r.first->second = abc9_box_id++;
|
r.first->second = abc9_box_id++;
|
||||||
|
|
||||||
if (module->get_bool_attribute(ID::abc9_flop)) {
|
if (module->get_bool_attribute(ID::abc9_flop)) {
|
||||||
|
|
Loading…
Reference in New Issue