Fixed/improved opt_const $eq/$ne/$eqx/$nex handling

This commit is contained in:
Clifford Wolf 2013-12-27 14:21:24 +01:00
parent 369bf81a70
commit 7b02a44efb
1 changed files with 3 additions and 1 deletions

View File

@ -166,6 +166,8 @@ void replace_const_cells(RTLIL::Design *design, RTLIL::Module *module, bool cons
if (b.chunks[i].wire == NULL && b.chunks[i].data.bits[0] > RTLIL::State::S1)
continue;
}
if (a.chunks[i] == b.chunks[i])
continue;
new_a.append(a.chunks[i]);
new_b.append(b.chunks[i]);
}
@ -177,7 +179,7 @@ void replace_const_cells(RTLIL::Design *design, RTLIL::Module *module, bool cons
goto next_cell;
}
if (new_a.width != a.width) {
if (new_a.width < a.width || new_b.width < b.width) {
new_a.optimize();
new_b.optimize();
cell->connections["\\A"] = new_a;