AMF-Placer  2.0
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
MacroLegalizer Class Reference

MacroLegalizer maps DSP/BRAM/CARRY macros to legal location. More...

#include <MacroLegalizer.h>

Collaboration diagram for MacroLegalizer:

Public Member Functions

 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. 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 &macroLoc, 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 &macroLoc)
 
int RandomPivotPartition (DesignInfo::DesignCell *curCell, std::vector< DeviceInfo::DeviceSite * > &sites, int low, int high, PlacementInfo::Location &macroLoc)
 
void quick_sort_WLChange (DesignInfo::DesignCell *curCell, std::vector< DeviceInfo::DeviceSite * > &sites, int p, int q, PlacementInfo::Location &macroLoc)
 
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
 
PlacementInfoplacementInfo
 
DeviceInfodeviceInfo
 
PlacementInfo::CompatiblePlacementTablecompatiblePlacementTable
 compatiblePlacementTable describes the type mapping from design to device, where a cell can be placed (which BEL in which site) More...
 
std::vector< DesignInfo::DesignCellTypemacroTypesToLegalize
 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
 
MinCostBipartiteMatcherminCostBipartiteMatcher = 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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ MacroLegalizer()

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.

Parameters
legalizerNamethe name string of legalizer for log dumping
placementInfothe PlacementInfo for this placer to handle
deviceInfodevice information
macroTypesToLegalizea vector of Cell Type string indicating the target types handled by this MacroLegalizer
JSONCfgthe user-defined placement configuration

Definition at line 33 of file MacroLegalizer.cc.

◆ ~MacroLegalizer()

MacroLegalizer::~MacroLegalizer ( )
inline

Definition at line 73 of file MacroLegalizer.h.

Member Function Documentation

◆ createBipartiteGraph()

void MacroLegalizer::createBipartiteGraph ( )
private

Create a bipartite graph between PlacementUnit and potential DeviceSites.

Definition at line 849 of file MacroLegalizer.cc.

Referenced by fixedColumnLegalize(), and roughlyLegalize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DPForMinHPWL()

float MacroLegalizer::DPForMinHPWL ( int  colNum,
std::vector< std::vector< DeviceInfo::DeviceSite * >> &  Column2Sites,
std::vector< std::deque< PlacementInfo::PlacementUnit * >> &  Column2PUs 
)
private

DP function for the legalization of a specific type of macros in the same column.

Parameters
colNumtotal number of the column of the target type of PlacementUnit
Column2Sitesa vector record the sites in the columns
Column2PUsa vector record the macros in the columns
Returns
float

Definition at line 183 of file MacroLegalizer.cc.

Referenced by finalLegalizeBasedOnDP().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dumpMatching()

void MacroLegalizer::dumpMatching ( bool  fixedColumn = false,
bool  enforce = false 
)

Definition at line 922 of file MacroLegalizer.cc.

Referenced by GlobalPlacer::GlobalPlacement_CLBElements(), and legalize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ finalLegalizeBasedOnDP()

void MacroLegalizer::finalLegalizeBasedOnDP ( )
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findCorrespondingColumn()

int MacroLegalizer::findCorrespondingColumn ( float  curX,
std::vector< float > &  Xs 
)
private

find the closest column for a given location X

Parameters
curXgiven location X
Xsthe location X for the resource columns
Returns
int

Definition at line 1355 of file MacroLegalizer.cc.

Referenced by mapMacrosToColumns().

Here is the caller graph for this function:

◆ findIdMaxWithRecurence()

int MacroLegalizer::findIdMaxWithRecurence ( int  minId,
int  maxId,
std::vector< int > &  ids 
)
private

find the column which contains the most of cells in a macro in a specific range of columns

Parameters
minIdthe begin column
maxIdthe end column
idsthe column ids of the cells in the macro
Returns
int

Definition at line 1332 of file MacroLegalizer.cc.

Referenced by mapMacrosToColumns().

Here is the caller graph for this function:

◆ findMacroCell2SitesInDistance()

