Skip to content

Commit

Permalink
[nix] WIP FIX
Browse files Browse the repository at this point in the history
  • Loading branch information
Avimitin committed Jul 22, 2024
1 parent 3791ef0 commit 6365bff
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions difftest/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{ lib
, libspike
, callPackage
, elaborateConfig

Expand Down Expand Up @@ -45,6 +46,8 @@ let
env = {
VERILATED_INC_DIR = "${verilated}/include";
VERILATED_LIB_DIR = "${verilated}/lib";
SPIKE_LIB_DIR = "${libspike}/lib";
SPIKE_INTERFACES_LIB_DIR = "${spike_interfaces}/lib";
DESIGN_VLEN = elaborateConfig.parameter.vLen;
DESIGN_DLEN = elaborateConfig.parameter.dLen;
};
Expand Down
13 changes: 13 additions & 0 deletions difftest/spike_rs/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
use std::env;

fn main() {
println!("cargo::rustc-link-search=native={}", env::var("SPIKE_LIB_DIR").expect("SPIKE_LIB_DIR should be set"));
println!("cargo::rustc-link-lib=static=riscv");
println!("cargo::rustc-link-lib=static=softfloat");
println!("cargo::rustc-link-lib=static=disasm");

println!("cargo::rustc-link-search=native={}", env::var("SPIKE_INTERFACES_LIB_DIR").expect("SPIKE_INTERFACES_LIB_DIR should be set"));
println!("cargo::rustc-link-lib=static=spike_interfaces");

println!("cargo::rerun-if-env-changed=VERILATED_LIB_DIR");
}

0 comments on commit 6365bff

Please sign in to comment.