Skip to content

Commit 7fb223d

Browse files
committed
Merge branch '2025.2.1' into array_builder
Signed-off-by: Chris Lavin <[email protected]>
2 parents 0b8c32d + 1116dfb commit 7fb223d

File tree

11 files changed

+567
-170
lines changed

11 files changed

+567
-170
lines changed

.classpath

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
<classpathentry kind="lib" path="jars/kryo-5.2.1.jar"/>
3434
<classpathentry kind="lib" path="jars/minlog-1.3.1.jar"/>
3535
<classpathentry kind="lib" path="jars/jython-standalone-2.7.2.jar"/>
36-
<classpathentry kind="lib" path="jars/rapidwright-api-lib-2025.2.0.jar">
36+
<classpathentry kind="lib" path="jars/rapidwright-api-lib-2025.2.1-rc1.jar">
3737
<attributes>
38-
<attribute name="javadoc_location" value="jar:platform:/resource/RapidWright/jars/rapidwright-api-lib-2025.2.0-javadoc.jar!/"/>
38+
<attribute name="javadoc_location" value="jar:platform:/resource/RapidWright/jars/rapidwright-api-lib-2025.2.1-rc1-javadoc.jar!/"/>
3939
</attributes>
4040
</classpathentry>
4141
<classpathentry kind="lib" path="jars/jgrapht-core-1.3.0.jar"/>

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
pull_request:
66

77
env:
8-
RAPIDWRIGHT_VERSION: v2025.2.0-beta
8+
RAPIDWRIGHT_VERSION: v2025.2.1-rc1-beta
99

1010

1111
jobs:

