Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a slightly different version of : #8873
It serves exactly the same purpose : to reduce DRWL under high core utilization.
The differences between this and v1 in terms of QoR on our end have been too close to call.
We are submitting this as an alternative, as we believe there are confidential instances which can determine which is better.
As with v1, please only test circuits at or near the highest core utilization at which they will complete the flow.
Please also use a reasonable variation (2-4 choices each) of hyperparameters.
--AI Generated content follows--
Description
This PR introduces a new Two-Pass Power-Aware Detailed Placement Optimization flow to the detailed placer (DPL). This enhancement aims to reduce routed wirelength and power consumption by iteratively refining cell placement based on a hybrid cost function that balances HPWL and power density.
Motivation:
Standard detailed placement primarily focuses on legalization and wirelength minimization. By incorporating power density awareness and a multi-pass budget-constrained approach, this PR allows the placer to make more informed swaps that can reduce routing congestion and power hotspots without significantly degrading timing.
Key Features and Changes:
Two-Pass Optimization Flow (
DetailedGlobalSwap::run):src/dpl/src/optimization/detailed_global.h: Added private member variables (budget_hpwl_,is_profiling_pass_,tradeoff_,power_contribution_,power_weight_) and new private methods (generateWirelengthOptimalMove,generateRandomMove,calculateAdaptivePowerWeight).src/dpl/src/optimization/detailed_global.cxx: Rewrote therunandglobalSwapmethods to implement the two-pass flow. Added new helper functions (generateWirelengthOptimalMove,generateRandomMove,calculateAdaptivePowerWeight).Power Density Awareness (
Grid):Gridclass now tracks and computes power density across its pixels, enabling the placer to identify and mitigate power hotspots.src/dpl/src/infrastructure/Grid.h: Added public methodscomputePowerDensityMap,updatePowerDensity,getPowerDensity, and a private helpernormalizeAndUpdatePowerDensity. Added new member variables:power_density_,total_area_,total_pins_,area_weight_,pin_weight_.src/dpl/src/infrastructure/Grid.cpp: Implemented the new power density computation and update logic. Also added missing#include "network.h"forNetworkclass usage.Enhanced Padding Handling (
Pixelstruct):Pixelstruct'spadding_reserved_bymember was updated from a singleNode*pointer to anstd::unordered_set<Node*>. This allows multiple cells to reserve padding on the same pixel, supporting more complex spacing rules.src/dpl/src/infrastructure/Grid.h: Modified thePixelstruct.src/dpl/src/infrastructure/Grid.cpp: UpdatederasePixelandpaintCellPaddingmethods to correctly interact with thestd::unordered_set.src/dpl/src/Opendp.cpp: ModifiedsetFixedGridCellsto useinsert()forpadding_reserved_by.src/dpl/src/PlacementDRC.cpp: ModifiedcheckPaddingto iterate over thepadding_reserved_byset for conflict detection.Journaling Improvements (
Journal):Journalclass was updated to provide mutable access and support range-based for loops, which are critical for the undo/redo mechanisms used in the multi-pass optimization.src/dpl/src/util/journal.h: Addedbegin()andend()methods.src/dpl/src/optimization/detailed_manager.h: UpdatedgetJournal()to return a non-const reference.How to Enable/Disable and Hyperparameters:
The power-aware detailed placement optimization is controlled by the
ENABLE_DPOenvironment variable or configuration setting.Enabling/Disabling:
ENABLE_DPO = 1inflow/scripts/variables.yaml, which is read by the flow scripts.ENABLE_DPO = 0in yourconfig.mkfor a specific design or exportexport ENABLE_DPO=0in your shell environment before running the flow.Exposed Hyperparameters (via
improve_placementcommand arguments):-p <passes>: Sets the number of optimization passes (default: 1).-t <tolerance>: Sets the tolerance for HPWL improvement to stop early (default: 0.01).-x <tradeoff_value>: Controls the trade-off between wirelength-optimal moves and random exploration for power optimization. Value ranges from 0.0 (pure wirelength) to 1.0 (full exploration for power) (default: 0.2).DPO_MAX_DISPLACEMENT <disp_x> <disp_y>: Specifies the maximum allowed displacement for instances during optimization. This can be set in aconfig.mkfile (e.g.,export DPO_MAX_DISPLACEMENT = "100 20"). If unset, adaptive displacement limits are used by the flow (chip dimensions in early iterations, then scaled versions of the original displacement limits).Internal Hyperparameters (not directly exposed via Tcl commands):
num_samples(150): Number of random swaps sampled internally for adaptive power weight calculation.user_knob(35.0): Tuning parameter within adaptive weight calculation to prioritize power over HPWL.