3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-08-18 01:02:19 +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

@ -293,10 +293,10 @@ struct proc_dlatch_db_t
cell->setPort(ID::A, sig_any_valid_b);
if (GetSize(sig_new_s) == 1) {
cell->type = ID($mux);
cell = cell->module->morphCell(ID($mux), cell);
cell->unsetParam(ID::S_WIDTH);
} else {
cell->type = ID($pmux);
cell = cell->module->morphCell(ID($pmux), cell);
cell->setParam(ID::S_WIDTH, GetSize(sig_new_s));
}

View file

@ -262,7 +262,7 @@ void append_pmux(RTLIL::Module *mod, const RTLIL::SigSpec &signal, const std::ve
RTLIL::SigSpec ctrl_sig = gen_cmp(mod, signal, compare, sw, cs, ifxmode);
log_assert(ctrl_sig.size() == 1);
last_mux_cell->type = ID($pmux);
last_mux_cell = last_mux_cell->module->morphCell(ID($pmux), last_mux_cell);
RTLIL::SigSpec new_s = last_mux_cell->getPort(ID::S);
new_s.append(ctrl_sig);