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

Placement net, compared to design net, includes information related to placement. More...

#include <PlacementInfo.h>

Collaboration diagram for PlacementInfo::PlacementNet:

Classes

struct  _pinOffset
 

Public Types

typedef struct PlacementInfo::PlacementNet::_pinOffset pinOffset
 

Public Member Functions

 PlacementNet (DesignInfo::DesignNet *designNet, int id, std::vector< PlacementUnit * > &cellId2PlacementUnitVec, PlacementInfo *placementInfo)
 Construct a new Placement Net object. More...
 
 ~PlacementNet ()
 
std::vector< PlacementUnit * > & getUnits ()
 Get the reference of the vector of PlacementUnits connected to the net The placement units in the vector might be duplicated because a net might connect to multiple pins of a unit. More...
 
std::vector< PlacementUnit * > & getDriverUnits ()
 Get the reference of the vector of the driver units that drive the net. More...
 
std::vector< PlacementUnit * > & getUnitsBeDriven ()
 Get the reference of the vector of the PlacementUnits driven by the net. More...
 
DesignInfo::DesignNetgetDesignNet ()
 Get the Design Net object. More...
 
int getId ()
 Get the Id of the net in current placement procedure. More...
 
std::vector< pinOffset > & getPinOffsetsInUnit ()
 Get the Pin Offsets (x,y) of the Units object. More...
 
bool updateNetBounds (bool updateX, bool updateY)
 update the bounding box of the net More...
 
float getHPWL (float y2xRatio)
 get current HPWL of the net More...
 
float getNewHPWLByTrying (PlacementUnit *curPU, double targetPUX, double targetPUY, float y2xRatio) const
 Get the New HPWL By Trying to move a PlacementUnit object. More...
 
void updateBound2BoundNetWeight (std::vector< Eigen::Triplet< float >> &objectiveMatrixTripletList, std::vector< float > &objectiveMatrixDiag, Eigen::VectorXd &objectiveVector, float generalWeight, float y2xRatio, bool updateX, bool updateY, bool checkClockRegion=false)
 update the weights of 2-pin nets between PlacementUnits in this hyperedge(PlacementNet) according to Bound2Bound net model More...
 
void addPseudoNet_enhancePin2Pin (std::vector< Eigen::Triplet< float >> &objectiveMatrixTripletList, std::vector< float > &objectiveMatrixDiag, Eigen::VectorXd &objectiveVector, float generalWeight, float y2xRatio, bool updateX, bool updateY, int PUIdA, int PUIdB, int pinIdA_net, int pinIdB_net)
 
void drawNet (float generalWeight=1.0)
 
void addB2BNet (std::vector< Eigen::Triplet< float >> &objectiveMatrixTripletList, std::vector< float > &objectiveMatrixDiag, Eigen::VectorXd &objectiveVector, int puId0, int puId1, float pos0, float pos1, float pinOffset0, float pinOffset1, bool movable0, bool movable1, float w)
 set weights of the terms in the quadratic problem More...
 
std::set< PlacementUnit * > & getPUSet ()
 
float getLeftPinX ()
 
float getRightPinX ()
 
float getTopPinY ()
 
float getBottomPinY ()
 
int getLeftPUId ()
 
int getRightPUId ()
 
int getTopPUId ()
 
int getBottomPUId ()
 
bool isGlobalClock ()
 

Private Attributes

DesignInfo::DesignNetdesignNet = nullptr
 
std::vector< PlacementUnit * > unitsOfNetPins
 
std::vector< PlacementUnit * > unitsOfDriverPins
 
std::vector< PlacementUnit * > unitsOfPinsBeDriven
 
std::vector< pinOffsetpinOffsetsInUnit
 
std::set< PlacementUnit * > PUSet
 
int id
 
PlacementInfoplacementInfo = nullptr
 
float leftPUX
 
float rightPUX
 
float topPUY
 
float bottomPUY
 
float leftPinX
 
float rightPinX
 
float topPinY
 
float bottomPinY
 
unsigned int leftPuId
 
unsigned int rightPuId
 
unsigned int topPuId
 
unsigned int bottomPuId
 
unsigned int leftPinId_net
 
unsigned int rightPinId_net
 
unsigned int topPinId_net
 
unsigned int bottomPinId_net
 
float eps = 1e-5
 
float minDist = 1
 

Detailed Description

Placement net, compared to design net, includes information related to placement.

Placement net, compared to design net, includes information related to placement: HPWL bounding box, interconnection between placement units (unpacked/macro), APIs to check wirelength.

Please note that PlacementNet is HyperEdge, connecting to multiple pins.

Definition at line 1876 of file PlacementInfo.h.

Member Typedef Documentation

◆ pinOffset

Constructor & Destructor Documentation

◆ PlacementNet()

