Add non-preferred directions for channel routes

This commit is contained in:
mrg 2020-06-11 15:03:36 -07:00
parent 8d52794c32
commit e9780ea599
2 changed files with 23 additions and 5 deletions

View File

@ -1043,7 +1043,8 @@ class layout():
mid = vector(pin.center().x, trunk_offset.y) mid = vector(pin.center().x, trunk_offset.y)
self.add_path(self.vertical_layer, [pin.center(), mid]) self.add_path(self.vertical_layer, [pin.center(), mid])
self.add_via_center(layers=layer_stack, self.add_via_center(layers=layer_stack,
offset=mid) offset=mid,
directions=self.directions)
def add_vertical_trunk_route(self, def add_vertical_trunk_route(self,
pins, pins,
@ -1083,7 +1084,8 @@ class layout():
mid = vector(trunk_offset.x, pin.center().y) mid = vector(trunk_offset.x, pin.center().y)
self.add_path(self.horizontal_layer, [pin.center(), mid]) self.add_path(self.horizontal_layer, [pin.center(), mid])
self.add_via_center(layers=layer_stack, self.add_via_center(layers=layer_stack,
offset=mid) offset=mid,
directions=self.directions)
def create_channel_route(self, netlist, def create_channel_route(self, netlist,
offset, offset,
@ -1146,7 +1148,8 @@ class layout():
overlaps = (not vertical and x_overlap) or (vertical and y_overlap) overlaps = (not vertical and x_overlap) or (vertical and y_overlap)
return overlaps return overlaps
if not directions: self.directions = directions
if not directions or directions == "pref":
# Use the preferred layer directions # Use the preferred layer directions
if self.get_preferred_direction(layer_stack[0]) == "V": if self.get_preferred_direction(layer_stack[0]) == "V":
self.vertical_layer = layer_stack[0] self.vertical_layer = layer_stack[0]
@ -1154,6 +1157,14 @@ class layout():
else: else:
self.vertical_layer = layer_stack[2] self.vertical_layer = layer_stack[2]
self.horizontal_layer = layer_stack[0] self.horizontal_layer = layer_stack[0]
elif directions == "nonpref":
# Use the preferred layer directions
if self.get_preferred_direction(layer_stack[0]) == "V":
self.vertical_layer = layer_stack[2]
self.horizontal_layer = layer_stack[0]
else:
self.vertical_layer = layer_stack[0]
self.horizontal_layer = layer_stack[2]
else: else:
# Use the layer directions specified to the router rather than # Use the layer directions specified to the router rather than
# the preferred directions # the preferred directions

View File

@ -9,7 +9,7 @@ import debug
import design import design
from sram_factory import factory from sram_factory import factory
from math import log, ceil from math import log, ceil
from tech import drc from tech import drc, layer
from vector import vector from vector import vector
from globals import OPTS from globals import OPTS
@ -879,9 +879,16 @@ class bank(design.design):
column_mux_pins = [self.port_data_inst[port].get_pin(x) for x in sel_names] column_mux_pins = [self.port_data_inst[port].get_pin(x) for x in sel_names]
route_map = list(zip(decode_pins, column_mux_pins)) route_map = list(zip(decode_pins, column_mux_pins))
if "li" in layer:
stack = self.li_stack
directions = "nonpref"
else:
stack = self.m1_stack
directions = "pref"
self.create_vertical_channel_route(route_map, self.create_vertical_channel_route(route_map,
offset, offset,
self.m1_stack) stack,
directions=directions)
def add_lvs_correspondence_points(self): def add_lvs_correspondence_points(self):
""" """