diff options
author | Clifford Wolf <clifford@clifford.at> | 2018-12-01 04:11:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-01 04:11:19 +0100 |
commit | 47c89d600c11aee97e325351d295781169d62978 (patch) | |
tree | e57183c3b33b3364de05df9315b9b84cfcdaf74a | |
parent | e90195b737912f6cffcc1b8720c7d72e746d8854 (diff) | |
parent | f8b97e21f3f76dd031f82586f8af104368f03e73 (diff) | |
download | yosys-47c89d600c11aee97e325351d295781169d62978.tar.gz yosys-47c89d600c11aee97e325351d295781169d62978.tar.bz2 yosys-47c89d600c11aee97e325351d295781169d62978.zip |
Merge pull request #676 from rafaeltp/master
Splits SigSpec into bits before calling check_signal_in_fanout (solves #675)
-rw-r--r-- | passes/equiv/equiv_make.cc | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/passes/equiv/equiv_make.cc b/passes/equiv/equiv_make.cc index 66ee28aff..dbd8682e6 100644 --- a/passes/equiv/equiv_make.cc +++ b/passes/equiv/equiv_make.cc @@ -290,22 +290,29 @@ struct EquivMakeWorker init_bit2driven(); - pool<Cell*> visited_cells; + pool<Cell*> visited_cells; for (auto c : cells_list) for (auto &conn : c->connections()) if (!ct.cell_output(c->type, conn.first)) { SigSpec old_sig = assign_map(conn.second); SigSpec new_sig = rd_signal_map(old_sig); - - visited_cells.clear(); - if (old_sig != new_sig) { - if (check_signal_in_fanout(visited_cells, old_sig, new_sig)) - continue; - log("Changing input %s of cell %s (%s): %s -> %s\n", - log_id(conn.first), log_id(c), log_id(c->type), - log_signal(old_sig), log_signal(new_sig)); - c->setPort(conn.first, new_sig); + if(old_sig != new_sig) { + SigSpec tmp_sig = old_sig; + for (int i = 0; i < GetSize(old_sig); i++) { + SigBit old_bit = old_sig[i], new_bit = new_sig[i]; + + visited_cells.clear(); + if (check_signal_in_fanout(visited_cells, old_bit, new_bit)) + continue; + + log("Changing input %s of cell %s (%s): %s -> %s\n", + log_id(conn.first), log_id(c), log_id(c->type), + log_signal(old_bit), log_signal(new_bit)); + + tmp_sig[i] = new_bit; + } + c->setPort(conn.first, tmp_sig); } } |