Skip to content

Commit

Permalink
Merge pull request #21 from alainmarcel/new_peepopts
Browse files Browse the repository at this point in the history
Fix nanoxplore meminit test
  • Loading branch information
alaindargelas authored Dec 21, 2024
2 parents b9c3666 + 11e4446 commit 9450dc1
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions passes/pmgen/peepopt_muxadd.pmg
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,16 @@ code add_y add_a add_b add_a_ext add_a_id add_b_id mux_y mux_a mux_b mux_a_id m
// Adder output could be assigned
for (auto it = module->connections().begin(); it != module->connections().end(); ++it) {
RTLIL::SigSpec rhs = it->second;
const std::string& rhs_name = rhs.as_wire()->name.c_str();
if (rhs_name == adder_y_name) {
RTLIL::SigSpec lhs = it->first;
const std::string& lhs_name = lhs.as_wire()->name.c_str();
module->rename(lhs_name, module->uniquify("$" + lhs_name));
break;
if (rhs.is_wire()) {
const std::string& rhs_name = rhs.as_wire()->name.c_str();
if (rhs_name == adder_y_name) {
RTLIL::SigSpec lhs = it->first;
if (lhs.is_wire()) {
const std::string& lhs_name = lhs.as_wire()->name.c_str();
module->rename(lhs_name, module->uniquify("$" + lhs_name));
break;
}
}
}
}
// Alternatively, the port name could be a wire name
Expand Down

0 comments on commit 9450dc1

Please sign in to comment.