AMF-Placer  2.0
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
PlacementInfo::PlacementBinInfo Class Reference

BEL bin for global placement for a specific shared BEL type. More...

#include <PlacementInfo.h>

Collaboration diagram for PlacementInfo::PlacementBinInfo:

Public Member Functions

 PlacementBinInfo (std::string sharedCellType, float leftX, float rightX, float bottomY, float topY, int row, int column, CompatiblePlacementTable *compatiblePlacementTable)
 Construct a new Placement Bin Info object. More...
 
 ~PlacementBinInfo ()
 
float getManhattanDistanceTo (float inX, float inY)
 Get the shortest Manhattan distance from the bin to a specific location. More...
 
void addSiteIntoBin (DeviceInfo::DeviceSite *curSite)
 add a resource site into the bin More...
 
bool inRange (float x, float y)
 check if the bin covers a given location on the device More...
 
bool inRangeY (float y)
 
void addCell (DesignInfo::DesignCell *cell, int occupationAdded)
 add a design cell into the bin More...
 
void removeCell (DesignInfo::DesignCell *cell, int occupationAdded)
 remove a design cell from the bin More...
 
bool contains (DesignInfo::DesignCell *cell)
 
void reset ()
 
void shrinkBinBy (float r)
 reduce the resource capacity by a given ratio More...
 
void inflateBinBy (float r)
 increase the resource capacity by a given ratio More...
 
void resetBinShrinkRatio ()
 
float getRequiredBinShrinkRatio ()
 
void setRequiredBinShrinkRatio (float r)
 Set the Required Bin Shrink Ratio for a bin. More...
 
std::set< DesignInfo::DesignCell * > & getCells ()
 Get the reference of the set of cells in the bin. More...
 
float getBinShrinkRatio ()
 
float getUtilizationRate ()
 Get the Utilization Rate: utilization / (capacity * binShrinkRatio) More...
 
float getRealUtilizationRate ()
 Get the theoratical utilization rate (use LUT theoratical resource utilization without any adjustment to dump bin information) More...
 
float getUtilization ()
 
float getCapacity ()
 
bool isOverflow (float overflowThreshold)
 check whether the resource demand in the bin is higher than the supply. More...
 
bool canAddMore (int BELAmo)
 check whether we can add some BEL demand to the bin More...
 
int Y ()
 return the row of the bin in the grid More...
 
int X ()
 return the column of the bin in the grid More...
 
float left ()
 return the left boundary of the bin More...
 
float right ()
 return the right boundary of the bin More...
 
float top ()
 return the top boundary of the bin More...
 
float bottom ()
 return the bottom boundary of the bin More...
 
std::string getType ()
 
void countOverflow ()
 increase one time of overflow situation More...
 
void countNoOverflow ()
 increase one time of non-overflow situation More...
 
void resetNoOverflowCounter ()
 
void resetOverflowCounter ()
 
int getNoOverflowCounter ()
 
int getOverflowCounter ()
 
std::vector< DeviceInfo::DeviceSite * > & getCorrespondingSites ()
 Get the reference of the set of sites in the bin. More...
 
std::string & getSharedCellType ()
 
void increaseSWDemandBy (float additionalDemand)
 increase the net routing demand of the bin More...
 
float getSwitchDemandForNets () const
 get the net routing demand of the bin More...
 
void setClockRegionX (int _x)
 Set the clock region X for this bin. More...
 
int getClockRegionX ()
 Get the clock region X for this bin. More...
 

Private Attributes

std::string sharedCellType
 
std::vector< DeviceInfo::DeviceSite * > correspondingSites
 
CompatiblePlacementTablecompatiblePlacementTable
 
std::set< DesignInfo::DesignCell * > cells
 
int capacity = 0
 
int utilization = 0
 
float binShrinkRatio = 1.0
 
float requiredBinShrinkRatio = 1.0
 
const float leftX
 
const float rightX
 
const float topY
 
const float bottomY
 
float eps = 1e-5
 
const int row
 
const int column
 
int overflowCnt = 0
 
int noOverflowCnt = 0
 
float switchDemandForNets = 0.0
 
