← 返回命令列表

Linux command

verilator 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Lint Verilog

verilator --lint-only [design.v]

Compile to C++

verilator --cc [design.v]

With testbench

verilator --cc [design.v] --exe [testbench.cpp]

Build simulation

verilator --cc [design.v] --exe [tb.cpp] --build

Generate waves

verilator --cc [design.v] --trace

Generate SystemC

verilator --sc [design.v]

Build binary

verilator --binary [design.v] --exe [tb.cpp]

Compile with parallel jobs

verilator --cc [design.v] --exe [tb.cpp] --build -j [4]

说明

verilator converts synthesizable Verilog and SystemVerilog designs into optimized C++ or SystemC models. The generated code compiles to native executables that run significantly faster than interpreted simulators, making it one of the fastest open-source Verilog simulators available. The tool also functions as a lint checker with --lint-only, catching common coding errors and style issues without generating simulation code. Waveform tracing can be enabled with --trace to produce VCD files for viewing in waveform viewers like GTKWave.

参数

--lint-only
Lint check only.
--cc
Generate C++.
--exe
Create executable.
--build
Compile output.
--trace
Enable waveforms.
--sc
Generate SystemC output.
--binary
Generate C++ and build a binary executable directly.
-Wall
Enable all warnings.
--top-module _module_
Specify the top-level module name.
-j _N_
Parallelism for build jobs.
-CFLAGS _flags_
Pass flags to the C++ compiler.
-LDFLAGS _flags_
Pass flags to the C++ linker.

FAQ

What is the verilator command used for?

verilator converts synthesizable Verilog and SystemVerilog designs into optimized C++ or SystemC models. The generated code compiles to native executables that run significantly faster than interpreted simulators, making it one of the fastest open-source Verilog simulators available. The tool also functions as a lint checker with --lint-only, catching common coding errors and style issues without generating simulation code. Waveform tracing can be enabled with --trace to produce VCD files for viewing in waveform viewers like GTKWave.

How do I run a basic verilator example?

Run `verilator --lint-only [design.v]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --lint-only do in verilator?

Lint check only.