summaryrefslogtreecommitdiff
path: root/passes/opt
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-02-08 14:21:34 +0100
committerClifford Wolf <clifford@clifford.at>2014-02-08 14:21:34 +0100
commit82c98bbbe60eb9246d399e712e92e4ff514402fa (patch)
treeb8a6e7b4022a7606ff0258bce1ea3484697e9734 /passes/opt
parent922d1c9520ec1863b932cd7910be86029726ae95 (diff)
Added opt -purge (frontend to opt_clean -purge)
Diffstat (limited to 'passes/opt')
-rw-r--r--passes/opt/opt.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/passes/opt/opt.cc b/passes/opt/opt.cc
index 8d259f34..8f4725e1 100644
--- a/passes/opt/opt.cc
+++ b/passes/opt/opt.cc
@@ -31,7 +31,7 @@ struct OptPass : public Pass {
{
// |---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|---v---|
log("\n");
- log(" opt [-mux_undef] [-mux_bool] [-undriven] [selection]\n");
+ log(" opt [-purge] [-mux_undef] [-mux_bool] [-undriven] [selection]\n");
log("\n");
log("This pass calls all the other opt_* passes in a useful order. This performs\n");
log("a series of trivial optimizations and cleanups. This pass executes the other\n");
@@ -45,13 +45,14 @@ struct OptPass : public Pass {
log(" opt_reduce\n");
log(" opt_share\n");
log(" opt_rmdff\n");
- log(" opt_clean\n");
+ log(" opt_clean [-purge]\n");
log(" opt_const [-mux_undef] [-mux_bool] [-undriven]\n");
log(" while [changed design]\n");
log("\n");
}
virtual void execute(std::vector<std::string> args, RTLIL::Design *design)
{
+ std::string opt_clean_args;
std::string opt_const_args;
log_header("Executing OPT pass (performing simple optimizations).\n");
@@ -59,6 +60,10 @@ struct OptPass : public Pass {
size_t argidx;
for (argidx = 1; argidx < args.size(); argidx++) {
+ if (args[argidx] == "-purge") {
+ opt_clean_args += " -purge";
+ continue;
+ }
if (args[argidx] == "-mux_undef") {
opt_const_args += " -mux_undef";
continue;
@@ -86,7 +91,7 @@ struct OptPass : public Pass {
Pass::call(design, "opt_reduce");
Pass::call(design, "opt_share");
Pass::call(design, "opt_rmdff");
- Pass::call(design, "opt_clean");
+ Pass::call(design, "opt_clean" + opt_clean_args);
Pass::call(design, "opt_const" + opt_const_args);
if (OPT_DID_SOMETHING == false)
break;