Skip to content

ord: move report design metrics to c++#10051

Open
gadfort wants to merge 5 commits intoThe-OpenROAD-Project:masterfrom
gadfort:designmetrics
Open

ord: move report design metrics to c++#10051
gadfort wants to merge 5 commits intoThe-OpenROAD-Project:masterfrom
gadfort:designmetrics

Conversation

@gadfort
Copy link
Copy Markdown
Collaborator

@gadfort gadfort commented Apr 4, 2026

Summary

Convert report_design_area_metrics to C++ from tcl.
I put it in openroad.cc, but open to suggestions if that isn't the right place for it.

Type of Change

  • Refactoring

Impact

No change, but on large design the call to report_design_area_metrics goes from 70s to 428ms.

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

N/A

@gadfort gadfort requested a review from maliberty April 4, 2026 00:16
Signed-off-by: Peter Gadfort <gadfort@zeroasic.com>
Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

Copy link
Copy Markdown
Contributor

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

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 design area metrics reporting from Tcl to C++ by implementing a new designMetrics method in the OpenRoad class. Key feedback includes a critical fix for a unit mismatch in utilization calculations where DBUs were incorrectly compared with microns. It is also recommended to remove the design__nets metric for consistency with the original Tcl implementation and to optimize row and site counting by using site pointers as map keys instead of strings.

src/OpenRoad.cc Outdated
const double total_active_area = stdcell_area + macro_area;

logger_->metric("design__io", num_ios);
logger_->metric("design__nets", block->getNets().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

This metric (design__nets) was not present in the original Tcl implementation. While it might be a useful addition, the PR summary states that there is "No change" in impact. If the goal is a direct refactoring, this should be removed to maintain consistency with the previous output.

Signed-off-by: Peter Gadfort <gadfort@zeroasic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 2026

clang-tidy review says "All clean, LGTM! 👍"

@maliberty
Copy link
Copy Markdown
Member

As it only depends on odb perhaps putting in src/odb/include/odb/util.h / src/odb/src/zutil/util.cpp would be a good scope.

Signed-off-by: Peter Gadfort <gadfort@zeroasic.com>
@gadfort
Copy link
Copy Markdown
Collaborator Author

gadfort commented Apr 4, 2026

@maliberty I moved it, but left the swig stuff in openroad.i since it needs access to the logger and I couldn't see how to do that elsewhere.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 2026

clang-tidy review says "All clean, LGTM! 👍"

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 6, 2026

clang-tidy review says "All clean, LGTM! 👍"

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

clang-tidy review says "All clean, LGTM! 👍"

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