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 ScalarValue slices 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
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

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.
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.
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.
ScalarValue
4-state scalar encodings used by VPI.
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_vectorbigint
Convert a num_bigint::BigInt to a two’s-complement-encoded Vec<ScalarValue> (MSB at index 0).
biguint_to_scalar_vectorbigint
Convert a num_bigint::BigUint to a binary-encoded Vec<ScalarValue> (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_vector
Convert an i64 to a two’s-complement-encoded Vec<ScalarValue> (MSB at index 0).
printf
Prints a message through the simulator’s vpi_printf.
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_vector_to_bigintbigint
Convert a two’s-complement-encoded ScalarValue slice (MSB at index 0) to a num_bigint::BigInt.
scalar_vector_to_biguintbigint
Convert a binary-encoded ScalarValue slice (MSB at index 0) to a num_bigint::BigUint.
scalar_vector_to_int64
Convert a two’s-complement-encoded ScalarValue slice (MSB at index 0) to an i64.
scalar_vector_to_string
Convert a scalar vector into a compact string representation.
scalar_vector_to_uint64
Convert a binary-encoded ScalarValue slice (MSB at index 0) to a u64.
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 Time variant into the corresponding DelayTimeType.
uint64_to_scalar_vector
Convert a u64 to a binary-encoded Vec<ScalarValue> (MSB at index 0).

Type Aliases§

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