3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-28 19:35:53 +00:00

add morphCell instead of type assignments, test_cell passes for all cells

This commit is contained in:
Emil J. Tywoniak 2024-06-20 23:41:09 +02:00
parent d2107a9ee4
commit 1be8f8023a
33 changed files with 129 additions and 99 deletions

View file

@ -46,7 +46,7 @@ static RTLIL::IdString formal_flavor(RTLIL::Cell *cell)
static void set_formal_flavor(RTLIL::Cell *cell, RTLIL::IdString flavor)
{
if (cell->type != ID($check)) {
cell->type = flavor;
cell = cell->module->morphCell(flavor, cell);
return;
}
@ -423,7 +423,7 @@ struct ChformalPass : public Pass {
if (cell->getPort(ID::ARGS).empty()) {
module->remove(cell);
} else {
cell->type = ID($print);
cell = cell->module->morphCell(ID($print), cell);
cell->setPort(ID::EN, combined_en);
cell->unsetPort(ID::A);
cell->unsetParam(ID(FLAVOR));

View file

@ -70,12 +70,12 @@ struct ChtypePass : public Pass {
for (auto cell : module->selected_cells())
{
if (map_types.count(cell->type)) {
cell->type = map_types.at(cell->type);
cell = cell->module->morphCell(map_types.at(cell->type), cell);
continue;
}
if (set_type != IdString()) {
cell->type = set_type;
cell = cell->module->morphCell(set_type, cell);
continue;
}
}

View file

@ -318,7 +318,7 @@ struct DesignPass : public Pass {
done[cell->type] = trg_name;
}
cell->type = done.at(cell->type);
cell = cell->module->morphCell(done.at(cell->type), cell);
}
}
}

View file

@ -109,7 +109,7 @@ struct DftTagWorker {
module->remove(cell);
}
for (auto cell : original_cells) {
cell->type = ID($get_tag);
cell = cell->module->morphCell(ID($get_tag), cell);
}
if (design_changed)

View file

@ -220,7 +220,7 @@ struct SetparamPass : public Pass {
{
for (auto cell : module->selected_cells()) {
if (!new_cell_type.empty())
cell->type = new_cell_type;
cell = cell->module->morphCell(new_cell_type, cell);
do_setunset(cell->parameters, setunset_list);
}
}