Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/dvsim/flow/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ def __init__(self, flow_cfg_file, hjson_data, args, mk_config) -> None:
self.project = ""
self.scratch_path = ""
self.scratch_base_path = ""
self.proj_root = ""

# Add exports using 'exports' keyword - these are exported to the child
# process' environment.
Expand Down Expand Up @@ -154,6 +155,10 @@ def __init__(self, flow_cfg_file, hjson_data, args, mk_config) -> None:
# _expand and add the code at the start.
self._expand()

# Check that proj_root has indeed been defined in the hjson config file
if not self.proj_root:
raise RuntimeError("Config file did not define proj_root.")

# After initialisation & expansion, save some useful revision metadata
proj_root = Path(self.proj_root)
self.commit = git_commit_hash(path=proj_root, short=False)
Expand Down
2 changes: 1 addition & 1 deletion src/dvsim/job/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def get_job_spec(self) -> "JobSpec":
),
workspace_cfg=WorkspaceConfig(
timestamp=self.sim_cfg.args.timestamp,
project_root=self.sim_cfg.proj_root,
project_root=Path(self.sim_cfg.proj_root),
scratch_root=Path(self.sim_cfg.scratch_root),
scratch_path=Path(self.sim_cfg.scratch_path),
),
Expand Down
Loading