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

#include <SAPlacer.h>

Public Member Functions

 SAPlacer (std::string placerName, std::vector< std::vector< float >> &clusterAdjMat, std::vector< float > &clusterWeights, std::vector< std::vector< float >> &cluster2FixedUnitMat, std::vector< float > &fixedX, std::vector< float > &fixedY, int gridH, int gridW, float deviceH, float deviceW, float connectionToFixedFactor=5.0, float y2xRatio=0.8, int Kmax=100000, int nJobs=1, int restartNum=10, bool verbose=false)
 
 ~SAPlacer ()
 
void solve ()
 
std::vector< std::pair< int, int > > & getCluster2XY ()
 
std::vector< std::vector< std::vector< int > > > & getGrid2clusters ()
 
double evaluateClusterPlacement (const std::vector< std::vector< std::vector< int >>> &grid2clusters, const std::vector< std::pair< int, int >> &cluster2XY)
 
double incrementalEvaluateClusterPlacement (const std::vector< std::vector< std::vector< int >>> &grid2clusters, const std::vector< std::pair< int, int >> &cluster2XY)
 

Private Member Functions

void randomSwapInWideRange (const std::vector< std::vector< std::vector< int >>> &grid2clusters, std::vector< std::vector< std::vector< int >>> &new_Grid2clusters, const std::vector< std::pair< int, int >> &cluster2XY, std::vector< std::pair< int, int >> &new_cluster2XY, float temperature, boost::mt19937 &rng)
 
void randomSwapInWideRangeWithNeighbors (const std::vector< std::vector< std::vector< int >>> &grid2clusters, std::vector< std::vector< std::vector< int >>> &new_Grid2clusters, const std::vector< std::pair< int, int >> &cluster2XY, std::vector< std::pair< int, int >> &new_cluster2XY, float temperature, boost::mt19937 &rng)
 
void randomShuffleRowColumn (const std::vector< std::vector< std::vector< int >>> &grid2clusters, std::vector< std::vector< std::vector< int >>> &new_grid2clusters, const std::vector< std::pair< int, int >> &cluster2XY, std::vector< std::pair< int, int >> &new_cluster2XY, boost::mt19937 &rng)
 
float probabilituFunc (double oriE, double newE, float T)
 
void greedyInitialize (std::vector< std::pair< int, int >> &init_cluster2XY, std::vector< std::vector< std::vector< int >>> &init_grid2clusters, int initOffset)
 
void greedyPlaceACluster (const std::vector< std::pair< int, int >> &init_cluster2XY, const std::vector< std::vector< std::vector< int >>> &init_grid2clusters, std::vector< std::pair< int, int >> &new_cluster2XY, std::vector< std::vector< std::vector< int >>> &new_grid2clusters, int clusterIdToPlace)
 
int greedyFindNextClusterToPlace (std::vector< std::pair< int, int >> &tmp_cluster2XY, std::vector< std::vector< std::vector< int >>> &tmp_grid2clusters)
 

Static Private Member Functions

static void worker (SAPlacer *saPlacer, std::vector< std::vector< std::vector< int >>> &init_grid2clusters, std::vector< std::pair< int, int >> &init_cluster2XY, std::vector< std::vector< std::vector< int >>> &opt_grid2clusters, std::vector< std::pair< int, int >> &opt_cluster2XY, int &totalIterNum, int &workers_randomSeed, double &resE)
 

Private Attributes

std::string placerName
 
std::vector< std::vector< float > > & clusterAdjMat
 
std::vector< float > & clusterWeights
 
std::vector< std::vector< float > > & cluster2FixedUnitMat
 
std::vector< float > & fixedX
 
std::vector< float > & fixedY
 
int gridH
 
int gridW
 
float deviceH
 
float deviceW
 
float connectionToFixedFactor
 
float y2xRatio
 
int Kmax
 
int nJobs
 
int restartNum
 
bool verbose
 
std::vector< std::pair< int, int > > res_cluster2XY
 
std::vector< std::vector< std::vector< int > > > res_grid2clusters
 
double resE
 
double SACalibrationOffset
 

Detailed Description

Definition at line 40 of file SAPlacer.h.

Constructor & Destructor Documentation

◆ SAPlacer()

