diff options
author | Clifford Wolf <clifford@clifford.at> | 2014-12-25 16:41:20 +0100 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2014-12-25 16:41:20 +0100 |
commit | 170788a3decdf8b475762106df24eae910cf24c7 (patch) | |
tree | d64052a4775908539608a8c1ba82ea21750e30f3 | |
parent | 95f17dbab0a15096c66e98af2d611b09ad26f3ea (diff) | |
download | yosys-170788a3decdf8b475762106df24eae910cf24c7.tar.gz yosys-170788a3decdf8b475762106df24eae910cf24c7.tar.bz2 yosys-170788a3decdf8b475762106df24eae910cf24c7.zip |
Fixed simplemap for $ne cells with output width > 1
-rw-r--r-- | passes/techmap/simplemap.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/passes/techmap/simplemap.cc b/passes/techmap/simplemap.cc index 694ebf226..9cea5f45d 100644 --- a/passes/techmap/simplemap.cc +++ b/passes/techmap/simplemap.cc @@ -241,18 +241,19 @@ void simplemap_eqne(RTLIL::Module *module, RTLIL::Cell *cell) RTLIL::SigSpec xor_out = module->addWire(NEW_ID, std::max(GetSize(sig_a), GetSize(sig_b))); RTLIL::Cell *xor_cell = module->addXor(NEW_ID, sig_a, sig_b, xor_out, is_signed); - - RTLIL::SigSpec reduce_out = is_ne ? sig_y : module->addWire(NEW_ID); - RTLIL::Cell *reduce_cell = module->addReduceOr(NEW_ID, xor_out, reduce_out); - - if (!is_ne) - module->addNotGate(NEW_ID, reduce_out, sig_y); - simplemap_bitop(module, xor_cell); module->remove(xor_cell); + RTLIL::SigSpec reduce_out = is_ne ? sig_y : module->addWire(NEW_ID); + RTLIL::Cell *reduce_cell = module->addReduceOr(NEW_ID, xor_out, reduce_out); simplemap_reduce(module, reduce_cell); module->remove(reduce_cell); + + if (!is_ne) { + RTLIL::Cell *not_cell = module->addLogicNot(NEW_ID, reduce_out, sig_y); + simplemap_lognot(module, not_cell); + module->remove(not_cell); + } } void simplemap_mux(RTLIL::Module *module, RTLIL::Cell *cell) |