3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-07-15 03:35:40 +00:00

Patch: route staged cell names through per-Patch dict

This commit is contained in:
Emil J. Tywoniak 2026-06-05 16:45:50 +02:00
parent 0f31d3089e
commit cfd7edc608
2 changed files with 6 additions and 2 deletions

View file

@ -14,9 +14,9 @@ Cell* Patch::addCell(IdString name, IdString type) {
cells_.push_back(std::make_unique<Cell>(Cell::ConstructToken{}));
Cell* cell = cells_.back().get();
cell->name = name;
cell->type = type;
cell->module = nullptr;
staged_cell_names_[cell] = name;
return cell;
}
@ -55,8 +55,11 @@ Wire* Patch::commit_wire(std::unique_ptr<Wire> wire) {
Cell* Patch::commit_cell(std::unique_ptr<Cell> cell) {
Cell* raw = cell.release();
mod->cells_[raw->name] = raw;
IdString name = staged_cell_names_.at(raw);
staged_cell_names_.erase(raw);
raw->name = name;
raw->module = mod;
mod->cells_[name] = raw;
raw->initIndex();
return raw;
}

View file

@ -26,6 +26,7 @@ public:
SigMap* map;
vector<std::unique_ptr<Wire>> wires_ = {};
vector<std::unique_ptr<Cell>> cells_ = {};
dict<RTLIL::Cell*, RTLIL::IdString> staged_cell_names_;
void connect(const RTLIL::SigSig &conn);
void connect(const RTLIL::SigSpec &lhs, const RTLIL::SigSpec &rhs);