Unify usage of noflatten among architectures
authorMiodrag Milanovic <mmicko@gmail.com>
Fri, 4 Jan 2019 10:37:25 +0000 (11:37 +0100)
committerMiodrag Milanovic <mmicko@gmail.com>
Fri, 4 Jan 2019 10:37:25 +0000 (11:37 +0100)
techlibs/achronix/synth_achronix.cc
techlibs/coolrunner2/synth_coolrunner2.cc
techlibs/gowin/synth_gowin.cc
techlibs/intel/synth_intel.cc

index 3642e3bd3eeb05fe8aa0d90a16fbeb710d1e2743..626860d9c1782697f4214288fe00292220c3a4ec 100755 (executable)
@@ -95,8 +95,8 @@ struct SynthAchronixPass : public ScriptPass {
           run_to = args[argidx].substr(pos+1);
           continue;
         }
-        if (args[argidx] == "-flatten") {
-          flatten = true;
+        if (args[argidx] == "-noflatten") {
+          flatten = false;
           continue;
         }
         if (args[argidx] == "-retime") {
index 810380d4a3a0d5490e0928b5bd211cb5f016a9a5..21bbcaef4cff3d600f1a3385aca9c25ee4d9f45f 100644 (file)
@@ -129,7 +129,7 @@ struct SynthCoolrunner2Pass : public ScriptPass
                        run(stringf("hierarchy -check %s", help_mode ? "-top <top>" : top_opt.c_str()));
                }
 
-               if (check_label("flatten", "(unless -noflatten)") && flatten)
+               if (flatten && check_label("flatten", "(unless -noflatten)"))
                {
                        run("proc");
                        run("flatten");
index 9700b3898de74bfc0a332cf03db29c3bc4d9f11f..96128a6807272e702faf0ea197ccfc518dc76319 100644 (file)
@@ -52,6 +52,9 @@ struct SynthGowinPass : public ScriptPass
                log("    -nobram\n");
                log("        do not use BRAM cells in output netlist\n");
                log("\n");
+               log("    -noflatten\n");
+               log("        do not flatten design before synthesis\n");
+               log("\n");
                log("    -retime\n");
                log("        run 'abc' with -dff option\n");
                log("\n");
@@ -62,14 +65,15 @@ struct SynthGowinPass : public ScriptPass
        }
 
        string top_opt, vout_file;
-       bool retime, nobram;
+       bool retime, flatten, nobram;
 
        void clear_flags() YS_OVERRIDE
        {
                top_opt = "-auto-top";
                vout_file = "";
                retime = false;
-                nobram = true;
+               flatten = true;
+               nobram = true;
        }
 
        void execute(std::vector<std::string> args, RTLIL::Design *design) YS_OVERRIDE
@@ -104,6 +108,10 @@ struct SynthGowinPass : public ScriptPass
                                nobram = true;
                                continue;
                        }
+                       if (args[argidx] == "-noflatten") {
+                               flatten = false;
+                               continue;
+                       }                       
                        break;
                }
                extra_args(args, argidx, design);
@@ -127,7 +135,7 @@ struct SynthGowinPass : public ScriptPass
                        run(stringf("hierarchy -check %s", help_mode ? "-top <top>" : top_opt.c_str()));
                }
 
-               if (check_label("flatten") && check_label("flatten", "(unless -noflatten)"))
+               if (flatten && check_label("flatten", "(unless -noflatten)"))
                {
                        run("proc");
                        run("flatten");
index d74f295ecf851a50192ecb9d708251326c2b778c..0f1d7a7b54d5b1d4625919c595cf61f81ab90ba2 100644 (file)
@@ -131,8 +131,8 @@ struct SynthIntelPass : public ScriptPass {
           nobram = true;
           continue;
         }
-        if (args[argidx] == "-flatten") {
-          flatten = true;
+        if (args[argidx] == "-noflatten") {
+          flatten = false;
           continue;
         }
         if (args[argidx] == "-retime") {