diff --git a/difftest/Cargo.lock b/difftest/Cargo.lock index 3f1ddaa87..014775917 100644 --- a/difftest/Cargo.lock +++ b/difftest/Cargo.lock @@ -286,6 +286,7 @@ dependencies = [ "common", "hex", "spike_rs", + "svdpi", "tracing", ] @@ -295,6 +296,7 @@ version = "0.1.0" dependencies = [ "cmake", "online_dpi", + "svdpi", ] [[package]] @@ -302,6 +304,7 @@ name = "online_vcs" version = "0.1.0" dependencies = [ "online_dpi", + "svdpi", ] [[package]] @@ -446,6 +449,12 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +[[package]] +name = "svdpi" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9248c35a9b58d508b60d40b6f5ab8173760b32445d055e90822f57f09b9d0f58" + [[package]] name = "syn" version = "2.0.68" diff --git a/difftest/Cargo.toml b/difftest/Cargo.toml index b4488928c..35ce5dbf7 100644 --- a/difftest/Cargo.toml +++ b/difftest/Cargo.toml @@ -23,3 +23,4 @@ tracing-subscriber = { version = "0.3", features = ["env-filter", "ansi"] } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" num-bigint = "0.4.6" +svdpi = "0.0.1" diff --git a/difftest/online_dpi/Cargo.toml b/difftest/online_dpi/Cargo.toml index ee1f608ab..1d33a18b3 100644 --- a/difftest/online_dpi/Cargo.toml +++ b/difftest/online_dpi/Cargo.toml @@ -10,9 +10,8 @@ common = { path = "../test_common" } spike_rs = { path = "../spike_rs" } clap = { workspace = true } tracing = { workspace = true } +svdpi = { workspace = true } hex = "0.4.3" [features] -sv2023 = [] -svvpi = [] trace = [] diff --git a/difftest/online_dpi/src/dpi.rs b/difftest/online_dpi/src/dpi.rs index 464e007a9..d431e8124 100644 --- a/difftest/online_dpi/src/dpi.rs +++ b/difftest/online_dpi/src/dpi.rs @@ -7,8 +7,8 @@ use std::sync::Mutex; use tracing::debug; use crate::drive::Driver; -use crate::svdpi::SvScope; use crate::OfflineArgs; +use svdpi::SvScope; pub type SvBitVecVal = u32; @@ -281,8 +281,7 @@ mod dpi_export { } #[cfg(feature = "trace")] -pub(crate) fn dump_wave(scope: crate::svdpi::SvScope, path: &str) { - use crate::svdpi; +pub(crate) fn dump_wave(scope: svdpi::SvScope, path: &str) { use std::ffi::CString; let path_cstring = CString::new(path).unwrap(); diff --git a/difftest/online_dpi/src/drive.rs b/difftest/online_dpi/src/drive.rs index 5cc9fb78b..c53f60d16 100644 --- a/difftest/online_dpi/src/drive.rs +++ b/difftest/online_dpi/src/drive.rs @@ -7,8 +7,8 @@ use tracing::{debug, error, info, trace}; use crate::dpi::*; use crate::get_t; -use crate::svdpi::SvScope; use crate::OfflineArgs; +use svdpi::SvScope; struct ShadowMem { mem: Vec, diff --git a/difftest/online_dpi/src/lib.rs b/difftest/online_dpi/src/lib.rs index bafe6db0d..ff10cc8e8 100644 --- a/difftest/online_dpi/src/lib.rs +++ b/difftest/online_dpi/src/lib.rs @@ -3,9 +3,6 @@ use common::CommonArgs; pub mod dpi; pub mod drive; -pub mod svdpi; -#[cfg(feature = "svvpi")] -pub mod svvpi; #[derive(Parser)] pub(crate) struct OfflineArgs { @@ -28,17 +25,7 @@ pub(crate) struct OfflineArgs { pub const CYCLE_PERIOD: u64 = 20; /// get cycle -#[cfg(any(feature = "sv2023", feature = "svvpi"))] pub fn get_t() -> u64 { - get_time() / CYCLE_PERIOD + svdpi::get_time() / CYCLE_PERIOD } -#[cfg(feature = "sv2023")] -pub fn get_time() -> u64 { - svdpi::get_time() -} - -#[cfg(all(not(feature = "sv2023"), feature = "svvpi"))] -pub fn get_time() -> u64 { - svvpi::get_time() -} \ No newline at end of file diff --git a/difftest/online_dpi/src/svdpi.rs b/difftest/online_dpi/src/svdpi.rs deleted file mode 100644 index 227626d79..000000000 --- a/difftest/online_dpi/src/svdpi.rs +++ /dev/null @@ -1,50 +0,0 @@ -use std::{ffi::{c_void, CString}, ptr::{self, NonNull}}; - -#[rustfmt::skip] -pub mod sys; - -/// get current simulation time in _simulation time unit_ -#[cfg(feature = "sv2023")] -pub fn get_time() -> u64 { - let mut time = sys::svTimeVal { - type_: sys::sv_sim_time as i32, - high: 0, - low: 0, - real: 0.0, - }; - unsafe { - let ret = sys::svGetTime(ptr::null_mut(), &mut time); - assert!(ret == 0, "svGetTime failed"); - } - - ((time.high as u64) << 32) + (time.low as u64) -} - -pub fn set_scope_by_name(name: &str) { - let name_cstr = CString::new(name).unwrap(); - unsafe { - let scope = sys::svGetScopeFromName(name_cstr.as_ptr()); - assert!(!scope.is_null(), "unrecognized scope `{name}`"); - sys::svSetScope(scope); - } -} - -pub fn set_scope(scope: SvScope) { - unsafe { - sys::svSetScope(scope.ptr.as_ptr()); - } -} - -#[derive(Debug, Clone, Copy)] -pub struct SvScope { - ptr: NonNull, -} - -unsafe impl Send for SvScope {} - -impl SvScope { - pub fn get_current() -> Option { - let ptr = unsafe { sys::svGetScope() }; - NonNull::new(ptr).map(|ptr| Self { ptr }) - } -} diff --git a/difftest/online_dpi/src/svdpi/sys.rs b/difftest/online_dpi/src/svdpi/sys.rs deleted file mode 100644 index 892d7534b..000000000 --- a/difftest/online_dpi/src/svdpi/sys.rs +++ /dev/null @@ -1,750 +0,0 @@ -// modified from `bindgen --allowlist-item 'sv.*' svdpi.h` -#![allow(non_upper_case_globals)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] - -/* automatically generated by rust-bindgen 0.69.4 */ - -pub const sv_0: u32 = 0; -pub const sv_1: u32 = 1; -pub const sv_z: u32 = 2; -pub const sv_x: u32 = 3; -pub const sv_scaled_real_time: u32 = 1; -pub const sv_sim_time: u32 = 2; -pub type svScalar = u8; -pub type svBit = svScalar; -pub type svLogic = svScalar; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct t_vpi_vecval { - pub aval: u32, - pub bval: u32, -} -#[test] -fn bindgen_test_layout_t_vpi_vecval() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(t_vpi_vecval)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(t_vpi_vecval)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).aval) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_vecval), - "::", - stringify!(aval) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bval) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_vecval), - "::", - stringify!(bval) - ) - ); -} -pub type s_vpi_vecval = t_vpi_vecval; -pub type svLogicVecVal = s_vpi_vecval; -pub type svBitVecVal = u32; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct t_vpi_time { - pub type_: i32, - pub high: u32, - pub low: u32, - pub real: f64, -} -#[test] -fn bindgen_test_layout_t_vpi_time() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(t_vpi_time)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(t_vpi_time)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_time), - "::", - stringify!(type_) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).high) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_time), - "::", - stringify!(high) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).low) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_time), - "::", - stringify!(low) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).real) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_time), - "::", - stringify!(real) - ) - ); -} -pub type s_vpi_time = t_vpi_time; -pub type svTimeVal = s_vpi_time; -extern "C" { - pub fn svDpiVersion() -> *const ::std::os::raw::c_char; -} -pub type svScope = *mut ::std::os::raw::c_void; -pub type svOpenArrayHandle = *mut ::std::os::raw::c_void; -extern "C" { - pub fn svGetBitselBit(s: *const svBitVecVal, i: ::std::os::raw::c_int) -> svBit; -} -extern "C" { - pub fn svGetBitselLogic(s: *const svLogicVecVal, i: ::std::os::raw::c_int) -> svLogic; -} -extern "C" { - pub fn svPutBitselBit(d: *mut svBitVecVal, i: ::std::os::raw::c_int, s: svBit); -} -extern "C" { - pub fn svPutBitselLogic(d: *mut svLogicVecVal, i: ::std::os::raw::c_int, s: svLogic); -} -extern "C" { - pub fn svGetPartselBit( - d: *mut svBitVecVal, - s: *const svBitVecVal, - i: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn svGetPartselLogic( - d: *mut svLogicVecVal, - s: *const svLogicVecVal, - i: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn svPutPartselBit( - d: *mut svBitVecVal, - s: svBitVecVal, - i: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn svPutPartselLogic( - d: *mut svLogicVecVal, - s: svLogicVecVal, - i: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn svLeft(h: svOpenArrayHandle, d: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn svRight(h: svOpenArrayHandle, d: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn svLow(h: svOpenArrayHandle, d: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn svHigh(h: svOpenArrayHandle, d: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn svIncrement(h: svOpenArrayHandle, d: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn svSize(h: svOpenArrayHandle, d: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn svDimensions(h: svOpenArrayHandle) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn svGetArrayPtr(arg1: svOpenArrayHandle) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn svSizeOfArray(arg1: svOpenArrayHandle) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn svGetArrElemPtr( - arg1: svOpenArrayHandle, - indx1: ::std::os::raw::c_int, - ... - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn svGetArrElemPtr1( - arg1: svOpenArrayHandle, - indx1: ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn svGetArrElemPtr2( - arg1: svOpenArrayHandle, - indx1: ::std::os::raw::c_int, - indx2: ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn svGetArrElemPtr3( - arg1: svOpenArrayHandle, - indx1: ::std::os::raw::c_int, - indx2: ::std::os::raw::c_int, - indx3: ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn svPutBitArrElemVecVal( - d: svOpenArrayHandle, - s: *const svBitVecVal, - indx1: ::std::os::raw::c_int, - ... - ); -} -extern "C" { - pub fn svPutBitArrElem1VecVal( - d: svOpenArrayHandle, - s: *const svBitVecVal, - indx1: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn svPutBitArrElem2VecVal( - d: svOpenArrayHandle, - s: *const svBitVecVal, - indx1: ::std::os::raw::c_int, - indx2: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn svPutBitArrElem3VecVal( - d: svOpenArrayHandle, - s: *const svBitVecVal, - indx1: ::std::os::raw::c_int, - indx2: ::std::os::raw::c_int, - indx3: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn svPutLogicArrElemVecVal( - d: svOpenArrayHandle, - s: *const svLogicVecVal, - indx1: ::std::os::raw::c_int, - ... - ); -} -extern "C" { - pub fn svPutLogicArrElem1VecVal( - d: svOpenArrayHandle, - s: *const svLogicVecVal, - indx1: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn svPutLogicArrElem2VecVal( - d: svOpenArrayHandle, - s: *const svLogicVecVal, - indx1: ::std::os::raw::c_int, - indx2: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn svPutLogicArrElem3VecVal( - d: svOpenArrayHandle, - s: *const svLogicVecVal, - indx1: ::std::os::raw::c_int, - indx2: ::std::os::raw::c_int, - indx3: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn svGetBitArrElemVecVal( - d: *mut svBitVecVal, - s: svOpenArrayHandle, - indx1: ::std::os::raw::c_int, - ... - ); -} -extern "C" { - pub fn svGetBitArrElem1VecVal( - d: *mut svBitVecVal, - s: svOpenArrayHandle, - indx1: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn svGetBitArrElem2VecVal( - d: *mut svBitVecVal, - s: svOpenArrayHandle, - indx1: ::std::os::raw::c_int, - indx2: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn svGetBitArrElem3VecVal( - d: *mut svBitVecVal, - s: svOpenArrayHandle, - indx1: ::std::os::raw::c_int, - indx2: ::std::os::raw::c_int, - indx3: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn svGetLogicArrElemVecVal( - d: *mut svLogicVecVal, - s: svOpenArrayHandle, - indx1: ::std::os::raw::c_int, - ... - ); -} -extern "C" { - pub fn svGetLogicArrElem1VecVal( - d: *mut svLogicVecVal, - s: svOpenArrayHandle, - indx1: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn svGetLogicArrElem2VecVal( - d: *mut svLogicVecVal, - s: svOpenArrayHandle, - indx1: ::std::os::raw::c_int, - indx2: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn svGetLogicArrElem3VecVal( - d: *mut svLogicVecVal, - s: svOpenArrayHandle, - indx1: ::std::os::raw::c_int, - indx2: ::std::os::raw::c_int, - indx3: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn svGetBitArrElem(s: svOpenArrayHandle, indx1: ::std::os::raw::c_int, ...) -> svBit; -} -extern "C" { - pub fn svGetBitArrElem1(s: svOpenArrayHandle, indx1: ::std::os::raw::c_int) -> svBit; -} -extern "C" { - pub fn svGetBitArrElem2( - s: svOpenArrayHandle, - indx1: ::std::os::raw::c_int, - indx2: ::std::os::raw::c_int, - ) -> svBit; -} -extern "C" { - pub fn svGetBitArrElem3( - s: svOpenArrayHandle, - indx1: ::std::os::raw::c_int, - indx2: ::std::os::raw::c_int, - indx3: ::std::os::raw::c_int, - ) -> svBit; -} -extern "C" { - pub fn svGetLogicArrElem(s: svOpenArrayHandle, indx1: ::std::os::raw::c_int, ...) -> svLogic; -} -extern "C" { - pub fn svGetLogicArrElem1(s: svOpenArrayHandle, indx1: ::std::os::raw::c_int) -> svLogic; -} -extern "C" { - pub fn svGetLogicArrElem2( - s: svOpenArrayHandle, - indx1: ::std::os::raw::c_int, - indx2: ::std::os::raw::c_int, - ) -> svLogic; -} -extern "C" { - pub fn svGetLogicArrElem3( - s: svOpenArrayHandle, - indx1: ::std::os::raw::c_int, - indx2: ::std::os::raw::c_int, - indx3: ::std::os::raw::c_int, - ) -> svLogic; -} -extern "C" { - pub fn svPutLogicArrElem( - d: svOpenArrayHandle, - value: svLogic, - indx1: ::std::os::raw::c_int, - ... - ); -} -extern "C" { - pub fn svPutLogicArrElem1(d: svOpenArrayHandle, value: svLogic, indx1: ::std::os::raw::c_int); -} -extern "C" { - pub fn svPutLogicArrElem2( - d: svOpenArrayHandle, - value: svLogic, - indx1: ::std::os::raw::c_int, - indx2: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn svPutLogicArrElem3( - d: svOpenArrayHandle, - value: svLogic, - indx1: ::std::os::raw::c_int, - indx2: ::std::os::raw::c_int, - indx3: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn svPutBitArrElem(d: svOpenArrayHandle, value: svBit, indx1: ::std::os::raw::c_int, ...); -} -extern "C" { - pub fn svPutBitArrElem1(d: svOpenArrayHandle, value: svBit, indx1: ::std::os::raw::c_int); -} -extern "C" { - pub fn svPutBitArrElem2( - d: svOpenArrayHandle, - value: svBit, - indx1: ::std::os::raw::c_int, - indx2: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn svPutBitArrElem3( - d: svOpenArrayHandle, - value: svBit, - indx1: ::std::os::raw::c_int, - indx2: ::std::os::raw::c_int, - indx3: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn svGetScope() -> svScope; -} -extern "C" { - pub fn svSetScope(scope: svScope) -> svScope; -} -extern "C" { - pub fn svGetNameFromScope(arg1: svScope) -> *const ::std::os::raw::c_char; -} -extern "C" { - pub fn svGetScopeFromName(scopeName: *const ::std::os::raw::c_char) -> svScope; -} -extern "C" { - pub fn svPutUserData( - scope: svScope, - userKey: *mut ::std::os::raw::c_void, - userData: *mut ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn svGetUserData( - scope: svScope, - userKey: *mut ::std::os::raw::c_void, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn svGetCallerInfo( - fileName: *mut *const ::std::os::raw::c_char, - lineNumber: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn svIsDisabledState() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn svAckDisabledState(); -} -#[cfg(feature = "sv2023")] -extern "C" { - pub fn svGetTime(scope: svScope, time: *mut svTimeVal) -> ::std::os::raw::c_int; -} -#[cfg(feature = "sv2023")] -extern "C" { - pub fn svGetTimeUnit(scope: svScope, time_unit: *mut i32) -> ::std::os::raw::c_int; -} -#[cfg(feature = "sv2023")] -extern "C" { - pub fn svGetTimePrecision(scope: svScope, time_precision: *mut i32) -> ::std::os::raw::c_int; -} -pub type svBitVec32 = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct svLogicVec32 { - pub c: ::std::os::raw::c_uint, - pub d: ::std::os::raw::c_uint, -} -#[test] -fn bindgen_test_layout_svLogicVec32() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(svLogicVec32)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(svLogicVec32)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).c) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(svLogicVec32), - "::", - stringify!(c) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).d) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(svLogicVec32), - "::", - stringify!(d) - ) - ); -} -pub type svBitPackedArrRef = *mut ::std::os::raw::c_void; -pub type svLogicPackedArrRef = *mut ::std::os::raw::c_void; -extern "C" { - pub fn svSizeOfBitPackedArr(width: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn svSizeOfLogicPackedArr(width: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn svPutBitVec32(d: svBitPackedArrRef, s: *const svBitVec32, w: ::std::os::raw::c_int); -} -extern "C" { - pub fn svPutLogicVec32( - d: svLogicPackedArrRef, - s: *const svLogicVec32, - w: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn svGetBitVec32(d: *mut svBitVec32, s: svBitPackedArrRef, w: ::std::os::raw::c_int); -} -extern "C" { - pub fn svGetLogicVec32(d: *mut svLogicVec32, s: svLogicPackedArrRef, w: ::std::os::raw::c_int); -} -extern "C" { - pub fn svGetSelectBit(s: svBitPackedArrRef, i: ::std::os::raw::c_int) -> svBit; -} -extern "C" { - pub fn svGetSelectLogic(s: svLogicPackedArrRef, i: ::std::os::raw::c_int) -> svLogic; -} -extern "C" { - pub fn svPutSelectBit(d: svBitPackedArrRef, i: ::std::os::raw::c_int, s: svBit); -} -extern "C" { - pub fn svPutSelectLogic(d: svLogicPackedArrRef, i: ::std::os::raw::c_int, s: svLogic); -} -extern "C" { - pub fn svGetPartSelectBit( - d: *mut svBitVec32, - s: svBitPackedArrRef, - i: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn svGetBits( - s: svBitPackedArrRef, - i: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, - ) -> svBitVec32; -} -extern "C" { - pub fn svGet32Bits(s: svBitPackedArrRef, i: ::std::os::raw::c_int) -> svBitVec32; -} -extern "C" { - pub fn svGet64Bits(s: svBitPackedArrRef, i: ::std::os::raw::c_int) -> u64; -} -extern "C" { - pub fn svGetPartSelectLogic( - d: *mut svLogicVec32, - s: svLogicPackedArrRef, - i: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn svPutPartSelectBit( - d: svBitPackedArrRef, - s: svBitVec32, - i: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn svPutPartSelectLogic( - d: svLogicPackedArrRef, - s: *const svLogicVec32, - i: ::std::os::raw::c_int, - w: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn svPutBitArrElemVec32( - d: svOpenArrayHandle, - s: *const svBitVec32, - indx1: ::std::os::raw::c_int, - ... - ); -} -extern "C" { - pub fn svPutBitArrElem1Vec32( - d: svOpenArrayHandle, - s: *const svBitVec32, - indx1: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn svPutBitArrElem2Vec32( - d: svOpenArrayHandle, - s: *const svBitVec32, - indx1: ::std::os::raw::c_int, - indx2: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn svPutBitArrElem3Vec32( - d: svOpenArrayHandle, - s: *const svBitVec32, - indx1: ::std::os::raw::c_int, - indx2: ::std::os::raw::c_int, - indx3: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn svPutLogicArrElemVec32( - d: svOpenArrayHandle, - s: *const svLogicVec32, - indx1: ::std::os::raw::c_int, - ... - ); -} -extern "C" { - pub fn svPutLogicArrElem1Vec32( - d: svOpenArrayHandle, - s: *const svLogicVec32, - indx1: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn svPutLogicArrElem2Vec32( - d: svOpenArrayHandle, - s: *const svLogicVec32, - indx1: ::std::os::raw::c_int, - indx2: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn svPutLogicArrElem3Vec32( - d: svOpenArrayHandle, - s: *const svLogicVec32, - indx1: ::std::os::raw::c_int, - indx2: ::std::os::raw::c_int, - indx3: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn svGetBitArrElemVec32( - d: *mut svBitVec32, - s: svOpenArrayHandle, - indx1: ::std::os::raw::c_int, - ... - ); -} -extern "C" { - pub fn svGetBitArrElem1Vec32( - d: *mut svBitVec32, - s: svOpenArrayHandle, - indx1: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn svGetBitArrElem2Vec32( - d: *mut svBitVec32, - s: svOpenArrayHandle, - indx1: ::std::os::raw::c_int, - indx2: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn svGetBitArrElem3Vec32( - d: *mut svBitVec32, - s: svOpenArrayHandle, - indx1: ::std::os::raw::c_int, - indx2: ::std::os::raw::c_int, - indx3: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn svGetLogicArrElemVec32( - d: *mut svLogicVec32, - s: svOpenArrayHandle, - indx1: ::std::os::raw::c_int, - ... - ); -} -extern "C" { - pub fn svGetLogicArrElem1Vec32( - d: *mut svLogicVec32, - s: svOpenArrayHandle, - indx1: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn svGetLogicArrElem2Vec32( - d: *mut svLogicVec32, - s: svOpenArrayHandle, - indx1: ::std::os::raw::c_int, - indx2: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn svGetLogicArrElem3Vec32( - d: *mut svLogicVec32, - s: svOpenArrayHandle, - indx1: ::std::os::raw::c_int, - indx2: ::std::os::raw::c_int, - indx3: ::std::os::raw::c_int, - ); -} diff --git a/difftest/online_dpi/src/svvpi.rs b/difftest/online_dpi/src/svvpi.rs deleted file mode 100644 index 401f7f65a..000000000 --- a/difftest/online_dpi/src/svvpi.rs +++ /dev/null @@ -1,18 +0,0 @@ -#[rustfmt::skip] -pub mod sys; - -use std::ptr; - -/// get current simulation time in _simulation time unit_ -pub fn get_time() -> u64 { - let mut time = sys::s_vpi_time { - type_: sys::vpiSimTime as i32, - high: 0, - low: 0, - real: 0.0, - }; - unsafe { - sys::vpi_get_time(ptr::null_mut(), &mut time); - } - ((time.high as u64) << 32) + (time.low as u64) -} diff --git a/difftest/online_dpi/src/svvpi/sys.rs b/difftest/online_dpi/src/svvpi/sys.rs deleted file mode 100644 index c3d269855..000000000 --- a/difftest/online_dpi/src/svvpi/sys.rs +++ /dev/null @@ -1,2102 +0,0 @@ -// modified from `bindgen --allowlist-item 'vpi.*' sv_vpi_user.h` -#![allow(non_upper_case_globals)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] - -/* automatically generated by rust-bindgen 0.69.4 */ - -pub const vpiAlways: u32 = 1; -pub const vpiAssignStmt: u32 = 2; -pub const vpiAssignment: u32 = 3; -pub const vpiBegin: u32 = 4; -pub const vpiCase: u32 = 5; -pub const vpiCaseItem: u32 = 6; -pub const vpiConstant: u32 = 7; -pub const vpiContAssign: u32 = 8; -pub const vpiDeassign: u32 = 9; -pub const vpiDefParam: u32 = 10; -pub const vpiDelayControl: u32 = 11; -pub const vpiDisable: u32 = 12; -pub const vpiEventControl: u32 = 13; -pub const vpiEventStmt: u32 = 14; -pub const vpiFor: u32 = 15; -pub const vpiForce: u32 = 16; -pub const vpiForever: u32 = 17; -pub const vpiFork: u32 = 18; -pub const vpiFuncCall: u32 = 19; -pub const vpiFunction: u32 = 20; -pub const vpiGate: u32 = 21; -pub const vpiIf: u32 = 22; -pub const vpiIfElse: u32 = 23; -pub const vpiInitial: u32 = 24; -pub const vpiIntegerVar: u32 = 25; -pub const vpiInterModPath: u32 = 26; -pub const vpiIterator: u32 = 27; -pub const vpiIODecl: u32 = 28; -pub const vpiMemory: u32 = 29; -pub const vpiMemoryWord: u32 = 30; -pub const vpiModPath: u32 = 31; -pub const vpiModule: u32 = 32; -pub const vpiNamedBegin: u32 = 33; -pub const vpiNamedEvent: u32 = 34; -pub const vpiNamedFork: u32 = 35; -pub const vpiNet: u32 = 36; -pub const vpiNetBit: u32 = 37; -pub const vpiNullStmt: u32 = 38; -pub const vpiOperation: u32 = 39; -pub const vpiParamAssign: u32 = 40; -pub const vpiParameter: u32 = 41; -pub const vpiPartSelect: u32 = 42; -pub const vpiPathTerm: u32 = 43; -pub const vpiPort: u32 = 44; -pub const vpiPortBit: u32 = 45; -pub const vpiPrimTerm: u32 = 46; -pub const vpiRealVar: u32 = 47; -pub const vpiReg: u32 = 48; -pub const vpiRegBit: u32 = 49; -pub const vpiRelease: u32 = 50; -pub const vpiRepeat: u32 = 51; -pub const vpiRepeatControl: u32 = 52; -pub const vpiSchedEvent: u32 = 53; -pub const vpiSpecParam: u32 = 54; -pub const vpiSwitch: u32 = 55; -pub const vpiSysFuncCall: u32 = 56; -pub const vpiSysTaskCall: u32 = 57; -pub const vpiTableEntry: u32 = 58; -pub const vpiTask: u32 = 59; -pub const vpiTaskCall: u32 = 60; -pub const vpiTchk: u32 = 61; -pub const vpiTchkTerm: u32 = 62; -pub const vpiTimeVar: u32 = 63; -pub const vpiTimeQueue: u32 = 64; -pub const vpiUdp: u32 = 65; -pub const vpiUdpDefn: u32 = 66; -pub const vpiUserSystf: u32 = 67; -pub const vpiVarSelect: u32 = 68; -pub const vpiWait: u32 = 69; -pub const vpiWhile: u32 = 70; -pub const vpiAttribute: u32 = 105; -pub const vpiBitSelect: u32 = 106; -pub const vpiCallback: u32 = 107; -pub const vpiDelayTerm: u32 = 108; -pub const vpiDelayDevice: u32 = 109; -pub const vpiFrame: u32 = 110; -pub const vpiGateArray: u32 = 111; -pub const vpiModuleArray: u32 = 112; -pub const vpiPrimitiveArray: u32 = 113; -pub const vpiNetArray: u32 = 114; -pub const vpiRange: u32 = 115; -pub const vpiRegArray: u32 = 116; -pub const vpiSwitchArray: u32 = 117; -pub const vpiUdpArray: u32 = 118; -pub const vpiContAssignBit: u32 = 128; -pub const vpiNamedEventArray: u32 = 129; -pub const vpiIndexedPartSelect: u32 = 130; -pub const vpiGenScopeArray: u32 = 133; -pub const vpiGenScope: u32 = 134; -pub const vpiGenVar: u32 = 135; -pub const vpiCondition: u32 = 71; -pub const vpiDelay: u32 = 72; -pub const vpiElseStmt: u32 = 73; -pub const vpiForIncStmt: u32 = 74; -pub const vpiForInitStmt: u32 = 75; -pub const vpiHighConn: u32 = 76; -pub const vpiLhs: u32 = 77; -pub const vpiIndex: u32 = 78; -pub const vpiLeftRange: u32 = 79; -pub const vpiLowConn: u32 = 80; -pub const vpiParent: u32 = 81; -pub const vpiRhs: u32 = 82; -pub const vpiRightRange: u32 = 83; -pub const vpiScope: u32 = 84; -pub const vpiSysTfCall: u32 = 85; -pub const vpiTchkDataTerm: u32 = 86; -pub const vpiTchkNotifier: u32 = 87; -pub const vpiTchkRefTerm: u32 = 88; -pub const vpiArgument: u32 = 89; -pub const vpiBit: u32 = 90; -pub const vpiDriver: u32 = 91; -pub const vpiInternalScope: u32 = 92; -pub const vpiLoad: u32 = 93; -pub const vpiModDataPathIn: u32 = 94; -pub const vpiModPathIn: u32 = 95; -pub const vpiModPathOut: u32 = 96; -pub const vpiOperand: u32 = 97; -pub const vpiPortInst: u32 = 98; -pub const vpiProcess: u32 = 99; -pub const vpiVariables: u32 = 100; -pub const vpiUse: u32 = 101; -pub const vpiExpr: u32 = 102; -pub const vpiPrimitive: u32 = 103; -pub const vpiStmt: u32 = 104; -pub const vpiActiveTimeFormat: u32 = 119; -pub const vpiInTerm: u32 = 120; -pub const vpiInstanceArray: u32 = 121; -pub const vpiLocalDriver: u32 = 122; -pub const vpiLocalLoad: u32 = 123; -pub const vpiOutTerm: u32 = 124; -pub const vpiPorts: u32 = 125; -pub const vpiSimNet: u32 = 126; -pub const vpiTaskFunc: u32 = 127; -pub const vpiBaseExpr: u32 = 131; -pub const vpiWidthExpr: u32 = 132; -pub const vpiAutomatics: u32 = 136; -pub const vpiUndefined: i32 = -1; -pub const vpiType: u32 = 1; -pub const vpiName: u32 = 2; -pub const vpiFullName: u32 = 3; -pub const vpiSize: u32 = 4; -pub const vpiFile: u32 = 5; -pub const vpiLineNo: u32 = 6; -pub const vpiTopModule: u32 = 7; -pub const vpiCellInstance: u32 = 8; -pub const vpiDefName: u32 = 9; -pub const vpiProtected: u32 = 10; -pub const vpiTimeUnit: u32 = 11; -pub const vpiTimePrecision: u32 = 12; -pub const vpiDefNetType: u32 = 13; -pub const vpiUnconnDrive: u32 = 14; -pub const vpiHighZ: u32 = 1; -pub const vpiPull1: u32 = 2; -pub const vpiPull0: u32 = 3; -pub const vpiDefFile: u32 = 15; -pub const vpiDefLineNo: u32 = 16; -pub const vpiDefDelayMode: u32 = 47; -pub const vpiDelayModeNone: u32 = 1; -pub const vpiDelayModePath: u32 = 2; -pub const vpiDelayModeDistrib: u32 = 3; -pub const vpiDelayModeUnit: u32 = 4; -pub const vpiDelayModeZero: u32 = 5; -pub const vpiDelayModeMTM: u32 = 6; -pub const vpiDefDecayTime: u32 = 48; -pub const vpiScalar: u32 = 17; -pub const vpiVector: u32 = 18; -pub const vpiExplicitName: u32 = 19; -pub const vpiDirection: u32 = 20; -pub const vpiInput: u32 = 1; -pub const vpiOutput: u32 = 2; -pub const vpiInout: u32 = 3; -pub const vpiMixedIO: u32 = 4; -pub const vpiNoDirection: u32 = 5; -pub const vpiConnByName: u32 = 21; -pub const vpiNetType: u32 = 22; -pub const vpiWire: u32 = 1; -pub const vpiWand: u32 = 2; -pub const vpiWor: u32 = 3; -pub const vpiTri: u32 = 4; -pub const vpiTri0: u32 = 5; -pub const vpiTri1: u32 = 6; -pub const vpiTriReg: u32 = 7; -pub const vpiTriAnd: u32 = 8; -pub const vpiTriOr: u32 = 9; -pub const vpiSupply1: u32 = 10; -pub const vpiSupply0: u32 = 11; -pub const vpiNone: u32 = 12; -pub const vpiUwire: u32 = 13; -pub const vpiNettypeNet: u32 = 14; -pub const vpiNettypeNetSelect: u32 = 15; -pub const vpiInterconnect: u32 = 16; -pub const vpiExplicitScalared: u32 = 23; -pub const vpiExplicitVectored: u32 = 24; -pub const vpiExpanded: u32 = 25; -pub const vpiImplicitDecl: u32 = 26; -pub const vpiChargeStrength: u32 = 27; -pub const vpiArray: u32 = 28; -pub const vpiPortIndex: u32 = 29; -pub const vpiTermIndex: u32 = 30; -pub const vpiStrength0: u32 = 31; -pub const vpiStrength1: u32 = 32; -pub const vpiPrimType: u32 = 33; -pub const vpiAndPrim: u32 = 1; -pub const vpiNandPrim: u32 = 2; -pub const vpiNorPrim: u32 = 3; -pub const vpiOrPrim: u32 = 4; -pub const vpiXorPrim: u32 = 5; -pub const vpiXnorPrim: u32 = 6; -pub const vpiBufPrim: u32 = 7; -pub const vpiNotPrim: u32 = 8; -pub const vpiBufif0Prim: u32 = 9; -pub const vpiBufif1Prim: u32 = 10; -pub const vpiNotif0Prim: u32 = 11; -pub const vpiNotif1Prim: u32 = 12; -pub const vpiNmosPrim: u32 = 13; -pub const vpiPmosPrim: u32 = 14; -pub const vpiCmosPrim: u32 = 15; -pub const vpiRnmosPrim: u32 = 16; -pub const vpiRpmosPrim: u32 = 17; -pub const vpiRcmosPrim: u32 = 18; -pub const vpiRtranPrim: u32 = 19; -pub const vpiRtranif0Prim: u32 = 20; -pub const vpiRtranif1Prim: u32 = 21; -pub const vpiTranPrim: u32 = 22; -pub const vpiTranif0Prim: u32 = 23; -pub const vpiTranif1Prim: u32 = 24; -pub const vpiPullupPrim: u32 = 25; -pub const vpiPulldownPrim: u32 = 26; -pub const vpiSeqPrim: u32 = 27; -pub const vpiCombPrim: u32 = 28; -pub const vpiPolarity: u32 = 34; -pub const vpiDataPolarity: u32 = 35; -pub const vpiPositive: u32 = 1; -pub const vpiNegative: u32 = 2; -pub const vpiUnknown: u32 = 3; -pub const vpiEdge: u32 = 36; -pub const vpiNoEdge: u32 = 0; -pub const vpiEdge01: u32 = 1; -pub const vpiEdge10: u32 = 2; -pub const vpiEdge0x: u32 = 4; -pub const vpiEdgex1: u32 = 8; -pub const vpiEdge1x: u32 = 16; -pub const vpiEdgex0: u32 = 32; -pub const vpiPosedge: u32 = 13; -pub const vpiNegedge: u32 = 50; -pub const vpiAnyEdge: u32 = 63; -pub const vpiPathType: u32 = 37; -pub const vpiPathFull: u32 = 1; -pub const vpiPathParallel: u32 = 2; -pub const vpiTchkType: u32 = 38; -pub const vpiSetup: u32 = 1; -pub const vpiHold: u32 = 2; -pub const vpiPeriod: u32 = 3; -pub const vpiWidth: u32 = 4; -pub const vpiSkew: u32 = 5; -pub const vpiRecovery: u32 = 6; -pub const vpiNoChange: u32 = 7; -pub const vpiSetupHold: u32 = 8; -pub const vpiFullskew: u32 = 9; -pub const vpiRecrem: u32 = 10; -pub const vpiRemoval: u32 = 11; -pub const vpiTimeskew: u32 = 12; -pub const vpiOpType: u32 = 39; -pub const vpiMinusOp: u32 = 1; -pub const vpiPlusOp: u32 = 2; -pub const vpiNotOp: u32 = 3; -pub const vpiBitNegOp: u32 = 4; -pub const vpiUnaryAndOp: u32 = 5; -pub const vpiUnaryNandOp: u32 = 6; -pub const vpiUnaryOrOp: u32 = 7; -pub const vpiUnaryNorOp: u32 = 8; -pub const vpiUnaryXorOp: u32 = 9; -pub const vpiUnaryXNorOp: u32 = 10; -pub const vpiSubOp: u32 = 11; -pub const vpiDivOp: u32 = 12; -pub const vpiModOp: u32 = 13; -pub const vpiEqOp: u32 = 14; -pub const vpiNeqOp: u32 = 15; -pub const vpiCaseEqOp: u32 = 16; -pub const vpiCaseNeqOp: u32 = 17; -pub const vpiGtOp: u32 = 18; -pub const vpiGeOp: u32 = 19; -pub const vpiLtOp: u32 = 20; -pub const vpiLeOp: u32 = 21; -pub const vpiLShiftOp: u32 = 22; -pub const vpiRShiftOp: u32 = 23; -pub const vpiAddOp: u32 = 24; -pub const vpiMultOp: u32 = 25; -pub const vpiLogAndOp: u32 = 26; -pub const vpiLogOrOp: u32 = 27; -pub const vpiBitAndOp: u32 = 28; -pub const vpiBitOrOp: u32 = 29; -pub const vpiBitXorOp: u32 = 30; -pub const vpiBitXNorOp: u32 = 31; -pub const vpiBitXnorOp: u32 = 31; -pub const vpiConditionOp: u32 = 32; -pub const vpiConcatOp: u32 = 33; -pub const vpiMultiConcatOp: u32 = 34; -pub const vpiEventOrOp: u32 = 35; -pub const vpiNullOp: u32 = 36; -pub const vpiListOp: u32 = 37; -pub const vpiMinTypMaxOp: u32 = 38; -pub const vpiPosedgeOp: u32 = 39; -pub const vpiNegedgeOp: u32 = 40; -pub const vpiArithLShiftOp: u32 = 41; -pub const vpiArithRShiftOp: u32 = 42; -pub const vpiPowerOp: u32 = 43; -pub const vpiConstType: u32 = 40; -pub const vpiDecConst: u32 = 1; -pub const vpiRealConst: u32 = 2; -pub const vpiBinaryConst: u32 = 3; -pub const vpiOctConst: u32 = 4; -pub const vpiHexConst: u32 = 5; -pub const vpiStringConst: u32 = 6; -pub const vpiIntConst: u32 = 7; -pub const vpiTimeConst: u32 = 8; -pub const vpiBlocking: u32 = 41; -pub const vpiCaseType: u32 = 42; -pub const vpiCaseExact: u32 = 1; -pub const vpiCaseX: u32 = 2; -pub const vpiCaseZ: u32 = 3; -pub const vpiNetDeclAssign: u32 = 43; -pub const vpiFuncType: u32 = 44; -pub const vpiIntFunc: u32 = 1; -pub const vpiRealFunc: u32 = 2; -pub const vpiTimeFunc: u32 = 3; -pub const vpiSizedFunc: u32 = 4; -pub const vpiSizedSignedFunc: u32 = 5; -pub const vpiSysFuncType: u32 = 44; -pub const vpiSysFuncInt: u32 = 1; -pub const vpiSysFuncReal: u32 = 2; -pub const vpiSysFuncTime: u32 = 3; -pub const vpiSysFuncSized: u32 = 4; -pub const vpiUserDefn: u32 = 45; -pub const vpiScheduled: u32 = 46; -pub const vpiActive: u32 = 49; -pub const vpiAutomatic: u32 = 50; -pub const vpiCell: u32 = 51; -pub const vpiConfig: u32 = 52; -pub const vpiConstantSelect: u32 = 53; -pub const vpiDecompile: u32 = 54; -pub const vpiDefAttribute: u32 = 55; -pub const vpiDelayType: u32 = 56; -pub const vpiModPathDelay: u32 = 1; -pub const vpiInterModPathDelay: u32 = 2; -pub const vpiMIPDelay: u32 = 3; -pub const vpiIteratorType: u32 = 57; -pub const vpiLibrary: u32 = 58; -pub const vpiOffset: u32 = 60; -pub const vpiResolvedNetType: u32 = 61; -pub const vpiSaveRestartID: u32 = 62; -pub const vpiSaveRestartLocation: u32 = 63; -pub const vpiValid: u32 = 64; -pub const vpiValidFalse: u32 = 0; -pub const vpiValidTrue: u32 = 1; -pub const vpiSigned: u32 = 65; -pub const vpiLocalParam: u32 = 70; -pub const vpiModPathHasIfNone: u32 = 71; -pub const vpiIndexedPartSelectType: u32 = 72; -pub const vpiPosIndexed: u32 = 1; -pub const vpiNegIndexed: u32 = 2; -pub const vpiIsMemory: u32 = 73; -pub const vpiIsProtected: u32 = 74; -pub const vpiStop: u32 = 66; -pub const vpiFinish: u32 = 67; -pub const vpiReset: u32 = 68; -pub const vpiSetInteractiveScope: u32 = 69; -pub const vpiScaledRealTime: u32 = 1; -pub const vpiSimTime: u32 = 2; -pub const vpiSuppressTime: u32 = 3; -pub const vpiSupplyDrive: u32 = 128; -pub const vpiStrongDrive: u32 = 64; -pub const vpiPullDrive: u32 = 32; -pub const vpiWeakDrive: u32 = 8; -pub const vpiLargeCharge: u32 = 16; -pub const vpiMediumCharge: u32 = 4; -pub const vpiSmallCharge: u32 = 2; -pub const vpiHiZ: u32 = 1; -pub const vpiBinStrVal: u32 = 1; -pub const vpiOctStrVal: u32 = 2; -pub const vpiDecStrVal: u32 = 3; -pub const vpiHexStrVal: u32 = 4; -pub const vpiScalarVal: u32 = 5; -pub const vpiIntVal: u32 = 6; -pub const vpiRealVal: u32 = 7; -pub const vpiStringVal: u32 = 8; -pub const vpiVectorVal: u32 = 9; -pub const vpiStrengthVal: u32 = 10; -pub const vpiTimeVal: u32 = 11; -pub const vpiObjTypeVal: u32 = 12; -pub const vpiSuppressVal: u32 = 13; -pub const vpiShortIntVal: u32 = 14; -pub const vpiLongIntVal: u32 = 15; -pub const vpiShortRealVal: u32 = 16; -pub const vpiRawTwoStateVal: u32 = 17; -pub const vpiRawFourStateVal: u32 = 18; -pub const vpiNoDelay: u32 = 1; -pub const vpiInertialDelay: u32 = 2; -pub const vpiTransportDelay: u32 = 3; -pub const vpiPureTransportDelay: u32 = 4; -pub const vpiForceFlag: u32 = 5; -pub const vpiReleaseFlag: u32 = 6; -pub const vpiCancelEvent: u32 = 7; -pub const vpiReturnEvent: u32 = 4096; -pub const vpiUserAllocFlag: u32 = 8192; -pub const vpiOneValue: u32 = 16384; -pub const vpiPropagateOff: u32 = 32768; -pub const vpi0: u32 = 0; -pub const vpi1: u32 = 1; -pub const vpiZ: u32 = 2; -pub const vpiX: u32 = 3; -pub const vpiH: u32 = 4; -pub const vpiL: u32 = 5; -pub const vpiDontCare: u32 = 6; -pub const vpiSysTask: u32 = 1; -pub const vpiSysFunc: u32 = 2; -pub const vpiCompile: u32 = 1; -pub const vpiPLI: u32 = 2; -pub const vpiRun: u32 = 3; -pub const vpiNotice: u32 = 1; -pub const vpiWarning: u32 = 2; -pub const vpiError: u32 = 3; -pub const vpiSystem: u32 = 4; -pub const vpiInternal: u32 = 5; -pub const vpiPackage: u32 = 600; -pub const vpiInterface: u32 = 601; -pub const vpiProgram: u32 = 602; -pub const vpiInterfaceArray: u32 = 603; -pub const vpiProgramArray: u32 = 604; -pub const vpiTypespec: u32 = 605; -pub const vpiModport: u32 = 606; -pub const vpiInterfaceTfDecl: u32 = 607; -pub const vpiRefObj: u32 = 608; -pub const vpiTypeParameter: u32 = 609; -pub const vpiVarBit: u32 = 49; -pub const vpiLongIntVar: u32 = 610; -pub const vpiShortIntVar: u32 = 611; -pub const vpiIntVar: u32 = 612; -pub const vpiShortRealVar: u32 = 613; -pub const vpiByteVar: u32 = 614; -pub const vpiClassVar: u32 = 615; -pub const vpiStringVar: u32 = 616; -pub const vpiEnumVar: u32 = 617; -pub const vpiStructVar: u32 = 618; -pub const vpiUnionVar: u32 = 619; -pub const vpiBitVar: u32 = 620; -pub const vpiLogicVar: u32 = 48; -pub const vpiArrayVar: u32 = 116; -pub const vpiClassObj: u32 = 621; -pub const vpiChandleVar: u32 = 622; -pub const vpiPackedArrayVar: u32 = 623; -pub const vpiVirtualInterfaceVar: u32 = 728; -pub const vpiLongIntTypespec: u32 = 625; -pub const vpiShortRealTypespec: u32 = 626; -pub const vpiByteTypespec: u32 = 627; -pub const vpiShortIntTypespec: u32 = 628; -pub const vpiIntTypespec: u32 = 629; -pub const vpiClassTypespec: u32 = 630; -pub const vpiStringTypespec: u32 = 631; -pub const vpiChandleTypespec: u32 = 632; -pub const vpiEnumTypespec: u32 = 633; -pub const vpiEnumConst: u32 = 634; -pub const vpiIntegerTypespec: u32 = 635; -pub const vpiTimeTypespec: u32 = 636; -pub const vpiRealTypespec: u32 = 637; -pub const vpiStructTypespec: u32 = 638; -pub const vpiUnionTypespec: u32 = 639; -pub const vpiBitTypespec: u32 = 640; -pub const vpiLogicTypespec: u32 = 641; -pub const vpiArrayTypespec: u32 = 642; -pub const vpiVoidTypespec: u32 = 643; -pub const vpiTypespecMember: u32 = 644; -pub const vpiPackedArrayTypespec: u32 = 692; -pub const vpiSequenceTypespec: u32 = 696; -pub const vpiPropertyTypespec: u32 = 697; -pub const vpiEventTypespec: u32 = 698; -pub const vpiInterfaceTypespec: u32 = 906; -pub const vpiClockingBlock: u32 = 650; -pub const vpiClockingIODecl: u32 = 651; -pub const vpiClassDefn: u32 = 652; -pub const vpiConstraint: u32 = 653; -pub const vpiConstraintOrdering: u32 = 654; -pub const vpiDistItem: u32 = 645; -pub const vpiAliasStmt: u32 = 646; -pub const vpiThread: u32 = 647; -pub const vpiMethodFuncCall: u32 = 648; -pub const vpiMethodTaskCall: u32 = 649; -pub const vpiAssert: u32 = 686; -pub const vpiAssume: u32 = 687; -pub const vpiCover: u32 = 688; -pub const vpiRestrict: u32 = 901; -pub const vpiDisableCondition: u32 = 689; -pub const vpiClockingEvent: u32 = 690; -pub const vpiPropertyDecl: u32 = 655; -pub const vpiPropertySpec: u32 = 656; -pub const vpiPropertyExpr: u32 = 657; -pub const vpiMulticlockSequenceExpr: u32 = 658; -pub const vpiClockedSeq: u32 = 659; -pub const vpiClockedProp: u32 = 902; -pub const vpiPropertyInst: u32 = 660; -pub const vpiSequenceDecl: u32 = 661; -pub const vpiCaseProperty: u32 = 662; -pub const vpiCasePropertyItem: u32 = 905; -pub const vpiSequenceInst: u32 = 664; -pub const vpiImmediateAssert: u32 = 665; -pub const vpiImmediateAssume: u32 = 694; -pub const vpiImmediateCover: u32 = 695; -pub const vpiReturn: u32 = 666; -pub const vpiAnyPattern: u32 = 667; -pub const vpiTaggedPattern: u32 = 668; -pub const vpiStructPattern: u32 = 669; -pub const vpiDoWhile: u32 = 670; -pub const vpiOrderedWait: u32 = 671; -pub const vpiWaitFork: u32 = 672; -pub const vpiDisableFork: u32 = 673; -pub const vpiExpectStmt: u32 = 674; -pub const vpiForeachStmt: u32 = 675; -pub const vpiReturnStmt: u32 = 691; -pub const vpiFinal: u32 = 676; -pub const vpiExtends: u32 = 677; -pub const vpiDistribution: u32 = 678; -pub const vpiSeqFormalDecl: u32 = 679; -pub const vpiPropFormalDecl: u32 = 699; -pub const vpiArrayNet: u32 = 114; -pub const vpiEnumNet: u32 = 680; -pub const vpiIntegerNet: u32 = 681; -pub const vpiLogicNet: u32 = 36; -pub const vpiTimeNet: u32 = 682; -pub const vpiUnionNet: u32 = 525; -pub const vpiShortRealNet: u32 = 526; -pub const vpiRealNet: u32 = 527; -pub const vpiByteNet: u32 = 528; -pub const vpiShortIntNet: u32 = 529; -pub const vpiIntNet: u32 = 530; -pub const vpiLongIntNet: u32 = 531; -pub const vpiBitNet: u32 = 532; -pub const vpiInterconnectNet: u32 = 533; -pub const vpiInterconnectArray: u32 = 534; -pub const vpiStructNet: u32 = 683; -pub const vpiBreak: u32 = 684; -pub const vpiContinue: u32 = 685; -pub const vpiPackedArrayNet: u32 = 693; -pub const vpiNettypeDecl: u32 = 523; -pub const vpiConstraintExpr: u32 = 747; -pub const vpiElseConst: u32 = 748; -pub const vpiImplication: u32 = 749; -pub const vpiConstrIf: u32 = 738; -pub const vpiConstrIfElse: u32 = 739; -pub const vpiConstrForEach: u32 = 736; -pub const vpiSoftDisable: u32 = 733; -pub const vpiLetDecl: u32 = 903; -pub const vpiLetExpr: u32 = 904; -pub const vpiActual: u32 = 700; -pub const vpiTypedefAlias: u32 = 701; -pub const vpiIndexTypespec: u32 = 702; -pub const vpiBaseTypespec: u32 = 703; -pub const vpiElemTypespec: u32 = 704; -pub const vpiNetTypedefAlias: u32 = 705; -pub const vpiInputSkew: u32 = 706; -pub const vpiOutputSkew: u32 = 707; -pub const vpiGlobalClocking: u32 = 708; -pub const vpiDefaultClocking: u32 = 709; -pub const vpiDefaultDisableIff: u32 = 710; -pub const vpiOrigin: u32 = 713; -pub const vpiPrefix: u32 = 714; -pub const vpiWith: u32 = 715; -pub const vpiProperty: u32 = 718; -pub const vpiValueRange: u32 = 720; -pub const vpiPattern: u32 = 721; -pub const vpiWeight: u32 = 722; -pub const vpiConstraintItem: u32 = 746; -pub const vpiTypedef: u32 = 725; -pub const vpiImport: u32 = 726; -pub const vpiDerivedClasses: u32 = 727; -pub const vpiInterfaceDecl: u32 = 728; -pub const vpiMethods: u32 = 730; -pub const vpiSolveBefore: u32 = 731; -pub const vpiSolveAfter: u32 = 732; -pub const vpiWaitingProcesses: u32 = 734; -pub const vpiMessages: u32 = 735; -pub const vpiLoopVars: u32 = 737; -pub const vpiConcurrentAssertion: u32 = 740; -pub const vpiConcurrentAssertions: u32 = 740; -pub const vpiMatchItem: u32 = 741; -pub const vpiMember: u32 = 742; -pub const vpiElement: u32 = 743; -pub const vpiAssertion: u32 = 744; -pub const vpiInstance: u32 = 745; -pub const vpiTop: u32 = 600; -pub const vpiUnit: u32 = 602; -pub const vpiJoinType: u32 = 603; -pub const vpiJoin: u32 = 0; -pub const vpiJoinNone: u32 = 1; -pub const vpiJoinAny: u32 = 2; -pub const vpiAccessType: u32 = 604; -pub const vpiForkJoinAcc: u32 = 1; -pub const vpiExternAcc: u32 = 2; -pub const vpiDPIExportAcc: u32 = 3; -pub const vpiDPIImportAcc: u32 = 4; -pub const vpiArrayType: u32 = 606; -pub const vpiStaticArray: u32 = 1; -pub const vpiDynamicArray: u32 = 2; -pub const vpiAssocArray: u32 = 3; -pub const vpiQueueArray: u32 = 4; -pub const vpiArrayMember: u32 = 607; -pub const vpiIsRandomized: u32 = 608; -pub const vpiLocalVarDecls: u32 = 609; -pub const vpiOpStrong: u32 = 656; -pub const vpiRandType: u32 = 610; -pub const vpiNotRand: u32 = 1; -pub const vpiRand: u32 = 2; -pub const vpiRandC: u32 = 3; -pub const vpiPortType: u32 = 611; -pub const vpiInterfacePort: u32 = 1; -pub const vpiModportPort: u32 = 2; -pub const vpiConstantVariable: u32 = 612; -pub const vpiStructUnionMember: u32 = 615; -pub const vpiVisibility: u32 = 620; -pub const vpiPublicVis: u32 = 1; -pub const vpiProtectedVis: u32 = 2; -pub const vpiLocalVis: u32 = 3; -pub const vpiOneStepConst: u32 = 9; -pub const vpiUnboundedConst: u32 = 10; -pub const vpiNullConst: u32 = 11; -pub const vpiAlwaysType: u32 = 624; -pub const vpiAlwaysComb: u32 = 2; -pub const vpiAlwaysFF: u32 = 3; -pub const vpiAlwaysLatch: u32 = 4; -pub const vpiDistType: u32 = 625; -pub const vpiEqualDist: u32 = 1; -pub const vpiDivDist: u32 = 2; -pub const vpiPacked: u32 = 630; -pub const vpiTagged: u32 = 632; -pub const vpiRef: u32 = 6; -pub const vpiVirtual: u32 = 635; -pub const vpiHasActual: u32 = 636; -pub const vpiIsConstraintEnabled: u32 = 638; -pub const vpiSoft: u32 = 639; -pub const vpiClassType: u32 = 640; -pub const vpiMailboxClass: u32 = 1; -pub const vpiSemaphoreClass: u32 = 2; -pub const vpiUserDefinedClass: u32 = 3; -pub const vpiProcessClass: u32 = 4; -pub const vpiMethod: u32 = 645; -pub const vpiIsClockInferred: u32 = 649; -pub const vpiIsDeferred: u32 = 657; -pub const vpiIsFinal: u32 = 670; -pub const vpiIsCoverSequence: u32 = 659; -pub const vpiQualifier: u32 = 650; -pub const vpiNoQualifier: u32 = 0; -pub const vpiUniqueQualifier: u32 = 1; -pub const vpiPriorityQualifier: u32 = 2; -pub const vpiTaggedQualifier: u32 = 4; -pub const vpiRandQualifier: u32 = 8; -pub const vpiInsideQualifier: u32 = 16; -pub const vpiInputEdge: u32 = 651; -pub const vpiOutputEdge: u32 = 652; -pub const vpiGeneric: u32 = 653; -pub const vpiCompatibilityMode: u32 = 654; -pub const vpiMode1364v1995: u32 = 1; -pub const vpiMode1364v2001: u32 = 2; -pub const vpiMode1364v2005: u32 = 3; -pub const vpiMode1800v2005: u32 = 4; -pub const vpiMode1800v2009: u32 = 5; -pub const vpiPackedArrayMember: u32 = 655; -pub const vpiStartLine: u32 = 661; -pub const vpiColumn: u32 = 662; -pub const vpiEndLine: u32 = 663; -pub const vpiEndColumn: u32 = 664; -pub const vpiAllocScheme: u32 = 658; -pub const vpiAutomaticScheme: u32 = 1; -pub const vpiDynamicScheme: u32 = 2; -pub const vpiOtherScheme: u32 = 3; -pub const vpiObjId: u32 = 660; -pub const vpiDPIPure: u32 = 665; -pub const vpiDPIContext: u32 = 666; -pub const vpiDPICStr: u32 = 667; -pub const vpiDPI: u32 = 1; -pub const vpiDPIC: u32 = 2; -pub const vpiDPICIdentifier: u32 = 668; -pub const vpiIsModPort: u32 = 669; -pub const vpiImplyOp: u32 = 50; -pub const vpiNonOverlapImplyOp: u32 = 51; -pub const vpiOverlapImplyOp: u32 = 52; -pub const vpiAcceptOnOp: u32 = 83; -pub const vpiRejectOnOp: u32 = 84; -pub const vpiSyncAcceptOnOp: u32 = 85; -pub const vpiSyncRejectOnOp: u32 = 86; -pub const vpiOverlapFollowedByOp: u32 = 87; -pub const vpiNonOverlapFollowedByOp: u32 = 88; -pub const vpiNexttimeOp: u32 = 89; -pub const vpiAlwaysOp: u32 = 90; -pub const vpiEventuallyOp: u32 = 91; -pub const vpiUntilOp: u32 = 92; -pub const vpiUntilWithOp: u32 = 93; -pub const vpiUnaryCycleDelayOp: u32 = 53; -pub const vpiCycleDelayOp: u32 = 54; -pub const vpiIntersectOp: u32 = 55; -pub const vpiFirstMatchOp: u32 = 56; -pub const vpiThroughoutOp: u32 = 57; -pub const vpiWithinOp: u32 = 58; -pub const vpiRepeatOp: u32 = 59; -pub const vpiConsecutiveRepeatOp: u32 = 60; -pub const vpiGotoRepeatOp: u32 = 61; -pub const vpiPostIncOp: u32 = 62; -pub const vpiPreIncOp: u32 = 63; -pub const vpiPostDecOp: u32 = 64; -pub const vpiPreDecOp: u32 = 65; -pub const vpiMatchOp: u32 = 66; -pub const vpiCastOp: u32 = 67; -pub const vpiIffOp: u32 = 68; -pub const vpiWildEqOp: u32 = 69; -pub const vpiWildNeqOp: u32 = 70; -pub const vpiStreamLROp: u32 = 71; -pub const vpiStreamRLOp: u32 = 72; -pub const vpiMatchedOp: u32 = 73; -pub const vpiTriggeredOp: u32 = 74; -pub const vpiAssignmentPatternOp: u32 = 75; -pub const vpiMultiAssignmentPatternOp: u32 = 76; -pub const vpiIfOp: u32 = 77; -pub const vpiIfElseOp: u32 = 78; -pub const vpiCompAndOp: u32 = 79; -pub const vpiCompOrOp: u32 = 80; -pub const vpiImpliesOp: u32 = 94; -pub const vpiInsideOp: u32 = 95; -pub const vpiTypeOp: u32 = 81; -pub const vpiAssignmentOp: u32 = 82; -pub const vpiOtherFunc: u32 = 6; -pub const vpiValidUnknown: u32 = 2; -pub const vpiCoverageStart: u32 = 750; -pub const vpiCoverageStop: u32 = 751; -pub const vpiCoverageReset: u32 = 752; -pub const vpiCoverageCheck: u32 = 753; -pub const vpiCoverageMerge: u32 = 754; -pub const vpiCoverageSave: u32 = 755; -pub const vpiAssertCoverage: u32 = 760; -pub const vpiFsmStateCoverage: u32 = 761; -pub const vpiStatementCoverage: u32 = 762; -pub const vpiToggleCoverage: u32 = 763; -pub const vpiCovered: u32 = 765; -pub const vpiCoverMax: u32 = 766; -pub const vpiCoveredMax: u32 = 766; -pub const vpiCoveredCount: u32 = 767; -pub const vpiAssertAttemptCovered: u32 = 770; -pub const vpiAssertSuccessCovered: u32 = 771; -pub const vpiAssertFailureCovered: u32 = 772; -pub const vpiAssertVacuousSuccessCovered: u32 = 773; -pub const vpiAssertDisableCovered: u32 = 774; -pub const vpiAssertKillCovered: u32 = 777; -pub const vpiFsmStates: u32 = 775; -pub const vpiFsmStateExpression: u32 = 776; -pub const vpiFsm: u32 = 758; -pub const vpiFsmHandle: u32 = 759; -pub const vpiAssertionLock: u32 = 645; -pub const vpiAssertionUnlock: u32 = 646; -pub const vpiAssertionDisable: u32 = 620; -pub const vpiAssertionEnable: u32 = 621; -pub const vpiAssertionReset: u32 = 622; -pub const vpiAssertionKill: u32 = 623; -pub const vpiAssertionEnableStep: u32 = 624; -pub const vpiAssertionDisableStep: u32 = 625; -pub const vpiAssertionClockSteps: u32 = 626; -pub const vpiAssertionSysLock: u32 = 647; -pub const vpiAssertionSysUnlock: u32 = 648; -pub const vpiAssertionSysOn: u32 = 627; -pub const vpiAssertionSysOff: u32 = 628; -pub const vpiAssertionSysKill: u32 = 632; -pub const vpiAssertionSysEnd: u32 = 629; -pub const vpiAssertionSysReset: u32 = 630; -pub const vpiAssertionDisablePassAction: u32 = 633; -pub const vpiAssertionEnablePassAction: u32 = 634; -pub const vpiAssertionDisableFailAction: u32 = 635; -pub const vpiAssertionEnableFailAction: u32 = 636; -pub const vpiAssertionDisableVacuousAction: u32 = 637; -pub const vpiAssertionEnableNonvacuousAction: u32 = 638; -pub const vpiAssertionSysEnablePassAction: u32 = 639; -pub const vpiAssertionSysEnableFailAction: u32 = 640; -pub const vpiAssertionSysDisablePassAction: u32 = 641; -pub const vpiAssertionSysDisableFailAction: u32 = 642; -pub const vpiAssertionSysEnableNonvacuousAction: u32 = 643; -pub const vpiAssertionSysDisableVacuousAction: u32 = 644; -pub type va_list = __builtin_va_list; -pub type PLI_INT64 = i64; -pub type PLI_INT32 = ::std::os::raw::c_int; -pub type PLI_UINT32 = ::std::os::raw::c_uint; -pub type PLI_INT16 = ::std::os::raw::c_short; -pub type PLI_BYTE8 = ::std::os::raw::c_char; -#[doc = " TYPEDEFS"] -pub type vpiHandle = *mut PLI_UINT32; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct t_vpi_time { - pub type_: PLI_INT32, - pub high: PLI_UINT32, - pub low: PLI_UINT32, - pub real: f64, -} -#[test] -fn bindgen_test_layout_t_vpi_time() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(t_vpi_time)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(t_vpi_time)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_time), - "::", - stringify!(type_) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).high) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_time), - "::", - stringify!(high) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).low) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_time), - "::", - stringify!(low) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).real) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_time), - "::", - stringify!(real) - ) - ); -} -pub type s_vpi_time = t_vpi_time; -pub type p_vpi_time = *mut t_vpi_time; -#[doc = " delay structures"] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct t_vpi_delay { - pub da: *mut t_vpi_time, - pub no_of_delays: PLI_INT32, - pub time_type: PLI_INT32, - pub mtm_flag: PLI_INT32, - pub append_flag: PLI_INT32, - pub pulsere_flag: PLI_INT32, -} -#[test] -fn bindgen_test_layout_t_vpi_delay() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(t_vpi_delay)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(t_vpi_delay)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).da) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_delay), - "::", - stringify!(da) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).no_of_delays) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_delay), - "::", - stringify!(no_of_delays) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).time_type) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_delay), - "::", - stringify!(time_type) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mtm_flag) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_delay), - "::", - stringify!(mtm_flag) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).append_flag) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_delay), - "::", - stringify!(append_flag) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pulsere_flag) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_delay), - "::", - stringify!(pulsere_flag) - ) - ); -} -#[doc = " delay structures"] -pub type p_vpi_delay = *mut t_vpi_delay; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct t_vpi_vecval { - pub aval: PLI_UINT32, - pub bval: PLI_UINT32, -} -#[test] -fn bindgen_test_layout_t_vpi_vecval() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(t_vpi_vecval)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(t_vpi_vecval)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).aval) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_vecval), - "::", - stringify!(aval) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bval) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_vecval), - "::", - stringify!(bval) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct t_vpi_strengthval { - pub logic: PLI_INT32, - pub s0: PLI_INT32, - pub s1: PLI_INT32, -} -#[test] -fn bindgen_test_layout_t_vpi_strengthval() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 12usize, - concat!("Size of: ", stringify!(t_vpi_strengthval)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(t_vpi_strengthval)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).logic) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_strengthval), - "::", - stringify!(logic) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).s0) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_strengthval), - "::", - stringify!(s0) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).s1) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_strengthval), - "::", - stringify!(s1) - ) - ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub struct t_vpi_value { - pub format: PLI_INT32, - pub value: t_vpi_value__bindgen_ty_1, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union t_vpi_value__bindgen_ty_1 { - pub str_: *mut PLI_BYTE8, - pub scalar: PLI_INT32, - pub integer: PLI_INT32, - pub real: f64, - pub time: *mut t_vpi_time, - pub vector: *mut t_vpi_vecval, - pub strength: *mut t_vpi_strengthval, - pub misc: *mut PLI_BYTE8, -} -#[test] -fn bindgen_test_layout_t_vpi_value__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(t_vpi_value__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(t_vpi_value__bindgen_ty_1)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).str_) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_value__bindgen_ty_1), - "::", - stringify!(str_) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).scalar) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_value__bindgen_ty_1), - "::", - stringify!(scalar) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).integer) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_value__bindgen_ty_1), - "::", - stringify!(integer) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).real) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_value__bindgen_ty_1), - "::", - stringify!(real) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).time) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_value__bindgen_ty_1), - "::", - stringify!(time) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).vector) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_value__bindgen_ty_1), - "::", - stringify!(vector) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).strength) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_value__bindgen_ty_1), - "::", - stringify!(strength) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).misc) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_value__bindgen_ty_1), - "::", - stringify!(misc) - ) - ); -} -#[test] -fn bindgen_test_layout_t_vpi_value() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(t_vpi_value)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(t_vpi_value)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).format) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_value), - "::", - stringify!(format) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).value) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_value), - "::", - stringify!(value) - ) - ); -} -pub type p_vpi_value = *mut t_vpi_value; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct t_vpi_arrayvalue { - pub format: PLI_UINT32, - pub flags: PLI_UINT32, - pub value: t_vpi_arrayvalue__bindgen_ty_1, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union t_vpi_arrayvalue__bindgen_ty_1 { - pub integers: *mut PLI_INT32, - pub shortints: *mut PLI_INT16, - pub longints: *mut PLI_INT64, - pub rawvals: *mut PLI_BYTE8, - pub vectors: *mut t_vpi_vecval, - pub times: *mut t_vpi_time, - pub reals: *mut f64, - pub shortreals: *mut f32, -} -#[test] -fn bindgen_test_layout_t_vpi_arrayvalue__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(t_vpi_arrayvalue__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(t_vpi_arrayvalue__bindgen_ty_1)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).integers) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_arrayvalue__bindgen_ty_1), - "::", - stringify!(integers) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).shortints) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_arrayvalue__bindgen_ty_1), - "::", - stringify!(shortints) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).longints) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_arrayvalue__bindgen_ty_1), - "::", - stringify!(longints) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rawvals) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_arrayvalue__bindgen_ty_1), - "::", - stringify!(rawvals) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).vectors) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_arrayvalue__bindgen_ty_1), - "::", - stringify!(vectors) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).times) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_arrayvalue__bindgen_ty_1), - "::", - stringify!(times) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reals) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_arrayvalue__bindgen_ty_1), - "::", - stringify!(reals) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).shortreals) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_arrayvalue__bindgen_ty_1), - "::", - stringify!(shortreals) - ) - ); -} -#[test] -fn bindgen_test_layout_t_vpi_arrayvalue() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(t_vpi_arrayvalue)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(t_vpi_arrayvalue)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).format) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_arrayvalue), - "::", - stringify!(format) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_arrayvalue), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).value) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_arrayvalue), - "::", - stringify!(value) - ) - ); -} -pub type p_vpi_arrayvalue = *mut t_vpi_arrayvalue; -#[doc = " system task/function structure"] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct t_vpi_systf_data { - pub type_: PLI_INT32, - pub sysfunctype: PLI_INT32, - pub tfname: *mut PLI_BYTE8, - pub calltf: ::std::option::Option PLI_INT32>, - pub compiletf: ::std::option::Option PLI_INT32>, - pub sizetf: ::std::option::Option PLI_INT32>, - pub user_data: *mut PLI_BYTE8, -} -#[test] -fn bindgen_test_layout_t_vpi_systf_data() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(t_vpi_systf_data)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(t_vpi_systf_data)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_systf_data), - "::", - stringify!(type_) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sysfunctype) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_systf_data), - "::", - stringify!(sysfunctype) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tfname) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_systf_data), - "::", - stringify!(tfname) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).calltf) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_systf_data), - "::", - stringify!(calltf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).compiletf) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_systf_data), - "::", - stringify!(compiletf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sizetf) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_systf_data), - "::", - stringify!(sizetf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).user_data) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_systf_data), - "::", - stringify!(user_data) - ) - ); -} -#[doc = " system task/function structure"] -pub type p_vpi_systf_data = *mut t_vpi_systf_data; -#[doc = " SystemVerilog execution information structure"] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct t_vpi_vlog_info { - pub argc: PLI_INT32, - pub argv: *mut *mut PLI_BYTE8, - pub product: *mut PLI_BYTE8, - pub version: *mut PLI_BYTE8, -} -#[test] -fn bindgen_test_layout_t_vpi_vlog_info() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(t_vpi_vlog_info)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(t_vpi_vlog_info)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).argc) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_vlog_info), - "::", - stringify!(argc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).argv) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_vlog_info), - "::", - stringify!(argv) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).product) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_vlog_info), - "::", - stringify!(product) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_vlog_info), - "::", - stringify!(version) - ) - ); -} -#[doc = " SystemVerilog execution information structure"] -pub type p_vpi_vlog_info = *mut t_vpi_vlog_info; -#[doc = " PLI error information structure"] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct t_vpi_error_info { - pub state: PLI_INT32, - pub level: PLI_INT32, - pub message: *mut PLI_BYTE8, - pub product: *mut PLI_BYTE8, - pub code: *mut PLI_BYTE8, - pub file: *mut PLI_BYTE8, - pub line: PLI_INT32, -} -#[test] -fn bindgen_test_layout_t_vpi_error_info() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(t_vpi_error_info)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(t_vpi_error_info)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).state) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_error_info), - "::", - stringify!(state) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).level) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_error_info), - "::", - stringify!(level) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).message) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_error_info), - "::", - stringify!(message) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).product) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_error_info), - "::", - stringify!(product) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).code) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_error_info), - "::", - stringify!(code) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).file) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_error_info), - "::", - stringify!(file) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).line) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_error_info), - "::", - stringify!(line) - ) - ); -} -#[doc = " PLI error information structure"] -pub type p_vpi_error_info = *mut t_vpi_error_info; -#[doc = " callback structures"] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct t_cb_data { - pub reason: PLI_INT32, - pub cb_rtn: ::std::option::Option PLI_INT32>, - pub obj: vpiHandle, - pub time: p_vpi_time, - pub value: p_vpi_value, - pub index: PLI_INT32, - pub user_data: *mut PLI_BYTE8, -} -#[test] -fn bindgen_test_layout_t_cb_data() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 56usize, - concat!("Size of: ", stringify!(t_cb_data)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(t_cb_data)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reason) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(t_cb_data), - "::", - stringify!(reason) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cb_rtn) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(t_cb_data), - "::", - stringify!(cb_rtn) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).obj) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(t_cb_data), - "::", - stringify!(obj) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).time) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(t_cb_data), - "::", - stringify!(time) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).value) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(t_cb_data), - "::", - stringify!(value) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).index) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(t_cb_data), - "::", - stringify!(index) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).user_data) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(t_cb_data), - "::", - stringify!(user_data) - ) - ); -} -#[doc = " callback structures"] -pub type p_cb_data = *mut t_cb_data; -extern "C" { - pub fn vpi_register_cb(cb_data_p: p_cb_data) -> vpiHandle; -} -extern "C" { - pub fn vpi_remove_cb(cb_obj: vpiHandle) -> PLI_INT32; -} -extern "C" { - pub fn vpi_get_cb_info(object: vpiHandle, cb_data_p: p_cb_data); -} -extern "C" { - pub fn vpi_register_systf(systf_data_p: p_vpi_systf_data) -> vpiHandle; -} -extern "C" { - pub fn vpi_get_systf_info(object: vpiHandle, systf_data_p: p_vpi_systf_data); -} -extern "C" { - pub fn vpi_handle_by_name(name: *mut PLI_BYTE8, scope: vpiHandle) -> vpiHandle; -} -extern "C" { - pub fn vpi_handle_by_index(object: vpiHandle, indx: PLI_INT32) -> vpiHandle; -} -extern "C" { - pub fn vpi_handle(type_: PLI_INT32, refHandle: vpiHandle) -> vpiHandle; -} -extern "C" { - pub fn vpi_handle_multi( - type_: PLI_INT32, - refHandle1: vpiHandle, - refHandle2: vpiHandle, - ... - ) -> vpiHandle; -} -extern "C" { - pub fn vpi_iterate(type_: PLI_INT32, refHandle: vpiHandle) -> vpiHandle; -} -extern "C" { - pub fn vpi_scan(iterator: vpiHandle) -> vpiHandle; -} -extern "C" { - pub fn vpi_get(property: PLI_INT32, object: vpiHandle) -> PLI_INT32; -} -extern "C" { - pub fn vpi_get64(property: PLI_INT32, object: vpiHandle) -> PLI_INT64; -} -extern "C" { - pub fn vpi_get_str(property: PLI_INT32, object: vpiHandle) -> *mut PLI_BYTE8; -} -extern "C" { - pub fn vpi_get_delays(object: vpiHandle, delay_p: p_vpi_delay); -} -extern "C" { - pub fn vpi_put_delays(object: vpiHandle, delay_p: p_vpi_delay); -} -extern "C" { - pub fn vpi_get_value(expr: vpiHandle, value_p: p_vpi_value); -} -extern "C" { - pub fn vpi_put_value( - object: vpiHandle, - value_p: p_vpi_value, - time_p: p_vpi_time, - flags: PLI_INT32, - ) -> vpiHandle; -} -extern "C" { - pub fn vpi_get_value_array( - object: vpiHandle, - arrayvalue_p: p_vpi_arrayvalue, - index_p: *mut PLI_INT32, - num: PLI_UINT32, - ); -} -extern "C" { - pub fn vpi_put_value_array( - object: vpiHandle, - arrayvalue_p: p_vpi_arrayvalue, - index_p: *mut PLI_INT32, - num: PLI_UINT32, - ); -} -extern "C" { - pub fn vpi_get_time(object: vpiHandle, time_p: p_vpi_time); -} -extern "C" { - pub fn vpi_mcd_open(fileName: *mut PLI_BYTE8) -> PLI_UINT32; -} -extern "C" { - pub fn vpi_mcd_close(mcd: PLI_UINT32) -> PLI_UINT32; -} -extern "C" { - pub fn vpi_mcd_name(cd: PLI_UINT32) -> *mut PLI_BYTE8; -} -extern "C" { - pub fn vpi_mcd_printf(mcd: PLI_UINT32, format: *mut PLI_BYTE8, ...) -> PLI_INT32; -} -extern "C" { - pub fn vpi_printf(format: *mut PLI_BYTE8, ...) -> PLI_INT32; -} -extern "C" { - pub fn vpi_compare_objects(object1: vpiHandle, object2: vpiHandle) -> PLI_INT32; -} -extern "C" { - pub fn vpi_chk_error(error_info_p: p_vpi_error_info) -> PLI_INT32; -} -extern "C" { - pub fn vpi_free_object(object: vpiHandle) -> PLI_INT32; -} -extern "C" { - pub fn vpi_release_handle(object: vpiHandle) -> PLI_INT32; -} -extern "C" { - pub fn vpi_get_vlog_info(vlog_info_p: p_vpi_vlog_info) -> PLI_INT32; -} -extern "C" { - pub fn vpi_get_data(id: PLI_INT32, dataLoc: *mut PLI_BYTE8, numOfBytes: PLI_INT32) - -> PLI_INT32; -} -extern "C" { - pub fn vpi_put_data(id: PLI_INT32, dataLoc: *mut PLI_BYTE8, numOfBytes: PLI_INT32) - -> PLI_INT32; -} -extern "C" { - pub fn vpi_get_userdata(obj: vpiHandle) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn vpi_put_userdata(obj: vpiHandle, userdata: *mut ::std::os::raw::c_void) -> PLI_INT32; -} -extern "C" { - pub fn vpi_vprintf(format: *mut PLI_BYTE8, ap: *mut __va_list_tag) -> PLI_INT32; -} -extern "C" { - pub fn vpi_mcd_vprintf( - mcd: PLI_UINT32, - format: *mut PLI_BYTE8, - ap: *mut __va_list_tag, - ) -> PLI_INT32; -} -extern "C" { - pub fn vpi_flush() -> PLI_INT32; -} -extern "C" { - pub fn vpi_mcd_flush(mcd: PLI_UINT32) -> PLI_INT32; -} -extern "C" { - pub fn vpi_control(operation: PLI_INT32, ...) -> PLI_INT32; -} -extern "C" { - pub fn vpi_handle_by_multi_index( - obj: vpiHandle, - num_index: PLI_INT32, - index_array: *mut PLI_INT32, - ) -> vpiHandle; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct t_vpi_assertion_step_info { - pub matched_expression_count: PLI_INT32, - pub matched_exprs: *mut vpiHandle, - pub stateFrom: PLI_INT32, - pub stateTo: PLI_INT32, -} -#[test] -fn bindgen_test_layout_t_vpi_assertion_step_info() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(t_vpi_assertion_step_info)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(t_vpi_assertion_step_info)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).matched_expression_count) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_assertion_step_info), - "::", - stringify!(matched_expression_count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).matched_exprs) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_assertion_step_info), - "::", - stringify!(matched_exprs) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).stateFrom) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_assertion_step_info), - "::", - stringify!(stateFrom) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).stateTo) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_assertion_step_info), - "::", - stringify!(stateTo) - ) - ); -} -pub type p_vpi_assertion_step_info = *mut t_vpi_assertion_step_info; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct t_vpi_attempt_info { - pub detail: t_vpi_attempt_info__bindgen_ty_1, - pub attemptStartTime: s_vpi_time, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union t_vpi_attempt_info__bindgen_ty_1 { - pub failExpr: vpiHandle, - pub step: p_vpi_assertion_step_info, -} -#[test] -fn bindgen_test_layout_t_vpi_attempt_info__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(t_vpi_attempt_info__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(t_vpi_attempt_info__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).failExpr) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_attempt_info__bindgen_ty_1), - "::", - stringify!(failExpr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).step) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_attempt_info__bindgen_ty_1), - "::", - stringify!(step) - ) - ); -} -#[test] -fn bindgen_test_layout_t_vpi_attempt_info() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(t_vpi_attempt_info)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(t_vpi_attempt_info)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).detail) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_attempt_info), - "::", - stringify!(detail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).attemptStartTime) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(t_vpi_attempt_info), - "::", - stringify!(attemptStartTime) - ) - ); -} -pub type p_vpi_attempt_info = *mut t_vpi_attempt_info; -pub type vpi_assertion_callback_func = ::std::option::Option< - unsafe extern "C" fn( - reason: PLI_INT32, - cb_time: p_vpi_time, - assertion: vpiHandle, - info: p_vpi_attempt_info, - user_data: *mut PLI_BYTE8, - ) -> PLI_INT32, ->; -extern "C" { - pub fn vpi_register_assertion_cb( - assertion: vpiHandle, - reason: PLI_INT32, - cb_rtn: vpi_assertion_callback_func, - user_data: *mut PLI_BYTE8, - ) -> vpiHandle; -} -pub type __builtin_va_list = [__va_list_tag; 1usize]; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __va_list_tag { - pub gp_offset: ::std::os::raw::c_uint, - pub fp_offset: ::std::os::raw::c_uint, - pub overflow_arg_area: *mut ::std::os::raw::c_void, - pub reg_save_area: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout___va_list_tag() { - const UNINIT: ::std::mem::MaybeUninit<__va_list_tag> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__va_list_tag>(), - 24usize, - concat!("Size of: ", stringify!(__va_list_tag)) - ); - assert_eq!( - ::std::mem::align_of::<__va_list_tag>(), - 8usize, - concat!("Alignment of ", stringify!(__va_list_tag)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).gp_offset) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__va_list_tag), - "::", - stringify!(gp_offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fp_offset) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(__va_list_tag), - "::", - stringify!(fp_offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).overflow_arg_area) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__va_list_tag), - "::", - stringify!(overflow_arg_area) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reg_save_area) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__va_list_tag), - "::", - stringify!(reg_save_area) - ) - ); -} diff --git a/difftest/online_drive/Cargo.toml b/difftest/online_drive/Cargo.toml index 929a8b546..ad2ef5a5a 100644 --- a/difftest/online_drive/Cargo.toml +++ b/difftest/online_drive/Cargo.toml @@ -4,7 +4,8 @@ version = "0.1.0" edition = "2021" [dependencies] -online_dpi = { path = "../online_dpi", features = ["sv2023"] } +online_dpi = { path = "../online_dpi" } +svdpi = { workspace = true, features = ["sv2023"] } [build-dependencies] cmake = "0.1.50" diff --git a/difftest/online_vcs/Cargo.toml b/difftest/online_vcs/Cargo.toml index d85b2b690..f0b513916 100644 --- a/difftest/online_vcs/Cargo.toml +++ b/difftest/online_vcs/Cargo.toml @@ -8,7 +8,8 @@ crate-type = ["staticlib"] name = "dpi" [dependencies] -online_dpi = { path = "../online_dpi", features = ["svvpi"] } +online_dpi = { path = "../online_dpi" } +svdpi = { workspace = true, features = ["vpi"] } [features] trace = ["online_dpi/trace"]