Skip to content

Commit

Permalink
[difftest] use link-cplusplus
Browse files Browse the repository at this point in the history
  • Loading branch information
FanShupei committed Jul 22, 2024
1 parent 6365bff commit ecec06a
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 1 deletion.
11 changes: 11 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 @@ -21,3 +21,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"
link-cplusplus = "1.0.9"
1 change: 1 addition & 0 deletions difftest/online_drive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ common = { path = "../test_common" }
spike_rs = { path = "../spike_rs" }
clap = { workspace = true }
tracing = { workspace = true }
link-cplusplus = { workspace = true }
hex = "0.4.3"

[build-dependencies]
Expand Down
1 change: 0 additions & 1 deletion difftest/online_drive/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ fn main() {
println!("cargo::rustc-link-lib=static=dpi_pre_link");
println!("cargo::rustc-link-lib=static=VTestBench");
println!("cargo::rustc-link-lib=static=verilated");
println!("cargo::rustc-link-lib=stdc++");
println!("cargo::rustc-link-lib=z");
println!("cargo::rerun-if-env-changed=VERILATED_LIB_DIR");
}
2 changes: 2 additions & 0 deletions difftest/online_drive/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ use common::CommonArgs;
mod dpi;
mod drive;

extern crate link_cplusplus;

#[derive(Parser)]
pub(crate) struct OfflineArgs {
#[command(flatten)]
Expand Down
1 change: 1 addition & 0 deletions difftest/spike_rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ edition = "2021"
[dependencies]
anyhow = { workspace = true }
tracing = { workspace = true }
link-cplusplus = { workspace = true }
libc = "0.2.155"
xmas-elf = "0.9.1"
2 changes: 2 additions & 0 deletions difftest/spike_rs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ use libc::c_char;
use std::ffi::{CStr, CString};
use tracing::trace;

extern crate link_cplusplus;

pub fn clip(binary: u32, a: i32, b: i32) -> u32 {
assert!(a <= b, "a should be less than or equal to b");
let nbits = b - a + 1;
Expand Down

0 comments on commit ecec06a

Please sign in to comment.