2018-08-15 13:32:56 +02:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
"""
|
|
|
|
|
Run a regression test on various srams
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
import unittest
|
|
|
|
|
from testutils import header,openram_test
|
|
|
|
|
import sys,os
|
|
|
|
|
sys.path.append(os.path.join(sys.path[0],".."))
|
|
|
|
|
import globals
|
|
|
|
|
from globals import OPTS
|
|
|
|
|
import debug
|
|
|
|
|
|
2018-09-04 20:55:22 +02:00
|
|
|
#@unittest.skip("SKIPPING 19_psingle_bank_test")
|
2018-08-28 19:45:50 +02:00
|
|
|
class psingle_bank_test(openram_test):
|
2018-08-15 13:32:56 +02:00
|
|
|
|
|
|
|
|
def runTest(self):
|
|
|
|
|
globals.init_openram("config_20_{0}".format(OPTS.tech_name))
|
|
|
|
|
global verify
|
|
|
|
|
import verify
|
|
|
|
|
|
|
|
|
|
from bank import bank
|
2018-08-31 21:03:28 +02:00
|
|
|
from sram_config import sram_config
|
2018-08-15 13:32:56 +02:00
|
|
|
OPTS.bitcell = "pbitcell"
|
|
|
|
|
|
2018-09-04 02:47:29 +02:00
|
|
|
# testing layout of bank using pbitcell with 1 RW port (a 6T-cell equivalent)
|
2018-08-31 21:03:28 +02:00
|
|
|
OPTS.num_rw_ports = 1
|
2018-09-04 04:36:20 +02:00
|
|
|
OPTS.num_w_ports = 0
|
|
|
|
|
OPTS.num_r_ports = 0
|
2018-08-31 21:03:28 +02:00
|
|
|
c = sram_config(word_size=4,
|
|
|
|
|
num_words=16)
|
|
|
|
|
c.words_per_row=1
|
2018-09-04 02:47:29 +02:00
|
|
|
debug.info(1, "No column mux")
|
2018-09-04 04:36:20 +02:00
|
|
|
a = bank(c, name="bank1_1rw_0w_0r_single")
|
2018-09-04 02:47:29 +02:00
|
|
|
self.local_check(a)
|
2018-09-10 07:08:03 +02:00
|
|
|
|
|
|
|
|
c.num_words=32
|
|
|
|
|
c.words_per_row=2
|
|
|
|
|
debug.info(1, "Two way column mux")
|
|
|
|
|
a = bank(c, name="bank1_1rw_0w_0r_single")
|
|
|
|
|
self.local_check(a)
|
|
|
|
|
|
|
|
|
|
c.num_words=64
|
|
|
|
|
c.words_per_row=4
|
|
|
|
|
debug.info(1, "Four way column mux")
|
|
|
|
|
a = bank(c, name="bank1_1rw_0w_0r_single")
|
|
|
|
|
self.local_check(a)
|
|
|
|
|
|
|
|
|
|
c.num_words=128
|
|
|
|
|
c.words_per_row=8
|
|
|
|
|
debug.info(1, "Four way column mux")
|
|
|
|
|
a = bank(c, name="bank1_1rw_0w_0r_single")
|
|
|
|
|
self.local_check(a)
|
|
|
|
|
|
2018-09-14 03:49:20 +02:00
|
|
|
|
|
|
|
|
# testing bank using pbitcell in various port combinations
|
|
|
|
|
# layout for multiple ports does not work yet
|
2018-09-04 02:47:29 +02:00
|
|
|
"""
|
|
|
|
|
OPTS.netlist_only = True
|
2018-09-14 03:49:20 +02:00
|
|
|
|
|
|
|
|
c.num_words=16
|
|
|
|
|
c.words_per_row=1
|
2018-09-04 02:47:29 +02:00
|
|
|
|
2018-08-31 21:03:28 +02:00
|
|
|
OPTS.num_rw_ports = c.num_rw_ports = 2
|
|
|
|
|
OPTS.num_w_ports = c.num_w_ports = 2
|
|
|
|
|
OPTS.num_r_ports = c.num_r_ports = 2
|
|
|
|
|
|
|
|
|
|
debug.info(1, "No column mux")
|
|
|
|
|
name = "bank1_{0}rw_{1}w_{2}r_single".format(c.num_rw_ports, c.num_w_ports, c.num_r_ports)
|
|
|
|
|
a = bank(c, name=name)
|
|
|
|
|
self.local_check(a)
|
|
|
|
|
|
|
|
|
|
OPTS.num_rw_ports = c.num_rw_ports = 0
|
|
|
|
|
OPTS.num_w_ports = c.num_w_ports = 2
|
|
|
|
|
OPTS.num_r_ports = c.num_r_ports = 2
|
2018-08-15 13:32:56 +02:00
|
|
|
|
|
|
|
|
debug.info(1, "No column mux")
|
2018-08-31 21:03:28 +02:00
|
|
|
name = "bank1_{0}rw_{1}w_{2}r_single".format(c.num_rw_ports, c.num_w_ports, c.num_r_ports)
|
|
|
|
|
a = bank(c, name=name)
|
2018-08-15 13:32:56 +02:00
|
|
|
self.local_check(a)
|
|
|
|
|
|
2018-08-31 21:03:28 +02:00
|
|
|
OPTS.num_rw_ports = c.num_rw_ports = 2
|
|
|
|
|
OPTS.num_w_ports = c.num_w_ports = 0
|
|
|
|
|
OPTS.num_r_ports = c.num_r_ports = 2
|
2018-08-15 13:32:56 +02:00
|
|
|
|
|
|
|
|
debug.info(1, "No column mux")
|
2018-08-31 21:03:28 +02:00
|
|
|
name = "bank1_{0}rw_{1}w_{2}r_single".format(c.num_rw_ports, c.num_w_ports, c.num_r_ports)
|
|
|
|
|
a = bank(c, name=name)
|
2018-08-15 13:32:56 +02:00
|
|
|
self.local_check(a)
|
|
|
|
|
|
2018-08-31 21:03:28 +02:00
|
|
|
OPTS.num_rw_ports = c.num_rw_ports = 2
|
|
|
|
|
OPTS.num_w_ports = c.num_w_ports = 2
|
|
|
|
|
OPTS.num_r_ports = c.num_r_ports = 0
|
2018-08-15 13:32:56 +02:00
|
|
|
|
|
|
|
|
debug.info(1, "No column mux")
|
2018-08-31 21:03:28 +02:00
|
|
|
name = "bank1_{0}rw_{1}w_{2}r_single".format(c.num_rw_ports, c.num_w_ports, c.num_r_ports)
|
|
|
|
|
a = bank(c, name=name)
|
2018-08-15 13:32:56 +02:00
|
|
|
self.local_check(a)
|
|
|
|
|
|
2018-08-31 21:03:28 +02:00
|
|
|
OPTS.num_rw_ports = c.num_rw_ports = 2
|
|
|
|
|
OPTS.num_w_ports = c.num_w_ports = 0
|
|
|
|
|
OPTS.num_r_ports = c.num_r_ports = 0
|
2018-08-15 13:32:56 +02:00
|
|
|
|
|
|
|
|
debug.info(1, "No column mux")
|
2018-08-31 21:03:28 +02:00
|
|
|
name = "bank1_{0}rw_{1}w_{2}r_single".format(c.num_rw_ports, c.num_w_ports, c.num_r_ports)
|
|
|
|
|
a = bank(c, name=name)
|
2018-08-15 13:32:56 +02:00
|
|
|
self.local_check(a)
|
|
|
|
|
|
|
|
|
|
# testing with various column muxes
|
2018-08-31 21:03:28 +02:00
|
|
|
OPTS.num_rw_ports = c.num_rw_ports = 2
|
|
|
|
|
OPTS.num_w_ports = c.num_w_ports = 2
|
|
|
|
|
OPTS.num_r_ports = c.num_r_ports = 2
|
2018-08-15 13:32:56 +02:00
|
|
|
|
2018-08-31 21:03:28 +02:00
|
|
|
c.num_words=32
|
|
|
|
|
c.words_per_row=2
|
2018-08-15 13:32:56 +02:00
|
|
|
debug.info(1, "Two way column mux")
|
2018-08-31 21:03:28 +02:00
|
|
|
name = "bank2_{0}rw_{1}w_{2}r_single".format(c.num_rw_ports, c.num_w_ports, c.num_r_ports)
|
|
|
|
|
a = bank(c, name=name)
|
2018-08-15 13:32:56 +02:00
|
|
|
self.local_check(a)
|
|
|
|
|
|
2018-08-31 21:03:28 +02:00
|
|
|
c.num_words=64
|
|
|
|
|
c.words_per_row=4
|
2018-08-15 13:32:56 +02:00
|
|
|
debug.info(1, "Four way column mux")
|
2018-08-31 21:03:28 +02:00
|
|
|
name = "bank3_{0}rw_{1}w_{2}r_single".format(c.num_rw_ports, c.num_w_ports, c.num_r_ports)
|
|
|
|
|
a = bank(c, name=name)
|
2018-08-15 13:32:56 +02:00
|
|
|
self.local_check(a)
|
|
|
|
|
|
|
|
|
|
# Eight way has a short circuit of one column mux select to gnd rail
|
2018-08-31 21:03:28 +02:00
|
|
|
c.word_size=2
|
|
|
|
|
c.num_words=128
|
|
|
|
|
c.words_per_row=8
|
2018-08-15 13:32:56 +02:00
|
|
|
debug.info(1, "Eight way column mux")
|
2018-08-31 21:03:28 +02:00
|
|
|
name = "bank4_{0}rw_{1}w_{2}r_single".format(c.num_rw_ports, c.num_w_ports, c.num_r_ports)
|
|
|
|
|
a = bank(c, name=name)
|
2018-08-15 13:32:56 +02:00
|
|
|
self.local_check(a)
|
|
|
|
|
"""
|
|
|
|
|
|
2018-09-14 03:49:20 +02:00
|
|
|
globals.end_openram()
|
2018-08-15 13:32:56 +02:00
|
|
|
|
|
|
|
|
# instantiate a copy of the class to actually run the test
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
|
(OPTS, args) = globals.parse_args()
|
|
|
|
|
del sys.argv[1:]
|
|
|
|
|
header(__file__, OPTS.tech_name)
|
|
|
|
|
unittest.main()
|