Add log_assert to ensure no loops
authorEddie Hung <eddie@fpgeh.com>
Tue, 4 Jun 2019 19:01:25 +0000 (12:01 -0700)
committerEddie Hung <eddie@fpgeh.com>
Tue, 4 Jun 2019 19:01:25 +0000 (12:01 -0700)
backends/aiger/xaiger.cc

index 4d45bb650a387df4d311e3a53e9bd7bec2595d61..bf2f9f1bc1d20746ec9494d0a480aca48b631e07 100644 (file)
@@ -334,7 +334,21 @@ struct XAigerWriter
 
                        pool<RTLIL::Module*> abc_carry_modules;
 
-                       toposort.sort();
+#if 0
+                       toposort.analyze_loops = true;
+#endif
+                       bool no_loops = toposort.sort();
+#if 0
+                       unsigned i = 0;
+                       for (auto &it : toposort.loops) {
+                               log("  loop %d", i++);
+                               for (auto cell : it)
+                                       log(" %s", log_id(cell));
+                               log("\n");
+                       }
+#endif
+                       log_assert(no_loops);
+
                        for (auto cell_name : toposort.sorted) {
                                RTLIL::Cell *cell = module->cell(cell_name);
                                RTLIL::Module* box_module = module->design->module(cell->type);