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

SubBox is the exact container which is the object for bi-partitioning-based cell spreading. More...

#include <GeneralSpreader.h>

Collaboration diagram for GeneralSpreader::SpreadRegion::SubBox:

Public Member Functions

 SubBox (PlacementInfo *placementInfo, SpreadRegion *curRegion, std::vector< std::vector< PlacementInfo::PlacementBinInfo * >> &binGrid, float capacityShrinkRatio=1.0, int level=100, bool dirIsH=true)
 Construct a new Sub Box object. More...
 
 SubBox (SubBox *parentBox, int topBinY, int bottomBinY, int leftBinX, int rightBinX, int cellRangeBegin, int cellRangeEnd)
 Construct a new Sub Box object. More...
 
 ~SubBox ()
 
void addCellId (int cellId)
 
void spreadAndPartition ()
 spread cells and partition the SubBox into smaller SubBoxes More...
 
int Partition (std::vector< int > &cellIds, int low, int high, bool Xsort)
 the partition/sort function for quick sorting by cell location (X or Y) More...
 
int RandomPivotPartition (std::vector< int > &cellIds, int low, int high, bool Xsort)
 the partition/sort function for quick sorting by cell location (X or Y) More...
 
void quick_sort (std::vector< int > &cellIds, int p, int q, bool Xsort)
 recursive implementation of quick sort for cell ids by X/Y location More...
 
int getLevel ()
 
void spreadCellsH (SubBox **boxA, SubBox **boxB)
 split horizontally the SubBox into smaller ones and assign cells to them More...
 
void spreadCellsV (SubBox **boxA, SubBox **boxB)
 split vertically the SubBox into smaller ones and assign cells to them More...
 
int top ()
 get the top bin coordinate Y of the SubBox in bin grid More...
 
int bottom ()
 get the bottom bin coordinate Y of the SubBox in bin grid More...
 
int left ()
 get the left bin coordinate X of the SubBox in bin grid More...
 
int right ()
 get the right bin coordinate X of the SubBox in bin grid More...
 

Public Attributes

PlacementInfoplacementInfo
 
std::vector< std::vector< PlacementInfo::PlacementBinInfo * > > & binGrid
 
float capacityShrinkRatio = 1.0
 
bool dirIsH
 
int minExpandSize = 2
 the minimum length of boundary More...
 

Private Attributes

int topBinY
 
int bottomBinY
 
int leftBinX
 
int rightBinX
 
std::vector< int > cellIds
 the cells in this SubBox More...
 
int level
 

Detailed Description

SubBox is the exact container which is the object for bi-partitioning-based cell spreading.

Each SubBox can be splited vertically or horizontally and cells can be assigned to the partitions accoringly if it is allowed.

Definition at line 821 of file GeneralSpreader.h.

Constructor & Destructor Documentation

◆ SubBox() [1/2]

GeneralSpreader::SpreadRegion::SubBox::SubBox ( PlacementInfo placementInfo,
SpreadRegion curRegion,
std::vector< std::vector< PlacementInfo::PlacementBinInfo * >> &  binGrid,
float  capacityShrinkRatio = 1.0,
int  level = 100,
bool  dirIsH = true 
)
inline

Construct a new Sub Box object.

Parameters
placementInfoPlacementInfo so this object can access the corresponding placement database
curRegionthe parent SpreadRegion of this SubBox which guides the boundary setting of the subox
binGridthe bin grid which record the cell density distribution
capacityShrinkRatioshrink the area supply to a specific ratio
levelcurrent recursion level
dirIsHsplit vertically or horizontally (it is a priority setting instead of enforcement)

Definition at line 834 of file GeneralSpreader.h.

Here is the call graph for this function:

◆ SubBox() [2/2]

GeneralSpreader::SpreadRegion::SubBox::SubBox ( SubBox parentBox,
int  topBinY,
int  bottomBinY,
int  leftBinX,
int  rightBinX,
int  cellRangeBegin,
int  cellRangeEnd 
)
inline

Construct a new Sub Box object.

Parameters
parentBoxinheret information from a parent SubBox
topBinYthe top bin index
bottomBinYthe bottom bin index
leftBinXthe left bin index
rightBinXthe right bin index
cellRangeBeginthe range begin for copying the cell ids to this child SubBox
cellRangeEndthe range end for copying the cell ids to this child SubBox

Definition at line 869 of file GeneralSpreader.h.

◆ ~SubBox()

GeneralSpreader::SpreadRegion::SubBox::~SubBox ( )
inline

Definition at line 882 of file GeneralSpreader.h.

Member Function Documentation

◆ addCellId()

void GeneralSpreader::SpreadRegion::SubBox::addCellId ( int  cellId)
inline

Definition at line 890 of file GeneralSpreader.h.

◆ bottom()

int GeneralSpreader::SpreadRegion::SubBox::bottom ( )
inline

get the bottom bin coordinate Y of the SubBox in bin grid

Returns
int

Definition at line 1028 of file GeneralSpreader.h.

Referenced by operator<<().

Here is the caller graph for this function:

◆ getLevel()

int GeneralSpreader::SpreadRegion::SubBox::getLevel ( )
inline

Definition at line 992 of file GeneralSpreader.h.

◆ left()

int GeneralSpreader::SpreadRegion::SubBox::left ( )
inline

get the left bin coordinate X of the SubBox in bin grid

Returns
int

Definition at line 1038 of file GeneralSpreader.h.

Referenced by operator<<().

Here is the caller graph for this function:

