Fix config for tests 30

This commit is contained in:
Matthew Guthaus 2019-11-16 22:22:30 +00:00
parent 0b3d2fe9de
commit aca99b87bc
4 changed files with 8 additions and 6 deletions

View File

@ -283,13 +283,15 @@ def read_config(config_file, is_unit_test=True):
# it is already not an abs path, make it one
if not os.path.isabs(config_file):
config_file = os.getcwd() + "/" + config_file
# Make it a python file if the base name was only given
config_file = re.sub(r'\.py$', "", config_file)
# Make it a python file if the base name was only given
config_file = re.sub(r'\.py$', "", config_file)
# Expand the user if it is used
config_file = os.path.expanduser(config_file)
OPTS.config_file = config_file
OPTS.config_file = config_file + ".py"
# Add the path to the system path
# so we can import things in the other directory
dir_name = os.path.dirname(config_file)

View File

@ -112,7 +112,7 @@ class sram():
# Write the config file
start_time = datetime.datetime.now()
from shutil import copyfile
copyfile(OPTS.config_file + '.py', OPTS.output_path + OPTS.output_name + '.py')
copyfile(OPTS.config_file, OPTS.output_path + OPTS.output_name + '.py')
debug.print_raw("Config: Writing to {0}".format(OPTS.output_path + OPTS.output_name + '.py'))
print_time("Config", datetime.datetime.now(), start_time)

View File

@ -20,7 +20,7 @@ class openram_back_end_test(openram_test):
def runTest(self):
OPENRAM_HOME = os.path.abspath(os.environ.get("OPENRAM_HOME"))
config_file = "{}/tests/{}/config".format(os.getenv("OPENRAM_HOME"), OPTS.tech_name)
config_file = "{}/tests/{}/config_back_end".format(os.getenv("OPENRAM_HOME"), OPTS.tech_name)
globals.init_openram(config_file)
debug.info(1, "Testing top-level back-end openram.py with 2-bit, 16 word SRAM.")

View File

@ -20,7 +20,7 @@ class openram_front_end_test(openram_test):
def runTest(self):
OPENRAM_HOME = os.path.abspath(os.environ.get("OPENRAM_HOME"))
config_file = "{}/tests/{}/config".format(os.getenv("OPENRAM_HOME"), OPTS.tech_name)
config_file = "{}/tests/{}/config_front_end".format(os.getenv("OPENRAM_HOME"), OPTS.tech_name)
globals.init_openram(config_file)
debug.info(1, "Testing top-level front-end openram.py with 2-bit, 16 word SRAM.")