public class Cell extends Object implements Serializable, Comparable<Cell>
EDIFCellInst
and provides a mapping to a physical location BEL on the device. It could
also be called a BELInst.Modifier and Type | Field and Description |
---|---|
static String |
FF_ROUTETHRU_TYPE
Sentinel type for library field "type" to identify FF routethrus
|
static String |
LOCKED
Cell name sentinel used when the cell represented is a locked BEL location
|
static String |
PORT_TYPE
Sentinel type for library field "type" to identify ports
|
static String |
SENTINEL_DEFAULT |
Constructor and Description |
---|
Cell(String name)
Cell constructor that creates a new physical cell
|
Cell(String name,
BEL bel)
Creates a new physical cell and places it on the designated bel
|
Cell(String name,
SiteInst siteInst,
BEL bel)
Physical cell constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addAltPinMapping(String physicalPin,
AltPinMapping logicalPin)
Adds an alternate pin mapping for the provided physical pin.
|
void |
addPinMapping(String physicalPin,
String logicalPin)
Maps together a logical and physical pin on the cell and BEL respectively.
|
EDIFPropertyValue |
addProperty(String key,
boolean value)
Helper method to add a boolean-valued property to the logical cell instance in
the netlist.
|
EDIFPropertyValue |
addProperty(String key,
int value)
Helper method to add an int-valued property to the logical cell instance in
the netlist.
|
EDIFPropertyValue |
addProperty(String key,
String value)
Helper method to add a string-valued property to the logical cell instance in
the netlist.
|
EDIFPropertyValue |
addProperty(String key,
String value,
EDIFValueType type)
Helper method to add a property to the logical cell instance in the netlist.
|
int |
compareTo(Cell o) |
void |
connectStaticSourceToPin(NetType type,
String logicalPinName)
Convenience method to quickly connect a cell pin to VDD or GND.
|
void |
connectStaticSourceToPins(NetType type,
String... myPins)
Convenience method to quickly connect a set of cell pins to VDD or GND.
|
Cell |
copyCell(String name,
EDIFHierCellInst inst)
Copies this cell except instance name and EDIFCellInst reference
|
Cell |
copyCell(String name,
EDIFHierCellInst inst,
SiteInst i)
Copies this cell except instance name, EDIFCellInst and SiteInst reference
|
String |
debugToString() |
boolean |
equals(Object obj) |
void |
fixPin(String physicalPin)
Marks a pin on the cell as fixed by its physical name.
|
List<String> |
getAllCorrespondingSitePinNames(String logicalPinName)
Finds all the corresponding site pin names of the site to be used to drive/source from
the logical pin name provided on this cell.
|
List<String> |
getAllCorrespondingSitePinNames(String logicalPinName,
boolean considerLutRoutethru)
Finds all the corresponding site pin names of the site to be used to drive/source from
the logical pin name provided on this cell.
|
List<String> |
getAllCorrespondingSitePinNames(String logicalPinName,
List<String> siteWires,
boolean considerLutRoutethru)
Finds all the corresponding site pin names of the site to be used to drive/source from
the logical pin name provided on this cell.
|
Set<String> |
getAllPhysicalPinMappings(String logicalPin)
Gets all corresponding physical pins that are mapped to by the given logical pin.
|
List<SitePinInst> |
getAllSitePinsFromLogicalPin(String logicalPinName,
List<String> siteWires)
Attempts to get all the physical net pin from this cell's logical pin name.
|
List<SitePinInst> |
getAllSitePinsFromPortInst(EDIFPortInst p,
List<String> siteWires)
Attempts to get the list of physical net pins from this cell's port ref.
|
SiteTypeEnum |
getAltBlockedSiteType()
Gets (if any) alternative site type if this cell's current site is blocked.
|
AltPinMapping |
getAltPinMapping(String physicalPin)
Gets (if exists) an alternative pin mapping for the provided physical pin name.
|
Map<String,AltPinMapping> |
getAltPinMappings()
Gets a map containing all alternate pin mappings for the cell.
|
BEL |
getBEL()
Gets the element type object onto which this cell is placed.
|
String |
getBELName()
The name of the BEL onto which this cell is placed.
|
BELPin |
getBELPin(EDIFHierPortInst p)
Attempts to get the physical BEL pin from the logical EDIFPortInst.
|
BELPin |
getBELPin(EDIFPortInst p)
Attempts to get the physical BEL pin from the logical EDIFPortInst.
|
Map<SiteTypeEnum,Set<String>> |
getCompatiblePlacements(Device device)
Provides a map of site type and bel names that support the specified unisim.
|
String |
getCorrespondingSitePinName(String logicalPinName)
Finds the corresponding site pin name of the site to be used to drive/source from
the logical pin name provided on this cell.
|
String |
getCorrespondingSitePinName(String logicalPinName,
String physPinName,
List<String> siteWires)
Finds the corresponding site pin name of the site to be used to drive/source from
the logical pin name provided on this cell.
|
String |
getDefaultPinMapping(String logicalPinName)
Gets the default physical pin mapping for specified logical pin mapping on this cell
|
EDIFCellInst |
getEDIFCellInst()
Gets the logical netlist cell instance corresponding to this cell.
|
EDIFHierCellInst |
getEDIFHierCellInst()
Gets the hierarchical logical netlist cell instance corresponding to this cell.
|
String |
getLogicalPinMapping(String physicalPin)
Gets the corresponding logical pin mapping for the provided physical pin.
|
String |
getName()
Gets the full hierarchical name of the cell
|
EDIFCell |
getParentCell()
Gets the parent logical cell of this cell instance.
|
String |
getParentHierarchicalInstName()
Gets this cell's hierarchical parent instance name.
|
String |
getPhysicalPinMapping(String logicalPin)
Gets the corresponding logical pin mapping for the provided logical pin.
|
Map<String,Set<String>> |
getPinMappingsL2P()
Gets the map representing the logical to physical pin mappings for the cell.
|
Map<String,String> |
getPinMappingsP2L()
Gets the map representing the physical to logical pin mappings for the cell.
|
Map<String,EDIFPropertyValue> |
getProperties()
Helper method to get the properties on the underlying logical cell
(
EDIFCellInst ) corresponding to this cell. |
EDIFPropertyValue |
getProperty(String key)
Helper method to get a property from the logical cell instance corresponding to this cell
|
String |
getPropertyValueString(String key)
Helper method to get the actual string value of a property if one exists.
|
Cell |
getReferenceCopy()
Creates a reference copy of this cell--a deep copy of the cell without this
new instance being referenced in the design object.
|
Site |
getSite()
Gets the site on which this cell is placed.
|
SiteInst |
getSiteInst()
Gets the site instance this cell belongs to.
|
String |
getSiteName()
Gets the site name onto which this cell is placed.
|
SitePinInst |
getSitePinFromLogicalPin(String logicalPinName,
List<String> siteWires)
Attempts to get the physical net pin from this cell's logical pin name.
|
SitePinInst |
getSitePinFromPortInst(EDIFPortInst p,
List<String> siteWires)
Attempts to get the physical net pin from this cell's port ref.
|
String |
getSiteWireNameFromLogicalPin(String logicalPinName)
Uses the logical pin name to lookup the site wire name from the physical mapping pin on the cell.
|
String |
getSiteWireNameFromPhysicalPin(String physicalPinName)
Gets the name of the site wire immediately connected to the physical pin specified.
|
Tile |
getTile()
Gets the tile on which this cell is placed.
|
String |
getType()
Gets the EDIFCell cell type (Unisim library cell name).
|
boolean |
hasAltPinMappings()
Checks if this cell has any alternative pin mappings on any pins.
|
int |
hashCode() |
boolean |
isBELFixed()
Checks if the cell is fixed to the BEL
|
boolean |
isFFRoutethruCell()
Checks if this cell is a sentinel placeholder object for a FF routethru.
|
boolean |
isLocked()
Checks if this cell is locked.
|
boolean |
isNullBEL()
Checks if this cell has a null BEL/element.
|
boolean |
isPinFixed(String physicalPin)
Checks if the provided pin is set as fixed.
|
boolean |
isPlaced()
Checks if the cell is placed.
|
boolean |
isPlacedOn(SiteTypeEnum type,
String bel)
Compares the placement of the cell with the provided site type and
BEL.
|
boolean |
isPlacedOn(String fullBelName)
Checks if this cell is placed
|
boolean |
isPortCell()
Checks if this cell is a sentinel placeholder object for a port.
|
boolean |
isRoutethru()
Checks if this cell is a routethru.
|
boolean |
isSiteFixed()
Checks if the site is fixed.
|
String |
removePinMapping(String physicalPin)
Removes the pin mapping based on the physical pin name
|
void |
setAltBlockedSiteType(SiteTypeEnum typeEnum)
Set the alternative SiteTypeEnum for a blocked site
|
void |
setBELFixed(boolean isBELFixed)
Sets if the cell is fixed to the BEL or not.
|
void |
setEDIFHierCellInst(EDIFHierCellInst inst)
Sets the hierarchical logical netlist cell to the one provided.
|
void |
setLocked(boolean isLocked)
Mark this cell as locked.
|
void |
setNullBEL(boolean b)
Set this cell has a null BEL/element.
|
void |
setPropertiesMap(Map<String,EDIFPropertyValue> properties)
Helper method to set the properties on the underlying logical cell (
EDIFCellInst ) |
void |
setRoutethru(boolean isRoutethru)
Sets flag that this cell represents a routethru.
|
void |
setSiteFixed(boolean isSiteFixed)
Sets the fixed site flag for the cell.
|
void |
setSiteInst(SiteInst instance)
Sets the site instance where this cell resides.
|
void |
setType(String type)
Explicitly set the type of this cell.
|
String |
toString() |
void |
unFixPin(String physicalPin)
Unmarks a pin on the cell as fixed by its physical name.
|
void |
unplace()
Unplaces this cell.
|
SitePinInst |
unrouteLogicalPinInSite(String logicalPinName)
Unroutes the site routing of the provided logical pin.
|
boolean |
updateName(String newCellName)
Updates the cell name, such as when instantiating this cell in a larger
design to add a prefix.
|
public static final String SENTINEL_DEFAULT
public static final String LOCKED
public static final String PORT_TYPE
public static final String FF_ROUTETHRU_TYPE
public Cell(String name)
name
- Full hierarchical name of the cellpublic Cell(String name, BEL bel)
name
- Full hierarchical name of the cellbel
- The BEL on which the cell should be placedpublic Cell copyCell(String name, EDIFHierCellInst inst)
name
- New instance name of the cellinst
- The logical cell instance that corresponds to this physical cell.public Cell copyCell(String name, EDIFHierCellInst inst, SiteInst i)
name
- New instance name of the cellinst
- The logical cell instance that corresponds to this physical cell.i
- New site instancepublic Cell getReferenceCopy()
public boolean isPortCell()
public boolean isFFRoutethruCell()
public boolean isPlacedOn(SiteTypeEnum type, String bel)
Vivado Tcl:
if [expr {[get_property BEL $this] eq "$type.$bel}] {1} else {0}
type
- The type of site to check if this cell is placed on.bel
- The BEL to check if this cell is placed on.public boolean isPlacedOn(String fullBelName)
Vivado Tcl:
if [expr {[get_property BEL $this] eq "$fullBelName}] {1} else {0}
fullBelName
- SiteType name and element name separated by '.', for example: SLICEL.AFFpublic String getName()
Vivado Tcl:
get_property NAME $this
public boolean updateName(String newCellName)
public boolean isPlaced()
public BEL getBEL()
Vivado Tcl:
get_bels [get_property BEL $this]
public String getSiteName()
Vivado Tcl:
get_property LOC $this
public String getBELName()
Vivado Tcl:
set n [get_property BEL $this];string range $n [string last "." $n]+1 [string length $n]
public SiteInst getSiteInst()
public void setSiteInst(SiteInst instance)
instance
- the instance to setpublic Site getSite()
Vivado Tcl:
get_sites -of $this
public Tile getTile()
public EDIFCellInst getEDIFCellInst()
public EDIFHierCellInst getEDIFHierCellInst()
public void setEDIFHierCellInst(EDIFHierCellInst inst)
inst
- The instance to setpublic String getParentHierarchicalInstName()
Vivado Tcl:
get_property NAME [get_property PARENT $this]
public void fixPin(String physicalPin)
Vivado Tcl:
foreach p [get_pins -of $this] {if [expr {get_bel_pins -of $p eq ""}] {set_property IS_LOC_FIXED 1 $p}
physicalPin
- Physical name that maps to the logical pin of a cell that is to be fixed.public void unFixPin(String physicalPin)
Vivado Tcl:
foreach p [get_pins -of $this] {if [expr {get_bel_pins -of $p eq ""}] {set_property IS_LOC_FIXED 0 $p}
physicalPin
- Physical name that maps to the logical pin of a cell to set as unfixed.public boolean isPinFixed(String physicalPin)
Vivado Tcl:
foreach p [get_pins -of $this] {if [expr {get_bel_pins -of $p eq ""}] {get_property IS_LOC_FIXED $p}
physicalPin
- Name of the physical pin that corresponds to the
logical pin on the cell to check if fixed.public void addPinMapping(String physicalPin, String logicalPin)
Vivado Tcl:
set_property LOCK_PINS $logicalPin:$physcialPin $this
physicalPin
- Name of the physical pin on the BEL to be mapped.logicalPin
- Name of the logical pin on the cell to be mapped.public String removePinMapping(String physicalPin)
Vivado Tcl:
set p [get_property LOCK_PINS $this]; set_property LOCK_PINS [string map {$logicalPin:$physicalPin ""} $p] $this
physicalPin
- Name of the physical pin from which to remove the mappingpublic Map<String,String> getPinMappingsP2L()
Vivado Tcl:
foreach p [get_pins -of $this] {puts "[get_bel_pins -of $p]:$p"}
public Map<String,Set<String>> getPinMappingsL2P()
public String getLogicalPinMapping(String physicalPin)
Vivado Tcl:
get_pins -of [get_bel_pins $site/$bel/$physicalPin]
physicalPin
- Name of the physical pin.public String getPhysicalPinMapping(String logicalPin)
Vivado Tcl:
set n [get_bel_pins -of [get_pins $this/$logicalPin]]; string range $n [string last "/" $n]+1 [string length $n]
logicalPin
- Name of the logical pin.Cell.getAllPhysicalPinMappings(String)
public Set<String> getAllPhysicalPinMappings(String logicalPin)
logicalPin
- public AltPinMapping getAltPinMapping(String physicalPin)
physicalPin
- Name of the physical pin of interest.public void addAltPinMapping(String physicalPin, AltPinMapping logicalPin)
physicalPin
- Name of the physical pin to receive the additional mapping.logicalPin
- The alternative pin mappingpublic boolean hasAltPinMappings()
public Map<String,AltPinMapping> getAltPinMappings()
public EDIFCell getParentCell()
Vivado Tcl:
get_property PARENT $this
public boolean isLocked()
public void setNullBEL(boolean b)
b
- True for a null BEL/element, false otherwise.public boolean isNullBEL()
public void setLocked(boolean isLocked)
isLocked
- True to mark this cell as locked, false as unlocked.public boolean isBELFixed()
Vivado Tcl:
get_property IS_BEL_FIXED $this
public void setBELFixed(boolean isBELFixed)
Vivado Tcl:
set_property IS_BEL_FIXED $isBELFIXED $this
isBELFixed
- The desired value for IS_BEL_FIXEDpublic boolean isSiteFixed()
Vivado Tcl:
get_property IS_LOC_FIXED $this
public void setSiteFixed(boolean isSiteFixed)
Vivado Tcl:
set_property IS_LOC_FIXED $isSiteFixed $this
isSiteFixed
- The desired value for IS_LOC_FIXEDpublic boolean isRoutethru()
Vivado GUI:
Select the BEL, it will be lightly colored, but no logical cell will be placed there.
public void setRoutethru(boolean isRoutethru)
isRoutethru
- True for routethru, false if not.public String debugToString()
public String toString()
toString
in class Object
public String getType()
Vivado Tcl:
get_property REF_NAME $this
public void setType(String type)
type
- the type to setpublic void setAltBlockedSiteType(SiteTypeEnum typeEnum)
typeEnum
- The alternate type to setpublic SiteTypeEnum getAltBlockedSiteType()
public String getSiteWireNameFromLogicalPin(String logicalPinName)
Vivado GUI:
Select cell in GUI, highlight each pin until cell pin matches, select connecting site wire
logicalPinName
- The logical pin name of interest.public String getSiteWireNameFromPhysicalPin(String physicalPinName)
Vivado GUI:
Select cell in GUI, highlight each pin until BEL pin matches, select connecting site wire
physicalPinName
- Name of the physical BEL pin used by the cell.public void unplace()
Vivado Tcl:
unplace_cell $this
public EDIFPropertyValue addProperty(String key, String value, EDIFValueType type)
Vivado Tcl:
set_property $key $value $this
key
- Name of the propertyvalue
- The valuetype
- The EDIF value typepublic EDIFPropertyValue addProperty(String key, String value)
Vivado Tcl:
set_property $key $value $this
key
- Name of the propertyvalue
- The EDIF value as a string.public EDIFPropertyValue addProperty(String key, boolean value)
Vivado Tcl:
set_property $key $value $this
key
- Name of the propertyvalue
- The EDIF value as a boolean.public EDIFPropertyValue addProperty(String key, int value)
Vivado Tcl:
set_property $key $value $this
key
- Name of the propertyvalue
- The EDIF value as an int.public EDIFPropertyValue getProperty(String key)
Vivado Tcl:
get_property $key $this
key
- The name of the property key to getpublic String getPropertyValueString(String key)
key
- The name of the property to getpublic Map<String,EDIFPropertyValue> getProperties()
EDIFCellInst
) corresponding to this cell.public void setPropertiesMap(Map<String,EDIFPropertyValue> properties)
EDIFCellInst
)properties
- Map of EDIF key/value pairs to setpublic void connectStaticSourceToPins(NetType type, String... myPins)
Vivado Tcl:
route_design -net [get_nets $type]
type
- Static net type (VDD or GND).myPins
- One or more logical pin names desired to connect to the provided static net.public void connectStaticSourceToPin(NetType type, String logicalPinName)
Vivado Tcl:
route_design -net [get_nets $type]
type
- Static net type (VDD or GND).logicalPinName
- Name of the logical cell pin to connect to the provided static net.public SitePinInst getSitePinFromPortInst(EDIFPortInst p, List<String> siteWires)
p
- The port inst on the logical cell to trace from.siteWires
- To be passed an empty list if the caller wants a list
of site wire names occupied by the path from the logical pin to the site pin.public List<SitePinInst> getAllSitePinsFromPortInst(EDIFPortInst p, List<String> siteWires)
p
- The port inst on the logical cell to trace from.siteWires
- To be passed an empty list if the caller wants a list
of site wire names occupied by the path from the logical pin to the site pin.public BELPin getBELPin(EDIFHierPortInst p)
p
- The port inst of the pin of interest on the cell.public BELPin getBELPin(EDIFPortInst p)
p
- The port inst of the pin of interest on the cell.public SitePinInst getSitePinFromLogicalPin(String logicalPinName, List<String> siteWires)
logicalPinName
- Name of the logical pin on the cell to trace.siteWires
- To be passed an empty list if the caller wants a list
of site wire names occupied by the path from the logical pin to the site pin.public List<SitePinInst> getAllSitePinsFromLogicalPin(String logicalPinName, List<String> siteWires)
logicalPinName
- Name of the logical pin on the cell to trace.siteWires
- To be passed an empty list if the caller wants a list
of site wire names occupied by the path from the logical pin to the site pin.public String getDefaultPinMapping(String logicalPinName)
logicalPin
- Name of the logical pin on the cell to be mapped.public List<String> getAllCorrespondingSitePinNames(String logicalPinName, List<String> siteWires, boolean considerLutRoutethru)
logicalPinName
- siteWires
- Pass as an optional empty list to accumulate the site wires used
in getting from the logical pin to a site pin.public String getCorrespondingSitePinName(String logicalPinName, String physPinName, List<String> siteWires)
logicalPinName
- physPinName
- siteWires
- Pass as an optional empty list to accumulate the site wires used
in getting from the logical pin to a site pin.public Map<SiteTypeEnum,Set<String>> getCompatiblePlacements(Device device)
device
- Device object.public String getCorrespondingSitePinName(String logicalPinName)
Vivado GUI:
Select cell in GUI, select cell pin, select connecting site wire
logicalPinName
- public List<String> getAllCorrespondingSitePinNames(String logicalPinName)
Vivado GUI:
Select cell in GUI, select cell pin, select connecting site wire
logicalPinName
- public List<String> getAllCorrespondingSitePinNames(String logicalPinName, boolean considerLutRoutethru)
Vivado GUI:
Select cell in GUI, select cell pin, select connecting site wire
logicalPinName
- considerLutRoutethru
- public SitePinInst unrouteLogicalPinInSite(String logicalPinName)
Vivado Tcl:
route_design -unroute [get_nets -of [get_pins $cell/$logicalPinName]
logicalPinName
- Name of the logical pin to unroutepublic int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object