aboutsummaryrefslogtreecommitdiffstats
path: root/passes/opt/opt.cc
diff options
context:
space:
mode:
Diffstat (limited to 'passes/opt/opt.cc')
-rw-r--r--passes/opt/opt.cc23
1 files changed, 18 insertions, 5 deletions
diff --git a/passes/opt/opt.cc b/passes/opt/opt.cc
index b20521d1e..5ca57a147 100644
--- a/passes/opt/opt.cc
+++ b/passes/opt/opt.cc
@@ -22,6 +22,9 @@
#include <stdlib.h>
#include <stdio.h>
+USING_YOSYS_NAMESPACE
+PRIVATE_NAMESPACE_BEGIN
+
struct OptPass : public Pass {
OptPass() : Pass("opt", "perform simple optimizations") { }
virtual void help()
@@ -34,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");
@@ -93,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;
@@ -137,8 +145,13 @@ struct OptPass : public Pass {
}
}
- log_header(fast_mode ? "Finished fast OPT passes." : "Finished OPT passes. (There is nothing left to do.)\n");
+ design->optimize();
+ design->sort();
+ design->check();
+
+ log_header(fast_mode ? "Finished fast OPT passes.\n" : "Finished OPT passes. (There is nothing left to do.)\n");
log_pop();
}
} OptPass;
+PRIVATE_NAMESPACE_END