Added "prep -auto-top" and "synth -auto-top"
authorClifford Wolf <clifford@clifford.at>
Mon, 11 Jul 2016 09:40:55 +0000 (11:40 +0200)
committerClifford Wolf <clifford@clifford.at>
Mon, 11 Jul 2016 09:40:55 +0000 (11:40 +0200)
techlibs/common/prep.cc
techlibs/common/synth.cc

index 9f8f6b313944045be9c69ec66a055eb45c97f545..ac1d98fde524c05e1640fdcfa04e9e427ab6f764 100644 (file)
@@ -42,6 +42,9 @@ struct PrepPass : public ScriptPass
                log("    -top <module>\n");
                log("        use the specified module as top module (default='top')\n");
                log("\n");
+               log("    -auto-top\n");
+               log("        automatically determine the top of the design hierarchy\n");
+               log("\n");
                log("    -flatten\n");
                log("        flatten the design before synthesis. this will pass '-auto-top' to\n");
                log("        'hierarchy' if no top module is specified.\n");
@@ -65,12 +68,14 @@ struct PrepPass : public ScriptPass
        }
 
        string top_module, fsm_opts, memory_opts;
-       bool flatten, ifxmode;
+       bool autotop, flatten, ifxmode;
 
        virtual void clear_flags() YS_OVERRIDE
        {
                top_module.clear();
                memory_opts.clear();
+
+               autotop = false;
                flatten = false;
                ifxmode = false;
        }
@@ -97,6 +102,10 @@ struct PrepPass : public ScriptPass
                                }
                                continue;
                        }
+                       if (args[argidx] == "-auto-top") {
+                               autotop = true;
+                               continue;
+                       }
                        if (args[argidx] == "-flatten") {
                                flatten = true;
                                continue;
@@ -130,10 +139,10 @@ struct PrepPass : public ScriptPass
                if (check_label("begin"))
                {
                        if (help_mode) {
-                               run("hierarchy -check [-top <top>]");
+                               run("hierarchy -check [-top <top> | -auto-top]");
                        } else {
                                if (top_module.empty()) {
-                                       if (flatten)
+                                       if (flatten || autotop)
                                                run("hierarchy -check -auto-top");
                                        else
                                                run("hierarchy -check");
index 859a6606fd6b898a016cf43acbee41d441707eec..11ebe5339c742e8708798a287f4b418581108689 100644 (file)
@@ -41,6 +41,9 @@ struct SynthPass : public ScriptPass
                log("    -top <module>\n");
                log("        use the specified module as top module (default='top')\n");
                log("\n");
+               log("    -auto-top\n");
+               log("        automatically determine the top of the design hierarchy\n");
+               log("\n");
                log("    -flatten\n");
                log("        flatten the design before synthesis. this will pass '-auto-top' to\n");
                log("        'hierarchy' if no top module is specified.\n");
@@ -73,7 +76,7 @@ struct SynthPass : public ScriptPass
        }
 
        string top_module, fsm_opts, memory_opts;
-       bool flatten, noalumacc, nofsm, noabc;
+       bool autotop, flatten, noalumacc, nofsm, noabc;
 
        virtual void clear_flags() YS_OVERRIDE
        {
@@ -81,6 +84,7 @@ struct SynthPass : public ScriptPass
                fsm_opts.clear();
                memory_opts.clear();
 
+               autotop = false;
                flatten = false;
                noalumacc = false;
                nofsm = false;
@@ -114,6 +118,10 @@ struct SynthPass : public ScriptPass
                                }
                                continue;
                        }
+                       if (args[argidx] == "-auto-top") {
+                               autotop = true;
+                               continue;
+                       }
                        if (args[argidx] == "-flatten") {
                                flatten = true;
                                continue;
@@ -154,10 +162,10 @@ struct SynthPass : public ScriptPass
                if (check_label("begin"))
                {
                        if (help_mode) {
-                               run("hierarchy -check [-top <top>]");
+                               run("hierarchy -check [-top <top> | -auto-top]");
                        } else {
                                if (top_module.empty()) {
-                                       if (flatten)
+                                       if (flatten || autotop)
                                                run("hierarchy -check -auto-top");
                                        else
                                                run("hierarchy -check");