Skip to content

Commit 48a7065

Browse files
committed
make channel router better
1 parent 691f7a9 commit 48a7065

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

compiler/base/channel_route.py

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from openram.tech import drc
1313
from .vector import vector
1414
from .design import design
15-
15+
from openram import OPTS
1616

1717
class channel_net():
1818
def __init__(self, net_name, pins, vertical):
@@ -326,13 +326,24 @@ def add_horizontal_trunk_with_jog(self,
326326
max_x = max([pin.center().x for pin in pins])
327327
min_x = min([pin.center().x for pin in pins])
328328
min_y = min([pin.center().y for pin in pins])
329+
max_y = max([pin.center().y for pin in pins])
329330
# see the channel is at top or bottom
330-
if min_y < 0: # port0, min_x need to change
331-
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
332-
port = 0
333-
else: # port1, max_x need to change
334-
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
335-
port = 1
331+
if min_y < 0: # port0
332+
for pin in pins:
333+
if pin.center().x == max_x:
334+
if pin.center().y == max_y:
335+
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
336+
else: # pin has max_x is under track
337+
max_x = max_x - 0.1
338+
port = 0
339+
else: # port1
340+
for pin in pins:
341+
if pin.center().x == max_x:
342+
if pin.center().y == max_y:
343+
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
344+
else: # pin has max_x is under track
345+
min_x = min_x - 0.1
346+
port = 1
336347
# if we are less than a pitch, just create a non-preferred layer jog
337348
non_preferred_route = max_x - min_x <= pitch
338349
half_layer_width = 0.5 * drc["minwidth_{0}".format(self.vertical_layer)]
@@ -368,6 +379,8 @@ def add_horizontal_trunk_with_jog(self,
368379

369380
# Route each pin to the trunk
370381
for pin in pins:
382+
debug.warning("pin name in net ----> {0}".format(pin.name))
383+
debug.warning("wmask or not --> {0}".format(OPTS.write_size))
371384
# Find the correct side of the pin
372385
if pin.cy() < trunk_offset.y:
373386
pin_pos = pin.center()

0 commit comments

Comments
 (0)