Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RWRoute] Further cleanup #1070

Merged
merged 45 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
f405faf
[RWRoute] Remove unnecessary overrides
eddieh-xlnx Sep 24, 2024
930aa99
[Connection] getNodes() to return empty list not null
eddieh-xlnx Sep 24, 2024
e6f9605
Improve TestRWRoute.testNonTimingDrivenPartialRouting()
eddieh-xlnx Sep 24, 2024
c1fcf1f
[PartialRouter] isAccessible() to always allow preserved nets
eddieh-xlnx Sep 24, 2024
d92ab01
[PartialRouter] Abandon unrouteable connections
eddieh-xlnx Sep 24, 2024
aca84f2
[PartialRouter] Check sink routability after preserveAsync()
eddieh-xlnx Sep 24, 2024
5fd643b
Tidy up
eddieh-xlnx Sep 24, 2024
4c1048e
[RWRoute] Lazy source swapping
eddieh-xlnx Sep 24, 2024
34badd7
Add messaging
eddieh-xlnx Sep 24, 2024
7181115
Try removing stashedPrev
eddieh-xlnx Sep 24, 2024
91aa14b
Missing !
eddieh-xlnx Sep 24, 2024
7091c8a
Fix abandoning connections for unpreservable
eddieh-xlnx Sep 24, 2024
0698be2
RWRoute to not pre-emptively set up second source
eddieh-xlnx Sep 25, 2024
3bce2ee
Refactor output pin swapping/connection abandonment
eddieh-xlnx Sep 25, 2024
b0de24b
Abandon connections with message, and remove from sorted
eddieh-xlnx Sep 25, 2024
b8ad542
Fix for nets with direct and indirect connections
eddieh-xlnx Sep 25, 2024
9857956
Refactor into RWRoute.saveRoutingSource()
eddieh-xlnx Sep 25, 2024
ce6edd8
Refactor
eddieh-xlnx Sep 25, 2024
9e64488
Remove stale comment
eddieh-xlnx Sep 25, 2024
f6e4a77
Cache result of finding alt source pins
eddieh-xlnx Sep 25, 2024
c233041
Inline trivial method
eddieh-xlnx Sep 25, 2024
a3d6dbc
NetWrapper.getAltSource() to compute altSourceRnode when pin already …
eddieh-xlnx Sep 25, 2024
ac6f796
Allow promotion for PINBOUNCE to PINFEED_I
eddieh-xlnx Sep 25, 2024
60fbb6e
Fix assertion in RWRoute.push()
eddieh-xlnx Sep 25, 2024
c5342e0
Fix broken assumptions
eddieh-xlnx Sep 25, 2024
65db026
Move RWRoute.setupAlternateSource() to Connection.getOrCreateAlternat…
eddieh-xlnx Sep 25, 2024
6b8eb10
Fix RWRoute.saveRouting() return value
eddieh-xlnx Sep 25, 2024
47af493
Consistency
eddieh-xlnx Sep 26, 2024
3360069
Reverse whitespace change
eddieh-xlnx Sep 26, 2024
4b11044
Bump copyright
eddieh-xlnx Sep 26, 2024
de4504f
Direct connection if sink cannot be projected
eddieh-xlnx Sep 26, 2024
39866ca
Apply suggestions from code review
eddieh-xlnx Sep 26, 2024
94ce54c
Merge remote-tracking branch 'upstream/master' into rwroute_cleanup
eddieh-xlnx Sep 26, 2024
6ef43cb
Set random seed for Test.testNonTimingDrivenPartialRouting()
eddieh-xlnx Sep 26, 2024
3611209
Condition to avoid extra work
eddieh-xlnx Sep 26, 2024
6caa610
Move getPreservedNet() call to after
eddieh-xlnx Sep 26, 2024
a83acd4
Remove unused method
eddieh-xlnx Sep 26, 2024
12348ce
Try AtomicReferenceArray instead of ConcurrentHashMap
eddieh-xlnx Sep 26, 2024
dcfe994
Revert RapidWrightDCP submodule
eddieh-xlnx Sep 26, 2024
cb57eb2
Revert "Try AtomicReferenceArray instead of ConcurrentHashMap"
eddieh-xlnx Sep 26, 2024
f4ab6dc
Revert [PartialRouter] isAccessible() to always allow preserved nets
eddieh-xlnx Sep 26, 2024
aed25d3
Add TODO
eddieh-xlnx Sep 26, 2024
8074703
Add PartialRouter.saveRouting() override
eddieh-xlnx Sep 26, 2024
aee5bc0
Merge branch '2024.1.3' into rwroute_cleanup
eddieh-xlnx Sep 26, 2024
d006b61
Apply suggestions from code review
eddieh-xlnx Sep 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 25 additions & 12 deletions src/com/xilinx/rapidwright/rwroute/Connection.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
*
* Copyright (c) 2021 Ghent University.
* Copyright (c) 2022-2023, Advanced Micro Devices, Inc.
* Copyright (c) 2022-2024, Advanced Micro Devices, Inc.
* All rights reserved.
*
* Author: Yun Zhou, Ghent University.
Expand Down Expand Up @@ -34,6 +34,7 @@
import com.xilinx.rapidwright.device.Node;
import com.xilinx.rapidwright.timing.TimingEdge;
import com.xilinx.rapidwright.timing.delayestimator.DelayEstimatorBase;
import com.xilinx.rapidwright.util.Pair;

