Split nets with multiple sink pins

19 views
Skip to first unread message

G. BRICAS

unread,
Aug 9, 2021, 12:08:46 PM8/9/21
to RapidWright

Hi everyone,

I would like to extract all the PIPs from one SitePinInst to a given sink Pin.
When the net has several sinkPins I don't know how to exclude the PIP that are not used by the sinkPin considered, in other words, I want to exclude from the PIP list of the net, all the PIPs used to route the signal to the others sink pins.

It seems that the physical nets always contain all the logically equivalent nodes. Is there anyway to split the net in some way to have only the net from one source pin to one sinkPin.

Thank you in advance for your answer!

Gaetan

RapidWright

unread,
Aug 10, 2021, 3:23:57 PM8/10/21
to RapidWright
Hi Gaetan,

You bring up a good question and that functionality should probably be part of RapidWright.  I've written a small bit of code that should be able to extract the PIPs of just a single connection based on the sink pin.  It works by creating a map from end nodes to their PIPs such that if you search backwards from a sink pin's node, you can follow the PIPs (hops) back to the source:

package com.xilinx.rapidwright.examples;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.xilinx.rapidwright.design.Design;
import com.xilinx.rapidwright.design.SitePinInst;
import com.xilinx.rapidwright.device.Node;
import com.xilinx.rapidwright.device.PIP;

public class GetConnectionPIPs {

    
    public static List<PIP> getConnectionPIPs(SitePinInst sinkPin) {
        Map<Node, PIP> reverseNodeToPIPMap = new HashMap<>(); 
        for(PIP p : sinkPin.getNet().getPIPs()) {
            reverseNodeToPIPMap.put(p.getEndNode(), p);
        }
        
        Node sinkNode = sinkPin.getConnectedNode();
        Node srcNode = sinkPin.getNet().getSource().getConnectedNode();
        Node curr = sinkNode;
        
        List<PIP> path = new ArrayList<>();
        while(!curr.equals(srcNode)) {
            PIP pip = reverseNodeToPIPMap.get(curr);
            path.add(pip);
            curr = pip.getStartNode();
        }
        
        return path;
    }
    
    public static void main(String[] args) {
        // Download example DCP from: 
        Design d = Design.readCheckpoint("pblock0.dcp"); 
        Net n = d.getNet("your_program/DOADO[2]");
        System.out.println(getConnectionPIPs(n.getSinkPins().get(0)));
    }
}

Ultimately, RapidWright stores routing (inter-site routing - from site pin to site pin)  in nets as a list of PIPs.  They are not separated out by sink pins.  There could be potential for an alternate representation more like Vivado's node tree, but we have not begun that development.

Chris

G. BRICAS

unread,
Aug 11, 2021, 5:38:25 AM8/11/21
to RapidWright
Hi Chris,

Thank you for your answer. The provided code works perfectly with my application!
I now understand how to properly use Nodes and PIPs to navigate through the circuit nets.

Thanks a lot for your help!

Gaetan
Reply all
Reply to author
Forward
0 new messages