mirror of
https://github.com/VLSIDA/OpenRAM.git
synced 2026-08-30 01:48:33 +02:00
Merge branch 'singleport_refactor' into array_gen
This commit is contained in:
@@ -10,7 +10,9 @@ from openram.tech import drc, spice
|
||||
from openram.sram_factory import factory
|
||||
from openram import OPTS
|
||||
from .bitcell_base_array import bitcell_base_array
|
||||
|
||||
from .pattern import pattern
|
||||
from openram.base import geometry, instance
|
||||
from math import ceil
|
||||
|
||||
class bitcell_array(bitcell_base_array):
|
||||
"""
|
||||
@@ -42,7 +44,7 @@ class bitcell_array(bitcell_base_array):
|
||||
|
||||
def create_layout(self):
|
||||
|
||||
self.place_array("bit_r{0}_c{1}")
|
||||
self.place_array()
|
||||
|
||||
self.add_layout_pins()
|
||||
|
||||
@@ -57,18 +59,26 @@ class bitcell_array(bitcell_base_array):
|
||||
self.cell = factory.create(module_type=OPTS.bitcell)
|
||||
|
||||
def create_instances(self):
|
||||
""" Create the module instances used in this design """
|
||||
self.cell_inst = {}
|
||||
for col in range(self.column_size):
|
||||
for row in range(self.row_size):
|
||||
name = "bit_r{0}_c{1}".format(row, col)
|
||||
self.cell_inst[row, col]=self.add_inst(name=name,
|
||||
mod=self.cell)
|
||||
self.connect_inst(self.get_bitcell_pins(row, col))
|
||||
self.cell_inst={}
|
||||
if self.cell.mirror.y:
|
||||
core_block = [[0 for x in range(2)] for y in range(2)]
|
||||
core_block[0][0] = geometry.instance("core_0_0", mod=self.cell, is_bitcell=True)
|
||||
core_block[1][0] = geometry.instance("core_1_0", mod=self.cell, is_bitcell=True, mirror='MX')
|
||||
core_block[0][1] = geometry.instance("core_0_1", mod=self.cell, is_bitcell=True, mirror='MY')
|
||||
core_block[1][1] = geometry.instance("core_1_1", mod=self.cell, is_bitcell=True, mirror='XY')
|
||||
else:
|
||||
core_block = [[0 for x in range(1)] for y in range(2)]
|
||||
core_block[0][0] = geometry.instance("core_0_0", mod=self.cell, is_bitcell=True)
|
||||
core_block[1][0] = geometry.instance("core_1_0", mod=self.cell, is_bitcell=True, mirror='MX')
|
||||
|
||||
# If it is a "core" cell, it could be trimmed for sim time
|
||||
if col>0 and col<self.column_size-1 and row>0 and row<self.row_size-1:
|
||||
self.trim_insts.add(name)
|
||||
|
||||
self.pattern = pattern(self, "bitcell_array", core_block, num_rows=self.row_size, num_cols=self.column_size,name_template="bit_r{0}_c{1}")
|
||||
self.pattern.connect_array()
|
||||
|
||||
for key in self.cell_inst.keys():
|
||||
(row, col) = key
|
||||
if col>0 and col<self.column_size-1 and row>0 and row<self.row_size-1:
|
||||
self.trim_insts.add(self.cell_inst[key].name)
|
||||
|
||||
def analytical_power(self, corner, load):
|
||||
"""Power of Bitcell array and bitline in nW."""
|
||||
|
||||
Reference in New Issue
Block a user