AMF-Placer
2.0
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
|
GeneralSpreader accounts for the cell spreading, which controls the cell density of specific resource type, under the device constraints for specific regions. More...
#include <GeneralSpreader.h>
Classes | |
class | SpreadRegion |
SpreadRegion is an object that record cell spreading region information, including boundaries, cells, bins, and spreading boxes. More... | |
Public Member Functions | |
GeneralSpreader (PlacementInfo *placementInfo, std::map< std::string, std::string > &JSONCfg, std::string &sharedCellType, int currentIteration, float capacityShrinkRatio, bool verbose=true) | |
Construct a new General Spreader object. More... | |
~GeneralSpreader () | |
void | spreadPlacementUnits (float forgetRatio, bool enableClockRegionAware=false, float displacementLimit=-10, unsigned int spreadRegionBinSizeLimit=1000000) |
spread cells with a given forgetting ratio More... | |
void | dumpLUTFFCoordinate () |
void | updatePlacementUnitsWithSpreadedCellLocations (std::set< PlacementInfo::PlacementUnit * > &involvedPUs, std::set< DesignInfo::DesignCell * > &involvedCells, std::vector< PlacementInfo::PlacementUnit * > &involvedPUVec, float forgetRatio, bool enableClockRegionAware, float displacementLimit) |
update the information of the involved PlacementUnit(s) More... | |
void | recordSpreadedCellLocations () |
record the spreaded location in PlacementInfo for later forget-ratio-based location updating More... | |
void | DumpCellsCoordinate (std::string dumpFileName, GeneralSpreader::SpreadRegion *curRegion) |
void | DumpPUCoordinate (std::string dumpFileName, std::vector< PlacementInfo::PlacementUnit * > &involvedPUVec) |
Static Public Member Functions | |
static void | updatePlacementUnitsWithSpreadedCellLocationsWorker (PlacementInfo *placementInfo, std::set< PlacementInfo::PlacementUnit * > &involvedPUs, std::set< DesignInfo::DesignCell * > &involvedCells, std::vector< PlacementInfo::PlacementUnit * > &involvedPUVec, float forgetRatio, float displacementLimit, int startId, int endId) |
multi-threading workers for updating the information of the involved PlacementUnit(s) More... | |
static void | makeCellInLegalArea (PlacementInfo *placementInfo, float &cellX, float &cellY) |
ensure the X/Y is in the legal range of the target device More... | |
Private Member Functions | |
void | dumpSiteGridDensity (std::string dumpFileName) |
void | findOverflowBins (float overflowThreshold) |
find the overflow bins in the placement accoridng to a given threshold More... | |
GeneralSpreader::SpreadRegion * | expandFromABin (PlacementInfo::PlacementBinInfo *curBin, float capacityShrinkRatio, unsigned int numBinThr=1000000) |
obtain a SpreadRegion by expanding a cell spreading window from an overflow bin More... | |
Private Attributes | |
PlacementInfo * | placementInfo |
std::map< std::string, std::string > & | JSONCfg |
std::string | sharedCellType |
int | currentIteration = 0 |
float | capacityShrinkRatio = 1.0 |
bool | verbose |
std::vector< std::vector< PlacementInfo::PlacementBinInfo * > > & | binGrid |
a reference of the global bin grid for data accessing and updating of cell density More... | |
int | dumpSiteGridDensityCnt = 0 |
int | LUTFFCoordinateDumpCnt = 0 |
int | nJobs = 1 |
bool | useSimpleExpland = false |
simple expansion will iteratively try 4 directions to expand the SpreadRegion More... | |
bool | enforceSimpleExpland = false |
int | dumpCnt = 0 |
std::vector< PlacementInfo::PlacementBinInfo * > | overflowBins |
a vector of the found overflow bins in the current placement More... | |
std::set< PlacementInfo::PlacementBinInfo * > | overflowBinSet |
a set of the found overflow bins in the current placement More... | |
std::set< PlacementInfo::PlacementBinInfo * > | coveredBinSet |
a set of the bins covered by existing SpreadRegion(s) More... | |
std::vector< GeneralSpreader::SpreadRegion * > | expandedRegions |
the obtained SpreadRegion s which can be processed in parallel. More... | |
GeneralSpreader accounts for the cell spreading, which controls the cell density of specific resource type, under the device constraints for specific regions.
Definition at line 49 of file GeneralSpreader.h.
GeneralSpreader::GeneralSpreader | ( | PlacementInfo * | placementInfo, |
std::map< std::string, std::string > & | JSONCfg, | ||
std::string & | sharedCellType, | ||
int | currentIteration, | ||
float | capacityShrinkRatio, | ||
bool | verbose = true |
||
) |
Construct a new General Spreader object.
placementInfo | the PlacementInfo for this placer to handle |
JSONCfg | the user-defined placement configuration |
sharedCellType | a string indicating the cell type which should be handled by this spreader |
currentIteration | the current global placement iteration number, which might be used for spreading settings |
capacityShrinkRatio | shrink the area supply to a specific ratio |
verbose | option to enable detailed information display in terminal |
Definition at line 34 of file GeneralSpreader.cc.
|
inline |
Definition at line 64 of file GeneralSpreader.h.
void GeneralSpreader::DumpCellsCoordinate | ( | std::string | dumpFileName, |
GeneralSpreader::SpreadRegion * | curRegion | ||
) |
void GeneralSpreader::dumpLUTFFCoordinate | ( | ) |
Definition at line 1279 of file GeneralSpreader.cc.
Referenced by spreadPlacementUnits().
void GeneralSpreader::DumpPUCoordinate | ( | std::string | dumpFileName, |
std::vector< PlacementInfo::PlacementUnit * > & | involvedPUVec | ||
) |
|
private |
Definition at line 1256 of file GeneralSpreader.cc.
Referenced by spreadPlacementUnits().
|
private |
obtain a SpreadRegion by expanding a cell spreading window from an overflow bin
curBin | the initial bin for the SpreadRegion construction |
capacityShrinkRatio | shrink the area supply to a specific ratio |
numBinThr | the maximum number of bin in one |
Definition at line 613 of file GeneralSpreader.cc.
Referenced by spreadPlacementUnits().
|
private |
find the overflow bins in the placement accoridng to a given threshold
overflowThreshold | a given threshold |
Definition at line 267 of file GeneralSpreader.cc.
Referenced by spreadPlacementUnits().
|
inlinestatic |
ensure the X/Y is in the legal range of the target device
placementInfo | PlacementInfo so this object can access the corresponding placement database |
cellX | inout reference to legalize X location for a given location X |
cellY | inout reference to legalize Y location for a given location Y |
Definition at line 1192 of file GeneralSpreader.h.
Referenced by updatePlacementUnitsWithSpreadedCellLocations(), and updatePlacementUnitsWithSpreadedCellLocationsWorker().
void GeneralSpreader::recordSpreadedCellLocations | ( | ) |
record the spreaded location in PlacementInfo for later forget-ratio-based location updating
Definition at line 698 of file GeneralSpreader.cc.
Referenced by spreadPlacementUnits().
void GeneralSpreader::spreadPlacementUnits | ( | float | forgetRatio, |
bool | enableClockRegionAware = false , |
||
float | displacementLimit = -10 , |
||
unsigned int | spreadRegionBinSizeLimit = 1000000 |
||
) |
spread cells with a given forgetting ratio
forgetRatio | forget the original according to a given extent ratio. Lower forget ratio will make cell spreading less sensitive (mreo stable). |
enableClockRegionAware | spread but limit in specific clock region |
spreadRegionBinSizeLimit | the maximum size of the spread region for a overflow bin |
Definition at line 52 of file GeneralSpreader.cc.
Referenced by GlobalPlacer::spreading().
void GeneralSpreader::updatePlacementUnitsWithSpreadedCellLocations | ( | std::set< PlacementInfo::PlacementUnit * > & | involvedPUs, |
std::set< DesignInfo::DesignCell * > & | involvedCells, | ||
std::vector< PlacementInfo::PlacementUnit * > & | involvedPUVec, | ||
float | forgetRatio, | ||
bool | enableClockRegionAware, | ||
float | displacementLimit | ||
) |
update the information of the involved PlacementUnit(s)
The inforation including cell location and the related bins should be updated. Only the involved elements will lead to information update, which can reduce the runtime.
involvedPUs | a set of PlacementUnit which are involved in the cell spreading procedure |
involvedCells | a set of DesignCell which are involved in the cell spreading procedure |
involvedPUVec | a vector of PlacementUnit which are involved in the cell spreading procedure(ensure the iteration order) |
forgetRatio | the forget ratio for the original location in last iteration |
enableClockRegionAware | spread but limit in specific clock region |
Definition at line 414 of file GeneralSpreader.cc.
Referenced by spreadPlacementUnits().
|
static |
multi-threading workers for updating the information of the involved PlacementUnit(s)
placementInfo | PlacementInfo so this object can access the corresponding placement database |
involvedPUs | a set of PlacementUnit which are involved in the cell spreading procedure |
involvedCells | a set of DesignCell which are involved in the cell spreading procedure |
involvedPUVec | a vector of PlacementUnit which are involved in the cell spreading procedure(ensure the iteration order) |
forgetRatio | the forget ratio for the original location in last iteration |
startId | the PlacementUnit range begin for this worker |
endId | the PlacementUnit range end for this worker |
Definition at line 307 of file GeneralSpreader.cc.
Referenced by updatePlacementUnitsWithSpreadedCellLocations().
|
private |
a reference of the global bin grid for data accessing and updating of cell density
Definition at line 1234 of file GeneralSpreader.h.
Referenced by expandFromABin(), findOverflowBins(), GeneralSpreader::SpreadRegion::SubBox::spreadCellsH(), GeneralSpreader::SpreadRegion::SubBox::spreadCellsV(), and spreadPlacementUnits().
|
private |
Definition at line 1227 of file GeneralSpreader.h.
Referenced by expandFromABin(), GeneralSpreader::SpreadRegion::SubBox::spreadCellsH(), GeneralSpreader::SpreadRegion::SubBox::spreadCellsV(), and spreadPlacementUnits().
|
private |
a set of the bins covered by existing SpreadRegion(s)
Definition at line 1266 of file GeneralSpreader.h.
Referenced by GeneralSpreader::SpreadRegion::addBinRegion(), expandFromABin(), GeneralSpreader::SpreadRegion::isCovered(), GeneralSpreader::SpreadRegion::simpleExpand(), GeneralSpreader::SpreadRegion::simpleFindExpandDirection(), GeneralSpreader::SpreadRegion::smartExpand(), GeneralSpreader::SpreadRegion::smartFindExpandDirection(), and spreadPlacementUnits().
|
private |
Definition at line 1226 of file GeneralSpreader.h.
|
private |
Definition at line 1248 of file GeneralSpreader.h.
Referenced by DumpCellsCoordinate(), and DumpPUCoordinate().
|
private |
Definition at line 1236 of file GeneralSpreader.h.
Referenced by dumpSiteGridDensity().
|
private |
Definition at line 1247 of file GeneralSpreader.h.
|
private |
the obtained SpreadRegion s which can be processed in parallel.
Definition at line 1292 of file GeneralSpreader.h.
Referenced by spreadPlacementUnits().
|
private |
Definition at line 1224 of file GeneralSpreader.h.
Referenced by dumpLUTFFCoordinate(), GeneralSpreader(), and spreadPlacementUnits().
|
private |
Definition at line 1237 of file GeneralSpreader.h.
Referenced by dumpLUTFFCoordinate().
|
private |
Definition at line 1238 of file GeneralSpreader.h.
Referenced by GeneralSpreader(), spreadPlacementUnits(), and updatePlacementUnitsWithSpreadedCellLocations().
|
private |
a vector of the found overflow bins in the current placement
Definition at line 1254 of file GeneralSpreader.h.
Referenced by findOverflowBins(), GeneralSpreader(), and spreadPlacementUnits().
|
private |
a set of the found overflow bins in the current placement
Definition at line 1260 of file GeneralSpreader.h.
Referenced by findOverflowBins().
|
private |
Definition at line 1223 of file GeneralSpreader.h.
Referenced by DumpCellsCoordinate(), dumpLUTFFCoordinate(), dumpSiteGridDensity(), expandFromABin(), makeCellInLegalArea(), recordSpreadedCellLocations(), GeneralSpreader::SpreadRegion::SubBox::spreadCellsH(), GeneralSpreader::SpreadRegion::SubBox::spreadCellsV(), spreadPlacementUnits(), updatePlacementUnitsWithSpreadedCellLocations(), and updatePlacementUnitsWithSpreadedCellLocationsWorker().
|
private |
Definition at line 1225 of file GeneralSpreader.h.
Referenced by dumpLUTFFCoordinate(), dumpSiteGridDensity(), and spreadPlacementUnits().
|
private |
simple expansion will iteratively try 4 directions to expand the SpreadRegion
smart expansion will greedily select a promising direction to expand the SpreadRegion
Definition at line 1246 of file GeneralSpreader.h.
Referenced by expandFromABin(), and GeneralSpreader().
|
private |
Definition at line 1228 of file GeneralSpreader.h.
Referenced by spreadPlacementUnits().