Be less aggressive with running design->check()
authorClifford Wolf <clifford@clifford.at>
Tue, 6 Aug 2019 17:21:37 +0000 (19:21 +0200)
committerClifford Wolf <clifford@clifford.at>
Tue, 6 Aug 2019 17:21:37 +0000 (19:21 +0200)
Signed-off-by: Clifford Wolf <clifford@clifford.at>
kernel/driver.cc
kernel/register.cc
kernel/yosys.cc

index f273057dd765d4872efcfa3f38a4be92a93fceca..70a97c4b955f8b9bca8c2f3dea0d27d1f0a46ea9 100644 (file)
@@ -522,6 +522,12 @@ int main(int argc, char **argv)
        if (!backend_command.empty())
                run_backend(output_filename, backend_command);
 
+       yosys_design->check();
+       for (auto it : saved_designs)
+               it.second->check();
+       for (auto it : pushed_designs)
+               it->check();
+
        if (!depsfile.empty())
        {
                FILE *f = fopen(depsfile.c_str(), "wt");
index 4c6e3591f7d960d9e0c4a72676ae5a8fb2fd0b3b..8f8f2c971f68462b2ecfa9a3e5e2564687decf5b 100644 (file)
@@ -256,8 +256,6 @@ void Pass::call(RTLIL::Design *design, std::vector<std::string> args)
        pass_register[args[0]]->post_execute(state);
        while (design->selection_stack.size() > orig_sel_stack_pos)
                design->selection_stack.pop_back();
-
-       design->check();
 }
 
 void Pass::call_on_selection(RTLIL::Design *design, const RTLIL::Selection &selection, std::string command)
@@ -339,8 +337,10 @@ void ScriptPass::run(std::string command, std::string info)
                        log("        %s\n", command.c_str());
                else
                        log("        %s    %s\n", command.c_str(), info.c_str());
-       } else
+       } else {
                Pass::call(active_design, command);
+               active_design->check();
+       }
 }
 
 void ScriptPass::run_script(RTLIL::Design *design, std::string run_from, std::string run_to)
@@ -534,8 +534,6 @@ void Frontend::frontend_call(RTLIL::Design *design, std::istream *f, std::string
                        args.push_back(filename);
                frontend_register[args[0]]->execute(args, design);
        }
-
-       design->check();
 }
 
 Backend::Backend(std::string name, std::string short_help) :
@@ -645,8 +643,6 @@ void Backend::backend_call(RTLIL::Design *design, std::ostream *f, std::string f
 
        while (design->selection_stack.size() > orig_sel_stack_pos)
                design->selection_stack.pop_back();
-
-       design->check();
 }
 
 static struct CellHelpMessages {
index 191b6d5c75817096d9951a25e9a7ee5d192d1194..a4cc53f1ad8878e48cac6dca813ad0ee59f317e5 100644 (file)
@@ -964,14 +964,18 @@ void run_frontend(std::string filename, std::string command, std::string *backen
                                        command += next_line;
                                }
                                handle_label(command, from_to_active, run_from, run_to);
-                               if (from_to_active)
+                               if (from_to_active) {
                                        Pass::call(design, command);
+                                       design->check();
+                               }
                        }
 
                        if (!command.empty()) {
                                handle_label(command, from_to_active, run_from, run_to);
-                               if (from_to_active)
+                               if (from_to_active) {
                                        Pass::call(design, command);
+                                       design->check();
+                               }
                        }
                }
                catch (...) {
@@ -1000,6 +1004,7 @@ void run_frontend(std::string filename, std::string command, std::string *backen
                Pass::call(design, vector<string>({command, filename}));
        else
                Frontend::frontend_call(design, NULL, filename, command);
+       design->check();
 }
 
 void run_frontend(std::string filename, std::string command, RTLIL::Design *design)
@@ -1183,6 +1188,7 @@ void shell(RTLIL::Design *design)
                                design->selection_stack.pop_back();
                        log_reset_stack();
                }
+               design->check();
        }
        if (command == NULL)
                printf("exit\n");