Skip to content

Conversation

@MrAMS
Copy link
Contributor

@MrAMS MrAMS commented Dec 7, 2025

Summary
This PR fixes two critical bugs in place_and_route/private/benchmark.bzl that caused incorrect PPA (Power-Performance-Area) metric reporting from OpenROAD logs.

Changes

  1. Fix clock_period_ps extraction:

    • Issue: Previously, the regex /clk / was too restrictive and only matched clocks explicitly named "clk". This resulted in clock_period_ps being 0 for clocks named "core_clock", "sys_clk", etc.
    • Fix: Updated the awk command to robustly match any clock name in the OpenROAD timing table.
  2. Fix fmax_ghz unit mismatch:

    • Issue: OpenROAD reports fmax in MHz, but the proto field fmax_ghz expects GHz. This resulted in values being off by a factor of 1000 (e.g., 218 MHz reported as 218 GHz).
    • Fix: Added division by 1000.0 in the extraction logic to correctly convert MHz to GHz.

Verification
Verified locally. clock_period_ps now captures the correct period (e.g., 1250 ps) instead of 0, and fmax_ghz now reports realistic values (e.g., 0.218 GHz instead of 218.56 GHz).

@MrAMS MrAMS changed the title fix(benchmark): correct clock period extraction and fmax units fix(place_and_route): correct clock period extraction and fmax units Dec 7, 2025
- Fix clock period extraction to match any clock name (not just 'clk')
- Fix fmax unit conversion from MHz to GHz

Fixes parsing of report_clock_properties and report_clock_min_period
output for accurate PPA reporting.
@MrAMS MrAMS force-pushed the fix-clock_name-and-fmax branch from 0a694e4 to 16ef289 Compare December 7, 2025 10:09
@MrAMS
Copy link
Contributor Author

MrAMS commented Dec 7, 2025

related pr#418

@mikesinouye
Copy link
Collaborator

/gcbrun

@MrAMS
Copy link
Contributor Author

MrAMS commented Dec 9, 2025

CI passed, please review at your convenience ❤️

@mikesinouye
Copy link
Collaborator

Thanks for the fix!

@mikesinouye mikesinouye merged commit 390ad43 into hdl:main Dec 9, 2025
4 checks passed
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