PlacementInfo::PlacementNet::PlacementNet ( DesignInfo::DesignNet designNet,
int  id,
std::vector< PlacementUnit * > &  cellId2PlacementUnitVec,
PlacementInfo placementInfo 
)
inline

Construct a new Placement Net object.

Parameters
designNeteach PlacementNet is binded to design net.
id
cellId2PlacementUnitVec

Definition at line 1886 of file PlacementInfo.h.

Here is the call graph for this function:

◆ ~PlacementNet()

PlacementInfo::PlacementNet::~PlacementNet ( )
inline

Definition at line 1926 of file PlacementInfo.h.

Member Function Documentation

◆ addB2BNet()

void PlacementInfo::PlacementNet::addB2BNet ( std::vector< Eigen::Triplet< float >> &  objectiveMatrixTripletList,
std::vector< float > &  objectiveMatrixDiag,
Eigen::VectorXd &  objectiveVector,
int  puId0,
int  puId1,
float  pos0,
float  pos1,
float  pinOffset0,
float  pinOffset1,
bool  movable0,
bool  movable1,
float  w 
)
inline

set weights of the terms in the quadratic problem

min_x 0.5 * x'Px + q'x s.t. l <= Ax <= u

Parameters
objectiveMatrixTripletListThe non-Diag elements in matrix Q, stored in the vector of Eigen Triplet (i,j,val)
objectiveMatrixDiagThe Diag elements in matrix Q, stored in a 1-D vector
objectiveVectorThe elements in the vector P
puId0PlacementUnit 0's Id (might be invaid -1)
puId1PlacementUnit 1's Id (might be invaid -1)
pos0PlacementUnit 0's position on one of the dimensions
pos1PlacementUnit 1's position on one of the dimensions
pinOffset0The pin's offset in PlacementUnit 0
pinOffset1The pin's offset in PlacementUnit 1
movable0whether the object 0 is movable
movable1whether the object 0 is movable
wthe weight of the net

Definition at line 2353 of file PlacementInfo.h.

Referenced by addPseudoNet_enhancePin2Pin(), and updateBound2BoundNetWeight().

Here is the caller graph for this function:

◆ addPseudoNet_enhancePin2Pin()

void PlacementInfo::PlacementNet::addPseudoNet_enhancePin2Pin ( std::vector< Eigen::Triplet< float >> &  objectiveMatrixTripletList,
std::vector< float > &  objectiveMatrixDiag,
Eigen::VectorXd &  objectiveVector,
float  generalWeight,
float  y2xRatio,
bool  updateX,
bool  updateY,
int  PUIdA,
int  PUIdB,
int  pinIdA_net,
int  pinIdB_net 
)
inline

Definition at line 2303 of file PlacementInfo.h.

Here is the call graph for this function:

◆ drawNet()

void PlacementInfo::PlacementNet::drawNet ( float  generalWeight = 1.0)

Definition at line 760 of file PlacementInfo.cc.

◆ getBottomPinY()

float PlacementInfo::PlacementNet::getBottomPinY ( )
inline

Definition at line 2427 of file PlacementInfo.h.

Referenced by updateBound2BoundNetWeight().

Here is the caller graph for this function:

◆ getBottomPUId()

int PlacementInfo::PlacementNet::getBottomPUId ( )
inline

Definition at line 2451 of file PlacementInfo.h.

◆ getDesignNet()

DesignInfo::DesignNet* PlacementInfo::PlacementNet::getDesignNet ( )
inline

Get the Design Net object.

Returns
DesignInfo::DesignNet*

Definition at line 1973 of file PlacementInfo.h.

◆ getDriverUnits()

std::vector<PlacementUnit *>& PlacementInfo::PlacementNet::getDriverUnits ( )
inline

Get the reference of the vector of the driver units that drive the net.

Returns
std::vector<PlacementUnit *>&

Definition at line 1953 of file PlacementInfo.h.

◆ getHPWL()

float PlacementInfo::PlacementNet::getHPWL ( float  y2xRatio)
inline

get current HPWL of the net

Parameters
y2xRatioa factor to tune the weights of the net spanning in Y-coordinate relative to the net spanning in X-coordinate
Returns
float

Definition at line 2076 of file PlacementInfo.h.

◆ getId()

int PlacementInfo::PlacementNet::getId ( )
inline

Get the Id of the net in current placement procedure.

Returns
int

Definition at line 1983 of file PlacementInfo.h.

Referenced by Packing_Netcompare::operator()().

Here is the caller graph for this function:

◆ getLeftPinX()

float PlacementInfo::PlacementNet::getLeftPinX ( )
inline

Definition at line 2409 of file PlacementInfo.h.

Referenced by updateBound2BoundNetWeight().

Here is the caller graph for this function:

◆ getLeftPUId()

int PlacementInfo::PlacementNet::getLeftPUId ( )
inline