float switchSupplyForNets = 0.0
 
std::mutex mtx
 
int clockRegionX = -1
 

Detailed Description

BEL bin for global placement for a specific shared BEL type.

To easier to find the neighbors of a design instance, we divide the design instances in the placement into a grid of bins. A placement bin will record the instances and resource sites inside it.

Definition at line 371 of file PlacementInfo.h.

Constructor & Destructor Documentation

◆ PlacementBinInfo()

PlacementInfo::PlacementBinInfo::PlacementBinInfo ( std::string  sharedCellType,
float  leftX,
float  rightX,
float  bottomY,
float  topY,
int  row,
int  column,
CompatiblePlacementTable compatiblePlacementTable 
)
inline

Construct a new Placement Bin Info object.

To construct a placement bin, we need to indicate its boundaries and target cell type for later information processing.

Parameters
sharedCellType
leftXbin left boundary
rightXbin right boundary
bottomYbin bottom boundary
topYbin top boundary
rowwhich row in the grid
columnwhich column in the grid
compatiblePlacementTable

Definition at line 390 of file PlacementInfo.h.

◆ ~PlacementBinInfo()

PlacementInfo::PlacementBinInfo::~PlacementBinInfo ( )
inline

Definition at line 400 of file PlacementInfo.h.

Member Function Documentation

◆ addCell()

void PlacementInfo::PlacementBinInfo::addCell ( DesignInfo::DesignCell cell,
int  occupationAdded 
)
inline

add a design cell into the bin

we have to set the mutex locked during the process since we enable multi-threading in the placer.

Parameters
cell
occupationAddedhow many slots will the cell occupy

Definition at line 469 of file PlacementInfo.h.

◆ addSiteIntoBin()

void PlacementInfo::PlacementBinInfo::addSiteIntoBin ( DeviceInfo::DeviceSite curSite)

add a resource site into the bin

check the resources in the site and increase the resource capacity of the bin

Parameters
curSite

Definition at line 308 of file PlacementInfo.cc.

Here is the call graph for this function:

◆ bottom()

float PlacementInfo::PlacementBinInfo::bottom ( )
inline

return the bottom boundary of the bin

Returns
float

Definition at line 723 of file PlacementInfo.h.

Referenced by GeneralSpreader::expandFromABin(), and ParallelCLBPacker::findNeiborSitesFromBinGrid().

Here is the caller graph for this function:

◆ canAddMore()

bool PlacementInfo::PlacementBinInfo::canAddMore ( int  BELAmo)
inline

check whether we can add some BEL demand to the bin

Parameters
BELAmo
Returns
true when there are available resources meeting the BEL demand.
false when there is no available resource meeting the BEL demand.

Definition at line 661 of file PlacementInfo.h.

◆ contains()

bool PlacementInfo::PlacementBinInfo::contains ( DesignInfo::DesignCell cell)
inline

Definition at line 499 of file PlacementInfo.h.

◆ countNoOverflow()

void PlacementInfo::PlacementBinInfo::countNoOverflow ( )
inline

increase one time of non-overflow situation

Definition at line 746 of file PlacementInfo.h.

◆ countOverflow()

void PlacementInfo::PlacementBinInfo::countOverflow ( )
inline

increase one time of overflow situation

Definition at line 737 of file PlacementInfo.h.

◆ getBinShrinkRatio()

float PlacementInfo::PlacementBinInfo::getBinShrinkRatio ( )
inline

Definition at line 568 of file PlacementInfo.h.

◆ getCapacity()

float PlacementInfo::PlacementBinInfo::getCapacity ( )
inline

Definition at line 627 of file PlacementInfo.h.

Referenced by GeneralSpreader::SpreadRegion::SpreadRegion().

Here is the caller graph for this function:

◆ getCells()

std::set<DesignInfo::DesignCell *>& PlacementInfo::PlacementBinInfo::getCells ( )
inline

Get the reference of the set of cells in the bin.

Returns
std::set<DesignInfo::DesignCell *>&

Definition at line 563 of file PlacementInfo.h.

