Skip to content

Commit

Permalink
Merge pull request #4800 from povik/portarcs-fix
Browse files Browse the repository at this point in the history
Fix portarcs edge cases
  • Loading branch information
povik authored Dec 9, 2024
2 parents f4ddbc3 + f4f6549 commit 481162b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions passes/cmds/portarcs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -192,16 +192,18 @@ struct PortarcsPass : Pass {
if (annotations.count(bit)) {
// consistency check
log_assert(annotations.at(bit)[0] == ((int) (intptr_t) bit.wire));

recycling.push_back(annotations.at(ordering[i]));
} else {
alloc_for_bit(bit);
}

recycling.push_back(annotations.at(ordering[i]));
}
log_debug("Allocated %lux%d\n", allocated.size(), inputs.size());

for (auto bit : outputs) {
int *p = annotations.at(canonical_bit(bit));
for (int i = 0; i < inputs.size(); i++)
p[i] = 0;
p[i] = -1;
}

for (int i = 0; i < ordering.size(); i++) {
Expand Down

0 comments on commit 481162b

Please sign in to comment.