opt_boundary improvements and add to opt pass as option

This commit is contained in:
Akash Levy 2026-05-04 10:51:04 -07:00
parent 35d89b16e3
commit ebf269bdf0
2 changed files with 12 additions and 1 deletions

View File

@ -47,6 +47,7 @@ struct OptPass : public Pass {
log(" opt_share (-full only)\n");
log(" opt_dff [-nodffe] [-nosdff] [-keepdc] [-sat] (except when called with -noff)\n");
log(" opt_hier (-hier only)\n");
log(" opt_boundary (-boundary only)\n");
log(" opt_clean [-purge]\n");
log(" opt_expr [-mux_undef] [-mux_bool] [-undriven] [-noclkinv] [-fine] [-full] [-keepdc]\n");
log(" while <changed design>\n");
@ -58,6 +59,7 @@ struct OptPass : public Pass {
log(" opt_merge [-share_all]\n");
log(" opt_dff [-nodffe] [-nosdff] [-keepdc] [-sat] (except when called with -noff)\n");
log(" opt_hier (-hier only)\n");
log(" opt_boundary (-boundary only)\n");
log(" opt_clean [-purge]\n");
log(" while <changed design in opt_dff>\n");
log("\n");
@ -77,6 +79,7 @@ struct OptPass : public Pass {
bool fast_mode = false;
bool noff_mode = false;
bool hier_mode = false;
bool boundary_mode = false;
log_header(design, "Executing OPT pass (performing simple optimizations).\n");
log_push();
@ -148,6 +151,10 @@ struct OptPass : public Pass {
hier_mode = true;
continue;
}
if (args[argidx] == "-boundary") {
boundary_mode = true;
continue;
}
break;
}
extra_args(args, argidx, design);
@ -164,6 +171,8 @@ struct OptPass : public Pass {
break;
if (hier_mode)
Pass::call(design, "opt_hier");
if (boundary_mode)
Pass::call(design, "opt_boundary");
Pass::call(design, "opt_clean" + opt_clean_args);
log_header(design, "Rerunning OPT passes. (Removed registers in this run.)\n");
}
@ -184,6 +193,8 @@ struct OptPass : public Pass {
Pass::call(design, "opt_dff" + opt_dff_args);
if (hier_mode)
Pass::call(design, "opt_hier");
if (boundary_mode)
Pass::call(design, "opt_boundary");
Pass::call(design, "opt_clean" + opt_clean_args);
Pass::call(design, "opt_expr" + opt_expr_args);
if (design->scratchpad_get_bool("opt.did_something") == false)

View File

@ -269,7 +269,7 @@ struct OptBoundaryPass : Pass {
log_header(design, "Executing OPT_BOUNDARY pass.\n");
int max_cells = 8;
int max_bits = 4096;
int max_bits = 16384;
bool no_disconnect = false;
size_t argidx;
for (argidx = 1; argidx < args.size(); argidx++) {