Merge pull request #676 from rafaeltp/master

Splits SigSpec into bits before calling check_signal_in_fanout (solves #675)
This commit is contained in:
Clifford Wolf 2018-12-01 04:11:19 +01:00 committed by GitHub
commit 47c89d600c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 10 deletions

View File

@ -297,15 +297,22 @@ struct EquivMakeWorker
SigSpec old_sig = assign_map(conn.second); SigSpec old_sig = assign_map(conn.second);
SigSpec new_sig = rd_signal_map(old_sig); SigSpec new_sig = rd_signal_map(old_sig);
visited_cells.clear();
if(old_sig != new_sig) { if(old_sig != new_sig) {
if (check_signal_in_fanout(visited_cells, 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; continue;
log("Changing input %s of cell %s (%s): %s -> %s\n", log("Changing input %s of cell %s (%s): %s -> %s\n",
log_id(conn.first), log_id(c), log_id(c->type), log_id(conn.first), log_id(c), log_id(c->type),
log_signal(old_sig), log_signal(new_sig)); log_signal(old_bit), log_signal(new_bit));
c->setPort(conn.first, new_sig);
tmp_sig[i] = new_bit;
}
c->setPort(conn.first, tmp_sig);
} }
} }