AMF-Placer
2.0
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
|
ClusterPlacer will cluster nodes in the given netlist and place the clusters on the device based on simulated-annealing as initial placement. More...
#include <ClusterPlacer.h>
Public Member Functions | |
ClusterPlacer (PlacementInfo *placementInfo, std::map< std::string, std::string > &JSONCfg, float connectionToFixedFactor=5.0) | |
Construct a new Cluster Placer object. More... | |
~ClusterPlacer () | |
void | ClusterPlacement () |
conduct cluster placement, cluster nodes in the given netlist and place the clusters on the device as initial placement. More... | |
Private Member Functions | |
bool | isDensePlacement () |
void | resetClusterInfo () |
clean all information of the clusters (including PlacementUnit-Cluster mapping and the cluster-level netlist) More... | |
void | creaeClusterNets () |
construct the netlist of the generated clusters based on the PlacementNet in PlacementInfo More... | |
void | setClusterNetsAdjMat () |
construct the cluster nets adjacent matrix for simulated-annealing cluster placement More... | |
void | hypergraphPartitioning () |
call specific partitioners to partition the design netlist into clusters for initial placement More... | |
void | basicPartitioning (int minClusterCellNum, int eachClusterDSPNum, int eachClusterBRAMNum) |
pure connectivity-based partitioning based on PaToH More... | |
void | clockBasedPartitioning (int minClusterCellNum, int eachClusterDSPNum, int eachClusterBRAMNum) |
initially cluster cells based on clock domains and conduct connectivity-based partitioning based on PaToH More... | |
void | userDefinedClusterBasedPartitioning (int minClusterCellNum, int eachClusterDSPNum, int eachClusterBRAMNum) |
initially cluster cells based on user-defined clusters and conduct connectivity-based partitioning based on PaToH More... | |
void | createUserDefinedClusterBasedClusterUnits () |
initially cluster cells based on user-defined clusters More... | |
void | createLongPathClusterUnits () |
initially cluster cells based on user-defined clusters More... | |
void | createClockBasedClusterUnits () |
initially cluster cells based on clock domains More... | |
void | createSinglePUClusterUnits () |
wrap single PlacementUnits into ClusterUnit for later uniform processing More... | |
void | refineClustersWithPredefinedClusters () |
refine the elements in obtained clusters to ensure the cells in user-defined clusters in the same cluster More... | |
void | clusterPlacementUnits () |
cluster the netlist and create ClusterUnit level netlist for SA placement More... | |
void | placeClusters () |
conduct the ClusterUnit level SA placement and then map PlacementUnit to cluster location More... | |
void | placeUnitBaseOnClusterPlacement (const std::vector< std::pair< int, int >> &cluster2XY) |
map PlacementUnit to cluster location More... | |
bool | isClustersToLarges () |
check whether the average size of clusters is greater than the given threshold More... | |
int | getPlacementUnitMaxPathLen (PlacementInfo::PlacementUnit *curPU) |
float | random_float (float min, float max) |
void | dumpClusters () |
void | drawClusters () |
Private Attributes | |
PlacementInfo * | placementInfo |
the PlacementInfo for this placer to handle More... | |
std::vector< std::set< int > > | clusters |
the resultant clusters of PlacementUnit (id) More... | |
std::map< std::string, std::string > & | JSONCfg |
float | connectionToFixedFactor |
the enhancement ratio of the net between elements and I/Os More... | |
float | y2xRatio = 1.0 |
the Y/X coordinate calibration factor More... | |
bool | verbose |
bool | randomInitialPlacement = false |
int | avgClusterSizeRequirement = 40000 |
the requirement of the average size of clusters (the number of cells) More... | |
double | maxMinCutRate = 0.0333 |
the maximum cut rate for netlist min-cut partitioning More... | |
std::vector< std::pair< int, int > > | cluster2XY |
mapping cluster id to X/Y location in the cluster bin More... | |
std::vector< std::pair< float, float > > | cluster2FP_XY |
mapping cluster id to floating-point X/Y location on device More... | |
std::vector< std::vector< float > > | clusterAdjMat |
std::vector< float > | clusterCLBCellWeights |
std::vector< float > | clusterDSPCellWeights |
std::vector< float > | clusterBRAMCellWeights |
std::vector< std::vector< float > > | cluster2FixedUnitMat |
std::vector< float > | fixedX |
std::vector< float > | fixedY |
std::vector< int > | placementUnit2ClusterId |
std::vector< int > | placementUnitId2ClusterUnitId |
std::vector< PlacementInfo::ClusterUnit * > | clusterUnits |
std::vector< PlacementInfo::ClusterNet * > | clusterNets |
int | clockRegionXNum |
int | clockRegionYNum |
int | jobs |
the parallel (multi-threading) worker number More... | |
SAPlacer * | saPlacer = nullptr |
simulated-annealing placer for the cluster placement. More... | |
GraphPartitioner< std::vector< PlacementInfo::PlacementUnit * >, std::vector< PlacementInfo::PlacementNet * > > * | basicGraphPartitioner = nullptr |
basicGraphPartitioner will conduct partitioning at the PlacementUnit level considering connectivity and resource demand More... | |
GraphPartitioner< std::vector< PlacementInfo::ClusterUnit * >, std::vector< PlacementInfo::ClusterNet * > > * | userDefinedClusterBasedGraphPartitioner = nullptr |
userDefinedClusterBasedGraphPartitioner will conduct partitioning at the Cluster level considering connectivity and resource demand. The input clusters are obtained by user-defined information More... | |
GraphPartitioner< std::vector< PlacementInfo::ClusterUnit * >, std::vector< PlacementInfo::ClusterNet * > > * | clockBasedGraphPartitioner = nullptr |
clockBasedGraphPartitioner will conduct partitioning at the Cluster level considering connectivity and resource demand. The input clusters are obtained by clock domain. More... | |
ClusterPlacer will cluster nodes in the given netlist and place the clusters on the device based on simulated-annealing as initial placement.
Definition at line 53 of file ClusterPlacer.h.
ClusterPlacer::ClusterPlacer | ( | PlacementInfo * | placementInfo, |
std::map< std::string, std::string > & | JSONCfg, | ||
float | connectionToFixedFactor = 5.0 |
||
) |
Construct a new Cluster Placer object.
placementInfo | the PlacementInfo for this placer to handle |
JSONCfg | the user-defined placement configuration |
connectionToFixedFactor | the enhancement ratio of the net between elements and I/Os |
Definition at line 33 of file ClusterPlacer.cc.
|
inline |
Definition at line 65 of file ClusterPlacer.h.
|
private |
pure connectivity-based partitioning based on PaToH
minClusterCellNum | minimum number of cells in a cluster |
eachClusterDSPNum | maximum number of DSP cells in a cluster |
eachClusterBRAMNum | maximum number of BRAM cells in a cluster |
Definition at line 338 of file ClusterPlacer.cc.
|
private |
initially cluster cells based on clock domains and conduct connectivity-based partitioning based on PaToH
minClusterCellNum | minimum number of cells in a cluster |
eachClusterDSPNum | maximum number of DSP cells in a cluster |
eachClusterBRAMNum | maximum number of BRAM cells in a cluster |
Definition at line 399 of file ClusterPlacer.cc.
Referenced by hypergraphPartitioning().
void ClusterPlacer::ClusterPlacement | ( | ) |
conduct cluster placement, cluster nodes in the given netlist and place the clusters on the device as initial placement.
Definition at line 60 of file ClusterPlacer.cc.
Referenced by GlobalPlacer::clusterPlacement().
|
private |
cluster the netlist and create ClusterUnit level netlist for SA placement
Definition at line 100 of file ClusterPlacer.cc.
Referenced by ClusterPlacement().
|
inlineprivate |
construct the netlist of the generated clusters based on the PlacementNet in PlacementInfo
Definition at line 225 of file ClusterPlacer.h.
Referenced by clockBasedPartitioning(), and createUserDefinedClusterBasedClusterUnits().
|
private |
initially cluster cells based on clock domains
Definition at line 235 of file ClusterPlacer.cc.
Referenced by clockBasedPartitioning().
|
private |
initially cluster cells based on user-defined clusters
Definition at line 144 of file ClusterPlacer.cc.
Referenced by clockBasedPartitioning().
|
private |
wrap single PlacementUnits into ClusterUnit for later uniform processing
Definition at line 324 of file ClusterPlacer.cc.
Referenced by clockBasedPartitioning(), and createUserDefinedClusterBasedClusterUnits().
|
private |
initially cluster cells based on user-defined clusters
Definition at line 269 of file ClusterPlacer.cc.
Referenced by userDefinedClusterBasedPartitioning().
|
private |
Definition at line 843 of file ClusterPlacer.cc.
Referenced by ClusterPlacement().
|
private |
Definition at line 777 of file ClusterPlacer.cc.
Referenced by ClusterPlacement().
|
inlineprivate |
Definition at line 340 of file ClusterPlacer.h.
Referenced by setClusterNetsAdjMat().
|
private |
call specific partitioners to partition the design netlist into clusters for initial placement
Definition at line 113 of file ClusterPlacer.cc.
Referenced by clusterPlacementUnits().
|
private |
check whether the average size of clusters is greater than the given threshold
Definition at line 527 of file ClusterPlacer.cc.
Referenced by hypergraphPartitioning().
|
inlineprivate |
Definition at line 203 of file ClusterPlacer.h.
Referenced by setClusterNetsAdjMat().
|
private |
conduct the ClusterUnit level SA placement and then map PlacementUnit to cluster location
Definition at line 709 of file ClusterPlacer.cc.
Referenced by ClusterPlacement().
|
private |
map PlacementUnit to cluster location
cluster2XY | the cluster location at grid level |
Definition at line 740 of file ClusterPlacer.cc.
Referenced by placeClusters().
|
inlineprivate |
Definition at line 366 of file ClusterPlacer.h.
Referenced by ClusterPlacement().
|
private |
refine the elements in obtained clusters to ensure the cells in user-defined clusters in the same cluster
It seems that this refining solution work poorly. Might be abandoned in the future.
Definition at line 457 of file ClusterPlacer.cc.
|
inlineprivate |
clean all information of the clusters (including PlacementUnit-Cluster mapping and the cluster-level netlist)
Definition at line 214 of file ClusterPlacer.h.
Referenced by clockBasedPartitioning().
|
private |
construct the cluster nets adjacent matrix for simulated-annealing cluster placement
Definition at line 593 of file ClusterPlacer.cc.
Referenced by clusterPlacementUnits().
|
private |
initially cluster cells based on user-defined clusters and conduct connectivity-based partitioning based on PaToH
minClusterCellNum | minimum number of cells in a cluster |
eachClusterDSPNum | maximum number of DSP cells in a cluster |
eachClusterBRAMNum | maximum number of BRAM cells in a cluster |
Definition at line 361 of file ClusterPlacer.cc.
|
private |
the requirement of the average size of clusters (the number of cells)
Definition at line 125 of file ClusterPlacer.h.
Referenced by hypergraphPartitioning(), and isClustersToLarges().
|
private |
basicGraphPartitioner will conduct partitioning at the PlacementUnit level considering connectivity and resource demand
Definition at line 185 of file ClusterPlacer.h.
Referenced by basicPartitioning(), and ~ClusterPlacer().
|
private |
clockBasedGraphPartitioner will conduct partitioning at the Cluster level considering connectivity and resource demand. The input clusters are obtained by clock domain.
Definition at line 201 of file ClusterPlacer.h.
Referenced by clockBasedPartitioning().
|
private |
Definition at line 162 of file ClusterPlacer.h.
Referenced by ClusterPlacer(), and setClusterNetsAdjMat().
|
private |
Definition at line 162 of file ClusterPlacer.h.
Referenced by ClusterPlacer().
|
private |
Definition at line 152 of file ClusterPlacer.h.
Referenced by placeClusters(), and setClusterNetsAdjMat().
|
private |
mapping cluster id to floating-point X/Y location on device
Definition at line 143 of file ClusterPlacer.h.
Referenced by placeUnitBaseOnClusterPlacement().
|
private |
mapping cluster id to X/Y location in the cluster bin
Definition at line 137 of file ClusterPlacer.h.
Referenced by dumpClusters(), placeClusters(), and placeUnitBaseOnClusterPlacement().
|
private |
Definition at line 147 of file ClusterPlacer.h.
Referenced by drawClusters(), placeClusters(), and setClusterNetsAdjMat().
|
private |
Definition at line 150 of file ClusterPlacer.h.
Referenced by setClusterNetsAdjMat().
|
private |
Definition at line 148 of file ClusterPlacer.h.
Referenced by placeClusters(), and setClusterNetsAdjMat().
|
private |
Definition at line 149 of file ClusterPlacer.h.
Referenced by setClusterNetsAdjMat().
|
private |
Definition at line 160 of file ClusterPlacer.h.
Referenced by clockBasedPartitioning(), creaeClusterNets(), createUserDefinedClusterBasedClusterUnits(), resetClusterInfo(), userDefinedClusterBasedPartitioning(), and ~ClusterPlacer().
|
private |
the resultant clusters of PlacementUnit (id)
a vector of the sets of PlacementUnit Id ==> clusters of PlacementUnit id
Definition at line 103 of file ClusterPlacer.h.
Referenced by basicPartitioning(), clockBasedPartitioning(), clusterPlacementUnits(), dumpClusters(), hypergraphPartitioning(), isClustersToLarges(), isDensePlacement(), refineClustersWithPredefinedClusters(), setClusterNetsAdjMat(), and userDefinedClusterBasedPartitioning().
|
private |
Definition at line 159 of file ClusterPlacer.h.
Referenced by clockBasedPartitioning(), creaeClusterNets(), createClockBasedClusterUnits(), createLongPathClusterUnits(), createSinglePUClusterUnits(), createUserDefinedClusterBasedClusterUnits(), resetClusterInfo(), userDefinedClusterBasedPartitioning(), and ~ClusterPlacer().
|
private |
the enhancement ratio of the net between elements and I/Os
Definition at line 110 of file ClusterPlacer.h.
Referenced by placeClusters().
|
private |
Definition at line 153 of file ClusterPlacer.h.
Referenced by placeClusters(), and setClusterNetsAdjMat().
|
private |
Definition at line 154 of file ClusterPlacer.h.
Referenced by placeClusters(), and setClusterNetsAdjMat().
|
private |
the parallel (multi-threading) worker number
Definition at line 168 of file ClusterPlacer.h.
Referenced by basicPartitioning(), clockBasedPartitioning(), ClusterPlacer(), placeClusters(), and userDefinedClusterBasedPartitioning().
|
private |
Definition at line 104 of file ClusterPlacer.h.
Referenced by ClusterPlacement(), ClusterPlacer(), dumpClusters(), hypergraphPartitioning(), placeClusters(), and placeUnitBaseOnClusterPlacement().
|
private |
the maximum cut rate for netlist min-cut partitioning
Definition at line 131 of file ClusterPlacer.h.
Referenced by basicPartitioning(), clockBasedPartitioning(), hypergraphPartitioning(), and userDefinedClusterBasedPartitioning().
|
private |
the PlacementInfo for this placer to handle
Definition at line 95 of file ClusterPlacer.h.
Referenced by basicPartitioning(), clockBasedPartitioning(), ClusterPlacement(), clusterPlacementUnits(), creaeClusterNets(), createClockBasedClusterUnits(), createLongPathClusterUnits(), createSinglePUClusterUnits(), createUserDefinedClusterBasedClusterUnits(), dumpClusters(), getPlacementUnitMaxPathLen(), hypergraphPartitioning(), isClustersToLarges(), isDensePlacement(), placeClusters(), placeUnitBaseOnClusterPlacement(), refineClustersWithPredefinedClusters(), resetClusterInfo(), setClusterNetsAdjMat(), and userDefinedClusterBasedPartitioning().
|
private |
Definition at line 156 of file ClusterPlacer.h.
Referenced by basicPartitioning(), clockBasedPartitioning(), placeUnitBaseOnClusterPlacement(), refineClustersWithPredefinedClusters(), setClusterNetsAdjMat(), and userDefinedClusterBasedPartitioning().
|
private |
Definition at line 158 of file ClusterPlacer.h.
Referenced by creaeClusterNets(), createClockBasedClusterUnits(), createLongPathClusterUnits(), createSinglePUClusterUnits(), createUserDefinedClusterBasedClusterUnits(), and resetClusterInfo().
|
private |
Definition at line 119 of file ClusterPlacer.h.
Referenced by ClusterPlacement(), ClusterPlacer(), and placeUnitBaseOnClusterPlacement().
|
private |
simulated-annealing placer for the cluster placement.
It will map the clusters to different cluster bins and try to minimize the rough total wirelength between the clusters.
Definition at line 177 of file ClusterPlacer.h.
Referenced by placeClusters(), and ~ClusterPlacer().
|
private |
userDefinedClusterBasedGraphPartitioner will conduct partitioning at the Cluster level considering connectivity and resource demand. The input clusters are obtained by user-defined information
Definition at line 193 of file ClusterPlacer.h.
Referenced by userDefinedClusterBasedPartitioning(), and ~ClusterPlacer().
|
private |
Definition at line 117 of file ClusterPlacer.h.
Referenced by basicPartitioning(), clockBasedPartitioning(), ClusterPlacer(), placeClusters(), and userDefinedClusterBasedPartitioning().
|
private |
the Y/X coordinate calibration factor
Definition at line 116 of file ClusterPlacer.h.
Referenced by ClusterPlacer(), and placeClusters().