Skip to content
Merged
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
6 changes: 6 additions & 0 deletions src/dvsim/flow/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -152,6 +153,11 @@ def __init__(self, flow_cfg_file, hjson_data, args, mk_config) -> None:
# _expand and add the code at the start.
self._expand()

# 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)

# Construct the path variables after variable expansion.
reports_dir = Path(self.scratch_base_path) / "reports"
self.results_dir = reports_dir / self.rel_path
Expand Down
7 changes: 1 addition & 6 deletions src/dvsim/sim/flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",)

Expand Down Expand Up @@ -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
Expand Down
Loading