Compare commits

..
37 Commits
Author SHA1 Message Date
Wilson Snyder 57c816f906 Merge from master for release. (update) 2023-09-16 21:44:39 -04:00
Wilson Snyder 82e1dbe162 Merge from master for release. 2023-09-16 20:43:53 -04:00
Wilson Snyder e6b0bdd4df Merge from master for release. 2023-08-06 14:17:13 -04:00
Wilson Snyder 4f13c4d1bb Merge from master for release. 2023-06-13 19:37:22 -04:00
Wilson Snyder c37ec19751 Merge from master for release. 2023-04-30 07:09:22 -04:00
Wilson Snyder aaaf8e75af Merge from master for release. 2023-03-04 11:29:11 -05:00
Wilson Snyder 8cc31c6cf1 Merge from master for release. 2023-01-22 11:52:52 -05:00
Wilson Snyder 8468af1a20 Merge from master for release. 2022-12-14 22:07:37 -05:00
Wilson Snyder db39d70c75 Merge from master for release. 2022-10-29 17:52:23 -04:00
Wilson Snyder 04fff7ebd8 Merge from master for release. 2022-10-01 08:33:50 -04:00
Wilson Snyder b154af87a1 Merge from master for release. 2022-08-31 19:47:07 -04:00
Wilson Snyder 8b7480806a Merge from master for release. 2022-06-19 15:11:19 -04:00
Wilson Snyder e29f5ad559 Merge from master for release. 2022-06-19 15:08:17 -04:00
Wilson Snyder 4618fd5a43 Merge from master for release. 2022-05-02 22:22:20 -04:00
Wilson Snyder ed979c6aa1 Merge from master for release. 2022-03-12 13:14:48 -05:00
Wilson Snyder 141c5da3f9 Merge from master for release. 2021-12-05 11:15:32 -05:00
Wilson Snyder 0185ee5df3 Merge from master for release. 2021-10-17 14:46:03 -04:00
Wilson Snyder 27c08a65e1 Merge from master for release. 2021-09-01 21:02:51 -04:00
Wilson Snyder de408a5eb7 Merge from master for release. 2021-07-07 20:48:51 -04:00
Wilson Snyder fa3c072dd1 Merge from master for release. 2021-06-12 13:01:37 -04:00
Wilson Snyder aac4b7090a Merge from master for release. 2021-04-24 10:40:13 -04:00
Wilson Snyder f0d664530d Merge from master for release. 2021-03-12 15:48:45 -05:00
Wilson Snyder 702140bf93 Merge from master for release. 2021-02-25 21:49:42 -05:00
Wilson Snyder 2075db3db0 Merge from master for release. 2021-01-10 13:35:45 -05:00
Wilson Snyder b7fec513cf Merge from master for release. 2020-12-02 20:13:31 -05:00
Wilson Snyder 78e7758022 Merge from master for release. 2020-11-14 09:58:28 -05:00
Wilson Snyder 818318ddd5 Merge from master for release. 2020-10-15 08:25:44 -04:00
Wilson Snyder 39eea781bc Merge from master for release. 2020-09-07 09:38:50 -04:00
Wilson Snyder c4f7bd6a04 'Merge from master for release.' 2020-08-15 09:18:29 -04:00
Wilson Snyder dd03d0f3c9 'Merge from master for release.' 2020-07-11 09:16:56 -04:00
Wilson Snyder 369ce6af2c 'Merge from master for release.' 2020-06-06 07:49:57 -04:00
Wilson Snyder f83817510d 'Merge from master for release.' 2020-05-03 11:15:21 -04:00
Wilson Snyder bfcd779cfb 'Merge from master for release.' 2020-04-04 08:50:02 -04:00
Wilson Snyder e69c380205 'Merge from master for release.' 2020-03-08 08:39:29 -04:00
Wilson Snyder 61e14aa827 'Merge from master for release.' 2020-02-08 09:15:27 -05:00
Wilson Snyder 0c6c83e278 Merge from master for release. 2020-01-11 07:12:09 -05:00
Wilson Snyder 6f52208b68 Fix clang warning. 2019-12-09 18:28:56 -05:00
6916 changed files with 193034 additions and 263454 deletions
-5
View File
@@ -63,8 +63,6 @@ ForEachMacros:
SortIncludes: true SortIncludes: true
IncludeBlocks: Regroup IncludeBlocks: Regroup
IncludeCategories: IncludeCategories:
- Regex: '"V3Pch.*\.h"'
Priority: -2 # Precompiled headers
- Regex: '"(config_build|verilated_config|verilatedos)\.h"' - Regex: '"(config_build|verilated_config|verilatedos)\.h"'
Priority: -1 # Sepecials before main header Priority: -1 # Sepecials before main header
- Regex: '(<|")verilated.*' - Regex: '(<|")verilated.*'
@@ -114,9 +112,6 @@ SpacesBeforeTrailingComments: 2
SpacesInAngles: false SpacesInAngles: false
SpacesInContainerLiterals: true SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false SpacesInCStyleCastParentheses: false
SpacesInLineCommentPrefix:
Minimum: 0
Maximum: -1
SpacesInParentheses: false SpacesInParentheses: false
SpacesInSquareBrackets: false SpacesInSquareBrackets: false
Standard: Cpp11 Standard: Cpp11
+1 -1
View File
@@ -1,4 +1,4 @@
Checks: '*,-hicpp*,-android-cloexec-fopen,-cert-dcl50-cpp,-cert-env33-c,-cert-err34-c,-cert-err58-cpp,-clang-analyzer-core.UndefinedBinaryOperatorResult,-clang-analyzer-security*,-cppcoreguidelines-avoid-magic-numbers,-cppcoreguidelines-no-malloc,-cppcoreguidelines-owning-memory,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-pro-bounds-constant-array-index,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-pro-type-const-cast,-cppcoreguidelines-pro-type-reinterpret-cast,-cppcoreguidelines-pro-type-static-cast-downcast,-cppcoreguidelines-pro-type-union-access,-cppcoreguidelines-pro-type-vararg,-cppcoreguidelines-special-member-functions,-fuchsia-*,-google-default-arguments,-google-readability-todo,-google-runtime-references,-llvm-header-guard,-llvm-include-order,-misc-string-integer-assignment,-misc-string-literal-with-embedded-nul,-modernize-use-auto,-modernize-use-trailing-return-type,-readability-braces-around-statements,-readability-container-size-empty,-readability-delete-null-pointer,-readability-else-after-return,-readability-implicit-bool-conversion,-readability-named-parameter,-readability-static-accessed-through-instance,-llvmlibc-*,-altera-*' Checks: '*,-hicpp*,-android-cloexec-fopen,-cert-dcl50-cpp,-cert-env33-c,-cert-err34-c,-cert-err58-cpp,-clang-analyzer-core.UndefinedBinaryOperatorResult,-clang-analyzer-security*,-cppcoreguidelines-avoid-magic-numbers,-cppcoreguidelines-no-malloc,-cppcoreguidelines-owning-memory,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-pro-bounds-constant-array-index,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-pro-type-const-cast,-cppcoreguidelines-pro-type-reinterpret-cast,-cppcoreguidelines-pro-type-static-cast-downcast,-cppcoreguidelines-pro-type-union-access,-cppcoreguidelines-pro-type-vararg,-cppcoreguidelines-special-member-functions,-fuchsia-*,-google-default-arguments,-google-readability-todo,-google-runtime-references,-llvm-header-guard,-llvm-include-order,-misc-string-integer-assignment,-misc-string-literal-with-embedded-nul,-modernize-use-auto,-modernize-use-trailing-return-type,-readability-braces-around-statements,-readability-container-size-empty,-readability-delete-null-pointer,-readability-else-after-return,-readability-implicit-bool-conversion,-readability-named-parameter,-readability-static-accessed-through-instance'
WarningsAsErrors: '' WarningsAsErrors: ''
HeaderFilterRegex: '' HeaderFilterRegex: ''
FormatStyle: none FormatStyle: none
+4 -4
View File
@@ -1,6 +1,6 @@
--- ---
exclude_paths: exclude_paths:
- ".github/**" - '.github/**'
- "ci/build_verilator.sh" - 'ci/build_verilator.sh'
- "include/vltstd/**" - 'include/vltstd/**'
- "nodist/fastcov.py" - 'nodist/fastcov.py'
-8
View File
@@ -1,8 +0,0 @@
{
"name": "Verilator Build Environment",
"build": {
"dockerfile": "../ci/docker/buildenv/Dockerfile"
}
}
-4
View File
@@ -11,12 +11,8 @@ Thanks for taking the time to report this.
Can you attach an example that shows the issue? (Must be openly licensed, ideally in test_regress format.) Can you attach an example that shows the issue? (Must be openly licensed, ideally in test_regress format.)
What 'verilator' command line do we use to run your example?
What 'verilator --version' are you using? Did you try it with the git master version? What 'verilator --version' are you using? Did you try it with the git master version?
What OS and distribution are you using? What OS and distribution are you using?
May we assist you in trying to fix this in Verilator yourself? May we assist you in trying to fix this in Verilator yourself?
(Please avoid attaching screenshots that show text - you can convert images to text using e.g. https://ocr.space)
-2
View File
@@ -11,8 +11,6 @@ Thanks for taking the time to report this.
What would you like added/supported? What would you like added/supported?
What 'verilator --version' are you using? Did you try it with the git master version?
Can you attach an example that runs on other simulators? (Must be openly licensed, ideally in test_regress format.) Can you attach an example that runs on other simulators? (Must be openly licensed, ideally in test_regress format.)
May we assist you in trying to fix this in Verilator yourself? May we assist you in trying to fix this in Verilator yourself?
-2
View File
@@ -8,5 +8,3 @@ assignees: ''
--- ---
How may we help - what is your question? How may we help - what is your question?
(If reporting a bug or requesting a feature please use one of the other issue templates.)
+96 -113
View File
@@ -1,4 +1,3 @@
---
# DESCRIPTION: Github actions config # DESCRIPTION: Github actions config
# This name is key to badges in README.rst, so we use the name build # This name is key to badges in README.rst, so we use the name build
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 # SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
@@ -10,7 +9,7 @@ on:
pull_request: pull_request:
workflow_dispatch: workflow_dispatch:
schedule: schedule:
- cron: '0 0 * * 0' # weekly - cron: '0 0 * * 0' # weekly
env: env:
CI_OS_NAME: linux CI_OS_NAME: linux
@@ -18,74 +17,82 @@ env:
CCACHE_COMPRESS: 1 CCACHE_COMPRESS: 1
CCACHE_DIR: ${{ github.workspace }}/.ccache CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_LIMIT_MULTIPLE: 0.95 CCACHE_LIMIT_MULTIPLE: 0.95
INSTALL_DIR: ${{ github.workspace }}/install
RELOC_DIR: ${{ github.workspace }}/relloc
defaults: defaults:
run: run:
shell: bash shell: bash
working-directory: repo working-directory: repo
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
cancel-in-progress: true
jobs: jobs:
build: build:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-24.04, ubuntu-22.04, ubuntu-20.04] os: [ubuntu-22.04, ubuntu-20.04]
compiler: compiler:
- {cc: clang, cxx: clang++} - { cc: clang, cxx: clang++ }
- {cc: gcc, cxx: g++} - { cc: gcc, cxx: g++ }
m32: [0, 1]
exclude:
# Build pull requests only with ubuntu-22.04 and without m32
# - os: ${{ github.event_name == 'pull_request' && 'ubuntu-18.04' || 'do-not-exclude' }}
# - os: ${{ github.event_name == 'pull_request' && 'ubuntu-20.04' || 'do-not-exclude' }}
# - m32: ${{ github.event_name == 'pull_request' && 1 || 'do-not-exclude' }}
# Build -m32 only on ubuntu-22.04 clang++
- {os: ubuntu-18.04, m32: 1}
- {os: ubuntu-20.04, m32: 1}
- compiler: { cc: gcc, cxx: g++ }
m32: 1
include: include:
# Build GCC 10 on ubuntu-20.04 # Build GCC 10 on ubuntu-20.04
- os: ubuntu-20.04 - os: ubuntu-20.04
compiler: {cc: gcc-10, cxx: g++-10} compiler: { cc: gcc-10, cxx: g++-10 }
m32: 0
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
name: Build | ${{ matrix.os }} | ${{ matrix.compiler.cc }} name: Build | ${{ matrix.os }} | ${{ matrix.compiler.cc }} ${{ matrix.m32 && '| -m32' || '' }}
env: env:
CI_BUILD_STAGE_NAME: build CI_BUILD_STAGE_NAME: build
CI_RUNS_ON: ${{ matrix.os }} CI_RUNS_ON: ${{ matrix.os }}
CI_M32: ${{ matrix.m32 }}
CC: ${{ matrix.compiler.cc }} CC: ${{ matrix.compiler.cc }}
CXX: ${{ matrix.compiler.cxx }} CXX: ${{ matrix.compiler.cxx }}
CACHE_BASE_KEY: build-${{ matrix.os }}-${{ matrix.compiler.cc }} CACHE_BASE_KEY: build-${{ matrix.os }}-${{ matrix.compiler.cc }}-m32=${{ matrix.m32 }}
CCACHE_MAXSIZE: 1000M # Per build matrix entry (* 5 = 5000M in total) CCACHE_MAXSIZE: 250M # Per build matrix entry (2000M in total)
VERILATOR_ARCHIVE: verilator-${{ github.sha }}-${{ matrix.os }}-${{ matrix.compiler.cc }}.tar.gz VERILATOR_ARCHIVE: verilator-${{ github.sha }}-${{ matrix.os }}-${{ matrix.compiler.cc }}${{ matrix.m32 && '-m32' || '' }}.tar.gz
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v3
with: with:
path: repo path: repo
- name: Cache $CCACHE_DIR - name: Cache $CCACHE_DIR
uses: actions/cache@v4 uses: actions/cache@v3
env: env:
CACHE_KEY: ${{ env.CACHE_BASE_KEY }}-ccache CACHE_KEY: ${{ env.CACHE_BASE_KEY }}-ccache
with: with:
path: ${{ env.CCACHE_DIR }} path: ${{ env.CCACHE_DIR }}
key: ${{ env.CACHE_KEY }}-${{ github.sha }} key: ${{ env.CACHE_KEY }}-${{ github.sha }}
restore-keys: | restore-keys: |
${{ env.CACHE_KEY }}- ${{ env.CACHE_KEY }}-
- name: Install packages for build - name: Install packages for build
run: ./ci/ci-install.bash run: ./ci/ci-install.bash
- name: Build - name: Build
run: ./ci/ci-script.bash run: ./ci/ci-script.bash
- name: Tar up repository - name: Tar up repository
working-directory: ${{ github.workspace }} working-directory: ${{ github.workspace }}
run: tar --posix -c -z -f ${{ env.VERILATOR_ARCHIVE }} repo run: tar --posix -c -z -f ${{ env.VERILATOR_ARCHIVE }} repo
- name: Upload tar archive
uses: actions/upload-artifact@v3
with:
path: ${{ github.workspace }}/${{ env.VERILATOR_ARCHIVE }}
name: ${{ env.VERILATOR_ARCHIVE }}
- name: Upload tar archive
uses: actions/upload-artifact@v4
with:
path: ${{ github.workspace }}/${{ env.VERILATOR_ARCHIVE }}
name: ${{ env.VERILATOR_ARCHIVE }}
test: test:
needs: build needs: build
@@ -94,88 +101,64 @@ jobs:
matrix: matrix:
os: [ubuntu-22.04, ubuntu-20.04] os: [ubuntu-22.04, ubuntu-20.04]
compiler: compiler:
- {cc: clang, cxx: clang++} - { cc: clang, cxx: clang++ }
- {cc: gcc, cxx: g++} - { cc: gcc, cxx: g++ }
reloc: [0] m32: [0, 1]
suite: [dist-vlt-0, dist-vlt-1, dist-vlt-2, dist-vlt-3, vltmt-0, vltmt-1] suite: [dist-vlt-0, dist-vlt-1, dist-vlt-2, vltmt-0, vltmt-1]
exclude:
# Build pull requests only with ubuntu-22.04 and without m32
# - os: ${{ github.event_name == 'pull_request' && 'ubuntu-18.04' || 'do-not-exclude' }}
# - os: ${{ github.event_name == 'pull_request' && 'ubuntu-20.04' || 'do-not-exclude' }}
# - m32: ${{ github.event_name == 'pull_request' && 1 || 'do-not-exclude' }}
# Build -m32 only on ubuntu-22.04
- {os: ubuntu-18.04, m32: 1}
- {os: ubuntu-20.04, m32: 1}
- compiler: { cc: gcc, cxx: g++ }
m32: 1
include: include:
# Test with GCC 10 on ubuntu-20.04, also test relocation # Test with GCC 10 on ubuntu-20.04 without m32
- {os: ubuntu-20.04, compiler: {cc: gcc-10, cxx: g++-10}, reloc: 1, suite: dist-vlt-0} - {os: ubuntu-20.04, compiler: { cc: gcc-10, cxx: g++-10 }, m32: 0, suite: dist-vlt-0}
- {os: ubuntu-20.04, compiler: {cc: gcc-10, cxx: g++-10}, reloc: 1, suite: dist-vlt-1} - {os: ubuntu-20.04, compiler: { cc: gcc-10, cxx: g++-10 }, m32: 0, suite: dist-vlt-1}
- {os: ubuntu-20.04, compiler: {cc: gcc-10, cxx: g++-10}, reloc: 1, suite: dist-vlt-2} - {os: ubuntu-20.04, compiler: { cc: gcc-10, cxx: g++-10 }, m32: 0, suite: dist-vlt-2}
- {os: ubuntu-20.04, compiler: {cc: gcc-10, cxx: g++-10}, reloc: 1, suite: dist-vlt-3} - {os: ubuntu-20.04, compiler: { cc: gcc-10, cxx: g++-10 }, m32: 0, suite: vltmt-0}
- {os: ubuntu-20.04, compiler: {cc: gcc-10, cxx: g++-10}, reloc: 1, suite: vltmt-0} - {os: ubuntu-20.04, compiler: { cc: gcc-10, cxx: g++-10 }, m32: 0, suite: vltmt-1}
- {os: ubuntu-20.04, compiler: {cc: gcc-10, cxx: g++-10}, reloc: 1, suite: vltmt-1}
# Ubuntu 24.04 only on GCC; not passing on clang yet
- {os: ubuntu-24.04, compiler: {cc: gcc, cxx: g++}, suite: dist-vlt-0}
- {os: ubuntu-24.04, compiler: {cc: gcc, cxx: g++}, suite: dist-vlt-1}
- {os: ubuntu-24.04, compiler: {cc: gcc, cxx: g++}, suite: dist-vlt-2}
- {os: ubuntu-24.04, compiler: {cc: gcc, cxx: g++}, suite: dist-vlt-3}
- {os: ubuntu-24.04, compiler: {cc: gcc, cxx: g++}, suite: vltmt-0}
- {os: ubuntu-24.04, compiler: {cc: gcc, cxx: g++}, suite: vltmt-1}
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
name: Test | ${{ matrix.os }} | ${{ matrix.compiler.cc }} | ${{ matrix.reloc && 'reloc | ' || '' }} ${{ matrix.suite }} name: Test | ${{ matrix.os }} | ${{ matrix.compiler.cc }} | ${{ matrix.suite }} ${{ matrix.m32 && '| -m32' || '' }}
env: env:
CI_BUILD_STAGE_NAME: test CI_BUILD_STAGE_NAME: test
CI_RUNS_ON: ${{ matrix.os }} CI_RUNS_ON: ${{ matrix.os }}
CI_RELOC: ${{ matrix.reloc }} CI_M32: ${{ matrix.m32 }}
CC: ${{ matrix.compiler.cc }} CC: ${{ matrix.compiler.cc }}
CXX: ${{ matrix.compiler.cxx }} CXX: ${{ matrix.compiler.cxx }}
CACHE_BASE_KEY: test-${{ matrix.os }}-${{ matrix.compiler.cc }}-${{ matrix.reloc }}-${{ matrix.suite }} CACHE_BASE_KEY: test-${{ matrix.os }}-${{ matrix.compiler.cc }}-m32=${{ matrix.m32 }}-${{ matrix.suite }}
CCACHE_MAXSIZE: 100M # Per build per suite (* 5 * 5 = 2500M in total) CCACHE_MAXSIZE: 64M # Per build matrix entry (2160M in total)
VERILATOR_ARCHIVE: verilator-${{ github.sha }}-${{ matrix.os }}-${{ matrix.compiler.cc }}.tar.gz VERILATOR_ARCHIVE: verilator-${{ github.sha }}-${{ matrix.os }}-${{ matrix.compiler.cc }}${{ matrix.m32 && '-m32' || '' }}.tar.gz
steps: steps:
- name: Download tar archive - name: Download tar archive
uses: actions/download-artifact@v4 uses: actions/download-artifact@v3
with: with:
name: ${{ env.VERILATOR_ARCHIVE }} name: ${{ env.VERILATOR_ARCHIVE }}
path: ${{ github.workspace }} path: ${{ github.workspace }}
- name: Unpack tar archive - name: Unpack tar archive
working-directory: ${{ github.workspace }} working-directory: ${{ github.workspace }}
run: tar -x -z -f ${{ env.VERILATOR_ARCHIVE }} run: tar -x -z -f ${{ env.VERILATOR_ARCHIVE }}
- name: Cache $CCACHE_DIR - name: Cache $CCACHE_DIR
uses: actions/cache@v4 uses: actions/cache@v3
env: env:
CACHE_KEY: ${{ env.CACHE_BASE_KEY }}-ccache2 CACHE_KEY: ${{ env.CACHE_BASE_KEY }}-ccache
with: with:
path: ${{ env.CCACHE_DIR }} path: ${{ env.CCACHE_DIR }}
key: ${{ env.CACHE_KEY }}-${{ github.sha }} key: ${{ env.CACHE_KEY }}-${{ github.sha }}
restore-keys: | restore-keys: |
${{ env.CACHE_KEY }}- ${{ env.CACHE_KEY }}-
- name: Install test dependencies - name: Install test dependencies
run: ./ci/ci-install.bash run: ./ci/ci-install.bash
- name: Test - name: Test
env: env:
TESTS: ${{ matrix.suite }} TESTS: ${{ matrix.suite }}
run: ./ci/ci-script.bash run: ./ci/ci-script.bash
lint-py:
runs-on: ubuntu-22.04
name: Lint Python
env:
CI_BUILD_STAGE_NAME: build
CI_RUNS_ON: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
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 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
- name: Lint
run: make -k lint-py
+5 -4
View File
@@ -1,16 +1,17 @@
---
# DESCRIPTION: Github actions config # DESCRIPTION: Github actions config
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 # SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
#
name: Contributor Agreement name: Contributor Agreement
on: on:
push: push:
pull_request: pull_request:
workflow_dispatch: workflow_dispatch:
jobs: jobs:
Test: Test:
name: "'docs/CONTRIBUTORS' was signed" name: "'docs/CONTRIBUTORS' was signed"
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v3
- run: test_regress/t/t_dist_contributors.py - run: test_regress/t/t_dist_contributors.pl
+49 -42
View File
@@ -1,4 +1,3 @@
---
# DESCRIPTION: Github actions config # DESCRIPTION: Github actions config
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 # SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
@@ -7,11 +6,12 @@ name: coverage
on: on:
workflow_dispatch: workflow_dispatch:
schedule: schedule:
- cron: '0 0 * * 0' # weekly - cron: '0 0 * * 0' # weekly
env: env:
CI_OS_NAME: linux CI_OS_NAME: linux
CI_COMMIT: ${{ github.sha }} CI_COMMIT: ${{ github.sha }}
CI_M32: 0
COVERAGE: 1 COVERAGE: 1
VERILATOR_ARCHIVE: verilator-coverage-${{ github.sha }}.tar.gz VERILATOR_ARCHIVE: verilator-coverage-${{ github.sha }}.tar.gz
@@ -22,6 +22,7 @@ defaults:
jobs: jobs:
Build: Build:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
env: env:
@@ -29,36 +30,49 @@ jobs:
CI_RUNS_ON: ubuntu-22.04 CI_RUNS_ON: ubuntu-22.04
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v3
with: with:
path: repo path: repo
- name: Install packages for build - name: Install packages for build
run: ./ci/ci-install.bash run: ./ci/ci-install.bash
- name: Build - name: Build
run: ./ci/ci-script.bash run: ./ci/ci-script.bash
- name: Tar up repository - name: Tar up repository
working-directory: ${{ github.workspace }} working-directory: ${{ github.workspace }}
run: tar --posix -c -z -f ${{ env.VERILATOR_ARCHIVE }} repo run: tar --posix -c -z -f ${{ env.VERILATOR_ARCHIVE }} repo
- name: Upload tar archive
uses: actions/upload-artifact@v3
with:
path: ${{ github.workspace }}/${{ env.VERILATOR_ARCHIVE }}
name: ${{ env.VERILATOR_ARCHIVE }}
- name: Upload tar archive
uses: actions/upload-artifact@v4
with:
path: ${{ github.workspace }}/${{ env.VERILATOR_ARCHIVE }}
name: ${{ env.VERILATOR_ARCHIVE }}
Test: Test:
needs: Build needs: Build
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
test: [vlt-, vltmt-] test:
num: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] - vlt-
- vltmt-
num:
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
include: include:
- {test: dist, num: ''} - { test: dist, num: '' }
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
name: test-${{ matrix.test }}${{ matrix.num }} name: test-${{ matrix.test }}${{ matrix.num }}
env: env:
@@ -66,27 +80,20 @@ jobs:
CI_RUNS_ON: ubuntu-22.04 CI_RUNS_ON: ubuntu-22.04
steps: steps:
- name: Download tar archive - name: Download tar archive
uses: actions/download-artifact@v4 uses: actions/download-artifact@v3
with: with:
name: ${{ env.VERILATOR_ARCHIVE }} name: ${{ env.VERILATOR_ARCHIVE }}
path: ${{ github.workspace }} path: ${{ github.workspace }}
- name: Unpack tar archive - name: Unpack tar archive
working-directory: ${{ github.workspace }} working-directory: ${{ github.workspace }}
run: tar -x -z -f ${{ env.VERILATOR_ARCHIVE }} run: tar -x -z -f ${{ env.VERILATOR_ARCHIVE }}
- name: Install test dependencies - name: Install test dependencies
run: ./ci/ci-install.bash run: ./ci/ci-install.bash
- name: Test - name: Test
env: env:
TESTS: coverage-${{ matrix.test }}${{ matrix.num }} TESTS: coverage-${{ matrix.test }}${{ matrix.num }}
run: ./ci/ci-script.bash run: ./ci/ci-script.bash
- name: Upload coverage data to Codecov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
find . -name '*.gcno' -exec rm {} \;
./ci/codecov -v upload-process -Z --sha ${{ github.sha }} -f nodist/obj_dir/coverage/app_total.info
+42 -43
View File
@@ -1,4 +1,3 @@
---
# Build and push verilator docker image when tags are pushed to the repository. # Build and push verilator docker image when tags are pushed to the repository.
# The following variable(s) must be configured in the github repository: # The following variable(s) must be configured in the github repository:
# DOCKER_HUB_NAMESPACE: docker hub namespace. # DOCKER_HUB_NAMESPACE: docker hub namespace.
@@ -9,7 +8,7 @@ name: Build Verilator Container
on: on:
push: push:
tags: ['v*'] tags: [ 'v*' ]
workflow_dispatch: workflow_dispatch:
inputs: inputs:
manual_tag: manual_tag:
@@ -35,52 +34,52 @@ jobs:
# - "ci/docker/buildenv:verilator-buildenv" # - "ci/docker/buildenv:verilator-buildenv"
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v3
- name: Extract context variables - name: Extract context variables
run: | run: |
echo "${{ matrix.contexts }}" | sed -r 's/(.*):.*/build_context=\1/' >> "$GITHUB_ENV" echo "${{ matrix.contexts }}" | sed -r 's/(.*):.*/build_context=\1/' >> "$GITHUB_ENV"
echo "${{ matrix.contexts }}" | sed -r 's/.*:(.*)/image_name=\1/' >> "$GITHUB_ENV" echo "${{ matrix.contexts }}" | sed -r 's/.*:(.*)/image_name=\1/' >> "$GITHUB_ENV"
echo "git_tag=${GITHUB_REF#refs/*/}" >> "$GITHUB_ENV" echo "git_tag=${GITHUB_REF#refs/*/}" >> "$GITHUB_ENV"
- name: Use manual tag - name: Use manual tag
if: ${{ inputs.manual_tag }} if: ${{ inputs.manual_tag }}
run: | run: |
echo "git_tag=${{ inputs.manual_tag }}" >> "$GITHUB_ENV" echo "git_tag=${{ inputs.manual_tag }}" >> "$GITHUB_ENV"
- name: Docker meta - name: Docker meta
id: docker_meta id: docker_meta
uses: docker/metadata-action@v4 uses: docker/metadata-action@v4
with: with:
images: | images: |
${{ vars.DOCKER_HUB_NAMESPACE }}/${{ env.image_name }} ${{ vars.DOCKER_HUB_NAMESPACE }}/${{ env.image_name }}
tags: | tags: |
type=match,pattern=(v.*),group=1,enable=${{ startsWith(github.ref, 'refs/tags/v') }} type=match,pattern=(v.*),group=1,enable=${{ startsWith(github.ref, 'refs/tags/v') }}
type=raw,value=${{ inputs.manual_tag }},enable=${{ inputs.manual_tag != '' }} type=raw,value=${{ inputs.manual_tag }},enable=${{ inputs.manual_tag != '' }}
type=raw,value=latest,enable=${{ inputs.add_latest_tag == true }} type=raw,value=latest,enable=${{ inputs.add_latest_tag == true }}
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v2 uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2 uses: docker/setup-buildx-action@v2
with: with:
buildkitd-flags: --debug buildkitd-flags: --debug
- name: Login to Docker Hub - name: Login to Docker Hub
uses: docker/login-action@v2 uses: docker/login-action@v2
with: with:
username: ${{ secrets.DOCKER_HUB_USER }} username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and Push to Docker - name: Build and Push to Docker
uses: docker/build-push-action@v4 uses: docker/build-push-action@v4
if: startsWith(github.ref, 'refs/tags/v') if: startsWith(github.ref, 'refs/tags/v')
with: with:
context: ${{ env.build_context }} context: ${{ env.build_context }}
build-args: SOURCE_COMMIT=${{ env.git_tag }} build-args: SOURCE_COMMIT=${{ env.git_tag }}
platforms: linux/arm64,linux/amd64 platforms: linux/arm64,linux/amd64
push: ${{ !env.ACT && startsWith(github.ref, 'refs/tags/v') }} push: ${{ !env.ACT && startsWith(github.ref, 'refs/tags/v') }}
tags: ${{ steps.docker_meta.outputs.tags }} tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }} labels: ${{ steps.docker_meta.outputs.labels }}
+5 -3
View File
@@ -1,12 +1,13 @@
---
# DESCRIPTION: Github actions config # DESCRIPTION: Github actions config
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 # SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
#
name: format name: format
on: on:
push: push:
pull_request_target: pull_request_target:
workflow_dispatch: workflow_dispatch:
jobs: jobs:
format: format:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
@@ -15,9 +16,10 @@ jobs:
CI_OS_NAME: linux CI_OS_NAME: linux
CI_RUNS_ON: ubuntu-22.04 CI_RUNS_ON: ubuntu-22.04
CI_COMMIT: ${{ github.sha }} CI_COMMIT: ${{ github.sha }}
CI_M32: 0
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v3
with: with:
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
- name: Install packages for build - name: Install packages for build
+29 -28
View File
@@ -1,50 +1,51 @@
---
# DESCRIPTION: Github actions config # DESCRIPTION: Github actions config
# This name is key to badges in README.rst, so we use the name build # This name is key to badges in README.rst, so we use the name build
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 # SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
#
name: msbuild name: msbuild
on: on:
push: push:
pull_request: pull_request:
workflow_dispatch: workflow_dispatch:
schedule: schedule:
- cron: 0 0 * * 0 # weekly - cron: '0 0 * * 0' # weekly
env: env:
CI_OS_NAME: win CI_OS_NAME: win
CI_COMMIT: ${{ github.sha }} CI_COMMIT: ${{ github.sha }}
CCACHE_COMPRESS: 1 CCACHE_COMPRESS: 1
CCACHE_DIR: ${{ github.workspace }}/.ccache CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_LIMIT_MULTIPLE: 0.95 CCACHE_LIMIT_MULTIPLE: 0.95
defaults: defaults:
run: run:
working-directory: repo working-directory: repo
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
cancel-in-progress: true
jobs: jobs:
windows:
windows:
name: run on windows name: run on windows
runs-on: windows-latest runs-on: windows-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v3
with: with:
path: repo path: repo
- name: Cache $CCACHE_DIR - name: Cache $CCACHE_DIR
uses: actions/cache@v4 uses: actions/cache@v3
with: with:
path: ${{ env.CCACHE_DIR }} path: ${{ env.CCACHE_DIR }}
key: msbuild-msvc-cmake key: msbuild-msvc-cmake
- name: compile - name: compile
env: env:
WIN_FLEX_BISON: ${{ github.workspace }}/.ccache WIN_FLEX_BISON: ${{ github.workspace }}/.ccache
run: ./ci/ci-win-compile.ps1 run: ./ci/ci-win-compile.ps1
- name: test build - name: test build
run: ./ci/ci-win-test.ps1 run: ./ci/ci-win-test.ps1
- name: Zip up repository - name: Zip up repository
run: Compress-Archive -LiteralPath install -DestinationPath verilator.zip run: Compress-Archive -LiteralPath install -DestinationPath verilator.zip
- name: Upload zip archive - name: Upload zip archive
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v3
with: with:
path: ${{ github.workspace }}/repo/verilator.zip path: ${{ github.workspace }}/repo/verilator.zip
name: verilator-win.zip name: verilator-win.zip
+4 -11
View File
@@ -29,24 +29,17 @@ dddrun*
doxygen-doc doxygen-doc
gdbrun* gdbrun*
gmon.out gmon.out
internals.txt
ncverilog.history ncverilog.history
nohup.out internals.txt
verilator-config-version.cmake
verilator-config.cmake
verilator.pc
verilator.txt verilator.txt
verilator_bin* verilator_bin*
verilator_coverage_bin* verilator_coverage_bin*
verilator.pc
verilator-config.cmake
verilator-config-version.cmake
**/__pycache__/* **/__pycache__/*
**/_build/* **/_build/*
**/obj_dir/* **/obj_dir/*
/.vscode/ /.vscode/
/.idea/ /.idea/
/cmake-build-*/ /cmake-build-*/
/test_regress/snapshot/
xmverilog.*
xrun.history
# Normal CMake build directory
/build
-8
View File
@@ -1,8 +0,0 @@
---
- id: verilator
name: verilator-lint
description: Runs verilator Docker image to lint (System) Verilog designs
args: [--lint-only]
language: docker_image
entry: verilator/verilator:latest
types_or: [verilog, system-verilog]
-4
View File
@@ -1,4 +0,0 @@
[style]
based_on_style = pep8
column_limit = 99
#split_before_arithmetic_operator=True
-27
View File
@@ -1,27 +0,0 @@
# See https://citation-file-format.github.io/
cff-version: 1.2.0
title: Verilator
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- given-names: Wilson
family-names: Snyder
email: [email protected]
affiliation: Veripool
- given-names: Paul
family-names: Wasson
- given-names: Duane
family-names: Galbi
- 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
traditional simulator but a compiler.
license:
- LGPL-3.0-only
- Artistic-2.0
+28 -95
View File
@@ -4,7 +4,7 @@
# #
#***************************************************************************** #*****************************************************************************
# #
# Copyright 2003-2025 by Wilson Snyder. This program is free software; you # Copyright 2003-2023 by Wilson Snyder. This program is free software; you
# can redistribute it and/or modify it under the terms of either the GNU # 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 # Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0. # Version 2.0.
@@ -14,87 +14,48 @@
cmake_minimum_required(VERSION 3.15) cmake_minimum_required(VERSION 3.15)
cmake_policy(SET CMP0091 NEW) # Use MSVC_RUNTIME_LIBRARY to select the runtime cmake_policy(SET CMP0091 NEW) # Use MSVC_RUNTIME_LIBRARY to select the runtime
project( project(Verilator
Verilator VERSION 5.016
VERSION 5.032
HOMEPAGE_URL https://verilator.org HOMEPAGE_URL https://verilator.org
LANGUAGES CXX LANGUAGES CXX
) )
# Set default build type to Release if not specified option(DEBUG_AND_RELEASE_AND_COVERAGE
if(NOT CMAKE_BUILD_TYPE) "Builds both the debug and release binaries, overriding CMAKE_BUILD_TYPE. Not supported under MSBuild.")
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type" FORCE)
endif()
option(
DEBUG_AND_RELEASE_AND_COVERAGE
"Builds both the debug and release binaries, overriding CMAKE_BUILD_TYPE. Not supported under MSBuild."
)
find_package(Python3 COMPONENTS Interpreter) find_package(Python3 COMPONENTS Interpreter)
set(PYTHON3 ${Python3_EXECUTABLE}) set(PYTHON3 Python3::Interpreter)
# See also CMake built-in; CMAKE_INSTALL_PREFIX is applied by the install command. set(CMAKE_INSTALL_DATADIR ${CMAKE_INSTALL_PREFIX})
set(CMAKE_INSTALL_DATADIR .)
include(GNUInstallDirs) include(GNUInstallDirs)
include(CMakePackageConfigHelpers) include(CMakePackageConfigHelpers)
include(CheckStructHasMember) include(CheckStructHasMember)
include(ExternalProject) include(ExternalProject)
include(FindThreads)
if(NOT WIN32) if (NOT WIN32)
message(WARNING "CMake support on Linux/OSX is experimental.") message(WARNING "CMake support on Linux/OSX is experimental.")
endif() endif()
if(WIN32) if (MSVC)
if(DEFINED ENV{WIN_FLEX_BISON}) if (DEFINED ENV{WIN_FLEX_BISON})
set(WIN_FLEX_BISON "$ENV{WIN_FLEX_BISON}") set(WIN_FLEX_BISON "$ENV{WIN_FLEX_BISON}")
endif() endif()
if(EXISTS ${WIN_FLEX_BISON}) if (EXISTS ${WIN_FLEX_BISON})
list(APPEND CMAKE_PREFIX_PATH ${WIN_FLEX_BISON}) list(APPEND CMAKE_PREFIX_PATH ${WIN_FLEX_BISON})
endif() endif()
if(NOT WIN_FLEX_BISON) if (NOT WIN_FLEX_BISON)
message( message(FATAL_ERROR "Please install https://github.com/lexxmark/winflexbison and set WIN_FLEX_BISON environment variable. Please use install cmake target after a successful build.")
FATAL_ERROR
"Please install https://github.com/lexxmark/winflexbison and set WIN_FLEX_BISON environment variable. Please use install cmake target after a successful build."
)
endif() endif()
set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD 20)
endif() endif()
set(OBJCACHE "" CACHE STRING "Path for ccache, auto-detected if empty")
option(OBJCACHE_ENABLED "Compile Verilator with ccache" ON)
if(OBJCACHE_ENABLED)
if(OBJCACHE STREQUAL "")
find_program(OBJCACHE_PATH ccache)
if(OBJCACHE_PATH STREQUAL "OBJCACHE_PATH-NOTFOUND")
set(OBJCACHE_PATH "")
endif()
else()
set(OBJCACHE_PATH "${OBJCACHE}")
endif()
if(NOT OBJCACHE_PATH STREQUAL "")
execute_process(
COMMAND "${OBJCACHE_PATH}" --version
OUTPUT_VARIABLE objcache_version
)
string(REGEX MATCH "[^\n\r]+" objcache_version "${objcache_version}")
message(
STATUS
"Found ccache: ${OBJCACHE_PATH} (\"${objcache_version}\")"
)
set(CMAKE_CXX_COMPILER_LAUNCHER "${OBJCACHE_PATH}")
endif()
endif()
find_package(BISON) find_package(BISON)
find_package(FLEX) find_package(FLEX)
# Build # Build
#set_property(GLOBAL PROPERTY JOB_POOLS one_job=1) #set_property(GLOBAL PROPERTY JOB_POOLS one_job=1)
if(DEBUG_AND_RELEASE_AND_COVERAGE) if (DEBUG_AND_RELEASE_AND_COVERAGE)
if(CMAKE_GENERATOR MATCHES "^Visual Studio ") if (CMAKE_GENERATOR MATCHES "^Visual Studio ")
error("%Error: The DEBUG_AND_RELEASE_AND_COVERAGE option is not supported in MSBuild-based builds.") error("%Error: The DEBUG_AND_RELEASE_AND_COVERAGE option is not supported in MSBuild-based builds.")
endif() endif()
set(saved_build_type ${CMAKE_BUILD_TYPE}) set(saved_build_type ${CMAKE_BUILD_TYPE})
@@ -113,72 +74,44 @@ endif()
set(PACKAGE_NAME ${PROJECT_NAME}) set(PACKAGE_NAME ${PROJECT_NAME})
set(PACKAGE_VERSION ${PROJECT_VERSION}) set(PACKAGE_VERSION ${PROJECT_VERSION})
set(CXX ${CMAKE_CXX_COMPILER})
set(AR ${CMAKE_AR})
configure_file(include/verilated_config.h.in include/verilated_config.h @ONLY) configure_file(include/verilated_config.h.in include/verilated_config.h @ONLY)
configure_file(include/verilated.mk.in include/verilated.mk @ONLY)
install( install(FILES ${CMAKE_CURRENT_BINARY_DIR}/include/verilated_config.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include)
FILES ${CMAKE_CURRENT_BINARY_DIR}/include/verilated_config.h
DESTINATION include configure_package_config_file(verilator-config.cmake.in verilator-config.cmake
) INSTALL_DESTINATION ${CMAKE_INSTALL_PREFIX}
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/include/verilated.mk
DESTINATION include
) )
configure_package_config_file( install(FILES ${CMAKE_CURRENT_BINARY_DIR}/verilator-config.cmake DESTINATION ${CMAKE_INSTALL_PREFIX})
verilator-config.cmake.in
verilator-config.cmake configure_package_config_file(verilator-config-version.cmake.in verilator-config-version.cmake
INSTALL_DESTINATION . INSTALL_DESTINATION ${CMAKE_INSTALL_PREFIX}
) )
install( install(FILES ${CMAKE_CURRENT_BINARY_DIR}/verilator-config-version.cmake DESTINATION ${CMAKE_INSTALL_PREFIX})
FILES ${CMAKE_CURRENT_BINARY_DIR}/verilator-config.cmake
DESTINATION .
)
configure_package_config_file( foreach (program
verilator-config-version.cmake.in
verilator-config-version.cmake
INSTALL_DESTINATION .
)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/verilator-config-version.cmake
DESTINATION .
)
foreach(
program
verilator verilator
verilator_gantt verilator_gantt
verilator_ccache_report verilator_ccache_report
verilator_difftree verilator_difftree
verilator_profcfunc verilator_profcfunc
verilator_includer
) )
install(PROGRAMS bin/${program} TYPE BIN) install(PROGRAMS bin/${program} TYPE BIN)
endforeach() endforeach()
install( install(DIRECTORY examples TYPE DATA FILES_MATCHING
DIRECTORY examples
TYPE DATA
FILES_MATCHING
PATTERN "examples/*/*.[chv]*" PATTERN "examples/*/*.[chv]*"
PATTERN "examples/*/Makefile*" PATTERN "examples/*/Makefile*"
PATTERN "examples/*/CMakeLists.txt" PATTERN "examples/*/CMakeLists.txt"
) )
install( install(DIRECTORY include TYPE DATA FILES_MATCHING
DIRECTORY include
TYPE DATA
FILES_MATCHING
PATTERN "include/verilated_config.h" PATTERN "include/verilated_config.h"
PATTERN "include/verilated.mk"
PATTERN "include/*.[chv]" PATTERN "include/*.[chv]"
PATTERN "include/*.cpp" PATTERN "include/*.cpp"
PATTERN "include/*.vlt"
PATTERN "include/*.sv" PATTERN "include/*.sv"
PATTERN "include/gtkwave/*.[chv]*" PATTERN "include/gtkwave/*.[chv]*"
PATTERN "include/vltstd/*.[chv]*" PATTERN "include/vltstd/*.[chv]*"
+28 -588
View File
@@ -8,565 +8,6 @@ The changes in each Verilator version are described below. The
contributors that suggested a given feature are shown in []. Thanks! contributors that suggested a given feature are shown in []. Thanks!
Verilator 5.032 2025-01-01
==========================
**Minor:**
* Support queue's assignment `push_back/push_front('{})` (#5585) (#5586). [Yilou Wang]
* Support basic constrained random for multi-dimensional dynamic array and queue (#5591). [Yilou Wang]
* Support vpiDefName (#3906) (#5572). [Krzysztof Starecki]
* Support parameter names in pattern initialization (#5593) (#5596). [Greg Davill]
* Support randomize size constraints with restrictions (#5582 partial) (#5611). [Ryszard Rozak, Antmicro Ltd.]
* Support associative array basic constrained randomization (#5658) (#5670). [Yilou Wang]
* Support `default disable iff` and `$inferred_disable` (#4016). [Srinivasan Venkataramanan]
* Support `extern constraint` and `pure constraint`.
* Add `--no-std-waiver` and default reading of standard lint waivers file (#5607).
* Add `--no-std-package` as subset-alias of `--no-std` (#5607).
* Add `lint_off --contents` in configuration files (#5606).
* Add `--waiver-multiline` for context-sensitive `--waiver-output` (#5608).
* Add `--fno-inline-funcs` to disable function inlining.
* Add `--fno-slice` to disable array assignment slicing (#5644).
* Add error on illegal enum base type (#3010). [Iztok Jeras]
* Add error on `wait` with missing `.triggered` (#4457).
* Add error when improperly storing to parameter (#5147). [Gökçe Aydos]
* Add error on illegal `--prefix` etc. values (#5507). [Fabian Keßler]
* Add error on `--savable --timing` (#5690). [Narcis Rodas]
* Add coverage point hierarchy to coverage reports (#5575) (#5576). [Andrew Nolte]
* Add warning on global constraints (#5625). [Ryszard Rozak, Antmicro Ltd.]
* Add default CMAKE_BUILD_TYPE (#5691) (#5692). [Anthony Moore]
* Add error on `solve before` or soft constraints of `randc` variable.
* Improve concatenation performance (#5598) (#5599) (#5602). [Geza Lore]
* Improve optimization of duplicate wide expressions (#5637). [Bartłomiej Chmiel, Antmicro Ltd.]
* Fix dotted reference in delay value (#2410).
* Fix `function fork...join_none` regression with unknown type (#4449).
* Fix public_module requiring a wire to become public (#4916). [Andrew Nolte]
* Fix --hierarchical on projects with dot-f dependency lists (#5199) (#5669). [Bartłomiej Chmiel, Antmicro Ltd.]
* Fix can't locate scope error in interface task delayed assignment (#5462) (#5568). [Zhou Shen]
* Fix BLKANDNBLK for for VARXREFs (#5569). [Todd Strader]
* Fix VPI error instead of fatal for vpi_get_value() on large signals (#5571). [Todd Strader]
* Fix --output-groups leftover files issue (#5574). [Todd Strader]
* Fix slow unsized number parsing (#5577). [Geza Lore]
* Fix negative assignment pattern keys (#5580). [Iztok Jeras]
* Fix duplicate scope identifiers decoding (#5584). [Bartłomiej Chmiel, Antmicro Ltd.]
* Fix `rand` dynamic arrays with null handles (#5594). [Ryszard Rozak, Antmicro Ltd.]
* Fix NBAs to unpacked arrays of unpacked structs (#5603). [Geza Lore]
* Fix array of struct member overwrites on member update (#5605) (#5618) (#5628). [sumpster]
* Fix interface and struct pattern collision (#5639) (#5640). [Todd Strader]
* Fix mis-aliasing of instances with mailbox parameter types (#5632 partial).
* Fix error on duplicated declaration of gen block (#5663). [Ryszard Rozak, Antmicro Ltd.]
* Fix wildcard equality and inside operators for non-fourstate expressions (#5673). [Ryszard Rozak, Antmicro Ltd.]
* Fix `randomize..with` of parameterized classes (#5676). [Ryszard Rozak, Antmicro Ltd.]
* Fix interface bracketed array parameter access (#5677) (#5678). [Todd Strader]
* Fix width extension of operands of `inside` operator (#5685). [Ryszard Rozak, Antmicro Ltd.]
* Fix VPI + SYMRSVDWORD intersection (#5686). [Todd Strader]
* Fix verilator_gantt for hierarchically Verilated models (#5700). [Bartłomiej Chmiel, Antmicro Ltd.]
Verilator 5.030 2024-10-27
==========================
**Major:**
* Add `-output-groups` to build with concatenated .cpp files (#5257). [Mariusz Glebocki]
* Self-tests have been converted to Python, run `{test_name}.py` instead of `{test_name}.pl`.
**Minor:**
* Change .vlt config files to be read before .v files (#5185). [David Moberg]
* Change to use maximum for cover point aggregation (#5402). [Andrew Nolte]
* Change `--main` and `--binary` to use a TOP hierarchy name of "" (#5482).
* Change install of public executables into bindir instead of pkgdatadir (#5140) (#5544). [Geza Lore]
* Support IEEE-compliant intra-assign delays (#3711) (#5441). [Krzysztof Bieganski, Antmicro Ltd.]
* Support `wor`, `trior`, `wand`, `triand` (#5386) (#5496). [Zhou Shen]
* Support unconstrained randomization for unions (#5395) (#5396). [Yilou Wang]
* Support basic constrained queue randomization (#5413). [Arkadiusz Kozdra, Antmicro Ltd.]
* Support packed/unpacked and dynamic array unconstrained randomization (#5414) (#5415). [Yilou Wang]
* Support appending to queue via `[]` (#5421). [Krzysztof Bieganski, Antmicro Ltd.]
* Support named event locals (#5422). [Krzysztof Bieganski, Antmicro Ltd.]
* Support basic `dist` constraints (#5431). [Arkadiusz Kozdra, Antmicro Ltd.]
* Support unpacked array constrained randomization (#5437) (#5489). [Yilou Wang]
* Support inside array constraints (#5448). [Arkadiusz Kozdra, Antmicro Ltd.]
* Support DPI imports and exports with double underscores (#5481).
* Support ccache when compiling Verilated files with cmake.
* Support `local` and `protected` on `typedef` (#5460).
* Support unconstrained randomization for associative array and queue (#5515). [Yilou Wang]
* Support `rand` dynamic arrays of objects (#5557) (#5564). [Ryszard Rozak, Antmicro Ltd.]
* Add error on misused genvar (#408). [Alex Solomatnikov]
* Add error on instances without parenthesis.
* Add Docker pre-commit hook (#5238) (#5452). [Chris Bachhuber]
* Add partial coverage symbol and branch data in lcov info files (#5388). [Andrew Nolte]
* Add method to check if there are VPI callbacks of the given type (#5399). [Kaleb Barrett]
* Remove warning on unsized numbers exceeding 32-bits.
* Improve Verilation thread pool (#5161). [Bartłomiej Chmiel, Antmicro Ltd.]
* Improve performance of V3VariableOrder with parallelism (#5406). [Bartłomiej Chmiel, Antmicro Ltd.]
* Improve parser error handling (#5493). [Arkadiusz Kozdra, Antmicro Ltd.]
* Improve process trigger performance (#5483). [Geza Lore]
* Fix suppression of WIDTH* warnings when immediately under a size cast (#3417).
* Fix `$fatal` to not be affected by `+verilator+error+limit` (#5135). [Gökçe Aydos]
* Fix equivalence checking when replacing type parameters (#5213) (#5255). [Han Qi]
* Fix display with multiple string formats (#5311). [Luiza de Melo]
* Fix performance of V3Trace when many activity blocks (#5372). [Deniz Güzel]
* Fix REALCVT warning on integral timescale conversions (#5378). [Liam Braun]
* Fix multidimensional function return value selects (#5382). [Gökçe Aydos]
* Fix internal error in out-of-range select (#5393) (#5443). [Geza Lore]
* Fix dot fallback finding wrong symbols (#5394). [Arkadiusz Kozdra, Antmicro Ltd.]
* Fix infinite recursion due to recursive functions/tasks (#5398). [Krzysztof Bieganski, Antmicro Ltd.]
* Fix V3Randomize compile error on old GCC (#5403) (#5417). [Krzysztof Bieganski, Antmicro Ltd.]
* Fix extra events in traces (#5405).
* Fix empty `foreach` in `if` in constraints (#5408). [Krzysztof Bieganski, Antmicro Ltd.]
* Fix queue `[$-i]` select as reference argument (#5411). [Krzysztof Bieganski, Antmicro Ltd.]
* Fix `pre`/`post_randomize` on `randomize() with` (#5412). [Krzysztof Bieganski, Antmicro Ltd.]
* Fix capturing params in `randomize() with` (#5416) (#5418). [Krzysztof Bieganski, Antmicro Ltd.]
* Fix `sformatf` internal error on initial automatics (#5423). [Todd Strader]
* Fix clearing trigger of events with no sensitivity trees (#5426). [Arkadiusz Kozdra, Antmicro Ltd.]
* Fix driving clocking block in reactive region (#5430). [Krzysztof Bieganski, Antmicro Ltd.]
* Fix associative array next/prev/first/last mis-propagating constants (#5435). [Ethan Sifferman]
* Fix randomize treated as std::randomize in classes (#5436). [Arkadiusz Kozdra, Antmicro Ltd.]
* Fix `foreach` colliding index names (#5444). [Arkadiusz Kozdra, Antmicro Ltd.]
* Fix fault on defparam with UNSUPPORTED ignored (#5450). [Luiza de Melo]
* Fix class reference with pin that is a class reference (#5454).
* Fix not reporting class reference with extra parameters (#5467).
* Fix user-type parameter overlap (#5469). [Todd Strader]
* Fix tracing when name() is empty (#5470). [Sam Shahrestani]
* Fix timing mode not exiting on empty events (#5472).
* Fix coverage counts missing due to table optimization (#5473) (#5474). [Vito Gamberini]
* Fix `--binary` with .cpp PLI filenames under relative directory paths.
* Fix extra dot in coverage point hierarchy when using name()=''.
* Fix short-circuiting with associative array access (#5484). [Ethan Sifferman]
* Fix short-circuiting on method calls (#5486). [Ethan Sifferman]
* Fix exponential concatenate performance (#5488). [Arkadiusz Kozdra, Antmicro Ltd.]
* Fix V3Table trying to generate 'x' bits in the lookup table. (#5491). [Geza Lore]
* Fix randomize with foreach constraints (#5492). [Arkadiusz Kozdra, Antmicro Ltd.]
* Fix explicit CMAKE_INSTALL_PREFIX usages (#5500). [Fabian Keßler]
* Fix configure inserting absolute paths for Python and Perl (#5504) (#5505). [Nathan Graybeal]
* Fix pattern initialization with typedef key (#5512). [Eugene Feinberg]
* Fix `-j` option without argument in hierarchical Verilation (#5514). [Ryszard Rozak, Antmicro Ltd.]
* Fix `foreach` with 2-D queues and dynamic arrays (#5525) (#5529). [Yilou Wang]
* Fix struct array assignment (#5455) (#5537). [Yilou Wang]
* Fix copy constructor of classes that use std::process (#5528). [Ryszard Rozak, Antmicro Ltd.]
* Fix foreach on associative array (#5530). [Yilou Wang]
* Fix multi-range indices assignment (#5534) (#5547). [Yilou Wang]
* Fix static function wrappers (#5536). [Ryszard Rozak, Antmicro Ltd.]
* Fix assignments of concatenation to queues and dynamic arrays (#5540). [Ryszard Rozak, Antmicro Ltd.]
* Fix container reduction methods (#5542). [Krzysztof Boroński]
* Fix complex user type problem with `--x-assign` (#5543). [Todd Strader]
* Fix long module names crashing string handling (#5546). [Filip Badáň]
* Fix array trace splitting (#5549). [Todd Strader]
* Fix queue element access (#5551). [Ryszard Rozak, Antmicro Ltd.]
* Fix struct literal on pattern assignment (#5552) (#5559). [Todd Strader]
* Fix build on gcc when using the Spack wrapper (#5555). [Eric Müller]
* Fix enum name method (#5563). [Todd Strader]
* Fix `$countbits` in assert with non-tristates (#5566). [Shou-Li Hsu]
* Fix missing VlProcess handle in coroutines with splits (#5623) (#5650). [Bartłomiej Chmiel, Antmicro Ltd.]
* Fix imported array assignment literals (#5642) (#5648). [Todd Strader]
* Fix foreach mixed array (#5655) (#5656). [Yilou Wang]
Verilator 5.028 2024-08-21
==========================
**Minor:**
* Support state-dependent constraints (#5217). [Arkadiusz Kozdra, Antmicro Ltd.]
* Support cross-module clocking variable access (#5184). [Arkadiusz Kozdra, Antmicro Ltd.]
* Support inline constraints for class randomization methods (#5234). [Krzysztof Boroński]
* Support clocking blocks in virtual interfaces (#5235). [Arkadiusz Kozdra, Antmicro Ltd.]
* Support `$assertcontrol` assertion_type (#5236). [Bartłomiej Chmiel, Antmicro Ltd.]
* Support conditional constraints (#5245). [Arkadiusz Kozdra, Antmicro Ltd.]
* Support`--compiler-include` headers in user-supplied cpp files (#5271). [Bartłomiej Chmiel, Antmicro Ltd.]
* Support `rand_mode` (#5273). [Krzysztof Bieganski, Antmicro Ltd.]
* Support `this.randomize with` (#5282). [Arkadiusz Kozdra, Antmicro Ltd.]
* Support foreach constraints (#5302). [Arkadiusz Kozdra, Antmicro Ltd.]
* Support `parameter type` in hierarchical blocks (#5309) (#5333). [Bartłomiej Chmiel, Antmicro Ltd.]
* Support assertcontrol directive type (#5310). [Bartłomiej Chmiel, Antmicro Ltd.]
* Support inline random variable control (#5317). [Krzysztof Bieganski, Antmicro Ltd.]
* Support streaming operator on arrays and wide data (#5326). [Arkadiusz Kozdra, Antmicro Ltd.]
* Support streams to/from arrays of wide data (#5334). [Arkadiusz Kozdra, Antmicro Ltd.]
* Support `constraint_mode` (#5338). [Krzysztof Bieganski, Antmicro Ltd.]
* Support constraining AstSel (#5344). [Arkadiusz Kozdra, Antmicro Ltd.]
* Support default value on module input (#5358) (#5373). [Drew Ranck]
* Add `--compiler-include` for additional C++ includes (#5139) (#5202). [Bartłomiej Chmiel, Antmicro Ltd.]
* Add `--emit-accessors` (#5182) (#5227). [Ryan Ziegler]
* Add suggestions on misspelled PLI functions.
* Add warning on dist in constraints (#5264). [Arkadiusz Kozdra, Antmicro Ltd.]
* Add more `rand_mode` unsupported errors (#5329). [Krzysztof Bieganski, Antmicro Ltd.]
* Add parsing but otherwise ignore std::randomize (#5354). [Arkadiusz Kozdra, Antmicro Ltd.]
* Add Verilated cc define when `--timing` used (#5383). [Kaleb Barrett]
* Improve emitted code to use a reference for VlSelf (#5254). [Yangyu Chen]
* Fix monitor block sensitivity items (#4400) (#5294). [Udaya Raj Subedi]
* Fix fusing macro arguments to not ignore whitespace (#5061). [Tudor Timi]
* Fix optimized-out sensitivity trees with `--timing` (#5080) (#5349). [Krzysztof Bieganski, Antmicro Ltd.]
* Fix classes/modules of case-similar names (#5109). [Arkadiusz Kozdra]
* Fix mis-removing $value$plusargs calls (#5127) (#5137). [Seth Pellegrino]
* Fix incorrect result of width mismatch (#5186) (#5189). [Yutetsu TAKATSUKASA]
* Fix compiler coroutine check (#5190) (#5300). [Ricardo Barbedo]
* Fix shortened module names when searching for files (#5196) (#5246). [Tim Hutt]
* Fix `--x-assign` to be independent from `+verilator+rand+reset` (#5214). [Andrew Nolte]
* Fix splitting if statements with impure conditions (#5219). [Bartłomiej Chmiel, Antmicro Ltd.]
* Fix unknown conversion on queues (#5220). [Alex Solomatnikov]
* Fix top-level unpacked structure resets (#5221).
* Fix concurrency for mailbox and semaphores (#5222). [Liam Braun]
* Fix forks capturing non-input ports in tasks (#5237) (#5343). [Krzysztof Bieganski, Antmicro Ltd.]
* Fix toggle coverage aggregation on same line (#5248). [Krzysztof Obłonczek]
* Fix error on empty generate with -O0 (#5250).
* Fix unconstrained randomization of unpacked structs (#5252). [Krzysztof Bieganski, Antmicro Ltd.]
* Fix inlining of variables driven from forced vars (#5259). [Geza Lore]
* Fix tracing with `--main-top-name -` (#5261). [Ethan Sifferman]
* Fix randomization when used with inheritance (#5268). [Krzysztof Bieganski, Antmicro Ltd.]
* Fix inline constraints creating class random generator (#5280). [Krzysztof Bieganski, Antmicro Ltd.]
* Fix WIDTHEXPAND on left shift of intuitive amount (#5284). [Greg Taylor]
* Fix elaborating foreach loops (#5285). [Arkadiusz Kozdra, Antmicro Ltd.]
* Fix initializing static array in dynamic arrays and queues (#5287). [Baruch Sterin]
* Fix static variable initializers in procedures (#5296). [Bartłomiej Chmiel, Antmicro Ltd.]
* Fix randomizing current object with `rand` class instance member (#5292). [Krzysztof Bieganski, Antmicro Ltd.]
* Fix handling of rand fields not referenced in constraints (#5305). [Ryszard Rozak, Antmicro Ltd.]
* Fix Python3 path discovery in make flows to avoid mixing system and user python interpreters (#5307) [Markus Krause]
* Fix make flows to pass PYTHON3 (like PERL) (#5307) (#5308). [Markus Krause]
* Fix assert on wide expression (#5319) (#5324). [Varun Koyyalagunta]
* Fix output clock variable overwriting signal (#5320) (#5347). [Krzysztof Bieganski, Antmicro Ltd.]
* Fix stringify in nested preprocessor macros (#5323). [Krzysztof Bieganski, Antmicro Ltd.]
* Fix $sformat with array arguments (#5330). [Abe Jordan]
* Fix -Wunused-but-set-variable clang warning (#5331). [Bartłomiej Chmiel, Antmicro Ltd.]
* Fix purity of functions with AstJumpBlock or AstStmtExpr (#5332). [Ryszard Rozak, Antmicro Ltd.]
* Fix compilation error on unreachable disable fork / wait fork (#5339). [Arkadiusz Kozdra, Antmicro Ltd.]
* Fix missing type coercion in 'inside {array}' (#5340). [Arkadiusz Kozdra, Antmicro Ltd.]
* Fix +: and -: unpacked array slicing when array has nonzero low index (#5345) (#5387). [James Bailey]
* Fix tracing_{on,off} in the presence of non-inlined modules (#5346). [Geza Lore]
* Fix NBAs in suspendables (#5348). [Krzysztof Bieganski, Antmicro Ltd.]
* Fix lint_off on Errors (#5351) (#5363). [Ethan Sifferman]
* Fix cache config file resolution performance (#5369). [Geza Lore]
* Fix capturing fields from superclass in `randomize() with` (#5389). [Krzysztof Bieganski, Antmicro Ltd.]
* Fix virtual interface null checks (#5391). [Krzysztof Bieganski, Antmicro Ltd.]
* Fix ==? and !=? with X values.
* Fix CPU time being zero.
* Fix inline function ref port persistence.
Verilator 5.026 2024-06-15
==========================
**Major:**
* Support constrained randomization with external solvers (#4947). [Arkadiusz Kozdra, Antmicro Ltd.]
**Minor:**
* Support `$psprintf` system function (#4314) (#5169). [Arkadiusz Kozdra, Antmicro Ltd.]
* Support 2D dynamic array initialization (#4700) (#5122). [Valentin Atepalikhin]
* Support __en/__out signals on top level inout ports (#4812) (#4856). [Paul Wright]
* Support empty queue as dynarray default value (#5055). [Arkadiusz Kozdra, Antmicro Ltd.]
* Support vpiInertialDelay (#5087). [Todd Strader]
* Support NBAs to arrays inside loops (#5092). [Geza Lore]
* Support parsing and otherwise ignoring inline constraints (#5126). [Arkadiusz Kozdra, Antmicro Ltd.]
* Support `inout` clocking items (#5160). [Arkadiusz Kozdra, Antmicro Ltd.]
* Support StructSel in unpacked array assignments (#5176). [Geza Lore]
* Add error on zero width select (#5028).
* Add CITATION.cff (#5057) (#5058). [Gijs Burghoorn]
* Add VPI eval needed tracking (#5065). [Todd Strader]
* Add `--localize-max-size` option and optimization (#5072).
* Add parameterless assert control system tasks (#5010). [Bartłomiej Chmiel]
* Add traceCapable indication to model header (#5053). [Vito Gamberini]
* Add increasing of stack size when possible (#5071) (#5104). [Yinan Xu]
* Add assertion on reusing VerilatedContext (#5167).
* Add `--pins-sc-uint-bool` to force SystemC uint type (#5192). [Bartłomiej Chmiel, Antmicro Ltd.]
* Improve DFG regularization in cyclic graphs (#5142). [Geza Lore]
* Improve VerilatedVpiPutHolder storage requirements (#5144). [Kaleb Barrett]
* Fix coroutines without awaits to have a co_return (#4208) (#5175). [Arkadiusz Kozdra, Antmicro Ltd.]
* Fix missing flex include path variable (#4970) (#4971). [Christopher Taylor]
* Fix missing parameters with comma to be errors (#4979) (#5012). [Paul Swirhun]
* Fix 'experimental/coroutine' file not found on MacOS (#5030) (#5031) (#5151). [Paul Bowen-Huggett]
* Fix bound queue printing (#5032). [Aleksander Kiryk, Antmicro Ltd.]
* Fix consecutive zero-delays (#5038). [Krzysztof Bieganski, Antmicro Ltd.]
* Fix attempted to destroy locked thread pool error (#5040). [Bartłomiej Chmiel, Antmicro Ltd.]
* Fix `$system` with string argument (#5042).
* Fix width extension on delays (#5043).
* Fix `$typename` on array.min and others (#5049). [Gökçe Aydos]
* Fix `make $(info)` which cannot be silenced (#5059). [Gökçe Aydos]
* Fix CMake builds to export VERILATOR_ROOT (#5063). [Michael Bikovitsky]
* Fix false ASSIGNIN on functions with explicit port map (#5069).
* Fix 4-state value support for $readmem (#5070) (#5078). [Ethan Sifferman]
* Fix DFG assertion with SystemC (#5076). [Geza Lore]
* Fix `$typename` string to be more standard (#5082) (#5083). [Andrew Nolte]
* Fix missed optimization in V3Delayed (#5089). [Geza Lore]
* Fix macro expansion in strings per 1800-2023 (#5094). [Geza Lore]
* Fix width extension of unpacked array select (#5095). [Varun Koyyalagunta]
* Fix MacOS missing <type_traits> header (#5096) (#5097). [Vito Gamberini]
* Fix assertion failure in V3Gate (#5101). [Yutetsu TAKATSUKASA]
* Fix aliases for forced port signals (#5105). [Geza Lore]
* Fix tracing interface functions (#5108). [Alex Solomatnikov]
* Fix method calls parsing in constraints (#5110). [Arkadiusz Kozdra, Antmicro Ltd.]
* Fix vpiInertialDelay for memories (#5113). [Todd Strader]
* Fix hierarchical compilation with nested -F (#5114) (#5124). [Alex Solomatnikov]
* Fix references to ports in forks (#5123). [Krzysztof Bieganski, Antmicro Ltd.]
* Fix output C++ type error on change detect of I/O arrays (#5125) (#5131). [Pawel Jewstafjew]
* Fix x-valued parameters with `--x-assign unique` (#5129). [Ethan Sifferman]
* Fix overflow of string on VPI reads (#5145) (#5146). [Kaleb Barrett]
* Fix VerilatedVpiPutHolder class (#5156). [Kaleb Barrett]
* Fix extending out-of-range select (#5159) (#5164). [Geza Lore]
* Fix radix in width warnings (#5166). [Geza Lore]
* Fix SystemC BITS_PER_DIGIT in VL_ASSIGN_SBW (#5170). [Bartłomiej Chmiel, Antmicro Ltd.]
* Fix non-constant replication in concats (#5171). [Arkadiusz Kozdra, Antmicro Ltd.]
* Fix table optimization when applied on real data type (#5172) (#5173). [Arthur Rosa]
* Fix signed types emitted in hierarchical Verilation (#5178). [Bartłomiej Chmiel, Antmicro Ltd.]
* Fix DPI import of null C-string (#5179).
* Fix CMake installation missing verilated.mk (#5187) (#5188). [Philip Axer]
* Fix linking with pthreads on CMake (#5194). [Tim Hutt]
* Fix clang-17 coroutines configuration with -std=gnu++20 (#5200). [Gus Smith]
Verilator 5.024 2024-04-05
==========================
**Major:**
* Add printing summary reports, use `--quiet` or `+verilator+quiet` to suppress (#4909).
* Support 1800-2023 keywords, and parsing with UNDEFINED warnings.
* Support 1800-2023 preprocessor ifdef expressions.
**Minor:**
* Change 1800-2023 to be default language version.
* Add DFG 'regularize' pass, and improve variable removal (#4937). [Geza Lore]
* Add error when pass net to function argument (#4132) (#4966). [Fuad Ismail]
* Add `UNUSEDLOOP` when unused loop is removed (#4926). [Bartłomiej Chmiel, Antmicro Ltd.]
* Add custom version for verilator --version packaging (#4954). [Nolan Poe]
* Add error on missing pure virtual functions (#4961).
* Add error on calling static function without object (#4962).
* Add JSON AST dumps (#5020). [Szymon Gizler]
* Support 1800-2023 DPI headers, svGetTime/svgGetTimeUnit/svGetTimePrecision methods.
* Support 1800-2023 class and function :initial, :extends, :final virtual overrides (#5025).
* Support public packed struct / union (#860) (#4878). [Kefa Chen]
* Support stream operation on unpacked array (#4714) (#5006). [Fuad Ismail]
* Support implicitly-typed variable definitions in for-loop initializers (#4945) (#4986). [Kevin Nygaard]
* Support inside range with implicit type conversion (#5026). [Arkadiusz Kozdra, Antmicro Ltd.]
* Improve installation to be relocatable (#4927). [Geza Lore]
* Improve internal ordering code (#4957) (#4990) (#4994) et al. [Geza Lore]
* Fix generate blocks in vpi_iterate (#3609) (#4913). [Andrew Nolte]
* Fix __Vlip undefined error in --freloop (#4824). [Justin Yao Du]
* Fix missing VPI scopes (#4918). [Andrew Nolte]
* Fix invalid cast on string structure creation (#4921).
* Fix try-lock spuriously fails (#4931) (#4938). [Kamil Rakoczy]
* Fix V3Unknown unpacked struct x-assign (#4934). [Yan Xu]
* Fix DFG removing forceable signals (#4942). [Geza Lore]
* Fix null characters in shortened identifiers (#4946). [Abdul Hameed]
* Fix assignment of null into struct member (#4952).
* Fix VPI missing scopes 2 (#4965). [Andrew Nolte]
* Fix object assignment from conditionals (#4968).
* Fix GCC14 warnings on template specialization syntax (#4974) (#4975). [Nolan Poe]
* Fix unpacked structure upper bit cleaning (#4978).
* Fix tests on MacOS (#4984) (#4985). [Kevin Nygaard]
* Fix `--prof-exec` predicted time values (#4988). [Geza Lore]
* Fix class type as an associative array parameter (#4997).
* Fix inout ports of unpacked struct type (#5000). [Ryszard Rozak, Antmicro Ltd.]
* Fix `unique {}` constraints missing semicolon (#5001).
* Fix preprocessor to respect strings in joins (#5007).
* Fix tracing class parameters (#5014).
* Fix memory leaks (#5016). [Geza Lore]
* Fix `$readmem` with missing newline (#5019). [Josse Van Delm]
* Fix internal error on missing pattern key (#5023).
* Fix tracing replicated hierarchical models (#5027).
* Fix false LIFETIME warning on `repeat` in `fork-join` (#5456).
Verilator 5.022 2024-02-24
==========================
**Minor:**
* Add predicted stack overflow warning (#4799).
* Add `+verilator+coverage+file` runtime option.
* Add `--assert-case` option (#4919). [Yutetsu TAKATSUKASA]
* Add `--decorations node` for inserting debug comments into emitted code.
* Add `--json-only` and related JSON dumping (#4715) (#4831). [Szymon Gizler, Antmicro Ltd.]
* Add `--[no]-stop-fail` option for continuing after assertions (#4904). [Yutetsu TAKATSUKASA]
* Add `--runtime-debug` for Verilated executable runtime debugging.
* Add `--valgrind` switch (#4828). [Szymon Gizler]
* Add `unroll_disable` and `unroll_full` loop control metacomments (#3260). [Jiaxun Yang]
* Remove deprecated 32-bit pointer mode (`gcc -m32`).
* Deprecate --xml-only and XML dumping (#4715) (#4831).
* Change zero replication width error to ZEROREPL warning (#4753) (#4762). [Pengcheng Xu]
* Improve message for priority case assertion failure (#4905). [Yutetsu TAKATSUKASA]
* Support dumping coverage with `--main`.
* Support dumping DFG patterns with `--stats` (#4889). [Geza Lore]
* Support `vpiConstType` in `vpi_get_str()` (#4797). [Marlon James]
* Support SystemC 3.0.0 public review version (#4805) (#4807). [Anthony Donlon]
* Support parsing anonymous primitive instantiations (#4809). [Anthony Donlon]
* Fix to not emit already waived warnings in waiver output (#4574) (#4818). [Jonathan Schröter]
* Fix `this` in member initialization (#4710). [eliasphanna]
* Fix localparam elaboration (#3858) (#4794). [Andrew Nolte]
* Fix lint_off disables on preprocessor warnings (#4703). [Srinivasan Venkataramanan]
* Fix $time not rounding up (#4790) (#4792). [Paul Wright]
* Fix `vpi_get()` and `vpi_get64()` to return vpiUndefined on errors (#4795). [Marlon James]
* Fix VPI parameter iteration (#4798). [Marlon James]
* Fix delays using wrong timeunit when modules inlined (#4806). [Paul Wright]
* Fix warnings in verilated_sc_trace.h for Clang. (#4807) (#4827). [Anthony Donlon]
* Fix null pointer dereference (#4810) (#4825). [Adrian Sampson]
* Fix compilation error on multi-inherited interface class usage (#4819).
* Fix maybe-uninitialized compiler warning (#4820) (#4822). [Larry Doolittle]
* Fix mis-splitting of dump control functions (#4821). [Fan Shupei]
* Fix wrong utimes() parameter (#4829). [Szymon Gizler]
* Fix incorrect bit-op-tree NOT optimization (#4832) (#4847). [Yutetsu TAKATSUKASA]
* Fix width calculation in replaceShiftOp (#4837) (#4841) (#4849). [Yutetsu TAKATSUKASA]
* Fix unsafe write in wide array insertion (#4850) (#4855). [Paul Swirhun]
* Fix NOT when checking EQ/NEQ under AND/OR tree (#4857) (#4863). [Yutetsu TAKATSUKASA]
* Fix tracing chandles (#4860). [Nathan Graybeal]
* Fix $fwrite of null (#4862). [Jose Tejada]
* Fix -fno-const-bit-op-tree wrong runtime result (#4864) (#4867). [Yutetsu TAKATSUKASA]
* Fix SystemC biguint sign desynchronization (#4870). [Bartłomiej Chmiel]
* Fix incorrect temporary insertion in loop conditions with statements (#4873). [Geza Lore]
* Fix timing with expr on assign LHS (#4880). [Krzysztof Bieganski, Antmicro Ltd.]
* Fix assertion for unique case (#4892). [Yutetsu TAKATSUKASA]
* Fix GCC tautological-compare warnings.
* Fix compile error on structs with queues (and ignore toggle coverage on queues).
* Fix toggle coverage error on multi-edge driven signals.
* Fix whitespace in `pragma protect version` (#4902) (#4914). [Paul Swirhun]
* Fix incorrect code generation for change expression on typedefed unpacked array (#4915). [Geza Lore]
* Fix inconsistent driver resolution with typedefs (#4917). [Geza Lore]
Verilator 5.020 2024-01-01
==========================
**Major:**
* Support compilation with precompiled headers with Make, and GCC or CLang.
* Change include to systemc instead of systemc.h (#4622) (#4623). [Chih-Mao Chen]
This may require that SystemC programs add 'using namespace sc_core', 'using namespace sc_dt'.
**Minor:**
* Add devcontainer support (#4748). [Stefan Wallentowitz]
* Support `iff` in sensitivity list (#1482) (#4626). [Krzysztof Bieganski, Antmicro Ltd.]
* Support parameterized virtual interfaces (#4047) (#4743). [Ryszard Rozak, Antmicro Ltd.]
* Support --timing triggers for virtual interfaces (#4673). [Krzysztof Bieganski, Antmicro Ltd.]
* Support ccache when compiling Verilator with CMake (#4678). [Anthony Donlon]
* Support passing constraints to --xml-only output (still otherwise unsupported) (#4683). [Shahid Ikram]
* Support node memory usage information in --stats (#4684). [Geza Lore]
* Support vpiConstType in vpi_get() (#4761). [Todd Strader]
* Support vpi_iterate on packages with vpiInstance (#4726). [Todd Strader]
* Support multiple parameters in virtual interfaces (#4745). [Ryszard Rozak, Antmicro Ltd.]
* Support user C/C++ code in final archive, and make a lib{model}.a (#4749) (#4754). [Fan Shupei]
* Support inside operator on unpacked arrays and queues (#4751). [Ryszard Rozak, Antmicro Ltd.]
* Support VPI parameter iteration (#4765). [Todd Strader]
* Support packages in vpi_handle_by_name() (#4768). [Todd Strader]
* Support invoking interface methods on virtual interface variables (#4774) (#4775). [Jordan McConnon]
* Remove deprecated options (#4663). [Geza Lore]
* Remove older compiler support; require C++14 or newer (#4784) (#4786).
* Optimize timing-delayed queue (#4584). [qrqiuren]
* Optimize substitute optimization memory usage (#4687). [Geza Lore]
* Optimize wide primitive operations with -Oz (#4733). [Geza Lore]
* Optimize V3Premit performance etc. (#4736). [Geza Lore]
* Fix VPI TOP level variable iteration (#3919) (#4618). [Marlon James]
* Fix display with no % printing assoc array (#4376). [Alex Solomatnikov]
* Fix scheduling of external force signals (#4577) (#4668). [Geza Lore]
* Fix a memory leak in V3Fork (#4628). [Krzysztof Boroński]
* Fix linking parameterized hierarchical blocks and recursive hierarchical blocks (#4654). [Anthony Donlon]
* Fix identifiers that end with '_' on Windows (#4655). [Anthony Donlon]
* Fix 'for' loop with outside variable reference (#4660). [David Harris]
* Fix tracing FST enums (#4661) (#4756). [Todd Strader]
* Fix interface parameters used in loop generate constructs (#4664) (#4665). [Anthony Donlon]
* Fix C++20 compilation errors (#4670).
* Fix deadlocks in error handler (#4672). [Mariusz Glebocki, Antmicro Ltd.]
* Fix MingW compilation (#4675). [David Ledger]
* Fix trace when using SystemC with certain configurations (#4676). [Anthony Donlon]
* Fix range access to classes depending on parameter resolution (#4681). [Krzysztof Boroński]
* Fix select into constant And/Or/Xor pattern (#4689). [Geza Lore]
* Fix access type of function arguments (#4692) (#4694). [Ryszard Rozak, Antmicro Ltd.]
* Fix dynamic NBAs with automatic vars (#4696). [Krzysztof Bieganski, Antmicro Ltd.]
* Fix # 0 delays for process resumption, etc. (#4697). [Krzysztof Boroński]
* Fix conflicted namespace for coroutines (#4701) (#4707). [Jinyan Xu]
* Fix compilers seeing empty input due to file system races (#4708). [Flavien Solt]
* Fix shift of > 32-bit number (#4719). [Flavien Solt]
* Fix Windows include gates in filesystem Flush implementation. (#4720). [William D. Jones]
* Fix power operator with wide numbers and constants (#4721) (#4763). [Flavien Solt]
* Fix parameter passing to ports (#4723). [Ryszard Rozak, Antmicro Ltd.]
* Fix block names of nested do..while loops (#4728). [Ryszard Rozak, Antmicro Ltd.]
* Fix class name in error on 'new' on virtual class (#4739). [Ryszard Rozak, Antmicro Ltd.]
* Fix typedefs pointing to parameterized classes (#4747). [Ryszard Rozak, Antmicro Ltd.]
* Fix $finish twice to no longer exit (#4757). [Tim Hutt]
* Fix dynamic NBA conditions (#4773). [Krzysztof Bieganski, Antmicro Ltd.]
* Fix `V3Fork` stage to run only if `--timing` is set (#4778). [Krzysztof Bieganski, Antmicro Ltd.]
* Fix max multiply width and add runtime assertions if too small. (#4781)
* Fix select value too wide (#5148) (#5153). [Dercury]
Verilator 5.018 2023-10-30
==========================
**Major:**
* Support compilation with precompiled headers with Make and GCC or CLang.
* Change include of systemc instead of systemc.h (#4622) (#4623). [Chih-Mao Chen]
This may require that SystemC programs add 'using namespace sc_core', 'using namespace sc_dt'.
**Minor:**
* Add SIDEEFFECT warning on mishandled side effect cases.
* Add trace() API even when Verilated without --trace (#4462). [phelter]
* Add warning on interface instantiation without parens (#4094). [Gökçe Aydos]
* Add sv_vpi_user.h from IEEE 1800-2017 Annex M (#4606). [Marlon James]
* Support 'disable fork' (#4125) (#4569). [Aleksander Kiryk, Antmicro Ltd.]
* Support 'wait fork' (#4586). [Aleksander Kiryk, Antmicro Ltd.]
* Support 'randc' (#4349).
* Support assigning events (#4403). [Krzysztof Boroński]
* Support resizing function call inout arguments (#4467).
* Support NBAs in non-inlined functions/tasks (#4496) (#4572). [Krzysztof Bieganski, Antmicro Ltd.]
* Support converting parameters inside modules to localparams (#4511). [Anthony Donlon]
* Support concatenation of unpacked arrays (#4558). [Yutetsu TAKATSUKASA]
* Support Clang 16 (#4592). [Mariusz Glebocki]
* Support VPI variables of real and string data types (#4594). [Marlon James]
* Support making VL_LOCK_SPINS configurable (#4599). [Geza Lore]
* Change code --stats output (#4597). [Geza Lore]
* Change --prof-exec infrastructure and report (#4602). [Geza Lore]
* Change lint_off to not propagate upwards to files including where the lint_off is.
* Optimize empty expression statements (#4544).
* Optimize trace internals (#4610) (#4612). [Geza Lore]
* Optimize internal performance issues (#4638). [Geza Lore]
* Fix conversion of impure logical expressions to bit expressions (#487 partial) (#4437). [Ryszard Rozak, Antmicro Ltd.]
* Fix enum functions in localparams (#3999). [Andrew Nolte]
* Fix passing arguments by reference (#3385 partial) (#4489). [Ryszard Rozak, Antmicro Ltd.]
* Fix multithreading handling to separate by code units that use/never use it (#4228). [Mariusz Glebocki, Antmicro Ltd.]
* Fix usage of annotation options (#4486) (#4504). [Michal Czyz]
* Fix detecting local vars in nested forks (#4493) (#4506). [Kamil Rakoczy]
* Fix handling input file path separator (#4515) (#4516). [Anthony Donlon]
* Fix mis-support for parameterized UDPs (#4518). [Anthony Donlon]
* Fix constant conversion of $realtobits, $bitstoreal (#4522). [Andrew Nolte]
* Fix conversion of integers in $display '%e' (#4528). [muzafferkal]
* Fix non-inlined interface tracing (#3984) (#4530). [Todd Strader]
* Fix stream operations with operands of struct type (#4531) (#4532). [Ryszard Rozak, Antmicro Ltd.]
* Fix 'this' in a constructor (#4533). [Ryszard Rozak, Antmicro Ltd.]
* Fix stream shift operator of 32 bits (#4536). [Julien Faucher]
* Fix object destruction after a copy constructor (#4540) (#4541). [Ryszard Rozak, Antmicro Ltd.]
* Fix inlining of real functions miscasting (#4543). [Andrew Nolte]
* Fix broken link error for enum references (#4551). [Anthony Donlon]
* Fix logical expressions with class objects - caching in v3Const (#4552). [Ryszard Rozak, Antmicro Ltd.]
* Fix using functions/tasks following class definition inside module (#4553). [Anthony Donlon]
* Fix large constant buffer overflow (#4556). [Varun Koyyalagunta]
* Fix instance arrays connecting to array of structs (#4557). [raphmaster]
* Fix error message for invalid parameter overrides (#4559). [Anthony Donlon]
* Fix shift to remove operation side effects (#4563).
* Fix compile warning on unused member function variable (#4567).
* Fix method narrowing conversion compiler error (#4568).
* Fix interface comparison (#4570). [Krzysztof Bieganski, Antmicro Ltd.]
* Fix dynamic triggers for named events (#4571). [Krzysztof Bieganski, Antmicro Ltd.]
* Fix dictionaries with keys of class types (#4576). [Ryszard Rozak, Antmicro Ltd.]
* Fix to not remap local assign intervals in forks (#4583). [Krzysztof Bieganski, Antmicro Ltd.]
* Fix display optimization ignoring side effects (#4585).
* Fix PLI/DPI user defined system task/function grammar (#4587) (#4588). [Quentin Corradi]
* Fix fault on empty clocking block (#4593). [Alex Mykyta]
* Fix creating implicit nets for inputs of gate primitives (#4603). [Geza Lore]
* Fix try_put method of unbounded mailbox (#4608). [Ryszard Rozak, Antmicro Ltd.]
* Fix stable name generation in V3Fork (#4615) (#4624). [Krzysztof Boroński]
* Fix virtual methods (#4616). [Ryszard Rozak, Antmicro Ltd.]
* Fix insertion at queue end (#4619). [Krzysztof Boroński]
* Fix rand fields of reference types (#4627). [Ryszard Rozak, Antmicro Ltd.]
* Fix dynamic casts of null values (#4631). [Ryszard Rozak, Antmicro Ltd.]
* Fix signals read via virtual interfaces being misoptimized (#4645). [Krzysztof Bieganski, Antmicro Ltd.]
* Fix handling of static keyword in methods (#4649). [Ryszard Rozak, Antmicro Ltd.]
* Fix preprocessor to show `line 2 on resumed file.
Verilator 5.016 2023-09-16 Verilator 5.016 2023-09-16
========================== ==========================
@@ -689,7 +130,7 @@ Verilator 5.012 2023-06-13
* Optimize VPI callValueCbs (#4155). [Hennadii Chernyshchyk] * Optimize VPI callValueCbs (#4155). [Hennadii Chernyshchyk]
* Configure for faster C++ linking using 'mold', if it is installed. * Configure for faster C++ linking using 'mold', if it is installed.
* Fix crash on duplicate imported modules (#3231). [Robert Balas] * Fix crash on duplicate imported modules (#3231). [Robert Balas]
* Fix false WIDTHEXPAND on array declarations (#3959). [Jose Tejada] * Fix false WIDTHEXPAND on array declarations (#3959). [JOTEGO]
* Fix marking overridden methods as coroutines (#4120) (#4169). [Krzysztof Bieganski, Antmicro Ltd] * Fix marking overridden methods as coroutines (#4120) (#4169). [Krzysztof Bieganski, Antmicro Ltd]
* Fix SystemC signal copy macro use (#4135). [Josep Sans] * Fix SystemC signal copy macro use (#4135). [Josep Sans]
* Fix duplicate static names in blocks in functions (#4144) (#4160). [Stefan Wallentowitz] * Fix duplicate static names in blocks in functions (#4144) (#4160). [Stefan Wallentowitz]
@@ -705,7 +146,7 @@ Verilator 5.012 2023-06-13
* Fix wide structure VL_TOSTRING_W generation (#4188) (#4189). [Aylon Chaim Porat] * Fix wide structure VL_TOSTRING_W generation (#4188) (#4189). [Aylon Chaim Porat]
* Fix references to members of parameterized base classes (#4196). [Ryszard Rozak, Antmicro Ltd] * Fix references to members of parameterized base classes (#4196). [Ryszard Rozak, Antmicro Ltd]
* Fix tracing undefined alignment (#4201) (#4288) [John Wehle] * Fix tracing undefined alignment (#4201) (#4288) [John Wehle]
* Fix class-specific same methods for AstVarScope, AstVar, and AstScope (#4203) (#4250). [John Wehle] * Fix class specific same methods for AstVarScope, AstVar, and AstScope (#4203) (#4250). [John Wehle]
* Fix dotted references in parameterized classes (#4206). [Ryszard Rozak, Antmicro Ltd] * Fix dotted references in parameterized classes (#4206). [Ryszard Rozak, Antmicro Ltd]
* Fix bit selections under parameterized classes (#4210). [Ryszard Rozak, Antmicro Ltd] * Fix bit selections under parameterized classes (#4210). [Ryszard Rozak, Antmicro Ltd]
* Fix duplicate std:: declaration with -I (#4215). [Harald Pretl] * Fix duplicate std:: declaration with -I (#4215). [Harald Pretl]
@@ -861,7 +302,7 @@ Verilator 5.006 2023-01-22
**Minor:** **Minor:**
* Support clocking blocks (#3674). [Krzysztof Bieganski, Antmicro Ltd] * Support clocking blocks (#3674). [Krzysztof Bieganski, Antmicro Ltd]
* Support unpacked structs (#3802). [Aleksander Kiryk, Antmicro Ltd] * Support packed structs (#3802). [Aleksander Kiryk, Antmicro Ltd]
* Support Windows-native builds using cmake (#3814). [Kritik Bhimani] * Support Windows-native builds using cmake (#3814). [Kritik Bhimani]
* Support p format for UnpackArray (#3877). [Aleksander Kiryk, Antmicro Ltd] * Support p format for UnpackArray (#3877). [Aleksander Kiryk, Antmicro Ltd]
* Support property calls without parenthesis (#3879) (#3893). [Ryszard Rozak, Antmicro Ltd] * Support property calls without parenthesis (#3879) (#3893). [Ryszard Rozak, Antmicro Ltd]
@@ -993,7 +434,7 @@ Verilator 5.002 2022-10-29
* Fix null access on optimized-out fork statements (#3658). [Krzysztof Bieganski, Antmicro Ltd] * Fix null access on optimized-out fork statements (#3658). [Krzysztof Bieganski, Antmicro Ltd]
* Fix VPI inline module naming mismatch (#3690) (#3694). [Jiuyang Liu] * Fix VPI inline module naming mismatch (#3690) (#3694). [Jiuyang Liu]
* Fix deadlock in timeprecision when using SystemC (#3707). [Kamil Rakoczy, Antmicro Ltd] * Fix deadlock in timeprecision when using SystemC (#3707). [Kamil Rakoczy, Antmicro Ltd]
* Fix width mismatch on inside operator (#3714). [Àlex Torregrosa] * Fix width mismatch on inside operator (#3714). [Alex Torregrosa]
Verilator 4.228 2022-10-01 Verilator 4.228 2022-10-01
@@ -1223,7 +664,7 @@ Verilator 4.214 2021-10-17
* Fix removing if statement with side effect in condition (#3131). [Alexander Grobman] * Fix removing if statement with side effect in condition (#3131). [Alexander Grobman]
* Fix --waiver-output for multiline warnings (#2429) (#3141). [Keith Colbert] * Fix --waiver-output for multiline warnings (#2429) (#3141). [Keith Colbert]
* Fix internal error on bad widths (#3140) (#3145). [Zhanglei Wang] * Fix internal error on bad widths (#3140) (#3145). [Zhanglei Wang]
* Fix crash on clang 12/13 (#3148). [Kuoping Hsu] * Fix crash on clang 12/13 (#3148). [Kouping Hsu]
* Fix cygwin compile error due to missing -std=gnu++14 (#3149). [Sun Kim] * Fix cygwin compile error due to missing -std=gnu++14 (#3149). [Sun Kim]
* Fix $urandom_range when the range is 0 ... UINT_MAX (#3161). [Iru Cai] * Fix $urandom_range when the range is 0 ... UINT_MAX (#3161). [Iru Cai]
* Fix constructor-parameter argument comma-separation in C++ (#3162). [Matthew Ballance] * Fix constructor-parameter argument comma-separation in C++ (#3162). [Matthew Ballance]
@@ -1338,12 +779,12 @@ Verilator 4.202 2021-04-24
* Mark --no-relative-cfuncs as scheduled for deprecation. * Mark --no-relative-cfuncs as scheduled for deprecation.
* Add --coverage-max-width (#2853). [xuejiazidi] * Add --coverage-max-width (#2853). [xuejiazidi]
* Add VerilatedCovContext::forcePerInstance (#2793). [Kevin Laeufer] * Add VerilatedCovContext::forcePerInstance (#2793). [Kevin Laeufer]
* Add FST SystemC tracing (#2806). [Àlex Torregrosa] * Add FST SystemC tracing (#2806). [Alex Torregrosa]
* Add PINNOTFOUND warning in place of error (#2868). [Udi Finkelstein] * Add PINNOTFOUND warning in place of error (#2868). [Udi Finkelstein]
* Support overlaps in priority case statements (#2864). [Rupert Swarbrick] * Support overlaps in priority case statements (#2864). [Rupert Swarbrick]
* Support for null ports (#2875). [Udi Finkelstein] * Support for null ports (#2875). [Udi Finkelstein]
* Fix class unpacked-array compile error (#2774). [Iru Cai] * Fix class unpacked-array compile error (#2774). [Iru Cai]
* Fix scope types in FST and VCD traces (#2805). [Àlex Torregrosa] * Fix scope types in FST and VCD traces (#2805). [Alex Torregrosa]
* Fix exceeding command-line ar limit (#2834). [Yinan Xu] * Fix exceeding command-line ar limit (#2834). [Yinan Xu]
* Fix false $dumpfile warning on model save (#2834). [Yinan Xu] * Fix false $dumpfile warning on model save (#2834). [Yinan Xu]
* Fix --timescale-override not suppressing TIMESCALEMOD (#2838). [Kaleb Barrett] * Fix --timescale-override not suppressing TIMESCALEMOD (#2838). [Kaleb Barrett]
@@ -1400,7 +841,7 @@ Verilator 4.110 2021-02-25
**Minor:** **Minor:**
* Support concat selection (#2721). * Support concat selection (#2721).
* Support struct scopes when dumping structs to VCD (#2776) [Àlex Torregrosa] * Support struct scopes when dumping structs to VCD (#2776) [Alex Torregrosa]
* Generate SELRANGE for potentially unreachable code (#2625) (#2754) [Pierre-Henri Horrein] * Generate SELRANGE for potentially unreachable code (#2625) (#2754) [Pierre-Henri Horrein]
* For --flatten, override inlining of public and no_inline modules (#2761) [James Hanlon] * For --flatten, override inlining of public and no_inline modules (#2761) [James Hanlon]
* Fix little endian interface pin swizzling (#2475). [Don Owen] * Fix little endian interface pin swizzling (#2475). [Don Owen]
@@ -1411,7 +852,7 @@ Verilator 4.110 2021-02-25
* Fix class extends with VM_PARALLEL_BUILDS (#2775). [Iru Cai] * Fix class extends with VM_PARALLEL_BUILDS (#2775). [Iru Cai]
* Fix shifts by > 32 bit values (#2785). [qrq992] * Fix shifts by > 32 bit values (#2785). [qrq992]
* Fix examples not flushing vcd (#2787). [Richard E George] * Fix examples not flushing vcd (#2787). [Richard E George]
* Fix little endian packed array pattern assignment (#2795). [Àlex Torregrosa] * Fix little endian packed array pattern assignment (#2795). [Alex Torregrosa]
Verilator 4.108 2021-01-10 Verilator 4.108 2021-01-10
@@ -1752,7 +1193,6 @@ Verilator 4.026 2020-01-11
* Fix expand optimization slowing --lint-only. Closes #2091. [Thomas Watts] * Fix expand optimization slowing --lint-only. Closes #2091. [Thomas Watts]
* Fix %{number}s with strings. #2093. [agrobman] * Fix %{number}s with strings. #2093. [agrobman]
* Fix shebang breaking some shells. Closes #2067. [zdave] * Fix shebang breaking some shells. Closes #2067. [zdave]
* Fix errors on using string in incorrect format (#5240). [John Demme]
Verilator 4.024 2019-12-08 Verilator 4.024 2019-12-08
@@ -1888,7 +1328,7 @@ Verilator 4.014 2019-05-08
**Minor:** **Minor:**
* Add --trace-fst-thread. * Add --trace-fst-thread.
* Support '#' comments in $readmem. (#1411) [Frédéric Requin] * Support '#' comments in $readmem. (#1411) [Frederick Requin]
* Support "'dx" constants. (#1423) [Udi Finkelstein] * Support "'dx" constants. (#1423) [Udi Finkelstein]
* For FST tracing use LZ4 compression. [Tony Bybell] * For FST tracing use LZ4 compression. [Tony Bybell]
* Add error when use parameters without value. (#1424) [Peter Gerst] * Add error when use parameters without value. (#1424) [Peter Gerst]
@@ -2158,19 +1598,19 @@ Verilator 3.912 2017-09-23
**Minor:** **Minor:**
* Support or/and/xor array intrinsic methods. (#1210) [Michael Popoloski] * Support or/and/xor array intrinsic methods. (#1210) [Mike Popoloski]
* Support package export. (#1217) [Usuario Eda] * Support package export. (#1217) [Usuario Eda]
* Support module port parameters without defaults. (#1213) [Michael Popoloski] * Support module port parameters without defaults. (#1213) [Mike Popoloski]
* Add performance information to --stats file. * Add performance information to --stats file.
* Simplify VL_CONST_W macro generation for faster compiles. * Simplify VL_CONST_W macro generation for faster compiles.
* Optimize improvements for Shift-And, and replication constructs. * Optimize improvements for Shift-And, and replication constructs.
* Fix ordering of arrayed cell wide connections. (#1202 partial) [Michael Popoloski] * Fix ordering of arrayed cell wide connections. (#1202 partial) [Mike Popoloski]
* Fix LITENDIAN warning on arrayed cells. (#1202) [Michael Popoloski] * Fix LITENDIAN warning on arrayed cells. (#1202) [Mike Popoloski]
* Fix enum ranges without colons. (#1204) [Michael Popoloski] * Fix enum ranges without colons. (#1204) [Mike Popoloski]
* Fix GCC noreturn compile error. (#1209) [Michael Popoloski] * Fix GCC noreturn compile error. (#1209) [Mike Popoloski]
* Fix constant function default parameters. (#1211) [Michael Popoloski] * Fix constant function default parameters. (#1211) [Mike Popoloski]
* Fix non-colon array of interface modports. (#1212) [Michael Popoloski] * Fix non-colon array of interface modports. (#1212) [Mike Popoloski]
* Fix .name connections on interfaces. (#1214) [Michael Popoloski] * Fix .name connections on interfaces. (#1214) [Mike Popoloski]
* Fix wide array indices causing compile error. * Fix wide array indices causing compile error.
@@ -2292,8 +1732,8 @@ Verilator 3.888 2016-10-14
**Minor:** **Minor:**
* Add --no-decoration to remove output comments, msg2015. [Frédéric Requin] * Add --no-decoration to remove output comments, msg2015. [Frederic Requin]
* If VM_PARALLEL_BUILDS=1, use OPT_FAST and OPT_SLOW. [Frédéric Requin] * If VM_PARALLEL_BUILDS=1, use OPT_FAST and OPT_SLOW. [Frederic Requin]
Set VM_DEFAULT_RULES=0 for old behavior. Set VM_DEFAULT_RULES=0 for old behavior.
* Add error on DPI functions > 32 bits. (#1898) [Elliot Mednick] * Add error on DPI functions > 32 bits. (#1898) [Elliot Mednick]
* Improve Verilation performance on internal strings. (#1896) [Johan Bjork] * Improve Verilation performance on internal strings. (#1896) [Johan Bjork]
@@ -2329,7 +1769,7 @@ Verilator 3.884 2016-05-18
* Fix --output-split of constructors. (#1035) [Johan Bjork] * Fix --output-split of constructors. (#1035) [Johan Bjork]
* Fix removal of empty packages, modules and cells. (#1034) [Johan Bjork] * Fix removal of empty packages, modules and cells. (#1034) [Johan Bjork]
* Fix core dump on Arch Linux/GCC 6.1.1. (#1058) [Jannis Harder] * Fix core dump on Arch Linux/GCC 6.1.1. (#1058) [Jannis Harder]
* Fix $value$plusargs to string. (#1880) [Frédéric Requin] * Fix $value$plusargs to string. (#1880) [Frederic Requin]
Verilator 3.882 2016-03-01 Verilator 3.882 2016-03-01
@@ -2408,13 +1848,13 @@ Verilator 3.876 2015-08-12
**Minor:** **Minor:**
* Add tracing_on, etc to vlt files. (#932) [Frédéric Requin] * Add tracing_on, etc to vlt files. (#932) [Frederic Requin]
* Support extraction of enum bits. (#951) [Jonathon Donaldson] * Support extraction of enum bits. (#951) [Jonathon Donaldson]
* Fix MinGW compiler error. (#927) (#929) [Hans Tichelaar] * Fix MinGW compiler error. (#927) (#929) [Hans Tichelaar]
* Fix .c files to be treated as .cpp. (#930) [Jonathon Donaldson] * Fix .c files to be treated as .cpp. (#930) [Jonathon Donaldson]
* Fix string-to-int space conversion. (#931) [Fabrizio Ferrandi] * Fix string-to-int space conversion. (#931) [Fabrizio Ferrandi]
* Fix dpi imports inside generates. [Michael Tresidder] * Fix dpi imports inside generates. [Michael Tresidder]
* Fix rounding in trace $timescale. (#946) [Frédéric Requin] * Fix rounding in trace $timescale. (#946) [Frederic Requin]
* Fix $fopen with SV string. (#947) [Sven Stucki] * Fix $fopen with SV string. (#947) [Sven Stucki]
* Fix hashed error with typedef inside block. (#948) [Sven Stucki] * Fix hashed error with typedef inside block. (#948) [Sven Stucki]
* Fix makefile with --coverage. (#953) [Eivind Liland] * Fix makefile with --coverage. (#953) [Eivind Liland]
@@ -2654,7 +2094,7 @@ Verilator 3.852 2013-09-29
* Support named function and task arguments. [Chris Randall] * Support named function and task arguments. [Chris Randall]
* Report SELRANGE warning for non-generate if. (#675) [Roland Kruse] * Report SELRANGE warning for non-generate if. (#675) [Roland Kruse]
* Fix ordering of $fgetc. (#1808) [Frédéric Requin] * Fix ordering of $fgetc. (#1808) [Frederic Requin]
* Fix --output-split-cfunc to count internal functions. [Chris Randall] * Fix --output-split-cfunc to count internal functions. [Chris Randall]
* Fix crash on 32-bit Ubuntu. (#670) [Mark Jackson Pulver] * Fix crash on 32-bit Ubuntu. (#670) [Mark Jackson Pulver]
@@ -2722,7 +2162,7 @@ Verilator 3.846 2013-03-09
* Fix DETECTARRAY on packed structures. (#610) [Jeremy Bennett] * Fix DETECTARRAY on packed structures. (#610) [Jeremy Bennett]
* Fix LITENDIAN on unpacked structures. (#614) [Wai Sum Mong] * Fix LITENDIAN on unpacked structures. (#614) [Wai Sum Mong]
* Fix 32-bit OS VPI scan issue. (#615) [Jeremy Bennett, Rich Porter] * Fix 32-bit OS VPI scan issue. (#615) [Jeremy Bennett, Rich Porter]
* Fix opening a VerilatedVcdC file multiple times. (#1774) [Frédéric Requin] * Fix opening a VerilatedVcdC file multiple times. (#1774) [Frederic Requin]
* Fix UNOPTFLAT circular array bounds crossing. (#630) [Jie Xu] * Fix UNOPTFLAT circular array bounds crossing. (#630) [Jie Xu]
@@ -4034,7 +3474,7 @@ Verilator 3.460 2005-07-27 Beta
* Fix false warning when a clock is constant. * Fix false warning when a clock is constant.
* Fix X/Z in decimal numbers. [Wim Michiels] * Fix X/Z in decimal numbers. [Wim Michiels]
* Fix genvar statements in non-named generate blocks. * Fix genvar statements in non-named generate blocks.
* Fix core dump when missing newline in `define. [David van der Bokke] * Fix core dump when missing newline in `define. [David van der bokke]
Verilator 3.450 2005-07-12 Verilator 3.450 2005-07-12
@@ -4930,7 +4370,7 @@ Verilator 0.0 1994-07-08
Copyright Copyright
========= =========
Copyright 2001-2025 by Wilson Snyder. This program is free software; you Copyright 2001-2023 by Wilson Snyder. This program is free software; you
can redistribute it and/or modify it under the terms of either the GNU 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 Lesser General Public License Version 3 or the Perl Artistic License
Version 2.0. Version 2.0.
+60 -158
View File
@@ -7,7 +7,7 @@
# #
#***************************************************************************** #*****************************************************************************
# #
# Copyright 2003-2025 by Wilson Snyder. This program is free software; you # Copyright 2003-2023 by Wilson Snyder. This program is free software; you
# can redistribute it and/or modify it under the terms of either the GNU # 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 # Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0. # Version 2.0.
@@ -52,7 +52,6 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@ INSTALL_DATA = @INSTALL_DATA@
MAKEINFO = makeinfo MAKEINFO = makeinfo
POD2TEXT = pod2text POD2TEXT = pod2text
PYTHON3 = @PYTHON3@
MKINSTALLDIRS = $(SHELL) $(srcdir)/src/mkinstalldirs MKINSTALLDIRS = $(SHELL) $(srcdir)/src/mkinstalldirs
# Version (for docs/guide/conf.py) # Version (for docs/guide/conf.py)
@@ -77,7 +76,7 @@ datadir = @datadir@
# Directory in which to install documentation info files. # Directory in which to install documentation info files.
infodir = @infodir@ infodir = @infodir@
# Directory in which to install package-specific files # Directory in which to install package specific files
# Generally ${prefix}/share/verilator # Generally ${prefix}/share/verilator
pkgdatadir = @pkgdatadir@ pkgdatadir = @pkgdatadir@
@@ -92,12 +91,10 @@ datarootdir = @datarootdir@
CFG_WITH_CCWARN = @CFG_WITH_CCWARN@ CFG_WITH_CCWARN = @CFG_WITH_CCWARN@
CFG_WITH_DEFENV = @CFG_WITH_DEFENV@ CFG_WITH_DEFENV = @CFG_WITH_DEFENV@
CFG_WITH_LONGTESTS = @CFG_WITH_LONGTESTS@ CFG_WITH_LONGTESTS = @CFG_WITH_LONGTESTS@
CFG_WITH_SOLVER = @CFG_WITH_SOLVER@
PACKAGE_VERSION = @PACKAGE_VERSION@ PACKAGE_VERSION = @PACKAGE_VERSION@
#### End of system configuration section. #### #### End of system configuration section. ####
###################################################################### ######################################################################
# Main build targets
.SUFFIXES: .SUFFIXES:
@@ -115,7 +112,7 @@ SUBDIRS = docs src test_regress \
examples/make_tracing_c \ examples/make_tracing_c \
examples/make_tracing_sc \ examples/make_tracing_sc \
examples/make_protect_lib \ examples/make_protect_lib \
examples/json_py \ examples/xml_py \
INFOS = verilator.html verilator.pdf INFOS = verilator.html verilator.pdf
@@ -148,9 +145,6 @@ verilator_exe verilator_bin$(EXEEXT) verilator_bin_dbg$(EXEEXT) verilator_covera
@echo "making verilator in src" @echo "making verilator in src"
$(MAKE) -C src $(OBJCACHE_JOBS) $(MAKE) -C src $(OBJCACHE_JOBS)
######################################################################
# Tests
.PHONY:msg_test .PHONY:msg_test
msg_test: all_nomsg msg_test: all_nomsg
@echo "Build complete!" @echo "Build complete!"
@@ -161,7 +155,7 @@ msg_test: all_nomsg
.PHONY: test .PHONY: test
ifeq ($(CFG_WITH_LONGTESTS),yes) # Local... Else don't burden users ifeq ($(CFG_WITH_LONGTESTS),yes) # Local... Else don't burden users
test: smoke-test test_regress test: smoke-test test_regress
# examples is part of test_regress's test_regress/t/t_a2_examples.py # examples is part of test_regress's test_regress/t/t_a2_examples.pl
# (because that allows it to run in parallel with other test_regress's) # (because that allows it to run in parallel with other test_regress's)
else else
test: smoke-test examples test: smoke-test examples
@@ -173,24 +167,17 @@ endif
@echo @echo
smoke-test: all_nomsg smoke-test: all_nomsg
test_regress/t/t_a1_first_cc.py test_regress/t/t_a1_first_cc.pl
test_regress/t/t_a2_first_sc.py test_regress/t/t_a2_first_sc.pl
test_regress: all_nomsg test_regress: all_nomsg
$(MAKE) -C test_regress $(MAKE) -C test_regress
.PHONY: test-snap test-diff
test-snap test-diff:
$(MAKE) -C test_regress $@
examples: all_nomsg examples: all_nomsg
for p in $(EXAMPLES) ; do \ for p in $(EXAMPLES) ; do \
$(MAKE) -C $$p VERILATOR_ROOT=`pwd` || exit 10; \ $(MAKE) -C $$p VERILATOR_ROOT=`pwd` || exit 10; \
done done
######################################################################
# Docs
.PHONY: docs .PHONY: docs
docs: info docs: info
@@ -212,35 +199,11 @@ verilator.html:
verilator.pdf: Makefile verilator.pdf: Makefile
$(MAKE) -C docs verilator.pdf $(MAKE) -C docs verilator.pdf
TAGFILES=${srcdir}/*/*.cpp ${srcdir}/*/*.h ${srcdir}/*/*.in \ # See uninstall also - don't put wildcards in this variable, it might uninstall other stuff
${srcdir}/*.in ${srcdir}/*.pod VL_INST_BIN_FILES = verilator verilator_bin$(EXEEXT) verilator_bin_dbg$(EXEEXT) verilator_coverage_bin_dbg$(EXEEXT) \
verilator_ccache_report verilator_coverage verilator_difftree verilator_gantt verilator_includer verilator_profcfunc
TAGS: $(TAGFILES) # Some scripts go into both the search path and pkgdatadir,
etags $(TAGFILES) # so they can be found by the user, and under $VERILATOR_ROOT.
.PHONY: doxygen
doxygen:
$(MAKE) -C docs doxygen
######################################################################
# Install
# Public executables intended to be invoked directly by the user
# Don't put wildcards in these variables, it might cause an uninstall of other stuff
VL_INST_PUBLIC_SCRIPT_FILES = verilator \
verilator_coverage \
verilator_gantt \
verilator_profcfunc \
VL_INST_PUBLIC_BIN_FILES = verilator_bin$(EXEEXT) \
verilator_bin_dbg$(EXEEXT) \
verilator_coverage_bin_dbg$(EXEEXT) \
# Private executabels intended to be invoked by internals
# Don't put wildcards in these variables, it might cause an uninstall of other stuff
VL_INST_PRIVATE_SCRIPT_FILES = verilator_ccache_report \
verilator_includer \
VL_INST_INC_BLDDIR_FILES = \ VL_INST_INC_BLDDIR_FILES = \
include/verilated_config.h \ include/verilated_config.h \
@@ -249,7 +212,6 @@ VL_INST_INC_BLDDIR_FILES = \
# Files under srcdir, instead of build time # Files under srcdir, instead of build time
VL_INST_INC_SRCDIR_FILES = \ VL_INST_INC_SRCDIR_FILES = \
include/*.[chv]* \ include/*.[chv]* \
include/*.vlt \
include/*.sv \ include/*.sv \
include/gtkwave/*.[chv]* \ include/gtkwave/*.[chv]* \
include/vltstd/*.[chv]* \ include/vltstd/*.[chv]* \
@@ -260,38 +222,19 @@ VL_INST_DATA_SRCDIR_FILES = \
examples/*/Makefile* \ examples/*/Makefile* \
examples/*/vl_* \ examples/*/vl_* \
mkbindirs: installbin:
$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/bin
$(MKINSTALLDIRS) $(DESTDIR)$(bindir) $(MKINSTALLDIRS) $(DESTDIR)$(bindir)
( cd ${srcdir}/bin ; $(INSTALL_PROGRAM) verilator $(DESTDIR)$(bindir)/verilator )
installbin: | mkbindirs ( cd ${srcdir}/bin ; $(INSTALL_PROGRAM) verilator_coverage $(DESTDIR)$(bindir)/verilator_coverage )
cd $(srcdir)/bin; \ ( cd ${srcdir}/bin ; $(INSTALL_PROGRAM) verilator_gantt $(DESTDIR)$(bindir)/verilator_gantt )
for p in $(VL_INST_PUBLIC_SCRIPT_FILES) ; do \ ( cd ${srcdir}/bin ; $(INSTALL_PROGRAM) verilator_profcfunc $(DESTDIR)$(bindir)/verilator_profcfunc )
$(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p; \ ( cd bin ; $(INSTALL_PROGRAM) verilator_bin$(EXEEXT) $(DESTDIR)$(bindir)/verilator_bin$(EXEEXT) )
done ( cd bin ; $(INSTALL_PROGRAM) verilator_bin_dbg$(EXEEXT) $(DESTDIR)$(bindir)/verilator_bin_dbg$(EXEEXT) )
perl -p -i -e 'use File::Spec;' \ ( cd bin ; $(INSTALL_PROGRAM) verilator_coverage_bin_dbg$(EXEEXT) $(DESTDIR)$(bindir)/verilator_coverage_bin_dbg$(EXEEXT) )
-e' $$path = File::Spec->abs2rel("$(realpath $(DESTDIR)$(pkgdatadir))", "$(realpath $(DESTDIR)$(bindir))");' \ $(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/bin
-e 's/my \$$verilator_pkgdatadir_relpath = .*/my \$$verilator_pkgdatadir_relpath = "$$path";/g' \ ( cd ${srcdir}/bin ; $(INSTALL_PROGRAM) verilator_includer $(DESTDIR)$(pkgdatadir)/bin/verilator_includer )
-- "$(DESTDIR)/$(bindir)/verilator" ( cd ${srcdir}/bin ; $(INSTALL_PROGRAM) verilator_ccache_report $(DESTDIR)$(pkgdatadir)/bin/verilator_ccache_report )
cd bin; \ ( cd ${srcdir}/bin ; $(INSTALL_PROGRAM) verilator_difftree $(DESTDIR)$(pkgdatadir)/bin/verilator_difftree )
for p in $(VL_INST_PUBLIC_BIN_FILES) ; do \
$(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p; \
done
cd $(srcdir)/bin; \
for p in $(VL_INST_PRIVATE_SCRIPT_FILES) ; do \
$(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkgdatadir)/bin/$$p; \
done
installredirect: installbin | mkbindirs
cp ${srcdir}/bin/redirect ${srcdir}/bin/redirect.tmp
perl -p -i -e 'use File::Spec;' \
-e' $$path = File::Spec->abs2rel("$(realpath $(DESTDIR)$(bindir))", "$(realpath $(DESTDIR)$(pkgdatadir)/bin)");' \
-e 's/RELPATH.*/"$$path";/g' -- "${srcdir}/bin/redirect.tmp"
cd $(srcdir)/bin; \
for p in $(VL_INST_PUBLIC_SCRIPT_FILES) $(VL_INST_PUBLIC_BIN_FILES) ; do \
$(INSTALL_PROGRAM) redirect.tmp $(DESTDIR)$(pkgdatadir)/bin/$$p; \
done
rm ${srcdir}/bin/redirect.tmp
# Man files can either be part of the original kit, or built in current directory # Man files can either be part of the original kit, or built in current directory
# So important we use $^ so VPATH is searched # So important we use $^ so VPATH is searched
@@ -322,7 +265,7 @@ installdata:
$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/examples/cmake_tracing_c $(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/examples/cmake_tracing_c
$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/examples/cmake_tracing_sc $(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/examples/cmake_tracing_sc
$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/examples/cmake_protect_lib $(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/examples/cmake_protect_lib
$(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/examples/json_py $(MKINSTALLDIRS) $(DESTDIR)$(pkgdatadir)/examples/xml_py
cd $(srcdir) \ cd $(srcdir) \
; for p in $(VL_INST_DATA_SRCDIR_FILES) ; do \ ; for p in $(VL_INST_DATA_SRCDIR_FILES) ; do \
$(INSTALL_DATA) $$p $(DESTDIR)$(pkgdatadir)/$$p; \ $(INSTALL_DATA) $$p $(DESTDIR)$(pkgdatadir)/$$p; \
@@ -334,11 +277,8 @@ installdata:
# We don't trust rm -rf, so rmdir instead as it will fail if user put in other files # We don't trust rm -rf, so rmdir instead as it will fail if user put in other files
uninstall: uninstall:
-cd $(DESTDIR)$(bindir) && rm -f $(VL_INST_PUBLIC_SCRIPT_FILES) -cd $(DESTDIR)$(bindir) && rm -f $(VL_INST_BIN_FILES)
-cd $(DESTDIR)$(bindir) && rm -f $(VL_INST_PUBLIC_BIN_FILES) -cd $(DESTDIR)$(pkgdatadir)/bin && rm -f $(VL_INST_BIN_FILES)
-cd $(DESTDIR)$(pkgdatadir)/bin && rm -f $(VL_INST_PUBLIC_SCRIPT_FILES)
-cd $(DESTDIR)$(pkgdatadir)/bin && rm -f $(VL_INST_PUBLIC_BIN_FILES)
-cd $(DESTDIR)$(pkgdatadir)/bin && rm -f $(VL_INST_PRIVATE_SCRIPT_FILES)
-cd $(DESTDIR)$(mandir)/man1 && rm -f $(VL_INST_MAN_FILES) -cd $(DESTDIR)$(mandir)/man1 && rm -f $(VL_INST_MAN_FILES)
-cd $(DESTDIR)$(pkgdatadir) && rm -f $(VL_INST_INC_BLDDIR_FILES) -cd $(DESTDIR)$(pkgdatadir) && rm -f $(VL_INST_INC_BLDDIR_FILES)
-cd $(DESTDIR)$(pkgdatadir) && rm -f $(VL_INST_INC_SRCDIR_FILES) -cd $(DESTDIR)$(pkgdatadir) && rm -f $(VL_INST_INC_SRCDIR_FILES)
@@ -361,29 +301,16 @@ uninstall:
-rmdir $(DESTDIR)$(pkgdatadir)/examples/cmake_tracing_c -rmdir $(DESTDIR)$(pkgdatadir)/examples/cmake_tracing_c
-rmdir $(DESTDIR)$(pkgdatadir)/examples/cmake_tracing_sc -rmdir $(DESTDIR)$(pkgdatadir)/examples/cmake_tracing_sc
-rmdir $(DESTDIR)$(pkgdatadir)/examples/cmake_protect_lib -rmdir $(DESTDIR)$(pkgdatadir)/examples/cmake_protect_lib
-rmdir $(DESTDIR)$(pkgdatadir)/examples/json_py -rmdir $(DESTDIR)$(pkgdatadir)/examples/xml_py
-rmdir $(DESTDIR)$(pkgdatadir)/examples -rmdir $(DESTDIR)$(pkgdatadir)/examples
-rmdir $(DESTDIR)$(pkgdatadir) -rmdir $(DESTDIR)$(pkgdatadir)
-rmdir $(DESTDIR)$(pkgconfigdir) -rmdir $(DESTDIR)$(pkgconfigdir)
install: all_nomsg install-all install: all_nomsg install-all
install-all: installbin installredirect installman installdata install-msg install-all: installbin installman installdata install-msg
install-here: installman info install-here: installman info
install-msg:
@echo
@echo "Installed binaries to $(DESTDIR)$(bindir)/verilator"
@echo "Installed man to $(DESTDIR)$(mandir)/man1"
@echo "Installed examples to $(DESTDIR)$(pkgdatadir)/examples"
@echo
@echo "For documentation see 'man verilator' or 'verilator --help'"
@echo "For forums and to report bugs see https://verilator.org"
@echo
######################################################################
# Format/Lint
# Use --xml flag to see the cppcheck code to use for suppression # Use --xml flag to see the cppcheck code to use for suppression
CPPCHECK1_CPP = $(wildcard $(srcdir)/include/*.cpp) CPPCHECK1_CPP = $(wildcard $(srcdir)/include/*.cpp)
CPPCHECK2_CPP = $(wildcard $(srcdir)/examples/*/*.cpp) CPPCHECK2_CPP = $(wildcard $(srcdir)/examples/*/*.cpp)
@@ -409,7 +336,7 @@ CPPCHECK_FLAGS = --enable=all --inline-suppr \
--suppress=useStlAlgorithm --suppress=useStlAlgorithm
CPPCHECK_FLAGS += --xml CPPCHECK_FLAGS += --xml
CPPCHECK_DEP = $(subst .cpp,.cppcheck,$(CHECK_CPP)) CPPCHECK_DEP = $(subst .cpp,.cppcheck,$(CHECK_CPP))
CPPCHECK_INC = -I$(srcdir)/include -I$(srcdir)/include/gtkwave -I$(srcdir)/include/vltstd -I$(srcdir)/src/obj_dbg -I$(srcdir)/src CPPCHECK_INC = -I$(srcdir)/include -I$(srcdir)/src/obj_dbg -I$(srcdir)/src
cppcheck: cppcheck-1 cppcheck-2 cppcheck-3 cppcheck-4 cppcheck-5 cppcheck-6 cppcheck-7 cppcheck-8 cppcheck: cppcheck-1 cppcheck-2 cppcheck-3 cppcheck-4 cppcheck-5 cppcheck-6 cppcheck-7 cppcheck-8
cppcheck-1: cppcheck-1:
@@ -451,40 +378,25 @@ analyzer-include:
-rm -rf examples/*/obj* -rm -rf examples/*/obj*
scan-build $(MAKE) -k examples scan-build $(MAKE) -k examples
format: format: clang-format yapf format-pl-exec
$(MAKE) -j 4 format-c format-py format-exec
CLANGFORMAT = clang-format-14 CLANGFORMAT = clang-format-14
CLANGFORMAT_FLAGS = -i CLANGFORMAT_FLAGS = -i
CLANGFORMAT_FILES = $(CHECK_CPP) $(CHECK_H) $(CHECK_YL) test_regress/t/*.c* test_regress/t/*.h CLANGFORMAT_FILES = $(CHECK_CPP) $(CHECK_H) $(CHECK_YL) test_regress/t/*.c* test_regress/t/*.h
format-c clang-format: clang-format:
@$(CLANGFORMAT) --version | egrep 14.0 > /dev/null \ @$(CLANGFORMAT) --version | egrep 14.0 > /dev/null \
|| echo "*** You are not using clang-format-14, indents may differ from master's ***" || echo "*** You are not using clang-format-14, indents may differ from master's ***"
$(CLANGFORMAT) $(CLANGFORMAT_FLAGS) $(CLANGFORMAT_FILES) $(CLANGFORMAT) $(CLANGFORMAT_FLAGS) $(CLANGFORMAT_FILES)
YAMLFIX = YAMLFIX_WHITELINES=1 YAMLFIX_LINE_LENGTH=130 YAMLFIX_preserve_quotes=true yamlfix
yamlfix:
$(YAMLFIX) .
# CMake files
CMAKE_FILES = \
CMakeLists.txt \
examples/*/CMakeLists.txt \
src/CMakeLists.txt \
test_regress/CMakeLists.txt \
*.cmake.in \
# Python programs, subject to format and lint
PY_PROGRAMS = \ PY_PROGRAMS = \
bin/verilator_ccache_report \ bin/verilator_ccache_report \
bin/verilator_difftree \ bin/verilator_difftree \
bin/verilator_gantt \ bin/verilator_gantt \
bin/verilator_includer \ bin/verilator_includer \
bin/verilator_profcfunc \ bin/verilator_profcfunc \
examples/json_py/vl_file_copy \ examples/xml_py/vl_file_copy \
examples/json_py/vl_hier_graph \ examples/xml_py/vl_hier_graph \
docs/guide/conf.py \ docs/guide/conf.py \
docs/bin/vl_sphinx_extract \ docs/bin/vl_sphinx_extract \
docs/bin/vl_sphinx_fix \ docs/bin/vl_sphinx_fix \
@@ -494,8 +406,6 @@ PY_PROGRAMS = \
src/cppcheck_filtered \ src/cppcheck_filtered \
src/flexfix \ src/flexfix \
src/vlcovgen \ src/vlcovgen \
src/.gdbinit.py \
test_regress/*.py \
test_regress/t/*.pf \ test_regress/t/*.pf \
nodist/clang_check_attributes \ nodist/clang_check_attributes \
nodist/code_coverage \ nodist/code_coverage \
@@ -503,55 +413,39 @@ PY_PROGRAMS = \
nodist/fuzzer/actual_fail \ nodist/fuzzer/actual_fail \
nodist/fuzzer/generate_dictionary \ nodist/fuzzer/generate_dictionary \
nodist/install_test \ nodist/install_test \
nodist/log_changes \
# Python files, subject to format but not lint
PY_FILES = \ PY_FILES = \
$(PY_PROGRAMS) \ $(PY_PROGRAMS) \
nodist/code_coverage.dat \ nodist/code_coverage.dat \
test_regress/t/*.py \
# Python files, test_regress tests
PY_TEST_FILES = \
test_regress/t/*.py \
YAPF = yapf3 YAPF = yapf3
YAPF_FLAGS = -i --parallel YAPF_FLAGS = -i
format-py yapf: yapf:
$(YAPF) $(YAPF_FLAGS) $(PY_FILES) $(YAPF) $(YAPF_FLAGS) $(PY_FILES)
GERSEMI = gersemi
GERSEMI_FLAGS = -i
format-cmake:
$(GERSEMI) $(GERSEMI_FLAGS) $(CMAKE_FILES)
PYLINT = pylint PYLINT = pylint
PYLINT_FLAGS = --recursive=n --score=n --disable=R0801 PYLINT_FLAGS = --score=n --disable=R0801
PYLINT_TEST_FLAGS = $(PYLINT_FLAGS) --disable=C0103,C0114,C0116,C0209,C0411,C0413,C0301,R0801,R0912,R0915,R0916,R1702,W0511,W0621
RUFF = ruff RUFF = ruff
RUFF_FLAGS = check --ignore=E402,E501,E701 RUFF_FLAGS = check --ignore=E402,E501,E701
# "make -k" so can see all tool result errors
lint-py: lint-py:
$(MAKE) -k lint-py-pylint lint-py-pylint-tests lint-py-ruff -$(PYLINT) $(PYLINT_FLAGS) $(PY_PROGRAMS)
-$(RUFF) $(RUFF_FLAGS) $(PY_PROGRAMS)
lint-py-pylint: format-pl-exec:
$(PYLINT) $(PYLINT_FLAGS) $(PY_PROGRAMS) -chmod a+x test_regress/t/*.pl
lint-py-pylint-tests: install-msg:
$(PYLINT) $(PYLINT_TEST_FLAGS) $(PY_TEST_FILES) | $(PYTHON3) nodist/lint_py_test_filter @echo
@echo "Installed binaries to $(DESTDIR)$(bindir)/verilator"
lint-py-ruff: @echo "Installed man to $(DESTDIR)$(mandir)/man1"
$(RUFF) $(RUFF_FLAGS) $(PY_PROGRAMS) @echo "Installed examples to $(DESTDIR)$(pkgdatadir)/examples"
@echo
format-exec: @echo "For documentation see 'man verilator' or 'verilator --help'"
-chmod a+x test_regress/t/*.py @echo "For forums and to report bugs see https://verilator.org"
@echo
######################################################################
# Configure
IN_WILD := ${srcdir}/*.in ${srcdir}/*/*.in IN_WILD := ${srcdir}/*.in ${srcdir}/*/*.in
@@ -572,9 +466,6 @@ else
autoconf autoconf
endif endif
######################################################################
# Clean
maintainer-clean:: maintainer-clean::
@echo "This command is intended for maintainers to use;" @echo "This command is intended for maintainers to use;"
@echo "rebuilding the deleted files requires autoconf." @echo "rebuilding the deleted files requires autoconf."
@@ -605,6 +496,17 @@ distclean maintainer-clean::
rm -f bin/verilator_bin* bin/verilator_coverage_bin* rm -f bin/verilator_bin* bin/verilator_coverage_bin*
rm -f include/verilated.mk include/verilated_config.h rm -f include/verilated.mk include/verilated_config.h
TAGFILES=${srcdir}/*/*.cpp ${srcdir}/*/*.h ${srcdir}/*/*.in \
${srcdir}/*.in ${srcdir}/*.pod
TAGS: $(TAGFILES)
etags $(TAGFILES)
.PHONY: doxygen
doxygen:
$(MAKE) -C docs doxygen
###################################################################### ######################################################################
# Distributions # Distributions
+20 -19
View File
@@ -1,21 +1,21 @@
.. Github doesn't render images unless absolute URL .. Github doesn't render images unless absolute URL
.. Do not know of a conditional tag, "only: github" nor "github display" works .. Do not know of a conditional tag, "only: github" nor "github display" works
|badge1| |badge2| |badge3| |badge4| |badge5| |badge6| |badge7| .. image:: https://img.shields.io/badge/Website-Verilator.org-181717.svg
.. |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 .. 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 .. 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 .. 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 .. 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
.. |badge6| image:: https://api.codacy.com/project/badge/Grade/fa78caa433c84a4ab9049c43e9debc6f .. image:: https://api.codacy.com/project/badge/Grade/fa78caa433c84a4ab9049c43e9debc6f
:target: https://www.codacy.com/gh/verilator/verilator :target: https://www.codacy.com/gh/verilator/verilator
.. |badge7| image:: https://github.com/verilator/verilator/workflows/build/badge.svg .. image:: https://codecov.io/gh/verilator/verilator/branch/master/graph/badge.svg
:target: https://codecov.io/gh/verilator/verilator
.. 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
@@ -66,9 +66,9 @@ executable performs the design simulation. Verilator also supports linking
Verilated generated libraries, optionally encrypted, into other simulators. Verilated generated libraries, optionally encrypted, into other simulators.
Verilator may not be the best choice if you are expecting a full-featured Verilator may not be the best choice if you are expecting a full-featured
replacement for a closed-source Verilog simulator, need SDF annotation, replacement for a closed-source Verilog simulator, needs SDF annotation,
mixed-signal simulation, or are doing a quick class project (we recommend mixed-signal simulation, or are doing a quick class project (we recommend
`Icarus Verilog`_ for classwork). However, if you are looking for a path `Icarus Verilog`_ for classwork.) However, if you are looking for a path
to migrate SystemVerilog to C++/SystemC, or want high-speed simulation of to migrate SystemVerilog to C++/SystemC, or want high-speed simulation of
designs, Verilator is the tool for you. designs, Verilator is the tool for you.
@@ -80,16 +80,17 @@ Verilator does not directly translate Verilog HDL to C++ or SystemC. Rather,
Verilator compiles your code into a much faster optimized and optionally Verilator compiles your code into a much faster optimized and optionally
thread-partitioned model, which is in turn wrapped inside a C++/SystemC 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 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 single-thread over 10x faster than standalone SystemC, and on a single
thread is about 100 times faster than interpreted Verilog simulators such thread is about 100 times faster than interpreted Verilog simulators such
as `Icarus Verilog`_. Another 2-10x speedup might be gained from as `Icarus Verilog`_. Another 2-10x speedup might be gained from
multithreading (yielding 200-1000x total over interpreted simulators). multithreading (yielding 200-1000x total over interpreted simulators).
Verilator has typically similar or better performance versus closed-source Verilator has typically similar or better performance versus the
Verilog simulators (e.g., Aldec Riviera-Pro, Cadence Incisive/NC-Verilog, closed-source Verilog simulators (e.g., Carbon Design Systems Carbonator,
Mentor ModelSim/Questa, Synopsys VCS, VTOC, and Pragmatic CVer/CVC). But, Modelsim/Questa, Cadence Incisive/NC-Verilog, Synopsys VCS, VTOC, and
Verilator is open-sourced, so you can spend on computes rather than Pragmatic CVer/CVC). But, Verilator is open-sourced, so you can spend on
licenses. Thus, Verilator gives you the best simulation cycles/dollar. computes rather than licenses. Thus, Verilator gives you the best
simulation cycles/dollar.
Installation & Documentation Installation & Documentation
@@ -141,7 +142,7 @@ Related Projects
Open License Open License
============ ============
Verilator is Copyright 2003-2025 by Wilson Snyder. (Report bugs to Verilator is Copyright 2003-2023 by Wilson Snyder. (Report bugs to
`Verilator Issues <https://verilator.org/issues>`_.) `Verilator Issues <https://verilator.org/issues>`_.)
Verilator is free software; you can redistribute it and/or modify it under Verilator is free software; you can redistribute it and/or modify it under
@@ -149,7 +150,7 @@ 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. Perl Artistic License Version 2.0. See the documentation for more details.
.. _CHIPS Alliance: https://chipsalliance.org .. _CHIPS Alliance: https://chipsalliance.org
.. _Icarus Verilog: https://steveicarus.github.io/iverilog .. _Icarus Verilog: http://iverilog.icarus.com
.. _Linux Foundation: https://www.linuxfoundation.org .. _Linux Foundation: https://www.linuxfoundation.org
.. |Logo| image:: https://www.veripool.org/img/verilator_256_200_min.png .. |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 multithreaded performance| image:: https://www.veripool.org/img/verilator_multithreaded_performance_bg-min.png
-22
View File
@@ -1,22 +0,0 @@
#!/usr/bin/env perl
######################################################################
#
# Copyright 2003-2025 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
#
######################################################################
require 5.006_001;
use warnings;
use FindBin qw($RealBin $RealScript);
use strict;
my $relpath = RELPATH; # Substituted during Verilator 'make install'
unshift @ARGV, $RealScript;
exec { "$RealBin/$relpath/$RealScript" } @ARGV;
die "%Error: Exec failed,";
+42 -84
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env perl #!/usr/bin/env perl
###################################################################### ######################################################################
# #
# Copyright 2003-2025 by Wilson Snyder. This program is free software; you # Copyright 2003-2023 by Wilson Snyder. This program is free software; you
# can redistribute it and/or modify it under the terms of either the GNU # 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 # Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0. # Version 2.0.
@@ -15,7 +15,6 @@ use Getopt::Long;
use FindBin qw($RealBin $RealScript); use FindBin qw($RealBin $RealScript);
use IO::File; use IO::File;
use Pod::Usage; use Pod::Usage;
use Cwd qw(realpath);
use strict; use strict;
use vars qw($Debug @Opt_Verilator_Sw); use vars qw($Debug @Opt_Verilator_Sw);
@@ -33,7 +32,6 @@ my $opt_rr;
my $opt_gdbbt; my $opt_gdbbt;
my $opt_quiet_exit; my $opt_quiet_exit;
my $opt_unlimited_stack = 1; my $opt_unlimited_stack = 1;
my $opt_valgrind;
# No arguments can't do anything useful. Give help # No arguments can't do anything useful. Give help
if ($#ARGV < 0) { if ($#ARGV < 0) {
@@ -58,31 +56,15 @@ if (! GetOptions(
# Switches # Switches
"gdb!" => \$opt_gdb, "gdb!" => \$opt_gdb,
"gdbbt!" => \$opt_gdbbt, "gdbbt!" => \$opt_gdbbt,
"quiet!" => \$opt_quiet_exit, # As -quiet implies -quiet-exit
"quiet-exit!" => \$opt_quiet_exit, "quiet-exit!" => \$opt_quiet_exit,
"rr!" => \$opt_rr, "rr!" => \$opt_rr,
"unlimited-stack!" => \$opt_unlimited_stack, "unlimited-stack!" => \$opt_unlimited_stack,
"valgrind!" => \$opt_valgrind,
# Additional parameters # Additional parameters
"<>" => sub {}, # Ignored "<>" => sub {}, # Ignored
)) { )) {
pod2usage(-exitstatus => 2, -verbose => 0); pod2usage(-exitstatus => 2, -verbose => 0);
} }
# WARNING: $verilator_pkgdatadir_relpath is substituted during Verilator 'make install'
my $verilator_pkgdatadir_relpath = "..";
my $verilator_root = realpath("$RealBin/$verilator_pkgdatadir_relpath");
if (defined $ENV{VERILATOR_ROOT}) {
if ((!-d $ENV{VERILATOR_ROOT}) || $verilator_root ne realpath($ENV{VERILATOR_ROOT})) {
warn "%Error: verilator: VERILATOR_ROOT is set to inconsistent path. Suggest leaving it unset.\n";
warn "%Error: VERILATOR_ROOT=$ENV{VERILATOR_ROOT}\n";
exit 1;
}
} else {
print "export VERILATOR_ROOT='$verilator_root'\n" if $Debug;
$ENV{VERILATOR_ROOT} = $verilator_root;
}
if ($opt_gdbbt && !gdb_works()) { if ($opt_gdbbt && !gdb_works()) {
warn "-Info: --gdbbt ignored: gdb doesn't seem to be working\n" if $Debug; warn "-Info: --gdbbt ignored: gdb doesn't seem to be working\n" if $Debug;
$opt_gdbbt = 0; $opt_gdbbt = 0;
@@ -127,18 +109,6 @@ if ($opt_gdb) {
. " -ex \"run " . join(' ', @quoted_sw)."\"" . " -ex \"run " . join(' ', @quoted_sw)."\""
. " -ex 'set width 0'" . " -ex 'set width 0'"
. " -ex 'bt' -ex 'quit'"); . " -ex 'bt' -ex 'quit'");
} elsif ($opt_valgrind) {
# Run under valgrind
my $valgrind_bin = ($ENV{VERILATOR_VALGRIND} || "valgrind --error-exitcode=1 --max-stackframe=2815880"
# Magic number sugested by valgrind, may need to be increased in future
# if you get warnings. See: https://valgrind.org/docs/manual/manual-core.html#opt.max-stackframe
);
run (ulimit_stack_unlimited()
. aslr_off()
. $valgrind_bin
. " " . verilator_bin()
. " " . join(' ', @quoted_sw));
} elsif ($Debug) { } elsif ($Debug) {
# Debug # Debug
run(ulimit_stack_unlimited() run(ulimit_stack_unlimited()
@@ -167,13 +137,30 @@ sub debug {
# Builds # Builds
sub verilator_bin { sub verilator_bin {
my $bin = "";
# Use VERILATOR_ROOT if defined, else assume verilator_bin is in the search path
my $basename = ($ENV{VERILATOR_BIN} my $basename = ($ENV{VERILATOR_BIN}
|| ($Debug ? "verilator_bin_dbg" : "verilator_bin")); || ($Debug ? "verilator_bin_dbg" : "verilator_bin"));
if (-x "$RealBin/$basename" || -x "$RealBin/$basename.exe") { if (defined($ENV{VERILATOR_ROOT})) {
return "$RealBin/$basename"; my $dir = $ENV{VERILATOR_ROOT};
if (-x "$dir/bin/$basename"
|| -x "$dir/bin/$basename.exe") { # From a "make install" into VERILATOR_ROOT
$bin = "$dir/bin/$basename";
} else {
$bin = "$dir/$basename"; # From pointing to kit directory
}
} else { } else {
return $basename; # Find in PATH if (-x "$RealBin/$basename"
|| -x "$RealBin/$basename.exe") {
$bin = "$RealBin/$basename"; # From path/to/verilator with verilator_bin installed
} else {
$bin = $basename; # Find in PATH
}
# Note we don't look under bin/$basename which would be right if running
# in the kit dir. Running that would likely break, since
# VERILATOR_ROOT wouldn't be set and Verilator won't find internal files.
} }
return $bin;
} }
####################################################################### #######################################################################
@@ -311,9 +298,7 @@ detailed descriptions of these arguments.
+1800-2009ext+<ext> Use SystemVerilog 2009 with file extension <ext> +1800-2009ext+<ext> Use SystemVerilog 2009 with file extension <ext>
+1800-2012ext+<ext> Use SystemVerilog 2012 with file extension <ext> +1800-2012ext+<ext> Use SystemVerilog 2012 with file extension <ext>
+1800-2017ext+<ext> Use SystemVerilog 2017 with file extension <ext> +1800-2017ext+<ext> Use SystemVerilog 2017 with file extension <ext>
+1800-2023ext+<ext> Use SystemVerilog 2023 with file extension <ext>
--assert Enable all assertions --assert Enable all assertions
--assert-case Enable unique/unique0/priority case related checks
--autoflush Flush streams after all $displays --autoflush Flush streams after all $displays
--bbox-sys Blackbox unknown $system calls --bbox-sys Blackbox unknown $system calls
--bbox-unsup Blackbox unsupported language features --bbox-unsup Blackbox unsupported language features
@@ -322,11 +307,11 @@ detailed descriptions of these arguments.
--build-dep-bin <filename> Override build dependency Verilator binary --build-dep-bin <filename> Override build dependency Verilator binary
--build-jobs <jobs> Parallelism for --build --build-jobs <jobs> Parallelism for --build
--cc Create C++ output --cc Create C++ output
--cdc Clock domain crossing analysis
-CFLAGS <flags> C++ compiler arguments for makefile -CFLAGS <flags> C++ compiler arguments for makefile
--clk <signal-name> Mark specified signal as clock --clk <signal-name> Mark specified signal as clock
--no-clk <signal-name> Prevent marking specified signal as clock --no-clk <signal-name> Prevent marking specified signal as clock
--compiler <compiler-name> Tune for specified C++ compiler --compiler <compiler-name> Tune for specified C++ compiler
--compiler-include Include additional header in the precompiled one
--converge-limit <loops> Tune convergence settle time --converge-limit <loops> Tune convergence settle time
--coverage Enable all coverage --coverage Enable all coverage
--coverage-line Enable line coverage --coverage-line Enable line coverage
@@ -340,8 +325,7 @@ detailed descriptions of these arguments.
--no-debug-leak Disable leaking memory in --debug mode --no-debug-leak Disable leaking memory in --debug mode
--debugi <level> Enable debugging at a specified level --debugi <level> Enable debugging at a specified level
--debugi-<srcfile> <level> Enable debugging a source file at a level --debugi-<srcfile> <level> Enable debugging a source file at a level
--decorations <level> Set output comment and spacing level --no-decoration Disable comments and symbol decorations
--no-decoration Disable comments and lower spacing level
--default-language <lang> Default language to parse --default-language <lang> Default language to parse
+define+<var>=<value> Set preprocessor define +define+<var>=<value> Set preprocessor define
--dpi-hdr-only Only produce the DPI header file --dpi-hdr-only Only produce the DPI header file
@@ -350,16 +334,12 @@ detailed descriptions of these arguments.
--dump-graph Enable dumping V3Graphs to .dot files --dump-graph Enable dumping V3Graphs to .dot files
--dump-tree Enable dumping Ast .tree files --dump-tree Enable dumping Ast .tree files
--dump-tree-addrids Use short identifiers instead of addresses --dump-tree-addrids Use short identifiers instead of addresses
--dump-tree-dot Enable dumping Ast .tree.dot debug files
--dump-tree-json Enable dumping Ast .tree.json files and .tree.meta.json file
--dump-<srcfile> Enable dumping everything in source file --dump-<srcfile> Enable dumping everything in source file
--dumpi-dfg <level> Enable dumping DfgGraphs to .dot files at level --dumpi-dfg <level> Enable dumping DfgGraphs to .dot files at level
--dumpi-graph <level> Enable dumping V3Graphs to .dot files at level --dumpi-graph <level> Enable dumping V3Graphs to .dot files at level
--dumpi-tree <level> Enable dumping Ast .tree files at level --dumpi-tree <level> Enable dumping Ast .tree files at level
--dumpi-tree-json <level> Enable dumping Ast .tree.json files at level
--dumpi-<srcfile> <level> Enable dumping everything in source file at level --dumpi-<srcfile> <level> Enable dumping everything in source file at level
-E Preprocess, but do not compile -E Preprocess, but do not compile
--emit-accessors Emit getter and setter methods for model top class
--error-limit <value> Abort after this number of errors --error-limit <value> Abort after this number of errors
--exe Link to create executable --exe Link to create executable
--expand-limit <value> Set expand optimization limit --expand-limit <value> Set expand optimization limit
@@ -367,8 +347,6 @@ detailed descriptions of these arguments.
-f <file> Parse arguments from a file -f <file> Parse arguments from a file
-FI <file> Force include of a file -FI <file> Force include of a file
--flatten Force inlining of all modules, tasks and functions --flatten Force inlining of all modules, tasks and functions
--future0 <option> Ignore an option for compatibility
--future1 <option> Ignore an option with argument for compatibility
-fno-<optimization> Disable internal optimization stage -fno-<optimization> Disable internal optimization stage
-G<name>=<value> Overwrite top-level parameter -G<name>=<value> Overwrite top-level parameter
--gate-stmts <value> Tune gate optimizer depth --gate-stmts <value> Tune gate optimizer depth
@@ -377,9 +355,8 @@ detailed descriptions of these arguments.
--generate-key Create random key for --protect-key --generate-key Create random key for --protect-key
--getenv <var> Get environment variable with defaults --getenv <var> Get environment variable with defaults
--get-supported <feature> Get if feature is supported --get-supported <feature> Get if feature is supported
--help Show this help --help Display this help
--hierarchical Enable hierarchical Verilation --hierarchical Enable hierarchical Verilation
--hierarchical-params-file <name> Internal option that specifies parameters file for hier blocks
-I<dir> Directory to search for includes -I<dir> Directory to search for includes
--if-depth <value> Tune IFDEPTH warning --if-depth <value> Tune IFDEPTH warning
+incdir+<dir> Directory to search for includes +incdir+<dir> Directory to search for includes
@@ -392,7 +369,6 @@ detailed descriptions of these arguments.
--lib-create <name> Create a DPI library --lib-create <name> Create a DPI library
+libext+<ext>+[ext]... Extensions for finding modules +libext+<ext>+[ext]... Extensions for finding modules
--lint-only Lint, but do not make output --lint-only Lint, but do not make output
--localize-max-size <value> Tune localize optimization variable size
--make <build-tool> Generate scripts for specified build tool --make <build-tool> Generate scripts for specified build tool
-MAKEFLAGS <flags> Arguments to pass to make during --build -MAKEFLAGS <flags> Arguments to pass to make during --build
--main Generate C++ main() file --main Generate C++ main() file
@@ -407,16 +383,14 @@ detailed descriptions of these arguments.
-O3 High-performance optimizations -O3 High-performance optimizations
-O<optimization-letter> Selectable optimizations -O<optimization-letter> Selectable optimizations
-o <executable> Name of final executable -o <executable> Name of final executable
--output-groups <numfiles> Group .cpp files into larger ones --no-order-clock-delay Disable ordering clock enable assignments
--output-split <statements> Split .cpp files into pieces --output-split <statements> Split .cpp files into pieces
--output-split-cfuncs <statements> Split model functions --output-split-cfuncs <statements> Split model functions
--output-split-ctrace <statements> Split tracing functions --output-split-ctrace <statements> Split tracing functions
-P Disable line numbers and blanks with -E -P Disable line numbers and blanks with -E
--pins-bv <bits> Specify types for top-level ports --pins-bv <bits> Specify types for top-level ports
--pins-inout-enables Specify that __en and __out signals be created for inouts
--pins-sc-biguint Specify types for top-level ports --pins-sc-biguint Specify types for top-level ports
--pins-sc-uint Specify types for top-level ports --pins-sc-uint Specify types for top-level ports
--pins-sc-uint-bool Specify types for top-level ports
--pins-uint8 Specify types for top-level ports --pins-uint8 Specify types for top-level ports
--no-pins64 Don't use uint64_t's for 33-64 bit sigs --no-pins64 Don't use uint64_t's for 33-64 bit sigs
--pipe-filter <command> Filter all input through a script --pipe-filter <command> Filter all input through a script
@@ -430,31 +404,24 @@ detailed descriptions of these arguments.
--protect-ids Hash identifier names for obscurity --protect-ids Hash identifier names for obscurity
--protect-key <key> Key for symbol protection --protect-key <key> Key for symbol protection
--protect-lib <name> Create a DPI protected library --protect-lib <name> Create a DPI protected library
--public Mark signals as public; see docs --public Debugging; see docs
--public-depth <level> Mark public to specified module depth
--public-params Mark all parameters as public_flat --public-params Mark all parameters as public_flat
--public-flat-rw Mark all variables, etc as public_flat_rw --public-flat-rw Mark all variables, etc as public_flat_rw
-pvalue+<name>=<value> Overwrite toplevel parameter -pvalue+<name>=<value> Overwrite toplevel parameter
--quiet Minimize additional printing
--quiet-exit Don't print the command on failure --quiet-exit Don't print the command on failure
--quiet-stats Don't print statistics
--relative-includes Resolve includes relative to current file --relative-includes Resolve includes relative to current file
--reloop-limit Minimum iterations for forming loops --reloop-limit Minimum iterations for forming loops
--report-unoptflat Extra diagnostics for UNOPTFLAT --report-unoptflat Extra diagnostics for UNOPTFLAT
--rr Run Verilator and record with rr --rr Run Verilator and record with rr
--runtime-debug Enable model runtime debugging
--savable Enable model save-restore --savable Enable model save-restore
--sc Create SystemC output --sc Create SystemC output
--no-skip-identical Disable skipping identical output --no-skip-identical Disable skipping identical output
--stats Create statistics file --stats Create statistics file
--stats-vars Provide statistics on variables --stats-vars Provide statistics on variables
--no-std Prevent loading standard files --no-std Prevent parsing standard library
--no-std-package Prevent parsing standard package
--no-std-waiver Prevent parsing standard lint waivers
--no-stop-fail Do not call $stop when assertion fails
--structs-packed Convert all unpacked structures to packed structures --structs-packed Convert all unpacked structures to packed structures
-sv Enable SystemVerilog parsing -sv Enable SystemVerilog parsing
+systemverilogext+<ext> Synonym for +1800-2023ext+<ext> +systemverilogext+<ext> Synonym for +1800-2017ext+<ext>
--threads <threads> Enable multithreading --threads <threads> Enable multithreading
--threads-dpi <mode> Enable multithreaded DPI --threads-dpi <mode> Enable multithreaded DPI
--threads-max-mtasks <mtasks> Tune maximum mtask partitioning --threads-max-mtasks <mtasks> Tune maximum mtask partitioning
@@ -468,8 +435,8 @@ detailed descriptions of these arguments.
--trace-coverage Enable tracing of coverage --trace-coverage Enable tracing of coverage
--trace-depth <levels> Depth of tracing --trace-depth <levels> Depth of tracing
--trace-fst Enable FST waveform creation --trace-fst Enable FST waveform creation
--trace-max-array <depth> Maximum array depth for tracing --trace-max-array <depth> Maximum bit width for tracing
--trace-max-width <width> Maximum bit width for tracing --trace-max-width <width> Maximum array depth for tracing
--trace-params Enable tracing of parameters --trace-params Enable tracing of parameters
--trace-structs Enable tracing structure names --trace-structs Enable tracing structure names
--trace-threads <threads> Enable FST waveform creation on separate threads --trace-threads <threads> Enable FST waveform creation on separate threads
@@ -482,15 +449,13 @@ detailed descriptions of these arguments.
--unused-regexp <regexp> Tune UNUSED lint signals --unused-regexp <regexp> Tune UNUSED lint signals
-V Verbose version and config -V Verbose version and config
-v <filename> Verilog library -v <filename> Verilog library
--valgrind Run Verilator under valgrind
--verilate-jobs Job threads for Verilation stage --verilate-jobs Job threads for Verilation stage
--no-verilate Skip Verilation and just compile previously Verilated code --no-verilate Skip Verilation and just compile previously Verilated code
+verilog1995ext+<ext> Synonym for +1364-1995ext+<ext> +verilog1995ext+<ext> Synonym for +1364-1995ext+<ext>
+verilog2001ext+<ext> Synonym for +1364-2001ext+<ext> +verilog2001ext+<ext> Synonym for +1364-2001ext+<ext>
--version Show program version and exits --version Displays program version and exits
--vpi Enable VPI compiles --vpi Enable VPI compiles
--waiver-multiline Create multiline --match for waivers --waiver-output <filename> Create a waiver file based on the linter warnings
--waiver-output <filename> Create a waiver file based on linter warnings
-Wall Enable all style warnings -Wall Enable all style warnings
-Werror-<message> Convert warnings to errors -Werror-<message> Convert warnings to errors
-Wfuture-<message> Disable unknown message warnings -Wfuture-<message> Disable unknown message warnings
@@ -506,11 +471,6 @@ detailed descriptions of these arguments.
--x-assign <mode> Assign non-initial Xs to this value --x-assign <mode> Assign non-initial Xs to this value
--x-initial <mode> Assign initial Xs to this value --x-initial <mode> Assign initial Xs to this value
--x-initial-edge Enable initial X->0 and X->1 edge triggers --x-initial-edge Enable initial X->0 and X->1 edge triggers
--no-json-edit-nums Don't dump editNum in .tree.json files
--no-json-ids Don't use short identifiers instead of adresses/paths in .tree.json
--json-only Create JSON parser output (.tree.json and .meta.json)
--json-only-output .tree.json output filename
--json-only-meta-output .tree.meta.json output filename
--xml-only Create XML parser output --xml-only Create XML parser output
--xml-output XML output filename --xml-output XML output filename
-y <dir> Directory to search for modules -y <dir> Directory to search for modules
@@ -522,28 +482,26 @@ description of these arguments.
=for VL_SPHINX_EXTRACT "_build/gen/args_verilated.rst" =for VL_SPHINX_EXTRACT "_build/gen/args_verilated.rst"
+verilator+debug Enable debugging +verilator+debug Enable debugging
+verilator+debugi+<value> Enable debugging at a level +verilator+debugi+<value> Enable debugging at a level
+verilator+coverage+file+<filename> Set coverage output filename +verilator+error+limit+<value> Set error limit
+verilator+error+limit+<value> Set error limit +verilator+help Display help
+verilator+help Show help +verilator+noassert Disable assert checking
+verilator+noassert Disable assert checking
+verilator+prof+exec+file+<filename> Set execution profile filename +verilator+prof+exec+file+<filename> Set execution profile filename
+verilator+prof+exec+start+<value> Set execution profile starting point +verilator+prof+exec+start+<value> Set execution profile starting point
+verilator+prof+exec+window+<value> Set execution profile duration +verilator+prof+exec+window+<value> Set execution profile duration
+verilator+prof+vlt+file+<filename> Set PGO profile filename +verilator+prof+vlt+file+<filename> Set PGO profile filename
+verilator+quiet Minimize additional printing +verilator+rand+reset+<value> Set random reset technique
+verilator+rand+reset+<value> Set random reset technique +verilator+seed+<value> Set random seed
+verilator+seed+<value> Set random seed +verilator+V Verbose version and config
+verilator+V Show verbose version and config +verilator+version Show version and exit
+verilator+version Show version and exit
=head1 DISTRIBUTION =head1 DISTRIBUTION
The latest version is available from L<https://verilator.org>. The latest version is available from L<https://verilator.org>.
Copyright 2003-2025 by Wilson Snyder. This program is free software; you can Copyright 2003-2023 by Wilson Snyder. This program is free software; you can
redistribute it and/or modify the Verilator internals under the terms of 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 either the GNU Lesser General Public License Version 3 or the Perl Artistic
License Version 2.0. License Version 2.0.
+17 -9
View File
@@ -16,7 +16,8 @@ parser = argparse.ArgumentParser(
For documentation see For documentation see
https://verilator.org/guide/latest/exe_verilator_ccache_report.html""", 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-2023 by Wilson Snyder. This program is free software; you
can redistribute it and/or modify it under the terms of either the GNU 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 Lesser General Public License Version 3 or the Perl Artistic License
Version 2.0. Version 2.0.
@@ -66,23 +67,30 @@ else:
wnames = max(len(_) for _ in results) + 1 wnames = max(len(_) for _ in results) + 1
wresults = max(len(_) for _ in results.values()) + 1 wresults = max(len(_) for _ in results.values()) + 1
for k in sorted(results.keys()): for k in sorted(results.keys()):
args.o.write("{:{wnames}} : {:{wresults}} : {}s\n".format(k, args.o.write("{:{wnames}} : {:{wresults}} : {}s\n".format(
results[k], k,
elapsed[k].total_seconds(), results[k],
wnames=wnames, elapsed[k].total_seconds(),
wresults=wresults)) wnames=wnames,
wresults=wresults))
args.o.write("\nSummary:\n") args.o.write("\nSummary:\n")
counts = collections.Counter(_ for _ in results.values()) counts = collections.Counter(_ for _ in results.values())
total = sum(counts.values()) total = sum(counts.values())
for k in sorted(counts.keys()): for k in sorted(counts.keys()):
c = counts[k] c = counts[k]
args.o.write("{:{width}}| {} ({:.2%})\n".format(k, c, c / total, width=wresults)) args.o.write("{:{width}}| {} ({:.2%})\n".format(k,
c,
c / total,
width=wresults))
args.o.write("\nLongest:\n") args.o.write("\nLongest:\n")
longest = sorted(list(elapsed.items()), key=lambda kv: -kv[1].total_seconds()) longest = sorted(list(elapsed.items()),
key=lambda kv: -kv[1].total_seconds())
for i, (k, v) in enumerate(longest): for i, (k, v) in enumerate(longest):
args.o.write("{:{width}}| {}s\n".format(k, v.total_seconds(), width=wnames)) args.o.write("{:{width}}| {}s\n".format(k,
v.total_seconds(),
width=wnames))
if i > 4: if i > 4:
break break
+10 -10
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env perl #!/usr/bin/env perl
###################################################################### ######################################################################
# #
# Copyright 2003-2025 by Wilson Snyder. This program is free software; you # Copyright 2003-2023 by Wilson Snyder. This program is free software; you
# can redistribute it and/or modify it under the terms of either the GNU # 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 # Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0. # Version 2.0.
@@ -154,9 +154,9 @@ verilator_coverage - Verilator coverage analyzer
verilator_coverage --annotate <obj> verilator_coverage --annotate <obj>
verilator_coverage -write merged.dat <datafiles>... verilator_coverage -write merged.dat -read <datafiles>...
verilator_coverage -write-info merged.info <datafiles>... verilator_coverage -write-info merged.info -read <datafiles>...
Verilator_coverage processes Verilated model-generated coverage reports. Verilator_coverage processes Verilated model-generated coverage reports.
@@ -177,18 +177,18 @@ L<https://verilator.org/guide/latest/exe_verilator_coverage.html>.
--write <filename> Write aggregate coverage results. --write <filename> Write aggregate coverage results.
--write-info <filename.info> Write lcov .info. --write-info <filename.info> Write lcov .info.
+libext+<ext>+<ext>... Extensions for Verilog files. +libext+I<ext>+I<ext>... Extensions for Verilog files.
+define+<var>+<value> Defines the given variable. +define+I<var>+I<value> Defines the given variable.
-D<var>=<value> Defines the given variable. -DI<var>=I<value> Defines the given variable.
+incdir+<dir> Add directory for finding include files. +incdir+I<dir> Add directory for finding include files.
-I<dir> Add directory for finding include files. -II<dir> Add directory for finding include files.
-y <dir> Specifies module search directory. -y I<dir> Specifies module search directory.
=head1 DISTRIBUTION =head1 DISTRIBUTION
The latest version is available from L<https://verilator.org>. The latest version is available from L<https://verilator.org>.
Copyright 2003-2025 by Wilson Snyder. This program is free software; you Copyright 2003-2023 by Wilson Snyder. This program is free software; you
can redistribute it and/or modify the Verilator internals under the terms 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 of either the GNU Lesser General Public License Version 3 or the Perl
Artistic License Version 2.0. Artistic License Version 2.0.
+8 -3
View File
@@ -47,7 +47,8 @@ def diff_dir(a, b):
diff_file(a, b) diff_file(a, b)
anyfile = True anyfile = True
if not anyfile: if not anyfile:
sys.stderr.write("%Warning: No .tree files found that have similar base names\n") sys.stderr.write(
"%Warning: No .tree files found that have similar base names\n")
def diff_file(a, b): def diff_file(a, b):
@@ -108,14 +109,18 @@ parser = argparse.ArgumentParser(
Verilator_difftree is used for debugging Verilator tree output files. Verilator_difftree is used for debugging Verilator tree output files.
It performs a diff between two files, or all files common between two It performs a diff between two files, or all files common between two
directories, ignoring irrelevant pointer differences.""", directories, ignoring irrelevant pointer differences.""",
epilog="""Copyright 2005-2025 by Wilson Snyder. This program is free software; you epilog=
"""Copyright 2005-2023 by Wilson Snyder. This program is free software; you
can redistribute it and/or modify it under the terms of either the GNU 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 Lesser General Public License Version 3 or the Perl Artistic License
Version 2.0. Version 2.0.
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0""") SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0""")
parser.add_argument('--debug', action='store_const', const=9, help='enable debug') parser.add_argument('--debug',
action='store_const',
const=9,
help='enable debug')
parser.add_argument('--no-lineno', parser.add_argument('--no-lineno',
action='store_false', action='store_false',
help='do not show differences in line numbering') help='do not show differences in line numbering')
+298 -340
View File
@@ -1,49 +1,52 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# pylint: disable=C0103,C0114,C0116,C0209,C0301,R0914,R0912,R0915,W0511,W0603,eval-used # pylint: disable=C0103,C0114,C0116,C0209,C0301,R0914,R0912,R0915,W0511,eval-used
###################################################################### ######################################################################
import argparse import argparse
import bisect
import collections import collections
import math import math
import re import re
import statistics import statistics
# from pprint import pprint # from pprint import pprint
Sections = [] Threads = collections.defaultdict(lambda: collections.defaultdict(lambda: {}))
LongestVcdStrValueLength = 0 Mtasks = collections.defaultdict(lambda: {})
Threads = collections.defaultdict(lambda: []) # List of records per thread id Evals = collections.defaultdict(lambda: {})
Mtasks = collections.defaultdict(lambda: {'elapsed': 0, 'end': 0}) EvalLoops = collections.defaultdict(lambda: {})
Cpus = collections.defaultdict(lambda: {'mtask_time': 0}) Global = {
Global = {'args': {}, 'cpuinfo': collections.defaultdict(lambda: {}), 'stats': {}} 'args': {},
ElapsedTime = None # total elapsed time 'cpuinfo': collections.defaultdict(lambda: {}),
ExecGraphTime = 0 # total elapsed time excuting an exec graph 'rdtsc_cycle_time': 0,
ExecGraphIntervals = [] # list of (start, end) pairs 'stats': {}
}
###################################################################### ######################################################################
def process(filename):
read_data(filename)
report()
def read_data(filename): def read_data(filename):
with open(filename, "r", encoding="utf8") as fh: with open(filename, "r", encoding="utf8") as fh:
re_thread = re.compile(r'^VLPROFTHREAD (\d+)$') re_thread = re.compile(r'^VLPROFTHREAD (\d+)$')
re_record = re.compile(r'^VLPROFEXEC (\S+) (\d+)(.*)$') re_record = re.compile(r'^VLPROFEXEC (\S+) (\d+)(.*)$')
re_payload_mtaskBegin = re.compile(r'id (\d+) predictStart (\d+) cpu (\d+)') re_payload_mtaskBegin = re.compile(
r'id (\d+) predictStart (\d+) cpu (\d+)')
re_payload_mtaskEnd = re.compile(r'id (\d+) predictCost (\d+)') re_payload_mtaskEnd = re.compile(r'id (\d+) predictCost (\d+)')
re_arg1 = re.compile(r'VLPROF arg\s+(\S+)\+([0-9.]*)\s*') re_arg1 = re.compile(r'VLPROF arg\s+(\S+)\+([0-9.]*)\s*')
re_arg2 = re.compile(r'VLPROF arg\s+(\S+)\s+([0-9.]*)\s*$') re_arg2 = re.compile(r'VLPROF arg\s+(\S+)\s+([0-9.]*)\s*$')
re_stat = re.compile(r'VLPROF stat\s+(\S+)\s+([0-9.]+)') re_stat = re.compile(r'VLPROF stat\s+(\S+)\s+([0-9.]+)')
re_time = re.compile(r'rdtsc time = (\d+) ticks')
re_proc_cpu = re.compile(r'VLPROFPROC processor\s*:\s*(\d+)\s*$') re_proc_cpu = re.compile(r'VLPROFPROC processor\s*:\s*(\d+)\s*$')
re_proc_dat = re.compile(r'VLPROFPROC ([a-z_ ]+)\s*:\s*(.*)$') re_proc_dat = re.compile(r'VLPROFPROC ([a-z_ ]+)\s*:\s*(.*)$')
cpu = None cpu = None
thread = 0 thread = None
execGraphStart = None
global LongestVcdStrValueLength lastEvalBeginTick = None
global ExecGraphTime lastEvalLoopBeginTick = None
SectionStack = []
mTaskThread = {}
for line in fh: for line in fh:
recordMatch = re_record.match(line) recordMatch = re_record.match(line)
@@ -51,53 +54,47 @@ def read_data(filename):
kind, tick, payload = recordMatch.groups() kind, tick, payload = recordMatch.groups()
tick = int(tick) tick = int(tick)
payload = payload.strip() payload = payload.strip()
if kind == "SECTION_PUSH": if kind == "EVAL_BEGIN":
LongestVcdStrValueLength = max(LongestVcdStrValueLength, len(payload)) Evals[tick]['start'] = tick
SectionStack.append(payload) lastEvalBeginTick = tick
Sections[thread].append((tick, tuple(SectionStack))) elif kind == "EVAL_END":
elif kind == "SECTION_POP": Evals[lastEvalBeginTick]['end'] = tick
assert SectionStack, "SECTION_POP without SECTION_PUSH" lastEvalBeginTick = None
SectionStack.pop() elif kind == "EVAL_LOOP_BEGIN":
Sections[thread].append((tick, tuple(SectionStack))) EvalLoops[tick]['start'] = tick
lastEvalLoopBeginTick = tick
elif kind == "EVAL_LOOP_END":
EvalLoops[lastEvalLoopBeginTick]['end'] = tick
lastEvalLoopBeginTick = None
elif kind == "MTASK_BEGIN": elif kind == "MTASK_BEGIN":
mtask, predict_start, ecpu = re_payload_mtaskBegin.match(payload).groups() mtask, predict_start, ecpu = re_payload_mtaskBegin.match(
payload).groups()
mtask = int(mtask) mtask = int(mtask)
predict_start = int(predict_start) predict_start = int(predict_start)
ecpu = int(ecpu) ecpu = int(ecpu)
mTaskThread[mtask] = thread Threads[thread][tick]['mtask'] = mtask
records = Threads[thread] Threads[thread][tick]['predict_start'] = predict_start
assert not records or records[-1]['start'] <= records[-1]['end'] <= tick Threads[thread][tick]['cpu'] = ecpu
records.append({ if 'elapsed' not in Mtasks[mtask]:
'start': tick, Mtasks[mtask] = {'end': 0, 'elapsed': 0}
'mtask': mtask,
'predict_start': predict_start,
'cpu': ecpu
})
Mtasks[mtask]['begin'] = tick Mtasks[mtask]['begin'] = tick
Mtasks[mtask]['thread'] = thread Mtasks[mtask]['thread'] = thread
Mtasks[mtask]['predict_start'] = predict_start Mtasks[mtask]['predict_start'] = predict_start
elif kind == "MTASK_END": elif kind == "MTASK_END":
mtask, predict_cost = re_payload_mtaskEnd.match(payload).groups() mtask, predict_cost = re_payload_mtaskEnd.match(
payload).groups()
mtask = int(mtask) mtask = int(mtask)
predict_cost = int(predict_cost) predict_cost = int(predict_cost)
begin = Mtasks[mtask]['begin'] begin = Mtasks[mtask]['begin']
record = Threads[mTaskThread[mtask]][-1] Threads[thread][begin]['end'] = tick
record['end'] = tick Threads[thread][begin]['predict_cost'] = predict_cost
record['predict_cost'] = predict_cost
Mtasks[mtask]['elapsed'] += tick - begin Mtasks[mtask]['elapsed'] += tick - begin
Mtasks[mtask]['predict_cost'] = predict_cost Mtasks[mtask]['predict_cost'] = predict_cost
Mtasks[mtask]['end'] = max(Mtasks[mtask]['end'], tick) Mtasks[mtask]['end'] = max(Mtasks[mtask]['end'], tick)
elif kind == "EXEC_GRAPH_BEGIN":
execGraphStart = tick
elif kind == "EXEC_GRAPH_END":
ExecGraphTime += tick - execGraphStart
ExecGraphIntervals.append((execGraphStart, tick))
execGraphStart = None
elif Args.debug: elif Args.debug:
print("-Unknown execution trace record: %s" % line) print("-Unknown execution trace record: %s" % line)
elif re_thread.match(line): elif re_thread.match(line):
thread = int(re_thread.match(line).group(1)) thread = int(re_thread.match(line).group(1))
Sections.append([])
elif re.match(r'^VLPROF(THREAD|VERSION)', line): elif re.match(r'^VLPROF(THREAD|VERSION)', line):
pass pass
elif re_arg1.match(line): elif re_arg1.match(line):
@@ -112,7 +109,7 @@ def read_data(filename):
elif re_proc_cpu.match(line): elif re_proc_cpu.match(line):
match = re_proc_cpu.match(line) match = re_proc_cpu.match(line)
cpu = int(match.group(1)) cpu = int(match.group(1))
elif cpu is not None and re_proc_dat.match(line): elif cpu and re_proc_dat.match(line):
match = re_proc_dat.match(line) match = re_proc_dat.match(line)
term = match.group(1) term = match.group(1)
value = match.group(2) value = match.group(2)
@@ -124,6 +121,11 @@ def read_data(filename):
pass pass
elif Args.debug: elif Args.debug:
print("-Unk: %s" % line) print("-Unk: %s" % line)
# TODO -- this is parsing text printed by a client.
# Really, verilator proper should generate this
# if it's useful...
if re_time.match(line):
Global['rdtsc_cycle_time'] = re_time.group(1)
def re_match_result(regexp, line, result_to): def re_match_result(regexp, line, result_to):
@@ -142,50 +144,34 @@ def report():
plus = "+" if re.match(r'^\+', arg) else " " plus = "+" if re.match(r'^\+', arg) else " "
print(" %s%s%s" % (arg, plus, Global['args'][arg])) print(" %s%s%s" % (arg, plus, Global['args'][arg]))
for records in Threads.values():
for record in records:
cpu = record['cpu']
elapsed = record['end'] - record['start']
Cpus[cpu]['mtask_time'] += elapsed
global ElapsedTime
ElapsedTime = int(Global['stats']['ticks'])
nthreads = int(Global['stats']['threads']) nthreads = int(Global['stats']['threads'])
ncpus = max(len(Cpus), 1) Global['cpus'] = {}
for thread in Threads:
# Make potentially multiple characters per column
for start in Threads[thread]:
if not Threads[thread][start]:
continue
cpu = Threads[thread][start]['cpu']
elapsed = Threads[thread][start]['end'] - start
if cpu not in Global['cpus']:
Global['cpus'][cpu] = {'cpu_time': 0}
Global['cpus'][cpu]['cpu_time'] += elapsed
print("\nSummary:") measured_mt_mtask_time = 0
print(" Total elapsed time = {} rdtsc ticks".format(ElapsedTime)) predict_mt_mtask_time = 0
print(" Parallelized code = {:.2%} of elapsed time".format(ExecGraphTime / ElapsedTime)) long_mtask_time = 0
print(" Total threads = %d" % nthreads) measured_last_end = 0
print(" Total CPUs used = %d" % ncpus) predict_last_end = 0
print(" Total mtasks = %d" % len(Mtasks)) for mtask in Mtasks:
print(" Total yields = %d" % int(Global['stats'].get('yields', 0))) measured_mt_mtask_time += Mtasks[mtask]['elapsed']
predict_mt_mtask_time += Mtasks[mtask]['predict_cost']
report_mtasks() measured_last_end = max(measured_last_end, Mtasks[mtask]['end'])
report_cpus() predict_last_end = max(
report_sections() predict_last_end,
Mtasks[mtask]['predict_start'] + Mtasks[mtask]['predict_cost'])
if nthreads > ncpus: long_mtask_time = max(long_mtask_time, Mtasks[mtask]['elapsed'])
print() Global['measured_last_end'] = measured_last_end
print("%%Warning: There were fewer CPUs (%d) than threads (%d)." % (ncpus, nthreads)) Global['predict_last_end'] = predict_last_end
print(" : See docs on use of numactl.")
else:
if 'cpu_socket_cores_warning' in Global:
print()
print("%Warning: Multiple threads scheduled on same hyperthreaded core.")
print(" : See docs on use of numactl.")
if 'cpu_sockets_warning' in Global:
print()
print("%Warning: Threads scheduled on multiple sockets.")
print(" : See docs on use of numactl.")
print()
def report_mtasks():
if not Mtasks:
return
nthreads = int(Global['stats']['threads'])
# If we know cycle time in the same (rdtsc) units, # If we know cycle time in the same (rdtsc) units,
# this will give us an actual utilization number, # this will give us an actual utilization number,
@@ -195,110 +181,130 @@ def report_mtasks():
# serial mode, to estimate the overhead of data sharing, # serial mode, to estimate the overhead of data sharing,
# which will show up in the total elapsed time. (Overhead # which will show up in the total elapsed time. (Overhead
# of synchronization and scheduling should not.) # of synchronization and scheduling should not.)
total_mtask_time = 0 print("\nAnalysis:")
thread_mtask_time = collections.defaultdict(lambda: 0) print(" Total threads = %d" % nthreads)
long_mtask_time = 0 print(" Total mtasks = %d" % len(Mtasks))
long_mtask = None ncpus = max(len(Global['cpus']), 1)
predict_mtask_time = 0 print(" Total cpus used = %d" % ncpus)
predict_elapsed = 0 print(" Total yields = %d" %
for mtaskId in Mtasks: int(Global['stats'].get('yields', 0)))
record = Mtasks[mtaskId] print(" Total evals = %d" % len(Evals))
predict_mtask_time += record['predict_cost'] print(" Total eval loops = %d" % len(EvalLoops))
total_mtask_time += record['elapsed'] if Mtasks:
thread_mtask_time[record['thread']] += record['elapsed'] print(" Total eval time = %d rdtsc ticks" %
predict_end = record['predict_start'] + record['predict_cost'] Global['measured_last_end'])
predict_elapsed = max(predict_elapsed, predict_end) print(" Longest mtask time = %d rdtsc ticks" % long_mtask_time)
if record['elapsed'] > long_mtask_time: print(" All-thread mtask time = %d rdtsc ticks" %
long_mtask_time = record['elapsed'] measured_mt_mtask_time)
long_mtask = mtaskId long_efficiency = long_mtask_time / (Global.get(
Global['predict_last_end'] = predict_elapsed 'measured_last_end', 1) or 1)
print(" Longest-thread efficiency = %0.1f%%" %
(long_efficiency * 100.0))
mt_efficiency = measured_mt_mtask_time / (
Global.get('measured_last_end', 1) * nthreads or 1)
print(" All-thread efficiency = %0.1f%%" %
(mt_efficiency * 100.0))
print(" All-thread speedup = %0.1f" %
(mt_efficiency * nthreads))
if Global['rdtsc_cycle_time'] > 0:
ut = measured_mt_mtask_time / Global['rdtsc_cycle_time']
print("tot_mtask_cpu=" + measured_mt_mtask_time + " cyc=" +
Global['rdtsc_cycle_time'] + " ut=" + ut)
serialTime = ElapsedTime - ExecGraphTime predict_mt_efficiency = predict_mt_mtask_time / (
Global.get('predict_last_end', 1) * nthreads or 1)
print("\nPrediction (what Verilator used for scheduling):")
print(" All-thread efficiency = %0.1f%%" %
(predict_mt_efficiency * 100.0))
print(" All-thread speedup = %0.1f" %
(predict_mt_efficiency * nthreads))
def subReport(elapsed, work): p2e_ratios = []
print(" Thread utilization = {:7.2%}".format(work / (elapsed * nthreads))) min_p2e = 1000000
print(" Speedup = {:6.3}x".format(work / elapsed)) min_mtask = None
max_p2e = -1000000
max_mtask = None
print("\nParallelized code, measured:") for mtask in sorted(Mtasks.keys()):
subReport(ExecGraphTime, total_mtask_time) if Mtasks[mtask]['elapsed'] > 0:
if Mtasks[mtask]['predict_cost'] == 0:
Mtasks[mtask]['predict_cost'] = 1 # don't log(0) below
p2e_ratio = math.log(Mtasks[mtask]['predict_cost'] /
Mtasks[mtask]['elapsed'])
p2e_ratios.append(p2e_ratio)
print("\nParallelized code, predicted during static scheduling:") if p2e_ratio > max_p2e:
subReport(predict_elapsed, predict_mtask_time) max_p2e = p2e_ratio
max_mtask = mtask
if p2e_ratio < min_p2e:
min_p2e = p2e_ratio
min_mtask = mtask
print("\nAll code, measured:") print("\nMTask statistics:")
subReport(ElapsedTime, serialTime + total_mtask_time) print(" min log(p2e) = %0.3f" % min_p2e, end="")
print(" from mtask %d (predict %d," %
(min_mtask, Mtasks[min_mtask]['predict_cost']),
end="")
print(" elapsed %d)" % Mtasks[min_mtask]['elapsed'])
print(" max log(p2e) = %0.3f" % max_p2e, end="")
print(" from mtask %d (predict %d," %
(max_mtask, Mtasks[max_mtask]['predict_cost']),
end="")
print(" elapsed %d)" % Mtasks[max_mtask]['elapsed'])
print("\nAll code, measured, scaled by predicted speedup:") stddev = statistics.pstdev(p2e_ratios)
expectedParallelSpeedup = predict_mtask_time / predict_elapsed mean = statistics.mean(p2e_ratios)
scaledElapsed = serialTime + total_mtask_time / expectedParallelSpeedup print(" mean = %0.3f" % mean)
subReport(scaledElapsed, serialTime + total_mtask_time) print(" stddev = %0.3f" % stddev)
print(" e ^ stddev = %0.3f" % math.exp(stddev))
p2e_ratios = [] report_cpus()
min_p2e = 1000000
min_mtask = None
max_p2e = -1000000
max_mtask = None
for mtask in sorted(Mtasks.keys()): if nthreads > ncpus:
if Mtasks[mtask]['elapsed'] > 0: print()
if Mtasks[mtask]['predict_cost'] == 0: print("%%Warning: There were fewer CPUs (%d) then threads (%d)." %
Mtasks[mtask]['predict_cost'] = 1 # don't log(0) below (ncpus, nthreads))
p2e_ratio = math.log(Mtasks[mtask]['predict_cost'] / Mtasks[mtask]['elapsed']) print(" : See docs on use of numactl.")
p2e_ratios.append(p2e_ratio) else:
if 'cpu_socket_cores_warning' in Global:
if p2e_ratio > max_p2e: print()
max_p2e = p2e_ratio print(
max_mtask = mtask "%Warning: Multiple threads scheduled on same hyperthreaded core."
if p2e_ratio < min_p2e: )
min_p2e = p2e_ratio print(" : See docs on use of numactl.")
min_mtask = mtask if 'cpu_sockets_warning' in Global:
print()
print("\nMTask statistics:") print("%Warning: Threads scheduled on multiple sockets.")
print(" Longest mtask id = {}".format(long_mtask)) print(" : See docs on use of numactl.")
print(" Longest mtask time = {:.2%} of time elapsed in parallelized code".format( print()
long_mtask_time / ExecGraphTime))
print(" min log(p2e) = %0.3f" % min_p2e, end="")
print(" from mtask %d (predict %d," % (min_mtask, Mtasks[min_mtask]['predict_cost']), end="")
print(" elapsed %d)" % Mtasks[min_mtask]['elapsed'])
print(" max log(p2e) = %0.3f" % max_p2e, end="")
print(" from mtask %d (predict %d," % (max_mtask, Mtasks[max_mtask]['predict_cost']), end="")
print(" elapsed %d)" % Mtasks[max_mtask]['elapsed'])
stddev = statistics.pstdev(p2e_ratios)
mean = statistics.mean(p2e_ratios)
print(" mean = %0.3f" % mean)
print(" stddev = %0.3f" % stddev)
print(" e ^ stddev = %0.3f" % math.exp(stddev))
def report_cpus(): def report_cpus():
print("\nCPU info:") print("\nCPUs:")
Global['cpu_sockets'] = collections.defaultdict(lambda: 0) Global['cpu_sockets'] = collections.defaultdict(lambda: 0)
Global['cpu_socket_cores'] = collections.defaultdict(lambda: 0) Global['cpu_socket_cores'] = collections.defaultdict(lambda: 0)
print(" Id | Time spent executing MTask | Socket | Core | Model") for cpu in sorted(Global['cpus'].keys()):
print(" | % of elapsed ticks / ticks | | |") print(" cpu %d: " % cpu, end='')
print(" ====|============================|========|======|======") print("cpu_time=%d" % Global['cpus'][cpu]['cpu_time'], end='')
for cpu in sorted(Cpus):
socket = "" socket = None
core = ""
model = ""
if cpu in Global['cpuinfo']: if cpu in Global['cpuinfo']:
cpuinfo = Global['cpuinfo'][cpu] cpuinfo = Global['cpuinfo'][cpu]
if 'physical_id' in cpuinfo and 'core_id' in cpuinfo: if 'physical_id' in cpuinfo and 'core_id' in cpuinfo:
socket = cpuinfo['physical_id'] socket = int(cpuinfo['physical_id'])
Global['cpu_sockets'][socket] += 1 Global['cpu_sockets'][socket] += 1
core = cpuinfo['core_id'] print(" socket=%d" % socket, end='')
Global['cpu_socket_cores'][socket + "__" + core] += 1
core = int(cpuinfo['core_id'])
Global['cpu_socket_cores'][str(socket) + "__" + str(core)] += 1
print(" core=%d" % core, end='')
if 'model_name' in cpuinfo: if 'model_name' in cpuinfo:
model = cpuinfo['model_name'] model = cpuinfo['model_name']
print(" %s" % model, end='')
print(" {:3d} | {:7.2%} / {:16d} | {:>6s} | {:>4s} | {}".format( print()
cpu, Cpus[cpu]['mtask_time'] / ElapsedTime, Cpus[cpu]['mtask_time'], socket, core,
model))
if len(Global['cpu_sockets']) > 1: if len(Global['cpu_sockets']) > 1:
Global['cpu_sockets_warning'] = True Global['cpu_sockets_warning'] = True
@@ -307,72 +313,25 @@ def report_cpus():
Global['cpu_socket_cores_warning'] = True Global['cpu_socket_cores_warning'] = True
def report_sections():
for thread, section in enumerate(Sections):
if section:
print(f"\nSection profile for thread {thread}:")
report_section(section)
def report_section(section):
totalTime = collections.defaultdict(lambda: 0)
selfTime = collections.defaultdict(lambda: 0)
sectionTree = [0, {}, 1] # [selfTime, childTrees, numberOfTimesEntered]
prevTime = 0
prevStack = ()
for time, stack in section:
if len(stack) > len(prevStack):
scope = sectionTree
for item in stack:
scope = scope[1].setdefault(item, [0, {}, 0])
scope[2] += 1
dt = time - prevTime
assert dt >= 0
scope = sectionTree
for item in prevStack:
scope = scope[1].setdefault(item, [0, {}, 0])
scope[0] += dt
if prevStack:
for name in prevStack:
totalTime[name] += dt
selfTime[prevStack[-1]] += dt
prevTime = time
prevStack = stack
def treeSum(tree):
n = tree[0]
for subTree in tree[1].values():
n += treeSum(subTree)
return n
# Make sure the tree sums to the elapsed time
sectionTree[0] += ElapsedTime - treeSum(sectionTree)
def printTree(prefix, name, entries, tree):
print(" {:7.2%} | {:7.2%} | {:8} | {:10.2f} | {}".format(
treeSum(tree) / ElapsedTime, tree[0] / ElapsedTime, tree[2], tree[2] / entries,
prefix + name))
for k in sorted(tree[1], key=lambda _: -treeSum(tree[1][_])):
printTree(prefix + " ", k, tree[2], tree[1][k])
print(" Total | Self | Total | Relative | Section")
print(" time | time | entries | entries | name ")
print("==========|=========|==========|============|========")
printTree("", "*TOTAL*", 1, sectionTree)
###################################################################### ######################################################################
def write_vcd(filename): def write_vcd(filename):
print("Writing %s" % filename) print("Writing %s" % filename)
with open(filename, "w", encoding="utf8") as fh: with open(filename, "w", encoding="utf8") as fh:
# dict of dicts of hierarchy elements/signal name -> (code, width) vcd = {
scopeSigs = {} 'values':
# map from time -> code -> value collections.defaultdict(lambda: {}), # {<time>}{<code>} = value
values = collections.defaultdict(lambda: {}) 'sigs': {
'predicted_threads': {},
'measured_threads': {},
'cpus': {},
'evals': {},
'mtasks': {},
'Stats': {}
} # {<module>}{<sig}} = code
}
code = 0
parallelism = { parallelism = {
'measured': collections.defaultdict(lambda: 0), 'measured': collections.defaultdict(lambda: 0),
@@ -381,137 +340,132 @@ def write_vcd(filename):
parallelism['measured'][0] = 0 parallelism['measured'][0] = 0
parallelism['predicted'][0] = 0 parallelism['predicted'][0] = 0
nextFreeCode = 0
def getCode(width, *names):
nonlocal nextFreeCode
scope = scopeSigs
*path, name = names
for item in path:
scope = scope.setdefault(item, {})
code, oldWidth = scope.setdefault(name, (nextFreeCode, width))
assert oldWidth == width
if code == nextFreeCode:
nextFreeCode += 1
return code
def addValue(code, time, val):
if isinstance(val, str):
buf = ""
for c in val:
buf += bin(ord(c))[2:].rjust(8, "0")
val = buf.ljust(LongestVcdStrValueLength * 8, "0")
values[time][code] = val
# Measured graph # Measured graph
for thread in sorted(Threads): for thread in sorted(Threads.keys()):
mcode = getCode(32, 'measured', 't%d_mtask' % thread) sig = "thread%d_mtask" % thread
for record in Threads[thread]: if sig not in vcd['sigs']['measured_threads']:
start = record['start'] vcd['sigs']['measured_threads'][sig] = code
mtask = record['mtask'] code += 1
end = record['end'] mcode = vcd['sigs']['measured_threads'][sig]
cpu = record['cpu']
addValue(mcode, start, mtask) for start in sorted(Threads[thread]):
addValue(mcode, end, None) mtask = Threads[thread][start]['mtask']
end = Threads[thread][start]['end']
cpu = Threads[thread][start]['cpu']
vcd['values'][start][mcode] = mtask
vcd['values'][end][mcode] = None
parallelism['measured'][start] += 1 parallelism['measured'][start] += 1
parallelism['measured'][end] -= 1 parallelism['measured'][end] -= 1
code = getCode(32, 'measured', 'cpu%d_thread' % cpu) sig = "cpu%d_thread" % cpu
addValue(code, start, thread) if sig not in vcd['sigs']['cpus']:
addValue(code, end, None) vcd['sigs']['cpus'][sig] = code
code += 1
ccode = vcd['sigs']['cpus'][sig]
vcd['values'][start][ccode] = thread
vcd['values'][end][ccode] = None
code = getCode(32, 'measured', 'cpu%d_mtask' % cpu) sig = "mtask%d_cpu" % mtask
addValue(code, start, mtask) if sig not in vcd['sigs']['mtasks']:
addValue(code, end, None) vcd['sigs']['mtasks'][sig] = code
code += 1
ccode = vcd['sigs']['mtasks'][sig]
vcd['values'][start][ccode] = cpu
vcd['values'][end][ccode] = None
tStart = sorted(_['start'] for records in Threads.values() for _ in records) # Eval graph
tEnd = sorted(_['end'] for records in Threads.values() for _ in records) vcd['sigs']['evals']["eval"] = code
elcode = code
code += 1
n = 0
for eval_start in Evals:
eval_end = Evals[eval_start]['end']
n += 1
vcd['values'][eval_start][elcode] = n
vcd['values'][eval_end][elcode] = None
# Predicted graph # Eval_loop graph
for start, end in ExecGraphIntervals: vcd['sigs']['evals']["eval_loop"] = code
# Find the earliest MTask start after the start point, and the elcode = code
# latest MTask end before the end point, so we can scale to the code += 1
# same range n = 0
start = tStart[bisect.bisect_left(tStart, start)] for eval_start in EvalLoops:
end = tEnd[bisect.bisect_right(tEnd, end) - 1] eval_end = EvalLoops[eval_start]['end']
# Compute scale so predicted graph is of same width as interval n += 1
measured_scaling = (end - start) / Global['predict_last_end'] vcd['values'][eval_start][elcode] = n
# Predict mtasks that fill the time the execution occupied vcd['values'][eval_end][elcode] = None
for mtask in Mtasks:
thread = Mtasks[mtask]['thread']
pred_scaled_start = start + int(Mtasks[mtask]['predict_start'] * measured_scaling)
pred_scaled_end = start + int(
(Mtasks[mtask]['predict_start'] + Mtasks[mtask]['predict_cost']) *
measured_scaling)
if pred_scaled_start == pred_scaled_end:
continue
mcode = getCode(32, 'predicted', 't%d_mtask' % thread) if Mtasks:
addValue(mcode, pred_scaled_start, mtask) # Predicted graph
addValue(mcode, pred_scaled_end, None) for eval_start in EvalLoops:
eval_end = EvalLoops[eval_start]['end']
# Compute scale so predicted graph is of same width as eval
measured_scaling = (eval_end -
eval_start) / Global['predict_last_end']
# Predict mtasks that fill the time the eval occupied
for mtask in Mtasks:
thread = Mtasks[mtask]['thread']
pred_scaled_start = eval_start + int(
Mtasks[mtask]['predict_start'] * measured_scaling)
pred_scaled_end = eval_start + int(
(Mtasks[mtask]['predict_start'] +
Mtasks[mtask]['predict_cost']) * measured_scaling)
if pred_scaled_start == pred_scaled_end:
continue
parallelism['predicted'][pred_scaled_start] += 1 sig = "predicted_thread%d_mtask" % thread
parallelism['predicted'][pred_scaled_end] -= 1 if sig not in vcd['sigs']['predicted_threads']:
vcd['sigs']['predicted_threads'][sig] = code
code += 1
mcode = vcd['sigs']['predicted_threads'][sig]
# Parallelism graph vcd['values'][pred_scaled_start][mcode] = mtask
for measpred in ('measured', 'predicted'): vcd['values'][pred_scaled_end][mcode] = None
pcode = getCode(32, 'stats', '%s_parallelism' % measpred)
value = 0
for time in sorted(parallelism[measpred].keys()):
value += parallelism[measpred][time]
addValue(pcode, time, value)
# Section graph parallelism['predicted'][pred_scaled_start] += 1
for thread, section in enumerate(Sections): parallelism['predicted'][pred_scaled_end] -= 1
if section:
scode = getCode(LongestVcdStrValueLength * 8, "section", f"t{thread}_trace") # Parallelism graph
dcode = getCode(32, "section", f"t{thread}_depth") for measpred in ('measured', 'predicted'):
for time, stack in section: vcd['sigs']['Stats']["%s_parallelism" % measpred] = code
addValue(scode, time, stack[-1] if stack else None) pcode = code
addValue(dcode, time, len(stack)) code += 1
value = 0
for time in sorted(parallelism[measpred].keys()):
value += parallelism[measpred][time]
vcd['values'][time][pcode] = value
# Create output file # Create output file
fh.write("$version Generated by verilator_gantt $end\n") fh.write("$version Generated by verilator_gantt $end\n")
fh.write("$timescale 1ns $end\n") fh.write("$timescale 1ns $end\n")
fh.write("\n") fh.write("\n")
all_codes = set() all_codes = {}
def writeScope(scope):
assert isinstance(scope, dict)
for key in sorted(scope):
val = scope[key]
if isinstance(val, dict):
fh.write(" $scope module %s $end\n" % key)
writeScope(val)
fh.write(" $upscope $end\n")
else:
(code, width) = val
all_codes.add(code)
fh.write(" $var wire %d v%x %s [%d:0] $end\n" %
(width, code, key, width - 1))
fh.write(" $scope module gantt $end\n") fh.write(" $scope module gantt $end\n")
writeScope(scopeSigs) for module in sorted(vcd['sigs'].keys()):
fh.write(" $scope module %s $end\n" % module)
for sig in sorted(vcd['sigs'][module].keys()):
code = vcd['sigs'][module][sig]
fh.write(" $var wire 32 v%x %s [31:0] $end\n" % (code, sig))
all_codes[code] = 1
fh.write(" $upscope $end\n")
fh.write(" $upscope $end\n") fh.write(" $upscope $end\n")
fh.write("$enddefinitions $end\n") fh.write("$enddefinitions $end\n")
fh.write("\n") fh.write("\n")
first = True first = True
for time in sorted(values): for time in sorted(vcd['values']):
if first: if first:
first = False first = False
# Start with Z for any signals without time zero data # Start with Z for any signals without time zero data
for code in sorted(all_codes): for code in sorted(all_codes.keys()):
if code not in values[time]: if code not in vcd['values'][time]:
addValue(code, time, None) vcd['values'][time][code] = None
fh.write("#%d\n" % time) fh.write("#%d\n" % time)
for code in sorted(values[time]): for code in sorted(vcd['values'][time].keys()):
value = values[time][code] value = vcd['values'][time][code]
if value is None: if value is None:
fh.write("bz v%x\n" % code) fh.write("bz v%x\n" % code)
elif isinstance(value, str):
fh.write("b%s v%x\n" % (value, code))
else: else:
fh.write("b%s v%x\n" % (format(value, 'b'), code)) fh.write("b%s v%x\n" % (format(value, 'b'), code))
@@ -529,7 +483,8 @@ Verilator_gantt creates a visual representation to help analyze Verilator
For documentation see For documentation see
https://verilator.org/guide/latest/exe_verilator_gantt.html""", 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-2023 by Wilson Snyder. This program is free software; you
can redistribute it and/or modify it under the terms of either the GNU 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 Lesser General Public License Version 3 or the Perl Artistic License
Version 2.0. Version 2.0.
@@ -537,16 +492,19 @@ Version 2.0.
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0""") SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0""")
parser.add_argument('--debug', action='store_true', help='enable debug') parser.add_argument('--debug', action='store_true', help='enable debug')
parser.add_argument('--no-vcd', help='disable creating vcd', action='store_true') parser.add_argument('--no-vcd',
parser.add_argument('--vcd', help='filename for vcd outpue', default='profile_exec.vcd') help='disable creating vcd',
action='store_true')
parser.add_argument('--vcd',
help='filename for vcd outpue',
default='profile_exec.vcd')
parser.add_argument('filename', parser.add_argument('filename',
help='input profile_exec.dat filename to process', help='input profile_exec.dat filename to process',
default='profile_exec.dat') default='profile_exec.dat')
Args = parser.parse_args() Args = parser.parse_args()
read_data(Args.filename) process(Args.filename)
report()
if not Args.no_vcd: if not Args.no_vcd:
write_vcd(Args.vcd) write_vcd(Args.vcd)
+1 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# pylint: disable=C0114,C0209 # pylint: disable=C0114,C0209
# #
# Copyright 2003-2025 by Wilson Snyder. This program is free software; you # Copyright 2003-2023 by Wilson Snyder. This program is free software; you
# can redistribute it and/or modify the Verilator internals under the terms # 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 # of either the GNU Lesser General Public License Version 3 or the Perl
# Artistic License Version 2.0. # Artistic License Version 2.0.
+22 -11
View File
@@ -34,8 +34,9 @@ def profcfunc(filename):
# Older gprofs have no call column for single-call functions # Older gprofs have no call column for single-call functions
# %time cumesec selfsec {stuff} name # %time cumesec selfsec {stuff} name
match = re.match(r'^\s*([0-9.]+)\s+[0-9.]+\s+([0-9.]+)\s+[^a-zA-Z_]*([a-zA-Z_].*)$', match = re.match(
line) r'^\s*([0-9.]+)\s+[0-9.]+\s+([0-9.]+)\s+[^a-zA-Z_]*([a-zA-Z_].*)$',
line)
if match: if match:
pct = float(match.group(1)) pct = float(match.group(1))
sec = float(match.group(2)) sec = float(match.group(2))
@@ -135,15 +136,19 @@ def profcfunc(filename):
design_width = 1 design_width = 1
for func, func_item in vfuncs.items(): for func, func_item in vfuncs.items():
design_width = max(design_width, len(func_item['design'])) if design_width < len(func_item['design']):
design_width = len(func_item['design'])
print("Verilog code profile:") print("Verilog code profile:")
print(" These are split into three categories:") print(" These are split into three categories:")
print(" C++: Time in non-Verilated C++ code") print(" C++: Time in non-Verilated C++ code")
print(" Prof: Time in profile overhead") print(" Prof: Time in profile overhead")
print(" VBlock: Time attributable to a block in a" + " Verilog file and line") print(" VBlock: Time attributable to a block in a" +
print(" VCommon: Time in a Verilated module," + " due to all parts of the design") " Verilog file and line")
print(" VLib: Time in Verilated common libraries," + " called by the Verilated code") print(" VCommon: Time in a Verilated module," +
" due to all parts of the design")
print(" VLib: Time in Verilated common libraries," +
" called by the Verilated code")
print() print()
print(" % cumulative self ") print(" % cumulative self ")
@@ -151,11 +156,13 @@ def profcfunc(filename):
"s type filename and line number") % "design") "s type filename and line number") % "design")
cume = 0 cume = 0
for func in sorted(vfuncs.keys(), key=lambda f: vfuncs[f]['sec'], reverse=True): for func in sorted(vfuncs.keys(),
key=lambda f: vfuncs[f]['sec'],
reverse=True):
cume += vfuncs[func]['sec'] cume += vfuncs[func]['sec']
print(("%6.2f %9.2f %8.2f %10d %-" + str(design_width) + "s %s") % print(("%6.2f %9.2f %8.2f %10d %-" + str(design_width) + "s %s") %
(vfuncs[func]['pct'], cume, vfuncs[func]['sec'], vfuncs[func]['calls'], (vfuncs[func]['pct'], cume, vfuncs[func]['sec'],
vfuncs[func]['design'], func)) vfuncs[func]['calls'], vfuncs[func]['design'], func))
###################################################################### ######################################################################
@@ -173,14 +180,18 @@ in each Verilog block.
For documentation see For documentation see
https://verilator.org/guide/latest/exe_verilator_profcfunc.html""", 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-2023 by Wilson Snyder. This program is free software; you
can redistribute it and/or modify it under the terms of either the GNU 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 Lesser General Public License Version 3 or the Perl Artistic License
Version 2.0. Version 2.0.
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0""") SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0""")
parser.add_argument('--debug', action='store_const', const=9, help='enable debug') parser.add_argument('--debug',
action='store_const',
const=9,
help='enable debug')
parser.add_argument('filename', help='input gprof output to process') parser.add_argument('filename', help='input gprof output to process')
Args = parser.parse_args() Args = parser.parse_args()
-1
View File
@@ -26,5 +26,4 @@ if git log --format=%B -n 1 "$COMMIT" | grep -q -i '\[CI\s\+ccache\s\+clear\]';
fi fi
# Dump stats, then zero stats # Dump stats, then zero stats
# 22.04: ccache -s -v -z
ccache -s -z ccache -s -z
+33 -13
View File
@@ -27,6 +27,12 @@ fatal() {
echo "ERROR: $(basename "$0"): $1" >&2; exit 1; echo "ERROR: $(basename "$0"): $1" >&2; exit 1;
} }
if [ "$CI_M32" = "0" ]; then
unset CI_M32
elif [ "$CI_M32" != "1" ]; then
fatal "\$CI_M32 must be '0' or '1'";
fi
if [ "$CI_OS_NAME" = "linux" ]; then if [ "$CI_OS_NAME" = "linux" ]; then
MAKE=make MAKE=make
elif [ "$CI_OS_NAME" = "osx" ]; then elif [ "$CI_OS_NAME" = "osx" ]; then
@@ -60,14 +66,21 @@ if [ "$CI_BUILD_STAGE_NAME" = "build" ]; then
sudo apt-get install libgoogle-perftools-dev || sudo apt-get install libgoogle-perftools-dev ||
sudo apt-get install libgoogle-perftools-dev sudo apt-get install libgoogle-perftools-dev
fi fi
if [ "$CI_RUNS_ON" = "ubuntu-20.04" ] || [ "$CI_RUNS_ON" = "ubuntu-22.04" ] || [ "$CI_RUNS_ON" = "ubuntu-24.04" ]; then if [ "$CI_RUNS_ON" = "ubuntu-20.04" ] || [ "$CI_RUNS_ON" = "ubuntu-22.04" ]; then
sudo apt-get install libsystemc libsystemc-dev || sudo apt-get install libsystemc libsystemc-dev ||
sudo apt-get install libsystemc libsystemc-dev sudo apt-get install libsystemc libsystemc-dev
fi fi
if [ "$CI_RUNS_ON" = "ubuntu-22.04" ] || [ "$CI_RUNS_ON" = "ubuntu-24.04" ]; then if [ "$CI_RUNS_ON" = "ubuntu-22.04" ]; then
sudo apt-get install bear mold || sudo apt-get install bear mold ||
sudo apt-get install bear mold sudo apt-get install bear mold
fi fi
if [ "$COVERAGE" = 1 ]; then
yes yes | sudo cpan -fi Parallel::Forker
fi
if [ "$CI_M32" = 1 ]; then
sudo apt-get install gcc-multilib g++-multilib ||
sudo apt-get install gcc-multilib g++-multilib
fi
elif [ "$CI_OS_NAME" = "osx" ]; then elif [ "$CI_OS_NAME" = "osx" ]; then
brew update brew update
brew install ccache perl gperftools brew install ccache perl gperftools
@@ -89,31 +102,38 @@ elif [ "$CI_BUILD_STAGE_NAME" = "test" ]; then
sudo apt-get update || sudo apt-get update ||
sudo apt-get update sudo apt-get update
# libfl-dev needed for internal coverage's test runs # libfl-dev needed for internal coverage's test runs
sudo apt-get install gdb gtkwave lcov libfl-dev ccache jq z3 || sudo apt-get install gdb gtkwave lcov libfl-dev ccache ||
sudo apt-get install gdb gtkwave lcov libfl-dev ccache jq z3 sudo apt-get install gdb gtkwave lcov libfl-dev ccache
# Required for test_regress/t/t_dist_attributes.py # Required for test_regress/t/t_dist_attributes.pl
if [ "$CI_RUNS_ON" = "ubuntu-22.04" ] || [ "$CI_RUNS_ON" = "ubuntu-24.04" ]; then if [ "$CI_RUNS_ON" = "ubuntu-22.04" ]; then
sudo apt-get install python3-clang mold || sudo apt-get install libclang-dev mold ||
sudo apt-get install python3-clang mold sudo apt-get install libclang-dev mold
pip3 install clang==14.0
fi fi
if [ "$CI_RUNS_ON" = "ubuntu-20.04" ] || [ "$CI_RUNS_ON" = "ubuntu-22.04" ] || [ "$CI_RUNS_ON" = "ubuntu-24.04" ]; then if [ "$CI_RUNS_ON" = "ubuntu-20.04" ] || [ "$CI_RUNS_ON" = "ubuntu-22.04" ]; then
sudo apt-get install libsystemc-dev || sudo apt-get install libsystemc-dev ||
sudo apt-get install libsystemc-dev sudo apt-get install libsystemc-dev
fi fi
if [ "$CI_M32" = 1 ]; then
sudo apt-get install lib32z1-dev gcc-multilib g++-multilib ||
sudo apt-get install lib32z1-dev gcc-multilib g++-multilib
fi
elif [ "$CI_OS_NAME" = "osx" ]; then elif [ "$CI_OS_NAME" = "osx" ]; then
brew update brew update
# brew cask install gtkwave # fst2vcd hangs at launch, so don't bother # brew cask install gtkwave # fst2vcd hangs at launch, so don't bother
brew install ccache perl jq z3 brew install ccache perl
elif [ "$CI_OS_NAME" = "freebsd" ]; then elif [ "$CI_OS_NAME" = "freebsd" ]; then
# fst2vcd fails with "Could not open '<input file>', exiting." # fst2vcd fails with "Could not open '<input file>', exiting."
sudo pkg install -y ccache gmake perl5 python3 jq z3 sudo pkg install -y ccache gmake perl5 python3
else else
fatal "Unknown os: '$CI_OS_NAME'" fatal "Unknown os: '$CI_OS_NAME'"
fi fi
# Common installs # Common installs
if [ "$CI_RUNS_ON" != "ubuntu-14.04" ]; then
CI_CPAN_REPO=https://cpan.org
fi
yes yes | sudo cpan -M $CI_CPAN_REPO -fi Parallel::Forker
install-vcddiff install-vcddiff
# Workaround -fsanitize=address crash
sudo sysctl -w vm.mmap_rnd_bits=28
else else
############################################################################## ##############################################################################
# Unknown build stage # Unknown build stage
+18 -32
View File
@@ -21,6 +21,12 @@ fatal() {
echo "ERROR: $(basename "$0"): $1" >&2; exit 1; echo "ERROR: $(basename "$0"): $1" >&2; exit 1;
} }
if [ "$CI_M32" = "0" ]; then
unset CI_M32
elif [ "$CI_M32" != "1" ]; then
fatal "\$CI_M32 must be '0' or '1'";
fi
if [ "$CI_OS_NAME" = "linux" ]; then if [ "$CI_OS_NAME" = "linux" ]; then
export MAKE=make export MAKE=make
NPROC=$(nproc) NPROC=$(nproc)
@@ -33,7 +39,6 @@ elif [ "$CI_OS_NAME" = "freebsd" ]; then
else else
fatal "Unknown os: '$CI_OS_NAME'" fatal "Unknown os: '$CI_OS_NAME'"
fi fi
NPROC=$(expr $NPROC '+' 1)
if [ "$CI_BUILD_STAGE_NAME" = "build" ]; then if [ "$CI_BUILD_STAGE_NAME" = "build" ]; then
############################################################################## ##############################################################################
@@ -41,10 +46,9 @@ if [ "$CI_BUILD_STAGE_NAME" = "build" ]; then
if [ "$COVERAGE" != 1 ]; then if [ "$COVERAGE" != 1 ]; then
autoconf autoconf
./configure --enable-longtests --enable-ccwarn --prefix="$INSTALL_DIR" ./configure --enable-longtests --enable-ccwarn ${CI_M32:+--enable-m32}
ccache -z ccache -z
"$MAKE" -j "$NPROC" -k "$MAKE" -j "$NPROC" -k
# 22.04: ccache -s -v
ccache -s ccache -s
if [ "$CI_OS_NAME" = "osx" ]; then if [ "$CI_OS_NAME" = "osx" ]; then
file bin/verilator_bin file bin/verilator_bin
@@ -62,7 +66,6 @@ elif [ "$CI_BUILD_STAGE_NAME" = "test" ]; then
# Run tests # Run tests
export VERILATOR_TEST_NO_CONTRIBUTORS=1 # Separate workflow check export VERILATOR_TEST_NO_CONTRIBUTORS=1 # Separate workflow check
export VERILATOR_TEST_NO_LINT_PY=1 # Separate workflow check
if [ "$CI_OS_NAME" = "osx" ]; then if [ "$CI_OS_NAME" = "osx" ]; then
export VERILATOR_TEST_NO_GDB=1 # Pain to get GDB to work on OS X export VERILATOR_TEST_NO_GDB=1 # Pain to get GDB to work on OS X
@@ -86,43 +89,26 @@ elif [ "$CI_BUILD_STAGE_NAME" = "test" ]; then
export VERILATOR_TEST_NO_GPROF=1 # gprof is a bit different on FreeBSD, disable export VERILATOR_TEST_NO_GPROF=1 # gprof is a bit different on FreeBSD, disable
fi fi
# Run sanitize on Ubuntu 22.04 only # Run sanitize on Ubuntu 20.04 only
( [ "$CI_RUNS_ON" = 'ubuntu-22.04' ] || [ "$CI_RUNS_ON" = 'ubuntu-24.04' ] ) && sanitize='--sanitize' || sanitize='' [ "$CI_RUNS_ON" = 'ubuntu-20.04' ] && [ "$CI_M32" = "" ] && sanitize='--sanitize' || sanitize=''
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"
# Feeling brave?
find . -delete
ls -la .
fi
# Run the specified test # Run the specified test
ccache -z ccache -z
case $TESTS in case $TESTS in
dist-vlt-0) dist-vlt-0)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--dist --vlt $sanitize" DRIVER_HASHSET=--hashset=0/4 "$MAKE" -C test_regress SCENARIOS="--dist --vlt $sanitize" DRIVER_HASHSET=--hashset=0/3
;; ;;
dist-vlt-1) dist-vlt-1)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--dist --vlt $sanitize" DRIVER_HASHSET=--hashset=1/4 "$MAKE" -C test_regress SCENARIOS="--dist --vlt $sanitize" DRIVER_HASHSET=--hashset=1/3
;; ;;
dist-vlt-2) dist-vlt-2)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--dist --vlt $sanitize" DRIVER_HASHSET=--hashset=2/4 "$MAKE" -C test_regress SCENARIOS="--dist --vlt $sanitize" DRIVER_HASHSET=--hashset=2/3
;;
dist-vlt-3)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS="--dist --vlt $sanitize" DRIVER_HASHSET=--hashset=3/4
;; ;;
vltmt-0) vltmt-0)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS=--vltmt DRIVER_HASHSET=--hashset=0/2 "$MAKE" -C test_regress SCENARIOS=--vltmt DRIVER_HASHSET=--hashset=0/2
;; ;;
vltmt-1) vltmt-1)
"$MAKE" -C "$TEST_REGRESS" SCENARIOS=--vltmt DRIVER_HASHSET=--hashset=1/2 "$MAKE" -C test_regress SCENARIOS=--vltmt DRIVER_HASHSET=--hashset=1/2
;; ;;
coverage-all) coverage-all)
nodist/code_coverage --stages 1- nodist/code_coverage --stages 1-
@@ -194,12 +180,12 @@ elif [ "$CI_BUILD_STAGE_NAME" = "test" ]; then
fatal "Unknown test: $TESTS" fatal "Unknown test: $TESTS"
;; ;;
esac esac
# To see load average (1 minute, 5 minute, 15 minute)
uptime
# 22.04: ccache -s -v
ccache -s ccache -s
# Upload coverage data
if [[ $TESTS == coverage-* ]]; then
bash <(cat ci/coverage-upload.sh) -f nodist/obj_dir/coverage/app_total.info
fi
else else
############################################################################## ##############################################################################
# Unknown build stage # Unknown build stage
+8 -21
View File
@@ -1,26 +1,13 @@
# DESCRIPTION: Verilator: CI Windows Power Shell - Compile Verilator
#
# Copyright 2024 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
################################################################################
Set-PSDebug -Trace 1
if (-Not (Test-Path $PWD/../.ccache/win_bison.exe)) { if (-Not (Test-Path $PWD/../.ccache/win_bison.exe)) {
git clone --depth 1 https://github.com/lexxmark/winflexbison git clone --depth 1 https://github.com/lexxmark/winflexbison
cd winflexbison cd winflexbison
mkdir build mkdir build
cd build cd build
cmake .. --install-prefix $PWD/../../../.ccache cmake .. --install-prefix $PWD/../../../.ccache
cmake --build . --config Release -j 3 cmake --build . --config Release -j 3
cmake --install . --prefix $PWD/../../../.ccache cmake --install . --prefix $PWD/../../../.ccache
cd ../.. cd ../..
} }
mkdir build mkdir build
cd build cd build
cmake .. --install-prefix $PWD/../install cmake .. --install-prefix $PWD/../install
+1 -17
View File
@@ -1,16 +1,3 @@
# DESCRIPTION: Verilator: CI Windows Power Shell - Verilate a test
#
# Copyright 2024 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
################################################################################
Set-PSDebug -Trace 1
cd install cd install
$Env:VERILATOR_ROOT=$PWD $Env:VERILATOR_ROOT=$PWD
cd examples/cmake_tracing_c cd examples/cmake_tracing_c
@@ -18,9 +5,6 @@ mkdir build
cd build cd build
cmake .. cmake ..
cmake --build . --config Release -j 3 cmake --build . --config Release -j 3
Release/example.exe
# TODO put this back in, see issue# 5163
# Release/example.exe
cd .. cd ..
Remove-Item -path build -recurse Remove-Item -path build -recurse
BIN
View File
Binary file not shown.
+1884
View File
File diff suppressed because it is too large Load Diff
+3 -13
View File
@@ -8,16 +8,6 @@
FROM ubuntu:22.04 FROM ubuntu:22.04
# Create the user
RUN groupadd verilator \
&& useradd -g verilator -m verilator -s /bin/bash \
&& apt-get update \
&& apt-get install --no-install-recommends -y sudo \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& echo verilator ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/verilator \
&& chmod 0440 /etc/sudoers.d/verilator
RUN apt-get update \ RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive \ && DEBIAN_FRONTEND=noninteractive \
apt-get install --no-install-recommends -y \ apt-get install --no-install-recommends -y \
@@ -43,7 +33,7 @@ RUN apt-get update \
perl \ perl \
python3 \ python3 \
wget \ wget \
z3 \ zlibc \
zlib1g \ zlib1g \
zlib1g-dev \ zlib1g-dev \
&& apt-get clean \ && apt-get clean \
@@ -51,6 +41,8 @@ RUN apt-get update \
WORKDIR /tmp WORKDIR /tmp
RUN cpan install -fi Parallel::Forker
RUN git clone https://github.com/veripool/vcddiff.git && \ RUN git clone https://github.com/veripool/vcddiff.git && \
make -C vcddiff && \ make -C vcddiff && \
cp -p vcddiff/vcddiff /usr/local/bin/vcddiff && \ cp -p vcddiff/vcddiff /usr/local/bin/vcddiff && \
@@ -60,8 +52,6 @@ COPY build.sh /tmp/build.sh
ENV VERILATOR_AUTHOR_SITE=1 ENV VERILATOR_AUTHOR_SITE=1
USER verilator
WORKDIR /work WORKDIR /work
ENTRYPOINT [ "/tmp/build.sh" ] ENTRYPOINT [ "/tmp/build.sh" ]
+1 -3
View File
@@ -1,8 +1,6 @@
.. Copyright 2003-2025 by Wilson Snyder. .. Copyright 2003-2023 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
.. _Verilator Build Docker Container:
Verilator Build Docker Container Verilator Build Docker Container
================================ ================================
+3 -4
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2025 by Wilson Snyder. .. Copyright 2003-2023 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
Verilator Executable Docker Container Verilator Executable Docker Container
@@ -11,11 +11,10 @@ easily as a docker image, e.g.:
docker run -ti verilator/verilator:latest --version docker run -ti verilator/verilator:latest --version
This will pull the container from `docker hub This will install the container, run the latest Verilator and print
<https://hub.docker.com/r/verilator/verilator>`_, run the latest Verilator and print
Verilator's version. Verilator's version.
Containers are automatically built and pushed to docker hub for all released versions, so you may Containers are automatically built for all released versions, so you may
easily compare results across versions, e.g.: easily compare results across versions, e.g.:
:: ::
+18 -16
View File
@@ -1,7 +1,6 @@
---
# DESCRIPTION: codecov.io config # DESCRIPTION: codecov.io config
# #
# Copyright 2020-2025 by Wilson Snyder. This program is free software; you # Copyright 2020-2023 by Wilson Snyder. This program is free software; you
# can redistribute it and/or modify it under the terms of either the GNU # 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 # Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0. # Version 2.0.
@@ -9,28 +8,31 @@
#################### ####################
# Validate: # Validate:
# curl --data-binary @codecov.yml https://codecov.io/validate # curl --data-binary @codecov.yml https://codecov.io/validate
#
codecov: codecov:
require_ci_to_pass: false require_ci_to_pass: no
coverage: coverage:
precision: 2 precision: 2
round: down round: down
range: 50...100 range: "50...100"
ignore: ignore:
- "ci" # - "ci"
- "docs" # - "docs"
- "examples" # - "examples"
- "include/gtkwave" # - "include/gtkwave"
- "include/vltstd" # - "include/vltstd"
- "test_regress" # - "test_regress"
parsers: parsers:
gcov: gcov:
branch_detection: branch_detection:
conditional: true conditional: yes
loop: true loop: yes
method: false method: no
macro: false macro: no
comment: comment:
layout: "reach,diff,flags,tree" layout: "reach,diff,flags,tree"
behavior: default behavior: default
require_changes: true require_changes: yes
+74 -128
View File
@@ -1,16 +1,16 @@
# DESCRIPTION: Process this file with autoconf to produce a configure script. # DESCRIPTION: Process this file with autoconf to produce a configure script.
# #
# Copyright 2003-2025 by Wilson Snyder. Verilator is free software; you # Copyright 2003-2023 by Wilson Snyder. Verilator is free software; you
# can redistribute it and/or modify it under the terms of either the GNU Lesser # 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. # General Public License Version 3 or the Perl Artistic License Version 2.0.
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 # SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
# When releasing, also update header of Changes file, and CMakeLists.txt, # When releasing, also update header of Changes file, and CmakeLists.txt,
# and commit using "devel release" or "Version bump" message # and commit using "devel release" or "Version bump" message
# Then 'make maintainer-dist' # Then 'make maintainer-dist'
#AC_INIT([Verilator],[#.### YYYY-MM-DD]) #AC_INIT([Verilator],[#.### YYYY-MM-DD])
#AC_INIT([Verilator],[#.### devel]) #AC_INIT([Verilator],[#.### devel])
AC_INIT([Verilator],[5.032 2025-01-01], AC_INIT([Verilator],[5.016 2023-09-16],
[https://verilator.org], [https://verilator.org],
[verilator],[https://verilator.org]) [verilator],[https://verilator.org])
@@ -24,13 +24,6 @@ AC_SUBST(PACKAGE_VERSION_NUMBER)
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_NUMBER_STRING],["$PACKAGE_VERSION_NUMBER"],[Package version as a number]) AC_DEFINE_UNQUOTED([PACKAGE_VERSION_NUMBER_STRING],["$PACKAGE_VERSION_NUMBER"],[Package version as a number])
VERILATOR_VERSION_INTEGER=`AS_ECHO("$PACKAGE_VERSION") | [sed 's/\([0-9]\)\.\([0-9][0-9][0-9]\) .*/\1\2000/g']` VERILATOR_VERSION_INTEGER=`AS_ECHO("$PACKAGE_VERSION") | [sed 's/\([0-9]\)\.\([0-9][0-9][0-9]\) .*/\1\2000/g']`
AC_SUBST(VERILATOR_VERSION_INTEGER) AC_SUBST(VERILATOR_VERSION_INTEGER)
AC_DEFINE_UNQUOTED([PACKAGE_VERSION_STRING_CHAR],
[static const char* const PACKAGE_STRING_UNUSED = "$PACKAGE_STRING";],
[Package version as a number])
AC_SUBST(PACKAGE_VERSION_STRING_CHAR)
######################################################################
## Arguments/flag checking
# Ignore automake flags passed by Ubuntu builds # Ignore automake flags passed by Ubuntu builds
AC_ARG_ENABLE([dependency-tracking], AC_ARG_ENABLE([dependency-tracking],
@@ -70,6 +63,20 @@ AC_ARG_ENABLE([tcmalloc],
[CFG_WITH_TCMALLOC=check;]) [CFG_WITH_TCMALLOC=check;])
AC_MSG_RESULT($CFG_WITH_TCMALLOC) AC_MSG_RESULT($CFG_WITH_TCMALLOC)
# Flag to enable -m32 build
AC_MSG_CHECKING(whether to use -m32)
AC_ARG_ENABLE([m32],
[AS_HELP_STRING([--enable-m32],
[Use -m32 for all compilation and link,
including Verilator and generated models.])],
[case "${enableval}" in
yes) CFG_ENABLE_M32=yes ;;
no) CFG_ENABLE_M32=no ;;
*) AC_MSG_ERROR([bad value '${enableval}' for --enable-m32]) ;;
esac],
CFG_ENABLE_M32=no)
AC_MSG_RESULT($CFG_ENABLE_M32)
# Flag to enable coverage build # Flag to enable coverage build
AC_MSG_CHECKING(whether to build for coverage collection) AC_MSG_CHECKING(whether to build for coverage collection)
AC_ARG_ENABLE([coverage], AC_ARG_ENABLE([coverage],
@@ -137,33 +144,6 @@ AC_ARG_ENABLE([longtests],
AC_SUBST(CFG_WITH_LONGTESTS) AC_SUBST(CFG_WITH_LONGTESTS)
AC_MSG_RESULT($CFG_WITH_LONGTESTS) AC_MSG_RESULT($CFG_WITH_LONGTESTS)
AC_CHECK_PROG(HAVE_Z3,z3,yes)
AC_CHECK_PROG(HAVE_CVC5,cvc5,yes)
AC_CHECK_PROG(HAVE_CVC4,cvc4,yes)
# Special Substitutions - CFG_WITH_SOLVER
AC_MSG_CHECKING(for SMT solver)
AC_ARG_WITH([solver],
[AS_HELP_STRING([--with-solver='z3 --in'],
[set default SMT solver for constrained randomization])],
[CFG_WITH_SOLVER="${withval}"],
[CFG_WITH_SOLVER=no
if test "x$HAVE_Z3" = "xyes"; then
CFG_WITH_SOLVER="z3 --in"
elif test "x$HAVE_CVC5" = "xyes"; then
CFG_WITH_SOLVER="cvc5 --incremental"
elif test "x$HAVE_CVC4" = "xyes"; then
CFG_WITH_SOLVER="cvc4 --lang=smt2 --incremental"
fi]
)
AC_SUBST(CFG_WITH_SOLVER)
AC_MSG_RESULT($CFG_WITH_SOLVER)
######################################################################
## Compiler checks
AC_MSG_RESULT([compiler CXX inbound is set to... $CXX])
# Compiler flags (ensure they are not empty to avoid configure defaults) # Compiler flags (ensure they are not empty to avoid configure defaults)
CFLAGS="$CFLAGS " CFLAGS="$CFLAGS "
CPPFLAGS="$CPPFLAGS " CPPFLAGS="$CPPFLAGS "
@@ -176,10 +156,8 @@ AC_PROG_CXX
AC_PROG_INSTALL AC_PROG_INSTALL
AC_LANG_PUSH(C++) AC_LANG_PUSH(C++)
CFG_CXX_VERSION=`$CXX --version | head -1` cxx_version=$($CXX --version | head -1)
AC_MSG_RESULT([compiler $CXX --version = $CFG_CXX_VERSION]) AC_MSG_RESULT([compiler is $CXX --version = $cxx_version])
AC_SUBST(CFG_CXX_VERSION)
AC_MSG_CHECKING([that C++ compiler can compile simple program]) AC_MSG_CHECKING([that C++ compiler can compile simple program])
AC_RUN_IFELSE( AC_RUN_IFELSE(
[AC_LANG_SOURCE([int main() { return 0; }])], [AC_LANG_SOURCE([int main() { return 0; }])],
@@ -192,26 +170,24 @@ if test "x$AR" = "x" ; then
AC_MSG_ERROR([Cannot find "ar" in your PATH, please install it]) AC_MSG_ERROR([Cannot find "ar" in your PATH, please install it])
fi fi
AC_CHECK_PROG(PERL,perl,perl) AC_PATH_PROG(PERL,perl)
if test "x$PERL" = "x" ; then if test "x$PERL" = "x" ; then
AC_MSG_ERROR([Cannot find "perl" in your PATH, please install it]) AC_MSG_ERROR([Cannot find "perl" in your PATH, please install it])
fi fi
AC_CHECK_PROG(PYTHON3,python3,python3) AC_PATH_PROG(PYTHON3,python3)
if test "x$PYTHON3" = "x" ; then if test "x$PYTHON3" = "x" ; then
AC_MSG_ERROR([Cannot find "python3" in your PATH, please install it]) AC_MSG_ERROR([Cannot find "python3" in your PATH, please install it])
fi fi
python3_version=$($PYTHON3 --version | head -1)
AC_MSG_RESULT([$PYTHON3 --version = $python3_version])
AC_CHECK_PROG(LEX,flex,flex) AC_PATH_PROG(LEX,flex)
if test "x$LEX" = "x" ; then if test "x$LEX" = "x" ; then
AC_MSG_ERROR([Cannot find "flex" in your PATH, please install it]) AC_MSG_ERROR([Cannot find "flex" in your PATH, please install it])
fi fi
flex_version=$($LEX --version | head -1) flex_version=$($LEX --version | head -1)
AC_MSG_RESULT([$LEX --version = $flex_version]) AC_MSG_RESULT([$LEX --version = $flex_version])
AC_CHECK_PROG(YACC,bison,bison) AC_PATH_PROG(YACC,bison)
if test "x$YACC" = "x" ; then if test "x$YACC" = "x" ; then
AC_MSG_ERROR([Cannot find "bison" in your PATH, please install it]) AC_MSG_ERROR([Cannot find "bison" in your PATH, please install it])
fi fi
@@ -300,43 +276,6 @@ AC_DEFUN([_MY_CXX_CHECK_OPT],
_MY_CXX_CHECK_IFELSE($2, $1="$$1 $2") _MY_CXX_CHECK_IFELSE($2, $1="$$1 $2")
]) ])
AC_DEFUN([_MY_CXX_CHECK_CORO_SET],
[# _MY_CXX_CHECK_CORO_SET(variable,option)
# Check if compiler supports coroutines with specific option. If it does,
# set variable to option, only if not previously set.
# Define HAVE_COROUTINES if supported.
if test "$$1" = ""; then
if test "$2" != ""; then
_my_msg_opt=" with $2"
else
_my_msg_opt=""
fi
AC_MSG_CHECKING([whether coroutines are supported by $CXX$_my_msg_opt])
ACO_SAVE_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $2"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([
#if defined(__clang__) && !defined(__cpp_impl_coroutine)
#define __cpp_impl_coroutine 1
#endif
#include <coroutine>
],[[std::coroutine_handle<> h;]])],
[_my_result=yes],
[AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[#include <experimental/coroutine>],
[[std::experimental::coroutine_handle<> h;]])],
[_my_result=yes],
[_my_result=no])])
AC_MSG_RESULT($_my_result)
CXXFLAGS="$ACO_SAVE_CXXFLAGS"
if test "$_my_result" = "yes" ; then
$1="$2"
AC_DEFINE([HAVE_COROUTINES],[1],[Defined if coroutines are supported by $CXX])
fi
fi
])
AC_DEFUN([_MY_LDLIBS_CHECK_FLAG], AC_DEFUN([_MY_LDLIBS_CHECK_FLAG],
[# _MY_LDLIBS_CHECK_FLAG(flag) -- Check if linker supports specific options [# _MY_LDLIBS_CHECK_FLAG(flag) -- Check if linker supports specific options
# Set $_my_result appropriately # Set $_my_result appropriately
@@ -376,7 +315,15 @@ AC_DEFUN([_MY_LDLIBS_CHECK_OPT],
_MY_LDLIBS_CHECK_IFELSE($2, $1="$$1 $2") _MY_LDLIBS_CHECK_IFELSE($2, $1="$$1 $2")
]) ])
# Add the coverage flags early as they influence later checks. # When using -m32. Check this first as later checks may fail with the -m32 flag.
if test "$CFG_ENABLE_M32" = "yes"; then
_MY_CXX_CHECK_IFELSE(
-m32,
[CXX="$CXX -m32"],
[AC_MSG_ERROR([--enable-m32 was given but compiler does not support -m32])])
fi
# Similarly, add the coverage flags early as they influence later checks.
if test "$CFG_ENABLE_COVERAGE" = "yes"; then if test "$CFG_ENABLE_COVERAGE" = "yes"; then
_MY_CXX_CHECK_OPT(CXX,--coverage) _MY_CXX_CHECK_OPT(CXX,--coverage)
# Otherwise inline may not show as uncovered # Otherwise inline may not show as uncovered
@@ -403,7 +350,7 @@ AC_SUBST(CFG_CXXFLAGS_PROFILE)
# Macros work such that first option that passes is the one we take # Macros work such that first option that passes is the one we take
# Currently enable c++17/c++14 due to packaged SystemC dependency # Currently enable c++17/c++14 due to packaged SystemC dependency
# c++17 is the newest that Verilator is regularly tested to support # c++17 is the newest that Verilator is regularly tested to support
# c++14 is the oldest that Verilator supports # c++11 is the oldest that Verilator supports
# gnu is required for Cygwin to compile verilated.h successfully # gnu is required for Cygwin to compile verilated.h successfully
#_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=gnu++20) #_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=gnu++20)
#_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=c++20) #_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=c++20)
@@ -411,6 +358,8 @@ _MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=gnu++17)
_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=c++17) _MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=c++17)
_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=gnu++14) _MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=gnu++14)
_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=c++14) _MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=c++14)
_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=gnu++11)
_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=c++11)
AC_SUBST(CFG_CXXFLAGS_STD_NEWEST) AC_SUBST(CFG_CXXFLAGS_STD_NEWEST)
# Flags for compiling Verilator internals including parser, and Verilated files # Flags for compiling Verilator internals including parser, and Verilated files
@@ -422,12 +371,33 @@ _MY_CXX_CHECK_OPT(CFG_CXXFLAGS_WEXTRA,-Wthread-safety)
AC_SUBST(CFG_CXXFLAGS_WEXTRA) AC_SUBST(CFG_CXXFLAGS_WEXTRA)
# Flags for coroutine support for dynamic scheduling # Flags for coroutine support for dynamic scheduling
_MY_CXX_CHECK_CORO_SET(CFG_CXXFLAGS_COROUTINES, "") _MY_CXX_CHECK_IFELSE(
_MY_CXX_CHECK_CORO_SET(CFG_CXXFLAGS_COROUTINES,-fcoroutines-ts) -fcoroutines-ts,
_MY_CXX_CHECK_CORO_SET(CFG_CXXFLAGS_COROUTINES,-fcoroutines) [CFG_CXXFLAGS_COROUTINES="-fcoroutines-ts"],
_MY_CXX_CHECK_CORO_SET(CFG_CXXFLAGS_COROUTINES,-fcoroutines-ts -Wno-deprecated-experimental-coroutine) [CFG_CXXFLAGS_COROUTINES="-fcoroutines"])
_MY_CXX_CHECK_CORO_SET(CFG_CXXFLAGS_COROUTINES,-std=gnu++20)
AC_SUBST(CFG_CXXFLAGS_COROUTINES) AC_SUBST(CFG_CXXFLAGS_COROUTINES)
# HAVE_COROUTINES
# Check if coroutines are supported at all
AC_MSG_CHECKING([whether coroutines are supported by $CXX])
ACO_SAVE_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $CFG_CXXFLAGS_COROUTINES"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([
#ifdef __clang__
#define __cpp_impl_coroutine 1
#endif
#include <coroutine>
],[[]])],
[_my_result=yes
AC_DEFINE([HAVE_COROUTINES],[1],[Defined if coroutines are supported by $CXX])],
[AC_LINK_IFELSE(
[AC_LANG_PROGRAM([#include <experimental/coroutine>],[[]])],
[_my_result=yes
AC_DEFINE([HAVE_COROUTINES],[1],[Defined if coroutines are supported by $CXX])],
[_my_result=no])])
AC_MSG_RESULT($_my_result)
CXXFLAGS="$ACO_SAVE_CXXFLAGS"
AC_SUBST(HAVE_COROUTINES) AC_SUBST(HAVE_COROUTINES)
# Flags for compiling Verilator internals including parser always # Flags for compiling Verilator internals including parser always
@@ -472,19 +442,14 @@ m4_foreach([cflag],[
[-mno-cet], [-mno-cet],
[-Qunused-arguments], [-Qunused-arguments],
[-Wno-bool-operation], [-Wno-bool-operation],
[-Wno-c++11-narrowing],
[-Wno-constant-logical-operand],
[-Wno-non-pod-varargs],
[-Wno-parentheses-equality],
[-Wno-shadow],
[-Wno-sign-compare],
[-Wno-tautological-bitwise-compare], [-Wno-tautological-bitwise-compare],
[-Wno-tautological-compare], [-Wno-parentheses-equality],
[-Wno-sign-compare],
[-Wno-uninitialized], [-Wno-uninitialized],
[-Wno-unused-but-set-parameter],
[-Wno-unused-but-set-variable], [-Wno-unused-but-set-variable],
[-Wno-unused-parameter], [-Wno-unused-parameter],
[-Wno-unused-variable]],[ [-Wno-unused-variable],
[-Wno-shadow]],[
_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_NO_UNUSED,cflag) _MY_CXX_CHECK_OPT(CFG_CXXFLAGS_NO_UNUSED,cflag)
# CMake will test what flags work itself, so pass all flags through to it # CMake will test what flags work itself, so pass all flags through to it
CFG_CXX_FLAGS_CMAKE="$CFG_CXX_FLAGS_CMAKE cflag" CFG_CXX_FLAGS_CMAKE="$CFG_CXX_FLAGS_CMAKE cflag"
@@ -526,7 +491,6 @@ AC_SUBST(CFG_LDFLAGS_VERILATED)
# pthreads is harmless otherwise. # pthreads is harmless otherwise.
CFG_LIBS="$LIBS $CFG_LIBS" CFG_LIBS="$LIBS $CFG_LIBS"
_MY_LDLIBS_CHECK_OPT(CFG_LIBS, -lpthread) _MY_LDLIBS_CHECK_OPT(CFG_LIBS, -lpthread)
_MY_LDLIBS_CHECK_OPT(CFG_LIBS, -latomic)
# Check libraries for MingW # Check libraries for MingW
_MY_LDLIBS_CHECK_OPT(CFG_LIBS, -lbcrypt) _MY_LDLIBS_CHECK_OPT(CFG_LIBS, -lbcrypt)
@@ -549,14 +513,14 @@ _MY_LDLIBS_CHECK_IFELSE(
fi]) fi])
AC_SUBST(CFG_LIBS) AC_SUBST(CFG_LIBS)
# Need C++14 at least # Need C++11 at least
#Alternative: AX_CXX_COMPILE_STDCXX([14]) #Alternative: AX_CXX_COMPILE_STDCXX([11])
AC_DEFUN([_MY_CXX_CHECK_CXX_VER], AC_DEFUN([_MY_CXX_CHECK_CXX_VER],
[# _MY_CXX_CHECK_CXX_VER(flag) -- Check if compiler runs C++14 [# _MY_CXX_CHECK_CXX_VER(flag) -- Check if compiler runs C++11
# Set $_my_result # Set $_my_result
AC_LINK_IFELSE( AC_LINK_IFELSE(
[AC_LANG_PROGRAM([#include <thread> [AC_LANG_PROGRAM([#include <thread>
#if (__cplusplus < 201402L) #if (__cplusplus < 201103L)
# error "Too old" # error "Too old"
#endif #endif
], [[ ]])], ], [[ ]])],
@@ -572,13 +536,13 @@ AC_DEFUN([_MY_CXX_CHECK_CXX_VER],
# Add $CFG_CXXFLAGS_STD only if can't compile correctly otherwise, # Add $CFG_CXXFLAGS_STD only if can't compile correctly otherwise,
# as adding std= when not needed can cause errors with the C++ std library. # as adding std= when not needed can cause errors with the C++ std library.
CFG_CXXFLAGS_STD=$CFG_CXXFLAGS_STD_NEWEST CFG_CXXFLAGS_STD=$CFG_CXXFLAGS_STD_NEWEST
AC_MSG_CHECKING(whether $CXX supports C++14) AC_MSG_CHECKING(whether $CXX supports C++11)
_MY_CXX_CHECK_CXX_VER() _MY_CXX_CHECK_CXX_VER()
AC_MSG_RESULT($_my_result) AC_MSG_RESULT($_my_result)
if test "$_my_result" = "no" ; then if test "$_my_result" = "no" ; then
CXXFLAGS="$CXXFLAGS $CFG_CXXFLAGS_STD" CXXFLAGS="$CXXFLAGS $CFG_CXXFLAGS_STD"
CFG_CXX_FLAGS_CMAKE="$CFG_CXX_FLAGS_CMAKE $CFG_CXXFLAGS_STD" CFG_CXX_FLAGS_CMAKE="$CFG_CXX_FLAGS_CMAKE $CFG_CXXFLAGS_STD"
AC_MSG_CHECKING(whether $CXX supports C++14 with $CFG_CXXFLAGS_STD) AC_MSG_CHECKING(whether $CXX supports C++11 with $CFG_CXXFLAGS_STD)
_MY_CXX_CHECK_CXX_VER() _MY_CXX_CHECK_CXX_VER()
AC_MSG_RESULT($_my_result) AC_MSG_RESULT($_my_result)
else else
@@ -588,28 +552,13 @@ else
fi fi
if test "$_my_result" = "no" ; then if test "$_my_result" = "no" ; then
AC_MSG_NOTICE([[]]) AC_MSG_NOTICE([[]])
AC_MSG_ERROR([[the $CXX compiler appears to not support C++14. AC_MSG_ERROR([[the $CXX compiler appears to not support C++11.
Verilator requires a C++14 or newer compiler.]]) Verilator requires a C++11 or newer compiler.]])
fi fi
AC_SUBST(CFG_CXXFLAGS_STD) AC_SUBST(CFG_CXXFLAGS_STD)
# Compiler precompiled header options (assumes either gcc or clang++)
AC_MSG_CHECKING([for $CXX precompile header include option])
if $CXX --help | grep include-pch >/dev/null 2>/dev/null ; then
# clang
CFG_CXXFLAGS_PCH_I=-include-pch
CFG_GCH_IF_CLANG=.gch
else
# GCC
CFG_CXXFLAGS_PCH_I=-include
CFG_GCH_IF_CLANG=
fi
AC_MSG_RESULT($CFG_CXXFLAGS_PCH_I)
AC_SUBST(CFG_CXXFLAGS_PCH_I)
AC_SUBST(CFG_GCH_IF_CLANG)
# Checks for library functions. # Checks for library functions.
AC_CHECK_MEMBER([struct stat.st_mtim.tv_nsec], AC_CHECK_MEMBER([struct stat.st_mtim.tv_nsec],
[AC_DEFINE([HAVE_STAT_NSEC],[1],[Defined if struct stat has st_mtim.tv_nsec])], [AC_DEFINE([HAVE_STAT_NSEC],[1],[Defined if struct stat has st_mtim.tv_nsec])],
@@ -624,7 +573,7 @@ ACO_SAVE_LIBS="$LIBS"
LIBS="$LIBS -lsystemc" LIBS="$LIBS -lsystemc"
AC_LINK_IFELSE( AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[#include <systemc.h> [AC_LANG_PROGRAM([[#include <systemc.h>
extern "C" int sc_main(int argc, char* argv[]) { return 0; } extern "C" int sc_main(int argc, char* argv[]) {}
]],[[sc_version()]])], ]],[[sc_version()]])],
[_my_result=yes [_my_result=yes
AC_DEFINE([HAVE_SYSTEMC],[1],[Defined if have SystemC library])], AC_DEFINE([HAVE_SYSTEMC],[1],[Defined if have SystemC library])],
@@ -635,9 +584,6 @@ AC_SUBST(HAVE_SYSTEMC)
# Checks for system services # Checks for system services
######################################################################
## Output
# Other install directories # Other install directories
pkgdatadir=${datadir}/verilator pkgdatadir=${datadir}/verilator
AC_SUBST(pkgdatadir) AC_SUBST(pkgdatadir)
-58
View File
@@ -4,73 +4,52 @@ under the Developer Certificate of Origin (https://developercertificate.org/).
Please see the Verilator manual for 200+ additional contributors. Thanks to all. Please see the Verilator manual for 200+ additional contributors. Thanks to all.
Adam Bagley Adam Bagley
Adrian Sampson
Adrien Le Masle Adrien Le Masle
Ahmed El-Mahmoudy Ahmed El-Mahmoudy
Aidan McNay
Aleksander Kiryk Aleksander Kiryk
Alex Chadwick Alex Chadwick
Alex Solomatnikov
Àlex Torregrosa Àlex Torregrosa
Aliaksei Chapyzhenka Aliaksei Chapyzhenka
Ameya Vikram Singh Ameya Vikram Singh
Andrea Calabrese
Andreas Kuster Andreas Kuster
Andrei Kostovski Andrei Kostovski
Andrew Miloradovsky Andrew Miloradovsky
Andrew Nolte Andrew Nolte
Anthony Donlon Anthony Donlon
Anthony Moore
Arkadiusz Kozdra Arkadiusz Kozdra
Arthur Rosa
Aylon Chaim Porat Aylon Chaim Porat
Bartłomiej Chmiel
Cameron Kirk Cameron Kirk
Chih-Mao Chen
Chris Bachhuber
Chris Randall Chris Randall
Christopher Taylor
Chuxuan Wang Chuxuan Wang
Chykon
Conor McCullough Conor McCullough
Dan Petrisko Dan Petrisko
Daniel Bates Daniel Bates
David Horton David Horton
David Ledger
David Metz David Metz
David Stanford David Stanford
David Turner David Turner
Dercury
Don Williamson Don Williamson
Drew Ranck Drew Ranck
Drew Taussig Drew Taussig
Driss Hafdi Driss Hafdi
Edgar E. Iglesias Edgar E. Iglesias
Eric Müller
Eric Rippey Eric Rippey
Ethan Sifferman Ethan Sifferman
Eyck Jentzsch Eyck Jentzsch
Furqan Nadir
Fabian Keßler
Fan Shupei Fan Shupei
february cozzocrea february cozzocrea
Felix Neumärker Felix Neumärker
Felix Yan Felix Yan
Frans Skarman Frans Skarman
Fuad Ismail
G-A. Kamendje G-A. Kamendje
Garrett Smith Garrett Smith
Geza Lore Geza Lore
Gianfranco Costamagna Gianfranco Costamagna
Gijs Burghoorn
Glen Gibb Glen Gibb
Gökçe Aydos Gökçe Aydos
Graham Rushton Graham Rushton
Greg Davill
Guokai Chen Guokai Chen
Gus Smith
Gustav Svensk Gustav Svensk
Han Qi
Harald Heckmann Harald Heckmann
Hennadii Chernyshchyk Hennadii Chernyshchyk
Howard Su Howard Su
@@ -78,13 +57,11 @@ Huang Rui
Huanghuang Zhou Huanghuang Zhou
HungMingWu HungMingWu
HyungKi Jeong HyungKi Jeong
Ícaro Lima
Ilya Barkov Ilya Barkov
Iru Cai Iru Cai
Ivan Vnučec Ivan Vnučec
Iztok Jeras Iztok Jeras
Jake Merdich Jake Merdich
James Bailey
James Hanlon James Hanlon
James Hutchinson James Hutchinson
James Pallister James Pallister
@@ -92,22 +69,18 @@ James Shi
Jamey Hicks Jamey Hicks
Jamie Iles Jamie Iles
Jan Van Winkel Jan Van Winkel
Jiangjie Weng
Jean Berniolles Jean Berniolles
Jeremy Bennett Jeremy Bennett
Jesse Taube Jesse Taube
Jevin Sweval Jevin Sweval
Jiacheng Qian Jiacheng Qian
Jiamin Zhu Jiamin Zhu
Jinyan Xu
Jiuyang Liu Jiuyang Liu
Joey Liu Joey Liu
John Coiner John Coiner
John Demme John Demme
John Wehle John Wehle
Jonathan Drolet Jonathan Drolet
Jonathan Schröter
Jordan McConnon
Jose Loyola Jose Loyola
Josep Sans Josep Sans
Joseph Nwabueze Joseph Nwabueze
@@ -115,24 +88,17 @@ Josh Redford
Julian Daube Julian Daube
Julie Schwartz Julie Schwartz
Julien Margetts Julien Margetts
Justin Thiel
Kaleb Barrett Kaleb Barrett
Kamil Rakoczy Kamil Rakoczy
Kanad Kanhere Kanad Kanhere
Kefa Chen
Keith Colbert Keith Colbert
Kevin Kiningham Kevin Kiningham
Kevin Nygaard
Kritik Bhimani Kritik Bhimani
Krzysztof Bieganski Krzysztof Bieganski
Krzysztof Boronski Krzysztof Boronski
Krzysztof Boroński Krzysztof Boroński
Krzysztof Obłonczek
Krzysztof Starecki
Kuba Ober Kuba Ober
Larry Doolittle Larry Doolittle
Liam Braun
Luca Colagrande
Ludwig Rogiers Ludwig Rogiers
Lukasz Dalek Lukasz Dalek
Maarten De Braekeleer Maarten De Braekeleer
@@ -146,62 +112,45 @@ Marshal Qiao
Martin Schmidt Martin Schmidt
Martin Stadler Martin Stadler
Matthew Ballance Matthew Ballance
Michael Bikovitsky
Michael Killough Michael Killough
Michaël Lefebvre Michaël Lefebvre
Michal Czyz
Mike Popoloski Mike Popoloski
Miodrag Milanović Miodrag Milanović
Mladen Slijepcevic Mladen Slijepcevic
Morten Borup Petersen Morten Borup Petersen
Mostafa Gamal Mostafa Gamal
Nandu Raj Nandu Raj
Nathan Graybeal
Nathan Kohagen Nathan Kohagen
Nathan Myers Nathan Myers
Nolan Poe
Oleh Maksymenko Oleh Maksymenko
Patrick Stewart Patrick Stewart
Paul Bowen-Huggett
Paul Swirhun
Paul Wright Paul Wright
Pawel Jewstafjew
Pawel Sagan Pawel Sagan
Pengcheng Xu
Peter Debacker Peter Debacker
Peter Horvath Peter Horvath
Peter Monsson Peter Monsson
Philip Axer
Philipp Wagner Philipp Wagner
Pierre-Henri Horrein Pierre-Henri Horrein
Pieter Kapsenberg Pieter Kapsenberg
Piotr Binkowski Piotr Binkowski
Qingyao Sun Qingyao Sun
Quentin Corradi
Rafal Kapuscik Rafal Kapuscik
Rasfunk
Raynard Qiao Raynard Qiao
Ricardo Barbedo
Richard Myers Richard Myers
Risto Pejašinović Risto Pejašinović
Robert Balas Robert Balas
Rupert Swarbrick Rupert Swarbrick
Ryan Ziegler
Ryszard Rozak Ryszard Rozak
Samuel Riedel Samuel Riedel
Sean Cross Sean Cross
Sebastien Van Cauwenberghe Sebastien Van Cauwenberghe
Sergi Granell Sergi Granell
Seth Pellegrino
Srinivasan Venkataramanan Srinivasan Venkataramanan
Stefan Wallentowitz Stefan Wallentowitz
Stephen Henry Stephen Henry
Steven Hugg Steven Hugg
sumpster
Szymon Gizler
Sören Tempel Sören Tempel
Teng Huang Teng Huang
Tom Manner
Tim Hutt Tim Hutt
Tim Snyder Tim Snyder
Tobias Rosenkranz Tobias Rosenkranz
@@ -214,8 +163,6 @@ Tudor Timi
Tymoteusz Blazejczyk Tymoteusz Blazejczyk
Udi Finkelstein Udi Finkelstein
Unai Martinez-Corral Unai Martinez-Corral
Udaya Raj Subedi
Valentin Atepalikhin
Varun Koyyalagunta Varun Koyyalagunta
Vassilis Papaefstathiou Vassilis Papaefstathiou
Veripool API Bot Veripool API Bot
@@ -224,9 +171,6 @@ Vito Gamberini
William D. Jones William D. Jones
Wilson Snyder Wilson Snyder
Xi Zhang Xi Zhang
Yan Xu
Yangyu Chen
Yilou Wang
Yinan Xu Yinan Xu
Yoda Lee Yoda Lee
Yossi Nivin Yossi Nivin
@@ -235,7 +179,5 @@ Yuri Victorovich
Yutetsu TAKATSUKASA Yutetsu TAKATSUKASA
Yves Mathieu Yves Mathieu
Zhanglei Wang Zhanglei Wang
Zhou Shen
Zixi Li Zixi Li
أحمد المحمودي أحمد المحمودي
404allen404
+2 -2
View File
@@ -5,7 +5,7 @@
# #
# Code available from: https://verilator.org # Code available from: https://verilator.org
# #
# Copyright 2003-2025 by Wilson Snyder. This program is free software; you # Copyright 2003-2023 by Wilson Snyder. This program is free software; you
# can redistribute it and/or modify it under the terms of either the GNU # 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 # Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0. # Version 2.0.
@@ -23,7 +23,7 @@ SPHINXBUILD ?= sphinx-build
SOURCEDIR = guide SOURCEDIR = guide
BUILDDIR = _build BUILDDIR = _build
SPHINXOPTS ?= -c guide -j 4 SPHINXOPTS ?= -c guide
ifneq ($(VERILATOR_ANALYTICS_ID),) ifneq ($(VERILATOR_ANALYTICS_ID),)
SPHINXOPTS += -D html_theme_options.analytics_id=$(VERILATOR_ANALYTICS_ID) SPHINXOPTS += -D html_theme_options.analytics_id=$(VERILATOR_ANALYTICS_ID)
endif endif
-21
View File
@@ -1,21 +0,0 @@
Verilator Documentation
=======================
This folder contains sources for Verilator documentation.
For formatted documentation see:
- `Verilator README <https://github.com/verilator/verilator>`_
- `Verilator installation and package directory structure
<https://verilator.org/install>`_
- `Verilator manual (HTML) <https://verilator.org/verilator_doc.html>`_,
or `Verilator manual (PDF) <https://verilator.org/verilator_doc.pdf>`_
- `Subscribe to Verilator announcements
<https://github.com/verilator/verilator-announce>`_
- `Verilator forum <https://verilator.org/forum>`_
- `Verilator issues <https://verilator.org/issues>`_
+10 -4
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# pylint: disable=C0112,C0114,C0115,C0116,C0209,C0301,R0903 # pylint: disable=C0112,C0114,C0115,C0116,C0209,C0301,R0201,R0903
# -*- Python -*- See copyright, etc below # -*- Python -*- See copyright, etc below
###################################################################### ######################################################################
@@ -23,7 +23,9 @@ class VlSphinxExtract:
outname = match.group(1) outname = match.group(1)
print("Writing %s" % outname) print("Writing %s" % outname)
fhw = open(outname, "w", encoding="utf8") # pylint: disable=consider-using-with fhw = open(outname, "w", encoding="utf8") # pylint: disable=consider-using-with
fhw.write(".. comment: generated by vl_sphinx_extract from " + filename + "\n") fhw.write(
".. comment: generated by vl_sphinx_extract from " +
filename + "\n")
fhw.write(".. code-block::\n") fhw.write(".. code-block::\n")
elif re.match(r'^[=a-zA-Z0-9_]', line): elif re.match(r'^[=a-zA-Z0-9_]', line):
fhw = None fhw = None
@@ -37,14 +39,18 @@ parser = argparse.ArgumentParser(
allow_abbrev=False, allow_abbrev=False,
formatter_class=argparse.RawDescriptionHelpFormatter, formatter_class=argparse.RawDescriptionHelpFormatter,
description="""Read a file and extract documentation data.""", description="""Read a file and extract documentation data.""",
epilog=""" Copyright 2021-2025 by Wilson Snyder. This package is free software; epilog=
""" Copyright 2021-2023 by Wilson Snyder. This package is free software;
you can redistribute it and/or modify it under the terms of either the GNU 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 Lesser General Public License Version 3 or the Perl Artistic License
Version 2.0. Version 2.0.
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0""") SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0""")
parser.add_argument('--debug', action='store_const', const=9, help='enable debug') parser.add_argument('--debug',
action='store_const',
const=9,
help='enable debug')
parser.add_argument('path', help='path to extract from') parser.add_argument('path', help='path to extract from')
Args = parser.parse_args() Args = parser.parse_args()
+8 -3
View File
@@ -18,7 +18,8 @@ class VlSphinxFix:
if os.path.isdir(path): if os.path.isdir(path):
for basefile in os.listdir(path): for basefile in os.listdir(path):
file = os.path.join(path, basefile) file = os.path.join(path, basefile)
if ((basefile != ".") and (basefile != "..") and basefile not in self.SkipBasenames if ((basefile != ".") and (basefile != "..")
and basefile not in self.SkipBasenames
and not os.path.islink(file)): and not os.path.islink(file)):
self.process(file) self.process(file)
elif re.search(r'\.(html|tex)$', path): elif re.search(r'\.(html|tex)$', path):
@@ -53,14 +54,18 @@ parser = argparse.ArgumentParser(
allow_abbrev=False, allow_abbrev=False,
formatter_class=argparse.RawDescriptionHelpFormatter, formatter_class=argparse.RawDescriptionHelpFormatter,
description="""Post-process Sphinx HTML.""", description="""Post-process Sphinx HTML.""",
epilog=""" Copyright 2021-2025 by Wilson Snyder. This package is free software; epilog=
""" Copyright 2021-2023 by Wilson Snyder. This package is free software;
you can redistribute it and/or modify it under the terms of either the GNU 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 Lesser General Public License Version 3 or the Perl Artistic License
Version 2.0. Version 2.0.
SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0""") SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0""")
parser.add_argument('--debug', action='store_const', const=9, help='enable debug') parser.add_argument('--debug',
action='store_const',
const=9,
help='enable debug')
parser.add_argument('path', help='path to edit') parser.add_argument('path', help='path to edit')
Args = parser.parse_args() Args = parser.parse_args()
-11
View File
@@ -1,11 +0,0 @@
.. comment: generated by t_lint_pinmissing_bad
.. code-block:: sv
:linenos:
:emphasize-lines: 2
module t;
sub sub(); // <--- Warning
endmodule
module sub
(output port);
endmodule
-4
View File
@@ -1,4 +0,0 @@
.. comment: generated by t_lint_pinmissing_bad
.. code-block::
%Warning-PINMISSING: example.v:1:8 Cell has missing pin: 'port'
-11
View File
@@ -1,11 +0,0 @@
.. comment: generated by t_lint_pkgnodecl_bad
.. code-block:: sv
:linenos:
:emphasize-lines: 2
module t;
initial Pkg::hello(); //<--- Warning
endmodule
package Pkg;
function void hello(); endfunction
endpackage
-4
View File
@@ -1,4 +0,0 @@
.. comment: generated by t_lint_pkgnodecl_bad
.. code-block::
%Error-PKGNODECL: example.v:1:12 Package/class 'Pkg' not found, and needs to be predeclared (IEEE 1800-2023 26.3)
+1 -1
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2025 by Wilson Snyder. .. Copyright 2003-2023 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
**************** ****************
+7 -5
View File
@@ -1,7 +1,7 @@
# pylint: disable=C0103,C0114,C0116,C0301,E0402,W0622 # pylint: disable=C0103,C0114,C0116,C0301,E0402,W0622
# #
# Configuration file for Verilator's Sphinx documentation builder. # Configuration file for Verilator's Sphinx documentation builder.
# Copyright 2003-2025 by Wilson Snyder. # Copyright 2003-2023 by Wilson Snyder.
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 # SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
# #
# This file only contains overridden options. For a full list: # This file only contains overridden options. For a full list:
@@ -23,7 +23,8 @@ def get_vlt_version():
filename = "../../Makefile" filename = "../../Makefile"
with open(filename, "r", encoding="utf8") as fh: with open(filename, "r", encoding="utf8") as fh:
for line in fh: for line in fh:
match = re.search(r"PACKAGE_VERSION *= *([a-z0-9.]+) +([-0-9]+)", line) match = re.search(r"PACKAGE_VERSION *= *([a-z0-9.]+) +([-0-9]+)",
line)
if match: if match:
return match.group(1), match.group(2) return match.group(1), match.group(2)
match = re.search(r"PACKAGE_VERSION *= *([a-z0-9.]+) +devel", line) match = re.search(r"PACKAGE_VERSION *= *([a-z0-9.]+) +devel", line)
@@ -44,7 +45,7 @@ def setup(app):
# -- Project information # -- Project information
project = 'Verilator' project = 'Verilator'
copyright = '2024 by Wilson Snyder, under LGPL-3.0 or Artistic-2.0' copyright = '2022 by Wilson Snyder, under LGPL-3.0 or Artistic-2.0'
author = 'Wilson Snyder' author = 'Wilson Snyder'
# The master toctree document. # The master toctree document.
@@ -74,7 +75,8 @@ extensions = []
# directories to ignore when looking for source files. # directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path. # This pattern also affects html_static_path and html_extra_path.
exclude_patterns = [ exclude_patterns = [
'_build', 'Thumbs.db', '.DS_Store', 'internals.rst', 'xml.rst', 'gen/ex_*', 'CONTRIBUTING.rst' '_build', 'Thumbs.db', '.DS_Store', 'internals.rst', 'xml.rst', 'gen/ex_*',
'CONTRIBUTING.rst'
] ]
# Warn about refs # Warn about refs
@@ -228,4 +230,4 @@ spelling_ignore_contributor_names = True
breathe_projects = {"verilated": "_build/doxygen/verilated/xml/"} breathe_projects = {"verilated": "_build/doxygen/verilated/xml/"}
breathe_default_project = "verilated" breathe_default_project = "verilated"
breathe_default_members = 'members' breathe_default_members = ('members')
+2 -12
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2025 by Wilson Snyder. .. Copyright 2003-2023 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
.. _Connecting: .. _Connecting:
@@ -407,16 +407,6 @@ only a couple of instructions.
For signal callbacks to work the main loop of the program must call For signal callbacks to work the main loop of the program must call
:code:`VerilatedVpi::callValueCbs()`. :code:`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()`.
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()`.
.. _VPI Example: .. _VPI Example:
@@ -510,7 +500,7 @@ the user should call:
any delayed events pending, any delayed events pending,
* :code:`designp->nextTimeSlot()`, which returns the simulation time of the * :code:`designp->nextTimeSlot()`, which returns the simulation time of the
next delayed event. This method can only be called if next delayed event. This method can only be called if
:code:`designp->eventsPending()` returned :code:`true`. :code:`designp->nextTimeSlot()` returned :code:`true`.
Call :code:`eventsPending()` to check if you should continue with the Call :code:`eventsPending()` to check if you should continue with the
simulation, and then :code:`nextTimeSlot()` to move simulation time forward. simulation, and then :code:`nextTimeSlot()` to move simulation time forward.
+12 -30
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2025 by Wilson Snyder. .. Copyright 2003-2023 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
******************************* *******************************
@@ -23,24 +23,24 @@ Next, try the :vlopt:`--debug` option. This will enable additional
internal assertions, and may help identify the problem. internal assertions, and may help identify the problem.
Finally, reduce your code to the smallest possible routine that exhibits Finally, reduce your code to the smallest possible routine that exhibits
the bug (see: :ref:`Minimizing bug-inducing code`). Even better, create the bug. Even better, create a test in the :file:`test_regress/t`
a test in the :file:`test_regress/t` directory, as follows: directory, as follows:
.. code-block:: bash .. code-block:: bash
cd test_regress cd test_regress
cp -p t/t_EXAMPLE.py t/t_BUG.py cp -p t/t_EXAMPLE.pl t/t_BUG.pl
cp -p t/t_EXAMPLE.v t/t_BUG.v cp -p t/t_EXAMPLE.v t/t_BUG.v
There are many hints on how to write a good test in the 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: :file:`test_regress/driver.pl` documentation which can be seen by running:
.. code-block:: bash .. code-block:: bash
cd $VERILATOR_ROOT # Need the original distribution kit cd $VERILATOR_ROOT # Need the original distribution kit
test_regress/driver.py --help test_regress/driver.pl --help
Edit :file:`t/t_BUG.py` to suit your example; you can do anything you want Edit :file:`t/t_BUG.pl` to suit your example; you can do anything you want
in the Verilog code there; just make sure it retains the single clk input 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:
@@ -48,38 +48,20 @@ and no outputs. Now, the following should fail:
cd $VERILATOR_ROOT # Need the original distribution kit cd $VERILATOR_ROOT # Need the original distribution kit
cd test_regress cd test_regress
t/t_BUG.py # Run on Verilator t/t_BUG.pl # Run on Verilator
t/t_BUG.py --debug # Run on Verilator, passing --debug to Verilator t/t_BUG.pl --debug # Run on Verilator, passing --debug to Verilator
t/t_BUG.py --vcs # Run on VCS simulator t/t_BUG.pl --vcs # Run on VCS simulator
t/t_BUG.py --nc|--iv|--ghdl # Likewise on other simulators t/t_BUG.pl --nc|--iv|--ghdl # Likewise on other simulators
The test driver accepts a number of options, many of which mirror the main 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 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. :command:`driver.pl --help` as shown above.
Finally, report the bug at `Verilator Issues Finally, report the bug at `Verilator Issues
<https://verilator.org/issues>`_. The bug will become publicly visible; if <https://verilator.org/issues>`_. The bug will become publicly visible; if
this is unacceptable, mail the bug report to ``[email protected]``. this is unacceptable, mail the bug report to ``[email protected]``.
.. _Minimizing bug-inducing code:
Minimizing bug-inducing code
============================
In some cases, the part of the code that causes the bug is clearly visible
and the design can be easily manually reduced. In other cases, the bug is
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
<https://github.com/antmicro/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
lines to a minimal test case while preserving the bug-inducing behavior.
Please refer to the `README
<https://github.com/antmicro/sv-bugpoint/blob/main/README.md>`_ file for more
information on how to use `sv-bugpoint`.
.. Contributing .. Contributing
.. ============ .. ============
+96 -136
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2025 by Wilson Snyder. .. Copyright 2003-2023 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
************************ ************************
@@ -27,147 +27,107 @@ Alliance <https://chipsalliance.org>`_, `Antmicro Ltd
<https://antmicro.com>`_ and `Shunyao CAD <https://shunyaocad.com>`_. <https://antmicro.com>`_ and `Shunyao CAD <https://shunyaocad.com>`_.
Previous major corporate sponsors of Verilator, by providing significant Previous major corporate sponsors of Verilator, by providing significant
contributions of time or funds include: Antmicro Ltd., Atmel Corporation, contributions of time or funds include: Atmel Corporation, Cavium
Compaq Corporation, Digital Equipment Corporation, Embecosm Ltd., Hicamp Inc., Compaq Corporation, Digital Equipment Corporation, Embecosm Ltd.,
Systems, Intel Corporation, Marvell Inc., Mindspeed Technologies Inc., Hicamp Systems, Intel Corporation, Mindspeed Technologies Inc., MicroTune
MicroTune Inc., picoChip Designs Ltd., Sun Microsystems Inc., Nauticus Inc., picoChip Designs Ltd., Sun Microsystems Inc., Nauticus Networks Inc.,
Networks Inc., SiCortex Inc, Shunyao CAD, and Western Digital Inc. SiCortex Inc, and Shunyao CAD.
The contributors of major functionality are: Jeremy Bennett, Krzysztof The contributors of major functionality are: Krzysztof
Bieganski, Byron Bradley, Lane Brooks, John Coiner, Duane Galbi, Arkadiusz Bieganski, Byron Bradley, Jeremy Bennett, Lane Brooks, John Coiner, Duane
Kozdra, Geza Lore, Todd Strader, Yutetsu Takatsukasa, Stefan Wallentowitz, Galbi, Geza Lore, Todd Strader, Stefan Wallentowitz, Paul Wasson, Jie Xu,
Paul Wasson, Jie Xu, and Wilson Snyder. and Wilson Snyder. Major testers included Jeff Dutton, Jonathon Donaldson,
Ralf Karge, David Hewson, Iztok Jeras, Wim Michiels, Alex Solomatnikov,
Sebastien Van Cauwenberghe, Gene Weber, and Clifford Wolf.
Some of the people who have provided ideas, and feedback for Verilator Some of the people who have provided ideas, and feedback for Verilator
include: include:
David Addison, Tariq B. Ahmad, Nikana Anastasiadis, John David Anglin, David Addison, Tariq B. Ahmad, Nikana Anastasiadis, Vasu Arasanipalai, Jens
Frederic Antonin, Hans Van Antwerpen, Vasu Arasanipalai, Jens Arm, Rohan Arm, Sharad Bagri, Matthew Ballance, Andrew Bardsley, Matthew Barr, Geoff
Arshid, Valentin Atepalikhin, Philip Axer, Gökçe Aydos, Chris Bachhuber, Barrett, Kaleb Barrett, Julius Baxter, Jeremy Bennett, Michael Berman, Jean
Filip Badáň, Adam Bagley, Sharad Bagri, James Bailey, Robert Balas, Marco Berniolles, Victor Besyakov, Moinak Bhattacharyya, Krzysztof Bieganski,
Balboni, Matthew Ballance, Ricardo Barbedo, Andrew Bardsley, Ilya Barkov, David Binderman, Piotr Binkowski, Johan Bjork, David Black, Tymoteusz
Matthew Barr, Geoff Barrett, Kaleb Barrett, Daniel Bates, Julius Baxter, Blazejczyk, Daniel Bone, Gregg Bouchard, Christopher Boumenot, Nick Bowler,
Michael Berman, Jean Berniolles, Victor Besyakov, Narayan Bhagavatula, Byron Bradley, Bryan Brady, Maarten De Braekeleer, Charlie Brej, J Briquet,
Moinak Bhattacharyya, Kritik Bhimani, David Biancolin, Krzysztof Bieganski, Lane Brooks, John Brownlee, Jeff Bush, Lawrence Butcher, Tony Bybell, Iru
Michael Bikovitsky, David Binderman, Piotr Binkowski, Johan Björk, David Cai, Ted Campbell, Chris Candler, Lauren Carlson, Donal Casey, Alex
Black, Tymoteusz Blazejczyk, Scott Bleiweiss, David van der Bokke, Daniel Chadwick, Marcel Chang, Aliaksei Chapyzhenka, Guokai Chen, Terry Chen,
Bone, Guy Bonneau, Krzysztof Boroński, Gregg Bouchard, Christopher Yi-Chung Chen, Enzo Chi, Robert A. Clark, Ryan Clarke, Allan Cochrane, John
Boumenot, Paul Bowen-Huggett, Nick Bowler, Bryan Brady, Maarten De Coiner, Keith Colbert, Gianfranco Costamagna, Sean Cross, George Cuan, Joe
Braekeleer, Liam Braun, Charlie Brej, J Briquet, John Brownlee, KC DErrico, Lukasz Dalek, Gunter Dannoritzer, Ashutosh Das, Bernard Deadman,
Buckenmaier, Gijs Burghoorn, Jeff Bush, Lawrence Butcher, Tony Bybell, Iru John Demme, Mike Denio, John Deroo, Philip Derrick, John Dickol, Ruben
Cai, Ted Campbell, Anthony Campos, Chris Candler, Lauren Carlson, Gregory Diez, Danny Ding, Jacko Dirks, Ivan Djordjevic, Jonathon Donaldson, Larry
Carver, Donal Casey, Sebastien Van Cauwenberghe, Alex Chadwick, Greg Doolittle, Sebastian Dressler, Jonathan Drolet, Alex Duller, Jeff Dutton,
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, Tomas Dzetkulic, Usuario Eda, Charles Eddleston, Chandan Egbert, Joe Eiler,
Ahmed El-Mahmoudy, Trevor Elbourne, Mats Engstrom, Robert Farrell, Julien Ahmed El-Mahmoudy, Trevor Elbourne, Mats Engstrom, Robert Farrell, Eugen
Faucher, Olivier Faure, Eugene Feinberg, Eugen Fekete, Fabrizio Ferrandi, Fekete, Fabrizio Ferrandi, Udi Finkelstein, Brian Flachs, Bill Flynn,
Udi Finkelstein, Brian Flachs, Bill Flynn, Andrea Foletto, Alex Forencich, Andrea Foletto, Bob Fredieu, Duane Galbi, Mostafa Gamal, Benjamin Gartner,
Aurelien Francillon, Bob Fredieu, Manuel Freiberger, Mostafa Gamal, Vito Christian Gelinek, Richard E George, Peter Gerst, Glen Gibb, Michael
Gamberini, Mostafa Garnal, Benjamin Gartner, Christian Gelinek, Richard E Gielda, Barbara Gigerl, Shankar Giri, Dan Gisselquist, Petr Gladkikh, Sam
George, Peter Gerst, Glen Gibb, Michael Gielda, Barbara Gigerl, Nimrod Gladstone, Mariusz Glebocki, Andrew Goessling, Amir Gonnen, Chitlesh
Gileadi, Shankar Giri, Dan Gisselquist, Szymon Gizler, Petr Gladkikh, Sam Goorah, Tomasz Gorochowik, Kai Gossner, Sergi Granell, Al Grant, Nathan
Gladstone, Mariusz Glebocki, Embedded Go, Andrew Goessling, Amir Gonnen, Graybeal, Alexander Grobman, Graham Rushton, Xuan Guo, Driss Hafdi, Neil
Chitlesh Goorah, Tomasz Gorochowik, Kai Gossner, Tarik Graba, Sergi Hamilton, James Hanlon, Oyvind Harboe, Jannis Harder, Junji Hashimoto,
Granell, Al Grant, Nathan Graybeal, Alexander Grobman, Qian Gu, Xuan Guo, Thomas Hawkins, Mitch Hayenga, Harald Heckmann, Robert Henry, Stephen
Prabhat Gupta, Deniz Güzel, Driss Hafdi, Abdul Hameed, Neil Hamilton, James Henry, David Hewson, Jamey Hicks, Joel Holdsworth, Andrew Holme, Hiroki
Hanlon, Tang Haojin, Øyvind Harboe, Jannis Harder, David Harris, Junji Honda, Alex Hornung, Pierre-Henri Horrein, David Horton, Peter Horvath, Jae
Hashimoto, Thomas Hawkins, Mitch Hayenga, Harald Heckmann, Robert Henry, Hossell, Kuoping Hsu, Teng Huang, Steven Hugg, Alan Hunter, James
Stephen Henry, Sebastian Hesselbarth, David Hewson, Jamey Hicks, Joel Hutchinson, Ehab Ibrahim, Edgar E. Iglesias, Jamie Iles, Vighnesh Iyer, Ben
Holdsworth, Andrew Holme, Peter Holmes, Hiroki Honda, Alex Hornung, Jackson, Shareef Jalloq, Marlon James, Krzysztof Jankowski, HyungKi Jeong,
Pierre-Henri Horrein, David Horton, Peter Horvath, Jae Hossell, Kuoping Iztok Jeras, Alexandre Joannou, James Johnson, Christophe Joly, Franck
Hsu, Shou-Li Hsu, Teng Huang, Steven Hugg, Alan Hunter, James Hutchinson, Jullien, James Jung, Mike Kagen, Arthur Kahlich, Kaalia Kahn, Guy-Armand
Tim Hutt, Ehab Ibrahim, Edgar E. Iglesias, Shahid Ikram, Jamie Iles, Fuad Kamendje, Vasu Kandadi, Kanad Kanhere, Patricio Kaplan, Pieter Kapsenberg,
Ismail, Vighnesh Iyer, Ben Jackson, Daniel Jacques, Shareef Jalloq, Marlon Rafal Kapuscik, Ralf Karge, Per Karlsson, Dan Katz, Sol Katzman, Ian
James, Krzysztof Jankowski, Eyck Jentzsch, HyungKi Jeong, Iztok Jeras, Kennedy, Michael Killough, Sun Kim, Jonathan Kimmitt, Olof Kindgren, Kevin
Pawel Jewstafjew, Alexandre Joannou, James Johnson, Christophe Joly, Justin Kiningham, Dan Kirkham, Aleksander Kiryk, Sobhan Klnv, Gernot Koch, Jack
Jones, William D. Jones, Abe Jordan, Larry Darryl Lee Jr., Franck Jullien, Koenig, Soon Koh, Nathan Kohagen, Steve Kolecki, Brett Koonce, Will
James Jung, Mike Kagen, Arthur Kahlich, Kaalia Kahn, Guy-Armand Kamendje, Korteland, Wojciech Koszek, Varun Koyyalagunta, Arkadiusz Kozdra, Markus
Vasu Kandadi, Yoshitomo Kaneda, Kanad Kanhere, Patricio Kaplan, Pieter Krause, David Kravitz, Roland Kruse, Andreas Kuster, Sergey Kvachonok,
Kapsenberg, Rafal Kapuscik, Ralf Karge, Per Karlsson, Dan Katz, Sol Charles Eric LaForest, Ed Lander, Steve Lang, Stephane Laurent, Walter
Katzman, Ian Kennedy, Ami Keren, Fabian Keßler, Michael Killough, Sun Kim, Lavino, Christian Leber, Larry Lee, Yoda Lee, Michaël Lefebvre, Igor Lesik,
Jonathan Kimmitt, Olof Kindgren, Kevin Kiningham, Cameron Kirk, Dan John Li, Eivind Liland, Yu Sheng Lin, Charlie Lind, Andrew Ling, Jiuyang
Kirkham, Aleksander Kiryk, Sobhan Klnv, Gernot Koch, Jack Koenig, Soon Koh, Liu, Paul Liu, Derek Lockhart, Jake Longo, Geza Lore, Arthur Low, Stefan
Nathan Kohagen, Steve Kolecki, Brett Koonce, Will Korteland, Andrei Ludwig, Dan Lussier, Fred Ma, Duraid Madina, Affe Mao, Julien Margetts,
Kostovski, Wojciech Koszek, Varun Koyyalagunta, Arkadiusz Kozdra, Markus Mark Marshall, Alfonso Martinez, Unai Martinez-Corral, Adrien Le Masle,
Krause, David Kravitz, Adam Krolnik, Roland Kruse, Mahesh Kumashikar, Yves Mathieu, Patrick Maupin, Conor McCullough, Jason McMullan, Elliot
Andreas Kuster, Sergey Kvachonok, Charles Eric LaForest, Kevin Laeufer, Ed Mednick, David Metz, Wim Michiels, Miodrag Milanovic, Kevin Millis, Wai Sum
Lander, Steve Lang, Pierre Laroche, Stephane Laurent, Walter Lavino, Mong, Peter Monsson, Sean Moore, Dennis Muhlestein, John Murphy, Matt
Christian Leber, David Ledger, Alex Lee, Larry Lee, Yoda Lee, Michaël Myers, Nathan Myers, Richard Myers, Dimitris Nalbantis, Peter Nelson, Bob
Lefebvre, Dag Lem, Igor Lesik, John Li, Kay Li, Zixi Li, Davide Libenzi, Newgard, Rachit Nigam, Paul Nitza, Yossi Nivin, Pete Nixon, Lisa Noack,
Nandor Licker, Eivind Liland, Ícaro Lima, Kevin Lin, Yu-Sheng Lin, Charlie Mark Nodine, Kuba Ober, Andreas Olofsson, Baltazar Ortiz, Aleksander Osman,
Lind, Andrew Ling, Jiuyang Liu, Joey Liu, Paul Liu, Derek Lockhart, Jake Don Owen, James Pallister, Vassilis Papaefstathiou, Brad Parker, Morten
Longo, Geza Lore, Arthur Low, Jose Loyola, Stefan Ludwig, Dan Lussier, Borup Petersen, Dan Petrisko, Maciej Piechotka, David Pierce, Cody
Konstantin Lübeck, Fred Ma, Liwei Ma, Duraid Madina, Oleh Maksymenko, Affe Piersall, Michael Platzer, Dominic Plunkett, David Poole, Mike Popoloski,
Mao, Julien Margetts, Chick Markley, Alexis Marquet, Mark Marshall, Alfonso Roman Popov, Rich Porter, Stefan Post, Niranjan Prabhu, Damien Pretet, Usha
Martinez, Unai Martinez-Corral, Adrien Le Masle, Yves Mathieu, Vladimir Priyadharshini, Mark Jackson Pulver, Prateek Puri, Marshal Qiao, Nandu Raj,
Matveyenko, Patrick Maupin, Stan Mayer, Jordan McConnon, Conor McCullough, Kamil Rakoczy, Danilo Ramos, Drew Ranck, Chris Randall, Anton Rapp, Josh
Jason McMullan, Elliot Mednick, Yuan Mei, Andy Meier, Luiza de Melo, Redford, Odd Magne Reitan, Frederic Requin, Dustin Richmond, Samuel Riedel,
Rodrigo A. Melo, Benjamin Menküc, Jake Merdich, David Metz, Wim Michiels, Alberto Del Rio, Eric Rippey, Oleg Rodionov, Ludwig Rogiers, Paul Rolfe,
Miodrag Milanović, Darryl Miles, Kevin Millis, Andrew Miloradovsky, David Arjen Roodselaar, Tobias Rosenkranz, Ryszard Rozak, Huang Rui, Graham
Moberg, Wai Sum Mong, Peter Monsson, Anthony Moore, Sean Moore, Stuart Rushton, Jan Egil Ruud, Denis Rystsov, John Sanguinetti, Martin Schmidt,
Morris, Dennis Muhlestein, John Murphy, Matt Myers, Nathan Myers, Richard Julie Schwartz, Galen Seitz, Joseph Shaker, Salman Sheikh, Hao Shi, Mike
Myers, Alex Mykyta, Eric Müller, Dimitris Nalbantis, Peter Nelson, Felix Shinkarovsky, Rafael Shirakawa, Jeffrey Short, Fan Shupei, Anderson Ignacio
Neumärker, Bob Newgard, Cong Van Nguyen, Rachit Nigam, Toru Niina, Paul da Silva, Rodney Sinclair, Ameya Vikram Singh, Steven Slatter, Mladen
Nitza, Yossi Nivin, Pete Nixon, Lisa Noack, Mark Nodine, Michael Nolan, Slijepcevic, Brian Small, Garrett Smith, Tim Snyder, Wilson Snyder, Maciej
Andrew Nolte, Joseph Nwabueze, Kevin Nygaard, Kuba Ober, Krzysztof Sobkowski, Stan Sokorac, Alex Solomatnikov, Flavien Solt, Wei Song, Trefor
Obłonczek, Andreas Olofsson, Baltazar Ortiz, Aleksander Osman, Don Owen, Southwell, Martin Stadler, Art Stamness, David Stanford, John Stevenson,
Tim Paine, Deepa Palaniappan, James Pallister, Vassilis Papaefstathiou, Pete Stevenson, Patrick Stewart, Rob Stoddard, Todd Strader, John Stroebel,
Sanggyu Park, Brad Parker, Risto Pejašinović, Seth Pellegrino, Morten Borup Sven Stucki, Howard Su, Emerson Suguimoto, Gene Sullivan, Qingyao Sun,
Petersen, Dan Petrisko, Wesley Piard, Maciej Piechotka, David Pierce, Cody Renga Sundararajan, Gustav Svensk, Rupert Swarbrick, Yutetsu Takatsukasa,
Piersall, T. Platz, Michael Platzer, Dominic Plunkett, Nolan Poe, David Thierry Tambe, Drew Taussig, Jose Tejada, Peter Tengstrand, Wesley
Poole, Michael Popoloski, Roman Popov, Aylon Chaim Porat, Oron Port, Rich Terpstra, Rui Terra, Stefan Thiede, Gary Thomas, Ian Thompson, Kevin
Porter, Rick Porter, Stefan Post, Niranjan Prabhu, Damien Pretet, Harald Thompson, Mike Thyer, Hans Tichelaar, Viktor Tomov, Steve Tong, Topa
Pretl, Bill Pringlemeir, Usha Priyadharshini, Mark Jackson Pulver, Prateek Topino, Alex Torregrosa, Michael Tresidder, David Turner, Neil Turton, Mike
Puri, Han Qi, Jiacheng Qian, Marshal Qiao, Raynard Qiao, Yujia Qiao, Jasen Urbach, Hans Van Antwerpen, Sebastien Van Cauwenberghe, Laurens van Dam,
Qin, Frank Qiu, Nandu Raj, Kamil Rakoczy, Danilo Ramos, Drew Ranck, Chris Leendert van Doorn, Cong Van Nguyen, Jan Van Winkel, Srini Vemuri, Yuri
Randall, Anton Rapp, Josh Redford, Odd Magne Reitan, Frédéric Requin, Victorovich, Bogdan Vukobratovic, Holger Waechtler, Philipp Wagner, Stefan
Dustin Richmond, Samuel Riedel, Alberto Del Rio, Eric Rippey, Narcis Rodas, Wallentowitz, Shawn Wang, Zhanglei Wang, Paul Wasson, Greg Waters, Thomas
Oleg Rodionov, Ludwig Rogiers, Paul Rolfe, Michail Rontionov, Arjen Watts, Eugene Weber, David Welch, Thomas J Whatson, Martin Whitaker, Marco
Roodselaar, Arthur Rosa, Tobias Rosenkranz, Yernagula Roshit, Ryszard Widmer, Leon Wildman, Daniel Wilkerson, Gerald Williams, Trevor Williams,
Rozak, Huang Rui, Graham Rushton, Jan Egil Ruud, Denis Rystsov, Pawel Jeff Winston, Joshua Wise, Clifford Wolf, Tobias Wolfel, Johan Wouters,
Sagan, Robert Sammelson, Adrian Sampson, John Sanguinetti, Josep Sans, Luca Paul Wright, Junyi Xi, Ding Xiaoliang, Jie Xu, Mandy Xu, Yinan Xu, Luke
Sasselli, Martin Scharrer, Martin Schmidt, Jonathan Schröter, Julie Yang, Amir Yazdanbakhsh, Keyi Zhang, and Xi Zhang.
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
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
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.
Thanks to them, and all those we've missed mentioning above, and to those Thanks to them, and all those we've missed mentioning above, and to those
whom have wished to remain anonymous. whom have wished to remain anonymous.
+2 -2
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2025 by Wilson Snyder. .. Copyright 2003-2023 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
********* *********
@@ -8,7 +8,7 @@ Copyright
The latest version of Verilator is available from `https://verilator.org The latest version of Verilator is available from `https://verilator.org
<https://verilator.org>`_. <https://verilator.org>`_.
Copyright 2003-2025 by Wilson Snyder. This program is free software; you Copyright 2003-2023 by Wilson Snyder. This program is free software; you
can redistribute it and/or modify the Verilator internals under the terms 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 of either the GNU Lesser General Public License Version 3 or the Perl
Artistic License Version 2.0. Artistic License Version 2.0.
+28 -11
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2025 by Wilson Snyder. .. Copyright 2003-2023 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
Deprecations Deprecations
@@ -6,17 +6,34 @@ Deprecations
The following deprecated items are scheduled for future removal: The following deprecated items are scheduled for future removal:
C++14 compiler support C++11 compiler support
Verilator currently requires a C++20 or newer compiler for timing, and a Verilator currently requires a C++20 or newer compiler for timing, and a
C++14 or newer compiler for both compiling Verilator and compiling C++11 or newer compiler for no-timing.
Verilated models with --no-timing.
Verilator will require C++14 or newer compilers for both compiling
Verilator and compiling Verilated models with --no-timing no sooner than
January 2023.
Verilator will require C++20 or newer compilers for both compiling Verilator will require C++20 or newer compilers for both compiling
Verilator and compiling all Verilated models no sooner than May 2025. Verilator and compiling all Verilated models no sooner than January 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).
XML output 32-bit compiler support
Verilator currently supports XML parser output (enabled with `--xml-only`). Verilator currently regresses both 64-bit and 32-bit pointer modes (GCC's
Support for `--xml-*` options will be deprecated no sooner than January 2026. `-m64` and `-m32`). Support for 32-bit `-m32` mode will be deprecated no
sooner than January 2024.
Option `-O<letter>`
The debug `-O<letter>` options have been replaced with
`-fno-<optimization>` debug options to match GCC. The old options are
planned for removal no sooner than June 2023.
Option `--prof-threads`
The `--prof-threads` option has been superseded by the `--prof-exec` and
`--prof-pgo` options and is planned for removal no sooner than April 2023.
Verilated model options `+verilator+prof+threads+*`
The `+verilator+prof+threads+start`, `+verilator+prof+threads+window` and
`+verilator+prof+threads+file` options have been superseded by the
`+verilator+prof+exec+start`, `+verilator+prof+exec+window` and
`+verilator+prof+exec+file` options respectively and are planned for removal
no sooner than April 2023.
+2 -56
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2025 by Wilson Snyder. .. Copyright 2003-2023 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
Environment Environment
@@ -29,7 +29,7 @@ associated programs.
.. option:: OBJCACHE .. option:: OBJCACHE
Optionally specifies a caching or distribution program to place in front 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 of all runs of the C++ compiler. For example, "ccache". If using
:command:`distcc` or :command:`icecc`/:command:`icecream`, they would :command:`distcc` or :command:`icecc`/:command:`icecream`, they would
generally be run under :command:`ccache`; see the documentation for generally be run under :command:`ccache`; see the documentation for
those programs. If OBJCACHE is not set, and at configure time ccache those programs. If OBJCACHE is not set, and at configure time ccache
@@ -117,57 +117,3 @@ associated programs.
``VERILATOR_ROOT`` to point to the new version. ``VERILATOR_ROOT`` to point to the new version.
See :ref:`Installation` for more details. See :ref:`Installation` for more details.
.. 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.
.. 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".
Make Variables
==============
This section describes the make variables used by Verilator. These may be
set by passing them to make e.g. ``make CXX=my-gcc ...``.
.. option:: AR
Optionally overrides the default :command:`ar` (archive) binary used by
the Verilated makefiles. If AR is not set, the version found at
configure time is used.
.. option:: CXX
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
configuration time, so changing the CXX compiler version using this
variable, as opposed to passing it at configuration time, may not give
desired results.
.. option:: LINK
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
configuration time, so changing the LINK version using this variable, as
opposed to passing it at configuration time, may not give desired
results.
.. option:: PERL
Optionally overrides the default :command:`perl` binary used by the
Verilated makefiles. If PERL is not set, the version found at configure
time, and compiled into the Verilator binary, is used.
.. option:: PYTHON3
Optionally overrides the default :command:`python3` binary used by the
Verilated makefiles. If PYTHON3 is not set, the version found at
configure time is used.
+1 -1
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2025 by Wilson Snyder. .. Copyright 2003-2023 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
.. _Example Create-Binary Execution: .. _Example Create-Binary Execution:
+1 -1
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2025 by Wilson Snyder. .. Copyright 2003-2023 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
.. _Example C++ Execution: .. _Example C++ Execution:
+1 -1
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2025 by Wilson Snyder. .. Copyright 2003-2023 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 .. 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
+1 -1
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2025 by Wilson Snyder. .. Copyright 2003-2023 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
.. _Examples in the Distribution: .. _Examples in the Distribution:
+1 -2
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2025 by Wilson Snyder. .. Copyright 2003-2023 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
.. _Example SystemC Execution: .. _Example SystemC Execution:
@@ -28,7 +28,6 @@ Now, let's create an example Verilog, and SystemC wrapper file:
cat >sc_main.cpp <<'EOF' cat >sc_main.cpp <<'EOF'
#include "Vour.h" #include "Vour.h"
using namespace sc_core;
int sc_main(int argc, char** argv) { int sc_main(int argc, char** argv) {
Verilated::commandArgs(argc, argv); Verilated::commandArgs(argc, argv);
sc_clock clk{"clk", 10, SC_NS, 0.5, 3, SC_NS, true}; sc_clock clk{"clk", 10, SC_NS, 0.5, 3, SC_NS, true};
+1 -2
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2025 by Wilson Snyder. .. Copyright 2003-2023 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
.. _Examples: .. _Examples:
@@ -9,7 +9,6 @@ Examples
This section covers the following examples: This section covers the following examples:
* :ref:`Example Create-Binary Execution`
* :ref:`Example C++ Execution` * :ref:`Example C++ Execution`
* :ref:`Example SystemC Execution` * :ref:`Example SystemC Execution`
* :ref:`Examples in the Distribution` * :ref:`Examples in the Distribution`
+6 -23
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2025 by Wilson Snyder. .. Copyright 2003-2023 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
.. _Simulation Runtime Arguments: .. _Simulation Runtime Arguments:
@@ -19,20 +19,11 @@ Summary:
.. include:: ../_build/gen/args_verilated.rst .. include:: ../_build/gen/args_verilated.rst
.. option:: +verilator+coverage+file+<filename>
When a model was Verilated using :vlopt:`--coverage`, sets the filename
to write coverage data into. Defaults to :file:`coverage.dat`.
.. option:: +verilator+debug .. option:: +verilator+debug
Enable simulation runtime debugging. Equivalent to Enable simulation runtime debugging. Equivalent to
:vlopt:`+verilator+debugi+4 <+verilator+debugi+\<value\>>`. :vlopt:`+verilator+debugi+4 <+verilator+debugi+\<value\>>`.
To be useful, the model typically must first be compiled with debug
capabilities by Verilating with :vlopt:`--runtime-debug` or `-CFLAGS
-DVL_DEBUG=1`.
.. option:: +verilator+debugi+<value> .. option:: +verilator+debugi+<value>
Enable simulation runtime debugging at the provided level. Enable simulation runtime debugging at the provided level.
@@ -40,8 +31,8 @@ Summary:
.. option:: +verilator+error+limit+<value> .. option:: +verilator+error+limit+<value>
Set number of non-fatal errors (e.g. assertion failures) before exiting Set number of non-fatal errors (e.g. assertion failures) before exiting
simulation runtime. Also affects number of `$stop` calls needed before simulation runtime. Also affects number of $stop calls needed before
exit. Does not affect `$fatal`. Defaults to 1. exit. Defaults to 1.
.. option:: +verilator+help .. option:: +verilator+help
@@ -73,18 +64,15 @@ Summary:
.. option:: +verilator+prof+threads+file+<filename> .. option:: +verilator+prof+threads+file+<filename>
Removed in 5.020. Was an alias for Deprecated. Alias for :vlopt:`+verilator+prof+exec+file+\<filename\>`
:vlopt:`+verilator+prof+exec+file+\<filename\>`
.. option:: +verilator+prof+threads+start+<value> .. option:: +verilator+prof+threads+start+<value>
Removed in 5.020. Was an alias for Deprecated. Alias for :vlopt:`+verilator+prof+exec+start+\<value\>`
:vlopt:`+verilator+prof+exec+start+\<value\>`
.. option:: +verilator+prof+threads+window+<value> .. option:: +verilator+prof+threads+window+<value>
Removed in 5.020. Was an alias for Deprecated. Alias for :vlopt:`+verilator+prof+exec+window+\<value\>`
:vlopt:`+verilator+prof+exec+window+\<value\>`
.. option:: +verilator+prof+vlt+file+<filename> .. option:: +verilator+prof+vlt+file+<filename>
@@ -92,11 +80,6 @@ Summary:
profile-guided optimization data runtime filename to dump to. Defaults profile-guided optimization data runtime filename to dump to. Defaults
to :file:`profile.vlt`. to :file:`profile.vlt`.
.. option:: +verilator+quiet
Disable printing the simulation summary report, see :ref:`Simulation
Summary Report`.
.. option:: +verilator+rand+reset+<value> .. option:: +verilator+rand+reset+<value>
When a model was Verilated using When a model was Verilated using
+47 -294
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2025 by Wilson Snyder. .. Copyright 2003-2023 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
verilator Arguments verilator Arguments
@@ -51,8 +51,6 @@ Summary:
.. option:: +1800-2017ext+<ext> .. option:: +1800-2017ext+<ext>
.. option:: +1800-2023ext+<ext>
Specifies the language standard to be used with a specific filename Specifies the language standard to be used with a specific filename
extension, <ext>. extension, <ext>.
@@ -87,11 +85,7 @@ Summary:
.. option:: --assert .. option:: --assert
Enable all assertions. Implies :vlopt:`--assert-case`. Enable all assertions.
.. option:: --assert-case
Enable unique/unique0/priority case related checks.
.. option:: --autoflush .. option:: --autoflush
@@ -201,10 +195,9 @@ Summary:
.. option:: --compiler <compiler-name> .. option:: --compiler <compiler-name>
Enables workarounds for the specified C++ compiler (list below). This Enables workarounds for the specified C++ compiler (list below).
does not change any performance tuning options, but it may in the This does not change any performance tuning options, but it may
future. This also does not change default compiler flags; these are in the future.
determined when Verilator was configured.
clang clang
Tune for clang. This may reduce execution speed as it enables several Tune for clang. This may reduce execution speed as it enables several
@@ -222,13 +215,6 @@ Summary:
expressions into sub-expressions to avoid error C1009, and breaking expressions into sub-expressions to avoid error C1009, and breaking
deep blocks into functions to avoid error C1061. deep blocks into functions to avoid error C1061.
.. option:: --compiler-include <header-path>
Specifies additional headers to be included in the final PCH header.
It is required to add them to this header, due to compilers'
limitation that allow only one precompiled header per compilation.
Use this instead of ::vlopt:`-CFLAGS` with `-include <header-path>`.
.. option:: --converge-limit <loops> .. option:: --converge-limit <loops>
Rarely needed. Specifies the maximum number of runtime iterations Rarely needed. Specifies the maximum number of runtime iterations
@@ -318,47 +304,19 @@ Summary:
detailed messages. See :vlopt:`--debug` for other implications of detailed messages. See :vlopt:`--debug` for other implications of
enabling debug. enabling debug.
.. option:: --decorations none
.. option:: --decorations medium
.. option:: --decorations node
When creating output Verilated code, set level of comment and whitespace
decoration.
With "--decorations none",
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`
option.
With "--decorations medium",
The default, put a small amount of comments and white space, for
typical level of readability.
With "--decorations node",
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.
.. option:: --no-decoration .. option:: --no-decoration
Alias for ``--decorations none``. When creating output Verilated code, 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.
.. option:: --default-language <value> .. option:: --default-language <value>
Select the language used by default when first processing each Select the language used by default when first processing each
Verilog file. The language value must be "VAMS", "1364-1995", Verilog file. The language value must be "VAMS", "1364-1995",
"1364-2001", "1364-2001-noconfig", "1364-2005", "1800-2005", "1364-2001", "1364-2001-noconfig", "1364-2005", "1800-2005",
"1800-2009", "1800-2012", "1800-2017", "1800-2023", or "1800+VAMS". "1800-2009", "1800-2012", "1800-2017", or "1800+VAMS".
Any language associated with a particular file extension (see the Any language associated with a particular file extension (see the
various +<lang>*\ ext+ options) will be used in preference to the various +<lang>*\ ext+ options) will be used in preference to the
@@ -371,7 +329,7 @@ Summary:
``+<lang>ext+`` options should be used. ``+<lang>ext+`` options should be used.
If no language is specified, either by this option or ``+<lang>ext+`` If no language is specified, either by this option or ``+<lang>ext+``
options, then the latest SystemVerilog language (IEEE 1800-2023) is options, then the latest SystemVerilog language (IEEE 1800-2017) is
used. used.
.. option:: +define+<var>=<value> .. option:: +define+<var>=<value>
@@ -420,12 +378,6 @@ Summary:
:vlopt:`--debug --no-dump-tree <--dump-tree>` may be useful if the dump :vlopt:`--debug --no-dump-tree <--dump-tree>` may be useful if the dump
files are large and not desired. files are large and not desired.
.. 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.
.. option:: --dump-tree-dot .. option:: --dump-tree-dot
Rarely needed. Enable dumping Ast .tree.dot debug files in Graphviz Rarely needed. Enable dumping Ast .tree.dot debug files in Graphviz
@@ -461,11 +413,6 @@ Summary:
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. globally to the specified value.
.. option:: --dumpi-tree-json <level>
Rarely needed - for developer use. Set internal Ast JSON dumping level
globally to the specified value.
.. option:: --dumpi-<srcfile> <level> .. option:: --dumpi-<srcfile> <level>
Rarely needed - for developer use. Set the dumping level in the Rarely needed - for developer use. Set the dumping level in the
@@ -483,12 +430,6 @@ Summary:
See also :vlopt:`--dump-defines`, :vlopt:`-P`, and See also :vlopt:`--dump-defines`, :vlopt:`-P`, and
:vlopt:`--pp-comments` options. :vlopt:`--pp-comments` options.
.. option:: --emit-accessors
Emit getter and setter methods for each top-level signal in the
model top class. Signals are still available as public members,
but with the `__Vm_sig_` prefix.
.. option:: --error-limit <value> .. option:: --error-limit <value>
After this number of errors are encountered during Verilator run, exit. After this number of errors are encountered during Verilator run, exit.
@@ -589,18 +530,10 @@ Summary:
.. option:: -fno-expand .. option:: -fno-expand
.. option:: -fno-func-opt
.. option:: -fno-func-opt-balance-cat
.. option:: -fno-func-opt-split-cat
.. option:: -fno-gate .. option:: -fno-gate
.. option:: -fno-inline .. option:: -fno-inline
.. option:: -fno-inline-funcs
.. option:: -fno-life .. option:: -fno-life
.. option:: -fno-life-post .. option:: -fno-life-post
@@ -617,8 +550,6 @@ Summary:
.. option:: -fno-reorder .. option:: -fno-reorder
.. option:: -fno-slice
.. option:: -fno-split .. option:: -fno-split
.. option:: -fno-subst .. option:: -fno-subst
@@ -733,13 +664,6 @@ Summary:
:option:`/*verilator&32;hier_block*/` metacomment is ignored. See :option:`/*verilator&32;hier_block*/` metacomment is ignored. See
:ref:`Hierarchical Verilation`. :ref:`Hierarchical Verilation`.
.. option:: --hierarchical-params-file <filename>
Internal flag inserted used during :vlopt:`--hierarchical`; specifies
name of hierarchical parameters file for deparametrized modules with
:option:`/*verilator&32;hier_block*/` metacomment. See
:ref:`Hierarchical Verilation`.
.. option:: -I<dir> .. option:: -I<dir>
See :vlopt:`-y`. See :vlopt:`-y`.
@@ -847,11 +771,6 @@ Summary:
If the design is not to be completely Verilated, see also the If the design is not to be completely Verilated, see also the
:vlopt:`--bbox-sys` and :vlopt:`--bbox-unsup` options. :vlopt:`--bbox-sys` and :vlopt:`--bbox-unsup` options.
.. option:: --localize-max-size <value>
Rarely needed. Set the maximum variable size in bytes for it to be
subject to localizing-to-stack optimization. Defaults to 1024.
.. option:: --make <build-tool> .. option:: --make <build-tool>
Generates a script for the specified build tool. Generates a script for the specified build tool.
@@ -968,22 +887,6 @@ Summary:
delayed assignments. This option should only be used when suggested by delayed assignments. This option should only be used when suggested by
the developers. the developers.
.. option:: --output-groups <numfiles>
Enables concatenating the output .cpp files into the given number of
effective output .cpp files. This is useful if the compiler startup
overhead from compiling many small files becomes unacceptable,
which can happen in designs making extensive use of SystemVerilog classes,
templates or generate blocks.
Using :vlopt:`--output-groups` can adversely impact caching and stability
(as in reproducibility) of compiled code. Compilation of larger .cpp
files also has higher memory requirements. Too low values might result in
swap thrashing with large designs, high values give no benefits. The
value should range from 2 to 20 for small to medium designs.
Default is zero, which disables this feature.
.. option:: --output-split <statements> .. option:: --output-split <statements>
Enables splitting the output .cpp files into multiple outputs. When a Enables splitting the output .cpp files into multiple outputs. When a
@@ -1036,13 +939,6 @@ Summary:
:option:`/*verilator&32;sc_bv*/` metacomment to select specific ports to :option:`/*verilator&32;sc_bv*/` metacomment to select specific ports to
be sc_bv. be sc_bv.
.. option:: --pins-inout-enables
Specifies that the __en and __out outputs will always be created for
inouts in the top-level module. The __en variable has a one in a bit
position to indicate the corresponding bit of the __out variable has
a value being driven from within the Verilated model.
.. option:: --pins-sc-uint .. option:: --pins-sc-uint
Specifies SystemC inputs/outputs greater than 2 bits wide should use Specifies SystemC inputs/outputs greater than 2 bits wide should use
@@ -1050,10 +946,6 @@ Summary:
:vlopt:`--pins-sc-biguint` combination, it results in sc_uint being used :vlopt:`--pins-sc-biguint` combination, it results in sc_uint being used
between 2 and 64 and sc_biguint being used between 65 and 512. between 2 and 64 and sc_biguint being used between 65 and 512.
.. option:: --pins-sc-uint-bool
Specifies SystemC inputs/outputs one bit wide should use sc_uint<1>.
.. option:: --pins-sc-biguint .. option:: --pins-sc-biguint
Specifies SystemC inputs/outputs greater than 65 bits wide should use Specifies SystemC inputs/outputs greater than 65 bits wide should use
@@ -1144,7 +1036,7 @@ Summary:
.. option:: --prof-threads .. option:: --prof-threads
Removed in 5.020. Was an alias for --prof-exec and --prof-pgo together. Deprecated. Same as --prof-exec and --prof-pgo together.
.. option:: --protect-ids .. option:: --protect-ids
@@ -1236,20 +1128,11 @@ Summary:
Overwrites the given parameter(s) of the top-level module. See Overwrites the given parameter(s) of the top-level module. See
:vlopt:`-G <-G<name>>` for a detailed description. :vlopt:`-G <-G<name>>` for a detailed description.
.. option:: --quiet
Alias for :vlopt:`--quiet-exit` :vlopt:`--quiet-stats`.
.. option:: --quiet-exit .. option:: --quiet-exit
When exiting due to an error, do not display the "Exiting due to Errors" When exiting due to an error, do not display the "Exiting due to Errors"
nor "Command Failed" messages. nor "Command Failed" messages.
.. option:: --quiet-stats
Disable printing the Verilation statistics report, see :ref:`Verilation
Summary Report`.
.. option:: --relative-includes .. option:: --relative-includes
When a file references an include file, resolve the filename relative to When a file references an include file, resolve the filename relative to
@@ -1300,40 +1183,6 @@ Summary:
Run Verilator and record with the :command:`rr` command. See Run Verilator and record with the :command:`rr` command. See
`https://rr-project.org <https://rr-project.org>`_. `https://rr-project.org <https://rr-project.org>`_.
.. option:: --runtime-debug
Enable including debug assertions in the generated model. This may
significantly decrease model performance. This option will only work
with gcc/clang.
This option has the same effect as the following flags:
:vlopt:`--decorations node <--decorations>`
Instructs Verilator to add comments to the Verilated C++ code to
assist determining what Verilog code was responsible for each C++
statement.
``-CFLAGS -ggdb -LDFLAGS -ggdb``
Instructs the compiler and linker to enable debugger symbols.
``-CFLAGS -fsanitize=address,undefined -LDFLAGS -fsanitize=address,undefined``
Instructs the compiler and linker to enable the address sanitizer, and
undefined behavior sanitizer.
``-CFLAGS -D_GLIBCXX_DEBUG``
Instructs the compiler to enable C++ library (glibc) internal
assertions to find library-misuse issues.
``-CFLAGS -DVL_DEBUG=1``
Instructs the compiler to enable Verilator's runtime assertions and
debug capabilities. To enable debug print messages at runtime, see
:vlopt:`+verilator+debug`.
The :vlopt:`-CFLAGS` and/or :vlopt:`-LDFLAGS` options used here pass the
following argument into the generated Makefile for use as compiler or
linker options respectively. If you are using your own Makefiles, adapt
appropriately to pass the suggested flags to the compiler and linker.
.. option:: --savable .. option:: --savable
Enable including save and restore functions in the generated model. See Enable including save and restore functions in the generated model. See
@@ -1356,8 +1205,6 @@ Summary:
Creates a dump file with statistics on the design in Creates a dump file with statistics on the design in
:file:`<prefix>__stats.txt`. :file:`<prefix>__stats.txt`.
Also dumps DFG patterns to
:file:`<prefix>__stats_dfg_patterns__*.txt`.
.. option:: --stats-vars .. option:: --stats-vars
@@ -1367,21 +1214,7 @@ Summary:
.. option:: --no-std .. option:: --no-std
Prevents parsing standard input files, alias for Prevents parsing standard library.
:vlopt:`--no-std-package`, :vlopt:`--no-std-waiver`. This may be extended
to prevent reading other standardized files in future versions.
.. option:: --no-std-package
Prevents parsing standard `std::` package file.
.. option:: --no-std-waiver
Prevents parsing standard lint waivers (`verilated_std_waiver.vlt`).
.. option:: --no-stop-fail
Don't call $stop when assertion fails. Simulation will continue.
.. option:: --structs-packed .. option:: --structs-packed
@@ -1393,12 +1226,12 @@ Summary:
.. option:: -sv .. option:: -sv
Specifies SystemVerilog language features should be enabled; equivalent Specifies SystemVerilog language features should be enabled; equivalent
to :vlopt:`--language 1800-2023 <--language>`. This option is selected to :vlopt:`--language 1800-2017 <--language>`. This option is selected
by default; it exists for compatibility with other simulators. by default; it exists for compatibility with other simulators.
.. option:: +systemverilogext+<ext> .. option:: +systemverilogext+<ext>
A synonym for :vlopt:`+1800-2023ext+\<ext\>`. A synonym for :vlopt:`+1800-2017ext+\<ext\>`.
.. option:: --threads <threads> .. option:: --threads <threads>
@@ -1530,13 +1363,13 @@ Summary:
Enable FST waveform tracing in the model. This overrides Enable FST waveform tracing in the model. This overrides
:vlopt:`--trace`. See also :vlopt:`--trace-threads` option. :vlopt:`--trace`. See also :vlopt:`--trace-threads` option.
.. option:: --trace-max-array <depth> .. option:: --trace-max-array *depth*
Rarely needed. Specify the maximum array depth of a signal that may be Rarely needed. Specify the maximum array depth of a signal that may be
traced. Defaults to 32, as tracing large arrays may greatly slow traced traced. Defaults to 32, as tracing large arrays may greatly slow traced
simulations. simulations.
.. option:: --trace-max-width <width> .. option:: --trace-max-width *width*
Rarely needed. Specify the maximum bit width of a signal that may be Rarely needed. Specify the maximum bit width of a signal that may be
traced. Defaults to 256, as tracing large vectors may greatly slow traced. Defaults to 256, as tracing large vectors may greatly slow
@@ -1553,7 +1386,7 @@ Summary:
format constraints, this may result in significantly slower trace times format constraints, this may result in significantly slower trace times
and larger trace files. and larger trace files.
.. option:: --trace-threads <threads> .. option:: --trace-threads *threads*
Enable waveform tracing using separate threads. This is typically faster Enable waveform tracing using separate threads. This is typically faster
in simulation runtime but uses more total compute. This option only in simulation runtime but uses more total compute. This option only
@@ -1591,19 +1424,15 @@ Summary:
.. option:: --unroll-count <loops> .. option:: --unroll-count <loops>
Rarely needed. Specifies the maximum number of loop iterations that may Rarely needed. Specifies the maximum number of loop iterations that may be
be unrolled. See also :option:`BLKLOOPINIT` warning, and unrolled. See also :option:`BLKLOOPINIT` warning.
:option:`/*verilator&32;unroll_disable*/` and
:option:`/*verilator&32;unroll_full*/` metacomments.
.. option:: --unroll-stmts <statements> .. option:: --unroll-stmts *statements*
Rarely needed. Specifies the maximum number of statements in a loop for Rarely needed. Specifies the maximum number of statements in a loop for
that loop to be unrolled. See also :option:`BLKLOOPINIT` warning, and that loop to be unrolled. See also :option:`BLKLOOPINIT` warning.
:option:`/*verilator&32;unroll_disable*/` and
:option:`/*verilator&32;unroll_full*/` metacomments.
.. option:: --unused-regexp <regexp> .. option:: --unused-regexp *regexp*
Rarely needed. Specifies a simple regexp with \* and ? that, if a signal Rarely needed. Specifies a simple regexp with \* and ? that, if a signal
name matches, will suppress the :option:`UNUSED` warning. Defaults to name matches, will suppress the :option:`UNUSED` warning. Defaults to
@@ -1615,17 +1444,12 @@ Summary:
into Verilator. (Similar to :command:`perl -V`.) See also into Verilator. (Similar to :command:`perl -V`.) See also
:vlopt:`--getenv` option. :vlopt:`--getenv` option.
.. option:: -v <filename> .. option:: -v *filename*
Read the filename as a Verilog library. Any modules in the file may be Read the filename as a Verilog library. Any modules in the file may be
used to resolve instances in the top-level module, otherwise, they are used to resolve instances in the top-level module, otherwise, they are
ignored. Note "-v" is relatively standard across Verilog tools. ignored. Note "-v" is relatively standard across Verilog tools.
.. option:: --valgrind
Run Verilator under `Valgrind <https://valgrind.org/>`_. The command may be
changed with :option:`VERILATOR_VALGRIND`.
.. option:: --no-verilate .. option:: --no-verilate
When using :vlopt:`--build`, disable the generation of C++/SystemC code, and When using :vlopt:`--build`, disable the generation of C++/SystemC code, and
@@ -1657,16 +1481,7 @@ Summary:
Enable the use of VPI and linking against the :file:`verilated_vpi.cpp` files. Enable the use of VPI and linking against the :file:`verilated_vpi.cpp` files.
.. option:: --waiver-multiline .. option:: --waiver-output *filename*
When using :vlopt:`--waiver-output \<filename\> <--waiver-output>`,
include a match expression that includes the entire multiline error
message as a match regular expression, as opposed to the default of only
matching the first line of the error message. This provides a starting
point for creating complex waivers, but such generated waivers will
likely require editing for brevity before being reused.
.. option:: --waiver-output <filename>
Generate a waiver file that contains all waiver statements to suppress Generate a waiver file that contains all waiver statements to suppress
the warnings emitted during this Verilator run. This, in particular, is the warnings emitted during this Verilator run. This, in particular, is
@@ -1770,19 +1585,18 @@ Summary:
``-Wwarn-CASEX`` ``-Wwarn-CASTCONST`` ``-Wwarn-CMPCONST`` ``-Wwarn-CASEX`` ``-Wwarn-CASTCONST`` ``-Wwarn-CMPCONST``
``-Wwarn-COLONPLUS`` ``-Wwarn-IMPLICIT`` ``-Wwarn-IMPLICITSTATIC`` ``-Wwarn-COLONPLUS`` ``-Wwarn-IMPLICIT`` ``-Wwarn-IMPLICITSTATIC``
``-Wwarn-LATCH`` ``-Wwarn-MISINDENT`` ``-Wwarn-NEWERSTD`` ``-Wwarn-LATCH`` ``-Wwarn-MISINDENT`` ``-Wwarn-NEWERSTD``
``-Wwarn-PREPROCZERO`` ``-Wwarn-PINMISSING`` ``-Wwarn-REALCVT`` ``-Wwarn-PINMISSING`` ``-Wwarn-REALCVT`` ``-Wwarn-STATICVAR``
``-Wwarn-STATICVAR`` ``-Wwarn-UNSIGNED`` ``-Wwarn-WIDTHTRUNC`` ``-Wwarn-UNSIGNED`` ``-Wwarn-WIDTHTRUNC`` ``-Wwarn-WIDTHEXPAND``
``-Wwarn-WIDTHEXPAND`` ``-Wwarn-WIDTHXZEXPAND``. ``-Wwarn-WIDTHXZEXPAND``.
.. option:: -Wwarn-style .. option:: -Wwarn-style
Enable all code style-related warning messages. This is equivalent to Enable all code style-related warning messages. This is equivalent to
``-Wwarn-ASSIGNDLY`` ``-Wwarn-BLKSEQ`` ``-Wwarn-DECLFILENAME`` ``-Wwarn-ASSIGNDLY`` ``-Wwarn-DECLFILENAME`` ``-Wwarn-DEFPARAM``
``-Wwarn-DEFPARAM`` ``-Wwarn-EOFNEWLINE`` ``-Wwarn-GENUNNAMED`` ``-Wwarn-EOFNEWLINE`` ``-Wwarn-GENUNNAMED`` ``-Wwarn-INCABSPATH``
``-Wwarn-IMPORTSTAR`` ``-Wwarn-INCABSPATH`` ``-Wwarn-PINCONNECTEMPTY``
``-Wwarn-PINNOCONNECT`` ``-Wwarn-SYNCASYNCNET`` ``-Wwarn-UNDRIVEN`` ``-Wwarn-PINNOCONNECT`` ``-Wwarn-SYNCASYNCNET`` ``-Wwarn-UNDRIVEN``
``-Wwarn-UNUSEDGENVAR`` ``-Wwarn-UNUSEDLOOP`` ``-Wwarn-UNUSEDPARAM`` ``-Wwarn-UNUSEDGENVAR`` ``-Wwarn-UNUSEDPARAM`` ``-Wwarn-UNUSEDSIGNAL``
``-Wwarn-UNUSEDSIGNAL`` ``-Wwarn-VARHIDDEN``. ``-Wwarn-VARHIDDEN``.
.. option:: --x-assign 0 .. option:: --x-assign 0
@@ -1814,9 +1628,9 @@ Summary:
.. note:: .. note::
This option applies only to values explicitly written as X in modules This option applies only to values explicitly written as X
(not classes, nor parameters) in the Verilog source code. Initial in modules (not classes) in the Verilog source code. Initial values
values of clocks are set to 0 unless `--x-initial-edge` is of clocks are set to 0 unless `--x-initial-edge` is
specified. Initial values of all other state holding variables are specified. Initial values of all other state holding variables are
controlled with `--x-initial`. controlled with `--x-initial`.
@@ -1881,58 +1695,19 @@ Summary:
iterations. This may be another indication of problems with the iterations. This may be another indication of problems with the
modeled design that should be addressed. modeled design that should be addressed.
.. option:: --json-only
Create JSON output only, do not create any other output.
The JSON format is intended to be used to leverage Verilator's parser and
elaboration to feed to other downstream tools. For details on the format, see
the Verilator Internals manual. Be aware that the JSON
format is still evolving; there will be some changes in future versions.
This option disables some more aggressive transformations and dumps only
the final state of the AST. For more granular and unaltered dumps, meant
mainly for debugging see :vlopt:`--dump-tree-json`.
.. option:: --json-only-meta-output <filename>
Specifies the filename for the metadata output file (`.tree.meta.json`) of --json-only.
Using this option automatically sets :vlopt:`--json-only`.
.. option:: --json-only-output <filename>
Specifies the filename for the main output file (`.tree.json`) of --json-only.
Using this option automatically sets :vlopt:`--json-only`.
.. option:: --no-json-edit-nums
Don't dump edit number in .tree.json files. This may make the file more
run-to-run stable for easier comparison.
.. option:: --no-json-ids
Don't use short identifiers instead of addresses/paths in .tree.json.
.. option:: --xml-only .. option:: --xml-only
Create XML output only, do not create any other output. Create XML output only, do not create any other output.
The XML format is intended to be used to leverage Verilator's parser and The XML format is intended to be used to leverage Verilator's parser and
elaboration to feed to other downstream tools. elaboration to feed to other downstream tools. Be aware that the XML
format is still evolving; there will be some changes in future versions.
.. note::
This feature is deprecated in favor of :vlopt:`--json-only`.
.. option:: --xml-output <filename> .. option:: --xml-output <filename>
Specifies the filename for the XML output file. Using this option Specifies the filename for the XML output file. Using this option
automatically sets :vlopt:`--xml-only`. automatically sets :vlopt:`--xml-only`.
.. note::
This feature is deprecated in favor of :vlopt:`--json-only`.
.. option:: -y <dir> .. option:: -y <dir>
Add the directory to the list of directories that should be searched to find Add the directory to the list of directories that should be searched to find
@@ -1955,12 +1730,8 @@ Configuration Files
In addition to the command line, warnings and other features for the In addition to the command line, warnings and other features for the
:command:`verilator` command may be controlled with configuration files, :command:`verilator` command may be controlled with configuration files,
typically named with the `.vlt` extension (what makes it a configuration typically named with the .vlt extension (what makes it a configuration file
file is the :option:`\`verilator_config` directive). These files, when is the :option:`\`verilator_config` directive). An example:
named `.vlt`, are read before source code files; if this behavior is
undesired, name the config file with a `.v` suffix.
An example:
.. code-block:: sv .. code-block:: sv
@@ -2053,13 +1824,6 @@ The grammar of configuration commands is as follows:
that the setting is ignored unless the :vlopt:`--hierarchical` option is that the setting is ignored unless the :vlopt:`--hierarchical` option is
specified. See :ref:`Hierarchical Verilation`. specified. See :ref:`Hierarchical Verilation`.
.. option:: hier_params -module "<modulename>"
Specifies that the module contains parameters a :vlopt:`--hierarchical` block. This option
is used internally to specify parameters for deparametrized hier block instances.
This option should not be used directly.
See :ref:`Hierarchical Verilation`.
.. option:: inline -module "<modulename>" .. option:: inline -module "<modulename>"
Specifies the module may be inlined into any modules that use this Specifies the module may be inlined into any modules that use this
@@ -2097,7 +1861,7 @@ The grammar of configuration commands is as follows:
.. option:: lint_off [-rule <message>] [-file "<filename>" [-lines <line> [ - <line>]]] .. option:: lint_off [-rule <message>] [-file "<filename>" [-lines <line> [ - <line>]]]
.. option:: lint_off [-rule <message>] [-file "<filename>"] [-contents "<wildcard>"] [-match "<wildcard>"] .. option:: lint_off [-rule <message>] [-file "<filename>"] [-match "<string>"]
Enable/disables the specified lint warning, in the specified filename Enable/disables the specified lint warning, in the specified filename
(or wildcard with '\*' or '?', or all files if omitted) and range of (or wildcard with '\*' or '?', or all files if omitted) and range of
@@ -2106,28 +1870,17 @@ The grammar of configuration commands is as follows:
With lint_off using "\*" will override any lint_on directives in the With lint_off using "\*" will override any lint_on directives in the
source, i.e. the warning will still not be printed. source, i.e. the warning will still not be printed.
If the :code:`-rule` is omitted, all lint warnings (see list in If the -rule is omitted, all lint warnings (see list in
:vlopt:`-Wno-lint`) are enabled/disabled. This will override all later :vlopt:`-Wno-lint`) are enabled/disabled. This will override all later
lint warning enables for the specified region. lint warning enables for the specified region.
If :code:`-contents` is provided, the input files must contain the given If -match is set, the linter warnings are matched against this
wildcard (with '\*' or '?'), and are waived in case they match, provided (wildcard) string and are waived in case they match, provided with the
the :code:`-rule`, :code:`-file`, and :code:`-contents` also match. The rule and file also match.
wildcard should be designed to match a single line; it is unspecified if
the wildcard is allowed to match across multiple lines. The input
contents does not include :vlopt:`--std <--no-std>` standard files, nor
configuration files (with :code:`verilator_config`). Typical use for
this is to match a version number present in the Verilog sources, so
that the waiver will only apply to that version of the sources.
If :code:`-match` is provided, the linter warnings are matched against In previous versions -rule was named -msg. The latter is deprecated, but
the given wildcard (with '\*' or '?'), and are waived in case they still works with a deprecation info; it may be removed in future
match, provided the :code:`-rule`, :code:`-file`, and :code:`-contents` versions.
also match. The wildcard is compared across the entire multi-line
message; see :vlopt:`--waiver-multiline`.
Before version 4.026, :code:`-rule` was named :code:`-msg`, and
:code:`-msg` remained a deprecated alias until Version 5.000.
.. option:: public [-module "<modulename>"] [-task/-function "<taskname>"] -var "<signame>" .. option:: public [-module "<modulename>"] [-task/-function "<taskname>"] -var "<signame>"
+26 -56
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2025 by Wilson Snyder. .. Copyright 2003-2023 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
verilator_coverage verilator_coverage
@@ -35,11 +35,11 @@ verilator_coverage Example Usage
verilator_coverage --help verilator_coverage --help
verilator_coverage --version verilator_coverage --version
verilator_coverage --annotate obj_dir coverage.dat verilator_coverage --annotate <obj>
verilator_coverage --write merged.dat coverage.dat ... verilator_coverage -write merged.dat -read <datafiles>...
verilator_coverage --write-info merged.info coverage.dat ... verilator_coverage -write-info merged.info -read <datafiles>...
verilator_coverage Arguments verilator_coverage Arguments
@@ -58,69 +58,36 @@ to read multiple inputs. If no data file is specified, by default,
Specifies the directory name to which source files with annotated coverage Specifies the directory name to which source files with annotated coverage
data should be written. data should be written.
Points are children of each line coverage- branches or toggle points. Converting from the Verilator coverage data format to the info format is
When point counts are aggregated into a line, the minimum and maximum counts lossy; the info will have all forms of coverage merged line coverage, and
are used to determine the status of the line (complete, partial, failing) if there are multiple coverage points on a single line they will merge.
The count is equal to the maximum of the points. The minimum coverage across all merged points will be used to report
coverage of the line.
Coverage data is annotated at the beginning of the line and is formatted The first character of the line shows a summary of the coverage; this
as a special character followed by the number of coverage hits. The special allows use of grep to filter the report. `%` indicates at least one point
characters " ,%,~,+,-" indicate summary of the coverage, and allow use of grep on the line was below the coverage limit. `+` indicates an
to filter the report. :option:`--annotate-points` point was at or above the limit, and `-` that
the point was below the limit.
* " " (whitespace) indicates that all points on the line are above the coverage min.
* "%" indicates that all points on the line are below the coverage min.
* "~" indicates that some points on the line are above the coverage min and some are below.
* "+" coverage point was at or above the min. Only used with :option:`--annotate-points`.
* "-" coverage point was below the min. Only used with :option:`--annotate-points`.
.. code-block::
100000 input logic a; // Begins with whitespace, because
// number of hits (100000) is above the min.
+100000 point: comment=a // Begins with +, because
// number of hits (100000) is above the min.
%000000 input logic b; // Begins with %, because
// number of hits (0) is below the min.
-000000 point: comment=b // Begins with -, because
// number of hits (0) is below the min.
~000010 if (cyc!=0) begin // Begins with ~, because
// branches are below and above the min.
+000010 point: comment=if // The if branch is above the min.
-000000 point: comment=else // The else branch is below the min.
.. option:: --annotate-all .. option:: --annotate-all
Specifies all files should be shown. By default, only those source files Specifies all files should be shown. By default, only those source files
with low coverage are written to the output directory. with low coverage are written to the output directory.
This option should be used together with :option:`--annotate`.
.. option:: --annotate-min <count> .. option:: --annotate-min <count>
Specifies the threshold (<count>) below which coverage point is considered Specifies if the coverage point does not include the count number of
sufficient. If the threshold is not exceeded, then the annotation will begin coverage hits, then the coverage point will be considered above the
with a "%" symbol to indicate the coverage is insufficient. threshold, and the coverage report will put a "%" to indicate the coverage
is insufficient. Defaults to 10.
The <count> threshold defaults to 10.
This option should be used together with :option:`--annotate`.
.. option:: --annotate-points .. option:: --annotate-points
Specifies all coverage points should be shown after each line of text. By Specifies all coverage points should be shown after each line of text. By
default, only source lines are shown. default, only source lines are shown.
.. code-block:: with low coverage are written to the output directory.
100000 input logic a, b, c;
+100000 point: comment=a // These lines are only shown
+200000 point: comment=b // with option --annotate-points
+300000 point: comment=c // enabled.
This option should be used together with :option:`--annotate`.
.. option:: --help .. option:: --help
@@ -158,7 +125,10 @@ generated from random test runs) into one master coverage file.
Specifies the aggregate coverage results, summed across all the files, Specifies the aggregate coverage results, summed across all the files,
should be written to the given filename in :command:`lcov` .info format. should be written to the given filename in :command:`lcov` .info format.
This may be used to feed into :command:`lcov` to aggregate or generate This may be used to feed into :command:`lcov` to aggregate or generate
reports. This format lacks the comments for cover points that the reports.
verilator_coverage format has. It can be used with :command:`genhtml`
to generate an HTML report. :command:`genhtml --branch-coverage` will Converting from the Verilator coverage data format to the info format is
also display the branch coverage, analogous to :option:`--annotate-points` lossy; the info will have all forms of coverage merged line coverage, and
if there are multiple coverage points on a single line they will merge.
The minimum coverage across all merged points will be used to report
coverage of the line.
+9 -18
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2025 by Wilson Snyder. .. Copyright 2003-2023 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
verilator_gantt verilator_gantt
@@ -30,13 +30,15 @@ Gantt Chart VCD Signals
In waveforms, there are the following signals. In GTKWave, use "decimal" In waveforms, there are the following signals. In GTKWave, use "decimal"
data format to remove the leading zeros and make the traces easier to read. data format to remove the leading zeros and make the traces easier to read.
trace/section evals
Shows the name of the current top of the execution section stack. Increments each time when eval_step was measured to be active. This
Set GTKWave data format to "ASCII". allow visualization of how much time eval_step was active.
trace/depth eval_loop
Shows the depth of the execution section stack. Increments each time when the evaluation loop within eval_step was
Set GTKWave data format to "Analog". measured to be active. For best performance, there is only a single
evaluation loop within each eval_step call; that is, the eval_loop
waveform looks identical to the evals waveform.
measured_parallelism measured_parallelism
The number of mtasks active at this time, for best performance, this will The number of mtasks active at this time, for best performance, this will
@@ -62,17 +64,6 @@ predicted_thread#_mtask
executing. executing.
verilator_gantt Example Usage
-----------------------------
..
verilator_gantt --help
verilator_gantt --version
verilator_gantt profile_exec.dat
verilator_gantt Arguments verilator_gantt Arguments
------------------------- -------------------------
+1 -12
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2025 by Wilson Snyder. .. Copyright 2003-2023 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
verilator_profcfunc verilator_profcfunc
@@ -15,17 +15,6 @@ reported as a rounding error.
For an overview of the use of verilator_profcfunc, see :ref:`Profiling`. For an overview of the use of verilator_profcfunc, see :ref:`Profiling`.
verilator_profcfunc Example Usage
---------------------------------
..
verilator_profcfunc --help
verilator_profcfunc --version
verilator_profcfunc gprof.out
verilator_profcfunc Arguments verilator_profcfunc Arguments
----------------------------- -----------------------------
+1 -1
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2025 by Wilson Snyder. .. Copyright 2003-2023 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
********************************* *********************************
+8 -36
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2025 by Wilson Snyder. .. Copyright 2003-2023 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
******************* *******************
@@ -17,26 +17,19 @@ or "`ifdef`"'s may break other tools.
.. option:: `__LINE__ .. option:: `__LINE__
The :option:`\`__LINE__` define expands to the current line number like The :option:`\`__LINE__` define expands to the current filename as a
C++'s __LINE__. This Verilator feature added in 2006 was incorporated string, like C++'s __LINE__. This Verilator feature added in 2006 was
into IEEE 1800-2009. incorporated into IEEE 1800-2009.
.. option:: `error [string] .. option:: `error [string]
This will report an error when the preprocessor emits it, similar to This will report an error when encountered, like C++'s #error.
C++'s #error.
.. option:: `line
As a special case `\`line \`__LINE__ "filename"` allows setting the
filename, without changing the line number. This is used for some
internal tests, so that debugging can leave the line numbers correctly
referring to the test file's line numbers.
.. option:: """ [string] """ .. option:: """ [string] """
A triple-quoted block specifies a string that may include newlines and A triple-quoted block specifies a string that may include newlines and
single quotes. This extension was standardized in IEEE 1800-2023. single quotes. This extension is experimental and may be removed
without deprecation.
.. option:: $c([string], ...); .. option:: $c([string], ...);
@@ -576,10 +569,6 @@ or "`ifdef`"'s may break other tools.
.. option:: /*verilator&32;trace_init_task*/ .. option:: /*verilator&32;trace_init_task*/
Removed.
In versions before 5.024:
Attached to a DPI import to indicate that function should be called when Attached to a DPI import to indicate that function should be called when
initializing tracing. This attribute is indented only to be used initializing tracing. This attribute is indented only to be used
internally in code that Verilator generates when :vlopt:`--lib-create` internally in code that Verilator generates when :vlopt:`--lib-create`
@@ -597,23 +586,6 @@ or "`ifdef`"'s may break other tools.
Re-enable waveform tracing for all future signals or instances that are Re-enable waveform tracing for all future signals or instances that are
declared. declared.
.. option:: /*verilator&32;unroll_disable*/
Used in a statement position to indicate the immediately following loop
at the same statement level should not be unrolled by Verilator,
ignoring :vlopt:`--unroll-count`. This is similar to clang's ``#pragma
clang loop unroll(disable)``.
This option does not currently disable the C++ compiler's unrolling (or
not) of any loops that make it through to the Verilated C++ code.
.. option:: /*verilator&32;unroll_full*/
Rarely needed. Used in a statement position to indicate the immediately
following loop at the same statement level should always be fully
unrolled by Verilator, ignoring :vlopt:`--unroll-count`. This is
similar to clang's ``#pragma clang loop unroll(full)``.
.. option:: $stacktrace .. option:: $stacktrace
Called as a task, print a stack trace. Called as a function, return a Called as a task, print a stack trace. Called as a function, return a
@@ -622,4 +594,4 @@ or "`ifdef`"'s may break other tools.
symbols. Also, the data represents the C++ stack; the SystemVerilog symbols. Also, the data represents the C++ stack; the SystemVerilog
functions/tasks involved may be renamed and/or inlined before becoming functions/tasks involved may be renamed and/or inlined before becoming
the C++ functions that may be visible in the stack trace. This the C++ functions that may be visible in the stack trace. This
extension was standardized in IEEE 1800-2023. extension is experimental and may be removed without deprecation.
+21 -22
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2025 by Wilson Snyder. .. Copyright 2003-2023 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
****************************** ******************************
@@ -128,13 +128,10 @@ How do I generate waveforms (traces) in C++?
See also the next question for tracing in SystemC mode. See also the next question for tracing in SystemC mode.
A. Pass the :vlopt:`--trace` option to Verilator. Then you may use ``$dumpfile`` and A. Pass the :vlopt:`--trace` option to Verilator, and in your top-level C
``$dumpvars`` to enable traces, the same as with any Verilog simulator, code, call ``Verilated::traceEverOn(true)``. Then you may use
although Verilator ignores the arguments to ``$dumpvars``. See ``$dumpfile`` and ``$dumpvars`` to enable traces, the same as with any
``examples/make_tracing_c`` in the distribution. Verilog simulator. See ``examples/make_tracing_c`` in the distribution.
If writing the top-level C code, call ``Verilated::traceEverOn(true)``;
this is done for you if using :vlopt:`--binary`.
B. Or, for finer-grained control, or C++ files with multiple Verilated B. Or, for finer-grained control, or C++ files with multiple Verilated
modules, you may also create the trace purely from C++. Create a modules, you may also create the trace purely from C++. Create a
@@ -223,20 +220,24 @@ This is done for you if you are using the Verilator :vlopt:`--binary` or
You can call :code:`->trace()` on multiple Verilated objects with the same You can call :code:`->trace()` on multiple Verilated objects with the same
trace file if you want all data to land in the same output file. trace file if you want all data to land in the same output file.
When using SystemC 2.3, the SystemC library must have been built with the
experimental simulation phase callback-based tracing disabled. This is
disabled by default when building SystemC with its configure based build
system, but when building SystemC with CMake, you must pass
``-DENABLE_PHASE_CALLBACKS_TRACING=OFF`` to disable this feature.
How do I generate FST waveforms (traces) in C++ or SystemC? How do I generate FST waveforms (traces) in C++ or SystemC?
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""
FST is a trace file format developed by GTKWave. Verilator provides basic FST is a trace file format developed by GTKWave. Verilator provides basic
FST support. To dump traces in FST format, add the :vlopt:`--trace-fst` FST support. To dump traces in FST format, add the :vlopt:`--trace-fst`
option to Verilator and either: option to Verilator and either A. use :code:`$dumpfile & $dumpvars` in
Verilog as described in the VCD example above,
Use :code:`$dumpfile & $dumpvars` in Verilog as described in the VCD
example above,
Or, in C++ change the include described in the VCD example above: Or, in C++ change the include described in the VCD example above:
.. code-block:: C++ .. code-block:: C++
#include "verilated_fst_c.h" #include "verilated_fst_c.h"
VerilatedFstC* tfp = new VerilatedFstC; VerilatedFstC* tfp = new VerilatedFstC;
@@ -244,14 +245,14 @@ Or, in C++ change the include described in the VCD example above:
Or, in SystemC, change the include described in the VCD example above: Or, in SystemC, change the include described in the VCD example above:
.. code-block:: C++ .. code-block:: C++
#include "verilated_fst_sc.h" #include "verilated_fst_sc.h"
VerilatedFstC* tfp = new VerilatedFstSc; VerilatedFstC* tfp = new VerilatedFstSc;
Currently, supporting FST and VCD in a single simulation is not supported, Currently, supporting FST and VCD in a single simulation is impossible, but
but such usage should be unlikely. You can however ifdef around the trace such requirement should be rare. You can however ifdef around the trace
format in your C++ main loop, and select VCD or FST at compile time. format in your C++ main loop, and select VCD or FST at compile time.
@@ -259,11 +260,9 @@ How do I view waveforms (aka dumps or traces)?
"""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""""""""""
Verilator creates standard VCD (Value Change Dump) and FST files. VCD Verilator creates standard VCD (Value Change Dump) and FST files. VCD
files are viewable with the open-source files are viewable with the open-source GTKWave (recommended), or Dinotrace
`GTKWave <http://gtkwave.sourceforge.net/>`_, (legacy) programs, or any of the many closed-source offerings; FST is
`Surfer <https://surfer-project.org/>`_, Dinotrace (legacy), or any of the supported only by GTKWave.
many closed-source viewer offerings; FST is supported only by GTKWave and
Surfer.
How do I speed up writing large waveform (trace) files? How do I speed up writing large waveform (trace) files?
@@ -402,7 +401,7 @@ How do I get faster build times?
* Use a recent compiler. Newer compilers tend to be faster. * Use a recent compiler. Newer compilers tend to be faster.
* Compile in parallel on many machines and use caching; see the web for the * Compile in parallel on many machines and use caching; see the web for the
ccache, sccache, distcc, or icecream packages. ccache will skip GCC runs between ccache, distcc, and icecream packages. ccache will skip GCC runs between
identical source builds, even across different users. If ccache was identical source builds, even across different users. If ccache was
installed when Verilator was built, it is used, or see OBJCACHE installed when Verilator was built, it is used, or see OBJCACHE
environment variable to override this. Also see the environment variable to override this. Also see the
+11 -21
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2025 by Wilson Snyder. .. Copyright 2003-2023 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
***** *****
@@ -48,6 +48,12 @@ For --cc/--sc, it creates:
- Make include file for compiling (from --make gmake) - Make include file for compiling (from --make gmake)
* - *{prefix}*\ _classes.mk * - *{prefix}*\ _classes.mk
- Make include file with class names (from --make gmake) - Make include file with class names (from --make gmake)
* - *{prefix}*\ _hier.mk
- Make file for hierarchy blocks (from --make gmake)
* - *{prefix}*\ _hierMkArgs.f
- Arguments for hierarchical Verilation (from --make gmake)
* - *{prefix}*\ _hierCMakeArgs.f
- Arguments for hierarchical Verilation (from --make cmake)
* - *{prefix}*\ .h * - *{prefix}*\ .h
- Model header - Model header
* - *{prefix}*\ .cpp * - *{prefix}*\ .cpp
@@ -89,24 +95,16 @@ For --cc/--sc, it creates:
* - *{prefix}{each_verilog_module}{__DepSet_hash__n}*\ .cpp * - *{prefix}{each_verilog_module}{__DepSet_hash__n}*\ .cpp
- Additional lower C++ files (hashed to reduce build times) - Additional lower C++ files (hashed to reduce build times)
For --hierarchical mode, it creates: For --hierarchy mode, it creates:
.. list-table:: .. list-table::
* - V\ *{hier_block}*\ / * - V\ *{hier_block}*\ /
- Directory to Verilate each hierarchical block (from --hierarchical) - Directory to Verilate each hierarchy block (from --hierarchy)
* - *{prefix}*\ __hierVer.d * - *{prefix}*\ __hierVer.d
- Make dependencies of the top module (from --hierarchical) - Make dependencies of the top module (from --hierarchy)
* - *{prefix}*\ _hier.mk
- Make file for hierarchical blocks (from --make gmake)
* - *{prefix}*\ __hierCMakeArgs.f
- Arguments for hierarchical Verilation (from --make cmake)
* - *{prefix}*\ __hierMkArgs.f
- Arguments for hierarchical Verilation (from --make gmake)
* - *{prefix}*\ __hierParameters.v
- Module parameters for hierarchical blocks
* - *{prefix}*\ __hier.dir * - *{prefix}*\ __hier.dir
- Directory to store .dot, .vpp, .tree of top module (from --hierarchical) - Directory to store .dot, .vpp, .tree of top module (from --hierarchy)
In specific debug and other modes, it also creates: In specific debug and other modes, it also creates:
@@ -114,10 +112,6 @@ In specific debug and other modes, it also creates:
* - *{prefix}*\ .xml * - *{prefix}*\ .xml
- XML tree information (from --xml) - XML tree information (from --xml)
* - *{prefix}*\ .tree.json
- JSON tree information (from --json-only)
* - *{prefix}*\ .tree.meta.json
- JSON tree metadata (from --json-only)
* - *{prefix}*\ __cdc.txt * - *{prefix}*\ __cdc.txt
- Clock Domain Crossing checks (from --cdc) - Clock Domain Crossing checks (from --cdc)
* - *{prefix}*\ __stats.txt * - *{prefix}*\ __stats.txt
@@ -151,10 +145,6 @@ After running Make, the C++ compiler may produce the following:
- Intermediate objects - Intermediate objects
* - *{prefix}*\ * - *{prefix}*\
- Final executable (from --exe) - Final executable (from --exe)
* - lib\ *{prefix}*\ .a
- Final archive (default lib mode)
* - libverilated.a
- Runtime for verilated model (default lib mode)
* - *{prefix}*\ __ALL.a * - *{prefix}*\ __ALL.a
- Library of all Verilated objects - Library of all Verilated objects
* - *{prefix}*\ __ALL.cpp * - *{prefix}*\ __ALL.cpp
+1 -1
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2025 by Wilson Snyder. .. Copyright 2003-2023 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
###################### ######################
+1 -1
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2025 by Wilson Snyder. .. Copyright 2003-2023 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
.. _CMakeInstallation: .. _CMakeInstallation:
+24 -56
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2025 by Wilson Snyder. .. Copyright 2003-2023 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
.. _Installation: .. _Installation:
@@ -19,33 +19,13 @@ started. (Note packages are unlikely to have the most recent version, so
:ref:`Git Install` might be a better alternative.) To install as a :ref:`Git Install` might be a better alternative.) To install as a
package: package:
.. code-block:: shell ::
apt-get install verilator # On Ubuntu apt-get install verilator # On Ubuntu
For other distributions, refer to `Repology Verilator Distro Packages For other distributions, refer to `Repology Verilator Distro Packages
<https://repology.org/project/verilator>`__. <https://repology.org/project/verilator>`__.
.. _pre-commit Quick Install:
pre-commit Quick Install
=============================
You can use Verilator's `pre-commit <https://pre-commit.com/>`__ hook to
lint your code before committing it. It encapsulates the :ref:`Verilator
Build Docker Container`, so you need docker on your system to use it. The
verilator image will be downloaded automatically.
To use the hook, add the following entry to your :code:`.pre-commit-config.yaml`:
.. code-block:: yaml
repos:
- repo: https://github.com/verilator/verilator
rev: v5.026 # or later
hooks:
- id: verilator
.. _Git Install: .. _Git Install:
Git Quick Install Git Quick Install
@@ -56,7 +36,7 @@ options and details, see :ref:`Detailed Build Instructions` below.
In brief, to install from git: In brief, to install from git:
.. code-block:: shell ::
# Prerequisites: # Prerequisites:
#sudo apt-get install git help2man perl python3 make autoconf g++ flex bison ccache #sudo apt-get install git help2man perl python3 make autoconf g++ flex bison ccache
@@ -109,7 +89,7 @@ Install Prerequisites
To build or run Verilator, you need these standard packages: To build or run Verilator, you need these standard packages:
.. code-block:: shell ::
sudo apt-get install git help2man perl python3 make sudo apt-get install git help2man perl python3 make
sudo apt-get install g++ # Alternatively, clang sudo apt-get install g++ # Alternatively, clang
@@ -121,7 +101,7 @@ To build or run Verilator, you need these standard packages:
To build or run Verilator, the following are optional but should be installed To build or run Verilator, the following are optional but should be installed
for good performance: for good performance:
.. code-block:: shell ::
sudo apt-get install ccache # If present at build, needed for run sudo apt-get install ccache # If present at build, needed for run
sudo apt-get install mold # If present at build, needed for run sudo apt-get install mold # If present at build, needed for run
@@ -130,26 +110,26 @@ for good performance:
The following is optional but is recommended for nicely rendered command line The following is optional but is recommended for nicely rendered command line
help when running Verilator: help when running Verilator:
.. code-block:: shell ::
sudo apt-get install perl-doc sudo apt-get install perl-doc
To build Verilator you will need to install these packages; these do not To build Verilator you will need to install these packages; these do not
need to be present to run Verilator: need to be present to run Verilator:
.. code-block:: shell ::
sudo apt-get install git autoconf flex bison sudo apt-get install git autoconf flex bison
Those developing Verilator itself may also want these (see internals.rst): Those developing Verilator itself may also want these (see internals.rst):
.. code-block:: shell ::
sudo apt-get install clang clang-format-14 cmake gdb gprof graphviz lcov sudo apt-get install clang clang-format-14 cmake gdb gprof graphviz lcov
sudo apt-get install python3-clang yapf3 bear jq sudo apt-get install libclang-dev yapf3 bear
sudo pip3 install sphinx sphinx_rtd_theme sphinxcontrib-spelling breathe ruff sudo pip3 install clang sphinx sphinx_rtd_theme sphinxcontrib-spelling breathe ruff
sudo pip3 install git+https://github.com/antmicro/astsee.git
cpan install Pod::Perldoc cpan install Pod::Perldoc
cpan install Parallel::Forker
Install SystemC Install SystemC
@@ -171,17 +151,6 @@ To make use of Verilator FST tracing you will want `GTKwave
required at Verilator build time. required at Verilator build time.
Install Z3
^^^^^^^^^^
In order to use constrained randomization the `Z3 Theorem Prover
<https://github.com/z3prover/z3#readme>`__ must be installed, however this is
not required at Verilator build time. There are other compatible SMT solvers,
like CVC5/CVC4, but they are not guaranteed to work. Since different solvers are
faster for different scenarios, the solver to use at run-time can be specified
by the environment variable :option:`VERILATOR_SOLVER`.
.. _Obtain Sources: .. _Obtain Sources:
Obtain Sources Obtain Sources
@@ -190,14 +159,14 @@ Obtain Sources
Get the sources from the git repository: (You need to do this only once, Get the sources from the git repository: (You need to do this only once,
ever.) ever.)
.. code-block:: shell ::
git clone https://github.com/verilator/verilator # Only first time git clone https://github.com/verilator/verilator # Only first time
## Note the URL above is not a page you can see with a browser; it's for git only ## Note the URL above is not a page you can see with a browser; it's for git only
Enter the checkout and determine what version/branch to use: Enter the checkout and determine what version/branch to use:
.. code-block:: shell ::
cd verilator cd verilator
git pull # Make sure we're up-to-date git pull # Make sure we're up-to-date
@@ -212,7 +181,7 @@ Auto Configure
Create the configuration script: Create the configuration script:
.. code-block:: shell ::
autoconf # Create ./configure script autoconf # Create ./configure script
@@ -223,9 +192,8 @@ Eventual Installation Options
Before configuring the build, you must decide how you're going to Before configuring the build, you must decide how you're going to
eventually install Verilator onto your system. Verilator will be compiling eventually install Verilator onto your system. Verilator will be compiling
the current value of the environment variables :option:`VERILATOR_ROOT`, the current value of the environment variables :option:`VERILATOR_ROOT`,
:option:`VERILATOR_SOLVER`, :option:`SYSTEMC_INCLUDE`, and :option:`SYSTEMC_INCLUDE`, and :option:`SYSTEMC_LIBDIR` as defaults into
:option:`SYSTEMC_LIBDIR` as defaults into the executable, so they must be the executable, so they must be correct before configuring.
correct before configuring.
These are the installation options: These are the installation options:
@@ -238,7 +206,7 @@ directory (don't run ``make install``). This allows the easiest
experimentation and upgrading, and allows many versions of Verilator to experimentation and upgrading, and allows many versions of Verilator to
co-exist on a system. co-exist on a system.
.. code-block:: shell ::
export VERILATOR_ROOT=`pwd` # if your shell is bash export VERILATOR_ROOT=`pwd` # if your shell is bash
setenv VERILATOR_ROOT `pwd` # if your shell is csh setenv VERILATOR_ROOT `pwd` # if your shell is csh
@@ -260,7 +228,7 @@ that may support multiple versions of every tool. Tell configure the
eventual destination directory name. We recommend that the destination eventual destination directory name. We recommend that the destination
location include the Verilator version name: location include the Verilator version name:
.. code-block:: shell ::
unset VERILATOR_ROOT # if your shell is bash unset VERILATOR_ROOT # if your shell is bash
unsetenv VERILATOR_ROOT # if your shell is csh unsetenv VERILATOR_ROOT # if your shell is csh
@@ -272,7 +240,7 @@ the ``bin`` directory to your ``PATH``. Or, if you use `modulecmd
<http://modules.sourceforge.net/>`__, you'll want a module file like the <http://modules.sourceforge.net/>`__, you'll want a module file like the
following: following:
.. code-block:: shell ::
set install_root /CAD_DISK/verilator/{version-number-used-above} set install_root /CAD_DISK/verilator/{version-number-used-above}
unsetenv VERILATOR_ROOT unsetenv VERILATOR_ROOT
@@ -287,7 +255,7 @@ following:
The final option is to eventually install Verilator globally, using The final option is to eventually install Verilator globally, using
configure's default system paths: configure's default system paths:
.. code-block:: shell ::
unset VERILATOR_ROOT # if your shell is bash unset VERILATOR_ROOT # if your shell is bash
unsetenv VERILATOR_ROOT # if your shell is csh unsetenv VERILATOR_ROOT # if your shell is csh
@@ -304,7 +272,7 @@ The command to configure the package was described in the previous step.
Developers should configure to have more complete developer tests. Developers should configure to have more complete developer tests.
Additional packages may be required for these tests. Additional packages may be required for these tests.
.. code-block:: shell ::
export VERILATOR_AUTHOR_SITE=1 # Put in your .bashrc export VERILATOR_AUTHOR_SITE=1 # Put in your .bashrc
./configure --enable-longtests ...above options... ./configure --enable-longtests ...above options...
@@ -315,7 +283,7 @@ Compile
Compile Verilator: Compile Verilator:
.. code-block:: shell ::
make -j `nproc` # Or if error on `nproc`, the number of CPUs in system make -j `nproc` # Or if error on `nproc`, the number of CPUs in system
@@ -325,7 +293,7 @@ Test
Check the compilation by running self-tests: Check the compilation by running self-tests:
.. code-block:: shell ::
make test make test
@@ -337,7 +305,7 @@ If you used any install option other than the `1. Run-in-Place from
VERILATOR_ROOT <#_1_run_in_place_from_verilator_root>`__ scheme, install VERILATOR_ROOT <#_1_run_in_place_from_verilator_root>`__ scheme, install
the files: the files:
.. code-block:: shell ::
make install make install
+39 -31
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2025 by Wilson Snyder. .. Copyright 2003-2023 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
*************** ***************
@@ -62,23 +62,12 @@ Verilator supports the 2017 "for" loop constructs and several cleanups IEEE
made in 1800-2017. made in 1800-2017.
SystemVerilog 2023 (IEEE 1800-2023) Support
-------------------------------------------
Verilator supports some of the 2023 improvements, including triple-quoted
string blocks that may include newlines and single quotes.
Verilator implements a full IEEE 1800-2023 compliant preprocessor,
including triple-quoted strings, and \`ifdef expressions.
Verilog AMS Support Verilog AMS Support
------------------- -------------------
Verilator implements a very small subset of Verilog AMS (Verilog Analog and Verilator implements a very small subset of Verilog AMS (Verilog Analog and
Mixed-Signal Extensions) with the subset corresponding to those VMS Mixed-Signal Extensions) with the subset corresponding to those VMS
keywords with near-equivalents in Verilog IEEE 1364 or SystemVerilog keywords with near-equivalents in Verilog 2005 or SystemVerilog 2017.
IEEE 1800.
AMS parsing is enabled with :vlopt:`--language VAMS <--language>` or AMS parsing is enabled with :vlopt:`--language VAMS <--language>` or
:vlopt:`--language 1800+VAMS <--language>`. :vlopt:`--language 1800+VAMS <--language>`.
@@ -248,9 +237,11 @@ optimizations will be disabled around the latch.
Structures and Unions Structures and Unions
--------------------- ---------------------
All structures and unions are scheduled together, which means that Presently Verilator only supports packed structs and packed unions. Rand
generating one member of a structure from blocking, and another from and randc tags on members are ignored. All structures and unions are
non-blocking assignments is unsupported. represented as a single vector, which means that generating one member of a
structure from blocking, and another from non-blocking assignments is
unsupported.
.. _Unknown States: .. _Unknown States:
@@ -329,6 +320,20 @@ there will be considered a two-state variable that is read and written
instead of a four-state variable. instead of a four-state variable.
Functions & Tasks
-----------------
All functions and tasks will be inlined (will not become functions in C.)
The only support provided is simple statements in tasks (which may
affect global variables).
Recursive functions and tasks are not supported. All inputs and outputs
are automatic as if they had the Verilog 2001 "automatic" keyword
prepended. (If you don't know what this means, Verilator will do what you
probably expect, what C does. The default behavior of Verilog is
different.)
Gate Primitives Gate Primitives
--------------- ---------------
@@ -378,6 +383,24 @@ Verilator does not support SEREs yet. All assertion and coverage
statements must be simple expressions that complete in one cycle. statements must be simple expressions that complete in one cycle.
Force statement
---------------
Verilator supports the procedural `force` (and corresponding `release`)
statement. However, the behavior of the `force` statement does not entirely
comply with IEEE 1800. According to the standard,
when a procedural statement of the form `force a = b;` is executed, the
simulation should behave as if, from that point forwards, a continuous
assignment `assign a = b;` has been added to override the drivers of `a`.
More specifically: the value of `a` should be updated whenever the value of
`b` changes, until a `release a;` statement is executed.
Verilator instead evaluates the current value of `b` when the `force`
statement is executed, and forces `a` to that value, without updating it
until a new `force` or `release` statement is encountered that applies to
`a`. This non-standard behavior is nevertheless consistent with some other
simulators.
Encrypted Verilog Encrypted Verilog
----------------- -----------------
@@ -448,21 +471,6 @@ disable
provide loop break and continue functionality before SystemVerilog added provide loop break and continue functionality before SystemVerilog added
the break and continue keywords. the break and continue keywords.
force, release
Verilator supports the procedural `force` (and corresponding `release`)
statement. However, the behavior of the `force` statement does not
entirely comply with IEEE 1800. According to the standard, when a
procedural statement of the form `force a = b;` is executed, the
simulation should behave as if, from that point forwards, a continuous
assignment `assign a = b;` has been added to override the drivers of `a`.
More specifically: the value of `a` should be updated whenever the value
of `b` changes, until a `release a;` statement is executed. Verilator
instead evaluates the current value of `b` when the `force` statement is
executed, and forces `a` to that value, without updating it until a new
`force` or `release` statement is encountered that applies to `a`. This
non-standard behavior is nevertheless consistent with some other
simulators.
inside inside
Inside expressions may not include unpacked array traversal or $ as an Inside expressions may not include unpacked array traversal or $ as an
upper bound. Case inside and case matches are also unsupported. upper bound. Case inside and case matches are also unsupported.
+6 -6
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2025 by Wilson Snyder. .. Copyright 2003-2023 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
******** ********
@@ -23,12 +23,12 @@ resulting model's C++ or SystemC code is output as .cpp and .h files. This
is referred to as "Verilating", and the process is "to Verilate"; the is referred to as "Verilating", and the process is "to Verilate"; the
output is a "Verilated" model. output is a "Verilated" model.
2. For simulation, a small user-written C++ wrapper file is required, the 2. For simulation, a small-user written C++ wrapper file is required, the
"wrapper". This wrapper defines the C++ standard function "main()", which "wrapper". This wrapper defines the C++ standard function "main()", which
instantiates the Verilated model as a C++/SystemC object. instantiates the Verilated model as a C++/SystemC object.
3. The user C++ wrapper, the files created by Verilator, a "runtime 3. The user C++ wrapper, the files created by Verilator, a "runtime
library" provided by Verilator, and, if applicable, SystemC libraries are library" provided by Verilator, and, if applicable SystemC libraries are
then compiled using a C++ compiler to create a simulation executable. then compiled using a C++ compiler to create a simulation executable.
4. The resulting executable will perform the actual simulation during 4. The resulting executable will perform the actual simulation during
@@ -50,6 +50,6 @@ The best place to get started is to try the :ref:`Examples`.
.. [#] SystemVerilog is defined by the `Institute of Electrical and .. [#] SystemVerilog is defined by the `Institute of Electrical and
Electronics Engineers (IEEE) Standard for SystemVerilog - Unified Electronics Engineers (IEEE) Standard for SystemVerilog - Unified
Hardware Design, Specification, and Verification Language`, Standard Hardware Design, Specification, and Verification Language`, Standard
1800, released in 2005, 2009, 2012, 2017, and 2023. The Verilator 1800, released in 2005, 2009, 2012, and 2017. The Verilator
documentation uses the shorthand e.g., "IEEE 1800-2023", to refer to documentation uses the shorthand e.g., "IEEE 1800-2017", to refer to
the, e.g., 2023 version of this standard. the, e.g., 2017 version of this standard.
+29 -120
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2025 by Wilson Snyder. .. Copyright 2003-2023 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
.. _Simulating: .. _Simulating:
@@ -12,62 +12,6 @@ Verilated model's executable. For the runtime arguments to a simulated
model, see :ref:`Simulation Runtime Arguments`. model, see :ref:`Simulation Runtime Arguments`.
.. _Simulation Summary Report:
Simulation Summary Report
=========================
When simulation finishes, it will print a report to stdout summarizing the
simulation. This requires the model being Verilated with :vlopt:`--main`,
or the user's `main()` calling `VerilatedContext->statsPrintSummary()`.
The report may be disabled with :vlopt:`+verilator+quiet`.
For example:
.. code-block::
- S i m u l a t i o n R e p o r t: Verilator ...
- Verilator: End at simtime 123 ns; walltime 1234.001 s; speed 123 ns/s
- Verilator: cpu 22.001 s on 4 threads; alloced 123 MB
The information in this report is:
.. describe:: "Verilator ..."
Program version.
.. describe:: "End at simtime 123 ns"
Verilog $time at which the model finished or stopped.
.. describe:: "walltime 1234.001 s"
Real elapsed wall time in seconds.
.. describe:: "speed 123.1 ns/s"
Simulated time (if non-zero) divided by wall time. e.g. `123 ns/s` means
123 simulated nanoseconds took 1 second of wall time; for a model with
only a 1 GHz clock that would be equivalent to 123.1 cycles per
second. The units are automatically selected to give a number between 1
and 1000. The wall time includes initialization, initial and final
process blocks, so indicates a slower speed than if the model had a
longer runtime.
.. describe:: "cpu 22 s"
CPU time used total across all CPU threads in seconds.
.. describe:: "4 threads"
Number of simultaneous threads used.
.. describe:: "alloced 123 MB"
Total memory used during simulation in megabytes.
.. _Benchmarking & Optimization: .. _Benchmarking & Optimization:
Benchmarking & Optimization Benchmarking & Optimization
@@ -224,6 +168,14 @@ at branches). At each such branch, a counter is incremented. At the end
of a test, the counters, filename, and line number corresponding to each of a test, the counters, filename, and line number corresponding to each
counter are written into the coverage file. counter are written into the coverage file.
Verilator automatically disables coverage of branches with a $stop in
them, as it is assumed that $stop branches contain an error check that should
not occur. A :option:`/*verilator&32;coverage_block_off*/` metacomment
will perform a similar function on any code in that block or below, or
:option:`/*verilator&32;coverage_off*/` and
:option:`/*verilator&32;coverage_on*/` will disable and enable coverage
respectively around a block of code.
Verilator may over-count combinatorial (non-clocked) blocks when those Verilator may over-count combinatorial (non-clocked) blocks when those
blocks receive signals which have had the :option:`UNOPTFLAT` warning blocks receive signals which have had the :option:`UNOPTFLAT` warning
disabled; for the most accurate results, do not disable this warning when disabled; for the most accurate results, do not disable this warning when
@@ -270,22 +222,6 @@ A :option:`/*verilator&32;coverage_off*/`
signals that do not need toggle analysis, such as RAMs and register files. signals that do not need toggle analysis, such as RAMs and register files.
.. _Suppressing Coverage:
Suppressing Coverage
--------------------
Using :option:`/*verilator&32;coverage_off*/` and
:option:`/*verilator&32;coverage_on*/` around a block of code will disable
and enable coverage respectively around that block. Or, use the
:option:`coverage_block_off` configuration file option.
Verilator automatically disables coverage of lines and branches with a
$stop in them, as it is assumed that $stop branches contain an error check
that should not occur. A :option:`/*verilator&32;coverage_block_off*/`
metacomment will perform a similar function on any code in that block or
below.
.. _Coverage Collection: .. _Coverage Collection:
Coverage Collection Coverage Collection
@@ -294,20 +230,14 @@ Coverage Collection
When any coverage flag is used to Verilate, Verilator will add appropriate When any coverage flag is used to Verilate, Verilator will add appropriate
coverage point insertions into the model and collect the coverage data. coverage point insertions into the model and collect the coverage data.
To get the coverage data from the model, write the coverage with either: To get the coverage data from the model, in the user wrapper code,
typically at the end once a test passes, call
1. Using :vlopt:`--binary` or :vlopt:`--main`, and Verilator will dump :code:`Verilated::threadContextp()->coveragep()->write` with an argument of the filename for
coverage when the test completes to the filename specified with the coverage data file to write coverage data to (typically
:vlopt:`+verilator+coverage+file+\<filename\>`. "logs/coverage.dat").
2. In the user wrapper code, typically at the end once a test passes, call
:code:`Verilated::threadContextp()->coveragep()->write` with an argument
of the filename for the coverage data file to write coverage data to
(typically "logs/coverage.dat").
Run each of your tests in different directories, potentially in parallel. Run each of your tests in different directories, potentially in parallel.
Each test will create the file specified above, Each test will create a :file:`logs/coverage.dat` file.
e.g. :file:`logs/coverage.dat`.
After running all of the tests, execute the :command:`verilator_coverage` After running all of the tests, execute the :command:`verilator_coverage`
command, passing arguments pointing to the filenames of all the command, passing arguments pointing to the filenames of all the
@@ -343,17 +273,13 @@ profiled C++ code functions.
To use profiling: To use profiling:
#. Make sure the Verilog code will call `$finish` at the end of simulation #. Use Verilator's :vlopt:`--prof-cfuncs`.
(otherwise the C library may not correctly create the `gmon.out` file in
the later steps below).
#. Run Verilator, adding the :vlopt:`--prof-cfuncs` option.
#. Build and run the simulation model. #. Build and run the simulation model.
#. The model will create `gmon.out`. #. The model will create gmon.out.
#. Run :command:`gprof gmon.out > gprof.log` to see where in the C++ code #. Run :command:`gprof` to see where in the C++ code the time is spent.
the time is spent. #. Run the gprof output through the :command:`verilator_profcfunc` program,
#. Run :command:`verilator_profcfunc gprof.log > profcfunc.log` to take the and it will tell you what Verilog line numbers on which most of the time
gprof output and translate into output showing the Verilog line numbers is being spent.
on which most of the time is being spent.
.. _Execution Profiling: .. _Execution Profiling:
@@ -579,30 +505,13 @@ documentation.
Runtime Debugging Runtime Debugging
================= =================
To debug a Verilated executable, Verilate with :vlopt:`--runtime-debug`. To debug a Verilated executable, use the standard GNU debugger ``gdb`` or a
This will instruct the compiler to insert debugger, and enable various similar tool. Typically you will want to have debugger symbols inserted by
library assertions. These options slow down the executable, so do this the compiler, assertions enabled in the C library, and assertions enabled
only when debugging. in the Verilated library. (These options slow down the executable, so do
this only when debugging.) To enable this, Verilate with:
If you are using your own Makefiles, adapt appropriately to pass the -CFLAGS -ggdb -LDFLAGS -ggdb -CFLAGS -DVL_DEBUG=1 -CFLAGS -D_GLIBCXX_DEBUG
options documented under :vlopt:`--runtime-debug` to the compiler and
linker.
Once you have a debugging-enabled executable, run it using the the standard The :vlopt:`-CFLAGS` and/or :vlopt:`-LDFLAGS` options pass arguments
GNU debugger ``gdb`` or a similar tool, and create a backtrace; e.g.: directly to the compiler or linker.
.. code-block:: bash
gdb obj_dir/Vtop
run {Vtop_command_arguments}
{Vtop prints output, perhaps a segmentation faults}
bt
Rarely the bug may disappear with :vlopt:`--runtime-debug`; if so, try
instead using the sub-options that :vlopt:`--runtime-debug` documents, to
find the maximum subset that still shows the issue. E.g. it is likely that
using `-CFLAGS -D_GLIBCXX_DEBUG` will not hide any bug, so may be used.
Using :vlopt:`--runtime-debug` or `-CFLAGS -DVL_DEBUG=1` will only print a
message if something goes wrong. To enable debug print messages at
runtime, additionally use the :vlopt:`+verilator+debug` runtime option.
+15 -101
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2025 by Wilson Snyder. .. Copyright 2003-2023 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
********** **********
@@ -7,13 +7,9 @@ Verilating
Verilator may be used in five major ways: Verilator may be used in five major ways:
* With the :vlopt:`--binary` option, Verilator will translate the design
into an executable, via generating C++ and compiling it. See
:ref:`Binary, C++ and SystemC Generation`.
* With the :vlopt:`--cc` or :vlopt:`--sc` options, Verilator will translate * With the :vlopt:`--cc` or :vlopt:`--sc` options, Verilator will translate
the design into C++ or SystemC code, respectively. See :ref:`Binary, C++ the design into C++ or SystemC code, respectively. See :ref:`C++ and
and SystemC Generation`. SystemC Generation`.
* With the :vlopt:`--lint-only` option, Verilator will lint the design to * With the :vlopt:`--lint-only` option, Verilator will lint the design to
check for warnings but will not typically create any output files. check for warnings but will not typically create any output files.
@@ -28,15 +24,13 @@ Verilator may be used in five major ways:
expanded. expanded.
.. _Binary, C++ and SystemC Generation: .. _C++ and SystemC Generation:
Binary, C++ and SystemC Generation C++ and SystemC Generation
================================== ==========================
Verilator will translate a SystemVerilog design into C++ with the Verilator will translate a SystemVerilog design into C++ with the
:vlopt:`--cc` option, or into SystemC with the :vlopt:`--sc` option. It :vlopt:`--cc` option, or into SystemC with the :vlopt:`--sc` option.
will translate into C++ and compile it into an executable binary with the
:vlopt:`--binary` option.
When using these options: When using these options:
@@ -51,19 +45,14 @@ When using these options:
The prefix is set with :vlopt:`--prefix`, or defaults to the name of the The prefix is set with :vlopt:`--prefix`, or defaults to the name of the
top module. top module.
#. If :vlopt:`--binary` or :vlopt:`--main` is used, Verilator creates a C++ #. If :vlopt:`--exe` is used, Verilator creates makefiles to generate a
top wrapper to read command line arguments, create the model, and simulation executable, otherwise, it creates makefiles to generate an
execute the model. archive (.a) containing the objects.
#. If :vlopt:`--binary` or :vlopt:`--exe` is used, Verilator creates #. If :vlopt:`--build` option was used, it calls :ref:`GNU Make` or
makefiles to generate a simulation executable, otherwise, it creates :ref:`CMake` to build the model.
makefiles to generate an archive (.a) containing the objects.
#. If :vlopt:`--binary` or :vlopt:`--build` is used, it calls :ref:`GNU Once a model is built, it is then typically run, see :ref:`Simulating`.
Make` or :ref:`CMake` to build the model.
Once a model is built, the next step is typically for the user to run it,
see :ref:`Simulating`.
.. _Hierarchical Verilation: .. _Hierarchical Verilation:
@@ -304,9 +293,9 @@ GNU Make
======== ========
Verilator defaults to creating GNU Make makefiles for the model. Verilator Verilator defaults to creating GNU Make makefiles for the model. Verilator
will call make automatically when the :vlopt:`--build` option is used. will call make automatically when the :vlopt:'--build' option is used.
If calling Verilator from a makefile, the :vlopt:`--MMD` option will create If calling Verilator from a makefile, the :vlopt:'-MMD' option will create
a dependency file, allowing Make to only run Verilator if input Verilog a dependency file, allowing Make to only run Verilator if input Verilog
files change. files change.
@@ -498,78 +487,3 @@ The search paths can be configured by setting some variables:
Sets the installation prefix of an installed SystemC library. (Same as Sets the installation prefix of an installed SystemC library. (Same as
SYSTEMC_ROOT). SYSTEMC_ROOT).
.. _Verilation Summary Report:
Verilation Summary Report
=========================
When Verilator generates code, unless :vlopt:`--quiet-stats` is used, it
will print a report to stdout summarizing the build. For example:
.. code-block::
- V e r i l a t i o n R e p o r t: Verilator ....
- Verilator: Built from 354 MB sources in 247 modules,
into 74 MB in 89 C++ files needing 0.192 MB
- Verilator: Walltime 26.580 s (elab=2.096, cvt=18.268,
bld=2.100); cpu 26.548 s on 1 threads; alloced 2894.672 MB
The information in this report is:
.. describe:: "Verilator ..."
Program version.
.. describe:: "234 MB sources"
Characters of post-preprocessed text in all input
Verilog and Verilator Control files in megabytes.
.. describe:: "247 modules"
Number of interfaces/modules/classes/packages in design before
elaboration.
.. describe:: "into 74 MB"
Characters of output C++ code, including comments in megabytes.
.. describe:: "89 C++ files"
Number of .cpp files created.
.. describe:: "needing 192MB"
Verilation-time minimum-bound estimate of memory needed to run model in
megabytes. (Expect to need significantly more.)
.. describe:: "Walltime 26.580 s"
Real elapsed wall time for Verilation and build.
.. describe:: "elab=2.096"
Wall time to read in files and complete elaboration.
.. describe:: "cvt=18.268"
Wall time for Verilator to process and write output.
.. describe:: "bld=2.1"
Wall time to compile gcc/clang (if using :vlopt:`--build`).
.. describe:: "cpu 22.548 s"
CPU time used, total across all CPU threads.
.. describe:: "4 threads"
Number of simultaneous threads used.
.. describe:: "alloced 123 MB"
Total memory used during build by Verilator executable (excludes
:vlopt:`--build` compiler's usage) in megabytes.
+53 -225
View File
@@ -1,4 +1,4 @@
.. Copyright 2003-2025 by Wilson Snyder. .. Copyright 2003-2023 by Wilson Snyder.
.. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 .. SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
******************* *******************
@@ -12,18 +12,10 @@ Disabling Warnings
Warnings may be disabled in multiple ways: Warnings may be disabled in multiple ways:
#. Disable the warning globally by invoking Verilator with the #. Disable the warning in the source code. When the warning is printed, it
:code:`-Wno-{warning-code}` option. will include a warning code. Surround the offending line with a
:code:`/*verilator&32;lint_off*/` and :code:`/*verilator&32;lint_on*/`
Global disables should be avoided, as they removes all checking across metacomment pair:
the source files, and prevents other users from compiling the sources
without knowing the magic set of disables needed to compile those
sources successfully.
#. Disable the warning in the design source code. When the warning is
printed, it will include a warning code. Surround the offending line
with a :code:`/*verilator&32;lint_off*/` and
:code:`/*verilator&32;lint_on*/` metacomment pair:
.. code-block:: sv .. code-block:: sv
@@ -31,12 +23,6 @@ Warnings may be disabled in multiple ways:
if (`DEF_THAT_IS_EQ_ZERO <= 3) $stop; if (`DEF_THAT_IS_EQ_ZERO <= 3) $stop;
// verilator lint_on UNSIGNED // verilator lint_on UNSIGNED
A lint_off in the design source code will propagate down to any child
files (files later included by the file with the lint_off), but will not
propagate upwards to any parent file (file that included the file with
the lint_off).
#. Disable the warning using :ref:`Configuration Files` with a #. Disable the warning using :ref:`Configuration Files` with a
:option:`lint_off` command. This is useful when a script suppresses :option:`lint_off` command. This is useful when a script suppresses
warnings, and the Verilog source should not be changed. This method also warnings, and the Verilog source should not be changed. This method also
@@ -46,6 +32,12 @@ Warnings may be disabled in multiple ways:
lint_off -rule UNSIGNED -file "*/example.v" -line 1 lint_off -rule UNSIGNED -file "*/example.v" -line 1
#. Disable the warning globally invoking Verilator with the
:code:`-Wno-{warning-code}` option. This should be avoided, as it
removes all checking across the designs, and prevents other users from
compiling your code without knowing the magic set of disables needed to
compile your design successfully.
Error And Warning Format Error And Warning Format
======================== ========================
@@ -161,8 +153,8 @@ List Of Warnings
.. option:: BADSTDPRAGMA .. option:: BADSTDPRAGMA
An error that a pragma is badly formed, for pragmas defined by IEEE An error that a pragma is badly formed, for pragmas defined by IEEE
1800-2023. For example, an empty pragma line, or an incorrectly used 1800-2017. For example, an empty pragma line, or an incorrectly used
'pragma protect'. Third-party pragmas not defined by IEEE 1800-2023 are 'pragma protect'. Third-party pragmas not defined by IEEE 1800-2017 are
ignored. ignored.
@@ -210,35 +202,22 @@ List Of Warnings
.. option:: BLKLOOPINIT .. option:: BLKLOOPINIT
Indicates certain constructs where non-blocking assignments to unpacked .. TODO better example
arrays (memories) are not supported inside loops. These typically appear in
initialization/reset code: This indicates that the initialization of an array needs to use
non-delayed assignments. This is done in the interest of speed; if
delayed assignments were used, the simulator would have to copy large
arrays every cycle. (In smaller loops, loop unrolling allows the
delayed assignment to work, though it's a bit slower than a non-delayed
assignment.) Here's an example
.. code-block:: sv .. code-block:: sv
always @(posedge clk) always @(posedge clk)
if (~reset_l) if (~reset_l)
for (i=0; i<`ARRAY_SIZE; i++) for (i=0; i<`ARRAY_SIZE; i++)
array[i] <= 0; // Non-blocking assignment inside loop array[i] = 0; // Non-delayed for verilator
else
array[address] <= data;
While this is supported in typical synthesizeable code (including the
example above), some complicated cases are not supported. Namely:
1. If the above loop is inside a suspendable process or fork statement.
2. If the variable is also the target of a '<=' non-blocking assignment
in a suspendable process or fork statement (in addition to a synthesizable
loop).
3. If the element type of the array is a compound type.
4. In versions before 5.026, any delayed assignment to an array.
It might slightly improve run-time performance if you change the
non-blocking assignment inside the loop into a blocking assignment
(that is: use '=' instead of '<='), if possible.
This message is only seen on large or complicated loops because This message is only seen on large or complicated loops because
Verilator generally unrolls small loops. You may want to try increasing Verilator generally unrolls small loops. You may want to try increasing
@@ -296,7 +275,7 @@ List Of Warnings
Unique case statements that select on an enumerated variable, where all Unique case statements that select on an enumerated variable, where all
of the enumerated values are covered by case items, are considered of the enumerated values are covered by case items, are considered
complete even if the case statement does not cover illegal complete even if the case statement does not cover illegal
non-enumerated values (IEEE 1800-2023 12.5.3). To check that illegal non-enumerated values (IEEE 1800-2017 12.5.3). To check that illegal
values are not hit, use :vlopt:`--assert`. values are not hit, use :vlopt:`--assert`.
Ignoring this warning will only suppress the lint check; it will Ignoring this warning will only suppress the lint check; it will
@@ -419,9 +398,9 @@ List Of Warnings
.. option:: CONSTRAINTIGN .. option:: CONSTRAINTIGN
Warns that Verilator does not support certain forms of Warns that Verilator does not support :code:`constraint`,
:code:`constraint`, :code:`constraint_mode`, or :code:`rand_mode`, and :code:`constraint_mode`, or :code:`rand_mode`, and the construct was are
the construct was are ignored. ignored.
Ignoring this warning may make Verilator randomize() simulations differ Ignoring this warning may make Verilator randomize() simulations differ
from other simulators. from other simulators.
@@ -492,7 +471,7 @@ List Of Warnings
.. code-block:: .. code-block::
%Warning-DEFPARAM: example.v:5:15: defparam is deprecated (IEEE 1800-2023 C.4.1) %Warning-DEFPARAM: example.v:5:15: defparam is deprecated (IEEE 1800-2017 C.4.1)
: ... Suggest use instantiation with #(.MY_PARAM(...etc...)) : ... Suggest use instantiation with #(.MY_PARAM(...etc...))
To repair use :code:`#(.PARAMETER(...))` syntax. Repaired Example: To repair use :code:`#(.PARAMETER(...))` syntax. Repaired Example:
@@ -720,7 +699,7 @@ List Of Warnings
.. code-block:: .. code-block::
%Warning-GENUNNAMED: example.v:2:9: Unnamed generate block (IEEE 1800-2023 27.6) %Warning-GENUNNAMED: example.v:2:9: Unnamed generate block (IEEE 1800-2017 27.6)
To fix this assign a label (often with the naming convention prefix of To fix this assign a label (often with the naming convention prefix of
:code:`gen_` or :code:`g_`), for example: :code:`gen_` or :code:`g_`), for example:
@@ -776,7 +755,7 @@ List Of Warnings
.. code-block:: .. code-block::
%Warning-IGNOREDRETURN: example.v:5:9: Ignoring return value of non-void function (IEEE 1800-2023 13.4.1) %Warning-IGNOREDRETURN: example.v:5:9: Ignoring return value of non-void function (IEEE 1800-2017 13.4.1)
The portable way to suppress this warning (in SystemVerilog) is to use a The portable way to suppress this warning (in SystemVerilog) is to use a
void cast, for example: void cast, for example:
@@ -1187,7 +1166,7 @@ List Of Warnings
Warns that a feature requires a newer standard of Verilog or SystemVerilog Warns that a feature requires a newer standard of Verilog or SystemVerilog
than the one specified by the :vlopt:`--language` option. For example, unsized than the one specified by the :vlopt:`--language` option. For example, unsized
unbased literals (`'0`, `'1`, `'z`, `'x`) require IEEE 1800-2005 or later. unbased literals (`'0`, `'1`, `'z`, `'x`) require 1800-2005 or later.
To avoid this warning, use a Verilog or SystemVerilog standard that To avoid this warning, use a Verilog or SystemVerilog standard that
supports the feature. Alternatively, modify your code to use a different supports the feature. Alternatively, modify your code to use a different
@@ -1217,14 +1196,6 @@ List Of Warnings
:vlopt:`--no-timing` option. :vlopt:`--no-timing` option.
.. option:: NONSTD
Warns when a non-standard language feature is used that has a standard
equivalent, which might behave differently in corner cases. For example
:code:`$psprintf` system function is replaced by its standard equivalent
:code:`$sformatf`.
.. option:: NULLPORT .. option:: NULLPORT
Warns that a null port was detected in the module definition port Warns that a null port was detected in the module definition port
@@ -1264,7 +1235,7 @@ List Of Warnings
.. option:: PINMISSING .. option:: PINMISSING
.. TODO better example (frequent) .. TODO better example
Warns that a module has a pin that is not mentioned in an instance. If Warns that a module has a pin that is not mentioned in an instance. If
a pin is not missing it should still be specified on the instance a pin is not missing it should still be specified on the instance
@@ -1273,22 +1244,6 @@ List Of Warnings
Ignoring this warning will only suppress the lint check; it will Ignoring this warning will only suppress the lint check; it will
simulate correctly. simulate correctly.
Faulty example:
.. include:: ../../docs/gen/ex_PKGNODECL_faulty.rst
Results in:
.. include:: ../../docs/gen/ex_PKGNODECL_msg.rst
Repaired example:
.. code-block:: sv
:emphasize-lines: 2
sub sub (
.port());
Other tools with similar warnings: Icarus Verilog's portbind, "warning: Other tools with similar warnings: Icarus Verilog's portbind, "warning:
Instantiating module ... with dangling input port (...)". Slang's Instantiating module ... with dangling input port (...)". Slang's
unconnected-port, "port '...' has no connection". unconnected-port, "port '...' has no connection".
@@ -1320,7 +1275,7 @@ List Of Warnings
generate generate
if (A==0) begin if (A==0) begin
b b_inst1 (.x(1'b0)); //<--- error nonexistent port b b_inst1 (.x(1'b0)); //<--- error nonexistent port
b #(.PX(1'b0)) b_inst2 (); //<--- error nonexistent parameter b #(.PX(1'b0)) b_inst2 (); //<--- error nonexistent parameter
end end
endgenerate endgenerate
endmodule endmodule
@@ -1362,47 +1317,11 @@ List Of Warnings
.. option:: PKGNODECL .. option:: PKGNODECL
An error that a package/class appears to have been referenced that has .. TODO better example
not yet been declared. According to IEEE 1800-2023 26.3, all packages
must be declared before being used.
Faulty example: An error that a package/class appears to have been referenced that has not
yet been declared. According to IEEE 1800-2017 26.3, all packages must
.. include:: ../../docs/gen/ex_PKGNODECL_faulty.rst be declared before being used.
Results in:
.. include:: ../../docs/gen/ex_PKGNODECL_msg.rst
Often the package is declared in its own header file. In this case add
an include of that package header file to the referencing file. (And
make sure you have header guards in the package's header file to prevent
multiple declarations of the package.)
.. option:: PREPROCZERO
Warns that a preprocessor \`ifdef/\`ifndef expression (added in IEEE
1800-2023) evaluates a define value which has a value of :code:`0`.
This will evaluate in the expression as :code:`1` because the define has
a definition, unlike in the C preprocessor, which evaluates using the
define's value (of :code:`1`).
Referring to a define with an empty value does not give this warning, as
in C, the preprocessor will give an error on a preprocessor expression
of a define that is empty.
.. code-block:: sv
:linenos:
:emphasize-lines: 2
`define ZERO 0
`ifdef (ZERO || ZERO) //<--- warning PREPROCZERO
`error This_will_error_which_might_be_not_the_intent
`endif
The portable way to suppress this warning is to use a define value other
than zero, when it is to be used in a preprocessor expression.
.. option:: PROCASSWIRE .. option:: PROCASSWIRE
@@ -1441,10 +1360,7 @@ List Of Warnings
.. option:: RANDC .. option:: RANDC
Historical, never issued since version 5.018, when :code:`randc` became Warns that the :code:`randc` keyword is unsupported and being converted
fully supported.
Warned that the :code:`randc` keyword was unsupported and was converted
to :code:`rand`. to :code:`rand`.
@@ -1587,39 +1503,6 @@ List Of Warnings
modeled values, or DPI calls. modeled values, or DPI calls.
.. option:: SIDEEFFECT
Warns that an expression has a side effect that might not properly be
executed by Verilator.
This often represents a bug in Verilator, as opposed to a bad code
construct, however the Verilog code can typically be changed to avoid
the warning.
Faulty example:
.. code-block:: sv
:linenos:
:emphasize-lines: 1
x = y[a++];
This example warns because Verilator does not currently handle side
effects inside array subscripts; the a++ may be executed multiple times.
Rewrite the code to avoid expression side effects, typically by using a
temporary:
.. code-block:: sv
:linenos:
temp = a++;
x = y[temp];
Ignoring this warning may make Verilator simulations differ from other
simulators.
.. option:: SPLITVAR .. option:: SPLITVAR
Warns that a variable with a :option:`/*verilator&32;split_var*/` Warns that a variable with a :option:`/*verilator&32;split_var*/`
@@ -1692,9 +1575,6 @@ List Of Warnings
Warning that a symbol matches a C++ reserved word, and using this as a Warning that a symbol matches a C++ reserved word, and using this as a
symbol name would result in odd C++ compiler errors. You may disable symbol name would result in odd C++ compiler errors. You may disable
this warning, but Verilator will rename the symbol to avoid conflict. this warning, but Verilator will rename the symbol to avoid conflict.
If you are using `--vpi` and only mark things as public for VPI access
(and not C++ access) then it is advisable to disable this warning with
:code:`-Wno-SYMRSVDWORD`.
.. option:: SYNCASYNCNET .. option:: SYNCASYNCNET
@@ -1783,7 +1663,7 @@ List Of Warnings
.. code-block:: .. code-block::
%Warning-TIMESCALEMOD: example.v:1:8: Timescale missing on this module as other modules have it (IEEE 1800-2023 3.14.2.3) %Warning-TIMESCALEMOD: example.v:1:8: Timescale missing on this module as other modules have it (IEEE 1800-2017 3.14.2.3)
Recommend using :vlopt:`--timescale` argument, or in front of all Recommend using :vlopt:`--timescale` argument, or in front of all
modules use: modules use:
@@ -1927,8 +1807,7 @@ List Of Warnings
.. option:: UNPACKED .. option:: UNPACKED
Warns that unpacked structs and unions are not supported because Warns that unpacked structs and unions are not supported.
:vlopt:`--structs-packed` was used, or by up through version 5.004.
Ignoring this warning will make Verilator treat the structure as packed, Ignoring this warning will make Verilator treat the structure as packed,
which may make Verilator simulations differ from other simulators. This which may make Verilator simulations differ from other simulators. This
@@ -1979,16 +1858,14 @@ List Of Warnings
.. TODO better example .. TODO better example
Warns that the specified genvar is never used/consumed. See similar Warns that the specified genvar is never used/consumed.
:option:`UNUSEDSIGNAL`.
.. option:: UNUSEDPARAM .. option:: UNUSEDPARAM
.. TODO better example .. TODO better example
Warns that the specified parameter is never used/consumed. See similar Warns that the specified parameter is never used/consumed.
:option:`UNUSEDSIGNAL`.
.. option:: UNUSEDSIGNAL .. option:: UNUSEDSIGNAL
@@ -2028,7 +1905,7 @@ List Of Warnings
.. option:: USERERROR .. option:: USERERROR
A SystemVerilog elaboration-time assertion error was executed. A SystemVerilog elaboration-time assertion error was executed.
IEEE 1800-2023 20.11 requires this error. IEEE 1800-2017 20.11 requires this error.
Faulty example: Faulty example:
@@ -2044,7 +1921,7 @@ List Of Warnings
.. option:: USERFATAL .. option:: USERFATAL
A SystemVerilog elaboration-time assertion fatal was executed. A SystemVerilog elaboration-time assertion fatal was executed.
IEEE 1800-2023 20.11 requires this error. IEEE 1800-2017 20.11 requires this error.
Faulty example: Faulty example:
@@ -2060,7 +1937,7 @@ List Of Warnings
.. option:: USERINFO .. option:: USERINFO
A SystemVerilog elaboration-time assertion print was executed. This is A SystemVerilog elaboration-time assertion print was executed. This is
not an error or warning, and IEEE 1800-2023 20.11 requires this not an error or warning, and IEEE 1800-2017 20.11 requires this
behavior. behavior.
Example: Example:
@@ -2075,7 +1952,7 @@ List Of Warnings
.. option:: USERWARN .. option:: USERWARN
A SystemVerilog elaboration-time assertion warning was executed. A SystemVerilog elaboration-time assertion warning was executed.
IEEE 1800-2023 20.11 requires this warning. IEEE 1800-2017 20.11 requires this warning.
Faulty example: Faulty example:
@@ -2111,6 +1988,10 @@ List Of Warnings
.. option:: WAITCONST .. option:: WAITCONST
.. code-block:: sv
wait(1); // Blocks forever
Warns that a `wait` statement awaits a constant condition, which means it Warns that a `wait` statement awaits a constant condition, which means it
either blocks forever or never blocks. either blocks forever or never blocks.
@@ -2118,12 +1999,6 @@ List Of Warnings
something that elaborates to zero), does not warn, as it is presumed the something that elaborates to zero), does not warn, as it is presumed the
code is making the intent clear. code is making the intent clear.
Faulty example:
.. code-block:: sv
wait(1); // Blocks forever
.. option:: WIDTH .. option:: WIDTH
@@ -2160,7 +2035,7 @@ List Of Warnings
.. include:: ../../docs/gen/ex_WIDTHEXPAND_1_faulty.rst .. include:: ../../docs/gen/ex_WIDTHEXPAND_1_faulty.rst
Results in a :option:`WIDTHEXPAND` warning: Results in a WIDTHEXPAND warning:
.. include:: ../../docs/gen/ex_WIDTHEXPAND_1_msg.rst .. include:: ../../docs/gen/ex_WIDTHEXPAND_1_msg.rst
@@ -2168,21 +2043,17 @@ List Of Warnings
.. include:: ../../docs/gen/ex_WIDTHEXPAND_1_fixed.rst .. include:: ../../docs/gen/ex_WIDTHEXPAND_1_fixed.rst
.. option:: WIDTHTRUNC .. option:: WIDTHTRUNC
A more granular :option:`WIDTH` warning, for when a value is A more granular WIDTH warning, for when a value is truncated
truncated. See :option:`WIDTH`.
.. option:: WIDTHEXPAND .. option:: WIDTHEXPAND
A more granular :option:`WIDTH` warning, for when a value is zero A more granular WIDTH warning, for when a value is zero expanded
expanded. See :option:`WIDTH`.
.. option:: WIDTHXZEXPAND .. option:: WIDTHXZEXPAND
A more granular :option:`WIDTH` warning, for when a value is X/Z A more granular WIDTH warning, for when a value is X/Z expanded
expanded. See :option:`WIDTH`.
.. option:: WIDTHCONCAT .. option:: WIDTHCONCAT
@@ -2215,46 +2086,3 @@ List Of Warnings
Inactive region. Such processes do get resumed in the same time slot Inactive region. Such processes do get resumed in the same time slot
somewhere in the Active region. Issued only if Verilator is run with the somewhere in the Active region. Issued only if Verilator is run with the
:vlopt:`--timing` option. :vlopt:`--timing` option.
.. option:: ZEROREPL
Warns that zero is used as the replication value in the replication
operator. This is specified as an error by IEEE 1800-2023 11.4.12.1.
Faulty example:
.. code-block:: sv
:linenos:
:emphasize-lines: 5
module dut
#(parameter int MY_PARAM = 0);
reg [7:0] data;
always @* begin
data = {MY_PARAM{1'b1}}; //<--- Warning
end
endmodule
Results in the following error:
.. code-block::
%Error-ZEROREPL: test.v:5:22: Replication value of 0 is only legal under a concatenation (IEEE 1800-2023 11.4.12.1)
Note that in some cases, this warning may be false, when a condition
upstream or downstream of the access means the zero replication will
never execute or be used.
Repaired example:
.. code-block:: sv
:linenos:
:emphasize-lines: 2
module dut
#(parameter int MY_PARAM = 1); //<--- REPAIRED
reg [7:0] data;
always @* begin
data = {MY_PARAM{1'b1}};
end
endmodule
+76 -263
View File
@@ -224,7 +224,7 @@ Scheduling
---------- ----------
Verilator implements the Active and NBA regions of the SystemVerilog scheduling Verilator implements the Active and NBA regions of the SystemVerilog scheduling
model as described in IEEE 1800-2023 chapter 4, and in particular sections model as described in IEEE 1800-2017 chapter 4, and in particular sections
4.5 and Figure 4.1. The static (Verilation time) scheduling of SystemVerilog 4.5 and Figure 4.1. The static (Verilation time) scheduling of SystemVerilog
processes is performed by code in the ``V3Sched`` namespace. The single processes is performed by code in the ``V3Sched`` namespace. The single
entry point to the scheduling algorithm is ``V3Sched::schedule``. Some entry point to the scheduling algorithm is ``V3Sched::schedule``. Some
@@ -312,7 +312,7 @@ Scheduling of clocked and combinational logic
For performance, clocked and combinational logic needs to be ordered. For performance, clocked and combinational logic needs to be ordered.
Conceptually this minimizes the iterations through the evaluation loop Conceptually this minimizes the iterations through the evaluation loop
presented in the reference algorithm in the SystemVerilog standard (IEEE presented in the reference algorithm in the SystemVerilog standard (IEEE
1800-2023 section 4.5), by evaluating logic constructs in data-flow order. 1800-2017 section 4.5), by evaluating logic constructs in data-flow order.
Without going into a lot of detail here, accept that well thought out ordering Without going into a lot of detail here, accept that well thought out ordering
is crucial to good simulation performance, and also enables further is crucial to good simulation performance, and also enables further
optimizations later on. optimizations later on.
@@ -407,7 +407,7 @@ triggered due to a combinational signal change from the previous evaluation
pass, and a combinational loop settling due to hybrid logic, if the clocked pass, and a combinational loop settling due to hybrid logic, if the clocked
logic reads the not yet settled combinationally driven signal. Such a race logic reads the not yet settled combinationally driven signal. Such a race
is indeed possible, but our evaluation is consistent with the SystemVerilog is indeed possible, but our evaluation is consistent with the SystemVerilog
scheduling semantics (IEEE 1800-2023 chapter 4), and therefore any program scheduling semantics (IEEE 1800-2017 chapter 4), and therefore any program
that exhibits such a race has non-deterministic behavior according to the that exhibits such a race has non-deterministic behavior according to the
SystemVerilog semantics, so we accept this. SystemVerilog semantics, so we accept this.
@@ -1031,100 +1031,15 @@ the evaluation process records a bitmask of variables that might have
changed; if clear, checking those signals for changes may be skipped. changed; if clear, checking those signals for changes may be skipped.
Constrained randomization
-------------------------
Because general constrained randomization is a co-NP-hard problem, not all
cases are implemented in Verilator, and an external specialized SMT solver is
used for any non-obvious ones.
The ``randomize()`` method spawns an SMT solver in a sub-process. Then the
solver gets a setup query, then the definition of variables, then all the
constraints (SMT assertions) about the variables. Since the solver has no
information about the class' PRNG state, if the problem is satisfiable,
the solution space is further constrained by adding extra random constraints,
and querying the values satisfying the problem statement.
The constraint is currently constructed as fixing a simple xor of randomly
chosen bits of the variables being randomized.
The runtime classes used for handling the randomization are defined in
``verilated_random.h`` and ``verilated_random.cpp``.
``VlSubprocess``
~~~~~~~~~~~~~~~~
Subprocess handle, responsible for keeping track of the resources like child
PID, read and write file descriptors, and presenting them as a C++ iostream.
``VlRandomizer``
~~~~~~~~~~~~~~~~
Randomizer class, responsible for keeping track of variables and constraints,
and communicating with the solver subprocess.
The solver gets the constraints in `SMT-LIB2
<https://smtlib.cs.uiowa.edu/>`__ textual format in the following syntax:
::
(set-info :smt-lib-version 2.0)
(set-option :produce-models true)
(set-logic QF_BV)
(declare-fun v () (_ BitVec 16))
(declare-fun w () (_ BitVec 64))
(declare-fun x () (_ BitVec 48))
(declare-fun z () (_ BitVec 24))
(declare-fun t () (_ BitVec 23))
(assert (or (= v #x0003) (= v #x0008)))
(assert (= w #x0000000000000009))
(assert (or (or (= x #x000000000001) (= x #x000000000002)) (or (= x #x000000000004) (= x #x000000000009))))
(assert (bvult ((_ zero_extend 8) z) #x00000015))
(assert (bvugt ((_ zero_extend 8) z) #x0000000d))
(check-sat)
The solver responds with either ``sat`` or ``unsat``. Then the initial solution
is queried with:
::
(get-value (v w x z t ))
The solver then responds with e.g.:
::
((v #x0008)
(w #x0000000000000005)
(x #x000000000002)
(z #x000010)
(t #b00000000000000000000000))
And then a follow-up query (or a series thereof) is asked, and the solver gets
reset, so that it can be reused by subsequent randomization attempts:
::
(assert (= (bvxor (bvxor <...> (bvxor ((_ extract 21 21) z) ((_ extract 39 39) x)) ((_ extract 5 5) w)) <...> ((_ extract 10 10) w)) #b0))
(check-sat)
(get-value)
...
(reset)
Coding Conventions Coding Conventions
================== ==================
Compiler Version and C++14 Compiler Version and C++11
-------------------------- --------------------------
Verilator requires C14. Verilator does not require any newer versions, but Verilator requires C11. Verilator does not require any newer versions, but
is maintained to build successfully with C17/C20. is maintained to build successfully with C14/C17/C20.
Indentation and Naming Style Indentation and Naming Style
@@ -1307,9 +1222,9 @@ There are three ways data is passed between visitor functions.
2. User attributes. Each ``AstNode`` (**Note.** The AST node, not the 2. User attributes. Each ``AstNode`` (**Note.** The AST node, not the
visitor) has five user attributes, which may be accessed as an visitor) has five user attributes, which may be accessed as an
integer using the ``user1()`` through ``user4()`` methods, or as a integer using the ``user1()`` through ``user5()`` methods, or as a
pointer (of type ``AstNUser``) using the ``user1p()`` through pointer (of type ``AstNUser``) using the ``user1p()`` through
``user4p()`` methods (a common technique lifted from graph traversal ``user5p()`` methods (a common technique lifted from graph traversal
packages). packages).
A visitor first clears the one it wants to use by calling A visitor first clears the one it wants to use by calling
@@ -1472,6 +1387,9 @@ For all tests to pass, you must install the following packages:
- SystemC to compile the SystemC outputs, see http://systemc.org - SystemC to compile the SystemC outputs, see http://systemc.org
- Parallel::Forker from CPAN to run tests in parallel; you can install
this with e.g. "sudo cpan install Parallel::Forker".
- vcddiff to find differences in VCD outputs. See the readme at - vcddiff to find differences in VCD outputs. See the readme at
https://github.com/veripool/vcddiff https://github.com/veripool/vcddiff
@@ -1481,8 +1399,8 @@ For all tests to pass, you must install the following packages:
Controlling the Test Driver Controlling the Test Driver
--------------------------- ---------------------------
The test driver script `driver.py` runs tests; see the `Test Driver` The test driver script `driver.pl` runs tests; see the `Test Driver`
section. The individual test drivers are written in Perl; see `Test section. The individual test drivers are written in PERL; see `Test
Language`. Language`.
@@ -1494,7 +1412,7 @@ A specific regression test can be executed manually. To start the
:: ::
test_regress/t/t_EXAMPLE.py test_regress/t/t_EXAMPLE.pl
Regression Testing for Developers Regression Testing for Developers
@@ -1514,6 +1432,13 @@ Developers will also want to call ./configure with two extra flags:
disabled by default, as SystemC installation problems would otherwise disabled by default, as SystemC installation problems would otherwise
falsely indicate a Verilator problem. falsely indicate a Verilator problem.
When enabling the long tests, some additional PERL modules are needed,
which you can install using cpan.
::
cpan install Parallel::Forker
There are some traps to avoid when running regression tests There are some traps to avoid when running regression tests
- When checking the MANIFEST, the test will fail on unexpected code in the - When checking the MANIFEST, the test will fail on unexpected code in the
@@ -1537,19 +1462,6 @@ There are some traps to avoid when running regression tests
system-dependent, but on Fedora Linux it would require editing the system-dependent, but on Fedora Linux it would require editing the
``/etc/security/limits.conf`` file as root. ``/etc/security/limits.conf`` file as root.
Diffing generated code after changes
------------------------------------
When making a change in the code generation area that should not change the
actual emitted code, it is useful to perform a diff to make sure the emitted
code really did not change. To do this, the top level Makefile provides the
*test-snap* and *test-diff* targets:
- Run the test suite with ``make test``
- Take a snapshot with ``make test-snap``
- Apply your changes
- Run the test suite again with ``make test``
- See the changes in the output with ``make test-diff``
Continuous Integration Continuous Integration
---------------------- ----------------------
@@ -1656,7 +1568,7 @@ field in the section below.
+---------------+--------------------------------------------------------+ +---------------+--------------------------------------------------------+
| ``1:2:`` | The hierarchy of the ``VAR`` is the ``op2p`` | | ``1:2:`` | The hierarchy of the ``VAR`` is the ``op2p`` |
| | pointer under the ``MODULE``, which in turn is the | | | pointer under the ``MODULE``, which in turn is the |
| | ``op1p`` pointer under the ``NETLIST``. | | | ``op1p`` pointer under the ``NETLIST`` |
+---------------+--------------------------------------------------------+ +---------------+--------------------------------------------------------+
| ``VAR`` | The AstNodeType (e.g. ``AstVar``). | | ``VAR`` | The AstNodeType (e.g. ``AstVar``). |
+---------------+--------------------------------------------------------+ +---------------+--------------------------------------------------------+
@@ -1670,7 +1582,7 @@ field in the section below.
| | and "aa" the 27th. Then line 22 in that file, then | | | and "aa" the 27th. Then line 22 in that file, then |
| | column 8 (aa=0, az=25, ba=26, ...). | | | column 8 (aa=0, az=25, ba=26, ...). |
+---------------+--------------------------------------------------------+ +---------------+--------------------------------------------------------+
| ``@dt=0x...`` | The address of the data type this node references. | | ``@dt=0x...`` | The address of the data type this node contains. |
+---------------+--------------------------------------------------------+ +---------------+--------------------------------------------------------+
| ``w32`` | The data-type width() is 32 bits. | | ``w32`` | The data-type width() is 32 bits. |
+---------------+--------------------------------------------------------+ +---------------+--------------------------------------------------------+
@@ -1678,7 +1590,7 @@ field in the section below.
| | variable. | | | variable. |
+---------------+--------------------------------------------------------+ +---------------+--------------------------------------------------------+
| ``[O]`` | Flags which vary with the type of node, in this | | ``[O]`` | Flags which vary with the type of node, in this |
| | case of a VAR, it means the variable is an output. | | | case, it means the variable is an output. |
+---------------+--------------------------------------------------------+ +---------------+--------------------------------------------------------+
In more detail, the following fields are dumped common to all nodes. They In more detail, the following fields are dumped common to all nodes. They
@@ -1728,7 +1640,7 @@ Source file and line
file is ``a``, the 26th is ``z``, the 27th is ``aa``, and so on. file is ``a``, the 26th is ``z``, the 27th is ``aa``, and so on.
User pointers User pointers
Shows the value of the node's user1p...user4p, if non-NULL. Shows the value of the node's user1p...user5p, if non-NULL.
Data type Data type
Many nodes have an explicit data type. "@dt=0x..." indicates the Many nodes have an explicit data type. "@dt=0x..." indicates the
@@ -1771,84 +1683,6 @@ Similarly, the ``NETLIST`` has a list of modules referred to by its
``op1p()`` pointer. ``op1p()`` pointer.
.tree.json Output
-----------------
``.tree.json``` is an alternative dump format to ``.tree`` that is meant for
programmatic processing (e.g. with `astsee <https://github.com/antmicro/astsee>`_).
To enable this dump format, use :vlopt:`--dump-tree-json` or :vlopt:`--json-only`.
Structure:
::
{
/* Attributes that are common to all types of nodes */
"type": "VAR",
"name": "cyc",
/* By default addresses and filenames use short/stable ids rather than real value */
"addr": "(H)",
"loc": "a,25:12,26:15", /* "fileid,firstLine:firstCol,lastLine:endCol" (endCol is right exclusive) */
"editNum": 602,
/* Fields that are specific to AstVar nodes: */
"origName": "cyc",
"isSc": false,
"ioDirection": "NONE",
"isConst": false,
"isPullup": false,
"isPulldown": false,
"isUsedClock": false,
"isSigPublic": false,
"isLatched": false,
"isUsedLoopIdx": false,
"noReset": false,
"attrIsolateAssign": false,
"attrFileDescr": false,
"isDpiOpenArray": false,
"isFuncReturn": false,
"isFuncLocal": false,
"attrClocker": "UNKNOWN",
"lifetime": "NONE",
"varType": "VAR",
/* Lists of child nodes (which use similar structure as their parent): */
"childDTypep": [ /* ... */ ],
"delayp": [ /* ... */ ],
"valuep": [ /* ... */ ],
"attrsp": [ /* ... */ ]
}
.tree.meta.json Output
----------------
.tree.meta.json contains metadata that is common across the whole AST tree
(in case of --dump-tree-json, multiple trees share one meta file).
Besides de-duplication of data shared between multiple stages, .meta.json enables offloading
unstable data (that can vary from machine-to-machine or run-to-run) from main .tree.json.
This offloading allows, for example, to use byte-to-byte comparisons of AST dumps in tests.
::
{"files": {
/* Map id to filename, and other metadata */
"d": {"filename":"/home/ant/tmp/verilator/include/verilated_std.sv", "realpath":"/home/ant/tmp/verilator/include/verilated_std.sv", "language":"1800-2023"},
"a": {"filename":"<built-in>", "realpath":"<built-in>", "language":"1800-2023"},
"b": {"filename":"<command-line>", "realpath":"<command-line>", "language":"1800-2023"},
"c": {"filename":"input.vc", "realpath":"/home/ant/tmp/verilator/test_regress/input.vc", "language":"1800-2023"},
"e": {"filename":"t/t_EXAMPLE.v", "realpath":"/home/ant/tmp/verilator/test_regress/t/t_EXAMPLE.v", "language":"1800-2023"}
},"pointers": {
/* Map id to real address */
"(AG)": "0x562997289180",
"(YF)": "0x5629971c50b0",
"(WF)": "0x5629971e7ae0",
/* ... /*
},"ptrFieldNames": [
/* List of fields that are used for storing pointers */
"aboveScopep",
"voidp",
"addr",
/* ... */
]}
.tree.dot Output .tree.dot Output
---------------- ----------------
@@ -1861,7 +1695,7 @@ represent the pointers (``op1p``, ``op2p``, etc) between the nodes.
Debugging with GDB Debugging with GDB
------------------ ------------------
The `driver.py` script accepts ``--debug --gdb`` to start The `driver.pl` script accepts ``--debug --gdb`` to start
Verilator under gdb and break when an error is hit, or the program is about Verilator under gdb and break when an error is hit, or the program is about
to exit. You can also use ``--debug --gdbbt`` to just backtrace and then to exit. You can also use ``--debug --gdbbt`` to just backtrace and then
exit gdb. To debug the Verilated executable, use ``--gdbsim``. exit gdb. To debug the Verilated executable, use ``--gdbsim``.
@@ -1872,7 +1706,7 @@ can use ``--debug`` and look at the underlying invocation of
:: ::
t/t_alw_dly.py --debug t/t_alw_dly.pl --debug
shows it invokes the command: shows it invokes the command:
@@ -1921,20 +1755,6 @@ To print a node:
pnt nodep pnt nodep
# or: call dumpTreeGdb(nodep) # aliased to "pnt" in src/.gdbinit # or: call dumpTreeGdb(nodep) # aliased to "pnt" in src/.gdbinit
``src/.gdbinit`` and ``src/.gdbinit.py`` define handy utilities for working with
JSON AST dumps. For example:
* ``jstash nodep`` - Perform a JSON AST dump and save it into GDB value history (e.g. ``$1``)
* ``jtree nodep`` - Perform a JSON AST dump and pretty print it using ``astsee_verilator``.
* ``jtree $1`` - Pretty print a dump that was previously saved by ``jstash``.
* ``jtree nodep -d '.file, .timeunit'`` - Perform a JSON AST dump, filter out some fields and pretty print it.
* ``jtree 0x55555613dca0`` - Pretty print using address literal (rather than actual pointer).
* ``jtree $1 nodep`` - Diff ``nodep`` against an older dump.
A detailed description of ``jstash`` and ``jtree`` can be displayed using ``gdb``'s ``help`` command.
These commands require `astsee <https://github.com/antmicro/astsee>`_ to be installed.
When GDB halts, it is useful to understand that the backtrace will commonly When GDB halts, it is useful to understand that the backtrace will commonly
show the iterator functions between each invocation of ``visit`` in the show the iterator functions between each invocation of ``visit`` in the
backtrace. You will typically see a frame sequence something like: backtrace. You will typically see a frame sequence something like:
@@ -1969,7 +1789,7 @@ Generally, what would you do to add a new feature?
Follow the convention described above about the AstNode type hierarchy. Follow the convention described above about the AstNode type hierarchy.
Ordering of definitions is enforced by ``astgen``. Ordering of definitions is enforced by ``astgen``.
5. Now you can run ``test_regress/t/t_<newtestcase>.py --debug`` and it'll 5. Now you can run ``test_regress/t/t_<newtestcase>.pl --debug`` and it'll
probably fail, but you'll see a probably fail, but you'll see a
``test_regress/obj_dir/t_<newtestcase>/*.tree`` file which you can examine ``test_regress/obj_dir/t_<newtestcase>/*.tree`` file which you can examine
to see if the parsing worked. See also the sections above on debugging. to see if the parsing worked. See also the sections above on debugging.
@@ -1996,21 +1816,21 @@ Verilator ideally would support all of IEEE, and has the goal to get close
to full support. However the following IEEE sections and features are not to full support. However the following IEEE sections and features are not
anticipated to be ever implemented for the reasons indicated. anticipated to be ever implemented for the reasons indicated.
IEEE 1800-2023 3.3 modules within modules IEEE 1800-2017 3.3 modules within modules
Little/no tool support, and arguably not a good practice. Little/no tool support, and arguably not a good practice.
IEEE 1800-2023 6.12 "shortreal" IEEE 1800-2017 6.12 "shortreal"
Little/no tool support, and easily promoted to real. Little/no tool support, and easily promoted to real.
IEEE 1800-2023 11.11 Min, typ, max IEEE 1800-2017 11.11 Min, typ, max
No SDF support, so will always use typical. No SDF support, so will always use typical.
IEEE 1800-2023 20.16 Stochastic analysis IEEE 1800-2017 20.16 Stochastic analysis
Little industry use. Little industry use.
IEEE 1800-2023 20.17 PLA modeling IEEE 1800-2017 20.17 PLA modeling
Little industry use and outdated technology. Little industry use and outdated technology.
IEEE 1800-2023 31 Timing checks IEEE 1800-2017 31 Timing checks
No longer relevant with static timing analysis tools. No longer relevant with static timing analysis tools.
IEEE 1800-2023 32 SDF annotation IEEE 1800-2017 32 SDF annotation
No longer relevant with static timing analysis tools. No longer relevant with static timing analysis tools.
IEEE 1800-2023 33 Config IEEE 1800-2017 33 Config
Little industry use. Little industry use.
@@ -2018,7 +1838,7 @@ IEEE 1800-2023 33 Config
Test Driver Test Driver
=========== ===========
This section documents the test driver script, `driver.py`. driver.py This section documents the test driver script, `driver.pl`. driver.pl
invokes Verilator or another simulator on each test file. For test file invokes Verilator or another simulator on each test file. For test file
contents description see `Test Language`. contents description see `Test Language`.
@@ -2030,7 +1850,7 @@ the regression tests with OBJCACHE enabled and in parallel on a machine
with many cores. See the -j option and OBJCACHE environment variable. with many cores. See the -j option and OBJCACHE environment variable.
driver.py Non-Scenario Arguments driver.pl Non-Scenario Arguments
-------------------------------- --------------------------------
--benchmark [<cycles>] --benchmark [<cycles>]
@@ -2051,10 +1871,6 @@ driver.py Non-Scenario Arguments
files with dumping level 3, which dumps the standard critical stages. files with dumping level 3, which dumps the standard critical stages.
For details on the format see `.tree Output`. For details on the format see `.tree Output`.
--fail-max <numtests>
Set the number of failing tests, after which the driver will stop running
additional tests. Defaults to 20, 0 disables.
--gdb --gdb
Same as ``verilator --gdb``: Run Verilator under the debugger. Same as ``verilator --gdb``: Run Verilator under the debugger.
@@ -2100,16 +1916,13 @@ driver.py Non-Scenario Arguments
memory leaks. memory leaks.
--site --site
Run site-specific tests also. Run site specific tests also.
--stop --stop
Stop on the first error. Stop on the first error.
--trace --trace
Set the simulator-specific flags to request waveform tracing. Set the simulator specific flags to request waveform tracing.
--valgrind
Same as ``verilator --valgrind``: Run Verilator under `Valgrind <https://valgrind.org/>`_.
--verbose --verbose
Compile and run the test in verbose mode. This means ``TEST_VERBOSE`` Compile and run the test in verbose mode. This means ``TEST_VERBOSE``
@@ -2119,7 +1932,7 @@ driver.py Non-Scenario Arguments
For tests using the standard C++ wrapper, enable runtime debug mode. For tests using the standard C++ wrapper, enable runtime debug mode.
driver.py Scenario Arguments driver.pl Scenario Arguments
---------------------------- ----------------------------
The following options control which simulator is used, and which tests are The following options control which simulator is used, and which tests are
@@ -2154,14 +1967,11 @@ simultaneously.
--vltmt --vltmt
Run Verilator tests in multithreaded mode. Run Verilator tests in multithreaded mode.
--xrun
Run Cadence Xcelium simulator tests.
--xsim --xsim
Run Xilinx XSim simulator tests. Run Xilinx XSim simulator tests.
driver.py Environment driver.pl Environment
--------------------- ---------------------
HARNESS_UPDATE_GOLDEN HARNESS_UPDATE_GOLDEN
@@ -2200,10 +2010,6 @@ VERILATOR_ROOT
Standard path to Verilator distribution root; see primary Verilator Standard path to Verilator distribution root; see primary Verilator
documentation. documentation.
VERILATOR_SOLVER
SMT solver command for constrained randomization; see primary Verilator
documentation.
VERILATOR_TESTS_SITE VERILATOR_TESTS_SITE
Used with ``--site``, a colon-separated list of directories with tests to Used with ``--site``, a colon-separated list of directories with tests to
be added to testlist. be added to testlist.
@@ -2221,30 +2027,30 @@ VERILATOR_XVLOG
Test Language Test Language
============= =============
This section describes the format of the ``test_regress/t/*.py`` test This section describes the format of the ``test_regress/t/*.pl`` test
language files, executed by `driver.py`. language files, executed by `driver.pl`.
Test Language Summary Test Language Summary
--------------------- ---------------------
For convenience, a summary of the most commonly used features is provided For convenience, a summary of the most commonly used features is provided
here, with a reference in a later section. All test files typically have a here, with a reference in a later section. All test files typically have a
call to the ``test.lint`` or ``test.compile`` methods to compile the call to the ``lint`` or ``compile`` subroutine to compile the test. For
test. For run-time tests, this is followed by a call to the run-time tests, this is followed by a call to the ``execute``
``test.execute`` method. Both of these functions can optionally be provided subroutine. Both of these functions can optionally be provided with
with arguments specifying additional options. arguments specifying additional options.
If those complete, the script calls ``test.passes`` to increment the count If those complete, the script calls ``ok`` to increment the count of
of successful tests. successful tests and then returns 1 as its result.
The driver.py script assumes by default that the source Verilog file name The driver.pl script assumes by default that the source Verilog file name
matches the test script name. So a test whose driver is matches the test script name. So a test whose driver is
``t/t_mytest.py`` will expect a Verilog source file ``t/t_mytest.v``. ``t/t_mytest.pl`` will expect a Verilog source file ``t/t_mytest.v``.
This can be changed using the ``top_filename`` subroutine, for example This can be changed using the ``top_filename`` subroutine, for example
:: ::
test.top_filename = "t/t_myothertest.v" top_filename("t/t_myothertest.v");
By default, all tests will run with major simulators (Icarus Verilog, NC, By default, all tests will run with major simulators (Icarus Verilog, NC,
VCS, ModelSim, etc.) as well as Verilator, to allow results to be VCS, ModelSim, etc.) as well as Verilator, to allow results to be
@@ -2253,25 +2059,26 @@ can use the following:
:: ::
test.scenarios('vlt') scenarios(vlt => 1);
Of the many options that can be set through arguments to ``test.compiler`` Of the many options that can be set through arguments to ``compiler`` and
and ``test.execute``, the following are particularly useful: ``execute``, the following are particularly useful:
``verilator_flags2`` ``verilator_flags2``
A list of flags to be passed to verilator when compiling. A list of flags to be passed to verilator when compiling.
``fails`` ``fails``
Set true to indicate that the compilation or execution is intended to fail. Set to 1 to indicate that the compilation or execution is intended to fail.
For example, the following would specify that compilation requires two For example, the following would specify that compilation requires two
defines and is expected to fail. defines and is expected to fail.
:: ::
test.compile( compile(
verilator_flags2 => ["-DSMALL_CLOCK -DGATED_COMMENT"], verilator_flags2 => ["-DSMALL_CLOCK -DGATED_COMMENT"],
fails = True) fails => 1,
);
Hints On Writing Tests Hints On Writing Tests
---------------------- ----------------------
@@ -2284,10 +2091,10 @@ same name as the test, but with .cpp as suffix
:: ::
test.compile( compile(
make_top_shell=False, make_top_shell => 0,
make_main=False, make_main => 0,
verilator_flags2=["--exe", test.t_dir + "/" + test.name + ".cpp"]) verilator_flags2 => ["--exe $Self->{t_dir}/$Self->{name}.cpp"], );
Tests should be self-checking, rather than producing lots of output. If a Tests should be self-checking, rather than producing lots of output. If a
test succeeds it should print ``*-* All Finished *-*`` to standard output test succeeds it should print ``*-* All Finished *-*`` to standard output
@@ -2327,8 +2134,9 @@ compile time, it is the only option. For example:
:: ::
compile( compile(
fails=True, fails => 1,
expect_filename=test.golden_filename) expect_filename => $Self->{golden_filename},
);
Note ``expect_filename`` strips some debugging information from the logfile Note ``expect_filename`` strips some debugging information from the logfile
when comparing. when comparing.
@@ -2337,9 +2145,9 @@ when comparing.
Test Language Compile/Lint/Run Arguments Test Language Compile/Lint/Run Arguments
---------------------------------------- ----------------------------------------
This section describes common arguments to ``test.compile``, ``test.lint``, This section describes common arguments to ``compile()``, ``lint()``, and
and ``test.run``. The full list of arguments can be found by looking at ``run()``. The full list of arguments can be found by looking at the
the ``driver.py`` source code. ``driver.pl`` source code.
all_run_flags all_run_flags
A list of flags to be passed when running the simulator (Verilated model A list of flags to be passed when running the simulator (Verilated model
@@ -2350,6 +2158,11 @@ check_finished
string ``*-* All Finished *-*`` being printed on standard output. This is string ``*-* All Finished *-*`` being printed on standard output. This is
the normal way for successful tests to finish. the normal way for successful tests to finish.
expect
A quoted list of strings or regular expression to be matched in the
output. See `Hints On Writing Tests` for more detail on how this argument
should be used.
fails fails
True to indicate this step is expected to fail. Tests that are expected True to indicate this step is expected to fail. Tests that are expected
to fail generally have _bad in their filename. to fail generally have _bad in their filename.
@@ -2411,7 +2224,7 @@ xsim_flags / xsim_flags2 / xsim_run_flags
Distribution Distribution
============ ============
Copyright 2008-2025 by Wilson Snyder. Verilator is free software; you can Copyright 2008-2023 by Wilson Snyder. Verilator is free software; you can
redistribute it and/or modify it under the terms of either the GNU Lesser 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. General Public License Version 3 or the Perl Artistic License Version 2.0.
-149
View File
@@ -1,5 +1,4 @@
ABCp ABCp
Aadi
Accellera Accellera
Affe Affe
Aleksander Aleksander
@@ -14,71 +13,54 @@ Antonin
Antwerpen Antwerpen
Arasanipalai Arasanipalai
Arjen Arjen
Arshid
Asciidoc Asciidoc
Ashutosh Ashutosh
Ast Ast
Atmel Atmel
Aurelien Aurelien
Badáň
Bagri Bagri
Balboni
Baltazar Baltazar
Bardsley Bardsley
Benchmarking Benchmarking
Berman Berman
Bhagavatula Bhagavatula
Bhattacharyya Bhattacharyya
Biancolin
Binderman Binderman
Björk
Bleiweiss Bleiweiss
Bogdan Bogdan
Bonneau
Bouchard Bouchard
Boumenot Boumenot
Brej Brej
Briquet Briquet
Brownlee Brownlee
Buckenmaier Buckenmaier
Burghoorn
Bybell Bybell
CLang
CMake CMake
Cai Cai
Cavium Cavium
Cfuncs Cfuncs
Chandan Chandan
Chentai
Cherkasov
Chih
Chitlesh Chitlesh
Christophe Christophe
Cochrane Cochrane
Conda Conda
Corteggiani Corteggiani
Cozzocrea
Cuan Cuan
Cygwin Cygwin
DErrico DErrico
DFG DFG
Da Da
Dai
Danilo Danilo
Dannoritzer Dannoritzer
Das Das
Davide
Dcache Dcache
Deadman Deadman
Debacker Debacker
Deepa Deepa
Defparams Defparams
Delm
Denio Denio
Deniz
Deprecations Deprecations
Deroo Deroo
Desai
Dickol Dickol
Diez Diez
Dimitris Dimitris
@@ -87,11 +69,9 @@ Djordjevic
Dobbie Dobbie
Dockerfile Dockerfile
Donal Donal
Donovick
Doorn Doorn
Doxygen Doxygen
Dressler Dressler
Dudek
Duraid Duraid
Dutton Dutton
Dzetkulic Dzetkulic
@@ -109,22 +89,14 @@ Engstrom
Enzo Enzo
Eugen Eugen
Fabrizio Fabrizio
Faucher
Faure
Feinberg
Fekete Fekete
Ferrandi Ferrandi
Filip
Flachs Flachs
Flavien Flavien
Florian
Foletto Foletto
Forencich
Forker Forker
Francillon Francillon
Fredieu Fredieu
Freiberger
Frédéric
GTKWave GTKWave
Galbi Galbi
Gantt Gantt
@@ -136,7 +108,6 @@ Gernot
Gerst Gerst
Gielda Gielda
Gigerl Gigerl
Gijs
Gileadi Gileadi
Giri Giri
Gisselquist Gisselquist
@@ -145,25 +116,18 @@ Goessling
Gonnen Gonnen
Goorah Goorah
Gossner Gossner
Graba
Graphviz Graphviz
Graybeal Graybeal
Grobman Grobman
Grulfen Grulfen
Gu
Gunter Gunter
Guo Guo
Güzel
Hameed
Hao Hao
Haojin
Harboe Harboe
Hashimoto Hashimoto
Hayenga Hayenga
Hesselbarth
Hewson Hewson
Hicamp Hicamp
Hideto
Hiroki Hiroki
Holdsworth Holdsworth
Holme Holme
@@ -171,11 +135,8 @@ Homebrew
Hornung Hornung
Hossell Hossell
Hsu Hsu
Huggett
Hutt
Hyperthreading Hyperthreading
Ibrahim Ibrahim
Ikram
Iles Iles
Inlines Inlines
Inout Inout
@@ -187,14 +148,11 @@ Jae
Jalloq Jalloq
Jankowski Jankowski
Jannis Jannis
Jasen
Jens Jens
Jeras Jeras
Jiaxun
Jiuyang Jiuyang
Joannou Joannou
Joly Joly
Josse
Jullien Jullien
Junji Junji
Junyi Junyi
@@ -205,7 +163,6 @@ Kahn
Kai Kai
Kamendje Kamendje
Kandadi Kandadi
Kaneda
Kaplan Kaplan
Karge Karge
Karlsson Karlsson
@@ -221,7 +178,6 @@ Klnv
Koenig Koenig
Koh Koh
Kolecki Kolecki
Konstantin
Koonce Koonce
Korteland Korteland
Koszek Koszek
@@ -233,24 +189,17 @@ Kumashikar
Kuoping Kuoping
Kurachi Kurachi
Laeufer Laeufer
Laroche
Laurens Laurens
Lavino Lavino
Leber Leber
Leendert Leendert
Lem Lem
Lesik Lesik
Libenzi
Licker
Liland Liland
Liu Liu
Liwei
Lockhart Lockhart
Longo Longo
Luca
Luiza
Lussier Lussier
Lübeck
MMD MMD
MODDUP MODDUP
MTasks MTasks
@@ -260,15 +209,10 @@ Mahesh
Mahmoudy Mahmoudy
Makefile Makefile
Makefiles Makefiles
Maksymenko
Markley
Marquet
Matveyenko Matveyenko
Maupin Maupin
Mdir Mdir
Mednick Mednick
Mei
Melo
Menküc Menküc
Michail Michail
Michiels Michiels
@@ -279,8 +223,6 @@ MinW
Mindspeed Mindspeed
MingW MingW
Miodrag Miodrag
Moberg
Mobert
ModelSim ModelSim
Modport Modport
Moinak Moinak
@@ -288,13 +230,10 @@ Mong
Muhlestein Muhlestein
Multithreaded Multithreaded
Multithreading Multithreading
Mykyta
NOUNOPTFLAT NOUNOPTFLAT
NaN NaN
Nalbantis Nalbantis
Nandor
Narayan Narayan
Narcis
Nassim Nassim
Nauticus Nauticus
Newgard Newgard
@@ -304,20 +243,16 @@ Niranjan
Nitza Nitza
Noack Noack
Nodine Nodine
Ober
Oleg Oleg
Olof Olof
Olofsson Olofsson
Oron
Oyvind Oyvind
PLI PLI
Palaniappan Palaniappan
Patricio Patricio
Petr Petr
Piard
Piechotka Piechotka
Piersall Piersall
Platz
Platzer Platzer
Plunkett Plunkett
Popolon Popolon
@@ -334,8 +269,6 @@ Priyadharshini
Pullup Pullup
Pulver Pulver
Puri Puri
Qin
Qiu
Questa Questa
Rachit Rachit
Ralf Ralf
@@ -344,41 +277,29 @@ Redhat
Reitan Reitan
Renga Renga
Requin Requin
Rodas
Rodionov Rodionov
Rohan
Rolfe Rolfe
Rontionov Rontionov
Roodselaar Roodselaar
Roshit
Runtime Runtime
Ruud Ruud
Rystsov Rystsov
STandarD STandarD
Salman Salman
Sammelson
Sanggyu
Sanguinetti Sanguinetti
Sanjay Sanjay
Sasselli
Scharrer Scharrer
Seitz Seitz
Shahid
Shahrestani
Shankar Shankar
Shanshan Shanshan
Sharad Sharad
Shareef Shareef
Shen
Sheng Sheng
Shi Shi
Shinkarovsky Shinkarovsky
Shinya
Shirakawa Shirakawa
Shou
Shuba Shuba
Shunyao Shunyao
Slager
Slatter Slatter
SoC SoC
Sobhan Sobhan
@@ -387,12 +308,10 @@ Solaris
Solomatnikov Solomatnikov
Solt Solt
Southwell Southwell
Spack
Srini Srini
Srinivasan Srinivasan
Stamness Stamness
Stephane Stephane
Sterin
Stoddard Stoddard
Stroebel Stroebel
Strouble Strouble
@@ -400,7 +319,6 @@ Stucki
Su Su
Suguimoto Suguimoto
Sundararajan Sundararajan
Sunderland
Suse Suse
Syms Syms
Synopsys Synopsys
@@ -408,7 +326,6 @@ SystemC
SystemVerilog SystemVerilog
Takatsukasa Takatsukasa
Tambe Tambe
Tarik
Tariq Tariq
Tejada Tejada
Tengstrand Tengstrand
@@ -416,7 +333,6 @@ Terpstra
Thiede Thiede
Thierry Thierry
Thyer Thyer
Tianrui
Tichelaar Tichelaar
Timi Timi
Tomov Tomov
@@ -427,11 +343,9 @@ Trefor
Tresidder Tresidder
Tri Tri
Tristate Tristate
Truong
Turton Turton
UNOPTFLAT UNOPTFLAT
Ubixum Ubixum
Ueno
Uints Uints
Undefines Undefines
Unsized Unsized
@@ -440,7 +354,6 @@ Uselib
Usha Usha
Usuario Usuario
VERILATOR VERILATOR
Vandergriendt
Vasu Vasu
Vdeeptemp Vdeeptemp
Vdly Vdly
@@ -458,7 +371,6 @@ Verilog
Vighnesh Vighnesh
Viktor Viktor
Vilp Vilp
Vlip
Vm Vm
Vukobratovic Vukobratovic
Wai Wai
@@ -475,26 +387,18 @@ Wojciech
Wolfel Wolfel
Wouters Wouters
Wpedantic Wpedantic
Wunused
Wwarn Wwarn
XSim XSim
Xcelium Xcelium
Xiaoliang Xiaoliang
Xiaoyi
Xuan Xuan
Xuanqi Xuanqi
Yao
Yazdanbakhsh Yazdanbakhsh
Yernagula
Yi Yi
Yike Yike
Yinan Yinan
Yoshitomo
Yosys Yosys
Yu Yu
Yujia
Yurii
Zaruba
Zhang Zhang
abirkmanis abirkmanis
accessor accessor
@@ -512,7 +416,6 @@ architected
args args
arrarys arrarys
assertOn assertOn
assertcontrol
astgen astgen
async async
atClone atClone
@@ -529,7 +432,6 @@ basename
bbox bbox
benchmarking benchmarking
biguint biguint
bindir
biops biops
bisonpre bisonpre
bitOpTree bitOpTree
@@ -545,7 +447,6 @@ buildenv
bv bv
bvs bvs
callValueCbs callValueCbs
callgrind
casex casex
casez casez
casted casted
@@ -585,7 +486,6 @@ countbits
countones countones
cout cout
cpp cpp
cppstyle
cpu cpu
ctor ctor
ctrace ctrace
@@ -599,7 +499,6 @@ datadir
datafiles datafiles
david david
ddd ddd
de
deassign deassign
debugi debugi
defenv defenv
@@ -607,15 +506,12 @@ defname
defparam defparam
demangling demangling
dep dep
deparametrized
der der
dereference dereference
desassign desassign
destructor destructor
desynchronization
detections detections
dev dev
devcontainer
devel devel
dir dir
displayb displayb
@@ -624,7 +520,6 @@ doxygen
dpiGetContext dpiGetContext
dpic dpic
dsvf dsvf
dt
dtor dtor
dumpall dumpall
dumpfile dumpfile
@@ -643,7 +538,6 @@ dut
dx dx
dynarray dynarray
elab elab
eliasphanna
elike elike
elsif elsif
endcase endcase
@@ -666,7 +560,6 @@ envvar
eof eof
errae errae
erroring erroring
esynr
et et
eval eval
evals evals
@@ -695,11 +588,9 @@ fno
fopen fopen
forceable forceable
foreach foreach
fourstate
fprintf fprintf
fprofile fprofile
fread fread
freloop
frewind frewind
fs fs
fscanf fscanf
@@ -721,9 +612,7 @@ genvar
genvars genvars
getenv getenv
getline getline
getter
ggdb ggdb
glibc
gmake gmake
gmon gmon
gotFinish gotFinish
@@ -735,7 +624,6 @@ hh
hier hier
hierCMakeArgs hierCMakeArgs
hierMkArgs hierMkArgs
hierParameters
hierVer hierVer
hx hx
hyperthreading hyperthreading
@@ -769,7 +657,6 @@ ish
isunbounded isunbounded
isunknown isunknown
jobserver jobserver
json
jwoutersymatra jwoutersymatra
killua killua
lang lang
@@ -782,7 +669,6 @@ libext
libgoogle libgoogle
libsystemc libsystemc
libtcmalloc libtcmalloc
libverilated
linkers linkers
linter linter
linux linux
@@ -811,7 +697,6 @@ miree
mis mis
misconnected misconnected
misconversion misconversion
misoptimized
missized missized
mk mk
mno mno
@@ -836,7 +721,6 @@ multithreading
musl musl
mutexes mutexes
mux mux
muzafferkal
myftptoyman myftptoyman
mysignal mysignal
namespace namespace
@@ -867,8 +751,6 @@ parallelized
param param
parameterization parameterization
parameterized parameterized
parameterized
parameterless
params params
parens parens
pawel pawel
@@ -877,11 +759,9 @@ pdf
perf perf
perftools perftools
pgo pgo
phelter
picoChip picoChip
pinIndex pinIndex
pinout pinout
pkgdatadir
plusargs plusargs
pmos pmos
poping poping
@@ -896,7 +776,6 @@ pragma
pragmas pragmas
pre pre
precisions precisions
precompiled
predefines predefines
prepareClone prepareClone
prepend prepend
@@ -913,9 +792,7 @@ profcfunc
profiler profiler
prototyptes prototyptes
ps ps
psprintf
pthread pthread
pthreads
ptr ptr
pulldown pulldown
pulldowns pulldowns
@@ -924,12 +801,10 @@ pvalue
pwd pwd
py py
qrq qrq
qrqiuren
radix radix
randc randc
randcase randcase
randstate randstate
raphmaster
rarr rarr
rdtsc rdtsc
reStructuredText reStructuredText
@@ -939,14 +814,11 @@ readmemb
readmemh readmemh
realpath realpath
realtime realtime
realtobits
recoding recoding
recrem recrem
redeclaring redeclaring
regs regs
reloop reloop
replaceShiftOp
reproducibility
resetall resetall
respecified respecified
rodata rodata
@@ -960,7 +832,6 @@ sVerilator
sawatzke sawatzke
sc sc
scalared scalared
sccache
sccanf sccanf
seg seg
setuphold setuphold
@@ -985,7 +856,6 @@ stdin
stdout stdout
stime stime
stmts stmts
str
strcasecmp strcasecmp
stringification stringification
stringified stringified
@@ -999,20 +869,13 @@ submakes
submodule submodule
submodules submodules
substring substring
superclass
suspendable
suspendables
sv sv
svBitVal svBitVal
svBitVecVal svBitVecVal
svGet svGet
svGetTime
svGetTimePrecision
svLogicVal svLogicVal
svdpi svdpi
svgGetTimeUnit
swrite swrite
synthesizeable
sys sys
systemc systemc
tenghtt tenghtt
@@ -1031,13 +894,10 @@ toolchain
topcell topcell
toplevel toplevel
toupper toupper
traceCapable
traceEverOn traceEverOn
tran tran
treei treei
tri tri
triand
trior
tristate tristate
tristates tristates
trunc trunc
@@ -1070,10 +930,8 @@ unsup
untyped untyped
urandom urandom
uselib uselib
utimes
uwire uwire
uwires uwires
valgrind
vc vc
vcd vcd
vcddiff vcddiff
@@ -1096,24 +954,19 @@ vlt
vltstd vltstd
vluint vluint
vpi vpi
vpiConstType
vpiDefName vpiDefName
vpiInertialDelay
vpiInstance
vpiLeftRange vpiLeftRange
vpiModule vpiModule
vpiSize vpiSize
vpiSuppressVal vpiSuppressVal
vpiTimeUnit vpiTimeUnit
vpiType vpiType
vpiUndefined
vpm vpm
vpp vpp
warmup warmup
waveforms waveforms
whitespace whitespace
widthed widthed
wor
wreal wreal
writeb writeb
writeme writeme
@@ -1131,5 +984,3 @@ ypq
yurivict yurivict
zdave zdave
Øyvind Øyvind
Алексеевич
Исаак
+1 -1
View File
@@ -70,7 +70,7 @@ The XML document consists of 4 sections within the top level
Distribution Distribution
============ ============
Copyright 2020-2025 by Wilson Snyder. Verilator is free software; you can Copyright 2020-2023 by Wilson Snyder. Verilator is free software; you can
redistribute it and/or modify it under the terms of either the GNU Lesser 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. General Public License Version 3 or the Perl Artistic License Version 2.0.
+3 -8
View File
@@ -24,19 +24,14 @@ cmake_policy(SET CMP0074 NEW)
project(cmake_hello_c) project(cmake_hello_c)
find_package(verilator HINTS $ENV{VERILATOR_ROOT} ${VERILATOR_ROOT}) find_package(verilator HINTS $ENV{VERILATOR_ROOT} ${VERILATOR_ROOT})
if(NOT verilator_FOUND) if (NOT verilator_FOUND)
message( message(FATAL_ERROR "Verilator was not found. Either install it, or set the VERILATOR_ROOT environment variable")
FATAL_ERROR
"Verilator was not found. Either install it, or set the VERILATOR_ROOT environment variable"
)
endif() endif()
# Create a new executable target that will contain all your sources # Create a new executable target that will contain all your sources
add_executable(example ../make_hello_c/sim_main.cpp) add_executable(example ../make_hello_c/sim_main.cpp)
target_compile_features(example PUBLIC cxx_std_14)
# Add the Verilated circuit to the target # Add the Verilated circuit to the target
verilate(example verilate(example
INCLUDE_DIRS "../make_hello_c" INCLUDE_DIRS "../make_hello_c"
SOURCES ../make_hello_c/top.v SOURCES ../make_hello_c/top.v)
)
+1 -1
View File
@@ -31,7 +31,7 @@ endif
ifeq ($(shell which cmake),) ifeq ($(shell which cmake),)
TARGET := nocmake TARGET := nocmake
else else
CMAKE_VERSION := $(shell cmake --version | grep -o '[0-9][.0-9]\+') CMAKE_VERSION := $(shell cmake --version | grep -Po '(\d[\.\d]+)')
CMAKE_MAJOR := $(shell echo $(CMAKE_VERSION) | cut -f1 -d.) CMAKE_MAJOR := $(shell echo $(CMAKE_VERSION) | cut -f1 -d.)
CMAKE_MINOR := $(shell echo $(CMAKE_VERSION) | cut -f2 -d.) CMAKE_MINOR := $(shell echo $(CMAKE_VERSION) | cut -f2 -d.)
CMAKE_GT_3_8 := $(shell [ $(CMAKE_MAJOR) -gt 3 -o \( $(CMAKE_MAJOR) -eq 3 -a $(CMAKE_MINOR) -ge 8 \) ] && echo true) CMAKE_GT_3_8 := $(shell [ $(CMAKE_MAJOR) -gt 3 -o \( $(CMAKE_MAJOR) -eq 3 -a $(CMAKE_MINOR) -ge 8 \) ] && echo true)
+7 -9
View File
@@ -24,11 +24,8 @@ cmake_policy(SET CMP0074 NEW)
project(cmake_hello_sc CXX) project(cmake_hello_sc CXX)
find_package(verilator HINTS $ENV{VERILATOR_ROOT} ${VERILATOR_ROOT}) find_package(verilator HINTS $ENV{VERILATOR_ROOT} ${VERILATOR_ROOT})
if(NOT verilator_FOUND) if (NOT verilator_FOUND)
message( message(FATAL_ERROR "Verilator was not found. Either install it, or set the VERILATOR_ROOT environment variable")
FATAL_ERROR
"Verilator was not found. Either install it, or set the VERILATOR_ROOT environment variable"
)
endif() endif()
# SystemC dependencies # SystemC dependencies
@@ -40,14 +37,15 @@ find_package(SystemCLanguage QUIET)
# Create a new executable target that will contain all your sources # Create a new executable target that will contain all your sources
add_executable(example ../make_hello_sc/sc_main.cpp) add_executable(example ../make_hello_sc/sc_main.cpp)
target_compile_features(example PUBLIC cxx_std_14)
set_property(TARGET example PROPERTY CXX_STANDARD ${SystemC_CXX_STANDARD}) set_property(
TARGET example
PROPERTY CXX_STANDARD ${SystemC_CXX_STANDARD}
)
# Add the Verilated circuit to the target # Add the Verilated circuit to the target
verilate(example SYSTEMC verilate(example SYSTEMC
INCLUDE_DIRS "../make_hello_sc" INCLUDE_DIRS "../make_hello_sc"
SOURCES ../make_hello_sc/top.v SOURCES ../make_hello_sc/top.v)
)
verilator_link_systemc(example) verilator_link_systemc(example)
+1 -1
View File
@@ -31,7 +31,7 @@ endif
ifeq ($(shell which cmake),) ifeq ($(shell which cmake),)
TARGET := nocmake TARGET := nocmake
else else
CMAKE_VERSION := $(shell cmake --version | grep -o '[0-9][.0-9]\+') CMAKE_VERSION := $(shell cmake --version | grep -Po '(\d[\.\d]+)')
CMAKE_MAJOR := $(shell echo $(CMAKE_VERSION) | cut -f1 -d.) CMAKE_MAJOR := $(shell echo $(CMAKE_VERSION) | cut -f1 -d.)
CMAKE_MINOR := $(shell echo $(CMAKE_VERSION) | cut -f2 -d.) CMAKE_MINOR := $(shell echo $(CMAKE_VERSION) | cut -f2 -d.)
CMAKE_GT_3_8 := $(shell [ $(CMAKE_MAJOR) -gt 3 -o \( $(CMAKE_MAJOR) -eq 3 -a $(CMAKE_MINOR) -ge 8 \) ] && echo true) CMAKE_GT_3_8 := $(shell [ $(CMAKE_MAJOR) -gt 3 -o \( $(CMAKE_MAJOR) -eq 3 -a $(CMAKE_MINOR) -ge 8 \) ] && echo true)
+4 -12
View File
@@ -24,21 +24,15 @@ cmake_policy(SET CMP0074 NEW)
project(cmake_protect_lib) project(cmake_protect_lib)
find_package(verilator HINTS $ENV{VERILATOR_ROOT} ${VERILATOR_ROOT}) find_package(verilator HINTS $ENV{VERILATOR_ROOT} ${VERILATOR_ROOT})
if(NOT verilator_FOUND) if (NOT verilator_FOUND)
message( message(FATAL_ERROR "Verilator was not found. Either install it, or set the VERILATOR_ROOT environment variable")
FATAL_ERROR
"Verilator was not found. Either install it, or set the VERILATOR_ROOT environment variable"
)
endif() endif()
# Create the main executable target # Create the main executable target
add_executable(example ../make_protect_lib/sim_main.cpp) add_executable(example ../make_protect_lib/sim_main.cpp)
target_compile_features(example PUBLIC cxx_std_14)
# Create a secret library # Create a secret library
add_library(verilated_secret STATIC) # or SHARED for a shared library add_library(verilated_secret STATIC) # or SHARED for a shared library
target_compile_features(verilated_secret PUBLIC cxx_std_14)
target_link_libraries(example PRIVATE verilated_secret) target_link_libraries(example PRIVATE verilated_secret)
# To create both libraries on CMake >= 3.12 replace the above 2 lines with the following: # To create both libraries on CMake >= 3.12 replace the above 2 lines with the following:
# add_library(verilated_secret OBJECT) # add_library(verilated_secret OBJECT)
@@ -58,11 +52,9 @@ verilate(verilated_secret
VERILATOR_ARGS --protect-lib verilated_secret VERILATOR_ARGS --protect-lib verilated_secret
--protect-key ${PROTECT_KEY} --protect-key ${PROTECT_KEY}
DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/verilated_secret DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/verilated_secret
SOURCES ../make_protect_lib/secret_impl.v SOURCES ../make_protect_lib/secret_impl.v)
)
# Include location of verilated_secret.sv wrapper # Include location of verilated_secret.sv wrapper
verilate(example verilate(example
VERILATOR_ARGS "-I${CMAKE_CURRENT_BINARY_DIR}/verilated_secret" VERILATOR_ARGS "-I${CMAKE_CURRENT_BINARY_DIR}/verilated_secret"
SOURCES ../make_protect_lib/top.v SOURCES ../make_protect_lib/top.v)
)
+1 -1
View File
@@ -31,7 +31,7 @@ endif
ifeq ($(shell which cmake),) ifeq ($(shell which cmake),)
TARGET := nocmake TARGET := nocmake
else else
CMAKE_VERSION := $(shell cmake --version | grep -o '[0-9][.0-9]\+') CMAKE_VERSION := $(shell cmake --version | grep -Po '(\d[\.\d]+)')
CMAKE_MAJOR := $(shell echo $(CMAKE_VERSION) | cut -f1 -d.) CMAKE_MAJOR := $(shell echo $(CMAKE_VERSION) | cut -f1 -d.)
CMAKE_MINOR := $(shell echo $(CMAKE_VERSION) | cut -f2 -d.) CMAKE_MINOR := $(shell echo $(CMAKE_VERSION) | cut -f2 -d.)
CMAKE_GT_3_8 := $(shell [ $(CMAKE_MAJOR) -gt 3 -o \( $(CMAKE_MAJOR) -eq 3 -a $(CMAKE_MINOR) -ge 8 \) ] && echo true) CMAKE_GT_3_8 := $(shell [ $(CMAKE_MAJOR) -gt 3 -o \( $(CMAKE_MAJOR) -eq 3 -a $(CMAKE_MINOR) -ge 8 \) ] && echo true)
+3 -8
View File
@@ -24,20 +24,15 @@ cmake_policy(SET CMP0074 NEW)
project(cmake_tracing_c) project(cmake_tracing_c)
find_package(verilator HINTS $ENV{VERILATOR_ROOT} ${VERILATOR_ROOT}) find_package(verilator HINTS $ENV{VERILATOR_ROOT} ${VERILATOR_ROOT})
if(NOT verilator_FOUND) if (NOT verilator_FOUND)
message( message(FATAL_ERROR "Verilator was not found. Either install it, or set the VERILATOR_ROOT environment variable")
FATAL_ERROR
"Verilator was not found. Either install it, or set the VERILATOR_ROOT environment variable"
)
endif() endif()
# Create a new executable target that will contain all your sources # Create a new executable target that will contain all your sources
add_executable(example ../make_tracing_c/sim_main.cpp) add_executable(example ../make_tracing_c/sim_main.cpp)
target_compile_features(example PUBLIC cxx_std_14)
# Add the Verilated circuit to the target # Add the Verilated circuit to the target
verilate(example COVERAGE TRACE verilate(example COVERAGE TRACE
INCLUDE_DIRS "../make_tracing_c" INCLUDE_DIRS "../make_tracing_c"
VERILATOR_ARGS -f ../make_tracing_c/input.vc -x-assign fast VERILATOR_ARGS -f ../make_tracing_c/input.vc -x-assign fast
SOURCES ../make_tracing_c/top.v SOURCES ../make_tracing_c/top.v)
)
+1 -1
View File
@@ -31,7 +31,7 @@ endif
ifeq ($(shell which cmake),) ifeq ($(shell which cmake),)
TARGET := nocmake TARGET := nocmake
else else
CMAKE_VERSION := $(shell cmake --version | grep -o '[0-9][.0-9]\+') CMAKE_VERSION := $(shell cmake --version | grep -Po '(\d[\.\d]+)')
CMAKE_MAJOR := $(shell echo $(CMAKE_VERSION) | cut -f1 -d.) CMAKE_MAJOR := $(shell echo $(CMAKE_VERSION) | cut -f1 -d.)
CMAKE_MINOR := $(shell echo $(CMAKE_VERSION) | cut -f2 -d.) CMAKE_MINOR := $(shell echo $(CMAKE_VERSION) | cut -f2 -d.)
CMAKE_GT_3_8 := $(shell [ $(CMAKE_MAJOR) -gt 3 -o \( $(CMAKE_MAJOR) -eq 3 -a $(CMAKE_MINOR) -ge 8 \) ] && echo true) CMAKE_GT_3_8 := $(shell [ $(CMAKE_MAJOR) -gt 3 -o \( $(CMAKE_MAJOR) -eq 3 -a $(CMAKE_MINOR) -ge 8 \) ] && echo true)
+7 -9
View File
@@ -25,11 +25,8 @@ cmake_policy(SET CMP0074 NEW)
project(cmake_tracing_sc_example CXX) project(cmake_tracing_sc_example CXX)
find_package(verilator HINTS $ENV{VERILATOR_ROOT} ${VERILATOR_ROOT}) find_package(verilator HINTS $ENV{VERILATOR_ROOT} ${VERILATOR_ROOT})
if(NOT verilator_FOUND) if (NOT verilator_FOUND)
message( message(FATAL_ERROR "Verilator was not found. Either install it, or set the VERILATOR_ROOT environment variable")
FATAL_ERROR
"Verilator was not found. Either install it, or set the VERILATOR_ROOT environment variable"
)
endif() endif()
# SystemC dependencies # SystemC dependencies
@@ -41,15 +38,16 @@ find_package(SystemCLanguage QUIET)
# Create a new executable target that will contain all your sources # Create a new executable target that will contain all your sources
add_executable(example ../make_tracing_sc/sc_main.cpp) add_executable(example ../make_tracing_sc/sc_main.cpp)
target_compile_features(example PUBLIC cxx_std_14)
set_property(TARGET example PROPERTY CXX_STANDARD ${SystemC_CXX_STANDARD}) set_property(
TARGET example
PROPERTY CXX_STANDARD ${SystemC_CXX_STANDARD}
)
# Add the Verilated circuit to the target # Add the Verilated circuit to the target
verilate(example SYSTEMC COVERAGE TRACE verilate(example SYSTEMC COVERAGE TRACE
INCLUDE_DIRS "../make_tracing_sc" INCLUDE_DIRS "../make_tracing_sc"
VERILATOR_ARGS -f ../make_tracing_sc/input.vc -x-assign fast VERILATOR_ARGS -f ../make_tracing_sc/input.vc -x-assign fast
SOURCES ../make_tracing_sc/top.v SOURCES ../make_tracing_sc/top.v)
)
verilator_link_systemc(example) verilator_link_systemc(example)
+1 -1
View File
@@ -31,7 +31,7 @@ endif
ifeq ($(shell which cmake),) ifeq ($(shell which cmake),)
TARGET := nocmake TARGET := nocmake
else else
CMAKE_VERSION := $(shell cmake --version | grep -o '[0-9][.0-9]\+') CMAKE_VERSION := $(shell cmake --version | grep -Po '(\d[\.\d]+)')
CMAKE_MAJOR := $(shell echo $(CMAKE_VERSION) | cut -f1 -d.) CMAKE_MAJOR := $(shell echo $(CMAKE_VERSION) | cut -f1 -d.)
CMAKE_MINOR := $(shell echo $(CMAKE_VERSION) | cut -f2 -d.) CMAKE_MINOR := $(shell echo $(CMAKE_VERSION) | cut -f2 -d.)
CMAKE_GT_3_8 := $(shell [ $(CMAKE_MAJOR) -gt 3 -o \( $(CMAKE_MAJOR) -eq 3 -a $(CMAKE_MINOR) -ge 8 \) ] && echo true) CMAKE_GT_3_8 := $(shell [ $(CMAKE_MAJOR) -gt 3 -o \( $(CMAKE_MAJOR) -eq 3 -a $(CMAKE_MINOR) -ge 8 \) ] && echo true)
-116
View File
@@ -1,116 +0,0 @@
#!/usr/bin/env python3
# -*- Python -*- See copyright, etc below
# pylint: disable=C0103,C0114,C0115,C0209,R0903
######################################################################
import argparse
import json
import os
import re
import subprocess
from shutil import copy2
from tempfile import NamedTemporaryFile
# from pprint import pprint, pformat
#######################################################################
class VlFileCopy:
def __init__(
self,
verilator_args, # presently all verilator options are passed-thru
debug=0,
output_dir='copied'): # directory name we output file uses
self.debug = debug
with NamedTemporaryFile() as tree_temp, NamedTemporaryFile() as meta_temp:
vargs = [
'--json-only-output',
tree_temp.name,
'--json-only-meta-output',
meta_temp.name,
'--bbox-sys', # Parse some stuff can't translate
'--bbox-unsup',
'--prefix vljson'
]
vargs += verilator_args
self.run_verilator(vargs)
self.tree = json.load(tree_temp)
self.meta = json.load(meta_temp)
os.makedirs(output_dir, 0o777, True)
for file_id in self.meta['files']:
path = self.meta['files'][file_id]['realpath']
if not re.match('^<', path): # e.g. <built-in>
if self.debug:
print("\tcp %s %s" % (path, output_dir))
copy2(path, output_dir)
def run_verilator(self, vargs):
"""Run Verilator command, check errors"""
if os.getenv("VERILATOR_ROOT"):
command = os.getenv("VERILATOR_ROOT") + "/bin/verilator"
else:
command = "verilator"
command += ' ' + ' '.join(vargs)
if self.debug:
print("\t%s " % command)
status = subprocess.call(command, shell=True)
if status != 0:
raise RuntimeError("Command failed running Verilator with '" + command + "', stopped")
#######################################################################
if __name__ == '__main__':
parser = argparse.ArgumentParser(
allow_abbrev=False,
formatter_class=argparse.RawTextHelpFormatter,
description="""Example of using Verilator JSON output to copy a list of files to an
output directory (-odir, defaults to 'copied'), e.g. to easily create a
tarball of the design to pass to others.
Example usage:
vl_file_copy -f input.vc top.v -odir mycopy
# This will make at least mycopy/top.v
""",
epilog="""All other arguments are pass-thru to Verilator: e.g.:
+define+<var>=<value> Set preprocessor define
-F <file> Parse options from a file, relatively
-f <file> Parse options from a file
-G<name>=<value> Overwrite toplevel parameter
+incdir+<dir> Directory to search for includes
+libext+<ext>+[ext]... Extensions for finding modules
-v <filename> Verilog library
-y <dir> Directory to search for modules
This file ONLY is placed under the Creative Commons Public Domain, for
any use, without warranty, 2019 by Wilson Snyder.
SPDX-License-Identifier: CC0-1.0
""")
parser.add_argument('-debug', '--debug', action='store_const', const=9, help='enable debug')
parser.add_argument('-odir',
'--odir',
action='store',
metavar='directory',
required=True,
help='target output directory')
(args, rem) = parser.parse_known_args()
print("NOTE: vl_file_copy is only an example starting point for writing your own tool.")
# That is:
# 1. We will accept basic patches
# 2. We are not expecting to make this globally useful. (e.g. we don't cleanup obj_dir)
# 3. "make install" will not install this.
# 4. This has not had production-worthy validation.
fc = VlFileCopy(output_dir=args.odir, debug=args.debug, verilator_args=rem)
######################################################################
# Local Variables:
# compile-command: "./vl_file_copy -h ; VERILATOR_ROOT=$V4 ./vl_file_copy +define+thru top.v"
# End:
-153
View File
@@ -1,153 +0,0 @@
#!/usr/bin/env python3
# -*- Python -*- See copyright, etc below
# pylint: disable=C0103,C0114,C0115,C0115,C0116,C0209,R0914
######################################################################
import argparse
import json
import os
import subprocess
from tempfile import NamedTemporaryFile
# from pprint import pprint, pformat
#######################################################################
class VlHierGraph:
def __init__(
self,
verilator_args, # presently all verilator options are passed-thru
debug=0,
output_filename='graph.dot'): # output filename
self.debug = debug
self.next_vertex_number = 0
self.addr_to_number = {}
with NamedTemporaryFile() as tree_temp, NamedTemporaryFile() as meta_temp:
vargs = [
'--json-only-output',
tree_temp.name,
'--json-only-meta-output',
meta_temp.name,
'--bbox-sys', # Parse some stuff can't translate
'--bbox-unsup',
'--prefix vljson'
]
vargs += verilator_args
self.run_verilator(vargs)
self.tree = json.load(tree_temp)
self.meta = json.load(meta_temp)
with open(output_filename, "w", encoding="utf8") as fh:
# For more serious purposes, use the python graphviz package instead
fh.write("digraph {\n")
fh.write(" dpi=300;\n")
fh.write(" order=LR;\n")
fh.write(" node [fontsize=8 shape=\"box\" margin=0.01 width=0 height=0]")
fh.write(" edge [fontsize=6]")
# Find cells
modules = self.flatten(self.tree, lambda n: n['type'] == "MODULE")
top_module = True
for mod in modules:
# origNames are before parameterization, name if after
mod_number = self.addr_to_vertex_number(mod['addr'])
fh.write(" n%d [label=\"%s\"" % (mod_number, mod['name']))
if top_module:
fh.write(" color=\"red\" rank=1")
top_module = False
fh.write("];\n")
cells = self.flatten(mod, lambda n: n['type'] == "CELL")
for cell in cells:
def_number = self.addr_to_vertex_number(cell['modp'])
fh.write(" n%d->n%d [label=\"%s\"];\n" %
(mod_number, def_number, cell['name']))
fh.write("}\n")
def flatten(self, node, accept_cb=lambda n: True):
"""Flatten tree to list using DFS.
accept_cb(node) should return True for nodes you want to save"""
arr = []
self.dfs(node, lambda n: accept_cb(n) and arr.append(n))
return arr
def dfs(self, node, node_cb):
"""Traverse given tree using DFS and apply node_cb(node) on each one"""
node_cb(node)
for _, v in node.items():
if isinstance(v, list): # childlist
for child in v:
self.dfs(child, node_cb)
def addr_to_vertex_number(self, name):
if name not in self.addr_to_number:
self.next_vertex_number += 1
self.addr_to_number[name] = self.next_vertex_number
return self.addr_to_number[name]
def run_verilator(self, vargs):
"""Run Verilator command, check errors"""
if os.getenv("VERILATOR_ROOT"):
command = os.getenv("VERILATOR_ROOT") + "/bin/verilator"
else:
command = "verilator"
command += ' ' + ' '.join(vargs)
if self.debug:
print("\t%s " % command)
status = subprocess.call(command, shell=True)
if status != 0:
raise RuntimeError("Command failed running Verilator with '" + command + "', stopped")
#######################################################################
if __name__ == '__main__':
parser = argparse.ArgumentParser(
allow_abbrev=False,
formatter_class=argparse.RawTextHelpFormatter,
description="""Example of using Verilator JSON output to create a .dot file showing the
design module hierarchy.
Example usage:
vl_hier_graph -f input.vc top.v -o graph.dot
dot -Tpdf -o graph.pdf graph.dot
""",
epilog="""All other arguments are pass-thru to Verilator: e.g.:
+define+<var>=<value> Set preprocessor define
-F <file> Parse options from a file, relatively
-f <file> Parse options from a file
-G<name>=<value> Overwrite toplevel parameter
+incdir+<dir> Directory to search for includes
+libext+<ext>+[ext]... Extensions for finding modules
-v <filename> Verilog library
-y <dir> Directory to search for modules
This file ONLY is placed under the Creative Commons Public Domain, for
any use, without warranty, 2019 by Wilson Snyder.
SPDX-License-Identifier: CC0-1.0
""")
parser.add_argument('-debug', '--debug', action='store_const', const=9, help='enable debug')
parser.add_argument('-o',
'--o',
action='store',
metavar='filename',
required=True,
help='output filename')
(args, rem) = parser.parse_known_args()
print("NOTE: vl_hier_graph is only an example starting point for writing your own tool.")
# That is:
# 1. We will accept basic patches
# 2. We are not expecting to make this globally useful. (e.g. we don't cleanup obj_dir)
# 3. "make install" will not install this.
# 4. This has not had production-worthy validation.
fc = VlHierGraph(output_filename=args.o, debug=args.debug, verilator_args=rem)
######################################################################
# Local Variables:
# compile-command: "./vl_hier_graph -h ; VERILATOR_ROOT=$V4 ./vl_hier_graph +define+thru top.v"
# End:
+2 -2
View File
@@ -19,14 +19,14 @@ int main(int argc, char** argv) {
// e.g. examples/c_tracing. // e.g. examples/c_tracing.
// Construct a VerilatedContext to hold simulation time, etc. // Construct a VerilatedContext to hold simulation time, etc.
VerilatedContext* const contextp = new VerilatedContext; VerilatedContext* contextp = new VerilatedContext;
// Pass arguments so Verilated code can see them, e.g. $value$plusargs // Pass arguments so Verilated code can see them, e.g. $value$plusargs
// This needs to be called before you create any model // This needs to be called before you create any model
contextp->commandArgs(argc, argv); contextp->commandArgs(argc, argv);
// Construct the Verilated model, from Vtop.h generated from Verilating "top.v" // Construct the Verilated model, from Vtop.h generated from Verilating "top.v"
Vtop* const top = new Vtop{contextp}; Vtop* top = new Vtop{contextp};
// Simulate until $finish // Simulate until $finish
while (!contextp->gotFinish()) { while (!contextp->gotFinish()) {
+1 -1
View File
@@ -25,7 +25,7 @@ int sc_main(int argc, char* argv[]) {
// e.g. examples/c_tracing. // e.g. examples/c_tracing.
// Construct the Verilated model, from Vtop.h generated from Verilating "top.v" // Construct the Verilated model, from Vtop.h generated from Verilating "top.v"
Vtop* const top = new Vtop{"top"}; Vtop* top = new Vtop{"top"};
// Pass arguments so Verilated code can see them, e.g. $value$plusargs // Pass arguments so Verilated code can see them, e.g. $value$plusargs
// This needs to be called before you create any model // This needs to be called before you create any model
+10 -5
View File
@@ -17,17 +17,16 @@
#endif #endif
int main(int argc, char** argv) { int main(int argc, char** argv) {
(void)argc; if (false && argc && argv) {}
(void)argv;
// Construct context to hold simulation time, etc // Construct context to hold simulation time, etc
const std::unique_ptr<VerilatedContext> contextp{new VerilatedContext}; VerilatedContext* contextp = new VerilatedContext;
contextp->debug(0); contextp->debug(0);
contextp->randReset(2); contextp->randReset(2);
contextp->commandArgs(argc, argv); contextp->commandArgs(argc, argv);
// Construct the Verilated model, including the secret module // Construct the Verilated model, including the secret module
const std::unique_ptr<Vtop> top{new Vtop{contextp.get(), "TOP"}}; Vtop* top = new Vtop{contextp};
#if VM_TRACE #if VM_TRACE
// When tracing, the contents of the secret module will not be seen // When tracing, the contents of the secret module will not be seen
@@ -47,12 +46,12 @@ int main(int argc, char** argv) {
// Simulate until $finish // Simulate until $finish
while (!contextp->gotFinish()) { while (!contextp->gotFinish()) {
contextp->timeInc(1);
top->clk = ~top->clk & 0x1; top->clk = ~top->clk & 0x1;
top->eval(); top->eval();
#if VM_TRACE #if VM_TRACE
if (tfp) tfp->dump(contextp->time()); if (tfp) tfp->dump(contextp->time());
#endif #endif
contextp->timeInc(1);
} }
// Final model cleanup // Final model cleanup
@@ -66,6 +65,12 @@ int main(int argc, char** argv) {
} }
#endif #endif
// Destroy model
delete top;
top = nullptr;
delete contextp;
contextp = nullptr;
// Return good completion status // Return good completion status
// Don't use exit() or destructor won't get called // Don't use exit() or destructor won't get called
return 0; return 0;
+3 -3
View File
@@ -20,6 +20,9 @@ double sc_time_stamp() { return 0; }
int main(int argc, char** argv) { int main(int argc, char** argv) {
// This is a more complicated example, please also see the simpler examples/make_hello_c. // This is a more complicated example, please also see the simpler examples/make_hello_c.
// Prevent unused variable warnings
if (false && argc && argv) {}
// Create logs/ directory in case we have traces to put under it // Create logs/ directory in case we have traces to put under it
Verilated::mkdir("logs"); Verilated::mkdir("logs");
@@ -117,9 +120,6 @@ int main(int argc, char** argv) {
contextp->coveragep()->write("logs/coverage.dat"); contextp->coveragep()->write("logs/coverage.dat");
#endif #endif
// Final simulation summary
contextp->statsPrintSummary();
// Return good completion status // Return good completion status
// Don't use exit() or destructor won't get called // Don't use exit() or destructor won't get called
return 0; return 0;

Some files were not shown because too many files have changed in this diff Show More