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

InitialPacker will identify macros from the design netlist based on pattern matching. More...

#include <InitialPacker.h>

Collaboration diagram for InitialPacker:

Classes

class  PackedControlSet
 control set information container used during initial packing. More...
 
class  SiteBELMapping
 SiteBELMapping is a contain recording the mapping between cells and BELs. More...
 

Public Member Functions

 InitialPacker (DesignInfo *designInfo, DeviceInfo *deviceInfo, PlacementInfo *placementInfo, std::map< std::string, std::string > &JSONCfg)
 Construct a new Initial Packer object. More...
 
void pack ()
 extract the macros from the netlist to construction PlacmentMacro More...
 
std::vector< DesignInfo::DesignCell * > BFSExpandViaSpecifiedPorts (std::string portPattern, DesignInfo::DesignCell *startCell, bool exactMatch=false)
 BFS to find the core cells of a macro based on some pre-defined patterns of cascaded cells. More...
 
std::vector< DesignInfo::DesignCell * > BFSExpandViaSpecifiedPorts (std::vector< std::string > portPatterns, DesignInfo::DesignCell *startCell, bool exactMatch=false)
 
void findDSPMacros ()
 detects DSP macros and clusters the related cells into PlacementInfo::PlacementMacro More...
 
void setDSPRegs (std::vector< DesignInfo::DesignCell * > &DSPTailsToBeCheckedRegisterAttr)
 
void findLUTRAMMacros ()
 detects LUTRAM macros and clusters the related cells into PlacementInfo::PlacementMacro More...
 
void findBRAMMacros ()
 detects BRAM macros and clusters the related cells into PlacementInfo::PlacementMacro More...
 
std::vector< DesignInfo::DesignCell * > checkCompatibleFFs (std::vector< DesignInfo::DesignCell * > FFs)
 check the control set of the candidate FFs and select the control set with the most FFs to be packed in the carray macro More...
 
void findCARRYMacros ()
 detects CARRY macros and clusters the related cells into PlacementInfo::PlacementMacro More...
 
void findMuxMacros ()
 detects Mux macros and clusters the related cells into PlacementInfo::PlacementMacro More...
 
void loadOtherCLBMacros (std::string RAMMacroListFromVivadoFileName)
 load the special macros from the design file. vendors might allow users to specify some primitive macros (e.g. cross-clock-domain register pairs and fine-grained LUTRAM macros) More...
 
void LUTFFPairing ()
 directly pack some LUTs/FFs if the LUT has only one fan-out. More...
 
void findUnpackedUnits ()
 other non-Macro elements will be instantiated as PlacementInfo::PlacementUnpackedCell More...
 
void loadFixedPlacementUnits (std::string fixedPlacementUnitsFromVivadoFileName)
 load the fixed elements (e.g., IOs) from the design file. More...
 
void enhanceIONets ()
 enhance the nets connected to the IO ports More...
 
void dumpMacroHighLight ()
 

Private Member Functions

void mapCarryRelatedRouteThru (PlacementInfo::PlacementMacro *CARRYChain, DesignInfo::DesignCell *coreCell, float CARRYChainSiteOffset)
 

Private Attributes

DesignInfodesignInfo
 
DeviceInfodeviceInfo
 
PlacementInfoplacementInfo
 
PlacementInfo::CompatiblePlacementTablecompatiblePlacementTable
 
std::vector< PlacementInfo::PlacementUnit * > & placementUnits
 
std::vector< PlacementInfo::PlacementUnpackedCell * > & placementUnpackedCells
 
std::vector< PlacementInfo::PlacementMacro * > & placementMacros
 
std::vector< PlacementInfo::PlacementUnit * > & fixedPlacementUnits
 
std::set< DesignInfo::DesignCell * > & cellInMacros
 
std::map< int, PlacementInfo::PlacementUnit * > & cellId2PlacementUnit
 
std::vector< PlacementInfo::PlacementUnit * > & cellId2PlacementUnitVec
 
std::map< std::string, std::string > & JSONCfg
 
bool DSPCritical = false
 

Detailed Description

InitialPacker will identify macros from the design netlist based on pattern matching.

Definition at line 50 of file InitialPacker.h.

Constructor & Destructor Documentation

◆ InitialPacker()

InitialPacker::InitialPacker ( DesignInfo designInfo,
DeviceInfo deviceInfo,
PlacementInfo placementInfo,
std::map< std::string, std::string > &  JSONCfg 
)
inline

Construct a new Initial Packer object.

Parameters
designInfogiven design information
deviceInfogiven device information
placementInfothe PlacementInfo for this placer to handle
JSONCfgthe user-defined placement configuration

Definition at line 61 of file InitialPacker.h.

Member Function Documentation

◆ BFSExpandViaSpecifiedPorts() [1/2]

std::vector< DesignInfo::DesignCell * > InitialPacker::BFSExpandViaSpecifiedPorts ( std::string  portPattern,
DesignInfo::DesignCell startCell,
bool  exactMatch = false 
)

BFS to find the core cells of a macro based on some pre-defined patterns of cascaded cells.

Parameters
portPatterna given set of port patterns on the element to detect cascading interconnection
startCella start cell for the search initialization
exactMatchindicate whether the portPattern should be exactly matched otherwise, containment relationship will be accepted as matched.
Returns
std::vector<DesignInfo::DesignCell *>

Definition at line 118 of file InitialPacker.cc.

Referenced by findBRAMMacros(), findCARRYMacros(), and findDSPMacros().

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

◆ BFSExpandViaSpecifiedPorts() [2/2]

std::vector< DesignInfo::DesignCell * > InitialPacker::BFSExpandViaSpecifiedPorts ( std::vector< std::string >  portPatterns,
DesignInfo::DesignCell startCell,
bool  exactMatch = false 
)

Definition at line 160 of file InitialPacker.cc.

Here is the call graph for this function:

◆ checkCompatibleFFs()

std::vector< DesignInfo::DesignCell * > InitialPacker::checkCompatibleFFs ( std::vector< DesignInfo::DesignCell * >  FFs)

check the control set of the candidate FFs and select the control set with the most FFs to be packed in the carray macro

Parameters
FFs
Returns
std::vector<DesignInfo::DesignCell *>

Definition at line 534 of file InitialPacker.cc.

Referenced by findCARRYMacros().

Here is the caller graph for this function:

◆ dumpMacroHighLight()

void InitialPacker::dumpMacroHighLight ( )

Definition at line 1744 of file InitialPacker.cc.

Referenced by pack().

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

◆ enhanceIONets()

void InitialPacker::enhanceIONets ( )

enhance the nets connected to the IO ports

Definition at line 96 of file InitialPacker.cc.

Here is the call graph for this function:

◆ findBRAMMacros()

void InitialPacker::findBRAMMacros ( )

detects BRAM macros and clusters the related cells into PlacementInfo::PlacementMacro

If two BRAMs are interconnected via their "CAS" ports, they are cascaded.

Definition at line 408 of file InitialPacker.cc.

Referenced by pack().

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

◆ findCARRYMacros()

void InitialPacker::findCARRYMacros ( )

detects CARRY macros and clusters the related cells into PlacementInfo::PlacementMacro

If two CARRYs are interconnected via their "CI" ports, they are cascaded. Moreover, the directly-connected LUTs/FFs will be fitted into the macro, after verifying the compatibility. Meanwhile, route-thru virtual elements will be added into the macro to occupy the BEL resources

Definition at line 815 of file InitialPacker.cc.

Referenced by pack().

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

◆ findDSPMacros()

void InitialPacker::findDSPMacros ( )

detects DSP macros and clusters the related cells into PlacementInfo::PlacementMacro

If two DSPs are interconnected via their "ACIN[", "BCIN[", "PCIN[" ports, they are cascaded.

Definition at line 215 of file InitialPacker.cc.

Referenced by pack().

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

◆ findLUTRAMMacros()

void InitialPacker::findLUTRAMMacros ( )

detects LUTRAM macros and clusters the related cells into PlacementInfo::PlacementMacro

Definition at line 362 of file InitialPacker.cc.

Referenced by pack().

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

◆ findMuxMacros()

void InitialPacker::findMuxMacros ( )

detects Mux macros and clusters the related cells into PlacementInfo::PlacementMacro

If two Mux are interconnected via their "I0/1" ports, they are cascaded. Moreover, the directly-connected LUTs/FFs will be fitted into the macro, after verifying the compatibility. Meanwhile, route-thru virtual elements will be added into the macro to occupy the BEL resources

Definition at line 1202 of file InitialPacker.cc.

Referenced by pack().

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

◆ findUnpackedUnits()

void InitialPacker::findUnpackedUnits ( )

other non-Macro elements will be instantiated as PlacementInfo::PlacementUnpackedCell

Definition at line 1640 of file InitialPacker.cc.

Referenced by pack().

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

◆ loadFixedPlacementUnits()

void InitialPacker::loadFixedPlacementUnits ( std::string  fixedPlacementUnitsFromVivadoFileName)

load the fixed elements (e.g., IOs) from the design file.

Parameters
fixedPlacementUnitsFromVivadoFileNamea given design file indicate the fixed elements and their locations on the device

Definition at line 1671 of file InitialPacker.cc.

Referenced by pack().

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

◆ loadOtherCLBMacros()

void InitialPacker::loadOtherCLBMacros ( std::string  RAMMacroListFromVivadoFileName)

load the special macros from the design file. vendors might allow users to specify some primitive macros (e.g. cross-clock-domain register pairs and fine-grained LUTRAM macros)

Parameters
RAMMacroListFromVivadoFileNamea given design file indicate the special CLB macros in the design

Definition at line 1448 of file InitialPacker.cc.

Referenced by pack().

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

◆ LUTFFPairing()

void InitialPacker::LUTFFPairing ( )

directly pack some LUTs/FFs if the LUT has only one fan-out.

According to our observation, this might not significantly improve the HPWL but it can help to get better timing.

Definition at line 1564 of file InitialPacker.cc.

Referenced by pack().

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

◆ mapCarryRelatedRouteThru()

void InitialPacker::mapCarryRelatedRouteThru ( PlacementInfo::PlacementMacro CARRYChain,
DesignInfo::DesignCell coreCell,
float  CARRYChainSiteOffset 
)
private

Definition at line 592 of file InitialPacker.cc.

Referenced by findCARRYMacros().

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

◆ pack()

void InitialPacker::pack ( )

extract the macros from the netlist to construction PlacmentMacro

Definition at line 28 of file InitialPacker.cc.

Referenced by AMFPlacer::run().

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

◆ setDSPRegs()

void InitialPacker::setDSPRegs ( std::vector< DesignInfo::DesignCell * > &  DSPTailsToBeCheckedRegisterAttr)

Definition at line 307 of file InitialPacker.cc.

Referenced by findDSPMacros().

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

Member Data Documentation

◆ cellId2PlacementUnit

◆ cellId2PlacementUnitVec

std::vector<PlacementInfo::PlacementUnit *>& InitialPacker::cellId2PlacementUnitVec
private

Definition at line 363 of file InitialPacker.h.

◆ cellInMacros

◆ compatiblePlacementTable

◆ designInfo

◆ deviceInfo

DeviceInfo* InitialPacker::deviceInfo
private

Definition at line 352 of file InitialPacker.h.

Referenced by loadFixedPlacementUnits(), and loadOtherCLBMacros().

◆ DSPCritical

bool InitialPacker::DSPCritical = false
private

Definition at line 365 of file InitialPacker.h.

Referenced by findDSPMacros(), and InitialPacker().

◆ fixedPlacementUnits

std::vector<PlacementInfo::PlacementUnit *>& InitialPacker::fixedPlacementUnits
private

Definition at line 359 of file InitialPacker.h.

Referenced by loadFixedPlacementUnits().

◆ JSONCfg

std::map<std::string, std::string>& InitialPacker::JSONCfg
private

Definition at line 364 of file InitialPacker.h.

Referenced by dumpMacroHighLight(), InitialPacker(), and pack().

◆ placementInfo

PlacementInfo* InitialPacker::placementInfo
private

Definition at line 353 of file InitialPacker.h.

Referenced by dumpMacroHighLight(), enhanceIONets(), and pack().

◆ placementMacros

std::vector<PlacementInfo::PlacementMacro *>& InitialPacker::placementMacros
private

◆ placementUnits

◆ placementUnpackedCells

std::vector<PlacementInfo::PlacementUnpackedCell *>& InitialPacker::placementUnpackedCells
private

Definition at line 357 of file InitialPacker.h.

Referenced by findUnpackedUnits(), LUTFFPairing(), and pack().


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