AMF-Placer
2.0
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
|
Go to the documentation of this file.
26 #ifndef _WIRELENGTHOPTIMIZER
27 #define _WIRELENGTHOPTIMIZER
31 #include "Eigen/Eigen"
32 #include "Eigen/SparseCore"
41 #include <semaphore.h>
92 bool forwardSolutionToNextIteration =
false,
bool enableMacroPseudoNet2Site =
false,
93 bool considerNetNum =
true,
bool enableUserDefinedClusterOpt =
false,
110 void updateB2BNetWeight(
float pesudoNetWeight,
bool enableMacroPseudoNet2Site =
false,
bool considerNetNum =
true,
111 bool enableUserDefinedClusterOpt =
false,
133 std::vector<Eigen::Triplet<float>> &objectiveMatrixTripletList,
134 std::vector<float> &objectiveMatrixDiag, Eigen::VectorXd &objectiveVector,
278 bool calculate =
false);
303 return std::abs(x0 - x1) +
y2xRatio * std::abs(y0 - y1);
406 std::string
targetCellName =
"design_1_i/DigitRec_0/inst/ap_phi_reg_pp2_iter31_knn_set_392_1_reg_27413_reg[20]";
_PUWithScore(PlacementInfo::PlacementUnit *PU, float score)
static void QPSolve(QPSolverWrapper *&curSolver)
call the cooresponding solver to solve the QP problem defined in the given QPSolverWrapper
void updatePseudoNetForClockRegion(float pesudoNetWeight)
add pseudo nets for clock region
QPSolverWrapper * ySolver
DesignInfo::DesignCell * cell
a DesignCell in design netlist, DesignPin objects of which might connect to DesignNet objects
std::map< DesignInfo::DesignNet *, std::vector< float > > netPinEnhanceRate
PlacementInfo * placementInfo
void addPseudoNet2LoctionForAllPUs(float pesudoNetWeight, bool considerNetNum)
as convential QP placers do, we add pseudo nets between anchors and PlacementUnit to constrain the mo...
float oriMacroLegalizationWeight
the net weight for macro legalization
std::vector< std::vector< slackEnhanceTuple > * > PNetId2SlackEnhanceTuples
void LUTLUTPairing_TimingDriven(float timingWeight, float disThreshold, PlacementTimingOptimizer *timingOptimizer)
int getMacroPseudoNetEnhanceCnt()
Get the number of the conducted macro iterations.
double manhattanDis(double x0, double y0, double x1, double y1)
evaluate the Mahattan distance between two locations
void setMacroLegalizationParameters(int cnt, float macroLegalizationWeight)
Set the macro legalization parameters.
void clearNetPinEnhanceRate()
PlacementInfo::PlacementUnit * PU
bool useUnconstrainedCG
indicate whether wirelength optimizer uses Eigen3, which cannot solve QP problem with constraints....
This header file contains the classes of data for a standalone design netlist.
void updatePseudoNetForUserDefinedClusters(float pesudoNetWeight)
add pseudo net for user-defined clusters
WirelengthOptimizer(PlacementInfo *placementInfo, std::map< std::string, std::string > &JSONCfg, bool verbose=true)
Construct a new Wirelength Optimizer object.
float generalNetWeight
a common factor indicate the overall strength of the nets in the QP model from external setting
float userDefinedClusterFadeOutFactor
the fade-out factor for the user-defined clusters
This header file contains the classes of data for a standalone device.
void addPseudoNet_SlackBased(float timingWeight, double slackPowFactor, PlacementTimingOptimizer *timingOptimizer, bool calculate=false)
add pseudo net for timing optimization based on the timing slack of each elements in the design netli...
void solverLoadData()
load to placement location from PlacementInfo to the solver
void updateB2BNetWeight(float pesudoNetWeight, bool enableMacroPseudoNet2Site=false, bool considerNetNum=true, bool enableUserDefinedClusterOpt=false, PlacementTimingOptimizer *timingOptimizer=nullptr)
update the net weights in the quadratic model according to B2B net HPWL model.
void reloadPlacementInfo()
re-initialize some parameters and optimizer configuration according to the PlacementInfo
struct WirelengthOptimizer::_slackEnhanceTuple slackEnhanceTuple
_CellWithScore(DesignInfo::DesignCell *cell, float score)
int macroPseudoNetCnt
the number of the conducted macro iterations
float y2xRatio
a factor to tune the weights of the net spanning in Y-coordinate relative to the net spanning in X-co...
struct WirelengthOptimizer::_PUWithScore PUWithScore
a movement unit in placement with information of location and resource demand
_slackEnhanceTuple(float weight, int PUAId, int PUBId, int PinAId, int PinBId, float YEnhance=1.0)
float generalTimingNetWeight
static void updateB2BNetWeightWorker(PlacementInfo *placementInfo, std::vector< Eigen::Triplet< float >> &objectiveMatrixTripletList, std::vector< float > &objectiveMatrixDiag, Eigen::VectorXd &objectiveVector, float generalNetWeight, float y2xRatio, bool updateX, bool updateY)
a worker funtion for multi-threading net weight updating
std::map< std::string, std::string > & JSONCfg
void GlobalPlacementQPSolve(float pesudoNetWeight, bool firstIteration=true, bool forwardSolutionToNextIteration=false, bool enableMacroPseudoNet2Site=false, bool considerNetNum=true, bool enableUserDefinedClusterOpt=false, float displacementLimit=-10, PlacementTimingOptimizer *timingOptimizer=nullptr)
use quadratic model to estimate the HPWL and some timing/user-defined pseudo nets are involved for sp...
struct WirelengthOptimizer::_CellWithScore CellWithScore
float getCellDistance(PlacementInfo::Location &A, PlacementInfo::Location &B)
float getMacroLegalizationWeight()
Get the net weight for macro legalization.
void solverWriteBackData(float displacementLimit)
write placement location from the solver to the PlacementInfo
void solverLoadFixedData()
load to placement location of fixed PlacementUnits from PlacementInfo to the solver
void addPseudoNetForMacros(float pesudoNetWeight, bool considerNetNum)
add the legalization pseudo nets to force macros move to the legal sites
This header file mainly contains the definition of class PlacementInfo, including information related...
bool MKLorNot
indicate whether wirelength optimizer is based on MKL library when using OSQP placer,...
std::string targetCellName
bool directMacroLegalize
indicate whether we use direct macro legalization instread of the progressive legalization (2-phase l...
QPSolverWrapper * xSolver
WirelengthOptimizer builds numerical models based on the element locations and calls solvers to find ...
void setSlackPowerFactor(double _slackPowerFactor)
void setGeneralTimingNetWeight(float _generalTimingNetWeight)
Information related to FPGA placement (wirelength optimization, cell spreading, legalization,...