Referenced by PlacementInfo::findNeiborLUTFFsFromBinGrid(), ParallelCLBPacker::PackingCLBSite::findNeiborPUsFromBinGrid(), and GeneralSpreader::SpreadRegion::SpreadRegion().

Here is the caller graph for this function:

◆ getClockRegionX()

int PlacementInfo::PlacementBinInfo::getClockRegionX ( )
inline

Get the clock region X for this bin.

Definition at line 818 of file PlacementInfo.h.

◆ getCorrespondingSites()

std::vector<DeviceInfo::DeviceSite *>& PlacementInfo::PlacementBinInfo::getCorrespondingSites ( )
inline

Get the reference of the set of sites in the bin.

Returns
std::vector<DeviceInfo::DeviceSite *>&

Definition at line 775 of file PlacementInfo.h.

Referenced by PlacementInfo::findNeiborSiteFromBinGrid(), and ParallelCLBPacker::findNeiborSitesFromBinGrid().

Here is the caller graph for this function:

◆ getManhattanDistanceTo()

float PlacementInfo::PlacementBinInfo::getManhattanDistanceTo ( float  inX,
float  inY 
)
inline

Get the shortest Manhattan distance from the bin to a specific location.

Parameters
inX
inY
Returns
float

Definition at line 413 of file PlacementInfo.h.

Referenced by PlacementInfo::findNeiborLUTFFsFromBinGrid(), ParallelCLBPacker::PackingCLBSite::findNeiborPUsFromBinGrid(), PlacementInfo::findNeiborSiteFromBinGrid(), and ParallelCLBPacker::findNeiborSitesFromBinGrid().

Here is the caller graph for this function:

◆ getNoOverflowCounter()

int PlacementInfo::PlacementBinInfo::getNoOverflowCounter ( )
inline

Definition at line 761 of file PlacementInfo.h.

◆ getOverflowCounter()

int PlacementInfo::PlacementBinInfo::getOverflowCounter ( )
inline

Definition at line 765 of file PlacementInfo.h.

◆ getRealUtilizationRate()

float PlacementInfo::PlacementBinInfo::getRealUtilizationRate ( )
inline

Get the theoratical utilization rate (use LUT theoratical resource utilization without any adjustment to dump bin information)

Returns
float

Definition at line 592 of file PlacementInfo.h.

Here is the call graph for this function:

◆ getRequiredBinShrinkRatio()

float PlacementInfo::PlacementBinInfo::getRequiredBinShrinkRatio ( )
inline

Definition at line 541 of file PlacementInfo.h.

◆ getSharedCellType()

std::string& PlacementInfo::PlacementBinInfo::getSharedCellType ( )
inline

Definition at line 780 of file PlacementInfo.h.

◆ getSwitchDemandForNets()

float PlacementInfo::PlacementBinInfo::getSwitchDemandForNets ( ) const
inline

get the net routing demand of the bin

Definition at line 799 of file PlacementInfo.h.

◆ getType()

std::string PlacementInfo::PlacementBinInfo::getType ( )
inline

Definition at line 728 of file PlacementInfo.h.

◆ getUtilization()

float PlacementInfo::PlacementBinInfo::getUtilization ( )
inline

Definition at line 622 of file PlacementInfo.h.

Referenced by GeneralSpreader::SpreadRegion::SpreadRegion().

Here is the caller graph for this function:

◆ getUtilizationRate()

float PlacementInfo::PlacementBinInfo::getUtilizationRate ( )
inline

Get the Utilization Rate: utilization / (capacity * binShrinkRatio)

Returns
float

Definition at line 578 of file PlacementInfo.h.

Referenced by getRealUtilizationRate(), and siteSortCmp().

Here is the caller graph for this function:

◆ increaseSWDemandBy()

void PlacementInfo::PlacementBinInfo::increaseSWDemandBy ( float  additionalDemand)
inline

increase the net routing demand of the bin

Parameters
additionalDemand

Definition at line 790 of file PlacementInfo.h.

◆ inflateBinBy()

void PlacementInfo::PlacementBinInfo::inflateBinBy ( float  r)
inline

increase the resource capacity by a given ratio

Parameters
r

