vhpi
This crate provides a high-level wrapper around VHPI (VHDL Procedural Interface) allowing the user to inspect and control a VHDL simulation. See nvc for a supported simulator.
A full description of VHPI capabilities can be found in the VHDL LRM.
Coverage Note
The vhpi crate covers the most common workflows (handles/iteration,
properties, callbacks, values, time, simulation control, errors, and
foreign model registration), but it does not yet wrap every API entry
in vhpi_user.h.
At the time of writing, the following vhpi_user.h APIs are not exposed
through a high-level wrapper in this crate:
vhpi_protected_callvhpi_schedule_transactionvhpi_format_valuevhpi_createvhpi_get_datavhpi_put_data
In addition, vhpi_vprintf is not and will not be supported as it should be preferred to use Rust formatting. If you have a use case, open an issue.
If you need one of these APIs today, call it through vhpi-sys directly
from your plugin code.
Usage
Add vhpi to your Cargo.toml:
[]
= "0.6.0"
VHPI programs are usually compiled as plugins and loaded into the simulator which requires:
[]
= ["cdylib"]
If you get linker errors on Windows and macOS because you are trying to build a stand-alone plugin, use the dynamic feature:
[]
= { = "0.6.0", = ["dynamic"] }
or, if you have nvc installed, link with $PREFIX/lib/nvc/libnvcimp.a.