Non chain user check using next_sig
authorEddie Hung <eddie@fpgeh.com>
Thu, 6 Jun 2019 19:44:50 +0000 (12:44 -0700)
committerEddie Hung <eddie@fpgeh.com>
Thu, 6 Jun 2019 19:44:50 +0000 (12:44 -0700)
passes/opt/muxpack.cc

index 9668b0d437fc83f617ba2806b6b192fe44908d5e..9630831079be348500b7a92a06a4e6e453e0ae55 100644 (file)
@@ -84,19 +84,17 @@ struct MuxpackWorker
        {
                for (auto it : sig_chain_next)
                {
-                       SigSpec next_sig;
-
-            for (auto bit : it.first.bits())
-                if (sigbit_with_non_chain_users.count(bit))
-                    goto start_cell;
-
-                       next_sig = it.second->getPort("\\A");
+                       SigSpec next_sig = it.second->getPort("\\A");
                        if (sig_chain_prev.count(next_sig) == 0) {
                                next_sig = it.second->getPort("\\B");
                                if (sig_chain_prev.count(next_sig) == 0)
                                        next_sig = SigSpec();
                        }
 
+                       for (auto bit : next_sig.bits())
+                               if (sigbit_with_non_chain_users.count(bit))
+                                       goto start_cell;
+
                        if (!next_sig.empty())
                        {
                                Cell *c1 = sig_chain_prev.at(next_sig);