3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-24 01:25:33 +00:00

fix swapped conns, params in interators

This commit is contained in:
Emil J. Tywoniak 2024-06-18 16:16:34 +02:00
parent 43d8c7f352
commit b190055bbb
2 changed files with 10 additions and 11 deletions

View file

@ -2446,7 +2446,7 @@ RTLIL::Cell *RTLIL::Module::addCell(RTLIL::IdString name, RTLIL::IdString type)
log("ptr 0x%016X\n", cell);
cell->name = name;
cell->type = type;
scream("addCell pre", cell);
// scream("addCell pre", cell);
if (RTLIL::Cell::is_legacy_type(type)) {
cell->legacy = new RTLIL::OldCell;
cell->legacy->name = name;
@ -2464,7 +2464,7 @@ RTLIL::Cell *RTLIL::Module::addCell(RTLIL::IdString name, RTLIL::IdString type)
new (&conn.second) SigSpec();
}
}
scream("addCell post", cell);
// scream("addCell post", cell);
add(cell);
return cell;
}
@ -3664,7 +3664,6 @@ void RTLIL::Cell::setParam(const RTLIL::IdString &paramname, RTLIL::Const value)
}
const RTLIL::Const& RTLIL::Cell::getParam(const RTLIL::IdString &paramname) const {
log_debug("paramname %s, type %s\n", paramname.c_str(), type.c_str());
if (is_legacy())
return legacy->getParam(paramname);
log_debug("fr");

View file

@ -1852,13 +1852,13 @@ public:
}
iterator end() {
if (parent->is_legacy()) {
return iterator(parent, parent->legacy->connections_.size());
return iterator(parent, parent->legacy->parameters.size());
} else if (parent->type == ID($pos)) {
return iterator(parent, parent->pos.connections().size());
return iterator(parent, parent->pos.parameters().size());
} else if (parent->type == ID($neg)) {
return iterator(parent, parent->neg.connections().size());
return iterator(parent, parent->neg.parameters().size());
} else if (parent->type == ID($not)) {
return iterator(parent, parent->not_.connections().size());
return iterator(parent, parent->not_.parameters().size());
} else {
throw std::out_of_range("FakeParams::iterator::end()");
}
@ -1914,13 +1914,13 @@ public:
}
const_iterator end() const {
if (parent->is_legacy()) {
return const_iterator(parent, parent->legacy->connections_.size());
return const_iterator(parent, parent->legacy->parameters.size());
} else if (parent->type == ID($pos)) {
return const_iterator(parent, parent->pos.connections().size());
return const_iterator(parent, parent->pos.parameters().size());
} else if (parent->type == ID($neg)) {
return const_iterator(parent, parent->neg.connections().size());
return const_iterator(parent, parent->neg.parameters().size());
} else if (parent->type == ID($not)) {
return const_iterator(parent, parent->not_.connections().size());
return const_iterator(parent, parent->not_.parameters().size());
} else {
throw std::out_of_range("FakeConns::end() const");
}