Skip to content

dbSta/mpl: report_qor + report_macro_placement (read-only QoR reports)#10855

Draft
saurav-fermions wants to merge 2 commits into
The-OpenROAD-Project:masterfrom
Fermions-ASI:feat/qor-reporting
Draft

dbSta/mpl: report_qor + report_macro_placement (read-only QoR reports)#10855
saurav-fermions wants to merge 2 commits into
The-OpenROAD-Project:masterfrom
Fermions-ASI:feat/qor-reporting

Conversation

@saurav-fermions

Copy link
Copy Markdown
Contributor

Summary

Two read-only, additive QoR reporting commands.

  1. report_qor (dbSta) — aggregates metrics OpenROAD already computes (design size, area/utilization, setup/hold timing, power, clock skew, DRC marker counts) into one concise sign-off summary. Text and -json output, -digits option. Sections whose prerequisites are missing (no clock/liberty/parasitics) degrade gracefully to n/a (text) / null (JSON) and never error.
  2. report_macro_placement (mpl) — read-only macro-placement QoR command.

Both recompute nothing and mutate no design/timing state; every reported value is the read side of an existing command/API.

Testing

Built openroad; report_qor1, report_qor_graceful, and report_macro_placement1 pass. (Updated the mpl golden for a Macros to be placed: info line added upstream since the bundle base.)

Notes

Add a read-only, additive report_qor command to dbSta that aggregates
metrics OpenROAD already computes (design size, area/utilization,
setup/hold timing, power, clock skew, DRC marker counts) into one
concise sign-off summary. Supports text and -json output and a -digits
option.

The command recomputes nothing and changes no design or timing state:
every value is the read side of an existing command/API. Sections whose
prerequisites are missing (no clock, no liberty, no parasitics/routing)
degrade gracefully to n/a (text) / null (JSON) and never error on a
partially set-up design.

Adds two integration tests with dual CMake+Bazel registration:
- report_qor1: full flow (liberty+LEF+DEF+SDC+estimate_parasitics),
  asserts expected sections and plausible values, and verifies timing /
  report_checks are byte-identical before and after report_qor.
- report_qor_graceful: LEF+DEF only, verifies no error and n/a/null
  degradation for timing/power/clock/DRC.

All 75 dbSta tests pass.



Signed-off-by: Saurav Singh <saurav.singh@fermions.co>
@github-actions github-actions Bot added the size/L label Jul 9, 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 two new read-only QoR reporting commands: report_qor in dbSta (aggregating design size, area, timing, power, clock skew, and DRC violations in text or JSON format) and report_macro_placement in mpl (reporting post-placement metrics for macros such as area, packing efficiency, HPWL, boundary spacing, and channel gaps). The review feedback highlights a precision loss issue in src/mpl/src/report.cpp due to integer division in the average boundary spacing calculation, which should be performed in double precision after converting to microns.

Comment thread src/mpl/src/report.cpp Outdated
Comment on lines +148 to +149
const double avg_boundary_spacing
= block->dbuToMicrons(sum_boundary_dbu / static_cast<int>(macros.size()));

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 average boundary spacing calculation performs integer division (sum_boundary_dbu / static_cast<int>(macros.size())), which discards the fractional part in DBUs before converting to microns [11.1.1]. To preserve precision and avoid integer truncation, perform the division in double precision after converting the sum to microns.

Suggested change
const double avg_boundary_spacing
= block->dbuToMicrons(sum_boundary_dbu / static_cast<int>(macros.size()));
const double avg_boundary_spacing
= block->dbuToMicrons(sum_boundary_dbu) / macros.size();

Adds an additive, read-only analysis command that reports post-placement
macro QoR from the final ODB: placed-macro count and area, bounding-box
dead space / packing efficiency, total and macro-net HPWL, min/avg
boundary spacing, min macro-to-macro channel gap (and overlap count), and
a per-macro location/orientation/area table. Also emits machine-readable
macro_place__* metrics.

The command never mutates the database, so default macro placement is
unchanged (verified byte-identical on the macro_only test). Documented in
the mpl README and covered by a new regression test
(report_macro_placement1) registered in both CMake and Bazel; the full
'^mpl' ctest suite (35/35) and the mpl doc-parity checks pass.



Signed-off-by: Saurav Singh <saurav.singh@fermions.co>
@saurav-fermions

Copy link
Copy Markdown
Contributor Author

Thanks — this is a draft (the report_qor regressions reuse the aocv_derate.def/.sdc fixtures introduced by #10846, so they need that to land). Addressed:

  • Integer division in the average boundary-spacing (mpl/report.cpp): now divides in micron space as a double (dbuToMicrons(sum) / count) so the average keeps fractional precision.
  • Removed an accidental src/sta bump.

report_signoff_timing from the same internal set is intentionally not here — it consolidates the SI/AOCV/POCV features and will follow as a PR stacked on #10846 + #10853.

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.

1 participant