Skip to main content

Crate vhpi

Crate vhpi 

Source
Expand description

Safe Rust wrappers around VHPI APIs.

FeatureDefaultDescription
nvcYesInclude NVC-specific VHPI-extensions
bigintNoFunctions that return BigInt/BigUint
dynamicNoEnable runtime name resolution.

The dynamic feature is required if you want to build a dynamic library (dylib on macOS and DLL on Windows). If you link directly to the simulator it is not required.

Macros§

assert
Assert a condition with a severity and print a message through the simulator if the assertion fails
count_idents
Count the number of comma-separated expressions.
printf
Print a formatted message to the simulator console.
startup_routines
Define the vhpi_startup_routines table required by VHPI simulators.

Structs§

CallbackFlag
Bitmask of callback flags.
CbData
Data passed to callback functions.
CbInfo
Information about a registered callback returned by get_cb_info and Handle::get_cb_info.
Error
Error details returned by simulator.
ForeignData
Builder for a VHPI foreign-model registration record.
ForeignExecData
Data passed to foreign model elaboration and execution callbacks.
ForeignInfo
Information about a registered foreign model returned by get_foreignf_info and Handle::get_foreignf_info.
Handle
Owned wrapper around a vhpi_sys::vhpiHandleT.
HandleIterator
Iterator over VHPI handles produced by vhpi_iterator/vhpi_scan.
LogicVec
A VHDL logic vector stored in most-significant-bit-first order.
Physical
Physical quantity represented as a split 64-bit value.
Provides
Capability flags reported by the active simulator.
Time
Simulation time represented as a split 64-bit value.

Enums§

BitVal
BooleanVal
CbReason
Callback reasons.
ClassKind
VHDL class/kind identifiers returned by IntProperty::Kind.
Control
Simulation control operations that can be requested via VHPI.
ControlReturn
Result returned by simulator control operations.
ForeignKind
The kind of VHPI foreign model, corresponding to vhpiForeignKindT.
Format
Requested VHPI data format for value transfers.
IntProperty
Integer-valued properties that can be queried from a VHPI handle.
LogicVal
Nine-value logic domain used by VHDL signals.
LogicVecToIntError
Mode
Interface mode values returned by IntProperty::Mode.
NextTimeStatus
Status value from get_next_time.
OneToMany
VHPI one-to-many relationship selectors used for indexed and iterator access.
OneToOne
VHPI one-to-one relationship selectors used with vhpi_handle.
PhysProperty
Physical-quantity properties that can be queried from a VHPI handle.
PredefAttr
Predefined VHDL attributes returned by IntProperty::PredefAttr.
PutValueMode
Write mode used by Handle::put_value.
RealProperty
Floating-point properties that can be queried from a VHPI handle.
RegisterCbError
Errors returned when registering a VHPI callback.
Severity
Severity level used by simulator diagnostics.
SigKind
Signal kind values returned by IntProperty::SigKind.
Staticness
Staticness classification returned by IntProperty::Staticness.
StrProperty
String-valued properties that can be queried from a VHPI handle.
Value
Strongly typed representation of values exchanged through VHPI.

Constants§

FS
1 femtosecond — the base VHDL time unit (vhpiFS).
HR
1 hour (vhpiHR).
MN
1 minute (vhpiMN).
MS
1 millisecond (vhpiMS).
NS
1 nanosecond (vhpiNS).
PS
1 picosecond (vhpiPS).
S
1 second (vhpiS).
US
1 microsecond (vhpiUS).

Functions§

assert
Emit a simulator assertion message with the given severity.
bigint_to_logic_vecDeprecatedbigint
Convert a BigInt to a Value::LogicVec of the specified width.
biguint_to_logic_vecDeprecatedbigint
Convert a BigUint to a Value::LogicVec of the specified width.
check_error
Query the simulator for the last VHPI error.
control
Request a simulation control operation.
disable_cb
Disable a previously registered callback without removing it.
enable_cb
Re-enable a callback that was previously disabled with disable_cb.
get_cb_info
Retrieve information about a registered callback.
get_cycles
Get the current simulator cycle count.
get_foreignf_info
Retrieve the registration record for a foreign model handle.
get_next_time
Get the next scheduled simulator time and status code.
get_time
Get the current simulator time.
handle
Look up a top-level object through a one-to-one relationship.
handle_by_name
Look up a top-level object by name.
int_to_logic_vecDeprecated
Convert a signed integer to a Value::LogicVec of the specified width.
is_printable
Test whether a character is printable by the simulator.
logic_vec_to_bigintDeprecatedbigint
Convert a Value::LogicVec to a BigInt by interpreting the vector as a binary number.
logic_vec_to_biguintDeprecatedbigint
Convert a Value::LogicVec to a BigUint by interpreting the vector as a binary number.
logic_vec_to_intDeprecated
Convert a Value::LogicVec to a signed integer by interpreting the vector as a binary number.
logic_vec_to_uintDeprecated
Convert a Value::LogicVec to an unsigned integer by interpreting the vector as a binary number.
printf
Print a message to the simulator console using vhpi_printf
register_cb
Register a global callback for a simulator event.
register_cb_after_delay
Register a callback that fires once after the specified simulation delay.
register_foreignf
Register a VHPI foreign model with the simulator.
remove_cb
Remove a previously registered callback.
simulator_capabilities
Query capability flags supported by the active simulator.
simulator_name
Get the simulator/tool name.
simulator_random_seednvc
Get the current simulator random seed.
simulator_time_resolution
Get the simulator time resolution.
simulator_version
Get the simulator/tool version string.
string_to_iso8859_1_cstring
Convert Rust string to ISO-8859-1 encoded C string.
string_to_logic_vecDeprecated
Convert a string to a Value::LogicVec by mapping each character to a LogicVal using the character’s byte value.
uint_to_logic_vecDeprecated
Convert an unsigned integer to a Value::LogicVec of the specified width.

Type Aliases§

ForeignCallback
extern "C" function pointer type for foreign model elaboration and execution callbacks.