diff --git a/src/dvsim/flow/base.py b/src/dvsim/flow/base.py index e90c17d1..e37570d1 100644 --- a/src/dvsim/flow/base.py +++ b/src/dvsim/flow/base.py @@ -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. @@ -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) diff --git a/src/dvsim/job/deploy.py b/src/dvsim/job/deploy.py index b31f534a..0678a65f 100644 --- a/src/dvsim/job/deploy.py +++ b/src/dvsim/job/deploy.py @@ -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), ),