Merge pull request #4800 from povik/portarcs-fix

Fix portarcs edge cases
This commit is contained in:
Martin Povišer 2024-12-09 15:13:15 +01:00 committed by GitHub
commit 481162b848
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 3 deletions

View File

@ -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++) {