diff --git a/src/dvsim/flow/base.py b/src/dvsim/flow/base.py index 149fec5b..43b05359 100644 --- a/src/dvsim/flow/base.py +++ b/src/dvsim/flow/base.py @@ -26,6 +26,7 @@ rm_path, subst_wildcards, ) +from dvsim.utils.git import git_commit_hash if TYPE_CHECKING: from dvsim.job.deploy import Deploy @@ -160,6 +161,12 @@ def __init__(self, flow_cfg_file, hjson_data, args, mk_config) -> None: # Configure the report path for instrumentation instrumentation.set_report_path(reports_dir / "metrics.json") + # After initialisation & expansion, save some useful revision metadata + proj_root = Path(self.proj_root) + + self.commit = git_commit_hash(path=proj_root, short=False) + self.commit_short = git_commit_hash(path=proj_root, short=True) + # Run any final checks self._post_init() diff --git a/src/dvsim/sim/flow.py b/src/dvsim/sim/flow.py index 909b3798..fe9e0fac 100644 --- a/src/dvsim/sim/flow.py +++ b/src/dvsim/sim/flow.py @@ -44,7 +44,7 @@ from dvsim.tool.utils import get_sim_tool_plugin from dvsim.utils import TS_FORMAT, rm_path from dvsim.utils.fs import relative_to -from dvsim.utils.git import git_commit_hash, git_https_url_with_commit +from dvsim.utils.git import git_https_url_with_commit __all__ = ("SimCfg",) @@ -176,11 +176,6 @@ def __init__(self, flow_cfg_file, hjson_data, args, mk_config) -> None: super().__init__(flow_cfg_file, hjson_data, args, mk_config) - # After initialisation & expansion, save some useful revision metadata - proj_root = Path(self.proj_root) - self.commit = git_commit_hash(path=proj_root, short=False) - self.commit_short = git_commit_hash(path=proj_root, short=True) - def _expand(self) -> None: # Choose a wave format now. Note that this has to happen after parsing # the configuration format because our choice might depend on the