Combine 'flatten' & 'coarse' labels in synth_ecp5 so proc run once
authorEddie Hung <eddie@fpgeh.com>
Thu, 26 Sep 2019 17:45:14 +0000 (10:45 -0700)
committerEddie Hung <eddie@fpgeh.com>
Thu, 26 Sep 2019 17:45:14 +0000 (10:45 -0700)
techlibs/ecp5/synth_ecp5.cc

index 0a3dcc62cc93fee763bed99fa7a5ad5d27b0c3f5..1f5b1cb6bd2c81367ecd7418fb1f9db9787862c1 100644 (file)
@@ -226,16 +226,13 @@ struct SynthEcp5Pass : public ScriptPass
                        run(stringf("hierarchy -check %s", help_mode ? "-top <top>" : top_opt.c_str()));
                }
 
-               if (flatten && check_label("flatten", "(unless -noflatten)"))
+               if (check_label("coarse"))
                {
                        run("proc");
-                       run("flatten");
+                       if (flatten || help_mode)
+                               run("flatten");
                        run("tribuf -logic");
                        run("deminout");
-               }
-
-               if (check_label("coarse"))
-               {
                        run("opt_expr");
                        run("opt_clean");
                        run("check");
@@ -248,9 +245,7 @@ struct SynthEcp5Pass : public ScriptPass
                        run("opt_expr");
                        run("opt_clean");
                        if (!nodsp) {
-                               run("techmap -map +/mul2dsp.v -D DSP_A_MAXWIDTH=18 -D DSP_B_MAXWIDTH=18  -D DSP_A_MINWIDTH=2 -D DSP_B_MINWIDTH=2  -D DSP_NAME=$__MUL18X18", "(unless -nodsp)");
-                               run("clean", "(unless -nodsp)");
-                               run("techmap -map +/ecp5/dsp_map.v", "(unless -nodsp)");
+                               run("techmap -map +/mul2dsp.v -map +/ecp5/dsp_map.v -D DSP_A_MAXWIDTH=18 -D DSP_B_MAXWIDTH=18  -D DSP_A_MINWIDTH=2 -D DSP_B_MINWIDTH=2  -D DSP_NAME=$__MUL18X18", "(unless -nodsp)");
                                run("chtype -set $mul t:$__soft_mul", "(unless -nodsp)");
                        }
                        run("alumacc");