Skip to content

Fix OPT_POST_GRT_WNS and disable for some PDKs#4343

Open
jfgava wants to merge 6 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:secure-fix-wns-opt
Open

Fix OPT_POST_GRT_WNS and disable for some PDKs#4343
jfgava wants to merge 6 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:secure-fix-wns-opt

Conversation

@jfgava

@jfgava jfgava commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

There is no need to run vt_swap and reroute for PDKs that don't benefit from it.
In this PR I disabled this optimization for Sky130HD/HS, GF180, Nangate45, IHP-SG13G2.

The reroute move does not account for capacitance, which is more relevant to timing closure on these PDKs.
It is possible to reroute a net to a lower-resistance path, but at significantly higher capacitance, which degrades timing.

Currently, we are missing an estimate_parasitics call before running the additional optimizations.
And as we are not changing placement with Reroute and VtSwap, there is no need for a legalization + incremental GRT post-repair_setup.

This prevents issues with another PR with Reroute move enhancements

designs/sky130hd/microwatt/rules-base.json updates:

Metric Old New Type
globalroute__antenna_diodes_count 1747 1692 Tighten
detailedroute__antenna__violating__nets 0 1 Failing
detailedroute__antenna_diodes_count 1297 1295 Tighten
finish__timing__setup__tns -312.0 -307.0 Tighten
finish__timing__hold__tns -5.02 -4.65 Tighten

jfgava added 4 commits July 8, 2026 16:08
…ng estimate_parasitics

Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
@jfgava jfgava self-assigned this Jul 8, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the global routing helper script to execute incremental global routing, detailed placement, and parasitics estimation unconditionally, while restricting the post-repair timing optimization to run conditionally based on the OPT_POST_GRT_WNS environment variable. Additionally, it defines OPT_POST_GRT_WNS as 0 across multiple platform configuration files. The reviewer feedback suggests using the conditional assignment operator ?= instead of = for OPT_POST_GRT_WNS in the platform configuration files to allow design-specific overrides.

export MAX_ROUTING_LAYER ?= Metal5
export DISABLE_VIA_GEN ?= 1

export OPT_POST_GRT_WNS = 0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using ?= instead of = allows design-specific configurations to override this platform default. In OpenROAD-flow-scripts, design-specific config.mk files are typically included before the platform config.mk, so a hard assignment with = will overwrite any design-specific settings. Changing this to ?= aligns with the other variables in this file and preserves user configurability.

export OPT_POST_GRT_WNS                      ?= 0

#export VIA_IN_PIN_MAX_LAYER ?= Metal1
#export DISABLE_VIA_GEN ?= 1

export OPT_POST_GRT_WNS = 0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using ?= instead of = allows design-specific configurations to override this platform default. In OpenROAD-flow-scripts, design-specific config.mk files are typically included before the platform config.mk, so a hard assignment with = will overwrite any design-specific settings. Changing this to ?= aligns with the other variables in this file and preserves user configurability.

export OPT_POST_GRT_WNS     ?= 0

export MIN_CLK_ROUTING_LAYER = metal4
export MAX_ROUTING_LAYER = metal10

export OPT_POST_GRT_WNS = 0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using ?= instead of = allows design-specific configurations to override this platform default. In OpenROAD-flow-scripts, design-specific config.mk files are typically included before the platform config.mk, so a hard assignment with = will overwrite any design-specific settings. Changing this to ?= aligns with the other variables in this file and preserves user configurability.

export OPT_POST_GRT_WNS ?= 0

export MIN_CLK_ROUTING_LAYER ?= met3
export MAX_ROUTING_LAYER ?= met5

export OPT_POST_GRT_WNS = 0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using ?= instead of = allows design-specific configurations to override this platform default. In OpenROAD-flow-scripts, design-specific config.mk files are typically included before the platform config.mk, so a hard assignment with = will overwrite any design-specific settings. Changing this to ?= aligns with the other variables in this file and preserves user configurability.

export OPT_POST_GRT_WNS ?= 0

export MIN_CLK_ROUTING_LAYER = met3
export MAX_ROUTING_LAYER = met5

export OPT_POST_GRT_WNS = 0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using ?= instead of = allows design-specific configurations to override this platform default. In OpenROAD-flow-scripts, design-specific config.mk files are typically included before the platform config.mk, so a hard assignment with = will overwrite any design-specific settings. Changing this to ?= aligns with the other variables in this file and preserves user configurability.

export OPT_POST_GRT_WNS ?= 0

Comment on lines -113 to -120
# Running DPL to fix overlapped instances
# Run to get modified net by DPL
log_cmd global_route -start_incremental
log_cmd detailed_placement {*}$dpl_args
log_cmd check_placement -verbose
# Route only the modified net by DPL
log_cmd global_route -end_incremental {*}$res_aware \
-congestion_report_file $::env(REPORTS_DIR)/congestion_post_repair_timing.rpt

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this no longer required?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm moving this part before the additional repair_timing.
VtSwap and Reroute do not change placement. So we don't need to legalize and run GRT incremental after it.

jfgava added 2 commits July 8, 2026 22:22
Signed-off-by: Jonas Gava <jfgava@precisioninno.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants