OpenRAM/compiler/modules/rom_poly_tap.py

54 lines
1.5 KiB
Python
Raw Normal View History

2022-09-02 05:06:48 +02:00
from base import design
from base import vector
from sram_factory import factory
class rom_poly_tap(design):
def __init__(self, name, strap_length=0, cell_name=None, prop=None, strap_layer="m2"):
super().__init__(name, cell_name, prop)
self.strap_layer=strap_layer
self.length = strap_length
self.create_netlist()
self.create_layout()
def create_netlist(self):
#for layout constants
self.dummy = factory.create(module_type="rom_dummy_cell")
def create_layout(self):
self.place_via()
self.add_boundary()
2022-10-07 23:40:28 +02:00
if self.length != 0:
2022-09-02 05:06:48 +02:00
self.place_strap(self.length)
def add_boundary(self):
self.height = self.dummy.height
self.width = self.poly_contact.width
super().add_boundary()
def place_via(self):
contact_width = self.poly_contact.width
2022-10-07 23:40:28 +02:00
contact_x = - contact_width * 0.5 - self.dummy.width
2022-09-02 05:06:48 +02:00
contact_y = self.dummy.poly.offset.x + (self.poly_width * 0.5)
contact_offset = vector(contact_x, contact_y)
self.via = self.add_via_stack_center(from_layer="poly",
to_layer=self.strap_layer,
offset=contact_offset)
def place_strap(self, length):
strap_start = vector(self.via.cx(), self.via.cy())
strap_end = vector( self.dummy.width * length, self.via.cy())
self.strap = self.add_path(self.strap_layer, (strap_start, strap_end))