mirror of https://github.com/VLSIDA/OpenRAM.git
Add constant cost for all non-preferred edges
This commit is contained in:
parent
821c763a1e
commit
d487f788e3
|
|
@ -63,14 +63,12 @@ class graph_node:
|
||||||
if other in self.neighbors:
|
if other in self.neighbors:
|
||||||
is_vertical = self.center.x == other.center.x
|
is_vertical = self.center.x == other.center.x
|
||||||
layer_dist = self.center.distance(other.center)
|
layer_dist = self.center.distance(other.center)
|
||||||
# Edge is on non-preferred direction
|
# Double the cost if the edge is in non-preferred direction
|
||||||
if is_vertical != bool(self.center.z):
|
if is_vertical != bool(self.center.z):
|
||||||
layer_dist *= 2
|
layer_dist *= 2
|
||||||
# Wire bends towards non-preferred direction
|
# Add a constant wire cost to prevent dog-legs
|
||||||
# NOTE: Adding a fixed cost prevents multiple dog-legs in
|
if prev_node and self.get_direction(prev_node) != self.get_direction(other):
|
||||||
# non-preferred direction
|
layer_dist += drc["grid"]
|
||||||
if prev_node and self.get_direction(prev_node) != self.get_direction(other):
|
via_dist = abs(self.center.z - other.center.z)
|
||||||
layer_dist += drc["grid"]
|
|
||||||
via_dist = abs(self.center.z - other.center.z) * 2
|
|
||||||
return layer_dist + via_dist
|
return layer_dist + via_dist
|
||||||
return float("inf")
|
return float("inf")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue