input:
- dimensions of design
- matrix of (currently) occupied spaces (i.e., extracted cell placements)
- locations of pins of a given net, and their direction
procedure:
-
create a min-heap for each pin in the net
-
create a union-find structure for the pins
-
initialize
n_groups
to len(pins) -
initialize a distance matrix, doing the following:
-
mark each pin (or pin + partial net) with
BT_START
and distance 0 -
initialize a visited matrix, doing the following:
-
mark all locations as unvisited
-
mark all current groups
-
while
n_groups
> 1: -
select the group with the lowest min-heap element
-
expand the heap as before
-
if the lowest min-heap element expands into a group not currently in my union-find set:
-
create a new "segment" with these two points as endpoints
-
with the intersecting point, backtrace to the remote
BT_START
-
with the point from which we expanded, backtrace to the local
BT_START
-
add this segment with the addition of the two backtraces
-
delete the min-heap corresponding to both sets
-
mark all points along the partial net as visited, and add these points to the new min-heap for expansion
OLD
- backtrace to the nearest
BT_START
, generating a new partial net - mark all parts of the to-be-joined groups as unvisited, marking each pin and partial net with
BT_START
and distance 0 - join the two groups in the union-find structure
- decrement
n_groups
output:
- list of blocks connecting all pins of net