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

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>

Collaboration diagram for GeneralSpreader:

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::SpreadRegionexpandFromABin (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

PlacementInfoplacementInfo
 
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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ GeneralSpreader()

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.

Parameters
placementInfothe PlacementInfo for this placer to handle
JSONCfgthe user-defined placement configuration
sharedCellTypea string indicating the cell type which should be handled by this spreader
currentIterationthe current global placement iteration number, which might be used for spreading settings
capacityShrinkRatioshrink the area supply to a specific ratio
verboseoption to enable detailed information display in terminal

Definition at line 34 of file GeneralSpreader.cc.

◆ ~GeneralSpreader()

GeneralSpreader::~GeneralSpreader ( )
inline

Definition at line 64 of file GeneralSpreader.h.

Member Function Documentation

◆ DumpCellsCoordinate()

void GeneralSpreader::DumpCellsCoordinate ( std::string  dumpFileName,
GeneralSpreader::SpreadRegion curRegion 
)

Definition at line 1335 of file GeneralSpreader.cc.

Here is the call graph for this function:

◆ dumpLUTFFCoordinate()

void GeneralSpreader::dumpLUTFFCoordinate ( )

Definition at line 1279 of file GeneralSpreader.cc.

Referenced by spreadPlacementUnits().

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

◆ DumpPUCoordinate()

void GeneralSpreader::DumpPUCoordinate ( std::string  dumpFileName,
std::vector< PlacementInfo::PlacementUnit * > &  involvedPUVec 
)

Definition at line 1353 of file GeneralSpreader.cc.

Here is the call graph for this function:

◆ dumpSiteGridDensity()

void GeneralSpreader::dumpSiteGridDensity ( std::string  dumpFileName)
private

Definition at line 1256 of file GeneralSpreader.cc.

Referenced by spreadPlacementUnits().

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

◆ expandFromABin()

GeneralSpreader::SpreadRegion * GeneralSpreader::expandFromABin ( PlacementInfo::PlacementBinInfo curBin,
float  capacityShrinkRatio,
unsigned int  numBinThr = 1000000 
)
private

obtain a SpreadRegion by expanding a cell spreading window from an overflow bin

Parameters
curBinthe initial bin for the SpreadRegion construction
capacityShrinkRatioshrink the area supply to a specific ratio
numBinThrthe maximum number of bin in one
Returns
GeneralSpreader::SpreadRegion*

Definition at line 613 of file GeneralSpreader.cc.

Referenced by spreadPlacementUnits().

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

◆ findOverflowBins()

void GeneralSpreader::findOverflowBins ( float  overflowThreshold)
private

find the overflow bins in the placement accoridng to a given threshold

Parameters
overflowThresholda given threshold

Definition at line 267 of file GeneralSpreader.cc.

Referenced by spreadPlacementUnits().

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

◆ makeCellInLegalArea()

static void GeneralSpreader::makeCellInLegalArea ( PlacementInfo placementInfo,
float &  cellX,
float &  cellY 
)
inlinestatic

ensure the X/Y is in the legal range of the target device

Parameters
placementInfoPlacementInfo so this object can access the corresponding placement database
cellXinout reference to legalize X location for a given location X
cellYinout reference to legalize Y location for a given location Y

Definition at line 1192 of file GeneralSpreader.h.

Referenced by updatePlacementUnitsWithSpreadedCellLocations(), and updatePlacementUnitsWithSpreadedCellLocationsWorker().

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

◆ recordSpreadedCellLocations()

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

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

◆ spreadPlacementUnits()

void GeneralSpreader::spreadPlacementUnits ( float  forgetRatio,
bool  enableClockRegionAware = false,
float  displacementLimit = -10,
unsigned int  spreadRegionBinSizeLimit = 1000000 
)

spread cells with a given forgetting ratio

Parameters
forgetRatioforget the original according to a given extent ratio. Lower forget ratio will make cell spreading less sensitive (mreo stable).
enableClockRegionAwarespread but limit in specific clock region
spreadRegionBinSizeLimitthe maximum size of the spread region for a overflow bin

Definition at line 52 of file GeneralSpreader.cc.

Referenced by GlobalPlacer::spreading().

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

◆ updatePlacementUnitsWithSpreadedCellLocations()

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.

Parameters
involvedPUsa set of PlacementUnit which are involved in the cell spreading procedure
involvedCellsa set of DesignCell which are involved in the cell spreading procedure
involvedPUVeca vector of PlacementUnit which are involved in the cell spreading procedure(ensure the iteration order)
forgetRatiothe forget ratio for the original location in last iteration
enableClockRegionAwarespread but limit in specific clock region

Definition at line 414 of file GeneralSpreader.cc.

Referenced by spreadPlacementUnits().

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

◆ updatePlacementUnitsWithSpreadedCellLocationsWorker()

void GeneralSpreader::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 
)
static