Definition at line 2433 of file PlacementInfo.h.

◆ getNewHPWLByTrying()

float PlacementInfo::PlacementNet::getNewHPWLByTrying ( PlacementUnit curPU,
double  targetPUX,
double  targetPUY,
float  y2xRatio 
) const
inline

Get the New HPWL By Trying to move a PlacementUnit object.

For some procedures like legalization and packing, evaluate the wirelength change if the location of a PlacementUnit is changed.

Parameters
curPUthe PlacementUnit to be moved
targetPUX
targetPUY
y2xRatio
Returns
float

Definition at line 2093 of file PlacementInfo.h.

Here is the call graph for this function:

◆ getPinOffsetsInUnit()

std::vector<pinOffset>& PlacementInfo::PlacementNet::getPinOffsetsInUnit ( )
inline

Get the Pin Offsets (x,y) of the Units object.

Returns
std::vector<pinOffset>&

Definition at line 1993 of file PlacementInfo.h.

◆ getPUSet()

std::set<PlacementUnit *>& PlacementInfo::PlacementNet::getPUSet ( )
inline

Definition at line 2404 of file PlacementInfo.h.

◆ getRightPinX()

float PlacementInfo::PlacementNet::getRightPinX ( )
inline

Definition at line 2415 of file PlacementInfo.h.

Referenced by updateBound2BoundNetWeight().

Here is the caller graph for this function:

◆ getRightPUId()

int PlacementInfo::PlacementNet::getRightPUId ( )
inline

Definition at line 2439 of file PlacementInfo.h.

◆ getTopPinY()

float PlacementInfo::PlacementNet::getTopPinY ( )
inline

Definition at line 2421 of file PlacementInfo.h.

Referenced by updateBound2BoundNetWeight().

Here is the caller graph for this function:

◆ getTopPUId()

int PlacementInfo::PlacementNet::getTopPUId ( )
inline

Definition at line 2445 of file PlacementInfo.h.

◆ getUnits()

std::vector<PlacementUnit *>& PlacementInfo::PlacementNet::getUnits ( )
inline

Get the reference of the vector of PlacementUnits connected to the net The placement units in the vector might be duplicated because a net might connect to multiple pins of a unit.

Returns
std::vector<PlacementUnit *>&

Definition at line 1943 of file PlacementInfo.h.

Referenced by ParallelCLBPacker::PackingCLBSite::PackingCLBCluster::getInternalPinsNum(), and PlacementInfo::reloadNets().

Here is the caller graph for this function:

◆ getUnitsBeDriven()

std::vector<PlacementUnit *>& PlacementInfo::PlacementNet::getUnitsBeDriven ( )
inline

Get the reference of the vector of the PlacementUnits driven by the net.

Returns
std::vector<PlacementUnit *>&

Definition at line 1963 of file PlacementInfo.h.

Referenced by ParallelCLBPacker::PackingCLBSite::PackingCLBCluster::getInternalPinsNum().

Here is the caller graph for this function:

◆ isGlobalClock()

bool PlacementInfo::PlacementNet::isGlobalClock ( )
inline

Definition at line 2457 of file PlacementInfo.h.

Referenced by PlacementInfo::reloadNets().

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

◆ updateBound2BoundNetWeight()

void PlacementInfo::PlacementNet::updateBound2BoundNetWeight ( std::vector< Eigen::Triplet< float >> &  objectiveMatrixTripletList,
std::vector< float > &  objectiveMatrixDiag,
Eigen::VectorXd &  objectiveVector,
float  generalWeight,
float  y2xRatio,
bool  updateX,
bool  updateY,
bool  checkClockRegion = false 
)
inline

update the weights of 2-pin nets between PlacementUnits in this hyperedge(PlacementNet) according to Bound2Bound net model

In the quadratic placement, the wirelength(HPWL) can be modeled into a quadratic equation based on Bound2Bound net model. The equation can be represented by matrix operation (XQX^T+PX)

Parameters
objectiveMatrixTripletListThe non-Diag elements in matrix Q, stored in the vector of Eigen Triplet (i,j,val)
objectiveMatrixDiagThe Diag elements in matrix Q, stored in a 1-D vector
objectiveVectorThe elements in the vector P
generalWeighta weight given from external setting
pseudoWeightpseudo net weight to constrain the movement of PlacementUnits from their locations in last optimization iteration
y2xRatioa factor to tune the weights of the net spanning in Y-coordinate relative to the net spanning in X-coordinate
updateXupdate the X-coordinate term in the quadratic problem
updateYupdate the X-coordinate term in the quadratic problem

Definition at line 2184 of file PlacementInfo.h.

Here is the call graph for this function:

◆ updateNetBounds()

bool PlacementInfo::PlacementNet::updateNetBounds ( bool  updateX,
bool  updateY 
)
inline

