Skip to main content

Crate vpi

Crate vpi 

Source
Expand description

Safe and ergonomic wrappers for selected Verilog VPI APIs.

§Features

FeatureDescriptionDefault
bigintEnables conversion between LogicVec and arbitrary-precision integers using num_bigint::BigInt and num_bigint::BigUint.No
cb_infoUses vpi_get_cb_info when removing callbacks.Yes
dynamicEnables runtime VPI symbol lookup via vpi-shim on Windows and macOS, allowing plugins to build without directly linking to a simulator library.No
release_handleCalls vpi_release_handle when dropping a Handle.No
svEnables SystemVerilog VPI extensions (types, callbacks, and properties defined in IEEE 1800).No
value_arrayEnables 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
verilatorEnables 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_routines symbol required by VPI simulators.

Structs§

AssertionAttemptInfosv
Safe wrapper for t_vpi_attempt_info.
AssertionCbDatasv
Safe callback data passed to SystemVerilog assertion callbacks.
AssertionStepInfosv
Decoded step-transition details for assertion step callbacks.
CbData
Safe callback data passed to Rust closures.
DelayData
Safe representation of s_vpi_delay.
Edge
Edge sensitivity mask values.
Handle
Wrapper around a raw VPI object handle.
HandleIterator
Iterator over VPI scan results from vpi_iterate/vpi_scan.
LogicVec
A vector of LogicVal representing a multi-bit signal value.
MCD
Multi-channel descriptor used by VPI for output streams.
PutValueArrayFlags
Flags controlling behavior of vpi_put_value_array.
PutValueFlags
Flags controlling behavior of vpi_put_value.
SimulatorInfo
Simulator metadata reported by vpi_get_vlog_info.
StrengthValue
Scalar logic value plus drive strengths.
SystfInfo
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§

AssertionAttemptDetailsv
Decoded union payload from t_vpi_attempt_info.detail.
AssertionControlsv
SystemVerilog assertion control operations for vpi_control.
CbReason
VPI callback reasons used when registering simulator callbacks.
ConstType
Literal/constant encoding type.
Control
Simulator control operations for vpi_control.
CoverageControlsv
SystemVerilog coverage control operations for vpi_control.
DelayTimeType
Time encoding used by VPI delay records.
Direction
Port direction classification.
DistTypesv
SystemVerilog distribution style used by distribution constraints.
ErrorState
Simulation phase/state where an error occurred.
FuncType
Function return type classification.
LogicVal
4-state scalar encodings used by VPI.
LogicVecToIntError
Error type for failed conversions from LogicVec to integer types.
NetType
Net type classification for net objects.
ObjectType
VPI object and relation kinds used with handle traversal APIs.
OpType
Operation subtype for expression objects.
PrimType
Primitive instance subtype.
Property
VPI property identifiers used with vpi_get and vpi_get_str.
PutValueDelay
Delay mode used with vpi_put_value.
RandTypesv
SystemVerilog randomization qualifier for variables.
Severity
Error severity levels reported by VPI.
Strength
Drive-strength and charge encodings used by VPI.
SysFuncType
System function return type classification.
SystfKind
System task/function registration kind.
TchkType
Timing check subtype.
Time
Time value representation used by VPI APIs.
Value
High-level value representation returned from or written to VPI objects.
ValueType
VPI value format tags used with vpi_get_value and related APIs.

Statics§

MCD_STDOUT
Standard output MCD descriptor.

Functions§

assertion_controlsv
Invokes vpi_control with a SystemVerilog assertion control operation.
bigint_to_scalar_vectorDeprecatedbigint
Convert a num_bigint::BigInt to a two’s-complement-encoded Vec<LogicVal> (MSB at index 0).
biguint_to_scalar_vectorDeprecatedbigint
Convert a num_bigint::BigUint to a binary-encoded Vec<LogicVal> (MSB at index 0).
check_error
Alias of chk_error for consistency with rust-vhpi
chk_error
Checks whether the simulator has a pending VPI error.
control
Invokes vpi_control with the selected operation.
coverage_controlsv
Invokes vpi_control with 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_vectorDeprecated
Convert an i64 to a two’s-complement-encoded Vec<LogicVal> (MSB at index 0).
int_array_to_value_array
Promote an i32 array to a homogeneous Value array.
longint_array_to_value_array
Promote an i64 array to a homogeneous Value array.
printf
Prints a message through the simulator’s vpi_printf.
real_array_to_value_array
Promote an f64 array to a homogeneous Value array.
register_assertion_cbsv
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_data record with the simulator.
remove_assertion_cbsv
Removes a previously registered SystemVerilog assertion callback.
remove_cbcb_info
Removes a previously registered callback.
scalar_array_to_value_array
Promote a scalar array to a homogeneous Value array.
scalar_vector_to_bigintDeprecatedbigint
Convert a two’s-complement-encoded LogicVal slice (MSB at index 0) to a num_bigint::BigInt.
scalar_vector_to_biguintbigint
Convert a binary-encoded LogicVal slice (MSB at index 0) to a num_bigint::BigUint.
scalar_vector_to_int64Deprecated
Convert a two’s-complement-encoded LogicVal slice (MSB at index 0) to an i64.
scalar_vector_to_stringDeprecated
Convert a scalar vector into a compact string representation.
scalar_vector_to_uint64
Convert a binary-encoded LogicVal slice (MSB at index 0) to a u64.
shortint_array_to_value_array
Promote an i16 array to a homogeneous Value array.
shortreal_array_to_value_array
Promote an f32 array to a homogeneous Value array.
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 Value array.
string_array_to_value_array
Promote a String array to a homogeneous Value array.
string_to_ascii_cstring
Converts a Rust string into a 7-bit ASCII CString.
string_to_scalar_vectorDeprecated
Convert a scalar string into a vector of scalar values.
time_array_to_value_array
Promote a time array to a homogeneous Value array.
time_to_type
Converts a Time variant into the corresponding DelayTimeType.
uint64_to_scalar_vectorDeprecated
Convert a u64 to a binary-encoded Vec<LogicVal> (MSB at index 0).
value_array_to_int_array
Demote a homogeneous Value array to i32 values.
value_array_to_longint_array
Demote a homogeneous Value array to i64 values.
value_array_to_real_array
Demote a homogeneous Value array to f64 values.
value_array_to_scalar_array
Demote a homogeneous Value array to scalar values.
value_array_to_shortint_array
Demote a homogeneous Value array to i16 values.
value_array_to_shortreal_array
Demote a homogeneous Value array to f32 values.
value_array_to_strength_array
Demote a homogeneous Value array to strength values.
value_array_to_string_array
Demote a homogeneous Value array to String values.
value_array_to_time_array
Demote a homogeneous Value array to time values.

Type Aliases§

RawSystfData
Raw VPI registration record type.
SystfCallback
Function pointer type for VPI system task/function callbacks.