Expand description
Safe and ergonomic wrappers for selected Verilog VPI APIs.
§Features
| Feature | Description | Default |
|---|---|---|
bigint | Enables conversion between ScalarValue slices 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 |
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 |
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. - 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.
- 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.
- Scalar
Value - 4-state scalar encodings used by VPI.
- 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 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. - 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 - Convert an
i64to a two’s-complement-encodedVec<ScalarValue>(MSB at index 0). - printf
- Prints a message through the simulator’s
vpi_printf. - 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_
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_ string - Convert a scalar vector into a compact string representation.
- 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. - string_
to_ scalar_ vector - Convert a scalar string into a vector of scalar values.
- time_
to_ type - Converts a
Timevariant into the correspondingDelayTimeType. - uint64_
to_ scalar_ vector - Convert a
u64to a binary-encodedVec<ScalarValue>(MSB at index 0).
Type Aliases§
- RawSystf
Data - Raw VPI registration record type.
- Systf
Callback - Function pointer type for VPI system task/function callbacks.