diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 5504fd433..706a40690 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -44,7 +44,7 @@ jobs: run: | ./ci/ci-script.bash - tar cvzf verilator-${CI_COMMIT}-coverage.tgz bin src/obj*/*.gcno + tar cvzf verilator-${CI_COMMIT}-coverage.tgz bin src/obj*/*.o src/obj*/*.gcno - uses: actions/upload-artifact@v2 with: @@ -87,6 +87,7 @@ jobs: - name: Install Verilator and test dependencies run: | tar xvzf artifact/verilator-${CI_COMMIT}-coverage.tgz + touch src/obj*/*.o src/obj*/*.gcno ./ci/ci-install.bash - name: Test diff --git a/ci/ci-script.bash b/ci/ci-script.bash index bcfc24285..eb3b828cf 100755 --- a/ci/ci-script.bash +++ b/ci/ci-script.bash @@ -51,7 +51,7 @@ if [ "$CI_BUILD_STAGE_NAME" = "build" ]; then stat bin/verilator_bin_dbg fi else - nodist/code_coverage --stages 1-2 + nodist/code_coverage --stages 0-2 fi elif [ "$CI_BUILD_STAGE_NAME" = "test" ]; then ############################################################################## @@ -97,34 +97,34 @@ elif [ "$CI_BUILD_STAGE_NAME" = "test" ]; then "$MAKE" -C test_regress SCENARIOS=--vltmt DRIVER_HASHSET=--hashset=1/2 ;; coverage-all) - nodist/code_coverage --stages 3- + nodist/code_coverage --stages 1- ;; coverage-dist) - nodist/code_coverage --stages 3- --scenarios=--dist + nodist/code_coverage --stages 1- --scenarios=--dist ;; coverage-vlt-0) - nodist/code_coverage --stages 3- --scenarios=--vlt --hashset=0/4 + nodist/code_coverage --stages 1- --scenarios=--vlt --hashset=0/4 ;; coverage-vlt-1) - nodist/code_coverage --stages 3- --scenarios=--vlt --hashset=1/4 + nodist/code_coverage --stages 1- --scenarios=--vlt --hashset=1/4 ;; coverage-vlt-2) - nodist/code_coverage --stages 3- --scenarios=--vlt --hashset=2/4 + nodist/code_coverage --stages 1- --scenarios=--vlt --hashset=2/4 ;; coverage-vlt-3) - nodist/code_coverage --stages 3- --scenarios=--vlt --hashset=3/4 + nodist/code_coverage --stages 1- --scenarios=--vlt --hashset=3/4 ;; coverage-vltmt-0) - nodist/code_coverage --stages 3- --scenarios=--vltmt --hashset=0/4 + nodist/code_coverage --stages 1- --scenarios=--vltmt --hashset=0/4 ;; coverage-vltmt-1) - nodist/code_coverage --stages 3- --scenarios=--vltmt --hashset=1/4 + nodist/code_coverage --stages 1- --scenarios=--vltmt --hashset=1/4 ;; coverage-vltmt-2) - nodist/code_coverage --stages 3- --scenarios=--vltmt --hashset=2/4 + nodist/code_coverage --stages 1- --scenarios=--vltmt --hashset=2/4 ;; coverage-vltmt-3) - nodist/code_coverage --stages 3- --scenarios=--vltmt --hashset=3/4 + nodist/code_coverage --stages 1- --scenarios=--vltmt --hashset=3/4 ;; *) fatal "Unknown test: $TESTS" diff --git a/nodist/code_coverage b/nodist/code_coverage index ce797e942..4dc57d96a 100755 --- a/nodist/code_coverage +++ b/nodist/code_coverage @@ -26,10 +26,15 @@ def test(): sys.exit("%Error: Run code_coverage from the top of the verilator kit") exec(open("./nodist/code_coverage.dat").read()) + if Args.stage_enabled[0]: + ci_fold_start("distclean") + print("Stage 0: distclean") + run("make distclean || true") + ci_fold_end() + if Args.stage_enabled[1]: ci_fold_start("configure") print("Stage 1: configure (coverage on)") - run("make distclean || true") run("autoconf") # Exceptions can pollute the branch coverage data run("./configure --enable-longtests CXX='g++ --coverage -fno-exceptions -DVL_GCOV'" @@ -387,7 +392,7 @@ if True: start = int(match_from.group(1)) else: os.exit("%Error: --stages not understood: " + Args.stages) - for n in range(1, 100): + for n in range(0, 100): Args.stage_enabled[n] = False for n in range(start, end + 1): Args.stage_enabled[n] = True