Skip to content

Commit 8222132

Browse files
committed
Address review comments
Signed-off-by: Eddie Hung <[email protected]>
1 parent ad8d152 commit 8222132

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

src/com/xilinx/rapidwright/interchange/DeviceResourcesWriter.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ public class DeviceResourcesWriter {
117117
private static DelayEstimatorBase delayEstimator;
118118
private static DelayModel intrasiteAndLogicDelayModel;
119119

120+
private static final float PICSECONDS_TO_SECONDS = 1e-12f;
121+
120122
public static void populateSiteEnumerations(SiteInst siteInst, Site site) {
121123
if (!siteTypes.containsKey(siteInst.getSiteTypeEnum())) {
122124
if (site.getSiteTypeEnum() != siteInst.getSiteTypeEnum()) {
@@ -662,7 +664,7 @@ public static void writeAllSiteTypesToBuilder(Design design, Device device, Devi
662664
if (delayPs != null && delayPs > 0) {
663665
DeviceResources.Device.CornerModel.Builder delayBuilder = spBuilder.initDelay();
664666
DeviceResources.Device.CornerModelValues.Builder slowBuilder = delayBuilder.initSlow().initSlow();
665-
slowBuilder.initMax().setMax(delayPs * 1e-12f);
667+
slowBuilder.initMax().setMax(delayPs * PICSECONDS_TO_SECONDS);
666668
}
667669
}
668670
}
@@ -855,7 +857,7 @@ public static Map<TileTypeEnum, Integer> writeAllTileTypesToBuilder(Design desig
855857
DeviceResources.Device.PIPTiming.Builder timingBuilder = pipTimingsBuilder.get(index);
856858
DeviceResources.Device.CornerModel.Builder delayBuilder = timingBuilder.initInternalDelay();
857859
DeviceResources.Device.CornerModelValues.Builder slowBuilder = delayBuilder.initSlow().initSlow();
858-
slowBuilder.initMax().setMax(slowMaxDelayPs * 1e-12f);
860+
slowBuilder.initMax().setMax(slowMaxDelayPs * PICSECONDS_TO_SECONDS);
859861
}
860862

861863
return tileTypeIndicies;
@@ -961,7 +963,7 @@ public static void writeAllWiresAndNodesToBuilder(Device device, DeviceResources
961963
DeviceResources.Device.CornerModelValues.Builder resBuilder = timingBuilder.initResistance().initSlow().initSlow();
962964
resBuilder.initMax().setMax(slowMaxDelayPs);
963965
DeviceResources.Device.CornerModelValues.Builder capBuilder = timingBuilder.initCapacitance().initSlow().initSlow();
964-
capBuilder.initMax().setMax(1e-12f);
966+
capBuilder.initMax().setMax(PICSECONDS_TO_SECONDS);
965967
}
966968
}
967969
private static void populatePackages(StringEnumerator allStrings, Device device, DeviceResources.Device.Builder devBuilder) {

src/com/xilinx/rapidwright/timing/DelayModel.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,13 @@ public interface DelayModel {
5353
/**
5454
* Get the delay in ps between two bel pins within the given site name.
5555
*
56-
* @param siteTypeName The name of the site type, such as SLICEL and SLICEM.
56+
* @param siteType The SiteTypeEnum of BEL site, such as SLICEL and SLICEM.
5757
* @param frBelPin The bel pin which is the driver of the connection. Thus, it must be a bel output pin.
5858
* The bel name must be included, ie., AFF2/D. An input site pin is considered a valid frBelPin.
5959
* @param toBelPin The bel pin which is the sink of the connection (a bel input pin, or an output site pin).
60-
* @return Intra-site delay in ps. Return -1 if the connection does not exist.
61-
* @throws IllegalArgumentException if the given siteTypeName is not recognized by the model.
60+
* @return Intra-site delay in ps. Return null if the connection does not exist.
6261
*/
63-
public Short getIntraSiteDelay(SiteTypeEnum siteTypeName, String frBelPin, String toBelPin);
62+
public Short getIntraSiteDelay(SiteTypeEnum siteType, String frBelPin, String toBelPin);
6463

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

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

src/com/xilinx/rapidwright/timing/SmallDelayModel.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ public Short getBELIndex(String belName) {
6565
/**
6666
* Implement the method with the same signature defined in DelayModel interface.
6767
*/
68-
public Short getIntraSiteDelay(SiteTypeEnum siteTypeName, String frBelPin, String toBelPin) {
68+
public Short getIntraSiteDelay(SiteTypeEnum siteType, String frBelPin, String toBelPin) {
6969
boolean verbose = false;
7070
Short delay;
71-
Short idx = site2IdxMap.get(siteTypeName.name());
71+
Short idx = site2IdxMap.get(siteType.name());
7272
if (idx == null) {
7373
return null;
7474
// throw new IllegalArgumentException("SmallDelayModel: Unknown site/belName to getIntraSiteDelay."
@@ -80,7 +80,7 @@ public Short getIntraSiteDelay(SiteTypeEnum siteTypeName, String frBelPin, Strin
8080
if (delay == null) {
8181
if (verbose) {
8282
System.out.println("WARNING in SmallDelayModel: Unknown connection to getIntraSiteDelay."
83-
+ " site/belName " + siteTypeName + " frBelPin " + frBelPin + " toBelPin " + toBelPin);
83+
+ " site/belName " + siteType + " frBelPin " + frBelPin + " toBelPin " + toBelPin);
8484
}
8585
}
8686
}

0 commit comments

Comments
 (0)