diff --git a/compiler/modules/rom_base_array.py b/compiler/modules/rom_base_array.py new file mode 100644 index 00000000..ae2fe9b7 --- /dev/null +++ b/compiler/modules/rom_base_array.py @@ -0,0 +1,131 @@ +# See LICENSE for licensing information. +# +# Copyright (c) 2016-2021 Regents of the University of California and The Board +# of Regents for the Oklahoma Agricultural and Mechanical College +# (acting for and on behalf of Oklahoma State University) +# All rights reserved. +# + + + +from .bitcell_base_array import bitcell_base_array +from base import vector +from globals import OPTS +from sram_factory import factory + +class rom_base_array(bitcell_base_array): + + def __init__(self, rows, cols, bitmap, name="", column_offset=0): + super().__init__(name=name, rows=rows, cols=cols, column_offset=column_offset) + self.data = bitmap + + self.create_all_bitline_names() + self.create_all_wordline_names() + self.create_netlist() + + self.create_layout() + + + def create_netlist(self): + self.add_modules() + self.add_pins() + self.create_instances() + + + def create_layout(self): + #self.add_layout_pins() + self.place_ptx() + self.route_supplies() + + #self.add_boundary() + + #self.DRC_LVS() + + #def add_pins(self): + def add_boundary(self): + self.width = self.nmos.width * self.column_size + self.height = self.nmos.height * self.row_size + super().add_boundary() + + def add_modules(self): + + self.nmos = factory.create(module_type="ptx", tx_type="nmos") + + + + def create_instances(self): + self.cell_inst = {} + self.current_row = 0 + for col in range(self.column_size): + for row in range(self.row_size): + name = "bit_r{0}_c{1}".format(row, col) + + if(self.data[col][row] == 1): + self.cell_inst[row, col]=self.add_inst(name=name, + mod=self.nmos) + + self.connect_inst(self.get_bitcell_pins(row, col)) + + # If it is a "core" cell, it could be trimmed for sim time + #if col>0 and col0 and row