Definition at line 531 of file PlacementInfo.h.

◆ inRange()

bool PlacementInfo::PlacementBinInfo::inRange ( float  x,
float  y 
)
inline

check if the bin covers a given location on the device

Parameters
x
y
Returns
true if the bin covers the given location on the device
false if the bin does not cover the given location on the device

Definition at line 449 of file PlacementInfo.h.

◆ inRangeY()

bool PlacementInfo::PlacementBinInfo::inRangeY ( float  y)
inline

Definition at line 454 of file PlacementInfo.h.

◆ isOverflow()

bool PlacementInfo::PlacementBinInfo::isOverflow ( float  overflowThreshold)
inline

check whether the resource demand in the bin is higher than the supply.

Parameters
overflowThreshold
Returns
true if the resource supply is enough.
false if the resource supply is not enough.

Definition at line 639 of file PlacementInfo.h.

◆ left()

float PlacementInfo::PlacementBinInfo::left ( )
inline

return the left boundary of the bin

Returns
float

Definition at line 693 of file PlacementInfo.h.

Referenced by GeneralSpreader::expandFromABin(), and ParallelCLBPacker::findNeiborSitesFromBinGrid().

Here is the caller graph for this function:

◆ removeCell()

void PlacementInfo::PlacementBinInfo::removeCell ( DesignInfo::DesignCell cell,
int  occupationAdded 
)
inline

remove a design cell from the bin

Parameters
cell
occupationAddedhow many slots were occupied by the cell

we have to set the mutex locked during the process since we enable multi-threading in the placer.

Definition at line 488 of file PlacementInfo.h.

◆ reset()

void PlacementInfo::PlacementBinInfo::reset ( )
inline

Definition at line 505 of file PlacementInfo.h.

◆ resetBinShrinkRatio()

void PlacementInfo::PlacementBinInfo::resetBinShrinkRatio ( )
inline

Definition at line 536 of file PlacementInfo.h.

◆ resetNoOverflowCounter()

void PlacementInfo::PlacementBinInfo::resetNoOverflowCounter ( )
inline

Definition at line 753 of file PlacementInfo.h.

◆ resetOverflowCounter()

void PlacementInfo::PlacementBinInfo::resetOverflowCounter ( )
inline

Definition at line 757 of file PlacementInfo.h.

◆ right()

float PlacementInfo::PlacementBinInfo::right ( )
inline

return the right boundary of the bin

Returns
float

Definition at line 703 of file PlacementInfo.h.

Referenced by GeneralSpreader::expandFromABin(), and ParallelCLBPacker::findNeiborSitesFromBinGrid().

Here is the caller graph for this function:

◆ setClockRegionX()

void PlacementInfo::PlacementBinInfo::setClockRegionX ( int  _x)
inline

Set the clock region X for this bin.

Parameters
_x

Definition at line 809 of file PlacementInfo.h.

◆ setRequiredBinShrinkRatio()

void PlacementInfo::PlacementBinInfo::setRequiredBinShrinkRatio ( float  r)
inline

Set the Required Bin Shrink Ratio for a bin.

For example, to resolve routing congestion, we will modify the default resource capacity of a bin

Parameters
r

Definition at line 553 of file PlacementInfo.h.

◆ shrinkBinBy()

void PlacementInfo::PlacementBinInfo::shrinkBinBy ( float  r)
inline

reduce the resource capacity by a given ratio

Parameters
r

Definition at line 521 of file PlacementInfo.h.

◆ top()

float PlacementInfo::PlacementBinInfo::top ( )
inline

return the top boundary of the bin

Returns
float

Definition at line 713 of file PlacementInfo.h.

Referenced by GeneralSpreader::expandFromABin(), and ParallelCLBPacker::findNeiborSitesFromBinGrid().

Here is the caller graph for this function:

◆ X()

int PlacementInfo::PlacementBinInfo::X ( )
inline

return the column of the bin in the grid

Returns
int

Definition at line 683 of file PlacementInfo.h.

Referenced by GeneralSpreader::SpreadRegion::SpreadRegion().

Here is the caller graph for this function:

