mirror of https://github.com/VLSIDA/OpenRAM.git
Fix bugs in channel route.
This commit is contained in:
parent
5285468380
commit
47f541df0e
|
|
@ -218,19 +218,14 @@ class channel_route(design.design):
|
|||
min_x = min([pin.center().x for pin in pins])
|
||||
|
||||
# if we are less than a pitch, just create a non-preferred layer jog
|
||||
if max_x - min_x <= pitch:
|
||||
half_layer_width = 0.5 * drc["minwidth_{0}".format(self.vertical_layer)]
|
||||
non_preferred_route = max_x - min_x <= pitch
|
||||
|
||||
if non_preferred_route:
|
||||
half_layer_width = 0.5 * drc["minwidth_{0}".format(self.vertical_layer)]
|
||||
# Add the horizontal trunk on the vertical layer!
|
||||
self.add_path(self.vertical_layer,
|
||||
[vector(min_x - half_layer_width, trunk_offset.y),
|
||||
vector(max_x + half_layer_width, trunk_offset.y)])
|
||||
|
||||
# Route each pin to the trunk
|
||||
for pin in pins:
|
||||
# No bend needed here
|
||||
mid = vector(pin.center().x, trunk_offset.y)
|
||||
self.add_path(self.vertical_layer, [pin.center(), mid])
|
||||
else:
|
||||
# Add the horizontal trunk
|
||||
self.add_path(self.horizontal_layer,
|
||||
|
|
@ -239,13 +234,14 @@ class channel_route(design.design):
|
|||
|
||||
# Route each pin to the trunk
|
||||
for pin in pins:
|
||||
mid = vector(pin.center().x, trunk_offset.y)
|
||||
# Find the correct side of the pin
|
||||
if pin.cy() < trunk_offset.y:
|
||||
pin_pos = pin.uc()
|
||||
else:
|
||||
pin_pos = pin.bc()
|
||||
mid = vector(pin_pos.x, trunk_offset.y)
|
||||
self.add_path(self.vertical_layer, [pin_pos, mid])
|
||||
if not non_preferred_route:
|
||||
self.add_via_center(layers=self.layer_stack,
|
||||
offset=mid,
|
||||
directions=self.directions)
|
||||
|
|
@ -265,20 +261,14 @@ class channel_route(design.design):
|
|||
min_y = min([pin.center().y for pin in pins])
|
||||
|
||||
# if we are less than a pitch, just create a non-preferred layer jog
|
||||
if max_y - min_y <= pitch:
|
||||
non_preferred_route = max_y - min_y <= pitch
|
||||
|
||||
if non_preferred_route:
|
||||
half_layer_width = 0.5 * drc["minwidth_{0}".format(self.horizontal_layer)]
|
||||
|
||||
# Add the vertical trunk on the horizontal layer!
|
||||
self.add_path(self.horizontal_layer,
|
||||
[vector(trunk_offset.x, min_y - half_layer_width),
|
||||
vector(trunk_offset.x, max_y + half_layer_width)])
|
||||
|
||||
# Route each pin to the trunk
|
||||
for pin in pins:
|
||||
# No bend needed here
|
||||
mid = vector(trunk_offset.x, pin.center().y)
|
||||
self.add_path(self.horizontal_layer, [pin.center(), mid])
|
||||
else:
|
||||
# Add the vertical trunk
|
||||
self.add_path(self.vertical_layer,
|
||||
|
|
@ -287,13 +277,14 @@ class channel_route(design.design):
|
|||
|
||||
# Route each pin to the trunk
|
||||
for pin in pins:
|
||||
mid = vector(trunk_offset.x, pin.center().y)
|
||||
# Find the correct side of the pin
|
||||
if pin.cx() < trunk_offset.x:
|
||||
pin_pos = pin.rc()
|
||||
else:
|
||||
pin_pos = pin.lc()
|
||||
mid = vector(trunk_offset.x, pin_pos.y)
|
||||
self.add_path(self.horizontal_layer, [pin_pos, mid])
|
||||
if not non_preferred_route:
|
||||
self.add_via_center(layers=self.layer_stack,
|
||||
offset=mid,
|
||||
directions=self.directions)
|
||||
|
|
|
|||
Loading…
Reference in New Issue