Skip to content

gpl: report HPWL after global placement - #11201

Merged
osamahammad21 merged 1 commit into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:secure-gpl-hpwl-metric
Aug 24, 2026
Merged

gpl: report HPWL after global placement#11201
osamahammad21 merged 1 commit into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:secure-gpl-hpwl-metric

Conversation

@minjukim55

@minjukim55 minjukim55 commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

What

Global placement printed HPWL only inside its iteration table and wrote no wirelength metric, so neither the log nor a metrics file had a final global placement number. Now both:

[INFO GPL-1018] Final HPWL (um): 2597.56
"route__wirelength__estimated": 2597.56
void Replace::reportHpwlMetric()
{
  odb::dbBlock* block = db_->getChip()->getBlock();
  const int64_t hpwl = odb::WireLengthEvaluator(block).hpwl();
  log_->info(GPL, 1018, "Final HPWL (um): {:.2f}", block->dbuToMicrons(hpwl));
  log_->metric("route__wirelength__estimated", block->dbuToMicrons(hpwl));
}

Called at the end of Replace::doNesterovPlace(), after NesterovPlace::doNesterovPlace() has updated the db.

Why this name and this evaluator

route__wirelength__estimated measured with odb::WireLengthEvaluator is exactly what dpl reports (src/dpl/src/Opendp.cpp). Under ORFS metrics stages the two land as globalplace__route__wirelength__estimated and detailedplace__route__wirelength__estimated, measured the same way, so the gpl -> dpl HPWL delta is meaningful.

Testing

  • bazelisk test //src/gpl/...: 102/102 pass. 35 golden logs updated, each with exactly the one new line and nothing else, so placement results are unchanged.
  • openroad -metrics ... src/gpl/test/simple01.tcl writes "route__wirelength__estimated": 2597.56.

Note

global_placement -incremental runs nesterov up to twice, so the metric key can appear twice in one metrics file with the final value last (JSON readers keep the last). Same pattern grt already has with antenna_diodes_count.

Global placement printed HPWL only inside its iteration table, and wrote
no wirelength metric at all, so neither the log nor a metrics file had a
final global placement number to compare against the one dpl reports.

Report it both ways at the end of doNesterovPlace, measured with
odb::WireLengthEvaluator, the same evaluator dpl uses for the metric of
that name, so the global and detailed placement numbers are directly
comparable:

  [INFO GPL-1018] Final HPWL (um): 2597.56
  "route__wirelength__estimated": 2597.56

Golden logs updated for the new line, in src/gpl/test, src/odb/test and test/.

Signed-off-by: Minju Kim <mkim@precisioninno.com>
@minjukim55 minjukim55 self-assigned this Aug 21, 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 introduces a new method reportHpwlMetric to calculate, log, and record the final Half-Parameter Wire Length (HPWL) metric after global placement, updating various test expectations to reflect this new log output. The review feedback recommends adding defensive null checks for db_, the chip, and the block within reportHpwlMetric to prevent potential segmentation faults.

Comment thread src/gpl/src/replace.cpp
@maliberty

Copy link
Copy Markdown
Member

Ready for review?

Btw, you should move to replace ctest -L " gpl " with bazelisk test //src/gpl/... as we move away from cmake.

@minjukim55
minjukim55 marked this pull request as ready for review August 24, 2026 01:44
@minjukim55
minjukim55 requested review from a team as code owners August 24, 2026 01:44

@osamahammad21 osamahammad21 left a comment

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.

Approving for ODB ok file changes only

@osamahammad21
osamahammad21 merged commit b75d7e2 into The-OpenROAD-Project:master Aug 24, 2026
17 checks passed
@openroad-ci
openroad-ci deleted the secure-gpl-hpwl-metric branch August 24, 2026 15:28
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.

4 participants