Skip to content

Commit 481162b

Browse files
authored
Merge pull request #4800 from povik/portarcs-fix
Fix portarcs edge cases
2 parents f4ddbc3 + f4f6549 commit 481162b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

passes/cmds/portarcs.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,16 +192,18 @@ struct PortarcsPass : Pass {
192192
if (annotations.count(bit)) {
193193
// consistency check
194194
log_assert(annotations.at(bit)[0] == ((int) (intptr_t) bit.wire));
195-
196-
recycling.push_back(annotations.at(ordering[i]));
195+
} else {
196+
alloc_for_bit(bit);
197197
}
198+
199+
recycling.push_back(annotations.at(ordering[i]));
198200
}
199201
log_debug("Allocated %lux%d\n", allocated.size(), inputs.size());
200202

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

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

0 commit comments

Comments
 (0)