void MacroLegalizer::findMacroCell2SitesInDistance ( bool  checkClockRegion)
inlineprivate

find candidate sites for the cells left to be matched

Definition at line 672 of file MacroLegalizer.h.

Referenced by fixedColumnLegalize(), and roughlyLegalize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findMacroType2AvailableSites()

void MacroLegalizer::findMacroType2AvailableSites ( )
private

find available sites for each specific macro type required by the constructor

Definition at line 564 of file MacroLegalizer.cc.

Referenced by legalize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findPossibleLegalLocation()

void MacroLegalizer::findPossibleLegalLocation ( bool  fixedColumn = false)
private

find potential sites for each PlacementUnit

Parameters
fixedColumntrue 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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fixedColumnLegalize()

void MacroLegalizer::fixedColumnLegalize ( bool  directLegalization)
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.

Parameters
directLegalizationdirect legalize the macros without rough legalization phase

Definition at line 129 of file MacroLegalizer.cc.

Referenced by legalize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAverageDisplacementOfExactLegalization()

float MacroLegalizer::getAverageDisplacementOfExactLegalization ( )
inline

Get the average displacement of exact legalization for the involved PlacementUnit.

Exact legalization ensures elements in a macro are placed consecutively.

Returns
float

Definition at line 95 of file MacroLegalizer.h.

Referenced by GlobalPlacer::macroLegalize(), and GlobalPlacer::updatePseudoNetWeight().

Here is the caller graph for this function:

◆ getAverageDisplacementOfRoughLegalization()

float MacroLegalizer::getAverageDisplacementOfRoughLegalization ( )
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.

Returns
float

Definition at line 117 of file MacroLegalizer.h.

Referenced by GlobalPlacer::macroLegalize().

Here is the caller graph for this function:

◆ getDisplacement() [1/2]

float MacroLegalizer::getDisplacement ( PlacementInfo::Location macroLoc,
DeviceInfo::DeviceSite curSite 
)
inlineprivate

Definition at line 740 of file MacroLegalizer.h.

Referenced by dumpMatching(), and findPossibleLegalLocation().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getDisplacement() [2/2]

float MacroLegalizer::getDisplacement ( PlacementInfo::PlacementUnit curPU,
DeviceInfo::DeviceSite curSite 
)
inlineprivate

Definition at line 745 of file MacroLegalizer.h.

Here is the call graph for this function:

◆ getHPWLChange() [1/3]

float MacroLegalizer::getHPWLChange ( DesignInfo::DesignCell curCell,
DeviceInfo::DeviceSite curSite 
)
inlineprivate

get the HPWL change when the given DesignCell moves to the given DeviceSite

Parameters
curCellthe given DesignCell
curSitethe given DeviceSite
Returns
float

Definition at line 757 of file MacroLegalizer.h.

Referenced by createBipartiteGraph(), DPForMinHPWL(), dumpMatching(), and sortPartition().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getHPWLChange() [2/3]

float MacroLegalizer::getHPWLChange ( PlacementInfo::PlacementUnit tmpPU,
DeviceInfo::DeviceSite curSite 
)
inlineprivate

get the HPWL change when the given PlacementUnit moves to the given DeviceSite

Parameters
tmpPUthe given PlacementUnit
curSitethe given DeviceSite
Returns
float

Definition at line 800 of file MacroLegalizer.h.

Here is the call graph for this function:

◆ getHPWLChange() [3/3]

float MacroLegalizer::getHPWLChange ( PlacementInfo::PlacementUnit tmpPU,
float  PUX,
float  PUY 
)
inlineprivate

get the HPWL change when the given PlacementUnit moves to the given location

Parameters
tmpPUthe given PlacementUnit
PUXgiven location X
PUYgiven location Y
Returns
float

Definition at line 832 of file MacroLegalizer.h.

Here is the call graph for this function:

◆ getMacrosToLegalize()

void MacroLegalizer::getMacrosToLegalize ( )
private

get the PlacementMacro(s) which SHOULD be legalized

Definition at line 527 of file MacroLegalizer.cc.

Referenced by legalize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getMarcroCellNum()

int MacroLegalizer::getMarcroCellNum ( PlacementInfo::PlacementUnit tmpMacroUnit)
private

check how many sites are required by the given PlacementUnit

Parameters
tmpPUUnitthe given PlacementUnit
Returns
int

Definition at line 1019 of file MacroLegalizer.cc.

Referenced by DPForMinHPWL(), dumpMatching(), macroCanBeFitIn(), mapMacrosToColumns(), spreadMacros(), and updatePUMatchingLocation().

Here is the caller graph for this function:

◆ hasNoTarget()

bool MacroLegalizer::hasNoTarget ( )
inline

Definition at line 159 of file MacroLegalizer.h.

Referenced by GlobalPlacer::GlobalPlacement_CLBElements(), and GlobalPlacer::macroLegalize().

Here is the caller graph for this function:

◆ legalize()

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

Parameters
exactLegalizationtrue to ensure elements in a macro are consecutive
directLegalizationdirect legalize the macros without rough legalization phase
_timingDrivenLegalizedisable the evaluation of HPWL change but use check displacement change

Definition at line 63 of file MacroLegalizer.cc.

Referenced by GlobalPlacer::macroLegalize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ macroCanBeFitIn()

bool MacroLegalizer::macroCanBeFitIn ( int  colId,
std::vector< std::vector< DeviceInfo::DeviceSite * >> &  Column2Sites,
std::deque< PlacementInfo::PlacementUnit * >  Column2PUs 
)
private

check whether the current macros can be fitted in the column legally.

Parameters
colIdthe target column Id
Column2Sites
Column2PUs
Returns
true if the current macros can be fitted in the column legally.
false if the current macros CANNOT be fitted in the column legally.

Definition at line 390 of file MacroLegalizer.cc.

Referenced by spreadMacros().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mapMacrosToColumns()

void MacroLegalizer::mapMacrosToColumns ( bool  directLegalization)
private

map the macros to the columns according to the locations of the cells in it

Parameters
directLegalizationdirect legalize the macros without rough legalization phase

Definition at line 1373 of file MacroLegalizer.cc.

Referenced by fixedColumnLegalize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ quick_sort_locX()

void MacroLegalizer::quick_sort_locX ( std::vector< PlacementInfo::PlacementUnit * > &  PUs,
int  p,
int  q 
)
inlineprivate

Definition at line 938 of file MacroLegalizer.h.

Here is the call graph for this function:

◆ quick_sort_WLChange()

void MacroLegalizer::quick_sort_WLChange ( DesignInfo::DesignCell curCell,
std::vector< DeviceInfo::DeviceSite * > &  sites,
int  p,
int  q,
PlacementInfo::Location macroLoc 
)
inlineprivate

Definition at line 889 of file MacroLegalizer.h.

Referenced by findPossibleLegalLocation().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RandomPivotPartition() [1/2]

int MacroLegalizer::RandomPivotPartition ( DesignInfo::DesignCell curCell,
std::vector< DeviceInfo::DeviceSite * > &  sites,
int  low,
int  high,
PlacementInfo::Location macroLoc 
)
inlineprivate

Definition at line 879 of file MacroLegalizer.h.

Referenced by quick_sort_locX(), and quick_sort_WLChange().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RandomPivotPartition() [2/2]

int MacroLegalizer::RandomPivotPartition ( std::vector< PlacementInfo::PlacementUnit * > &  PUs,
int  low,
int  high 
)
inlineprivate

Definition at line 929 of file MacroLegalizer.h.

Here is the call graph for this function:

◆ resetMacroCell2SitesInDistance()

void MacroLegalizer::resetMacroCell2SitesInDistance ( )
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().

Here is the caller graph for this function:

◆ resetSettings()

void MacroLegalizer::resetSettings ( )
inlineprivate

clear the mapping information and reset the mapping parameters

Definition at line 711 of file MacroLegalizer.h.

