mirror of
https://github.com/YosysHQ/yosys
synced 2025-09-30 05:09:04 +00:00
Merge pull request #5357 from rocallahan/builtin-ff
Instead of using `builtin_ff_cell_types()` directly, go through a method `Cell::is_builtin_ff()`
This commit is contained in:
commit
73e47ac3fe
32 changed files with 61 additions and 51 deletions
|
@ -206,7 +206,7 @@ void rmunused_module_cells(Module *module, bool verbose)
|
|||
if (verbose)
|
||||
log_debug(" removing unused `%s' cell `%s'.\n", cell->type.c_str(), cell->name.c_str());
|
||||
module->design->scratchpad_set_bool("opt.did_something", true);
|
||||
if (RTLIL::builtin_ff_cell_types().count(cell->type))
|
||||
if (cell->is_builtin_ff())
|
||||
ffinit.remove_init(cell->getPort(ID::Q));
|
||||
module->remove(cell);
|
||||
count_rm_cells++;
|
||||
|
|
|
@ -89,7 +89,7 @@ struct OptDffWorker
|
|||
}
|
||||
}
|
||||
|
||||
if (module->design->selected(module, cell) && RTLIL::builtin_ff_cell_types().count(cell->type))
|
||||
if (module->design->selected(module, cell) && cell->is_builtin_ff())
|
||||
dff_cells.push_back(cell);
|
||||
}
|
||||
|
||||
|
@ -802,7 +802,7 @@ struct OptDffWorker
|
|||
|
||||
bool did_something = false;
|
||||
for (auto cell : module->selected_cells()) {
|
||||
if (!RTLIL::builtin_ff_cell_types().count(cell->type))
|
||||
if (!cell->is_builtin_ff())
|
||||
continue;
|
||||
FfData ff(&initvals, cell);
|
||||
|
||||
|
|
|
@ -209,7 +209,7 @@ struct OptFfInvWorker
|
|||
std::vector<Cell *> ffs;
|
||||
|
||||
for (Cell *cell : module->selected_cells())
|
||||
if (RTLIL::builtin_ff_cell_types().count(cell->type))
|
||||
if (cell->is_builtin_ff())
|
||||
ffs.push_back(cell);
|
||||
|
||||
for (Cell *cell : ffs) {
|
||||
|
|
|
@ -110,7 +110,7 @@ struct OptMergeWorker
|
|||
comm.eat(hash_ops<std::pair<IdString, SigSpec>>::hash(port, assign_map(sig)));
|
||||
}
|
||||
h = comm.hash_into(h);
|
||||
if (RTLIL::builtin_ff_cell_types().count(cell->type))
|
||||
if (cell->is_builtin_ff())
|
||||
h = initvals(cell->getPort(ID::Q)).hash_into(h);
|
||||
}
|
||||
return h;
|
||||
|
@ -153,7 +153,7 @@ struct OptMergeWorker
|
|||
|
||||
for (const auto &it : cell1->connections_) {
|
||||
if (cell1->output(it.first)) {
|
||||
if (it.first == ID::Q && RTLIL::builtin_ff_cell_types().count(cell1->type)) {
|
||||
if (it.first == ID::Q && cell1->is_builtin_ff()) {
|
||||
// For the 'Q' output of state elements,
|
||||
// use the (* init *) attribute value
|
||||
conn1[it.first] = initvals(it.second);
|
||||
|
@ -201,7 +201,7 @@ struct OptMergeWorker
|
|||
|
||||
bool has_dont_care_initval(const RTLIL::Cell *cell)
|
||||
{
|
||||
if (!RTLIL::builtin_ff_cell_types().count(cell->type))
|
||||
if (!cell->is_builtin_ff())
|
||||
return false;
|
||||
|
||||
return !initvals(cell->getPort(ID::Q)).is_fully_def();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue