mirror of
https://github.com/VLSIDA/OpenRAM.git
synced 2026-09-01 18:48:10 +02:00
Update modules to use variable bit offsets.
Bitcell arrays can return the bit offsets. Port data and submodules can use offsets for spacing. Default spacing for port data if no offsets given.
This commit is contained in:
@@ -18,7 +18,7 @@ class write_mask_and_array(design.design):
|
||||
The write mask AND array goes between the write driver array and the sense amp array.
|
||||
"""
|
||||
|
||||
def __init__(self, name, columns, word_size, write_size, column_offset=0):
|
||||
def __init__(self, name, columns, word_size, write_size, offsets=None, column_offset=0):
|
||||
super().__init__(name)
|
||||
debug.info(1, "Creating {0}".format(self.name))
|
||||
self.add_comment("columns: {0}".format(columns))
|
||||
@@ -28,6 +28,7 @@ class write_mask_and_array(design.design):
|
||||
self.columns = columns
|
||||
self.word_size = word_size
|
||||
self.write_size = write_size
|
||||
self.offsets = offsets
|
||||
self.column_offset = column_offset
|
||||
self.words_per_row = int(columns / word_size)
|
||||
self.num_wmasks = int(word_size / write_size)
|
||||
@@ -90,12 +91,17 @@ class write_mask_and_array(design.design):
|
||||
debug.check(self.wmask_en_len >= self.and2.width,
|
||||
"Write mask AND is wider than the corresponding write drivers {0} vs {1}.".format(self.and2.width,
|
||||
self.wmask_en_len))
|
||||
|
||||
self.width = self.bitcell.width * self.columns
|
||||
if not self.offsets:
|
||||
self.offsets = []
|
||||
for i in range(self.columns):
|
||||
self.offsets.append(i * self.driver_spacing)
|
||||
|
||||
self.width = self.offsets[-1] + self.driver_spacing
|
||||
self.height = self.and2.height
|
||||
|
||||
write_bits = self.columns / self.num_wmasks
|
||||
for i in range(self.num_wmasks):
|
||||
base = vector(i * self.wmask_en_len, 0)
|
||||
base = vector(self.offsets[int(i * write_bits)], 0)
|
||||
self.and2_insts[i].place(base)
|
||||
|
||||
def add_layout_pins(self):
|
||||
|
||||
Reference in New Issue
Block a user