mirror of
https://github.com/YosysHQ/yosys
synced 2025-10-08 08:51:56 +00:00
Merge pull request #5410 from jix/abc_new-fix-zbuf-churn
abc_new: Avoid bufnorm helper cell churn
This commit is contained in:
commit
35bade56da
3 changed files with 9 additions and 6 deletions
|
@ -125,7 +125,7 @@ struct PortarcsPass : Pass {
|
||||||
|
|
||||||
for (auto cell : m->cells())
|
for (auto cell : m->cells())
|
||||||
// Ignore all bufnorm helper cells
|
// Ignore all bufnorm helper cells
|
||||||
if (!cell->type.in(ID($buf), ID($input_port), ID($connect))) {
|
if (!cell->type.in(ID($buf), ID($input_port), ID($connect), ID($tribuf))) {
|
||||||
auto tdata = tinfo.find(cell->type);
|
auto tdata = tinfo.find(cell->type);
|
||||||
if (tdata == tinfo.end())
|
if (tdata == tinfo.end())
|
||||||
log_cmd_error("Missing timing data for module '%s'.\n", log_id(cell->type));
|
log_cmd_error("Missing timing data for module '%s'.\n", log_id(cell->type));
|
||||||
|
|
|
@ -1605,6 +1605,7 @@ static void replace_zbufs(Design *design)
|
||||||
|
|
||||||
mod->bufNormalize();
|
mod->bufNormalize();
|
||||||
}
|
}
|
||||||
|
design->bufNormalize(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1624,7 +1625,6 @@ static void restore_zbufs(Design *design)
|
||||||
mod->addBuf(NEW_ID, Const(State::Sz, GetSize(sig_y)), sig_y);
|
mod->addBuf(NEW_ID, Const(State::Sz, GetSize(sig_y)), sig_y);
|
||||||
mod->remove(cell);
|
mod->remove(cell);
|
||||||
}
|
}
|
||||||
mod->bufNormalize();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -141,7 +141,11 @@ struct AbcNewPass : public ScriptPass {
|
||||||
selected_modules = order_modules(active_design,
|
selected_modules = order_modules(active_design,
|
||||||
active_design->selected_whole_modules_warn());
|
active_design->selected_whole_modules_warn());
|
||||||
active_design->push_empty_selection();
|
active_design->push_empty_selection();
|
||||||
} else {
|
}
|
||||||
|
|
||||||
|
run("abc9_ops -replace_zbufs");
|
||||||
|
|
||||||
|
if (help_mode) {
|
||||||
selected_modules = {nullptr};
|
selected_modules = {nullptr};
|
||||||
run("foreach module in selection");
|
run("foreach module in selection");
|
||||||
}
|
}
|
||||||
|
@ -169,13 +173,10 @@ struct AbcNewPass : public ScriptPass {
|
||||||
}
|
}
|
||||||
|
|
||||||
run(stringf(" abc9_ops -write_box %s/input.box", tmpdir));
|
run(stringf(" abc9_ops -write_box %s/input.box", tmpdir));
|
||||||
run(" abc9_ops -replace_zbufs");
|
|
||||||
run(stringf(" write_xaiger2 -mapping_prep -map2 %s/input.map2 %s/input.xaig", tmpdir, tmpdir));
|
run(stringf(" write_xaiger2 -mapping_prep -map2 %s/input.map2 %s/input.xaig", tmpdir, tmpdir));
|
||||||
run(stringf(" abc9_exe %s -cwd %s -box %s/input.box", exe_options, tmpdir, tmpdir));
|
run(stringf(" abc9_exe %s -cwd %s -box %s/input.box", exe_options, tmpdir, tmpdir));
|
||||||
run(stringf(" read_xaiger2 -sc_mapping -module_name %s -map2 %s/input.map2 %s/output.aig",
|
run(stringf(" read_xaiger2 -sc_mapping -module_name %s -map2 %s/input.map2 %s/output.aig",
|
||||||
modname.c_str(), tmpdir.c_str(), tmpdir.c_str()));
|
modname.c_str(), tmpdir.c_str(), tmpdir.c_str()));
|
||||||
run(" abc9_ops -restore_zbufs");
|
|
||||||
|
|
||||||
if (!help_mode && mod->has_attribute(ID(abc9_script))) {
|
if (!help_mode && mod->has_attribute(ID(abc9_script))) {
|
||||||
if (script_save.empty())
|
if (script_save.empty())
|
||||||
active_design->scratchpad_unset("abc9.script");
|
active_design->scratchpad_unset("abc9.script");
|
||||||
|
@ -196,6 +197,8 @@ struct AbcNewPass : public ScriptPass {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
run("abc9_ops -restore_zbufs");
|
||||||
|
|
||||||
if (!help_mode) {
|
if (!help_mode) {
|
||||||
active_design->pop_selection();
|
active_design->pop_selection();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue