public class Module
extends Object
implements Serializable
SiteInst
and Net
objects
that can be instantiated as a ModuleInst
. It serves as the
prototype for a pre-implemented module.Modifier and Type | Field and Description |
---|---|
static int |
_placement_failed_anchor_error |
static int |
_placement_failed_anchor_null |
static int |
_placement_failed_corresponding_site |
static int |
_placement_failed_corresponding_tile |
static boolean |
_placement_failed_debug |
static int |
_placement_failed_instance_at_site |
static int |
_placement_failed_pip_mismatch |
static String |
CLK_MACRO_SUFFIX |
static String |
INPUT_FF_MACRO_SUFFIX |
static String |
INPUT_LUT_MACRO_SUFFIX |
static String |
INPUT_PORT_INNER_SUFFIX |
static String |
INPUT_PORT_SUFFIX |
static String |
OUTPUT_FF_MACRO_SUFFIX |
static String |
OUTPUT_LUT_MACRO_SUFFIX |
static String |
OUTPUT_PORT_INNER_SUFFIX |
static String |
OUTPUT_PORT_SUFFIX |
Constructor and Description |
---|
Module()
Empty constructor, strings are null, everything else is initialized
|
Module(Design design)
Create a new module based on a design
|
Module(Design design,
boolean unrouteStaticNets)
Create a new module based on a design
|
Module(Design design,
String metadataFileName)
Create a new module based on the provided design and metadata file.
|
Module(Design design,
String metadataFileName,
boolean unrouteStaticNets)
Create a new module based on the provided design and metadata file.
|
Modifier and Type | Method and Description |
---|---|
void |
addCell(Cell c)
Adds a cell to the module
|
void |
addClock(String name,
float period)
Adds a new clock to the module by name and period constraint
|
void |
addInst(SiteInst inst)
Adds an instance to this module.
|
void |
addNet(Net net)
Adds a net to this module.
|
void |
addPort(Port port)
Adds a port to this module.
|
void |
addValidPlacement(Site compatibleAnchorSite)
Explicitly add a valid placement for the module on the
given device.
|
ArrayList<Site> |
calculateAllValidPlacements(Device dev)
Does a brute force search to find all valid locations of where this module
can be placed.
|
void |
disconnectDesign()
Sets the design in all the module's instances to null
|
boolean |
equals(Object obj) |
ArrayList<Site> |
getAllValidPlacements()
Gets the previously calculated valid placement locations for this particular module.
|
Site |
getAnchor()
This gets and returns the instance anchor of the module.
|
RelocatableTileRectangle |
getBoundingBox()
Get the Bounding Box of all SiteInsts in this Module
The Bounding Box is calculated once and cached for future calls of this method.
|
Cell |
getCell(String cellName)
Gets the named cell from the module
|
HashMap<String,Float> |
getClocks()
Gets a map of clocks and their period constraints in nanoseconds.
|
Tile |
getCorrespondingAnchorTile(Tile templateTile,
Tile newTile,
Device dev)
This method allows calculates the proposed anchor tile if the templateTile within the module
is placed at the newTile location.
|
Site |
getCorrespondingSite(SiteInst inst,
Site anchorSite)
Get the corresponding Site of the given SiteInst if the module is relocated.
|
Tile |
getCorrespondingTile(Tile templateTile,
Tile newAnchorTile)
This method will calculate and return the corresponding tile of a module
for a new anchor location.
|
static Tile |
getCorrespondingTile(Tile templateTile,
Tile newAnchorTile,
Tile originalAnchor)
This method will calculate and return the corresponding tile of a module
for a new anchor location for a given anchor location.
|
static Tile |
getCorrespondingTile(Tile templateTile,
Tile newAnchorTile,
Tile originalAnchor,
Tile[][] tiles)
This method will calculate and return the corresponding tile of a module for
a new anchor location for a given anchor location.
|
Device |
getDevice()
Gets the device object used by this module
|
int |
getImplementationIndex() |
Map<String,String> |
getMetaDataMap() |
float |
getMinClkPeriod() |
String |
getName()
Gets and returns the current name of this module
|
Net |
getNet(String name)
Gets and returns the net in the module called name.
|
EDIFNetlist |
getNetlist()
Gets the module's corresponding logical EDIF netlist
|
Collection<Net> |
getNets()
Gets and returns all the nets that are part of the module.
|
NOCDesign |
getNOCDesign()
Gets the current NOC Design corresponding to this module
|
PBlock |
getPBlock()
Gets the stored pblock used to create the module (if any)
|
String |
getPBlockString()
Gets the stored pblock String used to create the module (if any)
|
Port |
getPort(String name)
Returns the port with the given name.
|
Collection<Port> |
getPorts()
Gets and returns the port list for this module.
|
SiteInst |
getSiteInst(String name)
Gets and returns the instance in the module called name.
|
SiteInst |
getSiteInstAtSite(Site site)
Gets the module site instance at the specified site
|
Collection<SiteInst> |
getSiteInsts()
Gets and returns all of the instances part of this module.
|
String |
getSrcDatFile()
Gets the .dat filename used to populate this module
|
int |
getTileFootprintSize()
Returns the total number of tiles occupied by this module (sites and PIPs)
|
int |
hashCode() |
boolean |
isValidPlacement(Site proposedAnchorSite,
Design design)
Checks if the new proposed anchor site on this module is compatible with all of its
internal sites.
|
void |
removeNet(Net net)
Removes a net from the design
|
void |
removeNet(String name)
Removes a net from the design
|
boolean |
removeSiteInst(SiteInst instance)
This method carefully removes an instance in a design with its
pins and possibly nets.
|
boolean |
removeSiteInst(String name)
This method carefully removes an instance in a design with its
pins and possibly nets.
|
static void |
reportValidPlacementStats()
A debug reporting mechanism that will print stats on reasons
for attempted placement failures.
|
void |
setAnchor(Site anchor)
Sets the anchor instance for this module.
|
void |
setClocks(HashMap<String,Float> clocks)
Sets a map of clocks and their period constraints in nanoseconds.
|
void |
setDevice(Device dev)
Sets the specified device for this module
|
void |
setImplementationIndex(int implementationIndex) |
void |
setMetaDataMap(HashMap<String,String> metaDataMap) |
void |
setMinClkPeriod(float minClkPeriod) |
void |
setName(String name)
Sets the name of this module
|
void |
setNetlist(EDIFNetlist netlist)
Sets the netlist for the module
|
void |
setNOCDesign(NOCDesign nocDesign)
Sets the NOC Design containing client metadata for the module
|
void |
setPBlock(PBlock pblock)
Allows the user to store the pblock used to create the module
|
void |
setPBlock(String pblock)
Allows the user to store the pblock used to create the module from String
representation
|
void |
setPorts(ArrayList<Port> portList)
Sets the port list for this module.
|
void |
setSrcDatFile(String srcDatFile)
Sets the .dat filename used to populate this module
|
void |
setValidPlacements(ArrayList<Site> placements)
Manually set the valid placements for this module.
|
String |
toString() |
public static final String INPUT_PORT_SUFFIX
public static final String INPUT_PORT_INNER_SUFFIX
public static final String OUTPUT_PORT_SUFFIX
public static final String OUTPUT_PORT_INNER_SUFFIX
public static final String CLK_MACRO_SUFFIX
public static final String INPUT_FF_MACRO_SUFFIX
public static final String OUTPUT_FF_MACRO_SUFFIX
public static final String INPUT_LUT_MACRO_SUFFIX
public static final String OUTPUT_LUT_MACRO_SUFFIX
public static int _placement_failed_anchor_null
public static int _placement_failed_anchor_error
public static int _placement_failed_corresponding_tile
public static int _placement_failed_corresponding_site
public static int _placement_failed_instance_at_site
public static int _placement_failed_pip_mismatch
public static boolean _placement_failed_debug
public Module()
public Module(Design design, String metadataFileName)
design
- The prototype design to use for the modulemetadataFileName
- The associated metadata file (created from the Tcl command in rapidwright.tcl/generate_metadata() ).public Module(Design design, String metadataFileName, boolean unrouteStaticNets)
design
- The prototype design to use for the modulemetadataFileName
- The associated metadata file (created from the Tcl command in rapidwright.tcl/generate_metadata() ).unrouteStaticNets
- A flag denoting if Vcc and Gnd nets should be unrouted.public Module(Design design)
design
- The prototype designpublic Module(Design design, boolean unrouteStaticNets)
design
- The prototype designunrouteStaticNets
- A flag denoting if Vcc and Gnd nets should be unrouted.public void setName(String name)
name
- New name for this modulepublic String getName()
public Site getAnchor()
public int getImplementationIndex()
public void setImplementationIndex(int implementationIndex)
implementationIndex
- the implementationIndex to setpublic SiteInst getSiteInst(String name)
name
- Name of the instance in the module to get.public Collection<SiteInst> getSiteInsts()
public Net getNet(String name)
name
- Name of the net in the module to get.public Collection<Net> getNets()
public void removeNet(String name)
name
- The name of the net to remove.public void removeNet(Net net)
net
- The net to remove from the design.public boolean removeSiteInst(String name)
name
- The instance name in the module to remove.public boolean removeSiteInst(SiteInst instance)
instance
- The instance in the design to remove.public void setAnchor(Site anchor)
anchor
- New anchor Site for this module.public Collection<Port> getPorts()
public void setPorts(ArrayList<Port> portList)
portList
- The new port list to be set for this module.public void addPort(Port port)
port
- The new port to add.public Port getPort(String name)
name
- the port's namepublic void addNet(Net net)
net
- The net to add to the module.public void addInst(SiteInst inst)
inst
- The instance to add to the module.public Map<String,String> getMetaDataMap()
public void setMetaDataMap(HashMap<String,String> metaDataMap)
metaDataMap
- the metaDataMap to setpublic void setMinClkPeriod(float minClkPeriod)
minClkPeriod
- the minClkPeriod to setpublic float getMinClkPeriod()
public void disconnectDesign()
public SiteInst getSiteInstAtSite(Site site)
site
- The site of interestpublic ArrayList<Site> calculateAllValidPlacements(Device dev)
public ArrayList<Site> getAllValidPlacements()
com.xilinx.rapidwright.design.Cell#getCompatiblePlacements()
public void setValidPlacements(ArrayList<Site> placements)
placements
- The list of valid placements to be set for this module.public int getTileFootprintSize()
public static void reportValidPlacementStats()
Module._placement_failed_debug
must
be set to true.public boolean isValidPlacement(Site proposedAnchorSite, Design design)
proposedAnchorSite
- The proposed new anchor sitedesign
- OPTIONAL - if non-null, will check against currently placed sites (TODO, also should check against PIPs)public Tile getCorrespondingTile(Tile templateTile, Tile newAnchorTile)
templateTile
- The tile in the module which acts as a template.newAnchorTile
- This is the tile of the new anchor instance of the module.public static Tile getCorrespondingTile(Tile templateTile, Tile newAnchorTile, Tile originalAnchor, Tile[][] tiles)
Module.getCorrespondingTile(Tile, Tile, Tile)
when doing many relocations of the same template. Calling code needs to cache
the return value of
newAnchorTile.getDevice().getTilesByRootName(templateTile.getRootName())
and supply it as parameter tiles
.templateTile
- The tile in the module which acts as a template.newAnchorTile
- This is the tile of the new anchor instance of the
module.originalAnchor
- Location of the anchor origin.tiles
- The Tiles with the same Name Root as
templateTile
, as returned by
Device.getTilesByRootName(String)
public static Tile getCorrespondingTile(Tile templateTile, Tile newAnchorTile, Tile originalAnchor)
Module.getCorrespondingTile(Tile, Tile, Tile, Tile[][])
templateTile
- The tile in the module which acts as a template.newAnchorTile
- This is the tile of the new anchor instance of the module.originalAnchor
- Location of the anchor origin.public Tile getCorrespondingAnchorTile(Tile templateTile, Tile newTile, Device dev)
templateTile
- The tile within the module to act as reference.newTile
- The proposed place to move the templateTile to.dev
- The current device.public Site getCorrespondingSite(SiteInst inst, Site anchorSite)
inst
- The SiteInst to relocateanchorSite
- The target location of the module anchor.public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
public String toString()
toString
in class Object
public void addCell(Cell c)
c
- The cell to addpublic Cell getCell(String cellName)
cellName
- Name of the cell to getpublic Device getDevice()
public void setDevice(Device dev)
dev
- The desired device for this modulepublic EDIFNetlist getNetlist()
public void setNetlist(EDIFNetlist netlist)
netlist
- The desired netlist for the modulepublic void setNOCDesign(NOCDesign nocDesign)
nocDesign
- The NOC design for the modulepublic NOCDesign getNOCDesign()
public PBlock getPBlock()
public String getPBlockString()
public void setPBlock(String pblock)
pblock
- The pblock used to create the modulepublic void setPBlock(PBlock pblock)
pblock
- The pblock used to create the modulepublic HashMap<String,Float> getClocks()
public void setClocks(HashMap<String,Float> clocks)
clocks
- Map of clock names to period constraints in nanosecondspublic void addClock(String name, float period)
name
- Name of the clock to addperiod
- Clock period constraint in nanosecondspublic void addValidPlacement(Site compatibleAnchorSite)
compatibleAnchorSite
- The anchor site for the valid location.public String getSrcDatFile()
public void setSrcDatFile(String srcDatFile)
srcDatFile
- The .dat filename used to populate this modulepublic RelocatableTileRectangle getBoundingBox()