AMF-Placer
2.0
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
|
SpreadRegion is an object that record cell spreading region information, including boundaries, cells, bins, and spreading boxes. More...
#include <GeneralSpreader.h>
Classes | |
struct | expandOp |
a struct to describe the expanding operation for the SpreadRegion More... | |
class | SubBox |
SubBox is the exact container which is the object for bi-partitioning-based cell spreading. More... | |
Public Types | |
enum | dirType { expandLeft, expandRight, expandUp, expandDown } |
four direction options to expand the SpreadRegion More... | |
Public Member Functions | |
SpreadRegion (PlacementInfo::PlacementBinInfo *curBin, PlacementInfo *placementInfo, std::vector< std::vector< PlacementInfo::PlacementBinInfo * >> &binGrid, float capacityShrinkRatio) | |
Construct a new Spread Region object. More... | |
~SpreadRegion () | |
bool | isRegionOverlap (int tmpRegionTopBinY, int tmpRegionBottomBinY, int tmpRegionLeftBinX, int tmpRegionRightBinX) |
check whether the SpreadRegion is overlapped with a given boundary More... | |
bool | isRegionOverlap (SpreadRegion *anotherRegion) |
check whether overlapped with another SpreadRegion More... | |
void | addBinRegion (int newRegionTopBinY, int newRegionBottomBinY, int newRegionLeftBinX, int newRegionRightBinX, std::set< PlacementInfo::PlacementBinInfo * > &coveredBinSet) |
add cell bins into SpreadRegion with a new boundary and update region information including boundary and the sets of cells and bins More... | |
std::vector< PlacementInfo::PlacementBinInfo * > & | getBinsInRegion () |
Get the bins in the SpreadRegion. More... | |
bool | isOverflow () |
check whether the resource in this region is less than the requirement More... | |
bool | isCovered (int newTopBinY, int newBottomBinY, int newLeftBinX, int newRightBinX, dirType tmpDir, std::set< PlacementInfo::PlacementBinInfo * > &coveredBinSet) |
check whether an expansion in a given direction will make the SpreadRegion overlapped with some bins in another SpreadRegion More... | |
void | getDirCapacityAndUtilization (int newTopBinY, int newBottomBinY, int newLeftBinX, int newRightBinX, dirType tmpDir, float &tmpUtilization, float &tmpCapacity) |
evaluation the utilization and capacity of the incoming bins which will be included in the SpreadRegion after an expansion . More... | |
bool | smartFindExpandDirection (std::set< PlacementInfo::PlacementBinInfo * > &coveredBinSet) |
find the legal expansion direction More... | |
bool | expandable (int tmpDir) |
void | smartExpand (std::set< PlacementInfo::PlacementBinInfo * > &coveredBinSet) |
select the expansion direction greedily More... | |
bool | simpleFindExpandDirection (std::set< PlacementInfo::PlacementBinInfo * > &coveredBinSet) |
find the expansion direction iteratively in pre-defined order More... | |
void | simpleExpand (std::set< PlacementInfo::PlacementBinInfo * > &coveredBinSet) |
select the the expansion direction which is found in a pre-defined order More... | |
bool | contains (PlacementInfo::PlacementBinInfo *curBin) |
check whether SpreadRegion contains the given bin More... | |
std::vector< DesignInfo::DesignCell * > & | getCells () |
Get the cells in the SpreadRegion. More... | |
int | top () |
get the top bin coordinate Y of the SpreadRegion in bin grid More... | |
int | bottom () |
get the bottom bin coordinate Y of the SpreadRegion in bin grid More... | |
int | left () |
get the left bin coordinate X of the SpreadRegion in bin grid More... | |
int | right () |
get the right bin coordinate X of the SpreadRegion in bin grid More... | |
float | getOverflowRatio () |
Get the resource overflow ratio. More... | |
Public Attributes | |
expandOp | expandOps [4] = {{0, 0, -1, 0}, {0, 0, 0, 1}, {1, 0, 0, 0}, {0, -1, 0, 0}} |
expandOp | actualExpandOps [4] |
Static Public Attributes | |
static constexpr float | eps = 1e-4 |
Private Attributes | |
PlacementInfo * | placementInfo |
float | totalCapacity |
float | totalUtilization |
float | overflowRatio |
int | topBinY |
int | bottomBinY |
int | leftBinX |
int | rightBinX |
int | curDirectionIndex = 0 |
record the last selection of expansion direction for later expansion More... | |
dirType | curDirection = expandLeft |
make the direction into enum type for clearer identification More... | |
std::vector< std::vector< PlacementInfo::PlacementBinInfo * > > & | binGrid |
a reference of the global bin grid for data accessing and updating of cell density More... | |
float | dir2utilization [4] |
the utilization of the four directions (absolute value) More... | |
float | dir2capacity [4] |
the capacity of the four directions (absolute value) More... | |
bool | legalDir [4] |
a boolean array to record legal directions to expand the SpreadRegion More... | |
float | capacityShrinkRatio = 1.0 |
std::set< DesignInfo::DesignCell * > | cellsInRegion |
a set of cells in the SpreadRegion More... | |
std::vector< DesignInfo::DesignCell * > | cellsInRegionVec |
a vector of cells in the SpreadRegion More... | |
std::vector< PlacementInfo::PlacementBinInfo * > | binsInRegion |
a vector of bins in the SpreadRegion More... | |
std::set< PlacementInfo::PlacementBinInfo * > | binSetInRegion |
a set of bins in the SpreadRegion More... | |
SpreadRegion is an object that record cell spreading region information, including boundaries, cells, bins, and spreading boxes.
Definition at line 85 of file GeneralSpreader.h.
four direction options to expand the SpreadRegion
Enumerator | |
---|---|
expandLeft | |
expandRight | |
expandUp | |
expandDown |
Definition at line 196 of file GeneralSpreader.h.
|
inline |
Construct a new Spread Region object.
curBin | the initial bin for the SpreadRegion object, which should be overflowed. |
placementInfo | PlacementInfo so this object can access the corresponding placement database |
binGrid | the reference of the binGrid for cell spreading. A bin grid is used to record the density of cells on the device |
capacityShrinkRatio | shrink the area supply to a specific ratio |
Definition at line 97 of file GeneralSpreader.h.
|
inline |
Definition at line 118 of file GeneralSpreader.h.
void GeneralSpreader::SpreadRegion::addBinRegion | ( | int | newRegionTopBinY, |
int | newRegionBottomBinY, | ||
int | newRegionLeftBinX, | ||
int | newRegionRightBinX, | ||
std::set< PlacementInfo::PlacementBinInfo * > & | coveredBinSet | ||
) |
add cell bins into SpreadRegion with a new boundary and update region information including boundary and the sets of cells and bins
newRegionTopBinY | |
newRegionBottomBinY | |
newRegionLeftBinX | |
newRegionRightBinX | |
coveredBinSet |
Definition at line 656 of file GeneralSpreader.cc.
Referenced by simpleExpand(), and smartExpand().
|
inline |
get the bottom bin coordinate Y of the SpreadRegion in bin grid
Definition at line 779 of file GeneralSpreader.h.
Referenced by isRegionOverlap(), and GeneralSpreader::spreadPlacementUnits().
|
inline |
check whether SpreadRegion contains the given bin
curBin | a given bin |
Definition at line 747 of file GeneralSpreader.h.
|
inline |
Definition at line 478 of file GeneralSpreader.h.
Referenced by smartExpand().
|
inline |
Get the bins in the SpreadRegion.
Definition at line 176 of file GeneralSpreader.h.
Referenced by GeneralSpreader::expandFromABin(), and GeneralSpreader::spreadPlacementUnits().
|
inline |
Get the cells in the SpreadRegion.
please be aware that a SpreadRegion will only contain cells in a specific type defined by its constructor.
Definition at line 759 of file GeneralSpreader.h.
Referenced by addBinRegion(), GeneralSpreader::DumpCellsCoordinate(), GeneralSpreader::spreadPlacementUnits(), and GeneralSpreader::SpreadRegion::SubBox::SubBox().
|
inline |
evaluation the utilization and capacity of the incoming bins which will be included in the SpreadRegion after an expansion .
newTopBinY | the top boundary after expansion |
newBottomBinY | the bottom boundary after expansion |
newLeftBinX | the left boundary after expansion |
newRightBinX | the right boundary after expansion |
tmpDir | a given direction |
tmpUtilization | the resultant utilization |
tmpCapacity | the resultant capacity |
Definition at line 319 of file GeneralSpreader.h.
Referenced by smartFindExpandDirection().
|
inline |
Get the resource overflow ratio.
Definition at line 809 of file GeneralSpreader.h.
Referenced by GeneralSpreader::expandFromABin().
|
inline |
check whether an expansion in a given direction will make the SpreadRegion overlapped with some bins in another SpreadRegion
newTopBinY | the top boundary after expansion |
newBottomBinY | the bottom boundary after expansion |
newLeftBinX | the left boundary after expansion |
newRightBinX | the right boundary after expansion |
tmpDir | a given direction |
coveredBinSet | a set of bins which have been included in other SpreadRegion |
Definition at line 269 of file GeneralSpreader.h.
Referenced by simpleFindExpandDirection(), and smartFindExpandDirection().
|
inline |
check whether the resource in this region is less than the requirement
Definition at line 187 of file GeneralSpreader.h.
|
inline |
check whether the SpreadRegion is overlapped with a given boundary
tmpRegionTopBinY | |
tmpRegionBottomBinY | |
tmpRegionLeftBinX | |
tmpRegionRightBinX |
Definition at line 132 of file GeneralSpreader.h.
Referenced by addBinRegion().
|
inline |
check whether overlapped with another SpreadRegion
anotherRegion | another SpreadRegion object |
Definition at line 149 of file GeneralSpreader.h.
|
inline |
get the left bin coordinate X of the SpreadRegion in bin grid
Definition at line 789 of file GeneralSpreader.h.
Referenced by isRegionOverlap(), and GeneralSpreader::spreadPlacementUnits().
|
inline |
get the right bin coordinate X of the SpreadRegion in bin grid
Definition at line 799 of file GeneralSpreader.h.
Referenced by isRegionOverlap(), and GeneralSpreader::spreadPlacementUnits().
|
inline |
select the the expansion direction which is found in a pre-defined order
coveredBinSet | a set of bins which have been included in other SpreadRegion |
Definition at line 724 of file GeneralSpreader.h.
Referenced by GeneralSpreader::expandFromABin().
|
inline |
find the expansion direction iteratively in pre-defined order
coveredBinSet | a set of bins which have been included in other SpreadRegion |
Definition at line 689 of file GeneralSpreader.h.
Referenced by GeneralSpreader::expandFromABin().
|
inline |
select the expansion direction greedily
evaluate the 4 potential directions and select the direction, which can significantly reduce the overflow, to conduct expansion
coveredBinSet | a set of bins which have been included in other SpreadRegion |
Definition at line 491 of file GeneralSpreader.h.
Referenced by GeneralSpreader::expandFromABin().
|
inline |
find the legal expansion direction
evaluate the utilization/capacity of 4 legal directions
coveredBinSet | a set of bins which have been included in other SpreadRegion |
Definition at line 375 of file GeneralSpreader.h.
Referenced by GeneralSpreader::expandFromABin().
|
inline |
get the top bin coordinate Y of the SpreadRegion in bin grid
Definition at line 769 of file GeneralSpreader.h.
Referenced by isRegionOverlap(), and GeneralSpreader::spreadPlacementUnits().
expandOp GeneralSpreader::SpreadRegion::actualExpandOps[4] |
Definition at line 254 of file GeneralSpreader.h.
Referenced by smartExpand(), and smartFindExpandDirection().
|
private |
a reference of the global bin grid for data accessing and updating of cell density
Definition at line 1099 of file GeneralSpreader.h.
Referenced by addBinRegion(), getDirCapacityAndUtilization(), isCovered(), simpleFindExpandDirection(), and smartFindExpandDirection().
|
private |
a set of bins in the SpreadRegion
Definition at line 1146 of file GeneralSpreader.h.
Referenced by addBinRegion(), contains(), and SpreadRegion().
|
private |
a vector of bins in the SpreadRegion
vector can ensure the iteration order to get rid of random factors in multi-threading
Definition at line 1140 of file GeneralSpreader.h.
Referenced by addBinRegion(), getBinsInRegion(), and SpreadRegion().
|
private |
Definition at line 1080 of file GeneralSpreader.h.
Referenced by addBinRegion(), bottom(), isRegionOverlap(), simpleExpand(), simpleFindExpandDirection(), smartExpand(), smartFindExpandDirection(), and SpreadRegion().
|
private |
Definition at line 1120 of file GeneralSpreader.h.
Referenced by smartExpand().
|
private |
a set of cells in the SpreadRegion
Definition at line 1126 of file GeneralSpreader.h.
Referenced by addBinRegion(), and SpreadRegion().
|
private |
a vector of cells in the SpreadRegion
vector can ensure the iteration order to get rid of random factors in multi-threading
Definition at line 1133 of file GeneralSpreader.h.
Referenced by addBinRegion(), getCells(), and SpreadRegion().
|
private |
make the direction into enum type for clearer identification
Definition at line 1093 of file GeneralSpreader.h.
Referenced by simpleExpand(), and simpleFindExpandDirection().
|
private |
record the last selection of expansion direction for later expansion
Definition at line 1087 of file GeneralSpreader.h.
Referenced by simpleFindExpandDirection().
|
private |
the capacity of the four directions (absolute value)
Definition at line 1111 of file GeneralSpreader.h.
Referenced by smartExpand(), and smartFindExpandDirection().
|
private |
the utilization of the four directions (absolute value)
Definition at line 1105 of file GeneralSpreader.h.
Referenced by smartExpand(), and smartFindExpandDirection().
|
staticconstexpr |
Definition at line 1073 of file GeneralSpreader.h.
expandOp GeneralSpreader::SpreadRegion::expandOps[4] = {{0, 0, -1, 0}, {0, 0, 0, 1}, {1, 0, 0, 0}, {0, -1, 0, 0}} |
Definition at line 253 of file GeneralSpreader.h.
Referenced by simpleExpand(), simpleFindExpandDirection(), and smartFindExpandDirection().
|
private |
Definition at line 1081 of file GeneralSpreader.h.
Referenced by addBinRegion(), isRegionOverlap(), left(), simpleExpand(), simpleFindExpandDirection(), smartExpand(), smartFindExpandDirection(), and SpreadRegion().
|
private |
a boolean array to record legal directions to expand the SpreadRegion
legal direction means that
Definition at line 1119 of file GeneralSpreader.h.
Referenced by expandable(), and smartFindExpandDirection().
|
private |
Definition at line 1079 of file GeneralSpreader.h.
Referenced by addBinRegion(), getOverflowRatio(), isOverflow(), and SpreadRegion().
|
private |
Definition at line 1076 of file GeneralSpreader.h.
|
private |
Definition at line 1081 of file GeneralSpreader.h.
Referenced by addBinRegion(), isRegionOverlap(), right(), simpleExpand(), simpleFindExpandDirection(), smartExpand(), smartFindExpandDirection(), and SpreadRegion().
|
private |
Definition at line 1080 of file GeneralSpreader.h.
Referenced by addBinRegion(), isRegionOverlap(), simpleExpand(), simpleFindExpandDirection(), smartExpand(), smartFindExpandDirection(), SpreadRegion(), and top().
|
private |
Definition at line 1077 of file GeneralSpreader.h.
Referenced by addBinRegion(), smartExpand(), and SpreadRegion().
|
private |
Definition at line 1078 of file GeneralSpreader.h.
Referenced by addBinRegion(), smartExpand(), and SpreadRegion().