2020-04-02 01:39:47 +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 and The Board
|
2020-04-02 01:39:47 +02:00
|
|
|
# of Regents for the Oklahoma Agricultural and Mechanical College
|
|
|
|
|
# (acting for and on behalf of Oklahoma State University)
|
|
|
|
|
# All rights reserved.
|
|
|
|
|
#
|
|
|
|
|
import unittest
|
|
|
|
|
from testutils import *
|
2020-11-03 22:18:46 +01:00
|
|
|
import sys, os
|
2022-07-13 19:57:56 +02:00
|
|
|
|
2020-04-02 01:39:47 +02:00
|
|
|
import globals
|
|
|
|
|
from globals import OPTS
|
|
|
|
|
from sram_factory import factory
|
|
|
|
|
import debug
|
|
|
|
|
|
2020-11-03 22:18:46 +01:00
|
|
|
|
2020-04-22 02:20:29 +02:00
|
|
|
class hierarchical_decoder_pbitcell_test(openram_test):
|
2020-04-02 01:39:47 +02:00
|
|
|
|
|
|
|
|
def runTest(self):
|
|
|
|
|
config_file = "{}/tests/configs/config".format(os.getenv("OPENRAM_HOME"))
|
|
|
|
|
globals.init_openram(config_file)
|
|
|
|
|
# check hierarchical decoder for multi-port
|
|
|
|
|
OPTS.num_rw_ports = 1
|
|
|
|
|
OPTS.num_w_ports = 0
|
|
|
|
|
OPTS.num_r_ports = 0
|
2020-06-06 00:09:22 +02:00
|
|
|
globals.setup_bitcell()
|
2020-11-03 15:29:17 +01:00
|
|
|
|
2020-04-02 01:39:47 +02:00
|
|
|
factory.reset()
|
|
|
|
|
debug.info(1, "Testing 16 row sample for hierarchical_decoder (multi-port case)")
|
2020-04-09 02:05:16 +02:00
|
|
|
a = factory.create(module_type="hierarchical_decoder", num_outputs=16)
|
2020-04-02 01:39:47 +02:00
|
|
|
self.local_check(a)
|
|
|
|
|
|
|
|
|
|
factory.reset()
|
|
|
|
|
debug.info(1, "Testing 17 row sample for hierarchical_decoder (multi-port case)")
|
2020-04-09 02:05:16 +02:00
|
|
|
a = factory.create(module_type="hierarchical_decoder", num_outputs=17)
|
2020-04-02 01:39:47 +02:00
|
|
|
self.local_check(a)
|
|
|
|
|
|
|
|
|
|
factory.reset()
|
|
|
|
|
debug.info(1, "Testing 23 row sample for hierarchical_decoder (multi-port case)")
|
2020-04-09 02:05:16 +02:00
|
|
|
a = factory.create(module_type="hierarchical_decoder", num_outputs=23)
|
2020-04-02 01:39:47 +02:00
|
|
|
self.local_check(a)
|
|
|
|
|
|
|
|
|
|
debug.info(1, "Testing 32 row sample for hierarchical_decoder (multi-port case)")
|
2020-04-09 02:05:16 +02:00
|
|
|
a = factory.create(module_type="hierarchical_decoder", num_outputs=32)
|
2020-04-02 01:39:47 +02:00
|
|
|
self.local_check(a)
|
|
|
|
|
|
|
|
|
|
factory.reset()
|
|
|
|
|
debug.info(1, "Testing 65 row sample for hierarchical_decoder (multi-port case)")
|
2020-04-09 02:05:16 +02:00
|
|
|
a = factory.create(module_type="hierarchical_decoder", num_outputs=65)
|
2020-04-02 01:39:47 +02:00
|
|
|
self.local_check(a)
|
|
|
|
|
|
|
|
|
|
debug.info(1, "Testing 128 row sample for hierarchical_decoder (multi-port case)")
|
2020-04-09 02:05:16 +02:00
|
|
|
a = factory.create(module_type="hierarchical_decoder", num_outputs=128)
|
2020-04-02 01:39:47 +02:00
|
|
|
self.local_check(a)
|
|
|
|
|
|
|
|
|
|
factory.reset()
|
|
|
|
|
debug.info(1, "Testing 341 row sample for hierarchical_decoder (multi-port case)")
|
2020-04-09 02:05:16 +02:00
|
|
|
a = factory.create(module_type="hierarchical_decoder", num_outputs=341)
|
2020-04-02 01:39:47 +02:00
|
|
|
self.local_check(a)
|
|
|
|
|
|
|
|
|
|
debug.info(1, "Testing 512 row sample for hierarchical_decoder (multi-port case)")
|
2020-04-09 02:05:16 +02:00
|
|
|
a = factory.create(module_type="hierarchical_decoder", num_outputs=512)
|
2020-04-02 01:39:47 +02:00
|
|
|
self.local_check(a)
|
|
|
|
|
|
|
|
|
|
globals.end_openram()
|
2020-04-22 02:20:29 +02:00
|
|
|
|
2020-04-02 01:39:47 +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())
|