Skip to main content

DpiFunction

Trait DpiFunction 

Source
pub trait DpiFunction: Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn signature(&self) -> &'static [(&'static str, &'static str)];
    fn pointer(&self) -> *const c_void;
}
Expand description

A &'static dyn DpiFunction represents a Rust function suitable for use in Verilator DPI. See the #[verilog::dpi] macro for details.

Required Methods§

Source

fn name(&self) -> &'static str

The Rust-declared name of the DPI function. This should be taken to be equivalent to the name given for the DPI C function in Verilog source code.

Source

fn signature(&self) -> &'static [(&'static str, &'static str)]

A list of (name, c_type) pairs serving as the parameters of the generated C function and the generated function pointer type for the Rust function.

Source

fn pointer(&self) -> *const c_void

The Rust function as a function pointer.

Implementors§