From aca99b87bc45025f38bae399c6231973eb9c1246 Mon Sep 17 00:00:00 2001 From: Matthew Guthaus Date: Sat, 16 Nov 2019 22:22:30 +0000 Subject: [PATCH] Fix config for tests 30 --- compiler/globals.py | 8 +++++--- compiler/sram/sram.py | 2 +- compiler/tests/30_openram_back_end_test.py | 2 +- compiler/tests/30_openram_front_end_test.py | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/compiler/globals.py b/compiler/globals.py index 08ae4d96..a0f04de1 100644 --- a/compiler/globals.py +++ b/compiler/globals.py @@ -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) diff --git a/compiler/sram/sram.py b/compiler/sram/sram.py index c4f41f77..dfde78f7 100644 --- a/compiler/sram/sram.py +++ b/compiler/sram/sram.py @@ -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) diff --git a/compiler/tests/30_openram_back_end_test.py b/compiler/tests/30_openram_back_end_test.py index a947ac30..0c7d5e17 100755 --- a/compiler/tests/30_openram_back_end_test.py +++ b/compiler/tests/30_openram_back_end_test.py @@ -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.") diff --git a/compiler/tests/30_openram_front_end_test.py b/compiler/tests/30_openram_front_end_test.py index 54e2b443..79b19dc6 100755 --- a/compiler/tests/30_openram_front_end_test.py +++ b/compiler/tests/30_openram_front_end_test.py @@ -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.")