Skip to content

DRT: filter unsupported rules at io and fix minarea in FlexGC#10180

Open
openroad-ci wants to merge 5 commits intoThe-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:TR-rules
Open

DRT: filter unsupported rules at io and fix minarea in FlexGC#10180
openroad-ci wants to merge 5 commits intoThe-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:TR-rules

Conversation

@openroad-ci
Copy link
Copy Markdown
Collaborator

@openroad-ci openroad-ci commented Apr 18, 2026

Summary

refactor(drt): filter unsupported rules at IO instead of GC

Unsupported LEF58_AREA and LEF58_CUTSPACING sub-branches were accepted in io.cpp but warned per-invocation in GC — noisy and wasteful. Reject them once at parse time, skip storing. In addition, the logic for checking the LEF58_AREA rules was flawed.

  • LEF58_AREA: filter EXCEPTMINWIDTH, EXCEPTEDGELENGTH, EXCEPTMINSIZE, EXCEPTSTEP, MASK, LAYER branches in io.cpp
  • LEF58_SPACING ADJACENTCUTS: filter EXACTALIGNED, EXCEPTSAMEPGNET, TO ALL, SIDEPARALLELOVERLAP, SAMEMASK branches in io.cpp
  • LEF58_SPACING LAYER: filter STACK, ORTHOGONALSPACING, SHORTEDGEONLY, WIDTH, PARALLEL, EDGELENGTH, EXTENSION, ABOVEWIDTH, MASKOVERLAP, WRONGDIRECTION branches in io.cpp
  • Fix LEF58_AREA check logic: sort by area descending, patch once for largest applicable constraint; separate rectWidth constraints into own sorted vector for correct priority
  • Remove dead check_rect_width flag and no-op edge loop from GC
  • Drop redundant unsupported-branch warnings and stubs from GC

Type of Change

  • Bug fix
  • Breaking change
  • Refactoring

Impact

This is expected to change how DRT patches for min area rules.

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: osamahammad21 <osama21@aucegypt.edu>
Signed-off-by: osamahammad21 <osama21@aucegypt.edu>
Signed-off-by: osamahammad21 <osama21@aucegypt.edu>
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 handling of LEF58 area constraints by separating them into general area and rectwidth-specific lists, ensuring they are sorted for optimized checking. It also updates the parser to skip unsupported LEF58 rule branches and refactors the geometric verification logic. Feedback identifies a logic bug in the area check where non-rectangle shapes could prematurely skip constraints, notes that RECTWIDTH comparisons should be inclusive to match the LEF58 specification, and highlights a potential null pointer dereference for drWorker_.

Comment thread src/drt/src/gc/FlexGC_main.cpp Outdated
Comment thread src/drt/src/gc/FlexGC_main.cpp
Comment thread src/drt/src/gc/FlexGC_main.cpp Outdated
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

lef58AreaConstraints_.push_back(in);
// This vector should be sorted by area in a descending order
auto area = in->getODBRule()->getArea();
auto it = std::ranges::lower_bound(lef58AreaConstraints_.begin(),
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.

warning: no header providing "std::ranges::lower_bound" is directly included [misc-include-cleaner]

src/drt/src/db/tech/frLayer.h:5:

- #include <algorithm>
+ #include <bits/ranges_algo.h>
+ #include <algorithm>

Signed-off-by: osamahammad21 <osama21@aucegypt.edu>
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.

2 participants