If d_bit already in sigbit_chain_next, create extra wire
authorEddie Hung <eddie@fpgeh.com>
Mon, 10 Jun 2019 23:16:40 +0000 (16:16 -0700)
committerEddie Hung <eddie@fpgeh.com>
Thu, 22 Aug 2019 23:16:34 +0000 (16:16 -0700)
passes/techmap/shregmap.cc

index d472d1275f92be2513a6d3cef13c0599763da78f..6c00d4d53e6bf0630062e5b41e41d8c331c58147 100644 (file)
@@ -140,10 +140,13 @@ struct ShregmapWorker
 
                                if (opts.init || sigbit_init.count(q_bit) == 0)
                                {
-                                       if (sigbit_chain_next.count(d_bit)) {
+                                       auto r = sigbit_chain_next.insert(std::make_pair(d_bit, cell));
+                                       if (!r.second) {
                                                sigbit_with_non_chain_users.insert(d_bit);
-                                       } else
-                                               sigbit_chain_next[d_bit] = cell;
+                                               Wire *wire = module->addWire(NEW_ID);
+                                               module->connect(wire, d_bit);
+                                               sigbit_chain_next.insert(std::make_pair(wire, cell));
+                                       }
 
                                        sigbit_chain_prev[q_bit] = cell;
                                        continue;