mirror of
https://github.com/VLSIDA/OpenRAM.git
synced 2026-08-29 01:24:39 +02:00
Moving wide metal spacing to routing grid level
This commit is contained in:
@@ -483,10 +483,10 @@ class router:
|
||||
else:
|
||||
debug.error("Invalid zindex for track", -1)
|
||||
|
||||
width = drc("minwidth_{0}".format(layer_name), width, length)
|
||||
spacing = drc(str(layer_name)+"_to_"+str(layer_name), width, length)
|
||||
min_width = drc("minwidth_{0}".format(layer_name), width, length)
|
||||
min_spacing = drc(str(layer_name)+"_to_"+str(layer_name), width, length)
|
||||
|
||||
return (width,spacing)
|
||||
return (min_width,min_spacing)
|
||||
|
||||
def convert_pin_coord_to_tracks(self, pin, coord):
|
||||
"""
|
||||
@@ -1112,8 +1112,8 @@ class router:
|
||||
ll = path[0][0]
|
||||
ur = path[-1][-1]
|
||||
z = ll.z
|
||||
|
||||
pin = self.add_enclosure(ll, ur, z, name)
|
||||
print(ll, ur, ll.z, "->",pin)
|
||||
self.cell.add_layout_pin(text=name,
|
||||
layer=pin.layer,
|
||||
offset=pin.ll(),
|
||||
@@ -1133,20 +1133,11 @@ class router:
|
||||
(abs_ll,unused) = self.convert_track_to_shape(ll)
|
||||
(unused,abs_ur) = self.convert_track_to_shape(ur)
|
||||
|
||||
# Get the layer information
|
||||
x_distance = abs(abs_ll.x-abs_ur.x)
|
||||
y_distance = abs(abs_ll.y-abs_ur.y)
|
||||
shape_width = min(x_distance, y_distance)
|
||||
shape_length = max(x_distance, y_distance)
|
||||
|
||||
# Get the DRC rule for the grid dimensions
|
||||
(width, space) = self.get_layer_width_space(zindex, shape_width, shape_length)
|
||||
(width, space) = self.get_layer_width_space(zindex)
|
||||
layer = self.get_layer(zindex)
|
||||
|
||||
# Compute the shape offsets with correct spacing
|
||||
new_ll = abs_ll + vector(0.5*space, 0.5*space)
|
||||
new_ur = abs_ur - vector(0.5*space, 0.5*space)
|
||||
pin = pin_layout(name, [new_ll, new_ur], layer)
|
||||
pin = pin_layout(name, [abs_ll, abs_ur], layer)
|
||||
|
||||
return pin
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ class supply_router(router):
|
||||
# Determine the rail locations
|
||||
self.route_supply_rails(self.vdd_name,1)
|
||||
|
||||
#self.write_debug_gds("pre_pin_debug.gds",stop_program=True)
|
||||
self.write_debug_gds("pre_pin_debug.gds",stop_program=True)
|
||||
|
||||
# Route the supply pins to the supply rails
|
||||
self.route_pins_to_rails(gnd_name)
|
||||
@@ -132,16 +132,27 @@ class supply_router(router):
|
||||
self.add_wavepath(name, wave_path)
|
||||
|
||||
|
||||
|
||||
def route_supply_rails(self, name, supply_number):
|
||||
def compute_supply_rails(self, name, start_offset):
|
||||
"""
|
||||
Route the horizontal and vertical supply rails across the entire design.
|
||||
Must be done with lower left at 0,0
|
||||
Compute the unblocked locations for the horizontal and vertical supply rails.
|
||||
Go in a raster order from bottom to the top (for horizontal) and left to right
|
||||
(for vertical). Start with an initial start_offset in x and y direction.
|
||||
"""
|
||||
start_offset = supply_number*self.rail_track_width
|
||||
|
||||
max_yoffset = self.rg.ur.y
|
||||
max_xoffset = self.rg.ur.x
|
||||
step_offset = 2*self.rail_track_width
|
||||
max_length = max(max_yoffset,max_xoffset)
|
||||
|
||||
# Convert the number of tracks to dimensions to get the design rule spacing
|
||||
rail_width = self.track_width*self.rail_track_width
|
||||
(horizontal_width, horizontal_space) = self.get_layer_width_space(0, rail_width, max_length)
|
||||
(vertical_width, vertical_space) = self.get_layer_width_space(1, rail_width, max_length)
|
||||
width = max(horizontal_width, vertical_width)
|
||||
space = max(horizontal_space, vertical_space)
|
||||
|
||||
# This is the supply rail pitch in terms of routing grids
|
||||
# The 2* is to alternate the two supplies
|
||||
step_offset = 2*math.ceil((width+space)/self.track_width)
|
||||
|
||||
# Horizontal supply rails
|
||||
for offset in range(start_offset, max_yoffset, step_offset):
|
||||
@@ -161,6 +172,16 @@ class supply_router(router):
|
||||
while wave and wave[0].y < max_yoffset:
|
||||
wave = self.find_supply_rail(name, wave, direction.NORTH)
|
||||
|
||||
def route_supply_rails(self, name, supply_number):
|
||||
"""
|
||||
Route the horizontal and vertical supply rails across the entire design.
|
||||
Must be done with lower left at 0,0
|
||||
"""
|
||||
|
||||
# Compute the grid locations of the supply rails
|
||||
start_offset = supply_number*self.rail_track_width
|
||||
self.compute_supply_rails(name, start_offset)
|
||||
|
||||
# Add the supply rail vias (and prune disconnected rails)
|
||||
self.connect_supply_rails(name)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user