update the bounding box of the net

Parameters
updateXif true, update the bounding box of the net in X coordinate
updateYif true, update the bounding box of the net in Y coordinate
Returns
true if the pins of the net is not at the same location
false if all pins of the net is at the same location

Definition at line 2006 of file PlacementInfo.h.

Member Data Documentation

◆ bottomPinId_net

unsigned int PlacementInfo::PlacementNet::bottomPinId_net
private

Definition at line 2476 of file PlacementInfo.h.

Referenced by updateBound2BoundNetWeight(), and updateNetBounds().

◆ bottomPinY

float PlacementInfo::PlacementNet::bottomPinY
private

◆ bottomPuId

unsigned int PlacementInfo::PlacementNet::bottomPuId
private

◆ bottomPUY

float PlacementInfo::PlacementNet::bottomPUY
private

Definition at line 2473 of file PlacementInfo.h.

Referenced by updateBound2BoundNetWeight(), and updateNetBounds().

◆ designNet

DesignInfo::DesignNet* PlacementInfo::PlacementNet::designNet = nullptr
private

◆ eps

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

Definition at line 2477 of file PlacementInfo.h.

Referenced by addB2BNet().

◆ id

int PlacementInfo::PlacementNet::id
private

Definition at line 2471 of file PlacementInfo.h.

Referenced by getId().

◆ leftPinId_net

unsigned int PlacementInfo::PlacementNet::leftPinId_net
private

Definition at line 2476 of file PlacementInfo.h.

Referenced by updateBound2BoundNetWeight(), and updateNetBounds().

◆ leftPinX

float PlacementInfo::PlacementNet::leftPinX
private

◆ leftPuId

unsigned int PlacementInfo::PlacementNet::leftPuId
private

◆ leftPUX

float PlacementInfo::PlacementNet::leftPUX
private

Definition at line 2473 of file PlacementInfo.h.

Referenced by updateBound2BoundNetWeight(), and updateNetBounds().

◆ minDist

float PlacementInfo::PlacementNet::minDist = 1
private

Definition at line 2478 of file PlacementInfo.h.

Referenced by updateBound2BoundNetWeight().

◆ pinOffsetsInUnit

std::vector<pinOffset> PlacementInfo::PlacementNet::pinOffsetsInUnit
private

◆ placementInfo

PlacementInfo* PlacementInfo::PlacementNet::placementInfo = nullptr
private

Definition at line 2472 of file PlacementInfo.h.

Referenced by getNewHPWLByTrying(), and updateBound2BoundNetWeight().

◆ PUSet

std::set<PlacementUnit *> PlacementInfo::PlacementNet::PUSet
private

Definition at line 2469 of file PlacementInfo.h.

Referenced by getPUSet(), and PlacementNet().

◆ rightPinId_net

unsigned int PlacementInfo::PlacementNet::rightPinId_net
private

Definition at line 2476 of file PlacementInfo.h.

Referenced by updateBound2BoundNetWeight(), and updateNetBounds().

◆ rightPinX

float PlacementInfo::PlacementNet::rightPinX
private

◆ rightPuId

unsigned int PlacementInfo::PlacementNet::rightPuId
private

◆ rightPUX

float PlacementInfo::PlacementNet::rightPUX
private

Definition at line 2473 of file PlacementInfo.h.

Referenced by updateBound2BoundNetWeight(), and updateNetBounds().

◆ topPinId_net

unsigned int PlacementInfo::PlacementNet::topPinId_net
private

Definition at line 2476 of file PlacementInfo.h.

Referenced by updateBound2BoundNetWeight(), and updateNetBounds().

◆ topPinY

float PlacementInfo::PlacementNet::topPinY
private

Definition at line 2474 of file PlacementInfo.h.

Referenced by getHPWL(), getTopPinY(), updateBound2BoundNetWeight(), and updateNetBounds().

◆ topPuId

unsigned int PlacementInfo::PlacementNet::topPuId
private

◆ topPUY

float PlacementInfo::PlacementNet::topPUY
private

Definition at line 2473 of file PlacementInfo.h.

Referenced by updateBound2BoundNetWeight(), and updateNetBounds().

◆ unitsOfDriverPins

std::vector<PlacementUnit *> PlacementInfo::PlacementNet::unitsOfDriverPins
private

Definition at line 2466 of file PlacementInfo.h.

Referenced by getDriverUnits(), and PlacementNet().

◆ unitsOfNetPins

std::vector<PlacementUnit *> PlacementInfo::PlacementNet::unitsOfNetPins
private

◆ unitsOfPinsBeDriven

std::vector<PlacementUnit *> PlacementInfo::PlacementNet::unitsOfPinsBeDriven
private

Definition at line 2467 of file PlacementInfo.h.

Referenced by getUnitsBeDriven(), and PlacementNet().


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