Skip to content

Commit

Permalink
fix swapped conns, params in interators
Browse files Browse the repository at this point in the history
  • Loading branch information
widlarizer committed Jun 18, 2024
1 parent 43d8c7f commit b190055
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
5 changes: 2 additions & 3 deletions kernel/rtlil.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2446,7 +2446,7 @@ RTLIL::Cell *RTLIL::Module::addCell(RTLIL::IdString name, RTLIL::IdString type)
log("ptr 0x%016X\n", cell);

Check warning on line 2446 in kernel/rtlil.cc

View workflow job for this annotation

GitHub Actions / test-compile (ubuntu-latest, clang)

format specifies type 'unsigned int' but the argument has type 'RTLIL::Cell *' [-Wformat]

Check warning on line 2446 in kernel/rtlil.cc

View workflow job for this annotation

GitHub Actions / test-compile (ubuntu-latest, clang-14)

format specifies type 'unsigned int' but the argument has type 'RTLIL::Cell *' [-Wformat]

Check warning on line 2446 in kernel/rtlil.cc

View workflow job for this annotation

GitHub Actions / test-compile (ubuntu-latest, gcc)

format ‘%X’ expects argument of type ‘unsigned int’, but argument 2 has type ‘Yosys::RTLIL::Cell*’ [-Wformat=]

Check warning on line 2446 in kernel/rtlil.cc

View workflow job for this annotation

GitHub Actions / test-compile (ubuntu-latest, gcc-10)

format ‘%X’ expects argument of type ‘unsigned int’, but argument 2 has type ‘Yosys::RTLIL::Cell*’ [-Wformat=]

Check warning on line 2446 in kernel/rtlil.cc

View workflow job for this annotation

GitHub Actions / test-compile (ubuntu-22.04, clang-11)

format specifies type 'unsigned int' but the argument has type 'RTLIL::Cell *' [-Wformat]

Check warning on line 2446 in kernel/rtlil.cc

View workflow job for this annotation

GitHub Actions / test-compile (macos-13, clang)

format specifies type 'unsigned int' but the argument has type 'RTLIL::Cell *' [-Wformat]

Check warning on line 2446 in kernel/rtlil.cc

View workflow job for this annotation

GitHub Actions / test-compile (macos-13, clang)

format specifies type 'unsigned int' but the argument has type 'RTLIL::Cell *' [-Wformat]
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;
Expand All @@ -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;
}
Expand Down Expand Up @@ -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");
Expand Down
16 changes: 8 additions & 8 deletions kernel/rtlil.h
Original file line number Diff line number Diff line change
Expand Up @@ -1852,13 +1852,13 @@ struct RTLIL::Cell : RTLIL::AttrObject
}
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()");
}
Expand Down Expand Up @@ -1914,13 +1914,13 @@ struct RTLIL::Cell : RTLIL::AttrObject
}
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");
}
Expand Down

0 comments on commit b190055

Please sign in to comment.