Skip to main content

Crate vpi

Crate vpi 

Source
Expand description

Safe and ergonomic wrappers for selected Verilog VPI APIs.

§Features

FeatureDescription
bigintEnables conversion between ScalarValue slices and arbitrary-precision integers using num_bigint::BigInt and num_bigint::BigUint.
cb_infoUses vpi_get_cb_info when removing callbacks. Enabled by default.
dynamicEnables runtime VPI symbol lookup via vpi-shim on Windows and macOS, allowing plugins to build without directly linking to a simulator library.
svEnables 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_routines symbol 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.
HandleIterator
Iterator over VPI scan results from vpi_iterate/vpi_scan.
MCD
Multi-channel descriptor used by VPI for output streams.
PutValueFlags
Flags controlling behavior of vpi_put_value.
SimulatorInfo
Simulator metadata reported by vpi_get_vlog_info.
StrengthEncoding
Drive-strength and charge encoding flags.
StrengthValue
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.
ConstType
Literal/constant encoding type.
Control
Simulator control operations for vpi_control.
Direction
Port direction classification.
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.
ScalarValue
4-state scalar encodings used by VPI.
Severity
Error severity levels reported by VPI.
SysFuncType
System function return type classification.
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§

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.
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 i64 to a two’s-complement-encoded Vec<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_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_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.
uint64_to_scalar_vector
Convert a u64 to a binary-encoded Vec<ScalarValue> (MSB at index 0).
vector_value_to_scalar_vector
Convert VPI vector values to a vector of scalar values