AMF-Placer
2.0
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
|
GlobalPlacer accounts for the general iterations in global placement. More...
#include <GlobalPlacer.h>
Public Member Functions | |
GlobalPlacer (PlacementInfo *placementInfo, std::map< std::string, std::string > &JSONCfg, bool resetLegalizationInfo=true) | |
Construct a new Global Placer object based on placement information. More... | |
~GlobalPlacer () | |
void | clusterPlacement () |
cluster elements and conduct initial placement at coarse-grained level More... | |
void | GlobalPlacement_CLBElements (int iterNum, bool continuePreviousIteration=false, int lowerBoundIterNum=6, bool enableMacroPseudoNet2Site=false, bool stopStrictly=false, unsigned int spreadRegionBinNumLimit=10000000, PlacementTimingOptimizer *timingOptimizer=nullptr) |
wirelength optimization + cell spreading + legalization + area adjustion More... | |
void | GlobalPlacement_fixedCLB (int iterNum, float pseudoNetWeight) |
fix the locations of CLB and let macros move without low pseudo net at initial stages, e.g., just after initial placement More... | |
void | setPseudoNetWeight (float weight) |
Set the initial pseudo net weight for the global placer. More... | |
float | getPseudoNetWeight () |
Get the current pseudo net weight. More... | |
int | getMacroPseudoNetEnhanceCnt () |
Get the number of macro pseudo net enhancements. More... | |
float | getMacroLegalizationWeight () |
Get the current macro legalization weight object. More... | |
void | setMacroLegalizationParameters (int cnt, float macroLegalizationWeight) |
Set the macro legalization parameters (including legalization counter and pseudo net weight) More... | |
void | setMacroLegalizationFixed () |
fix the macro legalization result More... | |
void | setNeighborDisplacementUpperbound (float _threshold) |
Set the distance upperbound of neighbor LUT/FF-like elements for area adjustion. More... | |
void | spreading (int currentIteration, int spreadRegionSizeLimit=100000000, float displacementLimit=-10) |
cell spreading for all types of elements More... | |
WirelengthOptimizer * | getWirelengthOptimizer () |
int | timingDrivenDetailedPlacement_shortestPath_intermediate (PlacementTimingOptimizer *timingOptimizer) |
Private Member Functions | |
void | updatePseudoNetWeight (float &pseudoNetWeight, int curIter) |
update pseudo net weight according to placement progress More... | |
void | macroLegalize (int curIteration, bool timingDriven=false, PlacementTimingOptimizer *timingOptimizer=nullptr) |
legalize specific types of macro to the target regions More... | |
void | printPlacedUnits (std::ostream &os) |
void | dumpLUTCoordinate () |
void | dumpDSPCoordinate (bool enforced=false) |
void | dumpBRAMCoordinate (bool enforced=false) |
void | dumpFFCoordinate () |
void | dumpLUTFFCoordinate (bool enforced=false) |
void | dumpAllCellsCoordinate () |
void | dumpCARRYCoordinate () |
void | dumpCoord () |
float | random_float (float min, float max) |
Private Attributes | |
PlacementInfo * | placementInfo |
std::map< std::string, std::string > & | JSONCfg |
bool | verbose = false |
bool | dumpOptTrace = false |
float | y2xRatio = 1.0 |
bool | pseudoNetWeightConsiderNetNum = true |
set adaptive pseudo net weight according to net density More... | |
bool | disableSpreadingForgetRatio = false |
diable cell spreading forget ratio More... | |
ClusterPlacer * | clusterPlacer = nullptr |
cluster placer is used for initial placement More... | |
WirelengthOptimizer * | WLOptimizer = nullptr |
wirelength optimizer is based on numerial model and used to reduce the overall wirelength with various terms, e.g., terms for wirelength, legalization and timing... More... | |
GeneralSpreader * | generalSpreader = nullptr |
a general spreading will spread cells to meet cell density requirements More... | |
MacroLegalizer * | BRAMDSPLegalizer = nullptr |
legalize multi-site BRAM/DSP elements More... | |
MacroLegalizer * | CARRYMacroLegalizer = nullptr |
legalize multi-site CARRY elements More... | |
CLBLegalizer * | mCLBLegalizer = nullptr |
legalize single-site SLICEM-CLB elements More... | |
CLBLegalizer * | lCLBLegalizer = nullptr |
legalize single-site SLICEL-CLB elements More... | |
int | LUTCoordinateDumpCnt = 0 |
int | DSPCoordinateDumpCnt = 0 |
int | BRAMCoordinateDumpCnt = 0 |
int | FFCoordinateDumpCnt = 0 |
int | LUTFFCoordinateDumpCnt = 0 |
int | CARRYCoordinateDumpCnt = 0 |
int | allCoordinateDumpCnt = 0 |
float | spreadingForgetRatio = 0.2 |
we use the forget ratio to control the sensitivity of cell spreading during the location updateing (newFinalLoc = expectedLoc * forgetRatio + originalLoc * (1-forgetRatio) ) More... | |
float | progressRatio = 0.0 |
the similarity between upperbound wirelength and lowerbound wirelength More... | |
float | averageMacroLegalDisplacement = 100000 |
record the legalization displacement of DSP/BRAM More... | |
float | averageCarryLegalDisplacement = 100000 |
record the legalization displacement of CARRY More... | |
float | averageMCLBLegalDisplacement = 100000 |
record the legalization displacement of SLICEM-Macro More... | |
std::deque< float > | historyHPWLs |
record the change history of HPWL More... | |
float | minHPWL |
float | upperBoundHPWL |
upperbound HPWL is obtained just after cell spreading and legalization More... | |
float | lowerBoundHPWL |
lowerbound HPWL is obtained just after wirelength optimization More... | |
bool | updateMinHPWLAfterLegalization = false |
when legalization is started, the HPWL might have a significant change due to the legalization displacement/pseudo nets More... | |
bool | HPWLChangeLittle = false |
the small change of minHPWL might imply that the optimization converges. More... | |
bool | macrosBindedToSites = false |
macros are binded to sites and such binding will lead to pseudo nets between anchors and elements More... | |
bool | macroCloseToSite = false |
macros are located closely to their legalized locations More... | |
bool | macroLocked = false |
lock the macro binding and bypass serveral legalizaiton iterations for wirelength stable convergence More... | |
bool | macroLegalizationFixed = false |
fix the macros to the exact legal location More... | |
bool | directMacroLegalize = false |
directly legalize macros without the phase of rough legalization (each standard cell in a macro will be legalized separately) More... | |
bool | dumpClockUtilization = false |
bool | DSPCritical = false |
int | macroLockedIterCnt = 0 |
std::deque< float > | historyAverageDisplacement |
float | oriPseudoNetWeight = -1.0 |
record the pseudo net weight at the end of placement functions for later iterations. This information can be recorded in PlacementInfo for checkpoint dumping More... | |
float | pseudoNetWeight = 1.0 |
the pseudo net weight in the iterations of placement functions More... | |
float | neighborDisplacementUpperbound = -1.0 |
the distance threshold for the neighbor detection during area adjustion More... | |
bool | hasUserDefinedClusterInfo = false |
bool | enableClockRegionAware = false |
bool | timingOptEnabled = false |
bool | printHPWL = false |
GlobalPlacer accounts for the general iterations in global placement.
including wirelength optimization, cell spreading, legalization, area adjustion...
Definition at line 59 of file GlobalPlacer.h.
GlobalPlacer::GlobalPlacer | ( | PlacementInfo * | placementInfo, |
std::map< std::string, std::string > & | JSONCfg, | ||
bool | resetLegalizationInfo = true |
||
) |
Construct a new Global Placer object based on placement information.
placementInfo | the PlacementInfo for this placer to handle |
JSONCfg | the user-defined placement configuration |
resetLegalizationInfo |
Definition at line 31 of file GlobalPlacer.cc.
|
inline |
Definition at line 71 of file GlobalPlacer.h.
void GlobalPlacer::clusterPlacement | ( | ) |
cluster elements and conduct initial placement at coarse-grained level
Definition at line 122 of file GlobalPlacer.cc.
Referenced by AMFPlacer::run().
|
private |
Definition at line 864 of file GlobalPlacer.cc.
Referenced by dumpCoord().
|
private |
|
private |
Definition at line 768 of file GlobalPlacer.cc.
Referenced by dumpCoord().
|
private |
Definition at line 388 of file GlobalPlacer.cc.
Referenced by GlobalPlacement_CLBElements(), and GlobalPlacement_fixedCLB().
|
private |
Definition at line 1004 of file GlobalPlacer.cc.
Referenced by dumpCoord().
|
private |
Definition at line 816 of file GlobalPlacer.cc.
Referenced by dumpCoord().
|
private |
Definition at line 410 of file GlobalPlacer.cc.
Referenced by dumpCoord().
|
private |
Definition at line 906 of file GlobalPlacer.cc.
Referenced by dumpCoord(), and GlobalPlacement_CLBElements().
|
inline |
Get the current macro legalization weight object.
Definition at line 161 of file GlobalPlacer.h.
Referenced by AMFPlacer::run().
|
inline |
Get the number of macro pseudo net enhancements.
the macro legalization pseudo net will be enhanced as the number of previous enhancements is increased.
Definition at line 151 of file GlobalPlacer.h.
Referenced by AMFPlacer::run().
|
inline |
Get the current pseudo net weight.
usually we can record the current pseudo net weight for later placement-related procedure
Definition at line 139 of file GlobalPlacer.h.
Referenced by AMFPlacer::run().
|
inline |
Definition at line 207 of file GlobalPlacer.h.
Referenced by AMFPlacer::run().
void GlobalPlacer::GlobalPlacement_CLBElements | ( | int | iterNum, |
bool | continuePreviousIteration = false , |
||
int | lowerBoundIterNum = 6 , |
||
bool | enableMacroPseudoNet2Site = false , |
||
bool | stopStrictly = false , |
||
unsigned int | spreadRegionBinNumLimit = 10000000 , |
||
PlacementTimingOptimizer * | timingOptimizer = nullptr |
||
) |
wirelength optimization + cell spreading + legalization + area adjustion
iterNum | the current placement iteration |
continuePreviousIteration | whether we should use the information from previous iterations |
lowerBoundIterNum | the iteration number for the lower-bound wirelength optimization |
enableMacroPseudoNet2Site | enable pseudo nets for macro legalization |
stopStrictly | stop strictly even the placement wirelength metrics are not converged. |
spreadRegionBinNumLimit | the maximum number of bins in a spreadRegion |
timingOptimizer | the pointer of the timing optimizer (if nullptr, timing optimization will be disabled) |
Definition at line 128 of file GlobalPlacer.cc.
Referenced by AMFPlacer::run().
void GlobalPlacer::GlobalPlacement_fixedCLB | ( | int | iterNum, |
float | pseudoNetWeight | ||
) |
fix the locations of CLB and let macros move without low pseudo net at initial stages, e.g., just after initial placement
iterNum | current iteration number of global placement |
pseudoNetWeight | given pseudo net weight for non-CLB elements |
Definition at line 334 of file GlobalPlacer.cc.
Referenced by AMFPlacer::run().
|
private |
legalize specific types of macro to the target regions
curIteration | |
timingDriven | disable the evaluation of HPWL change but use check displacement change |
Definition at line 458 of file GlobalPlacer.cc.
Referenced by GlobalPlacement_CLBElements().
|
private |
|
inlineprivate |
Definition at line 310 of file GlobalPlacer.h.
|
inline |
fix the macro legalization result
Definition at line 181 of file GlobalPlacer.h.
|
inline |
Set the macro legalization parameters (including legalization counter and pseudo net weight)
cnt | the number of previous macro pseudo net enhancements |
macroLegalizationWeight | macro pseudo net weight |
Definition at line 172 of file GlobalPlacer.h.
Referenced by AMFPlacer::run().
|
inline |
Set the distance upperbound of neighbor LUT/FF-like elements for area adjustion.
_threshold | the distance upperbound |
Definition at line 191 of file GlobalPlacer.h.
Referenced by AMFPlacer::run().
|
inline |
Set the initial pseudo net weight for the global placer.
please note that this pseudo net will be updated according to the placement progress
weight |
Definition at line 127 of file GlobalPlacer.h.
Referenced by AMFPlacer::run().
void GlobalPlacer::spreading | ( | int | currentIteration, |
int | spreadRegionSizeLimit = 100000000 , |
||
float | displacementLimit = -10 |
||
) |
cell spreading for all types of elements
we make it public since sometime we allow external functions to call cell spreading for flexible improvement
currentIteration | the current global placement iteration in this round |
spreadRegionSizeLimit | the maximum number of bins in a spreadRegion |
displacementLimit |
Definition at line 618 of file GlobalPlacer.cc.
Referenced by GlobalPlacement_CLBElements().
int GlobalPlacer::timingDrivenDetailedPlacement_shortestPath_intermediate | ( | PlacementTimingOptimizer * | timingOptimizer | ) |
Definition at line 1196 of file GlobalPlacer.cc.
Referenced by GlobalPlacement_CLBElements().
|
private |
update pseudo net weight according to placement progress
pseudoNetWeight | current pseudo net weight for final convergence |
curIter | current iteration in the placement procedure |
Definition at line 668 of file GlobalPlacer.cc.
Referenced by GlobalPlacement_CLBElements().
|
private |
Definition at line 326 of file GlobalPlacer.h.
Referenced by dumpAllCellsCoordinate().
|
private |
record the legalization displacement of CARRY
Definition at line 351 of file GlobalPlacer.h.
Referenced by macroLegalize().
|
private |
record the legalization displacement of DSP/BRAM
Definition at line 345 of file GlobalPlacer.h.
Referenced by GlobalPlacement_CLBElements(), macroLegalize(), and updatePseudoNetWeight().
|
private |
record the legalization displacement of SLICEM-Macro
Definition at line 357 of file GlobalPlacer.h.
Referenced by macroLegalize().
|
private |
Definition at line 322 of file GlobalPlacer.h.
Referenced by dumpBRAMCoordinate().
|
private |
legalize multi-site BRAM/DSP elements
Definition at line 264 of file GlobalPlacer.h.
Referenced by GlobalPlacement_CLBElements(), GlobalPlacer(), macroLegalize(), updatePseudoNetWeight(), and ~GlobalPlacer().
|
private |
Definition at line 325 of file GlobalPlacer.h.
Referenced by dumpCARRYCoordinate().
|
private |
legalize multi-site CARRY elements
Definition at line 270 of file GlobalPlacer.h.
Referenced by GlobalPlacement_CLBElements(), GlobalPlacer(), macroLegalize(), and ~GlobalPlacer().
|
private |
cluster placer is used for initial placement
Definition at line 245 of file GlobalPlacer.h.
Referenced by clusterPlacement(), GlobalPlacer(), and ~GlobalPlacer().
|
private |
directly legalize macros without the phase of rough legalization (each standard cell in a macro will be legalized separately)
Definition at line 420 of file GlobalPlacer.h.
Referenced by GlobalPlacer(), and macroLegalize().
|
private |
diable cell spreading forget ratio
we use the forget ratio to control the sensitivity of cell spreading during the location updateing (newFinalLoc = expectedLoc * forgetRatio + originalLoc * (1-forgetRatio) )
Definition at line 239 of file GlobalPlacer.h.
Referenced by GlobalPlacer(), and updatePseudoNetWeight().
|
private |
Definition at line 321 of file GlobalPlacer.h.
Referenced by dumpDSPCoordinate().
|
private |
Definition at line 424 of file GlobalPlacer.h.
Referenced by GlobalPlacement_CLBElements(), and GlobalPlacer().
|
private |
Definition at line 422 of file GlobalPlacer.h.
Referenced by GlobalPlacement_CLBElements(), and GlobalPlacer().
|
private |
Definition at line 221 of file GlobalPlacer.h.
Referenced by GlobalPlacement_CLBElements(), GlobalPlacement_fixedCLB(), and GlobalPlacer().
|
private |
Definition at line 449 of file GlobalPlacer.h.
Referenced by macroLegalize(), spreading(), and updatePseudoNetWeight().
|
private |
Definition at line 323 of file GlobalPlacer.h.
Referenced by dumpFFCoordinate().
|
private |
a general spreading will spread cells to meet cell density requirements
Definition at line 258 of file GlobalPlacer.h.
Referenced by GlobalPlacement_fixedCLB(), spreading(), and ~GlobalPlacer().
|
private |
Definition at line 448 of file GlobalPlacer.h.
Referenced by GlobalPlacement_CLBElements(), and GlobalPlacer().
|
private |
Definition at line 427 of file GlobalPlacer.h.
Referenced by GlobalPlacement_CLBElements(), and macroLegalize().
|
private |
record the change history of HPWL
Definition at line 363 of file GlobalPlacer.h.
Referenced by GlobalPlacer(), and updatePseudoNetWeight().
|
private |
the small change of minHPWL might imply that the optimization converges.
Definition at line 389 of file GlobalPlacer.h.
Referenced by GlobalPlacement_CLBElements(), and updatePseudoNetWeight().
|
private |
Definition at line 219 of file GlobalPlacer.h.
Referenced by dumpAllCellsCoordinate(), dumpBRAMCoordinate(), dumpCARRYCoordinate(), dumpDSPCoordinate(), dumpFFCoordinate(), dumpLUTCoordinate(), dumpLUTFFCoordinate(), GlobalPlacement_CLBElements(), GlobalPlacer(), and spreading().
|
private |
legalize single-site SLICEL-CLB elements
Definition at line 282 of file GlobalPlacer.h.
Referenced by GlobalPlacer(), and ~GlobalPlacer().
|
private |
lowerbound HPWL is obtained just after wirelength optimization
Definition at line 376 of file GlobalPlacer.h.
Referenced by GlobalPlacement_CLBElements(), and updatePseudoNetWeight().
|
private |
Definition at line 320 of file GlobalPlacer.h.
Referenced by dumpLUTCoordinate().
|
private |
Definition at line 324 of file GlobalPlacer.h.
Referenced by dumpLUTFFCoordinate().
|
private |
macros are located closely to their legalized locations
Definition at line 401 of file GlobalPlacer.h.
Referenced by GlobalPlacement_CLBElements(), and macroLegalize().
|
private |
fix the macros to the exact legal location
Definition at line 413 of file GlobalPlacer.h.
Referenced by GlobalPlacement_CLBElements(), macroLegalize(), setMacroLegalizationFixed(), and spreading().
|
private |
lock the macro binding and bypass serveral legalizaiton iterations for wirelength stable convergence
Definition at line 407 of file GlobalPlacer.h.
Referenced by macroLegalize().
|
private |
Definition at line 426 of file GlobalPlacer.h.
Referenced by macroLegalize().
|
private |
macros are binded to sites and such binding will lead to pseudo nets between anchors and elements
Definition at line 395 of file GlobalPlacer.h.
Referenced by macroLegalize().
|
private |
legalize single-site SLICEM-CLB elements
Definition at line 276 of file GlobalPlacer.h.
Referenced by GlobalPlacement_CLBElements(), GlobalPlacer(), macroLegalize(), and ~GlobalPlacer().
|
private |
Definition at line 364 of file GlobalPlacer.h.
Referenced by GlobalPlacement_CLBElements(), GlobalPlacer(), and updatePseudoNetWeight().
|
private |
the distance threshold for the neighbor detection during area adjustion
Definition at line 446 of file GlobalPlacer.h.
Referenced by setNeighborDisplacementUpperbound(), and spreading().
|
private |
record the pseudo net weight at the end of placement functions for later iterations. This information can be recorded in PlacementInfo for checkpoint dumping
Definition at line 434 of file GlobalPlacer.h.
Referenced by getPseudoNetWeight(), GlobalPlacement_CLBElements(), and setPseudoNetWeight().
|
private |
Definition at line 216 of file GlobalPlacer.h.
Referenced by clusterPlacement(), dumpAllCellsCoordinate(), dumpBRAMCoordinate(), dumpCARRYCoordinate(), dumpDSPCoordinate(), dumpFFCoordinate(), dumpLUTCoordinate(), dumpLUTFFCoordinate(), GlobalPlacement_CLBElements(), GlobalPlacement_fixedCLB(), GlobalPlacer(), macroLegalize(), printPlacedUnits(), spreading(), timingDrivenDetailedPlacement_shortestPath_intermediate(), and updatePseudoNetWeight().
|
private |
Definition at line 451 of file GlobalPlacer.h.
Referenced by GlobalPlacement_CLBElements(), and GlobalPlacer().
|
private |
the similarity between upperbound wirelength and lowerbound wirelength
Definition at line 339 of file GlobalPlacer.h.
Referenced by GlobalPlacement_CLBElements(), macroLegalize(), spreading(), and updatePseudoNetWeight().
|
private |
the pseudo net weight in the iterations of placement functions
Definition at line 440 of file GlobalPlacer.h.
Referenced by GlobalPlacement_CLBElements(), GlobalPlacement_fixedCLB(), and updatePseudoNetWeight().
|
private |
set adaptive pseudo net weight according to net density
we assign higher weight for the pseudo nets between anchors and elements which connects to more nets
Definition at line 230 of file GlobalPlacer.h.
Referenced by GlobalPlacement_CLBElements(), and GlobalPlacer().
|
private |
we use the forget ratio to control the sensitivity of cell spreading during the location updateing (newFinalLoc = expectedLoc * forgetRatio + originalLoc * (1-forgetRatio) )
Definition at line 333 of file GlobalPlacer.h.
Referenced by GlobalPlacement_CLBElements(), spreading(), and updatePseudoNetWeight().
|
private |
Definition at line 450 of file GlobalPlacer.h.
Referenced by GlobalPlacement_CLBElements().
|
private |
when legalization is started, the HPWL might have a significant change due to the legalization displacement/pseudo nets
Definition at line 383 of file GlobalPlacer.h.
Referenced by GlobalPlacement_CLBElements(), and updatePseudoNetWeight().
|
private |
upperbound HPWL is obtained just after cell spreading and legalization
Definition at line 370 of file GlobalPlacer.h.
Referenced by GlobalPlacement_CLBElements(), and updatePseudoNetWeight().
|
private |
Definition at line 220 of file GlobalPlacer.h.
Referenced by GlobalPlacer(), and spreading().
|
private |
wirelength optimizer is based on numerial model and used to reduce the overall wirelength with various terms, e.g., terms for wirelength, legalization and timing...
Definition at line 252 of file GlobalPlacer.h.
Referenced by getMacroLegalizationWeight(), getMacroPseudoNetEnhanceCnt(), getWirelengthOptimizer(), GlobalPlacement_CLBElements(), GlobalPlacement_fixedCLB(), GlobalPlacer(), setMacroLegalizationParameters(), and ~GlobalPlacer().
|
private |
Definition at line 222 of file GlobalPlacer.h.
Referenced by GlobalPlacer().