◆ Partition()

int GeneralSpreader::SpreadRegion::SubBox::Partition ( std::vector< int > &  cellIds,
int  low,
int  high,
bool  Xsort 
)
inline

the partition/sort function for quick sorting by cell location (X or Y)

Parameters
cellIdsthe cell ids for location sorting
lowlower bound of sorting range
highupper bound of sorting range
Xsortsort by X loction or Y location
Returns
int

Definition at line 910 of file GeneralSpreader.h.

Referenced by RandomPivotPartition().

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

◆ quick_sort()

void GeneralSpreader::SpreadRegion::SubBox::quick_sort ( std::vector< int > &  cellIds,
int  p,
int  q,
bool  Xsort 
)
inline

recursive implementation of quick sort for cell ids by X/Y location

Parameters
cellIdsthe cell ids for location sorting
plower bound of sorting range
qupper bound of sorting range
Xsortsort by X loction or Y location

Definition at line 979 of file GeneralSpreader.h.

Here is the call graph for this function:

◆ RandomPivotPartition()

int GeneralSpreader::SpreadRegion::SubBox::RandomPivotPartition ( std::vector< int > &  cellIds,
int  low,
int  high,
bool  Xsort 
)
inline

the partition/sort function for quick sorting by cell location (X or Y)

Parameters
cellIdsthe cell ids for location sorting
lowlower bound of sorting range
highupper bound of sorting range
Xsortsort by X loction or Y location
Returns
int

Definition at line 961 of file GeneralSpreader.h.

Referenced by quick_sort().

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

◆ right()

int GeneralSpreader::SpreadRegion::SubBox::right ( )
inline

get the right bin coordinate X of the SubBox in bin grid

Returns
int

Definition at line 1048 of file GeneralSpreader.h.

Referenced by operator<<().

Here is the caller graph for this function:

◆ spreadAndPartition()

void GeneralSpreader::SpreadRegion::SubBox::spreadAndPartition ( )

spread cells and partition the SubBox into smaller SubBoxes

Definition at line 706 of file GeneralSpreader.cc.

Referenced by spreadAndPartition(), and GeneralSpreader::spreadPlacementUnits().

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

◆ spreadCellsH()

void GeneralSpreader::SpreadRegion::SubBox::spreadCellsH ( SubBox **  boxA,
SubBox **  boxB 
)

split horizontally the SubBox into smaller ones and assign cells to them

Parameters
boxAthe obtained pointer of new smaller SubBox
boxBanother obtained pointer of new smaller SubBox

Definition at line 752 of file GeneralSpreader.cc.

Here is the call graph for this function:

◆ spreadCellsV()

void GeneralSpreader::SpreadRegion::SubBox::spreadCellsV ( SubBox **  boxA,
SubBox **  boxB 
)

split vertically the SubBox into smaller ones and assign cells to them

Parameters
boxAthe obtained pointer of new smaller SubBox
boxBanother obtained pointer of new smaller SubBox

Definition at line 986 of file GeneralSpreader.cc.

Here is the call graph for this function:

◆ top()

int GeneralSpreader::SpreadRegion::SubBox::top ( )
inline

get the top bin coordinate Y of the SubBox in bin grid

Returns
int

Definition at line 1018 of file GeneralSpreader.h.

Referenced by operator<<().

Here is the caller graph for this function:

Member Data Documentation

◆ binGrid

std::vector<std::vector<PlacementInfo::PlacementBinInfo *> >& GeneralSpreader::SpreadRegion::SubBox::binGrid

Definition at line 887 of file GeneralSpreader.h.

◆ bottomBinY

int GeneralSpreader::SpreadRegion::SubBox::bottomBinY
private

Definition at line 1054 of file GeneralSpreader.h.

Referenced by bottom().

◆ capacityShrinkRatio

float GeneralSpreader::SpreadRegion::SubBox::capacityShrinkRatio = 1.0

Definition at line 888 of file GeneralSpreader.h.

◆ cellIds

std::vector<int> GeneralSpreader::SpreadRegion::SubBox::cellIds
private

the cells in this SubBox

Definition at line 1060 of file GeneralSpreader.h.

Referenced by addCellId(), Partition(), quick_sort(), RandomPivotPartition(), spreadCellsH(), spreadCellsV(), and SubBox().

◆ dirIsH

bool GeneralSpreader::SpreadRegion::SubBox::dirIsH

Definition at line 1064 of file GeneralSpreader.h.

◆ leftBinX

int GeneralSpreader::SpreadRegion::SubBox::leftBinX
private

Definition at line 1054 of file GeneralSpreader.h.

Referenced by left().

◆ level

int GeneralSpreader::SpreadRegion::SubBox::level
private

Definition at line 1061 of file GeneralSpreader.h.

Referenced by getLevel().

◆ minExpandSize

int GeneralSpreader::SpreadRegion::SubBox::minExpandSize = 2

the minimum length of boundary

Definition at line 1070 of file GeneralSpreader.h.

◆ placementInfo

PlacementInfo* GeneralSpreader::SpreadRegion::SubBox::placementInfo

Definition at line 886 of file GeneralSpreader.h.

Referenced by Partition().

◆ rightBinX

int GeneralSpreader::SpreadRegion::SubBox::rightBinX
private

Definition at line 1054 of file GeneralSpreader.h.

Referenced by right().

◆ topBinY

int GeneralSpreader::SpreadRegion::SubBox::topBinY
private

Definition at line 1054 of file GeneralSpreader.h.

Referenced by top().


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