SAPlacer::SAPlacer ( std::string  placerName,
std::vector< std::vector< float >> &  clusterAdjMat,
std::vector< float > &  clusterWeights,
std::vector< std::vector< float >> &  cluster2FixedUnitMat,
std::vector< float > &  fixedX,
std::vector< float > &  fixedY,
int  gridH,
int  gridW,
float  deviceH,
float  deviceW,
float  connectionToFixedFactor = 5.0,
float  y2xRatio = 0.8,
int  Kmax = 100000,
int  nJobs = 1,
int  restartNum = 10,
bool  verbose = false 
)
inline

Definition at line 43 of file SAPlacer.h.

◆ ~SAPlacer()

SAPlacer::~SAPlacer ( )
inline

Definition at line 54 of file SAPlacer.h.

Member Function Documentation

◆ evaluateClusterPlacement()

double SAPlacer::evaluateClusterPlacement ( const std::vector< std::vector< std::vector< int >>> &  grid2clusters,
const std::vector< std::pair< int, int >> &  cluster2XY 
)

Definition at line 32 of file SAPlacer.cc.

Referenced by solve(), and worker().

Here is the caller graph for this function:

◆ getCluster2XY()

std::vector<std::pair<int, int> >& SAPlacer::getCluster2XY ( )
inline

Definition at line 60 of file SAPlacer.h.

Referenced by ClusterPlacer::placeClusters().

Here is the caller graph for this function:

◆ getGrid2clusters()

std::vector<std::vector<std::vector<int> > >& SAPlacer::getGrid2clusters ( )
inline

Definition at line 64 of file SAPlacer.h.

◆ greedyFindNextClusterToPlace()

int SAPlacer::greedyFindNextClusterToPlace ( std::vector< std::pair< int, int >> &  tmp_cluster2XY,
std::vector< std::vector< std::vector< int >>> &  tmp_grid2clusters 
)
private

Definition at line 558 of file SAPlacer.cc.

Referenced by greedyInitialize().

Here is the caller graph for this function:

◆ greedyInitialize()

void SAPlacer::greedyInitialize ( std::vector< std::pair< int, int >> &  init_cluster2XY,
std::vector< std::vector< std::vector< int >>> &  init_grid2clusters,
int  initOffset 
)
private

Definition at line 609 of file SAPlacer.cc.

Referenced by solve().

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

◆ greedyPlaceACluster()

void SAPlacer::greedyPlaceACluster ( const std::vector< std::pair< int, int >> &  init_cluster2XY,
const std::vector< std::vector< std::vector< int >>> &  init_grid2clusters,
std::vector< std::pair< int, int >> &  new_cluster2XY,
std::vector< std::vector< std::vector< int >>> &  new_grid2clusters,
int  clusterIdToPlace 
)
private

Definition at line 494 of file SAPlacer.cc.

Referenced by greedyInitialize().

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

◆ incrementalEvaluateClusterPlacement()

double SAPlacer::incrementalEvaluateClusterPlacement ( const std::vector< std::vector< std::vector< int >>> &  grid2clusters,
const std::vector< std::pair< int, int >> &  cluster2XY 
)

Definition at line 89 of file SAPlacer.cc.

Referenced by greedyPlaceACluster().

Here is the caller graph for this function:

◆ probabilituFunc()

float SAPlacer::probabilituFunc ( double  oriE,
double  newE,
float  T 
)
private

Definition at line 435 of file SAPlacer.cc.

Referenced by worker().

Here is the caller graph for this function:

◆ randomShuffleRowColumn()

void SAPlacer::randomShuffleRowColumn ( const std::vector< std::vector< std::vector< int >>> &  grid2clusters,
std::vector< std::vector< std::vector< int >>> &  new_grid2clusters,
const std::vector< std::pair< int, int >> &  cluster2XY,
std::vector< std::pair< int, int >> &  new_cluster2XY,
boost::mt19937 &  rng 
)
private

Definition at line 402 of file SAPlacer.cc.

Referenced by worker().

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

◆ randomSwapInWideRange()

void SAPlacer::randomSwapInWideRange ( const std::vector< std::vector< std::vector< int >>> &  grid2clusters,
std::vector< std::vector< std::vector< int >>> &  new_Grid2clusters,
const std::vector< std::pair< int, int >> &  cluster2XY,
std::vector< std::pair< int, int >> &  new_cluster2XY,
float  temperature,
boost::mt19937 &  rng 
)
private

Definition at line 176 of file SAPlacer.cc.

Referenced by worker().

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

◆ randomSwapInWideRangeWithNeighbors()

void SAPlacer::randomSwapInWideRangeWithNeighbors ( const std::vector< std::vector< std::vector< int >>> &  grid2clusters,
std::vector< std::vector< std::vector< int >>> &  new_Grid2clusters,
const std::vector< std::pair< int, int >> &  cluster2XY,
std::vector< std::pair< int, int >> &  new_cluster2XY,
float  temperature,
boost::mt19937 &  rng 
)
private

Definition at line 313 of file SAPlacer.cc.

◆ solve()

void SAPlacer::solve ( )

Definition at line 678 of file SAPlacer.cc.

Referenced by ClusterPlacer::placeClusters().

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

◆ worker()

void SAPlacer::worker ( SAPlacer saPlacer,
std::vector< std::vector< std::vector< int >>> &  init_grid2clusters,
std::vector< std::pair< int, int >> &  init_cluster2XY,
std::vector< std::vector< std::vector< int >>> &  opt_grid2clusters,
std::vector< std::pair< int, int >> &  opt_cluster2XY,
int &  totalIterNum,
int &  workers_randomSeed,
double &  resE 
)
staticprivate

Definition at line 442 of file SAPlacer.cc.

Referenced by solve().

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

Member Data Documentation

◆ cluster2FixedUnitMat

std::vector<std::vector<float> >& SAPlacer::cluster2FixedUnitMat
private

◆ clusterAdjMat

std::vector<std::vector<float> >& SAPlacer::clusterAdjMat
private

◆ clusterWeights

std::vector<float>& SAPlacer::clusterWeights
private

Definition at line 79 of file SAPlacer.h.

Referenced by evaluateClusterPlacement(), and incrementalEvaluateClusterPlacement().

◆ connectionToFixedFactor

float SAPlacer::connectionToFixedFactor
private

Definition at line 90 of file SAPlacer.h.

Referenced by evaluateClusterPlacement(), and incrementalEvaluateClusterPlacement().

◆ deviceH

float SAPlacer::deviceH
private

Definition at line 87 of file SAPlacer.h.

Referenced by evaluateClusterPlacement(), and incrementalEvaluateClusterPlacement().

◆ deviceW

float SAPlacer::deviceW
private

Definition at line 88 of file SAPlacer.h.

Referenced by evaluateClusterPlacement(), and incrementalEvaluateClusterPlacement().

◆ fixedX

std::vector<float>& SAPlacer::fixedX
private

Definition at line 82 of file SAPlacer.h.

Referenced by evaluateClusterPlacement(), and incrementalEvaluateClusterPlacement().

◆ fixedY

std::vector<float>& SAPlacer::fixedY
private

Definition at line 83 of file SAPlacer.h.

Referenced by evaluateClusterPlacement(), and incrementalEvaluateClusterPlacement().

◆ gridH

◆ gridW

◆ Kmax

int SAPlacer::Kmax
private

Definition at line 92 of file SAPlacer.h.

Referenced by solve().

◆ nJobs

int SAPlacer::nJobs
private

Definition at line 93 of file SAPlacer.h.

Referenced by solve().

◆ placerName

std::string SAPlacer::placerName
private

Definition at line 76 of file SAPlacer.h.

Referenced by solve().

◆ res_cluster2XY

std::vector<std::pair<int, int> > SAPlacer::res_cluster2XY
private

Definition at line 97 of file SAPlacer.h.

Referenced by getCluster2XY(), greedyPlaceACluster(), and solve().

◆ res_grid2clusters

std::vector<std::vector<std::vector<int> > > SAPlacer::res_grid2clusters
private

Definition at line 98 of file SAPlacer.h.

Referenced by getGrid2clusters(), greedyPlaceACluster(), and solve().

◆ resE

double SAPlacer::resE
private

Definition at line 99 of file SAPlacer.h.

Referenced by solve(), and worker().

◆ restartNum

int SAPlacer::restartNum
private

Definition at line 94 of file SAPlacer.h.

Referenced by solve().

◆ SACalibrationOffset

double SAPlacer::SACalibrationOffset
private

Definition at line 101 of file SAPlacer.h.

Referenced by probabilituFunc(), and solve().

◆ verbose

bool SAPlacer::verbose
private

Definition at line 95 of file SAPlacer.h.

Referenced by solve().

◆ y2xRatio

float SAPlacer::y2xRatio
private

Definition at line 91 of file SAPlacer.h.

Referenced by evaluateClusterPlacement(), and incrementalEvaluateClusterPlacement().


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