make channel router better

This commit is contained in:
FriedrichWu 2024-12-23 19:38:42 +01:00
parent 691f7a989e
commit 48a7065b31
1 changed files with 20 additions and 7 deletions

View File

@ -12,7 +12,7 @@ from openram import debug
from openram.tech import drc from openram.tech import drc
from .vector import vector from .vector import vector
from .design import design from .design import design
from openram import OPTS
class channel_net(): class channel_net():
def __init__(self, net_name, pins, vertical): def __init__(self, net_name, pins, vertical):
@ -326,12 +326,23 @@ class channel_route(design):
max_x = max([pin.center().x for pin in pins]) max_x = max([pin.center().x for pin in pins])
min_x = min([pin.center().x for pin in pins]) min_x = min([pin.center().x for pin in pins])
min_y = min([pin.center().y for pin in pins]) min_y = min([pin.center().y for pin in pins])
max_y = max([pin.center().y for pin in pins])
# see the channel is at top or bottom # see the channel is at top or bottom
if min_y < 0: # port0, min_x need to change if min_y < 0: # port0
for pin in pins:
if pin.center().x == max_x:
if pin.center().y == max_y:
min_x = min_x - 0.1 # in order to add jog at the dff pins, avoid overlap with vdd pins, left shift vertical line at dout pin min_x = min_x - 0.1 # in order to add jog at the dff pins, avoid overlap with vdd pins, left shift vertical line at dout pin
else: # pin has max_x is under track
max_x = max_x - 0.1
port = 0 port = 0
else: # port1, max_x need to change else: # port1
for pin in pins:
if pin.center().x == max_x:
if pin.center().y == max_y:
max_x = max_x - 0.1 # in order to add jog at the dff pins, avoid overlap with vdd pins, left shift vertical line at dout pin max_x = max_x - 0.1 # in order to add jog at the dff pins, avoid overlap with vdd pins, left shift vertical line at dout pin
else: # pin has max_x is under track
min_x = min_x - 0.1
port = 1 port = 1
# if we are less than a pitch, just create a non-preferred layer jog # if we are less than a pitch, just create a non-preferred layer jog
non_preferred_route = max_x - min_x <= pitch non_preferred_route = max_x - min_x <= pitch
@ -368,6 +379,8 @@ class channel_route(design):
# Route each pin to the trunk # Route each pin to the trunk
for pin in pins: for pin in pins:
debug.warning("pin name in net ----> {0}".format(pin.name))
debug.warning("wmask or not --> {0}".format(OPTS.write_size))
# Find the correct side of the pin # Find the correct side of the pin
if pin.cy() < trunk_offset.y: if pin.cy() < trunk_offset.y:
pin_pos = pin.center() pin_pos = pin.center()