Referenced by finalLegalizeBasedOnDP(), and legalize().

Here is the caller graph for this function:

◆ resetSitesMapped()

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().

Here is the caller graph for this function:

◆ resolveOverflowColumns()

void MacroLegalizer::resolveOverflowColumns ( )
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ roughlyLegalize()

void MacroLegalizer::roughlyLegalize ( )
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setClockRegionAware()

void MacroLegalizer::setClockRegionAware ( bool  _clockRegionAware)
inline

Definition at line 149 of file MacroLegalizer.h.

Referenced by GlobalPlacer::macroLegalize().

Here is the caller graph for this function:

◆ setClockRegionCasLegalization()

void MacroLegalizer::setClockRegionCasLegalization ( bool  _clockRegionCasLegalization)
inline

Definition at line 154 of file MacroLegalizer.h.

Referenced by GlobalPlacer::updatePseudoNetWeight().

Here is the caller graph for this function:

◆ setIntitialParameters()

void MacroLegalizer::setIntitialParameters ( float  displacementThr,
int  candidateNum,
int  _candidateFactor = -1 
)
inline

Set the intitial parameters of the legalizer.

Parameters
displacementThrdisplacement threshold to detect potential legal sites
candidateNumthe maximum number of final candidate sites
_candidateFactorwe are allowed to detect a excessive number (>candidateNum) of initial candidates

Definition at line 131 of file MacroLegalizer.h.

Referenced by GlobalPlacer::macroLegalize().

Here is the caller graph for this function:

◆ setSitesMapped()

void MacroLegalizer::setSitesMapped ( )
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().

Here is the caller graph for this function:

◆ sortPartition() [1/2]

int MacroLegalizer::sortPartition ( DesignInfo::DesignCell curCell,
std::vector< DeviceInfo::DeviceSite * > &  sites,
int  low,
int  high,
PlacementInfo::Location macroLoc 
)
inlineprivate

Definition at line 859 of file MacroLegalizer.h.

Referenced by RandomPivotPartition().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sortPartition() [2/2]

int MacroLegalizer::sortPartition ( std::vector< PlacementInfo::PlacementUnit * > &  PUs,
int  low,
int  high 
)
inlineprivate

Definition at line 910 of file MacroLegalizer.h.

Here is the call graph for this function:

◆ sortPUsByPU2Y()

void MacroLegalizer::sortPUsByPU2Y ( std::deque< PlacementInfo::PlacementUnit * > &  PUs)
private

Definition at line 1043 of file MacroLegalizer.cc.

Referenced by macroCanBeFitIn(), and updatePUMatchingLocation().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sortSitesBySiteY()

void MacroLegalizer::sortSitesBySiteY ( std::vector< DeviceInfo::DeviceSite * > &  sites)
private

Definition at line 1052 of file MacroLegalizer.cc.

Referenced by DPForMinHPWL(), and macroCanBeFitIn().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ spreadMacros()

void MacroLegalizer::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 
)
private

spread PlacementUnits accross columns to resolve resource overflow

Parameters
columnNumthe number of columns
columnUntilizationa vector reording the utilization usage of each column
column2Sitesa vector reording device sites in each column
column2PUsa vector reording PlacementUnits in each column
cell2Columna map recording the column id for each PlacementUnit
globalBudgeRatiocontrol the density in all columns

Definition at line 1178 of file MacroLegalizer.cc.

Referenced by resolveOverflowColumns().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ swapPU()

void MacroLegalizer::swapPU ( PlacementInfo::PlacementUnit **  A,
PlacementInfo::PlacementUnit **  B 
)
inlineprivate

Definition at line 729 of file MacroLegalizer.h.

Referenced by sortPUsByPU2Y().

Here is the caller graph for this function:

◆ swapPUs()

void MacroLegalizer::swapPUs ( PlacementInfo::PlacementUnit **  PUA,
PlacementInfo::PlacementUnit **  PUB 
)
inlineprivate

Definition at line 903 of file MacroLegalizer.h.

