Expand description
Safe and ergonomic wrappers for selected Verilog VPI APIs.
§Features
| Feature | Description |
|---|---|
bigint | Enables conversion between ScalarValue slices and arbitrary-precision integers using num_bigint::BigInt and num_bigint::BigUint. |
cb_info | Uses vpi_get_cb_info when removing callbacks. Enabled by default. |
dynamic | Enables runtime VPI symbol lookup via vpi-shim on Windows and macOS, allowing plugins to build without directly linking to a simulator library. |
sv | Enables SystemVerilog VPI extensions (types, callbacks, and properties defined in IEEE 1800). |
Macros§
- count_
idents - Counts macro expression arguments at compile time.
- mcd_
println - Formats and writes a line to an
MCD. - printf
format!-style wrapper around [printf].- startup_
routines - Declares the
vlog_startup_routinessymbol required by VPI simulators.
Structs§
- CbData
- Safe callback data passed to Rust closures.
- Edge
- Edge sensitivity mask values.
- Handle
- Wrapper around a raw VPI object handle.
- Handle
Iterator - Iterator over VPI scan results from
vpi_iterate/vpi_scan. - MCD
- Multi-channel descriptor used by VPI for output streams.
- PutValue
Flags - Flags controlling behavior of
vpi_put_value. - Simulator
Info - Simulator metadata reported by
vpi_get_vlog_info. - Strength
Encoding - Drive-strength and charge encoding flags.
- Strength
Value - Scalar logic value plus drive strengths.
- Timescale
- Represents a module’s timescale information
- VPIError
- Rich error information returned by
vpi_chk_error.
Enums§
- CbReason
- VPI callback reasons used when registering simulator callbacks.
- Const
Type - Literal/constant encoding type.
- Control
- Simulator control operations for
vpi_control. - Direction
- Port direction classification.
- Error
State - Simulation phase/state where an error occurred.
- Func
Type - Function return type classification.
- NetType
- Net type classification for net objects.
- Object
Type - VPI object and relation kinds used with handle traversal APIs.
- OpType
- Operation subtype for expression objects.
- Prim
Type - Primitive instance subtype.
- Property
- VPI property identifiers used with
vpi_getandvpi_get_str. - Scalar
Value - 4-state scalar encodings used by VPI.
- Severity
- Error severity levels reported by VPI.
- SysFunc
Type - System function return type classification.
- Tchk
Type - Timing check subtype.
- Time
- Time value representation used by VPI APIs.
- Value
- High-level value representation returned from or written to VPI objects.
- Value
Type - VPI value format tags used with
vpi_get_valueand related APIs.
Statics§
- MCD_
STDOUT - Standard output MCD descriptor.
Functions§
- bigint_
to_ scalar_ vector bigint - Convert a
num_bigint::BigIntto a two’s-complement-encodedVec<ScalarValue>(MSB at index 0). - biguint_
to_ scalar_ vector bigint - Convert a
num_bigint::BigUintto a binary-encodedVec<ScalarValue>(MSB at index 0). - check_
error - Alias of
chk_errorfor consistency with rust-vhpi - chk_
error - Checks whether the simulator has a pending VPI error.
- control
- Invokes
vpi_controlwith the selected operation. - current_
simulation_ time - Returns the current simulation time.
- get_
top_ module_ timescales - Returns timescale information for top-level modules.
- int64_
to_ scalar_ vector - Convert an
i64to a two’s-complement-encodedVec<ScalarValue>(MSB at index 0). - printf
- Prints a message through the simulator’s
vpi_printf. - register_
cb - Registers a global callback not tied to a specific object handle.
- register_
cb_ with_ time - Registers a time-based callback.
- register_
full_ cb - Registers a global callback with persistent time/value registration buffers.
- remove_
cb cb_info - Removes a previously registered callback.
- scalar_
vector_ to_ bigint bigint - Convert a two’s-complement-encoded
ScalarValueslice (MSB at index 0) to anum_bigint::BigInt. - scalar_
vector_ to_ biguint bigint - Convert a binary-encoded
ScalarValueslice (MSB at index 0) to anum_bigint::BigUint. - scalar_
vector_ to_ int64 - Convert a two’s-complement-encoded
ScalarValueslice (MSB at index 0) to ani64. - scalar_
vector_ to_ uint64 - Convert a binary-encoded
ScalarValueslice (MSB at index 0) to au64. - simulator_
info - Returns simulator invocation metadata from
vpi_get_vlog_info. - simulator_
name - Returns the simulator product name.
- simulator_
version - Returns the simulator version string.
- string_
to_ ascii_ cstring - Converts a Rust string into a 7-bit ASCII
CString. - uint64_
to_ scalar_ vector - Convert a
u64to a binary-encodedVec<ScalarValue>(MSB at index 0). - vector_
value_ to_ scalar_ vector - Convert VPI vector values to a vector of scalar values