{
// |---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");
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");
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;
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;