Referenced by RandomPivotPartition(), and sortPartition().

Here is the caller graph for this function:

◆ swapSitePtr()

void MacroLegalizer::swapSitePtr ( DeviceInfo::DeviceSite **  siteA,
DeviceInfo::DeviceSite **  siteB 
)
inlineprivate

Definition at line 852 of file MacroLegalizer.h.

Referenced by RandomPivotPartition(), sortPartition(), and sortSitesBySiteY().

Here is the caller graph for this function:

◆ updateMatchingAndUnmatchedMacroCells()

void MacroLegalizer::updateMatchingAndUnmatchedMacroCells ( )
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updatePUMatchingLocation()

void MacroLegalizer::updatePUMatchingLocation ( bool  isRoughLegalization = true,
bool  updateDisplacement = true 
)
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.

Parameters
isRoughLegalizationspecify the type of legalization
updateDisplacementwhether we want to update the displacement value for the control of some optimizations

Definition at line 1072 of file MacroLegalizer.cc.

Referenced by legalize().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ adjList

std::vector<std::vector<std::pair<int, float> > > MacroLegalizer::adjList
private

the adjacent list of the bipartite graph

Definition at line 250 of file MacroLegalizer.h.

Referenced by createBipartiteGraph(), fixedColumnLegalize(), and roughlyLegalize().

◆ BRAMCell2Column

std::map<DesignInfo::DesignCell *, int> MacroLegalizer::BRAMCell2Column
private

record the PlacementUnits in each column of BRAM site

Definition at line 402 of file MacroLegalizer.h.

Referenced by findPossibleLegalLocation(), and resolveOverflowColumns().

◆ BRAMColumn2PUs

std::vector<std::deque<PlacementInfo::PlacementUnit *> > MacroLegalizer::BRAMColumn2PUs
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().

◆ BRAMColumn2Sites

std::vector<std::vector<DeviceInfo::DeviceSite *> > MacroLegalizer::BRAMColumn2Sites
private

record the sites in each column of BRAM

Definition at line 348 of file MacroLegalizer.h.

Referenced by finalLegalizeBasedOnDP(), findMacroType2AvailableSites(), findPossibleLegalLocation(), and resolveOverflowColumns().

◆ BRAMColumnNum

int MacroLegalizer::BRAMColumnNum = -1
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().

◆ BRAMColumnUntilization

std::vector<int> MacroLegalizer::BRAMColumnUntilization
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().

◆ BRAMColumnXs

std::vector<float> MacroLegalizer::BRAMColumnXs
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().

◆ BRAMPUs

std::set<PlacementInfo::PlacementUnit *> MacroLegalizer::BRAMPUs
private

the PlacementUnits which shoudl be mapped to BRAM site

Definition at line 451 of file MacroLegalizer.h.

Referenced by getMacrosToLegalize(), and mapMacrosToColumns().

◆ BRAMRowNum

int MacroLegalizer::BRAMRowNum = -1
private

the number of BRAM rows on the target device

Definition at line 312 of file MacroLegalizer.h.

Referenced by findMacroType2AvailableSites().

◆ candidateFactor

int MacroLegalizer::candidateFactor = 5
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().

◆ CARRYCell2Column

std::map<DesignInfo::DesignCell *, int> MacroLegalizer::CARRYCell2Column
private

record the PlacementUnits in each column of CARRY site

Definition at line 414 of file MacroLegalizer.h.

Referenced by findPossibleLegalLocation(), and resolveOverflowColumns().

◆ CARRYColumn2PUs

std::vector<std::deque<PlacementInfo::PlacementUnit *> > MacroLegalizer::CARRYColumn2PUs
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().

◆ CARRYColumn2Sites

std::vector<std::vector<DeviceInfo::DeviceSite *> > MacroLegalizer::CARRYColumn2Sites
private

record the sites in each column of CARRY

Definition at line 360 of file MacroLegalizer.h.

Referenced by finalLegalizeBasedOnDP(), findMacroType2AvailableSites(), findPossibleLegalLocation(), and resolveOverflowColumns().