multi-threading workers for updating the information of the involved PlacementUnit(s)

Parameters
placementInfoPlacementInfo so this object can access the corresponding placement database
involvedPUsa set of PlacementUnit which are involved in the cell spreading procedure
involvedCellsa set of DesignCell which are involved in the cell spreading procedure
involvedPUVeca vector of PlacementUnit which are involved in the cell spreading procedure(ensure the iteration order)
forgetRatiothe forget ratio for the original location in last iteration
startIdthe PlacementUnit range begin for this worker
endIdthe PlacementUnit range end for this worker

Definition at line 307 of file GeneralSpreader.cc.

Referenced by updatePlacementUnitsWithSpreadedCellLocations().

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

Member Data Documentation

◆ binGrid

std::vector<std::vector<PlacementInfo::PlacementBinInfo *> >& GeneralSpreader::binGrid
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().

◆ capacityShrinkRatio

float GeneralSpreader::capacityShrinkRatio = 1.0
private

◆ coveredBinSet

◆ currentIteration

int GeneralSpreader::currentIteration = 0
private

Definition at line 1226 of file GeneralSpreader.h.

◆ dumpCnt

int GeneralSpreader::dumpCnt = 0
private

Definition at line 1248 of file GeneralSpreader.h.

Referenced by DumpCellsCoordinate(), and DumpPUCoordinate().

◆ dumpSiteGridDensityCnt

int GeneralSpreader::dumpSiteGridDensityCnt = 0
private

Definition at line 1236 of file GeneralSpreader.h.

Referenced by dumpSiteGridDensity().

◆ enforceSimpleExpland

bool GeneralSpreader::enforceSimpleExpland = false
private

Definition at line 1247 of file GeneralSpreader.h.

◆ expandedRegions

std::vector<GeneralSpreader::SpreadRegion *> GeneralSpreader::expandedRegions
private

the obtained SpreadRegion s which can be processed in parallel.

Definition at line 1292 of file GeneralSpreader.h.

Referenced by spreadPlacementUnits().

◆ JSONCfg

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

Definition at line 1224 of file GeneralSpreader.h.

Referenced by dumpLUTFFCoordinate(), GeneralSpreader(), and spreadPlacementUnits().

◆ LUTFFCoordinateDumpCnt

int GeneralSpreader::LUTFFCoordinateDumpCnt = 0
private

Definition at line 1237 of file GeneralSpreader.h.

Referenced by dumpLUTFFCoordinate().

◆ nJobs

int GeneralSpreader::nJobs = 1
private

◆ overflowBins

std::vector<PlacementInfo::PlacementBinInfo *> GeneralSpreader::overflowBins
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().

◆ overflowBinSet

std::set<PlacementInfo::PlacementBinInfo *> GeneralSpreader::overflowBinSet
private

a set of the found overflow bins in the current placement

Definition at line 1260 of file GeneralSpreader.h.

Referenced by findOverflowBins().

◆ placementInfo

◆ sharedCellType

std::string GeneralSpreader::sharedCellType
private

◆ useSimpleExpland

bool GeneralSpreader::useSimpleExpland = false
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().

◆ verbose

bool GeneralSpreader::verbose
private

Definition at line 1228 of file GeneralSpreader.h.

Referenced by spreadPlacementUnits().


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