Added "opt -full" alias for all more aggressive optimizations
authorClifford Wolf <clifford@clifford.at>
Fri, 31 Oct 2014 02:36:51 +0000 (03:36 +0100)
committerClifford Wolf <clifford@clifford.at>
Fri, 31 Oct 2014 02:36:51 +0000 (03:36 +0100)
passes/opt/opt.cc
passes/opt/opt_const.cc
passes/opt/opt_reduce.cc
techlibs/common/synth.cc

index ea454b333ab93ab5b6374e6ef355944e2f09cefa..83a30ad77016cbf2746047cfc346150c1bf42166 100644 (file)
@@ -37,22 +37,22 @@ struct OptPass : public Pass {
                log("a series of trivial optimizations and cleanups. This pass executes the other\n");
                log("passes in the following order:\n");
                log("\n");
-               log("    opt_const [-mux_undef] [-mux_bool] [-undriven] [-fine] [-keepdc]\n");
+               log("    opt_const [-mux_undef] [-mux_bool] [-undriven] [-fine] [-full] [-keepdc]\n");
                log("    opt_share -nomux\n");
                log("\n");
                log("    do\n");
                log("        opt_muxtree\n");
-               log("        opt_reduce [-fine]\n");
+               log("        opt_reduce [-fine] [-full]\n");
                log("        opt_share\n");
                log("        opt_rmdff\n");
                log("        opt_clean [-purge]\n");
-               log("        opt_const [-mux_undef] [-mux_bool] [-undriven] [-fine] [-keepdc]\n");
+               log("        opt_const [-mux_undef] [-mux_bool] [-undriven] [-fine] [-full] [-keepdc]\n");
                log("    while <changed design>\n");
                log("\n");
                log("When called with -fast the following script is used instead:\n");
                log("\n");
                log("    do\n");
-               log("        opt_const [-mux_undef] [-mux_bool] [-undriven] [-fine] [-keepdc]\n");
+               log("        opt_const [-mux_undef] [-mux_bool] [-undriven] [-fine] [-full] [-keepdc]\n");
                log("        opt_share\n");
                log("        opt_rmdff\n");
                log("        opt_clean [-purge]\n");
@@ -96,6 +96,11 @@ struct OptPass : public Pass {
                                opt_reduce_args += " -fine";
                                continue;
                        }
+                       if (args[argidx] == "-full") {
+                               opt_const_args += " -full";
+                               opt_reduce_args += " -full";
+                               continue;
+                       }
                        if (args[argidx] == "-keepdc") {
                                opt_const_args += " -keepdc";
                                continue;
index c726c7b3dab497fe7212123ca0de1deeeb5a9d86..e00d5e3b1cd4e2a2ddc73cabfe48cc78f386f344 100644 (file)
@@ -942,15 +942,18 @@ struct OptConstPass : public Pass {
                log("    -undriven\n");
                log("        replace undriven nets with undef (x) constants\n");
                log("\n");
+               log("    -fine\n");
+               log("        perform fine-grain optimizations\n");
+               log("\n");
+               log("    -full\n");
+               log("        alias for -mux_undef -mux_bool -undriven -fine\n");
+               log("\n");
                log("    -keepdc\n");
                log("        some optimizations change the behavior of the circuit with respect to\n");
                log("        don't-care bits. for example in 'a+0' a single x-bit in 'a' will cause\n");
                log("        all result bits to be set to x. this behavior changes when 'a+0' is\n");
                log("        replaced by 'a'. the -keepdc option disables all such optimizations.\n");
                log("\n");
-               log("    -fine\n");
-               log("        perform fine-grain optimizations\n");
-               log("\n");
        }
        virtual void execute(std::vector<std::string> args, RTLIL::Design *design)
        {
@@ -981,6 +984,13 @@ struct OptConstPass : public Pass {
                                do_fine = true;
                                continue;
                        }
+                       if (args[argidx] == "-full") {
+                               mux_undef = true;
+                               mux_bool = true;
+                               undriven = true;
+                               do_fine = true;
+                               continue;
+                       }
                        if (args[argidx] == "-keepdc") {
                                keepdc = true;
                                continue;
index 302deb9bd4ffd503da8d94ec29fa96de1f5024f1..3183d973d7c9b70a62eda283e6d8c66d9482c680 100644 (file)
@@ -346,6 +346,9 @@ struct OptReducePass : public Pass {
                log("    -fine\n");
                log("      perform fine-grain optimizations\n");
                log("\n");
+               log("    -full\n");
+               log("      alias for -fine\n");
+               log("\n");
        }
        virtual void execute(std::vector<std::string> args, RTLIL::Design *design)
        {
@@ -359,6 +362,10 @@ struct OptReducePass : public Pass {
                                do_fine = true;
                                continue;
                        }
+                       if (args[argidx] == "-full") {
+                               do_fine = true;
+                               continue;
+                       }
                        break;
                }
                extra_args(args, argidx, design);
index 8b41a003d8c2e6edc264c2e35091090196e5c32d..c76b002ccb2a128e847947232d8abe11c5eefb98 100644 (file)
@@ -76,9 +76,11 @@ struct SynthPass : public Pass {
                log("        opt_clean\n");
                log("\n");
                log("    fine:\n");
+               log("        opt -fast -full\n");
                log("        memory_map\n");
+               log("        opt -full\n");
                log("        techmap\n");
-               log("        opt -fast\n");
+               log("        opt -fast -full\n");
        #ifdef YOSYS_ENABLE_ABC
                log("        abc -fast\n");
                log("        opt_clean\n");
@@ -144,9 +146,11 @@ struct SynthPass : public Pass {
 
                if (check_label(active, run_from, run_to, "fine"))
                {
+                       Pass::call(design, "opt -fast -full");
                        Pass::call(design, "memory_map");
+                       Pass::call(design, "opt -full");
                        Pass::call(design, "techmap");
-                       Pass::call(design, "opt -fast");
+                       Pass::call(design, "opt -fast -full");
                #ifdef YOSYS_ENABLE_ABC
                        Pass::call(design, "abc -fast");
                        Pass::call(design, "opt_clean");