Skip to content

tap/psm: geom boost - #11267

Open
gadfort wants to merge 2 commits into
The-OpenROAD-Project:masterfrom
gadfort:misc-boost
Open

tap/psm: geom boost#11267
gadfort wants to merge 2 commits into
The-OpenROAD-Project:masterfrom
gadfort:misc-boost

Conversation

@gadfort

@gadfort gadfort commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Switch PSM and TAP to use the geom_boost converters instead of their own.

Type of Change

  • Refactoring

Impact

Should be a no-op

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).

Signed-off-by: Peter Gadfort <gadfort@zeroasic.com>
Signed-off-by: Peter Gadfort <gadfort@zeroasic.com>
@gadfort
gadfort requested review from a team as code owners August 30, 2026 13:45

@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 refactors the geometry types in the psm and tap modules to use odb::geom::BoostPolygon90 and odb::geom::BoostPolygon90WithHoles instead of direct boost::polygon aliases. It also optimizes row subtraction in Tapcell::getBoundaryAreas and simplifies Tapcell::getBoundaryEdges. A review comment points out a potential undefined behavior in Tapcell::getBoundaryEdges if the input polygon is empty, suggesting an early return guard.

Comment thread src/tap/src/tapcell.cpp
Comment on lines 667 to +669
std::vector<Edge> edges;

Polygon90::point_type prev_pt = *area.begin();
const odb::Point first_pt((*area.begin()).x(), (*area.begin()).y());

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.

high

If area is empty, calling area.begin() and dereferencing it with *area.begin() will result in undefined behavior (dereferencing an end iterator). A guard should be added to check if the polygon is empty before accessing its vertices.

  std::vector<Edge> edges;

  if (area.begin() == area.end()) {
    return edges;
  }

  const odb::Point first_pt((*area.begin()).x(), (*area.begin()).y());

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