AMF-Placer
2.0
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
|
MacroLegalizer maps DSP/BRAM/CARRY macros to legal location. More...
#include <MacroLegalizer.h>
Public Member Functions | |
MacroLegalizer (std::string legalizerName, PlacementInfo *placementInfo, DeviceInfo *deviceInfo, std::vector< DesignInfo::DesignCellType > ¯oTypesToLegalize, std::map< std::string, std::string > &JSONCfg) | |
Construct a new MacroLegalizer object. More... | |
~MacroLegalizer () | |
void | legalize (bool exactLegalization=false, bool directLegalization=false, bool _timingDrivenLegalize=false) |
conduct legalization and map the PlacementUnit of one of the given types to sites More... | |
float | getAverageDisplacementOfExactLegalization () |
Get the average displacement of exact legalization for the involved PlacementUnit. More... | |
float | getAverageDisplacementOfRoughLegalization () |
Get the average displacement of rough legalization for the involved PlacementUnit. More... | |
void | dumpMatching (bool fixedColumn=false, bool enforce=false) |
void | setIntitialParameters (float displacementThr, int candidateNum, int _candidateFactor=-1) |
Set the intitial parameters of the legalizer. More... | |
void | resetSitesMapped () |
reset the mapped flag of the involved sites. More... | |
void | setClockRegionAware (bool _clockRegionAware) |
void | setClockRegionCasLegalization (bool _clockRegionCasLegalization) |
bool | hasNoTarget () |
Private Member Functions | |
void | getMacrosToLegalize () |
get the PlacementMacro(s) which SHOULD be legalized More... | |
void | findMacroType2AvailableSites () |
find available sites for each specific macro type required by the constructor More... | |
void | resolveOverflowColumns () |
resolve the overflow columns during fixed column legalization by spreading "outliers" to neighbor columns More... | |
void | findPossibleLegalLocation (bool fixedColumn=false) |
find potential sites for each PlacementUnit More... | |
void | mapMacrosToColumns (bool directLegalization) |
map the macros to the columns according to the locations of the cells in it More... | |
int | findCorrespondingColumn (float curX, std::vector< float > &Xs) |
find the closest column for a given location X More... | |
void | createBipartiteGraph () |
Create a bipartite graph between PlacementUnit and potential DeviceSites. More... | |
void | roughlyLegalize () |
conduct rough legalization. More... | |
void | fixedColumnLegalize (bool directLegalization) |
conduct fixed-column legalization as a step in exact legalization. During fixed-column legalization, cells in PlacementUnit (macro) can be only mapped to the same column. More... | |
void | updatePUMatchingLocation (bool isRoughLegalization=true, bool updateDisplacement=true) |
update the locations of the legalization anchors for the PlacementUnits. More... | |
void | finalLegalizeBasedOnDP () |
finally dynamic programming to legalize the macros which have been mapped to the columns. More... | |
float | DPForMinHPWL (int colNum, std::vector< std::vector< DeviceInfo::DeviceSite * >> &Column2Sites, std::vector< std::deque< PlacementInfo::PlacementUnit * >> &Column2PUs) |
DP function for the legalization of a specific type of macros in the same column. More... | |
void | updateMatchingAndUnmatchedMacroCells () |
record the matching in private list and update the list of cells which are not matched by the bi-partite matching More... | |
void | spreadMacros (int columnNum, std::vector< int > &columnUntilization, std::vector< std::vector< DeviceInfo::DeviceSite * >> &column2Sites, std::vector< std::deque< PlacementInfo::PlacementUnit * >> &column2PUs, std::map< DesignInfo::DesignCell *, int > &cell2Column, float globalBudgeRatio=1) |
spread PlacementUnits accross columns to resolve resource overflow More... | |
bool | macroCanBeFitIn (int colId, std::vector< std::vector< DeviceInfo::DeviceSite * >> &Column2Sites, std::deque< PlacementInfo::PlacementUnit * > Column2PUs) |
check whether the current macros can be fitted in the column legally. More... | |
int | findIdMaxWithRecurence (int minId, int maxId, std::vector< int > &ids) |
find the column which contains the most of cells in a macro in a specific range of columns More... | |
void | setSitesMapped () |
Set the sites which are binded as mapped so they will not be mapped to other elements in the netlist. More... | |
void | findMacroCell2SitesInDistance (bool checkClockRegion) |
find candidate sites for the cells left to be matched More... | |
void | resetMacroCell2SitesInDistance () |
clear the information of candidate sites for the cells left to be matched More... | |
void | resetSettings () |
clear the mapping information and reset the mapping parameters More... | |
int | getMarcroCellNum (PlacementInfo::PlacementUnit *tmpMacroUnit) |
check how many sites are required by the given PlacementUnit More... | |
void | swapPU (PlacementInfo::PlacementUnit **A, PlacementInfo::PlacementUnit **B) |
void | sortPUsByPU2Y (std::deque< PlacementInfo::PlacementUnit * > &PUs) |
void | sortSitesBySiteY (std::vector< DeviceInfo::DeviceSite * > &sites) |
float | getDisplacement (PlacementInfo::Location ¯oLoc, DeviceInfo::DeviceSite *curSite) |
float | getDisplacement (PlacementInfo::PlacementUnit *curPU, DeviceInfo::DeviceSite *curSite) |
float | getHPWLChange (DesignInfo::DesignCell *curCell, DeviceInfo::DeviceSite *curSite) |
get the HPWL change when the given DesignCell moves to the given DeviceSite More... | |
float | getHPWLChange (PlacementInfo::PlacementUnit *tmpPU, DeviceInfo::DeviceSite *curSite) |
get the HPWL change when the given PlacementUnit moves to the given DeviceSite More... | |
float | getHPWLChange (PlacementInfo::PlacementUnit *tmpPU, float PUX, float PUY) |
get the HPWL change when the given PlacementUnit moves to the given location More... | |
void | swapSitePtr (DeviceInfo::DeviceSite **siteA, DeviceInfo::DeviceSite **siteB) |
int | sortPartition (DesignInfo::DesignCell *curCell, std::vector< DeviceInfo::DeviceSite * > &sites, int low, int high, PlacementInfo::Location ¯oLoc) |
int | RandomPivotPartition (DesignInfo::DesignCell *curCell, std::vector< DeviceInfo::DeviceSite * > &sites, int low, int high, PlacementInfo::Location ¯oLoc) |
void | quick_sort_WLChange (DesignInfo::DesignCell *curCell, std::vector< DeviceInfo::DeviceSite * > &sites, int p, int q, PlacementInfo::Location ¯oLoc) |
void | swapPUs (PlacementInfo::PlacementUnit **PUA, PlacementInfo::PlacementUnit **PUB) |
int | sortPartition (std::vector< PlacementInfo::PlacementUnit * > &PUs, int low, int high) |
int | RandomPivotPartition (std::vector< PlacementInfo::PlacementUnit * > &PUs, int low, int high) |
void | quick_sort_locX (std::vector< PlacementInfo::PlacementUnit * > &PUs, int p, int q) |
Private Attributes | |
std::string | legalizerName |
PlacementInfo * | placementInfo |
DeviceInfo * | deviceInfo |
PlacementInfo::CompatiblePlacementTable * | compatiblePlacementTable |
compatiblePlacementTable describes the type mapping from design to device, where a cell can be placed (which BEL in which site) More... | |
std::vector< DesignInfo::DesignCellType > | macroTypesToLegalize |
a vector of Cell Type string indicating the target types handled by this MacroLegalizer More... | |
std::vector< PlacementInfo::Location > & | cellLoc |
a reference of the locations of cells (in cellId order) More... | |
std::map< std::string, std::string > & | JSONCfg |
MinCostBipartiteMatcher * | minCostBipartiteMatcher = nullptr |
min-cost bipartite matching solver for the legalization More... | |
std::vector< DesignInfo::DesignCell * > | macroCellsToLegalize |
a vector storing the Design cells which have NOT been legalized More... | |
std::vector< DesignInfo::DesignCell * > | initialMacrosToLegalize |
a vector storing the cells in macros which SHOULD be legalized More... | |
std::set< PlacementInfo::PlacementUnit * > | macroUnitsToLegalizeSet |
a set storing the macros which have NOT been legalized More... | |
std::map< DesignInfo::DesignCellType, std::vector< DeviceInfo::DeviceSite * > > | macroType2Sites |
a map record the potential sites of different site types More... | |
std::map< DesignInfo::DesignCell *, std::vector< DeviceInfo::DeviceSite * > > | macro2Sites |
record the mapping from cells to the candidate sites which are NOT binded to other cells More... | |
std::map< DesignInfo::DesignCell *, std::vector< DeviceInfo::DeviceSite * > * > | macro2SitesInDisplacementThreshold |
a cache record the candidate sites within a given displacement threshold for each cell in the macros More... | |
std::map< DeviceInfo::DeviceSite *, int > | rightSiteIds |
map sites to temperary indexes for bipartite matching More... | |
std::vector< DeviceInfo::DeviceSite * > | siteList |
a vector for the candidate sites for bipartite matching More... | |
std::vector< std::vector< std::pair< int, float > > > | adjList |
the adjacent list of the bipartite graph More... | |
std::set< DesignInfo::DesignCell * > | matchedMacroCells |
a set of cells in macros binded to corresponding DeviceSites More... | |
std::set< DeviceInfo::DeviceSite * > | matchedSites |
a set of DeviceSites binded to corresponding PlacementUnits More... | |
std::vector< std::pair< DesignInfo::DesignCell *, DeviceInfo::DeviceSite * > > | cellLevelMatching |
record the binding between design standard cells and DeviceSites as a vector of pairs More... | |
std::vector< std::pair< PlacementInfo::PlacementUnit *, DeviceInfo::DeviceSite * > > | PULevelMatching |
record the binding between PlacementUnits and DeviceSites as a vector of pairs More... | |
int | DumpMacroLegalizationCnt = 0 |
float | displacementThreshold = 30 |
displacement threshold to detect potential legal sites More... | |
int | maxNumCandidate = 30 |
the maximum number of final candidate sites More... | |
int | BRAMColumnNum = -1 |
the number of BRAM columns on the target device More... | |
int | DSPColumnNum = -1 |
the number of DSP columns on the target device More... | |
int | CARRYColumnNum = -1 |
the number of CARRY columns on the target device More... | |
int | BRAMRowNum = -1 |
the number of BRAM rows on the target device More... | |
int | DSPRowNum = -1 |
the number of DSP rows on the target device More... | |
int | CARRYRowNum = -1 |
the number of CARRY rows on the target device More... | |
std::vector< float > | BRAMColumnXs |
the floating-point X location of the BRAM columns on the device More... | |
std::vector< float > | DSPColumnXs |
the floating-point X location of the DSP columns on the device More... | |
std::vector< float > | CARRYColumnXs |
the floating-point X location of the CARRY columns on the device More... | |
std::vector< std::vector< DeviceInfo::DeviceSite * > > | BRAMColumn2Sites |
record the sites in each column of BRAM More... | |
std::vector< std::vector< DeviceInfo::DeviceSite * > > | DSPColumn2Sites |
record the sites in each column of DSP More... | |
std::vector< std::vector< DeviceInfo::DeviceSite * > > | CARRYColumn2Sites |
record the sites in each column of CARRY More... | |
std::vector< std::deque< PlacementInfo::PlacementUnit * > > | BRAMColumn2PUs |
record the PlacementUnits in each column of BRAM Sites More... | |
std::vector< std::deque< PlacementInfo::PlacementUnit * > > | DSPColumn2PUs |
record the PlacementUnits in each column of DSP Sites More... | |
std::vector< std::deque< PlacementInfo::PlacementUnit * > > | CARRYColumn2PUs |
record the PlacementUnits in each column of CARRY More... | |
std::vector< int > | BRAMColumnUntilization |
record the number of cells (Macro contains multiple cells) in each column for BRAM More... | |
std::vector< int > | DSPColumnUntilization |
record the number of cells (Macro contains multiple cells) in each column for DSP More... | |
std::vector< int > | CARRYColumnUntilization |
record the number of cells (Macro contains multiple cells) in each column for CARRY More... | |
std::map< DesignInfo::DesignCell *, int > | BRAMCell2Column |
record the PlacementUnits in each column of BRAM site More... | |
std::map< DesignInfo::DesignCell *, int > | DSPCell2Column |
record the PlacementUnits in each column of DSP site More... | |
std::map< DesignInfo::DesignCell *, int > | CARRYCell2Column |
record the PlacementUnits in each column of CARRY site More... | |
std::map< PlacementInfo::PlacementUnit *, std::vector< DeviceInfo::DeviceSite * > > | PU2LegalSites |
std::map< PlacementInfo::PlacementUnit *, float > | PU2X |
record the mapping from PlacementUnits to exact DeviceSite location X More... | |
std::map< PlacementInfo::PlacementUnit *, float > | PU2Y |
record the mapping from PlacementUnits to exact DeviceSite location Y More... | |
std::map< PlacementInfo::PlacementUnit *, int > | PU2SiteX |
record the exact site X (column id) of involved PlacementUnits More... | |
std::map< PlacementInfo::PlacementUnit *, std::vector< int > > | PU2Columns |
record the column id for the binded cells in involved PlacementUnits More... | |
std::set< PlacementInfo::PlacementUnit * > | BRAMPUs |
the PlacementUnits which shoudl be mapped to BRAM site More... | |
std::set< PlacementInfo::PlacementUnit * > | DSPPUs |
the PlacementUnits which shoudl be mapped to DSP site More... | |
std::set< PlacementInfo::PlacementUnit * > | CARRYPUs |
the PlacementUnits which shoudl be mapped to CARRY BEL More... | |
bool | enableBRAMLegalization = false |
bool | enableDSPLegalization = false |
bool | enableCARRYLegalization = false |
bool | verbose = false |
float | y2xRatio = 1.0 |
bool | clockRegionAware = false |
bool | clockRegionCasLegalization = false |
bool | timingDrivenLegalize = false |
int | clockRegionHeightOfDSE_BRAM = 24 |
float | finalAverageDisplacement = 10000.0 |
the average displacement of exact legalization for the involved PlacementUnit More... | |
float | fixedColumnAverageDisplacement = 10000.0 |
the average displacement of fixed column (but not exactly consective) legalization for the involved PlacementUnit More... | |
float | roughAverageDisplacement = 10000.0 |
the average displacement of rough legalization for the involved PlacementUnit More... | |
bool | noTarget = false |
float | initialDisplacementThreshold = 30 |
displacement threshold to detect potential legal sites More... | |
int | initialMaxNumCandidate = 30 |
the maximum number of final candidate sites More... | |
int | nJobs = 1 |
the number of the parallel multi-threading workers to handle the legalization problems More... | |
int | candidateFactor = 5 |
we are allowed to detect a excessive number (>candidateNum) of initial candidates. candidateFactor is to control the excessive ratio. More... | |
MacroLegalizer maps DSP/BRAM/CARRY macros to legal location.
(RAMB36E2 will be treated as 1+1 RAMB18E2, one of which is a virtual cell)
The legalization procedure will only conduct rough legalization in the early iterations of global placement, and it will conduct exact legalization following rough legalization when the macros are close enough to their potential legal positions.
Definition at line 57 of file MacroLegalizer.h.
MacroLegalizer::MacroLegalizer | ( | std::string | legalizerName, |
PlacementInfo * | placementInfo, | ||
DeviceInfo * | deviceInfo, | ||
std::vector< DesignInfo::DesignCellType > & | macroTypesToLegalize, | ||
std::map< std::string, std::string > & | JSONCfg | ||
) |
Construct a new MacroLegalizer object.
legalizerName | the name string of legalizer for log dumping |
placementInfo | the PlacementInfo for this placer to handle |
deviceInfo | device information |
macroTypesToLegalize | a vector of Cell Type string indicating the target types handled by this MacroLegalizer |
JSONCfg | the user-defined placement configuration |
Definition at line 33 of file MacroLegalizer.cc.
|
inline |
Definition at line 73 of file MacroLegalizer.h.
|
private |
Create a bipartite graph between PlacementUnit and potential DeviceSites.
Definition at line 849 of file MacroLegalizer.cc.
Referenced by fixedColumnLegalize(), and roughlyLegalize().
|
private |
DP function for the legalization of a specific type of macros in the same column.
colNum | total number of the column of the target type of PlacementUnit |
Column2Sites | a vector record the sites in the columns |
Column2PUs | a vector record the macros in the columns |
Definition at line 183 of file MacroLegalizer.cc.
Referenced by finalLegalizeBasedOnDP().
void MacroLegalizer::dumpMatching | ( | bool | fixedColumn = false , |
bool | enforce = false |
||
) |
Definition at line 922 of file MacroLegalizer.cc.
Referenced by GlobalPlacer::GlobalPlacement_CLBElements(), and legalize().
|
private |
finally dynamic programming to legalize the macros which have been mapped to the columns.
This function will call DP function for each specific type of macros
Definition at line 161 of file MacroLegalizer.cc.
Referenced by legalize().
|
private |
find the closest column for a given location X
curX | given location X |
Xs | the location X for the resource columns |
Definition at line 1355 of file MacroLegalizer.cc.
Referenced by mapMacrosToColumns().
|
private |
find the column which contains the most of cells in a macro in a specific range of columns
minId | the begin column |
maxId | the end column |
ids | the column ids of the cells in the macro |
Definition at line 1332 of file MacroLegalizer.cc.
Referenced by mapMacrosToColumns().
|
inlineprivate |
find candidate sites for the cells left to be matched
Definition at line 672 of file MacroLegalizer.h.
Referenced by fixedColumnLegalize(), and roughlyLegalize().
|
private |
find available sites for each specific macro type required by the constructor
Definition at line 564 of file MacroLegalizer.cc.
Referenced by legalize().
|
private |
find potential sites for each PlacementUnit
fixedColumn | true if we want to find potential sites for PlacementUnit in a given column |
Definition at line 699 of file MacroLegalizer.cc.
Referenced by fixedColumnLegalize(), and roughlyLegalize().
|
private |
conduct fixed-column legalization as a step in exact legalization. During fixed-column legalization, cells in PlacementUnit (macro) can be only mapped to the same column.
directLegalization | direct legalize the macros without rough legalization phase |
Definition at line 129 of file MacroLegalizer.cc.
Referenced by legalize().
|
inline |
Get the average displacement of exact legalization for the involved PlacementUnit.
Exact legalization ensures elements in a macro are placed consecutively.
Definition at line 95 of file MacroLegalizer.h.
Referenced by GlobalPlacer::macroLegalize(), and GlobalPlacer::updatePseudoNetWeight().
|
inline |
Get the average displacement of rough legalization for the involved PlacementUnit.
Rough legalization does not guarantee that elements in a macro are placed consecutively.
Definition at line 117 of file MacroLegalizer.h.
Referenced by GlobalPlacer::macroLegalize().
|
inlineprivate |
Definition at line 740 of file MacroLegalizer.h.
Referenced by dumpMatching(), and findPossibleLegalLocation().
|
inlineprivate |
|
inlineprivate |
get the HPWL change when the given DesignCell moves to the given DeviceSite
curCell | the given DesignCell |
curSite | the given DeviceSite |
Definition at line 757 of file MacroLegalizer.h.
Referenced by createBipartiteGraph(), DPForMinHPWL(), dumpMatching(), and sortPartition().
|
inlineprivate |
get the HPWL change when the given PlacementUnit moves to the given DeviceSite
tmpPU | the given PlacementUnit |
curSite | the given DeviceSite |
Definition at line 800 of file MacroLegalizer.h.
|
inlineprivate |
get the HPWL change when the given PlacementUnit moves to the given location
tmpPU | the given PlacementUnit |
PUX | given location X |
PUY | given location Y |
Definition at line 832 of file MacroLegalizer.h.
|
private |
get the PlacementMacro(s) which SHOULD be legalized
Definition at line 527 of file MacroLegalizer.cc.
Referenced by legalize().
|
private |
check how many sites are required by the given PlacementUnit
tmpPUUnit | the given PlacementUnit |
Definition at line 1019 of file MacroLegalizer.cc.
Referenced by DPForMinHPWL(), dumpMatching(), macroCanBeFitIn(), mapMacrosToColumns(), spreadMacros(), and updatePUMatchingLocation().
|
inline |
Definition at line 159 of file MacroLegalizer.h.
Referenced by GlobalPlacer::GlobalPlacement_CLBElements(), and GlobalPlacer::macroLegalize().
void MacroLegalizer::legalize | ( | bool | exactLegalization = false , |
bool | directLegalization = false , |
||
bool | _timingDrivenLegalize = false |
||
) |
conduct legalization and map the PlacementUnit of one of the given types to sites
exactLegalization | true to ensure elements in a macro are consecutive |
directLegalization | direct legalize the macros without rough legalization phase |
_timingDrivenLegalize | disable the evaluation of HPWL change but use check displacement change |
Definition at line 63 of file MacroLegalizer.cc.
Referenced by GlobalPlacer::macroLegalize().
|
private |
check whether the current macros can be fitted in the column legally.
colId | the target column Id |
Column2Sites | |
Column2PUs |
Definition at line 390 of file MacroLegalizer.cc.
Referenced by spreadMacros().
|
private |
map the macros to the columns according to the locations of the cells in it
directLegalization | direct legalize the macros without rough legalization phase |
Definition at line 1373 of file MacroLegalizer.cc.
Referenced by fixedColumnLegalize().
|
inlineprivate |
|
inlineprivate |
Definition at line 889 of file MacroLegalizer.h.
Referenced by findPossibleLegalLocation().
|
inlineprivate |
Definition at line 879 of file MacroLegalizer.h.
Referenced by quick_sort_locX(), and quick_sort_WLChange().
|
inlineprivate |
|
inlineprivate |
clear the information of candidate sites for the cells left to be matched
Definition at line 697 of file MacroLegalizer.h.
Referenced by fixedColumnLegalize(), and roughlyLegalize().
|
inlineprivate |
clear the mapping information and reset the mapping parameters
Definition at line 711 of file MacroLegalizer.h.
Referenced by finalLegalizeBasedOnDP(), and legalize().
void MacroLegalizer::resetSitesMapped | ( | ) |
reset the mapped flag of the involved sites.
A mapped site will not be binded to another PlacementUnit.
Definition at line 1507 of file MacroLegalizer.cc.
Referenced by GlobalPlacer::macroLegalize().
|
private |
resolve the overflow columns during fixed column legalization by spreading "outliers" to neighbor columns
Definition at line 1315 of file MacroLegalizer.cc.
Referenced by fixedColumnLegalize().
|
private |
conduct rough legalization.
Rough legalization does not guarantee that elements in a macro are placed consecutively. During rough legalization, each cell in a macro will be "legalized" individually as a general standard cell withouth the shape constraints.
Definition at line 104 of file MacroLegalizer.cc.
Referenced by legalize().
|
inline |
Definition at line 149 of file MacroLegalizer.h.
Referenced by GlobalPlacer::macroLegalize().
|
inline |
Definition at line 154 of file MacroLegalizer.h.
Referenced by GlobalPlacer::updatePseudoNetWeight().
|
inline |
Set the intitial parameters of the legalizer.
displacementThr | displacement threshold to detect potential legal sites |
candidateNum | the maximum number of final candidate sites |
_candidateFactor | we are allowed to detect a excessive number (>candidateNum) of initial candidates |
Definition at line 131 of file MacroLegalizer.h.
Referenced by GlobalPlacer::macroLegalize().
|
private |
Set the sites which are binded as mapped so they will not be mapped to other elements in the netlist.
Definition at line 1482 of file MacroLegalizer.cc.
Referenced by legalize().
|
inlineprivate |
Definition at line 859 of file MacroLegalizer.h.
Referenced by RandomPivotPartition().
|
inlineprivate |
|
private |
Definition at line 1043 of file MacroLegalizer.cc.
Referenced by macroCanBeFitIn(), and updatePUMatchingLocation().
|
private |
Definition at line 1052 of file MacroLegalizer.cc.
Referenced by DPForMinHPWL(), and macroCanBeFitIn().
|
private |
spread PlacementUnits accross columns to resolve resource overflow
columnNum | the number of columns |
columnUntilization | a vector reording the utilization usage of each column |
column2Sites | a vector reording device sites in each column |
column2PUs | a vector reording PlacementUnits in each column |
cell2Column | a map recording the column id for each PlacementUnit |
globalBudgeRatio | control the density in all columns |
Definition at line 1178 of file MacroLegalizer.cc.
Referenced by resolveOverflowColumns().
|
inlineprivate |
Definition at line 729 of file MacroLegalizer.h.
Referenced by sortPUsByPU2Y().
|
inlineprivate |
Definition at line 903 of file MacroLegalizer.h.
Referenced by RandomPivotPartition(), and sortPartition().
|
inlineprivate |
Definition at line 852 of file MacroLegalizer.h.
Referenced by RandomPivotPartition(), sortPartition(), and sortSitesBySiteY().
|
private |
record the matching in private list and update the list of cells which are not matched by the bi-partite matching
Definition at line 893 of file MacroLegalizer.cc.
Referenced by fixedColumnLegalize(), and roughlyLegalize().
|
private |
update the locations of the legalization anchors for the PlacementUnits.
This function might be called more than one time during implementation so we have to specify the type of legalization and whether we want to update the displacement value for the control of some optimizations.
isRoughLegalization | specify the type of legalization |
updateDisplacement | whether we want to update the displacement value for the control of some optimizations |
Definition at line 1072 of file MacroLegalizer.cc.
Referenced by legalize().
|
private |
the adjacent list of the bipartite graph
Definition at line 250 of file MacroLegalizer.h.
Referenced by createBipartiteGraph(), fixedColumnLegalize(), and roughlyLegalize().
|
private |
record the PlacementUnits in each column of BRAM site
Definition at line 402 of file MacroLegalizer.h.
Referenced by findPossibleLegalLocation(), and resolveOverflowColumns().
|
private |
record the PlacementUnits in each column of BRAM Sites
Definition at line 366 of file MacroLegalizer.h.
Referenced by dumpMatching(), finalLegalizeBasedOnDP(), mapMacrosToColumns(), resolveOverflowColumns(), and updatePUMatchingLocation().
|
private |
record the sites in each column of BRAM
Definition at line 348 of file MacroLegalizer.h.
Referenced by finalLegalizeBasedOnDP(), findMacroType2AvailableSites(), findPossibleLegalLocation(), and resolveOverflowColumns().
|
private |
the number of BRAM columns on the target device
Definition at line 294 of file MacroLegalizer.h.
Referenced by dumpMatching(), finalLegalizeBasedOnDP(), findMacroType2AvailableSites(), mapMacrosToColumns(), resolveOverflowColumns(), and updatePUMatchingLocation().
|
private |
record the number of cells (Macro contains multiple cells) in each column for BRAM
Definition at line 384 of file MacroLegalizer.h.
Referenced by mapMacrosToColumns(), and resolveOverflowColumns().
|
private |
the floating-point X location of the BRAM columns on the device
Definition at line 330 of file MacroLegalizer.h.
Referenced by findMacroType2AvailableSites(), and mapMacrosToColumns().
|
private |
the PlacementUnits which shoudl be mapped to BRAM site
Definition at line 451 of file MacroLegalizer.h.
Referenced by getMacrosToLegalize(), and mapMacrosToColumns().
|
private |
the number of BRAM rows on the target device
Definition at line 312 of file MacroLegalizer.h.
Referenced by findMacroType2AvailableSites().
|
private |
we are allowed to detect a excessive number (>candidateNum) of initial candidates. candidateFactor is to control the excessive ratio.
Definition at line 521 of file MacroLegalizer.h.
Referenced by findMacroCell2SitesInDistance(), and setIntitialParameters().
|
private |
record the PlacementUnits in each column of CARRY site
Definition at line 414 of file MacroLegalizer.h.
Referenced by findPossibleLegalLocation(), and resolveOverflowColumns().
|
private |
record the PlacementUnits in each column of CARRY
Definition at line 378 of file MacroLegalizer.h.
Referenced by dumpMatching(), finalLegalizeBasedOnDP(), mapMacrosToColumns(), resolveOverflowColumns(), and updatePUMatchingLocation().
|
private |
record the sites in each column of CARRY
Definition at line 360 of file MacroLegalizer.h.
Referenced by finalLegalizeBasedOnDP(), findMacroType2AvailableSites(), findPossibleLegalLocation(), and resolveOverflowColumns().
|
private |
the number of CARRY columns on the target device
Definition at line 306 of file MacroLegalizer.h.
Referenced by dumpMatching(), finalLegalizeBasedOnDP(), findMacroType2AvailableSites(), mapMacrosToColumns(), resolveOverflowColumns(), and updatePUMatchingLocation().
|
private |
record the number of cells (Macro contains multiple cells) in each column for CARRY
Definition at line 396 of file MacroLegalizer.h.
Referenced by mapMacrosToColumns(), and resolveOverflowColumns().
|
private |
the floating-point X location of the CARRY columns on the device
Definition at line 342 of file MacroLegalizer.h.
Referenced by findMacroType2AvailableSites(), and mapMacrosToColumns().
|
private |
the PlacementUnits which shoudl be mapped to CARRY BEL
Definition at line 463 of file MacroLegalizer.h.
Referenced by getMacrosToLegalize(), and mapMacrosToColumns().
|
private |
the number of CARRY rows on the target device
Definition at line 324 of file MacroLegalizer.h.
Referenced by findMacroType2AvailableSites().
|
private |
record the binding between design standard cells and DeviceSites as a vector of pairs
Definition at line 268 of file MacroLegalizer.h.
Referenced by dumpMatching(), resetSettings(), resetSitesMapped(), setSitesMapped(), updateMatchingAndUnmatchedMacroCells(), and updatePUMatchingLocation().
|
private |
a reference of the locations of cells (in cellId order)
Definition at line 186 of file MacroLegalizer.h.
Referenced by dumpMatching(), findMacroCell2SitesInDistance(), findPossibleLegalLocation(), and updatePUMatchingLocation().
|
private |
Definition at line 470 of file MacroLegalizer.h.
Referenced by fixedColumnLegalize(), MacroLegalizer(), roughlyLegalize(), and setClockRegionAware().
|
private |
Definition at line 471 of file MacroLegalizer.h.
Referenced by findPossibleLegalLocation(), and setClockRegionCasLegalization().
|
private |
Definition at line 473 of file MacroLegalizer.h.
Referenced by findPossibleLegalLocation().
|
private |
compatiblePlacementTable describes the type mapping from design to device, where a cell can be placed (which BEL in which site)
Definition at line 174 of file MacroLegalizer.h.
Referenced by findMacroType2AvailableSites().
|
private |
Definition at line 167 of file MacroLegalizer.h.
Referenced by findMacroType2AvailableSites().
|
private |
displacement threshold to detect potential legal sites
Definition at line 282 of file MacroLegalizer.h.
Referenced by findMacroCell2SitesInDistance(), findPossibleLegalLocation(), fixedColumnLegalize(), resetSettings(), and roughlyLegalize().
|
private |
record the PlacementUnits in each column of DSP site
Definition at line 408 of file MacroLegalizer.h.
Referenced by findPossibleLegalLocation(), and resolveOverflowColumns().
|
private |
record the PlacementUnits in each column of DSP Sites
Definition at line 372 of file MacroLegalizer.h.
Referenced by dumpMatching(), finalLegalizeBasedOnDP(), mapMacrosToColumns(), resolveOverflowColumns(), and updatePUMatchingLocation().
|
private |
record the sites in each column of DSP
Definition at line 354 of file MacroLegalizer.h.
Referenced by finalLegalizeBasedOnDP(), findMacroType2AvailableSites(), findPossibleLegalLocation(), and resolveOverflowColumns().
|
private |
the number of DSP columns on the target device
Definition at line 300 of file MacroLegalizer.h.
Referenced by dumpMatching(), finalLegalizeBasedOnDP(), findMacroType2AvailableSites(), mapMacrosToColumns(), resolveOverflowColumns(), and updatePUMatchingLocation().
|
private |
record the number of cells (Macro contains multiple cells) in each column for DSP
Definition at line 390 of file MacroLegalizer.h.
Referenced by mapMacrosToColumns(), and resolveOverflowColumns().
|
private |
the floating-point X location of the DSP columns on the device
Definition at line 336 of file MacroLegalizer.h.
Referenced by findMacroType2AvailableSites(), and mapMacrosToColumns().
|
private |
the PlacementUnits which shoudl be mapped to DSP site
Definition at line 457 of file MacroLegalizer.h.
Referenced by getMacrosToLegalize(), and mapMacrosToColumns().
|
private |
the number of DSP rows on the target device
Definition at line 318 of file MacroLegalizer.h.
Referenced by findMacroType2AvailableSites().
|
private |
Definition at line 276 of file MacroLegalizer.h.
Referenced by dumpMatching().
|
private |
Definition at line 465 of file MacroLegalizer.h.
Referenced by findMacroType2AvailableSites(), and resolveOverflowColumns().
|
private |
Definition at line 467 of file MacroLegalizer.h.
Referenced by findMacroType2AvailableSites(), and resolveOverflowColumns().
|
private |
Definition at line 466 of file MacroLegalizer.h.
Referenced by findMacroType2AvailableSites(), and resolveOverflowColumns().
|
private |
the average displacement of exact legalization for the involved PlacementUnit
Definition at line 479 of file MacroLegalizer.h.
Referenced by finalLegalizeBasedOnDP(), and getAverageDisplacementOfExactLegalization().
|
private |
the average displacement of fixed column (but not exactly consective) legalization for the involved PlacementUnit
During the fixed column legalization, cells in a macro will be constrainted on one column.
Definition at line 488 of file MacroLegalizer.h.
Referenced by updatePUMatchingLocation().
|
private |
displacement threshold to detect potential legal sites
Definition at line 502 of file MacroLegalizer.h.
Referenced by findPossibleLegalLocation(), resetSettings(), and setIntitialParameters().
|
private |
a vector storing the cells in macros which SHOULD be legalized
Definition at line 206 of file MacroLegalizer.h.
Referenced by fixedColumnLegalize(), getMacrosToLegalize(), and legalize().
|
private |
the maximum number of final candidate sites
Definition at line 508 of file MacroLegalizer.h.
Referenced by resetSettings(), and setIntitialParameters().
|
private |
Definition at line 188 of file MacroLegalizer.h.
Referenced by dumpMatching(), and MacroLegalizer().
|
private |
Definition at line 165 of file MacroLegalizer.h.
Referenced by dumpMatching(), finalLegalizeBasedOnDP(), legalize(), and updatePUMatchingLocation().
|
private |
record the mapping from cells to the candidate sites which are NOT binded to other cells
Please be aware that a cell might be binded of multiple sites.
Definition at line 226 of file MacroLegalizer.h.
Referenced by createBipartiteGraph(), findPossibleLegalLocation(), fixedColumnLegalize(), and roughlyLegalize().
|
private |
a cache record the candidate sites within a given displacement threshold for each cell in the macros
Definition at line 232 of file MacroLegalizer.h.
Referenced by findMacroCell2SitesInDistance(), findPossibleLegalLocation(), and resetMacroCell2SitesInDistance().
|
private |
a vector storing the Design cells which have NOT been legalized
Definition at line 200 of file MacroLegalizer.h.
Referenced by createBipartiteGraph(), findMacroCell2SitesInDistance(), findPossibleLegalLocation(), fixedColumnLegalize(), getMacrosToLegalize(), MacroLegalizer(), resetMacroCell2SitesInDistance(), roughlyLegalize(), and updateMatchingAndUnmatchedMacroCells().
|
private |
a map record the potential sites of different site types
Definition at line 218 of file MacroLegalizer.h.
Referenced by findMacroType2AvailableSites(), and findPossibleLegalLocation().
|
private |
a vector of Cell Type string indicating the target types handled by this MacroLegalizer
Definition at line 180 of file MacroLegalizer.h.
Referenced by findMacroType2AvailableSites(), and getMacrosToLegalize().
|
private |
a set storing the macros which have NOT been legalized
Definition at line 212 of file MacroLegalizer.h.
Referenced by getMacrosToLegalize().
|
private |
a set of cells in macros binded to corresponding DeviceSites
Definition at line 256 of file MacroLegalizer.h.
Referenced by resetSettings(), and updateMatchingAndUnmatchedMacroCells().
|
private |
a set of DeviceSites binded to corresponding PlacementUnits
Definition at line 262 of file MacroLegalizer.h.
Referenced by findPossibleLegalLocation(), resetSettings(), and updateMatchingAndUnmatchedMacroCells().
|
private |
the maximum number of final candidate sites
Definition at line 288 of file MacroLegalizer.h.
Referenced by findMacroCell2SitesInDistance(), findPossibleLegalLocation(), fixedColumnLegalize(), resetSettings(), and roughlyLegalize().
|
private |
min-cost bipartite matching solver for the legalization
Definition at line 194 of file MacroLegalizer.h.
Referenced by fixedColumnLegalize(), roughlyLegalize(), updateMatchingAndUnmatchedMacroCells(), and ~MacroLegalizer().
|
private |
the number of the parallel multi-threading workers to handle the legalization problems
Definition at line 514 of file MacroLegalizer.h.
Referenced by fixedColumnLegalize(), MacroLegalizer(), and roughlyLegalize().
|
private |
Definition at line 496 of file MacroLegalizer.h.
Referenced by hasNoTarget(), and legalize().
|
private |
Definition at line 166 of file MacroLegalizer.h.
Referenced by dumpMatching(), finalLegalizeBasedOnDP(), findMacroCell2SitesInDistance(), findMacroType2AvailableSites(), findPossibleLegalLocation(), getHPWLChange(), getMacrosToLegalize(), and updatePUMatchingLocation().
|
private |
record the column id for the binded cells in involved PlacementUnits
i.e., if a PlacementUnit is PlacementMacro, the cells in it might be allowed to bind to different columns during rough legalization.
Definition at line 445 of file MacroLegalizer.h.
Referenced by mapMacrosToColumns(), and updatePUMatchingLocation().
|
private |
Definition at line 416 of file MacroLegalizer.h.
Referenced by DPForMinHPWL(), finalLegalizeBasedOnDP(), MacroLegalizer(), resetSitesMapped(), setSitesMapped(), and updatePUMatchingLocation().
|
private |
record the exact site X (column id) of involved PlacementUnits
unused currently and just for debugging
Definition at line 436 of file MacroLegalizer.h.
Referenced by updatePUMatchingLocation().
|
private |
record the mapping from PlacementUnits to exact DeviceSite location X
Definition at line 422 of file MacroLegalizer.h.
Referenced by DPForMinHPWL(), dumpMatching(), finalLegalizeBasedOnDP(), MacroLegalizer(), and updatePUMatchingLocation().
|
private |
record the mapping from PlacementUnits to exact DeviceSite location Y
Definition at line 428 of file MacroLegalizer.h.
Referenced by DPForMinHPWL(), dumpMatching(), finalLegalizeBasedOnDP(), MacroLegalizer(), sortPUsByPU2Y(), and updatePUMatchingLocation().
|
private |
record the binding between PlacementUnits and DeviceSites as a vector of pairs
Definition at line 274 of file MacroLegalizer.h.
Referenced by DPForMinHPWL(), dumpMatching(), getAverageDisplacementOfExactLegalization(), resetSettings(), resetSitesMapped(), and setSitesMapped().
|
private |
map sites to temperary indexes for bipartite matching
Definition at line 238 of file MacroLegalizer.h.
Referenced by createBipartiteGraph(), fixedColumnLegalize(), and roughlyLegalize().
|
private |
the average displacement of rough legalization for the involved PlacementUnit
Definition at line 494 of file MacroLegalizer.h.
Referenced by getAverageDisplacementOfRoughLegalization(), and updatePUMatchingLocation().
|
private |
a vector for the candidate sites for bipartite matching
Definition at line 244 of file MacroLegalizer.h.
Referenced by createBipartiteGraph(), and updateMatchingAndUnmatchedMacroCells().
|
private |
Definition at line 472 of file MacroLegalizer.h.
Referenced by getHPWLChange(), and legalize().
|
private |
Definition at line 468 of file MacroLegalizer.h.
Referenced by finalLegalizeBasedOnDP(), findPossibleLegalLocation(), fixedColumnLegalize(), legalize(), MacroLegalizer(), roughlyLegalize(), and updatePUMatchingLocation().
|
private |
Definition at line 469 of file MacroLegalizer.h.
Referenced by getDisplacement(), getHPWLChange(), and MacroLegalizer().