diff --git a/cocotb/caravel_cocotb/scripts/verify_cocotb/RunFlow.py b/cocotb/caravel_cocotb/scripts/verify_cocotb/RunFlow.py index 9638f77..dad6b30 100644 --- a/cocotb/caravel_cocotb/scripts/verify_cocotb/RunFlow.py +++ b/cocotb/caravel_cocotb/scripts/verify_cocotb/RunFlow.py @@ -244,6 +244,7 @@ def __init__( sdf_setup=None, macros=None, sim_path=None, + gen_defaults_dir=None, run_path=".", verbosity="normal", check_commits=False, @@ -272,6 +273,7 @@ def __init__( self.clk = clk self.macros = macros self.sim_path = sim_path + self.gen_defaults_dir = gen_defaults_dir self.run_path = run_path self.verbosity = verbosity # dev only @@ -304,6 +306,7 @@ def argparse_to_CocotbArgs(self, args): self.clk = args.clk self.macros = args.macros self.sim_path = args.sim_path + self.gen_defaults_dir = args.gen_defaults_dir self.lint = args.lint self.run_path = os.getcwd() self.verbosity = args.verbosity diff --git a/cocotb/caravel_cocotb/scripts/verify_cocotb/RunRegression.py b/cocotb/caravel_cocotb/scripts/verify_cocotb/RunRegression.py index 852020c..821852e 100644 --- a/cocotb/caravel_cocotb/scripts/verify_cocotb/RunRegression.py +++ b/cocotb/caravel_cocotb/scripts/verify_cocotb/RunRegression.py @@ -175,7 +175,11 @@ def run_defaults_script(self): if self.args.no_gen_defaults: return current_dir = os.getcwd() - os.chdir(f"{self.paths.CARAVEL_ROOT}/") + if self.args.gen_defaults_dir is None: + root_script = f"{self.paths.CARAVEL_ROOT}/" + else: + root_script = self.args.gen_defaults_dir + os.chdir(root_script) self.logger.info("Running gen_gpio_defaults script") os.system( f"python3 scripts/gen_gpio_defaults.py {self.paths.USER_PROJECT_ROOT}" @@ -498,14 +502,13 @@ def unzip_sdf_files(self): pass else: sdf_dir = self.args.sdfs_dir - if isinstance(sdf_dir, list): gz_files = [] for dir in sdf_dir: - gz_files += glob.glob(f"{dir}/**/*.gz") + gz_files += glob.glob(f"{dir}/**/*.gz".replace('"', ''), recursive=True) else: - gz_files = glob.glob(f"{sdf_dir}/**/*.gz") - + gz_files = glob.glob(f"{sdf_dir}/**/*.gz".replace('"', ''), recursive=True) + print("unzipping files {}".format(gz_files)) for gz_file in gz_files: subprocess.run(f"gzip {gz_file} -d".split()) self.args.macros.append(f'SDF_PATH=\\"{sdf_dir}\\"')