3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-10 19:27:07 +00:00

Merge pull request from YosysHQ/clifford/andopt

Improve handling of and-with-1 and or-with-0 in opt_expr, fixes 
This commit is contained in:
Clifford Wolf 2019-03-14 21:22:16 +01:00 committed by GitHub
commit c4575103af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -155,6 +155,13 @@ bool group_cell_inputs(RTLIL::Module *module, RTLIL::Cell *cell, bool commutativ
new_b.append_bit(it.first.second);
}
if (cell->type.in("$and", "$or") && i == GRP_CONST_A) {
log(" Direct Connection: %s (%s with %s)\n", log_signal(new_b), log_id(cell->type), log_signal(new_a));
module->connect(new_y, new_b);
module->connect(new_conn);
continue;
}
RTLIL::Cell *c = module->addCell(NEW_ID, cell->type);
c->setPort("\\A", new_a);