rsz: BufferToInverters move#10662
Conversation
Signed-off-by: Eren Dogan <erendogan@google.com>
There was a problem hiding this comment.
Code Review
This pull request introduces a new optimization move, InvBuffer, which replaces a single buffer instance with a pair of cascaded inverters to reduce wire delay. The implementation includes the new InvBufferCandidate and InvBufferGenerator classes, integration into the optimization policies, CLI/Python interface updates, and new unit tests for flat and hierarchical designs. The review feedback highlights several critical improvement opportunities: resolving a logical bug where footprint matching prevents finding valid inverter replacements when -match_cell_footprint is enabled, handling block terminals (BTerms) to ensure accurate physical placement when drivers or loads are ports, and adding defensive nullptr checks on instance creation to prevent potential crashes.
| if (run_config_.match_cell_footprint && !drvr_footprint.empty() | ||
| && !cell->footprint().empty() | ||
| && drvr_footprint != cell->footprint()) { | ||
| continue; | ||
| } |
There was a problem hiding this comment.
In InvBufferGenerator::generate, the footprint matching check compares the footprint of the original buffer (drvr_footprint) with the footprint of the candidate inverter (cell->footprint()). Since buffers and inverters have different functions, they will almost always have different footprints in Liberty libraries (e.g., buf vs inv). If -match_cell_footprint is enabled, this check will prevent the generator from finding any valid inverter replacement, effectively disabling the InvBuffer move. This check should be removed, or replaced with a Vt-matching check if the goal is to match the threshold voltage class.
Signed-off-by: Eren Dogan <erendogan@google.com>
Signed-off-by: Eren Dogan <erendogan@google.com>
Signed-off-by: Eren Dogan <erendogan@google.com>
Signed-off-by: Eren Dogan <erendogan@google.com>
Summary
This PR introduces a new inverter buffering move, which replaces a buffer with two inverters uniformly placed along the fanout (
--(1/3 wire)--> inv1 --(1/3 wire)--> inv2 --(1/3 wire)-->).Type of Change
Impact
The new move isn't enabled by default. It can be enabled by adding it to the move sequence, like
repair_timing -sequence "unbuffer vt_swap sizeup swap buffer clone split buffer_to_inverters". I have run public CI benchmarks and have seen an average improvement when this move is appended to the default sequence in post-CTS and post-GRT timing repair.Verification
./etc/Build.sh).