You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Verification script verif/sim/cva6.py performs version consistency checks on several tools including Spike. For Spike it compares the built-in version string based on the short Git hash (SHA1 checksum) against the short hash of the Spike source. There are three cases of false negatives in the current implementation of these checks:
The short form of the hash has a length that is Git version-dependent. On RedHat Enterprise Linux, the short hash is 9 hex digits long whereas the built-in version string is built by fprintf-ing an unsigned integer (32 bits, 8 hex digits) thus causing the most significant digit to be truncated.
The "hex number + fprintf" approach is not robust against leading zeroes in hash value.
The use of "relative level-up" path (..) in git log invocations used to obtain the hash of the enclosing directory triggers a buggy behavior in Git: even when the .. is separated from commit-related information using a double dash (--), it gets interpreted as a commit-relative expression, yielding highly unexpected results.
point 1 - note the truncated leading 8 in the actual version string, even though the CFLAGS contain the correct value -DSPIKE_HASH_VERSION=0x8e8a63730:
$ bash verif/regress/smoke-tests.sh
...
Tue, 14 May 2024 15:15:40 ERROR You are currently using version 1.1.1-dev e8a63730 of Spike, should be: 1.1.1-dev 8e8a63730. Please install or reinstall it with the installation script.
....
$ tools/spike/bin/spike -v
1.1.1-dev e8a63730
$
point 3 occurs only when the core-v-verif commit being used is a merge point (e.g., core-v-verif@c98a21182):
$ (cd verif/core-v-verif/vendor/riscv/riscv-isa-sim/build ; git log -1 --pretty=tformat:%h -- ..)
1 8e8a63730
$ (cd verif/core-v-verif/vendor/riscv/riscv-isa-sim ; git log -1 --pretty=tformat:%h)
1 8e8a63730
$ (cd verif/core-v-verif ; git checkout c98a21182)
Previous HEAD position was 8e8a63730 Revert "Implementation of Spike param via Yaml files"
HEAD is now at c98a21182 Merge pull request #2419 from ThalesSiliconSecurity/revert
$ (cd verif/core-v-verif/vendor/riscv/riscv-isa-sim/build ; git log -1 --pretty=tformat:%h -- ..)
1 8e8a63730
$ (cd verif/core-v-verif/vendor/riscv/riscv-isa-sim ; git log -1 --pretty=tformat:%h)
1 c98a21182
$
The text was updated successfully, but these errors were encountered:
zchamski
added
the
Type:Bug
For bugs in the RTL, Documentation, Verification environment or Tool and Build system
label
May 14, 2024
Fixed in commit e6c3bac by aligning the behavior of Git hash extraction in Spike build inside core-v-verif and in verif/sim/cva6.py. From now on, the project-wide hash of core-v-verif is used on both sides.
Is there an existing CVA6 bug for this?
Bug Description
Verification script
verif/sim/cva6.py
performs version consistency checks on several tools including Spike. For Spike it compares the built-in version string based on the short Git hash (SHA1 checksum) against the short hash of the Spike source. There are three cases of false negatives in the current implementation of these checks:fprintf
-ing an unsigned integer (32 bits, 8 hex digits) thus causing the most significant digit to be truncated.fprintf
" approach is not robust against leading zeroes in hash value...
) ingit log
invocations used to obtain the hash of the enclosing directory triggers a buggy behavior in Git: even when the..
is separated from commit-related information using a double dash (--
), it gets interpreted as a commit-relative expression, yielding highly unexpected results.Examples using 807ed7825 and openhwgroup/core-v-verif@8e8a63730, openhwgroup/core-v-verif@c98a21182:
8
in the actual version string, even though the CFLAGS contain the correct value-DSPIKE_HASH_VERSION=0x8e8a63730
:core-v-verif
commit being used is a merge point (e.g., core-v-verif@c98a21182):The text was updated successfully, but these errors were encountered: