OpenRAM/compiler/tests/18_port_address_1rw_1r_test.py

45 lines
1.2 KiB
Python
Raw Normal View History

2020-06-03 23:30:15 +02:00
#!/usr/bin/env python3
# See LICENSE for licensing information.
#
2021-01-22 20:23:28 +01:00
# Copyright (c) 2016-2021 Regents of the University of California
2020-06-03 23:30:15 +02:00
# All rights reserved.
#
import unittest
from testutils import *
import sys, os
2020-06-03 23:30:15 +02:00
sys.path.append(os.getenv("OPENRAM_HOME"))
import globals
from globals import OPTS
from sram_factory import factory
import debug
class port_address_1rw_1r_test(openram_test):
def runTest(self):
config_file = "{}/tests/configs/config".format(os.getenv("OPENRAM_HOME"))
globals.init_openram(config_file)
# Use the 2 port cell since it is usually bigger/easier
OPTS.num_rw_ports = 1
OPTS.num_r_ports = 1
OPTS.num_w_ports = 0
globals.setup_bitcell()
2020-11-03 15:29:17 +01:00
2020-06-03 23:30:15 +02:00
debug.info(1, "Port address 16 rows")
a = factory.create("port_address", cols=16, rows=16, port=0)
2020-06-03 23:30:15 +02:00
self.local_check(a)
debug.info(1, "Port address 256 rows")
a = factory.create("port_address", cols=256, rows=256, port=1)
self.local_check(a)
2020-11-03 15:29:17 +01:00
2020-06-03 23:30:15 +02:00
globals.end_openram()
2020-11-03 15:29:17 +01:00
2020-06-03 23:30:15 +02:00
# run the test from the command line
if __name__ == "__main__":
(OPTS, args) = globals.parse_args()
del sys.argv[1:]
header(__file__, OPTS.tech_name)
unittest.main(testRunner=debugTestRunner())