Total Wire Length Calculation

41 views
Skip to first unread message

BOYANG ZHANG

unread,
Sep 9, 2020, 11:22:10 PM9/9/20
to RapidWright
Howdy people in rapidwright,

I used Vivado to place my design and generate the post placement .dcp file and now I am tying to calculate the total wire length of my design.

But I cannot find a way to calculate the total wire length using vivado directly. I wonder if there is a way to calculate the total wire length by rapidwright?

Thank you for your help.

RapidWright

unread,
Sep 10, 2020, 7:34:41 PM9/10/20
to RapidWright
Although there are a number of ways to determine wire length, here is a brute force, naive attempt by just using a Manhattan Distance approach to each physical net's source pin to each sink pin.  This is probably pessimistic in the sense that nets with fan out greater than 1 will typically have some branching farther (reusing a path).  In this case the unit of length is the dimension size of a tile.  

public static void main(String[] args) {
Design d = Design.readCheckpoint("my_placed_design.dcp");
DesignTools.createMissingSitePinInsts(d);
int wireLength = 0;
for(Net n : d.getNets()) {
if(n.isClockNet() || n.isStaticNet()) continue;
SitePinInst src = n.getSource();
if(src == null) continue;
Tile srcTile = src.getTile();
for(SitePinInst sink : n.getSinkPins()) {
wireLength += sink.getTile().getManhattanDistance(srcTile);
}
}
System.out.println(wireLength);
}


BOYANG ZHANG

unread,
Sep 12, 2020, 1:19:24 AM9/12/20
to RapidWright
Thank you for your help!
But I don't see a method called"createMissingSitePinInsts()" in my DesignTools.java(but I do see it in the official java doc). Is there anything going wrong with my java package? Or is there another way to calculate it?

截屏2020-09-12上午1.19.09.png

RapidWright

unread,
Sep 14, 2020, 3:20:35 PM9/14/20
to RapidWright
This method was written and committed somewhat recently, perhaps you just need to pull the latest changes (or just perform a clean in your sandbox):


It was first added on July 28th, 2020, but there have been a few fixes since them.


Reply all
Reply to author
Forward
0 new messages