Skip to content

Commit

Permalink
[difftest] move svdpi bindings to separate repo
Browse files Browse the repository at this point in the history
  • Loading branch information
FanShupei authored and sequencer committed Aug 25, 2024
1 parent 2357c6c commit 924f863
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 2,942 deletions.
9 changes: 9 additions & 0 deletions difftest/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions difftest/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
3 changes: 1 addition & 2 deletions difftest/online_dpi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
5 changes: 2 additions & 3 deletions difftest/online_dpi/src/dpi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion difftest/online_dpi/src/drive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<u8>,
Expand Down
15 changes: 1 addition & 14 deletions difftest/online_dpi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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()
}
50 changes: 0 additions & 50 deletions difftest/online_dpi/src/svdpi.rs

This file was deleted.

Loading

0 comments on commit 924f863

Please sign in to comment.