mirror of
https://github.com/VLSIDA/OpenRAM.git
synced 2026-09-03 04:23:38 +02:00
fixing decoder lvs
This commit is contained in:
@@ -28,6 +28,12 @@ class rom_wordline_driver_array(design):
|
||||
self.cols = cols
|
||||
self.invert_outputs=invert_outputs
|
||||
self.tap_spacing = tap_spacing
|
||||
|
||||
if OPTS.tech_name == "sky130":
|
||||
self.supply_layer = "m1"
|
||||
else:
|
||||
self.supply_layer = "m2"
|
||||
|
||||
self.create_netlist()
|
||||
if not OPTS.netlist_only:
|
||||
self.create_layout()
|
||||
@@ -45,8 +51,8 @@ class rom_wordline_driver_array(design):
|
||||
self.place_drivers()
|
||||
self.route_layout()
|
||||
self.route_supplies()
|
||||
self.place_taps()
|
||||
self.add_boundary()
|
||||
self.DRC_LVS()
|
||||
|
||||
def add_pins(self):
|
||||
# inputs to wordline_driver.
|
||||
@@ -60,6 +66,7 @@ class rom_wordline_driver_array(design):
|
||||
|
||||
def add_modules(self):
|
||||
b = factory.create(module_type="rom_base_cell")
|
||||
self.tap = factory.create(module_type="rom_poly_tap", add_tap = True)
|
||||
|
||||
if self.invert_outputs:
|
||||
self.wl_driver = factory.create(module_type="pinv_dec",
|
||||
@@ -67,19 +74,12 @@ class rom_wordline_driver_array(design):
|
||||
height=b.height,
|
||||
add_wells=False)
|
||||
|
||||
self.wl_driver_tap = factory.create(module_type="pinv_dec",
|
||||
size=self.cols,
|
||||
add_wells=True)
|
||||
else:
|
||||
self.wl_driver = factory.create(module_type="pbuf_dec",
|
||||
size=self.cols,
|
||||
height=b.height,
|
||||
add_wells=False)
|
||||
self.wl_driver_tap = factory.create(module_type="pbuf_dec",
|
||||
size=self.cols,
|
||||
add_wells=True)
|
||||
print(self.wl_driver.height)
|
||||
print(self.wl_driver_tap.height)
|
||||
|
||||
|
||||
def route_supplies(self):
|
||||
"""
|
||||
@@ -89,6 +89,8 @@ class rom_wordline_driver_array(design):
|
||||
if layer_props.wordline_driver.vertical_supply:
|
||||
self.route_vertical_pins("vdd", self.wld_inst)
|
||||
self.route_vertical_pins("gnd", self.wld_inst)
|
||||
self.route_vertical_pins("vdd", self.wld_inst, layer=self.supply_layer)
|
||||
self.route_vertical_pins("gnd", self.wld_inst, layer=self.supply_layer)
|
||||
else:
|
||||
self.route_vertical_pins("vdd", self.wld_inst, xside="rx",)
|
||||
self.route_vertical_pins("gnd", self.wld_inst, xside="lx",)
|
||||
@@ -96,12 +98,8 @@ class rom_wordline_driver_array(design):
|
||||
def create_drivers(self):
|
||||
self.wld_inst = []
|
||||
for row in range(self.rows):
|
||||
if row % self.tap_spacing == 0:
|
||||
self.wld_inst.append(self.add_inst(name="wld{0}".format(row),
|
||||
mod=self.wl_driver_tap))
|
||||
else:
|
||||
self.wld_inst.append(self.add_inst(name="wld{0}".format(row),
|
||||
mod=self.wl_driver))
|
||||
self.wld_inst.append(self.add_inst(name="wld{0}".format(row),
|
||||
mod=self.wl_driver))
|
||||
self.connect_inst(["in_{0}".format(row),
|
||||
"out_{0}".format(row),
|
||||
"vdd", "gnd"])
|
||||
@@ -109,13 +107,14 @@ class rom_wordline_driver_array(design):
|
||||
def place_drivers(self):
|
||||
y_offset = 0
|
||||
for row in range(self.rows):
|
||||
# These are flipped since we always start with an RBL on the bottom
|
||||
|
||||
if row % self.tap_spacing == 0:
|
||||
y_offset += self.tap.pitch_offset
|
||||
offset = [0, y_offset]
|
||||
|
||||
self.wld_inst[row].place(offset=offset)
|
||||
y_offset += self.wld_inst[row].height
|
||||
|
||||
|
||||
self.width = self.wl_driver.width
|
||||
self.height = self.wl_driver.height * self.rows
|
||||
|
||||
@@ -137,3 +136,46 @@ class rom_wordline_driver_array(design):
|
||||
end=end)
|
||||
|
||||
self.add_layout_pin_rect_center(text="out_{}".format(row), layer=self.route_layer, offset=end - vector(0, 0.5 * route_width))
|
||||
|
||||
|
||||
def place_taps(self):
|
||||
|
||||
for wl in range(0 , self.rows, self.tap_spacing):
|
||||
driver = self.wld_inst[wl]
|
||||
|
||||
source_pin1 = driver.get_pins("vdd")[0]
|
||||
gnd_pin1 = driver.get_pins("gnd")[0]
|
||||
|
||||
left_edge = driver.get_pin("Z").cy() - 0.5 * self.contact_width - self.active_enclose_contact - self.active_space - 0.5 * self.active_contact.width
|
||||
|
||||
contact_pos = vector(source_pin1.cx(), left_edge)
|
||||
self.place_tap(contact_pos, "n")
|
||||
|
||||
contact_pos = vector( gnd_pin1.cx(), left_edge)
|
||||
self.place_tap(contact_pos, "p")
|
||||
|
||||
if not self.invert_outputs:
|
||||
source_pin2 = driver.get_pins("vdd")[1]
|
||||
gnd_pin2 = driver.get_pins("gnd")[1]
|
||||
contact_pos = vector(source_pin2.cx(), left_edge)
|
||||
self.place_tap(contact_pos, "n")
|
||||
|
||||
contact_pos = vector( gnd_pin2.cx(), left_edge)
|
||||
self.place_tap(contact_pos, "p")
|
||||
|
||||
|
||||
def place_tap(self, offset, well_type):
|
||||
self.add_via_center(layers=self.active_stack,
|
||||
offset=offset,
|
||||
implant_type=well_type,
|
||||
well_type=well_type,
|
||||
directions="nonpref")
|
||||
self.add_via_stack_center(offset=offset,
|
||||
from_layer=self.active_stack[2],
|
||||
to_layer=self.supply_layer)
|
||||
if well_type == "p":
|
||||
pin = "gnd"
|
||||
else:
|
||||
pin = "vdd"
|
||||
self.add_layout_pin_rect_center(text=pin, layer=self.supply_layer, offset=offset)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user