2018-05-12 01:32:00 +02:00
|
|
|
#!/usr/bin/env python3
|
2016-11-08 18:57:35 +01:00
|
|
|
"""
|
2018-05-12 01:32:00 +02:00
|
|
|
Run a regression test on various srams
|
2016-11-08 18:57:35 +01:00
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
import unittest
|
2018-01-30 01:59:29 +01:00
|
|
|
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
|
2017-11-16 22:52:58 +01:00
|
|
|
from globals import OPTS
|
2016-11-08 18:57:35 +01:00
|
|
|
import debug
|
|
|
|
|
|
2018-10-11 01:00:21 +02:00
|
|
|
@unittest.skip("SKIPPING 22_sram_func_test")
|
2018-01-30 01:59:29 +01:00
|
|
|
class sram_func_test(openram_test):
|
2016-11-08 18:57:35 +01:00
|
|
|
|
|
|
|
|
def runTest(self):
|
|
|
|
|
globals.init_openram("config_20_{0}".format(OPTS.tech_name))
|
2018-10-12 15:29:59 +02:00
|
|
|
#OPTS.spice_name="hspice"
|
2017-11-16 22:52:58 +01:00
|
|
|
OPTS.analytical_delay = False
|
2018-09-21 00:04:59 +02:00
|
|
|
|
2018-02-01 01:21:43 +01:00
|
|
|
# This is a hack to reload the characterizer __init__ with the spice version
|
2018-05-12 01:32:00 +02:00
|
|
|
from importlib import reload
|
2017-11-16 22:52:58 +01:00
|
|
|
import characterizer
|
|
|
|
|
reload(characterizer)
|
2018-09-21 00:04:59 +02:00
|
|
|
from characterizer import functional
|
2018-02-01 01:21:43 +01:00
|
|
|
if not OPTS.spice_exe:
|
|
|
|
|
debug.error("Could not find {} simulator.".format(OPTS.spice_name),-1)
|
2017-11-16 22:52:58 +01:00
|
|
|
|
2018-09-21 00:04:59 +02:00
|
|
|
from sram import sram
|
|
|
|
|
from sram_config import sram_config
|
2018-09-29 08:38:48 +02:00
|
|
|
c = sram_config(word_size=4,
|
2018-10-12 15:29:59 +02:00
|
|
|
num_words=64,
|
2018-09-21 00:04:59 +02:00
|
|
|
num_banks=1)
|
2018-10-04 18:29:44 +02:00
|
|
|
c.words_per_row=2
|
2018-09-21 00:04:59 +02:00
|
|
|
debug.info(1, "Functional test for 1bit, 16word SRAM, with 1 bank")
|
|
|
|
|
s = sram(c, name="sram1")
|
2016-11-08 18:57:35 +01:00
|
|
|
|
|
|
|
|
tempspice = OPTS.openram_temp + "temp.sp"
|
|
|
|
|
s.sp_write(tempspice)
|
|
|
|
|
|
2018-02-12 18:33:23 +01:00
|
|
|
corner = (OPTS.process_corners[0], OPTS.supply_voltages[0], OPTS.temperatures[0])
|
2018-09-21 00:04:59 +02:00
|
|
|
f = functional(s.s, tempspice, corner)
|
2018-10-08 15:34:36 +02:00
|
|
|
f.num_cycles = 10
|
|
|
|
|
(fail, error) = f.run()
|
2018-10-01 06:20:01 +02:00
|
|
|
|
2018-10-08 15:34:36 +02:00
|
|
|
self.assertTrue(fail,error)
|
2016-11-08 18:57:35 +01:00
|
|
|
|
2018-09-29 08:38:48 +02:00
|
|
|
globals.end_openram()
|
2016-11-11 23:05:14 +01:00
|
|
|
|
2016-11-08 18:57:35 +01:00
|
|
|
# instantiate a copdsay 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()
|