@@ -46,6 +46,7 @@ struct OptPass : public Pass {
4646 log (" opt_merge [-share_all]\n " );
4747 log (" opt_share (-full only)\n " );
4848 log (" opt_dff [-nodffe] [-nosdff] [-keepdc] [-sat] (except when called with -noff)\n " );
49+ log (" opt_hier (-hier only)\n " );
4950 log (" opt_clean [-purge]\n " );
5051 log (" opt_expr [-mux_undef] [-mux_bool] [-undriven] [-noclkinv] [-fine] [-full] [-keepdc]\n " );
5152 log (" while <changed design>\n " );
@@ -56,6 +57,7 @@ struct OptPass : public Pass {
5657 log (" opt_expr [-mux_undef] [-mux_bool] [-undriven] [-noclkinv] [-fine] [-full] [-keepdc]\n " );
5758 log (" opt_merge [-share_all]\n " );
5859 log (" opt_dff [-nodffe] [-nosdff] [-keepdc] [-sat] (except when called with -noff)\n " );
60+ log (" opt_hier (-hier only)\n " );
5961 log (" opt_clean [-purge]\n " );
6062 log (" while <changed design in opt_dff>\n " );
6163 log (" \n " );
@@ -74,6 +76,7 @@ struct OptPass : public Pass {
7476 bool opt_share = false ;
7577 bool fast_mode = false ;
7678 bool noff_mode = false ;
79+ bool hier_mode = false ;
7780
7881 log_header (design, " Executing OPT pass (performing simple optimizations).\n " );
7982 log_push ();
@@ -141,6 +144,10 @@ struct OptPass : public Pass {
141144 noff_mode = true ;
142145 continue ;
143146 }
147+ if (args[argidx] == " -hier" ) {
148+ hier_mode = true ;
149+ continue ;
150+ }
144151 break ;
145152 }
146153 extra_args (args, argidx, design);
@@ -155,6 +162,8 @@ struct OptPass : public Pass {
155162 Pass::call (design, " opt_dff" + opt_dff_args);
156163 if (design->scratchpad_get_bool (" opt.did_something" ) == false )
157164 break ;
165+ if (hier_mode)
166+ Pass::call (design, " opt_hier" );
158167 Pass::call (design, " opt_clean" + opt_clean_args);
159168 log_header (design, " Rerunning OPT passes. (Removed registers in this run.)\n " );
160169 }
@@ -173,6 +182,8 @@ struct OptPass : public Pass {
173182 Pass::call (design, " opt_share" );
174183 if (!noff_mode)
175184 Pass::call (design, " opt_dff" + opt_dff_args);
185+ if (hier_mode)
186+ Pass::call (design, " opt_hier" );
176187 Pass::call (design, " opt_clean" + opt_clean_args);
177188 Pass::call (design, " opt_expr" + opt_expr_args);
178189 if (design->scratchpad_get_bool (" opt.did_something" ) == false )
0 commit comments