Verilator 用户指南

概述

欢迎使用 Verilator!

Verilator 软件包将 Verilog [1] 和 SystemVerilog [2] 硬件描述语言(HDL) 设计转换为一个 C++ 或 SystemC 模型,该模型在编译后可以被执行。Verilator 不是传统的仿真器,而是一个编译器。

Verilator 通常按如下方式使用:

1. 调用 verilator 可执行文件,其参数类似于 GCC 或其他仿真器 (如 Cadence Verilog-XL/NC-Verilog 或 Synopsys VCS)所使用的参数。 Verilator 读取指定的 SystemVerilog 代码,对其进行 lint,可选地添加覆盖率 和波形跟踪支持,并将设计编译为源码级别的多线程 C++ 或 SystemC "模型"。 所得模型的 C++ 或 SystemC 代码会输出为 .cpp 和 .h 文件。这被称为 "Verilating",该过程即 "to Verilate";其输出是一个 "Verilated" 模型。

2. 对于仿真,需要一个用户编写的小型 C++ 包装文件,即 "wrapper"。该包装 文件定义 C++ 标准函数 "main()",它把 Verilated 模型实例化为一个 C++/ SystemC 对象。

3. 然后,使用 C++ 编译器编译用户 C++ 包装文件、Verilator 创建的文件、 Verilator 提供的 "运行时库",以及(如果适用)SystemC 库,以创建仿真可 执行文件。

  1. 所得的可执行文件将在 "仿真运行时" 期间执行实际的仿真。

5. 如果适当启用,该可执行文件还可以生成可查看的设计波形跟踪。它也可以 创建覆盖率分析数据以供事后分析。

最好的入门方式是尝试 示例。

示例

本节涵盖以下示例:

示例:创建二进制可执行文件

我们将把这个 SystemVerilog 示例编译为一个 Verilated 仿真二进制文件。关于 下一层细节的示例,见 示例:C++ 执行。

首先你需要安装 Verilator,见 安装。简而言之,如果你使用操作 系统的包管理器安装了 Verilator,或者执行了 make install 将 Verilator 放入默认路径,则你的环境无需任何特殊设置,且不应设置 VERILATOR_ROOT。然而,如果你从源码安装 Verilator,并希望从编译 Verilator 的 位置运行它,则需要指向该套件:

# See above; don't do this if using an OS-distributed Verilator
export VERILATOR_ROOT=/path/to/where/verilator/was/installed
export PATH=$VERILATOR_ROOT/bin:$PATH

现在,我们来创建一个示例 Verilog 文件:

mkdir test_our
cd test_our

cat >our.v <<'EOF'
  module our;
     initial begin $display("Hello World"); $finish; end
  endmodule
EOF

现在我们对这个小示例运行 Verilator。

verilator --binary -j 0 -Wall our.v

分解这条命令:

  1. --binary 告诉 Verilator 完成创建仿真可执行文件所需的一切。

  2. -j 0 表示使用机器拥有的尽可能多的 CPU 线程进行 Verilate。

  3. -Wall 让 Verilator 启用更严格的 lint 警告。

  4. 最后,our.v 是我们的 SystemVerilog 设计文件。

现在我们运行它:

obj_dir/Vour

得到输出:

Hello World
- our.v:2: Verilog $finish

最好使用 Makefile 来为你运行这些步骤,这样当源码变化时,它会自动运行所有 适当的步骤。为此,Verilator 可以创建 makefile 依赖文件。有关这样做的示例, 见发行版中的 examples 目录。

示例:C++ 执行

我们将把这个示例编译为 C++。关于这段 C++ 代码所做的更详细且带注释的版本, 见发行版中的 examples/make_tracing_c/sim_main.cpp。

首先你需要安装 Verilator,见 安装。简而言之,如果你使用操作 系统的包管理器安装了 Verilator,或者执行了 make install 将 Verilator 放入默认路径,则你的环境无需任何特殊设置,且不应设置 VERILATOR_ROOT。然而,如果你从源码安装 Verilator,并希望从编译 Verilator 的 位置运行它,则需要指向该套件:

# See above; don't do this if using an OS-distributed Verilator
export VERILATOR_ROOT=/path/to/where/verilator/was/installed
export PATH=$VERILATOR_ROOT/bin:$PATH

现在,我们来创建一个示例 Verilog 文件和 C++ 包装文件:

mkdir test_our
cd test_our

cat >our.v <<'EOF'
  module our;
     initial begin $display("Hello World"); $finish; end
  endmodule
EOF

cat >sim_main.cpp <<'EOF'
  #include "Vour.h"
  #include "verilated.h"
  int main(int argc, char** argv) {
      VerilatedContext* contextp = new VerilatedContext;
      contextp->commandArgs(argc, argv);
      Vour* top = new Vour{contextp};
      while (!contextp->gotFinish()) { top->eval(); }
      delete top;
      delete contextp;
      return 0;
  }
EOF

现在我们对这个小示例运行 Verilator;

verilator --cc --exe --build -j 0 -Wall sim_main.cpp our.v

分解这条命令:

  1. --cc 用于获得 C++ 输出(相对于 SystemC,或仅进行 lint)。

  2. --exe,连同我们的 sim_main.cpp 包装文件,使构建 生成可执行文件,而不仅仅是库。

  3. --build 使 Verilator 自己调用 make。这样我们就不需要手动将 make 作为单独步骤调用。你也可以编写自己的编译规则,并像我们在 示例:SystemC 执行 中展示的那样自行运行 make。)

  4. -j 0 表示使用机器拥有的尽可能多的 CPU 线程进行 Verilate。

  5. -Wall 让 Verilator 启用更严格的 lint 警告。

  6. 最后,our.v 是我们的 SystemVerilog 设计文件。

Verilator 完成后,我们可以在 obj_dir 目录下看到生成的 C++ 代码。

ls -l obj_dir

(关于所创建的部分文件的说明,见 读取/写入的文件。)

现在我们运行它:

obj_dir/Vour

得到输出:

Hello World
- our.v:2: Verilog $finish

最好使用 Makefile 来为你运行这些步骤,这样当源码变化时,它会自动运行所有 适当的步骤。为此,Verilator 可以创建 makefile 依赖文件。有关这样做的示例, 见发行版中的 examples 目录。

示例:SystemC 执行

这是一个与 示例:C++ 执行 类似的示例,但使用 SystemC。我们 还会显式运行 make。

首先你需要安装 Verilator,见 安装。简而言之,如果你使用操作 系统的包管理器安装了 Verilator,或者执行了 make install 将 Verilator 放入默认路径,则你的环境无需任何特殊设置,且不应设置 VERILATOR_ROOT。然而,如果你从源码安装 Verilator,并希望从编译 Verilator 的 位置运行它,则需要指向该套件:

# See above; don't do this if using an OS-distributed Verilator
export VERILATOR_ROOT=/path/to/where/verilator/was/installed
export PATH=$VERILATOR_ROOT/bin:$PATH

现在,我们来创建一个示例 Verilog 文件和 SystemC 包装文件:

mkdir test_our_sc
cd test_our_sc

cat >our.v <<'EOF'
  module our (clk);
     input clk;  // Clock is required to get initial activation
     always @(posedge clk)
        begin $display("Hello World"); $finish; end
  endmodule
EOF

cat >sc_main.cpp <<'EOF'
  #include "Vour.h"
  using namespace sc_core;
  int sc_main(int argc, char** argv) {
      Verilated::commandArgs(argc, argv);
      sc_clock clk{"clk", 10, SC_NS, 0.5, 3, SC_NS, true};
      Vour* top = new Vour{"top"};
      top->clk(clk);
      while (!Verilated::gotFinish()) { sc_start(1, SC_NS); }
      delete top;
      return 0;
  }
EOF

现在我们对这个小示例运行 Verilator:

verilator --sc --exe -Wall sc_main.cpp our.v

此示例未使用 --build,因此我们需要显式编译它:

make -j -C obj_dir -f Vour.mk Vour

现在我们运行它:

obj_dir/Vour

在 SystemC 横幅之后,我们得到与 C++ 示例相同的输出:

SystemC 2.3.3-Accellera

Hello World
- our.v:4: Verilog $finish

实际上,最好使用 Makefile 来为你运行这些步骤,这样当源码变化时它会自动 运行所有适当的步骤。有关这样做的示例,见发行版中的 examples 目录。

发行版中的示例

见作为发行版一部分并会被安装(位于操作系统特定的位置,通常是例如 /usr/local/share/verilator/examples)的 examples/ 目录。这些示例 包括:

examples/make_hello_binary

使用 GNU-make 的简单 Verilog->二进制 转换示例

examples/make_hello_c

使用 GNU-make 的简单 Verilog->C++ 转换示例

examples/make_hello_sc

使用 GNU-make 的简单 Verilog->SystemC 转换示例

examples/make_tracing_c

使用 GNU-make 的带跟踪 Verilog->C++ 示例

examples/make_tracing_sc

使用 GNU-make 的带跟踪 Verilog->SystemC 示例

examples/make_protect_lib

使用 --protect-lib 的示例

examples/cmake_hello_c

使用 CMake 构建 make_hello_c 的示例

examples/cmake_hello_sc

使用 CMake 构建 make_hello_sc 的示例

examples/cmake_tracing_c

使用 CMake 构建 make_tracing_c 的示例

examples/cmake_tracing_sc

使用 CMake 构建 make_tracing_sc 的示例

examples/cmake_protect_lib

使用 CMake 构建 make_protect_lib 的示例

要运行某个示例,请将该示例复制到一个新目录并运行它。

cp -rp {path_to}/examples/make_hello_c make_hello_c
cd make_hello_c
make

安装

本节讨论如何安装 Verilator。

使用包管理器快速安装

使用发行版的包管理器是最简单的入门方式。(注意发行版包几乎从未包含最新的 Verilator 版本,因此我们建议改为遵循下文的 Git 快速安装。)以包方式 安装:

apt-get install verilator   # On Ubuntu

其他发行版请参阅 Repology Verilator Distro Packages。

Pre-commit 快速安装

你可以使用 Verilator 的 pre-commit 钩子在提交 代码前对其进行 lint。它封装了 Verilator Build Docker Container,因此 你需要系统上装有 docker 才能使用。verilator 镜像会被自动下载。

要使用该钩子,请在你的 .pre-commit-config.yaml 中添加如下条目:

repos:
  - repo: https://github.com/verilator/verilator
    rev: v5.026  # or later
    hooks:
      - id: verilator

Git 快速安装

从 Git 安装 Verilator 提供最大的灵活性;更多选项和细节见下文的 详细构建说明。

简而言之,从 git 安装:

# Prerequisites:
#sudo apt-get install git help2man perl python3 make autoconf g++ flex bison ccache
#sudo apt-get install libgoogle-perftools-dev libjemalloc-dev numactl perl-doc
#sudo apt-get install libfl2  # Ubuntu only (ignore if gives error)
#sudo apt-get install libfl-dev  # Ubuntu only (ignore if gives error)
#sudo apt-get install zlibc zlib1g zlib1g-dev liblz4 liblz4-dev  # Ubuntu only (ignore if gives error)

git clone https://github.com/verilator/verilator   # Only first time

# Every time you need to build:
unsetenv VERILATOR_ROOT  # For csh; ignore error if on bash
unset VERILATOR_ROOT  # For bash
cd verilator
git pull         # Make sure git repository is up-to-date
git tag          # See what versions exist
#git checkout master      # Use development branch (e.g. recent bug fixes)
#git checkout stable      # Use most recent stable release
#git checkout v{version}  # Switch to specified release version

autoconf         # Create ./configure script
./configure      # Configure and create Makefile
make -j `nproc`  # Build Verilator itself (if error, try just 'make')
sudo make install

详细构建说明

本节描述构建过程的细节,并假定你从 Git 构建。若要在你的 Linux 发行版上 使用预构建的二进制文件,请改为参阅 使用包管理器快速安装。

操作系统要求

Verilator 主要在 Ubuntu 上开发和测试,并在 Apple OS-X、FreeBSD 和 Windows MSVC 上进行额外测试。其版本也曾在 Red Hat Linux、其他类 GNU/Linux 平台、适用于 Linux 的 Windows 子系统 (WSL2)、Cygwin 下的 Windows 以及 MinGW 下的 Windows (gcc -mno-cygwin) 上构建。

安装前置依赖

要构建或运行 Verilator,你需要以下标准软件包:

sudo apt-get install git help2man perl python3 make
sudo apt-get install g++  # Alternatively, clang
sudo apt-get install libgz  # Non-Ubuntu (ignore if gives error)
sudo apt-get install libfl2  # Ubuntu only (ignore if gives error)
sudo apt-get install libfl-dev  # Ubuntu only (ignore if gives error)
sudo apt-get install zlibc zlib1g zlib1g-dev liblz4 liblz4-dev  # Ubuntu only (ignore if gives error)

对于 SystemC:

sudo apt-get install libsystemc libsystemc-dev

对于约束(constraints):

sudo apt-get install z3  # Optional solver

以下为可选,但建议安装,以便在运行 Verilator 时获得渲染良好的命令行帮助:

sudo apt-get install perl-doc

要构建或运行 Verilator,以下为可选,但为了良好性能应当安装:

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 libjemalloc-dev numactl

要构建 Verilator,你需要安装以下软件包;运行 Verilator 时无需它们存在:

sudo apt-get install git autoconf flex bison

开发 Verilator 本身还需要以下额外软件包(见 internals.rst)以及一个 Python 虚拟环境:

sudo apt-get install clang clang-format-18 cmake gdb gprof graphviz lcov
sudo apt-get install python3-clang bear jq
cpan install Pod::Perldoc

Python 虚拟环境仅在运行整个测试套件以及执行 lint、格式化等额外开发步骤时 需要。构建 Verilator 本身并不需要它。要自动安装 Python 虚拟环境及所有依赖, 请在 configure 之后运行以下命令一次:

# Install dependencies
sudo apt install python3-pip

# Create Python virutal environment in .venv:
make venv

# Or alternatively, to put it somewhere else:
make venv VENV_PATH=where_you_want_it

然后使用以下命令在 shell 中激活虚拟环境:

source .venv/bin/activate

# Or if installed somewhere else:
source where_you_want_it/bin/activate
安装 SystemC

如果 SystemC 已作为软件包安装(见上文),则可以从 Verilator 生成 SystemC 代码(使用 --sc)。

或者,从其源码下载 SystemC。按照其安装说明 操作。你需要将 SYSTEMC_INCLUDE 环境变量设置为包含 systemc.h 的 include 目录,并将 SYSTEMC_LIBDIR 环境变量设置为包含 libsystemc.a 的目录。

安装 GTKWave

要使用 Verilator 的 FST 跟踪,你会需要安装 GTKwave,不过在 Verilator 构建时并不需要它。

sudo apt-get install gtkwave  # Optional Waveform viewer
安装 Z3

要使用带约束的随机化,必须安装 Z3 Theorem Prover,不过在 Verilator 构建时并不需要它。 还有其他兼容的 SMT 求解器,例如 CVC5/CVC4,但不保证可用。由于不同求解器 在不同场景下速度不同,运行时要使用的求解器可以通过环境变量 VERILATOR_SOLVER 指定。

获取源码

从 git 仓库获取源码:(你只需做这一次。)

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

进入检出目录并确定要使用哪个版本/分支:

cd verilator
git pull        # Make sure we're up-to-date
git tag         # See what versions exist
#git checkout master      # Use development branch (e.g. recent bug fix)
#git checkout stable      # Use most recent release
#git checkout v{version}  # Switch to specified release version

自动配置

创建配置脚本:

autoconf        # Create ./configure script

最终的安装选项

在配置构建之前,你必须决定最终如何将 Verilator 安装到系统中。Verilator 会将环境变量 VERILATOR_ROOT、VERILATOR_SOLVER、 SYSTEMC_INCLUDE 和 SYSTEMC_LIBDIR 的当前值作为默认值 编译进可执行文件,因此它们必须在配置之前就是正确的。

以下是安装选项:

1. 从 VERILATOR_ROOT 就地运行

我们个人最喜欢的方式是始终从 Git 目录就地运行 Verilator(不运行 make install)。这样最容易实验和升级,并允许系统中并存多个 Verilator 版本。

export VERILATOR_ROOT=`pwd`   # if your shell is bash
setenv VERILATOR_ROOT `pwd`   # if your shell is csh
./configure
# Running will use files from $VERILATOR_ROOT, so no install needed

注意在安装后(见 ref:Installation),调用程序或 shell 必须设置环境变量 VERILATOR_ROOT 指向该 Git 目录,然后执行 $VERILATOR_ROOT/bin/verilator,它将找到所有所需文件的路径。

2. 安装到指定前缀

你可能是一位构建 Verilator 软件包的 OS 包维护者,或者你最终要安装到可能 支持每个工具多个版本的项目/公司级 "CAD" 工具磁盘上。告诉 configure 最终 目标目录名。我们建议目标位置包含 Verilator 版本名:

unset VERILATOR_ROOT      # if your shell is bash
unsetenv VERILATOR_ROOT   # if your shell is csh
# For the tarball, use the version number instead of git describe
./configure --prefix /CAD_DISK/verilator/`git describe | sed "s/verilator_//"`

注意在安装后(见 ref:Installation),你需要将 bin 目录的路径添加到 PATH。或者,如果你使用 modulecmd,你会需要一个类似如下的模块文件:

set install_root /CAD_DISK/verilator/{version-number-used-above}
unsetenv VERILATOR_ROOT
prepend-path PATH $install_root/bin
prepend-path MANPATH $install_root/man
prepend-path PKG_CONFIG_PATH $install_root/share/pkgconfig
3. 全局安装到系统

最后一个选项是最终使用 configure 的默认系统路径将 Verilator 全局安装:

unset VERILATOR_ROOT      # if your shell is bash
unsetenv VERILATOR_ROOT   # if your shell is csh
./configure

然后在安装后(见 ref:Installation),二进制文件应位于已在你的 $PATH 环境变量中的位置。

配置

配置该软件包的命令已在上一步描述。开发者应进行配置以获得更完整的开发者 测试。这些测试可能需要额外的软件包。

export VERILATOR_AUTHOR_SITE=1    # Put in your .bashrc
./configure --enable-longtests  ...above options...

编译

编译 Verilator:

make -j `nproc`  # Or if error on `nproc`, the number of CPUs in system

测试

通过运行自测来检查编译:

make test

安装

如果你使用了除 1. Run-in-Place from VERILATOR_ROOT 方案之外的任何安装 选项,请安装这些文件:

make install

Verilator Build Docker Container

This Verilator Build Docker Container is set up to compile and test a Verilator build. It uses the following parameters:

The container is published as verilator/verilator-buildenv on docker hub.

To run the basic build using the current Verilator master:

docker run -ti verilator/verilator-buildenv

To also run tests:

docker run -ti verilator/verilator-buildenv test

To change the compiler use the -e switch to pass environment variables:

docker run -ti -e CXX=clang++-18 verilator/verilator-buildenv test

The tests, that involve numactl are not working due to security restrictions. To run those too, add the CAP_SYS_NICE capability during the start of the container:

docker run -ti --cap-add=CAP_SYS_NICE verilator/verilator-buildenv test

Rather then building using a remote git repository you may prefer to use a working copy on the local filesystem. Mount the local working copy path as a volume and use that in place of git. When doing this be careful to have all changes committed to the local git area. To build the current HEAD from top of a repository:

docker run -ti -v ${PWD}:/tmp/repo -e REPO=/tmp/repo -e REV=`git rev-parse --short HEAD` verilator/verilator-buildenv test

Rebuilding

To rebuild the Verilator-buildenv docker image, run:

docker build .

This will also build SystemC under all supported compiler variants to reduce the SystemC testing time.

Verilator Executable Docker Container

The Verilator Executable Docker Container allows you to run Verilator easily as a docker image, e.g.:

docker run -ti verilator/verilator:latest --version

This will pull the container from Docker Hub, run the latest Verilator and print Verilator's version.

Containers are automatically built and pushed to docker hub for all released versions, so you may easily compare results across versions, e.g.:

docker run -ti verilator/verilator:4.030 --version

Verilator needs to read and write files on the local system. To simplify this process, use the verilator-docker convenience script. This script takes the version number, and all remaining arguments are passed through to Verilator. e.g.:

./verilator-docker 4.030 --version

or

./verilator-docker 4.030 --cc test.v

If you prefer not to use verilator-docker you must give the container access to your files as a volume with appropriate user rights. For example to Verilate test.v:

docker run -ti -v ${PWD}:/work --user $(id -u):$(id -g) verilator/verilator:latest --cc test.v

This method can only access files below the current directory. An alternative is setup the volume -workdir.

You can also work in the container by setting the entrypoint (don't forget to mount a volume if you want your work persistent):

docker run -ti --entrypoint /bin/bash verilator/verilator:latest

You can also use the container to build Verilator at a specific commit:

docker build --build-arg SOURCE_COMMIT=<commit> .

Internals

The Dockerfile builds Verilator and removes the tree when completed to reduce the image size. The entrypoint is a wrapper script (verilator-wrap.sh). That script 1. calls Verilator, and 2. copies the Verilated runtime files to the obj_dir or the -Mdir respectively. This allows the user to have the files to they may later build the C++ output with the matching runtime files. The wrapper also patches the Verilated Makefile accordingly.

A hook is also defined and run by Docker Hub via automated builds.

CMake 安装

本节讨论如何使用 cmake 构建和安装 Verilator。目前 cmake 仅对 Windows 构建(而非 Linux)提供官方支持。

快速安装

  1. 从 https://www.python.org/downloads/ 为你的平台安装 Python。

  2. 从 https://cmake.org/download/ 为你的平台安装 CMake,或从源码构建它。

  3. 如果选择的编译器是 MSVC,则安装 https://visualstudio.microsoft.com/downloads/。如果选择的编译器是 Clang, 则安装 https://releases.llvm.org/download.html 或从源码构建它。

  4. flex 和 bison 请使用 https://github.com/lexxmark/winflexbison 来构建和 安装。

  5. 在 Windows 上使用 MSVC 构建时,将环境变量 WIN_FLEX_BISON 设置为安装 目录。在 Windows/Linux/OS-X 上使用 ninja 构建时,将环境变量 FLEX_INCLUDE 设置为包含 FlexLexer.h 的目录,并确保 flex/bison 在 PATH 中可用。

要获取 Verilator 源码,请下载 https://github.com/verilator/verilator/archive/refs/heads/master.zip,或使用 git 克隆 https://github.com/verilator/verilator,见 获取源码。

使用 MSVC 构建:

cd verilator  # directory containing source files of verilator
mkdir -p build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release --install-prefix $PWD/../install
cmake --build . --config Release
cmake --install . --prefix $PWD/../install

使用 ninja 构建:

cd verilator
mkdir -p build
cd build
cmake -G Ninja .. -DCMAKE_BUILD_TYPE=Release --install-prefix $PWD/../install -DCMAKE_MAKE_PROGRAM=<path to ninja binary> -DBISON_EXECUTABLE=<path to bison> -DFLEX_EXECUTABLE=<path to flex>
<path to ninja binary> #execute ninja
cmake --install . --prefix $PWD/../install

用法

要使用 Verilator,请将环境变量 VERILATOR_ROOT 设置为上述构建中指定的 安装目录。

示例

cd verilator/examples
cd cmake_hello_c
mkdir -p build
cd build
cmake ..  # cmake -G Ninja ..
cmake --build . --config Release # ninja
# execute the generated binary

Verilating

Verilator 可以通过五种主要方式使用:

  • 使用 --binary 选项时,Verilator 通过生成 C++ 并编译它,将设计 转换成一个可执行文件。见 二进制、C++ 与 SystemC 生成。

  • 使用 --cc 或 --sc 选项时,Verilator 分别将设计转换为 C++ 或 SystemC 代码。见 二进制、C++ 与 SystemC 生成。

  • 使用 --lint-only 选项时,Verilator 会对设计进行 lint 以检查 警告,但通常不会创建任何输出文件。

  • 使用 --json-only 选项时,Verilator 会创建 JSON 输出,可用于 馈入其他用户设计的工具。

  • 使用 -E 选项时,Verilator 会按照 IEEE 预处理规则预处理代码, 并将输出写到标准输出。这对于馈入其他工具以及调试 "`define" 语句如何 展开很有用。

二进制、C++ 与 SystemC 生成

Verilator 会使用 --cc 选项将 SystemVerilog 设计转换为 C++,或使用 --sc 选项转换为 SystemC。使用 --binary 选项时,它会转换 为 C++ 并将其编译成可执行二进制文件。

使用这些选项时:

  1. Verilator 读取输入 Verilog 代码并确定所有 "顶层模块",即未被用作其他 单元下实例的模块或程序。如果使用了 --top-module,则由它确定 顶层模块,所有其他顶层模块都会被移除;否则会给出 MULTITOP 警告。

  2. Verilator 将 C++/SystemC 代码写入由 --Mdir 选项指定的目录中的 输出文件,或默认为 "obj_dir"。前缀由 --prefix 设置,或默认为 顶层模块的名称。

  3. 如果使用 --binary 或 --main,Verilator 会创建一个 C++ 顶层包装器,用于读取命令行参数、创建模型并执行模型。

  4. 如果使用 --binary 或 --exe,Verilator 会创建 makefile 以生成仿真可执行文件;否则,它会创建 makefile 以生成包含目标文件的 归档 (.a)。

  5. 如果使用 --binary 或 --build,它会调用 GNU Make 来构建模型。

一旦模型构建完成,下一步通常是用户运行它,见 仿真(Verilated 模型运行时)。

查找与绑定模块

Verilator 提供若干机制来查找包含模块、原语、接口或程序(本节中统称 "module")的源代码,并将它们绑定到实例。这些能力类似于 IEEE 1800-2023 33.5.1 中描述的 "Precompiling in a single-pass" 使用模型。

Verilator 首先读取命令行上和 -f 文件中提供的所有文件,并解析其中 的所有模块。每个模块被分配给用 -work 指定的最近一个库,因此 -work liba a.v -work libb b.v 会将 a.v 中的模块分配给 liba,将 b.v 中的模块分配给 libb。在没有 -work 映射的情况下,每个模块可选地根据 -libmap 提供的映射分配给一个库。

如果某个模块未从命令行上的文件定义,Verilator 会尝试使用 -y 和 +libext 根据模块名构造文件名来查找。

如果提供了 --top 模块,绑定从它开始。如果未提供,Verilator 会 尝试自己推断顶层模块;如果产生多个顶层,会发出 MULTITOP 警告, 该警告可以被抑制(详情见 MULTITOP)。

Verilator 将尝试绑定较低的未解析实例,首先基于 IEEE config 规范,其次 基于使用与父级实例化库相同的库名,最后按模块声明顺序在所有库中全局搜索。 这允许原本冲突的库间重复模块名在每个库名内唯一共存。

层级 Verilation

大型设计可能需要很长时间(例如 10 分钟以上)和巨大内存(例如 100+ GB) 来 Verilate。在层级模式中,用户手动选择一些大型低层层级块,将其与更大的 设计分离。例如,一个 core 可以是从多核 SoC 设计中分离出来的层级块。

在整个 SoC 上以层级模式运行 Verilator。Verilator 会生成两个模型,一个用于 CPU 层级块,一个用于 SoC。SoC 的 Verilated 代码会自动调用 CPU 的 Verilated 模型。

当前的层级 Verilation 基于 --lib-create。每个层级块被 Verilated 成一个库。层级块的用户模块将看到一个由 --lib-create 生成的微小 包装器。

用法

用户需要将一个或多个中等大小的模块标记为层级块。有两种标记模块的方式:

然后向 Verilator 传递 --hierarchical 选项。

编译与不使用层级模式时相同。

make -C obj_dir -f Vtop_module_name.mk

限制

层级块有一些限制,包括:

  • 层级块的内部不能从上层模块或其他层级块使用点 (.) 访问,但层级块实例的 端口可以从直接包围它的嵌套层级块访问,或者如果它不是嵌套层级块,则从 设计顶层的非层级部分访问。

  • 不能在层级块边界使用 Modport。

  • 仿真速度可能不如扁平 Verilation 快,在扁平 Verilation 中所有模块都在 全局调度。

  • 如果生成时钟是在层级模型中生成并传入另一个层级模型或顶层模块,可能 无法正确工作。

  • 层级块中不允许延迟。

但是,支持以下用法:

  • 嵌套层级块。一个层级块可以实例化其他层级块。

  • 参数化层级块。可以使用 #(.param_name(value)) 构造覆盖层级块的参数。

Verilation 与编译重叠

在层级 Verilation 中,Verilator 需要运行 2 + N 次,其中 N 是层级块的 数量。其中一次用于顶层模块,它引用所有其他层级块的包装器。另一次是初始 运行,它搜索带有 /*verilator&32;hier_block*/ 元注释的模块,创建 计划并写入 prefix_hier.mk。此初始运行在内部调用其他 N + 1 次 运行,因此你不必关心这 N + 1 次运行。额外的 N 是对每个层级块的 Verilator 运行。

如果指定了 :-j {jobs} 选项,层级块的 Verilation 会并行运行。

如果指定了 --build 选项,C++ 编译也会在一个层级块 Verilate 完成 后立即运行。C++ 编译和其他层级块的 Verilation 同时运行。

交叉编译

Verilator 支持交叉编译 Verilated 代码。这通常用于在 Linux 系统上运行 Verilator 并生成随后在 Windows 上编译的 C++ 代码。

交叉编译最多涉及三种不同的操作系统。构建系统是你配置和编译 Verilator 的 地方,宿主系统是你运行 Verilator 的地方,目标系统是你编译 Verilated 代码 并运行仿真的地方。

Verilator 要求构建系统和宿主系统类型相同,但目标系统类型可以不同。为此, 在构建系统上 ./configure 并 make Verilator。然后,在宿主系统上 运行 Verilator。最后,Verilator 的输出可以在不同的目标系统上编译。

为支持这一点,Verilator 生成的任何文件都不会引用任何 configure 生成的 特定于构建系统的文件,例如 config.h`(在 Verilator 中重命名为 :file:`config_package.h 以减少混淆)。这种方法的缺点是 include/verilatedos.h 必须自行检测目标系统的需求,而不是使用 configure。

目标系统可能还需要编辑 Makefile,Verilator 生成的简单 Makefile 假定目标 系统与构建系统类型相同。

多线程

Verilator 支持多线程仿真模型。

使用 --threads 1 时,生成的模型是单线程的;但是支持库 是多线程安全的。这允许模型的不同实例各自可能在不同的线程下运行。所有线程 处理都由用户的 C++ 测试平台负责。

使用 :vlopt:`--threads {N} <--threads>`(N 至少为 2)时,生成的模型将被 设计为在 N 个线程上并行运行。调用 eval() 的线程提供其中一个线程,生成的 模型将创建并管理其他 N-1 个线程。客户端有责任不要超额订阅可用的 CPU 核心。 在 CPU 超额订阅的情况下,Verilated 模型不应活锁或死锁;但是,与具有正确 线程和 CPU 核心比例的情况相比,你可以预期性能会差得多。

用于构造模型的线程必须与调用 eval() 进入模型的线程相同;这称为 "eval 线程"。用于执行某些全局操作(如保存和跟踪)的线程必须由 "主线程" 完成。 在大多数情况下,eval 线程和主线程是同一个线程(即用户的顶层 C++ 测试平台 在单个线程上运行),但这不是必需的。

在多线程模型中频繁使用 DPI 导入函数时,根据一些实验调整 --instr-count-dpi 选项可能对性能有益。这通过调整 DPI 导入的假定 执行时间来影响模型的划分。

使用 --trace-vcd 执行 VCD 跟踪时,VCD 跟踪构造使用与 --threads 指定相同数量的线程并行化,并在与模型相同的线程池上 执行。

运行多线程模型时,默认的 Linux 任务调度器常常与模型作对,因为它假定线程 是短命的,因此经常使用同一物理核心内的多个超线程来调度线程。如果尚未设置 亲和性,仅在 Linux 上,Verilator 会尝试以合理的方式设置线程到处理器的 亲和性。

一些较新的 Linux 内核能很好地处理线程分配。在此类系统上运行 Verilator 时,自动线程亲和性可能没有益处,甚至可能降低性能。在这种情况下,可以将 环境变量 VERILATOR_NUMA_STRATEGY 设置为 none 以禁用自动线程 亲和性。更多信息请参阅 环境。

为获得最佳性能,请使用 numactl 程序(在线程数合适时)选择同一 插槽上的唯一物理核心。

例如,如果模型使用 --threads 4 Verilate,我们查询:

egrep 'processor|physical id|core id' /proc/cpuinfo

以选择位于同一插槽 (0) 但具有不同物理核心的核心 0、1、2 和 3。( numactl --hardware 或 lscpu 也很有用,但它们不显示 超线程核心。)然后我们执行:

numactl -m 0 -C 0,1,2,3 -- verilated_executable_name

这会将内存限制到插槽 0,将线程限制到核心 0、1、2、3(假定在插槽 0 上), 从而优化性能。当然,如果你想让另一个仿真器使用例如插槽 1,或者你用不同 数量的线程进行 Verilate,则必须对此进行调整。要查看实际使用了哪些 CPU, 请使用 --prof-exec。

在每插槽有多个 L3 集群的系统上(例如 AMD EPYC 或 Ryzen),考虑使用 lstopo 确定当前系统的 L3 集群拓扑,并使用 numactl 将 CPU 绑定在单个 L3 集群内。这可以通过最小化线程间通信延迟来改善性能。 有时,对于线程数超过每个 L3 集群核心数的模型,在单个 L3 集群内使用 SMT (超线程)可能比仅使用物理核心跨多个 L3 集群分布性能更好。建议进行实验以 找到底层硬件和模型特性的最佳设置。

多线程 Verilog 与库支持

$display/$stop/$finish 会被延迟到 eval() 调用结束时,以保持线程间的顺序。 这可能导致在 $stop 或 $finish 之后还有额外任务完成。

如果使用 --coverage,覆盖率例程是完全线程安全的。

如果使用 DPI,Verilator 假定纯 DPI 导入是线程安全的,以平衡性能与安全性。 见 --threads-dpi。

如果使用 --savable,保存/恢复类不是多线程的,只能由 eval 线程 调用。

如果使用 --sc,SystemC 内核不是线程安全的;因此,eval 线程和主 线程必须相同。

如果使用 --trace-vcd 或其他跟踪选项,跟踪类必须从主线程构造和 调用。

如果使用 --vpi,由于 SystemVerilog VPI 并非由 IEEE 设计为多线程 的,Verilator 要求所有 VPI 调用只从主线程进行。

GNU Make

Verilator 默认创建用于模型的 GNU Make makefile。使用 --build 选项 时,Verilator 会自动调用 make。

如果从 makefile 中调用 Verilator,--MMD 选项会创建一个依赖文件, 使 Make 仅在输入 Verilog 文件变化时才运行 Verilator。

CMake

可以使用 CMake 运行 Verilator,它同时负责运行 Verilator 和编译输出。 examples/ 目录中有一个 CMake 示例。以下是最小的 CMakeLists.txt,它 将构建 示例:C++ 执行 中列出的代码

project(cmake_example)
find_package(verilator HINTS $ENV{VERILATOR_ROOT})
add_executable(Vour sim_main.cpp)
verilate(Vour SOURCES our.v)

find_package 会自动找到已安装的 Verilator 副本,如果设置了 VERILATOR_ROOT 则使用本地构建。

建议使用 CMake >= 3.12 和 Ninja 生成器,尽管其他组合也应该可以工作。要 使用 CMake 构建,切换到包含 CMakeLists.txt 的文件夹并运行:

mkdir build
cd build
cmake -GNinja ..
ninja

或者使用系统默认生成器构建:

mkdir build
cd build
cmake ..
cmake --build .

如果你在构建该示例,应该会有一个可执行文件可以运行:

./Vour

该包将 CMake 变量 verilator_FOUND、VERILATOR_ROOT 和 VERILATOR_BIN 设置为 适当的值,并创建一个 verilate() 函数。verilate() 会自动创建自定义命令来 运行 Verilator,并将生成的 C++ 源文件添加到指定的目标。

在 CMake 中 Verilate

verilate(target SOURCES source ... [TOP_MODULE top] [PREFIX name]
         [COVERAGE] [SYSTEMC]
         [TRACE_FST] [TRACE_SAIF] [TRACE_VCD] [TRACE_THREADS num]
         [INCLUDE_DIRS dir ...] [OPT_SLOW ...] [OPT_FAST ...]
         [OPT_GLOBAL ..] [DIRECTORY dir] [THREADS num]
         [VERILATOR_ARGS ...])

小写部分和 ... 应替换为参数;大写部分分隔各参数,可以以任意顺序传递,如果 是可选的则完全可以省略。

可以多次调用 verilate(target ...),以将其他 Verilog 模块添加到可执行文件 或库目标。

生成 Verilated SystemC 源文件时,你应列出 SystemC include 目录并链接到 SystemC 库。

target

由 add_executable 或 add_library 创建的目标名称。

COVERAGE

可选。如果存在则启用覆盖率,等价于 "VERILATOR_ARGS --coverage"。

DIRECTORY

可选。设置 verilator 输出目录。最好使用默认值,这样可以避免与其他文件 冲突。

INCLUDE_DIRS

可选。设置 Verilator 搜索的目录(与 -y 相同)。

OPT_SLOW

可选。设置慢速路径的编译器选项。你可能希望降低优化级别以改善大型设计的 编译时间。

OPT_FAST

可选。设置快速路径的编译器选项。

OPT_GLOBAL

可选。设置 Verilated 模型使用的公共运行时库的编译器选项。

PREFIX

可选。设置 Verilator 输出前缀。默认为第一个源文件名并加上前缀 "V"。 在每次调用 verilate() 时它必须唯一,因此如果你用不同参数多次构建同一个 模块,则必须设置它。它必须是有效的 C++ 标识符,即不包含空白,且只包含 字符 A-Z、a-z、0-9 或 _。

SOURCES

要 Verilate 的 Verilog 文件列表。你必须至少提供一个文件。

SYSTEMC

可选。启用 SystemC 模式,如果未指定则默认为 C++。

使用带 CMake 支持的 Accellera SystemC 时,有一个可用的 CMake 目标可以 简化 SystemC 步骤。这仅在 CMake 能找到 SystemC 安装时有效,可以在 CMake 配置期间设置 CMAKE_PREFIX_PATH 变量来配置。

不要忘记为 Verilated 源文件设置与 SystemC 库相同的 C++ 标准。可以使用 SYSTEMC_CXX_FLAGS 环境变量指定。

THREADS

可选。启用多线程模型;见 --threads。

TOP_MODULE

可选。设置顶层模块的名称。默认为 SOURCES 数组中第一个文件的名称。

TRACE

已弃用。与 TRACE_VCD 相同,应改用后者。

TRACE_FST

可选。如果存在则启用 FST 跟踪,等价于 "VERILATOR_ARGS --trace-fst"。

TRACE_SAIF

可选。如果存在则启用 SAIF 跟踪,等价于 "VERILATOR_ARGS --trace-saif"。

TRACE_THREADS

已弃用且无效果。

在 5.048 之前的版本中:可选。启用多线程 FST 跟踪;见 --trace-threads。

TRACE_VCD

可选。如果存在则启用 VCD 跟踪,等价于 "VERILATOR_ARGS --trace-vcd"。

VERILATOR_ARGS

可选。传递给 Verilator 的额外参数。不要在此处指定 --Mdir 或 --prefix;请使用 DIRECTORY 或 PREFIX。

CMake 中的 SystemC 链接

Verilator 的 CMake 支持提供了一个便利函数,用于自动查找并链接到 SystemC 库。用法如下:

verilator_link_systemc(target)

其中 target 是你的目标名称。

可以通过设置一些变量来配置搜索路径:

SYSTEMC_INCLUDE

设置指向 SystemC include 的直接路径。

SYSTEMC_LIBDIR

设置指向 SystemC 库的直接路径。

SYSTEMC_ROOT

设置已安装 SystemC 库的安装前缀。

SYSTEMC

设置已安装 SystemC 库的安装前缀。(与 SYSTEMC_ROOT 相同。)

Verilation 摘要报告

当 Verilator 生成代码时,除非使用 --quiet-stats,否则它会向 stdout 打印一份汇总构建的报告。例如:

- 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; allocated 2894.672 MB

此报告中的信息为:

"Verilator ..."

程序版本。

"234 MB sources"

所有输入 Verilog 和 Verilator 控制文件中预处理后文本的字符数,单位为 兆字节。

"247 modules"

展开(elaboration)之前设计中的接口/模块/类/包数量。

"into 74 MB"

输出 C++ 代码(包括注释)的字符数,单位为兆字节。

"89 C++ files"

创建的 .cpp 文件数量。

"needing 192MB"

Verilation 时对运行模型所需内存的最小界限估计,单位为兆字节。(预期 需要显著更多。)

"Walltime 26.580 s"

Verilation 和构建的实际经过墙钟时间。

"elab=2.096"

读入文件并完成展开的墙钟时间。

"cvt=18.268"

Verilator 处理并写出输出的墙钟时间。

"bld=2.1"

编译 gcc/clang 的墙钟时间(如果使用 --build)。

"cpu 22.548 s"

使用的 CPU 时间,所有 CPU 线程总计。

"4 threads"

使用的同时线程数。

"allocated 123 MB"

构建期间 Verilator 可执行文件使用的峰值常驻内存(不包括 --build 编译器的使用),单位为兆字节。

连接到 Verilated 模型

Verilated 模型的结构

Verilator 输出一个 prefix.h 头文件,其中定义了一个名为 {prefix} 的类,表示用户应当实例化的生成模型。此模型类定义了 Verilated 模型的接口。

Verilator 还会创建一个 prefix.cpp 文件,以及用于内部实现的额外 .h 和 .cpp 文件。示例见套件中的 examples 目录。关于 Verilator 可能输出的所有文件的信息,见 读取/写入的文件。

Verilator 的输出将包含一个 prefix.mk 文件,可与 Make 一起用于 构建包含所有所需目标文件的 prefix__ALL.a 库。

生成的模型类文件管理模型所需的所有内部状态,并暴露以下接口以允许与模型 交互:

  • 顶层 IO 端口暴露为对适当内部等价物的引用。

  • 公共顶层模块实例暴露为指针,以允许访问 /* verilator public */ 项。

  • 设计层级的根(如 SystemVerilog 中的 $root)通过 rootp 成员指针 暴露,以允许访问模型内部,包括 /* verilator public_flat */ 项。

4.210 版本中的模型接口变更

从 4.210 版本开始,模型类是一个接口对象。

直到 Verilator 4.204(含)为止,生成的模型类同时也是设计层级中顶层实例的 实例(即在 SystemVerilog 中用 $root 所指的东西)。这意味着 Verilator 在根作用域中实现的所有内部变量都可以作为模型类本身的成员访问。注意由于 模块内联,这类变量通常很多,包括 /* verilator public_flat */ 项。

这意味着访问模型内部信号(很可能包括 /* verilator public_flat */ 信号,因为它们通常被内联到根作用域)的用户代码需要按如下方式更新:

  • 访问顶层 IO 信号无需更改。这些可通过引用直接在模型类中访问。

  • 访问 /* verilator public */ 项无需更改。这些可通过模型类中的子模块 指针直接访问。

  • 访问任何其他内部成员(包括 /* verilator public_flat */ 项)需要 以下更改:

    • 额外包含 prefix___024root.h。该头文件定义了模型类中 rootp 指针的类型。注意 __024 子串是 $ 字符的 Verilator 转义序列,即:rootp 指向 Verilated SystemVerilog $root 作用域。

    • 将 modelp->internal->member 引用替换为 modelp->rootp->internal->member 引用,后者通过 rootp 指针多 了一层间接寻址。

连接到 C++

在 C++ 输出模式(--cc)中,Verilator 生成的模型类是一个简单的 C++ 类。用户必须为仿真编写 C++ 包装器和主循环,它实例化模型类并与 Verilated 模型链接。

详细带注释的示例请参阅发行版中的 examples/make_tracing_c。

顶层 IO 信号作为模型的成员读写。所有输入都必须经过净化(sanitize),即 对应 Verilog 构造宽度之上的位不得置位;--runtime-debug 会断言这 是正确的。

调用模型的 eval() 方法来求值模型。仿真完成时,调用模型的 final() 方法以执行任何 SystemVerilog final 块,并完成任何断言。如果使用 --timing,还有两个额外的函数,用于检查仿真中是否因延迟而有任何 待处理事件,以及检索下一个延迟事件的仿真时间。见 包装器与模型求值循环。

连接到 SystemC

在 SystemC 输出模式(--sc)中,Verilator 生成的模型类是一个 SystemC SC_MODULE。该模块将作为实例直接接入 SystemC 网表。

该 SC_MODULE 获得与 Verilog 模块相同的引脚布局,并进行以下类型转换: 单比特引脚变为 bool。2-32 位宽的引脚变为 uint32_t。33-64 位宽的引脚变为 sc_bv 或 uint64_t,具体取决于 --no-pins64 选项。更宽的引脚变为 sc_bv。(Uint 仿真最快,因此尽可能使用。)

模型内部(包括较低层子模块)不是纯 SystemC 代码。这是一个特性,因为在 所有地方使用 SystemC 引脚互连方案会使性能降低一个数量级。

Verilated API

Verilated 模型的 API 是发行版 include/ 目录中的 C++ 头文件。这些头文件使用 Doxygen 注释 /// 和 //< 来指示和记录那些属于 Verilated 公共 API 的 函数。

进程级克隆 API

现代操作系统通过 C/C++ 中的系统调用接口支持进程级克隆(又名复制、fork), 例如 Linux 中的 fork()。

然而,在克隆父进程之后,有些资源无法在子进程中继承。例如,在 POSIX 系统 中,当你 fork 一个进程时,子进程继承父进程的所有内存。但是,只有调用 fork 的线程会在子进程中复制。其他线程不会。

因此,为了支持进程级克隆机制,Verilator 支持 prepareClone() 和 atClone() API,允许用户在子进程中手动重建模型。这两个 API 处理克隆 前后释放和重新初始化所需的所有必要资源。

这两个 API 在 verilated 模型中受支持。以下是与 Linux fork() 和 pthread_atfork API 一起使用的示例:

// static function pointers to fit pthread_atfork
static auto prepareClone = [](){ topp->prepareClone(); };
static auto atClone = [](){ topp->atClone(); };

// in main function, register the handlers:
pthread_atfork(prepareClone, atClone, atClone);

为了更大的灵活性,你也可以在 fork() 前后手动调用这些处理程序。

借助进程级克隆 API,用户可以为 verilated 模型创建进程级快照。Verilator 的保存/恢复选项提供持久且依赖电路的快照,而进程级克隆 API 支持内存中、 电路透明且高效的快照。

Direct Programming Interface (DPI)

Verilator 支持 SystemVerilog Direct Programming Interface 导入和导出语句。 仅支持 SystemVerilog 形式("DPI-C"),不支持最初的 Synopsys 专用 DPI。

DPI 示例

在上面的 SYSTEMC 示例中,如果你想将 C++ 函数导入 Verilog,请在 our.v 中 放入:

import "DPI-C" function int add (input int a, input int b);

initial begin
  $display("%x + %x = %x", 1, 2, add(1,2));
end

然后在 Verilate 之后,Verilator 会创建一个文件 Vour__Dpi.h,其中包含调用 此函数的原型:

extern int add(int a, int b);

在 sc_main.cpp 文件(或传递给 Verilator 命令行或链接的另一个 .cpp 文件) 中,你会这样:

#include "svdpi.h"
#include "Vour__Dpi.h"
int add(int a, int b) { return a+b; }

DPI 系统任务/函数

Verilator 扩展了 DPI 格式,允许使用相同的方案高效地添加系统函数。对导入 使用带美元符号前缀的系统函数名,但注意它必须被转义。

import "DPI-C" function integer \$myRand;

initial $display("myRand=%d", $myRand());

反方向地,你可以导出 Verilog 任务,使它们可以从 C++ 调用:

export "DPI-C" task publicSetBool;

task publicSetBool;
  input bit in_bool;
  var_bool = in_bool;
endtask

然后在 Verilate 之后,Verilator 会创建一个文件 Vour__Dpi.h,其中包含调用 此函数的原型:

extern void publicSetBool(svBit in_bool);

在 sc_main.cpp 文件中,你会这样:

#include "Vour__Dpi.h"
publicSetBool(value);

或者,也可以在设计类下调用该函数。这不兼容 DPI,但更易读,且更好地支持 多个设计。

#include "Vour__Dpi.h"
Vour::publicSetBool(value);
// or top->publicSetBool(value);

注意,如果 DPI 任务或函数访问 RTL 内的任何寄存器或线网,它将需要设置一个 作用域。这可以在模块实例化之后、调用任务和/或函数之前,使用 svdpi.h 中的 标准函数来完成。

例如,如果顶层模块实例化的名称为 "dut",且任务内的名称引用都是相对于该 顶层模块的层级(点式)名称,那么可以这样设置作用域

#include "svdpi.h"
...
const svScope scope = svGetScopeFromName("TOP.dut");
assert(scope);  // Check for nullptr if scope not found
svSetScope(scope);

(请记住 Verilator 会在模块层级顶部添加一个 "TOP"。)

也可以从被 Verilog 调用的 DPI 导入 C 函数内部通过查询该函数的作用域来 设置作用域。更多信息见下面关于 DPI Context Functions 和 DPI Header Isolation 的章节以及 svdpi.h 头文件内的注释。

访问信号的 DPI 导入

如果 DPI 导入通过 VPI 访问信号,Verilator 将无法知道访问了哪些变量,可能 会不恰当地调度代码。理想情况下应将这些值作为输入/输出传递,从而不需要 VPI。另一种变通方法是使用非内联任务作为包装器:

logic din;

// This DPI function will read "din"
import "DPI-C" context function void dpi_that_accesses_din();

always @(...)
  dpi_din_args(din);

task dpi_din_args(input din);
  // verilator no_inline_task
  dpi_that_accesses_din();
endtask

DPI 显示函数

Verilator 允许使用以下语法编写类似 $display 的函数:

import "DPI-C" function void
  \$my_display(input string formatted /*verilator sformat*/ );

/*verilator&32;sformat*/ 元注释指示该函数接受类似 $display 的 格式说明符,后跟任意数量的参数以满足该格式。

DPI Context Functions

Verilator 支持 IEEE DPI Context Functions。Context 导入将仿真器上下文 (包括调用作用域名,以及文件名和行号)传递给 C 代码。例如,在 Verilog 中:

import "DPI-C" context function int dpic_line();
initial $display("This is line %d, again, line %d\n", `line, dpic_line());

这会调用 C++ 代码,后者随后可以使用 svGet* 函数读取信息,在此例中是调用 dpic_line 函数的 Verilog 语句的行号:

int dpic_line() {
    // Get a scope:  svScope scope = svGetScope();

    const char* scopenamep = svGetNameFromScope(scope);
    assert(scopenamep);

    const char* filenamep = "";
    int lineno = 0;
    if (svGetCallerInfo(&filenamep, &lineno)) {
        printf("dpic_line called from scope %s on line %d\n",
           scopenamep, lineno);
        return lineno;
    } else {
        return 0;
    }
}

更多信息见 IEEE 标准。

DPI 头文件隔离

Verilator 将 svdpi.h 等 IEEE 标准头文件放在单独的 include 目录 vltstd (VeriLaTor STandarD) 中。编译大多数应用程序时,$VERILATOR_ROOT/include/vltstd 会与常规的 $VERILATOR_ROOT/include 一起位于 include 路径中。然而,当将 Verilated 模型编译到其他拥有自己的 svdpi.h 及类似但内容不同的标准文件的 仿真器中时,不应包含 vltstd 目录,以防止拾取到不兼容的定义。

公共函数

除了 DPI 导出之外,还有 Verilator 公共函数,它们稍快一些,但兼容性较差。

Verification Procedural Interface (VPI)

Verilator 支持 VPI 的一个受限子集。该子集允许仅对公共信号进行检查、查看、 值变化回调和值写入。

VPI 通过 Verilator 的 --vpi 选项启用。

要通过 VPI 访问信号,必须明确告诉 Verilator 要访问哪些信号。这通过下文 记录的 Verilator public pragma 完成。

Verilator 与事件驱动仿真器有一个重要区别;由 VPI 更改的信号值不会立即传播 其值,而是必须调用顶层头文件的 eval() 方法。通常这会是正常求值的一部分 (即下一个时钟边沿),而不是值变化的一部分。这使得 VPI 例程的性能相比 事件驱动仿真器极快,但可能会让一些期望立即传播的测试平台感到困惑。

注意,VPI 按其规定的实现总是比通过直接引用(structure->module->signame) 访问 Verilator 值慢得多,因为 VPI 访问器在仿真运行时在函数中执行查找, 最乐观也需要数百条指令,而直接引用由编译器求值,只需几条指令。

要使信号回调工作,程序主循环必须调用 VerilatedVpi::callValueCbs()。

Verilator 还会通过 evalNeeded 标志跟踪模型状态何时通过 VPI 被修改。 该标志可以用 VerilatedVpi::evalNeeded() 检查,并可以用 VerilatedVpi::clearEvalNeeded() 清除。结合使用,如果自上次 eval() 以来没有模型状态发生变化,就可以跳过 eval() 调用。

任何通过带 vpiInertialDelay 的 vpi_put_value 写入的数据都将被推迟 到以后。这些延迟值可以用 VerilatedVpi::doInertialPuts() 刷新到模型。

VPI 示例

在下面的示例中,我们将 readme 标记为只读,将 writeme 标记为读写,如果从 模型外部写入它,其语义与顶层输入相同。

cat >our.v <<'EOF'
  module our #(
     parameter WIDTH /*verilator public_flat_rd*/ = 32
  ) (input clk);
    reg [WIDTH-1:0] readme   /*verilator public_flat_rd*/;
    reg [WIDTH-1:0] writeme  /*verilator public_flat_rw*/;
    initial $finish;
  endmodule
EOF

网上有许多关于 VPI 的教程和书籍,但访问上述信号 "readme" 的示例是:

cat >sim_main.cpp <<'EOF'
  #include "Vour.h"
  #include "verilated.h"
  #include "verilated_vpi.h"  // Required to get definitions

  uint64_t main_time = 0;   // See comments in first example
  double sc_time_stamp() { return main_time; }

  void read_and_check() {
      vpiHandle vh1 = vpi_handle_by_name((PLI_BYTE8*)"TOP.our.readme", NULL);
      if (!vh1) vl_fatal(__FILE__, __LINE__, "sim_main", "No handle found");
      const char* name = vpi_get_str(vpiName, vh1);
      const char* type = vpi_get_str(vpiType, vh1);
      const int size = vpi_get(vpiSize, vh1);
      printf("register name: %s, type: %s, size: %d\n", name, type, size);  // Prints "register name: readme, type: vpiReg, size: 32"

      s_vpi_value v;
      v.format = vpiIntVal;
      vpi_get_value(vh1, &v);
      printf("Value of %s: %d\n", name, v.value.integer);  // Prints "Value of readme: 0"
  }

  int main(int argc, char** argv) {
      Verilated::commandArgs(argc, argv);
      const std::unique_ptr<VerilatedContext> contextp{new VerilatedContext};
      const std::unique_ptr<Vour> top{new Vour{contextp.get()}};

      contextp->internalsDump();  // See scopes to help debug
      while (!contextp->gotFinish()) {
          top->eval();
          VerilatedVpi::callValueCbs();  // For signal callbacks
          read_and_check();
      }
      return 0;
  }
EOF

包装器与模型求值循环

使用 SystemC 时,Verilated 模型的求值由 SystemC 内核管理,大多数情况下可以 忽略。使用 C++ 时,用户必须调用 eval(),或 eval_step() 和 eval_end_step()。

  1. 当 C++ 层实例化了单个需要在给定上下文中求值的设计时,调用 designp->eval()。

  2. 当 C++ 层实例化了多个需要在上下文中求值的设计时,先调用 first_designp->eval_step(),然后对所有其他设计调用 ->eval_step()。 然后在第一个设计上调用 ->eval_end_step(),再对所有其他设计调用。 如果只有一个设计,你会调用 eval_step() 然后 eval_end_step(); 实际上上面描述的 eval() 只是调用这两个函数的包装器。

  3. 如果使用延迟和 --timing,用户还应调用两个额外的方法:

    • designp->eventsPending(),如果有任何待处理的延迟事件则返回 true,

    • designp->nextTimeSlot(),返回下一个延迟事件的仿真时间。仅当 designp->eventsPending() 返回 true 时才能调用此方法。

调用 eventsPending() 以检查是否应继续仿真,然后调用 nextTimeSlot() 以推进仿真时间。--main 可以与 --timing 一起使用,以生成 一个启用时序的 eval 循环的基本示例。

当调用 eval()``(或 ``eval_step())时,Verilator 会查找时钟信号中的 变化并求值相关的时序 always 块,例如计算 always_ff @ (posedge...) 的输出。 使用 --timing 时,它会恢复任何等待当前仿真时间的延迟进程。然后 Verilator 求值组合逻辑。

注意,组合逻辑不会在时序 always 块之前计算(出于速度原因)。因此,最好在 更改时钟之前,用单独的 eval() 调用设置任何非时钟输入。

或者,如果所有 always_ff 语句都只使用时钟的 posedge,或所有输入都直接进入 always_ff 语句(这是典型情况),那么你可以在输入时钟的负边沿更改非时钟 输入,这样会更快,因为 eval() 调用更少。

关于求值的更多信息,见发行版中的 docs/internals.rst。

Verilated 与 VerilatedContext

多个 C++ Verilated 模型可以是同一仿真上下文的一部分,即共享 VPI 接口、 时间观念和公共设置。这种公共仿真上下文信息存储在 VerilatedContext 结构中。如果在创建模型之前未创建 VerilatedContext,会自动创建一个 默认的全局上下文。SystemC 要求只使用单个默认的 VerilatedContext。

Verilated:: 方法(包括上面展示的 Verilated::commandArgs 调用)使用 默认全局 VerilatedContext 调用 VerilatedContext 方法。(从技术上讲,它们 操作的是给定线程最后使用的那个。)如果你使用多个仿真上下文,则不应使用 Verilated:: 方法,而应始终使用在适当 VerilatedContext 对象上调用的 VerilatedContext 方法。

Verilated 和 VerilatedContext 下可用的方法见发行版中的 include/verilated.h。

仿真(Verilated 模型运行时)

本节描述与仿真相关的项目,即使用 Verilated 模型的可执行文件。关于仿真模型 的运行时参数,见 仿真运行时参数。

仿真摘要报告

仿真结束时,它会向 stdout 打印一份总结该仿真的报告。这要求模型使用 --main 进行 Verilate,或者用户的 main() 调用 VerilatedContext->statsPrintSummary()。

可以使用 +verilator+quiet 禁用该报告。

例如:

- 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; allocated 123 MB

此报告中的信息为:

"Verilator ..."

程序版本。

"End at simtime 123 ns"

模型完成或停止时的 Verilog $time。

"walltime 1234.001 s"

实际经过的墙钟时间,单位为秒。

"speed 123.1 ns/s"

仿真时间(如果非零)除以墙钟时间。例如 123 ns/s 表示 123 个仿真纳秒 花费了 1 秒墙钟时间;对于只有 1 GHz 时钟的模型,这相当于每秒 123.1 个 周期。单位会自动选择,以给出 1 到 1000 之间的数字。墙钟时间包括初始化、 initial 和 final 进程块,因此表示的速度比模型运行时间更长时的速度慢。

"cpu 22 s"

所有 CPU 线程总计使用的 CPU 时间,单位为秒。

"4 threads"

使用的同时线程数。

"allocated 123 MB"

仿真期间使用的峰值常驻内存,单位为兆字节。

基准测试与优化

为获得最佳性能,请使用 -O3 --x-assign fast --x-initial fast --no-assert 选项运行 Verilator。-O3 选项 将需要更长时间运行 Verilator,而 --x-assign fast --x-initial fast 可能以性能换来的复位缺陷风险增加。 --no-assert 将抑制检查断言,这更快,适合运行已知良好模型的软件, 但可能隐藏设计错误。这些选项见上述文档。

如果使用多线程 Verilated,考虑使用 numactl 覆盖 Verilator 的默认 线程到处理器分配;见 多线程。如果你的操作系统能很好地为你的 设计和硬件处理线程分配,考虑通过将 VERILATOR_NUMA_STRATEGY 环境 变量设置为 none 来禁用 Verilator 的 NUMA 分配;见 环境。 另外,考虑使用配置引导优化;见 线程配置引导优化。

次要的 Verilog 代码修改也可能带来巨大收益。你不应有任何来自 Verilator 的 UNOPTFLAT 警告。修复这些警告可能带来巨大改进;一位用户通过对 用于门控时钟的时钟锁存器做简单修改,修复了他们的一个 UNOPTFLAT 警告, 获得了 60% 的性能提升。

除此之外,Verilated 模型的性能主要取决于你的 C++ 编译器和 CPU 缓存大小。 经验表明,指令缓存大小通常限制大型模型,如果可能,减小代码大小是有益的。

提供的 $VERILATOR_ROOT/include/verilated.mk 文件使用 OPT、OPT_FAST、 OPT_SLOW 和 OPT_GLOBAL 变量控制优化。你可以在用 Make 编译 Verilator 输出 时设置这些变量,例如:

make OPT_FAST="-Os -march=native" -f Vour.mk Vour__ALL.a

OPT_FAST 为快速路径上的模型部分指定优化选项。这主要是每个周期都会执行的 代码。OPT_SLOW 适用于慢速路径代码,它很少执行,通常只在仿真开始或结束时 执行一次。如果 VM_PARALLEL_BUILDS 不为 1,则忽略 OPT_SLOW,此时所有生成的 代码将使用 OPT_FAST 在单个编译单元中编译。另见 Verilator 的 --output-split 选项。OPT_GLOBAL 变量适用于 Verilated 模型使用的 运行时库中的公共代码(随 $VERILATOR_ROOT/include 提供)。在 verilator 命令行上传递的额外 C++ 文件使用 OPT_FAST。OPT 变量适用于所有编译单元以及 上述特定的 "OPT" 变量。

你也可以在 verilator 命令行上使用 -CFLAGS 和/或 -LDFLAGS 选项,将参数直接传递给编译器或链接器。

"OPT" 变量的默认值被选择为在合理的 C++ 编译时间下获得良好的仿真速度。 为此,OPT_FAST 默认设置为 "-Os"。更高的优化如 "-O2" 或 "-O3" 可能有帮助 (尽管它们通常只提供最小的性能提升),但即使是中等规模的设计,编译时间 也可能过长。可以通过降低优化来以仿真速度为代价改善编译时间,例如使用 OPT_FAST="-O0"。通常使用 OPT_FAST="-O1 -fstrict-aliasing" 可以获得良好的 仿真速度,同时改善编译时间。由 OPT_SLOW 控制的文件对性能影响很小,因此 OPT_SLOW 默认为空(等价于 "-O0")以提高编译速度。在常见用例中,更改 OPT_SLOW 应该没有多少好处。OPT_GLOBAL 默认设置为 "-Os",很少需要更改它。 由于运行时库相对于许多 Verilated 模型来说很小,禁用运行时库的优化不应 严重影响整体编译时间,但可能对仿真速度产生不利影响,尤其是在跟踪时。除 上述之外,为获得最佳结果,请使用 OPT="-march=native"、最新的 Clang 编译器 (比 GCC 快约 10%)并静态链接。

一般来说,哪个优化级别能带来最佳用户体验取决于用例,进行一些实验可能会 有回报。在开发期间进行快速调试循环,尤其是在 C++ 编译速度可能占主导的 大型设计上,考虑使用较低的优化以更快得到可执行文件。对于面向吞吐量的用例, 例如回归测试,通常值得花费额外的编译时间来减少总 CPU 时间。

如果你将在单个模型上运行许多仿真,你可以研究配置引导优化。见 编译器配置引导优化。

现代编译器还支持链接时优化 (LTO),这可能有帮助,尤其是在你链接 DPI 代码时。 要在 GCC 上启用 LTO,在编译和链接时都传递 "-flto"。注意 LTO 可能在大型 设计上导致过长的编译时间。

不幸的是,对 SystemC 文件使用优化器可能导致编译花费数分钟。(SystemC 库有许多小的内联函数,会让编译器发疯。)

你可以通过分析 Verilog 代码来发现进一步的调优可能。见 代码分析。

优化完成后,请告知作者结果。我们喜欢跟踪 Verilator 的表现,并可能建议 额外的改进。

覆盖率分析

Verilator 支持向 Verilated 模型添加代码以支持 SystemVerilog 代码覆盖率。 使用 --coverage,Verilator 启用所有形式的覆盖率:

当执行带覆盖率的模型时,它会创建一个覆盖率文件以供收集和后续分析,见 覆盖率收集。

属性覆盖率

使用 --coverage 或 --coverage-user,Verilator 会将用户 在 SystemVerilog 代码中手动插入的属性覆盖点转换到 Verilated 模型中。

对于简单的覆盖点,使用 cover property 构造:

DefaultClock: cover property (@(posedge clk) cyc==3);

这会添加一个覆盖点,跟踪该条件是否已被观察到。

Covergroup 覆盖率

使用 --coverage 或 --coverage-user,Verilator 会将用户 在 SystemVerilog 代码中手动插入的 covergroup 覆盖点转换到 Verilated 模型 中。Verilator 支持带值和转换 bin 的 coverpoint,以及交叉点。

FSM 覆盖率

使用 --coverage 或 --coverage-fsm,Verilator 可以插桩 一个保守的 FSM 子集,并报告状态覆盖率(fsm_state)和转换覆盖率 (fsm_arc)。

此特性目前是实验性的,可能在后续版本中改变。特别是,原生 FSM 覆盖率提取 启发式、--coverage-fsm 以及下面 Verilator 特定的 FSM 元注释在接口 稳定之前都应视为可能改变。

FSM 提取有意保持狭窄。当前实现针对可直接从 RTL 恢复的时钟状态机。它识别 以下常见形式中的标量 enum、parameter、localparam 和选定的字面量状态编码:

  • 单进程 FSM,其状态分派写为 case (state),或写为比较同一状态变量与 已知状态值的顶层 if / else if 链

  • 两进程和三块 FSM,其中带时钟的状态寄存器与组合下一状态块配对,使用相同 受支持的 case 或顶层 if / else if 分派形式

标量状态编码可以宽于 32 位。这允许稀疏状态编码(例如高汉明距离的 enum 或 localparam 值)保留在检测到的 FSM 模型中。Verilator 尽可能使用声明的 enum 项名、参数名或 localparam 名作为报告的状态标签。

简单输入守卫在它们出现在识别的状态分支内部,或作为恰好包含一个状态比较的 顶层合取(例如 (state_q == IDLE) && ready)时受支持。可直接追踪的预 解码状态别名(例如 assign idle_state = (state_q == IDLE))也可以在这些 带守卫的谓词中使用。

Verilator 不声称广泛支持任意谓词分解、one-hot 推断、辅助函数下一状态恢复、 深层嵌套控制恢复或跨模块状态别名追踪。

以下元注释可以附加到状态变量上,以引导提取的覆盖率模型:

  • /*verilator fsm_state*/ 强制将该变量视为 FSM 状态。

  • /*verilator fsm_reset_arc*/ 将复位转换标记为用户可见的复位弧,而不是 默认为隐藏的仅复位摘要。

  • /*verilator fsm_arc_include_cond*/ 保留保守提取器否则会跳过的条件 分支弧。

状态寄存器也可以由透明实例包装,例如项目触发器包装器或原语。此类包装器 必须先用 VLT 命令文件操作显式描述,Verilator 才会使用它们的数据、状态、 时钟或复位连接进行 FSM 提取:

`verilator_config
fsm_register_wrapper -module "my_fsm_flop" -d "state_i" -q "state_o" -clock "clk_i"

同一命令可以放在单独的 .vlt 文件中:

fsm_register_wrapper -module "my_fsm_flop" -d "state_i" -q "state_o" -clock "clk_i"

也可以提供可选复位元数据:

fsm_register_wrapper -module "my_fsm_flop" -d "state_i" -q "state_o" -clock "clk_i" \
   -reset "rst_ni" -reset_value "ResetValue"

仅当配置的复位端口在包装器中具有可推断的边沿,且配置的复位值参数可静态 解析时,才会生成复位弧。如果复位元数据不完整,Verilator 会发出警告,并且 仍可能生成 FSM 状态和转换覆盖率,但会省略复位弧。

无论哪种方式,复位转换都会包含在收集的数据中。默认情况下, verilator_coverage 会汇总仅复位弧,而不是将它们与非复位弧一起 打印。使用 verilator_coverage --include-reset-arcs 将这些弧包含 在打印的摘要和注释输出中。

verilator_coverage --annotate 生成的注释输出会用 fsm_state 和 fsm_arc 标记 FSM 点,并用 SYNTHETIC DEFAULT ARC 标记合成的回退 转换。

行覆盖率

使用 --coverage 或 --coverage-line,Verilator 会在每个 代码流变化点(例如分支处)自动添加覆盖率分析。在每个此类分支处,计数器 递增。在测试结束时,计数器、文件名以及每个计数器对应的行号会被写入覆盖率 文件。

当组合(非时钟)块接收到已禁用 UNOPTFLAT 警告的信号时,Verilator 可能对它们过度计数;为获得最准确的结果,使用覆盖率时不要禁用此警告。

翻转覆盖率

使用 --coverage 或 --coverage-toggle,Verilator 会自动 将翻转覆盖率分析添加到 Verilated 模型中。

模块中每个信号的每一位都插入一个计数器,计数器会在相应位的每次边沿变化时 递增。

作为任务或 begin/end 块一部分的信号被视为局部变量,不被覆盖。以下划线开头 的信号(见 --coverage-underscore)、整数或非常宽的信号(所有维度 总存储超过 256 位,见 --coverage-max-width)也不被覆盖。

层级会被压缩,因此如果某个模块被实例化多次,覆盖率将在该模块具有相同参数 集的**所有**实例上对该位求和。使用不同参数值实例化的模块被视为不同的模块, 将单独计数。

Verilator 会就信号属于哪个时钟域做出最低智能的判断,并且只在该时钟域中查找 边沿。这意味着如果已知接收逻辑永远看不到该边沿,则可能忽略它。此算法将来 可能改进。最终结果是,覆盖率可能低于查看跟踪所看到的结果,但覆盖率更准确 地表示了进入设计的激励质量。

在模型稳定期间,时间零点附近可能会有边沿计数。一个好的做法是在释放复位 之前将所有覆盖率清零,以防止计入此类行为。

可以在不需要翻转分析的信号(如 RAM 和寄存器堆)周围使用 /*verilator&32;coverage_off*/ /*verilator&32;coverage_on*/ 元注释对。

表达式覆盖率

使用 --coverage 或 --coverage-expr,Verilator 会在每个 表达式处自动添加覆盖率分析,用真值表指示表达式中每种布尔真值表可能性是否 发生过。

多比特表达式被忽略,但完全为布尔的子表达式会被分析。表达式覆盖率不会完全 探索表达式的真值表,而是查看每一项的贡献。例如 AND 操作会检查 TT、XF 和 FX 的覆盖率。

某些表达式可能产生过多覆盖点。Verilator 将每个表达式的最大覆盖点数限制为 32,但这可以通过 --coverage-expr-max 控制。

下面是一个示例,展示 verilator_coverage 为 if 语句内部条件表达式生成的 表达式覆盖率。每一行显示达到整个表达式某个结果(例如 => 1)所需的最小 项数及其值(例如 (t1==0 && t2==1))。每一行还显示此组合被命中的次数。 注意各个行不是互斥的。

%000004         if ((~t1 && t2) || (~t3 && t4)) $write("");
-000002  point: type=expr comment=(t1==0 && t2==1) => 1 hier=top.t
-000002  point: type=expr comment=(t1==1 && t3==1) => 0 hier=top.t
-000004  point: type=expr comment=(t1==1 && t4==0) => 0 hier=top.t
-000002  point: type=expr comment=(t2==0 && t3==1) => 0 hier=top.t
-000003  point: type=expr comment=(t2==0 && t4==0) => 0 hier=top.t
-000002  point: type=expr comment=(t3==0 && t4==1) => 1 hier=top.t

抑制覆盖率

在代码块周围使用 /*verilator&32;coverage_off*/ 和 /*verilator&32;coverage_on*/ 将分别在该块周围禁用和启用覆盖率。 或者,使用 coverage_block_off 控制文件选项。

Verilator 自动禁用包含 $stop 的行和分支的覆盖率,因为假定 $stop 分支包含 不应发生的错误检查。/*verilator&32;coverage_block_off*/ 元注释 将对该块中或其下的任何代码执行类似功能。

覆盖率收集

当使用任何覆盖率标志进行 Verilate 时,Verilator 会向模型中添加适当的覆盖点 插入并收集覆盖率数据。

要从模型获取覆盖率数据,请用以下方式之一写入覆盖率:

  1. 使用 --binary 或 --main,Verilator 会在测试完成时将 覆盖率转储到用 +verilator+coverage+file+<filename> 指定的 文件名。

  2. 在用户包装器代码中,通常在测试通过后结束时,调用 Verilated::threadContextp()->coveragep()->write,参数为要写入覆盖率 数据的文件名(通常是 "logs/coverage.dat")。

在不同的目录中运行每个测试,可能并行运行。每个测试将创建上面指定的文件, 例如 logs/coverage.dat。

运行所有测试后,执行 verilator_coverage 命令,传递指向所有单个 覆盖率文件名的参数。verilator_coverage 将读取 logs/coverage.dat 文件,并创建显示代码覆盖率详细信息的注释源代码 列表。

verilator_coverage 也可用于测试评分,计算哪些测试对于在设计上 提供完整验证覆盖是重要的。

示例见 examples/make_tracing_c/logs 目录。Grep 以 '%' 开头的行, 查看 Verilator 认为哪些行需要更多覆盖率。

verilator_coverage 的其他选项允许合并覆盖率数据文件或其他转换。

Info 文件可以由 verilator_coverage 写出,以便导入到 lcov。这使 可以使用 genhtml 生成 HTML 报告,并将报告导入到 https://codecov.io 等站点。

代码分析

Verilated 模型可以使用 GCC 或 Clang 的 C++ 分析机制进行代码分析。Verilator 提供额外标志,帮助将所得的 C++ 分析结果映射回负责被分析 C++ 代码函数的 原始 Verilog 代码。

要使用分析:

  1. 确保 Verilog 代码在仿真结束时调用 $finish`(否则 C 库可能在下面后面的 步骤中无法正确创建 `gmon.out 文件)。

  2. 运行 Verilator,添加 --prof-cfuncs 选项。

  3. 构建并运行仿真模型。

  4. 模型将创建 gmon.out。

  5. 运行 gprof gmon.out > gprof.log,查看时间花在 C++ 代码的 何处。

  6. 运行 verilator_profcfunc gprof.log > profcfunc.log,将 gprof 输出转换为显示大部分时间花在哪些 Verilog 行号上的输出。

执行分析

为了性能优化,查看统计信息并可视化执行时间在 verilated 模型中如何分布是 有帮助的。

使用 --prof-exec 选项时,Verilator 将:

  • 向 Verilated 模型添加代码以记录执行流。

  • 添加代码,将非人类友好形式的分析数据保存到用 +verilator+prof+exec+file+<filename> 指定的文件。

  • 在多线程模型中,添加代码以记录每个宏任务在多次 eval 调用中的开始和结束 时间。(什么是宏任务?见 Verilator 内部文档(发行版中的 docs/internals.rst)。)

然后可以运行 verilator_gantt 程序,将保存的分析文件转换为可视 格式并生成相关统计信息。

_images/fig_gantt_min.png

图 1 使用 GTKWave 查看的 verilator_gantt 输出示例。

measured_parallelism 显示给定时刻使用的 CPU 数量。

cpu_thread 部分显示每个物理 CPU 上正在执行哪个线程。

thread_mtask 部分显示给定线程上正在运行哪个宏任务。

更多信息见 verilator_gantt。

分析 ccache 效率

Verilator 生成的 Makefile 支持在构建期间对 ccache 行为进行基本分析。这可用 于追踪可能被不必要重建的文件,不过截至目前,即使是很小的代码变动通常也 需要重建大量文件。

要获得 ccache 表现的基本报告,在调用生成的 Makefile 时添加 ccache-report 目标:

make -C obj_dir -f Vout.mk Vout ccache-report

这将基于本次 Make 调用期间 ccache 的所有执行打印一份报告。该报告也会被写入 一个文件,在此例中为 obj_dir/Vout__cache_report.txt。

要使用 ccache-report 目标,OBJCACHE 必须设置为 'ccache'(如果安装了 'ccache',configure 会这样做)。如果未指定其他显式构建目标, cchache-report 将构建 default 目标。

此特性目前是实验性的,可能在后续版本中改变。

保存/恢复

Verilated 模型的中间状态可以被保存,以便以后恢复。

要启用此特性,使用 --savable。--savable 所支持的语言 特性有限制;如果你试图使用不支持的特性,Verilator 会抛出错误。

要使用保存/恢复,用户包装器代码必须创建一个 VerilatedSerialize 或 VerilatedDeserialze 对象,然后在生成的模型以及进程需要保存/恢复的任何其他 数据上调用 << 或 >> 运算符。这些函数不是线程安全的,通常只由主 线程调用。

例如:

void save_model(const char* filenamep) {
    VerilatedSave os;
    os.open(filenamep);
    os << main_time;  // user code must save the timestamp
    os << *topp;
}
void restore_model(const char* filenamep) {
    VerilatedRestore os;
    os.open(filenamep);
    os >> main_time;
    os >> *topp;
}

配置引导优化

配置引导优化是一种技术,通过运行你的仿真可执行文件收集分析数据;然后使用 此信息指导下一次 Verilation 或编译。

配置引导优化有两种形式。不幸的是,为获得最佳结果,它们必须各自从最高层 代码到最低层执行,这意味着要分别按此顺序执行:

将来可能支持其他形式的 PGO,例如时钟和复位翻转率 PGO、分支预测 PGO、语句 执行时间 PGO 等,前提是它们被证明有益。

线程配置引导优化

Verilator 支持多线程模型的配置引导优化(Verilation)(Thread PGO)以改善 性能。

使用多线程时,Verilator 计算宏任务花费多长时间,并尝试在线程之间平衡它们。 (什么是宏任务?见 Verilator 内部文档(发行版中的 docs/internals.rst)。)如果估算不正确,线程将不平衡,导致性能下降。 Thread PGO 允许收集分析数据以替代估算并更好地优化这些决策。

要使用 Thread PGO,用 --prof-pgo 选项 Verilate 模型。这会向 verilated 模型添加代码,以保存用于配置引导优化的分析数据。

运行模型可执行文件。当可执行文件退出时,它会创建一个 profile.vlt 文件。

重新运行 Verilator,可选地省略 --prof-pgo 选项,并将之前生成的 profile.vlt 添加到命令行。

注意没有与 GCC 的 --fprofile-use 等价的 Verilator 选项。Verilator 的分析 数据文件(profile.vlt)可以直接放在 verilator 命令行上,无需任何 选项前缀。

如果要在生成优化时使用来自多次仿真的结果,可以在外部拼接多次仿真的 profile.vlt,或者将每个文件作为单独的命令行选项馈入 Verilator。Verilator 将对分析结果求和,因此长时间运行的测试在优化中所占权重将比短时间运行的 测试成比例地更大。

如果你向 Verilator 提供任何分析反馈数据但它无法使用,它会发出 PROFOUTOFDATE 警告,表示线程使用的是估算成本调度的。这通常表示 分析数据是从与 Verilator 当前运行的 Verilog 源代码不同的源代码生成的。 因此,请重复数据收集阶段以创建新的分析数据,然后用相同的输入源文件和该 新分析数据重新运行 Verilator。

编译器配置引导优化

GCC 和 Clang 支持编译器配置引导优化 (PGO)。这优化任何 C/C++ 程序,包括 Verilated 代码。使用编译器 PGO 通常可在单线程和多线程模型上带来 5-15% 的 改进。

请参阅相应的编译器文档以在 GCC 或 Clang 上使用 PGO。GCC 10 中的过程如下:

  1. 使用编译器的 "-fprofile-generate" 标志编译 Verilated 模型:

    verilator [whatever_flags] --make \
        -CFLAGS -fprofile-generate -LDFLAGS -fprofile-generate
    

    或者,如果你自己调用 make,请将 -fprofile-generate 适当地添加到你的 Makefile。

  2. 运行你的仿真。这将在源文件所在的同一目录中创建 *.gcda 文件。

  3. 使用 -fprofile-use 重新编译模型。编译器将读取 *.gcda 文件。

    对于 GCC:

    verilator [whatever_flags] --build \
        -CFLAGS "-fprofile-use -fprofile-correction"
    

    对于 Clang:

    llvm-profdata merge -output default.profdata *.profraw
    verilator [whatever_flags] --build \
        -CFLAGS "-fprofile-use -fprofile-correction"
    

    或者,如果你自己调用 make,请将这些 CFLAGS 开关适当地添加到你的 Makefile。

Clang 和 GCC 还支持 -fauto-profile,它使用基于采样的反馈导向优化。请参阅 相应的编译器文档。

运行时调试

要调试 Verilated 可执行文件,请使用 --runtime-debug 进行 Verilate。 这会指示编译器插入调试器,并启用各种库断言。这些选项会减慢可执行文件, 因此仅在调试时这样做。

如果你使用自己的 Makefile,请适当地调整,以将 --runtime-debug 下 记录的选项传递给编译器和链接器。

一旦你有了启用调试的可执行文件,使用标准 GNU 调试器 gdb 或类似工具 运行它,并创建回溯;例如:

gdb obj_dir/Vtop
  run {Vtop_command_arguments}
  {Vtop prints output, perhaps a segmentation faults}
  bt

有时缺陷可能会在 --runtime-debug 下消失;如果是这样,请尝试改用 --runtime-debug 记录的子选项,以找到仍能显示该问题的最大子集。 例如,使用 -CFLAGS -D_GLIBCXX_DEBUG 很可能不会隐藏任何缺陷,因此可以 使用。

使用 --runtime-debug 或 -CFLAGS -DVL_DEBUG=1 仅在出错时打印 消息。要在运行时启用调试打印消息,额外使用 +verilator+debug 运行时选项。

贡献与报告缺陷

公告

要获得新版本和其他重要公告的通知,请前往 Verilator 公告仓库 并遵循其中的说明。

报告缺陷

首先,检查 语言限制 一节。

接下来,尝试 --debug 选项。它会启用额外的内部断言,可能有助于 定位问题。

最后,将你的代码精简为能够展现该缺陷的最小可能例程(见 最小化引发缺陷的代码)。更好的是,在 test_regress/t 目录中创建一个测试,如下所示:

cd test_regress
cp -p t/t_EXAMPLE.py t/t_BUG.py
cp -p t/t_EXAMPLE.v t/t_BUG.v

关于如何编写好的测试,test_regress/driver.py 文档中有许多提示, 可以通过运行以下命令查看:

cd $VERILATOR_ROOT  # Need the original distribution kit
test_regress/driver.py --help

编辑 t/t_BUG.py 以适配你的示例;你可以在其中的 Verilog 代码里做 任何想做的事;只需确保它保留单个 clk 输入且没有输出。现在,以下命令应当 失败:

cd $VERILATOR_ROOT  # Need the original distribution kit
cd test_regress
t/t_BUG.py  # Run on Verilator
t/t_BUG.py --debug # Run on Verilator, passing --debug to Verilator
t/t_BUG.py --vcs  # Run on VCS simulator
t/t_BUG.py --nc|--iv|--ghdl  # Likewise on other simulators

测试驱动程序接受许多选项,其中许多与主要的 Verilator 选项对应。例如,前面 的测试本可以在启用调试的情况下运行。完整的测试选项集可以通过如上所示运行 driver.py --help 查看。

最后,在 Verilator Issues 报告该缺陷。 缺陷将公开可见;如果这不可接受,请将缺陷报告邮寄至 wsnyder@wsnyder.org。

最小化引发缺陷的代码

在某些情况下,导致缺陷的那部分代码清晰可见,设计可以轻松地手动精简。在 另一些情况下,缺陷由设计中许多部分的复杂交互引起,不清楚哪些部分是复现 缺陷所必需的。在这些情况下,可以使用一个名为 sv-bugpoint 的开源工具,将 SystemVerilog 设计自动精简为最小可能的复现用例。它可用于自动将包含数十万行的设计精简为 最小测试用例,同时保留引发缺陷的行为。

使用 --debug 或 --dump-inputs 时,Verilator 会写出一个 {prefix}__inputs.vpp 文件,其中包含所有单个输入文件合并并预处理后的 结果,这通常可用作 sv-bugpoint 的输入设计。

关于如何使用 sv-bugpoint 的更多信息,请参阅 sv-bugpoint README。

为 Verilator 做贡献

感谢使用 Verilator!我们欢迎你以任何形式做出贡献。

本贡献文档包含一些建议,可让贡献流程更高效。

你发现了 Verilator 缺陷吗?

  • 请通过搜索 Verilator Issues 确保该 缺陷尚未被报告。

  • 请**下载最新的 GitHub 开发版本**,构建,并查看该问题是否已修复。

  • 如果你找不到描述该问题的未关闭 issue,请 新建一个 Verilator issue。

    • 务必包含一个**代码示例**或**可执行的测试用例**,以演示该缺陷以及 未发生的预期行为。

    • 理想的示例能针对其他仿真器运行,并采用 test_regress/t 测试格式, 如 Verilator Internals Documentation 中所述。

你编写了修复 Verilator 缺陷的补丁吗?

  • 如果还没有描述该缺陷的 issue,请 新建一个 Verilator issue。

  • 请 创建 Verilator 拉取请求。

  • 请参阅发行版中的 docs/internals.rst,或渲染后的 Verilator Internals Documentation, 了解编码约定及其他开发者信息。

  • Verilator 使用 GitHub Actions 提供持续集成。你可能希望在你的 GitHub 分支上启用 Actions,以确保你的更改保持测试通过。

  • 你的源代码贡献必须依据 Developer Certificate of Origin 被认证为开源。在你的首次贡献时, 你必须满足以下之一:

    • 让你的补丁包含将你的姓名添加到 docs/CONTRIBUTORS 的内容(首选)。

    • 通过电子邮件或在 issue 中发布声明,认证你的贡献。

    • 在上述任一情况下,你的姓名将被添加到 docs/CONTRIBUTORS,并且你同意所有未来的贡献也一并被认证。

    • 我们偶尔会接受那些不希望公开姓名的人的贡献。请给我们发电子邮件; 你仍必须私下认证你的贡献。

  • 除非你另有要求,或为你的文件添加 GNU/Artistic 许可证,否则你的测试 贡献通常被视为以 Creative Commons Public Domain (CC0) 发布。

  • 最重要的是我们拿到了你的补丁。

你对 Verilator 有疑问吗?

AI 政策

Verilator 遵循 Linux Foundation 关于在项目所有贡献(包括源代码、测试平台 和文档)中使用生成式大型语言模型人工智能(LLM-AI)工具和代理的建议。

不允许 AI 助手和自动化代理签署贡献。人类提交者对所有 AI 生成内容的审查、 验证和测试负有严格责任。通过提交,贡献者认证所生成内容实际上是其工作 成果,并符合项目标准。当人类贡献者按照 docs/CONTRIBUTORS 中所述签署 Developer Certificate of Origin (DCO) 时,即确认了这一责任。

鼓励贡献者在提交信息或 Pull Request 描述中披露对生成式 AI 工具的重要使用, 以保持透明。

贡献者必须确保生成式 AI 工具的条款和条件不会对该工具的输出施加任何与 Verilator 的开源许可证、项目的知识产权政策或 Open Source Definition 不一致 的合同限制。

如果 AI 工具的输出中包含任何既有的受版权保护材料(包括第三方开源代码或 文档),贡献者必须在提交前确认其已获得第三方所有者的明确许可,以符合 Verilator 许可政策的方式使用、修改和分发这些材料。

行为准则

我们的贡献者和参与者承诺使我们项目及社区的参与对每个人都是一种积极体验。 我们遵循 Contributor Covenant version 1.4。

谢谢!

FAQ/常见问题解答

问题

我可以做贡献吗?

请做贡献!只需提交一个拉取请求,或者如果你在寻找可以帮忙的方向,提出一个 issue 进行讨论。更多信息见我们的贡献者协议。

Verilator 的使用有多广泛?

Verilator 被许多最大的芯片设计公司、像 CERN 这样的大型组织,甚至大学生 项目所使用。

Verilator 是 "四大" 仿真器之一,即可用的四款领先 SystemVerilog 仿真器之一, 即闭源产品 Synopsys VCS (tm)、Mentor Questa/ModelSim (tm)、Cadence Xcelium/Incisive/NC-Verilog/NC-Sim (tm),以及开源的 Verilator。这三款闭源 产品通常被统称为 "三大" 仿真器。

Verilator 能在 Windows 下运行吗?

可以,理想情况下在适用于 Linux 的 Windows 子系统 (WSL2) 下运行 Ubuntu。 或者使用 Cygwin,不过这往往更慢且未定期测试。Verilated 输出也可以在 Microsoft Visual C++ 下编译,但同样未定期测试。

你们能提供二进制文件吗?

在许多 Linux 发行版(包括 Debian、Ubuntu、SuSE、Red Hat 等)上,你可以通过 系统包管理器(apt、yum 等)安装 Verilator。这些包由 Linux 发行版提供,通常 会落后于 Verilator 主仓库的版本。如果你的发行版没有可用的二进制包,何不 自己建立一个呢?

它怎么能比(某个三大闭源仿真器)更快?

通常,这个问题的隐含部分是 "... 在他们能投入开发它的所有人力的情况下。"

大多数仿真器必须符合完整的 IEEE 1364 (Verilog) 和 IEEE 1800 (SystemVerilog) 标准,这意味着它们必须是事件驱动的。这使它们无法重新排序 块并进行网表式优化,而大部分收益正来自后者。

你不应因不符合标准而害怕。你的综合工具一开始就不完全符合整个标准,因此 你的仿真器也不必如此。Verilator 更接近综合的解释方式,这对得到可工作的硅片 来说是件好事。

Verilator 的输出会保持在我自己的许可证/版权之下吗?

你的 SystemVerilog、VPI/DPI 或 main() C++ 代码保持在你自己许可证之下。

这就像在你的程序上使用 GCC 不会改变你程序的版权一样;这就是为什么 Verilator 使用 "GNU Lesser Public License Version 3" 而不是更典型的 "GNU Public License"。详情见许可证。

一些示例:

  • 输入到 Verilator 的任何 SystemVerilog 或其他输入仍归你所有。

  • Verilator 调用的你的任何 VPI/DPI C++ 例程仍归你所有。

  • 调用 Verilator 的你的任何 main() C++ 代码仍归你所有。

  • 如果你修改 Verilator 本身,例如修改或添加仓库中 src/ 目录下的文件,你 必须在 GNU Lesser Public License 下提供源代码。

  • 如果你修改 Verilator 提供的头文件,例如仓库中 include/ 下的头文件,你 必须在 GNU Lesser Public License 下提供源代码。

你还可以选择使用 Perl Artistic License,它同样不要求你发布你的 Verilog、 C++ 或生成的代码。该许可证还允许你为内部使用修改 Verilator 而不分发修改 版本。但请回馈社区!

在这两种许可证下,你都可以提供基于 Verilator 直接构建或嵌入其中的商业 产品。然而,在这两种许可证下,你为此类产品对 Verilator 所做的任何修改都 必须开源。

按照开源的惯例,回馈给 Verilator 的贡献将置于 Verilator 版权和 LGPL/Artistic 许可证之下。小型测试用例将发布到公共领域以便在任何地方使用, 大型测试则在 LGPL/Artistic 之下,除非另有要求。

为什么运行 Verilator(创建模型)这么慢?

Verilator 可能比生成的仿真需要更多内存,因为 Verilator 会在内部创建生成 仿真器的所有状态以对其进行优化。如果耗时超过几分钟左右(且你没有使用 --debug,因为调试模式受磁盘限制),请查看你的机器是否在换页; 最可能的是,你需要在内存更大的机器上运行它。已知非常大的设计会超过 64 GB 常驻集大小。或者,见 层级 Verilation。

如何在 C++ 中生成波形(跟踪)?

在 SystemC 模式下进行跟踪请另见下一个问题。

  1. 向 Verilator 传递 --trace-vcd 选项。然后你可以使用 $dumpfile 和 $dumpvars 来启用跟踪,与任何 Verilog 仿真器一样, 尽管 Verilator 会忽略 $dumpvars 的参数。见发行版中的 examples/make_tracing_c。

    如果编写顶层 C 代码,请调用 Verilated::traceEverOn(true);如果使用 --binary,这会为你完成。

  2. 或者,为了更细粒度的控制,或针对包含多个 Verilated 模块的 C++ 文件, 你也可以纯粹从 C++ 创建跟踪。创建一个 VerilatedVcdC 对象,并在你的主 循环中,紧接 eval() 之后每个时间步调用 trace_object->dump(contextp->time()),最后调用 trace_object->close()。

    #include "verilated_vcd_c.h"
    ...
    int main(int argc, char** argv) {
        const std::unique_ptr<VerilatedContext> contextp{new VerilatedContext};
        ...
        Verilated::traceEverOn(true);
        VerilatedVcdC* tfp = new VerilatedVcdC;
        topp->trace(tfp, 99);  // Trace 99 levels of hierarchy (or see below)
        // tfp->dumpvars(1, "t");  // trace 1 level under "t"
        tfp->open("obj_dir/t_trace_ena_cc/simx.vcd");
        ...
        while (contextp->time() < sim_time && !contextp->gotFinish()) {
            contextp->timeInc(1);
            topp->eval();
            tfp->dump(contextp->time());
        }
        tfp->close();
    }
    

你还需要编译 verilated_vcd_c.cpp 并将其加入你的链接,最好是向 Makefile 的 $(VK_GLOBAL_OBJS) 链接规则中添加依赖项。如果你使用 Verilator 的 --binary 或 --exe 选项,这会为你完成。

如果你希望所有数据都落到同一个输出文件中,可以对多个 Verilated 对象使用 同一个跟踪文件调用 trace_object->trace()。

如何在 SystemC 中生成波形(跟踪)?

  1. 向 Verilator 传递 --trace-vcd 选项,并在你的顶层 sc_main() 中调用 Verilated::traceEverOn(true)。然后你可以使用 $dumpfile 和 code:$dumpvars 来启用跟踪,与任何 Verilog 仿真器一样;见 examples/make_tracing_c 中的非 SystemC 示例。这只会跟踪包含 $dumpvar 的模块。

  2. 或者,你可以纯粹从 SystemC 创建跟踪,它可以跟踪 SystemC 模型中的所有 Verilated 设计。像创建标准 SystemC 跟踪文件一样创建一个 VerilatedVcdSc 对象。示例见发行版中 examples/make_tracing_sc/sc_main.cpp 文件里对 VerilatedVcdSc 的调用,以及下文。

  3. 或者,你可以使用上一个问题中描述的 C++ 跟踪机制;注意时间单位和时间 精度将从你的 SystemC 设置继承。

    #include "verilated_vcd_sc.h"
    ...
    int main(int argc, char** argv) {
        ...
        Verilated::traceEverOn(true);
        VerilatedVcdSc* tfp = new VerilatedVcdSc;
        topp->trace(tfp, 99);  // Trace 99 levels of hierarchy
        tfp->open("obj_dir/t_trace_ena_cc/simx.vcd");
        ...
        sc_start(1);
        ...
        tfp->close();
    }
    

你还需要编译 verilated_vcd_sc.cpp 和 verilated_vcd_c.cpp 并将它们加入你的链接,最好是向 Makefile 的 $(VK_GLOBAL_OBJS) 链接规则 中添加依赖项。如果你使用 Verilator 的 --binary 或 --exe 选项,这会为你完成。

如果你希望所有数据都落到同一个输出文件中,可以对多个 Verilated 对象使用 同一个跟踪文件调用 ->trace()。

如何在 C++ 或 SystemC 中生成 FST 波形(跟踪)?

FST 是 GTKWave 开发的一种跟踪文件格式。Verilator 提供基本的 FST 支持。 要以 FST 格式转储跟踪,请向 Verilator 添加 --trace-fst 选项,并 执行以下之一:

如上面的 VCD 示例所述,在 Verilog 中使用 $dumpfile & $dumpvars,

或者,在 C++ 中修改上面 VCD 示例所述的 include:

#include "verilated_fst_c.h"
VerilatedFstC* tfp = new VerilatedFstC;

或者,在 SystemC 中修改上面 VCD 示例所述的 include:

#include "verilated_fst_sc.h"
VerilatedFstC* tfp = new VerilatedFstSc;

目前不支持在单次仿真中同时支持 FST 和 VCD,但此类用法应该不太可能。不过 你可以在 C++ 主循环中对跟踪格式使用 ifdef,并在编译时选择 VCD 或 FST。

如何查看波形(又名转储或跟踪)?

Verilator 创建标准的 VCD(Value Change Dump)和 FST 文件。VCD 文件可以用 开源 GTKWave、Surfer、Dinotrace(旧式)或许多闭源查看器产品中的 任何一个查看;FST 仅由 GTKWave 和 Surfer 支持。

如何加快写入大型波形(跟踪)文件的速度?

  1. 不要在时间开始时调用 VerilatedVcdC->open 或 $dumpvars,而是推迟 到你希望开始跟踪的时间戳再调用它。

  2. 对任何你从不希望跟踪的非常底层模块(例如库单元)添加 /*verilator&32;tracing_off*/ 元注释。

  3. 使用 --trace-depth 选项限制跟踪深度,例如 --trace-depth 1 只查看顶层信号。

  4. 你也可以考虑使用 FST 跟踪而不是 VCD。FST 转储的大小只是等效 VCD 的 一小部分。FST 跟踪可能比 VCD 跟踪慢,但如果 VCD 文件大小大到无法承受, 它可能是唯一的选择。

  5. 将你的跟踪文件写入机器本地的固态硬盘,而不是网络驱动器。网络驱动器 通常慢得多。

translate_off 命令在哪里?(如何忽略某个构造?)

Translate on/off pragma 通常是个坏主意,因为很容易出现不匹配的成对出现, 而且仅通过预处理代码你无法看到另一个工具看到的内容。请改用预处理器; Verilator 为你定义了 \`VERILATOR 宏,因此只需将代码包裹在 ifndef 区域 中:

`ifndef VERILATOR
   Something_Verilator_Dislikes;
`endif

大多数综合工具同样为你定义 SYNTHESIS。

为什么我会得到 "unexpected 'do'" 或 "unexpected 'bit'" 错误?

do、bit、ref、return 等词是 SystemVerilog 中的保留关键字。 较旧的 Verilog 代码可能将它们用作标识符,你应修改代码不再使用它们,以 确保其能与较新的工具配合工作。或者,用 Verilog 2005/SystemVerilog begin_keywords pragma 将它们包围起来,以指示这是 Verilog 2001 代码。

`begin_keywords "1364-2001"
   integer bit; initial bit = 1;
`end_keywords

如果你希望整个设计按 Verilog 2001 解析,见 --default-language 选项。

如何防止我的断言在复位期间触发?

在你首次调用模型之前调用 Verilated::assertOn(false),然后在复位后重新 打开它。它默认为 true。为 false 时,所有断言都被禁用。

为什么我会得到 "undefined reference to sc_time_stamp()?

在 Verilator 4.200 及更高版本中,建议改用 timeInc 函数。见 连接到 C++ 示例。某些链接器 (MSVC++) 仍然要求定义 sc_time_stamp();要么用 double sc_time_stamp() { return 0; } 定义 它,要么使用 -CFLAGS -DVL_TIME_CONTEXT 编译 Verilated 代码。

在 Verilator 4.200 之前,需要在 C++(非 SystemC)中定义 sc_time_stamp() 函数以返回当前仿真时间。

为什么我会得到 "undefined reference to `VL_RAND_RESET_I' or `Verilated::...'"?

你需要将编译后的 Verilated 代码与 Verilator 套件 include 目录中的 verilated.cpp 文件链接。这是 $(VK_GLOBAL_OBJS) make 变量中的一个 目标,它应属于你 Makefile 的链接规则。如果你使用 --exe 或 --binary,这会为你完成。

支持 PLI 吗?

只在一定程度上支持。更具体地说,常见的类 PLI 调用 $display、$finish、 $stop、$time、$write 会转换为 C++ 等价形式。你也可以使用 "import DPI" SystemVerilog 特性来调用 C 代码(见上一章)。对公共信号还有有限的 VPI 访问。

如果你想要更复杂的功能,由于 Verilator 生成标准 C++ 代码,你可以编写能够 访问和修改信号值而无需任何 PLI 接口代码的 C++ 例程,并用 $c("{any_c++_statement}") 调用它。

见 连接到 Verilated 模型 一节。

如何制作一个包含 C++ 对象的 Verilog 模块?

你需要将该对象添加到 Verilator 创建的结构中,然后使用 $c 调用你对象内部的 方法。发行版中的 test_regress/t/t_extend_class 文件展示了如何做到 这一点的示例。

如何获得更快的构建时间?

  • 运行 make 时,传递 make 变量 VM_PARALLEL_BUILDS=1,使构建并行进行。注意 如果输出文件大到足以因 --output-split 选项而被拆分,现在默认 会设置此项。

  • Verilator 将任何不常执行的 "冷" 例程生成到单独的 __Slow.cpp 文件中。这 可以加速编译,因为可以对这些例程禁用优化。见 OPT_FAST 和 OPT_SLOW make 变量以及 基准测试与优化。

  • 使用较新的编译器。较新的编译器往往更快。

  • 在多台机器上并行编译并使用缓存;网上有 ccache、sccache、distcc 或 icecream 包。ccache 会在相同的源码构建之间跳过 GCC 运行,即使跨不同 用户也如此。如果在构建 Verilator 时安装了 ccache,就会使用它,或见 OBJCACHE 环境变量以覆盖此行为。另见 --output-split 选项和 :ref: Profiling ccache efficiency。

  • 为减少使用 Verilated 模块的类(例如顶层 CPP 文件)的编译时间,你可能 希望向顶层模块添加 /*verilator&32;no_inline_module*/ 元注释。这会减少模型 Verilated 类中的代码量,改善任何实例化顶层 C++ 代码的编译时间,代价是 相对较小的执行性能损失。

  • 使用 层级 Verilation。

为什么我添加一个信号后这么多文件都需要重新编译?

添加一个新信号需要重新编译符号表。Verilator 使用一个大型符号表,使每次 信号访问少 2-3 条汇编指令。这使执行时间快 10-15%,但当有变化时可能导致 更多编译。

如何在 C 中访问 Verilog 函数/任务?

使用 SystemVerilog Direct Programming Interface。你编写一个 Verilog 函数 或任务,其输入/输出与你想在 C 中调用的内容匹配。然后将该函数标记为 DPI 导出函数。见 IEEE 标准中的 DPI 章节。

如何在 Verilog 中访问 C++ 函数/任务?

使用 SystemVerilog Direct Programming Interface。你编写一个 Verilog 函数 或任务,其输入/输出与你想在 C 中调用的内容匹配。然后将该函数标记为 DPI 导入函数。见 IEEE 标准中的 DPI 章节。

如何在 C 中访问信号?

最好的做法是制作一个访问该信号的 SystemVerilog "export DPI" 任务或函数, 如手册中的 DPI 章节和网上的 DPI 教程所述。这将使 Verilator 能更好地优化 模型,并且应可跨仿真器移植。

如果你确实想要对信号的原始访问,请在闭合分号之前用 /*verilator&32;public*/ 元注释声明你将访问的信号。然后作用域 进入 C++ 类以读取信号的值,就像对待任何其他成员变量一样。

信号是适合该信号宽度的最小 8 位无符号 char(等价于 uint8_t)、16 位无符号 short (uint16_t)、32 位无符号 long (uint32_t) 或 64 位无符号 long long (uint64_t)。通常,对于 1 到 32 位你可以只用 uint32_t,对于 1 到 64 位可以 用 uint64_t,编译器会正确地将较小实体向上转换。注意即使是有符号端口也被 声明为无符号;你必须自己符号扩展到适当的信号宽度。

宽于 64 位的信号存储为 32 位 uint32_t 的数组。因此,要读取位 31:0,访问 signal[0];要读取位 63:32,访问 signal[1]。未使用的位(例如 65 位向量的 位 65-96)将始终为零。如果你更改该值,必须在未使用的位中填充零,否则可能 导致核心转储,因为 Verilator 会在它认为不必要的地方去除数组边界检查以 提高性能。

在上面的 SYSTEMC 示例中,如果你的 our.v 中有:

input clk /*verilator public*/;
// Note the placement of the semicolon above

那么在 sc_main.cpp 文件中,你会这样:

#include "Vour.h"
#include "Vour_our.h"
std::cout << "clock is " << top->our->clk << std::endl;

在此示例中,clk 是一个 bool,你可以像任何其他变量一样读取或设置它。普通 信号的值可以被设置,尽管你的代码不应更改时钟,否则会得到奇怪的结果。

模块应该用 Verilog 还是 SystemC 编写?

有时有一个只互连实例的块,你可以选择用 Verilog 还是 SystemC 编写它。在 其他条件相同的情况下,当 Verilator 看到整个设计时性能最好。因此,查看你 设计的层级,将实例标记为 SystemC 或 Verilog。然后:

  • 下方只有 SystemC 实例的模块必须是 SystemC。

  • 下方混合有 Verilog 和 SystemC 实例的模块必须是 SystemC。(因为 Verilator 无法连接到更低层的 SystemC 实例。)

  • 下方只有 Verilog 实例的模块可以是两者之一,但为获得最佳性能应是 Verilog。(例外情况是你的设计被实例化很多次;在这种情况下,Verilate 其中一个较低层模块并将该 Verilated 实例多次实例化到 SystemC 模块中 可能 更快。)

输入语言

本节描述 Verilator 作为输入接受的语言。另见 Verilator 控制文件。

语言标准支持

Verilog 2001 (IEEE 1364-2001) 支持

Verilator 支持大多数 Verilog 2001 语言特性。这包括有符号数、"always @*"、 generate 语句、多维数组、localparam,以及端口列表中的 C 风格声明。

Verilog 2005 (IEEE 1364-2005) 支持

Verilator 支持大多数 Verilog 2005 语言特性。这包括 `begin_keywords 和 `end_keywords 编译器指令、$clog2,以及 uwire 关键字。

SystemVerilog 2005 (IEEE 1800-2005) 支持

Verilator 支持 ==? 和 !=? 运算符,某些上下文中的 ++ 和 --,$bits、 $countbits、$countones、$error、$fatal、$info、$isunknown、$onehot、 $onehot0、$unit、$warning、always_comb、always_ff、always_latch、bit、byte、 chandle、const、do-while、enum、export、final、import、int、interface、 logic、longint、modport、package、program、shortint、struct、time、typedef、 union、var、void、priority case/if,以及 unique case/if。

SystemVerilog 2012 (IEEE 1800-2012) 支持

Verilator 实现了完全符合 SystemVerilog 的预处理器,包括类函数调用式预处理 器 define、默认 define 参数、`__FILE__、`__LINE 和 `undefineall。

SystemVerilog 2017 (IEEE 1800-2017) 支持

Verilator 支持 2017 的 "for" 循环构造以及 IEEE 在 1800-2017 中所做的若干 清理。

SystemVerilog 2023 (IEEE 1800-2023) 支持

Verilator 支持 2023 的部分改进,包括可以包含换行和单引号的三引号字符串块。

Verilator 实现了完全符合 IEEE 1800-2023 的预处理器,包括三引号字符串和 `ifdef 表达式。

Verilog AMS 支持

Verilator 实现了 Verilog AMS(Verilog 模拟与混合信号扩展)的一个很小的 子集,该子集对应于那些在 Verilog IEEE 1364 或 SystemVerilog IEEE 1800 中 有近似等价物的 VMS 关键字。

AMS 解析通过 --language VAMS 或 --language 1800+VAMS 启用。

Verilator 实现了 ceil、exp、floor、ln、log、pow、sqrt、string 和 wreal。

综合指令断言支持

Verilator 读取任何 //synopsys full_case 或 //synopsys parallel_case 指令。同样适用于任何相同形式的 //ambit synthesis、 //cadence 或 //pragma 指令。

当发现这些综合指令时,除非使用 --no-assert-case 选项,Verilator 要么形式化证明该指令为真,要么在无法证明时插入适当的代码以在仿真运行时 检测失败的情况并打印 "Assertion failed" 错误消息。

Verilator 同样还会对 case 语句上的任何 "unique" 或 "priority" SystemVerilog 关键字进行断言,以及 if 语句上的 "unique"。然而,"priority if" 目前被忽略。

时间

使用 --timing 时,支持所有时序控制:

  • 延迟语句,

  • 不仅在进程顶部的 event control 语句,

  • 赋值内时序控制,

  • 线网延迟,

  • wait 语句,

以及所有形式的 fork。

编译使用这些特性的 Verilated 设计需要支持 C++20 协程的编译器,例如 Clang 5、GCC 10 或更新版本。

上升/下降/关断延迟目前不受支持,并会引发 RISEFALLDLY 警告。

最小/典型/最大延迟目前不受支持。始终选择典型延迟。此类表达式会引发 MINTYPMAXDLY 警告。

使用 --timing 的另一个结果是 --main 选项会生成带有 正确时序 eval 循环的 main 文件,从而无需编写任何驱动 C++ 代码。你可以直接 编译该仿真(也许使用 --build)并运行它。

使用 --no-timing 时,所有时序控制都会引发 NOTIMING 错误,但以下情况除外:

  • 延迟语句 - 它们被忽略(如在综合中一样),不过会发出 STMTDLY 警告,

  • 赋值内时序控制 - 它们被忽略,不过会发出 ASSIGNDLY 警告,

  • 线网延迟 - 它们被忽略,

  • 过程顶部的 event control,

Fork 也会引发此错误,但以下情况除外:

  • 不含语句的 fork,

  • 含一条语句的 fork..join 或 fork..join_any,

  • 带 --bbox-unsup 的 fork。

如果既未指定 --timing 也未指定 --no-timing,则所有时序 控制都会引发 NEEDTIMINGOPT 错误,但进程顶部的 event control 除外。Fork 也会引发此错误,但以下情况除外:

  • 不含语句的 fork,

  • 含一条语句的 fork..join 或 fork..join_any,

  • 带 --bbox-unsup 的 fork。

时序控制和 fork 也可以在特定文件或文件的部分中被忽略。 /*verilator&32;timing_off*/ 和 /*verilator&32;timing_off*/ 元注释会使 Verilator 忽略所涵盖的 时序控制和 fork,无论选择的是 --timing 还是 --no-timing 选项。也可以在 Verilator 控制文件中使用 timing_off 和 timing_off 选项来实现。

语言限制

本节描述 Verilator 的语言限制。其中许多限制是有意为之的。

综合子集

Verilator 支持综合子集,并随时间添加其他验证构造。Verilator 还会像 Synopsys 的 Design Compiler 那样仿真事件,即给定如下形式的块:

always @(x) y = x & z;

当 x 有潜在变化或 z 有变化时,这会重新计算 y;也就是当计算 x 或 z 的 触发器求值时(这正是 Design Compiler 将综合的行为)。符合标准的仿真器仅在 x 变化时计算 y。我们建议使用 always_comb 使代码在所有地方行为一致。还要 避免在组合块中放置 $display,因为即使在没有事件顺序规定的情况下,它们 可能在不希望的时候多次打印。

信号命名

为避免与 C 符号命名冲突,信号名中任何既非字母数字也非单个下划线的字符都 将被替换为 __0hh,其中 hh 是该字符的十六进制码。为避免与 Verilator 内部符号冲突,任何双下划线都会被替换为 `___05F`(5F 是下划线的十六进制 码。)

Bind

Verilator 仅支持绑定到目标模块名,而不支持绑定到实例路径。

类

Verilator 的类支持有限,但正在积极开发中。Verilator 支持成员、方法、类 继承和类参数。

点式跨层级引用

Verilator 支持对不同模块中变量、函数和任务的点式引用。点之前的部分必须 有常量值;例如 a[2].b 可接受,而 a[x].b 通常不可接受。

对生成实例和数组实例的引用使用 Verilog 标准中指定的实例名;数组实例在 Verilog 中命名为 {instanceName}[{instanceNumber}],在生成的 C++ 代码 中变为 {instanceName}__BRA__{instanceNumber}__KET__。

锁存器

Verilator 针对边沿敏感(基于触发器)的设计进行了优化。它会尝试对锁存器 做正确的事情,但围绕锁存器的大部分性能优化将被禁用。

结构体与联合体

所有结构体和联合体一起调度,这意味着不支持结构体的一个成员来自阻塞赋值、 另一个来自非阻塞赋值。

未知状态

Verilator 主要是一个二态仿真器,而不是四态仿真器。然而,它有两个特性可以 揭示大多数初始化缺陷(包括许多四态仿真器会遗漏的缺陷)。

当两侧都不是常量时,同一性比较(=== 或 !==)会被转换为标准的 ==/!=。 这可能使表达式产生与四态仿真器不同的结果。与 X 的 === 比较将始终为假, 因此检查未初始化逻辑的 Verilog 代码不会被触发。

将 X 赋值给变量会赋值一个由 --x-assign 选项确定的常量值。这允许 运行时随机化;因此,如果使用了该值,随机值应会导致下游错误。整数也会被 随机化,尽管 Verilog 2001 规范说它们初始化为零。然而,随机化发生在初始化 时;因此,在单次仿真运行中,每次执行该赋值时都会使用相同的常量(但是 随机的)值。

根据 --x-initial 设置,所有变量通常使用某个函数进行随机初始化。 你可以通过运行若干次随机仿真来确认复位工作正常。第一次运行时,让函数将 变量初始化为零。第二次时,让它将变量初始化为一。第三次及之后的运行中, 让它随机初始化。如果结果匹配,则复位工作正常。(注意这就是硬件会做的 事情。)在实践中,启动时将所有变量设置为一能发现最多问题(因为控制信号 通常是高有效的)。

--x-assign 适用于显式初始化或赋值为 X 的变量。未初始化的时钟被 初始化为零,而所有其他状态保持变量被初始化为随机值。事件驱动仿真器通常 会在从 X 到 1 的转换(posedge)或从 X 到 0 的转换(negedge)时触发边沿。 然而,默认情况下,由于时钟初始化为零,Verilator 不会触发初始 negedge。 某些代码(特别是复位相关代码)可能依赖 X->0 触发边沿。--x-initial-edge 选项启用此行为。比较使用和不使用此选项的运行将发现此类问题。

三态/双向

Verilator 将一些简单的三态结构转换为二态。还支持 pullup、pulldown、bufif0、 bufif1、notif0、notif1、pmos、nmos、tri0 和 tri1。也支持与 === 1'bz 的简单比较。

如下形式的赋值:

inout driver;
wire driver = (enable) ? output_value : 1'bz;

将被转换为:

input driver;        // Value being driven in from "external" drivers
output driver__en;   // True if driven from this module
output driver__out;  // Value being driven from this module

将需要外部逻辑来将这些信号与任何外部驱动组合起来。

函数和任务内部不支持三态驱动;那里的 inout 将被视为被读写而不是四态的 二态变量。

门原语

二态门原语(and、buf、nand、nor、not、or、xnor、xor)会直接转换为行为 等价物。不支持三态和 MOS 门原语。支持用户自定义原语(UDP)表。

Specify 块

所有 specify 块和时序检查都被忽略。所有 min:typ:max 延迟使用典型值。

数组初始化

初始化大型数组时,你需要使用非延迟赋值。当需要修正时 Verilator 会告诉你; 更多信息见 BLKLOOPINIT 错误。

数组越界

在数组指定边界之外写入内存元素可能导致改为写入数组内的另一个内存元素。 对于 2 的幂大小的数组,Verilator 会给出宽度警告和地址。对于非 2 的幂大小 的数组,将写入索引 0。

在数组指定边界之外读取内存元素会给出宽度警告并环绕 2 的幂大小。对于非 2 的幂大小,它将返回适当宽度的未指定常量。

断言

Verilator 部分支持断言和断言驱动的功能覆盖率。

覆盖率

Verilator 部分支持 SystemVerilog 功能覆盖率,包括 covergroup、 coverpoint、bin、交叉覆盖和转换 bin。见 Covergroup 覆盖率。

加密 Verilog

如 Verilator 这样的开源仿真器不能使用加密 RTL(即 IEEE P1735)。请与你的 IP 供应商讨论使用 Verilator 的 --protect-lib 特性交付 IP 块。

语言关键字限制

本节描述每个语言关键字的特定限制。

`__FILE__, `__LINE__, `begin_keywords, `begin_keywords, `begin_keywords, `begin_keywords, `begin_keywords, `define, `else, `elsif, `end_keywords, `endif, `error, `ifdef, `ifndef, `include, `line, `systemc_ctor, `systemc_dtor, `systemc_header, `systemc_header_post, `systemc_imp_header, `systemc_implementation, `systemc_interface, `undef, `verilog

完全支持。

always, always_comb, always_ff, always_latch, and, assign, begin, buf, byte, case, casex, casez, default, defparam, do-while, else, end, endcase, endfunction, endgenerate, endmodule, endspecify, endtask, final, for, function, generate, genvar, if, initial, inout, input, int, integer, localparam, logic, longint, macromodule, module, nand, negedge, nor, not, or, output, parameter, posedge, reg, scalared, shortint, signed, supply0, supply1, task, time, tri, typedef, var, vectored, while, wire, xnor, xor

通常支持。

++, -- 运算符

自增/自减只能用作独立语句,或在某些有限的情况下使用。

'{} 运算符

支持基于顺序、默认、常量整数(数组)或成员标识符(结构体/联合体)键的 赋值模式。不支持数据类型键以及从常量表达式计算得到的键。

`uselib

Uselib 是一种供应商特定的库指定方法,它连同其后的任何内容直到该行末尾 都会被忽略。

cast 运算符

仅支持简单标量类型之间的类型转换,支持有符号和无符号,不支持数组和 结构体。

chandle

被视为 "longint";尚不会对 chandle 上指定为非法的操作发出警告。

checker

被视为 "module";尚不会对 checker 内许多非法的构造发出警告。

disable

仅当被禁用的块是 disable 语句自身所在的那个块时,才能使用 disable 语句。在 SystemVerilog 添加 break 和 continue 关键字之前,这通常用于 提供循环 break 和 continue 功能。

force, release

Verilator 支持过程式 force`(以及相应的 `release)语句。然而, force 语句的行为并不完全符合 IEEE 1800-2023:

  1. 目前不支持将强制变量用作另一个 force 语句的值。依赖的 force 语句由 初始常量值强制。

  2. 不支持带过程式连续赋值的 force/release。该赋值被视为过程式。

  3. 在强制右侧使用多个变量引用或函数调用的表达式不响应依赖关系变化。

inside

Inside 表达式不能包含非压缩数组遍历或将 $ 用作上界。case inside 和 case matches 也不受支持。

interface

支持接口和 modport,包括生成的数据类型。不支持 modport 周围的 generate 块,也不支持虚拟接口和未命名接口。

shortreal

短浮点数(shortreal)会被转换为 real。大多数其他仿真器要么不支持 float,要么同样进行转换。

specify specparam

所有时序检查和 specify 块(除 specparam 外,后者受支持)都被忽略。

uwire

Verilator 不对 uwire 执行警告检查;它将 uwire 关键字当作普通 wire 关键字处理。

$bits, $countbits, $countones, $finish, $isunknown, $onehot, $onehot0, $signed, $stime, $stop, $time, $unsigned,

通常支持。

$dump/$dumpports 及相关

$dumpfile 或 $dumpports 会创建一个 VCD 或 FST 文件(取决于 Verilate 模型时给定的 --trace-vcd 选项)。这将在下一次 eval() 调用时 生效。如果你在同一个 C 模型下有多个 Verilated 设计,这只会转储包含 $dumpvars 的设计的信号。

$dumpvars 和 $dumpports 的模块标识符被忽略;被跟踪的实例将始终从设计 顶部开始。levels 参数也被忽略;请改用 tracing_on/tracing_off pragma。

$dumpportson/$dumpportsoff/$dumpportsall/$dumpportslimit 的文件名参数被 忽略;同一时间只能有一个跟踪文件处于活动状态。

$dumpall/$dumpportsall、$dumpon/$dumpportson、$dumpoff/$dumpportsoff 和 $dumplimit/$dumpportlimit 目前被忽略。

$error, $fatal, $info, $warning.

通常支持。

$exit, $finish, $stop

$finish 和 $stop 很少使用的可选参数被忽略;$exit 是 $finish 的别名。

$fopen, $fclose, $fdisplay, $ferror, $feof, $fflush, $fgetc, $fgets, $fscanf, $fwrite, $fscanf, $sscanf

通常支持。

$fullskew, $hold, $nochange, $period, $recovery, $recrem, $removal, $setup, $setuphold, $skew, $timeskew, $width

所有 specify 块和时序检查都被忽略。

$random, $urandom, $urandom_range

如果没有 $random 或 $urandom 的可选参数来设置种子,请使用 +verilator+seed+<value> 运行时选项来设置种子。对于 $random 每个 C 线程有一个随机种子,而不是每个模块一个;对于 $urandom/$urandom_range 的随机稳定性,也不是每个对象一个。

$readmemb, $readmemh

支持读取内存命令。Verilator 和 Verilog 规范都不包含对多维数组 readmem 的支持。

$stacktrace

$stacktrace 系统调用将显示 C++ 栈,而不是 Verilog 调用栈,不过函数名 通常相互关联。要获得符号名,模型必须有调试符号,例如使用 -CFLAGS -ggdb -LDFLAGS -ggdb -LDFLAGS -rdynamic 编译。

$test$plusargs, $value$plusargs

支持,但实例化它的 C++/SystemC 包装器必须在调用 $test$plusargs 或 $value$plusargs 之前调用

{VerilatedContext*} ->commandArgs(argc, argv);

以注册命令行。或使用 --binary 或 --main。

语言扩展

以下附加构造是 Verilator 在标准 Verilog 代码之上支持的扩展。在注释或 "ifdef" 之外使用这些特性可能会破坏其他工具。

""" [string] """

三引号块指定一个可以包含换行和单引号的字符串。此扩展在 IEEE 1800-2023 中被标准化。

`__FILE__

`__FILE__ define 展开为当前文件名字符串,类似 C++ 的 __FILE__。这个 Verilator 特性添加于 2006 年,并被纳入 IEEE 1800-2009。

`__LINE__

`__LINE__ define 展开为当前行号,类似 C++ 的 __LINE__。这个 添加于 2006 年的 Verilator 特性被纳入 IEEE 1800-2009。

`coverage_block_off

指定整个 begin/end 块在覆盖率分析中应被忽略。必须位于代码块内部,例如 在 begin/end 对中。与 Verilator 控制文件 中的 coverage_block_off 相同。

`error [string]

当预处理器发出它时会报告错误,类似于 C++ 的 #error。

`line

作为特例,`line `__LINE__ "filename" 允许设置文件名而不更改行号。 这用于某些内部测试,使调试时行号仍能正确指向测试文件的行号。

`systemc_class_name

在某个 `systemc_... 文本块内部,替换为为 给定包含 SystemVerilog 类或模块生成的 C++ 类名。目前这是盲目替换的, 忽略引号或其他转义;此行为将来可能改变。此属性缩进只是为了在 verilated_std.sv 内部使用。

`systemc_ctor

取剩余文本直到下一个 `verilog 或 `systemc_... 模式切换,并原样放入 C++ 类 构造函数中。必须作为模块或类项放置,例如直接位于 module/endmodule 或 class/endclass 对内。尽管此宏的名称如此,它也能在纯 C++ 代码中工作。

`systemc_dtor

取剩余文本直到下一个 `verilog 或 `systemc_... 模式切换,并原样放入 C++ 类 析构函数中。必须作为模块或类项放置,例如直接位于 module/endmodule 或 class/endclass 对内。尽管此宏的名称如此,它也能在纯 C++ 代码中工作。

`systemc_header

取剩余文本直到下一个 `verilog 或 `systemc_... 模式切换,并原样放入输出 .h 文件的头部。必须作为模块或类项放置,例如直接位于 module/endmodule 或 class/endclass 对内。尽管此宏的名称如此,它也能在纯 C++ 代码中工作。

`systemc_header_post

取剩余文本直到下一个 `verilog 或 `systemc_... 模式切换,并原样放入输出 .h 文件头部中类定义之后。必须作为模块或类项放置,例如直接位于 module/endmodule 或 class/endclass 对内。尽管此宏的名称如此,它也能在 纯 C++ 代码中工作。

`systemc_imp_header

取剩余文本直到下一个 `verilog 或 `systemc_... 模式切换,并原样放入此 C++ 类实现的所有文件的头部。必须作为模块或类项放置,例如直接位于 module/endmodule 或 class/endclass 对内。尽管此宏的名称如此,它也能在 纯 C++ 代码中工作。

`systemc_implementation

取剩余文本直到下一个 `verilog 或 `systemc_... 模式切换,并原样放入 C++ 类 实现的单个文件中。必须作为模块或类项放置,例如直接位于 module/endmodule 或 class/endclass 对内。尽管此宏的名称如此,它也能在 纯 C++ 代码中工作。

如果你将在 C++ 函数中读写任何 Verilog 变量,Verilog 信号必须用 /*verilator&32;public*/ 元注释声明。另见 public task 特性; 编写一个访问器可能会得到更清晰的代码。

`systemc_interface

取剩余文本直到下一个 `verilog 或 `systemc_... 模式切换,并原样放入 C++ 类 接口。必须作为模块或类项放置,例如直接位于 module/endmodule 或 class/endclass 对内。尽管此宏的名称如此,它也能在纯 C++ 代码中工作。

`SYSTEMVERILOG

当 --language 为 "1800-*" 时,默认定义 SYSTEMVERILOG、SV_COV_START 及相关标准预定义宏。

`VERILATOR
`verilator
`verilator3

默认定义 VERILATOR、verilator 和 verilator3 预定义宏,以便你可以用 "`ifdef" 包围工具特定的构造。

`verilator_config

取剩余文本直到下一个 `verilog 模式切换,并将其视为 Verilator 控制文件命令。见 Verilator 控制文件。

`VERILATOR_TIMING

当使用 --timing 时设置 VERILATOR_TIMING define,以允许对依赖 此特性的代码使用 "`ifdef"。注意此 define 不受 timing_off 控制文件选项或时序元注释影响。

`verilog

在 `systemc_... 模式切换后切换回处理 Verilog 代码。Verilog 代码返回到用 "`begin_keywords" 指定的最后一个 语言模式,如果未指定则为 SystemVerilog。

$c([string], ...);, $cpure([string], ...);

该字符串将在周围 Verilog 代码编译的位置直接嵌入输出 C++ 代码中。它 可以是独立语句(字符串中带尾随 ;),也可以是一个返回最多 32 位数字的 函数(不带尾随 ;)。这可用于从你的 Verilog 代码调用 C++ 函数。

字符串参数将直接放入输出 C++ 代码中,但单词 'this'(即对象指针)可能 被替换为不同的指针,因为 Verilator 可能会用非成员函数实现逻辑。因此, 对类成员的任何引用都必须通过显式的 'this->' 指针解引用进行。

表达式参数将插入求值该表达式的代码。因此要调用 C++ 函数, $c("func(",a,")") 会在输出 C++ 代码中得到 func(a)。对于输入 参数,不要在字符串 $c("func(a)") 中硬编码变量名,而应将变量作为 表达式传递:$c("func(",a,")")。这将使调用能在 Verilog 函数内部 工作(其中变量会被展平),并启用其他优化。

Verilator 不使用引号内的任何文本进行排序/调度。如果你需要在特定时间 调用 $c,例如当变量变化时,则 $c 必须位于适当的敏感度语句下,例如 always @(posedge clk) $c("func()") 在每个边沿调用它,或者例如 always @* c("func(",a,")") 在 a 变化时调用它(后者能工作是因为 a 在引号之外)。

如果你将在 C++ 函数内部读写任何 Verilog 变量,Verilog 信号必须用 /*verilator&32;public*/ 元注释声明。

你也可以在 $c 后附加一个数字,指定输出的位宽,例如 signal_32_bits = $c32("...");。这允许与其他仿真器兼容,后者要求 每个不同输出宽度使用不同命名的 PLI 函数名。

$cpure 类似于 $c,只是它指示表达式是纯的,而 $c 被假定为不纯。 $cpure 仅供内部使用,在任何未来版本或 Verilator 中可能未经通知而 改变。

$display, $write, $fdisplay, $fwrite, $sformat, $swrite

格式参数可以在 % 转义之后使用 C fprintf 大小。根据 Verilog 标准,%x 按自然宽度打印数字,%0x 按最小宽度打印数字。Verilator 对此扩展使 %5x 按 C 标准打印 5 位数字。此扩展被标准化进 1800-2009。

$get_initial_random_seed()

返回一个整数,包含用于仿真的初始随机种子。这是通过 +verilator+seed+<value> 运行时选项提供的值。如果未指定种子, 则返回默认初始化种子(通常为 0)。IEEE 1800-2023 未定义此项,但大多数 仿真器支持它。

$stacktrace

作为任务调用时,打印堆栈跟踪。作为函数调用时,返回带堆栈跟踪的字符串。 这依赖于 C++ 系统跟踪,如果模型未使用调试符号编译,结果可能意义不大。 此外,数据表示的是 C++ 堆栈;涉及的 SystemVerilog 函数/任务在成为可能 在堆栈跟踪中可见的 C++ 函数之前可能被重命名和/或内联。此扩展在 IEEE 1800-2023 中被标准化。

$timeprecision

以整数返回模型的时间精度。此扩展是实验性的,可能在不弃用的情况下被 移除。

$timeunit

以整数返回当前模块的时间单位。此扩展是实验性的,可能在不弃用的情况下 被移除。

/*verilator&32;clock_enable*/

已弃用且无效果(被忽略)。

在 5.000 之前的版本中:

在信号声明之后使用,指示该信号用于门控时钟,用户负责确保没有与之相关 的竞争。(通常通过添加锁存器并运行静态时序分析。)例如:

reg enable_r /*verilator clock_enable*/;
wire gated_clk = clk & enable_r;
always_ff @(posedge clk)
  enable_r <= enable_early;

clock_enable 属性会使时钟门控在调度算法中被忽略,有时这是正确时钟行为 所必需的,并且总能改善性能。

与 clock_enable 控制文件选项相同。

/*verilator&32;clocker*/
/*verilator&32;no_clocker*/

已弃用且无效果(被忽略)。

在 5.042 之前的版本中:

指定该信号是否用作时钟。见 --clk。

与配置文件中的 clocker 和 no_clocker 相同。

/*verilator&32;coverage_block_off*/

指定整个 begin/end 块在覆盖率分析中应被忽略。

与 coverage_block_off 控制文件选项相同。

/*verilator&32;coverage_off*/

指定其后的代码行应禁用覆盖率。通常用于在覆盖率分析中忽略整个模块。

/*verilator&32;coverage_on*/

指定其后的代码行应在先前用 /*verilator&32;coverage_off*/ 禁用后重新启用覆盖率(如果 传入了适当的 --coverage 标志)。

/*verilator&32;dpi_c_decl "<C function declaration>"*/

指定将为给定 DPI-C 函数生成到 Verilator 生成的 __Dpi.h 头文件中的 C 函数声明,替换 Verilator 默认使用 Verilog 函数签名构建的声明。

这允许使用类型未在标准中指定的 C 函数。例如,它允许使用返回 char* 的函数:

module t;
  import "DPI-C" function string getenv(input string arg) /*verilator dpi_c_decl "char* getenv(const char*)"*/;

  initial begin
    $display("%s", getenv("HOME"));
  end
endmodule
/*verilator&32;fargs <arguments>*/

仅供 Verilator 开发者使用。当包含这些 fargs 元注释的源文件通过 -f 或 -F 选项在命令行上传递给 Verilator 时,提供的 参数将如同在命令行上指定一样被添加。源文件在解析参数之前不会被预处理, 并且所有 fargs 注释都会生效,即使放置在非活动的 `ifdef 之下。

/*verilator&32;forceable*/

指定该信号(线网或变量)应通过生成公共的 <signame>__VforceEn 和 <signame>__VforceVal 信号而可从 C++ 代码强制。强制控制信号创建为 public_flat 信号。

要从 C++ 强制一个被标记的信号,将相应的 __VforceVal 变量设置为所需 值,并将 __VforceEn 信号设置为指示要强制该信号哪些位的位掩码。要强制 目标信号的所有位,将 __VforceEn 设置为全一。要释放该信号(或其部分), 将 __VforceEn 信号的相应位设置为零。

与配置文件中的 forceable 相同。

/*verilator&32;hier_block*/

指定该模块是层级 Verilation 的一个单元。此元注释必须位于 module module_name(...); 和 endmodule 之间。在层级 Verilation 中,该模块不会被内联,也不会为每个实例唯一化。注意除非指定了 --hierarchical 选项,否则该元注释会被忽略。

见 层级 Verilation。

/*verilator&32;inline_module*/

指定注释所在的模块可以内联到任何使用此模块的模块中。这对加速仿真运行 时很有用。注意如果使用 --public,被内联子模块下的信号将被 命名为 {submodule}__DOT__{subsignal},因为 C++ 不允许信号名中出现 "."。

与 inline 控制文件选项相同。

/*verilator&32;isolate_assignments*/

已弃用且无效果(被忽略)。

在 5.050 之前的版本中:

在信号声明之后使用,指示任何块中对该信号的赋值应被隔离到新的块中。 当大型组合块导致 UNOPTFLAT 警告时,将其附加到导致假循环的 信号上可能可以绕过该警告。

即,对于以下内容:

reg splitme /* verilator isolate_assignments*/;
// Note the placement of the semicolon above
always_comb begin
  if (....) begin
    splitme = ....;
    other assignments
  end
end

Verilator 会在内部将赋值给 "splitme" 的块拆分为两个块:

然后它会在内部将其拆分为(大致):

// All assignments excluding those to splitme
always_comb begin
  if (....) begin
    other assignments
  end
end
// All assignments to splitme
always_comb begin
  if (....) begin
    splitme = ....;
  end
end

与 isolate_assignments 控制文件选项相同。

/*verilator&32;lint_off <msgs>*/

对注释之后的任何警告禁用指定的警告消息。可以指定多条消息,用逗号分隔。

如果使用单行斜杠-斜杠格式注释,则元注释在换行处或更早的下一个 斜杠-斜杠处结束。这允许注释禁用的原因,例如 // verilator lint_off MSG // Because...。

/*verilator&32;lint_on <msgs>*/

对注释之后的任何警告重新启用指定的警告消息。可以指定多条消息,用逗号 分隔。

/*verilator&32;lint_restore*/

在 /*verilator&32;lint_save*/ 之后,弹出包含 lint 消息状态的栈。 这通常在 include 文件底部很有用。

/*verilator&32;lint_save*/

将哪些 lint 消息开启或关闭的当前状态压入栈。之后的元注释随后可以 lint_on 或 lint_off 特定消息,然后通过 /*verilator&32;lint_restore*/ 返回到先前的消息状态。例如:

// verilator lint_save
// verilator lint_off WIDTH
...  // code needing WIDTH turned off
// verilator lint_restore

如果 WIDTH 在 lint_off 之前是开启的,现在将恢复为开启;如果它在 lint_off 之前是关闭的,则保持关闭。

/*verilator&32;no_inline_module*/

指定注释所在的模块不应内联到任何使用此模块的模块中。

与 no_inline 控制文件选项相同。

/*verilator&32;no_inline_task*/

用于函数或任务变量定义部分,指定该函数或任务不应内联到使用它的地方。 当某个任务被非常大量地使用时,这可以减小最终可执行文件的大小。要使 此标志生效,该任务及其下方的任务必须是纯的;它们不能引用任务自身之外 的任何变量。

与 no_inline 控制文件选项相同。

/*verilator&32;public*/ (on parameter)

用于参数声明之后,指示生成的 C 代码应使参数值可见。由于 C++ 语言限制, 这只能用于 64 位或更窄的整型枚举。

parameter [2:0] PARAM /*verilator public*/ = 2'b0;
/*verilator&32;public*/ (on task/function)

用于函数或任务声明的声明部分内部,指示该函数或任务应变为 C++ 函数, 对外部调用者公开。公共任务将被声明为 void C++ 函数,公共函数将获得 适当的非 void(bool、uint32_t 等)返回类型。任何输入参数将成为函数的 C++ 参数。任何输出参数将成为 C++ 引用参数。任何局部寄存器/整数将 成为栈上的函数自动变量。

超过 64 位的宽变量不能作为函数返回,以避免暴露复杂性。但是,宽变量 可以作为输入/输出;它们将作为对 32 位数字数组的引用传递。

通常,只应写入存储状态(触发器)的值,因为模型不会注意到这些函数中 对变量所做的更改。(与信号声明为 public 时相同。)

你可能想改用 DPI 导出,因为它与其他仿真器兼容。

与 public 控制文件选项相同。

/*verilator&32;public*/ (on typedef enum)

用于 enum typedef 声明之后,指示生成的 C 代码应使枚举值可见。由于 C++ 语言限制,这只能用于 64 位或更窄的整型枚举。

typedef enum logic [2:0] { ZERO = 3'b0 } pub_t /*verilator public*/;
/*verilator&32;public*/ (on variable)

用于 input、output、register 或 wire 声明之后,指示该信号应被声明, 以便 C 代码可以读取或写入该信号的值。这还会将此模块声明为 public; 否则,请使用 /*verilator&32;public_flat*/。

与其使用公共变量,不如考虑制作访问该变量的 DPI 或公共函数。这样更好, 因为它提供了一个明显且可跨仿真器兼容的入口点。

与 public 控制文件选项相同。

/*verilator&32;public_[|flat|flat_rd|flat_rw]_on [@(<edge_list>)]*/ (as scope)

用于将多个信号和参数包裹在相应的 public 属性中。 各自的行为见上面的属性。不能嵌套。例如:

/*verilator public_flat_rw_on*/
logic clk;
logic rst;
parameter width = 8;
/* verilator public_off*/
logic data;

等价于:

logic clk /*verilator public_flat_rw*/;
logic rst /*verilator public_flat_rw*/;
parameter width /*verilator public_flat_rw*/ = 8;
logic data;
/*verilator&32;public_flat*/ (on variable)

用于 input、output、register 或 wire 声明之后,指示该信号应被声明, 以便 C 代码可以读取或写入该信号的值。这不会将此模块声明为 public, 这意味着信号名或指向它的路径可能因发生的模块内联而改变。

与 public_flat 控制文件选项相同。

/*verilator&32;public_flat_rd*/ (on variable)

用于 input、output、register 或 wire 声明之后,指示该信号应声明为 public_flat(见上文),但为只读。

与 public_flat_rd 控制文件选项相同。

/*verilator&32;public_flat_rw [@(<edge_list>)]*/ (on variable)

用于 input、output、register 或 wire 声明之后,指示该信号应声明为 public_flat_rd(见上文)且可写。使用 --public-flat-rw 选项时 隐含使用此属性。

边沿列表是可选的且无效果(被忽略)。在 Verilator 5.024 之前,边沿列表 指定写入发生的时间。这不再需要,仅为兼容性而接受。

与 public_flat_rw 控制文件选项相同。

/*verilator&32;public_module*/

用于 module 语句之后,指示该模块不应被内联(除非特别要求),以便 C 代码可以访问该模块。当模块包含公共信号或 `systemc_ 指令时,Verilator 会自动设置此属性。使用 --public 选项时隐含使用此属性。

与 public 控制文件选项相同。

/*verilator&32;public_off*/

终止前一个 /*verilator public*_on*/ 指令;见上文。

/*verilator&32;sc_biguint*/

用于端口声明之后。它将端口设置为 sc_biguint<{width}> 类型,适用于 任何宽度的信号。如果端口宽度是参数化的,且实例化 C++ 代码总是希望 sc_biguint 接受任何宽度,这可能有用。一般来说,你应避免不必要地使用此 属性,因为随着 sc_biguint 使用量的增加,性能会显著下降。

/*verilator&32;sc_bv*/

用于端口声明之后。它将端口设置为 sc_bv<{width}> 类型,而不是 bool、 uint32_t 或 uint64_t。如果端口宽度是参数化的,且实例化 C++ 代码总是 希望 sc_bv 接受任何宽度,这可能有用。一般来说,你应避免不必要地使用此 属性,因为随着 sc_bv 使用量的增加,性能会显著下降。

与 sc_bv 控制文件选项相同。

/*verilator&32;sc_clock*/

已弃用且被忽略。以前用于 input 声明之后,指示该信号应在 SystemC 中 声明为 sc_clock 而不是 bool。这仅在 SystemC 1.1 和 1.2 中需要;2.0 及 更高版本不要求时钟引脚为 sc_clock,因此这不再需要并被忽略。

/*verilator&32;sformat*/

附加到函数或任务的类型为 "input string" 的最后一个参数,以指示该函数 或任务应将所有剩余参数通过 $sformatf 传递。这允许创建具有类似 $display 行为的 DPI 函数。示例见 test_regress/t/t_dpi_display.v 文件。

与 sformat 控制文件选项相同。

/*verilator&32;split_var*/

附加到变量或线网声明,将变量拆分为多个部分,通常用于解决 UNOPTFLAT 性能问题。通常,应附加此属性的变量由 Verilator 自身 推荐;见 UNOPTFLAT。

例如,Verilator 会在内部将带元注释的变量如:

logic [7:0] x [0:1]  /*verilator split_var*/;

转换为:

logic [7:0] x__BRA__0__KET__ /*verilator split_var*/;
logic [7:0] x__BRA__1__KET__ /*verilator split_var*/;

注意生成的压缩变量保留 split_var 元注释,因为它们可能根据访问模式被 拆分为更小的部分。

这仅支持整数类型(reg、logic、bit、byte、int...)的非压缩数组、压缩 数组和压缩结构体;否则,如果请求了拆分但无法进行,会发出 SPLITVAR 警告。拆分大型数组可能会降低 Verilation 速度,因此仅对需要它的变量 使用。

仅通过非重叠、常量索引的位选择或部分选择表达式在本地引用(无层级引用) 的压缩变量会被自动拆分。这涵盖了一种有点常见的用法模式:

logic [1:0][31:0] tmp;

assign tmp[0] = foo    + a;
assign tmp[1] = tmp[1] + b;
assign bar    = tmp[1] + c;

与 split_var 控制文件选项相同。

/*verilator&32;tag <text...>*/

附加到变量或结构体成员之后,指示不透明(对 Verilator 而言)文本,应 作为标签传递到 XML 输出,供下游应用程序使用。

/*verilator&32;timing_off*/

忽略此元注释之后的所有时序构造。所有时序控制的行为如同它们不存在 (与 --no-timing 相同),并且 fork/join* 块会被转换 为 begin/end 块。

与 timing_off 控制文件选项相同。

/*verilator&32;timing_on*/

重新启用此元注释之后的所有时序构造(仅在 timing_off 之后 适用)。

与 timing_on 控制文件选项相同。

/*verilator&32;trace_init_task*/

已移除。

在 5.024 之前的版本中:

附加到 DPI 导入,指示在初始化跟踪时应调用该函数。此属性缩进只是为了 在 --lib-create 或 --hierarchical 与 --trace-vcd 一起使用时 Verilator 生成的代码内部使用。

/*verilator&32;tracing_off*/

对此模块中声明的所有未来信号,或此模块下的实例禁用波形跟踪。通常将 它放在原语的 module 语句之后,这样整个模块及其下的实例都不会被跟踪。

/*verilator&32;tracing_on*/

对所有未来声明的信号或实例重新启用波形跟踪。

/*verilator&32;unroll_disable*/

用于语句位置,指示同一语句层次紧随其后的循环不应由 Verilator 展开, 忽略 --unroll-count。这类似于 clang 的 #pragma clang loop unroll(disable)。

此选项目前不会禁用(或启用)C++ 编译器对任何进入 Verilated C++ 代码的 循环的展开。

/*verilator&32;unroll_full*/

很少需要。用于语句位置,指示同一语句层次紧随其后的循环应始终由 Verilator 完全展开,忽略 --unroll-count。这类似于 clang 的 #pragma clang loop unroll(full)。

Verilator 控制文件

除命令行外,verilator 命令的警告及其他功能还可以通过 Verilator 控制文件来控制,不要与 IEEE Configurations 块(config...endconfig)混淆。 通常以 .vlt 扩展名命名,使其成为 Verilator 控制文件的是 `verilator_config 指令。当命名为 .vlt 时,这些文件会在源代码 文件之前被读取;如果不希望如此,请将控制文件命名为 .v 或其他后缀。

示例:

`verilator_config
lint_off -rule WIDTH
lint_off -rule CASEX  -file "silly_vendor_code.v"

这会全局禁用 WIDTH 警告,并对特定文件禁用 CASEX。

Verilator 控制文件在解析之前会经过常规的 Verilog 预处理器,因此可以像控制 文件是标准 Verilog 代码一样使用 "`ifdef"、"`define" 和注释。

注意,文件或行特定的控制仅适用于控制文件之后读取的文件。因此建议将控制 文件作为第一个文件传递给 Verilator。

控制命令的语法如下:

`verilator_config

取剩余文本并将其视为 Verilator 控制文件命令。 见 Verilator 控制文件。

clock_enable -module "<modulename>" -var "<signame>"

已弃用且无效果(被忽略)。

在 5.000 之前的版本中:

表示该信号用于门控时钟,用户负责确保没有与之相关的竞争。

与 /*verilator&32;clock_enable*/ 元注释相同。

clocker -module "<modulename>" [-function "<funcname>"] -var "<signame>"
clocker -module "<modulename>" [-task "<taskname>"] -var "<signame>"
no_clocker -module "<modulename>" [-function "<funcname>"] -var "<signame>"
no_clocker -module "<modulename>" [-task "<taskname>"] -var "<signame>"

已弃用且无效果(被忽略)。

在 5.042 之前的版本中:

表示该信号是否用作时钟。Verilator 使用此信息将该信号及任何派生信号 标记为 clocker。见 --clk。

与 /*verilator&32;clocker*/ 元注释相同。

coverage_block_off -file "<filename>" -line <lineno>
coverage_block_off -module "<modulename>" -block "<blockname>"

指定整个 begin/end 块在覆盖率分析中应被忽略。可以指定为命名块,也可以 指定为文件名和行号。

与 /*verilator&32;coverage_block_off*/ 元注释相同。

coverage_off [-file "<filename>" [-lines <line> [ - <line> ]]]
coverage_on  [-file "<filename>" [-lines <line> [ - <line> ]]]

为指定的文件名(或使用 '*' 或 '?' 的通配符,若省略则为所有文件)和行号 范围(若省略则为所有行)启用/禁用覆盖率。通常用于在覆盖率分析中忽略 整个模块。

forceable -module "<modulename>" -var "<signame>"

生成公共的 <signame>__VforceEn 和 <signame>__VforceVal 信号,可以从 C++ 代码强制/释放信号。强制控制信号创建为 public_flat 信号。

与 /*verilator&32;forceable*/ 元注释相同。

fsm_register_wrapper -module "<modulename>" -d "<port>" -q "<port>" -clock "<port>" [-reset "<port>"] [-reset_value "<param>"]

声明指定模块是用于 FSM 覆盖率提取的透明 FSM 状态寄存器包装器。一个声明 适用于该模块的所有实例。

-d 选项命名携带下一状态数据的包装器输入端口。 -q 选项命名携带寄存状态的包装器输出端口。 -clock 选项命名包装器时钟端口。

Verilator 不会从模块或端口命名约定推断包装器语义。必须先使用此选项声明 包装器模块,Verilator 才会使用它的实例来提取 FSM 状态和转换覆盖率。

-reset 和 -reset_value 选项是可选的。仅当可以从包装器的事件控制 推断复位极性,并且 -reset_value 指定了静态参数值时,才会生成复位弧。 如果复位元数据不完整,Verilator 仍可能生成 FSM 状态和转换覆盖率,但 不包含复位弧。

full_case -file "<filename>" -lines <lineno>

与 //synthesis full_case 相同。当发现这些综合指令时,Verilator 要么 形式化证明该指令为真,要么在无法证明时插入适当的代码以在仿真运行时 检测失败的情况并打印 "Assertion failed" 错误消息。

hier_block -module "<modulename>"

指定该模块是层级 Verilation 的一个单元。注意,除非指定了 --hierarchical 选项,否则该设置会被忽略。见 层级 Verilation。

hier_params -module "<modulename>"

指定该模块包含 --hierarchical 块的参数。此选项在内部用于为 去参数化的 hier 块实例指定参数。 此选项不应直接使用。 见 层级 Verilation。

hier_workers -hier-dpi "<function_name>" -workers <worker_count>

指定调度层级 DPI 任务需要使用多少个线程。此数据在 --hierarchical 期间根据 hier_workers -module 中指定的值在 内部插入。此选项不应直接使用。见 层级 Verilation。

hier_workers -module "<module_name>" -workers <worker_count>

指定调度带有 /*verilator&32;hier_block*/ 元注释的给定模块需要 使用多少个线程。此数字需要小于 --threads 才能适配到线程调度中。 见 层级 Verilation。

inline -module "<modulename>"

指定该模块可以内联到任何使用此模块的模块中。与 /*verilator&32;inline_module*/ 元注释相同。

no_inline -module "<modulename>"

指定该模块不应内联到任何使用此模块的模块中。与 /*verilator&32;no_inline_module*/ 元注释相同。

no_inline [-module "<modulename>"] -function "<funcname>"
no_inline [-module "<modulename>"] -task "<taskname>"

指定该函数或任务不应内联到使用它的地方。当某个任务被非常大量地使用时, 这可以减小最终可执行文件的大小。要使此标志生效,该任务及其下方的任务 必须是纯的(pure);它们不能引用任务自身之外的任何变量。

与 /*verilator&32;no_inline_task*/ 元注释相同。

isolate_assignments -module "<modulename>" -function "<fname>"
isolate_assignments -module "<modulename>" [-function "<funcname>"] -var "<signame>"
isolate_assignments -module "<modulename>" [-task "<taskname>"] -var "<signame>"

已弃用且无效果(被忽略)。

在 5.050 之前的版本中:

用于指示对任何块中该信号的赋值应被隔离到新的块中。与 /*verilator&32;isolate_assignments*/ 元注释相同。

lint_off [-rule <message>] [-file "<filename>" [-lines <line> [ - <line>]]]
lint_off [-rule <message>] [-file "<filename>"] [-contents "<wildcard>"] [-match "<wildcard>"]
lint_on  [-rule <message>] [-file "<filename>" [-lines <line> [ - <line>]]]

在指定的文件名(或使用 '*' 或 '?' 的通配符,若省略则为所有文件)和行号 范围(若省略则为所有行)内启用/禁用指定的 lint 警告。

如果省略 -rule,则启用/禁用所有 lint 警告(见 -Wno-lint 中的列表)。

如果提供了 -contents,则输入文件必须包含给定的通配符(使用 '*' 或 '?'),并且在匹配时予以豁免,前提是 -rule、-file 和 -contents 也匹配。通配符应设计为匹配单行;通配符是否允许跨多行匹配 未作规定。输入内容不包括 --std 标准文件,也不包括 控制文件(带有 verilator_config)。此选项的典型用法是匹配 Verilog 源码中存在的版本号,以便豁免仅适用于该版本的源码。

如果提供了 -match,则将 linter 警告与给定的通配符(使用 '*' 或 '?')匹配,并在匹配时予以豁免,前提是 -rule、-file 和 -contents 也匹配。通配符会与整个多行消息进行比较;见 --waiver-multiline。

当存在重叠冲突的 lint_on/lint_off 指令时,它们按以下优先级顺序解决:

  • 所有不带 -file 或带 -file "\*" 的 lint_on/lint_off 按解析 顺序处理。

  • 所有带 -file "non-\*" 的 lint_on/lint_off 按解析顺序处理。

  • 所有带 --match 的 lint_off 按解析顺序处理。

如果某个警告被 lint_off 禁用,即使源码包含 lint_on 元注释,它也不会被 打印。控制文件指令和元注释分别解释,互不影响。只有当警告既未在控制文件 中禁用,也未通过元注释禁用时,才会发出该警告。

在 4.026 版本之前,-rule 被命名为 -msg,-msg 一直作为已 弃用的别名保留到 5.000 版本。

parallel_case -file "<filename>" -lines <lineno>

与 //synthesis parallel_case 相同。当发现这些综合指令时,Verilator 要么形式化证明该指令为真,要么在无法证明时插入适当的代码以在仿真运行时 检测失败的情况并打印 "Assertion failed" 错误消息。

profile_data -hier-dpi "<function_name>" -cost <cost_value>

在 --hierarchical 期间插入的内部性能分析数据;为带有 /*verilator&32;hier_block*/ 元注释的模块指定层级 DPI 包装器 的执行成本。见 层级 Verilation。

profile_data -mtask "<mtask_hash>" -cost <cost_value>

将配置引导优化数据馈入 Verilator 算法,以改善模型运行时性能。此选项 预计不会由用户直接使用。见 线程配置引导优化。

public [-module "<modulename>"] [-task/-function "<taskname>"] [-var "<signame>"]
public_flat [-module "<modulename>"] [-task/-function "<taskname>"] [(-param | -port | -var) "<signame>"]
public_flat_rd [-module "<modulename>"] [-task/-function "<taskname>"] [(-param | -port | -var) "<signame>"]
public_flat_rw [-module "<modulename>"] [-task/-function "<taskname>"] [(-param | -port | -var) "<signame>"] ["@(edge)"]

将指定信号设为公共。与 /*verilator&32;public*/ 或 /*verilator&32;public_flat*/ 等元注释相同。另见 VPI 示例。

使用 -port 仅选择匹配的端口,-param 匹配参数和 localparam, -var 匹配任何信号(包括端口、参数以及常规变量或线网)。在这三者中, 后面的 <signame> 可以包含 * 和 ? 通配符,分别匹配任何子串 或任何单个字符。

sc_biguint -module "<modulename>" -var "<signame>"

将输入/输出信号设置为 sc_biguint<{width}> 类型。 此元注释适用于任何宽度的信号。 与 /*verilator&32;sc_biguint*/ 元注释相同。

sc_bv -module "<modulename>" -var "<signame>"

将端口设置为 sc_bv<{width}> 类型,而不是 bool、uint32_t 或 uint64_t。与 /*verilator&32;sc_bv*/ 元注释相同。

sformat [-module "<modulename>"] [-function "<funcname>"] -var "<signame>"
sformat [-module "<modulename>"] [-task "<taskname>"] -var "<signame>"

必须应用于函数或任务的类型为 input string 的最后一个参数,以指示该 函数或任务应将所有剩余参数通过 $sformatf 传递。这允许创建具有类似 $display 行为的 DPI 函数。示例见 test_regress/t/t_dpi_display.v 文件。

与 /*verilator&32;sformat*/ 元注释相同。

split_var [-module "<modulename>"] [-function "<funcname>"] -var "<varname>"
split_var [-module "<modulename>"] [-task "<taskname>"] -var "<varname>"

将变量拆分为多个部分,通常用于解决 UNOPTFLAT 性能问题。通常,应附加此 属性的变量由 Verilator 自身推荐;见 UNOPTFLAT。

与 /*verilator&32;split_var*/ 元注释相同。

timing_off [-file "<filename>" [-lines <line> [ - <line>]]]
timing_on  [-file "<filename>" [-lines <line> [ - <line>]]]

为指定文件和行启用/禁用时序构造。禁用时,指定源代码位置中的所有时序 控制构造都会被忽略,方式与 --no-timing 相同,并且 code:fork/join* 块会被转换为 begin/end 块。

类似于 /*verilator&32;timing_on*/、 /*verilator&32;timing_off*/ 元注释,但独立解释。如果控制文件 或元注释禁用了时序构造,它们就会被禁用。

tracing_off [-file "<filename>" [-lines <line> [ - <line> ]]]
tracing_on  [-file "<filename>" [-lines <line> [ - <line> ]]]
tracing_off [-scope "<scopename>" [-levels <levels> ]]
tracing_on  [-scope "<scopename>" [-levels <levels> ]]

为所有文件中声明的所有未来信号启用/禁用波形跟踪。

使用 -file 时,在指定的文件名(或使用 '*' 或 '?' 的通配符)以及 -line 行号范围(若省略则为所有行)内启用/禁用波形跟踪。

对于带 -file 的 tracing_off,在所指定文件/范围中任何模块之下的 实例也将不被跟踪。要克服此特性,请在上层模块声明以及任何单元上使用 tracing_on,或使用命令的 -scope 形式。

使用 -scope 时,为指定的作用域(或使用 '*' 或 '?' 的通配符)以及 其下可选 --levels 层数启用/禁用波形跟踪。这些控制仅在其他基于 文件/行/模块的控制已指示该信号应被跟踪之后才起作用。匹配按最短前缀优先 进行,因此 tracing_on -scope "a.b" tracing_off -scope "a" 会为 "a.b" 打开,并为其他所有 "a.*" 关闭。

使用 -levels``(与 ``-scope 一起使用时),指定该规则要匹配的作用域 之下的层数,其中 0 表示其下所有层,1 表示与所提供作用域完全相同的层, 2 表示在所提供作用域之下额外一层的子级,依此类推。

verilator_lib -module "<modulename>"

仅供内部使用。将指定模块标记为由 --lib-create 创建的库 (包括使用 --hierarchical 创建时)的存根。特殊内部处理所必需。

可执行文件与参数参考

本节描述 Verilator 附带的各可执行文件,以及各可执行文件的选项。

verilator 参数

以下参数可以传递给 "verilator" 可执行文件。

摘要:

<file.v>                    Verilog package, module, and top module filenames
<file.c/cc/cpp>             Optional C++ files to compile in
<file.a/o/so>               Optional C++ files to link in

 +1364-1995ext+<ext>        Use Verilog 1995 with file extension <ext>
 +1364-2001ext+<ext>        Use Verilog 2001 with file extension <ext>
 +1364-2005ext+<ext>        Use Verilog 2005 with file extension <ext>
 +1800-2005ext+<ext>        Use SystemVerilog 2005 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-2017ext+<ext>        Use SystemVerilog 2017 with file extension <ext>
 +1800-2023ext+<ext>        Use SystemVerilog 2023 with file extension <ext>
--no-aslr                   Disable address space layout randomization
--no-assert                 Disable all assertions
--no-assert-case            Disable unique/unique0/priority-case assertions
--assert-unroll-limit <iter> Max SVA assertion repetition before erroring
--autoflush                 Flush streams after all $displays
--bbox-sys                  Blackbox unknown $system calls
--bbox-unsup                Blackbox unsupported language features
--binary                    Build model binary
--build                     Build model executable/library after Verilation
--build-dep-bin <filename>  Override build dependency Verilator binary
--build-jobs <jobs>         Parallelism for --build
--cc                        Create C++ output
 -CFLAGS <flags>            C++ compiler arguments for makefile
--compiler <compiler-name>  Tune for specified C++ compiler
--compiler-include          Include additional header in the precompiled one
--constraint-array-limit <size>   Maximum array size for constraint array reduction
--converge-limit <loops>    Tune convergence settle time
--coverage                  Enable all coverage
--coverage-expr             Enable expression coverage
--coverage-expr-max <value>     Maximum permutations allowed for an expression
--coverage-fsm              Enable FSM state/arc coverage
--coverage-line             Enable line coverage
--coverage-max-width <width>   Maximum array depth for coverage
--coverage-per-instance     Enable per-instance coverage counters
--coverage-toggle           Enable toggle coverage
--coverage-underscore       Enable coverage of _signals
--coverage-user             Enable SVL user coverage
 -D<var>[=<value>]          Set preprocessor define
--debug                     Enable debugging
--debug-check               Enable debugging assertions
--no-debug-leak             Disable leaking memory in --debug mode
--debugi <level>            Enable debugging at a specified level
--debugi-<srcfile> <level>  Enable debugging a source file at a level
--no-decoration             Disable comments and lower spacing level
--decorations <level>       Set output comment and spacing level
--default-language <lang>   Default language to parse
 +define+<var>=<value>      Set preprocessor define
--diagnostics-sarif         Enable SARIF diagnostics output
--diagnostics-sarif-output <filename>  Set SARIF diagnostics output file
--dpi-hdr-only              Only produce the DPI header file
--dump-<srcfile>            Enable dumping everything in source file
--dump-ast-patterns         Enable dumping Ast pattern statistics
--dump-defines              Show preprocessor defines with -E
--dump-dfg                  Enable dumping DfgGraphs to .dot files
--dump-dfg-patterns         Enable dumping Dfg pattern statistics
--dump-graph                Enable dumping V3Graphs to .dot files
--dump-inputs               Enable dumping preprocessed input files
--dump-tree                 Enable dumping Ast .tree files
--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
--dumpi-<srcfile> <level>   Enable dumping everything in source file 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-tree <level>        Enable dumping Ast .tree files at level
--dumpi-tree-json <level>   Enable dumping Ast .tree.json files at level
 -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
--exe                       Link to create executable
--expand-limit <value>      Set expand optimization limit
 -F <file>                  Parse arguments from a file, relatively
 -f <file>                  Parse arguments from a file
 -FI <file>                 Force include of a file
--flatten                   Force inlining of all modules, tasks and functions
--fourstate                 Enable fourstate logic
--no-fourstate              Disable fourstate logic
--func-recursion-depth <value>  Maximum recursive constant function depth
--future0 <option>          Ignore an option for compatibility
--future1 <option>          Ignore an option with argument for compatibility
 -fno-<optimization>        Disable internal optimization stage
 -G<name>=<value>           Overwrite top-level parameter
--gate-stmts <value>        Tune gate optimizer depth
--gdb                       Run Verilator under GDB interactively
--gdbbt                     Run Verilator under GDB for backtrace
--generate-key              Create random key for --protect-key
--get-supported <feature>   Get if feature is supported
--getenv <var>              Get environment variable with defaults
--help                      Show this help
--hierarchical              Enable hierarchical Verilation
--hierarchical-block <block>  Internal use only for --hierarchical
--hierarchical-child <block>  Internal use only for --hierarchical
--hierarchical-params-file <name>  Internal option that specifies parameters file for hier blocks
--hierarchical-threads <threads>  Number of threads for hierarchical scheduling
 -I<dir>                    Directory to search for includes
--if-depth <value>          Tune IFDEPTH warning
 +incdir+<dir>              Directory to search for includes
--inline-cfuncs <value>     Inline CFuncs with <=value nodes (0=off)
--inline-cfuncs-product <value>  Inline CFuncs if size*calls <= value
--inline-mult <value>       Tune module inlining
--instr-count-dpi <value>   Assumed dynamic instruction count of DPI imports
 -j <jobs>                  Parallelism for --build-jobs/--verilate-jobs
--no-json-edit-nums         Don't dump editNum in .tree.json files
--no-json-ids               Don't use short identifiers instead of addresses/paths in .tree.json
--json-only                 Create JSON parser output (.tree.json and .meta.json)
--json-only-meta-output <filename>  Set .tree.meta.json output filename
--json-only-output <filename>       Set .tree.json output filename
--l2-name <value>           Verilog scope name of the top module
--language <lang>           Default language standard to parse
 -LDFLAGS <flags>           Linker pre-object arguments for makefile
 -libmap                    Specify library mapping file
--lib-create <name>         Create a DPI library
 +libext+<ext>+[ext]...     Extensions for finding modules
 +librescan                 Ignored for compatibility
--lint-only                 Lint, but do not make output
--localize-max-size <value>  Tune localize optimization variable size
--main                      Generate C++ main() file
--main-top-name             Specify top name passed to Verilated model in generated C++ main
--make <build-tool>         Generate scripts for specified build tool
 -MAKEFLAGS <flags>         Arguments to pass to make during --build
--max-num-width <value>     Maximum number width (default: 64K)
--Mdir <directory>          Name of output object directory
--MMD                       Create .d dependency files
--mod-prefix <topname>      Name to prepend to lower classes
--MP                        Create phony dependency targets
 +notimingchecks            Ignored
 -o <executable>            Name of final executable
 -O0                        Disable optimizations
 -O1                        Default optimizations
 -O2                        Stronger optimizations
 -O3                        High-performance optimizations
 -O<optimization-letter>    Selectable optimizations
--output-groups <numfiles>  Group .cpp files into larger ones
--output-split <statements>          Split .cpp files into pieces
--output-split-cfuncs <statements>   Split model functions
--output-split-ctrace <statements>   Split tracing functions
 -P                         Disable line numbers and blanks with -E
--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-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
--no-pins64                 Don't use uint64_t's for 33-64 bit sigs
--pipe-filter <command>     Filter all input through a script
--prefix <topname>          Name of top-level class
--preproc-comments          Include preprocessor comments in the output with -E
--preproc-defines           Include preprocessor defines in the output with -E
--preproc-resolve           Include all found modules in the output with -E
--preproc-token-limit       Maximum tokens on a line allowed by preprocessor
--private                   Debugging; see docs
--prof-c                    Compile C++ code with profiling
--prof-cfuncs               Name functions for profiling
--prof-exec                 Enable generating execution profile for gantt chart
--prof-pgo                  Enable generating profiling data for PGO
--protect-ids               Hash identifier names for obscurity
--protect-key <key>         Key for symbol protection
--protect-lib <name>        Create a DPI protected library
--public                    Mark signals as public; see docs
--public-depth <level>      Mark public to specified module depth
--public-flat-rw            Mark all variables, etc as public_flat_rw
--public-ignore             Ignore all public comment markings
--public-params             Mark all parameters as public_flat
 -pvalue+<name>=<value>     Overwrite toplevel parameter
--quiet                     Minimize additional printing
--quiet-build               Don't print build progress
--quiet-exit                Don't print the command on failure
--quiet-stats               Don't print statistics
--relative-includes         Resolve includes relative to current file
--reloop-limit <value>      Minimum iterations for forming loops
--replication-limit <value> Replication concatenation limit (default: 8k)
--report-unoptflat          Extra diagnostics for UNOPTFLAT
--rr                        Run Verilator and record with rr
--runtime-debug             Enable model runtime debugging
--savable                   Enable model save-restore
--sc                        Create SystemC output
--sched-zero-delay          Specify #0 delay support
--no-skip-identical         Disable skipping identical output
--stats                     Create statistics file
--stats-vars                Provide statistics on variables
--no-std                    Prevent loading standard files
--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
 -sv                        Enable SystemVerilog parsing
 +systemverilogext+<ext>    Synonym for +1800-2023ext+<ext>
--threads <threads>         Enable multithreading
--threads-dpi <mode>        Enable multithreaded DPI
--threads-max-mtasks <mtasks>  Tune maximum mtask partitioning
--timescale <timescale>     Sets default timescale
--timescale-override <timescale>  Overrides all timescales
--timing                    Enable timing support
--no-timing                 Disable timing support
--top <topname>             Alias of --top-module
--top-module <topname>      Name of top-level input module
--trace                     Enable VCD waveform creation
--trace-coverage            Enable tracing of coverage
--trace-depth <levels>      Depth of tracing
--trace-fst                 Enable FST waveform creation
--trace-max-array <depth>   Maximum array depth for tracing
--trace-max-width <width>   Maximum bit width for tracing
--trace-params              Enable tracing of parameters
--trace-saif                Enable SAIF file creation
--trace-structs             Enable tracing structure names
--no-trace-top              Do not emit traces for signals in the top module generated by verilator
--trace-underscore          Enable tracing of _signals
--trace-vcd                 Enable VCD waveform creation
 -U<var>                    Undefine preprocessor define
--no-unlimited-stack        Don't disable stack size limit
--unroll-count <loops>      Tune maximum loop iterations
--unroll-limit <loops>      Maximum loop iterations before assuming infinite loop
--unroll-stmts <stmts>      Tune maximum loop body size
--unused-regexp <regexp>    Tune UNUSED lint signals
 -V                         Verbose version and config
 -v <filename>              Verilog library
--valgrind                  Run Verilator under valgrind
--no-verilate               Skip Verilation and just compile previously Verilated code
--verilate-jobs             Job threads for Verilation stage
 +verilog1995ext+<ext>      Synonym for +1364-1995ext+<ext>
 +verilog2001ext+<ext>      Synonym for +1364-2001ext+<ext>
--version                   Show program version and exits
--vpi                       Enable VPI compiles
--waiver-multiline          Create multiline --match for waivers
--waiver-output <filename>  Create a waiver file based on linter warnings
 -Wall                      Enable all style warnings
 -Werror-<message>          Convert warnings to errors
 -Wfuture-<message>         Disable unknown message warnings
 -Wno-<message>             Disable warning
 -Wno-context               Disable source context on warnings
 -Wno-fatal                 Disable fatal exit on warnings
 -Wno-lint                  Disable all lint warnings
 -Wno-style                 Disable all style warnings
 -work <libname>            Set config library for following files
 -Wpedantic                 Warn on compliance-test issues
 -Wwarn-<message>           Enable specified warning message
 -Wwarn-lint                Enable lint warning message
 -Wwarn-style               Enable style warning message
--x-assign <mode>           Assign non-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
 -y <dir>                   Directory to search for modules
<file.a/.o/.so>

指定可选的要与 Verilog 代码链接的目标文件或库文件,作为 -LDFLAGS <file> 的简写。文件路径应为绝对路径, 或相对于 make 执行位置的路径,或将适当的目录添加到 makefile 的 VPATH 以查找该文件。

如果以这种方式指定了任何文件,Verilator 将包含一条 make 规则,在链接 模块的可执行文件时使用这些文件。这通常仅在与 --exe 选项一起 使用时有意义。

<file.c/.cc/.cpp/.cxx>

与 --exe 一起使用,指定可选的要与 Verilog 代码链接的 C++ 文件。 文件路径应为绝对路径,或相对于 make 执行位置的路径,或将适当的目录添加 到 makefile 的 VPATH 以查找该文件。

另见 -CFLAGS 和 -LDFLAGS 选项,当 C++ 文件需要特殊 编译器标志时它们很有用。编译器标志默认添加 -DVERILATOR=1,因此可以用 #ifdef VERILATOR 为不同仿真器有条件地预处理 .cpp 代码。

<file.v>

指定包含要 Verilated 的顶层模块的 Verilog 文件。

+1364-1995ext+<ext>
+1364-2001ext+<ext>
+1364-2005ext+<ext>
+1800-2005ext+<ext>
+1800-2009ext+<ext>
+1800-2012ext+<ext>
+1800-2017ext+<ext>
+1800-2023ext+<ext>

指定要与特定文件扩展名 <ext> 一起使用的语言标准。

为与其他仿真器兼容,另见同义词 +verilog1995ext+<ext>、 +verilog2001ext+<ext> 和 +systemverilogext+<ext>。

对于任何源文件,这些选项指定的语言优先于 --default-language 或 --language 选项指定的任何语言。

这些选项按遇到的顺序生效。因此以下内容将对 a.v 使用 Verilog 1995, 对 b.v 使用 Verilog 2001:

verilator ... +1364-1995ext+v a.v +1364-2001ext+v b.v

这些选项仅建议用于旧式混合语言设计,因为更好的选项是编辑代码以修复新 关键字,或添加适当的 `begin_keywords。

备注

`begin_keywords 是一个 SystemVerilog 构造,它*仅*指定要识别的 关键字集合。它还控制一些因语言标准而异的错误消息。目前,Verilator 往往过于宽松,例如,它会接受许多在设置为较旧标准时可能非法的语法和 其他语义扩展。

--aslr
--no-aslr

很少需要 -- 供开发者使用。使用 --aslr 时,不改变关于使用 Linux 地址 空间布局随机化 (ASLR) 的系统默认值。使用 --no-aslr 时尝试禁用 ASLR。 如果未指定,仅在使用 :vlopt:`--debug`(或类似调试相关选项)时禁用 ASLR, 使指针具有更确定的值,有助于可重现性。

--no-assert

禁用所有断言。隐含 --no-assert-case。

在 5.038 之前的版本中,断言默认禁用,需要 --assert 来启用断言。

--no-assert-case

禁用 unique/unique0/priority case 相关的检查。

在 5.038 之前的版本中,这些默认禁用,需要 --assert 或 --assert-case 来启用 case 断言。

--assert-unroll-limit <iterations>

已弃用且无效果(被忽略)。

在 5.052 之前的版本中:

很少需要。指定 Verilator 在 SVA 并发断言内部将展开的最大重复或范围计数 (例如 [*N]、[->M:N]、always[lo:hi])。超过此值时,断言会 被拒绝并报错,以免病态的计数使编译时间或内存爆炸。

默认 1024。如果设计需要更大的重复计数,请增加。

--autoflush

在每个 $display 或 $fdisplay 之后,刷新输出流。这确保消息立即出现,但 可能降低性能。为获得最佳性能,请在 C++ 主循环中偶尔调用 fflush(stdout)。默认关闭,将按照常规 C/C++ 标准库 IO 的提供方式缓冲 输出。

--bbox-sys

将任何未知的 $system 任务或函数调用黑盒化。System 任务将变为空操作, system 函数将被替换为无尺寸零。此类函数的参数会被解析,但不进行其他 检查。这防止在存在公司特定 PLI 调用时 lint 出错。

使用此参数可能导致错误的仿真。

--bbox-unsup

将一些不支持的语言特性黑盒化,目前是 UDP 表、cmos 和 tran 门原语、 deassign 语句以及混合边沿错误。这可以使设计其余部分的 lint 成为可能, 即使存在不支持的构造。

使用此参数可能导致错误的仿真。

--binary

创建一个 Verilated 仿真器二进制文件。是 --main --exe --build --timing 的别名。

另见 -j。

--build

在生成 SystemC/C++ 代码后,Verilator 将调用工具链来构建模型库(当同时 使用 --exe 时还构建可执行文件)。Verilator 自己管理构建,为此 --build 要求平台上可用 GNU Make。

当使用 -E、--dpi-hdr-only、--json-only 或 --lint-only 时不能指定 --build。

--build-dep-bin <filename>

很少需要。当创建依赖 (.d) 文件时,此文件名将成为一个源依赖,使得此二进制 文件的变化会使 make 重建输出文件。默认为 Verilator 二进制文件的完整 路径。

此选项在 4.228 版本之前名为 --bin。

--build-jobs <value>

指定 --build 的并行度。如果为零,则使用进程可用的线程数,即由 处理器亲和性分配的线程数(例如使用 numactl),如果未指定则为主机硬件 中的线程数。否则,<value> 必须是一个正整数,指定并行构建作业的最大数量。

如果未提供,且提供了 -j,则使用 -j 的值。

这形成 make 选项 -j 的值,除非 MAKEFLAGS 环境 变量包含 -jobserver-auth,在这种情况下 Verilator 假定正在使用 make 的 jobserver。

另见 -j。

--cc

指定 C++ 而非 SystemC 输出模式;另见 --sc 选项。

-CFLAGS <flags>

将指定的 C 编译器参数添加到生成的 makefile 中。对于多个标志,要么在 shell 中引用它们作为单个以空格分隔的参数传递 (-CFLAGS "-a -b"),要么使用多个 -CFLAGS 选项 (-CFLAGS -a -CFLAGS -b)。

在生成的 makefile 上运行 make 时,这些将传递给 C++ 编译器 (g++/clang++/msvc++)。

--clk <signal-name>

已弃用且无效果(被忽略)。

在 5.042 之前的版本中:

使用 --clk 时,指定的信号被标记为时钟信号。

提供的信号名使用 RTL 层级路径指定。例如 v.foo.bar。如果该信号是顶层模块 的输入,则直接提供信号名。或者,在 RTL 文件中使用 /*verilator&32;clocker*/ 元注释直接标记该信号。

如果时钟信号被赋值给向量并随后用作单个位,Verilator 会尝试分解该向量并 连接单个位时钟信号。

在 5.000 之前的版本中,当 Verilator 无法正确区分时钟信号与其他数据信号 时,clocker 属性很有用。使用 clocker 将导致所指示的信号被视为时钟,并将 其从组合逻辑重新求值检查代码中移除。这可以极大改善性能。

--no-clk <signal-name>

已弃用且无效果(被忽略)。

在 5.042 之前的版本中:

防止指定信号被标记为时钟。见 --clk。

--compiler <compiler-name>

为指定的 C++ 编译器启用变通方法(列表如下)。这不改变任何性能调优选项, 但将来可能。这也不改变默认编译器标志;这些在 Verilator 配置时确定。

clang

为 clang 调优。这可能降低执行速度,因为它启用了若干变通方法来避免 clang 中愚蠢的硬编码限制。这包括像对 msvc 那样打破深层结构,如下所述。

gcc

为 GNU C++ 调优,尽管生成的代码应在几乎任何符合标准的 C++ 编译器上 工作。目前为默认值。

msvc

为 Microsoft Visual C++ 调优。这可能降低执行速度,因为它启用了若干 变通方法来避免 MSVC++ 中愚蠢的硬编码限制。这包括将深层嵌套的括号 表达式拆分为子表达式以避免错误 C1009,以及将深层块拆分为函数以避免 错误 C1061。

--compiler-include <header-path>

指定要包含在最终 PCH 头文件中的额外头文件。由于编译器限制每次编译只允许 一个预编译头文件,必须将它们添加到此头文件中。使用此选项而不是带 -include <header-path> 的 :-CFLAGS。

--constraint-array-limit <size>

指定约束表达式中的数组归约方法(sum、product、and、or、xor)将被展开的 最大数组大小。大于此限制的数组其归约约束将被忽略并产生 CONSTRAINTIGN 警告。这防止为非常大的数组生成过多代码。

默认 64。设置为 0 禁用所有数组归约约束展开。

--converge-limit <loops>

很少需要。指定创建模型未能收敛错误之前的最大运行时迭代次数。默认 10000。

--coverage

启用所有形式的覆盖率,是 --coverage-line --coverage-toggle --coverage-expr --coverage-fsm --coverage-user 的别名。

--coverage-expr

启用表达式覆盖率分析。见 表达式覆盖率。

--coverage-expr-max <value>

很少需要。指定给定表达式可以覆盖的最大排列数。默认 32。增加可能减慢 覆盖率仿真并使分析结果变得笨重。

--coverage-fsm

启用原生 FSM 状态和弧覆盖率。见 FSM 覆盖率。

--coverage-line

启用基本块行覆盖率分析。见 行覆盖率。

--coverage-max-width <width>

很少需要。指定受翻转覆盖率约束的信号的最大位宽。默认 256,因为覆盖大 向量可能极大减慢覆盖率仿真。

--coverage-per-instance

对于 Verilator 插入的覆盖率,按层级实例保留生成的覆盖率计数器和 .dat 记录。在 Verilate 模型时必须指定此选项,并同时指定一个或多个覆盖率插桩 选项,例如 --coverage、--coverage-line、 --coverage-toggle、--coverage-expr、 --coverage-fsm 或 --coverage-user。它可能增加生成的模型 大小、计数器内存、覆盖率写入时间和 .dat 文件大小。

这不影响 SystemVerilog cover,后者使用 IEEE 指定的覆盖率选项 per_instance。

--coverage-toggle

启用添加信号翻转覆盖率。见 翻转覆盖率。

--coverage-underscore

启用以下划线开头的信号的覆盖率。通常这些信号不被覆盖。另见 --trace-underscore 选项。

--coverage-user

启用添加用户插入的功能 covergroup 覆盖率。见 Covergroup 覆盖率。

-D<var>=<value>

定义给定的预处理器符号。类似于 +define,但不允许使用加号在单个选项中定义多个 定义。+define 在 Verilog 工具中相对标准,而 -D 类似于 gcc -D。

--debug

在调试模式下运行。

  • 选择 Verilator 的调试可执行文件(如果可用)。这通常是符号存在的、 优化较少的二进制文件(因此可以对其使用 GDB)。

  • 启用调试消息(等价于 --debugi 3)。

  • 启用内部断言(等价于 --debug-check)。

  • 启用中间形式转储文件(等价于 --dumpi-tree 3)。

  • 泄漏以使节点编号唯一(等价于 --debug-leak。

  • 如果有任何错误则调用 abort() 而不是 exit()(这样 GDB 可以看到程序 状态)。

--debug-check

很少需要。启用内部调试断言检查,而不改变调试详细程度。使用 --debug 选项时自动启用。

--no-debug-leak

在 --debug 模式中,默认情况下 Verilator 有意泄漏 AstNode 实例 而不是释放它们,以便每个节点指针在生成的 tree 文件和 dot 文件中唯一。

此选项禁用泄漏。这在 --debug 模式下 Verilate 大型模型时可以 避免内存不足错误。

在 --debug 模式之外,AstNode 实例绝不应泄漏,此选项无效果。

--debugi <level>

很少需要 -- 供开发者使用。将内部调试级别全局设置为指定的调试级别 (1-10)。更高级别产生更详细的消息。

--debugi-<srcfile> <level>

很少需要 -- 供开发者使用。将指定的 Verilator 源文件设置为指定级别 (例如 --debugi-V3Width 9)。更高级别产生更详细的 消息。关于启用调试的其他影响,见 --debug。

--no-decoration

--decorations none 的别名。

--decorations <level>

创建输出 Verilated 代码时,设置注释和空白装饰的级别。

使用 "--decorations none" 时,

最小化注释、空白、符号名和其他装饰项,代价是降低可读性。这可能有助于 C++ 编译时间。这通常不会改变最终模型的性能,但在某些情况下可能会。 另见 --no-decoration 选项。

使用 "--decorations medium" 时,

默认值,放置少量注释和空白,以达到典型的可读性水平。

使用 "--decorations node" 时,

包含注释,指示什么导致了下列文本的生成,包括什么节点指针(对应于 --dump-tree 打印的 .tree 数据)以及源 Verilog 文件名和行号。 如果后续的语句等具有相同的文件名/行号,则省略这些注释。这在查看 C++ 代码以确定可能与哪些 Verilog 源相关时便于调试。由于节点指针在不同 Verilator 运行之间不稳定,这可能损害编译缓存,应仅用于调试。

--default-language <value>

选择首次处理每个 Verilog 文件时默认使用的语言。语言值必须为 "VAMS"、 "1364-1995"、"1364-2001"、"1364-2001-noconfig"、"1364-2005"、 "1800-2005"、"1800-2009"、"1800-2012"、"1800-2017"、"1800-2023" 或 "1800+VAMS"。

与特定文件扩展名关联的任何语言(见各种 +<lang>*ext+ 选项)将优先于 --default-language 指定的语言。

--default-language 仅建议用于所有源文件使用同一语言的旧代码, 因为更好的选项是编辑代码以修复新关键字,或添加适当的 \`begin_keywords。对于旧式混合语言设计,应使用各种 +<lang>ext+ 选项。

如果未通过此选项或 +<lang>ext+ 选项指定语言,则使用最新的 SystemVerilog 语言 (IEEE 1800-2023)。

+define+<var>=<value>
+define+<var>=<value>[+<var2>=<value2>][...]

定义给定的预处理器符号,如果由加号分隔则可定义多个符号。类似于 -D;+define 在 Verilog 工具中相对标准,而 -D 类似于 gcc -D。

--diagnostics-sarif

启用将诊断输出到 Static Analysis Results Interchange Format (SARIF) 文件,这是用于 linter 等静态分析工具输出的标准、基于 JSON 的格式。见 [SARIF](https://sarifweb.azurewebsites.net/)、 [sarif-tools](https://github.com/microsoft/sarif-tools) 和 [SARIF 基于 Web 的查看器](https://microsoft.github.io/sarif-web-component/)。

--diagnostics-sarif-output <filename>

指定 --diagnostics-sarif 的 SARIF 输出文件(.sarif)的文件名。 使用此选项会自动设置 --diagnostics-sarif。如果未指定,输出默认 为 <prefix>.sarif。

--dpi-hdr-only

仅生成 DPI 头文件。此选项不影响生成的 DPI 头文件的名称或位置,它像没有 此选项一样输出在 --Mdir 中。

--dump-<srcfile>

很少需要 -- 供开发者使用。在给定源文件中以级别 3 启用所有转储。

--dump-ast-patterns

很少需要。启用转储 AstNodeExpr 模式统计。

--dump-defines

与 -E 一起使用时,抑制正常输出,而是打印在预处理输入文件结束时 存在的所有 define 列表。类似于 GCC "-dM" 选项。这也给你一种通过以下命令 找出 Verilator 中预定义了什么的办法:

touch foo.v ; verilator -E --dump-defines foo.v
--dump-dfg

很少需要。启用转储 DfgGraph .dot 调试文件,级别 3。

--dump-dfg-patterns

很少需要。启用转储 DfgGraph 模式统计。

--dump-graph

很少需要。启用转储 V3Graph .dot 调试文件,级别 3。在 Verilator 4.228 之前,--dump-tree 曾包含此选项。

--dump-inputs

很少需要。启用转储一个 {prefix}__inputs.vpp 文件,其中包含所有 单个输入文件合并并预处理后的内容

--dump-tree

很少需要。启用转储 Ast .tree 调试文件,级别 3,这会转储标准关键阶段。 格式细节见 Verilator Internals 手册。--dump-tree 在使用 --debug 时自动启用,因此如果转储文件很大且不需要, --debug --no-dump-tree 可能有用。

--dump-tree-addrids

很少需要 -- 供开发者使用。在树转储中用短标识符替换 AST 节点地址以增强 可读性。每个唯一指针值映射到唯一标识符,但注意这不一定是每个节点实例 唯一的,因为在一个具有相同地址的节点被转储然后释放后,该地址可能被新 分配的节点重用。

--dump-tree-dot

很少需要 -- 供开发者使用。启用转储 Ast .tree.dot 调试文件,采用 Graphviz Dot 格式。此选项隐含 --dump-tree,除非显式传递了 --dumpi-tree。

--dump-tree-json

很少需要。启用转储 Ast .json.tree 调试文件,级别 3,这会转储标准关键 阶段。格式细节见 Verilator Internals 手册。

--dumpi-<srcfile> <level>

很少需要 -- 供开发者使用。将指定 Verilator 源文件中的转储级别设置为指定 值(例如 --dumpi-V3Order 9)。级别 0 禁用转储,等价于 --no-dump-<srcfile>。级别 9 启用所有内容的转储。

--dumpi-dfg <level>

很少需要 -- 供开发者使用。将内部 DfgGraph 转储级别全局设置为指定值。

--dumpi-graph <level>

很少需要 -- 供开发者使用。将内部 V3Graph 转储级别全局设置为指定值。

--dumpi-tree <level>

很少需要 -- 供开发者使用。将内部 Ast 转储级别全局设置为指定值。

--dumpi-tree-json <level>

很少需要 -- 供开发者使用。将内部 Ast JSON 转储级别全局设置为指定值。

-E

预处理源代码,但不编译,类似于使用 gcc -E 的 C++ 预处理。 输出写到标准输出。注意启用调试消息,因为它们也会写到标准输出。见 --no-std,它由本选项隐含。

另见 --dump-defines、-P、 --preproc-comments 和 --preproc-resolve 选项。

--emit-accessors

为模型顶层类中的每个顶层信号生成 getter 和 setter 方法。信号仍可作为 公共成员使用,但带有 __Vm_sig_ 前缀。

--error-limit <value>

在 Verilator 运行期间遇到此数量的错误后,退出。警告不计入此限制。默认 50。

它不影响仿真运行时错误,对于后者,见 +verilator+error+limit+<value>。

--exe

生成可执行文件。你还需要在命令行上传递实现仿真主循环的额外 .cpp 文件。

--expand-limit <value>

很少需要。微调优化,设置表达式以 32 位字为单位展开为独立的基于字的语句 的最大大小。

-F <file>

读取指定文件,并如同其中所有文本都作为命令行参数指定一样行动。任何相对 路径都相对于包含指定文件的目录。另见 -f 选项。注意 -F 在 Verilog 工具中相对标准。

-f <file>

读取指定文件,并如同其中所有文本都作为命令行参数指定一样行动。任何相对 路径都相对于当前目录。另见 -F 选项。注意 -f 在 Verilog 工具中相对标准。

该文件可以包含 // 注释,它们会被忽略直到行尾。它还可以包含 /* .. */ 注释,它们会被忽略,但请注意 -f 文件中不处理通配符, directory/* 是注释的开头,而不是通配符。任何 $VAR、$(VAR) 或 ${VAR} 都将被替换为指定的环境变量。

-fdfg-synthesize-all

很少需要。尝试在 DFG 中综合所有组合逻辑。

-FI <file>

强制包含指定的 C++ 头文件。所有生成的 C++ 文件将在任何其他 include 之前 插入对指定文件的 #include。指定的文件可用于包含自定义 VL_VPRINTF 函数的 define 原型,并且可能需要包含 verilatedos.h,因为此文件在 任何其他标准 include 之前被包含。

--flatten

强制展平设计的层级,所有模块、任务和函数都内联。通常与 --json-only 一起使用。展平大型设计可能需要大量 CPU 时间、内存 和存储。

-fno-acyc-simp
-fno-assemble
-fno-bit-scan-loops

很少需要。禁用将位计数循环转换为内建操作。

-fno-case

很少需要。禁用所有 case 语句优化。

是所有其他 -fno-case-* 选项的别名。

-fno-case-decoder

很少需要。禁用将 case 语句转换为解码器表。

-fno-case-table

很少需要。禁用将 case 语句转换为表查找。

-fno-case-tree

很少需要。禁用将 case 语句转换为逐位分支树。

-fno-combine
-fno-const
-fno-const-before-dfg

很少需要。在 DFG 遍之前不应用任何全局表达式折叠。此选项仅用于 DFG 测试 目的,不应在其他情况下使用。

-fno-const-bit-op-tree
-fno-const-eager
-fno-dead-assigns
-fno-dead-cells
-fno-dedup
-fno-dfg

很少需要。禁用基于 DFG 的组合逻辑优化器。

在 5.048 之前的版本中:

是 -fno-dfg-pre-inline、-fno-dfg-post-inline 和 -fno-dfg-scoped 的别名。

-fno-dfg-break-cycles

已弃用且无效果(被忽略)。

在 5.052 之前的版本中:

很少需要。禁用 DFG 期间打破组合循环。

-fno-dfg-peephole

很少需要。禁用 DFG 窥孔优化器。

-fno-dfg-peephole-<pattern>

很少需要。禁用单个 DFG 窥孔优化器模式。

-fno-dfg-post-inline

已弃用且无效果(被忽略)。

在 5.048 之前的版本中:内联之后不应用 DFG 优化器。

-fno-dfg-pre-inline

已弃用且无效果(被忽略)。

在 5.048 之前的版本中:内联之前不应用 DFG 优化器。

-fno-dfg-push-down-sels

很少需要。禁用 DFG select/连接优化。

-fno-dfg-scoped

已弃用;请改用 -fno-dfg。

在 5.048 之前的版本中:不跨模块作用域应用 DFG 优化器。

-fno-expand
-fno-func-opt
-fno-func-opt-balance-cat
-fno-func-opt-split-cat
-fno-gate

很少需要。不应用门级线网优化。不建议使用,因为可能导致额外的警告和排序 问题。

-fno-ico-change-detect

很少需要。在输入组合 ('ico') 区域禁用输入变化检测。启用变化检测(默认, 除非传递 --vpi)时,输入组合逻辑仅当顶层输入实际发生变化时才 求值,而不是在第一次调度迭代时无条件求值。

变化检测逻辑假定顶层输入只在求值之间在外部变化。对于在设计中写入的顶层 输入信号,该优化会自动禁用。通过 VPI 的访问无法在编译时分析,因此 --vpi 对所有输入禁用此优化;可以通过显式传递 -fico-change-detect 重新打开。

-fno-inline

很少需要。禁用模块内联。

-fno-inline-cfuncs

很少需要。禁用将生成的小型 C++ 函数内联到其调用者中。

当使用 --prof-cfuncs 时此优化自动禁用。

-fno-inline-funcs

很少需要。禁用 SystemVerilog 函数和任务的内联。

-fno-inline-funcs-eager

很少需要。禁用 SystemVerilog 函数和任务的急切内联。

-fno-life
-fno-life-post
-fno-lift-expr
-fno-localize
-fno-merge-cond
-fno-merge-cond-motion
-fno-merge-const-pool
-fno-reloop
-fno-reorder
-fno-slice
-fno-split
-fno-subst
-fno-subst-const
-fno-table

很少需要。禁用其中一个内部优化步骤。这些通常仅在维护者建议使用时用于 帮助调试或绕过某个问题。

-fno-var-split

很少需要。不尝试自动拆分变量。显式用 /*verilator&32;split_var*/ 标注的变量仍会被拆分。

--fourstate

启用四态逻辑支持。实验性,仅供开发者使用。

--no-fourstate

禁用四态逻辑支持,这是默认值。为向前兼容而存在。

--fslice-element-limit

很少需要。设置用于 slice 优化的最大数组大小(元素数量),以避免过多的 内存使用。

--func-recursion-depth <value>

指定递归常量函数求值的最大深度。当递归函数在常量折叠期间超过此深度时, Verilator 放弃并将该表达式视为非常量。

默认 1000。

-future0 <option>

很少需要。对于一个不接收额外参数的选项,抑制未知的 Verilator 选项。这 允许为较晚版本 Verilator 用 pragma 编写的脚本在较旧版本下运行。例如 -future0 option --option 在不理解 --option 或 +option 的较旧 版本上会抑制否则会出现的无效选项错误,而在实现 --option 的较新版本 上,-future0 option --option 中的 -future0 option 会被忽略, --option 会正常工作。

-future1 <option>

很少需要。对于一个接收额外参数的选项,抑制未知的 Verilator 选项。这允许 为较晚版本 Verilator 用 pragma 编写的脚本在较旧版本下运行。例如 -future1 option --option arg 在不理解 --option arg 或 +option arg 的较旧版本上会抑制否则会出现的无效选项错误,而在实现 --option arg 的较新版本上,-future1 option --option arg 中的 -future1 option 会被忽略,--option arg 会正常工作。

-G<name>=<value>

覆盖顶层模块的给定参数。值限于基本数据字面量:

Verilog 整数字面量

支持标准 Verilog 整数字面量,因此允许 32'h8、2'b00、4 等值。必须注意 单引号 (I') 在交互式 shell 中被适当转义,例如 -GWIDTH=8'hx。

C 整数字面量

也可以使用 C 整数表示法,包括十六进制 (0x..)、八进制 (0..) 或二进制 (0b..) 表示法。

双精度字面量
双精度字面量必须是以下风格之一:
  • 包含点 (.)(例如 1.23)

  • 包含指数 (e/E)(例如 12e3)

  • 包含 p/P 表示 C99 中的十六进制浮点(例如 0x123.ABCp1)

字符串

字符串必须使用双引号 ("")。它们必须在命令行上正确转义,例如 -GSTR="\"My String\"" 或 -GSTR='"My String"'。

--gate-stmts <value>

很少需要。设置方程中为使门替换优化内联该方程而允许存在的最大语句数。

--gdb

在交互式 GDB(或 VERILATOR_GDB 环境变量值)会话下运行 Verilator。另见 --gdbbt 选项。

--gdbbt

如果指定了 --debug,则在 GDB 进程下运行 Verilator,在退出时打印 回溯,然后立即退出 GDB。如果没有 --debug 或 GDB 似乎不起作用, 则忽略此标志。旨在便于用户创建回溯;否则请见 --gdb 选项。

--generate-key

生成一个适合与 --protect-key 一起使用的真正随机密钥,打印它, 并立即退出。

--get-supported <feature>

如果支持给定特性,则打印 "1" 并立即退出;否则打印一个换行并立即退出。 这在 makefile 中可能有用。另见 -V 和各种 *.mk 文件。

特性可以是以下之一:COROUTINES、DEV_ASAN、DEV_GCOV、SYSTEMC、TSAN。

--getenv <variable>

如果该变量在环境中声明,则打印它并立即退出。否则,如果它内建于 Verilator (例如 VERILATOR_ROOT),则打印它并立即退出。否则,打印一个换行并立即 退出。这在 makefile 中可能有用。另见 -V 和各种 *.mk 文件。

--help

显示此消息和程序版本并退出。

--hierarchical

启用层级 Verilation;否则忽略 /*verilator&32;hier_block*/ 元注释。见 层级 Verilation。

--hierarchical-block <block>

仅供内部使用,用于 --hierarchical。

--hierarchical-child <block>

仅供内部使用,用于 --hierarchical。

--hierarchical-params-file <filename>

很少需要 -- 内部使用。在 --hierarchical 期间插入的内部标志; 为带有 /*verilator&32;hier_block*/ 元注释的去参数化模块指定 层级参数文件的名称。见 层级 Verilation。

--hierarchical-threads <threads>

指定用于调度层级块的线程数。这允许在多个线程上调度多线程层级块,而不 增加整个设计的并行性。

默认设置为 --threads。为获得最佳性能,不应超过 CPU 线程数。

-I<dir>

见 -y。

--if-depth <value>

很少需要。设置触发 IFDEPTH 警告的深度,默认为 0,这会禁用此警告。

+incdir+<dir>

见 -y。与 -y 不同,可以用 + 符号分隔指定多个目录; 这是为了 Verilog-XL 兼容性,不建议使用,因为某些第三方工具不支持。

--inline-cfuncs <value>

调整生成的小型 C++ 函数的内联。不大于 <value> 个节点的函数将尽可能内联。 默认 20。

另见 --inline-cfuncs-product 和 -fno-inline-cfuncs。

--inline-cfuncs-product <value>

调整生成的小型 C++ 函数的内联。如果函数的节点数乘以其调用次数不大于 <value>,则尽可能内联该函数。

这允许仅被调用一次或两次的函数即使超过小函数阈值也能被内联。默认 200。

另见 --inline-cfuncs 和 -fno-inline-cfuncs。

--inline-mult <value>

调整模块内联。默认值 2000 指定内联最多可以向模型添加 2000 个新操作。如果 会导致超过此数量的操作,则不内联该模块。更大的值,或小于 1 的值(将内联 所有内容),会导致更长的编译时间,但可能带来更快的仿真速度。此设置对 非常小的模块被忽略;如果允许,它们总是被内联。

--instr-count-dpi <value>

调整平均 DPI 导入的假定动态指令数。创建多线程模型时划分算法会使用它。 默认值 200。将其调整为适当的值可以在多线程模型中带来性能改进。创建单 线程模型时忽略。

-j [<value>]

如果未提供 --build-jobs,则指定 --build 的并行度;如果 未提供 --verilate-jobs,则指定 Verilator 的内部编译步骤的并行度。 如果未提供,还设置 --output-groups。

如果为零,则使用进程可用的线程数,即由处理器亲和性分配的线程数(例如 使用 numactl),如果未指定则为主机硬件中的线程数。否则必须是一个正 整数,指定并行构建作业的最大数量。

--no-json-edit-nums

不在 .tree.json 文件中转储编辑编号。这可能使文件在运行之间更稳定,便于 比较。

--no-json-ids

不在 .tree.json 中使用短标识符代替地址/路径。

--json-only

仅创建 JSON 输出,不创建任何其他输出。

JSON 格式旨在利用 Verilator 的解析器和展开来馈入其他下游工具。格式细节见 Verilator Internals 手册。注意 JSON 格式仍在演进;未来版本会有一些变化。

此选项禁用一些更激进的变换,仅转储 AST 的最终状态。对于更细粒度且未更改 的转储(主要用于调试),见 --dump-tree-json。

--json-only-meta-output <filename>

指定 --json-only 的元数据输出文件(.tree.meta.json)的文件名。 使用此选项会自动设置 --json-only。

--json-only-output <filename>

指定 --json-only 的主输出文件(.tree.json)的文件名。使用此 选项会自动设置 --json-only。

--l2-name <value>

在显示 Verilog 作用域时,使用提供的名称而不是模块名。这允许简化一些 Verilator 嵌入式建模方法。默认是与顶层模块匹配的 l2-name,在 Verilator 3.884 之前默认是 --l2-name v。

例如,程序 module t; initial $display("%m"); endmodule 默认显示 "t"。 使用 --l2-name v 它将打印 "v"。

--language <value>

--default-language 的同义词,为与其他工具和早期版本的 Verilator 兼容。

-LDFLAGS <flags>

将指定的 C 链接器参数添加到生成的 makefile 中。对于多个标志,要么在 shell 中引用它们作为单个以空格分隔的参数传递(-LDFLAGS "-a -b"),要么使用 多个 -LDFLAGS 参数(-LDFLAGS -a -LDFLAGS -b)。

在生成的 makefile 上运行 make 时,这些将在被链接的主文件**之后**传递给 C++ 链接器 (ld)。此标志被称为 -LDFLAGS,因为那是仿真器中的传统 名称;它本应被称为 LDLIBS,因为那才是它控制的 Makefile 变量。(在 Make 中,LDFLAGS 在第一个目标文件之前,LDLIBS 在之后。-L 库需要放在 Make 变量 LDLIBS 中,而不是 LDFLAGS。)

--lib-create <name>

生成 C++、Verilog 包装器以及一个 Makefile,后者可以生成可供 Verilator 或 其他仿真器连同相应 Verilog 包装器一起使用的 DPI 库。该 Makefile 将分别 构建库的静态和动态版本,名为 lib<name>.a 和 lib<name>.so。 这样做是因为某些仿真器需要动态库,但如果可能,静态库可以说更易于使用。 --protect-lib 隐含 --protect-ids。

使用 --lib-create 时,建议同时使用 --timescale-override /1fs,以确保模型的 时间分辨率始终与上层实例化模块的时间精度兼容。

使用此选项编译的设计不能使用带延迟的 --timing。

另见 --protect-lib。

+libext+<ext>[+<ext>][...]

指定用于查找模块的扩展名。例如,如果引用了模块 "my",则查看 my.<ext>。注意 "+libext+" 在 Verilog 工具中相对标准。默认 ".v+.sv"。

-libmap <lib.map>

指定库映射文件以将模块分类到库中。这可以被 -work 覆盖。

+librescan

为与其他仿真器兼容而被忽略。

--lint-only

仅检查文件的 lint 违规,不创建任何其他输出。

你可能还想要 -Wall 选项,以启用被认为风格问题且默认未启用的 消息。

除非使用了 --no-timing,否则隐含 --timing。

如果设计不打算完全 Verilate,另见 --bbox-sys 和 --bbox-unsup 选项。

--localize-max-size <value>

很少需要。设置变量局部化到栈优化所适用的最大变量大小(字节)。默认 1024。

--main

生成一个顶层 C++ main() 文件,支持解析参数,但不驱动任何输入。这足以用于 没有输入的顶层 SystemVerilog 设计。

此选项也可以使用一次,生成 main .cpp 文件作为编辑的起点。将其复制到 obj 目录之外,手动编辑,然后在后续 Verilator 命令行调用中传递该文件名。

通常与 --timing 一起使用以支持延迟生成的时钟,以及 --build。

如果未提供其他输出模式,隐含 --cc。

另见 --binary。

--main-top-name <string>

在生成的 C++ main() 函数中,指定传递给所构造 Verilated 模型的名称。

如果使用字符串 "-",则不添加顶层作用域。

--make <build-tool>

为指定的构建工具生成脚本。

支持的值为 ``gmake``(GNU Make),或 ``json``(创建 JSON 文件以馈入其他 构建工具)。

Verilator 也支持使用 CMake 构建,但 CMakeLists.txt 在底层使用 --make json 输出格式。曾有原生的 --make cmake,但它在 5.046 版本中被移除。

可以一起指定多个选项。如果未指定构建工具,则假定为 gmake。gmake 的 可执行文件可以通过环境变量 MAKE 配置。

使用 --build 时,Verilator 接管构建模型库/可执行文件的职责。 因此使用 --build 时不能指定 --make。

-MAKEFLAGS <string>

使用 --build 时,将指定参数添加到所调用的 make 命令行。对于多个 标志,要么在 shell 中引用它们作为单个以空格分隔的参数传递(例如 -MAKEFLAGS "-a -b"),要么使用多个 -MAKEFLAGS 参数(例如 -MAKEFLAGS -l -MAKEFLAGS -k)。使用宿主工具链的简单构建不应需要此 选项。

--max-num-width <value>

设置最大数字字面量宽度(例如在 1024'd22 中的 1024)。这也限制 SVA 周期 延迟和时间边界值。

默认 64K。

--Mdir <directory>

指定 Make 目标目录的名称。所有生成的文件将放在此目录中。如果未指定,则 使用 "obj_dir"。如果该目录不存在且父目录存在,则创建它;否则请在调用 Verilator 之前手动创建 Mdir。

--MMD
--no-MMD

启用/禁用创建 .d 依赖文件,用于 make 依赖检测,类似于 gcc -MMD 选项。 默认情况下此选项对 --cc 或 --sc 模式启用。

--mod-prefix <topname>

指定要添加到所有较低层类前面的名称。默认与 --prefix 相同。

--MP

使用 --MMD 选项创建 .d 依赖文件时,生成 phony 目标。类似于 gcc -MP 选项。

+notimingchecks

为与其他仿真器兼容而被忽略。

-o <executable>

如果使用 --exe,指定所构建最终可执行文件的名称。如果未指定, 默认为 --prefix。

-O0

禁用模型优化。

-O1

启用模型的默认优化。这是默认优化级别。

-O2

启用比默认更强的模型优化。

-O3

为 Verilator 自身生成的代码启用慢速优化(相对于影响 C 编译器优化的 -CFLAGS -O3)。-O3 可以以编译时间为代价改善 仿真性能。这目前设置 --inline-mult -1。

-O<optimization-letter>

很少需要。启用或禁用特定优化,根据所传递的字母选择优化。小写字母禁用 优化,大写字母启用它。此选项已弃用,应改用各种 -f<optimization> 参数。

--no-order-clock-delay

已弃用且无效果(被忽略)。

在 5.000 之前的版本中:

很少需要。禁用针对带延迟赋值的时钟使能排序的缺陷修复。此选项仅应在开发者 建议时使用。

--output-groups <numfiles>

启用将输出 .cpp 文件连接为给定数量的有效输出 .cpp 文件。这最小化了编译 许多小文件带来的编译器启动开销,这在大量使用 SystemVerilog 类、模板或 generate 块的设计中可能发生。

使用 --output-groups 可能不利地影响已编译代码的缓存和稳定性 (即可重现性)。编译更大的 .cpp 文件也有更高的内存需求。过低的值可能 导致大型设计发生交换抖动,高值没有好处。

通常将文件数设置为硬件线程数(对应于可并行运行的编译器作业数)会带来 最快的构建时间。(例如对于小到中型设计,值应在 2 到 20 之间。)

零禁用此特性。负一(默认)将组设置为来自 --build-jobs 的值, 或来自 -j 的值,或按该优先级为零。

--output-split <statements>

启用将输出 .cpp 文件拆分为多个输出。当 C++ 文件超过指定操作数时,将在 下一个函数边界处创建新文件。此外,如果总输出代码大小超过指定值,生成的 makefile 中默认将 VM_PARALLEL_BUILDS 设置为 1,使并行编译成为可能。使用 --output-split 对模型性能应只有微不足道的影响。但可以极大改善 C++ 编译速度。使用 "ccache"(如果在配置时存在,会为你设置)与此选项 结合也更有效。

此选项默认开启,值为 20000。要禁用,传入值 0。

--output-split-cfuncs <statements>

启用将输出 .cpp 文件中的函数拆分为多个函数。当生成的函数超过指定操作数 时,将创建新函数。使用 --output-split 时,这将使 C++ 编译器能够 更快地编译,代价是随拆分值减小而变大的少量性能损失。注意此选项比 --output-split 更强,因为 --output-split 不会在函数 内部拆分。

除非显式指定,默认为 --output-split 的值。

--output-split-ctrace <statements>

与 --output-split-cfuncs 类似,它启用将输出 .cpp 文件中的跟踪 函数拆分为多个函数。

除非显式指定,默认为 --output-split 的值。

-P

与 -E 一起使用时,禁用生成 &96;line 标记和空行,类似于 gcc -P。

--pins-bv <width>

指定宽度大于等于 <width> 位的 SystemC 输入/输出应使用 sc_bv 而不是 uint32/uint64_t。默认是 "--pins-bv 65",值必须小于等于 65。Verilator 3.671 之前的版本默认 "--pins-bv 33"。sc_bv 使用得越多,性能越差。使用 /*verilator&32;sc_bv*/ 元注释选择特定端口为 sc_bv。

--pins-inout-enables

指定顶层模块中 inout 的 __en 和 __out 输出将始终被创建。__en 变量在某位 位置有 1,表示 __out 变量的对应位有从 Verilated 模型内部驱动的值。

--pins-sc-biguint

指定宽度大于 65 位的 SystemC 输入/输出应在 65 到 512 之间使用 sc_biguint, 从 513 向上使用 sc_bv。与 --pins-sc-uint 组合结合时,结果是 2 到 64 之间使用 sc_uint,65 到 512 之间使用 sc_biguint。使用 /*verilator&32;sc_biguint*/ 元注释选择性地将特定信号设置为任何 宽度的 sc_biguint。

--pins-sc-uint

指定宽度大于 2 位的 SystemC 输入/输出应在 2 到 64 之间使用 sc_uint。与 --pins-sc-biguint 组合结合时,结果是 2 到 64 之间使用 sc_uint, 65 到 512 之间使用 sc_biguint。

--pins-sc-uint-bool

指定宽度为一的 SystemC 输入/输出应使用 sc_uint<1>。

--pins-uint8

指定小于 --pins-bv 设置且不超过 8 位的 SystemC 输入/输出应使用 uint8_t 而不是 uint32_t。同样,宽度 9-16 的引脚将使用 uint16_t 而不是 uint32_t。

--pins64

--pins-bv 65 的向后兼容别名。注意这是 65,不是 64。

--no-pins64

--pins-bv 33 的向后兼容别名。

--pipe-filter <command>

很少需要。Verilator 将指定的命令作为子进程管道启动,以允许该命令在 Verilog 代码到达 Verilator 之前对其执行自定义编辑。

在读取每个 Verilog 文件之前,Verilator 将文件名传递给子进程的 stdin, 形式为 read "<filename>"。过滤器随后可以读取文件并执行它想要的任何 过滤,并首先输出一行定义过滤输出的字节长度 Content-Length: <bytes>, 然后将新的过滤内容通过 stdout 反馈给 Verilator。从过滤器输出到 stderr 的内容会传递到 Verilator 的 stdout,如果过滤器以非零状态退出,Verilator 会终止。示例见 file:t/t_pipe_filter 测试。

要调试过滤器的输出,请尝试使用 -E 选项查看预处理输出。

--pp-comments

已弃用。在 5.042 之前的版本中,是 --preproc-comments 的名称。

--prefix <topname>

指定顶层类和 makefile 的名称。默认为 V 加上 --top 选项的名称, 或 V 加上命令行上传递的第一个 Verilog 文件名。

--preproc-comments

与 -E 一起使用时,在预处理输出中显示注释。

--preproc-defines

与 -E 一起使用时,在预处理输出中显示 define 和 undef。

--preproc-resolve

与 -E 一起使用时,解析所引用的实例模块,以包含子模块的预处理 输出。用于将多文件设计转换为单个输出文件。

见 -E。

--preproc-token-limit <value>

很少需要。配置 Verilator 在单行上可以处理的令牌数量限制,以防止无限循环 和其他挂起。默认 40000 个令牌。

--private

很少需要。与 --public 相反。这是默认值;此选项为向后兼容而存在。

--prof-c

编译 C++ 代码时,启用编译器的分析标志(例如 g++ -pg)。见 代码分析。

使用 --prof-cfuncs 也会启用 --prof-c。

--prof-cfuncs

修改创建的 C++ 函数以支持分析。函数将被最小化以包含一个"基本"语句,通常 是单个 always 块或 wire 语句。(这可能会使可执行文件减慢约 5%。)此外, 函数名将附加 Verilog 模块的基本名和语句来源的行号。这允许 gprof 或 oprofile 报告与原始 Verilog 源语句相关联。见 代码分析。

使用 --prof-cfuncs 也会启用 --prof-c。

--prof-exec

启用执行跟踪收集,可以用 verilator_gantt 转换为甘特图。见 执行分析。

--prof-pgo

启用为配置引导 Verilation 收集分析数据。目前,这仅对 --threads 有用。见 线程配置引导优化。

--prof-threads

在 5.020 中移除。曾是 --prof-exec 和 --prof-pgo 一起的别名。

--protect-ids

将任何私有标识符(不在顶层的变量、模块和断言块名)哈希为看起来随机的 哈希标识符,编译后得到暴露较少设计信息的受保护库二进制文件。此哈希使用 提供或默认的 --protect-key;见那里重要的细节。

Verilator 还会创建一个 <prefix>__idmap.xml 文件,包含从哈希 标识符回映射到原始标识符的映射。此 idmap 文件应保持私有,用于协助将任何 仿真运行时设计断言、覆盖率或跟踪信息(它们会报告哈希标识符)映射回原始 设计的标识符名。

允许使用 DPI 导入/导出,就所披露的信息而言通常相对安全,仅限于 DPI 函数 原型。不建议使用 VPI,因为可能暴露许多设计细节,并且会发出 INSECURE 警告。

--protect-key <key>

为 --protect-ids 指定私钥。为获得最佳安全性,此密钥应为 16 个 或更多随机字节,合理安全的选择是 verilator --generate-key 的 输出。通常,用户会为给定的受保护设计库创建一次密钥,然后该库后续版本的 每次 Verilator 运行都会传递相同的 --protect-key。因此,如果输入 Verilog 在库版本(Verilator 运行)之间相似,Verilated 代码也将大体相似。

如果未指定 --protect-key 但需要密钥,Verilator 将为每次 Verilator 运行生成一个新密钥。由于密钥不被保存,这对安全最好,但这意味着 每次 Verilator 运行即使对相同输入也会产生大不相同的输出,可能损害编译 时间(并且肯定会扰乱任何 "ccache")。

--protect-lib <name>

生成类似 --lib-create 的 DPI 库,但隐藏内部设计细节。 --protect-lib 隐含 --protect-ids 和 --lib-create。

这允许安全交付敏感 IP,而无需加密 RTL(即 IEEE P1735)。关于如何构建和 使用该 DPI 库的演示,见发行版中的 examples/make_protect_lib。

使用此选项编译的设计不能使用带延迟的 --timing。

--public

很少需要。这仅用于历史调试用途,使用它可能导致生成时钟的错误仿真。

将所有信号和模块声明为 public。这将关闭信号优化,就像所有信号都有 /*verilator&32;public*/ 元注释和内联一样。这还将关闭内联,就像 所有模块都有 /*verilator&32;public_module*/ 一样,除非该模块 特别用 /*verilator&32;inline_module*/ 启用了它。

--public-depth <level>

如 --public-flat-rw 一样启用 public,但仅限于指定的模块深度。 它按模块最大层级运作,因此如果某个模块的单元是 A.B.X 和 A.X,则必须使用 --public-depth 3 才能使模块 X 为 public,并且 A.B.X 和 A.X 都将为 public。

--public-flat-rw

将所有变量、端口和 wire 声明为 public,就像它们有 /*verilator public_flat_rw*/ 元注释一样。这将使它们可以通过其扁平名 被 VPI 访问,但不会关闭模块内联。这在结合 --vpi 时特别有用。 在某些罕见情况下,这也可能导致生成时钟的错误仿真。与此全局选项相比, 仅标记那些需要 public_flat_rw 的信号通常性能显著更好。

--public-ignore

忽略所有 /*verilator public* */ 元注释。这对于不使用 VPI 时对 VPI 构建进行速度优化很有用。这仅影响元注释;--public、 --public-depth 等选项正常运作。

--public-params

将所有参数声明为 public,就像它们有 /*verilator public_flat_rd*/ 元注释一样。

-pvalue+<name>=<value>

覆盖顶层模块的给定参数。详细描述见 -G。

--quiet

--quiet-build --quiet-exit --quiet-stats 的 别名。

--quiet-build

使用 --build 时,禁用打印构建进度,如编译器命令行。

--quiet-exit

因错误退出时,不显示 "Exiting due to Errors" 和 "Command Failed" 消息。

--quiet-stats

禁用打印 Verilation 统计报告,见 Verilation 摘要报告。

--relative-includes

当文件引用 include 文件时,相对于引用文件的路径解析文件名,而不是相对于 当前目录。

--reloop-limit <value>

很少需要。Verilator 尝试在输出中将一些常见的语句序列转换为循环。此参数 指定结果循环为执行此变换所需的最小迭代次数。默认限制为 40。较小的数字 可能在这些序列常见的设计上略微改善 C++ 编译时间;然而,对模型性能的 影响需要基准测试。

--replication-limit <value>

设置复制连接的限制(例如 {1024{1'b1}})。也适用于无尺寸字面量(例如 '0)。

此选项默认开启,值为 8k。要禁用,传入值 0。

--report-unoptflat

为 UNOPTFLAT 警告启用额外诊断。这包括对每个循环,循环中十个 最宽的变量,以及循环中十个扇出最多的变量。这些是拆分为多个变量以打破 循环的候选。

此外,为与每个循环相关的源中的整个强连通分量生成 GraphViz DOT 文件。 无论是否设置 --dump-tree 都会生成。此类图可能有助于分析问题, 但可能非常大。

存在各种用于查看和操作 DOT 文件的命令,例如 "dot" 命令可以将 DOT 文件 转换为 PDF 以便打印。例如:

dot -Tpdf -O Vt_unoptflat_simple_2_35_unoptflat.dot

将从 DOT 文件生成 PDF Vt_unoptflat_simple_2_35_unoptflat.dot.pdf。

或者,可以使用 xdot 命令交互式查看 DOT 文件:

xdot Vt_unoptflat_simple_2_35_unoptflat.dot
--rr

运行 Verilator 并用 rr 命令记录。见 https://rr-project.org。

--runtime-debug

启用将调试断言包含在生成的模型中。这可能显著降低模型性能。此选项仅适用 于 gcc/clang。

此选项与以下标志具有相同效果:

--decorations node

指示 Verilator 向 Verilated C++ 代码添加注释,以帮助确定哪些 Verilog 代码对每个 C++ 语句负责。

-CFLAGS -ggdb  -LDFLAGS -ggdb

指示编译器和链接器启用调试器符号。

-CFLAGS -fsanitize=address,undefined  -LDFLAGS -fsanitize=address,undefined

指示编译器和链接器启用地址消毒器和未定义行为消毒器。

-CFLAGS -D_GLIBCXX_DEBUG

指示编译器启用 C++ 库 (glibc) 内部断言,以发现库误用问题。

-CFLAGS -DVL_DEBUG=1

指示编译器启用 Verilator 的运行时断言和调试能力。要在运行时启用调试 打印消息,见 +verilator+debug。

此处使用的 -CFLAGS 和/或 -LDFLAGS 选项将以下参数分别 传入生成的 Makefile 以用作编译器或链接器选项。如果你使用自己的 Makefile, 请适当调整以将建议的标志传递给编译器和链接器。

--savable

启用将保存和恢复函数包含在生成的模型中。见 保存/恢复。

--sc

指定 SystemC 输出模式;另见 --cc 选项。

--sched-zero-delay
--no-sched-zero-delay

指定生成的代码是否应支持具有完整 IEEE 1800 标准调度语义的 #0 延迟。 完整的 #0 支持有仿真性能成本。如果使用 --sched-zero-delay, 生成的代码将完全支持 #0 延迟。如果使用 --no-sched-zero-delay,生成的代码将不支持 #0 延迟,如果 执行 #0 延迟,仿真将在运行时失败。如果未给出选项,当输入包含 #0 或编译时延迟值未知的 #(expression) 时,Verilator 将生成具有正确 #0 支持的代码。

如果输入包含 #0 延迟,但已知它们在运行时不会被执行,则可以使用选项 --no-sched-zero-delay。这可以改善仿真性能。

--skip-identical
--no-skip-identical

很少需要。如果所有源文件相同且所有输出文件存在且日期较新,则禁用或启用 跳过 Verilator 的执行。默认情况下,此选项仅对 --cc 或 --sc 模式启用。

--stats

创建包含设计统计信息的转储文件,位于 <prefix>__stats.txt。 还会将 DFG 模式转储到 <prefix>__stats_dfg_patterns__*.txt。

--stats-vars

创建更详细的统计信息,包括按大小列出所有变量(普通 --stats 只给出计数)。见 --stats,本选项隐含它。

--no-std

阻止解析标准输入文件,是 --no-std-package、 --no-std-waiver 的别名。未来版本可能扩展以阻止读取其他标准化 文件。

--no-std-package

阻止解析标准 std:: 包文件。

--no-std-waiver

阻止解析标准 lint 豁免(verilated_std_waiver.vlt)。

--no-stop-fail

断言失败时不调用 $stop。仿真将继续。

--structs-packed

已弃用;停止使用此选项。

将所有非压缩结构体转换为压缩结构体,并发出 UNPACKED 警告。 指定此选项允许与 Verilator 5.006 之前的版本向后兼容,当时 Verilator 总是打包非压缩结构体。

-sv

指定应启用 SystemVerilog 语言特性;等价于 --language 1800-2023。此选项默认被选中;它为与其他 仿真器兼容而存在。

+systemverilogext+<ext>

+1800-2023ext+<ext> 的同义词。

--no-threads

已弃用且无效果(被忽略)。

在 5.004 之前的版本中,创建一个非线程安全的模型。

--threads <threads>

使用 "--threads 1"(默认)时,生成的模型是单线程的,但可以在多线程环境 中运行。使用 "--threads N"(N >= 2)时,生成的模型最多在 N 个线程上多 线程运行。见 多线程。此选项也适用于 --trace-vcd (但不适用于 --trace-fst)。

--threads-dpi <mode>

使用 --threads 时,控制哪些 DPI 导入任务和函数被视为线程安全。

使用 "--threads-dpi all" 时,

使 Verilator 假定所有 DPI 导入都是线程安全的,并使用线程本地存储与 DPI 通信,可能改善性能。任何 DPI 库都需要适当的互斥锁以避免未定义 行为。

使用 "--threads-dpi none" 时,

Verilator 假定 DPI 导入不是线程安全的,Verilator 默认将序列化对 DPI 导入的调用,可能损害性能。

使用 "--threads-dpi pure"(默认)时,

Verilator 假定 DPI 纯导入是线程安全的,但非纯 DPI 导入不是。

另见 --instr-count-dpi 选项。

--threads-max-mtasks <value>

很少需要。使用 --threads 时,指定模型要划分成的 mtask 数量。 如果未指定,Verilator 会近似估算一个好的值。

--timescale <timeunit>/<timeprecision>

当 "timescale" 未出现在给定模块之前时,设置默认时间单位和时间精度。 默认是 "1ps/1ps"(以匹配 SystemC)。这会被 :vlopt:--timescale-override` 覆盖。

--timescale-override /<timeprecision>
--timescale-override <timeunit>/<timeprecision>

覆盖源中的所有 "`timescale"。时间单位可以留空,以仅指定覆盖时间精度, 例如 "/1fs"。

时间精度必须与 SystemC 的 "sc_set_time_resolution()" 一致,或者与实例化 Verilated 模块的 C++ 代码一致。由于 "1fs" 是最细的时间精度,可能希望 始终使用 "1fs" 精度。

--timing
--no-timing

启用/禁用对时序构造的支持,例如延迟、事件控制(除非它位于进程顶部)、 wait 语句和 join。禁用时,时序控制构造会像早期版本的 Verilator 中一样被 忽略。启用此特性需要支持协程的 C++ 编译器(GCC 10、Clang 5 或更新版本)。

--top <topname>
--top-module <topname>

当输入 Verilog 包含多个顶层模块时,指定要成为顶层模块的模块名,并在未 显式指定时为 --prefix 设置默认值。对于只有一个顶层的标准设计 不需要此选项。见 查找与绑定模块。

--trace

已弃用;请改用 --trace-fst、--trace-saif 或 --trace-vcd。

使用 --trace 而不带 --trace-fst 或 --trace-saif 时请求 VCD 跟踪。

使用 --trace --trace-fst 时请求 FST 跟踪。

使用 --trace --trace-saif 时请求 SAIF 跟踪。

--trace-coverage

与 --trace-* 和 --coverage-* 一起使用时,启用跟踪以为每个 --coverage-line 或 --coverage-user 插入的覆盖点包含 一个被跟踪信号,以协助调试覆盖项。注意 --coverage-toggle 不会 添加额外信号,因为被翻转分析的原始信号已经可见。

添加的信号将是一个 32 位值,每次覆盖发生时递增。因此,此选项可能显著 增加跟踪文件大小并降低仿真速度。

--trace-depth <levels>

指定启用跟踪的深度层数,例如 --trace-depth 1 只查看顶层信号。默认是整个模型。 使用较小的数字会降低可见性,但会显著改善仿真性能和跟踪文件大小。

--trace-fst

在模型中启用 FST 波形跟踪。这会覆盖 --trace。

--trace-max-array <depth>

很少需要。指定可以被跟踪的信号的最大数组深度。零允许任何宽度。默认 32, 因为跟踪大型数组可能极大减慢被跟踪的仿真。

--trace-max-width <width>

很少需要。指定可以被跟踪的信号的最大总位宽(如果是数组,则跨所有元素)。 零允许任何宽度。默认 4096,因为跟踪大向量可能极大减慢被跟踪的仿真。

--no-trace-params

禁用参数的跟踪。

--trace-saif

在模型中启用 SAIF 跟踪。这会覆盖 --trace。此格式的规范可在 IEEE 1801-2018 中找到 (见 Annex I)。

--trace-structs

启用跟踪以显示压缩结构体、联合体和压缩数组字段的名称,而不是单个组合的 压缩总线。由于 VCD 文件格式限制,这可能导致跟踪时间显著变慢和跟踪文件 更大。

--trace-threads <threads>

已弃用且无效果。

在 5.048 之前的版本中:

使用单独的线程启用波形跟踪。这在仿真运行时通常更快,但使用更多总计算量。 此选项仅适用于 --trace-fst。FST 跟踪最多可利用 "--trace-threads 2"。这会覆盖 --no-threads。

此选项被接受,但对 --trace 完全没有效果,后者改为遵循 --threads。

--no-trace-top

禁用对 Verilator 添加到设计中的顶层包装器中输入和输出信号的跟踪。这些 信号在原始 verilog 顶层模块中仍被跟踪。

当与设置为 "-" 的 --main-top-name 组合时,或当顶层模块的名称 在其构造函数中设置为 "" 时,生成的跟踪文件将以 verilog 顶层模块为根, 而不是 Verilator 添加的另一个模块。

--trace-underscore

启用对以下划线开头的信号或模块的跟踪。否则,这些信号在跟踪期间不被输出。 另见 --coverage-underscore 选项。

--trace-vcd

使用 VCD 格式向模型添加波形跟踪代码。

Verilator 将生成必须编译的额外 <prefix>__Trace*.cpp 文件。此外 必须编译并链接 :file:`verilated_vcd_sc.cpp`(用于 SystemC 跟踪)或 :file:`verilated_vcd_c.cpp`(用于两者)。如果使用 Verilator 生成的 Makefile,这些文件会为你添加到源文件列表中。如果你不使用 Verilator Makefile,则需要手动将它们添加到你的 Makefile。

编译进跟踪可能导致少量性能损失,即使在模型执行期间未打开跟踪。

使用 --threads 时,VCD 跟踪被并行化,使用与传递给 --threads 相同数量的线程。

-U<var>

取消定义给定的预处理器符号。

--no-unlimited-stack

Verilator 尝试使用 ulimit -s unlimited 命令禁用栈大小限制。 此选项关闭此行为。

--unroll-count <loops>

很少需要。指定可能被展开的过程循环的最大迭代次数。如果循环有更多迭代, 则完全不展开。不影响 generate 循环。另见 BLKLOOPINIT 警告以及 /*verilator&32;unroll_disable*/ 和 /*verilator&32;unroll_full*/ 元注释。

默认 64。设置为 0 会禁用所有过程循环的展开,除了用 /*verilator&32;unroll_full*/ 标记的那些。

--unroll-limit <loops>

很少需要。指定在假定循环无限并随后发出错误之前,展开的循环迭代的最大 次数。这是一个安全限制,以确保即使输入中存在真正的无限循环(例如由于 generate for 循环缺少增量语句),Verilator 也会终止。

默认 16K,如果输入有更大的有限循环可以增加。

--unroll-stmts <statements>

很少需要。指定循环展开中语句的最大数量,以便该循环被展开。另见 BLKLOOPINIT 警告以及 /*verilator&32;unroll_disable*/ 和 /*verilator&32;unroll_full*/ 元注释。

默认 30000。

--unused-regexp <regexp>

很少需要。指定一个带 * 和 ? 的简单正则表达式,如果信号名匹配,将抑制 UNUSED 警告。默认 "*unused*"。将其设置为 "" 禁用匹配。

-V

显示详细版本,包括编译进 Verilator 的配置信息。(类似于 perl -V。)另见 --getenv 选项。

-v <filename>

将文件名作为 Verilog 库读取。文件中的任何模块可用于解析顶层模块中的实例, 否则它们被忽略。注意 "-v" 在 Verilog 工具中相对标准。

--valgrind

很少需要。在 Valgrind 下运行 Verilator。可以 用 VERILATOR_VALGRIND 更改命令。

--no-verilate

使用 --build 时,禁用生成 C++/SystemC 代码,仅执行构建。这对于 重建先前 Verilator 调用产生的 Verilated 代码可能有用。

--verilate-jobs <value>

指定 Verilator 内部编译步骤的并行度。如果为零,则使用进程可用的线程数, 即由处理器亲和性分配的线程数(例如使用 numactl),如果未指定则为主机 硬件中的线程数。否则必须是一个正整数,指定并行构建作业的最大数量。

如果未提供,且提供了 -j,则使用 -j 的值。

另见 -j。

+verilog1995ext+<ext>

+1364-1995ext+<ext> 的同义词。

+verilog2001ext+<ext>

+1364-2001ext+<ext> 的同义词。

--version

显示程序版本并退出。

--vpi

启用 VPI 的使用并链接 verilated_vpi.cpp 文件。

--waiver-multiline

使用 --waiver-output <filename> 时,包含一个 匹配表达式,将整个多行错误消息作为匹配正则表达式,而不是默认的仅匹配 错误消息的第一行。这为创建复杂豁免提供了起点,但此类生成的豁免在重用前 可能需要编辑以精简。

--waiver-output <filename>

生成一个豁免文件,包含所有豁免语句以抑制本次 Verilator 运行期间发出的 警告。这特别有助于作为解决 linter 警告或系统地抑制它们的起点。

生成的文件采用 Verilator 配置格式,见 Verilator 控制文件。 标准文件扩展名是 ".vlt"。这些文件可以直接被 Verilator 使用,通常通过 将文件名作为 Verilator 命令行选项的一部分。豁免文件需要在命令行上列在 它们所豁免的文件之前。

-Wall

启用所有代码风格警告,包括通常默认禁用的风格警告。等价于 -Wwarn-lint -Wwarn-style。排除一些特殊警告。

-Werror-<message>

将指定的警告消息提升为错误消息。这通常用于阻止用户违反重要的站点范围 规则,例如 "-Werror-NOUNOPTFLAT"。

-Wfuture-<message>

很少需要。用给定的消息代码抑制未知的 Verilator 注释或警告消息。这用于 允许为较晚版本 Verilator 用 pragma 编写的代码在较旧版本下运行;为新版本 支持的、旧版本不支持的每个消息代码或注释添加 "-Wfuture-" 参数。

-Wno-<message>

禁用指定的警告/错误消息。这会覆盖源中的任何 lint_on 指令,即警告仍不会 被打印。

-Wno-context

通过引用疑似位置的源文本,禁用显示警告消息的疑似上下文。这可用于安抚 处理警告消息但可能被从源引用的行弄糊涂的工具。

-Wno-fatal

检测到警告时打印它们,但不终止 Verilator。

构建中有警告消息可能是草率的。你应该清理代码、使用内联 lint_off,或使用 -Wno-... 选项,而不是使用此选项。

-Wno-lint

禁用所有与 lint 相关的警告消息,以及所有风格警告。这等价于 -Wno-ALWCOMBORDER -Wno-ASCRANGE -Wno-ASSIGNEQEXPR -Wno-BSSPACE -Wno-CASEINCOMPLETE -Wno-CASEOVERLAP -Wno-CASEX -Wno-CASTCONST -Wno-CASEWITHX -Wno-CMPCONST -Wno-COLONPLUS -Wno-IMPLICIT -Wno-IMPLICITSTATIC -Wno-PINCONNECTEMPTY -Wno-PINMISSING -Wno-STATICVAR -Wno-SYNCASYNCNET -Wno-UNDRIVEN -Wno-UNSIGNED -Wno-UNUSEDGENVAR -Wno-UNUSEDPARAM -Wno-UNUSEDSIGNAL -Wno-WIDTH,再加上 -Wno-style 所示的列表。

强烈建议你清理代码,而不是使用此选项;它仅用于运行从第三方收到的代码 测试用例时。

-Wno-style

禁用所有与代码风格相关的警告消息(注意默认情况下它们已经禁用)。这等价 于 -Wno-DECLFILENAME -Wno-DEFPARAM -Wno-EOFNEWLINE -Wno-GENUNNAMED -Wno-IMPORTSTAR -Wno-INCABSPATH -Wno-PINCONNECTEMPTY -Wno-PINNOCONNECT -Wno-SYNCASYNCNET -Wno-UNDRIVEN -Wno-UNUSEDGENVAR -Wno-UNUSEDPARAM -Wno-UNUSEDSIGNAL -Wno-VARHIDDEN。

-work <libname>

为在此参数之后读取的所有单元使用指定的 Verilog config 库名。可以多次 指定,它将应用于在给定参数之间读取的单元。例如 -work liba a.v -work libb b.v 将对 a.v 内的模块或在那些模块下层级 解析的单元使用 liba,并将对 b.v 内的模块或其下层级使用 libb。

默认为 "work" (IEEE 1800-2023 3.3.1)。

见 查找与绑定模块。

-Wpedantic

对 IEEE 要求的任何构造发出警告,并禁用所有可能干扰与用 --default-language 等定义的标准符合性的 Verilator 扩展。类似于 gcc -Wpedantic。很少使用,仅用于严格的符合性测试。

此选项将 ASSIGNIN 从错误改为警告。

-Wwarn-<message>

启用指定的警告消息。

-Wwarn-lint

启用所有与 lint 相关的警告消息(注意默认情况下它们已经启用),以及风格 消息。这等价于 -Wall。

在 5.044 之前的版本中,这仅启用 lint,但不启用 -Wwarn-style 消息;对于类似行为,使用 -Wwarn-lint -Wno-style。当前行为与 -Wno-lint 的逆操作一致。

-Wwarn-style

启用所有与代码风格相关的警告消息。这等价于 -Wwarn-ASSIGNDLY -Wwarn-BLKSEQ -Wwarn-DECLFILENAME -Wwarn-DEFPARAM -Wwarn-EOFNEWLINE -Wwarn-GENUNNAMED -Wwarn-IMPORTSTAR -Wwarn-INCABSPATH -Wwarn-PINCONNECTEMPTY -Wwarn-PINNOCONNECT -Wwarn-PROCASSINIT -Wwarn-SYNCASYNCNET -Wwarn-UNDRIVEN -Wwarn-UNUSEDGENVAR -Wwarn-UNUSEDLOOP -Wwarn-UNUSEDPARAM -Wwarn-UNUSEDSIGNAL -Wwarn-VARHIDDEN。

--x-assign <mode>

控制当源中遇到显式 X 值时替换成的二态值。

使用 "--x-assign 0" 时,

将所有 X 转换为 0,这也很快。

使用 "--x-assign 1" 时,

将所有 X 转换为 1,这几乎与 0 一样快,但更可能发现复位缺陷,因为 高有效逻辑会触发。

使用 "--x-assign fast"(默认)时,

将所有 X 转换为对性能最有利的任何值。

使用 "--x-assign unique" 时,

所有显式 X 被替换为运行时确定的常量值。该值通过在初始化时调用一个 函数来确定。这使 X 能够在不同执行中使用不同种子随机化。此方法最慢, 但对发现复位缺陷最安全。

如果使用 --x-assign unique,请使用 +verilator+rand+reset+2 运行时选项,并用 +verilator+seed+<value> 为运行时随机数 生成器设置种子,使每次回归运行得到不同的随机化序列。你可能还想打印 所选的任何种子,以及用该相同种子重新运行的代码,以便重现缺陷。

备注

此选项仅适用于 Verilog 源代码中在模块(不是类,也不是参数)中显式 写为 X 的值。除非指定 --x-initial-edge,时钟的初始值设置为 0。 所有其他状态保持变量的初始值由 --x-initial 控制。

--x-initial <mode>

控制用于初始化否则未初始化的变量的二态值。

使用 "--x-initial 0" 时,

将所有其他方面未初始化的变量初始化为零。

使用 "--x-initial unique"(默认)时,使用一个函数初始化变量,该函数为

每个初始化确定要使用的值。这提供最大的灵活性,并允许发现复位缺陷。 见 未知状态。

如果使用 --x-initial unique,请使用 +verilator+rand+reset+2 运行时选项,并用 +verilator+seed+<value> 为运行时随机数 生成器设置种子,使每次回归运行得到不同的随机化序列。你可能还想打印 所选的任何种子,以及用该相同种子重新运行的代码,以便重现缺陷。

使用 "--x-initial fast" 时,对性能最好,将所有变量初始化为 Verilator

确定为最优的状态。这可能允许进一步的代码优化,但很可能隐藏任何与 缺少复位相关的代码缺陷。

备注

此选项仅适用于变量的初始值。除非指定 --x-initial-edge, 时钟的初始值设置为 0。

--x-initial-edge

启用对事件驱动仿真器的仿真,后者通常在从 X 到 1(posedge)或从 X 到 0 (negedge)的转换时触发边沿。因此,当以下代码中 rst_n 未初始化时, 当 rst_n 首次设置为零时会将 res_n 设置为 1'b1:

logic res_n = 1'b0;

always @(negedge rst_n) begin
  if (rst_n == 1'b0) begin
    res_n <= 1'b1;
  end
end

在 Verilator 中,默认情况下未初始化的时钟被赋予零值,因此上述 always 块不会触发。

虽然这不是好做法,但某些设计依赖 X->0 触发 negedge,特别是在复位序列中。 使用 --x-initial-edge 将复制此行为。它还将确保 X->1 触发 posedge。

备注

使用此选项可能影响收敛性,可能需要使用 --converge-limit 增加收敛迭代次数。这可能是所建模设计存在问题的另一个指示,应加以 解决。

代替使用此选项,一种技术是在构造时创建一个值,并在时间零的 initial 块中 创建一个值,从而显式创建适当的边沿:

logic rst_n = 1;  // value at construction

initial begin
  rst_n = 0;  // value at time zero
  // ... rest
end

always @(negedge rst_n) begin
  if (rst_n == 1'b0) begin
    res_n <= 1'b1;
  end
end
--xml-only

在 5.046 中移除。

仅创建 XML 输出,不创建任何其他输出。

--xml-output <filename>

在 5.046 中移除。

指定 XML 输出文件的文件名。使用此选项会自动设置 --xml-only。

-y <dir>

将目录添加到应搜索以查找 include 文件或库的目录列表中。三个标志 -y、+incdir+<dir> 和 -I<dir> 有类似的 效果;+incdir+<dir> 和 -y 在 Verilog 工具中相对 标准,而 -I<dir> 被许多 C++ 编译器使用。

Verilator 默认为当前目录 "-y ." 以及任何指定的 --Mdir,不过 这些默认路径在用户指定的任何目录之后使用。这允许使用 '-y "$(pwd)"', 如果希望错误消息使用绝对文件名而不是相对文件名。

verilator_coverage

Verilator_coverage 处理由 Verilated 模型生成的覆盖率报告。

使用 --annotate 时,它读取指定的覆盖率数据文件并生成带覆盖率指标注释的 源代码。使用 --annotate-points 时还会显示对应每一行的覆盖点。

额外的 Verilog-XL 风格标准参数指定查找进行覆盖率分析的源代码所需的搜索 路径。

要过滤纳入覆盖率的项目,你可以将 logs/coverage.dat 读入编辑器,执行 M-x keep-lines 仅保留感兴趣的统计数据,然后保存到新的 .dat 文件。

对于绝不应发生的 Verilog 条件,要么在适当的语句块中添加 $stop 语句,要么 参见 /*verilator&32;coverage_off*/。这会在模型重新 Verilate 后 移除覆盖率点。

关于 verilator_coverage 用法的概述,见 覆盖率分析。

verilator_coverage 用法示例

verilator_coverage --help
verilator_coverage --version

verilator_coverage --annotate obj_dir coverage.dat

verilator_coverage --report summary coverage.dat

verilator_coverage --report hier --levels 3 coverage.dat

verilator_coverage --write merged.dat coverage.dat ...

verilator_coverage --write-info merged.info coverage.dat ...

verilator_coverage 参数

<filename>

指定输入覆盖率数据文件。可以提供多个文件名以读取多个输入。如果未指定 数据文件,默认会读取 "coverage.dat"。

--annotate <output_directory>

指定应将带有覆盖率数据注释的源文件写入的目录名。

点是每一行覆盖率的子项 -- 分支、表达式或翻转点。当点计数聚合到一行时, 使用最小和最大计数来确定该行的状态(完整、部分、失败)。计数等于各点 的最大值。

覆盖率数据注释在该行的开头,格式为一个特殊字符后跟覆盖率命中次数。 特殊字符 " ,%,~,+,-" 表示覆盖率的摘要,并允许使用 grep 过滤报告。

  • " "(空白)表示该行上的所有点都高于覆盖率最小值。

  • "%" 表示该行上的所有点都低于覆盖率最小值。

  • "~" 表示该行上的一些点高于覆盖率最小值,一些低于。

  • "+" 覆盖率点达到或高于最小值。仅与 --annotate-points 一起 使用。

  • "-" 覆盖率点低于最小值。仅与 --annotate-points 一起使用。

 100000  input logic a;                  // Begins with whitespace, because
                                         // number of hits (100000) is above the min.
+100000  point: type=line 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: type=line 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: type=branch comment=if   // The if branch is above the min.
-000000  point: type=branch comment=else // The else branch is below the min.
--annotate-all

指定应显示所有文件。默认情况下,只有覆盖率较低的源文件才会被写入输出 目录。

此选项应与 --annotate 一起使用。

--annotate-min <count>

指定阈值(<count>),低于该值的覆盖率点被视为充分。如果未超过该阈值, 则注释将以 "%" 符号开头,表示覆盖率不足。

<count> 阈值默认为 10。

此选项应与 --annotate 一起使用。

--annotate-points

指定应在每行文本之后显示所有覆盖点。默认情况下,仅显示源行。

 100000  input logic a, b, c;
+100000 point: type=line comment=a  // These lines are only shown
+200000 point: type=line comment=b  // with option --annotate-points
+300000 point: type=line comment=c  // enabled.

此选项应与 --annotate 一起使用。

--filter-type <regex>

保留与 <regex> 匹配的覆盖率类型的记录。 可能的取值有 toggle、line、branch、expr、covergroup、 user、fsm_state、fsm_arc,以及使用 * 或 ? 的通配符。默认值 为 *。

covergroup 类型表示 SystemVerilog 功能覆盖率,包括 covergroup、 coverpoint、bin 和交叉覆盖,如 IEEE 1800-2023 第 19 节所定义。

--help

显示帮助摘要、程序版本并退出。

--include-reset-arcs

在打印的摘要和注释输出中包含 FSM 复位弧。默认情况下,复位弧会被跟踪, 但与非常规 FSM 弧分开汇总。

--levels <depth>

与 --report hierarchy 一起使用时,限制显示的层级深度。更深的 后代仍会汇总到可见的父级总计中。深度为 0 时显示顶层层级汇总。如果为 负数或省略,则显示所有深度。

--rank

打印一份实验性报告,列出每个测试在覆盖所有覆盖点方面的相对重要性。该 报告显示 "Covered",表示该测试覆盖的点数;如果某测试的桶计数至少为 1, 则认为它覆盖了一个点。"rank" 列的数字越大表示该测试越关键,rank 为 0 表示该测试无需运行即可覆盖这些点。"RankPts" 表示如果按 rank 从高到低 运行所有测试,该测试对总体覆盖率贡献的覆盖点数量。

--report <kind>[,<kind>...]

生成供人阅读的报告。支持的报表种类有 summary、hier 和 hierarchy。多个报表种类可以用逗号分隔,例如 summary,hier。 未显式指定 --report 时,打印旧式的扁平摘要。summary 等价于扁平类型摘要。hier 和 hierarchy 从 hier 字段构建 确定性的层级汇总。可以报告折叠通配符层级,但它不是精确的按实例覆盖率。 如果不存在层级字段,则打印警告并改为显示扁平摘要。

与 --write 一起使用时,在成功创建输出后删除(unlink)所有 输入文件。

--version

显示程序版本并退出。

--write <filename>

指定应将跨所有文件求和的聚合覆盖率结果以 verilator_coverage 数据格式 写入给定文件名。这在脚本中将许多覆盖率数据文件(可能来自随机测试运行) 合并为一个主覆盖率文件时很有用。

--write-info <filename.info>

指定应将跨所有文件求和的聚合覆盖率结果以 lcov .info 格式 写入给定文件名。可用于输入到 lcov 以聚合或生成报告。此格式 缺少 verilator_coverage 格式所具有的覆盖点注释。它可以与 genhtml 一起使用以生成 HTML 报告。genhtml --branch-coverage 还会显示分支覆盖率,类似于 --annotate-points。

verilator_gantt

Verilator_gantt 创建一个可视化表示,通过显示每个宏任务何时开始、结束以及 每个线程何时忙碌或空闲,帮助分析 Verilator 多线程仿真性能。

关于 verilator_gantt 用法的概述,见 代码分析。

甘特图 VCD

Verilated_gantt 创建一个值变化转储(VCD)格式的转储文件,可以在波形查看器 (例如 C<GTKWave>)中查看:

_images/fig_gantt_min.png

图 2 使用 GTKWave 查看的 verilator_gantt 输出示例。

所查看的波形图 X 轴为时间,系统高性能计数器每个时间 tick 为一个单位。

甘特图 VCD 信号

在波形中,有以下信号。在 GTKWave 中,使用 "decimal" 数据格式可去除前导零, 使波形更易读。

trace/section

显示当前执行区段栈栈顶的名称。将 GTKWave 数据格式设置为 "ASCII"。

trace/depth

显示执行区段栈的深度。将 GTKWave 数据格式设置为 "Analog"。

measured_parallelism

此时活动的 mtask 数量,为获得最佳性能,此值将与线程数匹配。在 GTKWave 中,使用 "analog step" 数据格式查看此信号。

predicted_parallelism

Verilator 预测此时将处于活动的 mtask 数量,为获得最佳性能此值将与线程数 匹配。在 GTKWave 中,使用 "analog step" 数据格式查看此信号。

cpu#_thread

对于给定的 CPU 编号,测得正在执行的线程编号。

cpu#_waiting

对于给定的 CPU 编号,mtask 依赖关系的累计等待时间。可视化为 X 值。

mtask#_cpu

对于给定的 mtask id,测得它执行所在的 CPU。

thread#_mtask

对于给定的线程编号,它正在执行的 mtask id。

predicted_thread#_mtask

对于给定的线程编号,Verilator 预测将执行的 mtask id。

verilator_gantt 用法示例

verilator_gantt --help
verilator_gantt --version

verilator_gantt profile_exec.dat

verilator_gantt 参数

<filename>

要从中读取数据的文件名;默认值为 "profile_exec.dat"。

--help

显示帮助摘要、程序版本并退出。

--no-vcd

禁止创建 .vcd 文件。

--vcd <filename>

设置 vcd 转储的输出文件名;默认值为 "verilator_gantt.vcd"。

verilator_profcfunc

Verilator_profcfunc 读取由 gprof 创建的性能分析报告。函数名随后会被转换 (假定用户使用了 Verilator 的 --prof-cfuncs),并打印一份报告,显示每个 Verilog 块中占用的时间百分比等信息。

由于 gprof 报告中的舍入误差,输入报告的百分比可能不会合计为 100%。在 verilator_profcfunc 报告中,这将被报告为舍入误差。

关于 verilator_profcfunc 用法的概述,见 代码分析。

verilator_profcfunc 用法示例

verilator_profcfunc --help
verilator_profcfunc --version

verilator_profcfunc gprof.out

verilator_profcfunc 参数

<filename>

要从其读取数据的 gprof 生成的文件名。通常是 "gprof.out"。

--help

显示帮助摘要、程序版本并退出。

仿真运行时参数

以下是可传递给 Verilated 可执行文件的参数,前提是该可执行文件调用了 VerilatedContext*->commandArgs(argc, argv)。

所有仿真运行时参数都以 "+verilator" 开头,因此用户的可执行文件在解析其 命令行时可以跳过所有 "+verilator" 参数。

摘要:

+verilator+assert+lock                Lock assertion status changes at startup
+verilator+coverage+file+<filename>   Set coverage output filename
+verilator+debug                      Enable debugging
+verilator+debugi+<value>             Enable debugging at a level
+verilator+error+limit+<value>        Set error limit
+verilator+help                       Show help
+verilator+log+file+<filename>        Log stdout and stderr output to filename
+verilator+noassert                   Disable assert checking
+verilator+prof+exec+file+<filename>  Set execution profile filename
+verilator+prof+exec+start+<value>    Set execution profile starting point
+verilator+prof+exec+window+<value>   Set execution profile duration
+verilator+prof+vlt+file+<filename>   Set PGO profile filename
+verilator+quiet                      Minimize additional printing
+verilator+rand+reset+<value>         Set random reset technique
+verilator+seed+<value>               Set random seed
+verilator+solver+file+<filename>     Set random solver log filename
+verilator+V                          Show verbose version and config
+verilator+version                    Show version and exit
+verilator+vpi+<library>[:<bootstrap>]  Load VPI shared library
+verilator+wno+unsatconstr+<value>    Disable constraint warnings

选项:

+verilator+assert+lock

仅允许命令行选项来禁用/启用断言。禁止 RTL 通过 $asserton、 $assertoff 和 $assertcontrol 更改断言处理。同时阻止 VerilatedContext* 的断言控制函数更新断言处理。

+verilator+coverage+file+<filename>

当模型使用 --coverage 进行 Verilate 时,设置写入覆盖率数据的 文件名。默认值为 coverage.dat。

+verilator+debug

启用仿真运行时调试。等价于 +verilator+debugi+4。

为使其有用,模型通常必须首先通过使用 --runtime-debug 或 -CFLAGS -DVL_DEBUG=1 进行 Verilate 以启用调试能力。

+verilator+debugi+<value>

以提供的级别启用仿真运行时调试。

+verilator+error+limit+<value>

设置在退出仿真运行时之前的非致命错误(例如断言失败)数量。还会影响退出 前所需的 $stop 调用次数。不影响 $fatal。默认值为 1。

+verilator+help

显示帮助并退出。

+verilator+log+file+<filename>

将所有 stdout 和 stderr 记录到指定的输出文件名。如果未指定,则使用 常规的 stdout/stderr 流。

+verilator+noassert

根据运行时参数禁用断言检查。这等同于在模型中调用 VerilatedContext*->assertOn(false)。

+verilator+prof+exec+file+<filename>

当模型使用 --prof-exec 进行 Verilate 时,设置仿真运行时要转储 的文件名。默认值为 profile_exec.dat。

+verilator+prof+exec+start+<value>

当模型使用 --prof-exec 进行 Verilate 时,仿真运行时将等待直到 $time 达到该值(以时间精度为单位),然后开始分析预热,之后开始捕获。 通常应将其设置为远在仿真正常运行期间内的时间,即在复位之外。如果为 0,则禁用转储。默认值为 1。

+verilator+prof+exec+window+<value>

当模型使用 --prof-exec 进行 Verilate 时,在 $time 达到 +verilator+prof+exec+start+<value> 之后,Verilator 将为此 数量的 eval() 调用预热分析,然后捕获此数量的 eval() 调用的分析数据。 默认值为 2,这对单时钟域模块是合理的,此类模块通常希望捕获一个 posedge eval() 和一个 negedge eval()。

+verilator+prof+threads+file+<filename>

在 5.020 中移除。曾是 +verilator+prof+exec+file+<filename> 的别名

+verilator+prof+threads+start+<value>

在 5.020 中移除。曾是 +verilator+prof+exec+start+<value> 的别名

+verilator+prof+threads+window+<value>

在 5.020 中移除。曾是 +verilator+prof+exec+window+<value> 的别名

+verilator+prof+vlt+file+<filename>

当模型使用 --prof-pgo 进行 Verilate 时,设置要转储的 配置文件引导优化数据运行时文件名。默认值为 profile.vlt。

+verilator+quiet

禁止打印仿真摘要报告,见 仿真摘要报告。

+verilator+rand+reset+<value>

当模型使用 --x-initial unique 进行 Verilate 时, 设置仿真运行时初始化技术。0 = 复位为零。1 = 复位为全一。2 = 随机化。 见 未知状态。默认值为 0。

+verilator+seed+<value>

对于 $random 和 --x-initial unique,设置仿真 运行时随机种子值。如果未指定,种子默认为 1。如果指定为 0,则在启动时 生成一个非零种子;所选值通过 $get_initial_random_seed 暴露,以便 之后通过传递 +verilator+seed+<that_value> 重现该次运行。

+verilator+solver+file+<filename>

如果指定,当使用随机化求解器时,打开给定文件名以写入,并将所有随机 求解器命令和响应记录到其中。

+verilator+V

显示详细版本,包括配置信息。

+verilator+version

显示程序版本并退出。

+verilator+vpi+<library>[:<bootstrap>]

在仿真开始前加载一个 VPI 共享库。仅当模型使用 --vpi 和 --main`(或 :vlopt:--binary`)Verilate 时可用。<library> 是共享库的路径。如果给出 :<bootstrap>,则调用该命名的无参数函数; 否则调用库的 vlog_startup_routines 数组(IEEE 1800 38.37.2)。可以 重复以加载多个库。

仅 POSIX 平台支持运行时加载(它依赖可执行文件向所加载的库导出其 VPI 符号);在 Windows 上该参数会被拒绝,VPI 代码必须改为静态链接到模型中。

+verilator+wno+unsatconstr+<value>

在仿真运行时禁用未满足约束警告。当设置为 1 时,randomize() 调用 期间关于未满足约束的警告将不会显示。默认值为 0(启用警告)。这也可以 通过 C++ API 使用 Verilated::threadContextp()->warnUnsatConstr(false) 来控制。

错误与警告

禁用警告

可以通过多种方式禁用警告:

  1. 使用 -Wno-{warning-code} 选项调用 Verilator,全局禁用该警告。

    应避免全局禁用,因为这会移除跨源文件的所有检查,并阻止其他用户在不知晓 成功编译这些源文件所需的那组魔法禁用项的情况下编译源文件。

  2. 在设计源代码中禁用警告。打印警告时会包含一个警告代码。用 /*verilator&32;lint_off*/ 和 /*verilator&32;lint_on*/ 元注释对 包围有问题的行:

    // verilator lint_off UNSIGNED
    if (`DEF_THAT_IS_EQ_ZERO <= 3) $stop;
    // verilator lint_on UNSIGNED
    

    设计源代码中的 lint_off 会向下传播到任何子文件(之后被带有 lint_off 的 文件 include 的文件),但不会向上传播到任何父文件(include 了带有 lint_off 的文件的文件)。

  3. 使用 Verilator 控制文件 和 lint_off 命令禁用警告。 当脚本抑制警告且不应更改 Verilog 源代码时,这很有用。此方法还允许匹配 警告文本。

    lint_off -rule UNSIGNED -file "*/example.v" -lines 1
    

元注释和控制文件指令互不影响。如果警告被元注释或控制文件中的指令禁用,它 将不会被发出。

错误与警告格式

Verilator 打印的警告和错误始终匹配以下正则表达式:

%(Error|Warning)(-[A-Z0-9_]+)?: ((\S+):(\d+):((\d+):)? )?.*

错误和警告以百分号开头(历史渊源来自 Digital Equipment Corporation)。一些 错误或警告附带代码,其含义如下所述。一些错误还有文件名、行号以及可选的列号 (从列 1 开始以匹配 GCC)。

在错误消息之后,Verilator 通常会显示与该错误对应的用户源代码,前缀为行号和 " | "。其后通常是一个箭头和 ~,指向正上方源行上的错误。

需要理解 Verilator 警告输出的工具不应解析这种文本诊断输出,而应读取用 --diagnostics-sarif 创建的 SARIF JSON 输出。

警告列表

Internal Error

此错误本不应首先出现,尽管如果先前的警告或错误消息破坏了程序,它可能 出现。如果没有其他警告或错误,请提交缺陷报告。

Unsupported: ....

此错误表示代码使用了 Verilator 尚不支持的 Verilog 语言构造。另见 语言限制。

ALWCOMBORDER

警告 always_comb 块在稍后于同一块中赋值某个变量之前读取了该变量。 由于过程块中的语句按源顺序执行,该读取观察到该变量在该次激活时的先前值。 这可能意味着类似锁存器/状态的行为,并非纯组合逻辑。

always_comb begin
  y = a + tmp;  // Reads the previous value of tmp
  tmp = b;
end

如果想要 tmp 的新值,请在读取它之前先赋值 tmp。抑制此警告可能使 结果在不同仿真器之间不同。

ALWNEVER

警告 always @* 语句没有正在读取的变量,因此事件列表为空,且由于没有 事件唤醒该进程,该 always 将永远不会执行。

有问题的示例:

always @* a = 100;

结果:

%Warning-ALWNEVER: example.v:1:3 'always @*' will never execute as expression list is empty (no variables read)

要修复,假定意图是在例如时间零执行这些语句,请改用 always_comb 语句。

忽略此警告只会抑制 lint 检查;仿真将正确进行。

ASCRANGE

警告压缩向量以升序位范围声明(即 [0:7])。降序位范围现在是压倒性的标准, 因此升序范围现在通常是由于简单的疏忽而非有意(一个显著的例外是 OpenPOWER 代码库)。

它还警告实例以升序范围声明(即 [0:7] 或 [7])并连接到 N 宽信号。这些位 很可能与人们可能期望的顺序相反(即实例 [0] 将连接到信号位 [N-1] 而不是 位 [0])。

忽略此警告只会抑制 lint 检查;仿真将正确进行。

ASSIGNDLY

警告代码中的赋值语句前面带有延迟时间,例如:

a <= #100 b;
assign #100 a = b;

忽略此警告可能使 Verilator 仿真与其他仿真器不同;然而,这曾经是一种常见 风格,因此作为代码风格警告默认禁用。

仅当 Verilator 使用 --no-timing 运行时才发出此警告。

ASSIGNEQEXPR

警告复杂表达式中出现使用 = 的赋值。意图可能是使用 ==,或者如果 = 是正确的,这可能是可读性问题。

有问题的示例:

1  assign d_o =  // Note = not == below
2      (
3      e_o = 1  // <--- Warning: ASSIGNEQEXPR
4      ) ? 1 : (
5      e_o = 0  // <--- Warning: ASSIGNEQEXPR
6      ) ? b_i : 0;

结果:

%Warning-ASSIGNEQEXPR: example.v:1:11 Assignment '=' inside expression
                                                    : ... Was a '==' intended, or suggest use a separate statement

要修复,请将赋值改为单独的语句。

默认禁用,因为这是代码风格警告;仿真将正确进行。

忽略此警告只会抑制 lint 检查;仿真将正确进行。

ASSIGNIN

错误:正在对输入信号进行赋值。这几乎肯定是错误,尽管技术上合法。

input a;
assign a = 1'b1;

忽略此警告只会抑制 lint 检查;仿真将正确进行。

BADSTDPRAGMA

错误:pragma 格式错误,针对 IEEE 1800-2023 定义的 pragma。例如空的 pragma 行,或错误使用的 'pragma protect'。IEEE 1800-2023 未定义的第三方 pragma 被忽略。

可以使用 lint_off BADSTDPRAGMA 元注释禁用此错误。

忽略此警告将导致 pragma 被忽略。

BADVLTPRAGMA

错误:/*verilator ...*/ 元注释 pragma 格式错误或不被理解。

有问题的示例:

  // verilator lintt_off WIDTH  //<--- Warning (lint_off misspelled)

结果:

%Error-BADVLTPRAGMA: example.v:1:3 Unknown verilator comment: '/*verilator lintt_off WIDTH <--- Warning (lint_off misspelled)*/'
    7 |   /*verilator lintt_off WIDTH <--- Warning (lint_off misspelled)*/
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

可以使用 lint_off BADVLTPRAGMA 元注释禁用此错误。

忽略此警告将导致 pragma 被忽略。

BLKANDNBLK

BLKANDNBLK 是一个错误:某个变量由阻塞和非阻塞赋值的混合驱动。

这在 SystemVerilog 中并不非法,但违反了良好编码实践。Verilator 将其报告 为错误,因为忽略此警告可能使 Verilator 仿真与其他仿真器不同。

当其中一个赋值位于公共任务内,或者阻塞和非阻塞赋值具有不重叠的位和 结构体成员时,通常可以安全地禁用此错误(使用 // verilator lint_off BLKANDNBLK 元注释或 -Wno-BLKANDNBLK 选项)。

从 Verilator 5.038 起,仅当 Verilator 无法证明赋值是对不重叠的子部分, 且阻塞赋值位于组合逻辑中时(这是仿真结果可能与其他仿真器不同的情况), 才会发出此警告。在此版本之后请仔细审查任何 BLKANDNBLK 情况,并且仅在 确定更新不会作用于信号的重叠部分时,才按上述方式签署豁免。

通常,这是由同时被组合逻辑和触发器驱动的寄存器引起的:

logic [3:0] foo;
always @(posedge clk) foo[index] <= ...  // With index != 0
always_comb foo[0] = ...

相反,请为触发器使用不同的寄存器:

logic [3:0] foo;
logic [3:1] foo_flopped;
always @(posedge clk) foo_flopped[index] <= ... // With index != 0
always_comb foo[0] = ...
always_comb foo[3:1] = foo_flopped;

或者,这也可以避免该错误:

logic [1:0] foo /*verilator split_var*/;
BLKLOOPINIT

指示某些构造中不支持在循环内对非压缩数组(内存)进行非阻塞赋值。这些 通常出现在初始化/复位代码中:

always @(posedge clk)
  if (~reset_l)
    for (i=0; i<`ARRAY_SIZE; i++)
      array[i] <= 0;  // Non-blocking assignment inside loop
  else
    array[address] <= data;

虽然这在典型的可综合代码中受支持(包括上述示例),但某些复杂情况不 支持。即:

  1. 如果上述循环位于可挂起进程或 fork 语句内部。

2. 如果该变量也是可挂起进程或 fork 语句中 '<=' 非阻塞赋值的目标(除了 可综合循环之外)。

  1. 如果数组的元素类型是复合类型。

  2. 在 5.026 之前的版本中,任何对数组的延迟赋值。

如果可能,将循环内的非阻塞赋值改为阻塞赋值(即使用 '=' 而不是 '<=') 可能略微改善运行时性能。

此消息仅在大或复杂的循环上出现,因为 Verilator 通常会展开小循环。你可能 想尝试增加 --unroll-count`(偶尔还有 :vlopt:--unroll-stmts`), 这会提高小循环的门槛以避免此错误。

BLKSEQ

这表示在时序块中使用了阻塞赋值 (=)。通常,在时序块中使用非阻塞/延迟赋值 (<=) 以避免仿真器竞争的可能性。如果生成的信号仅在同一块的稍后使用,这样 做可能是合理的;然而,这种风格通常不鼓励,因为它容易出错。

always @(posedge clk)  foo = ...;  //<--- Warning

默认禁用,因为这是代码风格警告;仿真将正确进行。

具有类似警告的其他工具:Verible 的 always-ff-non-blocking, "Use only non-blocking assignments inside 'always_ff' sequential blocks."

BSSPACE

警告反斜杠后跟空格再跟换行。意图很可能是反斜杠直接后跟换行(例如在制作 "`define" 时),而行尾意外地有空白。如果空格不是意外的,建议在代码中 移除反斜杠,因为它没有作用。

忽略此警告只会抑制 lint 检查;仿真将正确进行。

CASEINCOMPLETE

警告在 case 语句内部,存在某种激励模式没有提供 case 项。这是坏风格; 如果某个 case 不可能,最好有 default: $stop; 或直接 default: ;, 这样任何设计假设违反都会在仿真中被发现。

对枚举变量进行选择的 unique case 语句,如果所有枚举值都被 case 项覆盖, 则被视为完整,即使 case 语句不覆盖非法的非枚举值 (IEEE 1800-2023 12.5.3)。除非使用 --no-assert-case,Verilator 会检查非法值未被 命中。

Unique0 case 语句永远不会导致此警告。(不过 unique0 在可综合代码中应 避免,因为可能导致锁存器行为。)

忽略此警告只会抑制 lint 检查;仿真将正确进行。

CASEOVERLAP

警告 case 语句的 case 值被检测为重叠。这是坏风格,因为改变 case 值的顺序 会导致不同的行为。通常可以重新指定这些值使其不重叠。

忽略此警告只会抑制 lint 检查;仿真将正确进行。

CASEWITHX

警告 case 语句包含带 x 的常量。Verilator 是二态的,因此将此类项解释 为始终为假。注意一个常见错误是在 case 或 casez 语句项中使用 X;通常 用户实际想要的是使用带 ? 的 casez。

忽略此警告只会抑制 lint 检查;仿真将正确进行。

CASEX

警告更好的风格是使用 casez,并用 "?" 代替 "x"。见 http://www.sunburst-design.com/papers/CummingsSNUG1999Boston_FullParallelCase.pdf

忽略此警告只会抑制 lint 检查;仿真将正确进行。

CASTCONST

警告动态转换 ($cast) 是不必要的,因为 $cast 将始终成功或失败。如果 它将始终失败,则 $cast 无用;如果它将始终成功,则静态转换可能更好。

忽略此警告只会抑制 lint 检查;仿真将正确进行。在其他仿真器上,不修复 CASTCONST 可能导致性能下降。

CDCRSTLOGIC

历史遗留,自 5.008 版本起从未发出。

曾用一个不再支持的时钟域交叉选项警告:异步触发器复位项来自主输入或触发 输出之外,造成复位毛刺的可能性。

CLKDATA

历史遗留,自 5.000 版本起从未发出。

曾警告时钟信号被混合使用为数据信号或与数据信号一起使用。仅当用户使用 命令行选项或源码内元注释(见 --clk)显式将某个信号标记为 clocker 时,才启用此警告的检查。

该警告可以在不影响仿真结果的情况下禁用。但建议检查该警告,因为它可能 降低了 Verilated 模型的性能。

CMPCONST

警告代码以始终为常量的方式比较值。例如,当 X 是单位宽时,X > 1 将 始终为假。

忽略此警告只会抑制 lint 检查;仿真将正确进行。

COLONPLUS

警告看到 :+。意图很可能是使用 +: 来选择位范围。如果意图是显式的 正范围,建议添加空格,例如使用 : +。

忽略此警告只会抑制 lint 检查;仿真将正确进行。

COMBDLY

警告组合块内部存在延迟赋值。以这种方式使用延迟赋值被认为是坏形式,可能 导致仿真器与综合不匹配。如果此消息被抑制,Verilator 会像综合一样将其转换 为非延迟赋值,这可能导致逻辑竞争或其他麻烦。见 http://www.sunburst-design.com/papers/CummingsSNUG2000SJ_NBA.pdf

忽略此警告可能使 Verilator 仿真与其他仿真器不同。

CONSTRAINTIGN

警告 Verilator 不支持某些形式的 constraint、constraint_mode 或 rand_mode,该构造被忽略。

忽略此警告可能使 Verilator 的 randomize() 仿真与其他仿真器不同。

CONSTWRITTEN

错误:正在给 const 数据类型变量赋值。

IEEE 1800-2023 6.20.6 要求此错误。

抑制此错误将抑制错误消息检查;仿真将如同 const 不存在一样进行。

CONTASSINIT

错误:连续赋值正在为具有初始值的变量赋值。请使用初始值或连续赋值,但不要 同时使用两者。

例如:

module t;
  logic b = 1'b0;
  logic a;
  assign b = a; //<--- Error
endmodule

结果:

%Error-CONTASSINIT: example.sv:4:10: Continuous assignment to variable with initial value: 'b'
                                            : ... note: In instance 't'
                                            : ... Location of variable initialization
    2 |   logic b = 1'b0;
      |         ^
                      example.sv:4:10: ... Location of continuous assignment
    4 |   assign b = a;
      |          ^
%Error: Exiting due to 1 error(s)

以下内容合法,因为被驱动的变量没有声明初始化器:

module t;
  logic b;
  logic a = 1'b0;
  assign b = a;
endmodule
CONTASSREG

错误:连续赋值正在给 reg 赋值。根据 IEEE Verilog(而非 SystemVerilog), 连续赋值的目标必须使用 wire。

此错误仅在以下情况下报告

--language 1364-1995、 --language 1364-2001 或 --language 1364-2005 被使用时。

忽略此错误只会抑制 lint 检查;仿真将正确进行。

COVERIGN

警告 Verilator 不支持某些形式的 covergroup、coverpoint 和覆盖率 选项,该构造被忽略。

禁用 UNSUPPORTED 错误也会禁用此警告。

忽略此警告可能使 Verilator 忽略对该构造的 lint 检查,并以与其他仿真器 不同的方式收集覆盖率数据。

DECLFILENAME

警告模块或其他声明的名称与它声明所在文件的文件名(去掉路径和扩展名) 不匹配。模块/接口/程序声明所在的文件名应与模块等的名称匹配,以便 -y 选项的目录搜索能工作。对任何给定文件,仅对第一个不匹配的 模块打印此警告,且忽略 -v 库文件。

默认禁用,因为这是代码风格警告;仿真将正确进行。

DEFOVERRIDE

警告代码中的宏定义被命令行指令覆盖:

例如,用 <+define+\<DUP\>=\<def2\>> 运行 Verilator,并且

1`define DUP def2 //<--- Warning

结果:

%Warning-DEFOVERRIDE: example.v1:20: Overriding define: 'DEF' with value: 'def2' to existing command line define value: 'def1'
             ... Location of previous definition, with value: '50'

虽然 IEEE 1800-2023 标准中没有明确说明,但此警告与其他仿真器的行为一致, 即用通过命令行传入的定义覆盖代码文件中的宏定义。

DEFPARAM

警告 defparam 语句在 IEEE 1364-2001 中已被弃用,所有设计现在都应使用 #(...) 格式来指定参数。

Defparam 可能定义在远离受其影响的实例化的地方,影响可读性。Defparam 自 IEEE 1800-2005 25.2 起已被正式弃用,在未来的语言版本中可能无法工作。

默认禁用,因为这是代码风格警告;仿真将正确进行。

有问题的示例:

1module parameterized
2  #(parameter int MY_PARAM = 0);
3endmodule
4module upper;
5  defparam p0.MY_PARAM = 1;  //<--- Warning
6  parameterized p0();
7endmodule

结果:

%Warning-DEFPARAM: example.v:5:15: defparam is deprecated (IEEE 1800-2023 C.4.1)
                                 : ... Suggest use instantiation with #(.MY_PARAM(...etc...))

要修复,请使用 #(.PARAMETER(...)) 语法。修复后的示例:

1module parameterized
2  #(parameter int MY_PARAM = 0);
3endmodule
4module upper
5  parameterized
6    #(.MY_PARAM(1))  //<--- Repaired
7    p0();
8endmodule

具有类似警告的其他工具:Verible 的 forbid_defparam_rule。

DEPRECATED

警告 Verilator 元注释或配置文件命令使用了已被弃用的语法。请将代码升级为 警告消息通常建议的替代方式。

忽略此警告只会抑制 lint 检查;仿真将正确进行。

DETECTARRAY

历史遗留,自 3.862 版本起从未发出。

当 Verilator 试图处理无法展平且涉及 Verilator 无法处理的数据类型(例如 非压缩结构体或大型非压缩数组)的组合循环时,曾是一个错误。

DIDNOTCONVERGE

仿真运行时模型未正确稳定时的错误。

有时 Verilator 必须多次求值组合逻辑,通常出现在发出但禁用了 UNOPTFLAT 警告的代码周围。

有问题的示例:

1  always_comb b = ~a;
2  always_comb a = b;

在运行时(不是 Verilate 时)结果:

%Error-DIDNOTCONVERGE: Settle region did not converge after '--converge-limit' of 10000 tries

这是因为信号即使没有时间流逝也持续翻转。因此为防止无限循环,Verilated 可执行文件给出 DIDNOTCONVERGE 错误。

要调试此问题,首先检查任何被忽略的 UNOPTFLAT 警告。虽然通常忽略 UNOPTFLAT(以性能为代价)是安全的,但在发出 UNOPTFLAT 时 Verilator 不 知道逻辑最终是否会收敛,并假定它会。

接下来,使用 --prof-cfuncs -CFLAGS -DVL_DEBUG 运行 Verilator。重新运行测试。现在就在收敛错误之前,你应该看到类似以下的 额外输出:

-V{t#,#}         'stl' region trigger index 0 is active: @([hybrid] a)
%Error-DIDNOTCONVERGE: Settle region did not converge after '--converge-limit' of 10000 tries

CHANGE 行意味着信号 'a' 在驱动该信号的给定文件名和行号处持续变化。检查 修改这些信号的代码。注意如果打印了许多信号,那么很可能它们都在振荡。 也可能是例如 "a" 在振荡,然后 "a" 馈送到信号 "c",后者也被报告为振荡。

DIDNOTCONVERGE 可能出现的一种方式是用门原语构建触发器。Verilator 不支持 用门原语构建触发器或锁存器,任何此类代码都必须改为使用行为构造(例如 always_ff 和 always_latch)。

另一种可能出现 DIDNOTCONVERGE 的方式是,如果 Verilator 使用 --no-timing 运行,而 # 延迟被用于生成时钟。在此模式下, Verilator 忽略延迟并给出 ASSIGNDLY 或 STMTDLY 警告。 如果这些被抑制,由于缺少延迟,设计可能振荡。

最后,罕见的、更困难的情况可以像 C++ 程序一样调试;要么进入 gdb 并使用其跟踪功能,要么编辑生成的 C++ 代码添加适当的打印 以查看发生了什么。

ENCAPSULATED

警告类成员被声明为 local 或 protected,但从该类外部(如果是 local) 或派生类(如果是 protected)被访问。

忽略此警告只会抑制 lint 检查;仿真将正确进行。

ENDLABEL

错误:附加到 "end"-某语句的标签与附加到块开始的标签不匹配。

IEEE 要求此错误。忽略此警告只会抑制 lint 检查;仿真将正确进行。

有问题的示例:

1module mine;
2endmodule : not_mine  //<--- Warning

结果:

%Error-ENDLABEL: example.v:2:13: End label 'not_mine' does not match begin label 'mine'

要修复,要么修正 end 标签的名称,要么完全删除它。

1module mine;
2endmodule : mine  //<--- Repaired

具有类似警告的其他工具:Verible 的 mismatched-labels, "Begin/end block labels must match." 或 "Matching begin label is missing."

ENUMITEMWIDTH

错误:枚举项的值正从会被截断的值赋值(类似于 WIDTHTRUNC), 或从具有不同位宽的有尺寸字面量常量赋值(类似于 WIDTHTRUNC 或 WIDTHEXPAND)。IEEE 要求此错误,但可以禁用。

有问题的示例:

1typedef enum [3:0] {
2  WRONG_WIDTH = 33'h3  //<--- Warning
3} enum_t;

要修复,直接修正该项值的大小,或使用转换,使结果宽度与枚举的宽度匹配。

ENUMVALUE

错误:枚举数据类型的值正从另一个与该枚举类型不隐式赋值兼容的数据类型 赋值。IEEE 要求此错误,但可以禁用。

有问题的示例:

1typedef enum { ZERO } e_t;
2initial e_t en = 0;  //<--- Warning

理想的修复是使用枚举值的助记符:

1typedef enum { ZERO } e_t;
2initial e_t en = ZERO;  //<--- Repaired

或者使用静态转换:

1typedef enum { ZERO } e_t;
2initial e_t en = e_t'(0);  //<--- Repaired
EOFNEWLINE

警告文件不以换行结尾。POSIX 定义行必须以换行结尾,否则例如以该文件为参数 的 cat 可能产生不期望的结果。

通过在文件末尾追加一个换行来修复。

默认禁用,因为这是代码风格警告;仿真将正确进行。

具有类似警告的其他工具:Verible 的 posix-eof,"File must end with a newline."

FINALDLY

在 final 块中使用非阻塞赋值 <= 时发出的错误。

此错误可以禁用。如果禁用,该赋值将作为 = 阻塞赋值执行。

有问题的示例:

1  bit foo;
2  final foo <= 1;  // <--- Error

结果:

%Error-FINALDLY: example.v:1:13 Non-blocking assignment '<=' in final block
    9 |   final foo <= 1;
      |             ^~
FSMMULTI

警告同一个 always 块包含多个 enum 类型的 case 语句,当启用 --coverage-fsm 或 --coverage 时,它们看起来像原生 FSM 覆盖率的候选。

Verilator 的 FSM 覆盖率仅插桩源顺序中的第一个此类候选。请将 FSM 拆分到 单独的 always 块中,或显式标注预期的状态变量并重构 RTL,以完整覆盖此类 多个状态机。

FUNCTIMECTL

错误:函数包含时间控制语句或对任务的调用。IEEE 1800-2023 13.4 要求此 错误。

有问题的示例:

1  function void calls_timing_ctl;
2    @e;  // <--- Bad IEEE 1800-2023 13.4 time-controlling

结果:

%Error-FUNCTIMECTL: example.v:1:5 Functions cannot contain time-controlling statements (IEEE 1800-2023 13.4)

抑制此错误只会抑制 IEEE 要求的检查;在大多数情况下 Verilator 将函数和 任务一视同仁,并依赖分析来确定哪些函数/任务需要允许时间流逝。

FUTURE

警告某特性正在开发中,尚不支持。

GENCLK

历史遗留,自 5.000 版本起从未发出。

曾指示指定信号是在模型内部生成并用作时钟。

GENUNNAMED

警告 generate 块未命名,将按 IEEE 使用 "genblk"。

潜在问题是添加额外的 generate 块会重新编号所分配的名称,这可能最终导致 综合约束或依赖层级路径保持一致的其他工具出现问题。

为空的块可能不会用此警告报告,因为不为空块创建作用域,所以让它们未命名 没有害处。

默认禁用,因为这是代码风格警告;仿真将正确进行。

1generate
2  if (PARAM == 1) begin  //<--- Warning
3  end

结果:

%Warning-GENUNNAMED: example.v:2:9: Unnamed generate block (IEEE 1800-2023 27.6)

要修复此问题,请分配一个标签(通常使用 gen_ 或 g_ 的命名约定 前缀),例如:

1generate
2  if (PARAM == 1) begin : gen_param_1  //<--- Repaired
3  end

具有类似警告的其他工具:Verible 的 generate-label,"All generate block statements must have a label."

HIERBLOCK

警告顶层模块被 /*verilator&32;hier_block*/ 元注释标记为层级块, 这是不合法的。顶层模块上的此设置将被忽略。

HIERPARAM

错误:正在使用层级值或函数来赋值参数。IEEE 1800-2023 6.20.2 要求此错误。

有问题的示例:

1  sub #(.X(MY_X)) u_sub ();
2
3  localparam int SUB_Y = u_sub.Y;  // <--- BAD: IEEE 1800-2023 6.20.2 no hierarchical

结果:

%Error-HIERPARAM: example.v:1:32 Parameter values cannot use hierarchical values (IEEE 1800-2023 6.20.2)
                                            : ... note: In instance 't'
   36 |   localparam int SUB_Y = u_sub.Y;
      |                                ^

抑制此错误可能允许某些层级引用工作(特别是对接口引用的层级引用),但并非 所有情况都可行,例如它无法以影响确定展开较低模块的参数的方式引用较低模块 的参数。

对出现在模块端口列表中的接口/modport 的 IEEE 1800-2023 25.10 作了例外, 因为这些是对在更高层声明并已特化的接口/modport 的引用。这些类型的访问 不需要豁免 HIERPARAM。

IEEEMAYDEPRECATE

此特性尚未弃用,但在未来版本的 IEEE 标准中可能弃用。此警告旨在提醒用户 他们可能想避免使用此特性,因为它可能在未来的 IEEE 标准版本中被移除, 因此在未来的 Verilator 版本中可能不受支持。

IFDEPTH

警告 if/if else 语句超过了用 --if-depth 指定的深度,因为它们 很可能导致缓慢的优先级编码器。unique 和 priority if 语句下方的语句被 忽略。解决方案包括将代码改为 case 语句,或使用 SystemVerilog 的 unique if 或 priority if 语句。

默认禁用,因为这是代码风格警告;仿真将正确进行。

IGNOREDRETURN

警告非 void 函数被作为任务调用,因此返回值被忽略。IEEE 要求此警告。

1function int function_being_called_as_task;
2  return 1;
3endfunction
4
5initial function_being_called_as_task();  //<--- Warning

结果:

%Warning-IGNOREDRETURN: example.v:5:9: Ignoring return value of non-void function (IEEE 1800-2023 13.4.1)

抑制此警告的可移植方式(在 SystemVerilog 中)是使用 void 转换,例如:

1function int function_being_called_as_task;
2  return 1;
3endfunction
4
5initial void'(function_being_called_as_task());  //<--- Repaired

忽略此警告只会抑制 lint 检查;仿真将正确进行。

IMPERFECTSCH

历史遗留,自 5.000 版本起从未发出。

曾警告模型的调度不完美,一些手动代码编辑可能带来更快的性能。此警告默认 关闭,不属于 -Wall,必须在处理顶层模块语句之前显式打开。

IMPLICIT

警告 wire 被隐式声明(它是来自子模块的单位宽输出)。虽然在 Verilog 中 合法,但隐式声明仅适用于单位宽信号(不适用于总线),不允许在实例隐式 声明信号之前使用该信号,并可能导致悬空线网。更好的选择是 Emacs 的 Verilog-Mode 的 /*AUTOWIRE*/ 特性,可从 https://www.veripool.org/verilog-mode 获取

忽略此警告只会抑制 lint 检查;仿真将正确进行。

具有类似警告的其他工具:Icarus Verilog 的 implicit,"warning: implicit definition of wire '...'"。

IMPLICITSTATIC

警告任务或函数的生命周期未提供,因此所包含的变量被隐式设置为 static。 当任务或函数内没有变量被赋值时,该警告被抑制。

还警告进程(例如 "always" 或 "initial" 语句)包含被隐式设置为 static 的 变量。

IEEE 1800-2023 6.21 要求此错误,尽管 Verilator 默认将其视为警告。

这是一个警告,因为静态默认值与 C++ 不同,与类成员函数/任务不同。static 是比 automatic 更危险的默认值,因为 static 阻止函数或进程可重入,这可能 是缺陷和/或性能问题的来源。

如果函数在模块中且不需要静态行为,请将其改为 "function automatic"。

如果函数在模块中且需要静态行为,请将其改为 "function static"。

如果函数在包中,它默认是 static,请将该函数的变量标注为 static。

忽略此警告只会抑制 lint 检查;仿真将正确进行。

IMPORTSTAR

警告 import {package}::* 语句位于 $unit 作用域。这导致导入的符号 污染全局命名空间,使拥有包的大部分目的落空。通常,import ::* 只应 在较低作用域(如包或模块)内使用。

默认禁用,因为这是代码风格警告;仿真将正确进行。

IMPURE

警告标记有 /*verilator&32;no_inline_task*/ 元注释的任务或函数 引用了不是该任务局部的变量,Verilator 无法正确调度这些变量。

忽略此警告可能使 Verilator 仿真与其他仿真器不同。

INCABSPATH

警告 "`include" 文件名指定了绝对路径。这意味着代码无法在任何其他文件 系统布局不同的系统上工作。不要使用绝对路径,而应使用相对路径(最好不 指定任何目录),并在命令行上使用 +incdir 指定顶层 include 源目录。

默认禁用,因为这是代码风格警告;仿真将正确进行。

INFINITELOOP

警告 while 或 for 语句的条件始终为真,因此如果该语句执行,会导致 无限循环。

如果 Verilator 使用 --no-timing 运行,且循环体包含否则会使时间 流逝的语句,这可能是意外行为。

忽略此警告只会抑制 lint 检查;仿真将正确进行(即因无限循环而挂起)。

INITIALDLY

历史遗留,自 5.050 版本起从未发出。

曾警告代码在 initial 或 final 块内部有延迟赋值。如果此消息被抑制, Verilator 会将其转换为非延迟赋值。使用 --timing 时,同时包含 # 延迟控制或 @ 事件控制语句的 initial 块中的延迟赋值被调度为 非阻塞赋值。另见 COMBDLY。

忽略此警告可能使 Verilator 仿真与其他仿真器不同。

INSECURE

警告所选选项的组合可能挫败保护/混淆标识符或隐藏模型中信息的尝试。请修正 提供的选项,或检查输出代码以查看所暴露的信息是否可接受。

忽略此警告只会抑制 lint 检查;仿真将正确进行。

INSIDETRUE

警告 inside 表达式包含两侧都无界值的范围([$:$]),它始终为真。 这很可能是编码错误。

忽略此警告只会抑制 lint 检查;仿真将正确进行。

LATCH

警告信号未在组合 always 块的所有控制路径中被赋值,导致推断出锁存器。 对于有意的锁存器,考虑改用 always_latch (SystemVerilog) 关键字。可以使用 围绕 always 块的 lint_off pragma 禁用该警告。

忽略此警告只会抑制 lint 检查;仿真将正确进行。

LIFETIME

错误:变量在可能比其声明所在进程存活更久的进程中被引用。这在使用 'fork..join_none' 或 'fork..join_any' 块时可能发生,它们派生的进程可能 比其父进程存活更久。仅当 Verilator 无法将该引用替换为对该变量副本(局部 于派生进程)的引用时才会发生此错误。例如:

1task foo(int local_var);
2  fork
3    #10 local_var++;
4    #20 $display("local_var = %d", local_var);
5  join_none
6endtask

在上例中 'local_var' 仅在 'foo' 的作用域内存在,一旦 foo 完成,包含它的 栈帧被移除。然而,从 foo 派生的进程继续,因为它包含延迟。经过 10 个时间 单位后,该进程试图修改 'local_var'。但该变量已不存在。它不能在派生时成为 派生进程的局部变量,因为它被修改并可能在别处被引用,例如在此例中被延迟 20 个时间单位的另一个派生进程中。因此,没有可行的栈分配给它。

要修复它,如果意图不是在进程外部共享变量的状态,则创建该变量的本地副本。

例如:

 1task foo(int local_var);
 2  fork
 3    #10 begin
 4      int forked_var = local_var;
 5      forked_var++;
 6    end
 7    #20 begin
 8      // Note that we are going to print the original value here,
 9      // as `forked_var`is a local copy that was initialized while
10      // `foo` was still alive.
11      int forked_var = local_var;
12      $display("forked_var = %d", forked_var)
13    end
14  join_none
15endtask

如果你需要共享其状态,另一种策略是确保它被静态分配:

1int static_var;
2
3task foo();
4  fork
5    #10 static_var++;
6    #20 $display("static_var = %d", static_var);
7  join_none
8endtask

然而,如果你需要能够在运行时实例化,解决方案是将其包装在对象中,因为 派生进程可以持有对该对象的引用,并以此方式确保变量保持存活:

 1class Wrapper;
 2  int m_var;
 3
 4  // Here we implicitly hold a reference to `this`
 5  task foo();
 6    fork
 7      #10 m_var++;
 8      #20 $display("this.m_var = %d", m_var);
 9    join_none
10  endtask
11endclass
12
13// Here we explicitly hold a handle to an object
14task bar(Wrapper wrapper);
15  fork
16    #10 wrapper.m_var++;
17    #20 $display("wrapper.m_var = %d", wrapper.m_var);
18  join_none
19endtask
LITENDIAN

此警告的名称与小端的常见解释相矛盾。因此它被重命名为 ASCRANGE。虽然 LITENDIAN 为向后兼容而保留,但新项目 应使用 ASCRANGE。

MINTYPMAXDLY
#(3:5:8) clk = ~clk;

警告最小、典型和最大延迟表达式目前不受支持。Verilator 只使用典型延迟值。

MISINDENT

警告语句的缩进具有误导性,暗示该语句是先前 if 或 while 块的一部分, 而实际上不是。

当空格和制表符混合不一致时,Verilator 会抑制此检查,因为它无法确保制表符 的宽度。Verilator 还会忽略带 begin/end 的块,因为 end 在视觉上 指示了先前语句的结束。

忽略此警告只会抑制 lint 检查;仿真将正确进行。

例如

1if (something)
2  statement_in_if;
3  statement_not_in_if;  //<--- Warning

结果:

%Warning-MISINDENT: example.v:3:9: Misleading indentation

要修复此问题,请将缩进修正为与正确的先前语句匹配,例如:

1if (something)
2  statement_in_if;
3statement_not_in_if;  //<--- Repaired

具有类似警告的其他工具:GCC -Wmisleading-indentation、clang-tidy readability-misleading-indentation。

MODDUP

警告模块有多个定义。通常,这表明编码错误或库文件中的错误,良好实践是每个 文件一个模块(并且每个文件只在命令行上放置一次)以避免这些问题。对于某些 门级网表,重复有时不可避免,此时应禁用 MODDUP。

忽略此警告将导致较新的模块定义被丢弃。

MODMISSING

错误:通常由单元引用的模块未找到。这通常是致命的,但在某些缺少库的 linting 情况下可以被抑制。

忽略此错误将导致单元定义被丢弃。仿真结果很可能错误,因此通常仅与 lint-only 一起使用。

MULTIDRIVEN

警告指定信号有多个过程驱动。

一种情况是信号来自多个 always 块,每个块有不同的时钟。此警告不查看 单个位(见下面示例)。

这被认为是坏风格,因为给定信号的使用者可能不知道不一致的时钟,导致时钟域 交叉或时序缺陷。

有问题的示例:

1  always @(posedge clk) begin
2    out2[7:0] <= d0;  // <--- Warning
3  end
4  always @(negedge clk) begin
5    out2[15:8] <= d0;  // <--- Warning
6  end

结果:

%Warning-MULTIDRIVEN: example.v:1:21 Signal has multiple driving blocks with different clocking: 'out2'
                      example.v:1:5 ... Location of first driving block
                      example.v:1:5 ... Location of other driving block

另一种情况是在 always_comb 或 always_ff 块中写入的变量也被另一个 进程写入。IEEE 1800 要求在这些专门的 always 块中写入的变量只能由该进程 写入。

有问题的 always_ff 示例:

1module t(input logic clk, input logic d, output logic q);
2
3    initial q = 1'b0;  // <--- Warning
4
5    always_ff @(posedge clk) begin
6    q <= d;  // <--- Warning
7    end
8endmodule

要在不添加另一个进程的情况下保留初始化,请使用声明初始化器(或者,对于 可综合代码,添加复位项):

logic q = 1'b0;

always_ff @(posedge clk) begin
  q <= d;
end

还有一种情况是命名为时钟块 output 的信号也被连续赋值驱动,或被命名为 第二个时钟块的 output。时钟块驱动该信号,因此设计和测试平台对它竞争, 同步驱动可能被静默丢失。如果意图只是观察该信号,请将时钟块声明为 input。

忽略此警告可能隐藏时钟域交叉、时序或可移植性缺陷。由于优化减少,它还 可能导致更长的仿真运行时间。

MULTIDRIVENPROC

警告整个变量由多个普通 always 块驱动。与 MULTIDRIVEN 情况 不同,普通 always 块不携带 always_comb/always_ff 意图,因此 这是合法的 SystemVerilog,而不是 IEEE 1800 违规。然而,这通常是综合错误: 硬件不能有由两个独立时序块驱动的信号,因此设计通常不会像 RTL 仿真所暗示 的那样运作。

默认禁用,因为这是代码风格警告;仿真将正确进行。

有问题的示例:

1  always @(posedge clk) q <= d;
2  always @(posedge clk) q <= ~d;

结果:

%Warning-MULTIDRIVENPROC: example.v:1:25 Variable written to in always block also written by another always block: 'q'
                                                               : ... note: In instance 't.u1'
                          example.v:1:25
   54 |   always @(posedge clk) q <= ~d;
      |                         ^

还警告命名为时钟块 output 的信号由普通 always 块驱动。在某些测试 平台中,同时从时钟块和普通 always 块驱动信号是一种有意的惯用法,因此 它被报告为 MULTIDRIVENPROC,而不是在默认开启的 MULTIDRIVEN 下报告。

要修复,请从单个 always 块驱动该信号,或者如果意图是单个专门进程, 请使用 always_ff/always_comb。

对于用作循环归纳变量的静态变量不发出警告:

1  integer i;
2
3  always @(posedge clk) begin
4    for (i = 0; i < 4; i = i + 1) q1[i] <= d[i];
5  end
6
7  always @(posedge clk) begin
8    for (i = 0; i < 4; i = i + 1) q2[i] <= ~d[i];
9  end
MULTITOP

警告多个顶层模块未被任何其他模块实例化,且两个模块都被放在命令行上(而不 是在库中)。三种可能情况:

1. 意图让单个模块作为顶层。那么此警告出现是因为某些低层实例被读入但不需要 作为设计的一部分。对此情况的最佳解决方案是确保只有顶层模块不带任何标志 地放在命令行上,所有剩余的库文件用 -v 作为库读入,或通过使其 文件名与模块名匹配而自动解析。

2. 意图让单个模块作为顶层,其名称已知,如果所有其他模块不是设计的一部分 则应被忽略。最佳解决方案是使用 --top 选项指定顶层模块的名称。 所有不属于设计的其他模块大部分将被忽略(它们必须语法干净,其内容将作为 Verilog 模块展开过程的一部分被移除。)

3. 意图让多个模块作为设计顶层,例如 lint 库文件时。由于需要多个模块,请 禁用 MULTITOP 警告。所有输入/输出将唯一地进入每个模块,任何冲突且相同的 信号名将通过添加基于顶层模块名的前缀并后跟 __02E(Verilator 编码的 ASCII ".")来使其唯一。即使两个模块的信号看起来相同(例如多个模块都有 "clk" 输入),也会进行此重命名。

忽略此警告将产生多个顶层,如上面 (3) 所述。

NEEDTIMINGOPT

错误:遇到与时序相关的构造(例如事件控制或延迟),但未指定 Verilator 应 如何处理它(既未提供 --timing 也未提供 --no-timing 选项)。

NEVERMATCH

警告 SVA 序列在静态上已知永远不会匹配。这样的序列是合法的 SystemVerilog 并且完全受支持,该警告仅突出潜在问题。例如,将序列用作 蕴涵的前件会导致蕴涵空洞地通过。对于 intersect 序列,请确保其操作数可以 在共同长度上匹配 (IEEE 1800-2023 16.9.6)。

忽略此警告只会抑制 lint 检查;仿真将正确进行。

NEWERSTD

警告某特性需要比 --language 选项指定的更新的 Verilog 或 SystemVerilog 标准。例如,无尺寸无基字面量('0、'1、'z、'x)需要 IEEE 1800-2005 或更新版本。

要避免此警告,请使用支持该特性的 Verilog 或 SystemVerilog 标准。或者, 修改代码以使用 --language 选项指定的 Verilog/SystemVerilog 标准 支持的不同语法。

忽略此警告只会抑制 lint 检查;仿真将正确进行。

NOEFFECT

警告该语句将没有效果,大致相当于不存在。仅当它"不明显"时才发出,例如 if (0) 不会导致此警告。

有问题的示例:

foreach (array[]) begin ... end  //<--- Warning

修复方法是移除该语句。

NOLATCH

警告在 always_latch 块中未检测到锁存器。可以使用围绕 always 块的 lint_off pragma 禁用该警告,但使用常规 always 重新编码可能更合适。

忽略此警告只会抑制 lint 检查;仿真将正确进行。

NONSTD

警告使用了非标准语言特性,而该特性有标准等价物,其在边界情况下可能表现 不同。例如 $psprintf 系统函数被其标准等价物 $sformatf 取代。

忽略此警告只会抑制 lint 检查;仿真将正确进行。

NORETURN

警告非 void 函数没有 return 语句,也没有设置函数的输出结果。

有问题的示例:

1  function int no_rtn();  // <--- Warning: No return
2  endfunction

结果:

%Warning-NORETURN: example.v:1:16 Non-void function 'no_rtn' has no return value

要修复此问题,请添加 return 语句,或设置函数的输出变量,或使函数的 数据类型为 void。

忽略此警告只会抑制 lint 检查;仿真将正确进行。

NOTIMING

错误:遇到需要 --timing 的与时序相关的构造。仅在 Verilator 使用 --no-timing 选项运行时发出。

NOTREDOP

错误:逻辑非运算符直接后跟未加括号的归约运算符,例如 !|a。 IEEE 1800-2023 附录 A 语法要求 ! 的操作数是一个基本表达式,而不是未 加括号的归约表达式。

例如:

%Error-NOTREDOP: example.v:1:17 Logical not directly before reduction operator is illegal
                                              : ... Suggest use parentheses, e.g. '!(|expr)'
   12 |   assign y[0] = !|v;
      |                 ^

某些仿真器作为扩展支持此语法,但建议修复这些以匹配 IEEE。为此,请在归约 表达式周围添加括号,例如使用 !(|a) 而不是 !|a。

抑制此错误将抑制错误消息检查;仿真将正确进行。

NULLPORT

警告在模块定义端口列表中发现空端口。空端口是空占位符,即模块端口列表 开头或结尾的一个或多个逗号,或模块端口列表中间的连续两个或多个逗号。 空端口不能在模块内访问,但按端口顺序实例化模块时,它被当作常规端口, 连接到它的任何 wire 都保持未连接。例如:

1module a
2  (a_named_port, );  //<--- Warning

这被视为警告,因为空端口很少使用,通常是输入错误的结果,例如端口列表 末尾的悬空逗号。

忽略此警告只会抑制 lint 检查;仿真将正确进行。

PARAMNODEFAULT

错误:正在声明没有默认值的参数,且这是在非 ANSI 块中进行的,而这只在 ANSI 风格的 #(...) 声明中合法。IEEE 1800-2023 6.20.1 要求此错误,但 某些仿真器接受此语法。

也在 ANSI 格式中顶层模块存在无默认值参数时发出,此时 Verilator 无法知道 如何处理该模块。对于此类情况,建议添加默认值,以便模块可以干净地 lint。

有问题的非 ANSI 示例:

1module sub;
2  parameter NODEF;  //<--- Warning

结果:

%Error-PARAMNODEFAULT: example.v:1:13 Parameter without default requires ANSI-style parameter list (IEEE 1800-2023 6.20.1): 'NODEF'
    8 |   parameter NODEF;
      |             ^~~~~

要修复此问题,请改为 ANSI 风格声明。

对于非 ANSI 情况,抑制此错误只会抑制 IEEE 要求的检查;仿真将正确进行。

PINCONNECTEMPTY

警告实例有一个连接到 .pin_name() 的引脚,即不是另一个信号,但显式 提到了该引脚。可能希望禁用 PINCONNECTEMPTY,因为这表示意图是不连接。

默认禁用,因为这是代码风格警告;仿真将正确进行。

PINMISSING

警告模块有一个在实例中未提及的引脚。如果引脚不是缺失,仍应在实例声明上 用 (.pin_name()) 使用空连接指定它。

忽略此警告只会抑制 lint 检查;仿真将正确进行。

有问题的示例:

1module t;
2  sub sub ();  // <--- Warning
3endmodule
4module sub (
5    output port
6);

结果:

%Warning-PINMISSING: example.v:1:7 Instance has missing pin: 'port'

修复后的示例:

sub sub (
         .port());

具有类似警告的其他工具:Icarus Verilog 的 portbind,"warning: Instantiating module ... with dangling input port (...)"。Slang 的 unconnected-port,"port '...' has no connection"。

PINNOCONNECT

警告实例有一个未连接到另一个信号的引脚。

默认禁用,因为这是代码风格警告;仿真将正确进行。

PINNOTFOUND

警告在正在实例化的模块中未找到实例端口或参数。注意 Verilator 也会对 应由 generate/if/endgenerate 构造禁用的实例引发这些错误:

 1module a;
 2  localparam A=1;
 3  generate
 4    if (A==0) begin
 5      b b_inst1 (.x(1'b0));  //<--- error nonexistent port
 6      b #(.PX(1'b0)) b_inst2 ();  //<--- error nonexistent parameter
 7    end
 8  endgenerate
 9endmodule
10
11module b;
12endmodule

在上例中,b 用名为 x 的端口实例化,但模块 b 没有这样的端口。在下一行中, b 用不存在的 PX 参数实例化。从技术上讲,因此此代码是不正确的,但其他工具 可能忽略它,因为由于 generate/if 条件为假,模块 b 未被实例化。

可以使用 lint_off PINNOTFOUND 元注释禁用此错误。

PKGNODECL

自 5.038 版本起从未发出。历史上是错误:某个包/类似乎被引用但尚未声明。 根据 IEEE 1800-2023 26.3,所有包在使用前必须声明。然而,包括 UVM 在内的 若干标准库违反了这一点,且其他工具不发出警告。

PORTSHORT

警告输出端口连接到常量。

1module a;
2  sub sub
3     (.out(1'b1));  //<--- error PORTSHORT
4endmodule
5
6module sub (output out);
7  assign out = '1;
8endmodule

在上例中,out 是输出但连接到常量,暗示它是输入。

可以使用 lint_off PORTSHORT 元注释禁用此错误。

PREPROCZERO

警告预处理器 `ifdef/`ifndef 表达式(在 IEEE 1800-2023 中添加)求值一个 值为 0 的 define。它在表达式中的求值结果将为 1,因为该 define 有定义,这与 C 预处理器不同,后者使用 define 的值(1)求值。

引用空值的 define 不会给出此警告,因为在 C 中,预处理器对空 define 的 预处理器表达式会给出错误。

1`define ZERO 0
2`ifdef (ZERO || ZERO)  //<--- warning PREPROCZERO
3 `error This_will_error_which_might_be_not_the_intent
4`endif

抑制此警告的可移植方式是,当 define 值要在预处理器表达式中使用时,使用 非零的 define 值。

忽略此警告只会抑制 lint 检查;仿真将正确进行。

PROCASSINIT

警告指定信号在声明处被赋予初始值,同时也在 always 进程中被驱动。通常此类 初始值应改为在进程内使用复位信号设置,以符合 ASIC 综合工具的要求。然而, 声明初始化器是有效的 FPGA 设计惯用法,因此 FPGA 用户可能想禁用此警告。

有问题的示例:

1  logic flop_out = 1;  // <--- Warning
2
3  always @(posedge clk, negedge reset_l) begin
4    if (enable) begin
5      flop_out <= ~in;  // <--- Use of initialized
6    end
7  end

结果:

%Warning-PROCASSINIT: example.v:1:20 Procedural assignment to declaration with initial value: 'flop_out'
                                                      : ... note: In instance 't'
                                                      : ... Location of variable initialization
   26 |   logic flop_out = 1;
      |                    ^
                      example.v:1:7 ... Location of variable process write
                                                     : ... Perhaps should initialize instead using a reset in this process
   30 |       flop_out <= ~in;
      |       ^~~~~~~~

一种可能的修复,向 always 添加复位:

 1  logic flop2_out;
 2
 3  always @(posedge clk, negedge reset_l) begin
 4    if (!reset_l) begin
 5      flop2_out <= '1;  // <--- Added reset init
 6    end
 7    else if (enable) begin
 8      flop2_out <= ~in;
 9    end
10  end

对于非 always_ff 逻辑,也可以使用 initial 块进行初始化:

initial flop_out = 1;  // <--- Fixed

不要对由 always_ff 进程赋值的变量使用单独的 initial 块,因为 IEEE 1800 要求 always_ff 变量只能由该进程写入。请使用声明初始化器,或在 always_ff 内部通过复位逻辑初始化该变量。

默认禁用,因为这是代码风格警告;仿真将正确进行。

PROCASSWIRE

错误:过程赋值正在给 wire 赋值。根据 IEEE,过程赋值的目标必须使用 var/reg。

PROFOUTOFDATE

警告线程使用估算成本调度,即使通过 profile_data 配置文件选项 馈入 Verilator 的配置引导优化(见 线程配置引导优化)提供了数据。这通常 表示分析数据是从与 Verilator 当前运行的 Verilog 源代码不同的源代码生成 的。

建议创建新的分析数据,然后用相同的输入源文件和该新分析数据重新运行 Verilator。

忽略此警告可能只会减慢仿真;仿真将正确进行。

PROTECTED

警告遇到 'pragma protected' 部分。受保护区域内的代码将部分检查正确性, 但在其他方面被忽略。

忽略该警告可能使 Verilator 与接受受保护代码的仿真器不同。

PROTOTYPEMIS

错误:函数原型在某些方面与该函数的块外声明不匹配。IEEE 要求此错误。

典型的解决方案是修正原型以与声明完全匹配,包括参数数量、参数名称、参数 数据类型以及返回数据类型(对于函数)。

禁用此错误将导致 Verilator 忽略该原型,并可能使代码在其他工具中非法。

RANDC

历史遗留,自 5.018 版本起从未发出,当时 randc 变得完全受支持。

曾警告 randc 关键字不受支持并被转换为 rand。

REALCVT

警告实数被隐式舍入为整数,可能损失精度。

忽略此警告只会抑制 lint 检查;仿真将正确进行。

有问题的示例:

1int i;
2i = 2.3;  //<--- Warning

结果:

%Warning-REALCVT: example.v:2:5: Implicit conversion of real to integer

如果代码正确,抑制该警告的可移植方式是添加转换。这将表达意图,并应避免 将来在任何 lint 工具上出现警告。

1int i;
2i = int'(2.3);  //<--- Repaired
REDEFMACRO

警告代码用不同的值重新定义了同一个宏。

忽略此警告只会抑制 lint 检查;仿真将正确进行。

例如:

1`define DUP def1
2//...
3`define DUP def2  //<--- Warning

结果:

%Warning-REDEFMACRO: example.v:3:20: Redefining existing define: 'DUP', with different value: 'def1'
                     example.v:1:20: ... Location of previous definition, with value: 'def2'

最佳解决方案是为第二个宏使用不同的名称。如果不可行,请添加 undef 以表明 代码覆盖了该值。这将表达意图,并应避免将来在任何 lint 工具上出现警告:

`define DUP def1
//...
`undef DUP  //<--- Repaired
`define DUP def2

具有类似警告的其他工具:Icarus Verilog 的 macro-redefinition, "warning: redefinition of macro ... from value '...' to '...'"。Yosys 的 "Duplicate macro arguments with name"。

RISEFALLDLY
and #(1,2,3) AND (out, a, b);

警告第三个(关断)延迟目前不受支持并被忽略。上升和下降延迟受支持。

在 5.048 之前的版本中,曾警告上升、下降和关断延迟不受支持。第一个(上升) 延迟用于所有情况。

SELRANGE

警告选择索引将越界。

有问题的示例:

1wire vec[6:0];
2initial out = vec[7];  //<--- Warning (there is no [7])

Verilator 将为此值假定为零而不是 X。注意在某些情况下,当访问的上游或 下游条件意味着越界访问永远不会执行或被使用时,此警告可能是误报。

修复后的示例:

1wire vec[6:0];
2initial begin
3  index = 7;
4  ...
5  if (index < 7) out = vec[index];  // Never will use vec[7]

具有类似警告的其他工具:Icarus Verilog 的 select-range, "warning: ... [...] is selecting before vector" 或 "is selecting before vector"。

SHORTREAL

警告 Verilator 不支持 shortreal,它们将自动提升为 real。

1shortreal sig;  //<--- Warning

建议将代码中的任何 shortreal 替换为 real,因为 shortreal 在 行业工具中未得到广泛支持。

1real sig;  //<--- Repaired

如果 real 增加的精度影响所建模的值或 DPI 调用,忽略此警告可能使 Verilator 仿真与其他仿真器不同。

SIDEEFFECT

警告表达式具有可能无法被 Verilator 正确执行的副作用。

这通常代表 Verilator 中的缺陷,而不是坏代码构造,不过通常可以修改 Verilog 代码来避免该警告。

有问题的示例:

1x = y[a++];

此示例发出警告,因为 Verilator 目前不处理数组下标内的副作用;a++ 可能被 执行多次。

重写代码以避免表达式副作用,通常通过使用临时变量:

1temp = a++;
2x = y[temp];

忽略此警告可能使 Verilator 仿真与其他仿真器不同。

SIMILARNAME

警告某个实体名称仅在词法大小写上与其他名称不同。

有问题的示例:

1  reg i;
2  wire I;

结果:

%Warning-SIMILARNAME: example.v:1:8 Declaration overlaps another with different case: 'I'
   13 |   wire I;
      |        ^
                      example.v:1:7 ... Location of original declaration
   12 |   reg i;
      |       ^

仅检查可以作为名称到达下游 VLSI 工具的声明,即线网、变量、实例、命名块 (begin、fork 和 generate 块)、函数和任务。所有这些都可以构成 展平信号或作用域名的一部分。其他声明,如参数、localparam、genvar 和 typedef,会被展开掉,因此不被检查。

默认禁用,因为这是代码风格警告;仿真将正确进行。

这是警告,因为一些下游 VLSI 工具不区分大小写相同的线网和门名。

SPECIFYIGN

警告 Verilator 不支持 specify 块中的某些构造,也不支持 $sdf_annotate,该构造被忽略。

禁用 UNSUPPORTED 错误也会禁用此警告。

忽略此警告可能使 Verilator 忽略对该构造的 lint 检查,并与其他仿真器得到 不同的结果。

SPLITVAR

警告带有 /*verilator&32;split_var*/ 元注释的变量未被拆分。一些 可能的原因有:

  • 变量的数据类型不支持拆分。(例如是 real)。

  • 变量的访问模式无法静态确定。(例如作为内存访问)。

  • 数组的索引超过数组大小。

  • 变量从外部使用点式引用访问。(例如 top.instance0.variable0 = 1)。

  • 变量未在模块中声明,而是在包或接口中声明。

  • 变量是参数、localparam、genvar 或队列。

  • 变量是三态或双向的。(例如 inout)。

STATICVAR

历史遗留,自 5.046 版本起从未发出。

曾警告静态变量在带声明赋值的循环中声明,Verilator 将其转换为 "automatic"。

STMTDLY

警告代码中有一个前面带延迟时间的语句。

忽略此警告可能使 Verilator 仿真与其他仿真器不同。

有问题的示例:

    #100 $finish;  //<--- Warning

结果:

%Warning-STMTDLY: example.v:1:5 Ignoring delay on this statement due to --no-timing

仅当 Verilator 使用 --no-timing 运行时才发出此警告。在此模式下, 语句上的所有延迟都被忽略。在许多情况下忽略延迟可能无害,但如果延迟语句 (如此例中)用于导致稍后的某个重要动作,则可能是重要的差异。

一些可能的变通方法:

  • 将延迟语句移到 C++ 包装文件中,在那里可以在 C++ 中完成激励和时钟生成。

  • 将语句转换为 FSM,或针对 $time 测试的其他语句。

  • 使用 --timing 运行 Verilator。

SUPERNFIRST

错误:super.new 不是 function new 中的第一条语句。

IEEE 要求此错误。忽略此警告可能导致其他错误或初始化顺序意外,如 IEEE 1800-2023 8.15 所述。

有问题的示例:

1  function new();
2    int x = $random();
3    super.new(build_coverage(x), x);  // <--- BAD, must be first statement

结果:

%Error-SUPERNFIRST: example.v:1:11 'super.new' must be first statement in a 'function new' (IEEE 1800-2023 8.15)
SYMRSVDWORD

警告符号匹配 C++ 保留字,将其用作符号名会导致奇怪的 C++ 编译器错误。你 可以禁用此警告,但 Verilator 将重命名该符号以避免冲突。如果你使用 --vpi 并且仅将事物标记为 public 以供 VPI 访问(而不是 C++ 访问),则 建议用 -Wno-SYMRSVDWORD 禁用此警告。

SYNCASYNCNET

警告指定线网在至少两个带 posedge/negedge 的不同 always 语句中使用(即 触发器)。一个用法在敏感列表和主体中都有该信号,可能是异步复位,另一个 只在主体中有该信号,可能是同步复位。混合同步和异步复位通常是错误。可以 使用围绕线网或触发器块的 lint_off pragma 禁用该警告。

默认禁用,因为这是代码风格警告;仿真将正确进行。

TASKNSVAR

错误:对任务或函数的调用有一个来自该任务的 inout 绑定到非简单信号。 相反,请将任务输出连接到一个适当宽度的临时信号,并使用该信号在下一语句 中设置适当的表达式。例如:

1task foo(inout sig); ... endtask
2// ...
3always @* begin
4  foo(bus_we_select_from[2]);  // Will get TASKNSVAR error
5end

将其改为:

task foo(inout sig); ... endtask
// ...
reg foo_temp_out;
always @* begin
  foo(foo_temp_out);
  bus_we_select_from[2] = foo_temp_out;
end

Verilator 不会为你进行此转换,因为一些更复杂的情况会导致仿真器不匹配。

TICKCOUNT

警告延迟 $past 变量的 tick 数大于 10。目前,Verilator 实际上为每个延迟 信号创建一个触发器,因此任何大的计数都可能导致设计大小大幅增加。

忽略此警告只会减慢仿真;仿真将正确进行。

TIMESCALEMOD

警告 "`timescale" 在某些模块中使用,但并非所有模块。

这可以像其他警告一样被禁用。忽略此警告可能导致模块具有意外的时间单位。

IEEE 建议将其作为错误;对于该行为,请使用 -Werror-TIMESCALEMOD。

有问题的示例:

1module mod1;
2  sub sub();
3endmodule
4`timescale 1ns/1ns
5module sub;  //<--- Warning
6endmodule

结果:

%Warning-TIMESCALEMOD: example.v:1:8: Timescale missing on this module as other modules have it (IEEE 1800-2023 3.14.2.3)

建议使用 --timescale 参数,或在所有模块之前使用:

`include "timescale.vh"

然后在该文件中设置时间单位。

具有类似警告的其他工具:Icarus Verilog 的 timescale,"warning: Some design elements have no explicit time unit and/or time precision. This may cause confusing timing results."。Slang 的:"[WRN:PA0205] No timescale set for "...""。

UNDRIVEN

警告指定信号没有来源。Verilator 在使用计算中相对宽松;将信号设为 public, 或仅设置单个数组元素,就会将整个信号标记为已驱动。

默认禁用,因为这是代码风格警告;仿真将正确进行。

具有类似警告的其他工具:Odin 的 "[NETLIST] This output is undriven (...) and will be removed"。

UNOPT

历史遗留,自 5.000 版本起从未发出。

曾警告由于某些构造,指定信号或块的优化被禁用。

忽略此警告只会减慢仿真;它正确地进行了仿真。

UNOPTFLAT

警告由于某些构造,指定信号的优化被禁用。所报告的信号包含到该信号的完整 作用域;它可能只是多次实例化块的一个特定用法。应清理该构造以改善仿真 性能。

通常 UNOPTFLAT 是由综合看来并非真正循环的逻辑引起的,综合按位分析互连, 而 IEEE 事件模型按信号分析,因此是循环的。

有问题的示例:

wire [2:0] x = {x[1:0], shift_in};

此语句需要多次求值,因为 shift_in 的变化要求 "x" 计算三次才能稳定。 这是因为 "x" 的变化要求 "x" 自身改变其值,从而导致该警告。

为获得显著更好的性能,请将其拆分为两个独立的信号:

wire [2:0] xout = {x[1:0], shift_in};

并将所有接收逻辑改为接收 "xout"。或者,将其改为:

wire [2:0] x = {xin[1:0], shift_in};

并将所有驱动逻辑改为驱动 "xin"。

进行此更改后,此赋值只需求值一次。这类更改也可能加速你传统的事件驱动 仿真器,因为每周期的事件会更少。

我们见过的最复杂的 UNOPTFLAT 路径是由于一个总线(其低位由某个 always 语句生成,而该 always 语句消耗同一总线的高位,这些高位由另一系列 always 块处理)引起的。修复方法相同;将其拆分为从每个块生成的两个独立信号。

有时存在真正的循环时也可能指示 UNOPTFLAT。例如,如果试图使用单独的门 原语实现触发器或锁存器。如果抑制 UNOPTFLAT,代码可能得到 DIDNOTCONVERGE 错误。Verilator 不支持用门原语构建触发器或锁存器,任何此类代码都必须改为 使用行为构造(例如 always_ff 和 always_latch)。

解决此警告的另一种方法是添加上述的 /*verilator&32;split_var*/ 元注释。这会导致变量在内部被拆分, 可能解决冲突。如果使用 --report-unoptflat 运行,Verilator 会 建议 /*verilator&32;split_var*/ 的可能候选。

在 5.000 版本之前,UNOPTFLAT 警告也可能由时钟使能引起,从所报告的经过 时钟门控实例的路径识别。要修复这些,使用了 clock_enable 元注释。

为协助解决 UNOPTFLAT,可以使用选项 --report-unoptflat,它将提供 可以拆分的变量建议,以及循环中所有连接节点的图。更多细节见 Arguments 一节。

忽略此警告只会减慢仿真;仿真将正确进行。

UNOPTTHREADS

警告线程调度器无法划分设计以填满所请求的线程数。

一种变通方法是使用 --threads 请求更少的线程。

另一种可能的变通方法是提高 --threads-max-mtasks 的值,以允许 仿真运行时中有更多 MTask。更多 MTask 会导致仿真运行时更多的通信和同步 开销;出于这个原因,调度器试图最小化 MTask 的数量。

忽略此警告只会减慢仿真;仿真将正确进行。

UNPACKED

警告由于使用了 --structs-packed,或直到 5.004 版本(含),非压缩 结构体和联合体不被支持。

忽略此警告将使 Verilator 将该结构体视为压缩的,这可能使 Verilator 仿真 与其他仿真器不同。这种降级还可能导致通常合法的非压缩结构体/数组内部的 非压缩结构体/数组,变成压缩结构体/数组内部的非法非压缩结构体/数组。

UNSATCONSTR

警告 randomize() 调用失败,因为一个或多个约束无法满足。当 SMT 求解器 确定约束组合不可满足时,在仿真运行时发出此警告。

每个未满足的约束都会报告其源代码位置,以帮助识别冲突的约束。

可以通过设置运行时选项 +verilator+wno+unsatconstr+1,或在 C++ 中调用 Verilated::threadContextp()->warnUnsatConstr(false) 来禁用此警告。

UNSIGNED

警告代码以暗示有符号的方式比较无符号值;例如当 X 无符号时 X < 0 将 始终为假。

忽略此警告只会抑制 lint 检查;仿真将正确进行。

UNSUPPORTED

错误:某个构造根据 IEEE 可能是合法的,但 Verilator 目前不支持。

典型的变通方法是将该构造重写为更常见的替代语言构造。

或者,检查其他工具是否支持该构造,如果支持,请考虑向 Verilator 源码提交 github pull request 以实现缺失的不支持特性。

可以使用 --bbox-unsup 忽略此错误,但这会使设计仿真不正确,仅 用于 lint 用途;详见 --bbox-unsup 下的说明。

禁用此错误也会禁用 COVERIGN 和 SPECIFYIGN。

UNUSED

禁用/启用 UNUSED 等价于禁用/启用 UNUSEDGENVAR、 UNUSEDPARAM 和 UNUSEDSIGNAL 警告。

自 5.000 版本起从未发出。历史上曾警告变量、参数或信号未被使用。

UNUSEDGENVAR

警告指定的 genvar 从未被使用/消耗。见类似的 UNUSEDSIGNAL。

UNUSEDLOOP

警告循环条件始终为假,因此循环体将永远不会被执行。

UNUSEDPARAM

警告指定的参数从未被使用/消耗。见类似的 UNUSEDSIGNAL。

UNUSEDSIGNAL

警告指定的信号从未被使用/消耗。Verilator 在使用计算中相对宽松;将信号 设为 public、信号匹配 --unused-regexp 选项(默认 "*unused*"), 或仅访问单个数组元素,都会将整个信号标记为已使用。

默认禁用,因为这是代码风格警告;仿真将正确进行。

对于未使用的线网,推荐风格是在文件底部放置类似以下代码:

wire _unused_ok = 1'b0 && &{1'b0,
                    sig_not_used_a,
                    sig_not_used_yet_b,  // To be fixed
                    1'b0};

与常量零进行 AND 意味着该线网将始终为零,因此不会使用仿真运行时。多余的 前导和尾随零避免了它们之间没有信号时的语法错误。魔法名称 "unused"(由 --unused-regexp 选项控制)被 Verilator 识别并抑制警告;如果使用 其他 lint 工具,要么教该工具忽略名称中带 "unused" 的信号,要么在该 wire 周围放置适当的 lint_off。将未使用的信号放在一处便于找到未使用的内容,并 减少 lint_off pragma 的数量,从而减少缺陷。

USERERROR

执行了 SystemVerilog 展开期断言错误。IEEE 1800-2023 20.11 要求此错误。

有问题的示例:

$error("User elaboration-time error");

结果:

%Warning-USERERROR: example.v:1:5 User elaboration-time error

要解决,请检查代码并纠正错误的原因。

USERFATAL

执行了 SystemVerilog 展开期断言致命错误。IEEE 1800-2023 20.11 要求此 错误。

有问题的示例:

$fatal(0, "User elaboration-time fatal");

结果:

%Warning-USERFATAL: example.v:1:5 User elaboration-time fatal

要解决,请检查代码并纠正致命错误的原因。

USERINFO

执行了 SystemVerilog 展开期断言打印。这不是错误或警告,IEEE 1800-2023 20.11 要求此行为。

示例:

$info("User elaboration-time info");

结果:

-Info: example.v:1:5 User elaboration-time info
USERWARN

执行了 SystemVerilog 展开期断言警告。IEEE 1800-2023 20.11 要求此警告。

有问题的示例:

$warning("User elaboration-time warning");

结果:

%Warning-USERWARN: example.v:1:5 User elaboration-time warning

要解决,请检查代码并纠正错误的原因。

VARHIDDEN

警告任务、函数或 begin/end 块声明的变量与上层模块或 begin/end 块中的 变量同名(从而隐藏上层变量使其无法被使用)。请重命名该变量以避免阅读代码 时混淆。

默认禁用,因为这是代码风格警告;仿真将正确进行。

有问题的示例:

1module t;
2  integer t;  //<--- Warning ('t' hidden by module 't')
3endmodule

结果:

%Warning-VARHIDDEN: example.v:2:11 Declaration of signal hides declaration in upper scope: 't'
                    example.v:1:8 ... Location of original declaration

要解决此问题,请将内部或外部变量重命名为唯一名称。

WAITCONST

警告 wait 语句等待常量条件,这意味着它要么永远阻塞,要么永不阻塞。

作为特例,带字面量常量 0 的 `wait(0)`(相对于展开为零的某个东西)不会 发出警告,因为假定代码在明确其意图。

有问题的示例:

wait(1);  // Blocks forever
WIDTH

根据 Verilog 的宽度规则警告:

  • 两个操作数具有不同宽度,例如将 2 位数和 5 位数相加。

  • 部分选择的尺寸与索引压缩或非压缩数组所需的不同,等等。

Verilator 尝试跟踪无尺寸常量的最小宽度,并在最小宽度适合所需尺寸时抑制 该警告。

禁用/启用 WIDTH 等价于禁用/启用 WIDTHEXPAND、 WIDTHTRUNC 和 WIDTHXZEXPAND 警告。

忽略这些警告只会抑制 lint 检查;仿真将正确进行。

建议通过以下方式修复这些问题:

  • 调整变量或常量的大小以匹配表达式所需的大小。例如 2'd2 而不是 3'd2。

  • 使用 '0 或 '1,它们在表达式中自动调整大小。

  • 使用部分选择收窄变量;例如 too_wide[1:0]。

  • 使用连接加宽变量;例如 {1'b1, too_narrow}。

  • 使用转换调整变量大小;例如 23'(wrong_sized)。

例如,这是一个尺寸错误的索引:

1  logic [31:0] array[5];
2  bit [1:0] rd_addr;
3  wire [31:0] rd_value = array[rd_addr];  //<--- Warning

结果产生 WIDTHEXPAND 警告:

%Warning-WIDTHEXPAND: example.v:3:31 Bit extraction of array[4:0] requires 3 bit index, not 2 bits.

一种可能的修复:

  wire [31:0] rd_value = array[{1'b0, rd_addr}];  //<--- Fixed
WIDTHCONCAT

根据 Verilog 的宽度规则警告,连接或复制具有不确定的宽度。在大多数情况下, 这违反了 Verilog 关于连接和复制内部的宽度必须有尺寸的规则,应在代码中 修复。

有问题的示例:

wire [63:0] concat = {1, 2};

一个技术上合法(尽管仍是坏形式)的示例是:

parameter PAR = 1;
wire [63:0] concat = {PAR, PAR};

正确的修复是给 1 指定尺寸(32'h1),或给参数定义添加宽度 (parameter [31:0]),或给参数使用添加宽度 ({PAR[31:0], PAR[31:0]})。

WIDTHEXPAND

更细粒度的 WIDTH 警告,用于值被零扩展时。见 WIDTH。

WIDTHTRUNC

更细粒度的 WIDTH 警告,用于值被截断时。见 WIDTH。

WIDTHXZEXPAND

更细粒度的 WIDTH 警告,用于值被 X/Z 扩展时。见 WIDTH。

ZERODLY

自 5.046 版本起:

如果在命令行上既未使用 --sched-zero-delay,也未使用 --sched-zero-delay,且输入不包含编译时已知的 #0 延迟,但 包含延迟值无法在编译时确定的 #(expression),则发出。如果已知所有可变 延迟在运行时都是非零的,传递 --no-sched-zero-delay 可以改善运行 时性能。

如果在命令行上使用了 --no-sched-zero-delay,但输入包含编译时 已知的 #0 延迟,也会发出。如果已知所报告的延迟在运行时不会执行,则 可以安全地忽略这一点。

在 5.046 版本之前:

警告 #0 延迟不会将进程调度为在 Inactive 区域中恢复。此类进程确实会在 Active 区域某处的同一时间槽中恢复。仅当 Verilator 使用 --timing 选项运行时才发出。

ZEROREPL

警告在复制运算符中使用零作为复制值。IEEE 1800-2023 11.4.12.1 规定这为 错误。

有问题的示例:

1module dut
2   #(parameter int MY_PARAM = 0);
3  reg [7:0] data;
4  always @* begin
5    data = {MY_PARAM{1'b1}};  //<--- Warning
6  end
7endmodule

结果产生以下错误:

%Error-ZEROREPL: test.v:5:22: Replication value of 0 is only legal under a concatenation (IEEE 1800-2023 11.4.12.1)

注意在某些情况下,当访问的上游或下游条件意味着零复制永远不会执行或被使用 时,此警告可能是误报。

修复后的示例:

1module dut
2   #(parameter int MY_PARAM = 1);  //<--- REPAIRED
3  reg [7:0] data;
4  always @* begin
5    data = {MY_PARAM{1'b1}};
6  end
7endmodule

文件

Git 树中的文件

以下是 Verilator 的 Git 树(发行版)中文件的摘要:

Changes                     => 版本历史
README.rst                  => 本文档
bin/verilator               => 用于 Verilate 代码的编译器包装程序
docs/                       => 附加文档
examples/                   => 示例(说明见手册)
include/                    => 应位于你的 -I 编译器路径中的文件
include/verilated*.cpp      => 要链接到你的仿真器中的全局例程
include/verilated*.h        => 全局头文件
include/verilated.mk        => 通用 Makefile
src/                        => 翻译器源代码
test_regress                => 内部测试

读取/写入的文件

所有输出文件都放在由 --Mdir 选项指定的输出目录中,若未指定则为 "obj_dir"。

Verilator 会在输出目录中创建以下文件:

对于 --cc/--sc,它会创建:

{prefix}.json

JSON 构建定义(来自 --make json)

{prefix}.mk

用于编译的 Make include 文件(来自 --make gmake)

{prefix}_classes.mk

带类名的 Make include 文件(来自 --make gmake)

{prefix}.h

模型头文件

{prefix}.cpp

模型 C++ 文件

{prefix}___024root.h

顶层内部头文件(来自 SystemVerilog $root)

{prefix}___024root.cpp

顶层内部 C++ 文件(来自 SystemVerilog $root)

{prefix}___024root{__n}.cpp

额外的顶层内部 C++ 文件

{prefix}___024root__Slow{__n}.cpp

不常执行的冷例程

{prefix}___024root__Trace{__n}.cpp

波形文件生成代码(来自 --trace-*)

{prefix}___024root__Trace__Slow{__n}.cpp

波形文件生成代码(来自 --trace-*)

{prefix}__Dpi.h

DPI 导入和导出声明(来自 --dpi)

{prefix}__Dpi.cpp

全局 DPI 导出包装(来自 --dpi)

{prefix}__Dpi_Export{__n}.cpp

作用域为该特定模型的 DPI 导出包装(来自 --dpi)

{prefix}__Inlines.h

内联支持函数

{prefix}__Syms.h

全局符号表头文件

{prefix}__Syms.cpp

全局符号表 C++

{prefix}{each_verilog_module}.h

较低层的内部头文件

{prefix}{each_verilog_module}.cpp

较低层的内部 C++ 文件

{prefix}{each_verilog_module}{__n}.cpp

额外的较低层 C++ 文件

对于 --hierarchical 模式,它会创建:

V{hier_block}/

用于 Verilate 每个层级块的目录(来自 --hierarchical)

{prefix}__hierVer.d

顶层模块的 Make 依赖(来自 --hierarchical)

{prefix}_hier.mk

层级块的 Make 文件(来自 --make gmake)

{prefix}__hierMkJsonArgs.f

层级 Verilation 的参数(来自 --make json)

{prefix}__hierMkArgs.f

层级 Verilation 的参数(来自 --make gmake)

{prefix}__hierParameters.v

层级块的模块参数

{prefix}__hier.dir

用于存储顶层模块的 .dot、.vpp、.tree 的目录(来自 --hierarchical)

在特定调试及其他模式下,它还会创建:

{prefix}.sarif

SARIF 诊断(来自 --diagnostics-sarif)

{prefix}.tree.json

JSON 树信息(来自 --json-only)

{prefix}.tree.meta.json

JSON 树元数据(来自 --json-only)

{prefix}__cdc.txt

时钟域交叉检查(来自 --cdc)

{prefix}__stats.txt

统计信息(来自 --stats)

{prefix}__idmap.txt

符号还原(demangling)(来自 --protect-ids)

{prefix}__ver.d

Make 依赖(来自 -MMD)

{prefix}__verFiles.dat

时间戳(来自 --skip-identical)

{prefix}{misc}.dot

调试图文件(来自 --debug)

{prefix}{misc}.tree

调试文件(来自 --debug)

{prefix}__inputs.vpp

所有文件的预处理后 Verilog(来自 --debug)

{prefix}_ {each_verilog_base_filename}.vpp

每个文件的预处理后 Verilog(来自 --debug)

运行 Make 之后,C++ 编译器可能产生以下内容:

verilated{misc}*.d

中间依赖

verilated{misc}*.o

中间目标文件

{mod_prefix}{misc}*.d

中间依赖

{mod_prefix}{misc}*.o

中间目标文件

{prefix}

最终可执行文件(来自 --exe)

lib{prefix}.a

最终归档文件(默认 lib 模式)

libverilated.a

Verilated 模型的运行时(默认 lib 模式)

{prefix}__ALL.a

所有 Verilated 目标文件的库

{prefix}__ALL.cpp

用于单次编译的所有代码的 include

{prefix}{misc}.d

中间依赖

{prefix}{misc}.o

中间目标文件

Verilated 可执行文件可能产生以下内容:

coverage.dat

代码覆盖率输出,以及 verilator_coverage 的默认输入 文件名

gmon.out

GCC/clang 代码分析器输出,通常输入到 verilator_profcfunc

profile.vlt

用于 线程配置引导优化 的 --prof-pgo 数据文件

profile_exec.dat

用于 verilator_gantt 的 --prof-exec 数据文件

Verilator_gantt 可能产生以下内容:

profile_exec.vcd

Gantt 报告波形输出

环境

本节描述 Verilator 及相关程序使用的环境变量。

LD_LIBRARY_PATH

一个通用的 Linux/OS 变量,指定哪些目录包含共享对象(.so)文件。该路径 应包含 SystemC 以及仿真运行时所需的其他共享对象。

MAKE

命名使用 --build 选项时调用的 make 命令可执行文件。某些操作 系统可能需要将 "gmake" 赋给该变量以启动 GNU make。如果未指定该变量, 则使用 "make"。

MAKEFLAGS

由 make 创建以传递给子 make 的标志。Verilator 会搜索该变量 以判断是否使用了 jobserver;见 --build-jobs。

OBJCACHE

可选地指定一个缓存或分发程序,放在所有 C++ 编译器运行之前。例如 "ccache" 或 "sccache"。如果使用 distcc 或 icecc/icecream,它们通常会在 ccache 下 运行;请参阅这些程序的文档。如果未设置 OBJCACHE,且在配置时存在 ccache,则默认使用 ccache。

SYSTEMC

已弃用。仅在 SYSTEMC_INCLUDE 或 SYSTEMC_LIBDIR 未 设置时使用。如果设置,则指定包含 SystemC 发行版的目录。如果未指定,则 来自配置时(Verilator 编译之前)可选指定的默认值。

SYSTEMC_ARCH

已弃用。仅在 SYSTEMC_LIBDIR 未设置时使用。指定 SystemC 套件 使用的架构名。这是 SystemC 发行版中 make 创建的 "lib-{...}" 目录名中破折号后面的部分。如果未设置,Verilator 会尝试 推断正确的设置,或使用配置时(Verilator 编译之前)可选指定的默认值。

SYSTEMC_CXX_FLAGS

指定构建 SystemC 模型时需要传递给 GCC 的额外标志。System 2.3.0 可能 需要将其设置为 "-pthread"。

SYSTEMC_INCLUDE

如果设置,则指定包含 systemc.h 头文件的目录。如果未指定,则来自配置时 (Verilator 编译之前)可选指定的默认值,或根据 SYSTEMC/include 计算 得出。

SYSTEMC_LIBDIR

如果设置,则指定包含 libsystemc.a 库的目录。如果未指定,则来自配置时 (Verilator 编译之前)可选指定的默认值,或根据 SYSTEMC/lib-SYSTEMC_ARCH 计算得出。

VERILATOR_BIN

如果设置,则指定 verilator 二进制文件的替代名称。可用于调试以及在 多个操作系统构建之间选择。

VERILATOR_COVERAGE_BIN

如果设置,则指定 verilator_coverage 二进制文件的替代名称。可用于 调试以及在多个操作系统构建之间选择。

VERILATOR_GDB

如果设置,则指定使用 --gdb 选项时要运行的命令,例如 "ddd"。 如果未指定,则使用 "gdb"(如果可用),否则使用 "lldb"(如果可用)。

VERILATOR_NUMA_STRATEGY

如果设置,则控制运行时 Verilated 仿真中 Verilator 线程池的 NUMA 分配 策略。 可能的取值有:

  • 空("")或 "default":启用 NUMA 分配,优先将 Verilator 线程 分配到物理核心。

  • "none":禁用 NUMA 分配。让操作系统处理线程调度。

未来版本可能支持其他取值。

VERILATOR_ROOT

VERILATOR_ROOT 环境变量用于多个地方:

  • 在 ./configure 时:如果设置,它会被嵌入二进制文件中;运行时如果 未设置 VERILATOR_ROOT,则使用嵌入值作为运行时默认值。

  • 运行 verilator 时:如果设置了 VERILATOR_ROOT,将用它来查找 verilator_bin 可执行文件(这是实际的 Verilator 二进制文件; verilator 是一个 Perl 包装脚本)。如果未设置,verilator 脚本 会使用其他方法查找 verilator_bin``(在同一目录中查找,并回退到 ``$PATH)。

  • 对 verilator 生成的 Makefile 运行 make 时:VERILATOR_ROOT 的值(如果未设置,则回退到嵌入二进制文件中的值)用于查找 include 文件(include/verilated.mk)。

如果你使用的是预编译的 Verilator 软件包,则应无需设置 VERILATOR_ROOT -- 嵌入二进制文件中的值就应该是正确的。事实上,此 选项对于使用 make install 安装的 Verilator 软件包*不起作用*。如果 Verilator 软件包使用 ./configure --prefix=/some/path && make install 安装后被移动到另一个位置,则你不能使用 VERILATOR_ROOT 指向新版本。

详见 安装。

VERILATOR_SOLVER

如果设置,则指定作为带约束随机化后端的命令,例如 cvc4 --lang=smt2 --incremental。如果未指定,则使用配置时 提供或找到的求解器,若为空则使用 z3 --in。

VERILATOR_VALGRIND

如果设置,则指定使用 --valgrind 选项时要运行的命令,例如 "valgrind --tool=callgrind"。如果未指定,则使用 "valgrind"。

Make 变量

本节描述 Verilator 使用的 make 变量。可以通过将它们传递给 make 来设置, 例如 make CXX=my-gcc ...。

AR

可选地覆盖 Verilated makefile 使用的默认 :command:`ar`(归档)二进制 文件。如果未设置 AR,则使用配置时找到的版本。

CXX

可选地覆盖 Verilated makefile 使用的默认编译器二进制文件。如果未设置 CXX,则使用配置时找到的版本。注意,传递给编译器的默认标志是在配置时 确定的,因此通过此变量更改 CXX 编译器版本(而不是在配置时传递)可能 无法得到期望的结果。

可选地覆盖 Verilated makefile 使用的默认链接器二进制文件。如果未设置 LINK,则使用配置时找到的版本。注意,传递给链接器的默认标志是在配置时 确定的,因此通过此变量更改 LINK 版本(而不是在配置时传递)可能无法 得到期望的结果。

PERL

可选地覆盖 Verilated makefile 使用的默认 perl 二进制文件。 如果未设置 PERL,则使用配置时找到并编译进 Verilator 二进制文件的版本。

PYTHON3

可选地覆盖 Verilated makefile 使用的默认 python3 二进制 文件。如果未设置 PYTHON3,则使用配置时找到的版本。

弃用项

以下已弃用项计划在将来移除:

C++14 编译器支持

Verilator 目前要求使用 C++20 或更新的编译器来支持时序(timing),并要求 使用 C++14 或更新的编译器来编译 Verilator 本身以及在使用 --no-timing 时 编译 Verilated 模型。

Verilator 将不早于 2025 年 5 月要求使用 C++20 或更新的编译器来编译 Verilator 本身以及编译所有 Verilated 模型。(尽管该日期已过,此变更目前 暂停,直到 Ubuntu LTS 版本的 GCC 和 clang 默认使用 C++20,预计为 2028 年 5 月。)

--structs-packed 选项

当 Verilator 首次实现非压缩结构体(unpacked struct)时引入了 --structs-packed 选项。该功能现已稳定多年,因此不应再使用 --structs-packed。因此,--structs-packed 将变为一个 空操作标志,相关的 UNPACKED 警告将不早于 2026 年 9 月不再发出。

tcmalloc 支持

Verilator 目前支持默认 malloc、tcmalloc 或 jemalloc。由于 jemalloc 具有 更好的性能,对 tcmalloc 的支持可能不早于 2027 年 1 月移除。

贡献者与起源

作者

如果可能,请改为在 Verilator Issues 报告 缺陷。

主要作者是 Wilson Snyder <wsnyder@wsnyder.org>。

主要概念由 Krzysztof Bieganski、John Coiner、Duane Galbi、Geza Lore、 Ryszard Rozak、Yutetsu Takatsukasa、Paul Wasson 和 Jie Xu 提出。

贡献者

许多人曾为 Verilator 提供想法和其他帮助。

Verilator 正从 CHIPS Alliance 和 Antmicro Ltd 获得重要的开发支持。

Verilator 以前的主要企业赞助者(通过提供大量时间或资金贡献)包括: Antmicro Ltd.、Atmel Corporation、Compaq Corporation、Digital Equipment Corporation、Embecosm Ltd.、Fractile Ltd.、Hicamp Systems、Intel Corporation、Marvell Inc.、Mindspeed Technologies Inc.、MicroTune Inc.、 picoChip Designs Ltd.、Sun Microsystems Inc.、Nauticus Networks Inc.、 SiCortex Inc、Shunyao CAD、Tenstorrent USA, Inc. 和 Western Digital Inc.

主要功能的贡献者有:Jeremy Bennett、Krzysztof Bieganski、Byron Bradley、 Lane Brooks、John Coiner、Duane Galbi、Arkadiusz Kozdra、Geza Lore、Todd Strader、Yutetsu Takatsukasa、Stefan Wallentowitz、Paul Wasson、Jie Xu 和 Wilson Snyder。

曾为 Verilator 提供想法和反馈的部分人员包括:

Gilberto Abram, David Addison, Joey Ah-kiow, Thomas Dybdahl Ahle, Tariq B. Ahmad, Thomas Aldrian, Omar Alkhatib, Amal Araweelo Almis, Nikana Anastasiadis, John David Anglin, Frederic Antonin, Hans Van Antwerpen, Vasu Arasanipalai, Jens Arm, Rohan Arshid, Valentin Atepalikhin, Philip Axer, Gökçe Aydos, Chris Bachhuber, Filip Badáň, Adam Bagley, Sharad Bagri, James Bailey, Robert Balas, Marco Balboni, Matthew Ballance, Ricardo Barbedo, Andrew Bardsley, Ilya Barkov, Matthew Barr, Geoff Barrett, Kaleb Barrett, Daniel Bates, Julius Baxter, Jeremy Bennett, Michael Berman, Jean Berniolles, Victor Besyakov, Narayan Bhagavatula, Moinak Bhattacharyya, Kritik Bhimani, David Biancolin, Krzysztof Bieganski, Artur Bieniek, Michael Bikovitsky, David Binderman, Piotr Binkowski, Peter Birch, Johan Björk, David Black, Tymoteusz Blazejczyk, Scott Bleiweiss, Joel Bodenmann, David van der Bokke, Daniel Bone, Guy Bonneau, Pierre-Yves Le Borgne, Krzysztof Boroński, Gregg Bouchard, Christopher Boumenot, Paul Bowen-Huggett, Nick Bowler, Byron Bradley, Bryan Brady, Maarten De Braekeleer, Liam Braun, Charlie Brej, Nick Brereton, J Briquet, Lane Brooks, John Brownlee, KC Buckenmaier, Gijs Burghoorn, Jeff Bush, Lawrence Butcher, Tony Bybell, Congcong Cai, Iru Cai, Ted Campbell, Anthony Campos, Chris Candler, Lauren Carlson, Gregory Carver, Donal Casey, Sebastien Van Cauwenberghe, Alex Chadwick, Greg Chadwick, Marcel Chang, Aliaksei Chapyzhenka, Chih-Mao Chen, Guokai Chen, Kefa Chen, Terry Chen, Yangyu Chen, Yi-Chung Chen, Yurii Cherkasov, Hennadii Chernyshchyk, Enzo Chi, Bartłomiej Chmiel, Sergey Chusov, Robert A. Clark, Ryan Clarke, Allan Cochrane, John Coiner, Luca Colagrande, Keith Colbert, Quentin Corradi, Nassim Corteggiani, Gianfranco Costamagna, February Cozzocrea, Sean Cross, George Cuan, RJ Cunningham, Michal Czyz, Joe DErrico, Jim Dai, Lukasz Dalek, Laurens van Dam, Gunter Dannoritzer, Ashutosh Das, Julian Daube, Greg Davill, Bernard Deadman, Peter Debacker, Josse Van Delm, John Demme, Mike Denio, John Deroo, Philip Derrick, Aadi Desai, John Dickol, Ruben Diez, Danny Ding, Jacko Dirks, Ivan Djordjevic, Brad Dobbie, Paul Donahue, Jonathon Donaldson, Anthony Donlon, Caleb Donovick, Larry Doolittle, Leendert van Doorn, Sebastian Dressler, Connor Driscoll, Jonathan Drolet, Jose Drowne, Justin Yao Du, Maciej Dudek, Alex Duller, Jeff Dutton, Tomas Dzetkulic, Usuario Eda, Charles Eddleston, Chandan Egbert, Joe Eiler, Ahmed El-Mahmoudy, Trevor Elbourne, Schuyler Eldridge, Ahmed Elzeftawi, Mats Engstrom, Augustin Fabre, Robert Farrell, Julien Faucher, Olivier Faure, Sergey Fedorov, Eugene Feinberg, Eugen Fekete, Fabrizio Ferrandi, Adrian Fiergolski, Udi Finkelstein, Brian Flachs, Bill Flynn, Andrea Foletto, Maxim Fonarev, Alex Forencich, Aurelien Francillon, Marco Frank, Bob Fredieu, Manuel Freiberger, Stephane Gagnon, Duane Galbi, Mostafa Gamal, Vito Gamberini, Mateusz Gancarz, Mostafa Garnal, Benjamin Gartner, Christian Gelinek, Richard E George, Peter Gerst, Glen Gibb, Michael Gielda, Barbara Gigerl, Nimrod Gileadi, Shankar Giri, Dan Gisselquist, Szymon Gizler, Petr Gladkikh, Sam Gladstone, Mariusz Glebocki, Embedded Go, Andrew Goessling, Emil Goh, Amir Gonnen, Chitlesh Goorah, Tomasz Gorochowik, Kai Gossner, Toshiki Goto, Tarik Graba, Sergi Granell, Al Grant, Nathan Graybeal, Alexander Grobman, Dominick Grochowina, Qian Gu, Karol Gugala, Xuan Guo, Prabhat Gupta, Oscar Gustafsson, Deniz Güzel, Driss Hafdi, Abdul Hameed, Neil Hamilton, Ali Hammoud, James Hanlon, Tang Haojin, Øyvind Harboe, Jannis Harder, David Harris, Junji Hashimoto, Thomas Hawkins, Mitch Hayenga, Christian Hecken, Harald Heckmann, Robin Heinemann, Robert Henry, Stephen Henry, Sebastian Hesselbarth, David Hewson, Jamey Hicks, Joel Holdsworth, Andrew Holme, Peter Holmes, Hiroki Honda, Steve Hoover, Alex Hornung, Pierre-Henri Horrein, David Horton, Peter Horvath, Jae Hossell, Kuoping Hsu, Shou-Li Hsu, Teng Huang, Steven Hugg, Alan Hunter, James Hutchinson, Tim Hutt, Ehab Ibrahim, Edgar E. Iglesias, Shahid Ikram, Jamie Iles, Ondrej Ille, Ron K. Irvine, Fuad Ismail, Vighnesh Iyer, Ben Jackson, Daniel Jacques, Shareef Jalloq, Marlon James, Krzysztof Jankowski, Moubarak Jeje, Tobias Jensen, Eyck Jentzsch, HyungKi Jeong, Iztok Jeras, Pawel Jewstafjew, Aditya Ranjan Jha, Xie Jiacheng, Alexandre Joannou, James Johnson, Christophe Joly, Justin Jones, William D. Jones, Kees Jongenburger, Abe Jordan, Larry Darryl Lee Jr., Franck Jullien, James Jung, Yoshitomo KANEDA, Mike Kagen, Arthur Kahlich, Kaalia Kahn, G-A. Kamendje, Guy-Armand Kamendje, Vasu Kandadi, Kanad Kanhere, Patricio Kaplan, Pieter Kapsenberg, Rafal Kapuscik, Ralf Karge, Per Karlsson, Dan Katz, Sol Katzman, Amirreza Kazemi, Ian Kennedy, Ami Keren, Fabian Keßler-Schulz, John Khoo, Michael Killough, Sun Kim, Jonathan Kimmitt, Olof Kindgren, Kevin Kiningham, Cameron Kirk, Dan Kirkham, Aleksander Kiryk, Sobhan Klnv, Gernot Koch, Jack Koenig, Soon Koh, Nathan Kohagen, Pawel Kojma, Steve Kolecki, Brett Koonce, Will Korteland, Andrei Kostovski, Wojciech Koszek, Varun Koyyalagunta, Arkadiusz Kozdra, Markus Krause, David Kravitz, Natan Kreimer, Adam Krolnik, Roland Kruse, Jan Kubalek, Mahesh Kumashikar, Andreas Kuster, Sergey Kvachonok, Charles Eric LaForest, Kevin Laeufer, Ed Lander, Steve Lang, Pierre Laroche, Stephane Laurent, Walter Lavino, Christian Leber, David Ledger, Alex Lee, Larry Lee, Yoda Lee, Michaël Lefebvre, Dag Lem, Igor Lesik, Brian Li, John Li, Kay Li, Zixi Li, Davide Libenzi, Matt Liberty, Nandor Licker, Eivind Liland, Ícaro Lima, Jian Nan Lin, Kevin Lin, Yu-Sheng Lin, Charlie Lind, Andrew Ling, Jens Yuechao Liu, Jiuyang Liu, Joey Liu, Paul Liu, Derek Lockhart, Jake Longo, Geza Lore, Arthur Low, Jose Loyola, Stefan Ludwig, Martin Lueker-Boden, Dan Lussier, Konstantin Lübeck, Fred Ma, Liwei Ma, Duraid Madina, Oleh Maksymenko, Alexander Mann, Affe Mao, Rémi Marche, Julien Margetts, Chick Markley, Alexis Marquet, Mark Marshall, Alfonso Martinez, Unai Martinez-Corral, Adrien Le Masle, Yves Mathieu, Vladimir Matveyenko, Patrick Maupin, Stan Mayer, Jordan McConnon, Conor McCullough, Jason McMullan, Elliot Mednick, Yuan Mei, Andy Meier, Luiza de Melo, Rodrigo A. Melo, Benjamin Menküc, Niraj Menon, Jake Merdich, David Metz, Wim Michiels, Miodrag Milanović, Darryl Miles, Kevin Millis, Andrew Miloradovsky, David Moberg, Wai Sum Mong, Peter Monsson, Anthony Moore, Sean Moore, Javier Mora, Rodrigo Batista de Moraes, Stuart Morris, Dennis Muhlestein, John Murphy, Matt Myers, Nathan Myers, Richard Myers, Alex Mykyta, Shivaram Mysore, Eric Müller, Dimitris Nalbantis, Jitesh Nayak, Peter Nelson, Yuri Nenakhov, Felix Neumärker, Bob Newgard, Cong Van Nguyen, Trung Nguyen, Rachit Nigam, Toru Niina, Paul Nitza, Yossi Nivin, Pete Nixon, Lisa Noack, Mark Nodine, Petr Nohavica, Michael Nolan, Andrew Nolte, Mateusz Nurczyński, Joseph Nwabueze, Kevin Nygaard, Thomas O'Keeffe, Kuba Ober, Krzysztof Obłonczek, Danny Oler, Andreas Olofsson, Baltazar Ortiz, Aleksander Osman, Don Owen, Tim Paine, Deepa Palaniappan, James Pallister, Vassilis Papaefstathiou, Sanggyu Park, Brad Parker, Risto Pejašinović, Seth Pellegrino, Joel Peltonen, Morten Borup Petersen, Dan Petrisko, Thanh Tung Pham, Wesley Piard, Maciej Piechotka, David Pierce, Cody Piersall, T. Platz, Michael Platzer, Dominic Plunkett, Nolan Poe, Tuomas Poikela, George Polack, David Poole, Michael Popoloski, Roman Popov, Aylon Chaim Porat, Oron Port, Rich Porter, Rick Porter, Stefan Post, Niranjan Prabhu, Damien Pretet, Harald Pretl, Bill Pringlemeir, Usha Priyadharshini, Mark Jackson Pulver, Prateek Puri, Nikolay Puzanov, Han Qi, Jiacheng Qian, Marshal Qiao, Raynard Qiao, Yujia Qiao, Jasen Qin, Frank Qiu, Nandu Raj, Kamil Rakoczy, Danilo Ramos, Drew Ranck, Chris Randall, Anton Rapp, Josh Redford, Odd Magne Reitan, Frédéric Requin, Wajahat Riaz, Dustin Richmond, Samuel Riedel, Alberto Del Rio, Eric Rippey, Narcis Rodas, Oleg Rodionov, Ludwig Rogiers, Paul Rolfe, Michail Rontionov, Arjen Roodselaar, Arthur Rosa, Tobias Rosenkranz, Yernagula Roshit, Diego Roux, Ryszard Rozak, Dan Ruelas-Petrisko, Luca Rufer, Huang Rui, Graham Rushton, Jan Egil Ruud, Denis Rystsov, Pawel Sagan, Robert Sammelson, Adrian Sampson, John Sanguinetti, Josep Sans, Dave Sargeant, Luca Sasselli, Philippe Sauter, Martin Scharrer, Parker Schless, Martin Schmidt, Jonathan Schröter, Julie Schwartz, Galen Seitz, Sam Shahrestani, Joseph Shaker, Mark Shaw, Salman Sheikh, Zhou Shen, Zhouyi Shen, Hao Shi, James Shi, Michael Shinkarovsky, Rafael Shirakawa, Jeffrey Short, S Shuba, Fan Shupei, Ethan Sifferman, Anderson Ignacio da Silva, Rodney Sinclair, Ameya Vikram Singh, Sanjay Singh, Frans Skarman, Nate Slager, Steven Slatter, Mladen Slijepcevic, Brian Small, Garrett Smith, Gus Smith, Rachel Smith, Tim Snyder, Maciej Sobkowski, Stan Sokorac, Alex Solomatnikov, Flavien Solt, Wei Song, Trefor Southwell, Martin Stadler, Art Stamness, David Stanford, Krzysztof Starecki, Baruch Sterin, John Stevenson, Pete Stevenson, Patrick Stewart, Rob Stoddard, Tood Strader, Jean-Nicolas Strauss, John Stroebel, Ray Strouble, Matt Stroud, Sven Stucki, Howard Su, Udaya Raj Subedi, Emerson Suguimoto, Gene Sullivan, Qingyao Sun, Renga Sundararajan, Kuba Sunderland-Ober, Gustav Svensk, Rupert Swarbrick, Jevin Sweval, Paul Swirhun, Krzysztof Sychla, Shinya T-Y, Yutetsu Takatsukasa, Thierry Tambe, Jesse Taube, Drew Taussig, Christopher Taylor, David Taylor, Greg Taylor, Michael Bedford Taylor, Jose Tejada, Sören Tempel, Peter Tengstrand, Wesley Terpstra, Rui Terra, Stefan Thiede, Justin Thiel, Gary Thomas, Ian Thompson, Kevin Thompson, Mike Thyer, Jerry Tianchen, Hans Tichelaar, Tudor Timi, Viktor Tomov, Steve Tong, Topa Topino, Àlex Torregrosa, Topa Tota, Michael Tresidder, Lenny Truong, David Turner, Neil Turton, Hideto Ueno, Ethan Uppal, Mike Urbach, Joel Vandergriendt, Srini Vemuri, Srinivasan Venkataramanan, Yuri Victorovich, Ivan Vnučec, Andrew Voznytsa, Bogdan Vukobratovic, Holger Waechtler, Justin Wagner, Philipp Wagner, Stefan Wallentowitz, Johannes Walter, CY Wang, Chuxuan Wang, Shawn Wang, Yilou Wang, Zhanglei Wang, Jakub Wasilewski, Paul Wasson, Greg Waters, Thomas Watts, Eugene Weber, John Wehle, Tianrui Wei, Yin Weijie, David Welch, Thomas J Whatson, Martin Whitaker, Marco Widmer, Leon Wildman, Daniel S. Wilkerson, Daniel Wilkerson, Gerald Williams, Trevor Williams, Don Williamson, Jan Van Winkel, Jeff Winston, Max Wipfli, Joshua Wise, Clifford Wolf, Johan Wouters, Paul Wright, Tobias Wölfel, Domenic Wüthrich, Junyi Xi, Ding Xiaoliang, Liu Xiaoyi, Jie Xu, Jinyan Xu, Mandy Xu, Pengcheng Xu, Shanshan Xu, Yan Xu, Yinan Xu, Felix Yan, Zhen Yan, Jiaxun Yang, Luke Yang, Su Yang, Amir Yazdanbakhsh, Law Heng Yi, Ibrahim Burak Yorulmaz, Chentai (Seven) Yuan, Florian Zaruba, Igor Zaworski, Mat Zeno, Keyi Zhang, Xi Zhang, Alex Zhou, Huanghuang Zhou, Yike Zhou, Jiamin Zhu, Ryan Ziegler, Lan Zongwei.

感谢他们,以及上面遗漏提及的所有人,也感谢那些希望保持匿名的人。

历史起源

Verilator 由 Paul Wasson 于 1994 年在 Digital Equipment Corporation 的 Core Logic Group 构想。被转换为 C 的 Verilog 代码随后与 Alpha 处理器的 基于 C 的 CPU 模型合并,并在名为 CCLI 的基于 C 的环境中仿真。

1995 年,Verilator 开始在 Digital 内部用于多媒体和网络处理器开发。Duane Galbi 接管了 Verilator 的活跃开发,并添加了若干性能增强,而 CCLI 仍被用作 外壳。

1998 年,通过现有 DEC 员工(主要是 Duane Galbi)的努力,Digital 慷慨地 同意发布源代码。(前提是不转售该代码,这与 GNU Public License 兼容。)

2001 年,Wilson Snyder 接手该套件,添加了 SystemC 模式,并称之为 Verilator2。这是第一个打包的公开版本。

2002 年,Wilson Snyder 用 C++ 从头重写 Verilator,创建了 Verilator 3.000。这添加了许多优化,带来了约 2-5 倍的性能提升。

2009 年,添加了对 SystemVerilog 和 DPI 语言的重要支持。

2018 年,Verilator 4.000 发布,支持多线程。

2019 年,Verilator 加入了 CHIPS Alliance。

2022 年,Verilator 5.000 发布,带来 IEEE 调度语义、fork/join、延迟处理、 DFG 性能优化和其他改进。

目前,随着需求的出现,各种语言特性和性能增强不断被添加,重点放在完成 Universal Verification Methodology (UVM, IEEE 1800.2-2017) 支持上。

修订历史

变更内容包含在发行版的 Changes 文件中,并概述如下。要订阅新版本, 请见 Verilator 公告。

Revision History and Change Log

The changes in each Verilator version are described below. The contributors that suggested or implemented a given issue are shown in []. Thanks!

Verilator 5.052 2026-09-05

Important:

  • Verilator now supports UVM 2020-3.2; see (#1538) for limitations.

Other:

  • Add comments as a branch description in coverage .info files (#7843). [Eryk Szpotanski]

  • Add --enable-light-debug configure option (#7886). [Geza Lore, Testorrent USA, Inc.]

  • Add user-provided DPI-C function declarations (#7626) (#7893). [Jakub Michalski]

  • Add error on static virtual functions (#7932). [Igor Zaworski, Antmicro Ltd.]

  • Add error when scalar is passed to array task argument (#7948). [Pawel Klopotek]

  • Add MULTIDRIVENPROC warning for signals driven by multiple plain always blocks (#7968). [Aisha]

  • Add FSM arc and state coverage to verilator_coverage .info output (#7972) (#7973). [Igor Zaworski, Antmicro Ltd.]

  • Add SIMILARNAME warning when variables have names that differ in case (#7992) (#8020) (#8186) (#8226) (#8233). [Paul Campbell]

  • Add Unigen2 constrained randomization algorithm (#8042). [Jakub Wasilewski, Antmicro Ltd.]

  • Add &96;+verilator+assert+lock&96; to ignore RTL assert control statements (#8086). [Sumanth Kadiyala]

  • Add NEVERMATCH warning when an SVA sequence can never match (#8176) (#8183). [Artur Bieniek, Antmicro Ltd.]

  • Remove and deprecate &96;--assert-unroll-limit&96;. (#8096). [Artur Bieniek, Antmicro Ltd.]

  • Support embedded covergroup member references (#7749) (#8015). [Marco Bartoli]

  • Support a sequence used as an event control (#7797) (#7846). [Yilou Wang]

  • Support &96;[*N:$]&96; consecutive repetition (#7940). [Artur Bieniek, Antmicro Ltd.]

  • Support dynamic containers in unique constraints (#7947). [Adam Kostrzewski, Antmicro Ltd.]

  • Support delayed tristate gates (#7960) (#7961). [Patrick Creighton]

  • Support &96;default clocking&96; (#7984). [Kamil Danecki, Antmicro Ltd.]

  • Support embedded covergroup clocking events (#8028). [Marco Bartoli]

  • Support &96;weak&96;/&96;strong&96; keywords in property expressions (#8054). [Artur Bieniek, Antmicro Ltd.]

  • Support class handle covergroup arguments (#8071). [Marco Bartoli]

  • Support &96;soft foreach&96; constraints (#8174). [Kamil Danecki, Antmicro Ltd.]

  • Support overlong &96;within&96; sequences as never-matching (#8177). [Artur Bieniek, Antmicro Ltd.]

  • Support covergroup/function/task (ref/virtual/array) interface arguments (#8180). [Marco Bartoli]

  • Support covergroup events with reference members or ref arguments (#8201). [Marco Bartoli]

  • Support s_until/s_until_with in property expression (#8220). [Artur Bieniek, Antmicro Ltd.]

  • Support solve before with associative array (#8232). [Kamil Danecki, Antmicro Ltd.]

  • Optimize random initialization. [Geza Lore, Testorrent USA, Inc.]

  • Optimize more always blocks in DFG (#7775). [Geza Lore, Testorrent USA, Inc.]

  • Optimize assertion NFAs using bit-vector ring buffers (#7885). [Artur Bieniek, Antmicro Ltd.]

  • Optimize circular logic in DFG (#7902). [Geza Lore, Testorrent USA, Inc.]

  • Optimize VPI symbol registration and scope construction (#7936). [Nick Brereton]

  • Optimize bounded always properties using ring buffers (#8061) (#8092). [Artur Bieniek, Antmicro Ltd.]

  • Optimize VL_WORDS_I/VL_BYTES_I (#8095). [Geza Lore, Testorrent USA, Inc.]

  • Optimize consecutive and goto repetitions using ring buffers (#8096). [Artur Bieniek, Antmicro Ltd.]

  • Optimize temporary insertion for single bit replicates in DFG (#8110). [Geza Lore, Testorrent USA, Inc.]

  • Optimize mtask coarsening in multi-threaded scheduling (#8120). [Geza Lore, Testorrent USA, Inc.]

  • Optimize NFA delay-ring edge traversal, drop complexity to linear (#8145). [Artur Bieniek, Antmicro Ltd.]

  • Optimize associative constant patterns to fixed point (#8147) (#8209). [Geza Lore, Testorrent USA, Inc.]

  • Fix procedural tristate assignment overrides (#6785) (#8130). [Eddie Rydell]

  • Fix $finish continuing event loop (#7267) (#7950). [Artur Bieniek, Antmicro Ltd.]

  • Fix continuing on wait(0) (#7372) (#8231). [Szymon Gizler, Antmicro Ltd.]

  • Fix $display accepting streaming concat arguments (#7663) (#7890). [Jaeuk Lee]

  • Fix typedef clocking input sampling (#7688 partial) (#8204). [Marco Bartoli]

  • Fix DFG misoptimizing bound checks (#7755). [Jakub Michalski]

  • Fix unique0 case side effects (#7787). [Pawel Klopotek]

  • Fix mid-window disable iff (#7792) (#7869). [Yilou Wang]

  • Fix cleaning purity cache after assertions. [Geza Lore, Testorrent USA, Inc.]

  • Fix uncaught type error leading to invalid C++ output (#7814). [Geza Lore, Testorrent USA, Inc.]

  • Fix internal error for coverpoints that reference a covergroup formal parameter (#7853 partial) (#7889). [Matthew Ballance]

  • Fix immediate disable of fork join branches (#7856) (#7931). [Marco Bartoli]

  • Fix self-disable of named blocks with forks (Part of #7857) (#7996) (#8006). [Marco Bartoli]

  • Fix clang++ ambiguous overload of '==' operator (#7863). [Pawel Kojma, Antmicro Ltd.]

  • Fix heap-use-after-free in &96;VlRNG::VlRNG()&96; (#7865). [Dragon-Git]

  • Fix mixed-width inside and dist range bounds failing randomization (#7875). [Yilou Wang]

  • Fix solve-before over array variables failing randomization (#7876). [Yilou Wang]

  • Fix scoped randomize with array members under rand_mode (#7877). [Yilou Wang]

  • Fix dist constraint on a frozen variable failing randomization (#7878). [Yilou Wang]

  • Fix range delays with parameter bounds (#7882). [Artur Bieniek, Antmicro Ltd.]

  • Fix --coverage on labeled inline assert/cover property (#7898) (#7904). [Patrick Creighton]

  • Fix memory leak in VerilatedFst::close() (#7899). [Jakub Michalski]

  • Fix spurious FSM COVERIGN on comparisons (#7900) (#7908). [Yogish Sekhar]

  • Fix release of forced port nets (#7901) (#7907). [Artur Bieniek, Antmicro Ltd.]

  • Fix independent force of multiply instantiated signals (#7905). [Artur Bieniek, Antmicro Ltd.]

  • Fix scheduling of variables written in non-inlined functions in suspendable processes (#7909). [Igor Zaworski, Antmicro Ltd.]

  • Fix randomization of unreferenced rand members of unpacked structs (#7910) (#7911). [Philip Axer]

  • Fix VL_TO_STRING function for array of structs (#7912). [Kornel Uriasz, Antmicro Ltd.]

  • Fix queues falling into wrong template spec (#7914). [Adam Kostrzewski, Antmicro Ltd.]

  • Fix type resolution when a local name shadows a type name (#7915). [Pawel Klopotek]

  • Fix crash streaming an unpacked array of unpacked structs (#7917). [Nick Brereton]

  • Fix streaming concat as output-port lvalue into unpacked struct (#7918). [Nick Brereton]

  • Fix dropping variable writes across opaque calls (#7921) (#7933). [Philip Axer]

  • Fix dynamic array handling in solve...before (#7922). [Kornel Uriasz, Antmicro Ltd.]

  • Fix unlinked error with function call in derived class parameter (#7923). [Mateusz Gancarz, Antmicro Ltd.]

  • Fix scheduling of variables written in non-inlined functions in suspendable processes (#7924). [Igor Zaworski, Antmicro Ltd.]

  • Fix class parameter resolution (#7935).

  • Fix FSM detection of coverage-only branches (#7941) (#7942). [Patrick Creighton]

  • Fix use-after-free in V3LinkDotIfaceCapture (#7943). [Nick Brereton]

  • Fix sampled-value clocks in repeated assertions (#7944). [Artur Bieniek, Antmicro Ltd.]

  • Fix queued $finish/$stop request thread ordering (#7946 prep) (#7952). [Yilou Wang]

  • Fix NFA assertion scheduling to fix outcome counts (#7946). [Yilou Wang]

  • Fix DFG nested shifts with overflowing shift amount (#7955) (#7977).

  • Fix timing controls in interface tasks called via virtual interface (#7959). [Yilou Wang]

  • Fix lambda parameter types in queue min and max (#7962). [Bartosz Skorowski]

  • Fix solve-before dropping all soft constraints in randomize() (#7963). [Yilou Wang]

  • Fix generic interface param resolution in module/cell parameterization (#7970) (#7971). [David Garau]

  • Fix lost writes when select width exceeds variable width (#7975). [Bartosz Skorowski]

  • Fix $fgets being mis-optimized away (#7976). [G-A. Kamendje]

  • Fix SYNCASYNCNET false positive with changed non-edge logic (#7980). [Oron Port]

  • Fix variable scope in unique on dynamic array (#7981). [Kornel Uriasz, Antmicro Ltd.]

  • Fix table optimization causing not contextually convertible to bool error (#7983). [Jakub Michalski]

  • Fix wait fork trigger temporary split across generated functions (#7985) (#7986). [Marco Brambilla]

  • Fix randc cycling in a class that also uses solve...before (#7991 partial) (#8055). [Yilou Wang]

  • Fix solver session stability to avoid breaking randomize (#7991 partial). [Yilou Wang]

  • Fix simulation hang when the solver stops answering (#7991 partial) (#8129) (#8136). [Yilou Wang]

  • Fix randomize() with a user variable named 'item' (#7993) (#7994).

  • Fix UNSATCONSTR reporting constraint indices above 9 (#7995). [Yilou Wang]

  • Fix MULTIDRIVEN/MULTIDRIVENPROC warning suppression via lint_off (#8000). [Gilberto Abram]

  • Fix force not substituted into an unpacked array index (#8002).

  • Fix dist weights ignored when an item is not a literal (#8003).

  • Fix error when forcing an array element read at a run-time index (#8004).

  • Fix FSM coverage on empty reset branches (#8005) (#8064). [Yogish Sekhar]

  • Fix missing verilator_coverage in cmake install (#8008) (#8011).

  • Fix dist inside a foreach nested in a constraint if (#8016).

  • Fix gcov dump on warnings discarding later coverage counts (#8017). [Yilou Wang]

  • Fix unique constraint crash, guards, and size (#8018).

  • Fix Linux peak memory stat to use VmHWM (#8022) (#8070). [Tyrone Marhguy]

  • Fix assignment pattern key constant expressions (#8029) (#8030). [Josep Sans]

  • Fix skipping optimization for unpacked data types (#8031). [Kornel Uriasz, Antmicro Ltd.]

  • Fix gate deduplication with function arguments (#8038). [JOTEGO]

  • Fix conditional expression with parameterized classes (#8039). [Pawel Klopotek, Antmicro Ltd.]

  • Fix array size references in constraints (#8040). [Kornel Uriasz, Antmicro Ltd.]

  • Fix mid-range consecutive repetition rejects (#8041). [Artur Bieniek, Antmicro Ltd.]

  • Fix write access to dynamic arrays (#8043). [Bartosz Skorowski, Antmicro Ltd.]

  • Fix nondeterminism in trace stage (#8046). [Sumanth Kadiyala]

  • Fix force helpers in multiply instantiated modules (#8047). [Artur Bieniek, Antmicro Ltd.]

  • Fix pin to non-existent port with PINNOTFOUND suppressed (#8051) (#8052). [Nikolai Kumar]

  • Fix wildcard equality against a 4-state constant in an assertion (#8056) (#8057). [Nikolai Kumar]

  • Fix untyped datatype error on sampling functions with property arguments (#8060). [Artur Bieniek, Antmicro Ltd.]

  • Fix VPI cbValueChange for 1-bit select (#8063). [Bartłomiej Chmiel, Antmicro Ltd.]

  • Fix NFA assertion crash and mis-counted property if/case (#8074). [Yilou Wang]

  • Fix skipping non-constrained enum constraining when inside object of other class (#8075). [Kornel Uriasz, Antmicro Ltd.]

  • Fix use-after-free of captured interface typedef reference during parameter cloning (#8076). [em2machine]

  • Fix unintended side-effect insertion on associative array read (#8077). [Adam Kostrzewski, Antmicro Ltd.]

  • Fix undefined symbol solver error (#8080). [Igor Zaworski, Antmicro Ltd.]

  • Fix unpacked array element force with procedural assign (#8084) (#8085). [Nikolai Kumar]

  • Fix reading another parameter resolves to 0 in cloned modules (#8086) (#8069). [em2machine]

  • Fix hierarchical class scope resolution (#8094). [Artur Bieniek, Antmicro Ltd.]

  • Fix segmentation fault on parameters (#8102) (#8149). [Sumanth Kadiyala]

  • Fix the clang compilation using precompiled headers (#8105). [Demin Han]

  • Fix invalid typedef (#8106). [Adam Kostrzewski, Antmicro Ltd.]

  • Fix R/W references to random builtin function seeds (#8112). [Geza Lore, Testorrent USA, Inc.]

  • Fix invalid C++ on cast (#8113). [Pawel Klopotek, Antmicro Ltd.]

  • Fix COVERIGN on SVA goto repetition (#8118). [Artur Bieniek, Antmicro Ltd.]

  • Fix unordered data hazards in multi-threaded scheduling (#8133). [Geza Lore, Testorrent USA, Inc.]

  • Fix public table offsets larger than 32 bits (#8135). [Sunimali Rathnayake]

  • Fix 'get-value' for empty constrained arrays (#8138). [Kornel Uriasz, Antmicro Ltd.]

  • Fix streaming concatenation uninitialized read-modify-write access (#8143). [Geza Lore, Testorrent USA, Inc.]

  • Fix unpacked array passing to logic task argument error (#8148). [Pawel Klopotek, Antmicro Ltd.]

  • Fix $past in final blocks on a sampling-tick finish (#8153). [Yilou Wang]

  • Fix array reference in reduction constraints (#8158). [Kornel Uriasz, Antmicro Ltd.]

  • Fix VPI force data corruption (#8160). [Jonathan Drolet]

  • Fix sampled-value functions output on the first cycle (#8162). [Artur Bieniek, Antmicro Ltd.]

  • Fix null pointer dereference in process destruction (#8171). [Andrii, Antmicro Ltd.]

  • Fix invalid conversion of queue (#8172). [Andrii, Antmicro Ltd.]

  • Fix crash on forward-referencing parameters (#8175). [Geza Lore, Testorrent USA, Inc.]

  • Fix crash on empty &96;#()&96; parameter list on class instance (#8182). [Geza Lore, Testorrent USA, Inc.]

  • Fix crash on multiple missing type parameters (#8184). [Geza Lore, Testorrent USA, Inc.]

  • Fix SVA bound limit guard, leave headroom for alignment, respect --max-num-width (#8192). [Artur Bieniek, Antmicro Ltd.]

  • Fix internal error on an enum literal inside a &96;with&96; lambda body (#8190) (#8193). [Aditya Shevade]

  • Fix internal error on backslash-quoted strings (#8198). [Henry Hsieh]

  • Fix backslash behavior in string literals (#8211). [Pawel Klopotek, Antmicro Ltd.]

  • Fix task inout pin resizing error (#8212). [Pawel Klopotek, Antmicro Ltd.]

  • Fix code generation for postponed region (#8218). [Geza Lore, Testorrent USA, Inc.]

  • Fix method calls to be a reorder barrier (#8222). [Matthew Ballance]

  • Fix errors on stream connected to instance port (#8234). [Geza Lore, Testorrent USA, Inc.]

  • Fix folding of short circuiting operators guarding member access (#8238). [Geza Lore, Testorrent USA, Inc.]

  • Fix MULTIDRIVENPROC on static loop induction variables (#8242). [Geza Lore, Testorrent USA, Inc.]

  • Fix multiply undefined behavior on signed int overflow (#8247) (#8248). [Paul Rigge]

  • Fix initial statements with gate optimization (#8250). [Prithayan Barua]

  • Fix segmentation fault on context destruction (#8265).

  • Fix mis-randomizing an unpacked struct member when not rand/randc (#8277) (#8278). [Aditya Shevade]

  • Fix std::randomize() with-clause array index arguments (#8279) (#8280). [Aditya Shevade]

  • Fix incorrect reference to sync/async in SYNCASYNCNET warning (#8281). [Andrii, Antmicro Ltd.]

  • Fix use-after-free of captured interface typedef in deleted generate branch (#8287). [Nick Brereton]

Verilator 5.050 2026-07-01

Important:

  • Support covergroups, coverpoints, and bins (#784) (#7117) (#7728). [Matthew Ballance]

  • Support new FST writer API (#6871) (#6992). [Yu-Sheng Lin] Use of FST may requiring installing liblz4 and/or liblz4-dev packages, see docs/install.rst.

Other:

  • Add &96;+verilator+log+file&96; (#4505) (#7645). [Tracy Narine]

  • Add peak memory usage to &96;--stats&96;. [Geza Lore, Testorrent USA, Inc.]

  • Add error on mixed-initialization (#7352) (#7357).

  • Add &96;--coverage-per-instance&96; (#7636). [Yogish Sekhar]

  • Add NOTREDOP error on reduction and negation operators (#7417) (#7623) (#7624).

  • Add hierarchy-aware reporting to &96;verilator_coverage&96; (#7657). [Yogish Sekhar]

  • Add FINALDLY error (#7754). [Igor Zaworski, Antmicro Ltd.]

  • Deprecate isolate_assignments attribute (#7774) (#7144). [Geza Lore, Testorrent USA, Inc.]

  • Improve &96;--coverage-fsm&96; (#7490) (#7529) (#7561) (#7573) (#7619). [Yogish Sekhar]

  • Change &96;+verilator+seed&96; to default to 1, and 0 to randomly select (#7325) (#7516). [Miguel]

  • Change JSON to include parameter constant mnemonics for FSM Coverage (#7531). [Yogish Sekhar]

  • Support assert property &96;default disable iff&96; (#4848) (#7723). [Artur Bieniek, Antmicro Ltd.]

  • Support printing enum names for %p and %s (#5523) (#7338 repair) (#7521) (#7527). [Nick Brereton]

  • Support weak &96;until&96; / &96;until_with&96; property operators (#7290) (#7548) (#7685). [Yilou Wang]

  • Support &96;s_eventually&96; (#7291) (#7508). [Bartłomiej Chmiel, Antmicro Ltd.]

  • Support writing to inout in fork after timing (#7345). [Kamil Danecki, Antmicro Ltd.]

  • Support &96;always&96; / &96;always[m:n]&96; / &96;s_always[m:n]&96; property operators (#7482). [Yilou Wang]

  • Support rand_mode() on static rand class members (#7484) (#7510). [Yilou Wang]

  • Support &96;randomize() with (identifier_list) {constraint_block}&96; (#7486) (#7507). [Yilou Wang]

  • Support &96;obj.randomize(null)&96; (#7487) (#7509). [Yilou Wang]

  • Support functions on RHS of force (#7491). [Artur Bieniek, Antmicro Ltd.]

  • Support procedural continuous assign/deassign (#7493). [Artur Bieniek, Antmicro Ltd.]

  • Support randsequence production function ports (#7522). [Yilou Wang]

  • Support followed-by operators &96;#-#&96; and &96;#=#&96; in properties (#7523). [Yilou Wang]

  • Support expression coverage on assign statements (#7542) (#7543). [Thomas Brown]

  • Support TERMUX (#7559). [Laurent CHARRIER]

  • Support NBAs in initial blocks with delay/event controls (#7566) (#7600). [Muzaffer Kal]

  • Support SVA goto repetition with range &96;[->M:N]&96; (#7569). [Yilou Wang]

  • Support property abort operators (accept_on, reject_on) (#7578). [Yilou Wang]

  • Support procedural concurrent assertions with inferred clock (#7581). [Yilou Wang]

  • Support calling interface functions without parens (#7584). [Krzysztof Bieganski, Antmicro Ltd.]

  • Support streaming on queues (#7597). [Benjamin Collier, Secturion Systems, Inc.]

  • Support clocking event on a sequence declaration body (#7598) (#7793). [Yilou Wang]

  • Support generic interface arrays (#7604). [Krzysztof Bieganski, Antmicro Ltd.]

  • Support FSM detection in primitive wrappers (#7607). [Yogish Sekhar]

  • Support busses with mix of pullup/pulldown (#7632). [Lucas Amaral]

  • Support forceable on unpacked array variables (#7677) (#7678). [Nikolai Kumar]

  • Support pre/post increment/decrement inside && and || (#7683). [Nick Brereton]

  • Support streaming into 2-D unpacked arrays (#7686) (#7687). [Paul Swirhun]

  • Support if/if-else in properties (#7692). [Artur Bieniek, Antmicro Ltd.]

  • Support process::self().srand() (#7695). [Igor Zaworski, Antmicro Ltd.]

  • Support MacOS lldb (#7697). [Tracy Narine]

  • Support assoc array methods with wide value types (#7680). [pawelktk]

  • Support property case (#7682) (#7721). [Artur Bieniek, Antmicro Ltd.]

  • Support &96;s_until&96; and &96;s_until_with&96;(#7722). [Artur Bieniek, Antmicro Ltd.]

  • Support covergroup runtime model Phase A1 (#7728). [Matthew Ballance]

  • Support hierarchical reference cross members (#7749) (#7820). [Matthew Ballance]

  • Support reduction XOR/AND operations in constraints (#7753). [Kornel Uriasz, Antmicro Ltd.]

  • Support NBAs in initial blocks (#7754). [Igor Zaworski, Antmicro Ltd.]

  • Support assertion control system tasks in classes and interfaces (#7761). [Yilou Wang]

  • Support cover sequence statement (#7764). [Yilou Wang]

  • Support unpacked struct stream (#7767). [Nick Brereton]

  • Support $assertcontrol control_type from lock to kill (#7788). [Yilou Wang]

  • Support unbounded always [m:$] and strong s_always liveness (#7798). [Yilou Wang]

  • Support method calls on a sub-interface via a virtual interface (#7800). [Yilou Wang]

  • Support global $assertcontrol (#7807). [Artur Bieniek, Antmicro Ltd.]

  • Support VPI access to unpacked struct members (#7823). [Nick Brereton]

  • Support variable-length intersect in SVA sequences (#7835). [Yilou Wang]

  • Support dynamic loading of VPI extensions (#7727). [Matthew Ballance]

  • Optimize DFG cycle breaking to do less work (#7210). [Geza Lore, Testorrent USA, Inc.]

  • Optimize emitting to_string() for compiler speedup (#7468). [Jakub Michalski, Antmicro Ltd.]

  • Optimize additional DFG peephole cases (#7553). [Varun Koyyalagunta, Testorrent USA, Inc.]

  • Optimize forced signal handling (#7554 partial) (#7572) (#7594) (#7596). [Krzysztof Bieganski, Artur Bieniek, Antmicro Ltd.]

  • Optimize primitive runtime functions. [Geza Lore, Testorrent USA, Inc.]

  • Optimize if branches with same trailing statements (#7674). [Geza Lore, Testorrent USA, Inc.]

  • Optimize wide conditional expansion in V3Premit (#7691). [Geza Lore, Testorrent USA, Inc.]

  • Optimize VL_ONEHOT. [Geza Lore, Testorrent USA, Inc.]

  • Optimize formatting functions (#7701) (#7702) (#7703). [Geza Lore, Testorrent USA, Inc.]

  • Optimize DPI import argument passing (#7704). [Geza Lore, Testorrent USA, Inc.]

  • Optimize runtime assertOn() checks (#7707). [Geza Lore, Testorrent USA, Inc.]

  • Optimize $countones and $onehot in DFG. [Geza Lore, Testorrent USA, Inc.]

  • Optimize procedural loop unrolling. [Geza Lore, Testorrent USA, Inc.]

  • Optimize V3Gate inlining heuristic (#7716). [Geza Lore, Testorrent USA, Inc.]

  • Optimize reset in DFG (#7737). [Geza Lore, Testorrent USA, Inc.]

  • Optimize DFG with relaxed live variable analysis (#7739). [Geza Lore, Testorrent USA, Inc.]

  • Optimize conditional patterns sharing common MBSs/LSBs in DfgPeephole (#7760). [Geza Lore, Testorrent USA, Inc.]

  • Optimize bit select removal earlier in DFG (#7762). [Geza Lore, Testorrent USA, Inc.]

  • Optimize away proven redundant case statement assertions (#7771). [Geza Lore, Testorrent USA, Inc.]

  • Optimize table lookups in DFG (#7772). [Geza Lore, Testorrent USA, Inc.]

  • Optimize input combinational logic by change detection (#7784). [Geza Lore, Testorrent USA, Inc.]

  • Optimize decoder case statements into lookup tables (#7795). [Geza Lore, Testorrent USA, Inc.]

  • Optimize wide decoder case statements into decoder expressions (#7804). [Geza Lore, Testorrent USA, Inc.]

  • Optimize statically known oversize shifts (#7806). [Geza Lore, Testorrent USA, Inc.]

  • Optimize generated function inlining (#7811). [Geza Lore, Testorrent USA, Inc.]

  • Optimize bit-scan loops into most-set-bit or $countones (#7822). [Thomas Santerre]

  • Optimize additional expression patterns (#7824). [Geza Lore, Testorrent USA, Inc.]

  • Optimize module inlining heuristic (#7837). [Geza Lore, Testorrent USA, Inc.]

  • Fix &96;$bits&96; on unpacked structs (#4521) (#7796). [Nick Brereton]

  • Fix TSP variable ordering for mtasks (#5342) (#7610). [Muzaffer Kal]

  • Fix inlining static initializer in V3Gate (#5381) (#7503). [Andrew Nolte] [Geza Lore, Testorrent USA, Inc.]

  • Fix timed nested fork block with disable (#6720) (#7743). [Marco Bartoli]

  • Fix segmentation fault when using --trace with --lib-create (#7299) (#7518). [anonkey]

  • Fix cross-hierarchy tristate drivers of interface nets (#7339) (#7801). [Yilou Wang]

  • Fix destructive event state before dynamic waits (#7340). [Nick Brereton]

  • Fix ALWCOMBORDER on variable ordering (#7350) (#7608). [Cookie]

  • Fix false MULTIDRIVEN warning on always_ff variables (#7351) (#7621) (#7672).

  • Fix array pattern concatenation (#7401) (#7402). [Greg Davill]

  • Fix fairness in &96;std::semaphore&96; (#7435) (#7605). [Krzysztof Bieganski, Antmicro Ltd.]

  • Fix generic interface port forwarded to a nested instance (#7454) (#7457). [Yilou Wang]

  • Fix internal error on multi-cycle SVA under default clocking (#7472) (#7506). [Yilou Wang]

  • Fix internal error instead of missing prototype error (#7485). [Alex Solomatnikov]

  • Fix mailbox#(packed_struct) type mismatch with parameterized class (#7494) (#7495). [Nikolai Kumar]

  • Fix std::randomize internal error on static member of different class (#7498) (#7499). [Alex Solomatnikov]

  • Fix assert under assert error (#7500) (#7513). [Nikolai Kumar]

  • Fix std::unique_ptr with incomplete type for clang (#7501) (#7526).

  • Fix virtual interface method call inlining and IMPURE suppression (#7505). [Nikolay Puzanov]

  • Fix expression coverage in loops (#7511). [Todd Strader]

  • Fix $bits on local struct with chained-interface (#7515) (#7517).

  • Fix array indexing side effects in compound assignments (#7519) (#7540) (#7544). [Kamil Danecki, Antmicro Ltd.]

  • Fix class::localparam during elaboration (#7524) (#7534).

  • Fix dearray variable scope error (#7530) (#7602).

  • Fix nested parameterized class typedef chain (#7538). [Michael Rogenmoser]

  • Fix events in observed region (#7546). [Todd Strader]

  • Fix regression rejecting boolean &96;!x&96; inside sequence expressions (#7549) (#7551). [Yilou Wang]

  • Fix exponential expansion in V3Gate (#7550). [Geza Lore, Testorrent USA, Inc.]

  • Fix internal error on consecutive repetition with N > 256 (#7552) (#7603). [Yilou Wang]

  • Fix inherited rand array with .size + foreach constraint (#7558) (#7650). [Yilou Wang]

  • Fix biased bit distribution under value < (1 << N) constraints (#7563) (#7684). [Yilou Wang]

  • Fix HIERPARAM lint checking (#7570) (#7690). [em2machine]

  • Fix display of %m in non-first argument (#7574).

  • Fix floating point compile warning on min/max delays.

  • Fix force of unpacked arrays (#7579) (#7580). [Zubin Jain]

  • Fix property argument retaining type of the previous variable (#7582). [Jakub Michalski]

  • Fix NBA to whole arrays (#7583) (#7575). [Geza Lore, Testorrent USA, Inc.]

  • Fix wrong false assert for property local variables with cycle-delayed consequents (#7587) (#7651). [Yilou Wang]

  • Fix interface instance name collision (#7591) (#7593). [Stuart Morris]

  • Fix process comparison compile error with &96;--public-flat-rw&96; (#7592).

  • Fix CPU pinning when no 'core id' present (#7599). [Geza Lore, Testorrent USA, Inc.]

  • Fix access to parameters via class::localparam (#7609) (#7671). [em2machine]

  • Fix clocking-block sample of unpacked array (#7612) (#7613). [Nikolai Kumar]

  • Fix type parameters order (#7615) (#7653) (#7693). [Kamil Danecki, Antmicro Ltd.]

  • Fix unique_index method on assoc arrays with values differing from the keys (#7616). [Pawel Klopotek]

  • Fix wide equality comparison in unpacked structs (#7618). [Geza Lore, Testorrent USA, Inc.]

  • Fix force determinism (#7620) (#7637). [Artur Bieniek, Antmicro Ltd.]

  • Fix reference counting for modport task references (#7628). [Nick Brereton]

  • Fix internal error when handling typedefs containing parameterized class type members (#7635) (#7661). [em2machine]

  • Fix forceable signal with a procedural continuous assign (#7638) (#7639). [Zubin Jain]

  • Fix scheduling of virtual interface method writes (#7641). [Artur Bieniek, Antmicro Ltd.]

  • Fix implicit conversions of VlWide (#7642). [Geza Lore, Testorrent USA, Inc.]

  • Fix CASEINCOMPLETE to not warn on &96;unique0 case&96; (#7647).

  • Fix hierarchical coverage counts for duplicate no-inline module instances (#7649). [Yogish Sekhar]

  • Fix dropped iff guard on clocking inside task (#7658) (#7659). [Nikolai Kumar]

  • Fix runtime speed summary report. [Geza Lore, Testorrent USA, Inc.]

  • Fix reserved keywords reaching emitter (#7666). [Pawel Kojma, Antmicro Ltd.]

  • Fix width of unsized literal in property expression (#7668). [Artur Bieniek, Antmicro Ltd.]

  • Fix loss of events due to bit shift (#7670). [Artur Bieniek, Antmicro Ltd.]

  • Fix parameter read through locally-declared interface instance (#7679). [Nick Brereton]

  • Fix skipping nulls in $sscanf (#7689).

  • Fix bounds checks in expressions with read/write references (#7694). [Ryszard Rozak, Antmicro Ltd.]

  • Fix (const) ref default task argument handling (#7698). [Nick Brereton]

  • Fix &96;ref&96; argument type check for packed arrays with differing range directions (#7700). [Nick Brereton]

  • Fix ignoring not-found modules with encoded names (#7706). [Igor Zaworski, Antmicro Ltd.]

  • Fix MULTIDRIVEN in generates (#7709). [Todd Strader]

  • Fix parameter pollution when using class parameters (#7711) (#7763). [em2machine]

  • Fix Makefile action to not write to ${srcdir} (#7715). [Larry Doolittle]

  • Fix splitting functions containing fork logic (#7717). [Mateusz Gancarz, Antmicro Ltd.]

  • Fix optimizations of assignments with timing controls (#7718). [Ryszard Rozak, Antmicro Ltd.]

  • Fix s_eventually on interface (#7731) (#7733). [Marco Bartoli]

  • Fix parameter values in coverage bins widths (#7732) (#7734). [Marco Bartoli]

  • Fix configure fall back on dynamic malloc libraries (#7736). [Geza Lore, Testorrent USA, Inc.]

  • Fix crash on overlapping priority case. [Geza Lore, Testorrent USA, Inc.]

  • Fix s_eventually in parameterized interfaces (#7741). [Nick Brereton]

  • Fix dpi export pointers (#7742) (#7751). [Yilin Li]

  • Fix force on unpacked bit select (#7744) (#7745). [Nikolai Kumar]

  • Fix &96;$&96; as unsupported coverpoint-bin range bounds (#7750) (#7825). [Matthew Ballance]

  • Fix FSM detect unchecked casts and variable redeclaration (#7758). [Adam Kostrzewski, Antmicro Ltd.]

  • Fix no-scope internal error on virtual interface method calls (#7759). [Yilou Wang]

  • Fix &96;case (_) inside&96; with x wildcards (#7766). [Geza Lore, Testorrent USA, Inc.]

  • Fix not failing assertion when RHS of a range window rejects once (#7773). [Artur Bieniek, Antmicro Ltd.]

  • Fix $fflush and autoflush with --threads (#7782).

  • Fix out-of-bounds read value for 2-state types (#7785). [Jakub Michalski]

  • Fix &96;cover property&96; of an implication counting vacuous matches (#7789). [Yilou Wang]

  • Fix randomization of dynamic arrays of objects (#7790). [Ryszard Rozak, Antmicro Ltd.]

  • Fix randomize() with skipping derived pre/post_randomize (#7799). [Yilou Wang]

  • Fix skewed dist operator for arrays (#7802). [Jakub Wasilewski, Antmicro Ltd.]

  • Fix assertion when loop unrolling failed (#7810). [Geza Lore, Testorrent USA, Inc.]

  • Fix CASEINCOMPLETE for all uncovered enum items (#7815) (#7817). [Saksham]

  • Fix split optimization nested-class crash (#7826). [Igor Zaworski, Antmicro Ltd.]

  • Fix class/var named identically to an enclosing-scope type (#7827) (#7828). [Tom Jackson]

  • Fix performance on large package-scoped structs (#7830). [Wolfgang Mayerwieser]

  • Fix unclocked concurrent assertion misreported as unsupported (#7831). [Yilou Wang]

  • Fix insertion of expression coverage statement (#7832). [Ryszard Rozak, Antmicro Ltd.]

  • Fix lifetime of expression coverage variable (#7834). [Ryszard Rozak, Antmicro Ltd.]

  • Fix disable iff ignored when its condition is held continuously true (#7841). [Yilou Wang]

  • Fix constant pool cache after dead scope removal (#7845). [Nick Brereton]

  • Fix covergroups without --coverage (#7848) (#7849). [Joshua Leahy]

  • Fix class scope '::' reference through an inherited type parameter (#7844). [Sergey Chusov]

Verilator 5.048 2026-04-26

Important:

  • Displaying Verilator generated FST files will require an updated version of Surfer (built from 'main', or the future numbered release 0.7.0). No GTKWave update is necessary (#7255).

  • Support jemalloc as the default allocator on Linux (#7250). [Yangyu Chen] For better performance, &96;apt install libjemalloc-dev&96; or equivalent before running ./configure.

Other:

  • Add VPI callback support to &96;--main&96; (#7145).

  • Add &96;--func-recursion-depth&96; option (#7175) (#7179).

  • Add &96;+verilator+solver+file&96; for debugging constraint solver (#7242).

  • Add &96;--coverage-fsm&96; for experimental FSM state and arc coverage (#7412). [Yogish Sekhar]

  • Add printed summary to verilator_coverage (#7438) (#7462). [Yogish Sekhar]

  • Deprecate &96;--structs-packed&96; (#7222).

  • Remove DFG extract optimization pass (#7394). [Geza Lore, Testorrent USA, Inc.]

  • Remove multi-threaded FST tracing (#7443). [Geza Lore, Testorrent USA, Inc.]

  • Improve assignment-compatibility type check (#2843) (#5666) (#7052). [Pawel Kojma, Antmicro Ltd.]

  • Improve error message when variable used as data type (#7318). [Ryszard Rozak, Antmicro Ltd.]

  • Improve E_UNSUPPORTED warning messages (#7329). [Eunseo Song]

  • Improve NFA-based multi-cycle SVA evaluation engine (#7430). [Yilou Wang]

  • Change array tracing to dump left index to right index (#7205). [Geza Lore, Testorrent USA, Inc.]

  • Change &96;--converge-limit&96; default to 10000 (#7209).

  • Support inout inside SV interface (#3466) (#7134) (#7708) (#7710). [Nick Brereton]

  • Support &96;##0&96; cycle delays (#4263) (#7298). [Yilou Wang]

  • Support multidimensional arrays of interfaces (#6230) (#7451). [em2machine]

  • Support array reduction methods with 'with' clause in constraints (#6455) (#6999). [Rahul Behl]

  • Support constraint imperfect distributions (#6811) (#7168). [Yilou Wang]

  • Support disable task by name (#6853) (#7136). [Nick Brereton]

  • Support procedural concurrent assertion simple cases (#6944).

  • Support force assignments to array elements of real type (#7048). [Ryszard Rozak, Antmicro Ltd.]

  • Support VPI array indexing in signal names (#7097) (#7187) (#7214) (#7289). [Christian Hecken, Heidelberg University]

  • Support soft constraint solving (#7124) (#7166). [Yilou Wang]

  • Support constraints on fixed-size array of class object members (#7170) (#7183). [Yilou Wang]

  • Support Z non-blocking assignment (#7192) (#496) (#7197). [Nick Brereton]

  • Support constraint &96;with&96; item.index array reduction (#7198). [Rahul Behl]

  • Support constant expressions without parentheses in &96;PATHPULSE$&96; (#7199). [Pawel Kojma, Antmicro Ltd.]

  • Support $sformat with runtime format string (#7212).

  • Support dist and solve...before inside foreach constraints (#7245) (#7253). [Yilou Wang]

  • Support array and struct info metadata in FST traces (#7255). [Geza Lore, Testorrent USA, Inc.]

  • Support dynamic array .size in inline randomize() with constraints (#7258) (#7266). [Yilou Wang]

  • Support defparam with more than one dot (#7262). [Artur Bieniek, Antmicro Ltd.]

  • Support modport export/import task prototypes and out-of-block definitions (#7277). [Yilou Wang]

  • Support very wide $display arguments (#7280). [Jakub Michalski]

  • Support named sequence declarations and instances in assertions (#7283). [Yilou Wang]

  • Support &96;##&96;, &96;##[*]&96;, &96;##[+]&96;, &96;##[M:N]&96; cycle delays in assertions (#7284) (#7312) (#7377). [Yilou Wang]

  • Support boolean and/or in sequence expressions (#7285). [Yilou Wang]

  • Support property-local variables and sequence match items (#7286). [Yilou Wang]

  • Support 'until' and &96;until_with&96; property (#7290 partial) (#7399) (#7436). [Ryszard Rozak, Antmicro Ltd.]

  • Support implication operator with constraint_set (#7300) (#7448). [Yilou Wang]

  • Support array map() method (#7307) (#7316) (#7344). [Wei-Lun Chiu]

  • Support MacOS address sanitizer memory limit (#7308). [Marco Bartoli]

  • Support SVA goto repetition &96;[->N]&96; in concurrent assertions (#7310). [Yilou Wang]

  • Support consecutive repetition &96;[*N]&96; in SVA properties (#7311). [Yilou Wang]

  • Support rise/fall delays (#7368). [Artur Bieniek, Antmicro Ltd.]

  • Support sequence intersect operator (#7374). [Yilou Wang]

  • Support sequence 'throughout' operator (#7378). [Yilou Wang]

  • Support sequence consecutive repetition &96;[N:M]&96;, &96;[+]&96;, and &96;[]&96; (#7379). [Yilou Wang]

  • Support sequence &96;first_match&96; operator (#7392). [Yilou Wang]

  • Support nonconsecutive repetition [=N] in sequence expressions (#7397). [Yilou Wang]

  • Support per-process RNG for process::srandom() and object seeding (#7408) (#7415) (#7408). [Yilou Wang]

  • Support 2**n expressions in constraint randomization (#7422). [Yilou Wang]

  • Support IEEE-compliant force/release handling (#7391). [Artur Bieniek, Antmicro Ltd.]

  • Support sequence 'within' operator (#7461). [Yilou Wang]

  • Optimize trace code for faster compiles on repeated types (#6707) (#6832). [Todd Strader]

  • Optimize impure expressions and calls with new V3LiftExpr pass (#7141) (#7164). [Geza Lore, Testorrent USA, Inc.]

  • Optimize size of trace declaration object code (#7150). [Szymon Gizler, Antmicro Ltd.]

  • Optimize function call return value temporaries (#7152). [Geza Lore, Testorrent USA, Inc.]

  • Optimize conditional merging across some impure statements (#7159). [Geza Lore, Testorrent USA, Inc.]

  • Optimize reuse of existing associative terms in DfgPeephole. [Geza Lore, Testorrent USA, Inc.]

  • Optimize duplicate vertices and multiplexers in DfgPeephole (#7305). [Geza Lore, Testorrent USA, Inc.]

  • Optimize commutative vertex operands in DFG for better combining. [Geza Lore, Testorrent USA, Inc.]

  • Optimize DFG peephole until a fixed point (#7309). [Geza Lore, Testorrent USA, Inc.]

  • Optimize comparisons with identical operands and $countones in DFG. [Geza Lore, Testorrent USA, Inc.]

  • Optimize more patterns in DfgPeephole (#7332). [Geza Lore, Testorrent USA, Inc.]

  • Optimize read references in DFG (#7354). [Geza Lore, Testorrent USA, Inc.]

  • Optimize DFG only once, after scoping (#7362). [Geza Lore, Testorrent USA, Inc.]

  • Optimize more DFG peephole patterns (#7423) (#7452). [Geza Lore, Testorrent USA, Inc.]

  • Optimize DfgBreakCycles IndependentBits analysis ordering (#7446). [Geza Lore, Testorrent USA, Inc.]

  • Optimize select patterns in DfgPeephole. [Geza Lore, Testorrent USA, Inc.]

  • Optimize temporary insertion in DfgPeephole. [Geza Lore, Testorrent USA, Inc.]

  • Optimize arithmetic right shift (>>>) in DfgBreakCycles (#7447). [Geza Lore, Testorrent USA, Inc.]

  • Optimize temporary insertion in DFG (#7459). [Geza Lore, Testorrent USA, Inc.]

  • Optimize mix of Concat/Extend assignments (#7479). [Geza Lore, Testorrent USA, Inc.]

  • Fix recursive default assignment for sub-arrays (#4589) (#7202). [Julian Carrier]

  • Fix tracing virtual interface member written from classes (#5044) (#7465). [Nikolay Puzanov]

  • Fix virtual interface member trigger convergence (#5116) (#7323). [Yilou Wang]

  • Fix shift width mismatch in constraint solver SMT emission (#5420) (#7265). [Yilou Wang]

  • Fix returning wrong type from static function in parameterized class (#5479) (#7387) (#7411) (#7418) (#7445) (#7450). [em2machine]

  • Fix randomize size+element queue constraints (#5582) (#7225). [Rahul Behl, Testorrent USA, Inc.]

  • Fix null assignment to virtual interfaces (#5974) (#5990). [Maxim Fonarev]

  • Fix typedef scope resolution for parameterized class aliases (#5977) (#7319). [Nick Brereton]

  • Fix lambda coroutines (#6106) (#7135). [Nick Brereton]

  • Fix super constructor calls with local variables (#6214) (#6933). [Igor Zaworski, Antmicro Ltd.]

  • Fix parameter default comparison when value contains type cast (#6281) (#7369) (#6281). [Yilou Wang]

  • Fix &96;local::&96; false error in randomize() with on parameterized class (#6680) (#7293). [Yilou Wang]

  • Fix false recursive definition error (#6769) (#7118). [Alex Zhou]

  • Fix port assignment to large arrays (#6904).

  • Fix interface localparam dependencies and arbitrary nesting (#6936) (#7128) (#7188) (#7190). [em2machine]

  • Fix parameterized class typedef as interface type parameter (#7000) (#7006). [Leela Pakanati]

  • Fix errant integer promotion (#7012). [Todd Strader]

  • Fix randc solver hang with wide variables (#7068) (#7248). [Yilou Wang]

  • Fix coroutine trace setters (#7078 repair) (#7296). [Igor Zaworski, Antmicro Ltd.]

  • Fix vpi_put_value not updating forced read value (#7092) (#7395) (#7092). [Christian Hecken, Heidelberg University]

  • Fix scheduling non-determinism (#7120) (#7162) (#7165). [Geza Lore, Testorrent USA, Inc.]

  • Fix parameters inside std::randomize &96;with&96; clause (#7140). [Kamil Danecki, Antmicro Ltd.]

  • Fix forcing unpacked variables (#7149). [Ryszard Rozak, Antmicro Ltd.]

  • Fix wide conditional short circuiting (#7155).

  • Fix eliminating assignments to DPI-read variables (#7158). [Geza Lore, Testorrent USA, Inc.]

  • Fix std::randomize() in static function with static class members (#7167) (#7169). [Yilou Wang]

  • Fix resolving default/non-default type parameters (#7171) (#7346) (#7380) (#7385) (#7398) (#7406) (#7398). [em2machine]

  • Fix recursive constant function in $unit scope (#7173) (#7174).

  • Fix class extend references between queues (#7195).

  • Fix library/hier_block tracing when top name is empty (#7200). [Geza Lore, Testorrent USA, Inc.]

  • Fix virtual interface select from sub-interface instance (#7203) (#7370) (#7203). [Yilou Wang]

  • Fix VPI force of bit-selected signals (#7211) (#7301). [Christian Hecken]

  • Fix &96;$finish&96; to immediately stop executing code from non-final blocks (#7213 partial) (#7390).

  • Fix wrong $bits() for parameterized interface struct typedefs (#7218) (#7219). [em2machine]

  • Fix &96;dist&96; operator inside constraint if blocks (#7221) (#7224). [Rahul Behl, Testorrent USA, Inc.]

  • Fix array reduction in constraints crashing with class inheritance (#7226) (#7263). [Yilou Wang]

  • Fix soft cross-object constraint priority inversion (#7228) (#7233). [Yilou Wang]

  • Fix internal error when derived class calls this.randomize() with inherited rand members (#7229) (#7234). [Yilou Wang]

  • Fix enum range constraints missing for rand variables in sub-objects (#7230) (#7235). [Yilou Wang]

  • Fix vpi_put_value release on non-continuous signal (#7231) (#7241). [Christian Hecken]

  • Fix functions in generate block resulting in 'Broken link in node' (#7236) (#7367). [em2machine]

  • Fix tracing of typedefed 1D packed arrays with --trace-structs (#7237). [Geza Lore, Testorrent USA, Inc.]

  • Fix rand variable used as array index in constraint evaluated as constant (#7238) (#7247). [Yilou Wang]

  • Fix --hierarchical dropping arguments in -f/-F files (#7240). [Clara Sparks]

  • Fix &96;final&96; asserts and $stop (#7249). [Artur Bieniek, Antmicro Ltd.]

  • Fix MacOS clang PCH compile error with -o flag (#7251) (#7327). [Eunseo Song]

  • Fix vpi_put_value with vpiIntVal on VlWide data (#7256). [Christian Hecken]

  • Fix streaming with descending unpacked arrays and unpacked-to-queue (#7287). [Yilou Wang]

  • Fix MacOs lexer compile error (#7314) (#7315). [Tracy Narine]

  • Fix linking shared library with its dependencies (#7320). [Artur Bieniek, Antmicro Ltd.]

  • Fix modport selection of virtual interface handle (#7321). [Yilou Wang]

  • Fix false ASSIGNIN on interface input ports driven from outside (#7322). [Yilou Wang]

  • Fix static initialization order for packages with class hierarchies (#7324). [Yilou Wang]

  • Fix sensitivity of signals to unrelated interface members (#7336). [Artur Bieniek, Antmicro Ltd.]

  • Fix &96;disable iff&96; imply-delay statement linking (#7337). [Nick Brereton]

  • Fix lost &96;$stop&96; on implied assertion &96;$error&96; failures.

  • Fix wait() hang when interface uses process calls and VIF function (#7342). [Yilou Wang]

  • Fix error on illegal nand/nor binary operators (#7353).

  • Fix simple array assignment unrolling in slice optimization (#7359). [Geza Lore, Testorrent USA, Inc.]

  • Fix missing temporary for DfgSplicePacked (#7361). [Geza Lore, Testorrent USA, Inc.]

  • Fix virtual interface function calls binding to wrong instance (#7363). [Yilou Wang]

  • Fix false ASSIGNIN on interface input port connections (#7365). [Yilou Wang]

  • Fix string &96;inside&96; queue (#7373).

  • Fix subclass with rand_mode(0) getting randomized (#7376) (#7383). [Yilou Wang]

  • Fix VPI access to Verilog &96;force&96;-ed signals (#7381). [Christian Hecken, Heidelberg University]

  • Fix sampling of hierarchical references (#7386). [Ryszard Rozak, Antmicro Ltd.]

  • Fix virtual class inheritance false error (#7403) (#7405). [Nikolay Puzanov]

  • Fix CMake compiler coroutine flags (#7404). [Shogo Yamazaki]

  • Fix delete inside foreach skipping elements (#7407) (#7410)

  • Fix std::randomize in parameterized-derived class (#7409) (#7416). [Yilou Wang]

  • Fix virtual interface implied comparison with null (#7421). [Alex Solomatnikov]

  • Fix uvm_hdl_release_and_read to release value and check success (#7425). [Christian Hecken, Heidelberg University]

  • Fix inline constraint on array-indexed randomize target (#7431) (#7434). [Yilou Wang]

  • Fix modification of members of object with const handle (#7433). [Kamil Danecki, Antmicro Ltd.]

  • Fix &96;dist&96; under implication in constraints (#7440) (#7442). [Alex Solomatnikov] [Yilou Wang]

  • Fix std::randomize &96;inside&96; corrupting class-member queue operand (#7449) (#7456). [Yilou Wang]

  • Fix module parameters not re-evaluated upon instantiation (#7463) (#7477). [em2machine]

  • Fix function-in-constraint internal error on bare port return (#7473) (#7480). [Yilou Wang]

  • Fix access to static variable inside function (#7474) (#7475). [Alex Zhou]

  • Fix multiple inclusion of verilated_std.sv (#7478). [Larry Doolittle]

  • Fix std::randomize inside {typedef array} internal error (#7481). [Yilou Wang]

  • Fix module parameters not re-evaluated upon instantiation (#7463) (#7477). [em2machine]

  • Fix infinite recursion with VERILATOR_BIN (#7496) (#7497).

  • Add error on mixed declaration initialization with continuous assignment (#7352). [Zhi QU]

Verilator 5.046 2026-02-28

Important:

  • Support #0 delays with IEEE-1800 compliant semantics (#7079). [Geza Lore, Testorrent USA, Inc.] This may require &96;-no-sched-zero-delay&96; to maintain performance vs. previous versions.

Other:

  • Add IEEE 4-state type lint checks (#3645 partial) (#6895). [Jose Drowne]

  • Add VERILATOR_NUMA_STRATEGY environment variable (#6826) (#6880). [Yangyu Chen]

  • Add decoded Verilog name in JSON output (#6919) (#6995). [Oleh Maksymenko]

  • Add parsing of solve-before inside foreach (#6934). [Pawel Kojma, Antmicro Ltd.]

  • Add error when accessing a non-static class field from a static function (#6948). [Artur Bieniek, Antmicro Ltd.]

  • Add VerilatedContext::useNumaAssign and set on threads() call (#6954). [Yangyu Chen]

  • Add coverage type information to verilator_coverage annotation output (#7131) (#7133) (#7148).

  • Add --max-replication option (#7139). [Todd Strader]

  • Support modport expression syntax + nested (#2601) (#5581) (#7005). [Leela Pakanati]

  • Support nested interface as port connection (#5066) (#6986). [Leela Pakanati]

  • Support solve..before constraints (#5647) (#7123). [Yilou Wang]

  • Support structure initial values (#6130).

  • Support proper automatic/static initialization, and remove STATICVAR warning (#6405) (#7086).

  • Support vpi_put/vpi_get forcing of signals (#5933) (#6704). [Christian Hecken, Heidelberg University]

  • Support detailed failure info for constraint violations (#6617) (#6883). [Yilou Wang]

  • Support &96;unique&96; constraints (on 1D static arrays) (#6810) (#6878). [Srinivasan Venkataramanan]

  • Support complex expressions as std::randomize arguments (#6860). [Jakub Wasilewski, Antmicro Ltd.]

  • Support dynamic array elements in std::randomize (#6896). [Ryszard Rozak, Antmicro Ltd.]

  • Support unbounded '$' in inside range expressions (#6935) (#6938). [Wei-Lun Chiu]

  • Support &96;extern module&96; as a forward-declaration that is ignored.

  • Support &96;foreach&96; with nested dots (#6991). [Krzysztof Bieganski, Antmicro Ltd.]

  • Support signed multiplication in constraints (#7008). [Pawel Kojma, Antmicro Ltd.]

  • Support constraint_mode() on static constraints (#7027) (#7038). [Yilou Wang]

  • Support some system functions in constraint blocks (#7028) (#7036). [Yilou Wang]

  • Support std::randomize() for queue, dynamic array, and associative array variables (#7044). [Yilou Wang]

  • Support inherited and nested pre/post_randomize callbacks (#7049) (#7053). [Yilou Wang]

  • Support &96;$get_initial_random_seed&96; (#7056) (#7069). [Srinivasan Venkataramanan]

  • Support unique constraint on explicit array element subsets (#7057) (#7064). [Yilou Wang]

  • Support force assignments to unpacked structs (#7060). [Ryszard Rozak, Antmicro Ltd.]

  • Support function calls with random arguments in constraints (#7061) (#7083). [Yilou Wang]

  • Support power expressions with constant exponent in constraints (#7073). [Kamil Danecki]

  • Support &96;disable iff&96; with sequences (#7090). [Ryszard Rozak, Antmicro Ltd.]

  • Support &96;this&96; keyword inside inline randomize() with {} constraint blocks (#7102) (#7113). [Yilou Wang]

  • Support constraint dynamic array reduction methods without 'with' clause (#7104) (#7108). [Yilou Wang]

  • Remove deprecated &96;--xml-only&96;.

  • Remove deprecated &96;--make cmake&96;.

  • Change JSON dumps to not include booleans that are false (#6977).

  • Change metacomment extra underscore error to BADVLTPRAGMA warning (#6968). [Geza Lore, Testorrent USA, Inc.]

  • Change INITIALSTATIC to also report on processes, per IEEE (#7020).

  • Change automatic variables to not be traced.

  • Change type definition error to show type chain with source context (#7151).

  • Optimize string temporaries to not be localized (#6969). [Geza Lore, Testorrent USA, Inc.]

  • Optimize wide word shifts by multiple of word size (#6970). [Geza Lore, Testorrent USA, Inc.]

  • Optimize concatenations that produce unused bits in DFG (#6971). [Geza Lore, Testorrent USA, Inc.]

  • Optimize more wide operation temporaries with substitution (#6972). [Geza Lore, Testorrent USA, Inc.]

  • Optimize right shifts as clean (#6981). [Geza Lore, Testorrent USA, Inc.]

  • Optimize temporary insertion for concatenations in DFG (#7013). [Geza Lore, Testorrent USA, Inc.]

  • Optimize removing redundant variables during DFG Peephole pass (#7076). [Geza Lore, Testorrent USA, Inc.]

  • Optimize additional DFG peephole Shift and Concat patterns (#7077). [Geza Lore, Testorrent USA, Inc.]

  • Optimize logic and variable removal early in DFG (#7081). [Geza Lore, Testorrent USA, Inc.]

  • Optimize straight line code in DFG always (#7084). [Geza Lore, Testorrent USA, Inc.]

  • Optimize always blocks using local temporary variables in DFG (#7085). [Geza Lore, Testorrent USA, Inc.]

  • Optimize functions inlined from packages in DFG (#7091). [Geza Lore, Testorrent USA, Inc.]

  • Optimize continuous assignments with function on RHS in DFG (#7096). [Geza Lore, Testorrent USA, Inc.]

  • Fix MULTIDRIVEN with task and default driver (#4045) (#6858). [em2machine]

  • Fix parameterized virtual interface references that have no model references (#4286).

  • Fix hierarchical interface/modport issues (#5941) (#6997). [Leela Pakanati]

  • Fix extending class by a typedef (#6679) (#6855). [Alex Zhou]

  • Fix variable reference lookup for module-level variables (#6741) (#6882). [Yilou Wang]

  • Fix false CASEOVERLAP case item expression lint (#6825) (#6886). [Luca Colagrande]

  • Fix virtual interface triggers (#6844). [Igor Zaworski, Antmicro Ltd.]

  • Fix use-after-free error (#6846). [Matthew Ballance]

  • Fix dynamic scheduler temporary variable locations (#6859) (#6926). [Igor Zaworski, Antmicro Ltd.]

  • Fix dynamic array elements passed to ref argument (#6877). [Ryszard Rozak, Antmicro Ltd.]

  • Fix large debug_str for emitted Syms headers (#6889). [Bartłomiej Chmiel, Antmicro Ltd.]

  • Fix &96;disable iff&96; in simple properties (#6890). [Ryszard Rozak, Antmicro Ltd.]

  • Fix #0 delays to control fork scheduling (#6891). [Artur Bieniek, Antmicro Ltd.]

  • Fix member-selected randomization assignments (#6892). [Yilou Wang]

  • Fix WIDTHEXTEND suppression on add/sub with single-bit signal. [Dan Katz]

  • Fix segfault in V3Slice (#6899). [Pawel Kojma, Antmicro Ltd.]

  • Fix unpacked array concatenation function arguments (#6900). [Pawel Kojma, Antmicro Ltd.]

  • Fix signedness of packed array (#6901) (#6902). [Yutetsu TAKATSUKASA]

  • Fix assignment of queue from unpacked array (#6906).

  • Fix &96;foreach&96; with mid-index empty commas (#6910).

  • Fix internal error when fork under always expression (#6911).

  • Fix error when calling non-static method (#6916). [Artur Bieniek, Antmicro Ltd.]

  • Fix memory leak in vpi_put_value and vpi_get_value (#6917). [Christian Hecken, Heidelberg University]

  • Fix interface internal type reference (#6920) (#6966). [Todd Strader]

  • Fix segfault after assignment pattern XOR error (#6928) (#6931). [emmettifelts]

  • Fix delayed initial assignment (#6929). [Todd Strader]

  • Fix event triggering (#6932) (#7072) (#7101). [Igor Zaworski, Antmicro Ltd.]

  • Fix &96;--top-module&96; with underscores (#6940). [Christopher Batten]

  • Fix variable randomization to better differ by seed (#6945) (#6956). [Rodrigo Batista de Moraes]

  • Fix null pointer dereference in class member trigger expressions (#6946). [Cameron Waite]

  • Fix type assignments for arrays of parameter types (#6955). [Todd Strader]

  • Fix accessing non-rand struct member in constraints (#6960). [Pawel Kojma, Antmicro Ltd.]

  • Fix associative array of events causes C++ compile error (#6962).

  • Fix UNUSED / UNDRIVEN for unused functions (#6967). [Todd Strader]

  • Fix non-inlined function return value clearing (#6982).

  • Fix parameterized class typedef as interface type parameter (#6983) (#6984). [Leela Pakanati]

  • Fix virtual interface not found internal error (#7010). [Igor Zaworski, Antmicro Ltd.]

  • Fix multidimensional dynamic array elements passed to ref argument (#7023). [Ryszard Rozak, Antmicro Ltd.]

  • Fix randomize() null pointer dereference (#7026). [Artur Bieniek, Antmicro Ltd.]

  • Fix randc cyclic behavior broken with constraints (#7029) (#7035). [Yilou Wang]

  • Fix inline foreach constraints on dynamic arrays of class objects (#7030) (#7037). [Yilou Wang]

  • Fix rand_mode() on nested object variables causing Z3 solver error (#7031) (#7034). [Yilou Wang]

  • Fix non-member identifiers used inside constraints (#7033). [Pawel Kojma, Antmicro Ltd.]

  • Fix tracing without module inlining to match with inlining (#7041). [Geza Lore, Testorrent USA, Inc.]

  • Fix scope tree in traces in hierarchical mode (#7042). [Geza Lore, Testorrent USA, Inc.]

  • Fix rand_mode()/constraint_mode() when used as function arguments (#7051) (#7055). [Yilou Wang]

  • Fix constraint_mode()/rand_mode() in constructor being overwritten (#7054). [Yilou Wang]

  • Fix enum variables in constraint solver producing invalid enum values (#7058) (#7065). [Yilou Wang]

  • Fix randomize() on null object handle crashing instead of returning 0 (#7059) (#7066). [Yilou Wang]

  • Fix inside operator crash with impure expression and unsized range literals (#7063) (#7067). [Yilou Wang]

  • Fix constant propagating DPI-written variables (#7074). [Geza Lore, Testorrent USA, Inc.]

  • Fix conditional expressions in constraints (#7087). [Ryszard Rozak, Antmicro Ltd.]

  • Fix UNSUPPORTED on $sampled in sensitivity list (#7093). [Ryszard Rozak, Antmicro Ltd.]

  • Fix time to not advance after &96;$finish&96; (#7095).

  • Fix associative array size() constraint generating invalid resize() call (#7103) (#7112). [Yilou Wang]

  • Fix &96;new&96; shallow copy to preserve polymorphic runtime type (#7105) (#7109). [Yilou Wang]

  • Fix circular class reference %p-printing causing infinite recursion (#7106).

  • Fix too-short bit pack returning wrong value (#7111).

  • Fix randomize of real (#7115). [Srinivasan Venkataramanan]

  • Fix inlining of C functions with reloop locals (#7132). [Geza Lore, Testorrent USA, Inc.]

  • Fix segfault in EmitCSyms (#7142) (#7143). [Gilberto Abram]

Verilator 5.044 2026-01-01

Important:

  • This is the last release supporting the deprecated &96;--xml-only&96; and &96;--make cmake&96; options.

  • Change &96;--lint-only&96; and &96;--json-only&96; to imply &96;--timing&96; (#6790).

Other:

  • Add &96;--unroll-limit&96; option (#6654) (#6668). [Geza Lore, Fractile Ltd.]

  • Add &96;-fno-inline-funcs-eager&96; option to disable excessive inlining (#6682). [Geza Lore, Fractile Ltd.]

  • Add &96;-param&96;/&96;-port&96; options to &96;public_flat*&96; control directives (#6685). [Geza Lore, Fractile Ltd.]

  • Add &96;--top&96; specifying &96;config&96; name (#6710). [Dan Ruelas-Petrisko]

  • Add &96;sc_biguint&96; pragma (#6712). [Jakub Wasilewski, Antmicro Ltd.]

  • Add &96;make venv&96; target (#6775). [Geza Lore]

  • Add SUPERNFIRST error on super.new on non-first statement (#6784). [Artur Bieniek]

  • Add fargs for reusability of &96;--dump-inputs&96; output (#6812). [Geza Lore]

  • Add &96;--quiet-build&96; to suppress make/compiler informationals.

  • Support &96;std::randomize(){...}&96; (#4706) (#6573). [Yilou Wang]

  • Support force assignments to unpacked array elements (partial #4735) (#6787). [Ryszard Rozak, Antmicro Ltd.]

  • Support &96;config' (#5891) (#6714) (#6717) (#6745) (#6764). [Dan Ruelas-Petrisko]

  • Support unpacked struct in localparam (#6053 partial) (#6708). [Jonathan Drolet]

  • Support &96;randsequence&96; (#6131).

  • Support array reference arguments into 'std::randomize()' (#6384) (#6719). [Yilou Wang]

  • Support basic global constraints (#6551) (#6552). [Yilou Wang]

  • Support SystemC time resolution with step 10/100 (#6633) (#6715). [Aliaksei Chapyzhenka]

  • Support &96;this.randomize()&96; with constraints (#6634). [Artur Bieniek, Antmicro Ltd.]

  • Support multi-expression sequences (#6639). [Bartłomiej Chmiel, Antmicro Ltd.]

  • Support &96;#1step&96; delay as statement (#6671). [Pawel Kojma, Antmicro Ltd.]

  • Support clocking output delay &96;1step&96; (#6681). [Ondrej Ille]

  • Support parsing of dotted &96;bins_expression&96; (#6683). [Pawel Kojma, Antmicro Ltd.]

  • Support constant expression cycle delays in sequences (#6691). [Ryszard Rozak, Antmicro Ltd.]

  • Support general global constraints (#6709) (#6711) (#7833) (#7838). [Yilou Wang]

  • Support complex std::randomize patterns (#6736) (#6737). [Yilou Wang]

  • Support &96;rand_mode&96; in global constraint gathering (#6740) (#6752). [Yilou Wang]

  • Support reduction or in constraints (#6840). [Pawel Kojma, Antmicro Ltd.]

  • Support vpiSigned (#6868) (#6870). [Kaleb Barrett]

  • Optimize away calls to empty functions (#6626). [Geza Lore]

  • Optimize redundant headers in Syms implementation files. [Geza Lore, Fractile Ltd.]

  • Optimize constructor/destructor VerilatedModules (#6660). [Geza Lore, Fractile Ltd.]

  • Optimize repeated function call during symbol table initialization (#6665). [Geza Lore, Fractile Ltd.]

  • Optimize functions reading external parameters as pure (#6684). [Geza Lore, Fractile Ltd.]

  • Optimize &96;$past&96; delayed variable reuse (#6689). [Geza Lore, Fractile Ltd.]

  • Optimize combinational loops through sign extension (#6724). [Geza Lore]

  • Optimize trace initialization code size (#6749). [Geza Lore]

  • Optimize combinational cycles in DFG (#6744) (#6746) (#6744). [Geza Lore]

  • Optimize inlining small C functions and add &96;-inline-cfuncs&96; (#6815). [Jose Drowne]

  • Fix generate function(s) inside of generate blocks (#1011) (#6789). [em2machine]

  • Fix typedef derived from type defined inside interface (#3441) (#6776). [em2machine]

  • Fix warning lint directive ordering and consistency (#4185) (#5368) (#5610) (#6876).

  • Fix extern function that returns parameterized class (#4924).

  • Fix type deduction for variable parameterized classes (#6281) (#6813). [em2machine]

  • Fix randomize called within func/task (#6144) (#6753). [Yilou Wang]

  • Fix pre/post_randomize on extended classes (#6467). [Alex Solomatnikov]

  • Fix expression short circuiting (#6483). [Todd Strader]

  • Fix resized lvalues with warning suppressed (#6497) (#6816). [Alex Solomatnikov]

  • Fix unsupported &96;if&96; virtual interface warning (#6558) (#6861). [Krzysztof Bieganski, Antmicro Ltd.]

  • Fix expression coverage of system calls (#6592). [Todd Strader]

  • Fix &96;--timing&96; with &96;--x-initial-edge&96; (#6603) (#6631). [Krzysztof Bieganski, Antmicro Ltd.]

  • Fix merging of impure assignments in gate optimization (#6629) (#6630). [Geza Lore]

  • Fix determining Verilator revision when within git submodules without tags.

  • Fix initial random values for verilator-created variables (#6611). [Todd Strader]

  • Fix parsing of &96;with&96; clause inside covergroups (#6618). [Pawel Kojma, Antmicro Ltd.]

  • Fix slice memory overflow on large output arrays (#6636) (#6638). [Jens Yuechao Liu]

  • Fix localparam type assignment from interface type parameters (#6637) (#6732). [em2machine]

  • Fix memory usage statistics on MacOS (#6644). [Geza Lore, Fractile Ltd.]

  • Fix command line statistics with --stats (#6645) (#6646). [Geza Lore, Fractile Ltd.]

  • Fix slow compilation of generated sampled value code (#6652). [Geza Lore, Fractile Ltd.]

  • Fix non-deterministic output when splitting Syms file. [Geza Lore, Fractile Ltd.]

  • Fix crash on DFG driver lookup (#6649). [Geza Lore]

  • Fix ccache-report with PCH files. [Geza Lore, Fractile Ltd.]

  • Fix parameterized class function (#6659) (#6802). [em2machine]

  • Fix local interface parameter hierarchical access (#6661) (#6666). [Paul Swirhun]

  • Fix splitting of Syms constructor/destructor bodies (#6662). [Geza Lore, Fractile Ltd.]

  • Fix long C++ compilation due to VerilatedScope constructors (#6664). [Geza Lore, Fractile Ltd.]

  • Fix large array initialization (#6669). [Artur Bieniek, Antmicro Ltd.]

  • Fix &96;--expand-limit&96; not respected for expressions (#6670). [Geza Lore, Fractile Ltd.]

  • Fix &96;free&96; name collision (#6675). [Todd Strader]

  • Fix bounds checking in non-inlined function (#6677). [Geza Lore, Fractile Ltd.]

  • Fix stream operator widening (#6693) (#6697). [Jean-Nicolas Strauss]

  • Fix multitop cross references (#6699).

  • Fix DFG independent bits analysis performance (#6713) (#6743). [Geza Lore]

  • Fix deleting linked node error in V3Randomize (#6718). [Igor Zaworski, Antmicro Ltd.]

  • Fix runtime worker thread stack sizes on MacOS (#6721). [Geza Lore]

  • Fix X handling in UDPs (#6722) (#6723). [Michael Bikovitsky]

  • Fix &96;--prof-exec&96; using &96;--lib-create&96;. [Geza Lore]

  • Fix fork scheduling semantics (#6730). [Artur Bieniek, Antmicro Ltd.]

  • Fix JSON output case statements (#6733).

  • Fix internal fault when cross-class calling with DPI (#6735) (#6742). [Matthew Ballance]

  • Fix write variable placement for global constraints (#6740) (#6750) (#6797). [Yilou Wang]

  • Fix JSON dump missing output ports (#6751) (#6831). [Oleh Maksymenko]

  • Fix resolution of specialized typedefs (#6754) (#6808) (#6834). [em2machine]

  • Fix UNSUPPORTED on force / release with complex selects (#6755). [Ryszard Rozak, Antmicro Ltd.]

  • Fix select assignment expansion (#6757). [Geza Lore]

  • Fix &96;--lib-create&96; with multi-bit clocks (#6759). [Geza Lore]

  • Fix DFG reusing volatile variables. [Geza Lore]

  • Fix DFG assertion on out-of-bounds selects. [Geza Lore]

  • Fix process reference giving no return statement error (#6767) (#6823). [Krzysztof Bieganski, Antmicro Ltd.]

  • Fix class param static not found again error (#6768).

  • Fix crash when super.new() called without a base class (#6772). [Matthew Ballance]

  • Fix class-in-class extends with parameters (#6773).

  • Fix enum item references in class extends with parameters.

  • Fix reordering of function body inlined on RHS of <= NBA (#6780). [Geza Lore]

  • Fix clang &96;-Wno-vla-cxx-extension&96; warning for UVM DPI tests (#6782)

  • Fix &96;disable iff&96; in simple properties (#6783). [Ryszard Rozak, Antmicro Ltd.]

  • Fix input sampling of clocking block signals (#6788). [Pawel Kojma, Antmicro Ltd.]

  • Fix O(n*2) analysis in const-bit-op-tree (#6791). [Geza Lore]

  • Fix member select of variable without randmode (#6800) (#6833). [Yilou Wang]

  • Fix duplicate name error with interface initial blocks (#6804) (#6805). [Thomas Dybdahl Ahle]

  • Fix nested struct within parameter port list (#6818) (#6824). [Luca Colagrande]

  • Fix setting thread count in VerilatedContext (#6826 partial) (#6841). [Yangyu Chen]

  • Fix firing array selects of events (#6829). [Amal Araweelo Almis]

  • Fix false IMPLICITSTATIC on localparam (#6835). [Geza Lore]

  • Fix randcase under fork (#6843). [Amal Araweelo Almis]

  • Fix JSON missing &96;signed&96; indication (#6845).

  • Fix class reference throwing cannot detect changes error (#6851).

  • Fix &96;randc&96; on extended class (#6852).

  • Fix typedef &96;::&96; class reference error (#6862).

  • Fix missing include on FreeBSD (#6864).

  • Fix &96;--Wwarn-lint&96; to be inverse of &96;--Wno-lint&96;.

Verilator 5.042 2025-11-02

Other:

  • Add HIERPARAM error on hierarchical parameter values (#1626) (#6456) (#6484) (#6587) (#6609) (#6621) (#6623). [Todd Strader] [Luca Rufer] [Paul Swirhun]

  • Add error on zero/negative unpacked dimensions (#1642). [Stefan Wallentowitz]

  • Add verilator_gantt profiling of DPI imports (#3084). [Geza Lore]

  • Add ASSIGNEQEXPR when use &96;=&96; inside expressions (#5567). [Ethan Sifferman]

  • Add error on non-packed struct randc (#5999). [Seth Pellegrino]

  • Add configure &96;--enable-dev-asan&96; to compile verilator_bin with the address sanitizer (#6404). [Geza Lore]

  • Add $(LDFLAGS) and $(LIBS) to when building shared libraries (#6425) (#6426). [Ahmed El-Mahmoudy]

  • Add IMPLICITSTATIC also on procedure variables.

  • Add FUNCTIMCTL error on function invoking task or time-controlling statements (#6385).

  • Add error on &96;virtual new&96; (#6486). [Alex Solomatnikov]

  • Add error on ranges with tristate values (#6534). [Alex Solomatnikov]

  • Add NORETURN warning on functions without return values (#6534). [Alex Solomatnikov]

  • Add &96;--aslr&96; and &96;--no-aslr&96; options.

  • Add &96;$cpure&96; (#6580). [Igor Zaworski, Antmicro Ltd.]

  • Add &96;--preproc-defines&96;.

  • Deprecate sensitivity list on public_flat_rw attributes (#6443). [Geza Lore]

  • Deprecate clocker attribute and --clk option (#6463). [Geza Lore]

  • Deprecate '--make cmake' option (#6540). [Geza Lore]

  • Change default &96;--expand-limit&96; to 256 (#3419).

  • Change developer coverage flow and add configure &96;--enable-dev-gcov&96; (#6526). [Geza Lore]

  • Change &96;verilator_difftree&96; to return exit code 1 on mismatch, 2 on error.

  • Change default thread pool sizes to respect processor affinity (#6604). [Geza Lore]

  • Change &96;--preproc-comments&96; to be new name of &96;--pp-comments&96; option.

  • Support modports referencing clocking blocks (#4555) (#6436). [Ryszard Rozak, Antmicro Ltd.]

  • Support class package reference on pattern keys (#5653). [Todd Strader]

  • Support digits in &96;$sscanf&96; field width formats (#6083). [Iztok Jeras]

  • Support assert under assert (#6146). [Alex Solomatnikov]

  • Support pure functions in sensitivity lists (#6393). [Krzysztof Bieganski, Antmicro Ltd.]

  • Support simple alias statements (#6339) (#6501). [Ryszard Rozak, Antmicro Ltd.]

  • Support simple cycle delay sequence expressions inside properties (#6508). [Bartłomiej Chmiel, Antmicro Ltd.]

  • Support impure expressions in &96;inside&96; (#6562). [Igor Zaworski, Antmicro Ltd.]

  • Support &96;case&96; impure expressions (#6563). [Igor Zaworski, Antmicro Ltd.]

  • Support dotted access to ports of a direct hier_block instance. (#6595). [Geza Lore]

  • Improve &96;lint_off&96; to allow multiple messages and comments (#2755).

  • Improve automatic selection of logic for DFG synthesis (#6370). [Geza Lore]

  • Improve &96;covergroup with function sample&96; handling (#6387). [Jakub Wasilewski]

  • Improve DFG type system (#6390). [Geza Lore]

  • Improve DFG variable removal and temporary insertion (#6401). [Geza Lore]

  • Improve memory usage of statistics (#6513). [Geza Lore]

  • Improve conditional merging to preserve branch prediction. [Geza Lore]

  • Optimize duplicate 'if' and '?:' conditions (#3807) (#6495)

  • Optimize dead functions in more cases (#6380) (#6430). [Artur Bieniek, Antmicro Ltd.]

  • Optimize constant folding in wide expression expansion (#6381). [Geza Lore]

  • Fix &96;--trace-max-width&96; and increase to 4096. (#2385).

  • Fix missing BLKSEQ when connecting module port to array (#2973).

  • Fix LATCH warning with CASEINCOMPLETE (#3301).

  • Fix unused parameterized class causing internal error (#4013). [Alberto Del Rio]

  • Fix false CONSTVAR error on initializers (#4992).

  • Fix hierarchical references with parameterized modules and interfaces (#5649) (#6566). [Ryszard Rozak, Antmicro Ltd.]

  • Fix interface exposure with &96;--public-depth&96; or &96;--trace-depth&96; (#5758).

  • Fix cell scoping performance (#6059). [Jerry Tianchen]

  • Fix hierarchical &96;--prof-pgo&96; (#6213). [Bartłomiej Chmiel, Antmicro Ltd.]

  • Fix while loop hang on timing-delayed assignment (#6343) (#6354). [Krzysztof Bieganski, Antmicro Ltd.]

  • Fix driver analysis of partially assigned variables (#6364) (#6378). [Geza Lore]

  • Fix V3Hash MacOS ambiguity (#6350). [Lan Zongwei]

  • Fix cmake APPLE variable (#6351). [Lan Zongwei]

  • Fix randomize local after parameters applied (#6371). [Alex Solomatnikov]

  • Fix package imports not found after parameters applied (#6373). [Alex Solomatnikov]

  • Fix deep shift pattern performance (#6379) (#6420). [Geza Lore]

  • Fix COVERAGEIGN-ignored &96;get_inst_coverage&96; and other covergroup methods (#6383). [Alex Solomatnikov]

  • Fix error when modport variable is unresolved (#6386). [Ryszard Rozak, Antmicro Ltd.]

  • Fix resolving parameters (#6388) (#6418) (#6421) (#6438) (#6429). [Artur Bieniek, Antmicro Ltd.]

  • Fix wire array with initial assignment (#6391). [Alex Solomatnikov]

  • Fix import of class with default params (#6396) (#6410) (#6413). [Krzysztof Bieganski, Antmicro Ltd.]

  • Fix use after free in elaboration (#6403). [Geza Lore]

  • Fix address sanitizer issues (#6406). [Geza Lore]

  • Fix timing control under fork under function (#6407). [Krzysztof Bieganski, Antmicro Ltd.]

  • Fix memory leaks and reduce requirements (#6411) (#6417) (#6419) (#6437) (#6439) (#6517). [Geza Lore]

  • Fix parameter implicit type from string (#6414). [Alex Solomatnikov]

  • Fix parsing for sequence expressions (#6427). [Bartłomiej Chmiel, Antmicro Ltd.]

  • Fix parameterized class super functions (#6431) (#6438). [Artur Bieniek, Antmicro Ltd.]

  • Fix external function declarations with class typedef references (#6433).

  • Fix internal error on out-of-bounds real array access.

  • Fix pre/post increments in assertions (#6434).

  • Fix elaboration displays with &96;%m&96; and some &96;%p&96; (#6445) (#6451). [Alex Solomatnikov]

  • Fix cast in gdbinit.py (#6447). [Artur Bieniek, Antmicro Ltd.]

  • Fix false unique assertions on &96;else ;&96; (#6450). [Don Owen]

  • Fix loss of clock attribute in DFG variable removal (#6453). [Bartłomiej Chmiel, Antmicro Ltd.]

  • Fix data types of method calls without parenthesis (#6457). [Artur Bieniek, Antmicro Ltd.]

  • Fix segfault on unsupported PLI calls (#6458). [Krzysztof Bieganski, Antmicro Ltd.]

  • Fix false assertion failure on failed DFG driver tracing (#6459). [Geza Lore]

  • Fix side effects when using select (#6460). [Igor Zaworski, Antmicro Ltd.]

  • Fix timeprecision backward assignment (#6469). [Artur Bieniek, Antmicro Ltd.]

  • Fix splitting hierarchically referenced variables (#6475). [Ryszard Rozak, Antmicro Ltd.]

  • Fix Windows compilation of Verilator with spaces in the path (#6477). [Fabian Keßler-Schulz]

  • Fix PROTOTYPEMIS error on implicit logic (#6482). [Alex Solomatnikov]

  • Fix configure misdetecting C++14 (#6488) (#6515). [Thomas O'Keeffe]

  • Fix false BLKSEQ on non-edged sensitivity list (#6492). [Oron Port]

  • Fix .vlt public_flat* and others to support long identifier names (#6516). [Szymon Gizler, Antmicro Ltd.]

  • Fix always_ff on constants (#6519). [Todd Strader]

  • Fix fault on operations on uninitialized strings (#6520). [Artur Bieniek, Antmicro Ltd.]

  • Fix find_index methods of associative arrays (#6525). [Ryszard Rozak, Antmicro Ltd.]

  • Fix parsing of &96;eventually[]&96; and property expression memory leaks (#6530). [Bartłomiej Chmiel, Antmicro Ltd.]

  • Fix memory leak for unsupported &96;$past&96; (#6535). [Bartłomiej Chmiel, Antmicro Ltd.]

  • Fix inconsistent force assignment (#6541). [Artur Bieniek, Antmicro Ltd.]

  • Fix DFG circular driver tracing with partial assignments. [Geza Lore]

  • Fix passing typedef value as parameter (#6543) (#6547). [Igor Zaworski, Antmicro Ltd.]

  • Fix indent error on quoted strings (#6544).

  • Fix incorrect nested interface-class error (#6549). [Matthew Ballance]

  • Fix std::process::get_randstate to not affect random stability (#6550) (#6565). [Aleksander Kiryk]

  • Fix exit code signal number reporting (#6554). [Artur Bieniek, Antmicro Ltd.]

  • Fix &96;$finish&96; inside fork blocks (#6555). [Bartłomiej Chmiel, Antmicro Ltd.]

  • Fix single element unpacked array DPI parameters. [Geza Lore]

  • Fix DFG synthesis non-determinism (#6557) (#6568). [Todd Strader]

  • Fix side effects for improved function/task/process purity (#6559). [Igor Zaworski, Antmicro Ltd.]

  • Fix excessive logic replication in DFG circular driver tracing (#6561) (#6594). [Geza Lore]

  • Fix hierarchical with parameterized instances under hier block (#6572). [Geza Lore]

  • Fix segfault on type casts (#6574). [David Moberg]

  • Fix references to interfaces containing generate blocks (#6579). [Ryszard Rozak, Antmicro Ltd.]

  • Fix missing net type mappings in FST traces (#6582) (#6583). [Matt Stroud]

  • Fix function call expression coverage (#6589). [Todd Strader]

  • Fix V3Life eliminating assignments across timing controls (#6593) (#6596). [Geza Lore]

  • Fix incorrectly resuming process waiting on multiple events (#6597). [Geza Lore]

  • Fix &96;--hierarchical&96; with &96;--binary&96; (#6602). [Geza Lore]

  • Fix mis-ignoring virtual interface member triggers (#5116 reopened) (#6613). [Geza Lore]

  • Fix ENUMVALUE warning when overriding parameter using &96;-G/-pvalue&96; options. [Geza Lore]

  • Fix &96;-G&96; and &96;-pvalue&96; with &96;--hierarchical&96;. [Geza Lore]

  • Fix waiving messages with empty contents (#6610). [Yoshitomo KANEDA]

  • Fix constant-arrayed instance parameters (#6614). [Alex Solomatnikov]

Verilator 5.040 2025-08-30

Other:

  • Add ENUMITEMWIDTH error, and apply to X-extended and ranged values.

  • Add NOEFFECT warning, replacing previous &96;foreach&96; error.

  • Add SPECIFYIGN warning for specify constructs that were previously silently ignored.

  • Add PARAMNODEFAULT error, for parameters without defaults.

  • Add enum base data type, wire data type, and I/O versus data declaration checking per IEEE.

  • Add PROTOTYPEMIS error on missing and mismatching prototypes (#6206) (#6207). [Alex Solomatnikov]

  • Add error when trying to assign class object to variable of non-class types (#6237). [Igor Zaworski, Antmicro Ltd.]

  • Add ALWNEVER warning, for &96;always @*&96; that never execute (#6291).

  • Add separate coverage counters for toggles 0->1 and 1->0 (#6086). [Ryszard Rozak, Antmicro Ltd.]

  • Add error on class 'function static'.

  • Add error on force/release non-constant selects.

  • Add &96;-DVERILATOR=1&96; definition to compiler flags when using verilated.mk.

  • Support member-level triggers for virtual interfaces (#5166) (#6148). [Yilou Wang]

  • Support unassigned virtual interfaces (#5265) (#6245). [Szymon Gizler, Antmicro Ltd.]

  • Support randomization of scope variables with 'std::randomize()' (#5438) (#6185). [Yilou Wang]

  • Support disabling a fork in additional contexts (#5432 partial) (#6174) (#6183). [Ryszard Rozak, Antmicro Ltd.]

  • Support bit queue streaming (#5830) (#6103). [Paul Swirhun]

  • Support &96;$fread&96; with missing start (#6125). [Iztok Jeras]

  • Support unpacked array &96;with&96; methods (#6134).

  • Support Verilog real ports as SystemC double ports (#6136) (#6158). [George Polack]

  • Support &96;$countones&96; in constraints (#6144 partial) (#6235). [Ryszard Rozak, Antmicro Ltd.]

  • Support disable dotted references (#6154). [Ryszard Rozak, Antmicro Ltd.]

  • Support randomize() on class member selects (#6161) (#6195). [Igor Zaworski, Ryszard Rozak, Antmicro Ltd.]

  • Support multiple variables on RHS of a &96;force&96; assignment (#6163). [Artur Bieniek, Antmicro Ltd.]

  • Support covergroup extends, etc., as unsupported (#6160). [Artur Bieniek, Antmicro Ltd.]

  • Support parameter resolution of 1D unpacked array slices (#6257) (#6268). [Michael Bedford Taylor]

  • Support generic interfaces (#6272). [Igor Zaworski, Antmicro Ltd.]

  • Support disabling a fork from within that fork (#6314). [Ryszard Rozak, Antmicro Ltd.]

  • Support future sampled value functions.

  • Support simple disable within task (#6334). [Ryszard Rozak, Antmicro Ltd.]

  • Support recursive constant functions.

  • Change control file &96;public_flat_*&96; and other signal attributes to support __ in names (#6140).

  • Change runtime to exit() instead of abort(), unless under +verilated+debug.

  • Change &96;$display("%p")&96; to remove space after &96;}&96;.

  • Improve &96;--skip-identical&96; to skip on identical input file contents (#6109).

  • Improve testing on FreeBSD (#6328). [Aleksander Kiryk]

  • Optimize to return memory when using -build (#6192) (#6226). [Michael B. Taylor]

  • Optimize 2 ** X to 1 << X if base is signed (#6203). [Max Wipfli]

  • Optimize more complex combinational logic in DFG (#6205) (#6209) (#6298). [Geza Lore]

  • Optimize combinational cycles through arrays in DFG (#6210). [Geza Lore]

  • Optimize variable removal in scoped DFG (#6260). [Geza Lore]

  • Optimize acyclic DFG components into the original acyclic sub-graph. (#6261). [Geza Lore]

  • Optimize multiplexers in DFG synthesis (#6331). [Geza Lore]

  • Optimize interfaces in DFG (#6332). [Geza Lore]

  • Optimize logic in non-virtual interfaces with DFG (#6347). [Geza Lore]

  • Fix loop initialization visibility outside loop (#4237).

  • Fix constructor parameters in inheritance hierarchies (#6036) (#6070). [Petr Nohavica]

  • Fix replicate of negative giving 'REPLICATE has no expected width' internal error (#6048) (#6229).

  • Fix cmake &96;-Wno&96; compiler flag testing (#6145). [Martin Stadler]

  • Fix class extends dotted error (#6162). [Igor Zaworski, Antmicro Ltd.]

  • Fix genvar error with &96;-O0&96; (#6165). [Max Wipfli]

  • Fix uninitialized thread PGO counters (#6167). [Bartłomiej Chmiel, Antmicro Ltd.]

  • Fix additional UNOPTFLAT combinational cycles automatically in DFG (#6168) (#6173) (#6176). [Geza Lore]

  • Fix omitting error when assigning to an input (#6169). [Artur Bieniek, Antmicro Ltd.]

  • Fix parameter-dependent type linking (#6170). [Igor Zaworski, Antmicro Ltd.]

  • Fix param-dependent class typedef linking (#6171). [Igor Zaworski, Antmicro Ltd.]

  • Fix virtual interface member propagation (#6175) (#6184). [Yilou Wang]

  • Fix &96;--coverage-expr&96; null pointer dereference (#6181). [Igor Zaworski, Antmicro Ltd.]

  • Fix conflicting function/class name linking error (#6182). [Igor Zaworski, Antmicro Ltd.]

  • Fix negate of wide structure selections (#6186).

  • Fix VPI signal range order (#6189) (#6200). [Ibrahim Burak Yorulmaz]

  • Fix structure select causing 'Wide Op' error (#6191). [Danny Oler]

  • Fix automatic task variables in unrolled loops with forks (#6194) (#6201). [Danny Oler]

  • Fix 'driver same component' assertion (#6211) (#6215). [Geza Lore]

  • Fix &96;--stats&96; overridden by skipping identical build (#6220). [Geza Lore]

  • Fix MODDUP with duplicate packages to take first package (#6222).

  • Fix replicate with unsigned count but MSB set (#6231) (#6233). [Geza Lore]

  • Fix randomize on function-local variable (#6234).

  • Fix queue typedef with unbounded slice (#6236).

  • Fix error when force assignment is used with ref function args (#6244). [Ryszard Rozak, Antmicro Ltd.]

  • Fix write of 0 in '%c' (#6248) (#6249). [Rodrigo Batista de Moraes]

  • Fix coverage of variables of complex types (#6250). [Ryszard Rozak, Antmicro Ltd.]

  • Fix broken support of unassigned virtual interfaces (#6253) (#6338). [Szymon Gizler, Antmicro Ltd.]

  • Fix partial DFG conversion of concat assignments (#6255). [Geza Lore]

  • Fix dynamic cast purity (#6267). [Igor Zaworski, Antmicro Ltd.]

  • Fix same variable on the RHS forced to two different LHSs. (#6269). [Artur Bieniek, Antmicro Ltd.]

  • Fix spurious VPI value change callbacks (#6274). [Todd Strader]

  • Fix stray ']' in Verilog code output for non-constant select (#6277). [Geza Lore]

  • Fix hierarchical NBAs (#6286) (#6300). [Geza Lore]

  • Fix variables hiding package imports (#6289). [Johan Wouters]

  • Fix DFG circular driver tracing. [Geza Lore]

  • Fix no matching function calls for randomized &96;VlWide&96; in unpacked and dynamic arrays (#6290). [Mateusz Gancarz, Antmicro Ltd.]

  • Fix PowerPC support (#6292). [Sergey Fedorov]

  • Fix referencing module variables above classes (#6304). [Artur Bieniek, Antmicro Ltd.]

  • Fix direct NBA to dynamically-sized variable (#6310). [Artur Bieniek, Antmicro Ltd.]

  • Fix static vars under member select (#6313). [Igor Zaworski, Antmicro Ltd.]

  • Fix expression type comparison (#6316). [Igor Zaworski, Antmicro Ltd.]

  • Fix of inline constraints with member selects (#6321). [Igor Zaworski, Antmicro Ltd.]

  • Fix corner case bugs in module and variable inlining (#6322). [Geza Lore]

  • Fix queue extend to check bounds (#6324). [Aleksander Kiryk]

  • Fix gathering sensitivities from virtual interface members (#6325). [Aleksander Kiryk]

  • Fix FreeBSD missing headers (#6326). [Aleksander Kiryk]

  • Fix to select UDPs when they are the only candidate for a top module.

  • Fix splitting of assignments to SC variables (#6329) (#6336). [Geza Lore]

  • Fix to localize for super constructors with function calls as arguments (#6330). [Igor Zaworski, Antmicro Ltd.]

  • Fix wide select expansion and substitution (#6341) (#6345). [Geza Lore]

  • Fix upcasting class type parameters (#6344). [Krzysztof Bieganski, Antmicro Ltd.]

  • Fix undefined weak link for Apple GCC etc (#6348). [Congcong Cai]

  • Fix emitting unbounded parameters (#6912).

  • Fix syntax error on unsupported defparam array (#6915).

Verilator 5.038 2025-07-08

Important:

  • Change &96;--assert&96; to be the default; use &96;--no-assert&96; for legacy behavior and faster runtimes.

Other:

  • Support redeclaring type as non-type; major parsing change (#2412) (#6020) (#6042) (#6044).

  • Support scoped &96;new&96; (#4199).

  • Support elaboration-time printing of unpacked array with &96;%p&96; (#4732).

  • Support constrained random for associative arrays (#5985) (#5986). [Yilou Wang]

  • Support assignments to concatenations with impure RHS (#6002). [Ryszard Rozak, Antmicro Ltd.]

  • Support SARIF JSON diagnostic output with &96;--diagnostics-sarif&96;. (#6017)

  • Support 1-bit params with -G and -pvalue (#6051) (#6082). [Paul Swirhun]

  • Support &96;specparam&96; (#5767) (#6142).

  • Support &96;$timeformat&96; with missing arguments (#6113). [Alex Solomatnikov]

  • Support non-overlapping blocking/non-blocking assignments (#6137). [Geza Lore]

  • Support parameter forward types.

  • Support constant functions with left-hand-side concatenates.

  • Add PROCINITASSIGN on initial assignments to process variables (#2481) (#7640). [Niraj Menon]

  • Add BADVLTPRAGMA on unknown Verilator pragmas (#5945). [Shou-Li Hsu]

  • Add ternary operator into branch coverage (#5880). [Ryszard Rozak, Antmicro Ltd.]

  • Add aggregate type error checks (#5570) (#5950). [Shou-Li Hsu]

  • Add &96;--work&96; library-selection option (#5891 partial).

  • Add &96;--filter-type&96; to verilator_coverage (#6030). [Ryszard Rozak, Antmicro Ltd.]

  • Add &96;--hierarchical-threads&96; (#6037). [Bartłomiej Chmiel]

  • Add &96;MODMISSING&96; error, in place of unnamed error (#6054). [Paul Swirhun]

  • Add DFG binToOneHot pass to generate one-hot decoders (#6096). [Geza Lore]

  • Add hint of the signed right-hand-side in oversized replication error (#6098). [Peter Birch]

  • Improve hierarchical scheduling visualization in V3ExecGraph (#6009). [Bartłomiej Chmiel, Antmicro Ltd.]

  • Improve DPI temporary 'for' loop performance (#6079). [Bartłomiej Chmiel, Antmicro Ltd.]

  • Improve memory usage for SenTrees in V3OrderProcessDomains (#6112). [Geza Lore]

  • Improve docker image size (#6139). [Tobias Rosenkranz, bitaggregat GmbH]

  • Update docker base image to Ubuntu 24.04 (#6147). [Tobias Rosenkranz, bitaggregat GmbH]

  • Optimize DFG De Morgan patterns (#6090). [Geza Lore]

  • Optimize DFG variable elimination (#6091). [Geza Lore]

  • Optimize DFG PUSH_SEL_THROUGH_CONCAT pattern (#6092). [Geza Lore]

  • Optimize DFG before V3Gate (#6141). [Geza Lore]

  • Optimize DFG peephole patterns (#6149). [Geza Lore]

  • Optimize constification within Expand and Subst stages (#6111). [Geza Lore]

  • Fix --x-initial and --x-assign random stability (#2662) (#5958) (#6018) (#6025) (#6075). [Todd Strader]

  • Fix trace hierarchical-name runtime errors (#5668) (#6076). [Paul Swirhun]

  • Fix streaming operator packing order (#5903) (#6077). [Paul Swirhun]

  • Fix filename backslash escapes in C code (#5947).

  • Fix C++ widths in V3Expand (#5953) (#5975). [Geza Lore]

  • Fix dependencies from different hierarchical schedules (#5954). [Bartłomiej Chmiel, Antmicro Ltd.]

  • Fix constant propagation of post-expand stages (#5955) (#5963) (#5969) (#5972) (#5983).

  • Fix sign extension of signed compared with unsigned case items (#5968).

  • Fix always processes ignoring $finish (#5971). [Hennadii Chernyshchyk]

  • Fix method calls and new to access interface arrays (#5973). [Nick Brereton]

  • Fix streaming to/from packed arrays (#5976). [Geza Lore]

  • Fix segfault writing timestamp to VCD after buffer flush (#5978) (#5980). [Dominick Grochowina]

  • Fix inconsistent assignment error with split-var (#5984) (#5988). [Yutetsu TAKATSUKASA]

  • Fix AstAssignW conversion (#5991) (#5992). [Ryszard Rozak, Antmicro Ltd.]

  • Fix const-bit-op-tree with single-bit masks (#5993) (#5998). [Yutetsu TAKATSUKASA]

  • Fix arithmetic right-shift by constants over 32 bits (#5994). [Zhen Yan]

  • Fix array bounds checking with class member selects (#5996) (#5997). [Krzysztof Starecki]

  • Fix checking for too-wide divide and modulus (#6003) (#6006). [Zhen Yan]

  • Fix folding of LteS in DfgPeephole (#6000) (#6004). [Geza Lore]

  • Fix slicing of AstExprStmt nodes (#6005). [Ryszard Rozak, Antmicro Ltd.]

  • Fix skipped generate blocks in toggle coverage (#6010). [Ryszard Rozak, Antmicro Ltd.]

  • Fix arithmetic left-shift by constants over 32 bits (#6007) (#6015). [Zhen Yan]

  • Fix concatenation and type casting (#6012) (#6013). [Todd Strader]

  • Fix wrong optimization result of shifted out variable (#6016) (#6019). [Yutetsu TAKATSUKASA]

  • Fix missing FreeBSD include (#6027) (#6028). [Joel Bodenmann]

  • Fix associative arrays with enum keys (#6034) (#6035). [Petr Nohavica]

  • Fix GCC 10 read-only linker error (#6040). [Todd Strader]

  • Fix WIDTHCONCAT on packed pattern assignment (#6045). [Dan Petrisko]

  • Fix type operator for interface signals (#6049) (#6050). [Todd Strader]

  • Fix V3OrderParallel scoring contraction hang (#6052). [Bartłomiej Chmiel, Antmicro Ltd.]

  • Fix virtual interface array typedef expressions (#6057).

  • Fix DFG peephole select conditionals (#6064) (#6071). [Geza Lore]

  • Fix &96;--skip-identical&96; skipping on some errors (#6066). [Todd Strader]

  • Fix class typedef elaboration (#6080). [Kamil Rakoczy, Antmicro Ltd.]

  • Fix unpacked to packed parameter assignment (#6081) (#6088). [Todd Strader]

  • Fix casting reals to large integrals (#6085). [Todd Strader]

  • Fix nested hier blocks workers error (#6087). [Bartłomiej Chmiel, Antmicro Ltd.]

  • Fix &96;--lib-create&96; with double-underscore (#6099).

  • Fix DFG binToOneHot table index missing driver (#6100). [Geza Lore]

  • Fix decoding octal string escapes with 1-2 digits (#6108).

  • Fix colon-divide operator without space (#6121). [Alex Solomatnikov]

  • Fix variables declared in fork after taskify (#6126). [Kamil Rakoczy, Antmicro Ltd.]

  • Fix method calls without parenthesis (#6127). [Alex Solomatnikov]

  • Fix &96;pre_randomize&96;/&96;post_randomize&96; when no randomize (#6128). [Alex Solomatnikov]

  • Fix wide non-blocking assignment mis-optimization (#6150) (#6152) (#6155). [Todd Strader]

  • Fix interface array connections with non-zero low declaration index.

  • Fix developer build error on MacOS/Flex2.6.4 (#6153). [Paul Swirhun]

  • Fix crash with --dumpi-V3LinkDot without --debug (#6159). [Igor Zaworski, Antmicro Ltd.]

  • Fix dereferencing stale iterator in DfgVertex::scopep() (#6225) (#6227). [Geza Lore]

  • Fix component numbers of new Vertices in V3DfgBreakCycles (#6225) (#6228). [Geza Lore]

Verilator 5.036 2025-04-27

Important:

  • Change &96;--output-groups&96; to default to value of &96;--build-jobs&96; (#5751). Those using build farms may need to now use &96;--output-groups 0&96; or otherwise.

  • Support user-defined primitives (UDPs) (#468) (#5807) (#5936). [Zhou Shen, Krzysztof Sychla, et al]

  • Add &96;--trace-saif&96; for SAIF power traces (#5812) (#5914). [Mateusz Gancarz, Antmicro Ltd.]

Other:

  • Change &96;--trace&96; to &96;--trace-vcd&96;.

  • Support simple &96;checker&96; blocks (#4066). [Srinivasan Venkataramanan]

  • Support force/release with a variable reference (#5721) (#5810). [Bartłomiej Chmiel, Antmicro Ltd.]

  • Support constraint random for StructArray (#5805) (#5937). [Yilou Wang]

  • Support command-line overriding &96;define (#5900) (#5908). [Brian Li]

  • Support soft unions (#5912) (#5932). [Robin Heinemann]

  • Support &96;$setuphold&96; (#5884). [Krzysztof Sychla]

  • Support assigning unpacked arrays to queues (#5924) (#5928). [Brian Li]

  • Support &96;systemc_interface and related inside &96;class&96;.

  • Support class extends with arguments.

  • Add multi-thread hierarchical simulation (#2583) (#5871). [Bartłomiej Chmiel, Antmicro Ltd.]

  • Add check for &96;let&96; misused in statement context (#5733).

  • Add used language to &96;--preproc-resolve&96; output (#5795). [Kamil Rakoczy, Antmicro Ltd.]

  • Add &96;--make json&96; to enable integration with non-make/cmake build systems (#5799). [Andrew Voznytsa]

  • Add numactl-like automatic assignment of processor affinity (#5911).

  • Add ccache support for generated cmake files (#5926) (#5930). [Andrew Voznytsa]

  • Add visualization of multi-threaded waiting time with verilator_gantt (#5929). [Bartłomiej Chmiel, Antmicro Ltd.]

  • Add suggesting isolate_assignments to UNOPTFLAT (#5942). [John Khoo]

  • Add profiling of hierarchical mtasks with verilator_gantt (#5956). [Bartłomiej Chmiel, Antmicro Ltd.]

  • Add empty veriuser.h for legacy compatibility.

  • Add DEPRECATED warning on &96;--xml-only&96; and &96;--xml-output&96;.

  • Remove unused gtkwave/wavealloca.h. [Geza Lore]

  • Optimize automatic splitting of some packed variables (#5843). [Geza Lore]

  • Optimize trigger vector in whole words (#5857). [Geza Lore]

  • Fix parameters referencing interface fields (#1593) (#5910). [Ryszard Rozak, Antmicro Ltd.]

  • Fix interface array assignments (#5270) (#5633) (#5869). [Nick Brereton]

  • Fix change detection at time 0 (#5499) (#5864). [Geza Lore]

  • Fix foreach of associative array inside a constraint block (#5727) (#5841). [Yilou Wang]

  • Fix reset of automatic function variables (#5747). [Augustin Fabre]

  • Fix invalid code motion over branches (#5811) (#5814). [Geza Lore]

  • Fix sorting of wide SenItems (#5816). [Geza Lore]

  • Fix tcmalloc static link and non-22.04 builds (#5817) (#5818). [Geza Lore]

  • Fix error on out-of-range lvalue part select (#5820).

  • Fix UNOPTFLAT warnings with &96;--coverage-trace&96; and always_comb (#5821).

  • Fix function locals in SenExprBuilder (#5822). [Geza Lore]

  • Fix type_id package scope resolution (#5826). [Krzysztof Bieganski, Antmicro Ltd.]

  • Fix &96;rand_mode&96; method with cast (#5831).

  • Fix invalidating variable caches in SenExprBulider (#5834) (#5835). [Geza Lore]

  • Fix assignment pattern as function argument (#5839).

  • Fix checking built-in method arguments (#5839).

  • Fix splitting of packed ports with non-zero based ranges (#5842). [Geza Lore]

  • Fix delays inside interface functions, and classes inside interfaces (#5846).

  • Fix NBA shared flag reuse (#5848). [Geza Lore]

  • Fix multiple expression coverage issues (#5849 partial) (#5867) (#5870). [Todd Strader]

  • Fix unresolved typedefs as parameters (#5850). [Eugene Feinberg, Brian Li]

  • Fix removal of callbacks no longer in current list (#5851) (#5852). [Gilberto Abram]

  • Fix segmentation fault on member compare (#5853).

  • Fix recursive error on virtual interfaces (#5854). [Yilou Wang]

  • Fix streaming of unpacked arrays concatenations (#5856). [Ryszard Rozak, Antmicro Ltd.]

  • Fix Windows paths in Perl (#5858) (#5860). [Tobias Jensen]

  • Fix algorithm header portability in V3Os.cpp (for std::replace) (#5861). [William D. Jones]

  • Fix &96;$fscanf&96; not returning -1 on EOF (#5881).

  • Fix PGO profiling for multi-threaded hierarchical scenarios (#5888). [Bartłomiej Chmiel, Antmicro Ltd.]

  • Fix V3Gate assertion on eliminated circular logic (#5889) (#5898). [Geza Lore]

  • Fix process comparisons (#5896).

  • Fix ccache with clang (#5899). [Geza Lore]

  • Fix delayed assignment malformed LHS assertion (#5904).

  • Fix segfault in fork synchronization (#5906). [Krzysztof Bieganski, Antmicro Ltd.]

  • Fix &96;new this&96; (#5909).

  • Fix assignments with stream expressions and unpacked arrays (#5915). [Ryszard Rozak, Antmicro Ltd.]

  • Fix LATCH warning for automatic variables (#5918). [Yutetsu TAKATSUKASA]

  • Fix %% on elaboration severity tasks (#5922). [Ethan Sifferman]

  • Fix port default values with &96;--coverage-line&96; creating &96;0=0&96; (#5920). [Drew Ranck]

  • Fix vlSelf error on fork repeats (#5927). [Drew Ranck]

  • Fix missing C++ regeneration when Verilog files are updated (#5934). [Zhouyi Shen]

  • Fix stream expressions (#5938). [Ryszard Rozak, Antmicro Ltd.]

  • Fix packed selection using over 32-bit index (#5957).

Verilator 5.034 2025-02-24

Important:

  • This is likely the last version to support Ubuntu 20.04, which is at end-of-life.

  • Add expression coverage (#4677) (#5719). [Todd Strader]

Other:

  • Add &96;COVERIGN&96; warning, as a more specific UNSUPPORTED error.

  • Add &96;--public-ignore&96; to ignore public metacomments (#5716). [Andrew Nolte]

  • Add &96;--preproc-token-limit&96; (#5768). [Krzysztof Bieganski, Antmicro Ltd.]

  • Add lint error on importing package within a class (#5634) (#5679). [Nick Brereton]

  • Add &96;--preproc-resolve&96; for modules in preprocessor output (#5789). [Kamil Rakoczy, Antmicro Ltd.]

  • Support multidimensional array access via VPI (#2812) (#5573). [Krzysztof Starecki]

  • Support nested classes (#4178) (#5778). [Kamil Rakoczy, Antmicro Ltd.]

  • Support VPI array accessors (#5612). [Moubarak Jeje]

  • Support unpacked structure constrained randomization (#5657) (#5759). [Yilou Wang]

  • Support generated classes (#5665). [Shou-Li Hsu]

  • Support constraints on associative array user-defined keys (#5671) (#5729). [Yilou Wang]

  • Support &96;+incdir&96; with multiple directories.

  • Support integer atom type ports in &96;--hierarchical&96; (#5748). [Bartłomiej Chmiel, Antmicro Ltd.]

  • Support constrained random for arrays in structs (#5765) (#5802). [Yilou Wang]

  • Support selects on arbitrary string expressions (#5773). [Krzysztof Bieganski, Antmicro Ltd.]

  • Support side effects of form 'variable[index_function()]++'.

  • Improve hierarchical DPI wrapper scheduling performance (#2583) (#5734). [Bartłomiej Chmiel, Antmicro Ltd.]

  • Improve VPI write errors (#5712). [Andrew Nolte]

  • Improve &96;resetall support (#5728) (#5730). [Ethan Sifferman]

  • Optimize labels as final &96;if&96; block statements (#5744).

  • Optimize empty function definition bodies (#5750).

  • Optimize splitting trigger computation and dump (#5798). [Geza Lore]

  • Optimize some DFG multiplexers (#6822). [Yangyu Chen]

  • Fix error message when call task as a function (#3089). [Matthew Ballance]

  • Fix force VPI public signal visibility (#5225). [Frédéric Requin]

  • Fix VPI iteration over hierarchy (#5314) (#5731). [Natan Kreimer]

  • Fix constrained random for > 64-bit associative arrays (#5670) (#5682). [Yilou Wang]

  • Fix mis-optimizing away &96;$urandom&96; (#5703). [Parker Schless]

  • Fix packages with &96;--public-depth 1&96; (#5708). [Andrew Nolte]

  • Fix V3Simulate constant reuse (#5709). [Geza Lore]

  • Fix man pages what-is section (#5710). [Ahmed El-Mahmoudy]

  • Fix pattern assignment to real inside struct (#5713).

  • Fix %p format output for real inside struct (#5713).

  • Fix segfault when only enum value referenced in package (#5714). [Dan Katz]

  • Fix &96;BLKSEQ&96; on suspendable processes (#5722). [Krzysztof Bieganski, Antmicro Ltd.]

  • Fix vpiDefName issues with non-inlined scopes and dpi conflicts (#5732). [Andrew Nolte]

  • Fix inlined expression with assignment under LHS of NBA (#5736) (#5740). [Geza Lore]

  • Fix duplicate-named class variable equivalence (#5737).

  • Fix &96;-j&96; ignored after &96;-f&96; (#5749). [Luca Colagrande]

  • Fix handling forced assigns in V3Life (#5757). [Bartłomiej Chmiel, Antmicro Ltd.]

  • Fix VFileContent reference count (#5769) (#5771). [Dave Sargeant]

  • Fix ignoring joins in stringify in preprocessor (#5777). [Krzysztof Bieganski, Antmicro Ltd.]

  • Fix unpacked split_var (#5782) (#5785). [Yutetsu TAKATSUKASA]

  • Fix time import error on time parameters (#5786). [Luca Colagrande]

  • Fix dpi context functions (#5788). [Ryszard Rozak, Antmicro Ltd.]

  • Fix &96;$monitor&96; with dotted references (#5794). [Ahmed Elzeftawi]

  • Fix parsing input wire with default and range (#5800). [RJ Cunningham]

  • Fix matching language extension options including dots.

Verilator 5.032 2025-01-01

Minor:

  • Support queue's assignment &96;push_back/push_front('{})&96; (#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 &96;default disable iff&96; and &96;$inferred_disable&96; (#4016). [Srinivasan Venkataramanan]

  • Support &96;extern constraint&96; and &96;pure constraint&96;.

  • Add &96;--no-std-waiver&96; and default reading of standard lint waivers file (#5607).

  • Add &96;--no-std-package&96; as subset-alias of &96;--no-std&96; (#5607).

  • Add &96;lint_off --contents&96; in configuration files (#5606).

  • Add &96;--waiver-multiline&96; for context-sensitive &96;--waiver-output&96; (#5608).

  • Add &96;--fno-inline-funcs&96; to disable function inlining.

  • Add &96;--fno-slice&96; to disable array assignment slicing (#5644).

  • Add error on illegal enum base type (#3010). [Iztok Jeras]

  • Add error on &96;wait&96; with missing &96;.triggered&96; (#4457).

  • Add error when improperly storing to parameter (#5147). [Gökçe Aydos]

  • Add error on illegal &96;--prefix&96; etc. values (#5507). [Fabian Keßler]

  • Add error on &96;--savable --timing&96; (#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 &96;solve before&96; or soft constraints of &96;randc&96; 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 &96;function fork...join_none&96; 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 &96;rand&96; 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 &96;randomize..with&96; of parameterized classes (#5676). [Ryszard Rozak, Antmicro Ltd.]

  • Fix interface bracketed array parameter access (#5677) (#5678). [Todd Strader]

  • Fix width extension of operands of &96;inside&96; 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 &96;-output-groups&96; to build with concatenated .cpp files (#5257). [Mariusz Glebocki]

  • Self-tests have been converted to Python, run &96;{test_name}.py&96; instead of &96;{test_name}.pl&96;.

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 &96;--main&96; and &96;--binary&96; 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 &96;wor&96;, &96;trior&96;, &96;wand&96;, &96;triand&96; (#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 &96;[]&96; (#5421). [Krzysztof Bieganski, Antmicro Ltd.]

  • Support named event locals (#5422). [Krzysztof Bieganski, Antmicro Ltd.]

  • Support basic &96;dist&96; 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 &96;local&96; and &96;protected&96; on &96;typedef&96; (#5460).

  • Support unconstrained randomization for associative array and queue (#5515). [Yilou Wang]

  • Support &96;rand&96; 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 &96;$fatal&96; to not be affected by &96;+verilator+error+limit&96; (#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 &96;foreach&96; in &96;if&96; in constraints (#5408). [Krzysztof Bieganski, Antmicro Ltd.]

  • Fix queue &96;[$-i]&96; select as reference argument (#5411). [Krzysztof Bieganski, Antmicro Ltd.]

  • Fix &96;pre&96;/&96;post_randomize&96; on &96;randomize() with&96; (#5412). [Krzysztof Bieganski, Antmicro Ltd.]

  • Fix capturing params in &96;randomize() with&96; (#5416) (#5418). [Krzysztof Bieganski, Antmicro Ltd.]

  • Fix &96;sformatf&96; 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 &96;foreach&96; 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 &96;--binary&96; 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 &96;-j&96; option without argument in hierarchical Verilation (#5514). [Ryszard Rozak, Antmicro Ltd.]

  • Fix &96;foreach&96; 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 &96;--x-assign&96; (#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 &96;$countbits&96; 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 &96;$assertcontrol&96; assertion_type (#5236). [Bartłomiej Chmiel, Antmicro Ltd.]

  • Support conditional constraints (#5245). [Arkadiusz Kozdra, Antmicro Ltd.]

  • Support&96;--compiler-include&96; headers in user-supplied cpp files (#5271). [Bartłomiej Chmiel, Antmicro Ltd.]

  • Support &96;rand_mode&96; (#5273). [Krzysztof Bieganski, Antmicro Ltd.]

  • Support &96;this.randomize with&96; (#5282). [Arkadiusz Kozdra, Antmicro Ltd.]

  • Support foreach constraints (#5302). [Arkadiusz Kozdra, Antmicro Ltd.]

  • Support &96;parameter type&96; 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 &96;constraint_mode&96; (#5338). [Krzysztof Bieganski, Antmicro Ltd.]

  • Support constraining AstSel (#5344). [Arkadiusz Kozdra, Antmicro Ltd.]

  • Support default value on module input (#5358) (#5373). [Drew Ranck]

  • Add &96;--compiler-include&96; for additional C++ includes (#5139) (#5202). [Bartłomiej Chmiel, Antmicro Ltd.]

  • Add &96;--emit-accessors&96; (#5182) (#5227). [Ryan Ziegler]

  • Add suggestions on misspelled PLI functions.

  • Add warning on dist in constraints (#5264). [Arkadiusz Kozdra, Antmicro Ltd.]

  • Add more &96;rand_mode&96; unsupported errors (#5329). [Krzysztof Bieganski, Antmicro Ltd.]

  • Add parsing but otherwise ignore std::randomize (#5354). [Arkadiusz Kozdra, Antmicro Ltd.]

  • Add Verilated cc define when &96;--timing&96; used (#5383). [Kaleb Barrett]

  • Improve emitted code to use a reference for VlSelf (#5254). [Yangyu Chen]

  • Fix monitor block sensitivity items (#4040) (#4400) (#5294). [Udaya Raj Subedi]

  • Fix fusing macro arguments to not ignore whitespace (#5061). [Tudor Timi]

  • Fix optimized-out sensitivity trees with &96;--timing&96; (#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 &96;--x-assign&96; to be independent from &96;+verilator+rand+reset&96; (#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 &96;--main-top-name -&96; (#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 &96;rand&96; 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 &96;randomize() with&96; (#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 &96;$psprintf&96; 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 &96;inout&96; 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 &96;--localize-max-size&96; 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 &96;--pins-sc-uint-bool&96; 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 &96;$system&96; with string argument (#5042).

  • Fix width extension on delays (#5043).

  • Fix &96;$typename&96; on array.min and others (#5049). [Gökçe Aydos]

  • Fix &96;make $(info)&96; 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 &96;$typename&96; 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 &96;--x-assign unique&96; (#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 &96;--quiet&96; or &96;+verilator+quiet&96; 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 &96;UNUSEDLOOP&96; 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 &96;--prof-exec&96; 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 &96;unique {}&96; constraints missing semicolon (#5001).

  • Fix preprocessor to respect strings in joins (#5007).

  • Fix tracing class parameters (#5014).

  • Fix memory leaks (#5016). [Geza Lore]

  • Fix &96;$readmem&96; 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 &96;repeat&96; in &96;fork-join&96; (#5456).

Verilator 5.022 2024-02-24

Minor:

  • Add predicted stack overflow warning (#4799).

  • Add &96;+verilator+coverage+file&96; runtime option.

  • Add &96;--assert-case&96; option (#4919). [Yutetsu TAKATSUKASA]

  • Add &96;--decorations node&96; for inserting debug comments into emitted code.

  • Add &96;--json-only&96; and related JSON dumping (#4715) (#4831). [Szymon Gizler, Antmicro Ltd.]

  • Add &96;--[no]-stop-fail&96; option for continuing after assertions (#4904). [Yutetsu TAKATSUKASA]

  • Add &96;--runtime-debug&96; for Verilated executable runtime debugging.

  • Add &96;--valgrind&96; switch (#4828). [Szymon Gizler]

  • Add &96;unroll_disable&96; and &96;unroll_full&96; loop control metacomments (#3260). [Jiaxun Yang]

  • Remove deprecated 32-bit pointer mode (&96;gcc -m32&96;).

  • 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 &96;--main&96;.

  • Support dumping DFG patterns with &96;--stats&96; (#4889). [Geza Lore]

  • Support &96;vpiConstType&96; in &96;vpi_get_str()&96; (#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 &96;this&96; 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 &96;vpi_get()&96; and &96;vpi_get64()&96; 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 &96;pragma protect version&96; (#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 &96;iff&96; 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 &96;V3Fork&96; stage to run only if &96;--timing&96; 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 &96;line 2 on resumed file.

Verilator 5.016 2023-09-16

Minor:

  • Add prepareClone and atClone APIs for Verilated models (#3503) (#4444). [Yinan Xu]

  • Add check for conflicting options e.g. binary and lint-only (#4409). [Ethan Sifferman]

  • Add --no-trace-top to not trace top signals (#4412) (#4422). [Frans Skarman]

  • Support recursive function calls (#3267).

  • Support assignments of packed values to stream expressions on queues (#4401). [Ryszard Rozak, Antmicro Ltd]

  • Support no-parentheses calls to static methods (#4432). [Krzysztof Boroński]

  • Support block_item_declaration in forks (#4455). [Krzysztof Boroński]

  • Support assignments of stream expressions on queues to packed values (#4458). [Ryszard Rozak, Antmicro Ltd]

  • Support function non-constant default arguments (#4470).

  • Support 'let'.

  • Optimize Verilator executable size by refactoring error reporting routines (#4446). [Anthony Donlon]

  • Optimize Verilation runtime pointers and graphs (#4396) (#4397) (#4398). [Krzysztof Bieganski, Antmicro Ltd]

  • Optimize preparations towards multithreaded Verilation (#4291) (#4463) (#4476) (#4477) (#4479). [Kamil Rakoczy, Antmicro Ltd]

  • Fix Windows filename format, etc (#3873) (#4421). [Anthony Donlon].

  • Fix t_dist_cppstyle Perl performance issue (#4085). [Srinivasan Venkataramanan]

  • Fix using type in parameterized classes without #() (#4281) (#4440). [Anthony Donlon]

  • Fix false INFINITELOOP on forever..mailbox.get() (#4323). [Srinivasan Venkataramanan]

  • Fix data type of condition operation on class objects (#4345) (#4352). [Ryszard Rozak, Antmicro Ltd]

  • Fix variables mutated under fork..join_none/join_any blocks into anonymous objects (#4356). [Krzysztof Boroński]

  • Fix V3CUse, do not consider implementations (.cpp) at all (#4386). [Krzysztof Boroński]

  • Fix ++/-- under statements (#4399). [Aleksander Kiryk, Antmicro Ltd]

  • Fix detection of mixed blocking and nonblocking assignment in nested assignments (#4404). [Ryszard Rozak, Antmicro Ltd]

  • Fix jumping over object initialization (#4411). [Krzysztof Boroński]

  • Fix multiple issues towards short circuit support (#4413) (#4460). [Ryszard Rozak, Antmicro Ltd]

  • Fix variable lifetimes in extern methods (#4414). [Krzysztof Boroński]

  • Fix multiple function definitions in V3Sched (#4416). [Hennadii Chernyshchyk]

  • Fix false UNUSEDPARAM on generate localparam (#4427). [Bill Pringlemeir]

  • Fix checking for parameter and port connections in the wrong place (#4428). [Anthony Donlon]

  • Fix coroutine handle movement during queue manipulation (#4431). [Aleksander Kiryk, Antmicro Ltd]

  • Fix nested assignments on the LHS (#4435). [Ryszard Rozak, Antmicro Ltd]

  • Fix false MULTITOP on bound interfaces (#4438). [Alex Solomatnikov]

  • Fix internal error on real conversion (#4447). [vdhotre-ventana]

  • Fix lifetime unknown error on enum.name (#4448). [Johan Wouters]

  • Fix unstable output of VHashSha256 (#4453). [Anthony Donlon]

  • Fix static cast from a stream type (#4469) (#4485). [Ryszard Rozak, Antmicro Ltd]

  • Fix error on enum with VARHIDDEN of cell (#4482). [Michail Rontionov]

  • Fix lint of case statements with enum and wildcard bits (#4464) (#4487). [Anthony Donlon]

  • Fix reference to extended class in parameterized class (#4466).

  • Fix recursive display causing segfault (#4480). [Kuoping Hsu]

  • Fix the error message when the type of ref argument is wrong (#4490). [Ryszard Rozak, Antmicro Ltd]

  • Fix display %x formatting of real.

  • Fix mis-warning on #() in classes' own functions.

  • Fix IGNOREDRETURN to not warn on void-cast static function calls.

  • Fix ZERODLY to not warn on 'wait(0)'.

Verilator 5.014 2023-08-06

Minor:

  • Deprecation planned for 32-bit pointer -m32 mode (#4268).

  • Deprecate CMake config below version 3.13 (#4389) (#4390). [Vito Gamberini]

  • Support some stream operations on queues (#4292). [Ryszard Rozak, Antmicro Ltd]

  • Support property declaration with empty parentheses (#4313) (#4317). [Anthony Donlon]

  • Support locator methods with "with" on assoc arrays (#4335). [Ryszard Rozak, Antmicro Ltd]

  • Support string replication with variable (#4341). [Aleksander Kiryk, Antmicro Ltd]

  • Support more types in wait (#4374). [Aleksander Kiryk, Antmicro Ltd]

  • Support static method calls as default values of function arguments (#4378). [Ryszard Rozak, Antmicro Ltd]

  • Add GENUNNAMED lint warning. [Srinivasan Venkataramanan, Deepa Palaniappan]

  • Add MISINDENT lint warning for misleading indentation.

  • Fix 'VlForkSync' redeclaration (#4277). [Krzysztof Bieganski, Antmicro Ltd]

  • Fix processes that can outlive their parents (#4253). [Krzysztof Boronski, Antmicro Ltd]

  • Fix duplicate fork names (#4295). [Ryszard Rozak, Antmicro Ltd]

  • Fix splitting coroutines (#4297) (#4307). [Jiamin Zhu]

  • Fix error when multiple duplicate DPI exports (#4301).

  • Fix class reference assignment checking (#4296). [Ryszard Rozak, Antmicro Ltd]

  • Fix handling of ref types in initial values of type parameters (#4304). [Ryszard Rozak, Antmicro Ltd]

  • Fix comparison of string parameters (#4308). [Ryszard Rozak, Antmicro Ltd]

  • Fix state update for always processes (#4311). [Aleksander Kiryk, Antmicro Ltd]

  • Fix multiple edge timing controls in class methods (#4318) (#4320) (#4344). [Krzysztof Bieganski, Antmicro Ltd]

  • Fix implicit calls of base class constructors with optional arguments (#4319). [Ryszard Rozak, Antmicro Ltd]

  • Fix propagation of process requirement (#4321). [Krzysztof Boroński]

  • Fix unhandled overloads in V3InstrCount (#4324). [Krzysztof Boroński]

  • Fix selects of static members (#4326). [Ryszard Rozak, Antmicro Ltd]

  • Fix references to members of results of static methods (#4327). [Ryszard Rozak, Antmicro Ltd]

  • Fix unique..with method on queues of class objects (#4328). [Ryszard Rozak, Antmicro Ltd]

  • Fix queue slicing (#4329). [Aleksander Kiryk, Antmicro Ltd]

  • Fix wildcard referring types (#4336) (#4342). [Aleksander Kiryk, Antmicro Ltd]

  • Fix comparison of class objects (#4346). [Ryszard Rozak, Antmicro Ltd]

  • Fix unexpected RefDType on assoc arrays (#4337). [Aleksander Kiryk, Antmicro Ltd]

  • Fix cmake astgen for Rocky Linux 8.7 (#4343). [Julian Daube]

  • Fix class timescale in class packages (#4348). [Krzysztof Bieganski, Antmicro Ltd]

  • Fix string concatenations (#4354). [Ryszard Rozak, Antmicro Ltd]

  • Fix unlinked task error from broken context (#4355) (#4402). [Aleksander Kiryk, Antmicro Ltd]

  • Fix selects on unpacked structs (#4359). [Ryszard Rozak, Antmicro Ltd]

  • Fix select operation on assoc array with wide keys (#4360). [Ryszard Rozak, Antmicro Ltd]

  • Fix non-public methods with wide output (#4364). [Ryszard Rozak, Antmicro Ltd]

  • Fix handling of super.new calls (#4366). [Ryszard Rozak, Antmicro Ltd]

  • Fix assign to input var in methods (#4367). [Aleksander Kiryk, Antmicro Ltd]

  • Fix VlProcess not found (#4368). [Aleksander Kiryk, Antmicro Ltd]

  • Fix order of evaluation of function calls in statements (#4375). [Ryszard Rozak, Antmicro Ltd]

  • Fix config_build.h issues (#4380) (#4381). [Andrew Miloradovsky]

Verilator 5.012 2023-06-13

Major:

  • With -j or --build-jobs, multithread Verilator's emit phase of Verilation. [Kamil Rakoczy, Antmicro Ltd] Additional Verilator-internal stages will become multithreaded over time.

Minor:

  • Add --main-top-name option for C main TOP name (#4235) (#4249). [Don Williamson]

  • Add creating __inputs.vpp file with --debug (#4177). [Tudor Timi]

  • Add NEWERSTD warning when using feature in newer language standard (#4168) (#4172). [Ethan Sifferman]

  • Add warning that timing controls in DPI exports are unsupported (#4238). [Krzysztof Bieganski, Antmicro Ltd]

  • Support std::process class (#4212). [Aleksander Kiryk, Antmicro Ltd]

  • Support inside expressions with strings and doubles (#4138) (#4139). [Krzysztof Boroński]

  • Support get_randstate/set_randstate class method functions.

  • Support for condition operator on class objects (#4214). [Ryszard Rozak, Antmicro Ltd]

  • Support array max (#4275). [Aleksander Kiryk, Antmicro Ltd]

  • Optimize VPI callValueCbs (#4155). [Hennadii Chernyshchyk]

  • Configure for faster C++ linking using 'mold', if it is installed.

  • Fix crash on duplicate imported modules (#3231). [Robert Balas]

  • Fix false WIDTHEXPAND on array declarations (#3959). [Jose Tejada]

  • Fix marking overridden methods as coroutines (#4120) (#4169). [Krzysztof Bieganski, Antmicro Ltd]

  • Fix SystemC signal copy macro use (#4135). [Josep Sans]

  • Fix duplicate static names in blocks in functions (#4144) (#4160). [Stefan Wallentowitz]

  • Fix initialization order of initial static after function/task (#4159). [Kamil Rakoczy, Antmicro Ltd]

  • Fix linking AstRefDType if it has parameterized class ref (#4164) (#4170). [Ryszard Rozak, Antmicro Ltd]

  • Fix crash caused by $display() optimization (#4165) (#4166). [Tudor Timi]

  • Fix arrays of unpacked structs (#4173). [Risto Pejašinović]

  • Fix $fscanf of decimals overflowing variables (#4174). [Ahmed El-Mahmoudy]

  • Fix super.new missing data type (#4147). [Tudor Timi]

  • Fix missing class forward declarations (#4151). [Krzysztof Boroński]

  • Fix hashes of instances of parameterized classes (#4182). [Ryszard Rozak, Antmicro Ltd]

  • Fix forced assignments that override non-continuous assignments (#4183) (#4192). [Krzysztof Bieganski, Antmicro Ltd]

  • 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 tracing undefined alignment (#4201) (#4288) [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 bit selections under parameterized classes (#4210). [Ryszard Rozak, Antmicro Ltd]

  • Fix duplicate std:: declaration with -I (#4215). [Harald Pretl]

  • Fix deep traversal of class inheritance timing (#4216). [Krzysztof Boroński]

  • Fix class parameters of enum types (#4219). [Ryszard Rozak, Antmicro Ltd]

  • Fix static methods with prototypes (#4220). [Ryszard Rozak, Antmicro Ltd]

  • Fix LATCH warning on function local variables (#4221) (#4284) [Julien Margetts]

  • Fix VCD scope types (#4227) (#4282). [Àlex Torregrosa]

  • Fix incorrect multi-driven lint warning (#4231) (#4248). [Adrien Le Masle]

  • Fix missing assignment for wide unpacked structs (#4233). [Jiamin Zhu]

  • Fix unpacked struct == and != operators (#4234) (#4240). [Risto Pejašinović]

  • Fix AstStructSel clean when data type is structure (#4241) (#4244). [Risto Pejašinović]

  • Fix function calls in with statements (#4245). [Ryszard Rozak, Antmicro Ltd]

  • Fix operator == for unpacked struct, if elements are VlUnpacked arrays (#4247). [Risto Pejašinović]

  • Fix STATIC lifetime for variables created from clocking items (#4262). [Krzysztof Boroński]

  • Fix names of foreach blocks (#4264). [Ryszard Rozak, Antmicro Ltd]

  • Fix iterated variables in foreach loops to have VAUTOM lifetimes (#4265). [Krzysztof Boroński]

  • Fix missing assignment for wide class members (#4267). [Jiamin Zhu]

  • Fix the global uses timing flag when forks exist (#4274). [Krzysztof Bieganski, Antmicro Ltd]

  • Fix struct redefinition (#4276). [Aleksander Kiryk, Antmicro Ltd]

  • Fix detection of wire/reg duplicates.

  • Fix false IMPLICITSTATIC on package functions.

  • Fix method calls on function return values.

Verilator 5.010 2023-04-30

Minor:

  • Add --public-depth to force public to a certain instance depth (#3952). [Andrew Nolte]

  • Add --public-params flag (#3990). [Andrew Nolte]

  • Add CONSTRAINTIGN warning when constraint ignored.

  • Add STATICVAR warning and convert to automatic (#4018) (#4027) (#4030). [Ryszard Rozak, Antmicro Ltd]

  • Add error if class types don't match (#4064). [Ryszard Rozak, Antmicro Ltd]

  • Support class extends of package::class.

  • Support class srandom and class random stability.

  • Support class method calls without parenthesis (#3902) (#4082). [Srinivasan Venkataramanan]

  • Support method calls without parenthesis (#4034). [Ryszard Rozak, Antmicro Ltd]

  • Support parameterized return types of methods (#4122). [Ryszard Rozak, Antmicro Ltd]

  • Support parameterized class references in extends statement (#4146). [Ryszard Rozak, Antmicro Ltd]

  • Support complicated IEEE 'for' assignments.

  • Support $fopen as an expression.

  • Support ++/-- on dotted member variables.

  • Optimize static trigger evaluation (#4142). [Geza Lore, X-EPIC]

  • Optimize more xor trees (#4071). [Yutetsu TAKATSUKASA]

  • Change range order warning from LITENDIAN to ASCRANGE (#4010). [Iztok Jeras]

  • Change ZERODLY to a warning.

  • Fix random internal crashes (#666). [Dag Lem]

  • Fix install, standardization in cmake CMakeLists.txt (#3974). [Yu-Sheng Lin]

  • Fix UNDRIVEN warning seg fault (#3989). [Felix Neumärker]

  • Fix symbol entries when inheriting classes (#3995) (#3996). [Krzysztof Boroński]

  • Fix event controls reusing same variable (#4014). Kamil Rakoczy <krakoczy@antmicro.com>

  • Fix push to dynamic queue in struct (#4015). [ezchi]

  • Fix names for blocks in do..while loop (#4019). [Ryszard Rozak, Antmicro Ltd]

  • Fix randomize on null field (#4023). [Ryszard Rozak, Antmicro Ltd]

  • Fix rand fields in base classes (#4025). [Ryszard Rozak, Antmicro Ltd]

  • Fix large return blocks with --comp-limit-blocks (#4028). [tenghtt]

  • Fix clocking block scope internal error (#4032). [Srinivasan Venkataramanan]

  • Fix false LATCH warning on --assert 'unique else if' (#4033) ($4054). [Jesse Taube]

  • Fix characters from DEFENV literals for Conda (#4035) (#4044). [Tim Snyder]

  • Fix info message prints under --assert (#4036) (#4053). [Srinivasan Venkataramanan]

  • Fix C++ compile errors when passing class refs as task argument (#4063). [Krzysztof Bieganski, Antmicro Ltd]

  • Fix NBAs inside fork-joins (#4050). [Aleksander Kiryk, Antmicro Ltd]

  • Fix task calls as fork statements (#4055). [Krzysztof Bieganski, Antmicro Ltd]

  • Fix _Vilp used before declaration (#4057) (#4062). [Josep Sans]

  • Fix incorrect optimization of bit op tree (#4059) (#4070). [Yutetsu TAKATSUKASA]

  • Fix parameters in a class body to be localparam (#4061). [Ryszard Rozak, Antmicro Ltd]

  • Fix interface generate begin (#4065). [Srinivasan Venkataramanan]

  • Fix tracing with awaits at end of block (#4075) (#4076). [Krzysztof Bieganski, Antmicro Ltd]

  • Fix sense expression variable naming (#4081). [Kamil Rakoczy]

  • Fix importing symbols from base class (#4084). [Ryszard Rozak, Antmicro Ltd]

  • Fix false error on new const assignment (#4098). [Tudor Timi]

  • Fix unpacked structs under classes (#4102). [Tudor Timi]

  • Fix variables in class methods to be automatic (#4111) (#4137). [Peter Monsson]

  • Fix to use parallel build for projects with a lot of files (#4116). [Krzysztof Boroński]

  • Fix including __Syms header in generated C++ files (#4123). [Krzysztof Boroński]

  • Fix systemc namespace issues (#4126) (#4127). [Eyck Jentzsch]

  • Fix class param extends A=B (#4128). [Ryszard Rozak, Antmicro Ltd]

  • Fix missing begin block hierarchy in --xml-only cells section (#4129) (#4133). [Risto Pejašinović]

  • Fix resolution of class lvalues after parameterization (#4131). [Krzysztof Boroński]

  • Fix DFG error on $countbits (#4101) (#4143). [Paul Donahue]

  • Fix duplicating parameter class types (#4115). [Ryszard Rozak, Antmicro Ltd]

  • Fix class extend param references (#4136). [Ryszard Rozak, Antmicro Ltd]

  • Fix -CFLAGS to allow overriding optimization levels (#4140). [Peter Monsson]

  • Fix DPI function type alias (#4148) (#4149). [Toru Niina]

  • Fix deleting unused parameterized classes (#4150). [Ryszard Rozak, Antmicro Ltd]

  • Fix false ENUMVALUE on expressions and arrays.

  • Fix unnecessary verilated_std.sv waivers in --waiver-output.

Verilator 5.008 2023-03-04

Minor:

  • Add --annotate-points option, change multipoint on line reporting (#3876). [Nassim Corteggiani]

  • Add --verilate-jobs option (#3889). [Kamil Rakoczy, Antmicro Ltd]

  • Add WIDTHEXPAND and WIDTHTRUNC warnings to replace WIDTH (#3900). [Andrew Nolte]

  • Add SOURCE_DATE_EPOCH for docs/guide/conf.py (#3918). [Larry Doolittle]

  • Add /verilator public[flat|flat_rd|flat_rw| ]/ metacomments (#3894). [Joseph Nwabueze]

  • Add lint warning on always_comb multidriven (#3888) (#3939). [Adam Bagley]

  • Add warning on ++/-- over expressions with potential side effects (#3976). [Krzysztof Boroński]

  • Add error on mixing .name and by-port instantiations.

  • Removed deprecated --cdc option.

  • Support unpacked unions.

  • Support interface classes and class implements.

  • Support global clocking and $global_clock.

  • Support class parameters without initial values.

  • Support cast to numbers from strings.

  • Support struct I/O in --lib-create (#3378) (#3892). [Varun Koyyalagunta]

  • Support function calls without parenthesis (#3903) (#3902). [Ryszard Rozak, Antmicro Ltd]

  • Support class extending its parameter (#3904). [Ryszard Rozak, Antmicro Ltd]

  • Support static function variables (#3830). [Ryszard Rozak, Antmicro Ltd]

  • Support recursive methods (#3987). [Ryszard Rozak, Antmicro Ltd]

  • Fix real parameters of infinity and NaN.

  • Fix pattern assignment to unpacked structs (#3510). [Mostafa Garnal]

  • Fix single-element replication to dynarray/unpacked/queue (#3548). [Gustav Svensk]

  • Fix constant enum methods (#3621). [Todd Strader]

  • Fix inconsistent naming of generate scope arrays (#3840). [Andrew Nolte]

  • Fix namespace fallback resolution (#3863) (#3942). [Aleksander Kiryk, Antmicro Ltd]

  • Fix std:: to be parsed first (#3864) (#3928). [Aleksander Kiryk, Antmicro Ltd]

  • Fix cmake warning if multiple SOURCES w/o PREFIX (#3916) (#3927). [Yoda Lee]

  • Fix parameterized class function linkage (#3917). [Ryszard Rozak]

  • Fix static members of type aliases of a parameterized class (#3922). [Ryszard Rozak, Antmicro Ltd]

  • Fix class extend parameter dot case (#3926). [Ryszard Rozak, Antmicro Ltd]

  • Fix MsWin missing directory exception, and ::std (#3928) (#3933) (#3935). [Kritik Bhimani]

  • Fix very long VPI signal names (#3929). [Marlon James]

  • Fix VPI upper interface scopes not found (#3937). [David Stanford]

  • Fix virus detection false positive (#3944). [Stuart Morris]

  • Fix constant string function assignment (#3945). [Todd Strader]

  • Fix constant format field widths (#3946). [Todd Strader]

  • Fix class field linking when a super classes is a param (#3949). [Ryszard Rozak, Antmicro Ltd]

  • Fix CMake bad C identifiers (#3948) (#3951). [Zixi Li]

  • Fix build on HP PA architecture (#3954). [John David Anglin]

  • Fix date on the front page of verilator.pdf (#3956) (#3957). [Larry Doolittle]

  • Fix associative arrays declared with ref type (#3960). [Ryszard Rozak, Antmicro Ltd]

  • Fix missing error on negative replicate (#3963). [Benjamin Menküc]

  • Fix self references to parameterized classes (#3962). [Ryszard Rozak, Antmicro Ltd]

  • Fix LITENDIAN warning is backwards (#3966) (#3967). [Cameron Kirk]

  • Fix subsequent parameter declarations (#3969). [Ryszard Rozak, Antmicro Ltd]

  • Fix timing delays to not truncate below 64 bits (#3973) (#3982). [Felix Neumärker]

  • Fix cmake on MacOS to mark weak symbols with -U linker flag (#3978) (#3979). [Peter Debacker]

  • Fix UNDRIVEN warning seg fault (#3989). [Felix Neumärker]

  • Fix coverage of class methods (#3998). [Tim Paine]

  • Fix packed array structure replication.

  • Fix enum.next(0) and enum.prev(0).

Verilator 5.006 2023-01-22

Minor:

  • Support clocking blocks (#3674). [Krzysztof Bieganski, Antmicro Ltd]

  • Support unpacked structs (#3802). [Aleksander Kiryk, Antmicro Ltd]

  • Support Windows-native builds using cmake (#3814). [Kritik Bhimani]

  • Support p format for UnpackArray (#3877). [Aleksander Kiryk, Antmicro Ltd]

  • Support property calls without parenthesis (#3879) (#3893). [Ryszard Rozak, Antmicro Ltd]

  • Support import/export lists in modport (#3886). [Gökçe Aydos]

  • Support class queue equality (#3895). [Ilya Barkov]

  • Support type case and type equality comparisons.

  • Add IMPLICITSTATIC warning when a task/function is implicitly static (#3839). [Ryszard Rozak, Antmicro Ltd]

  • Add VL_VALUE_STRING_MAX_WORDS override (#3869). [Andrew Nolte]

  • Optimize expansion of extend operators.

  • Internal multithreading tests. [Mariusz Glebocki, et al, Antmicro Ltd]

  • Fix VPI one-time timed callbacks (#2778). [Marlon James, et al]

  • Fix initiation of function variables (#3815). [Dan Gisselquist]

  • Fix to zero possibly uninitialized bits in replications (#3815).

  • Fix crash in DFT due to width use after free (#3817) (#3820). [Jevin Sweval]

  • Fix signed/unsigned comparison compile warning (#3822). [Kamil Rakoczy]

  • Fix OS-X weak symbols with -U linker flag (#3823). [Jevin Sweval]

  • Fix wrong bit op tree optimization (#3824) (#3825). [Yutetsu TAKATSUKASA]

  • Fix self references when param class instantiated (#3833). [Ryszard Rozak, Antmicro Ltd]

  • Fix memory leak in V3Sched, etc. (#3834). [Geza Lore]

  • Fix compatibility with musl libc / Alpine Linux (#3845). [Sören Tempel]

  • Fix empty case items crash (#3851). [Rich Porter]

  • Fix VL_CPU_RELAX on MIPS/Armel/s390/sparc (#3843) (#3891). [Kamil Rakoczy]

  • Fix module parameter name collision (#3854) (#3855). [James Shi]

  • Fix unpacked array expansion (#3861). [Joey Liu]

  • Fix signed/unsigned parameter types (#3866). [James Shi]

  • Fix chain call of abstract class constructor (#3868) (#3883). [Ilya Barkov]

  • Fix to use same std in Verilator and Verilated compile (#3881). [Kamil Rakoczy, Antmicro Ltd]

  • Fix foreach unnamedblk duplicate error (#3885). [Ilya Barkov]

  • Fix elaboration of member selected classes (#3890). [Ilya Barkov]

  • Fix mismatched widths in DFG (#3872). [Geza Lore, Yike Zhou]

  • Fix lint for non-integral types in packed structs.

  • Fix generate case with empty body statements.

Verilator 5.004 2022-12-14

Major:

  • Support named properties (#3667). [Ryszard Rozak, Antmicro Ltd]

  • Add ENUMVALUE warning when value misused for enum (#726) (#3777) (#3783).

  • Deprecate --no-threads; use --threads 1 for single threaded (#3703). [Kamil Rakoczy, Antmicro Ltd]

Minor:

  • Support std::semaphore and typed std::mailbox (#3708). [Krzysztof Bieganski, Antmicro Ltd]

  • Support 'with' in unique, unique_index, min, max in queues (#3772). [Ryszard Rozak, Antmicro Ltd]

  • Support events in VCD/FST traces (#3759). [Yves Mathieu]

  • Support foreach loops on strings (#3760). [Ryszard Rozak, Antmicro Ltd]

  • Support member selects in with clauses (#3775). [Ryszard Rozak, Antmicro Ltd]

  • Support super.new calls (#3789). [Ryszard Rozak, Antmicro Ltd]

  • Support randcase.

  • Support pre_randomize and post_randomize.

  • Support $timeunit and $timeprecision.

  • Support assignment expressions.

  • Change ENDLABEL from warning into an error.

  • Internal AST improvements, also affect XML format (#3721). [Geza Lore]

  • Deprecate verilated_fst_sc.cpp and verilated_vcd_sc.cpp.

  • Disable stack size limit (#3706) (#3751). [Mariusz Glebocki]

  • Add error when use --exe with --lib-create (#3785). [Yinan Xu]

  • Fix jump handling in do while loops (#3731). [Ryszard Rozak, Antmicro Ltd]

  • Fix 'with' clause handling in functions (#3739). [Ryszard Rozak, Antmicro Ltd]

  • Fix CONTEXT compile error on MingW (#3741). [William D. Jones]

  • Fix MSVC compiler errors (#3742) (#3746). [Kritik Bhimani]

  • Fix CASEINCOMPLETE when covers all enum values (#3745) (#3782). [Guy-Armand Kamendje]

  • Fix return type of $countbits functions to int (#3725). [Ryszard Rozak, Antmicro Ltd]

  • Fix timing control in while-break loops (#3733) (#3769). [Ryszard Rozak, Antmicro Ltd]

  • Fix return in constructors (#3734). [Ryszard Rozak, Antmicro Ltd]

  • Fix missing UNUSED warnings with --coverage (#3736). [alejandro-castro-ortegon]

  • Fix tracing parameters overridden with -G (#3723). [Iztok Jeras]

  • Fix folding of LogAnd with non-bool operands (#3726). [Geza Lore]

  • Fix DFG optimization issues (#3740) (#3771). [Geza Lore]

  • Fix pre/postincrement operations (#3744) (#3756). [Ryszard Rozak, Antmicro Ltd]

  • Fix cross-compile for MingW, Arm and RISC-V (#3752). [Miodrag Milanović]

  • Fix $unit as base package for other packages (#3755). [Ryszard Rozak, Antmicro Ltd]

  • Fix make jobserver with submakes (#3758). [Gus Smith]

  • Fix to escape VERILATOR_ROOT file paths (#3764) (#3765). [Jiacheng Qian]

  • Fix empty string literals converting to string types (#3774). [miree]

  • Fix to remove $date from .vcd files (#3779). [Larry Doolittle]

  • Fix missing user objects in --lib-create mode (#3780) (#3784). [Yinan Xu]

  • Fix non-blocking assignments in forks (#3781) (#3800). [Krzysztof Bieganski, Antmicro Ltd]

  • Fix forks without any delayed statements (#3792) (#3801). [Krzysztof Bieganski, Antmicro Ltd]

  • Fix internal error in bit op tree optimization (#3793). [Yutetsu TAKATSUKASA]

  • Fix lint_off EOFNEWLINE in .vlt files (#3796). [Andrew Nolte]

  • Fix wait 0.

  • Fix comparing ranged slices of unpacked arrays.

Verilator 5.002 2022-10-29

Major:

  • This is a major new release.

  • Require C++20 for the new --timing features. Upgrading to a C++20 or newer compiler is strongly recommended.

  • Support the Active and NBA scheduling regions as defined by the SystemVerilog standard (IEEE 1800-2017 chapter 4). This means all generated clocks are now simulated correctly (#3278, #3384). [Geza Lore, Shunyao CAD]

  • Support timing controls (delays, event controls in any location, wait statements) and forks. [Krzysztof Bieganski, Antmicro Ltd] This may require adding --timing or --no-timing. See docs for details.

  • Introduce a new combinational logic optimizer (DFG), that can yield significant performance improvements on some designs. [Geza Lore, Shunyao CAD]

  • Add --binary option as alias of --main --exe --build --timing (#3625). For designs where C++ was only used to make a simple no-I/O testbench, we recommend abandoning that C++, and instead letting Verilator build it with --binary (or --main).

Minor:

  • Split UNUSED warning into genvar, param, and signal warnings (#3607). [Topa Topino]

  • Support standalone 'this' in classes (#2594) (#3248) (#3675). [Arkadiusz Kozdra, Antmicro Ltd]

  • Support tristate select/extend (#3604). [Ryszard Rozak, Antmicro Ltd>

  • Support linting for top module interfaces (#3635). [Kanad Kanhere]

  • Support virtual interfaces (#3654). [Arkadiusz Kozdra, Antmicro Ltd]

  • Support class type params without defaults (#3693). [Krzysztof Bieganski, Antmicro Ltd]

  • Support empty generate_regions (#3695). [mpb27]

  • Support access to constructs inside type parameters (#3702). [Arkadiusz Kozdra, Antmicro Ltd]

  • Add --dump-tree-dot to enable dumping Ast Tree .dot files (#3636). [Marcel Chang]

  • Add --get-supported to determine what features are in Verilator.

  • Add error on real edge event control.

  • Fix false LATCH warning on 'unique if' (#3088). [Rachit Nigam]

  • Fix cell assigning integer array parameters (#3299). [Michael Platzer]

  • Fix LSB error on --hierarchical submodules (#3539). [danbone]

  • Fix $display of fixed-width numbers (#3565). [Iztok Jeras]

  • Fix foreach and pre/post increment in functions (#3613). [Nandu Raj]

  • Fix linker errors in user-facing timing functions (#3657). [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 deadlock in timeprecision when using SystemC (#3707). [Kamil Rakoczy, Antmicro Ltd]

  • Fix width mismatch on inside operator (#3714). [Àlex Torregrosa]

Verilator 4.228 2022-10-01

Announcement:

  • The next release is anticipated to premiere Verilator Version 5. Please consider beta-testing the github 'develop-v5' branch, which will soon merge into the github 'master' branch (#3383).

Minor:

  • Support some IEEE signal strengths (#3601) (#3629). [Ryszard Rozak, Antmicro Ltd]

  • Add --main to generate main() C++ (previously was experimental only).

  • Add --build-jobs, and rework arguments for -j (#3623). [Kamil Rakoczy]

  • Rename --bin to --build-dep-bin.

  • Rename debug flags --dumpi-tree, --dumpi-graph, etc. [Geza Lore]

  • Fix thread safety in SystemC VL_ASSIGN_SBW/WSB (#3494) (#3513). [Mladen Slijepcevic]

  • Fix crash in gate optimization of circular logic (#3543). [Bill Flynn]

  • Fix arguments in non-static method call (#3547) (#3582). [Gustav Svensk]

  • Fix default --mod-prefix when --prefix is repeated (#3603). [Geza Lore]

  • Fix calling trace() after open() segfault (#3610) (#3627). [Yu-Sheng Lin]

  • Fix typedef'ed class conversion to Boolean (#3616). [Aleksander Kiryk]

  • Fix Verilation speed when disabled warnings (#3632). [Kamil Rakoczy, Antmicro Ltd]

Verilator 4.226 2022-08-31

Minor:

  • Add --future0 and --future1 options.

  • Support class parameters (#2231) (#3541). [Arkadiusz Kozdra, Antmicro Ltd]

  • Support wildcard index associative arrays (#3501). [Arkadiusz Kozdra, Antmicro Ltd]

  • Support negated properties (#3572). [Aleksander Kiryk]

  • Support $test$plusargs(expr) (#3489).

  • Rename trace rolloverSize() (#3570).

  • Improve Verilation speed with --threads on large designs. [Geza Lore]

  • Improve Verilation memory by reducing V3Number (#3521). [Mariusz Glebocki, Antmicro Ltd]

  • Fix struct pattern assignment (#2328) (#3517). [Mostafa Gamal]

  • Fix public combo propagation issues (#2905). [Todd Strader]

  • Fix incorrect tristate logic (#3399) [shareefj, Vighnesh Iyer]

  • Fix incorrect bit op tree optimization (#3470). [algrobman]

  • Fix bisonpre for MSYS2 (#3471).

  • Fix max memory usage (#3483). [Kamil Rakoczy, Antmicro Ltd]

  • Fix empty string arguments to display (#3484). [Grulfen]

  • Fix table optimizing away display (#3488). [Stefan Post]

  • Fix unique_ptr memory header for MinGW64 (#3493).

  • Fix $dump system task with --output-split-cfuncs (#3495) (#3497). [Varun Koyyalagunta]

  • Fix wrong bit op tree optimization (#3509). [Nathan Graybeal]

  • Fix nested default assignment for struct pattern (#3511) (#3524). [Mostafa Gamal]

  • Fix sformat string incorrectly cleared (#3515) (#3519). [Gustav Svensk]

  • Fix segfault exporting non-existent package (#3535).

  • Fix void-cast queue pop_front or pop_back (#3542) (#3364). [Drew Ranck]

  • Fix case statement comparing string literal (#3544). [Gustav Svensk]

  • Fix === with some tristate constants (#3551). [Ryszard Rozak, Antmicro Ltd]

  • Fix converting classes to string (#3552). [Arkadiusz Kozdra, Antmicro Ltd]

  • Fix --hierarchical with order-based pin connections (#3583) (#3585). [Kelin9298]

Verilator 4.224 2022-06-19

Major:

  • VCD tracing is now parallelized with --threads (#3449). [Geza Lore, Shunyao CAD]

Minor:

  • Add -f<optimization> options to replace -O<letter> options (#3436).

  • Changed --no-merge-const-pool to -fno-merge-const-pool (#3436).

  • Changed --no-decoration to remove output whitespace (#3460). [Kamil Rakoczy]

  • Support compile time trace signal selection with tracing_on/off (#3323). [Shunyao CAD]

  • Support non-ANSI interface port declarations (#3439). [Geza Lore, Shunyao CAD]

  • Support concat assignment to packed array (#3446).

  • Improve conditional merging optimization (#3125). [Geza Lore, Shunyao CAD]

  • Define VM_TRACE_VCD when tracing in VCD format. [Geza Lore, Shunyao CAD]

  • Add assert when VerilatedContext is mis-deleted (#3121). [Rupert Swarbrick]

  • Internal prep work towards timing control. [Krzysztof Bieganski, Antmicro Ltd]

  • Fix hang with large case statement optimization (#3405). [Mike Urbach]

  • Fix UNOPTFLAT warning from initial static var (#3406). [Kamil Rakoczy]

  • Fix compile error when enable VL_LEAK_CHECKS (#3411). [HungMingWu]

  • Fix cmake rules to support higher-level targets (#3377) (#3386). [Martin Stadler]

  • Fix BLKANDNBLK on $readmem/$writemem (#3379). [Alex Solomatnikov]

  • Fix 'with' operator with type casting (#3387). [xiak95]

  • Fix incorrect conditional merging (#3409). [Raynard Qiao]

  • Fix passing VL_TRACE_FST_WRITER_THREAD in CMake build. [Geza Lore, Shunyao CAD]

  • Fix compile error under strict C++11 mode (#3463). [Kevin Kiningham]

  • Fix public unpacked input ports (#3465). [Todd Strader]

Verilator 4.222 2022-05-02

Minor:

  • Split --prof-threads into --prof-exec and --prof-pgo (#3365). [Geza Lore, Shunyao CAD]

  • Deprecate 'vluint64_t' and similar types (#3255).

  • Raise error on assignment to const in initial blocks. [Geza Lore, Shunyao CAD]

  • Issue INITIALDLY/COMBDLY/BLKSEQ warnings consistent with Verilator execution. [Geza Lore, Shunyao CAD]

  • Support LoongArch ISA multithreading (#3353) (#3354). [Xi Zhang]

  • Fix MSVC localtime_s (#3124).

  • Fix Bison 3.8.2 error (#3366). [elike-ypq]

  • Fix rare bug in -Oz (V3Localize) (#3286). [Geza Lore, Shunyao CAD]

  • Fix tracing interfaces inside interfaces (#3309). [Kevin Millis]

  • Fix filenames with dots overwriting debug .vpp files (#3373).

  • Fix including VK_USER_OBJS in make library (#3370) (#3382). [Julien Margetts]

  • Fix hang in generate symbol references (#3391) (#3398). [Yoda Lee]

  • Fix missing #include <memory> (#3392). [Aliaksei Chapyzhenka]

  • Fix crash in recursive module inlining (#3393). [david-sawatzke]

  • Fix --protect-ids mangling names of library methods. [Geza Lore, Shunyao CAD]

  • Fix foreach segmentation fault (#3400). [Kamil Rakoczy]

Verilator 4.220 2022-03-12

Minor:

  • Removed the deprecated lint_off flag -msg; use -rule instead.

  • Removed the deprecated "fl" attribute in XML output; use "loc" attribute instead.

  • Suppress WIDTH warning on negate using carry bit (#3295). [Peter Monsson]

  • Add trace dumpvars() call for selective runtime tracing (#3322). [Shunyao CAD]

  • Add VERILATOR_VERSION_INTEGER for determining API (#3343). [Larry Doolittle]

  • Improve various V3Combine algorithm details (#3328). [Yutetsu TAKATSUKASA]

  • Improve various V3Order algorithm details. [Geza Lore]

  • Fix MacOS arm64 build (#3285) (#3291). [Guokai Chen]

  • Fix signed number operation (#3294) (#3308). [Raynard Qiao]

  • Fix FST traces to include vector range (#3296) (#3297). [Jamie Iles]

  • Fix skipping public enum values with four-state values (#3303).

  • Fix $readmem file not found to be warning not error (#3310). [Alexander Grobman]

  • Fix class stringification on wide arrays (#3312). [Iru Cai]

  • Fix $fscanf etc to return -1 on EOF (#3313). [Jose Tejada]

  • Fix public function arguments that are arrayed (#3316). [pawel256]

  • Fix unnamedblk error on foreach (#3321). [Aliaksei Chapyzhenka]

  • Fix crash in recursive module inlining (#3324). [Larry Doolittle]

  • Fix VL_RESTORER behavior on passing a lvalue reference (#3326). [HungMingWu]

  • Fix compile error with --trace-fst --sc (#3332). [leavinel]

  • Fix cast to array types (#3333). [Todd Strader]

  • Fix Vdeeptemp error with --threads and --compiler clang (#3338). [Per Karlsson]

Verilator 4.218 2022-01-17

Major:

  • Primary inputs and outputs (VL_INW/VL_OUTW) now use VlWide type. In general this should be backward compatible, but may lead to some wrapper code needing changes.

  • Option --cdc is deprecated and is planned for removal, file a bug if this is still being used.

Minor:

  • Support class static members (#2233).

  • Support force/release (#2431) (#2593). [Shunyao CAD]

  • Add 'forceable' attribute to allow forcing from C++ (#3272). [Geza Lore, Shunyao CAD]

  • Support lower dimension looping in foreach loops (#3172). [Ehab Ibrahim]

  • Support up to 64 bit enums for .next/.prev/.name (#3244). [Alexander Grobman]

  • Reduce .rodata footprint of trace initialization (#3250). [Geza Lore, Shunyao CAD]

  • Support FST tracing in hierarchical Verilation (#3251). [Yutetsu TAKATSUKASA]

  • Use C++11 standard types for MacOS portability (#3254) (#3257). [Adrien Le Masle]

  • Fix make support for BSD ar (#2999) (#3256). [Julie Schwartz]

  • Fix bad ending address on $readmem (#3205). [Julie Schwartz]

  • Fix MSWIN compile error (#2681). [Unai Martinez-Corral]

  • Fix break under foreach loop (#3230).

  • Fix VL_STREAML_FAST_QQI with 64 bit left-hand-side (#3232) (#3235). [Adrien Le Masle]

  • Fix $sformat of inputs/outputs (#3236). [Adrien Le Masle]

  • Fix associative array first method as statement (#3228). [Adrien Le Masle]

  • Fix associative array foreach loop (#3229).

  • Fix $fclose not accepting expressions (#3237). [Julie Schwartz]

  • Fix $random not updating seed (#3238). [Julie Schwartz]

  • Fix top level param overwrite when package has same param (#3241) (#3247). [Adrien Le Masle]

  • Fix spurious UNUSED by ignoring inout pin connections (#3242). [Julie Schwartz]

  • Fix splitting of _eval and other top level functions. [Geza Lore, Shunyao CAD]

  • Fix internal error by inout port (#3258). [Yutetsu TAKATSUKASA]

  • Fix GCC 11 compile error (#3273). [HungMingWu]

Verilator 4.216 2021-12-05

Major:

  • Add --lib-create, similar to --protect-lib but without protections.

  • Support tracing through --hierarchical/--lib-create libraries (#3200).

Minor:

  • Internal code cleanups and improvements. [Geza Lore]

  • Improve --thread Verilation-time performance.

  • Support task name in $display %m (#3211). [Julie Schwartz]

  • Make 'bit', 'logic' and 'time' types unsigned by default. [Geza Lore]

  • Optimize $random concatenates/selects (#3114).

  • Fix array method names with parenthesis (#3181) (#3183). [Teng Huang]

  • Fix split_var assign merging (#3177) (#3179). [Yutetsu TAKATSUKASA]

  • Fix wrong bit op tree optimization (#3185). [Yutetsu TAKATSUKASA]

  • Fix some SliceSels not being constants (#3186) (#3218). [Michaël Lefebvre]

  • Fix nested generate if genblk naming (#3189). [yanx21]

  • Fix hang on recursive definition error (#3199). [Jonathan Kimmitt]

  • Fix display of signed without format (#3204). [Julie Schwartz]

  • Fix display of empty string constant (#3207) (#3215). [Julie Schwartz]

  • Fix incorrect width after and-or optimization (#3208). [Julie Schwartz]

  • Fix $fopen etc on integer arrays (#3214). [adrienlemasle]

  • Fix $size on dynamic strings (#3216).

  • Fix %0 format on $value$plusargs (#3217).

  • Fix timescale portability on Arm64 (#3222).

Verilator 4.214 2021-10-17

Major:

  • Add profile-guided optimization of mtasks (#3150).

Minor:

  • Verilator_gantt has removed the ASCII graphics, use the VCD output instead.

  • Verilator_gantt now shows the predicted mtask times, eval times, and additional statistics.

  • Verilator_gantt data files now include processor information, to allow later processing.

  • Support displaying x and z in $display task (#3107) (#3109). [Iru Cai]

  • Fix verilator_profcfunc profile accounting (#3115).

  • Fix display has no time units on class function (#3116). [Damien Pretet]

  • Fix removing if statement with side effect in condition (#3131). [Alexander Grobman]

  • Fix --waiver-output for multiline warnings (#2429) (#3141). [Keith Colbert]

  • Fix internal error on bad widths (#3140) (#3145). [Zhanglei Wang]

  • Fix crash on clang 12/13 (#3148). [Kuoping Hsu]

  • 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 constructor-parameter argument comma-separation in C++ (#3162). [Matthew Ballance]

  • Fix missing install of vl_file_copy/vl_hier_graph (#3165). [Popolon]

  • Fix calling new with arguments in same class (#3166). [Matthew Ballance]

  • Fix false EOFNEWLINE warning when DOS carriage returns present (#3171).

Verilator 4.212 2021-09-01

Minor:

  • Fix re-evaluation of logic dependent on state set in DPI exports (#3091). [Geza Lore]

  • Support unpacked array localparams in tasks/functions (#3078). [Geza Lore]

  • Support timeunit/timeprecision in $unit.

  • Support assignment patterns as children of pins (#3041). [Krzysztof Bieganski, Antmicro Ltd]

  • Add --instr-count-dpi to tune assumed DPI import cost for multithreaded model scheduling. Default value changed to 200 (#3068). [Yinan Xu]

  • Output files are split based on the set of headers required in order to aid incremental compilation via ccache (#3071). [Geza Lore]

  • Parameter values are now emitted as 'static constexpr' instead of enum. C++ direct references to parameters might require updating (#3077). [Geza Lore]

  • Refactored Verilated include files; include verilated.h not verilated_heavy.h.

  • Add header guards on Dpi.h generated files (#2979). [Tood Strader]

  • Add XML ccall, constpool, initarray, and if/while begins (#3080). [Steven Hugg]

  • Add error when constant function under a generate (#3103). [Don Owen]

  • Fix -G to treat simple integer literals as signed (#3060). [Anikin1610]

  • Fix emitted string array initializers (#2895). [Iztok Jeras]

  • Fix bitop tree optimization dropping necessary & operator (#3096). [Flavien Solt]

  • Fix internal error on wide -x-initial unique (#3106). [Alexandre Joannou]

  • Fix traces to show array instances with brackets (#3092) (#3095). [Pieter Kapsenberg]

Verilator 4.210 2021-07-07

Major:

  • Generated code is now emitted as global functions rather than methods. '$c' contents might need to be updated, see the docs (#3006). [Geza Lore]

  • The generated model class instantiated by the user is now an interface object and no longer the TOP module instance. User code with direct C++ member access to model internals, including verilator public_flat items will likely need to be updated. See the manual for instructions: https://verilator.org/guide/latest/connecting.html#porting-from-pre-4-210 (#3036). [Geza Lore]

Minor:

  • Add --prof-c to pass profiling to compiler (#3059). [Alexander Grobman]

  • Optimize a lot more model variables into function locals (#3027). [Geza Lore]

  • Support middle-of-design nested top modules (#3026). [Dan Petrisko]

  • Remove deprecated --no-relative-cfuncs option (#3024). [Geza Lore]

  • Remove deprecated --inhibit-sim option (#3035). [Geza Lore]

  • Merge const static data globally into a new constant pool (#3013). [Geza Lore]

  • Allow configure override of AR program (#2999). [ahouska]

  • In XML, show pinIndex information (#2877). [errae233]

  • Fix error on unsupported recursive functions (#2957). [Trefor Southwell]

  • Fix type parameter specialization when struct names are same (#3055). [7FM]

  • Improve speed of table optimization (-OA) pass. [Geza Lore]

Verilator 4.204 2021-06-12

Minor:

  • Add 'make ccache-report' (#3011). [Geza Lore]

  • Add --reloop-limit argument (#2943) (#2960). [Geza Lore]

  • Add --expand-limit argument (#3005). [Julien Margetts]

  • Add TRACE_THREADS to CMake (#2934). [Jonathan Drolet]

  • Optimize large lookup tables to static data (#2925). [Geza Lore]

  • Optimize reloop to accept constant index offsets (#2939). [Geza Lore]

  • Split always blocks to better respect --output-split-cfuncs. [Geza Lore]

  • Support ignoring "&96;pragma protect ..." (#2886). [Udi Finkelstein]

  • Support --trace-fst for SystemC with CMake (#2927). [Jonathan Drolet]

  • Update cmake latest C++ Standard Compilation flag (#2951). [Ameya Vikram Singh]

  • Prep work towards better ccache hashing/performance. [Geza Lore]

  • Fix assertion failure in bitOpTree optimization (#2891) (#2899). [Raynard Qiao]

  • Fix DPI functions not seen as vpiModule (#2893). [Todd Strader]

  • Fix bounds check in VL_SEL_IWII (#2910). [Krzysztof Bieganski, Antmicro Ltd]

  • Fix slowdown in elaboration (#2911). [Nathan Graybeal]

  • Fix initialization of assoc in assoc array (#2914). [myftptoyman]

  • Fix make support for gmake 3.x (#2920) (#2921). [Philipp Wagner]

  • Fix VPI memory access for packed arrays (#2922). [Todd Strader]

  • Fix MCD close also closing stdout (#2931). [Alexander Grobman]

  • Fix split procedures to better respect --output-split-cfuncs (#2942). [Geza Lore]

  • Fix to emit 'else if' without nesting (#2944). [Geza Lore]

  • Fix part select issues in LATCH warning (#2948) (#2938). [Julien Margetts]

  • Fix to not emit empty files with low split limits (#2961). [Geza Lore]

  • Fix merging of assignments in C++ code (#2970). [Rupert Swarbrick]

  • Fix unused variable warnings (#2991). [Pieter Kapsenberg]

  • Fix --protect-ids when using SV classes (#2994). [Geza Lore]

  • Fix constant function calls with uninitialized value (#2995). [yanx21]

  • Fix Makefiles to support Windows EXEEXT usage (#3008). [Miodrag Milanovic]

Verilator 4.202 2021-04-24

Major:

  • Documentation has been rewritten into a book format.

  • Verilated signals now use VlWide and VlPacked in place of C arrays.

Minor:

  • Add an URL on warnings to point to the manual's description.

  • Add EOFNEWLINE warning when missing a newline at EOF.

  • Changed TIMESCALEMOD from error into a warning.

  • Mark --no-relative-cfuncs as scheduled for deprecation.

  • Add --coverage-max-width (#2853). [xuejiazidi]

  • Add VerilatedCovContext::forcePerInstance (#2793). [Kevin Laeufer]

  • Add FST SystemC tracing (#2806). [Àlex Torregrosa]

  • Add PINNOTFOUND warning in place of error (#2868). [Udi Finkelstein]

  • Support overlaps in priority case statements (#2864). [Rupert Swarbrick]

  • Support for null ports (#2875). [Udi Finkelstein]

  • Fix class unpacked-array compile error (#2774). [Iru Cai]

  • Fix scope types in FST and VCD traces (#2805). [Àlex Torregrosa]

  • Fix exceeding command-line ar limit (#2834). [Yinan Xu]

  • Fix false $dumpfile warning on model save (#2834). [Yinan Xu]

  • Fix --timescale-override not suppressing TIMESCALEMOD (#2838). [Kaleb Barrett]

  • Fix false TIMESCALEMOD on generate-ignored instances (#2838). [Kaleb Barrett]

  • Fix --output-split with class extends (#2839). [Iru Cai]

  • Fix false WIDTHCONCAT on casted constant (#2849). [Rupert Swarbrick]

  • Fix tracing of long hashed names (#2854). [Graham Rushton]

  • Fix --public-flat-rw / DPI issue (#2858). [Todd Strader]

  • Fix interface localparam access (#2859). [Todd Strader]

  • Fix Cygwin example compile issues (#2856). [Mark Shaw]

  • Fix select of with index variable (#2880). [Alexander Grobman]

  • Fix cmake version number to be numeric (#2881). [Yuri Victorovich]

  • Fix MinGW not supporting 'localtime_r' (#2882). [HyungKi Jeong]

  • Fix cast from packed, typedef'ed interface signal (#2884). [Todd Strader]

  • Fix VPI package reported as vpiModule (#2885). [Todd Strader]

  • Fix dumping waveforms to multiple FST files (#2889). [David Metz]

  • Fix assertion failure in bitOpTree (#2892). [Yutetsu TAKATSUKASA]

  • Fix V3Premit infinite loop on always read-and-write (#2898). [Raynard Qiao]

  • Fix VPI packed vectors (#2900). [Todd Strader]

  • Fix VPI public interface parameters (#2901). [Todd Strader]

Verilator 4.200 2021-03-12

Announcement:

  • --inhibit-sim is planned for deprecation, file a bug if this is still being used.

Major:

  • Add simulation context (VerilatedContext) to allow multiple fully independent models to be in the same process. Please see the updated examples (#2660).

  • Add context->time() and context->timeInc() API calls, to set simulation time. These now are recommended in place of the legacy sc_time_stamp().

Minor:

  • Converted Asciidoc documentation into reStructuredText (RST) format.

  • Fix range inheritance on port without data type (#2753). [Embedded Go]

  • Fix slice-assign overflow (#2803) (#2811). [David Turner]

  • Fix interface array connection ordering broken in v4.110 (#2827). [Don Owen]

  • Fix or-reduction on different scopes broken in 4.110 (#2828). [Yinan Xu]

  • Fix MSVC++ compile error (#2831) (#2833). [Drew Taussig]

Verilator 4.110 2021-02-25

Major:

  • Optimize bit operations and others (#2186) (#2632) (#2633) (#2751) (#2800) [Yutetsu TAKATSUKASA]

Minor:

  • Support concat selection (#2721).

  • Support struct scopes when dumping structs to VCD (#2776) [Àlex Torregrosa]

  • Generate SELRANGE for potentially unreachable code (#2625) (#2754) [Pierre-Henri Horrein]

  • For --flatten, override inlining of public and no_inline modules (#2761) [James Hanlon]

  • Fix little endian interface pin swizzling (#2475). [Don Owen]

  • Fix range inheritance on port without data type (#2753). [Embedded Go]

  • Fix TIMESCALE warnings on primitives (#2763). [Xuanqi]

  • Fix to exclude strings from toggle coverage (#2766) (#2767) [Paul Wright]

  • Fix $fread extra semicolon inside statements. [Leendert van Doorn]

  • Fix class extends with VM_PARALLEL_BUILDS (#2775). [Iru Cai]

  • Fix shifts by > 32 bit values (#2785). [qrq992]

  • Fix examples not flushing vcd (#2787). [Richard E George]

  • Fix little endian packed array pattern assignment (#2795). [Àlex Torregrosa]

Verilator 4.108 2021-01-10

Major:

  • Many VPI changes for IEEE compatibility, which may alter behavior from previous releases.

  • Support randomize() class method and rand (#2607). [Krzysztof Bieganski, Antmicro Ltd]

Minor:

  • Support $cast and new CASTCONST warning.

  • Add --top option as alias of --top-module.

  • Add LATCH and NOLATCH warnings (#1609) (#2740). [Julien Margetts]

  • Remove Unix::Processors internal test dependency.

  • Report UNUSED on parameters, localparam and genvars (#2627). [Charles Eric LaForest]

  • Add error on real to non-real output pins (#2690). [Peter Monsson]

  • Support package imports before parameters in interfaces (#2714). [James Hanlon]

  • Support --sanitize in internal tests (#2705). [Yutetsu TAKATSUKASA]

  • Fix passing parameter type instantiations by position number.

  • Fix DPI open array handling issues.

  • Fix error when dotted refers to missing module (#2095). [Alexander Grobman]

  • Fix little endian packed array counting (#2499). [phantom-killua]

  • Fix showing reference locations for BLKANDNBLK (#2170). [Yuri Victorovich]

  • Fix genblk naming to match IEEE (#2686). [tinshark]

  • Fix VPI memory word indexing (#2695). [Marlon James]

  • Fix vpiLeftRange on little-endian memories (#2696). [Marlon James]

  • Fix VPI module tree (#2704). [Todd Strader]

  • Fix vpi_release_handle to be called implicitly per IEEE (#2706).

  • Fix to allow inheriting 'VerilatedVcdFile' class (#2720). [HyungKi Jeong]

  • Fix $urandom_range maximum value (#2723). [Nandu Raj]

  • Fix tracing empty sc module (#2729).

  • Fix generate for unrolling to be signed (#2730). [yanx21]

  • Fix to emit timescale in hierarchical blocks (#2735). [Yutetsu TAKATSUKASA]

  • Fix to ignore coverage on real ports (#2741) (#2745). [Paul Wright]

Verilator 4.106 2020-12-02

Major:

  • Change -sv option to select 1800-2017 instead of 1800-2005.

Minor:

  • Check for proper 'local' and 'protected' (#2228).

  • Support $random and $urandom seeds.

  • Support $monitor and $strobe.

  • Support complex function arguments.

  • Support 'super'.

  • Support 'with item.index'.

  • Fix the default GNU Make executable name on FreeBSD (#2553). [Yuri Victorovich]

  • Fix trace signal names getting hashed (#2643). [Barbara Gigerl]

  • Fix unpacked array parameters near functions (#2639). [Anderson Ignacio da Silva]

  • Fix access to non-overridden base class variable (#2654). [Tobias Rosenkranz]

Verilator 4.104 2020-11-14

Minor:

  • Support queue and associative array 'with' statements (#2616).

  • Support queue slicing (#2326).

  • Support associative array pattern assignments and defaults.

  • Support static methods and typedefs in classes (#2615). [Krzysztof Bieganski, Antmicro Ltd]

  • Add error on typedef referencing self (#2539). [Cody Piersall]

  • With --debug, turn off address space layout randomization.

  • Fix iteration over mutating list bug in VPI (#2588). [Kaleb Barrett]

  • Fix cast width propagation (#2597). [flex-liu]

  • Fix return from callValueCbs (#2589) (#2605). [Marlon James]

  • Fix WIDTH warnings on comparisons with nullptr (#2602). [Rupert Swarbrick]

  • Fix fault when $fgets, $sscanf, etc used with string (#2604). [Yutetsu TAKATSUKASA]

  • Fix WIFEXITED missing from MinGW/MSYS2 (#2609). [Jean Berniolles]

  • Fix queue poping wrong value when otherwise unused (#2512). [nanduraj1]

  • Fix arrays of modport interfaces (#2614). [Thierry Tambe]

  • Fix split_var internal error (#2640) (#2641). [Yutetsu TAKATSUKASA]

Verilator 4.102 2020-10-15

Minor:

  • Support const object new() assignments.

  • Support # as a comment in -f files (#2497). [phantom-killua]

  • Support 'this' (#2585). [Rafal Kapuscik]

  • Support defines for FST tracing (#2592). [Markus Krause]

  • Support non-overlapping implication inside properties (#1292). [Peter Monsson]

  • Fix timescale with --hierarchical (#2554). [Yutetsu TAKATSUKASA]

  • Fix cmake build with --hierarchical (#2560). [Yutetsu TAKATSUKASA]

  • Fix -G dropping public indication (#2561). [Andrew Goessling]

  • Fix $urandom_range passed variable (#2563). [nanduraj1]

  • Fix method calls to package class functions (#2565). [Peter Monsson]

  • Fix class wide member display (#2567). [Nandu Raj P]

  • Fix hierarchical references inside function (#2267) (#2572). [James Pallister]

  • Fix flushCall for backward compatibility (#2580). [chenguokai]

  • Fix preprocessor stringify of undefined macro. [Martin Whitaker]

Verilator 4.100 2020-09-07

Major:

  • C++11 or newer compilers are now required.

  • SystemC 2.3.0 or newer (SYSTEMC_VERSION >= 20111121) is now required.

  • Support hierarchical Verilation (#2206). [Yutetsu TAKATSUKASA]

Minor:

  • Support (with limitations) class extern, class extends, virtual class.

  • Support $urandom, $urandom_range without stability.

  • Support assume property. [Peter Monsson]

  • Support non-overlapping implication inside properties (#1292). [Peter Monsson]

  • Fix false DECLFILENAME on black-boxed modules (#2430). [Philipp Wagner]

  • Fix naming of "id : begin" blocks.

  • Fix class constructor error on assignments to const.

  • Fix splitting eval functions with --output-split-cfuncs (#2368). [Geza Lore]

  • Fix queues as class members (#2525). [nanduraj1]

Verilator 4.040 2020-08-15

Announcement:

  • Version 4.040 is planned to be the final version that will support pre-C++11 compilers. Please move to C++11 or newer compilers.

Minor:

  • Fix arrayed interfaces, broke in 4.038 (#2468). [Josh Redford]

  • Support $stable, $rose and $fell (#2148) (#2501). [Peter Monsson]

  • Support simple function localparams (#2461). [James Hanlon]

  • Miscellaneous parsing error changes towards UVM support.

  • Fix arrayed interfaces (#2469). [Josh Redford]

  • Fix protect lib VCS warning (#2479). [Julien Margetts]

  • Fix combining different-width parameters (#2484). [abirkmanis]

  • Fix protect-lib without sequential logic (#2492). [Yutetsu TAKATSUKASA]

  • Fix V3Unknown from running with flat XML output (#2494). [James Hanlon]

  • Fix non-32 bit conversion to float (#2495). [dsvf]

  • Fix casting non-self-determined subexpressions (#2493). [phantom-killua]

  • Fix SystemC net names (#2500). [Edgar E. Iglesias]

  • Fix build with Bison 3.7 and newer (#2505). [Rupert Swarbrick]

  • Fix slice of unpacked array (#2506) (#2507). [Yutetsu TAKATSUKASA]

Verilator 4.038 2020-07-11

Announcement:

  • Versions 4.038 and 4.040 are planned to be the final versions that will support pre-C++11 compilers. Please move to C++11 or newer compilers.

Minor:

  • Support VPI access to parameters and localparam. [Ludwig Rogiers]

  • Support parsing (not elaboration, yet) of UVM.

  • Add new UNSUPPORTED error code to replace most previous Unsupported: messages.

  • With --bbox-unsup continue parsing on many (not all) UVM constructs.

  • Support for-loop increments with commas.

  • Support $swrite with arbitrary arguments.

  • Support $writememb (#2450). [Fan Shupei]

  • Fix OS X, Free BSD, and -m32 portability issues. [Geza Lore]

  • Fix to flush FST trace on termination due to $stop or assertion failure.

  • Fix part select error when multipling by power-of-two (#2413). [Conor McCullough]

  • Fix division exception (#2460) [Kuoping Hsu]

Verilator 4.036 2020-06-06

Major:

  • OPT_FAST is now -Os by default. See the BENCHMARKING & OPTIMIZATION part of the manual if you experience issues with compilation speed.

  • --output-split is now on by default. VM_PARALLEL_BUILDS is set by default iff the --output-split caused an actual file split to occur. --output-split-cfuncs and --output-split-ctrace now default to the value of --output-split. These changes should improve build times of medium and large designs with default options. User makefiles may require changes.

Minor:

  • Configure now enables SystemC if it is installed as a system headers, e.g. with 'apt-get install systemc-dev'.

  • Add --waiver-output flag that writes a verilator config file (.vlt) with waivers to the warnings emitted during a Verilator run.

  • Support verilator_coverage --write-info for lcov HTML reports.

  • Line Coverage now tracks all statement lines, not just branch lines.

  • The run-time library is now compiled with -Os by default (#2369, #2373).

  • Support multi channel descriptor I/O (#2190) [Stephen Henry]

  • Support $countbits (#2287). [Yossi Nivin]

  • Support $isunbounded and parameter $ (#2104).

  • Support unpacked array .sum and .product.

  • Support prefix/postfix increment/decrement (#2223). [Maciej Sobkowski]

  • Fix FST tracing of little bit endian signals. [Geza Lore]

  • Fix +: and -: on unpacked arrays (#2304). [engr248]

  • Fix $isunknown with constant Z's.

  • Fix queues and dynamic array wide ops (#2352). [Vassilis Papaefstathiou]

Verilator 4.034 2020-05-03

Major:

  • Support simplistic classes with many restrictions, see manual. (#377)

  • Support IEEE time units and time precisions. (#234) Includes &96;timescale, $printtimescale, $timeformat. VL_TIME_MULTIPLIER, VL_TIME_PRECISION, VL_TIME_UNIT have been removed and the time precision must now match the SystemC time precision. To get closer behavior to older versions, use e.g. --timescale-override "1ps/1ps".

  • Add --build to call make automatically. (#2249) [Yutetsu TAKATSUKASA]

  • Configuring with ccache present now defaults to using it; see OBJCACHE.

  • Fix DPI import/export to be standard compliant. (#2236) [Geza Lore]

  • Add --trace-threads for general multithreaded tracing. (#2269) [Geza Lore]

Minor:

  • Add --flatten for use with --xml-only. (#2270) [James Hanlon]

  • Greatly improve FST/VCD dump performance (#2244) (#2246) (#2250) (#2257) [Geza Lore]

  • Support $ferror, and $fflush without arguments. (#1638)

  • Support event data type (with some restrictions).

  • Support $root. (#2150) [Keyi Zhang]

  • Add error if use SystemC 2.2 and earlier (pre-2011) as is deprecated.

  • Add support of --trace-structs for CMake (#2986). [Martin Schmidt]

  • Fix arrayed instances connecting to slices. (#2263) [Don/engr248]

  • Fix error on unpacked connecting to packed. (#2288) [Joseph Shaker]

  • Fix logical not optimization with empty begin. (#2291) [Baltazar Ortiz]

  • Fix reduction OR on wide data, broke in v4.026. (#2300) [Jack Koenig]

  • Fix clock enables with bit-extends. (#2299) [Marco Widmer]

  • Fix MacOs Homebrew by removing default LIBS. (#2298) [Ryan Clarke]

Verilator 4.032 2020-04-04

Minor:

  • Add column numbers to errors and warnings.

  • Add GCC 9-style line number prefix when showing source text for errors.

  • Add setting VM_PARALLEL_BUILDS=1 when using --output-split. (#2185)

  • Change --quiet-exit to also suppress 'Exiting due to N errors'.

  • Suppress REALCVT for whole real numbers.

  • Support split_var in vlt files. (#2219) [Marco Widmer]

  • Fix parameter type redeclaring a type. (#2195) [hdzhangdoc]

  • Fix VCD open with empty filename. (#2198) [Julius Baxter]

  • Fix packages as enum base types. (#2202) [Driss Hafdi]

  • Fix duplicate typedefs in generate for. (#2205) [hdzhangdoc]

  • Fix MinW portability. (#2114) [Sean Cross]

  • Fix assertions with unique case inside. (#2199) [hdzhangdoc]

  • Fix implicit conversion of floats to wide integers.

Verilator 4.030 2020-03-08

Major:

  • Add split_var metacomment to assist UNOPTFLAT fixes. (#2066) [Yutetsu TAKATSUKASA]

  • Support $dumpfile and $dumpvars. (#2126) [Alexander Grobman]

  • Support dynamic arrays. (#379)

Minor:

  • Add +verilator+noassert flag to disable assertion checking. [Tobias Wölfel]

  • Add check for assertOn for asserts. (#2162) [Tobias Wölfel]

  • Add --structs-packed for forward compatibility.

  • Support $displayb/o/h, $writeb/o/h, etc. (#1637)

  • Use gcc -Os in examples instead of -O2 for better average performance.

  • Fix genblk naming with directly nested generate blocks. (#2176) [Alexander Grobman]

  • Fix undeclared VL_SHIFTR_WWQ. (#2114) [Alex Solomatnikov]

Verilator 4.028 2020-02-08

Major:

  • Support attributes (public, isolate_assignments, etc.) in configuration files.

  • Add -match to lint_off to waive warnings. [Philipp Wagner]

Minor:

  • Link Verilator binary partially statically. (#2146) [Geza Lore]

  • Verilation speed improvements (#2133) (#2138) [Geza Lore]

  • Support libgoogle-perftools-dev's libtcmalloc if available. (#2137) [Geza Lore]

  • Support $readmem/$writemem with assoc arrarys. (#2100) [agrobman]

  • Support type(expression) operator and $typename. (#1650)

  • Support left justified $display. (#2101) [Pieter Kapsenberg]

  • Support string character access via indexing.

  • Support enum.next(k) with constant k > 1. (#2125) [Tobias Rosenkranz]

  • Support parameter access from arrays of interfaces. (#2155) [Todd Strader]

  • Add parameter values in XML. #2110. [Pieter Kapsenberg]

  • Add loc column location in XML (replaces fl). (#2122) [Pieter Kapsenberg]

  • Add error on misused define. [Topa Tota]

  • Add parameter to set maximum signal width. (#2082) [Øyvind Harboe]

  • Add warning on genvar in normal for loop. (#2143) [Yuri Victorovich]

  • Fix VPI scope naming for public modules. [Nandu Raj]

  • Fix FST tracing of enums inside structs. [fsiegle]

  • Fix WIDTH warning on </<= of narrower value. (#2141) [agrobman]

  • Fix OpenSolaris issues. (#2154) [brancoliticus]

  • Fix gated clocks under --protect-lib. (#2169) [Todd Strader]

Verilator 4.026 2020-01-11

Major:

  • Docker images are now available for Verilator releases.

Minor:

  • Support bounded queues.

  • Support non-overlapping implication operator in assertions. (#2069) [Peter Monsson]

  • Support string compare, ato*, etc methods. (#1606) [Yutetsu TAKATSUKASA]

  • Support immediate cover statements.

  • Ignore &96;uselib to end-of-line. (#1634) [Frederic Antonin]

  • Update FST trace API for better performance.

  • Add vpiTimeUnit and allow to specify time as string. (#1636) [Stefan Wallentowitz]

  • Add error when &96;resetall inside module (IEEE 2017-22.3).

  • Add cleaner error on version control conflicts in sources.

  • Fix little endian cell ranges. (#1631) [Julien Margetts]

  • Fix queue issues (#1641) (#1643) [Peter Monsson, Stefan Wallentowitz]

  • Fix strcasecmp for windows. (#1651) [Kuba Ober]

  • Fix disable iff in assertions. Closes #1404. [Peter Monsson]

  • Fix huge case statement performance. Closes #1644. [Julien Margetts]

  • Fix tracing -1 index arrays. Closes #2090. [Yutetsu Takatsukasa]

  • Fix expand optimization slowing --lint-only. Closes #2091. [Thomas Watts]

  • Fix %{number}s with strings. #2093. [agrobman]

  • 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

Major:

  • Support associative arrays (excluding [*] and pattern assignments). (#544)

  • Support queues (excluding {} notation and pattern assignments). (#545)

Minor:

  • Add +verilator+error+limit to see more assertion errors. [Peter Monsson]

  • Support string.toupper and string.tolower.

  • Support $rewind and $ungetc.

  • Support shortreal as real, with a SHORTREAL warning.

  • Add -Wpedantic and -Wno-context for compliance testing.

  • Add error on redefining preprocessor directives. [Piotr Binkowski]

  • Support $value$plusargs float and shorts. (#1592) (#1619) [Garrett Smith]

  • Fix gate lvalue optimization error. (#831) [Jonathon Donaldson, Driss Hafdi]

  • Fix color assertion on empty if. (#1604) [Andrew Holme]

  • Fix for loop missing initializer. (#1605) [Andrew Holme]

  • Fix hang on concat error. (#1608) [Bogdan Vukobratovic]

  • Fix VPI timed callbacks to be one-shot, pull5. [Matthew Ballance]

  • Fix // in filenames. (#1610) [Peter Nelson]

  • Fix $display("%p") to be closer to IEEE.

  • Fix labels on functions with returns. (#1614) [Mitch Hayenga]

  • Fix false unused message on __Vemumtab. (#2061) [Tobias Rosenkranz]

  • Fix assertion on dotted parameter arrayed function. (#1620) [Rich Porter]

  • Fix interface reference tracing. (#1595) [Todd Strader]

  • Fix error on unpacked concatenations. (#1627) [Driss Hafdi]

Verilator 4.022 2019-11-10

Major:

  • Add --protect-lib. (#1490) [Todd Strader]

  • Add cmake support. (#1363) [Patrick Stewart]

Minor:

  • Examples have been renamed.

  • Add --protect-ids to obscure information in objects. (#1521) [Todd Strader]

  • Add --trace-coverage.

  • Add --xml-output.

  • Support multithreading on Windows. [Patrick Stewart]

  • Suppress 'command failed' on normal errors.

  • Support some unpacked arrays in parameters. (#1315) [Marshal Qiao]

  • Add interface port visibility in traces. (#1594) [Todd Strader]

  • Increase case duplicate/incomplete to 16 bit tables. (#1545) [Yossi Nivin]

  • Support quoted arguments in -f files. (#1535) [Yves Mathieu]

  • Optimize modulus by power-of-two constants, and masked conditionals.

  • Fix detecting missing reg types. (#1570) [Jacko Dirks]

  • Fix multithreaded yield behavior when no work. [Patrick Stewart]

  • Fix bad-syntax crashes. (#1548, #1550-#1553, #1557-#1560, #1563, #1573-#1577, #1579, #1582-#1591) [Eric Rippey]

  • Fix false CMPCONST/UNSIGNED warnings on "inside". (#1581) [Mitch Hayenga]

Verilator 4.020 2019-10-06

Minor:

  • Add --public-flat-rw. (#1511) [Stefan Wallentowitz]

  • Support $fseek, $ftell, $frewind. (#1496) [Howard Su]

  • Support vpiModule. (#1469) [Stefan Wallentowitz]

  • Make Syms file honor --output-split-cfuncs. (#1499) [Todd Strader]

  • Fix make test with no VERILATOR_ROOT. (#1494) [Ahmed El-Mahmoudy]

  • Fix error on multidimensional cells. (#1505) [Anderson Ignacio Da Silva]

  • Fix config_rev revision detection on old versions.

  • Fix false warning on backward indexing. (#1507) [Hao Shi]

  • Fix vpiType accessor. (#1509) (#1510) [Stefan Wallentowitz]

  • Fix ugly error on interface misuse. (#1525) [Bogdan Vukobratovic]

  • Fix misc bad-syntax crashes. (#1529) (#1530) (#1531) (#1532) (#1533) [Eric Rippey]

  • Fix case statements with strings. (#1536) [Philipp Wagner]

  • Fix some coverage lost when multithreaded. (#2151)

Verilator 4.018 2019-08-29

Major:

  • When showing an error, show source code and offer suggestions of replacements.

  • When showing an error, show the instance location. (#1305) [Todd Strader]

Minor:

  • Add --rr. (#1481) [Todd Strader]

  • Change MULTITOP to warning to help linting, see manual.

  • Add XSim support to driver.pl. (#1493) [Todd Strader]

  • Add --dpi-hdr-only. (#1491) [Todd Strader]

  • Show included-from filenames in warnings. (#1439) [Todd Strader]

  • Fix elaboration time errors. (#1429) [Udi Finkelstein]

  • Fix not reporting some duplicate signals/ports. (#1462) [Peter Gerst]

  • Fix not in array context on non-power-of-two slices. (#2027) [Yu Sheng Lin]

  • Fix system compile flags injection. [Gianfranco Costamagna]

  • Fix enum values not being sized based on parent. (#1442) [Dan Petrisko]

  • Fix internal error on gate optimization of assign. (#1475) [Oyvind Harboe]

Verilator 4.016 2019-06-16

Minor:

  • Add --quiet-exit. (#1436) [Todd Strader]

  • Error continuation lines no longer have %Error prefix.

  • Support logical equivalence operator <->.

  • Support VerilatedFstC set_time_unit. (#1433) [Pieter Kapsenberg]

  • Support deferred assertions. (#1449) [Charles Eddleston]

  • Mark infrequently called functions with GCC cold attribute.

  • Fix sign-compare warning in verilated.cpp. (#1437) [Sergey Kvachonok]

  • Fix fault on $realtime with %t. (#1443) [Julien Margetts]

  • Fix $display with string without %s. (#1441) [Denis Rystsov]

  • Fix parameter function string returns. (#1441) [Denis Rystsov]

  • Fix invalid XML output due to special chars. (#1444) [Kanad Kanhere]

  • Fix performance when mulithreaded on 1 CPU. (#1455) [Stefan Wallentowitz]

  • Fix type and real parameter issues (#1427) (#1456) (#1458) [Todd Strader]

  • Fix build error on MinGW. (#1460) [Richard Myers]

  • Fix not reporting some duplicate signals. (#1462) [Peter Gerst]

  • Fix --savable invalid C++ on packed arrays. (#1465) [Alex Chadwick]

  • Fix constant function return of function var. (#1467) [Roman Popov]

Verilator 4.014 2019-05-08

Minor:

  • Add --trace-fst-thread.

  • Support '#' comments in $readmem. (#1411) [Frédéric Requin]

  • Support "'dx" constants. (#1423) [Udi Finkelstein]

  • For FST tracing use LZ4 compression. [Tony Bybell]

  • Add error when use parameters without value. (#1424) [Peter Gerst]

  • Auto-extend and WIDTH warn on unsized X/Zs. (#1423) [Udi Finkelstein]

  • Fix missing VL_SHIFTL errors. (#1412) (#1415) [Larry Lee]

  • Fix MinGW GCC 6 printf formats. (#1413) [Sergey Kvachonok]

  • Fix test problems when missing fst2vcd. (#1417) [Todd Strader]

  • Fix GTKWave register warning. (#1421) [Pieter Kapsenberg]

  • Fix FST enums not displaying. (#1426) [Danilo Ramos]

  • Fix table compile error with multiinterfaces. (#1431) [Bogdan Vukobratovic]

Verilator 4.012 2019-03-23

Minor:

  • Add +verilator+seed. (#1396) [Stan Sokorac]

  • Support $fread. [Leendert van Doorn]

  • Support void' cast on functions called as tasks. (#1383) [Al Grant]

  • Add IGNOREDRETURN warning. (#1383)

  • Report PORTSHORT errors on concat constants. (#1400) [Will Korteland]

  • Fix VERILATOR_GDB being ignored. (#2017) [Yu Sheng Lin]

  • Fix $value$plus$args missing verilated_heavy.h. [Yi-Chung Chen]

  • Fix MSVC compile error. (#1406) [Benjamin Gartner]

  • Fix maintainer test when no Parallel::Forker. (#1977) [Enzo Chi]

  • Fix +1364-1995ext flags applying too late. (#1384) [Al Grant]

Verilator 4.010 2019-01-27

Minor:

  • Removed --trace-lxt2, use --trace-fst instead.

  • For --xml, add additional information. (#1372) [Jonathan Kimmitt]

  • Add circular typedef error. (#1388) [Al Grant]

  • Add unsupported for loops error. (#1986) [Yu Sheng Lin]

  • Fix FST tracing of wide arrays. (#1376) [Aleksander Osman]

  • Fix error when pattern assignment has too few elements. (#1378) [Viktor Tomov]

  • Fix error when no modules in $unit. (#1381) [Al Grant]

  • Fix missing too many digits warning. (#1380) [Jonathan Kimmitt]

  • Fix uninitialized data in verFiles and unroller. (#1385) (#1386) [Al Grant]

  • Fix internal error on xrefs into unrolled functions. (#1387) [Al Grant]

  • Fix DPI export void compiler error. (#1391) [Stan Sokorac]

Verilator 4.008 2018-12-01

Minor:

  • Support "ref" and "const ref" pins and functions. (#1360) [Jake Longo]

  • In --xml-only show the original unmodified names, and add module_files and cells similar to Verilog-Perl, msg2719. [Kanad Kanhere]

  • Add CONTASSREG error on continuous assignments to regs. (#1369) [Peter Gerst]

  • Add PROCASSWIRE error on behavioral assignments to wires, msg2737. [Neil Turton]

  • Add IMPORTSTAR warning on import::* inside $unit scope.

  • Fix --trace-lxt2 compile error on MinGW. (#1990) [HyungKi Jeong]

  • Fix hang on bad pattern keys. (#1364) [Matt Myers]

  • Fix crash due to cygwin bug in getline. (#1349) [Affe Mao]

  • Fix __Slow files getting compiled with OPT_FAST. (#1370) [Thomas Watts]

Verilator 4.006 2018-10-27

Minor:

  • Add --pp-comments. (#1988) [Robert Henry]

  • Add --dump-defines.

  • For --trace-fst, save enum decoding information. (#1358) [Sergi Granell] (To visualize enumeration data you must use GTKwave 3.3.95 or newer.)

  • For --trace-fst, combine hier information into FST. [Tony Bybell]

  • Fix --trace-lxt2 compile error on MinGW, msg2667. [HyungKi Jeong]

  • Fix Windows .exe not found. (#1361) [Patrick Stewart]

Verilator 4.004 2018-10-06

Major:

  • Add GTKWave FST native tracing. (#1356) [Sergi Granell] (Verilator developers need to pull the latest vcddiff.)

Minor:

  • Support $past. [Dan Gisselquist]

  • Support restrict. (#1350) [Clifford Wolf]

  • Rename include/lxt2 to include/gtkwave.

  • Fix replication of 64-bit signal change detects.

  • Fix Mac OSX 10.13.6 / LLVM 9.1 compile issues. (#1348) [Kevin Kiningham]

  • Fix MinGW compile issues. (#1979) [HyungKi Jeong]

Verilator 4.002 2018-09-16

Major:

  • This is a major release. Any patches may require major rework to apply. [Thanks everyone]

  • Add multithreaded model generation.

  • Add runtime arguments.

  • Add GTKWave LXT2 native tracing. (#1333) [Yu Sheng Lin]

  • Note $random has new algorithm; results may vary vs. previous versions.

Minor:

  • Better optimize large always block splitting. (#1244) [John Coiner]

  • Add new reloop optimization for repetitive assignment compression.

  • Support string.atoi and similar methods. (#1289) [Joel Holdsworth]

  • Fix internals to be C++ null-pointer-check clean.

  • Fix internals to avoid 'using namespace std'.

  • Fix Verilation performance issues. (#1316) [John Coiner]

  • Fix clocker attributes to not propagate on concats. [John Coiner]

  • Fix first clock edge and --x-initial-edge. (#1327) [Rupert Swarbrick]

  • Fix compile error on tracing of string arrays. (#1338) [Iztok Jeras]

  • Fix number parsing with newline after radix. (#1340) [George Cuan]

  • Fix string ?: conditional type resolution. (#1345) [Iztok Jeras]

  • Fix duplicate symbol error on generate tri. (#1347) [Tomas Dzetkulic]

Verilator 3.926 2018-08-22

Minor:

  • Add OBJCACHE envvar support to examples and generated Makefiles.

  • Change MODDUP errors to warnings. (#1969) [Marshal Qiao]

  • Fix define argument stringification (&96;"), broke since 3.914. [Joe DErrico]

  • Fix to ignore Unicode UTF-8 BOM sequences. (#1967) [HyungKi Jeong]

  • Fix std:: build error. (#1322)

  • Fix function inlining inside certain while loops. (#1330) [Julien Margetts]

Verilator 3.924 2018-06-12

Minor:

  • Renamed --profile-cfuncs to --prof-cfuncs.

  • Report interface ports connected to wrong interface. (#1294) [Todd Strader]

  • When tracing, use scalars on single bit arrays to appease vcddiff.

  • Fix parsing "output signed" in V2K port list, msg2540. [James Jung]

  • Fix parsing error on bad missing #. (#1308) [Dan Kirkham]

  • Fix $clog2 to be in verilog 2005. (#1319) [James Hutchinson]

Verilator 3.922 2018-03-17

Major:

  • Support IEEE 1800-2017 as default language.

Minor:

  • Support trig functions ($sin() etc). (#1281) [Patrick Stewart]

  • Support calling system functions as tasks. (#1285) [Joel Holdsworth]

  • Support assert properties. (#785) (#1290) [John Coiner, et al]

  • Support $writememh. [John Coiner]

  • Add --no-debug-leak to reduce memory use under debug. [John Coiner]

  • Fix severe runtime performance bug in certain foreach loops. [John Coiner]

  • On convergence errors, show activity. [John Coiner]

  • Fix GCC 8.0 issues. (#1273)

  • Fix pullup/pulldowns on bit selects. (#1274) [Rob Stoddard]

  • Fix verilator_coverage --annotate-min. (#1284) [Tymoteusz Blazejczyk]

  • Fix quoting of quoted arguments. [John Coiner]

Verilator 3.920 2018-02-01

Announcement:

  • Moving forward, use the git "stable" branch to track the latest release, and git "v#.###" tags for specific releases.

Minor:

  • Support 'assume' similar to 'assert'. (#1269) [Dan Gisselquist]

  • Remove c++filt. (#1265) [Stefan Wallentowitz]

  • Fix tracing example file output. (#1268) [Enzo Chi]

  • Fix gate optimization out of memory, add --gate-stmts. (#1260) [Alex Solomatnikov]

  • Fix compile error on public real parameters by suppressing. (#1261) [Alex Solomatnikov]

  • Fix input-only tristate comparisons. (#1267) [Alexis G]

  • Fix missing edge type in xml output. (#1955) [Alexis G]

  • Fix compile error with --public and interface bind. (#1264) [Alexis G]

Verilator 3.918 2018-01-02

Minor:

  • Workaround GCC/clang bug with huge compile times. (#1248)

  • Support DPI open arrays. (#909) (#1245) [David Pierce, Victor Besyakov]

  • Add INFINITELOOP warning. (#1254) [Alex Solomatnikov]

  • Support > 64 bit decimal $display.

  • Support DPI time and svLogicVal. [Victor Besyakov] Note older version incorrectly assumed svBitVal even for logicals.

  • Support string len() method. [Victor Besyakov]

  • Add error if always_comb has sensitivity list. [Arjen Roodselaar]

  • Fix SystemC 2.3.2 compile error. (#1251) [Tymoteusz Blazejczyk]

  • Fix modport outputs being treated as inputs. (#1246) [Jeff Bush]

  • Fix false ALWCOMBORDER on interface references. (#1247) [Josh Redford]

  • Fix constant propagation across DPI imports of inout strings. [Victor Besyakov]

  • Fix resolving inline nested interface names. (#1250) [Arjen Roodselaar]

  • Fix GCC false warning on array bounds. (#2386)

Verilator 3.916 2017-11-25

Minor:

  • Support self-recursive modules. (#659) [Sean Moore, et al]

  • Support $error/$warning in elaboration time blocks.

  • Support $size/$bits/etc on type references.

  • Add error when driving input-only modport. (#1110) [Trevor Elbourne]

  • Add BSSPACE and COLONPLUS lint warnings.

  • Detect MSB overflow when under VL_DEBUG. (#1238) [Junyi Xi]

  • Add data types to --xml. [Rui Terra]

  • Fix partial slicing with pattern assignments. (#991) [Johan Bjork]

  • Fix false unused warning on interfaces. (#1241) [Laurens van Dam]

  • Fix error on "unique case" with no cases.

  • Fix MacOS portability. (#1232) [Jeff Bush]

Verilator 3.914 2017-10-14

Major:

  • Add new examples/ directory with appropriate examples. This replaces the old test_c and test_sc directories.

Minor:

  • Add --getenv option for simplifying Makefiles.

  • Add --x-initial option for specifying initial value assignment behavior.

  • Add --no-relative-cfuncs and related default optimization. (#1224) [John Coiner]

  • Add /verilator tag/ for XML extraction applications. [Chris Randall]

  • The internal test_verilated test directory is moved to be part of test_regress.

  • The experimental VL_THREADED setting (only, not normal mode) now requires C++11.

  • Fix over-aggressive inlining. (#1223) [John Coiner]

  • Fix Ubuntu 17.10 issues. (#1223 partial). [John Coiner]

  • Fix compiler warning when WIDTH warning ignored on large compare.

  • Fix memory leak in VerilatedVcd dumps. (#1222 partial) [Shareef Jalloq]

  • Fix unnecessary Vdly variables. (#1224 partial) [John Coiner]

  • Fix conditional slices and add related optimizations.

  • Fix &96;&96; expansion of &96;defines. (#1225) (#1227) (#1228) [Odd Magne Reitan]

  • Fix -E duplicating output. (#1226) [Odd Magne Reitan]

  • Fix float-conversion warning. (#1229) [Robert Henry]

  • Fix MacOS portability. (#1230) (#1231) [Jeff Bush]

Verilator 3.912 2017-09-23

Major:

  • Verilated headers no longer "use namespace std;" User's code without "std::" prefixes may need "use namespace std;" to compile.

Minor:

  • Support or/and/xor array intrinsic methods. (#1210) [Michael Popoloski]

  • Support package export. (#1217) [Usuario Eda]

  • Support module port parameters without defaults. (#1213) [Michael Popoloski]

  • Add performance information to --stats file.

  • Simplify VL_CONST_W macro generation for faster compiles.

  • Optimize improvements for Shift-And, and replication constructs.

  • Fix ordering of arrayed cell wide connections. (#1202 partial) [Michael Popoloski]

  • Fix LITENDIAN warning on arrayed cells. (#1202) [Michael Popoloski]

  • Fix enum ranges without colons. (#1204) [Michael Popoloski]

  • Fix GCC noreturn compile error. (#1209) [Michael Popoloski]

  • Fix constant function default parameters. (#1211) [Michael Popoloski]

  • Fix non-colon array of interface modports. (#1212) [Michael Popoloski]

  • Fix .name connections on interfaces. (#1214) [Michael Popoloski]

  • Fix wide array indices causing compile error.

Verilator 3.910 2017-09-07

Major:

  • SystemPerl mode (-sp-deprecated) has been removed.

Minor:

  • Update keyword warnings to include C++11 and others.

Verilator 3.908 2017-08-28

Minor:

  • Support x in $readmem. (#1180) [Arthur Kahlich]

  • Support packed struct DPI imports. (#1190) [Rob Stoddard]

  • Fix GCC 6 warnings.

  • Fix compile error on unused VL_VALUEPLUSARGS_IW. (#1181) [Thomas J Whatson]

  • Fix undefined VL_POW_WWI. [Clifford Wolf]

  • Fix internal error on unconnected inouts. (#1187) [Rob Stoddard]

Verilator 3.906 2017-06-22

Minor:

  • Support set_time_unit/set_time_precision in C traces. (#1937)

  • Fix extract of packed array with non-zero LSB. (#1172) [James Pallister]

  • Fix shifts by more than 32-bit numbers. (#1174) [Clifford Wolf]

  • Fix power operator on wide constants. (#761) [Clifford Wolf]

  • Fix .* on interface pins. (#1176) [Maciej Piechotka]

Verilator 3.904 2017-05-30

Minor:

  • Fix non-cutable ordering loops on clock arrays. (#1009) [Todd Strader]

  • Support ports of array of reals. (#1154) [J Briquet]

  • Support arrayed parameter overrides. (#1153) [John Stevenson]

  • Support $value$plusargs with variables. (#1165) [Wesley Terpstra]

  • Support modport access to un-modport objects. (#1161) [Todd Strader]

  • Add stack trace when can't optimize function. (#1158) [Todd Strader]

  • Add warning on mis-sized literal. (#1156) [Todd Strader]

  • Fix interface functions returning wrong parameters. (#996) [Todd Strader]

  • Fix non-arrayed cells with interface arrays. (#1153) [John Stevenson]

  • Fix --assert with complex case statements. (#1164) [Enzo Chi]

Verilator 3.902 2017-04-02

Major:

  • Add -FI option to force includes. (#1916) [Amir Gonnen]

  • Add --relative-includes. [Rob Stoddard]

Minor:

  • Add error on duplicate pattern assignments. (#1145) [Johan Bjork]

  • Fix error on improperly widthed default function. (#984) [Todd Strader]

  • Fix 2009 localparam syntax, msg2139. [Galen Seitz]

  • Fix ugly interface-to-non-interface errors. (#1112) [Johan Bjork]

  • Fix LDFLAGS and CFLAGS not preserving order. (#1130) [Olof Kindgren]

  • Fix internal error on initializing parameter array. (#1131) [Jie Xu]

  • Fix internal error on interface arrays. (#1135) [John Stevenson]

  • Fix calling sformatf to display, and elab $displays. (#1139) [Johan Bjork]

  • Fix realpath compile issue on MSVC++. (#1141) [Miodrag Milanovic]

  • Fix missing error on interface size mismatch. (#1143) [Johan Bjork]

  • Fix error on parameters with dotted references. (#1146) [Johan Bjork]

  • Fix wreal not handling continuous assign. (#1150) [J Briquet]

  • Fix nested structure parameter selects. (#1150) [J Briquet]

Verilator 3.900 2017-01-15

Major:

  • Internal code changes for improved compatibility and performance.

Minor:

  • Support old-style $display($time). (#467) [John Demme]

  • With --bbox-unsup, suppress desassign and mixed edges. (#1120) [Galen Seitz]

  • Fix parsing sensitivity with &&. (#934) [Luke Yang]

  • Fix internal error on double-for loop unrolling. (#1044) [Jan Egil Ruud]

  • Fix internal error on unique casez with --assert. (#1117) [Enzo Chi]

  • Fix bad code when tracing array of structs. (#1122) [Andrew Bardsley]

Verilator 3.890 2016-11-25

Minor:

  • Honor --output-split on coverage constructors. (#1098) [Johan Bjork]

  • Fix various issues when making outside of the kit.

  • Fix flex 2.6.2 bug. (#1103) [Sergey Kvachonok]

  • Fix error on bad interface name. (#1097) [Todd Strader]

  • Fix error on referencing variable in parent. (#1099) [Ian Thompson]

  • Fix type parameters with low optimization. (#1101) [Stefan Wallentowitz]

Verilator 3.888 2016-10-14

Major:

  • Support foreach. (#1078) [Xuan Guo]

Minor:

  • Add --no-decoration to remove output comments, msg2015. [Frédéric Requin]

  • If VM_PARALLEL_BUILDS=1, use OPT_FAST and OPT_SLOW. [Frédéric Requin] Set VM_DEFAULT_RULES=0 for old behavior.

  • Add error on DPI functions > 32 bits. (#1898) [Elliot Mednick]

  • Improve Verilation performance on internal strings. (#1896) [Johan Bjork]

  • Improve Verilation performance on trace duplicates. (#1090) [Johan Bjork]

  • Fix SystemC compiles with VPI. (#1081) [Arthur Kahlich]

  • Fix error on wide numbers that represent shifts, msg1991. (#1088) [Mandy Xu]

Verilator 3.886 2016-07-30

Minor:

  • Fix enum values of 11-16 bits wide using .next/.prev. (#1062) [Brian Flachs]

  • Fix false warnings on non-power-2 enums using .next/.prev.

  • Fix comparison of unpacked arrays. (#1071) [Andrew Bardsley]

  • Fix compiler warning in GCC 6. [David Horton]

Verilator 3.884 2016-05-18

Major:

  • Support parameter type. (#376) [Alan Hunter, et al]

  • Support command-line -G/+pvalue param overrides. (#1045) [Stefan Wallentowitz]

  • Add --l2-name option for controlling "v" naming.

  • The default l2 scope name is now the same as the top-level module. (#1050) Use "--l2-name v" for the historical behavior.

Minor:

  • Fix --output-split of constructors. (#1035) [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 $value$plusargs to string. (#1880) [Frédéric Requin]

Verilator 3.882 2016-03-01

Minor:

  • Internal Verilation-time performance enhancements. (#1021) [Johan Bjork]

  • Support inlining interfaces. (#1018) [Johan Bjork]

  • Support SV strings to readmemh. (#1040) [Stefan Wallentowitz]

  • Fix unrolling complicated for-loop bounds. (#677) [Johan Bjork]

  • Fix stats file containing multiple unroll entries. (#1020) [Johan Bjork]

  • Fix using short parameter names on negative params. (#1022) [Duraid Madina]

  • Fix read-after-free error. (#1031) [Johan Bjork]

  • Fix elaboration-time display warnings. (#1032) [Johan Bjork]

  • Fix crash on very deep function trees. (#1028) [Jonathan Kimmitt]

  • Fix slicing mix of big and little-endian. (#1033) [Geoff Barrett]

  • Fix pattern assignment width propagation. (#1037) [Johan Bjork]

Verilator 3.880 2015-12-19

Minor:

  • Support display %u, %v, %p, %z. (#989) [Johan Bjork]

  • Fix real parameters causing bad module names. (#992) [Johan Bjork]

  • Fix size-changing cast on packed struct. (#993) [Johan Bjork]

  • Fix function calls on arrayed interface. (#994) [Johan Bjork]

  • Fix arrayed interfaces. (#879) (#1001) [Todd Strader]

  • Fix constant function assigned to packed structs. (#997) [Johan Bjork]

  • Fix interface inside generate. (#998) [Johan Bjork]

  • Fix $signed casts under generates. (#999) [Clifford Wolf]

  • Fix genvar constant propagation. (#1003) [Johan Bjork]

  • Fix parameter constant propagation from package. (#1004) [Johan Bjork]

  • Fix array slicing of non-const indexes. (#1006) [Johan Bjork]

  • Fix dotted generated array error. (#1005) [Jeff Bush, Johan Bjork]

  • Fix error instead of warning on large concat. (#1865) [Paul Rolfe]

  • Fix $bitstoreal constant propagation. (#1012) [Jonathan Kimmitt]

  • Fix model restore crash. (#1013) [Jason McMullan]

  • Fix arrayed instances to unpacked of same size. (#1015) [Varun Koyyalagunta]

  • Fix slices of unpacked arrays with non-zero LSBs.

  • Fix ternary operation with unpacked array. (#1017) [Varun Koyyalagunta].

Verilator 3.878 2015-11-01

Major:

  • Add --vpi flag, and fix VPI linkage. (#969) [Arthur Kahlich]

  • Support genvar indexes into arrayed cells. (#517) [Todd Strader]

  • Support $sformatf. (#977) [Johan Bjork]

  • Support elaboration assertions. (#973) [Johan Bjork]

  • Support $display with non-format arguments. (#467) [Jamey Hicks]

Minor:

  • Add VerilatedScopeNameMap for introspection. (#966) [Todd Strader]

  • Ignore %l in $display. (#983) [Todd Strader]

  • Fix very long module names. (#937) [Todd Strader]

  • Fix internal error on dotted refs into generates. (#958) [Jie Xu]

  • Fix structure parameter constant propagation. (#968) [Todd Strader]

  • Fix enum constant propagation. (#970) [Todd Strader]

  • Fix mis-optimizing public DPI functions. (#963) [Wei Song]

  • Fix package:scope.scope variable references.

  • Fix $fwrite to constant stderr/stdout. (#961) [Wei Song]

  • Fix struct.enum.name method calls. (#855) [Jonathon Donaldson]

  • Fix dot indexing into arrayed inferfaces. (#978) [Johan Bjork]

  • Fix crash in commandArgsPlusMatch. (#987) [Jamie Iles]

  • Fix error message on missing interface. (#985) [Todd Strader]

Verilator 3.876 2015-08-12

Minor:

  • Add tracing_on, etc to vlt files. (#932) [Frédéric Requin]

  • Support extraction of enum bits. (#951) [Jonathon Donaldson]

  • Fix MinGW compiler error. (#927) (#929) [Hans Tichelaar]

  • Fix .c files to be treated as .cpp. (#930) [Jonathon Donaldson]

  • Fix string-to-int space conversion. (#931) [Fabrizio Ferrandi]

  • Fix dpi imports inside generates. [Michael Tresidder]

  • Fix rounding in trace $timescale. (#946) [Frédéric Requin]

  • Fix $fopen with SV string. (#947) [Sven Stucki]

  • Fix hashed error with typedef inside block. (#948) [Sven Stucki]

  • Fix makefile with --coverage. (#953) [Eivind Liland]

  • Fix coverage documentation. (#954) [Thomas J Whatson]

  • Fix parameters with function parameter arguments. (#952) [Jie Xu]

  • Fix size casts as second argument of cast item. (#950) [Jonathon Donaldson]

Verilator 3.874 2015-06-06

Minor:

  • Add pkg-config .pc file. (#919) [Stefan Wallentowitz]

  • Fix installing missing manpages. (#908) [Ahmed El-Mahmoudy]

  • Fix sign extension in large localparams. (#910) [Mike Thyer]

  • Fix core dump in sync-async warnings. (#911) [Sebastian Dressler]

  • Fix truncation warning with -pins-bv. (#912) [Alfonso Martinez]

  • Fix Cygwin uint32 compile. (#914) [Matthew Barr]

  • Fix preprocessing stringified newline escapes. (#915) [Anton Rapp]

  • Fix part-select in constant function. (#916) [Andrew Bardsley]

  • Fix width extension on mis-width ports. (#918) [Patrick Maupin]

  • Fix width propagation on sized casts. (#925) [Jonathon Donaldson]

  • Fix MSVC++ compiler error. (#927) [Hans Tichelaar]

Verilator 3.872 2015-04-05

Minor:

  • Add VerilatedVcdFile to allow real-time waveforms. (#890) [HyungKi Jeong]

  • Add --clk and related optimizations. (#1840) [Jie Xu]

  • Fix order of C style arrays. [Duraid Madina]

  • Add --dump-treei-<srcfile>. (#894) [Jie Xu]

  • Fix comma-instantiations with parameters. (#884) [Franck Jullien]

  • Fix SystemC arrayed bit vectors. (#886) [David Poole]

  • Fix compile error on MinGW. (#887) [HyungKi Jeong]

Verilator 3.870 2015-02-12

Minor:

  • Suppress COMBDLY when inside always_latch. (#864) [Iztok Jeras]

  • Support cast operator with expression size. (#865) [Iztok Jeras]

  • Add warning on slice selection out of bounds. (#875) [Cong Van Nguyen].

  • Fix member select error broke in 3.868. (#867) [Iztok Jeras]

  • Fix $sccanf from string. (#866) [David Pierce]

  • Fix VM_PARALLEL_BUILDS broke in 3.868. (#870) [Hiroki Honda]

  • Fix non-ANSI modport instantiations. (#868) [Kevin Thompson]

  • Fix UNOPTFLAT change detect on multidim arrays. (#872) [Andrew Bardsley]

  • Fix slice connections of arrays to ports. (#880) [Varun Koyyalagunta]

  • Fix mis-optimizing gate assignments in unopt blocks. (#881) [Mike Thyer]

  • Fix sign extension of pattern members. (#882) [Iztok Jeras]

  • Fix clang compile warnings.

Verilator 3.868 2014-12-20

Major:

  • New verilator_coverage program added to replace SystemPerl's vcoverage.

  • PSL support was removed, please use System Verilog assertions.

  • SystemPerl mode is deprecated and now untested.

Minor:

  • Support enum.first/name and similar methods. (#460) (#848)

  • Add 'string' printing and comparisons. (#746) (#747) etc.

  • Inline C functions that are used only once. (#1838) [Jie Xu]

  • Fix tracing SystemC signals with structures. (#858) [Eivind Liland] Note that SystemC traces will no longer show the signals in the wrapper, they can be seen one level further down.

  • Add --stats-vars. (#851) [Jeremy Bennett]

  • Fix bare generates in interfaces. (#789) [Bob Newgard]

  • Fix underscores in real literals. (#863) [Jonathon Donaldson]

Verilator 3.866 2014-11-15

Minor:

  • Fix +define+A+B to define A and B to match other simulators. (#847) [Adam Krolnik]

  • Add optimization of wires from arrayed cells. (#1831) [Jie Xu]

  • Add optimization of operators between concats. (#1831) [Jie Xu]

  • Add public enums. (#833) [Jonathon Donaldson]

  • Trace_off now operates on cells. (#826) [Lane Brooks]

  • Fix public parameters in unused packages. (#804) [Jonathon Donaldson]

  • Fix select when partially out-of-bound. (#823) [Clifford Wolf]

  • Fix generate unrolling with function call. (#830) [Steven Slatter]

  • Fix cast-to-size context-determined sizing. (#828) [Geoff Barrett]

  • Fix not tracing modules following primitives. (#837) [Jie Xu]

  • Fix trace overflow on huge arrays. (#834) [Geoff Barrett]

  • Fix quoted comment slashes in defines. (#845) [Adam Krolnik]

Verilator 3.864 2014-09-21

Minor:

  • Support power operator with real. (#809) [Jonathon Donaldson]

  • Improve verilator_profcfunc time attributions. [Jonathon Donaldson]

  • Fix duplicate anonymous structures in $root. (#788) [Bob Newgard]

  • Fix mis-optimization of bit-swap in wide signal. (#800) [Jie Xu]

  • Fix error when tracing public parameters. (#722) [Jonathon Donaldson]

  • Fix dpiGetContext in dotted scopes. (#740) [Geoff Barrett]

  • Fix over-shift structure optimization error. (#803) [Jeff Bush]

  • Fix optional parameter keyword in module #(). (#810) [Iztok Jeras]

  • Fix $warning/$error multi-argument ordering. (#816) [Jonathon Donaldson]

  • Fix clang warnings. (#818) [Iztok Jeras]

  • Fix string formats under deep expressions. (#820) [Iztok Jeras]

Verilator 3.862 2014-06-10

Minor:

  • Using command line -Wno-{WARNING} now overrides file-local lint_on.

  • Add -P to suppress &96;line and blanks with preprocessing. (#781) [Derek Lockhart]

  • Support SV 2012 package import before port list.

  • Change SYMRSVDWORD to print as warning rather than error.

  • Fix seg-fault with variable of parameterized interface. (#692) [Jie Xu]

  • Fix false name conflict on cells in generate blocks. (#749) [Igor Lesik]

  • Fix pattern assignment to basic types. (#767) [Jie Xu]

  • Fix pattern assignment to conditionals. (#769) [Jie Xu]

  • Fix shift corner-cases. (#765) (#766) (#768) (#772) (#774) (#776) [Clifford Wolf]

  • Fix C compiler interpreting signing. (#773) [Clifford Wolf]

  • Fix late constant division by zero giving X error. (#775) [Clifford Wolf]

  • Fix gate primitives with arrays and non-arrayed pins.

  • Fix DETECTARRAY error on packed arrays. (#770) [Jie Xu]

  • Fix ENDLABEL warnings on escaped identifiers.

  • Fix string corruption. (#780) [Derek Lockhart]

Verilator 3.860 2014-05-11

Major:

  • PSL is no longer supported, please use System Verilog assertions.

  • Support '{} assignment pattern on arrays. (#355)

  • Support streaming operators. (#649) [Glen Gibb]

  • Fix expression problems with -Wno-WIDTH. (#729) (#736) (#737) (#759) Where WIDTH warnings were ignored this might result in different warning messages and results, though it should better match the spec. [Clifford Wolf]

Minor:

  • Add --no-trace-params.

  • Add assertions on 'unique if'. (#725) [Jeff Bush]

  • Add PINCONNECTEMPTY warning. [Holger Waechtler]

  • Support parameter arrays. (#683) [Jeremy Bennett]

  • Documentation fixes. (#723) [Glen Gibb]

  • Support {} in always sensitivity lists. (#745) [Igor Lesik]

  • Fix begin_keywords "1800+VAMS". (#1806)

  • Fix tracing of package variables and real arrays.

  • Fix tracing of packed arrays without --trace-structs. (#742) [Jie Xu]

  • Fix missing coverage line on else-if. (#727) [Sharad Bagri]

  • Fix modport function import not-found error.

  • Fix power operator calculation. (#730) (#735) [Clifford Wolf]

  • Fix reporting struct members as reserved words. (#741) [Chris Randall]

  • Fix change detection error on unions. (#758) [Jie Xu]

  • Fix -Wno-UNOPTFLAT change detection with 64-bits. (#762) [Clifford Wolf]

  • Fix shift-right optimization. (#763) [Clifford Wolf]

  • Fix Mac OS-X test issues. [Holger Waechtler]

  • Fix C++-2011 warnings.

Verilator 3.856 2014-03-11

Minor:

  • Support case inside. (#708) [Jan Egil Ruud]

  • Add parameters into trace files. (#706) [Alex Solomatnikov]

  • Fix parsing "#0 'b0". (#256)

  • Fix array bound checks on real variables.

  • Fix --skip-identical mis-detecting on OS-X. (#707)

  • Fix missing VL_SHIFTRS_IQI with WIDTH warning. (#714) [Fabrizio Ferrandi]

  • Fix signed shift right optimization. (#715) [Fabrizio Ferrandi]

  • Fix internal error on "input x =" syntax error. (#716) [Lane Brooks]

  • Fix slice extraction from packed array. (#717) [Jan Egil Ruud]

  • Fix inside statement EQWILD error. (#718) [Jan Egil Ruud]

Verilator 3.855 2014-01-18

Minor:

  • Support modport import. (#696) [Jeremy Bennett]

  • Add --trace-structs to show struct names. (#673) [Chris Randall]

  • Fix tracing of packed structs. (#705) [Jie Xu]

  • Fix --lint-only with MinGW. (#1813) [HyungKi Jeong]

  • Fix some delayed assignments of typedefed unpacked arrays.

  • Fix wire declarations with size and not range. (#466) [Alex Solomatnikov]

  • Fix parameter pin vs. normal pin error. (#704) [Alex Solomatnikov]

Verilator 3.854 2013-11-26

Minor:

  • Add UNPACKED warning to convert unpacked structs. [Jeremy Bennett]

  • Add --compiler clang to work around compiler bug. (#694) [Stefan Ludwig]

  • Support vpi_get of vpiSuppressVal. (#687) [Varun Koyyalagunta]

  • Support vpi_get_time. (#688) [Varun Koyyalagunta]

  • Fix evaluation of chained parameter functions. (#684) [Ted Campbell]

  • Fix enum value extension of '1.

  • Fix multiple VPI variable callbacks. (#679) [Rich Porter]

  • Fix vpi_get of vpiSize. (#680) [Rich Porter]

  • Fix vpi_remove_cb inside callback. (#689) [Varun Koyyalagunta]

  • Fix crash with coverage of structures. (#691) [Eivind Liland]

  • Fix array assignment from const var. (#693) [Jie Xu]

Verilator 3.853 2013-09-30

Minor:

  • Add --no-order-clock-delay to work around #613. [Charlie Brej]

Verilator 3.852 2013-09-29

Minor:

  • Support named function and task arguments. [Chris Randall]

  • Report SELRANGE warning for non-generate if. (#675) [Roland Kruse]

  • Fix ordering of $fgetc. (#1808) [Frédéric Requin]

  • Fix --output-split-cfunc to count internal functions. [Chris Randall]

  • Fix crash on 32-bit Ubuntu. (#670) [Mark Jackson Pulver]

Verilator 3.851 2013-08-15

Minor:

  • Fix ordering of clock enables with delayed assigns. (#613) [Jeremy Bennett]

  • Fix vpi_iterate on memory words. (#655) [Rich Porter]

  • Fix final duplicate declarations when non-inlined. (#661) [Charlie Brej]

  • Fix interface ports with comma lists. (#1779) [Ed Lander]

  • Fix parameter real conversion from integer.

  • Fix clang warnings. (#668) [Yutetsu Takatsukasa]

Verilator 3.850 2013-06-02

Major:

  • Support interfaces and modports. (#102) [Byron Bradley, Jeremy Bennett]

Minor:

  • Duplicate clock gate optimization on by default. (#621)

  • Fix arrayed input compile error. (#645) [Krzysztof Jankowski]

  • Fix GCC version runtime changes. (#651) [Jeremy Bennett]

  • Fix packed array select internal error. (#652) [Krzysztof Jankowski]

Verilator 3.847 2013-05-11

Minor:

  • Add ALWCOMBORDER warning. [KC Buckenmaier]

  • Add --pins-sc-uint and --pins-sc-biguint. (#638) [Alex Hornung]

  • Support "signal[vec]++".

  • Fix simulation error when inputs and MULTIDRIVEN. (#634) [Ted Campbell]

  • Fix module resolution with __. (#631) [Jason McMullan]

  • Fix packed array non-zero right index select crash. (#642) [Krzysztof Jankowski]

  • Fix nested union crash. (#643) [Krzysztof Jankowski]

Verilator 3.846 2013-03-09

Major:

  • IEEE 1800-2012 is now the default language. This adds 4 new keywords and updates the svdpi.h and vpi_user.h header files.

  • Add --report-unoptflat. (#611) [Jeremy Bennett]

Minor:

  • Add duplicate clock gate optimization. (#1772) [Varun Koyyalagunta] Disabled unless -OD or -O3 used, please try it as may get some significant speedups.

  • Support pattern assignment features. (#616) (#617) (#618) [Ed Lander]

  • Support bind in $unit. (#602) [Ed Lander]

  • Support <number>'() sized casts. (#628) [Ed Lander]

  • Fix wrong dot resolution under inlining. [Art Stamness]

  • Fix DETECTARRAY on packed structures. (#610) [Jeremy Bennett]

  • Fix LITENDIAN on unpacked structures. (#614) [Wai Sum Mong]

  • 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 UNOPTFLAT circular array bounds crossing. (#630) [Jie Xu]

Verilator 3.845 2013-02-04

Minor:

  • Fix nested packed arrays and struct. (#600) [Jeremy Bennett] Packed arrays are now represented as a single linear vector in Verilated models. This may affect packed arrays that are public or accessed via the VPI.

  • Support wires with data types. (#608) [Ed Lander]

  • Support bind, to module names only. (#602) [Ed Lander]

  • Support VPI product info, warning calls, etc. (#588) [Rick Porter]

  • Support $left, $right and related functions. (#448) [Iztok Jeras]

  • Support inside expressions.

  • Define SYSTEMVERILOG, SV_COV_START and other IEEE mandated predefines.

  • Fix pin width mismatch error. (#595) [Alex Solomatnikov]

  • Fix implicit one bit parameter selection. (#603) [Jeremy Bennett]

  • Fix signed/unsigned parameter misconversion. (#606) [Jeremy Bennett]

  • Fix segfault on multidimensional dotted arrays. (#607) [Jie Xu]

  • Fix per-bit array output connection error. (#414) [Jan Egil Ruud]

  • Fix package logic var compile error.

  • Fix enums with X values.

Verilator 3.844 2013-01-09

Minor:

  • Support "unsigned int" DPI import functions. (#1770) [Alex Lee]

  • Fix package resolution of parameters. (#586) [Jeremy Bennett]

  • Fix non-integer vpi_get_value. (#587) [Rich Porter]

  • Fix task inlining under $display and case. (#589) (#598) [Holger Waechtler]

  • Fix package import of non-localparam parameter. (#474) (#591) [Jeremy Bennett]

  • Fix package import of package imports, partial #592. [Jeremy Bennett]

  • Fix package import preventing local var. (#599) [Jeremy Bennett]

  • Fix array extraction of implicit vars. (#601) [Joe Eiler]

Verilator 3.843 2012-12-01

Minor:

  • Add +1364-1995ext and similar language options. (#532) [Jeremy Bennett]

  • Fix mis-optimized identical submodule subtract. (#581) [Charlie Brej]

  • Fix crash on dotted references into dead modules. (#583) [Jeremy Bennett]

  • Fix compile issues on MSVCC. (#571) (#577) [Amir Gonnen]

  • Fix --debug overriding preceding --dump-treei. (#580) [Jeremy Bennett]

Verilator 3.842 2012-11-03

Minor:

  • Add -x-initial-edge. (#570) [Jeremy Bennett]

  • Fix parameter pins interspersed with cells broke in 3.840. [Bernard Deadman]

  • Fix large shift error on large shift constants. [David Welch]

  • Fix $display mangling on GCC 4.7 and speed up. (#1765) (#373) (#574) [R Diez]

  • Fix array of struct references giving false error. (#566) [Julius Baxter]

  • Fix missing var access functions when no DPI. (#572) [Amir Gonnen]

  • Fix name collision on unnamed blocks. (#567) [Chandan Egbert]

  • Fix name collision on task inputs. (#569) [Chandan Egbert]

Verilator 3.841 2012-09-03

Major:

  • Add --savable to support model save/restore. [Jeremy Bennett]

Minor:

  • Support '{} assignment pattern on structures, part of #355.

  • Fix double-deep parameter cell WIDTHs. (#541) [Hiroki Honda]

  • Fix imports under multiple instantiated cells. (#542) [Alex Solomatnikov]

  • Fix defparam in generate broke in 3.840. (#543) [Alex Solomatnikov]

  • Fix duplicate begin error broke in 3.840. (#548) [Alex Solomatnikov]

  • Fix triangle symbol resolution error broke in 3.840. (#550) [Ted Campbell]

Verilator 3.840 2012-07-31 Beta

Major:

  • Rewrote tristate handling; supports tri0, tri1, tristate bit selects, concatenates and pullup/pulldowns. (#395) (#56) (#54) (#51) [Alex Solomatnikov, Lane Brooks, et al]

  • Support packed structures and unions. (#181) Note this was a major internal change that may lead to some instability.

Minor:

  • Support tri0 and tri1. (#462) [Alex Solomatnikov]

  • Support nmos and pmos. (#488) [Alex Solomatnikov]

  • Add INITIALDLY warning on initial assignments. (#478) [Alex Solomatnikov]

  • Add PINMISSING and PINNOCONNECT lint checks.

  • Add --converge-limit option.

  • Fix generate operators not short circuiting. (#413) [by Jeremy Bennett]

  • Fix parameters not supported in constant functions. (#474) [Alex Solomatnikov]

  • Fix duplicate warnings/errors. (#516) [Alex Solomatnikov]

  • Fix signed extending biops with WIDTH warning off. (#511) [Junji Hashimoto]

  • Fix ITOD internal error on real conversions. (#491) [Alex Solomatnikov]

  • Fix input and real loosing real data type. (#501) [Alex Solomatnikov]

  • Fix imports causing symbol table error. (#490) [Alex Solomatnikov]

  • Fix newlines in radix values. (#507) [Walter Lavino]

  • Fix loop error message to report line. (#513) [Jeremy Bennett]

  • Fix false UNUSED warning on file system calls.

  • Fix GCC 4.7.0 compile warnings. (#530) [Jeremy Bennett]

  • Fix svdpi.h compile error on Apple OS.

  • Fix compile error under git submodules. (#534) [Aurelien Francillon]

Verilator 3.833 2012-04-15

Minor:

  • Support += and -= in standard for loops. (#463) [Alex Solomatnikov]

  • Fix processing unused parameterized modules. (#469) (#470) [Alex Solomatnikov]

  • Add SELRANGE as warning instead of error. (#477) [Alex Solomatnikov]

  • Add readme.pdf and internal.pdf and doxygen. (#483) [by Jeremy Bennett]

  • Fix change detections on arrays. (#364) [John Stevenson, Alex Solomatnikov]

  • Fix signed array warning. (#456) [Alex Solomatnikov]

  • Fix genvar and begin under generate. (#461) [Alex Solomatnikov]

  • Fix real constant parameter functions. (#475) [Alex Solomatnikov]

  • Fix and document --gdb option. (#454) [Jeremy Bennett]

  • Fix OpenSolaris compile error. [Sanjay Singh]

Verilator 3.832 2012-03-07

Minor:

  • Fix memory delayed assignments from multiple clock domains. [Andrew Ling]

  • Support arrayed SystemC I/O pins. [Christophe Joly]

  • Report MULTIDRIVEN on memories set in multiple clock domains.

  • Report ENDLABEL on mismatching end labels. (#450) [Iztok Jeras]

  • Fix expansion of back-slashed escaped macros. (#441) [Alberto Del Rio]

  • Fix inheriting real and signed type across untyped parameters.

  • Fix core dump with over 100 deep UNOPTFLAT. (#432) [Joe Eiler]

  • Fix false command not found warning in makefiles. [Ruben Diez]

  • Fix hang when functions inside begin block. [David Welch]

  • Fix hang on recursive substitution &96;defines. (#443) [Alex Solomatnikov]

Verilator 3.831 2012-01-20

Major:

  • Support SystemC 2.3.0 prerelease. This requires setting the new SYSTEMC_INCLUDE and SYSTEMC_LIBDIR variables in place of now deprecated SYSTEMC and SYSTEMC_ARCH. [Iztok Jeras]

Minor:

  • Suppress VARHIDDEN on dpi import arguments. [Ruben Diez]

  • Support "generate for (genvar i=0; ...". [David Kravitz]

  • Fix dpi exports with > 32 bit but < 64 bit args. (#423) [Chandan Egbert]

  • Fix array of instantiations with sub-range output. (#414) [Jeremy Bennett]

  • Fix BLKSEQ warnings on variables declared inside always. [Ruben Diez]

Verilator 3.830 2011-11-27

Major:

  • With "--language VAMS" support a touch of Verilog AMS. [Holger Waechtler]

Minor:

  • Add sc_bv attribute to force bit vectors. (#402) [by Stefan Wallentowitz]

  • Search for user -y paths before default current directory. [Ruben Diez]

  • Support constants in sensitivity lists. (#412) [Jeremy Bennett]

  • Support $system. [Ruben Diez]

  • Support $sscanf with %g. [Holger Waechtler]

  • Indicate 'exiting due to errors' if errors, not warnings. [Ruben Diez]

  • Fix bad result with if-else-return optimization. (#420) [Alex Solomatnikov]

  • Fix reporting not found modules if generate-off. (#403) [Jeremy Bennett]

  • Fix $display with %d following %g. [Holger Waechtler]

Verilator 3.824 2011-10-25

Minor:

  • Fix "always @ (* )". (#403) (#404) [Walter Lavino]

  • Add ASSIGNIN as suppressible error. [Jeremy Bennett]

  • Fix 3.823 constructor core dump on Debian. (#401) [Ahmed El-Mahmoudy]

Verilator 3.823 2011-10-20

Minor:

  • Support $ceil, $floor, etc. [Alex Solomatnikov]

  • Add configure options for cc warnings and extended tests. [Ruben Diez]

  • Add -Wall reporting ASSIGNDLY on assignment delays. [Ruben Diez]

  • Fix UNDRIVEN warnings inside DPI import functions. [Ruben Diez]

  • Fix --help output to go to stderr, not stdout. (#397) [Ruben Diez]

  • Fix DPI import output of 64 bits. (#398) [Mike Denio]

  • Fix DPI import false BLKSEQ warnings. [Alex Solomatnikov]

  • Fix MSVC compile warning with trunc/round. (#394) [Amir Gonnen]

  • Fix autoconf and Makefile warnings. (#396) [Ruben Diez]

Verilator 3.821 2011-09-14

Minor:

  • Fix PowerPC runtime error. (#288) [Ahmed El-Mahmoudy]

  • Fix internal error on integer casts. (#374) [Chandan Egbert]

Verilator 3.820 2011-07-28

Minor:

  • Support 'real' numbers and related functions.

  • Support 'const' variables in limited cases; similar to enums. [Alex Solomatnikov]

  • Support disable for loop escapes.

  • Support $fopen and I/O with integer instead of &96;verilator_file_descriptor.

  • Support coverage in -cc and -sc output modes. [John Li] Note this requires SystemPerl 1.338 or newer.

  • Use 'vluint64_t' for SystemC instead of (same sized) 'uint64' for MSVC++.

  • Fix vpi_register_cb using bad s_cb_data. (#370) [by Thomas Watts]

  • Fix $display missing leading zeros in %0d. (#367) [Alex Solomatnikov]

Verilator 3.813 2011-06-28

Minor:

  • Support bit vectors > 64 bits wide in DPI import and exports.

  • Fix out of memory on slice syntax error. (#354) [Alex Solomatnikov]

  • Fix error on enum references to other packages. (#339) [Alex Solomatnikov]

  • Fix DPI undeclared svBitVecVal compile error. (#346) [Chandan Egbert]

  • Fix DPI bit vector compile errors. (#347) (#359) [Chandan Egbert]

  • Fix CDCRSTLOGIC report showing endpoint flops without resets.

  • Fix compiler warnings on SPARC. (#288) [Ahmed El-Mahmoudy]

Verilator 3.812 2011-04-06

Minor:

  • Add --trace-max-width and --trace-max-array. (#319) [Alex Solomatnikov]

  • Add --Wno-fatal to turn off abort on warnings. [by Stefan Wallentowitz]

  • Support ${...} and $(...) env vars in .vc files. [by Stefan Wallentowitz]

  • Support $bits(data_type). (#327) [Alex Solomatnikov]

  • Support loop unrolling on width mismatches. (#333) [Joe Eiler]

  • Support simple cast operators. (#335) [Alex Solomatnikov]

  • Accelerate bit-selected inversions.

  • Add error on circular parameter definitions. (#329) [Alex Solomatnikov]

  • Fix concatenates and vectored bufif1. (#326) [Iztok Jeras]

Verilator 3.811 2011-02-14

Minor:

  • Report error on duplicated or empty pins. (#321) [Christian Leber]

  • Report error on function call output tied to constant. [Bernard Deadman]

  • Throw UNUSED/UNDRIVEN only once per net in a parameterized module.

  • Fix internal error on functions called as SV tasks. [Bernard Deadman]

  • Fix internal error on non-inlined inout pins. [Jeff Winston]

  • Fix false BLKSEQ on non-unrolled for loop indexes. [Jeff Winston]

  • Fix block comment not separating identifiers. (#311) [Gene Sullivan]

  • Fix warnings to point to lowest net usage, not upper level ports.

  • Fix error on constants connected to outputs. (#323) [Christian Leber]

Verilator 3.810 2011-01-03

Major:

  • Add limited support for VPI access to public signals, see docs.

  • Add -F option to read relative option files. (#297) [Neil Hamilton]

  • Support ++,--,+= etc as standalone statements. [Alex Solomatnikov]

  • Add -Wall, -Wwarn-style, -Wno-style to enable code style warnings that have been added to this release, and disabled by default:

  • With --Wall, add BLKSEQ warning on blocking assignments in seq blocks.

  • With --Wall, add DECLFILENAME warning on modules not matching filename.

  • With --Wall, add DEFPARAM warning on deprecated defparam statements.

  • With --Wall, add IFDEPTH warning on deep if statements.

  • With --Wall, add INCABSPATH warning on &96;include with absolute paths.

  • With --Wall, add SYNCASYNCNET warning on mixed sync/async reset nets.

  • With --Wall, add UNDRIVEN warning on undriven nets.

  • With --Wall, add UNUSED warning on unused nets.

Minor:

  • When running with VERILATOR_ROOT, optionally find binaries under bin.

  • Suppress WIDTH warnings when adding/subtracting 1'b1.

  • The VARHIDDEN warning is now disabled by default, use -Wall to enable.

Verilator 3.805 2010-11-02

Minor:

  • Add warning when directory contains spaces. (#1705) [Salman Sheikh]

  • Fix wrong filename on include file errors. (#289) [Brad Parker]

  • Fix segfault on SystemVerilog "output wire foo=0". (#291) [Joshua Wise]

  • Fix DPI export name not found. (#1703) [Terry Chen]

Verilator 3.804 2010-09-20

Minor:

  • Support tracing/coverage of underscore signals. (#280) [by Jason McMullan]

  • Increase define recursions before error. [Paul Liu]

  • On core dump, print debug suggestions.

  • Fix preprocessor &96;&96; of existing base define. (#283) [Usha Priyadharshini]

Verilator 3.803 2010-07-10

Minor:

  • Fix preprocessor preservation of newlines across macro substitutions.

  • Fix preprocessor stringification of nested macros.

  • Fix some constant parameter functions causing crash. (#253) [Nick Bowler]

  • Fix do {...} while() not requiring final semicolon.

Verilator 3.802 2010-05-01

Minor:

  • Support runtime access to public signal names.

  • Add /verilator public_flat_rw/ for timing-specific public access.

  • Fix word size to match uint64_t on -m64 systems. (#238) [Joe Eiler]

  • Improve error handling on slices of arrays. (#226) [by Byron Bradley]

  • Report errors when extra underscores used in meta-comments.

  • Fix bit reductions on multi-packed dimensions. (#227) [by Byron Bradley]

  • Fix removing $fscanf if assigned to unused var. (#248) [Ashutosh Das]

  • Fix "make install" with configure outside srcdir. [Stefan Wallentowitz]

  • Fix loop unroller out of memory; change --unroll-stmts. [Ashutosh Das]

  • Fix trace files with empty modules crashing some viewers.

  • Fix parsing single files > 2GB. [Jeffrey Short]

  • Fix installing data files as non-executable. (#168) [by Ahmed El-Mahmoudy]

Verilator 3.801 2010-03-17

Minor:

  • Support "break", "continue", "return".

  • Support "&96;default_nettype none|wire". [Dominic Plunkett]

  • Skip SystemC tests if not installed. [Iztok Jeras]

  • Fix clock-gates with non-AND complex logic. (#220) [Ashutosh Das]

  • Fix flushing VCD buffers on $stop. [Ashutosh Das]

  • Fix Mac OS-X compile issues. (#217) [Joshua Wise, Trevor Williams]

  • Fix make uninstall. (#216) [Iztok Jeras]

  • Fix parameterized defines with empty arguments.

Verilator 3.800 2010-02-07

Major application visible changes:

  • SystemPerl is no longer required for tracing. Applications must use VerilatedVcdC class in place of SpTraceVcdC.

  • SystemVerilog 1800-2009 is now the default language. Thus "global" etc are now keywords. See the --language option.

Major new features:

  • Support SystemVerilog types "byte", "chandle", "int", "longint", "shortint", "time", "var" and "void" in variables and functions.

  • Support "program", "package", "import" and $unit.

  • Support typedef and enum. [by Donal Casey]

  • Support direct programming interface (DPI) "import" and "export". Includes an extension to map user $system PLI calls to the DPI.

  • Support assignments of multidimensional slices. (#170) [by Byron Bradley]

  • Support multidimensional inputs/outputs. (#171) [by Byron Bradley]

  • Support "reg [1:0][1:0][1:0]" and "reg x [3][2]". (#176) [Byron Bradley]

  • Support declarations in loop initializers. (#172) [by Byron Bradley]

  • Support $test$plusargs and $value$plusargs, but see the docs!

  • Support $sformat and $swrite.

  • Support 1800-2009 define defaults and &96;undefineall.

  • Add -CFLAGS, -LDFLAGS, <file>.a, <file>.o, and <file>.so options.

  • Speed compiles by avoiding including the STL iostream header. Application programs may need to include it themselves to avoid errors.

  • Add experimental clock domain crossing checks.

  • Add experimental --pipe-filter to filter all Verilog input.

  • Add experimental config files to filter warnings outside of the source.

  • Add VARHIDDEN warning when signal name hides module name.

  • Support optional cell parenthesis. (#179) [by Byron Bradley]

  • Support for-loop i++, ++i, i--, --i. (#175) [by Byron Bradley]

  • Support 1800-2009 /comments/ in define values.

  • Add Makefile VM_GLOBAL_FAST, listing objects needed to link executables.

  • Add --bbox-unsup option to black-box unsupported UDP tables.

  • Add -Wno-MODDUP option to allow duplicate modules.

Bug fixes:

  • Fix implicit variable issues. (#196) (#201) [Byron Bradley]

  • Fix 'for' variable typing. (#205) [by Byron Bradley]

  • Fix tracing with --pins-bv 1. (#195) [Michael S]

  • Fix MSVC++ 2008 compile issues. (#209) [Amir Gonnen]

  • Fix MinGW compilation. (#184) (#214) [by Shankar Giri, Amir Gonnen]

  • Fix Cygwin 1.7.x compiler error with uint32_t. (#204) [Ivan Djordjevic]

  • Fix &96;define argument mis-replacing system task of same name. (#191)

  • Fix Verilator core dump on wide integer divides. (#178) [Byron Bradley]

  • Fix lint_off/lint_on meta comments on same line as warning.

Verilator 3.720 2009-10-26

Major:

  • Support little endian bit vectors ("reg [0:2] x;").

  • Support division and modulus of > 64 bit vectors. [Gary Thomas]

Minor:

  • Fix writing to out-of-bounds arrays writing element 0.

  • Fix core dump with SystemVerilog var declarations under unnamed begins.

  • Fix VCD files showing internal flattened hierarchy, broke in 3.714.

  • Fix cell port connection to unsized integer causing false width warning.

  • Fix erroring on strings with backslashed newlines. (#168) [Pete Nixon]

Verilator 3.714 2009-09-18

Major:

  • Add --bbox-sys option to blackbox $system calls.

Minor:

  • Support generate for var++, var--, ++var, --var.

  • Improved warning when "do" used as identifier.

  • Don't require SYSTEMPERL_INCLUDE if SYSTEMPERL/src exists. [Gary Thomas]

  • Fix deep defines causing flex scanner overflows. [Brad Dobbie]

  • Fix preprocessing commas in deep parameterized macros. [Brad Dobbie]

  • Fix tracing escaped dotted identifiers. (#107)

  • Fix $display with uppercase %M.

  • Fix --error-limit option being ignored.

Verilator 3.713 2009-08-04

Minor:

  • Support constant function calls for parameters. [many!]

  • Support SystemVerilog "logic". (#101) [by Alex Duller]

  • Name SYMRSVDWORD error, and allow disabling it. (#103) [Gary Thomas]

  • Fix escaped preprocessor identifiers. (#106) [Nimrod Gileadi]

Verilator 3.712 2009-07-14

Major:

  • Patching SystemC is no longer required to trace sc_bvs.

Minor:

  • Add verilator --pins-uint8 option to use sc_in<uint8_t/uint16_t>.

  • Add verilator -V option, to show verbose version.

  • Add BLKLOOPINIT error code, and describe --unroll-count. [Jeff Winston]

  • Support zero-width constants in concatenations. [Jeff Winston]

  • On WIDTH warnings, show variable name causing error. [Jeff Winston]

Verilator 3.711 2009-06-23

Minor:

  • Support decimal constants of arbitrary widths. [Mark Marshall]

  • Fix error on case statement with all duplicate items. (#99) [Gary Thomas]

  • Fix segfault on unrolling for's with bad inits. (#90) [Andreas Olofsson]

  • Fix tristates causing "Assigned pin is neither...". [by Lane Brooks]

  • Fix compiler errors under Fedora release candidate 11. [Chitlesh Goorah]

Verilator 3.710 2009-05-19

Major:

  • Verilator is now licensed under LGPL v3 and/or Artistic v2.0.

Minor:

  • &96;__FILE__ now expands to a string, per draft SystemVerilog 2010(ish).

  • The front end parser has been re-factored to enable more SV parsing. Code should parse the same, but minor parsing bugs may pop up.

  • Verilator_includer is no longer installed twice. (#48) [Lane Brooks]

  • Fix escaped identifiers with '.' causing conflicts. (#83) [J Baxter]

  • Fix define formal arguments that contain newlines. (#84) [David A]

Verilator 3.703 2009-05-02

Minor:

  • Fix $clog2 calculation error with powers-of-2. (#81) [Patricio Kaplan]

  • Fix error with tasks that have output first. (#78) [Andrea Foletto]

  • Fix "cloning" error with -y/--top-module. (#76) [Dimitris Nalbantis]

  • Fix segfault with error on bad --top-module. (#79) [Dimitris Nalbantis]

  • Fix "redefining I" error with complex includes. [Duraid Madina]

  • Fix GCC 4.3.2 compile warnings.

Verilator 3.702 2009-03-28

Minor:

  • Add --pins-bv option to use sc_bv for all ports. [Brian Small]

  • Add SYSTEMPERL_INCLUDE envvar to assist RPM builds. [Chitlesh Goorah]

  • Report errors when duplicate labels are used. (#72) [Vasu Kandadi]

  • Fix the SC_MODULE name() to not include __PVT__. [Bob Fredieu]

Verilator 3.701 2009-02-26

Minor:

  • Support repeat and forever statements. [Jeremy Bennett]

  • Add --debugi-<srcfile> option, for internal debugging. [Dennis Muhlestein]

  • Fix compile issues with GCC 4.3. (#47) [Lane Brooks]

  • Fix VL_RANDom to better randomize bits. [Art Stamness]

  • Fix error messages to consistently go to stderr. [Jeremy Bennett]

  • Fix left associativity for ?: operators.

Verilator 3.700 2009-01-08

Major:

  • Support limited tristate inouts. Written by Lane Brooks, under support by Ubixum Inc. This allows common pad ring and tristate-mux structures to be Verilated. See the documentation for more information on supported constructs.

  • Add --coverage_toggle for toggle coverage analysis. Running coverage now requires SystemPerl 1.301 or newer.

  • Add coverage_on/_off metacomments to bracket coverage regions.

Minor:

  • Support posedge of bit-selected signals. (#45) [Rodney Sinclair]

  • Optimize two-level shift and and/or trees, +23% on one test.

  • Line coverage now aggregates by hierarchy automatically. Previously this would be done inside SystemPerl, which was slower.

  • Minor performance improvements of Verilator compiler runtime.

  • Coverage of each parameterized module is counted separately. [Bob Fredieu]

  • Fix creating parameterized modules when no parameter values are changed.

  • Fix certain generate-if cells causing "clone" error. [Stephane Laurent]

  • Fix line coverage of public functions. [Soon Koh]

  • Fix SystemC 2.2 deprecated warnings about sensitive() and sc_start().

  • Fix arrayed variables under function not compiling. (#44) [Ralf Karge]

  • Fix --output-split-cfuncs to also split trace code. [Niranjan Prabhu]

  • Fix 'bad select range' warning missing some cases. (#43) [Lane Brooks]

  • Fix internal signal names containing control characters (broke in 3.680).

  • Fix compile error on Ubuntu 8.10. [Christopher Boumenot]

  • Fix internal error on "output x; reg x = y;".

  • Fix wrong result for read of delayed FSM signal. (#46) [Rodney Sinclair]

Verilator 3.681 2008-11-12

Minor:

  • Support SystemVerilog unique and priority case.

  • Include Verilog file's directory name in coverage reports.

  • Fix 'for' under 'generate-for' causing error. (#38) [Rafael Shirakawa]

  • Fix coverage hierarchy being backwards with inlining. [Vasu Arasanipalai]

  • Fix GCC 4.3 compile error. (#35) [Lane Brooks]

  • Fix MSVC compile error. (#42) [John Stroebel]

Verilator 3.680 2008-10-08

Major:

  • Support negative bit indexes. [Stephane Laurent] Tracing negative indexes requires latest Verilog-Perl and SystemPerl.

Minor:

  • Suppress width warnings between constant strings and wider vectors. [Rodney Sinclair]

  • Ignore SystemVerilog timeunit and timeprecision.

  • Expand environment variables in -f input files. [Lawrence Butcher]

  • Report error if port declaration is missing. (#32) [Guy-Armand Kamendje]

  • Fix genvars causing link error when using --public. [Chris Candler]

Verilator 3.671 2008-09-19

Major:

  • SystemC uint64_t pins are now the default instead of sc_bv<64>. Use --no-pins64 for backward compatibility.

  • Support SystemVerilog "cover property" statements.

Minor:

  • When warnings are disabled on signals that are flattened out, disable the warnings on the signal(s) that replace it.

  • Add by-design and by-module subtotals to verilator_profcfunc.

  • Add IMPERFECTSCH warning, disabled by default.

  • Support coverage under SystemPerl 1.285 and newer.

  • Support arbitrary characters in identifiers. [Stephane Laurent]

  • Fix extra evaluation of pure combo blocks in SystemC output.

  • Fix stack overflow on large ? : trees. [John Sanguinetti]

Verilator 3.670 2008-07-23

Major:

  • Add --x-assign=fast option, and make it the default. This chooses performance over reset debugging. See the manual.

  • Add --autoflush, for flushing streams after $display. [Steve Tong]

  • Add CASEWITHX lint warning and if disabled fix handling of casez with Xs.

Minor:

  • Add $feof, $fgetc, $fgets, $fflush, $fscanf, $sscanf. [Holger Waechtler]

  • Add $stime. [Holger Waechtler]

  • Add $random.

  • Add --Wfuture-, for improving forward compatibility.

  • Add WIDTH warning to $fopen etc file descriptors.

  • Fix verilator_includer not being installed properly. [Holger Waechtler]

  • Fix IMPURE errors due to X-assignment temporary variables. [Steve Tong]

  • Fix "lvalue" errors with public functions. (#25) [CY Wang]

Verilator 3.665 2008-06-25

Minor:

  • Ignore "// verilator" comments alone on endif lines. [Rodney Sinclair]

  • "Make install" now installs verilator_includer and verilator_profcfunc.

  • Fix tracing missing changes on undriven public wires. [Rodney Sinclair]

  • Fix syntax error when "&96;include &96;defname" is ifdefed. [John Dickol]

  • Fix error when macro call has commas in concatenate. [John Dickol]

  • Fix compile errors under Fedora 9, GCC 4.3.0. [by Jeremy Bennett]

  • Fix Makefile to find headers/libraries under prefix. [by Holger Waechtler]

Verilator 3.664 2008-05-08

Minor:

  • Fix missing file in kit.

Verilator 3.663 2008-05-07

Minor:

  • Add DESTDIR to Makefiles to assist RPM construction. [Gunter Dannoritzer]

  • Fix compiler warnings under GCC 4.2.1.

  • Fix preprocessor &96;else after series of &96;elsif. [Mark Nodine]

  • Fix parameterized defines calling define with comma. [Joshua Wise]

  • Fix comma separated list of primitives. [by Bryan Brady]

Verilator 3.662 2008-04-25

Minor:

  • Add Verilog 2005 $clog2() function. This is useful in calculating bus-widths from parameters.

  • Support C-style comments in -f option files. [Stefan Thiede]

  • Add error message when modules have duplicate names. [Stefan Thiede]

  • Support defines terminated in EOF, though against spec. [Stefan Thiede]

  • Support optional argument to $finish and $stop. [by Stefan Thiede]

  • Support ranges on gate primitive instantiations. [Stefan Thiede]

  • Ignore old standard(ish) Verilog-XL defines. [by Stefan Thiede]

  • Fix "always @ ((a) or (b))" syntax error. [by Niranjan Prabhu]

  • Fix "output reg name=expr;" syntax error. [Martin Scharrer]

  • Fix multiple .v files being read in random order. [Stefan Thiede]

  • Fix internal error when params get non-constants. [Johan Wouters]

  • Fix bug introduced in 3.661 with parameterized defines.

Verilator 3.661 2008-04-04

Major:

  • The --enable-defenv configure option added in 3.660 is now the default. This hard-codes a default for VERILATOR_ROOT etc in the executables.

  • Add --language option for supporting older code. [Stefan Thiede]

  • Add --top-module option to select between multiple tops. [Stefan Thiede]

Minor:

  • Unsized concatenates now give WIDTHCONCAT warnings. [Jonathan Kimmitt] Previously they threw fatal errors, which in most cases is correct according to spec, but can be incorrect in presence of parameter values.

  • Support functions with "input integer". [Johan Wouters]

  • Ignore delays attached to gate UDPs. [Stefan Thiede]

  • Fix SystemVerilog parameterized defines with &96;&96; expansion, and fix extra whitespace inserted on substitution. [Vladimir Matveyenko]

  • Fix no-module include files on command line. [Stefan Thiede]

  • Fix dropping of backslash quoted-quote at end of $display.

  • Fix task output pin connected to non-variables. [Jonathan Kimmitt]

  • Fix missing test_v in install datadir. [Holger Waechtler]

  • Fix internal error after MSB < LSB error reported to user. [Stefan Thiede]

Verilator 3.660 2008-03-23

Minor:

  • Support hard-coding VERILATOR_ROOT etc in the executables, to enable easier use of Verilator RPMs. [Gunter Dannoritzer]

  • Allow multiple .v files on command line. [Stefan Thiede]

  • Convert re-defining macro error to warning. [Stefan Thiede]

  • Add --error-limit option. [Stefan Thiede]

  • Allow __ in cell names by quoting them in C. [Stefan Thiede]

  • Fix genvar to be signed, so "< 0" works properly. [Niranjan Prabhu]

  • Fix assignments to inputs inside functions/tasks. [Patricio Kaplan]

  • Fix definitions in main file.v, referenced in library. [Stefan Thiede]

  • Fix undefined assigns to be implicit warnings. [Stefan Thiede]

Verilator 3.658 2008-02-25

Minor:

  • Fix unistd compile error in 3.657. [Patricio Kaplan, Jonathan Kimmitt]

Verilator 3.657 2008-02-20

Minor:

  • Fix assignments of {a,b,c} = {c,b,a}. [Jonathan Kimmitt]

  • Fix Perl warning with --lint-only. [by Ding Xiaoliang]

  • Fix to avoid creating obj_dir with --lint-only. [Ding Xiaoliang]

  • Fix parsing of always @(*). [Patricio Kaplan]

Verilator 3.656 2008-01-18

Minor:

  • Wide VL_CONST_W_#X functions are now made automatically. [Bernard Deadman] In such cases, a new {prefix}__Inlines.h file will be built and included.

  • Fix sign error when extracting from signed memory. [Peter Debacker]

  • Fix tracing of SystemC w/o SystemPerl. [Bernard Deadman, Johan Wouters]

Verilator 3.655 2007-11-27

Minor:

  • Support "#delay <statement>;" with associated STMTDLY warning.

  • Fix generate for loops with constant zero conditions. [Rodney Sinclair]

  • Fix divide-by-zero errors in constant propagator. [Rodney Sinclair]

  • Fix wrong result with obscure signed-shift underneath a "? :".

  • Fix many internal memory leaks, and added leak detector.

Verilator 3.654 2007-10-18

Minor:

  • Don't exit early if many warnings but no errors are found. [Stan Mayer]

  • Fix parsing module #(parameter x,y) declarations. [Oleg Rodionov]

  • Fix parsing system functions with empty parens. [Oleg Rodionov]

Verilator 3.653 2007-08-01

Minor:

  • Support SystemVerilog ==? and !=? operators.

  • Fix SC_LIBS missing from generated makefiles. [Ding Xiaoliang]

Verilator 3.652 2007-06-21

Minor:

  • Report as many warning types as possible before exiting.

  • Support V2K portlists with "input a,b,...". [Mark Nodine]

  • Support V2K function/task argument lists.

  • Optimize constant $display arguments.

  • Fix preprocessor dropping some &96;line directives. [Mark Nodine]

Verilator 3.651 2007-05-22

Major:

  • Add verilator_profcfunc utility. [Gene Weber]

Minor:

  • Treat modules within &96;celldefine and &96;endcelldefine as if in library.

  • Support functions which return integers. [Mark Nodine]

  • Warn if flex is not installed. [Ralf Karge]

  • Ignore &96;protect and &96;endprotect.

  • Fix empty case/endcase blocks.

Verilator 3.650 2007-04-20

Major:

  • Add --compiler msvc option. This is now required when Verilated code is to be run through MSVC++. This also enables fixing MSVC++ error C1061, blocks nested too deeply. [Ralf Karge]

  • Add --lint-only option, to lint without creating other output.

Minor:

  • Add /verilator lint_save/ and /verilator lint_restore/ to allow friendly control over re-enabling lint messages. [Gerald Williams]

  • Support SystemVerilog .name and .* interconnect.

  • Support while and do-while loops.

  • Use $(LINK) instead of $(CXX) for Makefile link rules. [Gerald Williams]

  • Add USER_CPPFLAGS and USER_LDFLAGS to Makefiles. [Gerald Williams]

  • Fix compile errors under Windows MINGW compiler. [Gerald Williams]

  • Fix dotted bit reference to local memory. [Eugene Weber]

  • Fix 3.640 &96;verilog forcing IEEE 1364-1995 only. [David Hewson]

Verilator 3.640 2007-03-12

Minor:

  • Support Verilog 2005 &96;begin_keywords and &96;end_keywords.

  • Updated list of SystemVerilog keywords to correspond to IEEE 1800-2005.

  • Add /verilator public_flat/. [Eugene Weber]

  • Try all +libext's in the exact order given. [Michael Shinkarovsky]

  • Fix elimination of public signals assigned to constants. [Eugene Weber]

  • Fix internal error when public for loop has empty body. [David Addison]

  • Fix "Loops detected" assertion when model exceeds 4GB. [David Hewson]

  • Fix display %m names inside named blocks.

Verilator 3.633 2007-02-07

Minor:

  • Add --trace-depth option for minimizing VCD file size. [Emerson Suguimoto]

  • With VL_DEBUG, show wires causing convergence errors. [Mike Shinkarovsky]

  • Fix isolate_assignments when many signals per always. [Mike Shinkarovsky]

  • Fix isolate_assignments across task/func temporaries. [Mike Shinkarovsky]

  • Fix $display's with array select followed by wide AND. [David Hewson]

Verilator 3.632 2007-01-17

Minor:

  • Add /verilator isolate_assignments/ attribute. [Mike Shinkarovsky]

Verilator 3.631 2007-01-02

Major:

  • Support standard NAME[#] for cells created by arraying or generate for. This replaces the non-standard name__# syntax used in earlier versions.

Minor:

  • Fix again dotted references into generate cells. [David Hewson] Verilator no longer accepts duplicated variables inside unique generate blocks as this is illegal according to the specification.

  • Fix $readmem* with filenames < 8 characters. [Emerson Suguimoto]

Verilator 3.630 2006-12-19

Major:

  • Support $readmemb and $readmemh. [Eugene Weber, Arthur Kahlich]

Minor:

  • When dotted signal lookup fails, help the user by showing known scopes.

  • Fix to reduce depth of priority encoded case statements. [Eugene Weber]

  • Fix configure and compiling under Solaris. [Bob Farrell]

  • Fix dotted references inside generated cells. [David Hewson]

  • Fix missed split optimization points underneath other re-split blocks.

Verilator 3.623 2006-12-05

Major:

  • Add --output-split-cfuncs for accelerating GCC compile. [Eugene Weber]

Minor:

  • Add M32 make variable to support -m32 compiles. [Eugene Weber]

  • Fix $signed mis-extending when input has a WIDTH violation. [Eugene Weber]

Verilator 3.622 2006-10-17 Stable

Minor:

  • Fix --skip-identical without --debug, broken in 3.621. [Andy Meier]

Verilator 3.621 2006-10-11 Beta

Major:

  • Add /verilator no_inline_task/ to prevent over-expansion. [Eugene Weber]

Minor:

  • Public functions now allow > 64 bit arguments.

  • Remove .vpp intermediate files when not under --debug.

  • Fix link error when using --exe with --trace. [Eugene Weber]

  • Fix mis-optimization of wide concats with constants.

  • Fix core dump on printing error when not under --debug. [Allan Cochrane]

Verilator 3.620 2006-10-04 Stable

Minor:

  • Support simple inout task ports. [Eugene Weber]

  • Allow overriding Perl, Flex and Bison versions. [by Robert Farrell]

  • Optimize variables set to constants within basic blocks for ~3%.

  • Default make no longer makes the docs; if you edit the documentation. sources, run "make info" to get them.

  • Optimize additional Boolean identities (a|a = a, etc.)

  • Fix coredump when dotted cross-ref inside task call. [Eugene Weber]

  • Fix dotted variables in always sensitivity lists. [Allan Cochrane]

Verilator 3.610 2006-09-20 Stable

Minor:

  • Verilator now works under DJGPP (Pentium GCC). [John Stroebel]

  • Add default define for VL_PRINTF. [John Stroebel]

  • Removed coverage request variable; see Coverage limitations in docs.

  • Fix DOS carriage returns in multiline defines. [Ralf Karge]

  • Fix printf format warnings on 64-bit linux.

Verilator 3.602 2006-09-11 Stable

Minor:

  • Fix function references under top inlined module. [David Hewson]

Verilator 3.601 2006-09-06 Beta

Major:

  • Add --inhibit-sim flag for environments using old __Vm_inhibitSim.

  • Add &96;systemc_dtor for destructor extensions. [Allan Cochrane]

  • Add -MP to make phony dependencies, ala GCC's.

Minor:

  • Changed how internal functions are invoked to reduce aliasing. Useful when using GCC's -O2 or -fstrict-aliasing, to gain another ~4%.

  • Declare optimized lookup tables as 'static', to reduce D-Cache miss rate.

  • Fix memory leak when destroying modules. [John Stroebel]

  • Fix coredump when unused modules have unused cells. [David Hewson]

  • Fix 3.600 internal error with arrayed instances. [David Hewson]

  • Fix 3.600 internal error with non-unrolled function loops. [David Hewson]

  • Fix $display %m name not matching Verilog name inside SystemC modules.

Verilator 3.600 2006-08-28 Beta

Major:

  • Support dotted cross-hierarchy variable and task references.

Minor:

  • Lint for x's in generate case statements.

  • Fix line numbers being off by one when first file starts with newline.

  • Fix naming of generate for blocks to prevent non-inline name conflict.

  • Fix redundant statements remaining after table optimization.

Verilator 3.542 2006-08-11 Stable

Minor:

  • vl_finish and vl_fatal now print via VL_PRINTF rather then cerr/cout.

  • Fix extraneous UNSIGNED warning when comparing genvars. [David Hewson]

  • Fix extra white space in $display %c. [by David Addison]

  • Fix missing VL_CONST_W_24X macro. [Bernard Deadman]

Verilator 3.541 2006-07-05 Beta

Minor:

  • Add warning on changeDetect to arrayed structures. [David Hewson]

  • Fix "// verilator lint_on" not re-enabling warnings. [David Hewson]

  • Fix 3.540's multiple memory assignments to same block. [David Hewson]

  • Fix non-zero start number for arrayed instantiations. [Jae Hossell]

  • Fix GCC 4.0 header file warnings.

Verilator 3.540 2006-06-27 Beta

Minor:

  • Optimize combo assignments that are used only once, ~5-25% faster.

  • Optimize delayed assignments to memories inside loops, ~0-5% faster.

  • Fix mis-width warning on bit selects of memories. [David Hewson]

  • Fix mis-width warning on dead generate-if branches. [Jae Hossell]

Verilator 3.533 2006-06-05 Stable

Minor:

  • Add PDF user manual, verilator.pdf.

  • Fix delayed bit-selected arrayed assignments. [David Hewson]

  • Fix execution path to Perl. [Shanshan Xu]

  • Fix Bison compile errors in verilog.y. [by Ben Jackson]

Verilator 3.531 2006-05-10 Stable

Minor:

  • Support $c routines which return 64 bit values.

  • Fix &96;include &96;DEFINE.

  • Fix Verilator core dump when have empty public function. [David.Hewson]

Verilator 3.530 2006-04-24 Stable

Major:

  • $time is now 64 bits. The macro VL_TIME_I is now VL_TIME_Q, but calls the same sc_time_stamp() function to get the current time.

Verilator 3.523 2006-03-06 Stable

Minor:

  • Fix error line numbers being off due to multi-line defines. [Mat Zeno]

  • Fix GCC sign extending (uint64_t)(a<b). [David Hewson]

  • Fix &96;systemc_imp_header "undefined macro" error.

Verilator 3.522 2006-02-23 Beta

Minor:

  • Add UNUSED error message, for forward compatibility.

Verilator 3.521 2006-02-14 Beta

Major:

  • Create new --coverage-line and --coverage-user options. [Peter Holmes]

Minor:

  • Add SystemVerilog 'x,'z,'0,'1, and new string literals.

  • Fix public module's parent still getting inlined.

Verilator 3.520 2006-01-14 Stable

Major:

  • Support $fopen, $fclose, $fwrite, $fdisplay. See documentation, as the file descriptors differ from the standard.

Verilator 3.510 2005-12-17 Stable

Major:

  • Improve trace-on performance on large multi-clock designs by 2x or more. This adds a small ~2% performance penalty if traces are compiled in, but not turned on. For best non-tracing performance, do not use --trace.

Minor:

  • Fix $'s in specify delays causing bad PLI errors. [Mat Zeno]

  • Fix public functions not setting up proper symbol table. [Mat Zeno]

  • Fix genvars generating trace compile errors. [Mat Zeno]

  • Fix VL_MULS_WWW compile error with MSVC++. [Wim Michiels]

Verilator 3.502 2005-11-30 Stable

Minor:

  • Fix local non-IO variables in public functions and tasks.

  • Fix bad lifetime optimization when same signal is assigned multiple times in both branch of an if. [Danny Ding]

Verilator 3.501 2005-11-16 Stable

Major:

  • Add --prof-cfuncs for correlating profiles back to Verilog.

Minor:

  • Fix functions where regs are declared before inputs. [Danny Ding]

  • Fix bad deep expressions with bit-selects and rotate. [Prabhat Gupta]

Verilator 3.500 2005-10-30 Stable

Major:

  • Support signed numbers, >>>, $signed, $unsigned. [MANY!]

  • Support multi-dimensional arrays. [Eugen Fekete]

  • Support very limited Property Specification Language (aka PSL or Sugar). The format and keywords are now very limited, but will grow with future releases. The --assert switch enables this feature.

  • With --assert, generate assertions for synthesis parallel_case and full_case.

Minor:

  • Fix generate if's with empty if/else blocks. [Mat Zeno]

  • Fix generate for cell instantiations with same name. [Mat Zeno]

Verilator 3.481 2005-10-12 Stable

Minor:

  • Add /verilator tracing_on/off/ for waveform control.

  • Fix split optimization reordering $display statements.

Verilator 3.480 2005-09-27 Beta

Major:

  • Allow coverage of flattened modules, and multiple points per line. Coverage analysis requires SystemPerl 1.230 or newer.

Minor:

  • Add preprocessor changes to support meta-comments.

  • Optimize sequential assignments of different bits of same bus; ~5% faster.

  • Optimize away duplicate lookup tables.

  • Optimize wide concatenates into individual words. [Ralf Karge]

  • Optimize local variables from delayed array assignments.

Verilator 3.470 2005-09-06 Stable

Minor:

  • Optimize staging flops under reset blocks.

  • Add '-Werror-...' to upgrade specific warnings to errors.

  • Add GCC branch prediction hints on generated if statements.

  • Fix bad simulation when same function called twice in same expression.

  • Fix preprocessor substitution of quoted parameterized defines.

Verilator 3.464 2005-08-24 Stable

Major:

  • Add &96;systemc_imp_header, for use when using --output-split.

  • Add --stats option to dump design statistics.

Minor:

  • Fix core dump with clock inversion optimizations.

Verilator 3.463 2005-08-05 Stable

Minor:

  • Fix case defaults when not last statement in case list. [Wim Michiels]

Verilator 3.462 2005-08-03 Stable

Minor:

  • Fix reordering of delayed assignments to same memory index. [Wim Michiels]

  • Fix compile error with Flex 2.5.1. [Jens Arm]

  • Fix multiply-instantiated public tasks generating non-compilable code.

Verilator 3.461 2005-07-28 Beta

Minor:

  • Fix compile error with older versions of bison. [Jeff Dutton]

Verilator 3.460 2005-07-27 Beta

Major:

  • Add -output-split option to enable faster parallel GCC compiles. To support --output-split, the makefiles now split VM_CLASSES into VM_CLASSES_FAST and VM_CLASSES_SLOW. This may require a change to local makefiles.

  • Support -v argument to read library files.

Minor:

  • When issuing unoptimizable warning, show an example path.

  • Internal tree dumps now indicate edit number that changed the node.

  • Fix false warning when a clock is constant.

  • Fix X/Z in decimal numbers. [Wim Michiels]

  • Fix genvar statements in non-named generate blocks.

  • Fix core dump when missing newline in &96;define. [David van der Bokke]

Verilator 3.450 2005-07-12

Major:

  • $finish will no longer exit, but set Verilated::gotFinish(). This enables support for final statements, and for other cleanup code. If this is undesired, redefine the vl_user_finish routine. Top level loops should use Verilated::gotFinish() as an exit condition for their loop, and then call top->final(). To prevent an infinite loop, a double $finish will still exit; this may be removed in future releases.

  • Support SystemVerilog keywords $bits, $countones, $isunknown, $onehot, $onehot0, always_comb, always_ff, always_latch, finish.

Minor:

  • Fix "=== 1'bx" to always be false, instead of random.

Verilator 3.440 2005-06-28 Stable

Major:

  • Add Verilog 2001 generate for/if/case statements.

Verilator 3.431 2005-06-24 Stable

Minor:

  • Fix selection bugs introduced in 3.430 beta.

Verilator 3.430 2005-06-22 Beta

Minor:

  • Add Verilog 2001 variable part selects [n+:m] and [n-:m]. [Wim Michiels]

Verilator 3.422 2005-06-10 Stable

Minor:

  • Add Verilog 2001 power (**) operator. [Danny Ding]

  • Fix crash and added error message when assigning to inputs. [Ralf Karge]

  • Fix tracing of modules with public functions.

Verilator 3.421 2005-06-02 Beta

Minor:

  • Fix error about reserved word on non-public signals.

  • Fix missing initialization compile errors in 3.420 beta. [Ralf Karge]

Verilator 3.420 2005-06-02 Beta

Minor:

  • Performance improvements worth ~20%

  • Add -x-assign options; ~5% faster if use -x-assign=0.

  • Add error message when multiple defaults in case statement.

  • Optimize shifts out of conditionals and if statements.

  • Optimize local 'short' wires.

  • Fix case defaults when not last statement in case list. [Ralf Karge]

  • Fix crash when wire self-assigns x=x.

  • Fix gate optimization with top-flattened modules. [Mahesh Kumashikar]

Verilator 3.411 2005-05-30 Stable

Minor:

  • Fix compile error in GCC 2.96. [Jeff Dutton]

Verilator 3.410 2005-05-25 Beta

Major:

  • Allow functions and tasks to be declared public. They will become public C++ functions, with appropriate C++ types. This allows users to make public accessor functions/tasks, instead of having to use public variables and &96;systemc_header hacks.

Minor:

  • Skip producing output files if all inputs are identical This uses timestamps, similar to make. Disable with --no-skip-identical.

  • Improved compile performance with large case statements.

  • Fix internal error in V3Table. [Jeff Dutton]

  • Fix compile error in GCC 2.96, and with SystemC 1.2. [Jeff Dutton]

Verilator 3.400 2005-04-29 Beta

Major:

  • Internal changes to support future clocking features.

  • Verilog-Perl and SystemPerl are no longer required for C++ or SystemC output. If you want tracing or coverage analysis, they are still needed.

  • Add --sc to create pure SystemC output not requiring SystemPerl.

  • Add --pins64 to create 64 bit SystemC outputs instead of sc_bv<64>.

  • The --exe flag is now required to produce executables inside the makefile. This was previously the case any time .cpp files were passed on the command line.

  • Add -O3 and --inline-mult for performance tuning. [Ralf Karge] One experiment regained 5% performance, at a cost of 300% in compile time.

Minor:

  • Improved performance of large case/always statements with low fanin by converting to internal lookup tables (ROMs).

  • Initialize SystemC port names. [S Shuba]

  • Add Doxygen comments to Verilated includes.

  • Fix -cc pins 8 bits wide and less to be uint8_t instead of uint16_t.

  • Fix crash when Mdir has same name as .v file. [Gernot Koch]

  • Fix crash with size mismatches on case items. [Gernot Koch]

Verilator 3.340 2005-02-18 Stable

Minor:

  • Report misconnected pins across all modules, instead of just first error.

  • Improved large netlist compile times.

  • Fix over-active inlining, resulting in compile slowness.

Verilator 3.332 2005-01-27

Major:

  • Add -E preprocess only flag, similar to GCC.

  • Add CMPCONSTLR when comparison is constant due to > or < with all ones.

Minor:

  • Fix loss of first -f file argument, introduced in 3.331.

Verilator 3.331 2005-01-18

Major:

  • The Verilog::Perl preprocessor is now C++ code inside of Verilator. This improves performance, makes compilation easier, and enables some future features.

Minor:

  • Support arrays of instantiations (non-primitives only). [Wim Michiels]

  • Fix unlinked error with defparam. [Shawn Wang]

Verilator 3.320 2004-12-10

Major:

  • NEWS is now renamed Changes, to support CPAN indexing.

  • If Verilator is passed a C file, create a makefile link rule. This saves several user steps when compiling small projects.

Minor:

  • Add new COMBDLY warning in place of fatal error. [Shawn Wang]

  • Fix mis-simulation with wide-arrays under bit selects. [Ralf Karge]

  • Add NC Verilog as alternative to VCS for reference tests.

  • Support implicit wire declarations on input-only signals. (Dangerous, as leads to wires without drivers, but allowed by spec.)

  • Fix compile warnings on Suse 9.1

Verilator 3.311 2004-11-29

Major:

  • Support implicit wire declarations (as a warning). [Shawn Wang]

Minor:

  • Fix over-shift difference in Verilog vs C++. [Ralf Karge]

Verilator 3.310 2004-11-15

Major:

  • Support defparam.

  • Support gate primitives: buf, not, and, nand, or, nor, xor, xnor.

Minor:

  • Ignore all specify blocks.

Verilator 3.302 2004-11-12

Minor:

  • Support NAND and NOR operators.

  • Better warnings when port widths don't match.

  • Fix internal error due to some port width mismatches. [Ralf Karge]

  • Fix WIDTH warnings on modules that are only used parameterized, not in 'default' state.

  • Fix selection of SystemC library on cygwin systems. [Shawn Wang]

  • Fix runtime bit-selection of parameter constants.

Verilator 3.301 2004-11-04

Minor:

  • Fix 64 bit [31:0] = {#{}} mis-simulation. [Ralf Karge]

  • Fix shifts greater then word width mis-simulation. [Ralf Karge]

  • Fix to work around GCC 2.96 negation bug.

Verilator 3.300 2004-10-21

Major:

  • New backend that eliminates most VL macros. Improves performance 20%-50%, depending on frequency of use of signals over 64 bits. GCC compile times with -O2 shrink by a factor of 10.

Minor:

  • Fix "setting unsigned int from signed value" warning.

Verilator 3.271 2004-10-21

Minor:

  • Fix "loops detected" error with some negedge clocks.

  • Fix some output code spacing issues.

Verilator 3.270 2004-10-15

Minor:

  • Support Verilog 2001 parameters in module headers. [Ralf Karge]

  • Faster code to support compilers not inlining all Verilated functions.

  • Fix numeric fault when dividing by zero.

Verilator 3.260 2004-10-07

Major:

  • Support Verilog 2001 named parameter instantiation. [Ralf Karge]

Minor:

  • Return 1's when one bit wide extract indexes outside array bounds.

  • Fix compile warnings on 64-bit operating systems.

  • Fix incorrect dependency in .d file when setting VERILATOR_BIN.

Verilator 3.251 2004-09-09

Minor:

  • Fix parenthesis overflow in Microsoft Visual C++ [Renga Sundararajan]

Verilator 3.250 2004-08-30

Major:

  • Support Microsoft Visual C++ [Renga Sundararajan]

Minor:

  • SystemPerl 1.161+ is required.

Verilator 3.241 2004-08-17

Minor:

  • Support ,'s to separate multiple assignments. [Paul Nitza]

  • Fix shift sign extension problem using non-GCC compilers.

Verilator 3.240 2004-08-13

Major:

  • Verilator now uses 64 bit math where appropriate. Inputs and outputs of 33-64 bits wide to the C++ Verilated model must now be uint64_t's; SystemC has not changed, they will remain sc_bv's. This increases performance by ~ 9% on x86 machines, varying with how frequently 33-64 bit signals occur. Signals 9-16 bits wide are now stored as 16 bit shorts instead of longs, this aids cache packing.

Minor:

  • Fix SystemC compile error with feedthrus. [Paul Nitza]

  • Fix concat value error introduced in 3.230.

Verilator 3.230 2004-08-10

Minor:

  • Add coverage output to test_sp example, SystemPerl 1.160+ is required.

  • Fix time 0 value of signals. [Hans Van Antwerpen] Earlier versions would not evaluate some combinatorial signals until posedge/negedge blocks had been activated.

  • Fix wide constant inputs to public submodules [Hans Van Antwerpen]

  • Fix wide signal width extension bug. Only applies when width mismatch warnings were overridden.

Verilator 3.220 2004-06-22

Major:

  • Many waveform tracing changes:

  • Tracing is now supported on C++ standalone simulations. [John Brownlee]

Minor:

  • When tracing, SystemPerl 1.150 or newer is required.

  • When tracing, Verilator must be called with the --trace switch.

  • Add SystemPerl example to documentation. [John Brownlee]

  • Various Cygwin compilation fixes. [John Brownlee]

Verilator 3.210 2004-04-01

Major:

  • Compiler optimization switches have changed See the BENCHMARKING section of the documentation.

  • With Verilog-Perl 2.3 or newer, Verilator supports SystemVerilog preprocessor extensions.

Minor:

  • Add localparam. [Thomas Hawkins]

  • Add warnings for SystemVerilog reserved words.

Verilator 3.203 2004-03-10

Minor:

  • Notes and repairs for Solaris. [Fred Ma]

Verilator 3.202 2004-01-27

Major:

  • The beta version is now the primary release. See below for many changes. If you have many problems, you may wish to try release 3.125.

  • Verilated::traceEverOn(true) must be called at time 0 if you will ever turn on tracing (waveform dumping) of signals. Future versions will need this switch to disable trace incompatible optimizations.

Minor:

  • Optimize common replication operations.

  • Fix several tracing bugs

Verilator 3.201-beta 2003-12-10

Major:

  • BETA VERSION, USE 3.124 for stable release!

  • Version 3.2XX includes an all new back-end. This includes automatic inlining, flattening of signals between hierarchy, and complete ordering of statements. This results in 60-300% execution speedups, though less pretty C++ output. Even better results are possible using GCC 3.2.2 (part of Redhat 9.1), as GCC has fixed some optimization problems which Verilator exposes.

    If you are using &96;systemc_ctor, beware pointers to submodules are now initialized after the constructor is called for a module, to avoid segfaults, move statements that reference subcells into initial statements.

  • C++ Constructor that creates a verilog module may take a char* name. This name will be used to prefix any $display %m arguments, so users may distinguish between multiple Verilated modules in a single executable.

Verilator 3.125 2004-01-27

Minor:

  • Optimize bit replications

Verilator 3.124 2003-12-05

Major:

  • An optimized executable will be made by default, in addition to a debug executable. Invoking Verilator with --debug will pick the debug version.

Minor:

  • Many minor invisible changes to support the next version.

Verilator 3.123 2003-11-10

Minor:

  • Wide bus performance enhancements.

  • Fix function call bug when width warning suppressed. [Leon Wildman]

  • Fix __DOT__ compile problem with funcs in last revision. [Leon Wildman]

Verilator 3.122 2003-10-29

Major:

  • Modules which are accessed from external code now must be marked with /verilator public_module/ unless they already contain public signals. To enforce this, private cell names now have a string prepended.

Minor:

  • Fix replicated function calls in one statement. [Robert A. Clark]

  • Fix function call bug when width warning suppressed. [Leon Wildman]

Verilator 3.121 2003-09-29

Minor:

  • Support multiplication over 32 bits. [Chris Boumenot] Also improved speed of addition and subtraction over 32 bits.

  • Detect bit selection out of range errors.

  • Detect integer width errors.

  • Fix width problems on function arguments. [Robert A. Clark]

Verilator 3.120 2003-09-24

Minor:

  • $finish now exits the model (via vl_finish function).

  • Support inputs/outputs in tasks.

  • Support V2K "integer int = {INITIAL_VALUE};"

  • Ignore floating point delay values. [Robert A. Clark]

  • Ignore &96;celldefine, &96;endcelldefine, etc. [Robert A. Clark]

  • Optimize reduction operators.

  • Fix converting "ooo" into octal values.

  • Fix $display("%x");

Verilator 3.112 2003-09-16

Minor:

  • Fix functions in continuous assignments. [Robert A. Clark]

  • Fix inlining of modules with 2-level deep outputs.

Verilator 3.111 2003-09-15

Minor:

  • Fix declaration of functions before using that module. [Robert A. Clark]

  • Fix module inlining bug with outputs.

Verilator 3.110 2003-09-12

Major:

  • Support Verilog 2001 style input/output declarations. [Robert A. Clark]

  • Support local vars in headers of function/tasks. [Leon Wildman]

Verilator 3.109 2003-08-28

Major:

  • Support local variables in named begin blocks. [Leon Wildman]

Verilator 3.108 2003-08-11

Major:

  • Support functions.

Minor:

  • Signals 8 bits and shorter are now stored as chars instead of uint32_t's. This improves Dcache packing and improves performance by ~7%.

  • $display now usually results in a single VL_PRINT rather then many.

  • Optimize conditionals (?:)

Verilator 3.107 2003-07-15

Major:

  • --private and --l2name are now the default, as this enables additional optimizations. Use --noprivate or --nol2name to get the older behavior.

Minor:

  • Now support $display of binary and wide format data.

  • Add detection of incomplete case statements, and added related optimizations worth ~4%.

  • Work around flex bug in Redhat 8.0. [Eugene Weber]

  • Add some additional C++ reserved words.

  • Additional constant optimizations, ~5% speed improvement.

Verilator 3.106 2003-06-17

Major:

  • $c can now take multiple expressions as arguments. For example $c("foo","bar(",32+1,");") will insert "foobar(33);" This makes it easier to pass the values of signals.

  • Several changes to support future versions that may have signal-eliminating optimizations. Users should try to use these switch on designs, they will become the default in later versions.

  • Add --private switch and /verilator public/ metacomment. This renames all signals so that compile errors will result if any signals referenced by C++ code are missing a /verilator public/ metacomment.

  • With --l2name, the second level cell C++ cell is now named "v". Previously it was named based on the name of the verilog code. This means to get to signals, scope to "{topcell} ->v ->{mysignal}" instead of "{topcell} ->{verilogmod}. {mysignal}". This allows different modules to be substituted for the cell without requiring source changes.

Minor:

  • Several cleanups for Redhat 8.0.

Verilator 3.105 2003-05-08

Minor:

  • Fix more GCC 3.2 errors. [David Black]

Verilator 3.104 2003-04-30

Major:

  • Indicate direction of ports with VL_IN and VL_OUT.

  • Allow $c32, etc, to specify width of the $c statement.

  • Numerous performance improvements, worth about 25%

Minor:

  • Fix false "indent underflow" error inside &96;systemc_ctor sections.

  • Fix missing ordering optimizations when outputs also used internally.

  • Assign constant cell pins in initial blocks rather then every cycle.

  • Promote subcell's combo logic to sequential evaluation when possible.

  • Fix GCC 3.2 compile errors. [Narayan Bhagavatula]

Verilator 3.103 2003-01-28

Minor:

  • Fix missing model evaluation when clock generated several levels of hierarchy across from where it is used as a clock. [Richard Myers]

  • Fix sign-extension bug introduced in 3.102.

Verilator 3.102 2003-01-24

Minor:

  • Fix sign-extension of X/Z's ("32'hx")

Verilator 3.101 2003-01-13

Minor:

  • Fix 'parameter FOO=#'bXXXX' [Richard Myers]

  • Allow spaces inside numbers ("32'h 1234") [Sam Gladstone]

Verilator 3.100 2002-12-23

Major:

  • Support for simple tasks w/o vars or I/O. [Richard Myers]

Minor:

  • Ignore DOS carriage returns in Linux files. [Richard Myers]

Verilator 3.012 2002-12-18

Minor:

  • Fix parsing bug with casex statements containing case items with bit extracts of parameters. [Richard Myers]

  • Fix bug which could cause writes of non-power-of-2 sized arrays to corrupt memory beyond the size of the array. [Dan Lussier]

  • Fix bug which did not detect UNOPT problems caused by submodules. See the description in the verilator man page. [John Deroo]

  • Fix compile with threaded Perl. [Ami Keren]

Verilator 3.010 2002-11-03

Major:

  • Support SystemC 2.0.1. SystemPerl version 1.130 or newer is required.

Minor:

  • Fix bug with inlined modules under other inlined modules. [Scott Bleiweiss]

Verilator 3.005 2002-10-21

Minor:

  • Fix X's in case (not casex/z) to constant propagate correctly.

  • Fix missing include. [Kurachi]

Verilator 3.004 2002-10-10

Minor:

  • Add module_inline metacomment and associated optimizations.

  • Allow coverage_block_off metacomment in place of &96;coverage_block_off. This prevents problems with Emacs AUTORESET. [Ray Strouble]

  • Fix &96;coverage_block_off also disabling subsequent blocks.

  • Fix unrolling of loops with multiple simple statements.

  • Fix compile warnings on newer GCC. [Kurachi]

  • Additional concatenation optimizations.

Verilator 3.003 2002-09-13

Minor:

  • Now compiles on Windows 2000 with Cygwin.

  • Fix bug with pin assignments to wide memories.

  • Optimize wire assignments to constants.

Verilator 3.002 2002-08-19

Major:

  • First public release of version 3.

Verilator 3.000 2002-08-03

Major:

  • All new code base. Many changes too numerous to mention.

Minor:

  • Approximately 4 times faster then Verilator 2.

  • Support initial statements

  • Support correct blocking/nonblocking assignments

  • Support &96;defines across multiple modules

  • Optimize call ordering, constant propagation, and dead code elimination.

Verilator 2.1.8 2002-04-03

Major:

  • All applications must now link against include/verilated.cpp

Minor:

  • Paths specified to verilator_make should be absolute, or be formed to allow for execution in the object directory (prepend ../ to each path.) This allows relative filenames for makes which hash and cache dependencies.

  • Add warning when parameter constants are too large. [John Deroo]

  • Add warning when x/?'s used in non-casez statements.

  • Add warning when blocking assignments used in posedge blocks. [Dan Lussier]

  • Split evaluation function into clocked and non-clocked, 20% perf gain.

Verilator 2.1.5 2001-12-01

Major:

  • Add coverage analysis. In conjunction with SystemC provide line coverage reports, without SystemC, provide a hook to user written accumulation function. See --coverage option of verilator_make.

Minor:

  • Relaxed multiply range checking

  • Support for constants up to 128 bits

  • Randomize values used when assigning to X's.

  • Add -guard option of internal testing.

  • Changed indentation in emitted code to be automatically generated.

  • Fix corruption of assignments of signal over 32 bits with non-0 lsb.

Verilator 2.1.4 2001-11-16

Major:

  • Add $c("c_commands();"); for embedding arbitrary C code in Verilog.

Verilator 2.1.3 2001-11-03

Major:

  • Support for parameters.

Verilator 2.1.2 2001-10-25

Major:

  • Verilog Errors now reference the .v file rather then the .vpp file.

Minor:

  • Support strings in assignments: reg [31:0] foo = "STRG";

  • Support %m in format strings. Ripped out old $info support, use Verilog-Perl's vpm program instead.

  • Convert $stop to call of v_stop() which user can define.

  • Fix bug where a==b==c would have wrong precedence rule.

  • Fix bug where XNOR on odd-bit-widths (~^ or ^~) had bad value.

Verilator 2.1.1 2001-05-17

Major:

  • New test_sp directory for System-Perl (SystemC) top level instantiation of the Verilated code, lower modules are still C++ code. (Experimental).

  • New test_spp directory for Pure System-Perl (SystemC) where every module is true SystemC code. (Experimental)

Minor:

  • Input ports are now loaded by pointer reference into the sub-cell. This is faster on I-386 machines, as the stack must be used when there are a large number of parameters. Also, this simplifies debugging as the value of input ports exists for tracing.

  • Many code cleanups towards standard C++ style conventions.

Verilator 2.1.0 2001-05-08

Minor:

  • Many code cleanups towards standard C++ style conventions.

Version history lost

Verilator 1.8 1996-07-08

[Versions 0 to 1.8 were by Paul Wasson] * Fix single bit in concat from instance output incorrect offset bug.

Verilator 1.7 1996-05-20

  • Mask unused bits of DONTCAREs.

Verilator 1.6 1996-05-13

  • Add fasttrace script

Verilator 1.5 1996-01-09

  • Pass structure pointer into translated code, so multiple instances can use same functions.

  • Fix static value concat on casex items.

Verilator 1.1 1995-03-30

  • Bug fixes, added verimake_partial script, performance improvements.

Verilator 1.0c 1994-09-30

  • Initial release of Verilator

Verilator 0.0 1994-07-08

  • First code written.

版权

Verilator 的最新版本可从 https://verilator.org 获取。

Copyright 2003-2026 by Wilson Snyder。Verilator 是自由软件;你可以依据 GNU Lesser General Public License Version 3 或 Perl Artistic License Version 2.0 的条款重新分发和/或修改 Verilator 内部实现。

本文档文件中引用的所有 Verilog 和 C++/SystemC 代码均以 Creative Commons Public Domain (CC0) 发布。许多示例文件和测试文件同样以 CC0 发布,实际上归入 公共领域,具体如这些文件自身所述。