◆ Y()

int PlacementInfo::PlacementBinInfo::Y ( )
inline

return the row of the bin in the grid

Returns
int

Definition at line 673 of file PlacementInfo.h.

Referenced by GeneralSpreader::SpreadRegion::SpreadRegion().

Here is the caller graph for this function:

Member Data Documentation

◆ binShrinkRatio

float PlacementInfo::PlacementBinInfo::binShrinkRatio = 1.0
private

◆ bottomY

const float PlacementInfo::PlacementBinInfo::bottomY
private

Definition at line 837 of file PlacementInfo.h.

Referenced by bottom(), getManhattanDistanceTo(), inRange(), and inRangeY().

◆ capacity

int PlacementInfo::PlacementBinInfo::capacity = 0
private

◆ cells

std::set<DesignInfo::DesignCell *> PlacementInfo::PlacementBinInfo::cells
private

◆ clockRegionX

int PlacementInfo::PlacementBinInfo::clockRegionX = -1
private

Definition at line 850 of file PlacementInfo.h.

Referenced by getClockRegionX(), and setClockRegionX().

◆ column

const int PlacementInfo::PlacementBinInfo::column
private

Definition at line 841 of file PlacementInfo.h.

Referenced by X().

◆ compatiblePlacementTable

CompatiblePlacementTable* PlacementInfo::PlacementBinInfo::compatiblePlacementTable
private

Definition at line 826 of file PlacementInfo.h.

◆ correspondingSites

std::vector<DeviceInfo::DeviceSite *> PlacementInfo::PlacementBinInfo::correspondingSites
private

Definition at line 825 of file PlacementInfo.h.

Referenced by getCorrespondingSites(), PlacementBinInfo(), and ~PlacementBinInfo().

◆ eps

float PlacementInfo::PlacementBinInfo::eps = 1e-5
private

Definition at line 839 of file PlacementInfo.h.

Referenced by canAddMore(), and isOverflow().

◆ leftX

const float PlacementInfo::PlacementBinInfo::leftX
private

Definition at line 834 of file PlacementInfo.h.

Referenced by getManhattanDistanceTo(), inRange(), and left().

◆ mtx

std::mutex PlacementInfo::PlacementBinInfo::mtx
private

Definition at line 848 of file PlacementInfo.h.

Referenced by addCell(), and removeCell().

◆ noOverflowCnt

int PlacementInfo::PlacementBinInfo::noOverflowCnt = 0
private

◆ overflowCnt

int PlacementInfo::PlacementBinInfo::overflowCnt = 0
private

Definition at line 843 of file PlacementInfo.h.

Referenced by countOverflow(), getOverflowCounter(), reset(), and resetOverflowCounter().

◆ requiredBinShrinkRatio

float PlacementInfo::PlacementBinInfo::requiredBinShrinkRatio = 1.0
private

◆ rightX

const float PlacementInfo::PlacementBinInfo::rightX
private

Definition at line 835 of file PlacementInfo.h.

Referenced by getManhattanDistanceTo(), and right().

◆ row

const int PlacementInfo::PlacementBinInfo::row
private

Definition at line 840 of file PlacementInfo.h.

Referenced by Y().

◆ sharedCellType

std::string PlacementInfo::PlacementBinInfo::sharedCellType
private

Definition at line 824 of file PlacementInfo.h.

Referenced by getSharedCellType(), and getType().

◆ switchDemandForNets

float PlacementInfo::PlacementBinInfo::switchDemandForNets = 0.0
private

Definition at line 846 of file PlacementInfo.h.

Referenced by getSwitchDemandForNets(), increaseSWDemandBy(), and reset().

◆ switchSupplyForNets

float PlacementInfo::PlacementBinInfo::switchSupplyForNets = 0.0
private

Definition at line 847 of file PlacementInfo.h.

Referenced by reset().

◆ topY

const float PlacementInfo::PlacementBinInfo::topY
private

Definition at line 836 of file PlacementInfo.h.

Referenced by getManhattanDistanceTo(), and top().

◆ utilization

int PlacementInfo::PlacementBinInfo::utilization = 0
private

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