Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Eddie Hung <[email protected]>
  • Loading branch information
eddieh-xlnx committed Jun 13, 2024
1 parent ad8d152 commit 8222132
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ public class DeviceResourcesWriter {
private static DelayEstimatorBase delayEstimator;
private static DelayModel intrasiteAndLogicDelayModel;

private static final float PICSECONDS_TO_SECONDS = 1e-12f;

public static void populateSiteEnumerations(SiteInst siteInst, Site site) {
if (!siteTypes.containsKey(siteInst.getSiteTypeEnum())) {
if (site.getSiteTypeEnum() != siteInst.getSiteTypeEnum()) {
Expand Down Expand Up @@ -662,7 +664,7 @@ public static void writeAllSiteTypesToBuilder(Design design, Device device, Devi
if (delayPs != null && delayPs > 0) {
DeviceResources.Device.CornerModel.Builder delayBuilder = spBuilder.initDelay();
DeviceResources.Device.CornerModelValues.Builder slowBuilder = delayBuilder.initSlow().initSlow();
slowBuilder.initMax().setMax(delayPs * 1e-12f);
slowBuilder.initMax().setMax(delayPs * PICSECONDS_TO_SECONDS);
}
}
}
Expand Down Expand Up @@ -855,7 +857,7 @@ public static Map<TileTypeEnum, Integer> writeAllTileTypesToBuilder(Design desig
DeviceResources.Device.PIPTiming.Builder timingBuilder = pipTimingsBuilder.get(index);
DeviceResources.Device.CornerModel.Builder delayBuilder = timingBuilder.initInternalDelay();
DeviceResources.Device.CornerModelValues.Builder slowBuilder = delayBuilder.initSlow().initSlow();
slowBuilder.initMax().setMax(slowMaxDelayPs * 1e-12f);
slowBuilder.initMax().setMax(slowMaxDelayPs * PICSECONDS_TO_SECONDS);
}

return tileTypeIndicies;
Expand Down Expand Up @@ -961,7 +963,7 @@ public static void writeAllWiresAndNodesToBuilder(Device device, DeviceResources
DeviceResources.Device.CornerModelValues.Builder resBuilder = timingBuilder.initResistance().initSlow().initSlow();
resBuilder.initMax().setMax(slowMaxDelayPs);
DeviceResources.Device.CornerModelValues.Builder capBuilder = timingBuilder.initCapacitance().initSlow().initSlow();
capBuilder.initMax().setMax(1e-12f);
capBuilder.initMax().setMax(PICSECONDS_TO_SECONDS);
}
}
private static void populatePackages(StringEnumerator allStrings, Device device, DeviceResources.Device.Builder devBuilder) {
Expand Down
13 changes: 5 additions & 8 deletions src/com/xilinx/rapidwright/timing/DelayModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,13 @@ public interface DelayModel {
/**
* Get the delay in ps between two bel pins within the given site name.
*
* @param siteTypeName The name of the site type, such as SLICEL and SLICEM.
* @param siteType The SiteTypeEnum of BEL site, such as SLICEL and SLICEM.
* @param frBelPin The bel pin which is the driver of the connection. Thus, it must be a bel output pin.
* The bel name must be included, ie., AFF2/D. An input site pin is considered a valid frBelPin.
* @param toBelPin The bel pin which is the sink of the connection (a bel input pin, or an output site pin).
* @return Intra-site delay in ps. Return -1 if the connection does not exist.
* @throws IllegalArgumentException if the given siteTypeName is not recognized by the model.
* @return Intra-site delay in ps. Return null if the connection does not exist.
*/
public Short getIntraSiteDelay(SiteTypeEnum siteTypeName, String frBelPin, String toBelPin);
public Short getIntraSiteDelay(SiteTypeEnum siteType, String frBelPin, String toBelPin);

/**
* Get the delay between input and output pins of a bel.
Expand All @@ -74,8 +73,7 @@ public interface DelayModel {
* Where to get the config's value from the design?
* There is no uniform way to find the value. It is to determined per case.
* For example, some configs of carry8 is from bel, while some from cell.
* @return Logic delay in ps. Return -1 if the connection does not exist.
* @throws IllegalArgumentException if the given bel is not recognized by the model.
* @return Logic delay in ps. Return null if the connection does not exist.
*/
public Short getLogicDelay(short belIdx, String frBelPin, String toBelPin, int encodedConfig);

Expand All @@ -85,8 +83,7 @@ public interface DelayModel {
* @param belIdx The unique BEL timing model index, see {@link #getBELIndex(String)}.
* @param frBelPin An input bel pin. It must NOT include bel name.
* @param toBelPin An output bel pin. It must NOT include bel name.
* @return Logic delay in ps. Return -1 if the connection does not exist.
* @throws IllegalArgumentException if the given bel is not recognized by the model.
* @return Logic delay in ps. Return null if the connection does not exist.
*/
public Short getLogicDelay(short belIdx, String frBelPin, String toBelPin);

Expand Down
6 changes: 3 additions & 3 deletions src/com/xilinx/rapidwright/timing/SmallDelayModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ public Short getBELIndex(String belName) {
/**
* Implement the method with the same signature defined in DelayModel interface.
*/
public Short getIntraSiteDelay(SiteTypeEnum siteTypeName, String frBelPin, String toBelPin) {
public Short getIntraSiteDelay(SiteTypeEnum siteType, String frBelPin, String toBelPin) {
boolean verbose = false;
Short delay;
Short idx = site2IdxMap.get(siteTypeName.name());
Short idx = site2IdxMap.get(siteType.name());
if (idx == null) {
return null;
// throw new IllegalArgumentException("SmallDelayModel: Unknown site/belName to getIntraSiteDelay."
Expand All @@ -80,7 +80,7 @@ public Short getIntraSiteDelay(SiteTypeEnum siteTypeName, String frBelPin, Strin
if (delay == null) {
if (verbose) {
System.out.println("WARNING in SmallDelayModel: Unknown connection to getIntraSiteDelay."
+ " site/belName " + siteTypeName + " frBelPin " + frBelPin + " toBelPin " + toBelPin);
+ " site/belName " + siteType + " frBelPin " + frBelPin + " toBelPin " + toBelPin);
}
}
}
Expand Down

0 comments on commit 8222132

Please sign in to comment.