diff --git a/overlay.nix b/overlay.nix index 4911b6b..90ea611 100644 --- a/overlay.nix +++ b/overlay.nix @@ -43,8 +43,8 @@ final: prev: }; bitstreams = builtins.fetchGit { - url = "git@bscpm03.bsc.es:rarias/bitstreams.git"; - rev = "2f899627a226890c6f9820aa44e34c2ecea03faf"; + url = "git@gitlab-internal.bsc.es:rarias/bitstreams.git"; + rev = "14a41bae426e8d2a870d335492a552981941a529"; }; # Baremetal tests for standalone FPGA @@ -54,11 +54,11 @@ final: prev: url = "git@gitlab-internal.bsc.es:hwdesign/rtl/core-tile/sa-fpga.git"; rev = "720be4f1f5dd0ef963135992578be2ab55fb5537"; ref = "main"; - }; + }; dontConfigure = true; patches = [ - #./patches/sa-fpga-crt.patch - #./patches/sa-fpga-text-address.patch + ./patches/sa-fpga-crt.patch + ./patches/sa-fpga-text-address.patch ./patches/sa-fpga-uart.patch ./patches/sa-fpga-plic-registers.patch ./patches/sa-fpga-add-plic-claim-test.patch @@ -96,4 +96,15 @@ final: prev: dontFixup = true; hardeningDisable = [ "all" ]; }; + + #pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [(python-final: python-prev: { + # numpy = python-prev.numpy.overridePythonAttrs (oldAttrs: { + # disabledTests = [ + # "TestStuff::test_many_source_for_filename_calls" + # ] ++ oldAttrs.disabledTests; + # }); + # cherrypy = python-prev.cherrypy.overridePythonAttrs (oldAttrs: { + # doCheck = false; + # }); + #})]; } diff --git a/pkgs/spec-cpu/default.nix b/pkgs/spec-cpu/default.nix index 56cd2eb..3df7f30 100644 --- a/pkgs/spec-cpu/default.nix +++ b/pkgs/spec-cpu/default.nix @@ -10,7 +10,7 @@ , autoPatchelfHook , libxcrypt-legacy , lib -, benchSize ? "test" +, benchSize ? "train" }: stdenv.mkDerivation rec { diff --git a/pkgs/spec-cpu/launcher-vm.sh b/pkgs/spec-cpu/launcher-vm.sh new file mode 100644 index 0000000..58e21e8 --- /dev/null +++ b/pkgs/spec-cpu/launcher-vm.sh @@ -0,0 +1,71 @@ +#!/bin/bash + +set -e + +if [ -z "$SPEC" ]; then + SPEC=$(spec-cpu-mini) +fi + +if [ -z "$SPEC" ]; then + echo "cannot find spec, set SPEC variable" + exit 1 +fi + +where=$TMPDIR +if [ -z "$where" ]; then + if [ -d /tmp ]; then + where=/tmp + else + where=$PWD + fi +fi + +cwd=$(readlink -f $where) +# Place the outcome here +wd="$cwd/spec" +mkdir -p "$wd" + +benchniter=1 +benchsize=train +benchtune=base + +echo "--- Placing output in $wd ---" + +printf 'benchmark\tsize\ttune\titer\ttime_s\n' > "$wd/time.csv" + +for srcbench in $SPEC/benchspec/CPU/*; do + name=$(basename $srcbench) + bench="$wd/$name" + bench_out="$wd/$name.csv" + rm -rf "$bench" + cp -r "$srcbench" "$bench" + chmod +w -R "$bench" + + rundir="$bench/run/run_${benchtune}_${benchsize}_nix-m64.0000" + echo $rundir + sed -i '/^-C/d' "$rundir/speccmds.cmd" + echo "--- Running $name for $benchniter iterations ---" + ( + #set -x + #cd $rundir + ./specinvoke -i $benchniter -E speccmds.cmd > /dev/null + #set +x + ) + # Print time + awk '/^run [0-9]* elapsed time/{printf \ + "%s\t%s\t%s\t%s\t%s\n", \ + "'$name'","'$benchsize'","'$benchtune'",$2,$7}' \ + "$rundir/speccmds.out" > "$bench_out" + + cat "$bench_out" + + # Accumulate in main CSV + cat "$bench_out" >> "$wd/time.csv" + + # Erase intermediate files as they occupy RAM. + rm -rf "$bench" +done + +echo "--- RESULTS in $wd/time.csv ---" +cat "$wd/time.csv" +echo "---------------------------------------" \ No newline at end of file diff --git a/pkgs/spec-cpu/launcher.sh b/pkgs/spec-cpu/launcher.sh index c43add8..65d9b0e 100644 --- a/pkgs/spec-cpu/launcher.sh +++ b/pkgs/spec-cpu/launcher.sh @@ -26,7 +26,7 @@ wd="$cwd/spec" mkdir -p "$wd" benchniter=1 -benchsize=test +benchsize=train benchtune=base echo "--- Placing output in $wd ---" @@ -42,6 +42,7 @@ for srcbench in $SPEC/benchspec/CPU/*; do chmod +w -R "$bench" rundir="$bench/run/run_${benchtune}_${benchsize}_nix-m64.0000" + echo $rundir sed -i '/^-C/d' "$rundir/speccmds.cmd" echo "--- Running $name for $benchniter iterations ---" ( diff --git a/pkgs/spec-cpu/speclaunch-vm.nix b/pkgs/spec-cpu/speclaunch-vm.nix new file mode 100644 index 0000000..f5ba47b --- /dev/null +++ b/pkgs/spec-cpu/speclaunch-vm.nix @@ -0,0 +1,21 @@ +{ + stdenv +, bash +}: + +stdenv.mkDerivation { + name = "speclaunch-vm"; + src = ./launcher-vm.sh; + dontUnpack = true; + dontConfigure = true; + dontBuild = true; + installPhase = '' + mkdir -p $out/bin + cp $src $out/bin/speclaunch + chmod +x $out/bin/speclaunch + ''; + buildInputs = [ bash ]; + enableParallelBuilding = false; + hardeningDisable = [ "all" ]; + dontStrip = true; +}