From b1976ce0a5bb8a5fb474bf9e257faf7c77a325b2 Mon Sep 17 00:00:00 2001 From: Todd Strader Date: Wed, 15 Apr 2026 14:23:31 -0400 Subject: [PATCH] CR, etc. --- ci/ci-install.bash | 26 ++++++++++++++++++++++- ci/docker/buildenv/Dockerfile | 12 +++++++---- ci/docker/buildenv/wavetools.conf | 1 + docs/spelling.txt | 1 + src/V3ProtectLib.cpp | 2 +- test_regress/driver.py | 9 ++++---- test_regress/t/t_dist_copyright.py | 1 + test_regress/t/trace_hier_block_common.py | 1 - test_regress/t/trace_lib_common.py | 1 - 9 files changed, 42 insertions(+), 12 deletions(-) create mode 100644 ci/docker/buildenv/wavetools.conf diff --git a/ci/ci-install.bash b/ci/ci-install.bash index b256ccbfd..b3ae2e06d 100755 --- a/ci/ci-install.bash +++ b/ci/ci-install.bash @@ -41,7 +41,31 @@ if [ "$CI_OS_NAME" = "linux" ]; then fi install-wavediff() { - cargo install wavetools + source ci/docker/buildenv/wavetools.conf + local _base_url="https://github.com/hudson-trading/wavetools/releases/download/${WAVETOOLS_VERSION}" + local _platform + if [ "$CI_OS_NAME" = "linux" ]; then + _platform="linux-x86_64" + elif [ "$CI_OS_NAME" = "osx" ]; then + _platform="macos-arm64" + elif [ "$CI_OS_NAME" = "windows" ]; then + _platform="windows-x86_64" + else + echo "WARNING: No wavetools binary available for CI_OS_NAME=$CI_OS_NAME, skipping" + return 0 + fi + local _tmpdir + _tmpdir=$(mktemp -d) + local _archive="wavetools-${WAVETOOLS_VERSION}-${_platform}" + if [ "$CI_OS_NAME" = "windows" ]; then + wget -q -O "${_tmpdir}/${_archive}.zip" "${_base_url}/${_archive}.zip" + unzip -o "${_tmpdir}/${_archive}.zip" -d "${_tmpdir}" + else + wget -q -O "${_tmpdir}/${_archive}.tar.gz" "${_base_url}/${_archive}.tar.gz" + tar -xzf "${_tmpdir}/${_archive}.tar.gz" -C "${_tmpdir}" + fi + sudo cp "${_tmpdir}/${_archive}/wavediff" /usr/local/bin/wavediff + rm -rf "${_tmpdir}" } if [ "$CI_BUILD_STAGE_NAME" = "build" ]; then diff --git a/ci/docker/buildenv/Dockerfile b/ci/docker/buildenv/Dockerfile index 4cbb57466..d5e56df3c 100644 --- a/ci/docker/buildenv/Dockerfile +++ b/ci/docker/buildenv/Dockerfile @@ -53,10 +53,14 @@ RUN apt-get update \ WORKDIR /tmp -RUN apt-get update && apt-get install --no-install-recommends -y cargo && \ - apt-get clean && rm -rf /var/lib/apt/lists/* -RUN cargo install wavetools && \ - cp -p $HOME/.cargo/bin/wavediff /usr/local/bin/wavediff +COPY wavetools.conf /tmp/wavetools.conf +ARG WGET_EXTRA_ARGS= +RUN . /tmp/wavetools.conf && \ + wget -q ${WGET_EXTRA_ARGS} -O /tmp/wavetools.tar.gz \ + "https://github.com/hudson-trading/wavetools/releases/download/${WAVETOOLS_VERSION}/wavetools-${WAVETOOLS_VERSION}-linux-x86_64.tar.gz" && \ + tar -xzf /tmp/wavetools.tar.gz -C /tmp && \ + cp /tmp/wavetools-${WAVETOOLS_VERSION}-linux-x86_64/wavediff /usr/local/bin/wavediff && \ + rm -rf /tmp/wavetools.tar.gz /tmp/wavetools-* /tmp/wavetools.conf COPY build.sh /tmp/build.sh diff --git a/ci/docker/buildenv/wavetools.conf b/ci/docker/buildenv/wavetools.conf new file mode 100644 index 000000000..d327112c5 --- /dev/null +++ b/ci/docker/buildenv/wavetools.conf @@ -0,0 +1 @@ +WAVETOOLS_VERSION=v0.1.2 diff --git a/docs/spelling.txt b/docs/spelling.txt index 7e86ffdad..6d7b85bb1 100644 --- a/docs/spelling.txt +++ b/docs/spelling.txt @@ -1257,6 +1257,7 @@ vpm vpp warmup wavealloca +wavediff waveforms whitespace widthed diff --git a/src/V3ProtectLib.cpp b/src/V3ProtectLib.cpp index c7be84580..49aa38f56 100644 --- a/src/V3ProtectLib.cpp +++ b/src/V3ProtectLib.cpp @@ -221,7 +221,7 @@ class ProtectVisitor final : public VNVisitor { + "_protectlib_final(chandle handle__V);\n\n"); // Local variables - // Avoid tracing handle, as it is not a stable value, so breaks vcddiff + // Avoid tracing handle, as it is not a stable value, so breaks wavediff // Likewise other internals aren't interesting to the user txtp->add("// verilator tracing_off\n"); diff --git a/test_regress/driver.py b/test_regress/driver.py index f3b70e8e7..d26d3fd6c 100755 --- a/test_regress/driver.py +++ b/test_regress/driver.py @@ -2514,10 +2514,11 @@ class VlTest: def vcd_identical(self, fn1: str, fn2: str) -> None: """Test if two VCD/FST files have logically-identical contents""" - cmd = 'wavediff --epsilon ' + fn1 + ' ' + fn2 - out = VtOs.run_capture(cmd, check=False) - if out != "": - print(out) + cmd = 'wavediff --epsilon 0.0000001 ' + fn1 + ' ' + fn2 + proc = subprocess.run([cmd], capture_output=True, text=True, shell=True, check=False) + if proc.returncode: + print(proc.stderr) + print(proc.stdout) self.copy_if_golden(fn1, fn2) self.error("VCD miscompares " + fn1 + " " + fn2) diff --git a/test_regress/t/t_dist_copyright.py b/test_regress/t/t_dist_copyright.py index 53ee776c6..e9aab9c58 100755 --- a/test_regress/t/t_dist_copyright.py +++ b/test_regress/t/t_dist_copyright.py @@ -26,6 +26,7 @@ EXEMPT_FILES_LIST = """ REUSE.toml ci/ci-win-compile.ps1 ci/ci-win-test.ps1 + ci/docker/buildenv/wavetools.conf ci/codecov docs/CONTRIBUTORS docs/_static diff --git a/test_regress/t/trace_hier_block_common.py b/test_regress/t/trace_hier_block_common.py index b300d7dff..e634b5e28 100644 --- a/test_regress/t/trace_hier_block_common.py +++ b/test_regress/t/trace_hier_block_common.py @@ -93,7 +93,6 @@ def run(test, *, verilator_flags2=()): if "enddefinitions" in la: break - # NOCOMMIT: figure out attr handling test.trace_identical(trace_hier, trace_nonh) # The hierarchical must match the reference test.trace_identical(trace_hier, test.golden_filename) diff --git a/test_regress/t/trace_lib_common.py b/test_regress/t/trace_lib_common.py index ad831d9a3..f3cf31866 100644 --- a/test_regress/t/trace_lib_common.py +++ b/test_regress/t/trace_lib_common.py @@ -109,7 +109,6 @@ def run(test, *, verilator_flags2=()): if "enddefinitions" in la: break - # NOCOMMIT: figure out attr handling test.trace_identical(trace_libs, trace_nonl) # The --lib-create must match the reference test.trace_identical(trace_libs, test.golden_filename)