From d7ac26a0538e77899b67a8a45367e0bf8e820d35 Mon Sep 17 00:00:00 2001 From: Jacob Walker Date: Thu, 4 Aug 2022 12:47:17 -0700 Subject: [PATCH] array generation and bitline routing with array module --- compiler/modules/rom_base_array.py | 160 +++++++++++++++++++++------- compiler/tests/05_rom_array_test.py | 4 +- 2 files changed, 123 insertions(+), 41 deletions(-) diff --git a/compiler/modules/rom_base_array.py b/compiler/modules/rom_base_array.py index ae2fe9b7..94b6f7a5 100644 --- a/compiler/modules/rom_base_array.py +++ b/compiler/modules/rom_base_array.py @@ -17,8 +17,10 @@ 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) + + #TODO: data is input in col-major order for ease of parsing, create a function to convert a row-major input to col-major self.data = bitmap - + self.route_layer = 'm1' self.create_all_bitline_names() self.create_all_wordline_names() self.create_netlist() @@ -29,15 +31,21 @@ class rom_base_array(bitcell_base_array): 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_horizontal_pins(insts=self.cell_inst.values(), layer=self.route_layer, name="S") + self.route_bitlines() + #self.route_wordlines() + self.route_supplies() - #self.add_boundary() + self.add_boundary() #self.DRC_LVS() @@ -49,42 +57,30 @@ class rom_base_array(bitcell_base_array): def add_modules(self): - self.nmos = factory.create(module_type="ptx", tx_type="nmos") - - - + self.nmos = factory.create(module_type="ptx", tx_type="nmos", add_source_contact=self.route_layer, + add_drain_contact=self.route_layer) + temp = self.nmos.width + self.nmos.width = self.nmos.height + self.nmos.poly_extend_active + self.nmos.height = temp def create_instances(self): self.cell_inst = {} + self.cell_list = [] self.current_row = 0 - for col in range(self.column_size): - for row in range(self.row_size): + for row in range(self.row_size): + row_list = [] + + for col in range(self.column_size): + name = "bit_r{0}_c{1}".format(row, col) - if(self.data[col][row] == 1): + if(self.data[row][col] == 1): self.cell_inst[row, col]=self.add_inst(name=name, - mod=self.nmos) - + mod=self.nmos, rotate=90) + + row_list.append(self.cell_inst[row, col]) 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