OpenRAM/compiler/tests/19_multi_bank_test.py

66 lines
1.7 KiB
Python
Raw Normal View History

#!/usr/bin/env python3
2016-11-08 18:57:35 +01:00
"""
Run a regression test on various srams
2016-11-08 18:57:35 +01:00
"""
import unittest
from testutils import header,openram_test
2016-11-08 18:57:35 +01:00
import sys,os
sys.path.append(os.path.join(sys.path[0],".."))
import globals
from globals import OPTS
from sram_factory import factory
2016-11-08 18:57:35 +01:00
import debug
2018-10-11 01:57:42 +02:00
@unittest.skip("SKIPPING 19_multi_bank_test")
class multi_bank_test(openram_test):
2016-11-08 18:57:35 +01:00
def runTest(self):
globals.init_openram("config_{0}".format(OPTS.tech_name))
from sram_config import sram_config
2016-11-08 18:57:35 +01:00
c = sram_config(word_size=4,
num_words=16)
c.num_banks=2
c.words_per_row=1
factory.reset()
c.recompute_sizes()
debug.info(1, "No column mux")
a = factory.create("bank", sram_config=c)
self.local_check(a)
2016-11-08 18:57:35 +01:00
c.num_words=32
c.words_per_row=2
factory.reset()
c.recompute_sizes()
debug.info(1, "Two way column mux")
a = factory.create("bank", sram_config=c)
self.local_check(a)
c.num_words=64
c.words_per_row=4
factory.reset()
c.recompute_sizes()
debug.info(1, "Four way column mux")
a = factory.create("bank", sram_config=c)
2016-11-08 18:57:35 +01:00
self.local_check(a)
c.word_size=2
c.num_words=128
c.words_per_row=8
factory.reset()
c.recompute_sizes()
debug.info(1, "Eight way column mux")
a = factory.create("bank", sram_config=c)
self.local_check(a)
globals.end_openram()
# run the test from the command line
2016-11-08 18:57:35 +01:00
if __name__ == "__main__":
(OPTS, args) = globals.parse_args()
del sys.argv[1:]
header(__file__, OPTS.tech_name)
unittest.main()