Bugfix in "scc" command
authorClifford Wolf <clifford@clifford.at>
Sat, 5 Nov 2016 23:03:35 +0000 (00:03 +0100)
committerClifford Wolf <clifford@clifford.at>
Sat, 5 Nov 2016 23:03:35 +0000 (00:03 +0100)
passes/cmds/scc.cc

index bb6d74474a1f2ec558d488840306d15618d73298..6b8f3f512ca98e763641665b4e2f2565db5c3c61 100644 (file)
@@ -163,16 +163,8 @@ struct SccWorker
                }
 
                for (auto cell : workQueue)
-                       cellToNextCell[cell] = sigToNextCells.find(cellToNextSig[cell]);
-
-               labelCounter = 0;
-               cellLabels.clear();
-
-               while (workQueue.size() > 0)
                {
-                       RTLIL::Cell *cell = *workQueue.begin();
-                       log_assert(cellStack.size() == 0);
-                       cellDepth.clear();
+                       cellToNextCell[cell] = sigToNextCells.find(cellToNextSig[cell]);
 
                        if (!nofeedbackMode && cellToNextCell[cell].count(cell)) {
                                log("Found an SCC:");
@@ -183,6 +175,16 @@ struct SccWorker
                                sccList.push_back(scc);
                                log("\n");
                        }
+               }
+
+               labelCounter = 0;
+               cellLabels.clear();
+
+               while (!workQueue.empty())
+               {
+                       RTLIL::Cell *cell = *workQueue.begin();
+                       log_assert(cellStack.size() == 0);
+                       cellDepth.clear();
 
                        run(cell, 0, maxDepth);
                }