byuccl / bitrec

Python/Tcl tools for documenting Xilinx bitstreams. Lead author Corey Simpson.
Apache License 2.0
2 stars 1 forks source link

Pip fuzzing - re-use of Node in uphill and downhill path #11

Open nelsobe opened 2 years ago

nelsobe commented 2 years ago

The following occurs for at least the GFAN0->>BYP_ALT1 pipD:. the issue is that both the uphill DFS and the downhill DFS re-use the same node in the originating tile, leading to an unroutable net. It is unclear how often this might happen but printing the uphill and downhill paths for GFAN0->>BYP_ALT1 shows it happens for at least that one.

Such a net is unroutable by Vivado. Although it presumably doesn't affect the results it does waste time. Is there any reason to add code to avoid it? Unclear.

But, if so, there are two ways to do so:

  1. Let the code do the searching it is doing unchanged but then then check each uphill/downhill pair found for duplicate nodes and toss out those that have re-use of a node. This will allow bogus routes from being found by dfs()but will prevent Vivado from wasting time trying to route them.

  2. Or, on the downhill search prevent it from using any nodes used by the uphill search. A code snippet to do this is below. This requires a check against that list every time a node is visited and that might add to the run time due to that. But, it would avoid ever creating such an illegal net which Vivado must attempt (but which will then fail) to route.

# In run_pip_generation():
...
                avoid = [ str(P.getEndNode()) ]                
                ret_up = dfs_main(P,"UP",max_depth, avoid)
                avoid = [ str(P.getStartNode()) ]
                if ret_up is not None:
                    avoid += ret_up[0]
                ret_down = dfs_main(P,"DOWN",max_depth, avoid)
...

# In dfs():
...
    elif sN in avoid:
        return None
...