aboutsummaryrefslogtreecommitdiffstats
path: root/passes/techmap/shregmap.cc
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2019-06-20 16:57:54 -0700
committerEddie Hung <eddie@fpgeh.com>2019-08-22 16:16:56 -0700
commitcfafd360d52795c9c76c69d008f765d171e2b0ed (patch)
tree0eed6845d5dbb41858f99689827d9f5e2b82bc92 /passes/techmap/shregmap.cc
parente7a8cdbccfa6f619f2e25c540b5af6d8e34ff431 (diff)
downloadyosys-cfafd360d52795c9c76c69d008f765d171e2b0ed.tar.gz
yosys-cfafd360d52795c9c76c69d008f765d171e2b0ed.tar.bz2
yosys-cfafd360d52795c9c76c69d008f765d171e2b0ed.zip
Add comment as per @cliffordwolf
Diffstat (limited to 'passes/techmap/shregmap.cc')
-rw-r--r--passes/techmap/shregmap.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/passes/techmap/shregmap.cc b/passes/techmap/shregmap.cc
index 6c00d4d53..f308292fa 100644
--- a/passes/techmap/shregmap.cc
+++ b/passes/techmap/shregmap.cc
@@ -142,7 +142,18 @@ struct ShregmapWorker
{
auto r = sigbit_chain_next.insert(std::make_pair(d_bit, cell));
if (!r.second) {
+ // Insertion not successful means that d_bit is already
+ // connected to another register, thus mark it as a
+ // non chain user ...
sigbit_with_non_chain_users.insert(d_bit);
+ // ... and clone d_bit into another wire, and use that
+ // wire as a different key in the d_bit-to-cell dictionary
+ // so that it can be identified as another chain
+ // (omitting this common flop)
+ // Link: https://github.com/YosysHQ/yosys/pull/1085
+ // NB: This relies on us not updating sigmap with this
+ // alias otherwise it would think they are the same
+ // wire
Wire *wire = module->addWire(NEW_ID);
module->connect(wire, d_bit);
sigbit_chain_next.insert(std::make_pair(wire, cell));