Logic loop bugfix for "share" pass
authorClifford Wolf <clifford@clifford.at>
Sun, 21 Sep 2014 13:13:44 +0000 (15:13 +0200)
committerClifford Wolf <clifford@clifford.at>
Sun, 21 Sep 2014 13:13:44 +0000 (15:13 +0200)
passes/opt/share.cc

index 5ed9af00912234c29859b128cee80e1e998ed3ef..b91a67ee081c1b4ab883a1b0540fd3192c40fc30 100644 (file)
@@ -958,13 +958,17 @@ struct ShareWorker
 
                                for (auto bit : topo_sigmap(all_ctrl_signals))
                                        for (auto c : topo_bit_drivers[bit])
-                                               topo_cell_drivers[cell].insert(c);
+                                               topo_cell_drivers[supercell].insert(c);
+
+                               topo_cell_drivers[supercell].insert(topo_cell_drivers[cell].begin(), topo_cell_drivers[cell].end());
+                               topo_cell_drivers[supercell].insert(topo_cell_drivers[other_cell].begin(), topo_cell_drivers[other_cell].end());
+
+                               topo_cell_drivers[cell] = { supercell };
+                               topo_cell_drivers[other_cell] = { supercell };
 
                                if (config.limit > 0)
                                        config.limit--;
 
-                               topo_cell_drivers[cell].insert(topo_cell_drivers[other_cell].begin(), topo_cell_drivers[other_cell].end());
-                               topo_cell_drivers[other_cell] = topo_cell_drivers[cell];
                                break;
                        }
                }