mirror of https://github.com/VLSIDA/OpenRAM.git
adding unit test for bitcell array using pbitcell
This commit is contained in:
parent
fc294cb282
commit
820a8440c9
|
|
@ -26,17 +26,19 @@ class pbitcell(pgate.pgate):
|
||||||
|
|
||||||
|
|
||||||
def add_pins(self):
|
def add_pins(self):
|
||||||
for k in range(0,self.num_write):
|
|
||||||
self.add_pin("wrow{}".format(k))
|
for k in range(self.num_write):
|
||||||
for k in range(0,self.num_write):
|
|
||||||
self.add_pin("wbl{}".format(k))
|
self.add_pin("wbl{}".format(k))
|
||||||
self.add_pin("wbl_bar{}".format(k))
|
self.add_pin("wbl_bar{}".format(k))
|
||||||
if(self.num_read > 0):
|
for k in range(self.num_read):
|
||||||
for k in range(0,self.num_read):
|
self.add_pin("rbl{}".format(k))
|
||||||
self.add_pin("rrow{}".format(k))
|
self.add_pin("rbl_bar{}".format(k))
|
||||||
for k in range(0,self.num_read):
|
|
||||||
self.add_pin("rbl{}".format(k))
|
for k in range(self.num_write):
|
||||||
self.add_pin("rbl_bar{}".format(k))
|
self.add_pin("wrow{}".format(k))
|
||||||
|
for k in range(self.num_read):
|
||||||
|
self.add_pin("rrow{}".format(k))
|
||||||
|
|
||||||
self.add_pin("vdd")
|
self.add_pin("vdd")
|
||||||
self.add_pin("gnd")
|
self.add_pin("gnd")
|
||||||
|
|
||||||
|
|
@ -51,6 +53,8 @@ class pbitcell(pgate.pgate):
|
||||||
self.add_read_ports()
|
self.add_read_ports()
|
||||||
self.extend_well()
|
self.extend_well()
|
||||||
self.offset_all_coordinates()
|
self.offset_all_coordinates()
|
||||||
|
#offset = vector(0, -0.5*drc["minwidth_metal2"])
|
||||||
|
#self.translate_all(offset)
|
||||||
#self.add_fail()
|
#self.add_fail()
|
||||||
|
|
||||||
def create_ptx(self):
|
def create_ptx(self):
|
||||||
|
|
@ -152,7 +156,7 @@ class pbitcell(pgate.pgate):
|
||||||
|
|
||||||
# calculations for the cell dimensions
|
# calculations for the cell dimensions
|
||||||
self.width = -2*self.leftmost_xpos
|
self.width = -2*self.leftmost_xpos
|
||||||
self.height = self.topmost_ypos - self.botmost_ypos
|
self.height = self.topmost_ypos - self.botmost_ypos + 0.5*drc["minwidth_metal2"] - 0.5*drc["minwidth_metal1"]
|
||||||
|
|
||||||
|
|
||||||
def add_storage(self):
|
def add_storage(self):
|
||||||
|
|
@ -610,9 +614,10 @@ class pbitcell(pgate.pgate):
|
||||||
the well connections must be done piecewise to avoid pwell and nwell overlap.
|
the well connections must be done piecewise to avoid pwell and nwell overlap.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
cell_well_tiling_offset = 0.5*drc["minwidth_metal2"]
|
||||||
""" extend pwell to encompass entire nmos region of the cell up to the height of the inverter nmos well """
|
""" extend pwell to encompass entire nmos region of the cell up to the height of the inverter nmos well """
|
||||||
offset = vector(self.leftmost_xpos, self.botmost_ypos)
|
offset = vector(self.leftmost_xpos, self.botmost_ypos - cell_well_tiling_offset)
|
||||||
well_height = -self.botmost_ypos + self.inverter_nmos.cell_well_height - drc["well_enclosure_active"]
|
well_height = -self.botmost_ypos + self.inverter_nmos.cell_well_height - drc["well_enclosure_active"] + cell_well_tiling_offset
|
||||||
self.add_rect(layer="pwell",
|
self.add_rect(layer="pwell",
|
||||||
offset=offset,
|
offset=offset,
|
||||||
width=self.width,
|
width=self.width,
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,10 @@ class pbitcell_test(openram_test):
|
||||||
tx = pbitcell.pbitcell(num_write=2,num_read=2)
|
tx = pbitcell.pbitcell(num_write=2,num_read=2)
|
||||||
self.local_check(tx)
|
self.local_check(tx)
|
||||||
|
|
||||||
|
debug.info(2, "Bitcell with 2 write ports and 0 read ports")
|
||||||
|
tx = pbitcell.pbitcell(num_write=2,num_read=0)
|
||||||
|
self.local_check(tx)
|
||||||
|
|
||||||
OPTS.check_lvsdrc = True
|
OPTS.check_lvsdrc = True
|
||||||
globals.end_openram()
|
globals.end_openram()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env python2.7
|
#!/usr/bin/env python2.7
|
||||||
"""
|
"""
|
||||||
Run regresion tests on a parameterized bitcell
|
Run a regresion test on a basic array
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
@ -11,12 +11,9 @@ import globals
|
||||||
from globals import OPTS
|
from globals import OPTS
|
||||||
import debug
|
import debug
|
||||||
|
|
||||||
OPTS = globals.OPTS
|
#@unittest.skip("SKIPPING 05_array_test")
|
||||||
|
|
||||||
#@unittest.skip("SKIPPING 04_pbitcell_test")
|
class array_test(openram_test):
|
||||||
|
|
||||||
|
|
||||||
class pbitcell_test(openram_test):
|
|
||||||
|
|
||||||
def runTest(self):
|
def runTest(self):
|
||||||
globals.init_openram("config_20_{0}".format(OPTS.tech_name))
|
globals.init_openram("config_20_{0}".format(OPTS.tech_name))
|
||||||
|
|
@ -24,17 +21,16 @@ class pbitcell_test(openram_test):
|
||||||
import verify
|
import verify
|
||||||
OPTS.check_lvsdrc = False
|
OPTS.check_lvsdrc = False
|
||||||
|
|
||||||
import pbitcell
|
import bitcell_array
|
||||||
import tech
|
|
||||||
|
|
||||||
debug.info(2, "Bitcell with 2 write ports and 0 read ports")
|
OPTS.bitcell = "pbitcell"
|
||||||
tx = pbitcell.pbitcell(num_write=2,num_read=0)
|
debug.info(2, "Testing 4x4 array for multiport bitcell")
|
||||||
self.local_check(tx)
|
a = bitcell_array.bitcell_array(name="pbitcell_array", cols=4, rows=4)
|
||||||
|
self.local_check(a)
|
||||||
|
|
||||||
OPTS.check_lvsdrc = True
|
OPTS.check_lvsdrc = True
|
||||||
globals.end_openram()
|
globals.end_openram()
|
||||||
|
|
||||||
|
|
||||||
# instantiate a copy of the class to actually run the test
|
# instantiate a copy of the class to actually run the test
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
(OPTS, args) = globals.parse_args()
|
(OPTS, args) = globals.parse_args()
|
||||||
Loading…
Reference in New Issue