-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Failed to link due to snps doesn't implement the IEEE 1800-2023: = note: /nix/store/2p1sq1nr09xr3xb1a9lrjgdanvk1aakb-binutils-2.42/bin/ld: warning: type of symbol `cosim_init' changed from 1 to 2 in /home/sequencer/t1/difftest/target/debug/deps/libonline_dpi-e08daffbb814a8db.rlib(online_dpi-e08daffbb814a8db.4twjnztmhnh46d6z.rcgu.o) /nix/store/2p1sq1nr09xr3xb1a9lrjgdanvk1aakb-binutils-2.42/bin/ld: /home/sequencer/t1/difftest/target/debug/deps/libonline_dpi-e08daffbb814a8db.rlib(online_dpi-e08daffbb814a8db.3wnd5deuga8hai4e.rcgu.o): in function `online_dpi::svdpi::get_time': /home/sequencer/t1/difftest/online_dpi/src/svdpi.rs:9:(.text._ZN10online_dpi5svdpi8get_time17hc271602d89503b28E+0x56): undefined reference to `svGetTime' collect2: error: ld returned 1 exit status = note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified = note: use the `-l` flag to specify native libraries to link = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#rustc-link-lib) cosim_init is conflict with SNPS symbol, we need to change ours Reproduce via: - nix develop --impure .#t1.blastoise.ip.vcs-emu - cd difftest/ - cargo run --bin online_vcs -- --elf-file $(nix build --no-link --print-out-paths .#t1.blastoise.cases.intrinsic.softmax)/bin/* --timeout 10000 --log-level trace
- Loading branch information
Showing
5 changed files
with
93 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
use std::path::Path; | ||
use std::env; | ||
|
||
fn main() { | ||
let vcs_lib_dir = env::var("VCS_LIB_DIR").unwrap(); | ||
println!("cargo:rustc-link-search=native={}", Path::new(&vcs_lib_dir).display()); | ||
let vcs_compiled_lib_dir = env::var("VCS_COMPILED_LIB_DIR").unwrap(); | ||
println!("cargo:rustc-link-search=native={}", Path::new(&vcs_compiled_lib_dir).display()); | ||
println!("cargo::rustc-link-lib=TestBench"); | ||
println!("cargo::rustc-link-lib=vcsnew64"); | ||
println!("cargo::rustc-link-lib=vcs_tls"); | ||
println!("cargo::rustc-link-lib=vfs"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
{ lib | ||
, callPackage | ||
, elaborateConfig | ||
|
||
, rustPlatform | ||
|
||
, rust-analyzer | ||
, rust-bindgen | ||
|
||
, vcStaticInstallPath | ||
, vcs-lib | ||
|
||
, cmake | ||
, clang-tools | ||
}: | ||
|
||
let | ||
spike_interfaces = callPackage ./spike_interfaces { }; | ||
|
||
self = rustPlatform.buildRustPackage { | ||
name = "t1-vcs-emu"; | ||
src = with lib.fileset; toSource { | ||
root = ./.; | ||
fileset = unions [ | ||
./spike_rs | ||
./offline | ||
./online_dpi | ||
./online_drive | ||
./online_vcs | ||
./test_common | ||
./Cargo.lock | ||
./Cargo.toml | ||
]; | ||
}; | ||
|
||
buildInputs = [ | ||
spike_interfaces | ||
vcs-lib | ||
]; | ||
|
||
buildFeatures = lib.optionals vcs-lib.enable-trace [ "trace" ]; | ||
|
||
env = { | ||
VCS_LIB_DIR = "${vcStaticInstallPath}/vcs-mx/linux64/lib"; | ||
VCS_COMPILED_LIB_DIR = "${vcs-lib}/lib"; | ||
DESIGN_VLEN = elaborateConfig.parameter.vLen; | ||
DESIGN_DLEN = elaborateConfig.parameter.dLen; | ||
}; | ||
|
||
cargoLock = { | ||
lockFile = ./Cargo.lock; | ||
}; | ||
|
||
dontUseCmakeConfigure = true; | ||
|
||
passthru = { | ||
devShell = self.overrideAttrs (old: { | ||
nativeBuildInputs = old.nativeBuildInputs ++ [ | ||
rust-analyzer | ||
rust-bindgen | ||
clang-tools | ||
]; | ||
}); | ||
inherit spike_interfaces; | ||
}; | ||
}; | ||
in | ||
self |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters