public class Design
extends Object
implements Serializable
Modifier and Type | Field and Description |
---|---|
static String |
RW_AUTO_GENERATE_READABLE_EDIF
Name of the environment variable that controls the auto generation of readable EDIF
mechanism.
|
Constructor and Description |
---|
Design()
Constructor which initializes all member data structures.
|
Design(EDIFNetlist n)
Creates a new design and populates the logical netlist from the provided
EDIFNetlist.
|
Design(String designName,
String partName)
Creates a new design and populates it with the given design name and
part name.
|
Modifier and Type | Method and Description |
---|---|
BELAttr |
addBELAttr(Net net,
Site site,
SiteTypeEnum type,
BEL bel,
String name,
String value)
Adds a BEL attribute on the net provided
|
Cell |
addCell(Cell c)
Adds the cell to the design.
|
void |
addManuallyRoutedSite(String siteName) |
boolean |
addModifiedNet(Net net)
Adds the Net to the set of modified Nets for this design.
|
boolean |
addModifiedSiteInst(SiteInst siteInst)
Adds the SiteInst to the set of modified SiteInsts for this design.
|
void |
addModule(Module module)
Adds a module to the design, including copying the module's netlist
into the current design's netlist (using
EDIFNetlist.copyCellAndSubCells(com.xilinx.rapidwright.edif.EDIFCell) ). |
void |
addModuleImpls(ModuleImpls modImpls)
Adds a list of modules with different implementations (ModuleImpls) to preserve order
|
EDIFCellInst |
addModuleInstNetlist(ModuleInst mi,
EDIFNetlist edifGuts)
Adds the EDIF netlist guts to the existing netlist for a particular module instance.
|
Net |
addNet(Net net)
Attaches a net to the design by mapping the hierarchical name to
the Net object.
|
boolean |
addPartitionPin(PartitionPin pin)
Adds a partition pin to this design
|
void |
addSiteInst(SiteInst inst)
Adds a site instance to the design.
|
void |
addXDCConstraint(ConstraintGroup cg,
String... xdc)
Adds the XDC command(s) to the list of the provided
ConstraintGroup . |
void |
addXDCConstraint(String... xdc)
Adds the XDC command to the list of (Normal, see
ConstraintGroup )
XDC commands for this design. |
void |
clearTrackedChanges()
Clears (empties) all tracked sets (logical cells, SiteInsts and Nets)
|
void |
clearUsedSites()
Clears out all the used sites in the design.
|
Cell |
copyCell(Cell c,
String instName)
Copies the cell c into this design (c should originate from a different design).
|
void |
copyPartitionPins(Design source,
ModuleInst dest,
Map<EDIFPort,EDIFPort> portMap)
Copy PartitionPins from a design to its ModuleInst in this design.
|
Cell |
createAndPlaceCell(EDIFCell parent,
String name,
Unisim cellType,
Site site,
BEL bel)
Convenience function to create and place a new cell.
|
Cell |
createAndPlaceCell(EDIFCell parent,
String name,
Unisim cellType,
Site site,
BEL bel,
String... params)
Convenience function to create and place a new cell.
|
Cell |
createAndPlaceCell(EDIFCell parent,
String name,
Unisim cellType,
String location)
Creates a new cell from scratch in the logical and physical netlists and places it at
the location specified.
|
Cell |
createAndPlaceCell(EDIFCell parent,
String name,
Unisim cellType,
String location,
String... params)
Creates a new cell from scratch in the logical and physical netlists and places it at
the location specified.
|
Cell |
createAndPlaceCell(String name,
Unisim cellType,
String location)
Creates a new cell from scratch in the logical and physical netlists and
places it at the location specified.
|
Cell |
createAndPlaceCell(String name,
Unisim cellType,
String location,
String... params)
Creates a new cell from scratch in the logical and physical netlists and places it at
the location specified.
|
Cell |
createAndPlaceIOB(String name,
PinType dir,
String pkgPin,
String ioStandard)
Creates either an IBUF or OBUF in the netlist and places according to the provided
package pin.
|
Cell |
createAndPlaceIOB(String name,
PinType dir,
String pkgPin,
String ioStandard,
Net portNet,
EDIFNet logNet)
Creates either an IBUF or OBUF in the netlist and places according to the provided
package pin.
|
Cell |
createBUFGCE(EDIFCell parent,
String name,
Site location)
Creates a new BUFGCE instance in the parent cell provided and places it at location.
|
Cell |
createCell(String instName,
EDIFCell reference)
Creates and adds a new cell instance to the top level of the design.
|
Cell |
createCell(String instName,
EDIFCellInst instance)
Creates a physical cell object from an existing logical cell instance in the
netlist.
|
Cell |
createCell(String instName,
Unisim unisim)
Creates and adds a new cell instance to the top level of the design.
|
EDIFCellInst |
createIBUFDS(String portNameP,
String portNameN,
Site siteP,
Site siteN,
Net portNet,
EDIFNet logNet,
String ioStandard)
This method will create a generic IBUFDS instance (DIFFINBUF+IBUFCTRL) at the top level of a design.
|
ModuleInst |
createModuleInst(String name,
Module module)
Creates, adds to design, and returns a new
ModuleInst called name and based on module.
|
ModuleInst |
createModuleInst(String name,
Module module,
boolean includePortRouting)
Creates, adds to design, and returns a new
ModuleInst called name and based on module.
|
Net |
createNet(EDIFHierNet net)
Creates a physical net from a logical hierarchical net.
|
Net |
createNet(String netName)
Creates both the logical and physical net objects for the
given name.
|
EDIFCellInst |
createOrFindEDIFCellInst(String name,
EDIFCell cell)
Create or find a EDIFCellInst of the specified name.
|
PartitionPin |
createPartitionPin(EDIFHierPortInst pin,
Node node)
Creates a new partition pin and adds it to the design
|
PartitionPin |
createPartitionPin(EDIFPort port,
int index,
Node node)
Creates a new partition pin from a top cell port and adds it to the design
|
PartitionPin |
createPartitionPin(EDIFPort port,
Node node)
Creates a new partition pin from a top cell port and adds it to the design
|
SiteInst |
createSiteInst(Site site)
Convenience site instance creator for a given site.
|
SiteInst |
createSiteInst(String siteName)
Convenience site instance creator for a given site.
|
SiteInst |
createSiteInst(String name,
SiteTypeEnum type,
Site placement)
Creates a new site instance in the design.
|
static EDIFCellInst |
createUnisimInst(EDIFCell parent,
String name,
Unisim cellType)
Create a unisim EDIF cell instance.
|
void |
detachNetlist()
Removes all references to the EDIFNetlist.
|
void |
detachNetlist(Predicate<Cell> preserveCellProperties)
Removes all references to the EDIFNetlist.
|
void |
flattenDesign()
If there are any module instances in the design, this flattens
them so there are no references to modules or module instances.
|
Map<Site,SiteConfig> |
getBELAttrs()
Get the BEL attribute mappings for this design
|
Cell |
getCell(String name)
Gets a cell by name from the instance
|
Collection<Cell> |
getCells()
Gets all the cells in the design (unlike @link{SiteInst#getCells()}, routethrus are not included)
|
static Map<String,VivadoProp> |
getDefaultCellProperties(Series series,
String cellTypeName)
Returns a map of all default cell properties for the specified cell.
|
static VivadoProp |
getDefaultProperty(Series series,
String cellTypeName,
String propName)
Gets the default property (type and value) for the specified cell and property name.
|
Device |
getDevice()
Gets the device specific to this part and returns it.
|
Net |
getGndNet()
Get the global ground net called
|
static EDIFLibrary |
getMacroPrimitives(Series s)
Gets the logical (EDIF) representation of the macro primitives
supported by this architecture.
|
Set<String> |
getManuallyRoutedSites() |
Set<Net> |
getModifiedNets()
Gets the set of modified Nets for this design.
|
Set<SiteInst> |
getModifiedSiteInsts()
Gets the set of modified SiteInsts for this design.
|
Module |
getModule(String name)
Get a module by name.
|
Module |
getModule(String name,
int implementationIndex)
Get's a specific implementation of a module
|
ModuleInst |
getModuleInst(String name)
Gets and returns the moduleInst called name.
|
HashMap<String,ModuleInst> |
getModuleInstMap()
Gets and returns the HashMap of all of the module instance members separated by
module instance name.
|
Collection<ModuleInst> |
getModuleInsts()
Gets and returns the Collection of all of the module instances in this design.
|
Set<String> |
getModuleNames()
Get all module names
|
Collection<ModuleImpls> |
getModules()
Gets and returns all of the modules of the design.
|
String |
getName()
Gets and returns the current name of the design.
|
Net |
getNet(String name)
Get a net by name.
|
EDIFNetlist |
getNetlist()
Get the logical netlist object corresponding to this design.
|
Collection<Net> |
getNets()
Gets and returns all of the nets of the design.
|
NOCDesign |
getNOCDesign()
Gets the current NOC Design for this design
|
Map<String,List<PIP>> |
getOriginalNetRouting()
Gets a map of all the original net routing PIPs of nets that have been
modified since
Design.isCopyingOriginalNetsRouting() returns true. |
Map<String,SiteInst> |
getOriginalSiteInsts()
Gets a map of all the original SiteInst objects that have been modified since
Design.isCopyingOriginalSiteInsts() returns true. |
Part |
getPart()
Gets the part object this design is targeting.
|
List<PartitionPin> |
getPartitionPins()
Gets the partition pins associated with this design
|
String |
getPartName()
This will return the canonical part name used within Vivado.
|
static String |
getPartNameFromDCP(Path dcpFileName)
Gets the part name of the design in the DCP file specified without loading
the entire DCP or the associated device.
|
static String |
getPartNameFromDCP(String dcpFileName)
Gets the part name of the design in the DCP file specified without loading
the entire DCP or the associated device.
|
static EDIFLibrary |
getPrimitivesLibrary()
Gets the set of all unisim primitives as an EDIF library.
|
static EDIFLibrary |
getPrimitivesLibrary(String deviceName)
Gets the set of compatible unisim primitives for the specified device as an EDIF Library.
|
Series |
getSeries()
Gets the Series of this design by looking at the target device.
|
SiteInst |
getSiteInst(String name)
Get an instance by name.
|
SiteInst |
getSiteInstFromSite(Site site)
Gets and returns the site instance placed on the specified site.
|
SiteInst |
getSiteInstFromSiteName(String siteName)
Gets and returns the site instance at the specified site.
|
Collection<SiteInst> |
getSiteInsts()
Gets and returns all of the instance in the design.
|
Net |
getStaticNet(NetType type)
Get the global static net or
based on the
NetType . |
EDIFCell |
getTopEDIFCell()
Gets the top logical cell from the netlist.
|
static EDIFCell |
getUnisimCell(Unisim cell)
Gets the Unisim primitive cell.
|
Net |
getVccNet()
Get the global power net called
|
List<String> |
getXDCConstraints(ConstraintGroup cg)
Gets a list of strings that correspond to lines of an XDC
file for the design.
|
static boolean |
isAutoGenerateReadableEdif()
Check if Vivado should be automatically run during
Design.readCheckpoint(Path) to generate
readable EDIFs. |
boolean |
isAutoIOBuffersSet()
Checks the setting on this design for its behavior related auto I/O
buffer instantiation when the design is loaded in Vivado.
|
boolean |
isCopyingOriginalNetsRouting()
Gets and returns the flag indicating if the design is keeping a copy of a
net's PIPs before it is modified.
|
boolean |
isCopyingOriginalSiteInsts()
Gets and returns the flag indicating if the design is keeping a copy of a
SiteInst before it is modified.
|
boolean |
isDesignOutOfContext()
Checks if the design is labeled as an out-of-context design for Vivado.
|
boolean |
isSiteUsed(Site site)
Checks if the site is used in this design.
|
boolean |
isTrackingNetChanges()
Checks a flag indicating if this design is currently tracking changes to its Nets.
|
boolean |
isTrackingSiteInstChanges()
Checks a flag indicating if this design is currently tracking changes to its SiteInsts.
|
void |
movePinsToNewNetDeleteOldNet(Net oldNet,
Net newNet,
boolean keepRouting)
The method will take the pins on the oldNet and move them to the newNet.
|
boolean |
placeCell(Cell c,
Site site,
BEL bel)
This is a limited checking placement method for placing a cell on a BEL site.
|
boolean |
placeCell(Cell c,
Site site,
BEL bel,
Map<String,String> pinMappings)
This is a limited checking placement method for placing a cell on a BEL site.
|
boolean |
placeCells(Map<String,String> desiredCellPlacements)
Places a set of cells according to the map provided.
|
Cell |
placeIOB(EDIFCellInst bufInst,
String pkgPin,
String ioStandard)
Places an existing IBUF or OBUF in the netlist according to the provided
package pin.
|
static Design |
readCheckpoint(Path dcpFileName)
Reads a design checkpoint file into a new design object.
|
static Design |
readCheckpoint(Path dcpFileName,
boolean skipXdef)
Reads a design checkpoint file into a new design object.
|
static Design |
readCheckpoint(Path dcpFileName,
CodePerfTracker t)
Reads a design checkpoint file into a new design object.
|
static Design |
readCheckpoint(Path dcpFileName,
Path edfFileName)
Reads a design checkpoint file into a new design object.
|
static Design |
readCheckpoint(Path dcpFileName,
Path edfFileName,
boolean skipXdef,
CodePerfTracker t)
Reads a design checkpoint file into a new design object.
|
static Design |
readCheckpoint(Path dcpFileName,
Path edfFileName,
CodePerfTracker t)
Reads a design checkpoint file into a new design object.
|
static Design |
readCheckpoint(String dcpFileName)
Reads a design checkpoint file into a new design object.
|
static Design |
readCheckpoint(String dcpFileName,
boolean skipXdef)
Reads a design checkpoint file into a new design object.
|
static Design |
readCheckpoint(String dcpFileName,
CodePerfTracker t)
Reads a design checkpoint file into a new design object.
|
static Design |
readCheckpoint(String dcpFileName,
String edfFileName)
Reads a design checkpoint file into a new design object.
|
static Design |
readCheckpoint(String dcpFileName,
String edfFileName,
CodePerfTracker t)
Reads a design checkpoint file into a new design object.
|
static boolean |
readEdifAndXdefInParallel()
Check if
Design.readCheckpoint(Path) is encouraged to read Edif and XDEF (placement
and routing information) in parallel. |
Cell |
removeCell(Cell c)
Removes the cell of the same name
|
Cell |
removeCell(String name)
Removes the cell by its hierarchical name.
|
Net |
removeNet(Net net)
Removes a net from the design and associated routing.
|
Net |
removeNet(String name)
Removes a net from the design
|
boolean |
removePartitionPin(PartitionPin pin)
Removes a partition pin from this design
|
boolean |
removeSiteInst(SiteInst instance)
This method carefully removes an instance in a design with its
pins and possibly nets.
|
boolean |
removeSiteInst(SiteInst instance,
boolean keepSitePinRouting)
This method carefully removes an instance in a design with its
pins and possibly nets.
|
boolean |
renameSiteInst(SiteInst inst,
String newName)
Renames a SiteInst, checks if an existing site already has the new desired name.
|
static boolean |
replaceEDIFinDCP(String dcpFileName,
String edfFileName)
Replaces the existing EDIF file inside a DCP with the one provided and ensures that it will
be loaded when the DCP is read by Vivado.
|
static boolean |
replaceEDIFinDCP(String inDcpFileName,
String edfFileName,
String outDcpFileName)
Create a new DCP but overwriting the EDIF file from the input DCP with
the one provided and ensures that it will be loaded when the DCP is read by Vivado.
|
void |
repopulateNetlistOfModuleInst(ModuleInst modInst,
EDIFNetlist edifGuts)
For a module instance, inserts the logical netlist into the main EDIF netlist.
|
void |
repopulateNetlistOfModuleInst(String modInstName,
EDIFNetlist edifGuts)
For a module instance, inserts the logical netlist into the main EDIF netlist.
|
boolean |
retargetPart(Part targetPart,
int tileXOffset,
int tileYOffset)
Changes the current target part to another compatible part and updates all
device-related references accordingly.
|
void |
routeSites()
Iterates through all non-empty site instances and invokes the
routeSite() method on each one.
|
static void |
setAutoGenerateReadableEdif(boolean autoGenerateReadableEdif)
Set whether to automatically run Vivado during
Design.readCheckpoint(Path) to generate
readable EDIFs |
void |
setAutoIOBuffers(boolean val)
Updates the design such that if a DCP is created and read into
Vivado, if it is to automatically instantiate I/Os for top level
ports not already connected to I/Os.
|
void |
setCopyingOriginalNetsRouting(boolean copyOrigNets)
Sets the flag indicating if the design is to keep a copy of a net's routing
before it is modified.
|
void |
setCopyingOriginalSiteInsts(boolean copyOrigSiteInsts)
Sets the flag indicating if the design is to keep a copy of a net's routing
before it is modified.
|
void |
setDesignOutOfContext(boolean val)
Updates the design to be set or unset as out of context for Vivado.
|
void |
setName(String name)
Sets the name of the design
|
void |
setNetlist(EDIFNetlist netlist)
Sets the logical netlist for this design.
|
void |
setNOCDesign(NOCDesign nocDesign)
Sets the NOC Design for this design
|
void |
setPartName(String partName)
Sets the part name (see
Part ), for the design. |
static void |
setReadEdifAndXdefInParallel(boolean readEdifAndXdefInParallel)
Set whether
Design.readCheckpoint(Path) is encouraged to read Edif and XDEF (placement
and routing information) in parallel. |
void |
setTrackingChanges(boolean trackChanges)
Global design setting that enables or disable tracking of modified EDIFCells, SiteInsts and
physical Nets.
|
void |
setTrackNetChanges(boolean trackNetChanges)
Flag to track changes to Nets in this design.
|
void |
setTrackSiteInstChanges(boolean trackSiteInstChanges)
Flag to track changes to SiteInst in this design.
|
List<String> |
setXDCConstraints(List<String> xdc,
ConstraintGroup cg)
Sets (overwrites) the XDC commands for this design
with those provided.
|
String |
toString() |
void |
trimPartitionPins(Pair<Tile,Tile> range)
Remove excess routing from all Partition pins beyond the first node within a tile range.
|
void |
unplaceDesign()
Will unroute and unplace the design, no site information will be retained.
|
void |
unrouteDesign()
Unroutes the current design by removing all PIPs.
|
void |
unrouteSites()
Removes all site routing from all instantiated sites in the design.
|
void |
updateDesignWithCheckpointPlaceAndRoute(Path dcpFileName)
Applies the placement and routing of the provided DCP to the netlist
given in this design.
|
void |
updateDesignWithCheckpointPlaceAndRoute(String dcpFileName)
Applies the placement and routing of the provided DCP to the netlist
given in this design.
|
void |
writeCheckpoint(Path dcpFileName)
Writes a design checkpoint file from the current state of the design.
|
void |
writeCheckpoint(Path dcpFileName,
CodePerfTracker t)
Writes a design checkpoint file from the current state of the design.
|
void |
writeCheckpoint(Path dcpFileName,
Path edfFileName,
CodePerfTracker t)
Writes a design checkpoint file from the current state of the design, but
optionally using a previously-written EDIF netlist file rather than creating
a new one.
|
void |
writeCheckpoint(String dcpFileName)
Writes a design checkpoint file from the current state of the design.
|
void |
writeCheckpoint(String dcpFileName,
CodePerfTracker t)
Writes a design checkpoint file from the current state of the design.
|
void |
writeCheckpoint(String dcpFileName,
String edfFileName,
CodePerfTracker t)
Writes a design checkpoint file from the current state of the design, but
optionally using a previously-written EDIF netlist file rather than creating
a new one.
|
public static final String RW_AUTO_GENERATE_READABLE_EDIF
public Design()
public Design(String designName, String partName)
designName
- The name of the newly created design.deviceName
- The target part name of the newly created design.public Design(EDIFNetlist n)
n
- The netlist to populate the new design object.public static boolean isAutoGenerateReadableEdif()
Design.readCheckpoint(Path)
to generate
readable EDIFs. True by default.public static void setAutoGenerateReadableEdif(boolean autoGenerateReadableEdif)
Design.readCheckpoint(Path)
to generate
readable EDIFspublic static boolean readEdifAndXdefInParallel()
Design.readCheckpoint(Path)
is encouraged to read Edif and XDEF (placement
and routing information) in parallel. True by default.
Parallelism within the Edif or XDEF parsers are unaffected by this setting;
this controls whether both parsers are allowed to be run simultaneously.public static void setReadEdifAndXdefInParallel(boolean readEdifAndXdefInParallel)
Design.readCheckpoint(Path)
is encouraged to read Edif and XDEF (placement
and routing information) in parallel.
Parallelism within the Edif or XDEF parsers are unaffected by this setting;
this controls whether both parsers are allowed to be run simultaneously.public static Design readCheckpoint(Path dcpFileName)
()
is set, Run Vivado to create a readable EDIF file of the same name in the same directory as the DCPVivado Tcl:
open_checkpoint $dcpFileName
dcpFileName
- Name of the DCP to load.public static Design readCheckpoint(String dcpFileName)
()
is set, Run Vivado to create a readable EDIF file of the same name in the same directory as the DCPVivado Tcl:
open_checkpoint $dcpFileName
dcpFileName
- Name of the DCP to load.public static Design readCheckpoint(Path dcpFileName, CodePerfTracker t)
()
is set, Run Vivado to create a readable EDIF file of the same name in the same directory as the DCPDesign.readCheckpoint(Path)
except allows you to control the
CodePerfTracker
that is used during the DCP loading process.
Vivado Tcl:
open_checkpoint $dcpFileName
dcpFileName
- Name of the DCP file.t
- The CodePerfTracker
instance to use, can be null and a unique
one will be created.public static Design readCheckpoint(String dcpFileName, CodePerfTracker t)
()
is set, Run Vivado to create a readable EDIF file of the same name in the same directory as the DCPDesign.readCheckpoint(String)
except allows you to control the
CodePerfTracker
that is used during the DCP loading process.
Vivado Tcl:
open_checkpoint $dcpFileName
dcpFileName
- Name of the DCP file.t
- The CodePerfTracker
instance to use, can be null and a unique
one will be created.public static Design readCheckpoint(Path dcpFileName, Path edfFileName, CodePerfTracker t)
edfFileName
if it exists()
is set, Run Vivado to create a readable EDIF file at edfFileName
Vivado Tcl:
open_checkpoint $dcpFileName
dcpFileName
- Name of the DCP file to load.edfFileName
- Name of the external EDIF file to load/create.t
- The CodePerfTracker
instance to use, can be null and a unique
one will be created.public static Design readCheckpoint(String dcpFileName, String edfFileName, CodePerfTracker t)
edfFileName
if it exists()
is set, Run Vivado to create a readable EDIF file at edfFileName
Vivado Tcl:
open_checkpoint $dcpFileName
dcpFileName
- Name of the DCP file to load.edfFileName
- Name of the external EDIF file to load/create.t
- The CodePerfTracker
instance to use, can be null and a unique
one will be created.public static Design readCheckpoint(Path dcpFileName, Path edfFileName)
edfFileName
if it exists()
is set, Run Vivado to create a readable EDIF file at edfFileName
Vivado Tcl:
open_checkpoint $dcpFileName
dcpFileName
- Name of the DCP file to load.edfFileName
- Name of the external EDIF file to load.public static Design readCheckpoint(String dcpFileName, String edfFileName)
edfFileName
if it exists()
is set, Run Vivado to create a readable EDIF file at edfFileName
Vivado Tcl:
open_checkpoint $dcpFileName
dcpFileName
- Name of the DCP file to load.edfFileName
- Name of the external EDIF file to load.public static Design readCheckpoint(Path dcpFileName, boolean skipXdef)
()
is set, Run Vivado to create a readable EDIF file of the same name in the same directory as the DCPVivado Tcl:
open_checkpoint $dcpFileName
dcpFileName
- Name of the DCP to load.skipXdef
- Flag to indicate if the XDEF (placement and routing information) file should be loaded.public static Design readCheckpoint(String dcpFileName, boolean skipXdef)
()
is set, Run Vivado to create a readable EDIF file of the same name in the same directory as the DCPVivado Tcl:
open_checkpoint $dcpFileName
dcpFileName
- Name of the DCP to load.skipXdef
- Flag to indicate if the XDEF (placement and routing information) file should be loaded.public static Design readCheckpoint(Path dcpFileName, Path edfFileName, boolean skipXdef, CodePerfTracker t)
edfFileName
if it exists()
is set, Run Vivado to create a readable EDIF file at edfFileName
Vivado Tcl:
open_checkpoint $dcpFileName
dcpFileName
- Name of the DCP file to load.edfFileName
- Name of the external EDIF file to load/create.skipXdef
- Flag to indicate if the XDEF (placement and routing information) file should be loaded.t
- The CodePerfTracker
instance to use, can be null and a unique
one will be created.public void writeCheckpoint(Path dcpFileName)
Vivado Tcl:
write_checkpoint $dcpFileName
dcpFileName
- Name of the dcp file to write.public void writeCheckpoint(String dcpFileName)
Vivado Tcl:
write_checkpoint $dcpFileName
dcpFileName
- Name of the dcp file to write.public void writeCheckpoint(Path dcpFileName, CodePerfTracker t)
Design.writeCheckpoint(Path)
with the
added option of providing a custom instance of CodePerfTracker
.
Vivado Tcl:
write_checkpoint $dcpFileName
dcpFileName
- Name of the DCP file to write.t
- The CodePerfTracker
instance to use, can be null and a unique
one will be created.public void writeCheckpoint(String dcpFileName, CodePerfTracker t)
Design.writeCheckpoint(String)
with the
added option of providing a custom instance of CodePerfTracker
.
Vivado Tcl:
write_checkpoint $dcpFileName
dcpFileName
- Name of the DCP file to write.t
- The CodePerfTracker
instance to use, can be null and a unique
one will be created.public void writeCheckpoint(String dcpFileName, String edfFileName, CodePerfTracker t)
dcpFileName
- Name of the DCP file to write.edfFileName
- Name of the EDIF file to use for the dcp, null to write
out a new netlist.t
- The CodePerfTracker
instance to use, can be null and a unique
one will be created.public void writeCheckpoint(Path dcpFileName, Path edfFileName, CodePerfTracker t)
dcpFileName
- Name of the DCP file to write.edfFileName
- Name of the EDIF file to use for the dcp, null to write
out a new netlist.t
- The CodePerfTracker
instance to use, can be null and a unique
one will be created.public void updateDesignWithCheckpointPlaceAndRoute(Path dcpFileName)
dcpFileName
- Name of the DCP with the placement and routing information
of interest to apply to this design's netlist.public void updateDesignWithCheckpointPlaceAndRoute(String dcpFileName)
dcpFileName
- Name of the DCP with the placement and routing information
of interest to apply to this design's netlist.public static String getPartNameFromDCP(Path dcpFileName)
Vivado Tcl:
read_checkpoint $dcpFileName;get_property PART [current_project]
dcpFileName
- Name of the DCP from which to get the part name.public static String getPartNameFromDCP(String dcpFileName)
Vivado Tcl:
read_checkpoint $dcpFileName;get_property PART [current_project]
dcpFileName
- Name of the DCP from which to get the part name.public static boolean replaceEDIFinDCP(String dcpFileName, String edfFileName)
dcpFileName
- DCP file name to be updatededfFileName
- The file name of the EDIF file to be inserted into the DCP replacing
the existing onepublic static boolean replaceEDIFinDCP(String inDcpFileName, String edfFileName, String outDcpFileName)
inDcpFileName
- Input DCP file nameedfFileName
- The file name of the EDIF file to replace the one
inside the input DCPoutDcpFileName
- Output DCP file namepublic Part getPart()
Vivado Tcl:
get_property PART [current_project]
public Series getSeries()
public boolean isSiteUsed(Site site)
Vivado Tcl:
if [expr [llength [get_cells -of $site]] > 0] 1 else 0
site
- The site to check if occupied.public SiteInst getSiteInstFromSite(Site site)
site
- The site of the desired site instance.public SiteInst getSiteInstFromSiteName(String siteName)
siteName
- Name of the site from which to retrieve the site instance.SiteInst
occupying the site specified or null if invalid site or none exists.public ModuleInst getModuleInst(String name)
name
- The name of the moduleInst to get.public EDIFCellInst addModuleInstNetlist(ModuleInst mi, EDIFNetlist edifGuts)
mi
- The ModuleInst to have recently been added.edifGuts
- The corresponding EDIF netlist internals for the ModuleInst.public void repopulateNetlistOfModuleInst(ModuleInst modInst, EDIFNetlist edifGuts)
modInst
- The newly added module instanceedifGuts
- The corresponding logical netlist (EDIF guts) of the module instancepublic void repopulateNetlistOfModuleInst(String modInstName, EDIFNetlist edifGuts)
modInstName
- The name of the newly added module instanceedifGuts
- The corresponding logical netlist (EDIF guts) of the module instancepublic EDIFCellInst createOrFindEDIFCellInst(String name, EDIFCell cell)
name
- The name of the new EDIFCellInst to create / find.cell
- The cell type for the EDIFCellInstpublic ModuleInst createModuleInst(String name, Module module)
Design.addModule(com.xilinx.rapidwright.design.Module)
).name
- The name of the new ModuleInst created.module
- The Module that the new ModuleInst instances.public ModuleInst createModuleInst(String name, Module module, boolean includePortRouting)
Design.addModule(com.xilinx.rapidwright.design.Module)
).name
- The name of the new ModuleInst created.module
- The Module that the new ModuleInst instances.includePortRouting
- Enables inclusion of top-level port routing.public boolean renameSiteInst(SiteInst inst, String newName)
inst
- The site instance to renamenewName
- The newly desired namepublic String getName()
Vivado Tcl:
get_property NAME [current_project]
public Collection<ModuleInst> getModuleInsts()
public HashMap<String,ModuleInst> getModuleInstMap()
public String getPartName()
Vivado Tcl:
get_property PART [current_project]
public void addModule(Module module)
EDIFNetlist.copyCellAndSubCells(com.xilinx.rapidwright.edif.EDIFCell)
).
Updates the implementation index accordingly.module
- The module to add.public void addModuleImpls(ModuleImpls modImpls)
modImpls
- The list of modules with different implementationspublic void addSiteInst(SiteInst inst)
Design.createSiteInst(Site)
.inst
- The instance to add.public Net addNet(Net net)
Design.createNet(String)
.net
- The net to add.public Net removeNet(String name)
Vivado Tcl:
remove_net [get_nets $name]
name
- The name of the net to remove.public Net removeNet(Net net)
Vivado Tcl:
remove_net $net
net
- The net to remove from the design.public void movePinsToNewNetDeleteOldNet(Net oldNet, Net newNet, boolean keepRouting)
Vivado Tcl:
connect_net -net_object_list [get_pins -of $oldNet] -net $newNet;remove_net $oldNet
oldNet
- Net to have pins moved to newNet and be deleted from design.newNet
- Net to receive pins from oldNet.keepRouting
- A flag indicating if any existing inter-site routing on the new net should be maintained.public boolean removeSiteInst(SiteInst instance)
Vivado Tcl:
foreach c [get_cells -of $site] {remove_cell $c}
instance
- The instance in the design to remove.public boolean removeSiteInst(SiteInst instance, boolean keepSitePinRouting)
instance
- The instance in the design to remove.keepSitePinRouting
- If true, all routing on nets connected to site pins will be kept.public Module getModule(String name)
name
- The name of the module to get.public Module getModule(String name, int implementationIndex)
name
- The name of the module to getimplementationIndex
- The implementation index within the design.public SiteInst getSiteInst(String name)
name
- Name of the instance to get.public Net getNet(String name)
Vivado Tcl:
get_nets $name
name
- Name of the net to get.public Net getGndNet()
public Net getVccNet()
public Net getStaticNet(NetType type)
NetType
.NetType
== NetType.VCC
if returns the
power net, otherwise the ground net.public Collection<SiteInst> getSiteInsts()
public void clearUsedSites()
public Collection<ModuleImpls> getModules()
public Set<String> getModuleNames()
public Collection<Net> getNets()
Vivado Tcl:
get_nets -hierarchical
public Device getDevice()
public void setName(String name)
name
- New name for the designpublic void setPartName(String partName)
Part
), for the design. Cannot
change the part once it has already been set.partName
- Full Xilinx part name for the intended design.public EDIFNetlist getNetlist()
public void setNetlist(EDIFNetlist netlist)
netlist
- The netlist to apply to this design.public void setNOCDesign(NOCDesign nocDesign)
nocDesign
- The new NOC Designpublic NOCDesign getNOCDesign()
public EDIFCell getTopEDIFCell()
public void unrouteDesign()
Vivado Tcl:
route_design -unroute
public void unplaceDesign()
Vivado Tcl:
place_design -unplace
public void flattenDesign()
public SiteInst createSiteInst(String name, SiteTypeEnum type, Site placement)
SiteInst
and the Design.addSiteInst(SiteInst)
methods into one command and checks for collisions in name and placement.name
- Name of the new site instance.type
- The SiteType of the new site instance.placement
- The desired placement of the new site instance.public SiteInst createSiteInst(Site site)
site
- The site instance name, type and placement to create.public SiteInst createSiteInst(String siteName)
siteName
- The site name onto which this instance should be placed and named.public Cell createCell(String instName, EDIFCell reference)
Vivado Tcl:
create_cell -reference $reference $instName
instName
- Name of the cell instance to create and add to the design at the top level.reference
- The EDIFCell reference this cell should instantiate. This is generally a primitive cell.public Cell createCell(String instName, Unisim unisim)
Vivado Tcl:
create_cell -reference $reference $instName
instName
- Name of the cell instance to create and add to the design at the top level.unisim
- The Unisim reference this cell should instantiate. This is generally a primitive cell.public Cell createCell(String instName, EDIFCellInst instance)
Vivado Tcl:
create_cell -reference $reference $instName
instName
- Name of the existing cell. This method does not create a
logical cell in the netlist, it should already exist.instance
- The existing logical cell in the netlist. This is only used
for setting the cell type, a reference to it is not stored in
the cell.public Cell createAndPlaceCell(String name, Unisim cellType, String location)
Vivado Tcl:
create_cell -reference $cellType $name; place_cell $location
name
- Name of the cellcellType
- The Unisim library cell typelocation
- The Vivado name of the site/BEL location (i.e.
SLICE_X45Y42/AFF)public Cell createAndPlaceCell(String name, Unisim cellType, String location, String... params)
Vivado Tcl:
create_cell -reference $cellType $name; place_cell $location
name
- Name of the cellcellType
- The Unisim library cell typelocation
- The Vivado name of the site/BEL location (i.e. SLICE_X45Y42/AFF)params
- Key=Value parameters to set on the cell during creation.public Cell createAndPlaceCell(EDIFCell parent, String name, Unisim cellType, String location)
Vivado Tcl:
current_instance $parent;create_cell -reference $cellType $name; place_cell $location
parent
- The parent cell to which to add this cellname
- Name of the cellcellType
- The Unisim library cell typelocation
- The Vivado name of the site/BEL location (i.e. SLICE_X45Y42/AFF)public Cell createAndPlaceCell(EDIFCell parent, String name, Unisim cellType, String location, String... params)
Vivado Tcl:
current_instance $parent;create_cell -reference $cellType $name; place_cell $location
parent
- The parent cell to which to add this cellname
- Name of the cellcellType
- The Unisim library cell typelocation
- The Vivado name of the site/BEL location (i.e. SLICE_X45Y42/AFF)params
- Key=Value parameters to set on the cell during creation.public Cell createAndPlaceCell(EDIFCell parent, String name, Unisim cellType, Site site, BEL bel)
Vivado Tcl:
current_instance $parent;create_cell -reference $cellType $name; place_cell $site/$bel
parent
- If set to null, the EDIFCellInst
will not reference the netlist.name
- Name of the cellcellType
- The Unisim library cellsite
- The site onto which to place this cellbel
- The BEL site onto which to place this cellpublic Cell createAndPlaceCell(EDIFCell parent, String name, Unisim cellType, Site site, BEL bel, String... params)
Vivado Tcl:
current_instance $parent;create_cell -reference $cellType $name; place_cell $site/$bel
parent
- If set to null, the EDIFCellInst
will not reference the netlist.name
- Name of the cellcellType
- The Unisim library cellsite
- The site onto which to place this cellbel
- The BEL site onto which to place this cellparams
- Key=Value parameters to set on the cell during creation.public Cell createAndPlaceIOB(String name, PinType dir, String pkgPin, String ioStandard)
Vivado Tcl:
create_cell -reference IBUF/OBUF $name; set_property PACKAGE_PIN $pkgPin [get_ports $name];set_property IOSTANDARD $ioStandard [get_ports $name]
name
- Name of the IO buffer and port it connects to.dir
- Is it an input or output pin (inout is not supported).pkgPin
- The letter/number package pin name on the device.ioStandard
- The voltage standard to assign to the IO.public Cell createAndPlaceIOB(String name, PinType dir, String pkgPin, String ioStandard, Net portNet, EDIFNet logNet)
Vivado Tcl:
create_cell -reference IBUF/OBUF $name; set_property PACKAGE_PIN $pkgPin [get_ports $name];set_property IOSTANDARD $ioStandard [get_ports $name]
name
- Name of the IO buffer and port it connects to.dir
- Is it an input or output pin (inout is not supported).pkgPin
- The letter/number package pin name on the device.ioStandard
- The voltage standard to assign to the IO.portNet
- Physical net to connect from IO to fabriclogNet
- Logical net that connects from IO to fabricpublic Cell placeIOB(EDIFCellInst bufInst, String pkgPin, String ioStandard)
Vivado Tcl:
set_property PACKAGE_PIN $pkgPin [get_ports $name];set_property IOSTANDARD $ioStandard [get_ports $name]
bufInst
- Existing IBUF or OBUF instance in the netlist (note for IBUF, this is not the leaf-level cell, but the hierarchical parent).pkgPin
- The letter/number package pin name on the device.ioStandard
- The voltage standard to assign to the IO.public static EDIFCellInst createUnisimInst(EDIFCell parent, String name, Unisim cellType)
Cell
object.parent
- The parent cell of the instancename
- Name of the instancecellType
- The Unisim typepublic static EDIFCell getUnisimCell(Unisim cell)
Vivado Tcl:
get_primitives -filter NAME==$cell
cell
- The cell type to getpublic Cell createBUFGCE(EDIFCell parent, String name, Site location)
Vivado Tcl:
set c [create_cell -reference BUFGCE $name]; place_cell $c $location
parent
- The parent cell (logical netlist EDIF) to which this BUFGCE instance belongs.name
- Name of the BUGFGCE instance.location
- The site on the device to place this BUFGCE.public EDIFCellInst createIBUFDS(String portNameP, String portNameN, Site siteP, Site siteN, Net portNet, EDIFNet logNet, String ioStandard)
Vivado Tcl:
set c [create_cell -reference IBUFDS $name]; place_cell $c $location
portNameP
- Positive Name of the port at the top levelportNameN
- Negative Name of the port at the top levelsiteP
- Positive IO site to place the IBUFDSsiteN
- Negative IO site to place the IBUFDSportNet
- Physical net of the portlogNet
- Logical net of the portioStandard
- IO standard to configure the IBUFpublic Net createNet(EDIFHierNet net)
Vivado Tcl:
create_net $net
net
- The logical hierarchical net from which to create the net from.public Net createNet(String netName)
EDIFNet
can be accessed
by Net.getLogicalNet()
.
Vivado Tcl:
create_net $netName
netName
- Full hierarchical name of the net to create.public boolean placeCell(Cell c, Site site, BEL bel)
Vivado Tcl:
place_cell $c $site/$bel
c
- The cell to be placed.site
- The site containing the BEL to be placed.bel
- The BEL site onto which the cell placement is attempted.public boolean placeCell(Cell c, Site site, BEL bel, Map<String,String> pinMappings)
Vivado Tcl:
place_cell $c $site/$bel;set_property LOCK_PINS $pinMappings $c
c
- The cell to be placed.site
- The site containing the BEL to be placed.bel
- The BEL site onto which the cell placement is attempted.pinMappings
- The physical to logical pin mappings for the cell.public Cell copyCell(Cell c, String instName)
c
- The prototype cell from a different design to copy.instName
- public Cell addCell(Cell c)
Design.createCell(String, EDIFCellInst)
or
Design.createAndPlaceCell(EDIFCell, String, Unisim, Site, BEL)
or their variants.c
- The cell to add.public Cell getCell(String name)
name
- The name of the cell to getpublic Cell removeCell(String name)
EDIFCellInst
).name
- Hierarchical name of the cell.public Cell removeCell(Cell c)
c
- The cell to remove, or a cell with the same name to removepublic Collection<Cell> getCells()
Vivado Tcl:
get_cells
public static EDIFLibrary getMacroPrimitives(Series s)
s
- The architectural series from which to get the macro primitivespublic static EDIFLibrary getPrimitivesLibrary()
public static EDIFLibrary getPrimitivesLibrary(String deviceName)
deviceName
- The name of the device from which to get the compatible primitivespublic static VivadoProp getDefaultProperty(Series series, String cellTypeName, String propName)
series
- Series to which the cell targetscellTypeName
- Name of the cell type (often Unisims)propName
- Name of the property attached to the cellpublic static Map<String,VivadoProp> getDefaultCellProperties(Series series, String cellTypeName)
series
- Target series of the cellcelTypeName
- Name of the cell type (often a Unisim)public List<String> getXDCConstraints(ConstraintGroup cg)
cg
- The specific constraint group from which to get XDC constraints.public List<String> setXDCConstraints(List<String> xdc, ConstraintGroup cg)
xdc
- New XDC commands to use for this designcg
- The constraint group to set.public void addXDCConstraint(String... xdc)
ConstraintGroup
)
XDC commands for this design.xdc
- One or more of the XDC command to be addedpublic void addXDCConstraint(ConstraintGroup cg, String... xdc)
ConstraintGroup
.cg
- The constraint group to which the XDC command should be added.xdc
- One or more of the XDC command to be addedpublic boolean addPartitionPin(PartitionPin pin)
pin
- The pin to addpublic boolean removePartitionPin(PartitionPin pin)
pin
- The pin to removepublic List<PartitionPin> getPartitionPins()
public PartitionPin createPartitionPin(EDIFHierPortInst pin, Node node)
pin
- The hierarchical port instance as the logical reference of the pinnode
- The physical reference point on the device for the pinpublic PartitionPin createPartitionPin(EDIFPort port, int index, Node node)
port
- The top cell portindex
- The index within the port if bussednode
- The node to targetpublic PartitionPin createPartitionPin(EDIFPort port, Node node)
port
- The top cell portnode
- The node to targetpublic void copyPartitionPins(Design source, ModuleInst dest, Map<EDIFPort,EDIFPort> portMap)
source
- The Design object used to create a ModuleInst in this Design.dest
- The ModuleInst in this Design.portMap
- Map of ports to have their partition pins copied from the source design to dest design.public void trimPartitionPins(Pair<Tile,Tile> range)
range
- A pair of tiles representing opposite corners of the routing range.public String toString()
toString
in class Object
public void setAutoIOBuffers(boolean val)
val
- Set to true (default) to automatically instantiate I/Os when
the design is loaded in Vivado, false to disable this behavior.public boolean isAutoIOBuffersSet()
public boolean isDesignOutOfContext()
public void setDesignOutOfContext(boolean val)
val
- True to make the design labeled as out of context, false
to be unlabeled out-of-context.public void routeSites()
Vivado Tcl:
route_design
public void unrouteSites()
public boolean placeCells(Map<String,String> desiredCellPlacements)
Vivado Tcl:
place_cells $desiredCellPlacements
desiredCellPlacements
- Map of cell placements where the key is full
hierarchical name of the cell and value is the full bel site name (ex: SLICE_X0Y0/AFF).public void clearTrackedChanges()
public void setTrackingChanges(boolean trackChanges)
EDIFNetlist.isTrackingCellChanges()
,
Design.isTrackingNetChanges()
, Design.isTrackingNetChanges()
trackChanges
- True to begin tracking changes, false to stop tracking changespublic boolean isTrackingSiteInstChanges()
Design.getModifiedSiteInsts()
.
SiteInsts are determined as modified if (1) a mapping between a Net and SiteWire has changed,
(2) the status of a SitePIP has changed, or (3) a cell has been placed or unplaced on a BEL
corresponding to the site where this SiteInst is placed.public void setTrackSiteInstChanges(boolean trackSiteInstChanges)
Design.isTrackingSiteInstChanges()
trackSiteInstChanges
- True to enable tracking of SiteInsts, false to stop trackingpublic boolean isTrackingNetChanges()
Design.getModifiedNets()
.
Nets are determined as modified if the PIPs on the net change, including if a PIP is set as
fixed or not.public boolean isCopyingOriginalNetsRouting()
Design.setCopyingOriginalNetsRouting(boolean)
.public void setCopyingOriginalNetsRouting(boolean copyOrigNets)
Design.isCopyingOriginalNetsRouting()
copyOrigNets
- The desired value of the flagpublic Map<String,List<PIP>> getOriginalNetRouting()
Design.isCopyingOriginalNetsRouting()
returns true.public boolean isCopyingOriginalSiteInsts()
Design.setCopyingOriginalSiteInsts(boolean)
.public void setCopyingOriginalSiteInsts(boolean copyOrigSiteInsts)
Design.isCopyingOriginalNetsRouting()
copyOrigSiteInsts
- The desired value of the flagpublic Map<String,SiteInst> getOriginalSiteInsts()
Design.isCopyingOriginalSiteInsts()
returns true.public void setTrackNetChanges(boolean trackNetChanges)
Design.isTrackingNetChanges()
trackNetChanges
- True to enable tracking of Nets, false to stop trackingpublic Set<SiteInst> getModifiedSiteInsts()
Design.isTrackingSiteInstChanges()
returns true.public Set<Net> getModifiedNets()
Design.isTrackingNetChanges()
returns true.public boolean addModifiedNet(Net net)
net
- The net to addpublic boolean addModifiedSiteInst(SiteInst siteInst)
siteInst
- The siteInst to addpublic void addManuallyRoutedSite(String siteName)
public Set<String> getManuallyRoutedSites()
public void detachNetlist()
public void detachNetlist(Predicate<Cell> preserveCellProperties)
preserveCellProperties
- PredicateDesign.getSiteInsts()
, Design.getModifiedSiteInsts()
,
and Design.getOriginalSiteInsts()
) should have their
EDIFHierCellInst properties (accessible through
Cell.getProperty(String)
) preserved.
Set to null to not preserve any properties.public Map<Site,SiteConfig> getBELAttrs()
public BELAttr addBELAttr(Net net, Site site, SiteTypeEnum type, BEL bel, String name, String value)
net
- The net associated with the BEL attributesite
- The site where the BEL attribute residestype
- The selected site type of the site where the BEL attribute residesbel
- The BEL to annotate with the attributename
- The name of the attributevalue
- The value of the attributepublic boolean retargetPart(Part targetPart, int tileXOffset, int tileYOffset)
targetPart
- The new target part for this design.tileXOffset
- The offset in tile X coordinate of the destination
implementationtileYOffset
- The offset in tile Y coordinate of the destination
implementation