Skip to content

ant: Supports LEF58_ANTENNAGATEPLUSDIFF rule in ant and odb#10029

Open
QuantamHD wants to merge 3 commits intoThe-OpenROAD-Project:masterfrom
QuantamHD:lef_parsing_jetski
Open

ant: Supports LEF58_ANTENNAGATEPLUSDIFF rule in ant and odb#10029
QuantamHD wants to merge 3 commits intoThe-OpenROAD-Project:masterfrom
QuantamHD:lef_parsing_jetski

Conversation

@QuantamHD
Copy link
Copy Markdown
Collaborator

@QuantamHD QuantamHD commented Apr 1, 2026

Summary

This was mostly about me trying to use AntiGravity to see how well it could implement an unsupported LEF property in our PDK. It worked reasonably well. It needed some guiding, and my knowledge of the code did help.

Updated antenna checker to account for this lef property.

How par is calculated if LEF58_ANTENNAGATEPLUSDIFF is present

PAR = {(cutFactor * cut) * diffReducePWL(diff) - (minusDiffFactor * diff)} / {gatePWL(gate) + plusDiffProtect(diff)}

Updates schema and other properties to account for this rule.

ANTENNAGATEPLUSDIFF {OXIDE1 | OXIDE2 }
{plusDiffFactor |
PWL ((diffArea_1 plusDiffProtect_1) (diffArea_1 plusDiffProtect_2) ...)}

Technically this is supposed to support up to 32 different oxides, but the code as is hard codes it to 2 so I'm leaving that here.

Type of Change

Antenna check will now respect LEF58_ANTENNAGATEPLUSDIFF.

Impact

[How does this change the tool's behavior?]

Verification

  • [ x] I have verified that the local build succeeds (./etc/Build.sh).
  • [x ] I have run the relevant tests and they pass.
  • [x ] My code follows the repository's formatting guidelines.
  • [x ] I have signed my commits (DCO).

Updated antenna checker to account for this lef property.

Factor if LEF58_ANTENNAGATEPLUSDIFF is present

PAR = {(cutFactor * cut) * diffReducePWL(diff) - (minusDiffFactor * diff)} /
{gatePWL(gate) + plusDiffProtect(diff)}

Updates schema and other properties to account for this rule.

ANTENNAGATEPLUSDIFF {OXIDE1 | OXIDE2 }
{plusDiffFactor |
PWL ((diffArea_1 plusDiffProtect_1) (diffArea_1 plusDiffProtect_2) ...)}

Technically this is supposed to support up to 32 different oxides, but
the code as is hard codes it to 2 so I'm leaving that here.

Signed-off-by: Ethan Mahintorabi <ethanmoon@google.com>
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 implements support for LEF 5.8 ANTENNAGATEPLUSDIFF properties, enabling Piece-Wise Linear (PWL) definitions and oxide-specific antenna rules. Key changes include updating the AntennaChecker to incorporate PWL factors into PAR and PSR calculations, expanding the odb database schema to store ARuleRatio for gate plus diff values, and implementing a more robust parser in lefin to handle the new syntax. Feedback identifies several opportunities to reduce code duplication by extracting logic for protection factor calculation, property parsing, and antenna rule retrieval into shared helper functions to improve maintainability.

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

Signed-off-by: Ethan Mahintorabi <ethanmoon@google.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

Signed-off-by: Ethan Mahintorabi <ethanmoon@google.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

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

@QuantamHD
Copy link
Copy Markdown
Collaborator Author

@maliberty looks like the CI might have a problem. The email step is failing

@maliberty
Copy link
Copy Markdown
Member

@maliberty looks like the CI might have a problem. The email step is failing

known, @vvbandeira is looking at it

@maliberty maliberty requested a review from luis201420 April 2, 2026 13:51
Comment on lines 441 to 443
info.diff_PSR
= (side_metal_factor * info.side_area * diff_metal_reduce_factor)
/ info.iterm_gate_area;
Copy link
Copy Markdown
Collaborator Author

@QuantamHD QuantamHD Apr 3, 2026

Choose a reason for hiding this comment

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

@luis201420 I left it out from this PR, but it's not clear to me that if info.iterm_diff_area == 0 if we should attempt to do the PWL lookup and add it to info.iterm_gate_area. I noticed in all of our PDKs it would evaluate to 0 anyways, but again not clear if that should be included here as well

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