mirror of https://github.com/VLSIDA/OpenRAM.git
PEP8 format replica_bitcell_array
This commit is contained in:
parent
4fef632dce
commit
00b51f5464
|
|
@ -32,8 +32,10 @@ class replica_bitcell_array(design.design):
|
|||
self.right_rbl = right_rbl
|
||||
self.bitcell_ports = bitcell_ports
|
||||
|
||||
debug.check(left_rbl+right_rbl==len(self.all_ports),"Invalid number of RBLs for port configuration.")
|
||||
debug.check(left_rbl+right_rbl==len(self.bitcell_ports),"Bitcell ports must match total RBLs.")
|
||||
debug.check(left_rbl + right_rbl == len(self.all_ports),
|
||||
"Invalid number of RBLs for port configuration.")
|
||||
debug.check(left_rbl + right_rbl == len(self.bitcell_ports),
|
||||
"Bitcell ports must match total RBLs.")
|
||||
|
||||
# Two dummy rows/cols plus replica for each port
|
||||
self.extra_rows = 2 + left_rbl + right_rbl
|
||||
|
|
@ -47,7 +49,6 @@ class replica_bitcell_array(design.design):
|
|||
# the replica bitcell in the control logic
|
||||
# self.offset_all_coordinates()
|
||||
|
||||
|
||||
def create_netlist(self):
|
||||
""" Create and connect the netlist """
|
||||
self.add_modules()
|
||||
|
|
@ -118,7 +119,6 @@ class replica_bitcell_array(design.design):
|
|||
mirror=0)
|
||||
self.add_mod(self.dummy_row)
|
||||
|
||||
|
||||
# If there are bitcell end caps, replace the dummy cells on the edge of the bitcell array with end caps.
|
||||
try:
|
||||
end_caps_enabled = cell_properties.bitcell.end_caps
|
||||
|
|
@ -131,7 +131,7 @@ class replica_bitcell_array(design.design):
|
|||
self.edge_row = factory.create(module_type=edge_row_module_type,
|
||||
cols=self.column_size,
|
||||
rows=1,
|
||||
# dummy column + left replica column
|
||||
# dummy column + left replica column(s)
|
||||
column_offset=1 + self.left_rbl,
|
||||
mirror=0)
|
||||
self.add_mod(self.edge_row)
|
||||
|
|
@ -149,9 +149,9 @@ class replica_bitcell_array(design.design):
|
|||
self.edge_col_right = factory.create(module_type=edge_col_module_type,
|
||||
cols=1,
|
||||
# dummy column
|
||||
# + left replica column
|
||||
# + left replica column(s)
|
||||
# + bitcell columns
|
||||
# + right replica column
|
||||
# + right replica column(s)
|
||||
column_offset = 1 + self.left_rbl + self.column_size + self.right_rbl,
|
||||
rows=self.row_size + self.extra_rows,
|
||||
mirror=(self.left_rbl + 1) %2)
|
||||
|
|
@ -195,7 +195,6 @@ class replica_bitcell_array(design.design):
|
|||
# Left/right dummy columns are connected identically to the replica column
|
||||
self.dummy_col_wl_names = self.replica_col_wl_names
|
||||
|
||||
|
||||
# Per port bitline names
|
||||
self.replica_bl_names = {}
|
||||
self.replica_wl_names = {}
|
||||
|
|
@ -211,10 +210,8 @@ class replica_bitcell_array(design.design):
|
|||
self.replica_bl_names[port] = bl_names
|
||||
|
||||
wl_names = ["rbl_{0}_{1}".format(x, port) for x in self.cell.get_all_wl_names()]
|
||||
#wl_names[port] = "rbl_wl{}".format(port)
|
||||
self.replica_wl_names[port] = wl_names
|
||||
|
||||
|
||||
# External pins
|
||||
self.add_pin_list(self.bitcell_array_bl_names, "INOUT")
|
||||
# Need to sort by port order since dictionary values may not be in order
|
||||
|
|
@ -231,7 +228,6 @@ class replica_bitcell_array(design.design):
|
|||
self.add_pin("vdd", "POWER")
|
||||
self.add_pin("gnd", "GROUND")
|
||||
|
||||
|
||||
def create_instances(self):
|
||||
""" Create the module instances used in this design """
|
||||
|
||||
|
|
@ -252,7 +248,6 @@ class replica_bitcell_array(design.design):
|
|||
mod=self.replica_columns[port])
|
||||
self.connect_inst(self.replica_bl_names[port] + self.replica_col_wl_names + supplies)
|
||||
|
||||
|
||||
# Dummy rows under the bitcell array (connected with with the replica cell wl)
|
||||
self.dummy_row_replica_inst = {}
|
||||
for port in range(self.left_rbl + self.right_rbl):
|
||||
|
|
@ -260,7 +255,6 @@ class replica_bitcell_array(design.design):
|
|||
mod=self.dummy_row)
|
||||
self.connect_inst(self.dummy_row_bl_names + self.replica_wl_names[port] + supplies)
|
||||
|
||||
|
||||
# Top/bottom dummy rows or col caps
|
||||
self.dummy_row_bot_inst=self.add_inst(name="dummy_row_bot",
|
||||
mod=self.edge_row)
|
||||
|
|
@ -269,7 +263,6 @@ class replica_bitcell_array(design.design):
|
|||
mod=self.edge_row)
|
||||
self.connect_inst(self.dummy_row_bl_names + [x + "_top" for x in self.dummy_cell_wl_names] + supplies)
|
||||
|
||||
|
||||
# Left/right Dummy columns
|
||||
self.dummy_col_left_inst=self.add_inst(name="dummy_col_left",
|
||||
mod=self.edge_col_left)
|
||||
|
|
@ -295,10 +288,12 @@ class replica_bitcell_array(design.design):
|
|||
for bit in range(self.right_rbl):
|
||||
self.replica_col_inst[self.left_rbl + bit].place(offset=offset.scale(bit, -self.left_rbl - 1) + self.bitcell_array_inst.lr())
|
||||
|
||||
# FIXME: These depend on the array size itself
|
||||
# Far top dummy row (first row above array is NOT flipped)
|
||||
flip_dummy = self.right_rbl % 2
|
||||
self.dummy_row_top_inst.place(offset=offset.scale(0, self.right_rbl + flip_dummy) + self.bitcell_array_inst.ul(),
|
||||
mirror="MX" if flip_dummy else "R0")
|
||||
# FIXME: These depend on the array size itself
|
||||
# Far bottom dummy row (first row below array IS flipped)
|
||||
flip_dummy = (self.left_rbl + 1) % 2
|
||||
self.dummy_row_bot_inst.place(offset=offset.scale(0, -self.left_rbl - 1 + flip_dummy),
|
||||
|
|
@ -316,7 +311,6 @@ class replica_bitcell_array(design.design):
|
|||
self.dummy_row_replica_inst[self.left_rbl + bit].place(offset=offset.scale(0, bit + bit % 2) + self.bitcell_array_inst.ul(),
|
||||
mirror="MX" if bit % 2 else "R0")
|
||||
|
||||
|
||||
self.translate_all(offset.scale(-1 - self.left_rbl, -1 - self.left_rbl))
|
||||
|
||||
self.add_layout_pins()
|
||||
|
|
@ -325,7 +319,6 @@ class replica_bitcell_array(design.design):
|
|||
|
||||
self.DRC_LVS()
|
||||
|
||||
|
||||
def add_layout_pins(self):
|
||||
""" Add the layout pins """
|
||||
|
||||
|
|
@ -351,7 +344,6 @@ class replica_bitcell_array(design.design):
|
|||
width=pin.width(),
|
||||
height=self.height)
|
||||
|
||||
|
||||
# Replica wordlines
|
||||
for port in range(self.left_rbl + self.right_rbl):
|
||||
inst = self.replica_col_inst[port]
|
||||
|
|
@ -416,8 +408,6 @@ class replica_bitcell_array(design.design):
|
|||
|
||||
def analytical_power(self, corner, load):
|
||||
"""Power of Bitcell array and bitline in nW."""
|
||||
from tech import drc, parameter
|
||||
|
||||
# Dynamic Power from Bitline
|
||||
bl_wire = self.gen_bl_wire()
|
||||
cell_load = 2 * bl_wire.return_input_cap()
|
||||
|
|
|
|||
Loading…
Reference in New Issue