abc9: add abc9.verify and abc9.debug options
authorEddie Hung <eddie@fpgeh.com>
Fri, 10 Jan 2020 23:04:13 +0000 (15:04 -0800)
committerEddie Hung <eddie@fpgeh.com>
Fri, 10 Jan 2020 23:04:13 +0000 (15:04 -0800)
passes/techmap/abc9.cc

index 22f5a1f3a92401ef7b7e4eb8964ea62f71dcd22f..3ce435dd08c0d88088362527c5f31dc80f758e34 100644 (file)
@@ -308,7 +308,14 @@ void abc9_module(RTLIL::Design *design, RTLIL::Module *module, std::string scrip
                for (size_t pos = abc9_script.find("&mfs"); pos != std::string::npos; pos = abc9_script.find("&mfs", pos))
                        abc9_script = abc9_script.erase(pos, strlen("&mfs"));
 
-       abc9_script += stringf("; &ps -l; &write -n %s/output.aig; time", tempdir_name.c_str());
+       abc9_script += stringf("; &ps -l; &write -n %s/output.aig;", tempdir_name.c_str());
+       if (design->scratchpad_get_bool("abc9.debug")) {
+               if (dff_mode)
+                       abc9_script += "verify -s;";
+               else
+                       abc9_script += "verify;";
+       }
+       abc9_script += "time";
        abc9_script = add_echos_to_abc9_cmd(abc9_script);
 
        for (size_t i = 0; i+1 < abc9_script.size(); i++)
@@ -910,6 +917,11 @@ struct Abc9Pass : public Pass {
                }
                nomfs = design->scratchpad_get_bool("abc9.nomfs", nomfs);
 
+               if (design->scratchpad_get_bool("abc9.debug")) {
+                       cleanup = false;
+                       show_tempdir = true;
+               }
+
                size_t argidx;
                char pwd [PATH_MAX];
                if (!getcwd(pwd, sizeof(pwd))) {