/**
* A Connection instance represents a pair of source-sink {@link SitePinInst} instances of a {@link Net} instance.
Expand All @@ -49,7 +50,6 @@ public class Connection implements Comparable<Connection>{
* They are created based on the INT tile nodes the source and sink SitePinInsts connect to, respectively.
*/
private RouteNode sourceRnode;
private RouteNode altSourceRnode;
private RouteNode sinkRnode;
private List<RouteNode> altSinkRnodes;
/**
Expand Down Expand Up @@ -273,7 +273,6 @@ public float getCriticality() {

public void resetRoute() {
getRnodes().clear();
sink.setRouted(false);
}

public RouteNode getSourceRnode() {
Expand All @@ -284,14 +283,6 @@ public void setSourceRnode(RouteNode sourceNode) {
sourceRnode = sourceNode;
}

public RouteNode getAltSourceRnode() {
return altSourceRnode;
}

public void setAltSourceRnode(RouteNode altSourceNode) {
altSourceRnode = altSourceNode;
}

public RouteNode getSinkRnode() {
return sinkRnode;
}
Expand Down Expand Up @@ -361,6 +352,7 @@ public SitePinInst getSource() {
}

public void setSource(SitePinInst source) {
assert(source != null);
this.source = source;
}

Expand Down Expand Up @@ -413,7 +405,7 @@ public boolean isCrossSLR() {
}

public List<Node> getNodes() {
return nodes;
return nodes == null ? Collections.emptyList() : nodes;
}

public void setNodes(List<Node> nodes) {
Expand Down Expand Up @@ -498,4 +490,25 @@ public void setAllTargets(RWRoute.ConnectionState state) {
}
}
}

protected Pair<SitePinInst,RouteNode> getOrCreateAlternateSource(RouteNodeGraph routingGraph) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this method intend to do in the context of Versal? In UltraScale+ there is only one other option, but there might be a preference of one vs another given the choices in Versal and the context. Not saying this has to implement Versal, but we should be aware of the soon-to-be-added context.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's clean up UltraScale/UltraScale+ before we consider Versal. I think there's some other RapidWright infrastructure upgrades that needs to happen before Versal's alternate sources can really be captured.

SitePinInst altSource = netWrapper.getOrCreateAlternateSource(routingGraph);
if (altSource == null) {
return null;
}

Net net = netWrapper.getNet();
RouteNode altSourceRnode;
if (source.equals(net.getSource())) {
altSourceRnode = netWrapper.getAltSourceRnode();
} else {
assert(source.equals(net.getAlternateSource()));
altSource = net.getSource();
assert(altSource != null);
altSourceRnode = netWrapper.getSourceRnode();
}

assert(altSourceRnode != null);
return new Pair<>(altSource, altSourceRnode);
}
}
54 changes: 53 additions & 1 deletion src/com/xilinx/rapidwright/rwroute/NetWrapper.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
*
* Copyright (c) 2021 Ghent University.
* Copyright (c) 2022-2023, Advanced Micro Devices, Inc.
* Copyright (c) 2022-2024, Advanced Micro Devices, Inc.
* All rights reserved.
*
* Author: Yun Zhou, Ghent University.
Expand All @@ -27,7 +27,10 @@
import java.util.ArrayList;
import java.util.List;

import com.xilinx.rapidwright.design.DesignTools;
import com.xilinx.rapidwright.design.Net;
import com.xilinx.rapidwright.design.SitePinInst;
import com.xilinx.rapidwright.device.Node;

/**
* A wrapper class of {@link Net} with additional information for the router.
Expand All @@ -44,11 +47,15 @@ public class NetWrapper{
private float yCenter;
/** The half-perimeter wirelength */
private short doubleHpwl;
boolean noAltSourceFound;
private RouteNode sourceRnode;
private RouteNode altSourceRnode;

public NetWrapper(int id, Net net) {
this.id = id;
this.net = net;
connections = new ArrayList<>();
noAltSourceFound = false;
}

public void computeHPWLAndCenterCoordinates(int[] nextLagunaColumn, int[] prevLagunaColumn) {
Expand Down Expand Up @@ -128,4 +135,49 @@ public int hashCode() {
return id;
}

public RouteNode getSourceRnode() {
return sourceRnode;
}

public void setSourceRnode(RouteNode sourceRnode) {
this.sourceRnode = sourceRnode;
}

public SitePinInst getOrCreateAlternateSource(RouteNodeGraph routingGraph) {
if (noAltSourceFound) {
return null;
}

SitePinInst altSource = net.getAlternateSource();
if (altSource == null) {
altSource = DesignTools.getLegalAlternativeOutputPin(net);
if (altSource == null) {
noAltSourceFound = true;
return null;
}

net.addPin(altSource);
DesignTools.routeAlternativeOutputSitePin(net, altSource);
}
if (altSourceRnode == null) {
Node altSourceNode = RouterHelper.projectOutputPinToINTNode(altSource);
if (altSourceNode == null) {
noAltSourceFound = true;
return null;
}

if (routingGraph.isPreserved(altSourceNode)) {
noAltSourceFound = true;
return null;
}

altSourceRnode = routingGraph.getOrCreate(altSourceNode, RouteNodeType.PINFEED_O);
}
assert(altSourceRnode != null);
return altSource;
}

public RouteNode getAltSourceRnode() {
return altSourceRnode;
}
}
Loading
Loading