Project structure
vhpi-sys/- raw low-level generated bindings to C API.vhpi/- higher level Rust bindings.vhpi-shim/- platform shim library used by thedynamicfeature.dumper/- example plugin.tests/test_simple/- assertion-based plugin fortb_simplecheckpoints.tests/stringindexing/- plugin that checks string indexing.
Test with the example plugin
cargo build && nvc --vhpi-trace --load ./target/debug/libdumper.so -r toplevelOn Windows, load ./target/debug/dumper.dll instead of libdumper.so.
On macOS, load ./target/debug/libdumper.dylib.
For linux there is usually no need to do anything special, but the plugin will be able to find the VHPI symbols at run time.
For Windows and macOS, one can add the dynamic feature which will add a shim for dynamically resolving the VHPI symbols at run time. If using nvc, there is an import library at $PREFIX/lib/nvc/libnvcimp.a that can linked to. This may also work for other simulators.