Fix up some bugs in the Invoke script.

This commit is contained in:
David Anderson 2024-08-13 20:53:47 -07:00
parent 2efb40fa3d
commit dad128b56b
1 changed files with 5 additions and 4 deletions

View File

@ -27,7 +27,7 @@ def bsc_root(c):
def find_verilog_modules(c, modules): def find_verilog_modules(c, modules):
libpaths = [Path("lib"), bsc_root(c) / "Verilog"] libpaths = [Path("lib"), bsc_root(c) / "Verilog"]
ret = [] ret = []
for m in modules: for module in modules:
module_path = None module_path = None
for p in libpaths: for p in libpaths:
f = p / Path(module).with_suffix(".v") f = p / Path(module).with_suffix(".v")
@ -35,7 +35,7 @@ def find_verilog_modules(c, modules):
module_path = f module_path = f
break break
if module_path is None: if module_path is None:
raise RuntimeError(f"Cannot find verilog module {m} in {libpaths}") raise RuntimeError(f"Cannot find verilog module {module} in {libpaths}")
ret.append(module_path) ret.append(module_path)
return ret return ret
@ -56,12 +56,13 @@ def expand_build_target(target):
raise ValueError(f"Unknown target type {t}") raise ValueError(f"Unknown target type {t}")
def resolve_synth_target(target): def resolve_synth_target(target):
target = Path(target)
if '/' not in str(target): if '/' not in str(target):
target = "hardware" / Path(target) target = "hardware" / target
if target.is_dir(): if target.is_dir():
target /= "Top.bsv" target /= "Top.bsv"
if not target.is_file(): if not target.is_file():
raise ArgumentError(f"Unknown target type {target}") raise ValueError(f"Unknown target type {target}")
return target return target
def expand_test_target(target): def expand_test_target(target):