Merged
Conversation
f9feb91 to
e14b489
Compare
The current method for getting the git commit hash is to evaluate git commands as part of hjson wildcard substitution. Presumably as a means of making it more generic and supporting other version control systems. However the opentitan HJSON builds up a markdown string containing a URL link to github. Then DVSim parses that string with a regex. Which couples the somewhat generic mechanism to an exact implementation. This commit adds some generic git utility functions to work directly with git from within DVSim and bypass HJSON calculated values. If we are going to be calling Git, I'd rather do that directly from DVSim, rather than some uncontrolled system call eval in HJSON. If we need to add flexibility to support different systems then we can add that in the future using a plugin system in DVSim and declaratively switching between version control system (i.e. git) and hosting solution (i.e. github) in the HJSON if required. The current solution is highly coupled and doesn't allow for extension. This solution is still git/github specific, but adds scope for later extension if required. It also removes the dependence on one more eval in the OpenTitan HJSON. Signed-off-by: James McCorrie <james.mccorrie@lowrisc.org>
Signed-off-by: James McCorrie <james.mccorrie@lowrisc.org>
e14b489 to
5716c85
Compare
martin-velay
approved these changes
Nov 21, 2025
martin-velay
left a comment
There was a problem hiding this comment.
Looks good, but I am not a Python expert. As long as it has been tested and is an improvement I happy to approve it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The git commit link is broken on the summary page. This is now fixed with this PR.
Fixes: #62