aboutsummaryrefslogtreecommitdiffstats
path: root/passes
diff options
context:
space:
mode:
authorclairexen <claire@symbioticeda.com>2020-08-20 16:21:09 +0200
committerGitHub <noreply@github.com>2020-08-20 16:21:09 +0200
commitfaf8e19511de07e38158ae68950876843ef803c5 (patch)
tree5711e343b14c9f88ba05c51c958fe0f66479481a /passes
parent16bb3fc8bb11b6d373d0e2685b7d1fb38a306de0 (diff)
parentb4a4cb081de717a7f6de89914f8f5ffec959b0c3 (diff)
downloadyosys-faf8e19511de07e38158ae68950876843ef803c5.tar.gz
yosys-faf8e19511de07e38158ae68950876843ef803c5.tar.bz2
yosys-faf8e19511de07e38158ae68950876843ef803c5.zip
Merge pull request #2327 from YosysHQ/mwk/techmap-constmap-fix
techmap.CONSTMAP: Handle outputs before inputs.
Diffstat (limited to 'passes')
-rw-r--r--passes/techmap/techmap.cc23
1 files changed, 22 insertions, 1 deletions
diff --git a/passes/techmap/techmap.cc b/passes/techmap/techmap.cc
index e8085595b..4a1a74ce9 100644
--- a/passes/techmap/techmap.cc
+++ b/passes/techmap/techmap.cc
@@ -801,11 +801,31 @@ struct TechmapWorker
}
}
+ // Handle outputs first, as these cannot be remapped.
for (auto &conn : cell->connections())
+ {
+ Wire *twire = tpl->wire(conn.first);
+ if (!twire->port_output)
+ continue;
+
+ for (int i = 0; i < GetSize(conn.second); i++) {
+ RTLIL::SigBit bit = sigmap(conn.second[i]);
+ RTLIL::SigBit tplbit(twire, i);
+ cellbits_to_tplbits[bit] = tplbit;
+ }
+ }
+
+ // Now handle inputs, remapping as necessary.
+ for (auto &conn : cell->connections())
+ {
+ Wire *twire = tpl->wire(conn.first);
+ if (twire->port_output)
+ continue;
+
for (int i = 0; i < GetSize(conn.second); i++)
{
RTLIL::SigBit bit = sigmap(conn.second[i]);
- RTLIL::SigBit tplbit(tpl->wire(conn.first), i);
+ RTLIL::SigBit tplbit(twire, i);
if (bit.wire == nullptr)
{
@@ -820,6 +840,7 @@ struct TechmapWorker
else
cellbits_to_tplbits[bit] = tplbit;
}
+ }
RTLIL::SigSig port_conn;
for (auto &it : port_connmap) {