3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-06-23 06:13:41 +00:00

Revert "Refactor full_selection"

This commit is contained in:
Miodrag Milanović 2025-04-07 12:11:55 +02:00 committed by GitHub
parent 98d4355b82
commit d49364d96f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
38 changed files with 270 additions and 707 deletions

View file

@ -306,10 +306,9 @@ struct Abc9Pass : public ScriptPass
}
run("design -stash $abc9");
run("design -load $abc9_map");
if (help_mode) run("select =*");
else active_design->push_complete_selection();
run("proc");
run("wbflip");
run("techmap -autoproc -wb -map %$abc9 -map +/techmap.v A:abc9_flop");
run("techmap -wb -map %$abc9 -map +/techmap.v A:abc9_flop");
run("opt -nodffe -nosdff");
if (dff_mode || help_mode) {
if (!help_mode)
@ -370,8 +369,6 @@ struct Abc9Pass : public ScriptPass
if (saved_designs.count("$abc9_holes") || help_mode) {
run("design -stash $abc9");
run("design -load $abc9_holes");
if (help_mode) run("select =*");
else active_design->push_complete_selection();
run("techmap -wb -map %$abc9 -map +/techmap.v");
run("opt -purge");
run("aigmap");
@ -394,7 +391,7 @@ struct Abc9Pass : public ScriptPass
}
else {
auto selected_modules = active_design->selected_modules();
active_design->push_empty_selection();
active_design->selection_stack.emplace_back(false);
for (auto mod : selected_modules) {
if (mod->processes.size() > 0) {
@ -403,9 +400,8 @@ struct Abc9Pass : public ScriptPass
}
log_push();
active_design->select(mod);
active_design->selection().select(mod);
// this check does nothing because the above line adds the whole module to the selection
if (!active_design->selected_whole_module(mod))
log_error("Can't handle partially selected module %s!\n", log_id(mod));
@ -456,7 +452,7 @@ struct Abc9Pass : public ScriptPass
log_pop();
}
active_design->pop_selection();
active_design->selection_stack.pop_back();
}
}

View file

@ -454,7 +454,7 @@ void prep_bypass(RTLIL::Design *design)
void prep_dff(RTLIL::Design *design)
{
auto r = design->selection_vars.insert(std::make_pair(ID($abc9_flops), RTLIL::Selection::EmptySelection(design)));
auto r = design->selection_vars.insert(std::make_pair(ID($abc9_flops), RTLIL::Selection(false)));
auto &modules_sel = r.first->second;
for (auto module : design->selected_modules())

View file

@ -139,7 +139,7 @@ struct AbcNewPass : public ScriptPass {
if (!help_mode) {
selected_modules = order_modules(active_design,
active_design->selected_whole_modules_warn());
active_design->push_empty_selection();
active_design->selection_stack.emplace_back(false);
} else {
selected_modules = {nullptr};
run("foreach module in selection");
@ -157,7 +157,7 @@ struct AbcNewPass : public ScriptPass {
exe_options = abc_exe_options;
log_header(active_design, "Mapping module '%s'.\n", log_id(mod));
log_push();
active_design->select(mod);
active_design->selection().select(mod);
}
std::string script_save;
@ -194,7 +194,7 @@ struct AbcNewPass : public ScriptPass {
}
if (!help_mode) {
active_design->pop_selection();
active_design->selection_stack.pop_back();
}
}
}

View file

@ -171,7 +171,8 @@ struct AigmapPass : public Pass {
module->remove(cell);
if (select_mode) {
RTLIL::Selection& sel = design->selection();
log_assert(!design->selection_stack.empty());
RTLIL::Selection& sel = design->selection_stack.back();
sel.selected_members[module->name] = std::move(new_sel);
}

View file

@ -333,7 +333,7 @@ struct ClockgatePass : public Pass {
dict<ClkNetInfo, GClkNetInfo> clk_nets;
int gated_flop_count = 0;
for (auto module : design->selected_unboxed_whole_modules()) {
for (auto module : design->selected_whole_modules()) {
for (auto cell : module->cells()) {
if (!RTLIL::builtin_ff_cell_types().count(cell->type))
continue;

View file

@ -42,7 +42,7 @@ struct NlutmapWorker
RTLIL::Selection get_selection()
{
auto sel = RTLIL::Selection::EmptySelection(module->design);
RTLIL::Selection sel(false);
for (auto cell : module->cells())
if (!mapped_cells.count(cell))
sel.select(module, cell);