Skip to content

Commit

Permalink
Merge pull request #71 from efabless/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
M0stafaRady authored Aug 1, 2024
2 parents ef131e8 + ea47f38 commit d617f6f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
4 changes: 4 additions & 0 deletions cocotb/caravel_cocotb/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ def main():
action="store_true",
help="don't run gen_gpio_defaults script",
)
parser.add_argument(
"-gen_defaults_dir",
help="directory to run gen_gpio_defaults script <dir>/scripts/gen_gpio_defaults.py default is caravel_root",
)
parser.add_argument(
"-sdfs_dir",
"-sdfs",
Expand Down
3 changes: 3 additions & 0 deletions cocotb/caravel_cocotb/scripts/verify_cocotb/RunFlow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
13 changes: 8 additions & 5 deletions cocotb/caravel_cocotb/scripts/verify_cocotb/RunRegression.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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}\\"')
Expand Down
2 changes: 1 addition & 1 deletion cocotb/caravel_cocotb/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.2.5"
__version__ = "1.2.6"

0 comments on commit d617f6f

Please sign in to comment.