|
12 | 12 | from openram.tech import drc
|
13 | 13 | from .vector import vector
|
14 | 14 | from .design import design
|
15 |
| - |
| 15 | +from openram import OPTS |
16 | 16 |
|
17 | 17 | class channel_net():
|
18 | 18 | def __init__(self, net_name, pins, vertical):
|
@@ -326,13 +326,24 @@ def add_horizontal_trunk_with_jog(self,
|
326 | 326 | max_x = max([pin.center().x for pin in pins])
|
327 | 327 | min_x = min([pin.center().x for pin in pins])
|
328 | 328 | min_y = min([pin.center().y for pin in pins])
|
| 329 | + max_y = max([pin.center().y for pin in pins]) |
329 | 330 | # 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 |
336 | 347 | # if we are less than a pitch, just create a non-preferred layer jog
|
337 | 348 | non_preferred_route = max_x - min_x <= pitch
|
338 | 349 | half_layer_width = 0.5 * drc["minwidth_{0}".format(self.vertical_layer)]
|
@@ -368,6 +379,8 @@ def add_horizontal_trunk_with_jog(self,
|
368 | 379 |
|
369 | 380 | # Route each pin to the trunk
|
370 | 381 | 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)) |
371 | 384 | # Find the correct side of the pin
|
372 | 385 | if pin.cy() < trunk_offset.y:
|
373 | 386 | pin_pos = pin.center()
|
|
0 commit comments