diff --git a/.codecov.yml b/.codecov.yml index 003364353..75dc35efe 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -1,7 +1,7 @@ --- # DESCRIPTION: codecov.io config # -# Copyright 2020-2025 by Wilson Snyder. This program is free software; you +# Copyright 2020-2026 by Wilson Snyder. This program is free software; you # can redistribute it and/or modify it under the terms of either the GNU # Lesser General Public License Version 3 or the Perl Artistic License # Version 2.0. diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 4d9d1a8ca..1d61ec338 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -138,11 +138,11 @@ jobs: CCACHE_DIR: ${{ github.workspace }}/.ccache CCACHE_LIMIT_MULTIPLE: 0.95 steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 with: path: repo - name: Cache $CCACHE_DIR - uses: actions/cache@v4 + uses: actions/cache@v5 with: path: ${{ env.CCACHE_DIR }} key: msbuild-msvc-cmake @@ -155,7 +155,7 @@ jobs: - name: Zip up repository run: Compress-Archive -LiteralPath install -DestinationPath verilator.zip - name: Upload zip archive - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v6 with: path: ${{ github.workspace }}/repo/verilator.zip name: verilator-win.zip diff --git a/.github/workflows/contributor.yml b/.github/workflows/contributor.yml index a814be303..02549bf76 100644 --- a/.github/workflows/contributor.yml +++ b/.github/workflows/contributor.yml @@ -16,5 +16,5 @@ jobs: name: "'docs/CONTRIBUTORS' was signed" runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - run: test_regress/t/t_dist_contributors.py diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index e2516e776..f25f1c944 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -74,10 +74,10 @@ jobs: runs-on: ubuntu-24.04 steps: - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Download code coverage data - uses: actions/download-artifact@v6 + uses: actions/download-artifact@v7 with: pattern: code-coverage-* path: obj_coverage @@ -113,7 +113,7 @@ jobs: sudo apt install lcov - name: Download repository archive - uses: actions/download-artifact@v6 + uses: actions/download-artifact@v7 with: name: ${{ needs.build.outputs.archive }} path: ${{ github.workspace }} @@ -124,7 +124,7 @@ jobs: ls -lsha - name: Download code coverage data - uses: actions/download-artifact@v6 + uses: actions/download-artifact@v7 with: pattern: code-coverage-* path: repo/obj_coverage @@ -169,14 +169,14 @@ jobs: fi - name: Upload report - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v6 with: path: repo/obj_coverage name: coverage-report - name: Upload notification if: ${{ github.event_name == 'pull_request' }} - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v6 with: path: repo/notification name: coverage-pr-notification @@ -192,7 +192,7 @@ jobs: # Creating issues requires elevated privilege - name: Generate access token id: generate-token - uses: actions/create-github-app-token@v2.1.4 + uses: actions/create-github-app-token@v2.2.1 with: app-id: ${{ vars.VERILATOR_CI_ID }} private-key: ${{ secrets.VERILATOR_CI_KEY }} diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 3ea8faf86..05f8f101e 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -39,7 +39,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Extract context variables run: | diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index c319c6c14..f1940067d 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -21,23 +21,23 @@ jobs: CI_COMMIT: ${{ github.sha }} steps: - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: token: ${{ secrets.GITHUB_TOKEN }} - name: Install packages for build env: CI_BUILD_STAGE_NAME: build run: | - bash ci/ci-install.bash && - sudo apt-get install clang-format-18 yapf3 && - sudo pip3 install gersemi mbake && - git config --global user.email "action@example.com" && + sudo apt install clang-format-18 + git config --global user.email "action@example.com" git config --global user.name "github action" - name: Format code run: | - autoconf && - ./configure && - make -j 2 format CLANGFORMAT=clang-format-18 && + autoconf + ./configure + make venv + source .venv/bin/activate + make -j 2 format CLANGFORMAT=clang-format-18 git status - name: Push run: |- diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 2642091e4..651cc44a2 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -6,11 +6,8 @@ name: Pages on: push: - branches: - - master - paths: - - "ci/**" - - ".github/workflows" + branches: [master] + paths: ["ci/**", ".github/workflows"] workflow_dispatch: workflow_run: workflows: ["Code coverage"] @@ -41,7 +38,7 @@ jobs: coverage-pr-run-ids: ${{ steps.build.outputs.coverage-pr-run-ids }} steps: - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Build pages id: build env: @@ -73,11 +70,11 @@ jobs: if: ${{ github.repository == 'verilator/verilator' }} steps: - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@v6 # Use the Verilator CI app to post the comment - name: Generate access token id: generate-token - uses: actions/create-github-app-token@v2.1.4 + uses: actions/create-github-app-token@v2.2.1 with: app-id: ${{ vars.VERILATOR_CI_ID }} private-key: ${{ secrets.VERILATOR_CI_KEY }} diff --git a/.github/workflows/reusable-build.yml b/.github/workflows/reusable-build.yml index ed2048c41..2818c1455 100644 --- a/.github/workflows/reusable-build.yml +++ b/.github/workflows/reusable-build.yml @@ -61,14 +61,14 @@ jobs: CCACHE_MAXSIZE: 1000M # Per build matrix entry (* 5 = 5000M in total) steps: - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: path: repo ref: ${{ inputs.sha }} fetch-depth: ${{ inputs.dev-gcov && '0' || '1' }} # Coverage flow needs full history - name: Cache $CCACHE_DIR - uses: actions/cache@v4 + uses: actions/cache@v5 env: CACHE_KEY: ${{ env.CACHE_BASE_KEY }}-ccache with: @@ -93,7 +93,7 @@ jobs: echo "archive=$ARCHIVE" >> "$GITHUB_OUTPUT" - name: Upload repository archive - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v6 with: path: ${{ github.workspace }}/${{ steps.create-archive.outputs.archive }} name: ${{ steps.create-archive.outputs.archive }} diff --git a/.github/workflows/reusable-lint-py.yml b/.github/workflows/reusable-lint-py.yml index 3edc4bed7..53fbcf256 100644 --- a/.github/workflows/reusable-lint-py.yml +++ b/.github/workflows/reusable-lint-py.yml @@ -27,20 +27,24 @@ jobs: name: Sub-lint | Python steps: - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: path: repo - name: Install packages for build run: ./ci/ci-install.bash - # We use specific version numbers, otherwise a Python package - # update may add a warning and break our build - - name: Install packages for lint - run: sudo pip3 install mypy==1.18.2 pylint==3.0.2 ruff==0.1.3 clang sphinx sphinx_rtd_theme sphinxcontrib-spelling breathe ruff - - name: Configure - run: autoconf && ./configure --enable-longtests --enable-ccwarn + run: | + autoconf + ./configure --enable-longtests --enable-ccwarn + + - name: Install python dependencies + run: | + sudo apt install python3-clang + make venv - name: Lint - run: make -k lint-py + run: |- + source .venv/bin/activate + make -k lint-py diff --git a/.github/workflows/reusable-rtlmeter-build.yml b/.github/workflows/reusable-rtlmeter-build.yml index f371ac687..1e2bd33db 100644 --- a/.github/workflows/reusable-rtlmeter-build.yml +++ b/.github/workflows/reusable-rtlmeter-build.yml @@ -38,14 +38,14 @@ jobs: sudo apt install ccache mold help2man libfl-dev libgoogle-perftools-dev libsystemc-dev - name: Use saved ccache - uses: actions/cache@v4 + uses: actions/cache@v5 with: path: ccache key: rtlmeter-build-ccache-${{ inputs.runs-on }}-${{ inputs.cc }}-${{ github.run_id }}-${{ github.run_attempt }} restore-keys: rtlmeter-build-ccache-${{ inputs.runs-on }}-${{ inputs.cc }} - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: path: repo fetch-depth: 0 # Required for 'git describe' used for 'verilator --version' @@ -68,7 +68,7 @@ jobs: run: tar --posix -c -z -f verilator-rtlmeter.tar.gz install - name: Upload Verilator installation archive - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v6 with: path: verilator-rtlmeter.tar.gz name: verilator-rtlmeter-${{ inputs.runs-on }}-${{ inputs.cc }} diff --git a/.github/workflows/reusable-rtlmeter-run.yml b/.github/workflows/reusable-rtlmeter-run.yml index b4cf573da..96bf409fb 100644 --- a/.github/workflows/reusable-rtlmeter-run.yml +++ b/.github/workflows/reusable-rtlmeter-run.yml @@ -62,7 +62,7 @@ jobs: sudo apt install ccache mold libfl-dev libgoogle-perftools-dev libsystemc-dev - name: Download Verilator installation archive - uses: actions/download-artifact@v6 + uses: actions/download-artifact@v7 with: name: verilator-rtlmeter-${{ inputs.runs-on }}-${{ inputs.cc }} @@ -73,14 +73,14 @@ jobs: - name: Use saved ccache if: ${{ env.CCACHE_DISABLE == 0 }} - uses: actions/cache@v4 + uses: actions/cache@v5 with: path: ${{ env.CCACHE_DIR }} key: rtlmeter-run-ccache-${{ inputs.runs-on }}-${{ inputs.cc }}-${{ inputs.cases }}-${{ inputs.compileArgs }}-${{ github.run_id }}-${{ github.run_attempt }} restore-keys: rtlmeter-run-ccache-${{ inputs.runs-on }}-${{ inputs.cc }}-${{ inputs.cases }}-${{ inputs.compileArgs }} - name: Checkout RTLMeter - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: repository: "verilator/rtlmeter" path: rtlmeter @@ -115,7 +115,7 @@ jobs: ./rtlmeter report --steps '*' --metrics '*' ../results-${{ steps.results.outputs.hash }}.json - name: Upload results - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v6 with: path: results-${{ steps.results.outputs.hash }}.json name: rtlmeter-${{ inputs.tag }}-results-${{ steps.results.outputs.hash }} @@ -124,5 +124,5 @@ jobs: - name: Report status working-directory: rtlmeter - run: | # This will fail the job if any of the runs failed + run: |- # This will fail the job if any of the runs failed ./rtlmeter run --verbose --cases='${{inputs.cases}}' --compileArgs='${{inputs.compileArgs}}' --executeArgs='${{inputs.executeArgs}}' diff --git a/.github/workflows/reusable-test.yml b/.github/workflows/reusable-test.yml index 186490e55..d2fb687c3 100644 --- a/.github/workflows/reusable-test.yml +++ b/.github/workflows/reusable-test.yml @@ -55,7 +55,7 @@ jobs: steps: - name: Download repository archive - uses: actions/download-artifact@v6 + uses: actions/download-artifact@v7 with: name: ${{ inputs.archive }} path: ${{ github.workspace }} @@ -67,7 +67,7 @@ jobs: ls -lsha - name: Cache $CCACHE_DIR - uses: actions/cache@v4 + uses: actions/cache@v5 env: CACHE_KEY: ${{ env.CACHE_BASE_KEY }}-ccache2 with: @@ -77,14 +77,18 @@ jobs: ${{ env.CACHE_KEY }}- - name: Install test dependencies - run: ./ci/ci-install.bash + run: | + ./ci/ci-install.bash + make venv - name: Test id: run-test continue-on-error: true env: TESTS: ${{ inputs.suite }} - run: ./ci/ci-script.bash + run: | + source .venv/bin/activate + ./ci/ci-script.bash - name: Combine code coverage data if: ${{ inputs.dev-gcov }} @@ -95,7 +99,7 @@ jobs: - name: Upload code coverage data if: ${{ inputs.dev-gcov }} - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v6 with: path: ${{ github.workspace }}/repo/obj_coverage/verilator-${{ inputs.suite }}.info name: code-coverage-${{ inputs.suite }} diff --git a/.github/workflows/rtlmeter-pr-results.yml b/.github/workflows/rtlmeter-pr-results.yml index b1918f4df..5ce1b0fdc 100644 --- a/.github/workflows/rtlmeter-pr-results.yml +++ b/.github/workflows/rtlmeter-pr-results.yml @@ -20,13 +20,13 @@ jobs: pull-requests: write steps: - name: Download report - uses: actions/download-artifact@v6 + uses: actions/download-artifact@v7 with: name: rtlmeter-pr-results run-id: ${{ github.event.workflow_run.id }} github-token: ${{ secrets.GITHUB_TOKEN }} - name: Download PR number - uses: actions/download-artifact@v6 + uses: actions/download-artifact@v7 with: name: pr-number run-id: ${{ github.event.workflow_run.id }} @@ -34,7 +34,7 @@ jobs: # Use the Verilator CI app to post the comment - name: Generate access token id: generate-token - uses: actions/create-github-app-token@v2.1.4 + uses: actions/create-github-app-token@v2.2.1 with: app-id: ${{ vars.VERILATOR_CI_ID }} private-key: ${{ secrets.VERILATOR_CI_KEY }} diff --git a/.github/workflows/rtlmeter.yml b/.github/workflows/rtlmeter.yml index 255208759..3dee9f230 100644 --- a/.github/workflows/rtlmeter.yml +++ b/.github/workflows/rtlmeter.yml @@ -77,6 +77,7 @@ jobs: - "BlackParrot:1x1:*" - "BlackParrot:2x2:*" - "BlackParrot:4x4:*" + - "Caliptra:default:*" - "NVDLA:*" - "OpenPiton:1x1:*" - "OpenPiton:2x2:*" @@ -122,6 +123,7 @@ jobs: - "BlackParrot:1x1:*" - "BlackParrot:2x2:*" - "BlackParrot:4x4:*" + - "Caliptra:default:*" - "NVDLA:*" - "OpenPiton:1x1:*" - "OpenPiton:2x2:*" @@ -188,7 +190,7 @@ jobs: tag: [gcc, clang, gcc-hier] steps: - name: Checkout RTLMeter - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: repository: "verilator/rtlmeter" path: rtlmeter @@ -196,7 +198,7 @@ jobs: working-directory: rtlmeter run: make venv - name: Download all results - uses: actions/download-artifact@v6 + uses: actions/download-artifact@v7 with: pattern: rtlmeter-${{ matrix.tag }}-results-* path: all-results-${{ matrix.tag }} @@ -206,7 +208,7 @@ jobs: run: | ./rtlmeter collate ../all-results-${{ matrix.tag }}/*.json > ../all-results-${{ matrix.tag }}.json - name: Upload combined results - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v6 with: path: all-results-${{ matrix.tag }}.json name: all-results-${{ matrix.tag }} @@ -225,20 +227,20 @@ jobs: runs-on: ubuntu-24.04 steps: - name: Download combined results - uses: actions/download-artifact@v6 + uses: actions/download-artifact@v7 with: pattern: all-results-* path: results merge-multiple: true - name: Upload published results - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v6 with: path: results/*.json name: published-results # Pushing to verilator/verilator-rtlmeter-results requires elevated permissions - name: Generate access token id: generate-token - uses: actions/create-github-app-token@v2.1.4 + uses: actions/create-github-app-token@v2.2.1 with: app-id: ${{ vars.VERILATOR_CI_ID }} private-key: ${{ secrets.VERILATOR_CI_KEY }} @@ -246,7 +248,7 @@ jobs: repositories: verilator-rtlmeter-results permission-contents: write - name: Checkout verilator-rtlmeter-results - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: repository: "verilator/verilator-rtlmeter-results" token: ${{ steps.generate-token.outputs.token }} @@ -279,7 +281,7 @@ jobs: actions: read steps: - name: Checkout RTLMeter - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: repository: "verilator/rtlmeter" path: rtlmeter @@ -287,7 +289,7 @@ jobs: working-directory: rtlmeter run: make venv - name: Download combined results - uses: actions/download-artifact@v6 + uses: actions/download-artifact@v7 with: pattern: all-results-* path: all-results @@ -306,7 +308,7 @@ jobs: DATE=$(gh run --repo ${{ github.repository }} view $ID --json createdAt --jq ".createdAt") echo "date=$DATE" >> $GITHUB_OUTPUT - name: Download scheduled run results - uses: actions/download-artifact@v6 + uses: actions/download-artifact@v7 with: name: published-results path: nightly-results @@ -372,14 +374,14 @@ jobs: done cat report.txt - name: Upload report - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v6 with: path: report.txt name: rtlmeter-pr-results - name: Save PR number run: echo ${{ github.event.number }} > pr-number.txt - name: Upload PR number - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v6 with: path: pr-number.txt name: pr-number @@ -395,7 +397,7 @@ jobs: # Creating issues requires elevated privilege - name: Generate access token id: generate-token - uses: actions/create-github-app-token@v2.1.4 + uses: actions/create-github-app-token@v2.2.1 with: app-id: ${{ vars.VERILATOR_CI_ID }} private-key: ${{ secrets.VERILATOR_CI_KEY }} diff --git a/.gitignore b/.gitignore index 6814ac82d..dbf906295 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ *.pdf /Makefile /.ccache +/.venv/ /artifact/ README TAGS diff --git a/CITATION.cff b/CITATION.cff index 61136d929..a3e43ff86 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -1,3 +1,4 @@ +--- # See https://citation-file-format.github.io/ cff-version: 1.2.0 title: Verilator @@ -14,14 +15,14 @@ authors: family-names: Wasson - given-names: Duane family-names: Galbi + - given-names: Geza + family-names: Lore - name: 'et al' repository-code: 'https://github.com/verilator/verilator' url: 'https://verilator.org' abstract: >- The Verilator package converts Verilog and SystemVerilog hardware description language (HDL) designs into a fast C++ or SystemC model - that, after compiling, can be executed. Verilator is not a + that, after compiling, can be executed. Verilator is not only a traditional simulator but a compiler. -license: - - LGPL-3.0-only - - Artistic-2.0 +license: [LGPL-3.0-only, Artistic-2.0] diff --git a/CMakeLists.txt b/CMakeLists.txt index d311d6a7e..3cf9b4b91 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ # #***************************************************************************** # -# Copyright 2003-2025 by Wilson Snyder. This program is free software; you +# Copyright 2003-2026 by Wilson Snyder. This program is free software; you # can redistribute it and/or modify it under the terms of either the GNU # Lesser General Public License Version 3 or the Perl Artistic License # Version 2.0. @@ -16,7 +16,7 @@ cmake_minimum_required(VERSION 3.15) cmake_policy(SET CMP0091 NEW) # Use MSVC_RUNTIME_LIBRARY to select the runtime project( Verilator - VERSION 5.042 + VERSION 5.044 HOMEPAGE_URL https://verilator.org LANGUAGES CXX ) diff --git a/Changes b/Changes index dc0a43231..95e6062c2 100644 --- a/Changes +++ b/Changes @@ -8,6 +8,130 @@ The changes in each Verilator version are described below. The contributors that suggested or implemented a given issue are shown in []. Thanks! +Verilator 5.044 2026-01-01 +========================== + +**Important:** + +* This is the last release supporting the deprecated `--xml-only` and + `--make cmake` options. +* Change `--lint-only` and `--json-only` to imply `--timing` (#6790). + +**Other:** + +* Add `--unroll-limit` option (#6654) (#6668). [Geza Lore, Fractile Ltd.] +* Add `-fno-inline-funcs-eager` option to disable excessive inlining (#6682). [Geza Lore, Fractile Ltd.] +* Add `-param`/`-port` options to `public_flat*` control directives (#6685). [Geza Lore, Fractile Ltd.] +* Add `--top` specifying `config` name (#6710). [Dan Ruelas-Petrisko] +* Add `sc_biguint` pragma (#6712). [Jakub Wasilewski, Antmicro Ltd.] +* Add `make venv` target (#6775). [Geza Lore] +* Add SUPERNFIRST error on super.new on non-first statement (#6784). [Artur Bieniek] +* Add fargs for reusability of `--dump-inputs` output (#6812). [Geza Lore] +* Add `--quiet-build` to suppress make/compiler informationals. +* Support `std::randomize(){...}` (#4706) (#6573). [Yilou Wang] +* Support force assignments to unpacked array elements (partial #4735) (#6787). [Ryszard Rozak, Antmicro Ltd.] +* Support `config' (#5891) (#6714) (#6717) (#6745) (#6764). [Dan Ruelas-Petrisko] +* Support unpacked struct in localparam (#6053 partial) (#6708). [Jonathan Drolet] +* Support `randsequence` (#6131). +* Support array reference arguments into 'std::randomize()' (#6384) (#6719). [Yilou Wang] +* Support basic global constraints (#6551) (#6552). [Yilou Wang] +* Support SystemC time resolution with step 10/100 (#6633) (#6715). [Aliaksei Chapyzhenka] +* Support `this.randomize()` with constraints (#6634). [Artur Bieniek, Antmicro Ltd.] +* Support multi-expression sequences (#6639). [Bartłomiej Chmiel, Antmicro Ltd.] +* Support `#1step` delay as statement (#6671). [Pawel Kojma, Antmicro Ltd.] +* Support clocking output delay `1step` (#6681). [Ondrej Ille] +* Support parsing of dotted `bins_expression` (#6683). [Pawel Kojma, Antmicro Ltd.] +* Support constant expression cycle delays in sequences (#6691). [Ryszard Rozak, Antmicro Ltd.] +* Support general global constraints (#6709) (#6711). [Yilou Wang] +* Support complex std::randomize patterns (#6736) (#6737). [Yilou Wang] +* Support `rand_mode` in global constraint gathering (#6740) (#6752). [Yilou Wang] +* Support reduction or in constraints (#6840). [Pawel Kojma, Antmicro Ltd.] +* Support vpiSigned (#6868) (#6870). [Kaleb Barrett] +* Optimize away calls to empty functions (#6626). [Geza Lore] +* Optimize redundant headers in Syms implementation files. [Geza Lore, Fractile Ltd.] +* Optimize constructor/destructor VerilatedModules (#6660). [Geza Lore, Fractile Ltd.] +* Optimize repeated function call during symbol table initialization (#6665). [Geza Lore, Fractile Ltd.] +* Optimize functions reading external parameters as pure (#6684). [Geza Lore, Fractile Ltd.] +* Optimize `$past` delayed variable reuse (#6689). [Geza Lore, Fractile Ltd.] +* Optimize combinational loops through sign extension (#6724). [Geza Lore] +* Optimize trace initialization code size (#6749). [Geza Lore] +* Optimize combinational cycles in DFG (#6744) (#6746) (#6744). [Geza Lore] +* Optimize inlining small C functions and add `-inline-cfuncs` (#6815). [Jose Drowne] +* Fix generate function(s) inside of generate blocks (#1011) (#6789). [em2machine] +* Fix typedef derived from type defined inside interface (#3441) (#6776). [em2machine] +* Fix warning lint directive ordering and consistency (#4185) (#5368) (#5610) (#6876). +* Fix extern function that returns parameterized class (#4924). +* Fix type deduction for variable parameterized classes (#6281) (#6813). [em2machine] +* Fix randomize called within func/task (#6144) (#6753). [Yilou Wang] +* Fix pre/post_randomize on extended classes (#6467). [Alex Solomatnikov] +* Fix expression short circuiting (#6483). [Todd Strader] +* Fix resized lvalues with warning suppressed (#6497) (#6816). [Alex Solomatnikov] +* Fix unsupported `if` virtual interface warning (#6558) (#6861). [Krzysztof Bieganski, Antmicro Ltd.] +* Fix expression coverage of system calls (#6592). [Todd Strader] +* Fix `--timing` with `--x-initial-edge` (#6603) (#6631). [Krzysztof Bieganski, Antmicro Ltd.] +* Fix merging of impure assignments in gate optimization (#6629) (#6630). [Geza Lore] +* Fix determining Verilator revision when within git submodules without tags. +* Fix initial random values for verilator-created variables (#6611). [Todd Strader] +* Fix parsing of `with` clause inside covergroups (#6618). [Pawel Kojma, Antmicro Ltd.] +* Fix slice memory overflow on large output arrays (#6636) (#6638). [Jens Yuechao Liu] +* Fix localparam type assignment from interface type parameters (#6637) (#6732). [em2machine] +* Fix memory usage statistics on MacOS (#6644). [Geza Lore, Fractile Ltd.] +* Fix command line statistics with --stats (#6645) (#6646). [Geza Lore, Fractile Ltd.] +* Fix slow compilation of generated sampled value code (#6652). [Geza Lore, Fractile Ltd.] +* Fix non-deterministic output when splitting Syms file. [Geza Lore, Fractile Ltd.] +* Fix crash on DFG driver lookup (#6649). [Geza Lore] +* Fix ccache-report with PCH files. [Geza Lore, Fractile Ltd.] +* Fix parameterized class function (#6659) (#6802). [em2machine] +* Fix local interface parameter hierarchical access (#6661) (#6666). [Paul Swirhun] +* Fix splitting of Syms constructor/destructor bodies (#6662). [Geza Lore, Fractile Ltd.] +* Fix long C++ compilation due to VerilatedScope constructors (#6664). [Geza Lore, Fractile Ltd.] +* Fix large array initialization (#6669). [Artur Bieniek, Antmicro Ltd.] +* Fix `--expand-limit` not respected for expressions (#6670). [Geza Lore, Fractile Ltd.] +* Fix `free` name collision (#6675). [Todd Strader] +* Fix bounds checking in non-inlined function (#6677). [Geza Lore, Fractile Ltd.] +* Fix stream operator widening (#6693) (#6697). [Jean-Nicolas Strauss] +* Fix multitop cross references (#6699). +* Fix DFG independent bits analysis performance (#6713) (#6743). [Geza Lore] +* Fix deleting linked node error in V3Randomize (#6718). [Igor Zaworski, Antmicro Ltd.] +* Fix runtime worker thread stack sizes on MacOS (#6721). [Geza Lore] +* Fix X handling in UDPs (#6722) (#6723). [Michael Bikovitsky] +* Fix `--prof-exec` using `--lib-create`. [Geza Lore] +* Fix fork scheduling semantics (#6730). [Artur Bieniek, Antmicro Ltd.] +* Fix JSON output case statements (#6733). +* Fix internal fault when cross-class calling with DPI (#6735) (#6742). [Matthew Ballance] +* Fix write variable placement for global constraints (#6740) (#6750) (#6797). [Yilou Wang] +* Fix JSON dump missing output ports (#6751) (#6831). [Oleh Maksymenko] +* Fix resolution of specialized typedefs (#6754) (#6808) (#6834). [em2machine] +* Fix UNSUPPORTED on force / release with complex selects (#6755). [Ryszard Rozak, Antmicro Ltd.] +* Fix select assignment expansion (#6757). [Geza Lore] +* Fix `--lib-create` with multi-bit clocks (#6759). [Geza Lore] +* Fix DFG reusing volatile variables. [Geza Lore] +* Fix DFG assertion on out-of-bounds selects. [Geza Lore] +* Fix process reference giving no return statement error (#6767) (#6823). [Krzysztof Bieganski, Antmicro Ltd.] +* Fix class param static not found again error (#6768). +* Fix crash when super.new() called without a base class (#6772). [Matthew Ballance] +* Fix class-in-class extends with parameters (#6773). +* Fix enum item references in class extends with parameters. +* Fix reordering of function body inlined on RHS of <= NBA (#6780). [Geza Lore] +* Fix clang `-Wno-vla-cxx-extension` warning for UVM DPI tests (#6782) +* Fix `disable iff` in simple properties (#6783). [Ryszard Rozak, Antmicro Ltd.] +* Fix input sampling of clocking block signals (#6788). [Pawel Kojma, Antmicro Ltd.] +* Fix O(n*2) analysis in const-bit-op-tree (#6791). [Geza Lore] +* Fix member select of variable without randmode (#6800) (#6833). [Yilou Wang] +* Fix duplicate name error with interface initial blocks (#6804) (#6805). [Thomas Dybdahl Ahle] +* Fix nested struct within parameter port list (#6818) (#6824). [Luca Colagrande] +* Fix setting thread count in VerilatedContext (#6826 partial) (#6841). [Yangyu Chen] +* Fix firing array selects of events (#6829). [Amal Araweelo Almis] +* Fix false IMPLICITSTATIC on localparam (#6835). [Geza Lore] +* Fix randcase under fork (#6843). [Amal Araweelo Almis] +* Fix JSON missing `signed` indication (#6845). +* Fix class reference throwing cannot detect changes error (#6851). +* Fix `randc` on extended class (#6852). +* Fix typedef `::` class reference error (#6862). +* Fix missing include on FreeBSD (#6864). +* Fix `--Wwarn-lint` to be inverse of `--Wno-lint`. + + Verilator 5.042 2025-11-02 ========================== @@ -39,6 +163,7 @@ Verilator 5.042 2025-11-02 * Support modports referencing clocking blocks (#4555) (#6436). [Ryszard Rozak, Antmicro Ltd.] * Support class package reference on pattern keys (#5653). [Todd Strader] * Support digits in `$sscanf` field width formats (#6083). [Iztok Jeras] +* Support assert under assert (#6146). [Alex Solomatnikov] * Support pure functions in sensitivity lists (#6393). [Krzysztof Bieganski, Antmicro Ltd.] * Support simple alias statements (#6339) (#6501). [Ryszard Rozak, Antmicro Ltd.] * Support simple cycle delay sequence expressions inside properties (#6508). [Bartłomiej Chmiel, Antmicro Ltd.] @@ -445,6 +570,7 @@ Verilator 5.034 2025-02-24 * Optimize labels as final `if` block statements (#5744). * Optimize empty function definition bodies (#5750). * Optimize splitting trigger computation and dump (#5798). [Geza Lore] +* Optimize some DFG multiplexers (#6822). [Yangyu Chen] * Fix error message when call task as a function (#3089). [Matthew Ballance] * Fix force VPI public signal visibility (#5225). [Frédéric Requin] * Fix VPI iteration over hierarchy (#5314) (#5731). [Natan Kreimer] @@ -5394,7 +5520,7 @@ Verilator 0.0 1994-07-08 Copyright ========= -Copyright 2001-2025 by Wilson Snyder. This program is free software; you +Copyright 2001-2026 by Wilson Snyder. This program is free software; you can redistribute it and/or modify it under the terms of either the GNU Lesser General Public License Version 3 or the Perl Artistic License Version 2.0. diff --git a/Makefile.in b/Makefile.in index a1ec1d163..7f576d240 100644 --- a/Makefile.in +++ b/Makefile.in @@ -7,7 +7,7 @@ # #***************************************************************************** # -# Copyright 2003-2025 by Wilson Snyder. This program is free software; you +# Copyright 2003-2026 by Wilson Snyder. This program is free software; you # can redistribute it and/or modify it under the terms of either the GNU # Lesser General Public License Version 3 or the Perl Artistic License # Version 2.0. @@ -460,23 +460,19 @@ analyzer-include: -rm -rf examples/*/obj* scan-build $(MAKE) -k examples -format: - $(MAKE) -j 5 format-c format-cmake format-exec format-py - -CLANGFORMAT = clang-format-18 -CLANGFORMAT_FLAGS = -i -CLANGFORMAT_FILES = $(CHECK_CPP) $(CHECK_H) $(CHECK_YL) test_regress/t/*.c* test_regress/t/*.h - -format-c clang-format: - $(CLANGFORMAT) --version - @$(CLANGFORMAT) --version | fgrep 'version 18' > /dev/null \ - || echo "*** You are not using clang-format-18, indents may differ from master's ***" - $(CLANGFORMAT) $(CLANGFORMAT_FLAGS) $(CLANGFORMAT_FILES) - -YAMLFIX = YAMLFIX_WHITELINES=1 YAMLFIX_LINE_LENGTH=200 YAMLFIX_preserve_quotes=true yamlfix - -yamlfix: - $(YAMLFIX) . +# Bash/sh files +BASH_FILES = \ + ci/ci-install.bash \ + ci/ci-pages-notify.bash \ + ci/ci-pages.bash \ + ci/ci-script.bash \ + ci/docker/run/hooks/post_push \ + ci/docker/run/verilator-docker \ + ci/docker/run/verilator-wrap.sh \ + nodist/fuzzer/all \ + nodist/fuzzer/run \ + nodist/fuzzer/setup_root \ + nodist/fuzzer/setup_user \ # CMake files CMAKE_FILES = \ @@ -495,6 +491,12 @@ MAKE_FILES = \ src/Makefile*.in \ test_regress/Makefile* \ +# Perl programs +PERL_PROGRAMS = \ + bin/redirect \ + bin/verilator \ + bin/verilator_coverage \ + # Python programs, subject to format and lint PY_PROGRAMS = \ bin/verilator_ccache_report \ @@ -502,25 +504,28 @@ PY_PROGRAMS = \ bin/verilator_gantt \ bin/verilator_includer \ bin/verilator_profcfunc \ - examples/json_py/vl_file_copy \ - examples/json_py/vl_hier_graph \ - docs/guide/conf.py \ docs/bin/vl_sphinx_extract \ docs/bin/vl_sphinx_fix \ - src/astgen \ - src/bisonpre \ - src/config_rev \ - src/flexfix \ - src/vlcovgen \ - src/.gdbinit.py \ - test_regress/*.py \ - test_regress/t/*.pf \ + docs/guide/conf.py \ + examples/json_py/vl_file_copy \ + examples/json_py/vl_hier_graph \ nodist/clang_check_attributes \ nodist/dot_importer \ nodist/fuzzer/actual_fail \ nodist/fuzzer/generate_dictionary \ nodist/install_test \ + nodist/lint_py_test_filter \ nodist/log_changes \ + nodist/uvm_pkg_packer \ + nodist/verilator_saif_diff \ + src/.gdbinit.py \ + src/astgen \ + src/bisonpre \ + src/config_rev \ + src/flexfix \ + src/vlcovgen \ + test_regress/*.py \ + test_regress/t/*.pf \ # Python files, subject to format but not lint PY_FILES = \ @@ -530,26 +535,70 @@ PY_FILES = \ # Python files, test_regress tests PY_TEST_FILES = test_regress/t/*.py -YAPF = yapf3 +# YAML files +YAML_FILES = \ + .*.yaml \ + .*.yml \ + .github/*.yml \ + .github/*/*.yml \ + CITATION.cff \ + +###################################################################### +# Format + +format: + $(MAKE) -j 5 format-c format-cmake format-exec format-py format-yaml + +BEAUTYSH = beautysh +BEAUTYSH_FLAGS = --indent-size 2 + +format-bash: + $(BEAUTYSH) --version + $(BEAUTYSH) $(BEAUTYSH_FLAGS) $(BASH_FILES) + +CLANGFORMAT = clang-format-18 +CLANGFORMAT_FLAGS = -i +CLANGFORMAT_FILES = $(CHECK_CPP) $(CHECK_H) $(CHECK_YL) test_regress/t/*.c* test_regress/t/*.h + +format-c clang-format: + $(CLANGFORMAT) --version + @$(CLANGFORMAT) --version | fgrep 'version 18' > /dev/null \ + || echo "*** You are not using clang-format-18, indents may differ from master's ***" + $(CLANGFORMAT) $(CLANGFORMAT_FLAGS) $(CLANGFORMAT_FILES) + +GERSEMI = gersemi +GERSEMI_FLAGS = -i --no-warn-about-unknown-commands + +format-cmake: + $(GERSEMI) --version + $(GERSEMI) $(GERSEMI_FLAGS) $(CMAKE_FILES) + +MBAKE = mbake +MBAKE_FLAGS = format --config ./.bake.toml + +format-exec: + -chmod a+x test_regress/t/*.py + +format-make mbake: + $(MBAKE) --version + $(MBAKE) $(MBAKE_FLAGS) $(MAKE_FILES) + +YAPF = yapf YAPF_FLAGS = -i --parallel format-py yapf: $(YAPF) --version $(YAPF) $(YAPF_FLAGS) $(PY_FILES) -GERSEMI = gersemi -GERSEMI_FLAGS = -i --no-warn-about-unknown-commands +YAMLFIX = YAMLFIX_WHITELINES=1 YAMLFIX_LINE_LENGTH=200 YAMLFIX_preserve_quotes=true yamlfix +YAMLFIX_FLAGS = -format-cmake: - $(GERSEMI) $(GERSEMI_FLAGS) $(CMAKE_FILES) +format-yaml yamlfix: + $(YAMLFIX) --version + $(YAMLFIX) $(YAMLFIX_FLAGS) $(YAML_FILES) -MBAKE = mbake -MBAKE_FLAGS = format --config ./.bake.toml - -format-make: - $(MBAKE) $(MBAKE_FLAGS) $(MAKE_FILES) - -format-yaml: yamlfix +###################################################################### +# Lint MYPY = mypy MYPY_FLAGS = --strict --no-error-summary @@ -583,9 +632,6 @@ lint-py-pylint-tests: lint-py-ruff: $(RUFF) $(RUFF_FLAGS) $(PY_PROGRAMS) -format-exec: - -chmod a+x test_regress/t/*.py - ###################################################################### # Configure @@ -781,7 +827,7 @@ clean mostlyclean distclean maintainer-clean:: distclean maintainer-clean:: rm -f *.info* *.1 $(INFOS) $(INFOS_OLD) $(VL_INST_MAN_FILES) - rm -f Makefile config.status config.cache config.log TAGS + rm -f Makefile config.status config.cache config.log configure~ TAGS rm -f verilator_bin* verilator_coverage_bin* rm -f bin/verilator_bin* bin/verilator_coverage_bin* rm -f include/verilated.mk include/verilated_config.h @@ -806,3 +852,20 @@ preexist: maintainer-dist: preexist tag svnorcvs release $(DISTTAGNAME) + +###################################################################### +# Python venv + +VENV_PATH ?= .venv + +.PHONY: venv +venv: + # Create virtual environment using the python3 picked up by configure + [ -e $(VENV_PATH) ] || @PYTHON3@ -m venv --system-site-packages $(VENV_PATH) + # Install python3 dependencies + $(VENV_PATH)/bin/pip3 install -r python-dev-requirements.txt + @echo + @echo "Installed Python virtual environment, in:" + @echo " $(VENV_PATH)" + @echo "To activate, run:" + @echo " source $(VENV_PATH)/bin/activate" diff --git a/README.rst b/README.rst index 5093785cc..f8b360ad1 100644 --- a/README.rst +++ b/README.rst @@ -4,19 +4,19 @@ |badge1| |badge2| |badge3| |badge4| |badge5| |badge7| |badge8| .. |badge1| image:: https://img.shields.io/badge/Website-Verilator.org-181717.svg - :target: https://verilator.org + :target: https://verilator.org .. |badge2| image:: https://img.shields.io/badge/License-LGPL%20v3-blue.svg - :target: https://www.gnu.org/licenses/lgpl-3.0 + :target: https://www.gnu.org/licenses/lgpl-3.0 .. |badge3| image:: https://img.shields.io/badge/License-Artistic%202.0-0298c3.svg - :target: https://opensource.org/licenses/Artistic-2.0 + :target: https://opensource.org/licenses/Artistic-2.0 .. |badge4| image:: https://repology.org/badge/tiny-repos/verilator.svg?header=distro%20packages - :target: https://repology.org/project/verilator/versions + :target: https://repology.org/project/verilator/versions .. |badge5| image:: https://img.shields.io/docker/pulls/verilator/verilator - :target: https://hub.docker.com/r/verilator/verilator + :target: https://hub.docker.com/r/verilator/verilator .. |badge7| image:: https://github.com/verilator/verilator/workflows/build/badge.svg - :target: https://github.com/verilator/verilator/actions?query=workflow%3Abuild + :target: https://github.com/verilator/verilator/actions?query=workflow%3Abuild .. |badge8| image:: https://img.shields.io/github/actions/workflow/status/verilator/verilator/rtlmeter.yml?branch=master&event=schedule&label=benchmarks - :target: https://verilator.github.io/verilator-rtlmeter-results + :target: https://verilator.github.io/verilator-rtlmeter-results Welcome to Verilator @@ -54,7 +54,7 @@ Welcome to Verilator What Verilator Does =================== -Verilator is invoked with parameters similar to GCC or Synopsys's VCS. It +Verilator is invoked with parameters similar to GCC or Synopsys's VCS. It "Verilates" the specified Verilog or SystemVerilog code by reading it, performing lint checks, and optionally inserting assertion checks and coverage-analysis points. It outputs single- or multithreaded .cpp and .h @@ -69,21 +69,21 @@ Verilated generated libraries, optionally encrypted, into other simulators. Verilator may not be the best choice if you are expecting a full-featured replacement for a closed-source Verilog simulator, need SDF annotation, mixed-signal simulation, or are doing a quick class project (we recommend -`Icarus Verilog`_ for classwork). However, if you are looking for a path -to migrate SystemVerilog to C++/SystemC, or want high-speed simulation of +`Icarus Verilog`_ for classwork). However, if you are looking for a path to +migrate SystemVerilog to C++/SystemC, or want high-speed simulation of designs, Verilator is the tool for you. Performance =========== -Verilator does not directly translate Verilog HDL to C++ or SystemC. Rather, -Verilator compiles your code into a much faster optimized and optionally -thread-partitioned model, which is in turn wrapped inside a C++/SystemC -module. The results are a compiled Verilog model that executes even on a -single thread over 10x faster than standalone SystemC, and on a single -thread is about 100 times faster than interpreted Verilog simulators such -as `Icarus Verilog`_. Another 2-10x speedup might be gained from +Verilator does not directly translate Verilog HDL to C++ or SystemC. +Rather, Verilator compiles your code into a much faster optimized and +optionally thread-partitioned model, which is in turn wrapped inside a +C++/SystemC module. The results are a compiled Verilog model that executes +even on a single thread over 10x faster than standalone SystemC, and on a +single thread is about 100 times faster than interpreted Verilog simulators +such as `Icarus Verilog`_. Another 2-10x speedup might be gained from multithreading (yielding 200-1000x total over interpreted simulators). Verilator has typically similar or better performance versus closed-source @@ -101,8 +101,8 @@ For more information: - `Verilator installation and package directory structure `_ -- `Verilator manual (HTML) `_, - or `Verilator manual (PDF) `_ +- `Verilator manual (HTML) `_, or + `Verilator manual (PDF) `_ - `Subscribe to Verilator announcements `_ @@ -145,16 +145,16 @@ Related Projects Open License ============ -Verilator is Copyright 2003-2025 by Wilson Snyder. (Report bugs to +Verilator is Copyright 2003-2026 by Wilson Snyder. (Report bugs to `Verilator Issues `_.) Verilator is free software; you can redistribute it and/or modify it under the terms of either the GNU Lesser General Public License Version 3 or the Perl Artistic License Version 2.0. See the documentation for more details. -.. _CHIPS Alliance: https://chipsalliance.org -.. _Icarus Verilog: https://steveicarus.github.io/iverilog -.. _Linux Foundation: https://www.linuxfoundation.org +.. _chips alliance: https://chipsalliance.org +.. _icarus verilog: https://steveicarus.github.io/iverilog +.. _linux foundation: https://www.linuxfoundation.org .. |Logo| image:: https://www.veripool.org/img/verilator_256_200_min.png .. |verilator multithreaded performance| image:: https://www.veripool.org/img/verilator_multithreaded_performance_bg-min.png .. |verilator usage| image:: https://www.veripool.org/img/verilator_usage_400x200-min.png diff --git a/bin/redirect b/bin/redirect index ddd8c1a4d..76bebfa90 100644 --- a/bin/redirect +++ b/bin/redirect @@ -1,7 +1,7 @@ #!/usr/bin/env perl ###################################################################### # -# Copyright 2003-2025 by Wilson Snyder. This program is free software; you +# Copyright 2003-2026 by Wilson Snyder. This program is free software; you # can redistribute it and/or modify it under the terms of either the GNU # Lesser General Public License Version 3 or the Perl Artistic License # Version 2.0. diff --git a/bin/verilator b/bin/verilator index 8da3c0ddc..4cd6e160c 100755 --- a/bin/verilator +++ b/bin/verilator @@ -1,7 +1,7 @@ #!/usr/bin/env perl ###################################################################### # -# Copyright 2003-2025 by Wilson Snyder. This program is free software; you +# Copyright 2003-2026 by Wilson Snyder. This program is free software; you # can redistribute it and/or modify it under the terms of either the GNU # Lesser General Public License Version 3 or the Perl Artistic License # Version 2.0. @@ -42,6 +42,7 @@ if ($#ARGV < 0) { } # Insert debugging options up front +# (VERILATOR_TEST_FLAGS is not a documented nor official supported feature) push @ARGV, (split ' ', $ENV{VERILATOR_TEST_FLAGS} || ""); # We sneak a look at the flags so we can do some pre-environment checks @@ -408,6 +409,8 @@ detailed descriptions of these arguments. -I Directory to search for includes --if-depth Tune IFDEPTH warning +incdir+ Directory to search for includes + --inline-cfuncs Inline CFuncs with <=value nodes (0=off) + --inline-cfuncs-product Inline CFuncs if size*calls <= value --inline-mult Tune module inlining --instr-count-dpi Assumed dynamic instruction count of DPI imports -j Parallelism for --build-jobs/--verilate-jobs @@ -419,6 +422,7 @@ detailed descriptions of these arguments. --l2-name Verilog scope name of the top module --language Default language standard to parse -LDFLAGS Linker pre-object arguments for makefile + -libmap Specify library mapping file --lib-create Create a DPI library +libext++[ext]... Extensions for finding modules +librescan Ignored for compatibility @@ -473,6 +477,7 @@ detailed descriptions of these arguments. --public-params Mark all parameters as public_flat -pvalue+= Overwrite toplevel parameter --quiet Minimize additional printing + --quiet-build Don't print build progress --quiet-exit Don't print the command on failure --quiet-stats Don't print statistics --relative-includes Resolve includes relative to current file @@ -517,6 +522,7 @@ detailed descriptions of these arguments. -U Undefine preprocessor define --no-unlimited-stack Don't disable stack size limit --unroll-count Tune maximum loop iterations + --unroll-limit Maximum loop iterations before assuming infinite loop --unroll-stmts Tune maximum loop body size --unused-regexp Tune UNUSED lint signals -V Verbose version and config @@ -578,7 +584,7 @@ description of these arguments. The latest version is available from L. -Copyright 2003-2025 by Wilson Snyder. This program is free software; you can +Copyright 2003-2026 by Wilson Snyder. This program is free software; you can redistribute it and/or modify the Verilator internals under the terms of either the GNU Lesser General Public License Version 3 or the Perl Artistic License Version 2.0. diff --git a/bin/verilator_ccache_report b/bin/verilator_ccache_report index 3ddd38491..2866adfe0 100755 --- a/bin/verilator_ccache_report +++ b/bin/verilator_ccache_report @@ -17,18 +17,14 @@ parser = argparse.ArgumentParser( For documentation see https://verilator.org/guide/latest/exe_verilator_ccache_report.html""", - epilog="""Copyright 2002-2025 by Wilson Snyder. This program is free software; you + epilog="""Copyright 2002-2026 by Wilson Snyder. This program is free software; you can redistribute it and/or modify it under the terms of either the GNU Lesser General Public License Version 3 or the Perl Artistic License Version 2.0. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0""") -parser.add_argument('-o', - type=argparse.FileType('w'), - metavar="OUTFILE", - required=True, - help='output file') +parser.add_argument('-o', type=pathlib.Path, metavar="OUTFILE", required=True, help='output file') parser.add_argument('logdir', type=pathlib.Path, help='log directory') args = parser.parse_args() @@ -58,34 +54,35 @@ for logfile in args.logdir.iterdir(): elapsed[obj] = toDateTime(match.group(1)) - start results[obj] = match.group(2) -args.o.write("#" * 80 + "\n") -args.o.write("ccache report (from verilator_ccache_report) :\n") +with args.o.open("w") as ofd: + ofd.write("#" * 80 + "\n") + ofd.write("ccache report (from verilator_ccache_report) :\n") -if not results: - args.o.write("\nAll object files up to date\n") -else: - args.o.write("\nCompiled object files:\n") - wnames = max(len(_) for _ in results) + 1 - wresults = max(len(_) for _ in results.values()) + 1 - for k in sorted(results.keys()): - args.o.write("{:{wnames}} : {:{wresults}} : {}s\n".format(k, - results[k], - elapsed[k].total_seconds(), - wnames=wnames, - wresults=wresults)) + if not results: + ofd.write("\nAll object files up to date\n") + else: + ofd.write("\nCompiled object files:\n") + wnames = max(len(_) for _ in results) + 1 + wresults = max(len(_) for _ in results.values()) + 1 + for k in sorted(results.keys()): + ofd.write("{:{wnames}} : {:{wresults}} : {}s\n".format(k, + results[k], + elapsed[k].total_seconds(), + wnames=wnames, + wresults=wresults)) - args.o.write("\nSummary:\n") - counts = collections.Counter(_ for _ in results.values()) - total = sum(counts.values()) - for k in sorted(counts.keys()): - c = counts[k] - args.o.write("{:{width}}| {} ({:.2%})\n".format(k, c, c / total, width=wresults)) + ofd.write("\nSummary:\n") + counts = collections.Counter(_ for _ in results.values()) + total = sum(counts.values()) + for k in sorted(counts.keys()): + c = counts[k] + ofd.write("{:{width}}| {} ({:.2%})\n".format(k, c, c / total, width=wresults)) - args.o.write("\nLongest:\n") - longest = sorted(list(elapsed.items()), key=lambda kv: -kv[1].total_seconds()) - for i, (k, v) in enumerate(longest): - args.o.write("{:{width}}| {}s\n".format(k, v.total_seconds(), width=wnames)) - if i > 4: - break + ofd.write("\nLongest:\n") + longest = sorted(list(elapsed.items()), key=lambda kv: -kv[1].total_seconds()) + for i, (k, v) in enumerate(longest): + ofd.write("{:{width}}| {}s\n".format(k, v.total_seconds(), width=wnames)) + if i > 4: + break -args.o.write("#" * 80 + "\n") + ofd.write("#" * 80 + "\n") diff --git a/bin/verilator_coverage b/bin/verilator_coverage index 158e78779..4d828ce90 100755 --- a/bin/verilator_coverage +++ b/bin/verilator_coverage @@ -1,7 +1,7 @@ #!/usr/bin/env perl ###################################################################### # -# Copyright 2003-2025 by Wilson Snyder. This program is free software; you +# Copyright 2003-2026 by Wilson Snyder. This program is free software; you # can redistribute it and/or modify it under the terms of either the GNU # Lesser General Public License Version 3 or the Perl Artistic License # Version 2.0. @@ -192,7 +192,7 @@ L. The latest version is available from L. -Copyright 2003-2025 by Wilson Snyder. This program is free software; you +Copyright 2003-2026 by Wilson Snyder. This program is free software; you can redistribute it and/or modify the Verilator internals under the terms of either the GNU Lesser General Public License Version 3 or the Perl Artistic License Version 2.0. diff --git a/bin/verilator_difftree b/bin/verilator_difftree index 7ab32425c..163a87a01 100755 --- a/bin/verilator_difftree +++ b/bin/verilator_difftree @@ -110,7 +110,7 @@ It performs a diff between two files, or all files common between two directories, ignoring irrelevant pointer differences. Exit status is 0 if inputs are the same, 1 if different, 2 if trouble.""", - epilog="""Copyright 2005-2025 by Wilson Snyder. This program is free software; you + epilog="""Copyright 2005-2026 by Wilson Snyder. This program is free software; you can redistribute it and/or modify it under the terms of either the GNU Lesser General Public License Version 3 or the Perl Artistic License Version 2.0. diff --git a/bin/verilator_gantt b/bin/verilator_gantt index 63e094818..845e13c08 100755 --- a/bin/verilator_gantt +++ b/bin/verilator_gantt @@ -613,7 +613,7 @@ Verilator_gantt creates a visual representation to help analyze Verilator For documentation see https://verilator.org/guide/latest/exe_verilator_gantt.html""", - epilog="""Copyright 2018-2025 by Wilson Snyder. This program is free software; you + epilog="""Copyright 2018-2026 by Wilson Snyder. This program is free software; you can redistribute it and/or modify it under the terms of either the GNU Lesser General Public License Version 3 or the Perl Artistic License Version 2.0. diff --git a/bin/verilator_includer b/bin/verilator_includer index f8149cac9..648dba61a 100755 --- a/bin/verilator_includer +++ b/bin/verilator_includer @@ -2,7 +2,7 @@ # mypy: disallow-untyped-defs # pylint: disable=C0114,C0209 # -# Copyright 2003-2025 by Wilson Snyder. This program is free software; you +# Copyright 2003-2026 by Wilson Snyder. This program is free software; you # can redistribute it and/or modify the Verilator internals under the terms # of either the GNU Lesser General Public License Version 3 or the Perl # Artistic License Version 2.0. diff --git a/bin/verilator_profcfunc b/bin/verilator_profcfunc index f05934900..cf47d3587 100755 --- a/bin/verilator_profcfunc +++ b/bin/verilator_profcfunc @@ -173,7 +173,7 @@ in each Verilog block. For documentation see https://verilator.org/guide/latest/exe_verilator_profcfunc.html""", - epilog="""Copyright 2002-2025 by Wilson Snyder. This program is free software; you + epilog="""Copyright 2002-2026 by Wilson Snyder. This program is free software; you can redistribute it and/or modify it under the terms of either the GNU Lesser General Public License Version 3 or the Perl Artistic License Version 2.0. diff --git a/ci/ci-script.bash b/ci/ci-script.bash index 59966d8eb..9c24bb52e 100755 --- a/ci/ci-script.bash +++ b/ci/ci-script.bash @@ -94,18 +94,18 @@ elif [ "$CI_BUILD_STAGE_NAME" = "test" ]; then TEST_REGRESS=test_regress if [ "$CI_RELOC" == 1 ]; then - # Testing that the installation is relocatable. - "$MAKE" install - mkdir -p "$RELOC_DIR" - mv "$INSTALL_DIR" "$RELOC_DIR/relocated-install" - export VERILATOR_ROOT="$RELOC_DIR/relocated-install/share/verilator" - TEST_REGRESS="$RELOC_DIR/test_regress" - mv test_regress "$TEST_REGRESS" - NODIST="$RELOC_DIR/nodist" - mv nodist "$NODIST" - # Feeling brave? - find . -delete - ls -la . + # Testing that the installation is relocatable. + "$MAKE" install + mkdir -p "$RELOC_DIR" + mv "$INSTALL_DIR" "$RELOC_DIR/relocated-install" + export VERILATOR_ROOT="$RELOC_DIR/relocated-install/share/verilator" + TEST_REGRESS="$RELOC_DIR/test_regress" + mv test_regress "$TEST_REGRESS" + NODIST="$RELOC_DIR/nodist" + mv nodist "$NODIST" + # Feeling brave? + find . -delete + ls -la . fi # Run the specified test diff --git a/ci/docker/buildenv/README.rst b/ci/docker/buildenv/README.rst index ee4c1095a..8a1f3deb7 100644 --- a/ci/docker/buildenv/README.rst +++ b/ci/docker/buildenv/README.rst @@ -1,7 +1,7 @@ -.. Copyright 2003-2025 by Wilson Snyder. +.. Copyright 2003-2026 by Wilson Snyder. .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 -.. _Verilator Build Docker Container: +.. _verilator build docker container: Verilator Build Docker Container ================================ @@ -9,11 +9,11 @@ Verilator Build Docker Container This Verilator Build Docker Container is set up to compile and test a Verilator build. It uses the following parameters: -- Source repository (default: https://github.com/verilator/verilator) +- Source repository (default: https://github.com/verilator/verilator) -- Source revision (default: master) +- Source revision (default: master) -- Compiler (GCC 13.3.0, clang 18.1.3, default: 13.3.0) +- Compiler (GCC 13.3.0, clang 18.1.3, default: 13.3.0) The container is published as ``verilator/verilator-buildenv`` on `docker hub @@ -37,8 +37,9 @@ To change the compiler use the `-e` switch to pass environment variables: docker run -ti -e CXX=clang++-18 verilator/verilator-buildenv test -The tests, that involve numactl are not working due to security restrictions. -To run those too, add the CAP_SYS_NICE capability during the start of the container: +The tests, that involve numactl are not working due to security +restrictions. To run those too, add the CAP_SYS_NICE capability during the +start of the container: :: diff --git a/ci/docker/run/README.rst b/ci/docker/run/README.rst index 86bad6cdb..e960d1a81 100644 --- a/ci/docker/run/README.rst +++ b/ci/docker/run/README.rst @@ -1,4 +1,4 @@ -.. Copyright 2003-2025 by Wilson Snyder. +.. Copyright 2003-2026 by Wilson Snyder. .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 Verilator Executable Docker Container @@ -11,12 +11,12 @@ easily as a docker image, e.g.: docker run -ti verilator/verilator:latest --version -This will pull the container from `docker hub -`_, run the latest Verilator and print -Verilator's version. +This will pull the container from `Docker Hub +`_, run the latest Verilator +and print Verilator's version. -Containers are automatically built and pushed to docker hub for all released versions, so you may -easily compare results across versions, e.g.: +Containers are automatically built and pushed to docker hub for all +released versions, so you may easily compare results across versions, e.g.: :: @@ -38,7 +38,7 @@ or ./verilator-docker 4.030 --cc test.v If you prefer not to use ``verilator-docker`` you must give the container -access to your files as a volume with appropriate user rights. For example +access to your files as a volume with appropriate user rights. For example to Verilate test.v: :: @@ -68,9 +68,9 @@ Internals The Dockerfile builds Verilator and removes the tree when completed to reduce the image size. The entrypoint is a wrapper script (``verilator-wrap.sh``). That script 1. calls Verilator, and 2. copies the -Verilated runtime files to the ``obj_dir`` or the ``-Mdir`` -respectively. This allows the user to have the files to they may later -build the C++ output with the matching runtime files. The wrapper also -patches the Verilated Makefile accordingly. +Verilated runtime files to the ``obj_dir`` or the ``-Mdir`` respectively. +This allows the user to have the files to they may later build the C++ +output with the matching runtime files. The wrapper also patches the +Verilated Makefile accordingly. A hook is also defined and run by Docker Hub via automated builds. diff --git a/ci/docker/run/hooks/post_push b/ci/docker/run/hooks/post_push index 256e85008..6da467d3f 100755 --- a/ci/docker/run/hooks/post_push +++ b/ci/docker/run/hooks/post_push @@ -8,6 +8,6 @@ # SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 if [ "$SOURCE_BRANCH"="stable" ]; then - docker tag $IMAGE_NAME $DOCKER_REPO:latest - docker push $DOCKER_REPO:latest + docker tag $IMAGE_NAME $DOCKER_REPO:latest + docker push $DOCKER_REPO:latest fi diff --git a/ci/docker/run/verilator-wrap.sh b/ci/docker/run/verilator-wrap.sh index 80d839b5b..1a5aa6211 100755 --- a/ci/docker/run/verilator-wrap.sh +++ b/ci/docker/run/verilator-wrap.sh @@ -11,21 +11,21 @@ perl /usr/local/bin/verilator "$@" status=$? if [ $status -ne 0 ]; then - exit $status + exit $status fi # Check if user set an obj_dir obj_dir=$(echo " $@" | grep -oP '\s--Mdir\s*\K\S+') if [ "$obj_dir" == "" ]; then - obj_dir="obj_dir" + obj_dir="obj_dir" fi # If the run was successful: Copy required files to allow build without this container if [ -e ${obj_dir} ]; then - # Copy files required for the build - mkdir -p ${obj_dir}/vlt - cp -r /usr/local/share/verilator/bin ${obj_dir}/vlt - cp -r /usr/local/share/verilator/include ${obj_dir}/vlt - # Point Makefile to that folder - sed -i 's/VERILATOR_ROOT = \/usr\/local\/share\/verilator/VERILATOR_ROOT = vlt/g' ${obj_dir}/*.mk + # Copy files required for the build + mkdir -p ${obj_dir}/vlt + cp -r /usr/local/share/verilator/bin ${obj_dir}/vlt + cp -r /usr/local/share/verilator/include ${obj_dir}/vlt + # Point Makefile to that folder + sed -i 's/VERILATOR_ROOT = \/usr\/local\/share\/verilator/VERILATOR_ROOT = vlt/g' ${obj_dir}/*.mk fi diff --git a/configure.ac b/configure.ac index 3cd840db7..96e60accd 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ # DESCRIPTION: Process this file with autoconf to produce a configure script. # -# Copyright 2003-2025 by Wilson Snyder. Verilator is free software; you +# Copyright 2003-2026 by Wilson Snyder. Verilator is free software; you # can redistribute it and/or modify it under the terms of either the GNU Lesser # General Public License Version 3 or the Perl Artistic License Version 2.0. # SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 @@ -11,7 +11,7 @@ # Then 'make maintainer-dist' #AC_INIT([Verilator],[#.### YYYY-MM-DD]) #AC_INIT([Verilator],[#.### devel]) -AC_INIT([Verilator],[5.042 2025-11-02], +AC_INIT([Verilator],[5.044 2026-01-01], [https://verilator.org], [verilator],[https://verilator.org]) @@ -475,6 +475,7 @@ _MY_CXX_CHECK_OPT(CFG_CXXFLAGS_SRC,-Wno-shadow) _MY_CXX_CHECK_OPT(CFG_CXXFLAGS_SRC,-Wno-unused-parameter) _MY_CXX_CHECK_OPT(CFG_CXXFLAGS_SRC,-Xclang -fno-pch-timestamp) _MY_CXX_CHECK_OPT(CFG_CXXFLAGS_SRC,-faligned-new) +_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_SRC,-fno-exceptions) AC_SUBST(CFG_CXXFLAGS_SRC) # Flags for compiling Verilator parser always (in addition to above CFG_CXXFLAGS_SRC) @@ -533,7 +534,8 @@ m4_foreach([cflag],[ [-Wno-unused-but-set-parameter], [-Wno-unused-but-set-variable], [-Wno-unused-parameter], - [-Wno-unused-variable]],[ + [-Wno-unused-variable], + [-Wno-vla-cxx-extension]],[ _MY_CXX_CHECK_OPT(CFG_CXXFLAGS_NO_UNUSED,cflag) # CMake will test what flags work itself, so pass all flags through to it CFG_CXX_FLAGS_CMAKE="$CFG_CXX_FLAGS_CMAKE cflag" diff --git a/docs/CONTRIBUTING.rst b/docs/CONTRIBUTING.rst index 061394812..4b42b8f1d 100644 --- a/docs/CONTRIBUTING.rst +++ b/docs/CONTRIBUTING.rst @@ -23,8 +23,8 @@ Did you find a Verilator bug? demonstrating the bug and expected behavior that is not occurring. - The ideal example works against other simulators, and is in the - test_regress/t test format, as described in - `Verilator Internals Documentation + test_regress/t test format, as described in `Verilator Internals + Documentation `__. @@ -38,18 +38,18 @@ Did you write a patch that fixes a Verilator bug? `__. - See the coding conventions, and other developer information in - ``docs/internals.rst`` in the distribution, or as rendered at - `Verilator Internals Documentation + ``docs/internals.rst`` in the distribution, or as rendered at `Verilator + Internals Documentation `__. -- Verilator uses GitHub Actions to provide continuous integration. You - may want to enable Actions on your GitHub branch to ensure your changes - keep the tests passing. +- Verilator uses GitHub Actions to provide continuous integration. You may + want to enable Actions on your GitHub branch to ensure your changes keep + the tests passing. -- Your source-code contributions must be certified as open source, - under the `Developer Certificate of - Origin `__. On your first - contribution, you must either: +- Your source-code contributions must be certified as open source, under + the `Developer Certificate of Origin + `__. On your first contribution, you + must either: - Have your patch include the addition of your name to `docs/CONTRIBUTORS `__ (preferred). @@ -75,9 +75,9 @@ Did you write a patch that fixes a Verilator bug? Do you have questions on Verilator? ----------------------------------- -- Please see FAQ section and rest of the `Verilator - manual `__, or `Verilator - manual (PDF) `__. +- Please see FAQ section and rest of the `Verilator manual + `__, or `Verilator manual (PDF) + `__. - Ask any question in the `Verilator forum `__. diff --git a/docs/CONTRIBUTORS b/docs/CONTRIBUTORS index 8bb9a82b0..a3fca586c 100644 --- a/docs/CONTRIBUTORS +++ b/docs/CONTRIBUTORS @@ -38,7 +38,7 @@ Chuxuan Wang Chykon Congcong Cai Conor McCullough -Dan Petrisko +Dan Ruelas-Petrisko Daniel Bates Danny Oler Dave Sargeant @@ -105,6 +105,8 @@ Jamey Hicks Jamie Iles Jan Van Winkel Jean Berniolles +Jean-Nicolas Strauss +Jens Yuechao Liu Jeremy Bennett Jesse Taube Jevin Sweval @@ -123,6 +125,7 @@ John Wehle Jonathan Drolet Jonathan Schröter Jordan McConnon +Jose Drowne Jose Loyola Josep Sans Joseph Nwabueze @@ -190,6 +193,7 @@ Paul Bowen-Huggett Paul Swirhun Paul Wright Pawel Jewstafjew +Pawel Kojma Pawel Sagan Pengcheng Xu Peter Birch @@ -230,6 +234,8 @@ Steven Hugg Szymon Gizler Sören Tempel Teng Huang +Thomas Aldrian +Thomas Dybdahl Ahle Tim Hutt Tim Snyder Tobias Jensen @@ -270,8 +276,10 @@ Zhen Yan Zhou Shen Zhouyi Shen Zixi Li +apocelipes dependabot[bot] february cozzocrea sumpster +em2machine Àlex Torregrosa Ícaro Lima diff --git a/docs/Makefile b/docs/Makefile index 9ee03aa73..c7ebd2ef6 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -5,7 +5,7 @@ # # Code available from: https://verilator.org # -# Copyright 2003-2025 by Wilson Snyder. This program is free software; you +# Copyright 2003-2026 by Wilson Snyder. This program is free software; you # can redistribute it and/or modify it under the terms of either the GNU # Lesser General Public License Version 3 or the Perl Artistic License # Version 2.0. diff --git a/docs/README.rst b/docs/README.rst index 3e5949f15..0752c6a5c 100644 --- a/docs/README.rst +++ b/docs/README.rst @@ -10,8 +10,8 @@ For formatted documentation see: - `Verilator installation and package directory structure `_ -- `Verilator manual (HTML) `_, - or `Verilator manual (PDF) `_ +- `Verilator manual (HTML) `_, or + `Verilator manual (PDF) `_ - `Subscribe to Verilator announcements `_ diff --git a/docs/bin/vl_sphinx_extract b/docs/bin/vl_sphinx_extract index f312ac32d..9b1aac284 100755 --- a/docs/bin/vl_sphinx_extract +++ b/docs/bin/vl_sphinx_extract @@ -37,7 +37,7 @@ parser = argparse.ArgumentParser( allow_abbrev=False, formatter_class=argparse.RawDescriptionHelpFormatter, description="""Read a file and extract documentation data.""", - epilog=""" Copyright 2021-2025 by Wilson Snyder. This package is free software; + epilog=""" Copyright 2021-2026 by Wilson Snyder. This package is free software; you can redistribute it and/or modify it under the terms of either the GNU Lesser General Public License Version 3 or the Perl Artistic License Version 2.0. diff --git a/docs/bin/vl_sphinx_fix b/docs/bin/vl_sphinx_fix index 99ccf1ca3..32c3455ec 100755 --- a/docs/bin/vl_sphinx_fix +++ b/docs/bin/vl_sphinx_fix @@ -52,7 +52,7 @@ parser = argparse.ArgumentParser( allow_abbrev=False, formatter_class=argparse.RawDescriptionHelpFormatter, description="""Post-process Sphinx HTML.""", - epilog=""" Copyright 2021-2025 by Wilson Snyder. This package is free software; + epilog=""" Copyright 2021-2026 by Wilson Snyder. This package is free software; you can redistribute it and/or modify it under the terms of either the GNU Lesser General Public License Version 3 or the Perl Artistic License Version 2.0. diff --git a/docs/gen/ex_ASSIGNEQEXPR_faulty.rst b/docs/gen/ex_ASSIGNEQEXPR_faulty.rst index 7fd7546e0..af5f59067 100644 --- a/docs/gen/ex_ASSIGNEQEXPR_faulty.rst +++ b/docs/gen/ex_ASSIGNEQEXPR_faulty.rst @@ -1,9 +1,8 @@ .. comment: generated by t_lint_assigneqexpr_bad .. code-block:: sv :linenos: - :emphasize-lines: 3 - assign d_o = // Note = not == below - ( - c_o = 1 // <--- Warning: ASSIGNEQEXPR - ) ? 1 : ( + output logic c_o, + output logic d_o + ); + assign c_o = (a_i != 0) ? 1 : 0; diff --git a/docs/gen/ex_FUNCTIMECTL_faulty.rst b/docs/gen/ex_FUNCTIMECTL_faulty.rst index 5c2e70053..42e21e889 100644 --- a/docs/gen/ex_FUNCTIMECTL_faulty.rst +++ b/docs/gen/ex_FUNCTIMECTL_faulty.rst @@ -4,4 +4,4 @@ :emphasize-lines: 2 function void calls_timing_ctl; - @e; // <--- Bad IEEE 1800-2023 13.4 time-controlling + @e; // <--- Bad IEEE 1800-2023 13.4 time-controlling diff --git a/docs/gen/ex_SUPERNFIRST_faulty.rst b/docs/gen/ex_SUPERNFIRST_faulty.rst new file mode 100644 index 000000000..dcbed941e --- /dev/null +++ b/docs/gen/ex_SUPERNFIRST_faulty.rst @@ -0,0 +1,8 @@ +.. comment: generated by t_class_new_supernfirst_bad +.. code-block:: sv + :linenos: + :emphasize-lines: 3 + + function new(); + int x = $random(); + super.new(build_coverage(x), x); // <--- BAD, must be first statement diff --git a/docs/gen/ex_SUPERNFIRST_msg.rst b/docs/gen/ex_SUPERNFIRST_msg.rst new file mode 100644 index 000000000..87f016a48 --- /dev/null +++ b/docs/gen/ex_SUPERNFIRST_msg.rst @@ -0,0 +1,4 @@ +.. comment: generated by t_class_new_supernfirst_bad +.. code-block:: + + %Error-SUPERNFIRST: example.v:1:11 'super.new' must be first statement in a 'function new' (IEEE 1800-2023 8.15) diff --git a/docs/guide/changes.rst b/docs/guide/changes.rst index 7454f5162..7aecb111a 100644 --- a/docs/guide/changes.rst +++ b/docs/guide/changes.rst @@ -1,16 +1,17 @@ -.. Copyright 2003-2025 by Wilson Snyder. +.. Copyright 2003-2026 by Wilson Snyder. .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 **************** Revision History **************** -.. COMMENT above header must use ### so there is an extra level of headers +.. + COMMENT above header must use *** so there is an extra level of headers here so the index won't show the huge list of revisions when clicking on "Revision History" in the sidebar. Changes are contained in the :file:`Changes` file of the distribution, and -also summarized below. To subscribe to new versions, see `Verilator +also summarized below. To subscribe to new versions, see `Verilator Announcements `_. .. include:: ../_build/gen/Changes diff --git a/docs/guide/conf.py b/docs/guide/conf.py index 2902c88c6..a9392b6ab 100644 --- a/docs/guide/conf.py +++ b/docs/guide/conf.py @@ -1,7 +1,7 @@ # pylint: disable=C0103,C0114,C0116,C0301,E0402,W0622 # # Configuration file for Verilator's Sphinx documentation builder. -# Copyright 2003-2025 by Wilson Snyder. +# Copyright 2003-2026 by Wilson Snyder. # SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 # # This file only contains overridden options. For a full list: diff --git a/docs/guide/connecting.rst b/docs/guide/connecting.rst index ac6c55971..f3c8eedbf 100644 --- a/docs/guide/connecting.rst +++ b/docs/guide/connecting.rst @@ -1,7 +1,7 @@ -.. Copyright 2003-2025 by Wilson Snyder. +.. Copyright 2003-2026 by Wilson Snyder. .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 -.. _Connecting: +.. _connecting: ****************************** Connecting to Verilated Models @@ -11,13 +11,13 @@ Structure of the Verilated Model ================================ Verilator outputs a :file:`{prefix}.h` header file which defines a class -named :code:`{prefix}` which represents the generated model the user is -supposed to instantiate. This model class defines the interface of the +named ``{prefix}`` which represents the generated model the user is +supposed to instantiate. This model class defines the interface of the Verilated model. Verilator will additionally create a :file:`{prefix}.cpp` file, together -with additional .h and .cpp files for internals. See the :file:`examples` -directory in the kit for examples. See :ref:`Files Read/Written` for +with additional .h and .cpp files for internals. See the :file:`examples` +directory in the kit for examples. See :ref:`Files Read/Written` for information on all the files Verilator might output. The output of Verilator will contain a :file:`{prefix}.mk` file that may be @@ -32,91 +32,89 @@ model: equivalents. * Public top level module instances are exposed as pointers to allow access - to :code:`/* verilator public */` items. + to ``/* verilator public */`` items. -* The root of the design hierarchy (as in SystemVerilog :code:`$root`) is - exposed via the :code:`rootp` member pointer to allow access to model - internals, including :code:`/* verilator public_flat */` items. +* The root of the design hierarchy (as in SystemVerilog ``$root``) is + exposed via the ``rootp`` member pointer to allow access to model + internals, including ``/* verilator public_flat */`` items. -.. _Porting from pre 4.210: +.. _porting from pre 4.210: Model interface changes in version 4.210 ------------------------------------------- +---------------------------------------- Starting from version 4.210, the model class is an interface object. Up until Verilator version 4.204 inclusive, the generated model class was also the instance of the top level instance in the design hierarchy (what -you would refer to with :code:`$root` in SystemVerilog). This meant that -all internal variables that were implemented by Verilator in the root scope -were accessible as members of the model class itself. Note there were often -many such variable due to module inlining, including -:code:`/* verilator public_flat */` items. +you would refer to with ``$root`` in SystemVerilog). This meant that all +internal variables that were implemented by Verilator in the root scope +were accessible as members of the model class itself. Note there were often +many such variable due to module inlining, including ``/* verilator +public_flat */`` items. This means that user code that accesses internal signals in the model -(likely including :code:`/* verilator public_flat */` signals, as they are +(likely including ``/* verilator public_flat */`` signals, as they are often inlined into the root scope) will need to be updated as follows: * No change required for accessing top level IO signals. These are directly accessible in the model class via references. -* No change required for accessing :code:`/* verilator public */` items. - These are directly accessible via sub-module pointers in the model class. +* No change required for accessing ``/* verilator public */`` items. These + are directly accessible via sub-module pointers in the model class. * Accessing any other internal members, including - :code:`/* verilator public_flat */` items requires the following changes: + ``/* verilator public_flat */`` items requires the following changes: * Additionally include :file:`{prefix}___024root.h`. This header defines - type of the :code:`rootp` pointer within the model class. Note the - :code:`__024` substring is the Verilator escape sequence for the - :code:`$` character, i.e.: :code:`rootp` points to the Verilated - SystemVerilog :code:`$root` scope. + type of the ``rootp`` pointer within the model class. Note the + ``__024`` substring is the Verilator escape sequence for the ``$`` + character, i.e.: ``rootp`` points to the Verilated SystemVerilog + ``$root`` scope. - * Replace :code:`modelp->internal->member` references with - :code:`modelp->rootp->internal->member` references, which - contain one additional indirection via the :code:`rootp` pointer. + * Replace ``modelp->internal->member`` references with + ``modelp->rootp->internal->member`` references, which contain one + additional indirection via the ``rootp`` pointer. -.. _Connecting to C++: +.. _connecting to c++: Connecting to C++ ================= -In C++ output mode (:vlopt:`--cc`), the Verilator generated model class is a -simple C++ class. The user must write a C++ wrapper and main loop for the +In C++ output mode (:vlopt:`--cc`), the Verilator generated model class is +a simple C++ class. The user must write a C++ wrapper and main loop for the simulation, which instantiates the model class, and link with the Verilated model. Refer to ``examples/make_tracing_c`` in the distribution for a detailed commented example. -Top level IO signals are read and written as members of the model. You -call the model's :code:`eval()` method to evaluate the model. When the -simulation is complete call the model's :code:`final()` method to execute -any SystemVerilog final blocks, and complete any assertions. If using -:vlopt:`--timing`, there are two additional functions for checking if -there are any events pending in the simulation due to delays, and for -retrieving the simulation time of the next delayed event. See -:ref:`Evaluation Loop`. - +Top level IO signals are read and written as members of the model. You call +the model's ``eval()`` method to evaluate the model. When the simulation is +complete call the model's ``final()`` method to execute any SystemVerilog +final blocks, and complete any assertions. If using :vlopt:`--timing`, +there are two additional functions for checking if there are any events +pending in the simulation due to delays, and for retrieving the simulation +time of the next delayed event. See :ref:`Evaluation Loop`. Connecting to SystemC ===================== In SystemC output mode (:vlopt:`--sc`), the Verilator generated model class -is a SystemC SC_MODULE. This module will attach directly into a SystemC +is a SystemC SC_MODULE. This module will attach directly into a SystemC netlist as an instantiation. The SC_MODULE gets the same pinout as the Verilog module, with the -following type conversions: Pins of a single bit become bool. Pins 2-32 -bits wide become uint32_t's. Pins 33-64 bits wide become sc_bv's or -uint64_t's depending on the :vlopt:`--no-pins64` option. Wider pins -become sc_bv's. (Uints simulate the fastest so are used where possible.) +following type conversions: Pins of a single bit become bool. Pins 2-32 +bits wide become uint32_t's. Pins 33-64 bits wide become sc_bv's or +uint64_t's depending on the :vlopt:`--no-pins64` option. Wider pins become +sc_bv's. (Uints simulate the fastest so are used where possible.) Model internals, including lower level sub-modules are not pure SystemC -code. This is a feature, as using the SystemC pin interconnect scheme +code. This is a feature, as using the SystemC pin interconnect scheme everywhere would reduce performance by an order of magnitude. @@ -124,41 +122,42 @@ Verilated API ============= The API to a Verilated model is the C++ headers in the include/ directory -in the distribution. These headers use Doxygen comments, `///` and `//<`, +in the distribution. These headers use Doxygen comments, `///` and `//<`, to indicate and document those functions that are part of the Verilated public API. Process-Level Clone APIs --------------------------- +------------------------ -Modern operating systems support process-level clone (a.k.a copying, forking) -with system call interfaces in C/C++, e.g., :code:`fork()` in Linux. +Modern operating systems support process-level clone (a.k.a copying, +forking) with system call interfaces in C/C++, e.g., ``fork()`` in Linux. However, after cloning a parent process, some resources cannot be inherited -in the child process. For example, in POSIX systems, when you fork a process, -the child process inherits all the memory of the parent process. However, -only the thread that called fork is replicated in the child process. Other -threads are not. +in the child process. For example, in POSIX systems, when you fork a +process, the child process inherits all the memory of the parent process. +However, only the thread that called fork is replicated in the child +process. Other threads are not. -Therefore, to support the process-level clone mechanisms, Verilator supports -:code:`prepareClone()` and :code:`atClone()` APIs to allow the user to manually -re-construct the model in the child process. The two APIs handle all necessary -resources required for releasing and re-initializing before and after cloning. +Therefore, to support the process-level clone mechanisms, Verilator +supports ``prepareClone()`` and ``atClone()`` APIs to allow the user to +manually re-construct the model in the child process. The two APIs handle +all necessary resources required for releasing and re-initializing before +and after cloning. -The two APIs are supported in the verilated models. Here is an example of usage -with Linux :code:`fork()` and :code:`pthread_atfork` APIs: +The two APIs are supported in the verilated models. Here is an example of +usage with Linux ``fork()`` and ``pthread_atfork`` APIs: .. code-block:: C++ - // static function pointers to fit pthread_atfork - static auto prepareClone = [](){ topp->prepareClone(); }; - static auto atClone = [](){ topp->atClone(); }; + // static function pointers to fit pthread_atfork + static auto prepareClone = [](){ topp->prepareClone(); }; + static auto atClone = [](){ topp->atClone(); }; - // in main function, register the handlers: - pthread_atfork(prepareClone, atClone, atClone); + // in main function, register the handlers: + pthread_atfork(prepareClone, atClone, atClone); For better flexibility, you can also manually call the handlers before and -after :code:`fork()`. +after ``fork()``. With the process-level clone APIs, users can create process-level snapshots for the verilated models. While the Verilator save/restore option provides @@ -170,7 +169,7 @@ Direct Programming Interface (DPI) ================================== Verilator supports SystemVerilog Direct Programming Interface import and -export statements. Only the SystemVerilog form ("DPI-C") is supported, not +export statements. Only the SystemVerilog form ("DPI-C") is supported, not the original Synopsys-only DPI. DPI Example @@ -181,76 +180,76 @@ Verilog, put in our.v: .. code-block:: - import "DPI-C" function int add (input int a, input int b); + import "DPI-C" function int add (input int a, input int b); - initial begin - $display("%x + %x = %x", 1, 2, add(1,2)); - endtask + initial begin + $display("%x + %x = %x", 1, 2, add(1,2)); + endtask Then after Verilating, Verilator will create a file Vour__Dpi.h with the prototype to call this function: .. code-block:: C++ - extern int add(int a, int b); + extern int add(int a, int b); From the sc_main.cpp file (or another .cpp file passed to the Verilator command line, or the link), you'd then: .. code-block:: C++ - #include "svdpi.h" - #include "Vour__Dpi.h" - int add(int a, int b) { return a+b; } + #include "svdpi.h" + #include "Vour__Dpi.h" + int add(int a, int b) { return a+b; } DPI System Task/Functions ------------------------- Verilator extends the DPI format to allow using the same scheme to -efficiently add system functions. Use a dollar-sign prefixed system +efficiently add system functions. Use a dollar-sign prefixed system function name for the import, but note it must be escaped. .. code-block:: sv - export "DPI-C" function integer \$myRand; + export "DPI-C" function integer \$myRand; - initial $display("myRand=%d", $myRand()); + initial $display("myRand=%d", $myRand()); Going the other direction, you can export Verilog tasks so they can be called from C++: .. code-block:: sv - export "DPI-C" task publicSetBool; + export "DPI-C" task publicSetBool; - task publicSetBool; - input bit in_bool; - var_bool = in_bool; - endtask + task publicSetBool; + input bit in_bool; + var_bool = in_bool; + endtask Then after Verilating, Verilator will create a file Vour__Dpi.h with the prototype to call this function: .. code-block:: C++ - extern void publicSetBool(svBit in_bool); + extern void publicSetBool(svBit in_bool); From the sc_main.cpp file, you'd then: .. code-block:: C++ - #include "Vour__Dpi.h" - publicSetBool(value); + #include "Vour__Dpi.h" + publicSetBool(value); -Or, alternatively, call the function under the design class. This isn't -DPI compatible but is easier to read and better supports multiple designs. +Or, alternatively, call the function under the design class. This isn't DPI +compatible but is easier to read and better supports multiple designs. .. code-block:: C++ - #include "Vour__Dpi.h" - Vour::publicSetBool(value); - // or top->publicSetBool(value); + #include "Vour__Dpi.h" + Vour::publicSetBool(value); + // or top->publicSetBool(value); Note that if the DPI task or function accesses any register or net within the RTL, it will require a scope to be set. This can be done using the @@ -263,11 +262,11 @@ with respect to that top level module, then the scope could be set with .. code-block:: C++ - #include "svdpi.h" - ... - const svScope scope = svGetScopeFromName("TOP.dut"); - assert(scope); // Check for nullptr if scope not found - svSetScope(scope); + #include "svdpi.h" + ... + const svScope scope = svGetScopeFromName("TOP.dut"); + assert(scope); // Check for nullptr if scope not found + svSetScope(scope); (Remember that Verilator adds a "TOP" to the top of the module hierarchy.) @@ -282,24 +281,24 @@ DPI Imports that access signals If a DPI import accesses a signal through the VPI Verilator will not be able to know what variables are accessed and may schedule the code -inappropriately. Ideally pass the values as inputs/outputs so the VPI is -not required. Alternatively a workaround is to use a non-inlined task as a +inappropriately. Ideally pass the values as inputs/outputs so the VPI is +not required. Alternatively a workaround is to use a non-inlined task as a wrapper: .. code-block:: - logic din; + logic din; - // This DPI function will read "din" - import "DPI-C" context function void dpi_that_accesses_din(); + // This DPI function will read "din" + import "DPI-C" context function void dpi_that_accesses_din(); - always @(...) - dpi_din_args(din); + always @(...) + dpi_din_args(din); - task dpi_din_args(input din); - // verilator no_inline_task - dpi_that_accesses_din(); - endtask + task dpi_din_args(input din); + // verilator no_inline_task + dpi_that_accesses_din(); + endtask DPI Display Functions @@ -309,8 +308,8 @@ Verilator allows writing $display like functions using this syntax: .. code-block:: - import "DPI-C" function void - \$my_display(input string formatted /*verilator sformat*/ ); + import "DPI-C" function void + \$my_display(input string formatted /*verilator sformat*/ ); The :option:`/*verilator&32;sformat*/` metacomment indicates that this function accepts a $display like format specifier followed by any number of @@ -320,14 +319,14 @@ arguments to satisfy the format. DPI Context Functions --------------------- -Verilator supports IEEE DPI Context Functions. Context imports pass the +Verilator supports IEEE DPI Context Functions. Context imports pass the simulator context, including calling scope name, and filename and line -number to the C code. For example, in Verilog: +number to the C code. For example, in Verilog: .. code-block:: - import "DPI-C" context function int dpic_line(); - initial $display("This is line %d, again, line %d\n", `line, dpic_line()); + import "DPI-C" context function int dpic_line(); + initial $display("This is line %d, again, line %d\n", `line, dpic_line()); This will call C++ code which may then use the svGet\* functions to read information, in this case the line number of the Verilog statement that @@ -335,22 +334,22 @@ invoked the dpic_line function: .. code-block:: C++ - int dpic_line() { - // Get a scope: svScope scope = svGetScope(); + int dpic_line() { + // Get a scope: svScope scope = svGetScope(); - const char* scopenamep = svGetNameFromScope(scope); - assert(scopenamep); + const char* scopenamep = svGetNameFromScope(scope); + assert(scopenamep); - const char* filenamep = ""; - int lineno = 0; - if (svGetCallerInfo(&filenamep, &lineno)) { - printf("dpic_line called from scope %s on line %d\n", - scopenamep, lineno); - return lineno; - } else { - return 0; - } - } + const char* filenamep = ""; + int lineno = 0; + if (svGetCallerInfo(&filenamep, &lineno)) { + printf("dpic_line called from scope %s on line %d\n", + scopenamep, lineno); + return lineno; + } else { + return 0; + } + } See the IEEE Standard for more information. @@ -359,13 +358,12 @@ DPI Header Isolation -------------------- Verilator places the IEEE standard header files such as svdpi.h into a -separate include directory, vltstd (VeriLaTor STandarD). When compiling +separate include directory, vltstd (VeriLaTor STandarD). When compiling most applications $VERILATOR_ROOT/include/vltstd would be in the include -path along with the normal $VERILATOR_ROOT/include. However, when -compiling Verilated models into other simulators which have their own -svdpi.h and similar standard files with different contents, the vltstd -directory should not be included to prevent picking up incompatible -definitions. +path along with the normal $VERILATOR_ROOT/include. However, when compiling +Verilated models into other simulators which have their own svdpi.h and +similar standard files with different contents, the vltstd directory should +not be included to prevent picking up incompatible definitions. Public Functions @@ -378,24 +376,23 @@ are slightly faster, but less compatible. Verification Procedural Interface (VPI) ======================================= -Verilator supports a limited subset of the VPI. This subset allows +Verilator supports a limited subset of the VPI. This subset allows inspection, examination, value change callbacks, and depositing of values to public signals only. VPI is enabled with the Verilator :vlopt:`--vpi` option. To access signals via the VPI, Verilator must be told exactly which signals -are to be accessed. This is done using the Verilator public pragmas +are to be accessed. This is done using the Verilator public pragmas documented below. Verilator has an important difference from an event based simulator; signal values that are changed by the VPI will not immediately propagate their -values, instead the top level header file's :code:`eval()` method must be -called. Normally this would be part of the normal evaluation (i.e. the -next clock edge), not as part of the value change. This makes the -performance of VPI routines extremely fast compared to event based -simulators, but can confuse some test-benches that expect immediate -propagation. +values, instead the top level header file's ``eval()`` method must be +called. Normally this would be part of the normal evaluation (i.e. the next +clock edge), not as part of the value change. This makes the performance of +VPI routines extremely fast compared to event based simulators, but can +confuse some test-benches that expect immediate propagation. Note the VPI by its specified implementation will always be much slower than accessing the Verilator values by direct reference @@ -405,132 +402,131 @@ while the direct references are evaluated by the compiler and result in only a couple of instructions. For signal callbacks to work the main loop of the program must call -:code:`VerilatedVpi::callValueCbs()`. +``VerilatedVpi::callValueCbs()``. -Verilator also tracks when the model state has been modified via the VPI with -an :code:`evalNeeded` flag. This flag can be checked with :code:`VerilatedVpi::evalNeeded()` -and it can be cleared with :code:`VerilatedVpi::clearEvalNeeded()`. Used together -it is possible to skip :code:`eval()` calls if no model state has been changed -since the last :code:`eval()`. +Verilator also tracks when the model state has been modified via the VPI +with an ``evalNeeded`` flag. This flag can be checked with +``VerilatedVpi::evalNeeded()`` and it can be cleared with +``VerilatedVpi::clearEvalNeeded()``. Used together it is possible to skip +``eval()`` calls if no model state has been changed since the last +``eval()``. -Any data written via :code:`vpi_put_value` with :code:`vpiInertialDelay` will -be deferred for later. These delayed values can be flushed to the model with -:code:`VerilatedVpi::doInertialPuts()`. +Any data written via ``vpi_put_value`` with ``vpiInertialDelay`` will be +deferred for later. These delayed values can be flushed to the model with +``VerilatedVpi::doInertialPuts()``. -.. _VPI Example: +.. _vpi example: VPI Example ----------- In the below example, we have readme marked read-only, and writeme marked -read-write which if written from outside the model will have the same semantics -as if it was a top level input. +read-write which if written from outside the model will have the same +semantics as if it was a top level input. .. code-block:: bash - cat >our.v <<'EOF' - module our #( - parameter WIDTH /*verilator public_flat_rd*/ = 32 - ) (input clk); - reg [WIDTH-1:0] readme /*verilator public_flat_rd*/; - reg [WIDTH-1:0] writeme /*verilator public_flat_rw*/; - initial $finish; - endmodule - EOF + cat >our.v <<'EOF' + module our #( + parameter WIDTH /*verilator public_flat_rd*/ = 32 + ) (input clk); + reg [WIDTH-1:0] readme /*verilator public_flat_rd*/; + reg [WIDTH-1:0] writeme /*verilator public_flat_rw*/; + initial $finish; + endmodule + EOF There are many online tutorials and books on the VPI, but an example that accesses the above signal "readme" would be: .. code-block:: bash - cat >sim_main.cpp <<'EOF' - #include "Vour.h" - #include "verilated.h" - #include "verilated_vpi.h" // Required to get definitions + cat >sim_main.cpp <<'EOF' + #include "Vour.h" + #include "verilated.h" + #include "verilated_vpi.h" // Required to get definitions - uint64_t main_time = 0; // See comments in first example - double sc_time_stamp() { return main_time; } + uint64_t main_time = 0; // See comments in first example + double sc_time_stamp() { return main_time; } - void read_and_check() { - vpiHandle vh1 = vpi_handle_by_name((PLI_BYTE8*)"TOP.our.readme", NULL); - if (!vh1) vl_fatal(__FILE__, __LINE__, "sim_main", "No handle found"); - const char* name = vpi_get_str(vpiName, vh1); - const char* type = vpi_get_str(vpiType, vh1); - const int size = vpi_get(vpiSize, vh1); - printf("register name: %s, type: %s, size: %d\n", name, type, size); // Prints "register name: readme, type: vpiReg, size: 32" + void read_and_check() { + vpiHandle vh1 = vpi_handle_by_name((PLI_BYTE8*)"TOP.our.readme", NULL); + if (!vh1) vl_fatal(__FILE__, __LINE__, "sim_main", "No handle found"); + const char* name = vpi_get_str(vpiName, vh1); + const char* type = vpi_get_str(vpiType, vh1); + const int size = vpi_get(vpiSize, vh1); + printf("register name: %s, type: %s, size: %d\n", name, type, size); // Prints "register name: readme, type: vpiReg, size: 32" - s_vpi_value v; - v.format = vpiIntVal; - vpi_get_value(vh1, &v); - printf("Value of %s: %d\n", name, v.value.integer); // Prints "Value of readme: 0" - } + s_vpi_value v; + v.format = vpiIntVal; + vpi_get_value(vh1, &v); + printf("Value of %s: %d\n", name, v.value.integer); // Prints "Value of readme: 0" + } - int main(int argc, char** argv) { - Verilated::commandArgs(argc, argv); - const std::unique_ptr contextp{new VerilatedContext}; - const std::unique_ptr top{new Vour{contextp.get()}}; + int main(int argc, char** argv) { + Verilated::commandArgs(argc, argv); + const std::unique_ptr contextp{new VerilatedContext}; + const std::unique_ptr top{new Vour{contextp.get()}}; - contextp->internalsDump(); // See scopes to help debug - while (!contextp->gotFinish()) { - top->eval(); - VerilatedVpi::callValueCbs(); // For signal callbacks - read_and_check(); - } - return 0; - } - EOF + contextp->internalsDump(); // See scopes to help debug + while (!contextp->gotFinish()) { + top->eval(); + VerilatedVpi::callValueCbs(); // For signal callbacks + read_and_check(); + } + return 0; + } + EOF -.. _Evaluation Loop: +.. _evaluation loop: Wrappers and Model Evaluation Loop ================================== When using SystemC, evaluation of the Verilated model is managed by the -SystemC kernel, and for the most part can be ignored. When using C++, the -user must call :code:`eval()`, or :code:`eval_step()` and -:code:`eval_end_step()`. +SystemC kernel, and for the most part can be ignored. When using C++, the +user must call ``eval()``, or ``eval_step()`` and ``eval_end_step()``. 1. When there is a single design instantiated at the C++ level that needs -to evaluate within a given context, call :code:`designp->eval()`. +to evaluate within a given context, call ``designp->eval()``. 2. When there are multiple designs instantiated at the C++ level that need -to evaluate within a context, call :code:`first_designp->eval_step()` then -:code:`->eval_step()` on all other designs. Then call -:code:`->eval_end_step()` on the first design then all other designs. If -there is only a single design, you would call :code:`eval_step()` then -:code:`eval_end_step()`; in fact :code:`eval()` described above is just a -wrapper which calls these two functions. +to evaluate within a context, call ``first_designp->eval_step()`` then +``->eval_step()`` on all other designs. Then call ``->eval_end_step()`` on +the first design then all other designs. If there is only a single design, +you would call ``eval_step()`` then ``eval_end_step()``; in fact ``eval()`` +described above is just a wrapper which calls these two functions. 3. If using delays and :vlopt:`--timing`, there are two additional methods the user should call: - * :code:`designp->eventsPending()`, which returns :code:`true` if there are - any delayed events pending, - * :code:`designp->nextTimeSlot()`, which returns the simulation time of the + * ``designp->eventsPending()``, which returns ``true`` if there are any + delayed events pending, + * ``designp->nextTimeSlot()``, which returns the simulation time of the next delayed event. This method can only be called if - :code:`designp->eventsPending()` returned :code:`true`. + ``designp->eventsPending()`` returned ``true``. -Call :code:`eventsPending()` to check if you should continue with the -simulation, and then :code:`nextTimeSlot()` to move simulation time forward. -:vlopt:`--main` can be used with :vlopt:`--timing` to generate a basic example -of a timing-enabled eval loop. +Call ``eventsPending()`` to check if you should continue with the +simulation, and then ``nextTimeSlot()`` to move simulation time forward. +:vlopt:`--main` can be used with :vlopt:`--timing` to generate a basic +example of a timing-enabled eval loop. -When :code:`eval()` (or :code:`eval_step()`) is called Verilator looks for -changes in clock signals and evaluates related sequential always blocks, -such as computing always_ff @ (posedge...) outputs. With :vlopt:`--timing`, it +When ``eval()`` (or ``eval_step()``) is called Verilator looks for changes +in clock signals and evaluates related sequential always blocks, such as +computing always_ff @ (posedge...) outputs. With :vlopt:`--timing`, it resumes any delayed processes awaiting the current simulation time. Then Verilator evaluates combinational logic. Note combinatorial logic is not computed before sequential always blocks are computed (for speed reasons). Therefore it is best to set any non-clock -inputs up with a separate :code:`eval()` call before changing clocks. +inputs up with a separate ``eval()`` call before changing clocks. Alternatively, if all always_ff statements use only the posedge of clocks, or all inputs go directly to always_ff statements, as is typical, then you can change non-clock inputs on the negative edge of the input clock, which -will be faster as there will be fewer :code:`eval()` calls. +will be faster as there will be fewer ``eval()`` calls. For more information on evaluation, see :file:`docs/internals.rst` in the distribution. @@ -540,18 +536,18 @@ Verilated and VerilatedContext ============================== Multiple C++ Verilated models may be part of the same simulation context, -that is share a VPI interface, sense of time, and common settings. This +that is share a VPI interface, sense of time, and common settings. This common simulation context information is stored in a ``VerilatedContext`` -structure. If a ``VerilatedContext`` is not created prior to creating a -model, a default global one is created automatically. SystemC requires +structure. If a ``VerilatedContext`` is not created prior to creating a +model, a default global one is created automatically. SystemC requires using only the single, default VerilatedContext. The ``Verilated::`` methods, including the ``Verilated::commandArgs`` call shown above, call VerilatedContext methods using the default global -VerilatedContext. (Technically they operate on the last one used by a -given thread.) If you are using multiple simulation contexts you should -not use the Verilated:: methods, and instead always use VerilatedContext -methods called on the appropriate VerilatedContext object. +VerilatedContext. (Technically they operate on the last one used by a given +thread.) If you are using multiple simulation contexts you should not use +the Verilated:: methods, and instead always use VerilatedContext methods +called on the appropriate VerilatedContext object. For methods available under Verilated and VerilatedContext see :file:`include/verilated.h` in the distribution. diff --git a/docs/guide/contributing.rst b/docs/guide/contributing.rst index e25fa9bc4..80c11be2f 100644 --- a/docs/guide/contributing.rst +++ b/docs/guide/contributing.rst @@ -1,4 +1,4 @@ -.. Copyright 2003-2025 by Wilson Snyder. +.. Copyright 2003-2026 by Wilson Snyder. .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 ******************************* @@ -19,50 +19,50 @@ Reporting Bugs First, check the :ref:`Language Limitations` section. -Next, try the :vlopt:`--debug` option. This will enable additional -internal assertions, and may help identify the problem. +Next, try the :vlopt:`--debug` option. This will enable additional internal +assertions, and may help identify the problem. Finally, reduce your code to the smallest possible routine that exhibits -the bug (see: :ref:`Minimizing bug-inducing code`). Even better, create -a test in the :file:`test_regress/t` directory, as follows: +the bug (see: :ref:`Minimizing bug-inducing code`). Even better, create a +test in the :file:`test_regress/t` directory, as follows: .. code-block:: bash - cd test_regress - cp -p t/t_EXAMPLE.py t/t_BUG.py - cp -p t/t_EXAMPLE.v t/t_BUG.v + cd test_regress + cp -p t/t_EXAMPLE.py t/t_BUG.py + cp -p t/t_EXAMPLE.v t/t_BUG.v There are many hints on how to write a good test in the :file:`test_regress/driver.py` documentation which can be seen by running: .. code-block:: bash - cd $VERILATOR_ROOT # Need the original distribution kit - test_regress/driver.py --help + cd $VERILATOR_ROOT # Need the original distribution kit + test_regress/driver.py --help Edit :file:`t/t_BUG.py` to suit your example; you can do anything you want in the Verilog code there; just make sure it retains the single clk input -and no outputs. Now, the following should fail: +and no outputs. Now, the following should fail: .. code-block:: bash - cd $VERILATOR_ROOT # Need the original distribution kit - cd test_regress - t/t_BUG.py # Run on Verilator - t/t_BUG.py --debug # Run on Verilator, passing --debug to Verilator - t/t_BUG.py --vcs # Run on VCS simulator - t/t_BUG.py --nc|--iv|--ghdl # Likewise on other simulators + cd $VERILATOR_ROOT # Need the original distribution kit + cd test_regress + t/t_BUG.py # Run on Verilator + t/t_BUG.py --debug # Run on Verilator, passing --debug to Verilator + t/t_BUG.py --vcs # Run on VCS simulator + t/t_BUG.py --nc|--iv|--ghdl # Likewise on other simulators The test driver accepts a number of options, many of which mirror the main Verilator options. For example the previous test could have been run with -debugging enabled. The full set of test options can be seen by running +debugging enabled. The full set of test options can be seen by running :command:`driver.py --help` as shown above. Finally, report the bug at `Verilator Issues -`_. The bug will become publicly visible; if +`_. The bug will become publicly visible; if this is unacceptable, mail the bug report to ``wsnyder@wsnyder.org``. -.. _Minimizing bug-inducing code: +.. _minimizing bug-inducing code: Minimizing bug-inducing code ============================ @@ -73,12 +73,12 @@ caused by a complex interaction of many parts of the design, and it is not clear which parts are necessary to reproduce the bug. In these cases, an Open Source tool called `sv-bugpoint `_ can be used to automatically -reduce a SystemVerilog design to the smallest possible reproducer. -It can be used to automatically reduce a design with hundreds of thousands of +reduce a SystemVerilog design to the smallest possible reproducer. It can +be used to automatically reduce a design with hundreds of thousands of lines to a minimal test case while preserving the bug-inducing behavior. With :vlopt:`--debug` or :vlopt:`--dump-inputs`, Verilator will write a -*{prefix}*\ __inputs\ .vpp file which has all of the individual input files +*{prefix}*\ __inputs.vpp file which has all of the individual input files combined and pre-processed, this is often useful as the input design into `sv-bugpoint`. @@ -88,4 +88,5 @@ information on how to use `sv-bugpoint`. .. Contributing .. ============ + .. include:: ../CONTRIBUTING.rst diff --git a/docs/guide/contributors.rst b/docs/guide/contributors.rst index 607e967a4..8f9d42dfd 100644 --- a/docs/guide/contributors.rst +++ b/docs/guide/contributors.rst @@ -1,4 +1,4 @@ -.. Copyright 2003-2025 by Wilson Snyder. +.. Copyright 2003-2026 by Wilson Snyder. .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 ************************ @@ -28,10 +28,11 @@ Alliance `_, and `Antmicro Ltd Previous major corporate sponsors of Verilator, by providing significant contributions of time or funds include: Antmicro Ltd., Atmel Corporation, -Compaq Corporation, Digital Equipment Corporation, Embecosm Ltd., Hicamp -Systems, Intel Corporation, Marvell Inc., Mindspeed Technologies Inc., -MicroTune Inc., picoChip Designs Ltd., Sun Microsystems Inc., Nauticus -Networks Inc., SiCortex Inc, Shunyao CAD, and Western Digital Inc. +Compaq Corporation, Digital Equipment Corporation, Embecosm Ltd., Fractile +Ltd., Hicamp Systems, Intel Corporation, Marvell Inc., Mindspeed +Technologies Inc., MicroTune Inc., picoChip Designs Ltd., Sun Microsystems +Inc., Nauticus Networks Inc., SiCortex Inc, Shunyao CAD, and Western +Digital Inc. The contributors of major functionality are: Jeremy Bennett, Krzysztof Bieganski, Byron Bradley, Lane Brooks, John Coiner, Duane Galbi, Arkadiusz @@ -41,133 +42,158 @@ Paul Wasson, Jie Xu, and Wilson Snyder. Some of the people who have provided ideas, and feedback for Verilator include: -David Addison, Tariq B. Ahmad, Nikana Anastasiadis, John David Anglin, -Frederic Antonin, Hans Van Antwerpen, Vasu Arasanipalai, Jens Arm, Rohan -Arshid, Valentin Atepalikhin, Philip Axer, Gökçe Aydos, Chris Bachhuber, -Filip Badáň, Adam Bagley, Sharad Bagri, James Bailey, Robert Balas, Marco -Balboni, Matthew Ballance, Ricardo Barbedo, Andrew Bardsley, Ilya Barkov, -Matthew Barr, Geoff Barrett, Kaleb Barrett, Daniel Bates, Julius Baxter, -Michael Berman, Jean Berniolles, Victor Besyakov, Narayan Bhagavatula, -Moinak Bhattacharyya, Kritik Bhimani, David Biancolin, Krzysztof Bieganski, -Michael Bikovitsky, David Binderman, Piotr Binkowski, Johan Björk, David -Black, Tymoteusz Blazejczyk, Scott Bleiweiss, David van der Bokke, Daniel -Bone, Guy Bonneau, Krzysztof Boroński, Gregg Bouchard, Christopher -Boumenot, Paul Bowen-Huggett, Nick Bowler, Bryan Brady, Maarten De -Braekeleer, Liam Braun, Charlie Brej, J Briquet, John Brownlee, KC -Buckenmaier, Gijs Burghoorn, Jeff Bush, Lawrence Butcher, Tony Bybell, Iru -Cai, Ted Campbell, Anthony Campos, Chris Candler, Lauren Carlson, Gregory -Carver, Donal Casey, Sebastien Van Cauwenberghe, Alex Chadwick, Greg -Chadwick, Marcel Chang, Aliaksei Chapyzhenka, Chih-Mao Chen, Guokai Chen, -Kefa Chen, Terry Chen, Yangyu Chen, Yi-Chung Chen, Yurii Cherkasov, -Hennadii Chernyshchyk, Enzo Chi, Bartłomiej Chmiel, Robert A. Clark, Ryan -Clarke, Allan Cochrane, Keith Colbert, Quentin Corradi, Nassim Corteggiani, -Gianfranco Costamagna, February Cozzocrea, Sean Cross, George Cuan, Michal -Czyz, Joe DErrico, Jim Dai, Lukasz Dalek, Laurens van Dam, Gunter -Dannoritzer, Ashutosh Das, Julian Daube, Greg Davill, Bernard Deadman, -Peter Debacker, Josse Van Delm, John Demme, Mike Denio, John Deroo, Philip -Derrick, Aadi Desai, John Dickol, Ruben Diez, Danny Ding, Jacko Dirks, Ivan -Djordjevic, Brad Dobbie, Paul Donahue, Jonathon Donaldson, Anthony Donlon, -Caleb Donovick, Larry Doolittle, Leendert van Doorn, Sebastian Dressler, -Jonathan Drolet, Justin Yao Du, Maciej Dudek, Alex Duller, Jeff Dutton, -Tomas Dzetkulic, Usuario Eda, Charles Eddleston, Chandan Egbert, Joe Eiler, -Ahmed El-Mahmoudy, Trevor Elbourne, Mats Engstrom, Robert Farrell, Julien -Faucher, Olivier Faure, Eugene Feinberg, Eugen Fekete, Fabrizio Ferrandi, -Udi Finkelstein, Brian Flachs, Bill Flynn, Andrea Foletto, Alex Forencich, -Aurelien Francillon, Bob Fredieu, Manuel Freiberger, Mostafa Gamal, Vito -Gamberini, Mostafa Garnal, Benjamin Gartner, Christian Gelinek, Richard E -George, Peter Gerst, Glen Gibb, Michael Gielda, Barbara Gigerl, Nimrod -Gileadi, Shankar Giri, Dan Gisselquist, Szymon Gizler, Petr Gladkikh, Sam -Gladstone, Mariusz Glebocki, Embedded Go, Andrew Goessling, Amir Gonnen, -Chitlesh Goorah, Tomasz Gorochowik, Kai Gossner, Tarik Graba, Sergi -Granell, Al Grant, Nathan Graybeal, Alexander Grobman, Qian Gu, Xuan Guo, -Prabhat Gupta, Deniz Güzel, Driss Hafdi, Abdul Hameed, Neil Hamilton, James -Hanlon, Tang Haojin, Øyvind Harboe, Jannis Harder, David Harris, Junji -Hashimoto, Thomas Hawkins, Mitch Hayenga, Harald Heckmann, Robert Henry, -Stephen Henry, Sebastian Hesselbarth, David Hewson, Jamey Hicks, Joel -Holdsworth, Andrew Holme, Peter Holmes, Hiroki Honda, Alex Hornung, -Pierre-Henri Horrein, David Horton, Peter Horvath, Jae Hossell, Kuoping -Hsu, Shou-Li Hsu, Teng Huang, Steven Hugg, Alan Hunter, James Hutchinson, -Tim Hutt, Ehab Ibrahim, Edgar E. Iglesias, Shahid Ikram, Jamie Iles, Fuad -Ismail, Vighnesh Iyer, Ben Jackson, Daniel Jacques, Shareef Jalloq, Marlon -James, Krzysztof Jankowski, Eyck Jentzsch, HyungKi Jeong, Iztok Jeras, -Pawel Jewstafjew, Alexandre Joannou, James Johnson, Christophe Joly, Justin -Jones, William D. Jones, Abe Jordan, Larry Darryl Lee Jr., Franck Jullien, -James Jung, Mike Kagen, Arthur Kahlich, Kaalia Kahn, Guy-Armand Kamendje, -Vasu Kandadi, Yoshitomo Kaneda, Kanad Kanhere, Patricio Kaplan, Pieter -Kapsenberg, Rafal Kapuscik, Ralf Karge, Per Karlsson, Dan Katz, Sol -Katzman, Ian Kennedy, Ami Keren, Fabian Keßler, Michael Killough, Sun Kim, -Jonathan Kimmitt, Olof Kindgren, Kevin Kiningham, Cameron Kirk, Dan -Kirkham, Aleksander Kiryk, Sobhan Klnv, Gernot Koch, Jack Koenig, Soon Koh, -Nathan Kohagen, Steve Kolecki, Brett Koonce, Will Korteland, Andrei -Kostovski, Wojciech Koszek, Varun Koyyalagunta, Arkadiusz Kozdra, Markus -Krause, David Kravitz, Adam Krolnik, Roland Kruse, Mahesh Kumashikar, -Andreas Kuster, Sergey Kvachonok, Charles Eric LaForest, Kevin Laeufer, Ed -Lander, Steve Lang, Pierre Laroche, Stephane Laurent, Walter Lavino, -Christian Leber, David Ledger, Alex Lee, Larry Lee, Yoda Lee, Michaël -Lefebvre, Dag Lem, Igor Lesik, John Li, Kay Li, Zixi Li, Davide Libenzi, -Nandor Licker, Eivind Liland, Ícaro Lima, Kevin Lin, Yu-Sheng Lin, Charlie -Lind, Andrew Ling, Jiuyang Liu, Joey Liu, Paul Liu, Derek Lockhart, Jake -Longo, Geza Lore, Arthur Low, Jose Loyola, Stefan Ludwig, Dan Lussier, -Konstantin Lübeck, Fred Ma, Liwei Ma, Duraid Madina, Oleh Maksymenko, Affe -Mao, Julien Margetts, Chick Markley, Alexis Marquet, Mark Marshall, Alfonso -Martinez, Unai Martinez-Corral, Adrien Le Masle, Yves Mathieu, Vladimir -Matveyenko, Patrick Maupin, Stan Mayer, Jordan McConnon, Conor McCullough, -Jason McMullan, Elliot Mednick, Yuan Mei, Andy Meier, Luiza de Melo, -Rodrigo A. Melo, Benjamin Menküc, Jake Merdich, David Metz, Wim Michiels, +Gilberto Abram, David Addison, Joey Ah-kiow, Thomas Dybdahl Ahle, Tariq B. +Ahmad, Thomas Aldrian, Omar Alkhatib, Amal Araweelo Almis, Nikana +Anastasiadis, John David Anglin, Frederic Antonin, Hans Van Antwerpen, Vasu +Arasanipalai, Jens Arm, Rohan Arshid, Valentin Atepalikhin, Philip Axer, +Gökçe Aydos, Chris Bachhuber, Filip Badáň, Adam Bagley, Sharad Bagri, James +Bailey, Robert Balas, Marco Balboni, Matthew Ballance, Ricardo Barbedo, +Andrew Bardsley, Ilya Barkov, Matthew Barr, Geoff Barrett, Kaleb Barrett, +Daniel Bates, Julius Baxter, Jeremy Bennett, Michael Berman, Jean +Berniolles, Victor Besyakov, Narayan Bhagavatula, Moinak Bhattacharyya, +Kritik Bhimani, David Biancolin, Krzysztof Bieganski, Artur Bieniek, +Michael Bikovitsky, David Binderman, Piotr Binkowski, Peter Birch, Johan +Björk, David Black, Tymoteusz Blazejczyk, Scott Bleiweiss, Joel Bodenmann, +David van der Bokke, Daniel Bone, Guy Bonneau, Pierre-Yves Le Borgne, +Krzysztof Boroński, Gregg Bouchard, Christopher Boumenot, Paul +Bowen-Huggett, Nick Bowler, Byron Bradley, Bryan Brady, Maarten De +Braekeleer, Liam Braun, Charlie Brej, Nick Brereton, J Briquet, Lane +Brooks, John Brownlee, KC Buckenmaier, Gijs Burghoorn, Jeff Bush, Lawrence +Butcher, Tony Bybell, Congcong Cai, Iru Cai, Ted Campbell, Anthony Campos, +Chris Candler, Lauren Carlson, Gregory Carver, Donal Casey, Sebastien Van +Cauwenberghe, Alex Chadwick, Greg Chadwick, Marcel Chang, Aliaksei +Chapyzhenka, Chih-Mao Chen, Guokai Chen, Kefa Chen, Terry Chen, Yangyu +Chen, Yi-Chung Chen, Yurii Cherkasov, Hennadii Chernyshchyk, Enzo Chi, +Bartłomiej Chmiel, Sergey Chusov, Robert A. Clark, Ryan Clarke, Allan +Cochrane, John Coiner, Luca Colagrande, Keith Colbert, Quentin Corradi, +Nassim Corteggiani, Gianfranco Costamagna, February Cozzocrea, Sean Cross, +George Cuan, RJ Cunningham, Michal Czyz, Joe DErrico, Jim Dai, Lukasz +Dalek, Laurens van Dam, Gunter Dannoritzer, Ashutosh Das, Julian Daube, +Greg Davill, Bernard Deadman, Peter Debacker, Josse Van Delm, John Demme, +Mike Denio, John Deroo, Philip Derrick, Aadi Desai, John Dickol, Ruben +Diez, Danny Ding, Jacko Dirks, Ivan Djordjevic, Brad Dobbie, Paul Donahue, +Jonathon Donaldson, Anthony Donlon, Caleb Donovick, Larry Doolittle, +Leendert van Doorn, Sebastian Dressler, Connor Driscoll, Jonathan Drolet, +Jose Drowne, Justin Yao Du, Maciej Dudek, Alex Duller, Jeff Dutton, Tomas +Dzetkulic, Usuario Eda, Charles Eddleston, Chandan Egbert, Joe Eiler, Ahmed +El-Mahmoudy, Trevor Elbourne, Schuyler Eldridge, Ahmed Elzeftawi, Mats +Engstrom, Augustin Fabre, Robert Farrell, Julien Faucher, Olivier Faure, +Sergey Fedorov, Eugene Feinberg, Eugen Fekete, Fabrizio Ferrandi, Adrian +Fiergolski, Udi Finkelstein, Brian Flachs, Bill Flynn, Andrea Foletto, +Maxim Fonarev, Alex Forencich, Aurelien Francillon, Marco Frank, Bob +Fredieu, Manuel Freiberger, Stephane Gagnon, Duane Galbi, Mostafa Gamal, +Vito Gamberini, Mateusz Gancarz, Mostafa Garnal, Benjamin Gartner, +Christian Gelinek, Richard E George, Peter Gerst, Glen Gibb, Michael +Gielda, Barbara Gigerl, Nimrod Gileadi, Shankar Giri, Dan Gisselquist, +Szymon Gizler, Petr Gladkikh, Sam Gladstone, Mariusz Glebocki, Embedded Go, +Andrew Goessling, Emil Goh, Amir Gonnen, Chitlesh Goorah, Tomasz +Gorochowik, Kai Gossner, Toshiki Goto, Tarik Graba, Sergi Granell, Al +Grant, Nathan Graybeal, Alexander Grobman, Dominick Grochowina, Qian Gu, +Karol Gugala, Xuan Guo, Prabhat Gupta, Oscar Gustafsson, Deniz Güzel, Driss +Hafdi, Abdul Hameed, Neil Hamilton, Ali Hammoud, James Hanlon, Tang Haojin, +Øyvind Harboe, Jannis Harder, David Harris, Junji Hashimoto, Thomas +Hawkins, Mitch Hayenga, Christian Hecken, Harald Heckmann, Robin Heinemann, +Robert Henry, Stephen Henry, Sebastian Hesselbarth, David Hewson, Jamey +Hicks, Joel Holdsworth, Andrew Holme, Peter Holmes, Hiroki Honda, Steve +Hoover, Alex Hornung, Pierre-Henri Horrein, David Horton, Peter Horvath, +Jae Hossell, Kuoping Hsu, Shou-Li Hsu, Teng Huang, Steven Hugg, Alan +Hunter, James Hutchinson, Tim Hutt, Ehab Ibrahim, Edgar E. Iglesias, Shahid +Ikram, Jamie Iles, Ondrej Ille, Ron K. Irvine, Fuad Ismail, Vighnesh Iyer, +Ben Jackson, Daniel Jacques, Shareef Jalloq, Marlon James, Krzysztof +Jankowski, Moubarak Jeje, Tobias Jensen, Eyck Jentzsch, HyungKi Jeong, +Iztok Jeras, Pawel Jewstafjew, Aditya Ranjan Jha, Xie Jiacheng, Alexandre +Joannou, James Johnson, Christophe Joly, Justin Jones, William D. Jones, +Kees Jongenburger, Abe Jordan, Larry Darryl Lee Jr., Franck Jullien, James +Jung, Yoshitomo KANEDA, Mike Kagen, Arthur Kahlich, Kaalia Kahn, G-A. +Kamendje, Guy-Armand Kamendje, Vasu Kandadi, Kanad Kanhere, Patricio +Kaplan, Pieter Kapsenberg, Rafal Kapuscik, Ralf Karge, Per Karlsson, Dan +Katz, Sol Katzman, Amirreza Kazemi, Ian Kennedy, Ami Keren, Fabian +Keßler-Schulz, John Khoo, Michael Killough, Sun Kim, Jonathan Kimmitt, Olof +Kindgren, Kevin Kiningham, Cameron Kirk, Dan Kirkham, Aleksander Kiryk, +Sobhan Klnv, Gernot Koch, Jack Koenig, Soon Koh, Nathan Kohagen, Pawel +Kojma, Steve Kolecki, Brett Koonce, Will Korteland, Andrei Kostovski, +Wojciech Koszek, Varun Koyyalagunta, Arkadiusz Kozdra, Markus Krause, David +Kravitz, Natan Kreimer, Adam Krolnik, Roland Kruse, Jan Kubalek, Mahesh +Kumashikar, Andreas Kuster, Sergey Kvachonok, Charles Eric LaForest, Kevin +Laeufer, Ed Lander, Steve Lang, Pierre Laroche, Stephane Laurent, Walter +Lavino, Christian Leber, David Ledger, Alex Lee, Larry Lee, Yoda Lee, +Michaël Lefebvre, Dag Lem, Igor Lesik, Brian Li, John Li, Kay Li, Zixi Li, +Davide Libenzi, Matt Liberty, Nandor Licker, Eivind Liland, Ícaro Lima, +Jian Nan Lin, Kevin Lin, Yu-Sheng Lin, Charlie Lind, Andrew Ling, Jens +Yuechao Liu, Jiuyang Liu, Joey Liu, Paul Liu, Derek Lockhart, Jake Longo, +Geza Lore, Arthur Low, Jose Loyola, Stefan Ludwig, Martin Lueker-Boden, Dan +Lussier, Konstantin Lübeck, Fred Ma, Liwei Ma, Duraid Madina, Oleh +Maksymenko, Alexander Mann, Affe Mao, Rémi Marche, Julien Margetts, Chick +Markley, Alexis Marquet, Mark Marshall, Alfonso Martinez, Unai +Martinez-Corral, Adrien Le Masle, Yves Mathieu, Vladimir Matveyenko, +Patrick Maupin, Stan Mayer, Jordan McConnon, Conor McCullough, Jason +McMullan, Elliot Mednick, Yuan Mei, Andy Meier, Luiza de Melo, Rodrigo A. +Melo, Benjamin Menküc, Niraj Menon, Jake Merdich, David Metz, Wim Michiels, Miodrag Milanović, Darryl Miles, Kevin Millis, Andrew Miloradovsky, David -Moberg, Wai Sum Mong, Peter Monsson, Anthony Moore, Sean Moore, Stuart -Morris, Dennis Muhlestein, John Murphy, Matt Myers, Nathan Myers, Richard -Myers, Alex Mykyta, Eric Müller, Dimitris Nalbantis, Peter Nelson, Felix -Neumärker, Bob Newgard, Cong Van Nguyen, Rachit Nigam, Toru Niina, Paul -Nitza, Yossi Nivin, Pete Nixon, Lisa Noack, Mark Nodine, Michael Nolan, -Andrew Nolte, Joseph Nwabueze, Kevin Nygaard, Kuba Ober, Krzysztof -Obłonczek, Andreas Olofsson, Baltazar Ortiz, Aleksander Osman, Don Owen, -Tim Paine, Deepa Palaniappan, James Pallister, Vassilis Papaefstathiou, -Sanggyu Park, Brad Parker, Risto Pejašinović, Seth Pellegrino, Morten Borup -Petersen, Dan Petrisko, Wesley Piard, Maciej Piechotka, David Pierce, Cody -Piersall, T. Platz, Michael Platzer, Dominic Plunkett, Nolan Poe, David -Poole, Michael Popoloski, Roman Popov, Aylon Chaim Porat, Oron Port, Rich -Porter, Rick Porter, Stefan Post, Niranjan Prabhu, Damien Pretet, Harald -Pretl, Bill Pringlemeir, Usha Priyadharshini, Mark Jackson Pulver, Prateek -Puri, Han Qi, Jiacheng Qian, Marshal Qiao, Raynard Qiao, Yujia Qiao, Jasen -Qin, Frank Qiu, Nandu Raj, Kamil Rakoczy, Danilo Ramos, Drew Ranck, Chris -Randall, Anton Rapp, Josh Redford, Odd Magne Reitan, Frédéric Requin, -Dustin Richmond, Samuel Riedel, Alberto Del Rio, Eric Rippey, Narcis Rodas, -Oleg Rodionov, Ludwig Rogiers, Paul Rolfe, Michail Rontionov, Arjen -Roodselaar, Arthur Rosa, Tobias Rosenkranz, Yernagula Roshit, Ryszard -Rozak, Huang Rui, Graham Rushton, Jan Egil Ruud, Denis Rystsov, Pawel -Sagan, Robert Sammelson, Adrian Sampson, John Sanguinetti, Josep Sans, Luca -Sasselli, Martin Scharrer, Martin Schmidt, Jonathan Schröter, Julie +Moberg, Wai Sum Mong, Peter Monsson, Anthony Moore, Sean Moore, Javier +Mora, Rodrigo Batista de Moraes, Stuart Morris, Dennis Muhlestein, John +Murphy, Matt Myers, Nathan Myers, Richard Myers, Alex Mykyta, Shivaram +Mysore, Eric Müller, Dimitris Nalbantis, Jitesh Nayak, Peter Nelson, Yuri +Nenakhov, Felix Neumärker, Bob Newgard, Cong Van Nguyen, Trung Nguyen, +Rachit Nigam, Toru Niina, Paul Nitza, Yossi Nivin, Pete Nixon, Lisa Noack, +Mark Nodine, Petr Nohavica, Michael Nolan, Andrew Nolte, Mateusz +Nurczyński, Joseph Nwabueze, Kevin Nygaard, Thomas O'Keeffe, Kuba Ober, +Krzysztof Obłonczek, Danny Oler, Andreas Olofsson, Baltazar Ortiz, +Aleksander Osman, Don Owen, Tim Paine, Deepa Palaniappan, James Pallister, +Vassilis Papaefstathiou, Sanggyu Park, Brad Parker, Risto Pejašinović, Seth +Pellegrino, Joel Peltonen, Morten Borup Petersen, Dan Petrisko, Thanh Tung +Pham, Wesley Piard, Maciej Piechotka, David Pierce, Cody Piersall, +T. Platz, Michael Platzer, Dominic Plunkett, Nolan Poe, Tuomas Poikela, +George Polack, David Poole, Michael Popoloski, Roman Popov, Aylon Chaim +Porat, Oron Port, Rich Porter, Rick Porter, Stefan Post, Niranjan Prabhu, +Damien Pretet, Harald Pretl, Bill Pringlemeir, Usha Priyadharshini, Mark +Jackson Pulver, Prateek Puri, Nikolay Puzanov, Han Qi, Jiacheng Qian, +Marshal Qiao, Raynard Qiao, Yujia Qiao, Jasen Qin, Frank Qiu, Nandu Raj, +Kamil Rakoczy, Danilo Ramos, Drew Ranck, Chris Randall, Anton Rapp, Josh +Redford, Odd Magne Reitan, Frédéric Requin, Wajahat Riaz, Dustin Richmond, +Samuel Riedel, Alberto Del Rio, Eric Rippey, Narcis Rodas, Oleg Rodionov, +Ludwig Rogiers, Paul Rolfe, Michail Rontionov, Arjen Roodselaar, Arthur +Rosa, Tobias Rosenkranz, Yernagula Roshit, Diego Roux, Ryszard Rozak, Dan +Ruelas-Petrisko, Luca Rufer, Huang Rui, Graham Rushton, Jan Egil Ruud, +Denis Rystsov, Pawel Sagan, Robert Sammelson, Adrian Sampson, John +Sanguinetti, Josep Sans, Dave Sargeant, Luca Sasselli, Philippe Sauter, +Martin Scharrer, Parker Schless, Martin Schmidt, Jonathan Schröter, Julie Schwartz, Galen Seitz, Sam Shahrestani, Joseph Shaker, Mark Shaw, Salman -Sheikh, Zhou Shen, Hao Shi, James Shi, Michael Shinkarovsky, Rafael -Shirakawa, Jeffrey Short, S Shuba, Fan Shupei, Ethan Sifferman, Anderson -Ignacio da Silva, Rodney Sinclair, Ameya Vikram Singh, Sanjay Singh, Frans -Skarman, Nate Slager, Steven Slatter, Mladen Slijepcevic, Brian Small, -Garrett Smith, Gus Smith, Tim Snyder, Maciej Sobkowski, Stan Sokorac, Alex -Solomatnikov, Flavien Solt, Wei Song, Trefor Southwell, Martin Stadler, Art -Stamness, David Stanford, Krzysztof Starecki, Baruch Sterin, John -Stevenson, Pete Stevenson, Patrick Stewart, Rob Stoddard, Tood Strader, -John Stroebel, Ray Strouble, Sven Stucki, Howard Su, Udaya Raj Subedi, -Emerson Suguimoto, Gene Sullivan, Qingyao Sun, Renga Sundararajan, Kuba +Sheikh, Zhou Shen, Zhouyi Shen, Hao Shi, James Shi, Michael Shinkarovsky, +Rafael Shirakawa, Jeffrey Short, S Shuba, Fan Shupei, Ethan Sifferman, +Anderson Ignacio da Silva, Rodney Sinclair, Ameya Vikram Singh, Sanjay +Singh, Frans Skarman, Nate Slager, Steven Slatter, Mladen Slijepcevic, +Brian Small, Garrett Smith, Gus Smith, Rachel Smith, Tim Snyder, Maciej +Sobkowski, Stan Sokorac, Alex Solomatnikov, Flavien Solt, Wei Song, Trefor +Southwell, Martin Stadler, Art Stamness, David Stanford, Krzysztof +Starecki, Baruch Sterin, John Stevenson, Pete Stevenson, Patrick Stewart, +Rob Stoddard, Tood Strader, Jean-Nicolas Strauss, John Stroebel, Ray +Strouble, Matt Stroud, Sven Stucki, Howard Su, Udaya Raj Subedi, Emerson +Suguimoto, Gene Sullivan, Qingyao Sun, Renga Sundararajan, Kuba Sunderland-Ober, Gustav Svensk, Rupert Swarbrick, Jevin Sweval, Paul -Swirhun, Shinya T-Y, Thierry Tambe, Jesse Taube, Drew Taussig, Christopher -Taylor, Greg Taylor, Jose Tejada, Sören Tempel, Peter Tengstrand, Wesley +Swirhun, Krzysztof Sychla, Shinya T-Y, Yutetsu Takatsukasa, Thierry Tambe, +Jesse Taube, Drew Taussig, Christopher Taylor, David Taylor, Greg Taylor, +Michael Bedford Taylor, Jose Tejada, Sören Tempel, Peter Tengstrand, Wesley Terpstra, Rui Terra, Stefan Thiede, Justin Thiel, Gary Thomas, Ian -Thompson, Kevin Thompson, Mike Thyer, Hans Tichelaar, Tudor Timi, Viktor -Tomov, Steve Tong, Topa Topino, Àlex Torregrosa, Topa Tota, Michael -Tresidder, Lenny Truong, David Turner, Neil Turton, Hideto Ueno, Mike -Urbach, Joel Vandergriendt, Srini Vemuri, Srinivasan Venkataramanan, Yuri -Victorovich, Ivan Vnučec, Bogdan Vukobratovic, Holger Waechtler, Philipp -Wagner, Stefan Wallentowitz, Johannes Walter, CY Wang, Chuxuan Wang, Shawn -Wang, Yilou Wang, Zhanglei Wang, Greg Waters, Thomas Watts, Eugene Weber, -John Wehle, Tianrui Wei, David Welch, Thomas J Whatson, Martin Whitaker, -Marco Widmer, Leon Wildman, Daniel S. Wilkerson, Daniel Wilkerson, Gerald -Williams, Trevor Williams, Don Williamson, Jan Van Winkel, Jeff Winston, -Joshua Wise, Clifford Wolf, Johan Wouters, Paul Wright, Tobias Wölfel, -Junyi Xi, Ding Xiaoliang, Liu Xiaoyi, Jinyan Xu, Mandy Xu, Pengcheng Xu, -Shanshan Xu, Yan Xu, Yinan Xu, SU YANG, Felix Yan, Jiaxun Yang, Luke Yang, -Amir Yazdanbakhsh, Chentai (Seven) Yuan, Florian Zaruba, Mat Zeno, Keyi -Zhang, Xi Zhang, Huanghuang Zhou, Yike Zhou, Jiamin Zhu, Ryan Ziegler. +Thompson, Kevin Thompson, Mike Thyer, Jerry Tianchen, Hans Tichelaar, Tudor +Timi, Viktor Tomov, Steve Tong, Topa Topino, Àlex Torregrosa, Topa Tota, +Michael Tresidder, Lenny Truong, David Turner, Neil Turton, Hideto Ueno, +Ethan Uppal, Mike Urbach, Joel Vandergriendt, Srini Vemuri, Srinivasan +Venkataramanan, Yuri Victorovich, Ivan Vnučec, Andrew Voznytsa, Bogdan +Vukobratovic, Holger Waechtler, Justin Wagner, Philipp Wagner, Stefan +Wallentowitz, Johannes Walter, CY Wang, Chuxuan Wang, Shawn Wang, Yilou +Wang, Zhanglei Wang, Jakub Wasilewski, Paul Wasson, Greg Waters, Thomas +Watts, Eugene Weber, John Wehle, Tianrui Wei, Yin Weijie, David Welch, +Thomas J Whatson, Martin Whitaker, Marco Widmer, Leon Wildman, Daniel S. +Wilkerson, Daniel Wilkerson, Gerald Williams, Trevor Williams, Don +Williamson, Jan Van Winkel, Jeff Winston, Max Wipfli, Joshua Wise, Clifford +Wolf, Johan Wouters, Paul Wright, Tobias Wölfel, Domenic Wüthrich, Junyi +Xi, Ding Xiaoliang, Liu Xiaoyi, Jie Xu, Jinyan Xu, Mandy Xu, Pengcheng Xu, +Shanshan Xu, Yan Xu, Yinan Xu, Felix Yan, Zhen Yan, Jiaxun Yang, Luke Yang, +Su Yang, Amir Yazdanbakhsh, Law Heng Yi, Ibrahim Burak Yorulmaz, Chentai +(Seven) Yuan, Florian Zaruba, Igor Zaworski, Mat Zeno, Keyi Zhang, Xi +Zhang, Alex Zhou, Huanghuang Zhou, Yike Zhou, Jiamin Zhu, Ryan Ziegler, Lan +Zongwei. Thanks to them, and all those we've missed mentioning above, and to those whom have wished to remain anonymous. @@ -177,24 +203,24 @@ Historical Origins ================== Verilator was conceived in 1994 by Paul Wasson at the Core Logic Group at -Digital Equipment Corporation. The Verilog code that was converted to C -was then merged with a C-based CPU model of the Alpha processor and -simulated in a C-based environment called CCLI. +Digital Equipment Corporation. The Verilog code that was converted to C was +then merged with a C-based CPU model of the Alpha processor and simulated +in a C-based environment called CCLI. In 1995 Verilator started being used for Multimedia and Network Processor -development inside Digital. Duane Galbi took over the active development -of Verilator, and added several performance enhancements, and CCLI was -still being used as the shell. +development inside Digital. Duane Galbi took over the active development of +Verilator, and added several performance enhancements, and CCLI was still +being used as the shell. In 1998, through the efforts of existing DECies, mainly Duane Galbi, -Digital graciously agreed to release the source code. (Subject to the code +Digital graciously agreed to release the source code. (Subject to the code not being resold, which is compatible with the GNU Public License.) -In 2001, Wilson Snyder took the kit, added a SystemC mode, and called -it Verilator2. This was the first packaged public release. +In 2001, Wilson Snyder took the kit, added a SystemC mode, and called it +Verilator2. This was the first packaged public release. In 2002, Wilson Snyder created Verilator 3.000 by rewriting Verilator from -scratch in C++. This added many optimizations, yielding about a 2-5x +scratch in C++. This added many optimizations, yielding about a 2-5x performance gain. In 2009, major SystemVerilog and DPI language support was added. diff --git a/docs/guide/copyright.rst b/docs/guide/copyright.rst index e83fcc1ed..0268b6ab8 100644 --- a/docs/guide/copyright.rst +++ b/docs/guide/copyright.rst @@ -1,14 +1,13 @@ -.. Copyright 2003-2025 by Wilson Snyder. +.. Copyright 2003-2026 by Wilson Snyder. .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 ********* Copyright ********* -The latest version of Verilator is available from `https://verilator.org -`_. +The latest version of Verilator is available from https://verilator.org. -Copyright 2003-2025 by Wilson Snyder. This program is free software; you +Copyright 2003-2026 by Wilson Snyder. This program is free software; you can redistribute it and/or modify the Verilator internals under the terms of either the GNU Lesser General Public License Version 3 or the Perl Artistic License Version 2.0. diff --git a/docs/guide/deprecations.rst b/docs/guide/deprecations.rst index b8f573570..e053befa1 100644 --- a/docs/guide/deprecations.rst +++ b/docs/guide/deprecations.rst @@ -1,4 +1,4 @@ -.. Copyright 2003-2025 by Wilson Snyder. +.. Copyright 2003-2026 by Wilson Snyder. .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 Deprecations @@ -7,22 +7,23 @@ Deprecations The following deprecated items are scheduled for future removal: C++14 compiler support - Verilator currently requires a C++20 or newer compiler for timing, and a - C++14 or newer compiler for both compiling Verilator and compiling - Verilated models with --no-timing. + Verilator currently requires a C++20 or newer compiler for timing, and a + C++14 or newer compiler for both compiling Verilator and compiling + Verilated models with --no-timing. - Verilator will require C++20 or newer compilers for both compiling - Verilator and compiling all Verilated models no sooner than May 2025. - (Likely to be removed shortly after GitHub removes Ubuntu 20.04 - continuous-integration action runners, which are used to test the older - C++ standard). + Verilator will require C++20 or newer compilers for both compiling + Verilator and compiling all Verilated models no sooner than May 2025. + (Although this date has expired, this change is currently on hold until + the Ubuntu LTS versions of GCC and clang use C++20 by default, estimated + May 2028.) XML output - Verilator currently supports XML parser output (enabled with `--xml-only`). - Support for `--xml-*` options will be deprecated no sooner than January 2026. + Verilator currently supports XML parser output (enabled with + `--xml-only`). Support for `--xml-*` options will be deprecated no + sooner than January 2026. ---make cmake - The `--make cmake` options is deprecated and will be removed no sooner than - January 2026. Use `--make json` instead. Note that the CMake integration - shipping with Verilator (verilator-config.mk) already uses `--make json` so - no changes are necessary if using that. +`--make cmake` + The `--make cmake` options is deprecated and will be removed no sooner + than January 2026. Use `--make json` instead. Note that the CMake + integration shipping with Verilator (verilator-config.mk) already uses + `--make json` so no changes are necessary if using that. diff --git a/docs/guide/environment.rst b/docs/guide/environment.rst index f70d35763..35481e063 100644 --- a/docs/guide/environment.rst +++ b/docs/guide/environment.rst @@ -1,4 +1,4 @@ -.. Copyright 2003-2025 by Wilson Snyder. +.. Copyright 2003-2026 by Wilson Snyder. .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 Environment @@ -10,14 +10,14 @@ associated programs. .. option:: LD_LIBRARY_PATH A generic Linux/OS variable specifying what directories have shared - object (.so) files. This path should include SystemC and other - shared objects needed at simulation runtime. + object (.so) files. This path should include SystemC and other shared + objects needed at simulation runtime. .. option:: MAKE Names the executable of the make command invoked when using the - :vlopt:`--build` option. Some operating systems may require "gmake" to - this variable to launch GNU make. If this variable is not specified, + :vlopt:`--build` option. Some operating systems may require "gmake" to + this variable to launch GNU make. If this variable is not specified, "make" is used. .. option:: MAKEFLAGS @@ -29,33 +29,33 @@ associated programs. .. option:: OBJCACHE Optionally specifies a caching or distribution program to place in front - of all runs of the C++ compiler. For example, "ccache" or "sccache". If using - :command:`distcc` or :command:`icecc`/:command:`icecream`, they would - generally be run under :command:`ccache`; see the documentation for - those programs. If OBJCACHE is not set, and at configure time ccache + of all runs of the C++ compiler. For example, "ccache" or "sccache". If + using :command:`distcc` or :command:`icecc`/:command:`icecream`, they + would generally be run under :command:`ccache`; see the documentation + for those programs. If OBJCACHE is not set, and at configure time ccache was present, ccache will be used as a default. .. option:: SYSTEMC - Deprecated. Used only if :option:`SYSTEMC_INCLUDE` or - :option:`SYSTEMC_LIBDIR` is not set. If set, specifies the directory - containing the SystemC distribution. If not specified, it will come - from a default optionally specified at configure time (before Verilator - was compiled). + Deprecated. Used only if :option:`SYSTEMC_INCLUDE` or + :option:`SYSTEMC_LIBDIR` is not set. If set, specifies the directory + containing the SystemC distribution. If not specified, it will come from + a default optionally specified at configure time (before Verilator was + compiled). .. option:: SYSTEMC_ARCH - Deprecated. Used only if :option:`SYSTEMC_LIBDIR` is not set. - Specifies the architecture name used by the SystemC kit. This is the - part after the dash in the "lib-{...}" directory name created by a - :command:`make` in the SystemC distribution. If not set, Verilator will - try to intuit the proper setting, or use the default optionally - specified at configure time (before Verilator was compiled). + Deprecated. Used only if :option:`SYSTEMC_LIBDIR` is not set. Specifies + the architecture name used by the SystemC kit. This is the part after + the dash in the "lib-{...}" directory name created by a :command:`make` + in the SystemC distribution. If not set, Verilator will try to intuit + the proper setting, or use the default optionally specified at configure + time (before Verilator was compiled). .. option:: SYSTEMC_CXX_FLAGS Specifies additional flags that are required to be passed to GCC when - building the SystemC model. System 2.3.0 may need this set to + building the SystemC model. System 2.3.0 may need this set to "-pthread". .. option:: SYSTEMC_INCLUDE @@ -67,27 +67,27 @@ associated programs. .. option:: SYSTEMC_LIBDIR - If set, specifies the directory containing the libsystemc.a library. If + If set, specifies the directory containing the libsystemc.a library. If not specified, it will come from a default optionally specified at configure time (before Verilator was compiled), or computed from SYSTEMC/lib-SYSTEMC_ARCH. .. option:: VERILATOR_BIN - If set, specifies an alternative name of the ``verilator`` binary. May + If set, specifies an alternative name of the ``verilator`` binary. May be used for debugging and selecting between multiple operating system builds. .. option:: VERILATOR_COVERAGE_BIN If set, specifies an alternative name of the ``verilator_coverage`` - binary. May be used for debugging and selecting between multiple + binary. May be used for debugging and selecting between multiple operating system builds. .. option:: VERILATOR_GDB If set, the command to run when using the :vlopt:`--gdb` option, such as - "ddd". If not specified, it will use "gdb". + "ddd". If not specified, it will use "gdb". .. option:: VERILATOR_ROOT @@ -110,7 +110,7 @@ associated programs. If you are using a pre-compiled Verilator package, you should not need to set ``VERILATOR_ROOT`` - the value embedded in the binary should be - correct. In fact this option *does not work* with Verilator packages + correct. In fact this option *does not work* with Verilator packages that have been installed with ``make install``. If a Verilator package has been installed using ``./configure --prefix=/some/path && make install`` and then moved to another location, you cannot use @@ -121,13 +121,15 @@ associated programs. .. option:: VERILATOR_SOLVER If set, the command to run as a constrained randomization backend, such - as :command:`cvc4 --lang=smt2 --incremental`. If not specified, it will use - the one supplied or found during configure, or :command:`z3 --in` if empty. + as :command:`cvc4 --lang=smt2 --incremental`. If not specified, it will + use the one supplied or found during configure, or :command:`z3 --in` if + empty. .. option:: VERILATOR_VALGRIND - If set, the command to run when using the :vlopt:`--valgrind` option, such as - "valgrind --tool=callgrind". If not specified, it will use "valgrind". + If set, the command to run when using the :vlopt:`--valgrind` option, + such as "valgrind --tool=callgrind". If not specified, it will use + "valgrind". Make Variables @@ -146,7 +148,7 @@ set by passing them to make e.g. ``make CXX=my-gcc ...``. Optionally overrides the default compiler binary used by the Verilated makefiles. If CXX is not set, the version found at configure time is - used. Note the default flags passed to the compiler are determined at + used. Note the default flags passed to the compiler are determined at configuration time, so changing the CXX compiler version using this variable, as opposed to passing it at configuration time, may not give desired results. @@ -155,7 +157,7 @@ set by passing them to make e.g. ``make CXX=my-gcc ...``. Optionally overrides the default linker binary used by the Verilated makefiles. If LINK is not set, the version found at configure time is - used. Note the default flags passed to the linker are determined at + used. Note the default flags passed to the linker are determined at configuration time, so changing the LINK version using this variable, as opposed to passing it at configuration time, may not give desired results. diff --git a/docs/guide/example_binary.rst b/docs/guide/example_binary.rst index 3085d235d..ecca83049 100644 --- a/docs/guide/example_binary.rst +++ b/docs/guide/example_binary.rst @@ -1,14 +1,14 @@ -.. Copyright 2003-2025 by Wilson Snyder. +.. Copyright 2003-2026 by Wilson Snyder. .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 -.. _Example Create-Binary Execution: +.. _example create-binary execution: Example Create-Binary Execution =============================== -We'll compile this SystemVerilog example into a Verilated simulation binary. For -an example that discusses the next level of detail see :ref:`Example C++ -Execution`. +We'll compile this SystemVerilog example into a Verilated simulation +binary. For an example that discusses the next level of detail see +:ref:`Example C++ Execution`. .. include:: example_common_install.rst @@ -16,20 +16,20 @@ Now, let's create an example Verilog file: .. code-block:: bash - mkdir test_our - cd test_our + mkdir test_our + cd test_our - cat >our.v <<'EOF' - module our; - initial begin $display("Hello World"); $finish; end - endmodule - EOF + cat >our.v <<'EOF' + module our; + initial begin $display("Hello World"); $finish; end + endmodule + EOF Now we run Verilator on our little example. .. code-block:: bash - verilator --binary -j 0 -Wall our.v + verilator --binary -j 0 -Wall our.v Breaking this command down: @@ -39,8 +39,7 @@ Breaking this command down: #. :vlopt:`-j` `0` to Verilate using use as many CPU threads as the machine has. -#. :vlopt:`-Wall` so Verilator has stronger lint warnings - enabled. +#. :vlopt:`-Wall` so Verilator has stronger lint warnings enabled. #. An finally, :command:`our.v`, which is our SystemVerilog design file. @@ -48,16 +47,16 @@ And now we run it: .. code-block:: bash - obj_dir/Vour + obj_dir/Vour And we get as output: .. code-block:: bash - Hello World - - our.v:2: Verilog $finish + Hello World + - our.v:2: Verilog $finish You're better off using a Makefile to run the steps for you, so when your -source changes, it will automatically run all of the appropriate steps. To -aid this, Verilator can create a makefile dependency file. For examples +source changes, it will automatically run all of the appropriate steps. To +aid this, Verilator can create a makefile dependency file. For examples that do this, see the :file:`examples` directory in the distribution. diff --git a/docs/guide/example_cc.rst b/docs/guide/example_cc.rst index 2173e64e1..007645078 100644 --- a/docs/guide/example_cc.rst +++ b/docs/guide/example_cc.rst @@ -1,12 +1,12 @@ -.. Copyright 2003-2025 by Wilson Snyder. +.. Copyright 2003-2026 by Wilson Snyder. .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 -.. _Example C++ Execution: +.. _example c++ execution: Example C++ Execution ===================== -We'll compile this example into C++. For an extended and commented version +We'll compile this example into C++. For an extended and commented version of what this C++ code is doing, see :file:`examples/make_tracing_c/sim_main.cpp` in the distribution. @@ -16,34 +16,34 @@ Now, let's create an example Verilog and C++ wrapper file: .. code-block:: bash - mkdir test_our - cd test_our + mkdir test_our + cd test_our - cat >our.v <<'EOF' - module our; - initial begin $display("Hello World"); $finish; end - endmodule - EOF + cat >our.v <<'EOF' + module our; + initial begin $display("Hello World"); $finish; end + endmodule + EOF - cat >sim_main.cpp <<'EOF' - #include "Vour.h" - #include "verilated.h" - int main(int argc, char** argv) { - VerilatedContext* contextp = new VerilatedContext; - contextp->commandArgs(argc, argv); - Vour* top = new Vour{contextp}; - while (!contextp->gotFinish()) { top->eval(); } - delete top; - delete contextp; - return 0; - } - EOF + cat >sim_main.cpp <<'EOF' + #include "Vour.h" + #include "verilated.h" + int main(int argc, char** argv) { + VerilatedContext* contextp = new VerilatedContext; + contextp->commandArgs(argc, argv); + Vour* top = new Vour{contextp}; + while (!contextp->gotFinish()) { top->eval(); } + delete top; + delete contextp; + return 0; + } + EOF Now we run Verilator on our little example; .. code-block:: bash - verilator --cc --exe --build -j 0 -Wall sim_main.cpp our.v + verilator --cc --exe --build -j 0 -Wall sim_main.cpp our.v Breaking this command down: @@ -60,8 +60,7 @@ Breaking this command down: #. :vlopt:`-j 0 <-j>` to Verilate using use as many CPU threads as the machine has. -#. :vlopt:`-Wall` so Verilator has stronger lint warnings - enabled. +#. :vlopt:`-Wall` so Verilator has stronger lint warnings enabled. #. And finally, :command:`our.v` which is our SystemVerilog design file. @@ -70,7 +69,7 @@ Once Verilator completes we can see the generated C++ code under the .. code-block:: bash - ls -l obj_dir + ls -l obj_dir (See :ref:`Files Read/Written` for descriptions of some of the files that were created.) @@ -79,16 +78,16 @@ And now we run it: .. code-block:: bash - obj_dir/Vour + obj_dir/Vour And we get as output: .. code-block:: bash - Hello World - - our.v:2: Verilog $finish + Hello World + - our.v:2: Verilog $finish You're better off using a Makefile to run the steps for you, so when your -source changes, it will automatically run all of the appropriate steps. To -aid this, Verilator can create a makefile dependency file. For examples +source changes, it will automatically run all of the appropriate steps. To +aid this, Verilator can create a makefile dependency file. For examples that do this, see the :file:`examples` directory in the distribution. diff --git a/docs/guide/example_common_install.rst b/docs/guide/example_common_install.rst index ecf9f813b..a9bd788a8 100644 --- a/docs/guide/example_common_install.rst +++ b/docs/guide/example_common_install.rst @@ -1,16 +1,16 @@ -.. Copyright 2003-2025 by Wilson Snyder. +.. Copyright 2003-2026 by Wilson Snyder. .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 -First you need Verilator installed, see :ref:`Installation`. In brief, if +First you need Verilator installed, see :ref:`Installation`. In brief, if you installed Verilator using the package manager of your operating system, or did a :command:`make install` to place Verilator into your default path, you do not need anything special in your environment, and should not have -VERILATOR_ROOT set. However, if you installed Verilator from sources and +VERILATOR_ROOT set. However, if you installed Verilator from sources and want to run Verilator out of where you compiled Verilator, you need to point to the kit: .. code-block:: bash - # See above; don't do this if using an OS-distributed Verilator - export VERILATOR_ROOT=/path/to/where/verilator/was/installed - export PATH=$VERILATOR_ROOT/bin:$PATH + # See above; don't do this if using an OS-distributed Verilator + export VERILATOR_ROOT=/path/to/where/verilator/was/installed + export PATH=$VERILATOR_ROOT/bin:$PATH diff --git a/docs/guide/example_dist.rst b/docs/guide/example_dist.rst index cafb63c12..5a2aad40d 100644 --- a/docs/guide/example_dist.rst +++ b/docs/guide/example_dist.rst @@ -1,42 +1,52 @@ -.. Copyright 2003-2025 by Wilson Snyder. +.. Copyright 2003-2026 by Wilson Snyder. .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 -.. _Examples in the Distribution: +.. _examples in the distribution: Examples in the Distribution ============================ -See the ``examples/`` directory that is part of the distribution, and -is installed (in an OS-specific place, often in e.g. -``/usr/local/share/verilator/examples``). These examples include: +See the ``examples/`` directory that is part of the distribution, and is +installed (in an OS-specific place, often in e.g. +``/usr/local/share/verilator/examples``). These examples include: examples/make_hello_binary Example GNU-make simple Verilog->binary conversion + examples/make_hello_c Example GNU-make simple Verilog->C++ conversion + examples/make_hello_sc Example GNU-make simple Verilog->SystemC conversion + examples/make_tracing_c Example GNU-make Verilog->C++ with tracing + examples/make_tracing_sc Example GNU-make Verilog->SystemC with tracing + examples/make_protect_lib Example using --protect-lib + examples/cmake_hello_c Example building make_hello_c with CMake + examples/cmake_hello_sc Example building make_hello_sc with CMake + examples/cmake_tracing_c Example building make_tracing_c with CMake + examples/cmake_tracing_sc Example building make_tracing_sc with CMake + examples/cmake_protect_lib Example building make_protect_lib with CMake To run an example copy the example to a new directory and run it. -:: +.. code-block:: bash - cp -rp {path_to}/examples/make_hello_c make_hello_c - cd make_hello_c - make + cp -rp {path_to}/examples/make_hello_c make_hello_c + cd make_hello_c + make diff --git a/docs/guide/example_sc.rst b/docs/guide/example_sc.rst index c6e235785..4d236f582 100644 --- a/docs/guide/example_sc.rst +++ b/docs/guide/example_sc.rst @@ -1,7 +1,7 @@ -.. Copyright 2003-2025 by Wilson Snyder. +.. Copyright 2003-2026 by Wilson Snyder. .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 -.. _Example SystemC Execution: +.. _example systemc execution: Example SystemC Execution ========================= @@ -15,58 +15,58 @@ Now, let's create an example Verilog, and SystemC wrapper file: .. code-block:: bash - mkdir test_our_sc - cd test_our_sc + mkdir test_our_sc + cd test_our_sc - cat >our.v <<'EOF' - module our (clk); - input clk; // Clock is required to get initial activation - always @(posedge clk) - begin $display("Hello World"); $finish; end - endmodule - EOF + cat >our.v <<'EOF' + module our (clk); + input clk; // Clock is required to get initial activation + always @(posedge clk) + begin $display("Hello World"); $finish; end + endmodule + EOF - cat >sc_main.cpp <<'EOF' - #include "Vour.h" - using namespace sc_core; - int sc_main(int argc, char** argv) { - Verilated::commandArgs(argc, argv); - sc_clock clk{"clk", 10, SC_NS, 0.5, 3, SC_NS, true}; - Vour* top = new Vour{"top"}; - top->clk(clk); - while (!Verilated::gotFinish()) { sc_start(1, SC_NS); } - delete top; - return 0; - } - EOF + cat >sc_main.cpp <<'EOF' + #include "Vour.h" + using namespace sc_core; + int sc_main(int argc, char** argv) { + Verilated::commandArgs(argc, argv); + sc_clock clk{"clk", 10, SC_NS, 0.5, 3, SC_NS, true}; + Vour* top = new Vour{"top"}; + top->clk(clk); + while (!Verilated::gotFinish()) { sc_start(1, SC_NS); } + delete top; + return 0; + } + EOF Now we run Verilator on our little example: .. code-block:: bash - verilator --sc --exe -Wall sc_main.cpp our.v + verilator --sc --exe -Wall sc_main.cpp our.v This example does not use --build, therefore we need to explicitly compile it: .. code-block:: bash - make -j -C obj_dir -f Vour.mk Vour + make -j -C obj_dir -f Vour.mk Vour And now we run it: .. code-block:: bash - obj_dir/Vour + obj_dir/Vour And we get, after the SystemC banner, the same output as the C++ example: .. code-block:: bash - SystemC 2.3.3-Accellera + SystemC 2.3.3-Accellera - Hello World - - our.v:4: Verilog $finish + Hello World + - our.v:4: Verilog $finish Really, you're better off using a Makefile to run the steps for you so when your source changes it will automatically run all of the appropriate steps. diff --git a/docs/guide/examples.rst b/docs/guide/examples.rst index 7c27c6d5f..da378c313 100644 --- a/docs/guide/examples.rst +++ b/docs/guide/examples.rst @@ -1,7 +1,7 @@ -.. Copyright 2003-2025 by Wilson Snyder. +.. Copyright 2003-2026 by Wilson Snyder. .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 -.. _Examples: +.. _examples: ======== Examples diff --git a/docs/guide/exe_sim.rst b/docs/guide/exe_sim.rst index abe946acd..c8f686646 100644 --- a/docs/guide/exe_sim.rst +++ b/docs/guide/exe_sim.rst @@ -1,14 +1,14 @@ -.. Copyright 2003-2025 by Wilson Snyder. +.. Copyright 2003-2026 by Wilson Snyder. .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 -.. _Simulation Runtime Arguments: +.. _simulation runtime arguments: Simulation Runtime Arguments ============================ The following are the arguments that may be passed to a Verilated executable, provided that executable calls -:code:`VerilatedContext*->commandArgs(argc, argv)`. +``VerilatedContext*->commandArgs(argc, argv)``. All simulation runtime arguments begin with "+verilator", so that the user's executable may skip over all "+verilator" arguments when parsing its @@ -18,15 +18,16 @@ Summary: .. include:: ../_build/gen/args_verilated.rst +Options: .. option:: +verilator+coverage+file+ When a model was Verilated using :vlopt:`--coverage`, sets the filename - to write coverage data into. Defaults to :file:`coverage.dat`. + to write coverage data into. Defaults to :file:`coverage.dat`. .. option:: +verilator+debug - Enable simulation runtime debugging. Equivalent to + Enable simulation runtime debugging. Equivalent to :vlopt:`+verilator+debugi+4 <+verilator+debugi+\>`. To be useful, the model typically must first be compiled with debug @@ -50,12 +51,12 @@ Summary: .. option:: +verilator+noassert Disable assert checking per runtime argument. This is the same as - calling :code:`VerilatedContext*->assertOn(false)` in the model. + calling ``VerilatedContext*->assertOn(false)`` in the model. .. option:: +verilator+prof+exec+file+ When a model was Verilated using :vlopt:`--prof-exec`, sets the - simulation runtime filename to dump to. Defaults to + simulation runtime filename to dump to. Defaults to :file:`profile_exec.dat`. .. option:: +verilator+prof+exec+start+ @@ -72,9 +73,9 @@ Summary: When a model was Verilated using :vlopt:`--prof-exec`, after $time reaches :vlopt:`+verilator+prof+exec+start+\`, Verilator will warm up the profiling for this number of eval() calls, then will capture - the profiling of this number of eval() calls. Defaults to 2, which - makes sense for a single-clock-domain module where it's typical to want - to capture one posedge eval() and one negedge eval(). + the profiling of this number of eval() calls. Defaults to 2, which makes + sense for a single-clock-domain module where it's typical to want to + capture one posedge eval() and one negedge eval(). .. option:: +verilator+prof+threads+file+ @@ -94,7 +95,7 @@ Summary: .. option:: +verilator+prof+vlt+file+ When a model was Verilated using :vlopt:`--prof-pgo`, sets the - profile-guided optimization data runtime filename to dump to. Defaults + profile-guided optimization data runtime filename to dump to. Defaults to :file:`profile.vlt`. .. option:: +verilator+quiet @@ -104,15 +105,15 @@ Summary: .. option:: +verilator+rand+reset+ - When a model was Verilated using - :vlopt:`--x-initial unique <--x-initial>`, sets the simulation runtime - initialization technique. 0 = Reset to zeros. 1 = Reset to all-ones. 2 - = Randomize. See :ref:`Unknown States`. + When a model was Verilated using :vlopt:`--x-initial unique + <--x-initial>`, sets the simulation runtime initialization technique. 0 + = Reset to zeros. 1 = Reset to all-ones. 2 = Randomize. See + :ref:`Unknown States`. .. option:: +verilator+seed+ For $random and :vlopt:`--x-initial unique <--x-initial>`, set the - simulation runtime random seed value. If zero or not specified picks a + simulation runtime random seed value. If zero or not specified picks a value from the system random number generator. .. option:: +verilator+V diff --git a/docs/guide/exe_verilator.rst b/docs/guide/exe_verilator.rst index 2f11d50cb..b5e9a0edd 100644 --- a/docs/guide/exe_verilator.rst +++ b/docs/guide/exe_verilator.rst @@ -1,4 +1,4 @@ -.. Copyright 2003-2025 by Wilson Snyder. +.. Copyright 2003-2026 by Wilson Snyder. .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 =================== @@ -21,18 +21,18 @@ Summary: the appropriate directory to your makefile's VPATH to find the file. If any files are specified in this way, Verilator will include a make - rule that uses these files when linking the module's executable. This + rule that uses these files when linking the module's executable. This generally is only useful when used with the :vlopt:`--exe` option. .. option:: Used with :vlopt:`--exe` to specify optional C++ files to be linked in - with the Verilog code. The file path should either be absolute, or + with the Verilog code. The file path should either be absolute, or relative to where the make will be executed from, or add to your makefile's VPATH the appropriate directory to find the file. See also :vlopt:`-CFLAGS` and :vlopt:`-LDFLAGS` options, which are - useful when the C++ files need special compiler flags. The compiler + useful when the C++ files need special compiler flags. The compiler flags add by default `-DVERILATOR=1`, so an `#ifdef VERILATOR` may be used to conditionally preprocess .cpp code for different simulators. @@ -83,7 +83,7 @@ Summary: ```begin_keywords`` is a SystemVerilog construct, which specifies *only* the set of keywords to be recognized. This also controls some - error messages that vary between language standards. At present, + error messages that vary between language standards. At present, Verilator tends to be overly permissive, e.g., it will accept many grammar and other semantic extensions which might not be legal when set to an older standard. @@ -94,8 +94,8 @@ Summary: Rarely needed - for developer use. With `--aslr`, do not change the system default as to using Linux address space layout randomization - (ASLR). With `--no-aslr` attempt to disable ASLR. If not specified, - ASLR will be disabled only when using :vlopt:`--debug` (or similar + (ASLR). With `--no-aslr` attempt to disable ASLR. If not specified, ASLR + will be disabled only when using :vlopt:`--debug` (or similar debug-related options), so that pointers have more deterministic values, aiding repeatability. @@ -115,18 +115,18 @@ Summary: .. option:: --autoflush - After every $display or $fdisplay, flush the output stream. This - ensures that messages will appear immediately but may reduce - performance. For best performance, call :code:`fflush(stdout)` - occasionally in the C++ main loop. Defaults to off, which will buffer - output as provided by the normal C/C++ standard library IO. + After every $display or $fdisplay, flush the output stream. This ensures + that messages will appear immediately but may reduce performance. For + best performance, call ``fflush(stdout)`` occasionally in the C++ main + loop. Defaults to off, which will buffer output as provided by the + normal C/C++ standard library IO. .. option:: --bbox-sys - Black box any unknown $system task or function calls. System tasks will + Black box any unknown $system task or function calls. System tasks will become no-operations, and system functions will be replaced with unsized - zero. Arguments to such functions will be parsed, but not otherwise - checked. This prevents errors when linting in the presence of + zero. Arguments to such functions will be parsed, but not otherwise + checked. This prevents errors when linting in the presence of company-specific PLI calls. Using this argument will likely cause incorrect simulation. @@ -135,14 +135,14 @@ Summary: Black box some unsupported language features, currently UDP tables, the cmos and tran gate primitives, deassign statements, and mixed edge - errors. This may enable linting of the rest of the design even when + errors. This may enable linting of the rest of the design even when unsupported constructs are present. Using this argument will likely cause incorrect simulation. .. option:: --binary - Create a Verilated simulator binary. Alias for :vlopt:`--main` + Create a Verilated simulator binary. Alias for :vlopt:`--main` :vlopt:`--exe` :vlopt:`--build` :vlopt:`--timing`. See also :vlopt:`-j`. @@ -151,28 +151,29 @@ Summary: After generating the SystemC/C++ code, Verilator will invoke the toolchain to build the model library (and executable when :vlopt:`--exe` - is also used). Verilator manages the build itself, and for this --build + is also used). Verilator manages the build itself, and for this --build requires GNU Make to be available on the platform. :vlopt:`--build` cannot be specified when using :vlopt:`-E`, - :vlopt:`--dpi-hdr-only`, :vlopt:`--lint-only`, or :vlopt:`--xml-only`. + :vlopt:`--dpi-hdr-only`, :vlopt:`--json-only` or :vlopt:`--lint-only`. .. option:: --build-dep-bin - Rarely needed. When a dependency (.d) file is created, this filename + Rarely needed. When a dependency (.d) file is created, this filename will become a source dependency, such that a change in this binary will - have ``make`` rebuild the output files. Defaults to the full path to - the Verilator binary. + have ``make`` rebuild the output files. Defaults to the full path to the + Verilator binary. This option was named `--bin` before version 4.228. .. option:: --build-jobs - Specify the level of parallelism for :vlopt:`--build`. If zero, uses the - number of threads available to the process, which is the number of threads - assigned by processor affinity (e.g. using `numactl`), or the number of - threads in the host hardware if unspecified. Otherwise, the must be - a positive integer specifying the maximum number of parallel build jobs. + Specify the level of parallelism for :vlopt:`--build`. If zero, uses the + number of threads available to the process, which is the number of + threads assigned by processor affinity (e.g. using `numactl`), or the + number of threads in the host hardware if unspecified. Otherwise, the + must be a positive integer specifying the maximum number of + parallel build jobs. If not provided, and :vlopt:`-j` is provided, the :vlopt:`-j` value is used. @@ -207,7 +208,7 @@ Summary: With :vlopt:`--clk`, the specified signal is marked as a clock signal. The provided signal name is specified using a RTL hierarchy path. For - example, v.foo.bar. If the signal is the input to the top-module, then + example, v.foo.bar. If the signal is the input to the top-module, then directly provide the signal name. Alternatively, use a :option:`/*verilator&32;clocker*/` metacomment in RTL file to mark the signal directly. @@ -233,26 +234,26 @@ Summary: .. option:: --compiler - Enables workarounds for the specified C++ compiler (list below). This + Enables workarounds for the specified C++ compiler (list below). This does not change any performance tuning options, but it may in the - future. This also does not change default compiler flags; these are + future. This also does not change default compiler flags; these are determined when Verilator was configured. clang - Tune for clang. This may reduce execution speed as it enables several - workarounds to avoid silly hard-coded limits in clang. This includes + Tune for clang. This may reduce execution speed as it enables several + workarounds to avoid silly hard-coded limits in clang. This includes breaking deep structures as for msvc, as described below. gcc Tune for GNU C++, although generated code should work on almost any - compliant C++ compiler. Currently, the default. + compliant C++ compiler. Currently, the default. msvc - Tune for Microsoft Visual C++. This may reduce execution speed as it + Tune for Microsoft Visual C++. This may reduce execution speed as it enables several workarounds to avoid silly hard-coded limits in - MSVC++. This includes breaking deeply nested parenthesized - expressions into sub-expressions to avoid error C1009, and breaking - deep blocks into functions to avoid error C1061. + MSVC++. This includes breaking deeply nested parenthesized expressions + into sub-expressions to avoid error C1009, and breaking deep blocks + into functions to avoid error C1061. .. option:: --compiler-include @@ -263,8 +264,8 @@ Summary: .. option:: --converge-limit - Rarely needed. Specifies the maximum number of runtime iterations - before creating a model failed to converge error. Defaults to 100. + Rarely needed. Specifies the maximum number of runtime iterations before + creating a model failed to converge error. Defaults to 100. .. option:: --coverage @@ -277,8 +278,8 @@ Summary: .. option:: --coverage-expr-max - Rarely needed. Specifies the maximum number of permutations able to be - covered for a given expression. Defaults to 32. Increasing may slow + Rarely needed. Specifies the maximum number of permutations able to be + covered for a given expression. Defaults to 32. Increasing may slow coverage simulations and make analyzing the results unwieldy. .. option:: --coverage-line @@ -287,38 +288,40 @@ Summary: .. option:: --coverage-max-width - Rarely needed. Specify the maximum bit width of a signal - subject to toggle coverage. Defaults to 256, as covering large vectors - may greatly slow coverage simulations. + Rarely needed. Specify the maximum bit width of a signal subject to + toggle coverage. Defaults to 256, as covering large vectors may greatly + slow coverage simulations. .. option:: --coverage-toggle - Enables adding signal toggle coverage. See :ref:`Toggle Coverage`. + Enables adding signal toggle coverage. See :ref:`Toggle Coverage`. .. option:: --coverage-underscore Enable coverage of signals that start with an underscore. Normally, - these signals are not covered. See also :vlopt:`--trace-underscore` + these signals are not covered. See also :vlopt:`--trace-underscore` option. .. option:: --coverage-user - Enables adding user-inserted functional coverage. See :ref:`User Coverage`. + Enables adding user-inserted functional coverage. See :ref:`User + Coverage`. .. option:: -D= - Defines the given preprocessor symbol. Similar to + Defines the given preprocessor symbol. Similar to :vlopt:`+define <+define+>`, but does not allow multiple - definitions with a single option using plus signs. "+define" is relatively - standard across Verilog tools, while "-D" is similar to + definitions with a single option using plus signs. ``+define`` is + relatively standard across Verilog tools, while ``-D`` is similar to :command:`gcc -D`. .. option:: --debug Run under debug. - * Select the debug executable of Verilator (if available). This - generally is a less-optimized binary with symbols present (so GDB can be used on it). + * Select the debug executable of Verilator (if available). This + generally is a less-optimized binary with symbols present (so GDB can + be used on it). * Enable debugging messages (equivalent to :vlopt:`--debugi 3 <--debugi>`). * Enable internal assertions (equivalent to :vlopt:`--debug-check`). * Enable intermediate form dump files (equivalent to @@ -330,8 +333,8 @@ Summary: .. option:: --debug-check - Rarely needed. Enable internal debugging assertion checks, without - changing debug verbosity. Enabled automatically with :vlopt:`--debug` + Rarely needed. Enable internal debugging assertion checks, without + changing debug verbosity. Enabled automatically with :vlopt:`--debug` option. .. option:: --no-debug-leak @@ -348,16 +351,16 @@ Summary: .. option:: --debugi - Rarely needed - for developer use. Set the internal debugging level + Rarely needed - for developer use. Set the internal debugging level globally to the specified debug level (1-10). Higher levels produce more detailed messages. .. option:: --debugi- - Rarely needed - for developer use. Set the specified Verilator source + Rarely needed - for developer use. Set the specified Verilator source file to the specified level (e.g., :vlopt:`--debugi-V3Width 9 <--debugi>`). Higher levels produce more - detailed messages. See :vlopt:`--debug` for other implications of + detailed messages. See :vlopt:`--debug` for other implications of enabling debug. .. option:: --no-decoration @@ -373,7 +376,7 @@ Summary: Minimize comments, white space, symbol names, and other decorative items, at the cost of reduced readability. This may assist C++ compile times. This will not typically change the ultimate model's - performance, but may in some cases. See also :vlopt:`--no-decoration` + performance, but may in some cases. See also :vlopt:`--no-decoration` option. With "--decorations medium", @@ -384,19 +387,19 @@ Summary: Include comments indicating what caused generation of the following text, including what node pointer (corresponding to :vlopt:`--dump-tree` .tree printed data), and the source Verilog - filename and line number. If subsequent following statements etc have - the same filename/line number these comments are omitted. This - enables easy debug when looking at the C++ code to determine what - Verilog source may be related. As node pointers are not stable - between different Verilator runs, this may harm compile caching and - should only be used for debug. + filename and line number. If subsequent following statements etc have + the same filename/line number these comments are omitted. This enables + easy debug when looking at the C++ code to determine what Verilog + source may be related. As node pointers are not stable between + different Verilator runs, this may harm compile caching and should + only be used for debug. .. option:: --default-language - Select the language used by default when first processing each - Verilog file. The language value must be "VAMS", "1364-1995", - "1364-2001", "1364-2001-noconfig", "1364-2005", "1800-2005", - "1800-2009", "1800-2012", "1800-2017", "1800-2023", or "1800+VAMS". + Select the language used by default when first processing each Verilog + file. The language value must be "VAMS", "1364-1995", "1364-2001", + "1364-2001-noconfig", "1364-2005", "1800-2005", "1800-2009", + "1800-2012", "1800-2017", "1800-2023", or "1800+VAMS". Any language associated with a particular file extension (see the various +*\ ext+ options) will be used in preference to the @@ -405,7 +408,7 @@ Summary: The :vlopt:`--default-language` is only recommended for legacy code using the same language in all source files, as the preferable option is to edit the code to repair new keywords, or add appropriate - :code:`\`begin_keywords`. For legacy mixed-language designs, the various + ``\`begin_keywords``. For legacy mixed-language designs, the various ``+ext+`` options should be used. If no language is specified, either by this option or ``+ext+`` @@ -417,7 +420,7 @@ Summary: .. option:: +define+=[+=][...] Defines the given preprocessor symbol, or multiple symbols if separated - by plus signs. Similar to :vlopt:`-D <-D>`; +define is relatively + by plus signs. Similar to :vlopt:`-D <-D>`; +define is relatively standard across Verilog tools while :vlopt:`-D <-D>` is similar to :command:`gcc -D`. @@ -425,7 +428,7 @@ Summary: Enables diagnostics output into a Static Analysis Results Interchange Format (SARIF) file, a standard, JSON-based format for the output of - static analysis tools such as linters. See + static analysis tools such as linters. See [SARIF](https://sarifweb.azurewebsites.net/), [sarif-tools](https://github.com/microsoft/sarif-tools), and the [SARIF web-based viewer](https://microsoft.github.io/sarif-web-component/). @@ -433,13 +436,13 @@ Summary: .. option:: --diagnostics-sarif-output Specifies the filename for the SARIF output file (`.sarif`) of - :vlopt:`--diagnostics-sarif`. Using this option automatically sets - :vlopt:`--diagnostics-sarif`. If not specified, output defaults to + :vlopt:`--diagnostics-sarif`. Using this option automatically sets + :vlopt:`--diagnostics-sarif`. If not specified, output defaults to :file:`.sarif`. .. option:: --dpi-hdr-only - Only generate the DPI header file. This option does not affect on the + Only generate the DPI header file. This option does not affect on the name or location of the emitted DPI header file, it is output in :vlopt:`--Mdir` as it would be without this option. @@ -461,82 +464,82 @@ Summary: .. option:: --dump-dfg - Rarely needed. Enable dumping DfgGraph .dot debug files with dumping + Rarely needed. Enable dumping DfgGraph .dot debug files with dumping level 3. .. option:: --dump-graph - Rarely needed. Enable dumping V3Graph .dot debug files with dumping - level 3. Before Verilator 4.228, :vlopt:`--dump-tree` used - to include this option. + Rarely needed. Enable dumping V3Graph .dot debug files with dumping + level 3. Before Verilator 4.228, :vlopt:`--dump-tree` used to include + this option. .. option:: --dump-inputs - Rarely needed. Enable dumping a *{prefix}*\ __inputs\ .vpp file which + Rarely needed. Enable dumping a *{prefix}*\ __inputs\ .vpp file which has all of the individual input files combined and pre-processed .. option:: --dump-tree - Rarely needed. Enable dumping Ast .tree debug files with dumping level 3, - which dumps the standard critical stages. For details on the format, see - the Verilator Internals manual. :vlopt:`--dump-tree` is enabled - automatically with :vlopt:`--debug`, so - :vlopt:`--debug --no-dump-tree <--dump-tree>` may be useful if the dump - files are large and not desired. + Rarely needed. Enable dumping Ast .tree debug files with dumping level + 3, which dumps the standard critical stages. For details on the format, + see the Verilator Internals manual. :vlopt:`--dump-tree` is enabled + automatically with :vlopt:`--debug`, so :vlopt:`--debug --no-dump-tree + <--dump-tree>` may be useful if the dump files are large and not + desired. .. option:: --dump-tree-addrids - Rarely needed - for developer use. Replace AST node addresses with - short identifiers in tree dumps to enhance readability. Each unique - pointer value is mapped to a unique identifier, but note that this is - not necessarily unique per node instance as an address might get reused - by a newly allocated node after a node with the same address has been - dumped and then freed. + Rarely needed - for developer use. Replace AST node addresses with short + identifiers in tree dumps to enhance readability. Each unique pointer + value is mapped to a unique identifier, but note that this is not + necessarily unique per node instance as an address might get reused by a + newly allocated node after a node with the same address has been dumped + and then freed. .. option:: --dump-tree-dot - Rarely needed - for developer use. Enable dumping Ast .tree.dot debug + Rarely needed - for developer use. Enable dumping Ast .tree.dot debug files in Graphviz Dot format. This option implies :vlopt:`--dump-tree`, unless :vlopt:`--dumpi-tree` was passed explicitly. .. option:: --dump-tree-json - Rarely needed. Enable dumping Ast .json.tree debug files with dumping level 3, - which dumps the standard critical stages. For details on the format, see - the Verilator Internals manual. + Rarely needed. Enable dumping Ast .json.tree debug files with dumping + level 3, which dumps the standard critical stages. For details on the + format, see the Verilator Internals manual. .. option:: --dumpi- Rarely needed - for developer use. Set the dumping level in the specified Verilator source file to the specified value (e.g., - `--dumpi-V3Order 9`). Level 0 disables dumps and is equivalent to - `--no-dump-`. Level 9 enables the dumping of everything. + `--dumpi-V3Order 9`). Level 0 disables dumps and is equivalent to + `--no-dump-`. Level 9 enables the dumping of everything. .. option:: --dumpi-dfg - Rarely needed - for developer use. Set the internal DfgGraph dumping level - globally to the specified value. + Rarely needed - for developer use. Set the internal DfgGraph dumping + level globally to the specified value. .. option:: --dumpi-graph - Rarely needed - for developer use. Set internal V3Graph dumping level + Rarely needed - for developer use. Set internal V3Graph dumping level globally to the specified value. .. option:: --dumpi-tree - Rarely needed - for developer use. Set internal Ast dumping level + Rarely needed - for developer use. Set internal Ast dumping level globally to the specified value. .. option:: --dumpi-tree-json - Rarely needed - for developer use. Set internal Ast JSON dumping level + Rarely needed - for developer use. Set internal Ast JSON dumping level globally to the specified value. .. option:: -E Preprocess the source code, but do not compile, similar to C++ - preprocessing using :command:`gcc -E`. Output is written to standard - out. Beware of enabling debugging messages, as they will also go to + preprocessing using :command:`gcc -E`. Output is written to standard + out. Beware of enabling debugging messages, as they will also go to standard out. See :vlopt:`--no-std`, which is implied by this. See also :vlopt:`--dump-defines`, :vlopt:`-P`, @@ -551,43 +554,42 @@ Summary: .. option:: --error-limit After this number of errors are encountered during Verilator run, exit. - Warnings are not counted in this limit. Defaults to 50. + Warnings are not counted in this limit. Defaults to 50. It does not affect simulation runtime errors, for those, see :vlopt:`+verilator+error+limit+\`. .. option:: --exe - Generate an executable. You will also need to pass additional .cpp - files on the command line that implement the main loop for your - simulation. + Generate an executable. You will also need to pass additional .cpp files + on the command line that implement the main loop for your simulation. .. option:: --expand-limit - Rarely needed. Fine-tune optimizations to set the maximum size of an + Rarely needed. Fine-tune optimizations to set the maximum size of an expression in 32-bit words to expand into separate word-based statements. .. option:: -F Read the specified file, and act as if all text inside it was specified - as command line arguments. Any relative paths are relative to the - directory containing the specified file. See also :vlopt:`-f` - option. Note :option:`-F` is relatively standard across Verilog tools. + as command line arguments. Any relative paths are relative to the + directory containing the specified file. See also :vlopt:`-f` option. + Note :option:`-F` is relatively standard across Verilog tools. .. option:: -f Read the specified file, and act as if all text inside it was specified - as command line arguments. Any relative paths are relative to the - current directory. See also :vlopt:`-F` option. Note :option:`-f` is + as command line arguments. Any relative paths are relative to the + current directory. See also :vlopt:`-F` option. Note :option:`-f` is relatively standard across Verilog tools. - The file may contain :code:`//` comments which are ignored until the end of - the line. It may also contain :code:`/* .. */` comments which are - ignored, be cautious that wildcards are not handled in -f files, and - that :code:`directory/*` is the beginning of a comment, not a wildcard. - Any :code:`$VAR`, :code:`$(VAR)`, or :code:`${VAR}` will be replaced - with the specified environment variable. + The file may contain ``//`` comments which are ignored until the end of + the line. It may also contain ``/* .. */`` comments which are ignored, + be cautious that wildcards are not handled in -f files, and that + ``directory/*`` is the beginning of a comment, not a wildcard. Any + ``$VAR``, ``$(VAR)``, or ``${VAR}`` will be replaced with the specified + environment variable. .. option:: -fdfg-synthesize-all @@ -595,17 +597,16 @@ Summary: .. option:: -FI - Force include of the specified C++ header file. All generated C++ files - will insert a #include of the specified file before any other - includes. The specified file might be used to contain define prototypes - of custom :code:`VL_VPRINTF` functions, and may need to include - :file:`verilatedos.h` as this file is included before any other standard - includes. + Force include of the specified C++ header file. All generated C++ files + will insert a #include of the specified file before any other includes. + The specified file might be used to contain define prototypes of custom + ``VL_VPRINTF`` functions, and may need to include :file:`verilatedos.h` + as this file is included before any other standard includes. .. option:: --flatten Force flattening of the design's hierarchy, with all modules, tasks, and - functions inlined. Typically used with :vlopt:`--xml-only`. + functions inlined. Typically used with :vlopt:`--json-only`. Flattening large designs may require significant CPU time, memory and storage. @@ -638,7 +639,7 @@ Summary: .. option:: -fno-dfg Rarely needed. Disable all use of the DFG-based combinational logic - optimizer. Alias for :vlopt:`-fno-dfg-pre-inline`, + optimizer. Alias for :vlopt:`-fno-dfg-pre-inline`, :vlopt:`-fno-dfg-post-inline` and :vlopt:`-fno-dfg-scoped`. .. option:: -fno-dfg-break-cycles @@ -683,6 +684,8 @@ Summary: .. option:: -fno-inline-funcs +.. option:: -fno-inline-funcs-eager + .. option:: -fno-life .. option:: -fno-life-post @@ -719,29 +722,32 @@ Summary: automatically. Variables explicitly annotated with :option:`/*verilator&32;split_var*/` are still split. +.. option:: --fslice-element-limit + + Rarely needed. Set the maximum array size (number of elements) for slice + optimization to avoid excessive memory usage. + .. option:: -future0