◆ CARRYColumnNum

int MacroLegalizer::CARRYColumnNum = -1
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().

◆ CARRYColumnUntilization

std::vector<int> MacroLegalizer::CARRYColumnUntilization
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().

◆ CARRYColumnXs

std::vector<float> MacroLegalizer::CARRYColumnXs
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().

◆ CARRYPUs

std::set<PlacementInfo::PlacementUnit *> MacroLegalizer::CARRYPUs
private

the PlacementUnits which shoudl be mapped to CARRY BEL

Definition at line 463 of file MacroLegalizer.h.

Referenced by getMacrosToLegalize(), and mapMacrosToColumns().

◆ CARRYRowNum

int MacroLegalizer::CARRYRowNum = -1
private

the number of CARRY rows on the target device

Definition at line 324 of file MacroLegalizer.h.

Referenced by findMacroType2AvailableSites().

◆ cellLevelMatching

std::vector<std::pair<DesignInfo::DesignCell *, DeviceInfo::DeviceSite *> > MacroLegalizer::cellLevelMatching
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().

◆ cellLoc

std::vector<PlacementInfo::Location>& MacroLegalizer::cellLoc
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().

◆ clockRegionAware

bool MacroLegalizer::clockRegionAware = false
private

◆ clockRegionCasLegalization

bool MacroLegalizer::clockRegionCasLegalization = false
private

Definition at line 471 of file MacroLegalizer.h.

Referenced by findPossibleLegalLocation(), and setClockRegionCasLegalization().

◆ clockRegionHeightOfDSE_BRAM

int MacroLegalizer::clockRegionHeightOfDSE_BRAM = 24
private

Definition at line 473 of file MacroLegalizer.h.

Referenced by findPossibleLegalLocation().

◆ compatiblePlacementTable

PlacementInfo::CompatiblePlacementTable* MacroLegalizer::compatiblePlacementTable
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().

◆ deviceInfo

DeviceInfo* MacroLegalizer::deviceInfo
private

Definition at line 167 of file MacroLegalizer.h.

Referenced by findMacroType2AvailableSites().

◆ displacementThreshold

float MacroLegalizer::displacementThreshold = 30
private

displacement threshold to detect potential legal sites

Definition at line 282 of file MacroLegalizer.h.

Referenced by findMacroCell2SitesInDistance(), findPossibleLegalLocation(), fixedColumnLegalize(), resetSettings(), and roughlyLegalize().

◆ DSPCell2Column

std::map<DesignInfo::DesignCell *, int> MacroLegalizer::DSPCell2Column
private

record the PlacementUnits in each column of DSP site

Definition at line 408 of file MacroLegalizer.h.

Referenced by findPossibleLegalLocation(), and resolveOverflowColumns().

◆ DSPColumn2PUs

std::vector<std::deque<PlacementInfo::PlacementUnit *> > MacroLegalizer::DSPColumn2PUs
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().

◆ DSPColumn2Sites

std::vector<std::vector<DeviceInfo::DeviceSite *> > MacroLegalizer::DSPColumn2Sites
private

record the sites in each column of DSP

Definition at line 354 of file MacroLegalizer.h.

Referenced by finalLegalizeBasedOnDP(), findMacroType2AvailableSites(), findPossibleLegalLocation(), and resolveOverflowColumns().

◆ DSPColumnNum

int MacroLegalizer::DSPColumnNum = -1
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().

◆ DSPColumnUntilization

std::vector<int> MacroLegalizer::DSPColumnUntilization
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().

◆ DSPColumnXs

std::vector<float> MacroLegalizer::DSPColumnXs
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().

◆ DSPPUs

std::set<PlacementInfo::PlacementUnit *> MacroLegalizer::DSPPUs
private

the PlacementUnits which shoudl be mapped to DSP site

Definition at line 457 of file MacroLegalizer.h.

Referenced by getMacrosToLegalize(), and mapMacrosToColumns().

◆ DSPRowNum

int MacroLegalizer::DSPRowNum = -1
private

the number of DSP rows on the target device

Definition at line 318 of file MacroLegalizer.h.

Referenced by findMacroType2AvailableSites().

◆ DumpMacroLegalizationCnt

int MacroLegalizer::DumpMacroLegalizationCnt = 0
private

Definition at line 276 of file MacroLegalizer.h.

Referenced by dumpMatching().

◆ enableBRAMLegalization

bool MacroLegalizer::enableBRAMLegalization = false
private

Definition at line 465 of file MacroLegalizer.h.

Referenced by findMacroType2AvailableSites(), and resolveOverflowColumns().

◆ enableCARRYLegalization

bool MacroLegalizer::enableCARRYLegalization = false
private

Definition at line 467 of file MacroLegalizer.h.

Referenced by findMacroType2AvailableSites(), and resolveOverflowColumns().

◆ enableDSPLegalization

bool MacroLegalizer::enableDSPLegalization = false
private

Definition at line 466 of file MacroLegalizer.h.

Referenced by findMacroType2AvailableSites(), and resolveOverflowColumns().

◆ finalAverageDisplacement

float MacroLegalizer::finalAverageDisplacement = 10000.0
private

the average displacement of exact legalization for the involved PlacementUnit

Definition at line 479 of file MacroLegalizer.h.

Referenced by finalLegalizeBasedOnDP(), and getAverageDisplacementOfExactLegalization().

◆ fixedColumnAverageDisplacement

float MacroLegalizer::fixedColumnAverageDisplacement = 10000.0
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().

◆ initialDisplacementThreshold

float MacroLegalizer::initialDisplacementThreshold = 30
private

displacement threshold to detect potential legal sites

Definition at line 502 of file MacroLegalizer.h.

Referenced by findPossibleLegalLocation(), resetSettings(), and setIntitialParameters().

◆ initialMacrosToLegalize

std::vector<DesignInfo::DesignCell *> MacroLegalizer::initialMacrosToLegalize
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().

◆ initialMaxNumCandidate

int MacroLegalizer::initialMaxNumCandidate = 30
private

the maximum number of final candidate sites

Definition at line 508 of file MacroLegalizer.h.

Referenced by resetSettings(), and setIntitialParameters().

◆ JSONCfg

std::map<std::string, std::string>& MacroLegalizer::JSONCfg
private

Definition at line 188 of file MacroLegalizer.h.

Referenced by dumpMatching(), and MacroLegalizer().

◆ legalizerName

std::string MacroLegalizer::legalizerName
private

◆ macro2Sites

std::map<DesignInfo::DesignCell *, std::vector<DeviceInfo::DeviceSite *> > MacroLegalizer::macro2Sites
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().

◆ macro2SitesInDisplacementThreshold

std::map<DesignInfo::DesignCell *, std::vector<DeviceInfo::DeviceSite *> *> MacroLegalizer::macro2SitesInDisplacementThreshold
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().

◆ macroCellsToLegalize

std::vector<DesignInfo::DesignCell *> MacroLegalizer::macroCellsToLegalize
private

◆ macroType2Sites

std::map<DesignInfo::DesignCellType, std::vector<DeviceInfo::DeviceSite *> > MacroLegalizer::macroType2Sites
private

a map record the potential sites of different site types

Definition at line 218 of file MacroLegalizer.h.

Referenced by findMacroType2AvailableSites(), and findPossibleLegalLocation().

◆ macroTypesToLegalize

std::vector<DesignInfo::DesignCellType> MacroLegalizer::macroTypesToLegalize
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().

◆ macroUnitsToLegalizeSet

std::set<PlacementInfo::PlacementUnit *> MacroLegalizer::macroUnitsToLegalizeSet
private

a set storing the macros which have NOT been legalized

Definition at line 212 of file MacroLegalizer.h.

Referenced by getMacrosToLegalize().

◆ matchedMacroCells

std::set<DesignInfo::DesignCell *> MacroLegalizer::matchedMacroCells
private

