Expand description
Safe and ergonomic wrappers for selected Verilog VPI APIs.
§Features
| Feature | Description | Default |
|---|---|---|
bigint | Enables conversion between LogicVec and arbitrary-precision integers using num_bigint::BigInt and num_bigint::BigUint. | No |
cb_info | Uses vpi_get_cb_info when removing callbacks. | Yes |
dynamic | Enables runtime VPI symbol lookup via vpi-shim on Windows and macOS, allowing plugins to build without directly linking to a simulator library. | No |
release_handle | Calls vpi_release_handle when dropping a Handle. | No |
sv | Enables SystemVerilog VPI extensions (types, callbacks, and properties defined in IEEE 1800). | No |
value_array | Enables support for VPI array values via vpi_get_value_array and vpi_put_value_array. Otherwise the related functions are still available, but use repeated calls to the scalar vpi_get_value and vpi_put_value functions. | No |
verilator | Enables support for Verilator-specific VPI extensions, including two-state and four-state raw vector values. | No |
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§
- Assertion
Attempt Info sv - Safe wrapper for
t_vpi_attempt_info. - Assertion
CbData sv - Safe callback data passed to SystemVerilog assertion callbacks.
- Assertion
Step Info sv - Decoded step-transition details for assertion step callbacks.
- CbData
- Safe callback data passed to Rust closures.
- Delay
Data - Safe representation of
s_vpi_delay. - 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. - Logic
Vec - A vector of
LogicValrepresenting a multi-bit signal value. - MCD
- Multi-channel descriptor used by VPI for output streams.
- PutValue
Array Flags - Flags controlling behavior of
vpi_put_value_array. - PutValue
Flags - Flags controlling behavior of
vpi_put_value. - Simulator
Info - Simulator metadata reported by
vpi_get_vlog_info. - Strength
Value - Scalar logic value plus drive strengths.
- Systf
Info - Owned view of data returned by
vpi_get_systf_info. - Timescale
- Represents a module’s timescale information
- VPIError
- Rich error information returned by
vpi_chk_error.
Enums§
- Assertion
Attempt Detail sv - Decoded union payload from
t_vpi_attempt_info.detail. - Assertion
Control sv - SystemVerilog assertion control operations for
vpi_control. - CbReason
- VPI callback reasons used when registering simulator callbacks.
- Const
Type - Literal/constant encoding type.
- Control
- Simulator control operations for
vpi_control. - Coverage
Control sv - SystemVerilog coverage control operations for
vpi_control. - Delay
Time Type - Time encoding used by VPI delay records.
- Direction
- Port direction classification.
- Dist
Type sv - SystemVerilog distribution style used by distribution constraints.
- Error
State - Simulation phase/state where an error occurred.
- Func
Type - Function return type classification.
- Logic
Val - 4-state scalar encodings used by VPI.
- Logic
VecTo IntError - Error type for failed conversions from
LogicVecto integer types. - 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. - PutValue
Delay - Delay mode used with
vpi_put_value. - Rand
Type sv - SystemVerilog randomization qualifier for variables.
- Severity
- Error severity levels reported by VPI.
- Strength
- Drive-strength and charge encodings used by VPI.
- SysFunc
Type - System function return type classification.
- Systf
Kind - System task/function registration kind.
- 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§
- assertion_
control sv - Invokes
vpi_controlwith a SystemVerilog assertion control operation. - bigint_
to_ scalar_ vector Deprecated bigint - Convert a
num_bigint::BigIntto a two’s-complement-encodedVec<LogicVal>(MSB at index 0). - biguint_
to_ scalar_ vector Deprecated bigint - Convert a
num_bigint::BigUintto a binary-encodedVec<LogicVal>(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. - coverage_
control sv - Invokes
vpi_controlwith a SystemVerilog coverage control operation. - current_
simulation_ time - Returns the current simulation time.
- current_
systf_ call - Returns the current system task/function call handle.
- current_
systf_ info - Retrieves owned system task/function metadata for the current
calltf. - flush
- Flushes the simulator’s default output streams via
vpi_flush. - get_
systf_ arg - Returns one system task/function argument by index in a requested format.
- get_
systf_ args - Returns system task/function arguments using per-argument value formats.
- get_
systf_ info - Retrieves owned system task/function metadata for a VPI object.
- get_
systf_ info_ raw - Retrieves raw system task/function metadata for a VPI object.
- get_
top_ module_ timescales - Returns timescale information for top-level modules.
- int64_
to_ scalar_ vector Deprecated - Convert an
i64to a two’s-complement-encodedVec<LogicVal>(MSB at index 0). - int_
array_ to_ value_ array - Promote an
i32array to a homogeneousValuearray. - longint_
array_ to_ value_ array - Promote an
i64array to a homogeneousValuearray. - printf
- Prints a message through the simulator’s
vpi_printf. - real_
array_ to_ value_ array - Promote an
f64array to a homogeneousValuearray. - register_
assertion_ cb sv - Registers a SystemVerilog assertion callback.
- 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.
- register_
systf - Registers a system task or function with typed inputs.
- register_
systf_ raw - Registers a raw
s_vpi_systf_datarecord with the simulator. - remove_
assertion_ cb sv - Removes a previously registered SystemVerilog assertion callback.
- remove_
cb cb_info - Removes a previously registered callback.
- scalar_
array_ to_ value_ array - Promote a scalar array to a homogeneous
Valuearray. - scalar_
vector_ to_ bigint Deprecated bigint - Convert a two’s-complement-encoded
LogicValslice (MSB at index 0) to anum_bigint::BigInt. - scalar_
vector_ to_ biguint bigint - Convert a binary-encoded
LogicValslice (MSB at index 0) to anum_bigint::BigUint. - scalar_
vector_ to_ int64 Deprecated - Convert a two’s-complement-encoded
LogicValslice (MSB at index 0) to ani64. - scalar_
vector_ to_ string Deprecated - Convert a scalar vector into a compact string representation.
- scalar_
vector_ to_ uint64 - Convert a binary-encoded
LogicValslice (MSB at index 0) to au64. - shortint_
array_ to_ value_ array - Promote an
i16array to a homogeneousValuearray. - shortreal_
array_ to_ value_ array - Promote an
f32array to a homogeneousValuearray. - 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.
- strength_
array_ to_ value_ array - Promote a strength array to a homogeneous
Valuearray. - string_
array_ to_ value_ array - Promote a
Stringarray to a homogeneousValuearray. - string_
to_ ascii_ cstring - Converts a Rust string into a 7-bit ASCII
CString. - string_
to_ scalar_ vector Deprecated - Convert a scalar string into a vector of scalar values.
- time_
array_ to_ value_ array - Promote a time array to a homogeneous
Valuearray. - time_
to_ type - Converts a
Timevariant into the correspondingDelayTimeType. - uint64_
to_ scalar_ vector Deprecated - Convert a
u64to a binary-encodedVec<LogicVal>(MSB at index 0). - value_
array_ to_ int_ array - Demote a homogeneous
Valuearray toi32values. - value_
array_ to_ longint_ array - Demote a homogeneous
Valuearray toi64values. - value_
array_ to_ real_ array - Demote a homogeneous
Valuearray tof64values. - value_
array_ to_ scalar_ array - Demote a homogeneous
Valuearray to scalar values. - value_
array_ to_ shortint_ array - Demote a homogeneous
Valuearray toi16values. - value_
array_ to_ shortreal_ array - Demote a homogeneous
Valuearray tof32values. - value_
array_ to_ strength_ array - Demote a homogeneous
Valuearray to strength values. - value_
array_ to_ string_ array - Demote a homogeneous
Valuearray toStringvalues. - value_
array_ to_ time_ array - Demote a homogeneous
Valuearray to time values.
Type Aliases§
- RawSystf
Data - Raw VPI registration record type.
- Systf
Callback - Function pointer type for VPI system task/function callbacks.