Skip to content

Commit aac562d

Browse files
aiger.cc: Explicit unsorted-pool-as-LIFO
1 parent 0072a26 commit aac562d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

backends/aiger/aiger.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,9 @@ struct AigerWriter
153153
sigmap.add(wire);
154154

155155
// handle ports
156+
// provided the input_bits and output_bits don't get sorted they
157+
// will be returned in reverse order, so add them in reverse to
158+
// match
156159
for (auto riter = module->ports.rbegin(); riter != module->ports.rend(); ++riter) {
157160
auto *wire = module->wire(*riter);
158161
for (int i = 0; i < GetSize(wire); i++)
@@ -353,6 +356,7 @@ struct AigerWriter
353356
}
354357

355358
init_map.sort();
359+
// we are relying here on unsorted pools iterating last-in-first-out
356360
if (!no_sort) {
357361
input_bits.sort();
358362
output_bits.sort();

0 commit comments

Comments
 (0)