Expand description
Safe Rust wrappers around VHPI APIs.
| Feature | Default | Description |
|---|---|---|
nvc | Yes | Include NVC-specific VHPI-extensions |
bigint | No | Functions that return BigInt/BigUint |
dynamic | No | Enable 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_routinestable required by VHPI simulators.
Structs§
- Callback
Flag - Bitmask of callback flags.
- CbData
- Data passed to callback functions.
- CbInfo
- Information about a registered callback returned by
get_cb_infoandHandle::get_cb_info. - Error
- Error details returned by simulator.
- Foreign
Data - Builder for a VHPI foreign-model registration record.
- Foreign
Exec Data - Data passed to foreign model elaboration and execution callbacks.
- Foreign
Info - Information about a registered foreign model returned by
get_foreignf_infoandHandle::get_foreignf_info. - Handle
- Owned wrapper around a
vhpi_sys::vhpiHandleT. - Handle
Iterator - Iterator over VHPI handles produced by
vhpi_iterator/vhpi_scan. - Logic
Vec - 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
- Boolean
Val - CbReason
- Callback reasons.
- Class
Kind - VHDL class/kind identifiers returned by
IntProperty::Kind. - Control
- Simulation control operations that can be requested via VHPI.
- Control
Return - Result returned by simulator control operations.
- Foreign
Kind - 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.
- Logic
Val - Nine-value logic domain used by VHDL signals.
- Logic
VecTo IntError - Mode
- Interface mode values returned by
IntProperty::Mode. - Next
Time Status - Status value from
get_next_time. - OneTo
Many - VHPI one-to-many relationship selectors used for indexed and iterator access.
- OneTo
One - VHPI one-to-one relationship selectors used with
vhpi_handle. - Phys
Property - Physical-quantity properties that can be queried from a VHPI handle.
- Predef
Attr - Predefined VHDL attributes returned by
IntProperty::PredefAttr. - PutValue
Mode - Write mode used by
Handle::put_value. - Real
Property - Floating-point properties that can be queried from a VHPI handle.
- Register
CbError - 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_ vec Deprecated bigint - Convert a
BigIntto aValue::LogicVecof the specified width. - biguint_
to_ logic_ vec Deprecated bigint - Convert a
BigUintto aValue::LogicVecof 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_ vec Deprecated - Convert a signed integer to a
Value::LogicVecof the specified width. - is_
printable - Test whether a character is printable by the simulator.
- logic_
vec_ to_ bigint Deprecated bigint - Convert a
Value::LogicVecto aBigIntby interpreting the vector as a binary number. - logic_
vec_ to_ biguint Deprecated bigint - Convert a
Value::LogicVecto aBigUintby interpreting the vector as a binary number. - logic_
vec_ to_ int Deprecated - Convert a
Value::LogicVecto a signed integer by interpreting the vector as a binary number. - logic_
vec_ to_ uint Deprecated - Convert a
Value::LogicVecto 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_ seed nvc - 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_ vec Deprecated - Convert a string to a
Value::LogicVecby mapping each character to aLogicValusing the character’s byte value. - uint_
to_ logic_ vec Deprecated - Convert an unsigned integer to a
Value::LogicVecof the specified width.
Type Aliases§
- Foreign
Callback extern "C"function pointer type for foreign model elaboration and execution callbacks.