python/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
setup(
2626
name='rapidwright',
27-
version='2025.1.3',
27+
version='2025.2.0',
2828
license='Apache 2.0 and Others',
2929
description='Xilinx RapidWright Framework Wrapped for Python.',
3030
long_description='',

python/src/rapidwright/rapidwright.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from typing import List, Optional
2525
import os, urllib.request, platform
2626

27-
version='2025.1.3'
27+
version='2025.2.0'
2828

2929
def start_jvm():
3030
os_str = 'lin64'

src/com/xilinx/rapidwright/design/DesignTools.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3854,8 +3854,10 @@ private static boolean isFlipFlopOrLatchNeedingCeSrToVcc(String cellType) {
38543854
return flipFlopAndLatchTypesNeedingCeSrToVcc.contains(cellType);
38553855
}
38563856

3857-
/** Mapping from device Series to another mapping from FF BEL name to CKEN/SRST site pin name **/
3857+
/** Mapping from device Series to another mapping from FF BEL name to CKEN/SRST site pin name */
38583858
static public final Map<Series, Map<String, Pair<String, String>>> belTypeSitePinNameMapping;
3859+
/** Mapping from device Series to ctrl set pins connected FF BEL site names */
3860+
static public final Map<Series, Map<String, List<String>>> ctrlPinFFMapping;
38593861
static{
38603862
belTypeSitePinNameMapping = new EnumMap<Series, Map<String, Pair<String, String>>>(Series.class);
38613863
Pair<String,String> p;
@@ -3952,6 +3954,17 @@ private static boolean isFlipFlopOrLatchNeedingCeSrToVcc(String cellType) {
39523954
versal.put("HFF", p);
39533955
versal.put("HFF2", p);
39543956
}
3957+
3958+
ctrlPinFFMapping = new HashMap<>();
3959+
for (Entry<Series, Map<String, Pair<String, String>>> e : belTypeSitePinNameMapping.entrySet()) {
3960+
Map<String, List<String>> map = new HashMap<>();
3961+
for (Entry<String, Pair<String, String>> e2 : e.getValue().entrySet()) {
3962+
for (String pin : new String[] {e2.getValue().getFirst(), e2.getValue().getSecond()}) {
3963+
map.computeIfAbsent(pin, l -> new ArrayList<>()).add(e2.getKey());
3964+
}
3965+
}
3966+
ctrlPinFFMapping.put(e.getKey(), map);
3967+
}
39553968
}
39563969

39573970
/**

src/com/xilinx/rapidwright/design/blocks/PBlock.java

Lines changed: 33 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,14 @@ public PBlock(Device dev, Set<Site> sites) {
132132
else slices.addAll(slicems == null ? Collections.emptyList() : slicems);
133133
PBlockRange sliceRange = createPBlockRange(dev, slices);
134134
if (sliceRange != null) add(sliceRange);
135+
136+
// IRI_QUADs are a special case
137+
List<Site> iriQuadOdds = typeSets.remove(SiteTypeEnum.IRI_QUAD_ODD);
138+
List<Site> iriQuadEvens = typeSets.remove(SiteTypeEnum.IRI_QUAD_EVEN);
139+
if (iriQuadOdds == null) iriQuadOdds = iriQuadEvens == null ? Collections.emptyList() : iriQuadEvens;
140+
else iriQuadOdds.addAll(iriQuadEvens == null ? Collections.emptyList() : iriQuadEvens);
141+
PBlockRange iriQuadRange = createPBlockRange(dev, iriQuadOdds);
142+
if (iriQuadRange != null) add(iriQuadRange);
135143
// Rest of site types
136144
for (Entry<SiteTypeEnum,ArrayList<Site>> e : typeSets.entrySet()) {
137145
add(createPBlockRange(dev, e.getValue()));
@@ -429,100 +437,38 @@ public PBlock createNewPblockAt(Site placement) {
429437
/**
430438
* Attempts to move the pblock by an offset of tiles in the x and y directions.
431439
* @param dx The number of tiles to move the pblock in the x direction.
432-
* @param dy The number of tiles to mvoe the pblock in the y direction.
440+
* @param dy The number of tiles to move the pblock in the y direction.
433441
* @return True if the pblock ranges changed, false if no move was made.
434442
*/
435443
public boolean movePBlock(int dx, int dy) {
436444
if (dx == 0 && dy == 0) return false;
437-
Tile bl = getBottomLeftTile();
438-
Tile tr = getTopRightTile();
439-
Device d = tr.getDevice();
440-
boolean hasMoved = false;
441-
if (dx != 0) {
442-
if (dx > 0) {
443-
// moving to the right, check the columns to the right most tile
444-
for (PBlockRange pbr : this) {
445-
int x = 0;
446-
Site right = pbr.getUpperRightSite().getNeighborSite(x, 0);
447-
int target = right.getTile().getColumn() + dx;
448-
while (right.getTile().getColumn() < target) {
449-
x++;
450-
right = pbr.getUpperRightSite().getNeighborSite(x, 0);
451-
if (right.getTile().getColumn() <= target) {
452-
hasMoved = true;
453-
}
454-
}
455-
if (hasMoved) {
456-
pbr.setUpperRight(right);
457-
Site otherCorner = pbr.getLowerLeftSite().getNeighborSite(x, 0);
458-
pbr.setLowerLeft(otherCorner);
459-
}
460-
}
461-
} else {
462-
// moving to the left, check the columns to the left most tile
463-
for (PBlockRange pbr : this) {
464-
int x = 0;
465-
Site left = pbr.getLowerLeftSite().getNeighborSite(x, 0);
466-
int target = left.getTile().getColumn() + dx;
467-
while (left.getTile().getColumn() > target) {
468-
x--;
469-
left = pbr.getLowerLeftSite().getNeighborSite(x, 0);
470-
if (left.getTile().getColumn() >= target) {
471-
hasMoved = true;
472-
}
473-
}
474-
if (hasMoved) {
475-
pbr.setLowerLeft(left);
476-
Site otherCorner = pbr.getUpperRightSite().getNeighborSite(x, 0);
477-
pbr.setUpperRight(otherCorner);
478-
}
479-
}
480-
445+
List<PBlockRange> pBlockRanges = new ArrayList<>();
446+
for (PBlockRange pbr : this) {
447+
Tile left = pbr.getBottomLeftTile();
448+
int siteIndex = pbr.getLowerLeftSite().getSiteIndexInTile();
449+
Tile newLeft = left.getTileNeighbor(dx, -dy);
450+
Site leftSite = pbr.getLowerLeftSite();
451+
if (newLeft == null || leftSite.getCorrespondingSite(leftSite.getSiteTypeEnum(), newLeft) == null) {
452+
return false;
481453
}
482-
}
483-
if (dy != 0) {
484-
if (dy > 0) {
485-
// moving down, check tiles below
486-
for (PBlockRange pbr : this) {
487-
int y = 0;
488-
Site left = pbr.getLowerLeftSite().getNeighborSite(0, y);
489-
int target = left.getTile().getRow() + dy;
490-
while (left.getTile().getRow() < target) {
491-
y--;
492-
left = pbr.getLowerLeftSite().getNeighborSite(0, y);
493-
if (left.getTile().getRow() <= target) {
494-
hasMoved = true;
495-
}
496-
}
497-
if (hasMoved) {
498-
pbr.setLowerLeft(left);
499-
Site otherCorner = pbr.getUpperRightSite().getNeighborSite(0, y);
500-
pbr.setUpperRight(otherCorner);
501-
}
502-
}
503-
} else {
504-
// moving up, check the rows above
505-
for (PBlockRange pbr : this) {
506-
int y = 0;
507-
Site right = pbr.getUpperRightSite().getNeighborSite(0, y);
508-
int target = right.getTile().getRow() + dy;
509-
while (right.getTile().getRow() > target) {
510-
y++;
511-
right = pbr.getUpperRightSite().getNeighborSite(0, y);
512-
if (right.getTile().getRow() >= target) {
513-
hasMoved = true;
514-
}
515-
}
516-
if (hasMoved) {
517-
pbr.setUpperRight(right);
518-
Site otherCorner = pbr.getLowerLeftSite().getNeighborSite(0, y);
519-
pbr.setLowerLeft(otherCorner);
520-
}
521-
}
522-
454+
Site newLeftSite = newLeft.getSites()[siteIndex];
455+
Tile right = pbr.getTopRightTile();
456+
Tile newRight = right.getTileNeighbor(dx, -dy);
457+
Site rightSite = pbr.getUpperRightSite();
458+
if (newRight == null || rightSite.getCorrespondingSite(rightSite.getSiteTypeEnum(), newRight) == null) {
459+
return false;
523460
}
461+
int upperRightSiteIndex = pbr.getUpperRightSite().getSiteIndexInTile();
462+
Site otherCorner = newRight.getSites()[upperRightSiteIndex];
463+
pBlockRanges.add(new PBlockRange(newLeftSite, otherCorner));
464+
}
465+
int i = 0;
466+
for (PBlockRange pbr : pBlockRanges) {
467+
this.get(i).setLowerLeft(pbr.getLowerLeftSite());
468+
this.get(i).setUpperRight(pbr.getUpperRightSite());
469+
i++;
524470
}
525-
return hasMoved;
471+
return true;
526472
}
527473

528474
public static void main(String[] args) {

0 commit comments

Comments
 (0)