iverilog-vpi(1)

πŸ“¦
version 13.0 Β· 3 versions
, in alpine 3.24, arch rolling, epel 10, fedora 44, nixos 26.05, nixpkgs unstable, ubuntu stonking

πŸ’– iverilog-vpi β€” the compile front end for VPI modules πŸ’–

okay bestie, so this is iverilog-vpi(1), from the Version 13.0 (stable) era of the Icarus Verilog manual, and it is literally the glow-up your VPI module deserves. ✨


πŸŽ€ NAME πŸŽ€

iverilog-vpi β€” Compile front end for VPI modules


🌸 SYNOPSIS 🌸

iverilog-vpi [options] sourcefile...

πŸ¦‹ DESCRIPTION πŸ¦‹

So iverilog-vpi is the tool that makes compiling VPI modules for Icarus Verilog not a whole ordeal. You hand it a list of C or C++ source files on the command line, and it hands you back a linked VPI module. That's it, that's the whole serve. πŸ’…

Want the tea on how that linked module actually gets loaded by a simulation? Go read the vvp(1) man page, she explains it all.

By default the output gets named after the first source file. So if your first source file is named foo.c, the output becomes foo.vpi. Iconic, predictable, we love a naming convention that just works. πŸ’–


✨ OPTIONS ✨

iverilog-vpi accepts the following options:

  • -llibrary β€” Include the named library in the link of the VPI module. This lets your VPI modules go reference external libraries too, no cap.
  • -Ldirectory β€” Add directory to the list of directories that will be searched for library files.
  • -Idirectory β€” Add directory to the list of directories that will be searched for header files.
  • -Ddefine β€” Define a macro named define.
  • --name=name β€” Normally the output VPI module gets named after the first source file you passed to the command. This flag sets the name (without the .vpi suffix) of the output vpi module. So you get to pick, main character style. πŸ‘‘

πŸ–₯️ PC-ONLY OPTIONS πŸ–₯️

Heads up bestie, this section is only for the Windows girlies.

When it's built as a native Windows program (using the MinGW toolchain), by default iverilog-vpi will try to locate the MinGW tools it needs to compile a VPI module on the system path (as set by the PATH environment variable). But as an alternative, you can just tell it where the MinGW tools live with this option:

  • -mingw=path β€” Tell the program the root of the MinGW compiler tool suite. The vvp runtime is compiled with this compiler, and this is the compiler that iverilog-vpi expects to use to compile your source code. If this option accompanies a list of files, it will apply to the current build only. If this option is provided on its own, iverilog-vpi will save the path in the registry and use that path in preference to the system path for subsequent operations β€” which means you avoid the need to specify it on the command line every single time. Obsessed with a tool that remembers things for you. 🫢

πŸ” INFORMATIONAL OPTIONS πŸ”

iverilog-vpi also includes extra flags so the Makefile gurus can peek at the configuration of the iverilog installation. πŸ‘€ The whole point is that Makefiles can be written that handle complex VPI builds natively, and without hard-coding values that depend on the system and installation. So much cleaner, fr fr.

Real talk though: if you use these at all, they must be used one at a time, and without any other options or directives. Don't get cute with it.
  • --install-dir β€” Print the install directory for VPI modules.
  • --cflags β€” Print the compiler flags (CFLAGS or CXXFLAGS) needed to compile source code destined for a VPI module.
  • --ldflags β€” Print the linker flags (LDFLAGS) needed to link a VPI module.
  • --ldlibs β€” Print the libraries (LDLIBS) needed to link a VPI module.

Example GNU makefile that takes advantage of these flags β€” copy this vibe exactly:

CFLAGS = -Wall -O $(CFLAGS_$@)
VPI_CFLAGS := $(shell iverilog-vpi --cflags)
CFLAGS_messagev.o = $(VPI_CFLAGS)
CFLAGS_fifo.o = $(VPI_CFLAGS)
messagev.o fifo.o: transport.h
messagev.vpi: messagev.o fifo.o
     iverilog-vpi $^

πŸ‘‘ AUTHOR πŸ‘‘

Steve Williams (steve@icarus.com)


🌈 SEE ALSO 🌈

iverilog(1), vvp(1), <https://steveicarus.github.io/iverilog/>, <http://mingw-w64.yaxm.org/>,


Copyright Β© 2002-2026 Stephen Williams

This document can be freely redistributed according to the terms of the GNU General Public License version 2.0


okay that's the whole page, you ate it up, you understood it, periodt. πŸ’…βœ¨

Signing off from the iverilog-vpi(1) corner of the manual β€” this was the Version 13.0 (stable) era, dated Jan 13th, 2026. Take care of her, she's iconic. πŸŽ€πŸ’–