Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Simulator

Test is executed through veryl test.

For native test, Veryl’s built-in simulator is used. No external simulator installation is required.

The native simulator selects its code-generation backend through veryl test --backend:

BackendDescription
ccDefault. Emits C, compiles with an external C compiler (gcc or clang with -O3), then loads the result.
craneliftIn-process Cranelift JIT.
interpretWalks the IR each cycle without code generation.

The cc backend requires cc (typically gcc or clang) to be available on PATH. If cc is missing, or a particular construct is not yet covered by the cc emitter, the simulator transparently falls back to Cranelift for that part. Use veryl test --backend-validate to dual-run the cc backend against Cranelift and abort on any divergence.

For SystemVerilog test and cocotb test, an external RTL simulator is required. Supported simulators are below:

Verilator is the default simulator. If no simulator is specified through Veryl.toml and command-line option, it will be used.

The available configurations are here.

cocotb

cocotb tests require python3 environment in which cocotb is installed. The supported version of cocotb is 1.9.x and 2.0.x.

For example, it can be installed by the following command.

$ pip3 install cocotb==2.0.0

As simulator backend, Verilator is only supported.