a set of cells in macros binded to corresponding DeviceSites

Definition at line 256 of file MacroLegalizer.h.

Referenced by resetSettings(), and updateMatchingAndUnmatchedMacroCells().

◆ matchedSites

std::set<DeviceInfo::DeviceSite *> MacroLegalizer::matchedSites
private

a set of DeviceSites binded to corresponding PlacementUnits

Definition at line 262 of file MacroLegalizer.h.

Referenced by findPossibleLegalLocation(), resetSettings(), and updateMatchingAndUnmatchedMacroCells().

◆ maxNumCandidate

int MacroLegalizer::maxNumCandidate = 30
private

the maximum number of final candidate sites

Definition at line 288 of file MacroLegalizer.h.

Referenced by findMacroCell2SitesInDistance(), findPossibleLegalLocation(), fixedColumnLegalize(), resetSettings(), and roughlyLegalize().

◆ minCostBipartiteMatcher

MinCostBipartiteMatcher* MacroLegalizer::minCostBipartiteMatcher = nullptr
private

min-cost bipartite matching solver for the legalization

Definition at line 194 of file MacroLegalizer.h.

Referenced by fixedColumnLegalize(), roughlyLegalize(), updateMatchingAndUnmatchedMacroCells(), and ~MacroLegalizer().

◆ nJobs

int MacroLegalizer::nJobs = 1
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().

◆ noTarget

bool MacroLegalizer::noTarget = false
private

Definition at line 496 of file MacroLegalizer.h.

Referenced by hasNoTarget(), and legalize().

◆ placementInfo

◆ PU2Columns

std::map<PlacementInfo::PlacementUnit *, std::vector<int> > MacroLegalizer::PU2Columns
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().

◆ PU2LegalSites

std::map<PlacementInfo::PlacementUnit *, std::vector<DeviceInfo::DeviceSite *> > MacroLegalizer::PU2LegalSites
private

◆ PU2SiteX

std::map<PlacementInfo::PlacementUnit *, int> MacroLegalizer::PU2SiteX
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().

◆ PU2X

std::map<PlacementInfo::PlacementUnit *, float> MacroLegalizer::PU2X
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().

◆ PU2Y

std::map<PlacementInfo::PlacementUnit *, float> MacroLegalizer::PU2Y
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().

◆ PULevelMatching

std::vector<std::pair<PlacementInfo::PlacementUnit *, DeviceInfo::DeviceSite *> > MacroLegalizer::PULevelMatching
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().

◆ rightSiteIds

std::map<DeviceInfo::DeviceSite *, int> MacroLegalizer::rightSiteIds
private

map sites to temperary indexes for bipartite matching

Definition at line 238 of file MacroLegalizer.h.

Referenced by createBipartiteGraph(), fixedColumnLegalize(), and roughlyLegalize().

◆ roughAverageDisplacement

float MacroLegalizer::roughAverageDisplacement = 10000.0
private

the average displacement of rough legalization for the involved PlacementUnit

Definition at line 494 of file MacroLegalizer.h.

Referenced by getAverageDisplacementOfRoughLegalization(), and updatePUMatchingLocation().

◆ siteList

std::vector<DeviceInfo::DeviceSite *> MacroLegalizer::siteList
private

a vector for the candidate sites for bipartite matching

Definition at line 244 of file MacroLegalizer.h.

Referenced by createBipartiteGraph(), and updateMatchingAndUnmatchedMacroCells().

◆ timingDrivenLegalize

bool MacroLegalizer::timingDrivenLegalize = false
private

Definition at line 472 of file MacroLegalizer.h.

Referenced by getHPWLChange(), and legalize().

◆ verbose

bool MacroLegalizer::verbose = false
private

◆ y2xRatio

float MacroLegalizer::y2xRatio = 1.0
private

Definition at line 469 of file MacroLegalizer.h.

Referenced by getDisplacement(), getHPWLChange(), and MacroLegalizer().


The documentation for this class was generated from the following files: