AMF-Placer
2.0
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
|
Go to the documentation of this file.
13 #include "3rdParty/Rendering/paintDB.h"
23 #include <boost/filesystem.hpp>
61 assert(
JSON.find(
"vivado extracted device information file") !=
JSON.end());
62 assert(
JSON.find(
"special pin offset info file") !=
JSON.end());
63 assert(
JSON.find(
"vivado extracted design information file") !=
JSON.end());
64 assert(
JSON.find(
"cellType2fixedAmo file") !=
JSON.end());
65 assert(
JSON.find(
"cellType2sharedCellType file") !=
JSON.end());
66 assert(
JSON.find(
"sharedCellType2BELtype file") !=
JSON.end());
67 assert(
JSON.find(
"GlobalPlacementIteration") !=
JSON.end());
68 if (
JSON.find(
"dumpDirectory") !=
JSON.end())
71 assert(boost::filesystem::create_directories(
JSON[
"dumpDirectory"]) &&
72 "the specified dump directory should be created successfully.");
75 oriTime = std::chrono::steady_clock::now();
77 omp_set_num_threads(std::stoi(
JSON[
"jobs"]));
80 omp_set_num_threads(std::stoi(
JSON[
"jobs"]));
84 omp_set_num_threads(1);
97 JSON[
"guiEnable"] =
"true";
122 if (pair.first->isFixed() && !pair.first->isLocked())
124 pair.first->setUnfixed();
165 200, timingOptimizer);
174 true, 200, timingOptimizer);
193 true, 25, timingOptimizer);
207 true, 25, timingOptimizer);
208 JSON[
"SpreaderSimpleExpland"] =
"true";
211 25, timingOptimizer);
224 new ParallelCLBPacker(
designInfo,
deviceinfo,
placementInfo,
JSON, 3, 10, 0.25, 0.5, 6, 10, 0.02,
"first",
303 std::map<std::string, std::string>
JSON;
void buildSimpleTimingGraph()
call timing info to build simple timing graph
void printStat(bool verbose=false)
WirelengthOptimizer * getWirelengthOptimizer()
InitialPacker will identify macros from the design netlist based on pattern matching.
DeviceInfo * deviceinfo
information related to the device (BELs, Sites, Tiles, Clock Regions)
std::vector< PlacementUnit * > & getPlacementUnits()
GlobalPlacer * globalPlacer
global placer acconting for initial placement, quadratic placement, cell spreading and macro legaliza...
void clusterLongPathInOneClockRegion(int pathLenThr, float clusterThrRatio)
void dumpCongestion(std::string dumpFileName)
dump the congestion mesh grid for evaluation
void LUTFFPairing(float disThreshold)
try to pair LUTs/FFs in the design netlist which are neighbors according to a given threshold and con...
void setPaintDataBase(PaintDataBase *_paintData)
void setPseudoNetWeight(float weight)
Set the initial pseudo net weight for the global placer.
int getLongPathThresholdLevel()
This header file contains the definitions of ParallelCLBPacker class and its internal modules and API...
AMFPlacer is an analytical mixed-size FPGA placer.
PlacementInfo * placementInfo
inforamtion related to placement (locations, interconnections, status, constraints,...
bool fileExists(const std::string &filename)
std::pair< std::map< PlacementInfo::PlacementUnit *, float >, std::map< PlacementInfo::PlacementUnit *, float > > & getPULegalXY()
get the locations (pair of X,Y) of the legalized PlacementUnit objects
This header file contains the definitions of GlobalPlacer class and its internal modules and APIs whi...
void printStat(bool verbose=false)
double updateB2BAndGetTotalHPWL()
update the B2B net model for the placement and get the total HPWL of all the nets in the design
std::map< std::string, std::string > JSON
the user-defined settings of placement
This header file contains the classes of data for a standalone design netlist.
IncrementalBELPacker incrementally packs some LUTs/FFs during global placement based on their distanc...
This header file contains the classes of data for a standalone device.
std::map< std::string, std::string > parseJSONFile(std::string JSONFileName)
This header file contains the definitions of InitialPacker class and its internal modules and APIs wh...
InitialPacker * initialPacker
initially packing for macro extraction based on pre-defined rules
void setNeighborDisplacementUpperbound(float _threshold)
Set the distance upperbound of neighbor LUT/FF-like elements for area adjustion.
void printStat(bool verbose=false)
void clearSomeAttributesCannotRecord()
PaintDataBase * paintData
int getMacroPseudoNetEnhanceCnt()
Get the number of macro pseudo net enhancements.
void print_status(std::string tmp_string)
void verifyDeviceForDesign()
verify that each cells in the design can be mapped on the resource elements on the device.
IncrementalBELPacker * incrementalBELPacker
incremental pairing of some FFs and LUTs into small macros
void pack()
extract the macros from the netlist to construction PlacmentMacro
AMFPlacer(std::string JSONFileName, bool guiEnable)
Construct a new AMFPlacer object according to a given placer configuration file.
void packCLBs(int packIterNum, bool doExceptionHandling, bool debug=false)
packing the PlacementUnits (which are compatible to CLB sites) into CLB sites
void updatePackedMacro(bool setPUPseudoNetToCLBSite=false, bool setCLBFixed=false)
Update the macros in PlacementInfo by regarding those elements in one CLB site as a macro.
void resetLUTFFDeterminedOccupation()
reset the LUTFFDeterminedOccupation object
PlacementTimingInfo * getTimingInfo()
void dumpOverflowClockUtilization()
void GlobalPlacement_CLBElements(int iterNum, bool continuePreviousIteration=false, int lowerBoundIterNum=6, bool enableMacroPseudoNet2Site=false, bool stopStrictly=false, unsigned int spreadRegionBinNumLimit=10000000, PlacementTimingOptimizer *timingOptimizer=nullptr)
wirelength optimization + cell spreading + legalization + area adjustion
void GlobalPlacement_fixedCLB(int iterNum, float pseudoNetWeight)
fix the locations of CLB and let macros move without low pseudo net at initial stages,...
This header file contains the definitions of IncrementalBELPacker class and its internal modules and ...
bool checkClockUtilization(bool dump)
check the utlization of the clock regions on the device
float conductStaticTimingAnalysis(bool enforeOptimisticTiming=false)
Information class related to FPGA device, including the details of BEL/Site/Tile/ClockRegion.
void dumpPlacementUnitInformation(std::string dumpFile)
dump the PlacementUnit objects and some placement parameters as a checkpoint
GlobalPlacer accounts for the general iterations in global placement.
DesignInfo * designInfo
information related to the design (cells, pins and nets)
void clusterPlacement()
cluster elements and conduct initial placement at coarse-grained level
void print_info(std::string tmp_string)
void setMacroLegalizationParameters(int cnt, float macroLegalizationWeight)
Set the macro legalization parameters (including legalization counter and pseudo net weight)
std::chrono::time_point< std::chrono::steady_clock > oriTime
ParallelCLBPacker will finally pack LUT/FF/MUX/CARRY elements into legal CLB sites in a parallel appr...
void run()
launch the analytical mixed-size FPGA placement procedure
float getPseudoNetWeight()
Get the current pseudo net weight.
float getMacroLegalizationWeight()
Get the current macro legalization weight object.
ParallelCLBPacker * parallelCLBPacker
final packing of instances into CLB sites
void adjustLUTFFUtilization(float neighborDisplacementUpperbound, bool enfore=false)
adjust the resource demand of LUTs/FFs according to packing feasibility and routing congestion
std::map< PlacementUnit *, std::pair< float, float > > & getPU2ClockRegionCenters()
get the PlacementUnit Mapping to clock region centers for timing optimzation
This header file mainly contains the definition of class PlacementInfo, including information related...
void setPULocationToPackedSite()
update the location of PlacementUnits according to the packing result
void FFPairing(float disThreshold)
try to pair FFs in the design netlist which are neighbors according to a given threshold and the cont...
Information related to FPGA designs, including design cells and their interconnections.
void createGridBins(float binWidth, float binHeight)
Create a grid of bins on the device.
Information related to FPGA placement (wirelength optimization, cell spreading, legalization,...