Skip to content

dpl: modify negotiation drc penalty and debug mode options#10681

Open
gudeh wants to merge 16 commits into
The-OpenROAD-Project:masterfrom
gudeh:dpl-drc-penalty-and-debug
Open

dpl: modify negotiation drc penalty and debug mode options#10681
gudeh wants to merge 16 commits into
The-OpenROAD-Project:masterfrom
gudeh:dpl-drc-penalty-and-debug

Conversation

@gudeh

@gudeh gudeh commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Modify default DRC penalty value. Parametrize search window range and DRC penalty. A few debug mode changes. Some variables renamings.

Functional changes:
Tunable DRC penalty. Modifiable via the new -drc_penalty option; default is kDrcPenalty = 5.0. Reduce the previous default DRC penalty relative to the previous hardcoded value of 1000. This means we allow for DRCs occurrences during initial negotiation iterations, while solving them on later iterations.

New TCL options:

  • -drc_penalty: base DRC penalty, scaled per iteration.
  • -site_search_window / -row_search_window: parametrize the former kHorizWindow (20) / kAdjWindow (5) constants (renamed to site_search_window_ / row_search_window_. Defaults unchanged).

Debug / visualization

  • Reworked iterative mode: stops every major iteration; adds -iterative_start and an iterative_jump interval.
  • Prior-iteration moves drawn in grey; current-iteration movers colored.
  • Stuck-cell counters and printing.
    • For some corner cases cells may not move (they get "stuck", for example if it is on top of a macro and the search window can't reach outside the macro), for such cases we report with printStuckSummary().
  • Renamed setDplPositions→commitNegotiationPosToDpl and flushToDb→commitNegotiationPosToOdb.

Reporting

  • gpl-style violations table (total violations / illegal cells / illegal sites) with capped line count.
  • "overflow" terminology renamed to "violations".

Type of Change

  • Bug fix
  • Refactoring

Impact

The previous behavior of focusing on DRCs at initial iterations when there are multiple overlaps does not make sense. DRCs should be solved later on.

At least one private design wasn't converging because of this.

Verification

  • I have verified that the local build succeeds (./etc/Build.sh).
  • I have run the relevant tests and they pass.
  • My code follows the repository's formatting guidelines.
  • I have signed my commits (DCO).

Related Issues

This is one of multiple PRs splitting up PR #10226 to make Negotiation the default algorithm at DPL.

gudeh added 11 commits June 10, 2026 21:52
stop every iteration on iterative mode, include stop on final state,
introduce iterative_jump to stop at desired iteration

Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
…oves in grey, track current-iter movers

Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
…sites,

print table similar to gpl with controled number of lines, less verbose,
rename overflow to violations

Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
this fix a debug visualization bug,
also rename some functions for better clarity

Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
include more debug info for stuck cells

Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
@gudeh gudeh requested a review from a team as a code owner June 17, 2026 16:00
@gudeh gudeh requested a review from osamahammad21 June 17, 2026 16:00

@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 introduces configurable search windows and DRC penalties for the NegotiationLegalizer, adds new debugging parameters, and integrates a GUI chart to visualize legalization progress. Feedback on the changes highlights two issues: a logic bug in findBestLocation that causes stuck cells to be double-counted when no valid candidate is found, and an overly restrictive TCL validation check on -iterative_start that incorrectly rejects the valid value of 0.

Comment thread src/dpl/src/NegotiationLegalizerPass.cpp Outdated
Comment thread src/dpl/src/Opendp.tcl
Comment on lines +362 to +366
set iterative_start 0
if { [info exists keys(-iterative_start)] } {
set iterative_start $keys(-iterative_start)
sta::check_positive_integer "-iterative_start" $iterative_start
}

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

The -iterative_start option specifies the iteration from which debugging/visualization should start. The default value is 0 (start from the very first iteration), and Opendp::setNegotiationDebugStart explicitly clamps the value to std::max(0, iterative_start), making 0 a perfectly valid value.

However, using sta::check_positive_integer on -iterative_start will reject 0 as an invalid value, preventing users from explicitly specifying -iterative_start 0 in their scripts. Using sta::check_integer and manually verifying that the value is non-negative is a more robust approach.

  set iterative_start 0
  if { [info exists keys(-iterative_start)] } {
    set iterative_start $keys(-iterative_start)
    sta::check_integer "-iterative_start" $iterative_start
    if { $iterative_start < 0 } {
      sta::error DPL 33 "-iterative_start must be non-negative"
    }
  }

gudeh added 2 commits June 18, 2026 14:01
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
@gudeh gudeh requested a review from eder-matheus June 18, 2026 14:49
@eder-matheus

Copy link
Copy Markdown
Member

@codex review

@gudeh

gudeh commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

This one includes a parametrization of the search window because there was some overlap with code change on the DRC penalty.

There should be another PR after this one to make the search window dynamically adjustable with the instance size. The base value should be the one modifiable by TCL

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 7fc4d0a401

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@eder-matheus

Copy link
Copy Markdown
Member

@gudeh Please check clang-tidy and bazel unit tests failures.

gudeh added 3 commits June 18, 2026 20:00
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
…e should be added on a future PR

Signed-off-by: Augusto Berndt <augusto.berndt@precisioninno.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants