Compare commits
12 Commits
tarball-ni
...
492c540bf5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
492c540bf5 | ||
|
|
6185599b70 | ||
| c09bdbef96 | |||
| 46077e67f5 | |||
| 070b96598a | |||
|
|
eb1dc238b1 | ||
| a818bd14b6 | |||
| fbc55272ef | |||
| 7613f8dcc9 | |||
| 1b8809cd3b | |||
| 0fc7fd4f5a | |||
|
|
8da3468ee2 |
9
.gitea/workflows/ci.yaml
Normal file
9
.gitea/workflows/ci.yaml
Normal file
@@ -0,0 +1,9 @@
|
||||
name: CI
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
build:qemu-lagarto-ox:
|
||||
runs-on: native
|
||||
steps:
|
||||
- uses: https://gitea.com/ScMi1/checkout@v1.4
|
||||
- run: nix develop -L .#qemu-lagarto-ox --command ./boot.sh bench2
|
||||
@@ -1,6 +1,31 @@
|
||||
build:lagarto-ox:
|
||||
stage: build
|
||||
when: manual
|
||||
tags:
|
||||
- nix
|
||||
script:
|
||||
- nix develop -L .#lagarto-ox --command fpga/run-remotely.sh fpgalogin1:ci
|
||||
build:lagarto-ox-tarball:
|
||||
stage: build
|
||||
when: manual
|
||||
tags:
|
||||
- nix
|
||||
script:
|
||||
- nix build -L .#nixosConfigurations.lagarto-ox.pkgs.fpga-tarball
|
||||
- cd result
|
||||
- out=/ceph/home/gitlab-runner/public_html/nixos-riscv/
|
||||
- fn=$(ls | head -1)
|
||||
- cp $fn $out/$fn
|
||||
- rm -f $out/latest.tar.zst
|
||||
- ln -s $out/$fn $out/latest.tar.zst
|
||||
- cd ..
|
||||
- rm result
|
||||
- |
|
||||
echo "Pinned: https://jungle.bsc.es/~gitlab-runner/nixos-riscv/$fn"
|
||||
echo "Latest: https://jungle.bsc.es/~gitlab-runner/nixos-riscv/latest.tar.zst"
|
||||
build:qemu-lagarto-ox:
|
||||
stage: build
|
||||
tags:
|
||||
- nix
|
||||
script:
|
||||
- nix develop -L .#qemu-lagarto-ox --command ./boot.sh
|
||||
|
||||
13
NOTES.md
13
NOTES.md
@@ -26,3 +26,16 @@ To dump a ROM without the ELF header:
|
||||
$ nix build .\#nixosConfigurations.lagarto-hun.config.system.build.kernel.configfile
|
||||
$ nix build .\#nixosConfigurations.lagarto-hun.config.system.build.kernel
|
||||
```
|
||||
|
||||
## Interactive build of rvb
|
||||
|
||||
```
|
||||
hut% cd .../nixos-riscv
|
||||
hur% nix develop .#nixosConfigurations.qemu-lagarto-ox.pkgs.rvb
|
||||
hut$ mkdir /tmp/foo
|
||||
hut$ cd /tmp/foo
|
||||
hut$ genericBuild
|
||||
...
|
||||
error...
|
||||
hut$ make ...
|
||||
```
|
||||
|
||||
25
README.md
25
README.md
@@ -45,6 +45,31 @@ $ picocom -q -b 115200 $FPGACTL_UART
|
||||
|
||||
It should boot without any user interaction.
|
||||
|
||||
## Lagarto Ox on QEMU
|
||||
|
||||
To build the system and boot it on QEMU, you can run the following:
|
||||
|
||||
```
|
||||
$ nix develop -L '.#qemu-lagarto-ox'
|
||||
```
|
||||
|
||||
Then, simply run boot.sh to start the QEMU system.
|
||||
|
||||
```
|
||||
$ ./boot.sh
|
||||
```
|
||||
To execute the RISC-V benchmark suite on boot stage 2, run boot.sh with the bench2 option.
|
||||
|
||||
```
|
||||
$ ./boot.sh bench2
|
||||
```
|
||||
|
||||
To open a debug shell on boot stage 2, run boot.sh with the debug2 option.
|
||||
|
||||
```
|
||||
$ ./boot.sh debug2
|
||||
```
|
||||
|
||||
## Lagarto Hun
|
||||
|
||||
WIP
|
||||
|
||||
55
boot.sh
55
boot.sh
@@ -2,6 +2,8 @@
|
||||
|
||||
set -ex
|
||||
|
||||
QEMU_KERNEL_PARAMS="$@"
|
||||
|
||||
#export PATH=/nix/store/c5xwy0rllg4lcw61mh20glairjz7ibv4-qemu-8.0.4/bin/:$PATH
|
||||
|
||||
CDIR=$(readlink -f "$PWD")
|
||||
@@ -22,35 +24,34 @@ if [ -z "$TMPDIR" ] || [ -z "$USE_TMPDIR" ]; then
|
||||
TMPDIR=$(mktemp -d nix-vm.XXXXXXXXXX --tmpdir)
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# Create a directory for exchanging data with the VM.
|
||||
mkdir -p "$TMPDIR/xchg"
|
||||
|
||||
system="$NIXOS_SYSTEM_TOPLEVEL"
|
||||
system="$TOPLEVEL"
|
||||
echo "Booting $system"
|
||||
|
||||
cd "$TMPDIR"
|
||||
|
||||
|
||||
#QEMU_KERNEL_PARAMS="boot.debug1devices"
|
||||
#QEMU_KERNEL_PARAMS="boot.trace boot.debug1"
|
||||
#QEMU_KERNEL_PARAMS=bench2
|
||||
#QEMU_KERNEL_PARAMS=debug2
|
||||
|
||||
# Trap the CPU on compressed instructions?
|
||||
TRAP_COMPRESSED="-cpu rv64,c=false"
|
||||
#TRAP_COMPRESSED="-cpu rv64,c=false"
|
||||
|
||||
CUSTOM_BIOS="-bios $OPENSBI/share/opensbi/lp64/generic/firmware/fw_payload.bin"
|
||||
#CUSTOM_BIOS="-bios $OPENSBI/share/opensbi/lp64/generic/firmware/fw_payload.bin"
|
||||
#CUSTOM_BIOS="-bios $OPENSBI/share/opensbi/lp64/generic/firmware/fw_jump.elf"
|
||||
#CUSTOM_BIOS="-bios $CDIR/bios-nc.bin"
|
||||
#CUSTOM_BIOS="-bios $CDIR/bios.bin"
|
||||
#CUSTOM_BIOS="-bios opensbi-1.4-rv-bin/share/opensbi/lp64/generic/firmware/fw_payload.bin"
|
||||
#DEBUG_GDB="-s -S"
|
||||
DEBUG_CPU="-d cpu_reset"
|
||||
#DEBUG_CPU="-d cpu_reset"
|
||||
#DEBUG_CPU="-d in_asm,cpu,cpu_reset"
|
||||
|
||||
run_qemu () {
|
||||
|
||||
# Start QEMU.
|
||||
exec qemu-system-riscv64 \
|
||||
CMD='qemu-system-riscv64 \
|
||||
$DEBUG_GDB \
|
||||
$DEBUG_CPU \
|
||||
-name nixos-riscv \
|
||||
@@ -60,41 +61,51 @@ exec qemu-system-riscv64 \
|
||||
-machine virt \
|
||||
-device virtio-rng-pci \
|
||||
$TRAP_COMPRESSED \
|
||||
$CUSTOM_BIOS \
|
||||
-netdev user,id=net0,hostfwd=tcp::60022-:22 -device virtio-net-device,netdev=net0 \
|
||||
-netdev user,id=net0,hostfwd=tcp::60022-:22 \
|
||||
-device virtio-net-device,netdev=net0 \
|
||||
-virtfs local,path=/nix/store,security_model=none,mount_tag=nix-store \
|
||||
-virtfs local,path="${SHARED_DIR:-$TMPDIR/xchg}",security_model=none,mount_tag=shared \
|
||||
-virtfs local,path="$TMPDIR"/xchg,security_model=none,mount_tag=xchg \
|
||||
-device virtio-keyboard \
|
||||
-drive "file=$NIX_DISK_IMAGE,if=none,id=hd0" \
|
||||
-device virtio-blk-device,drive=hd0 \
|
||||
-device loader,addr=0x84000000,file=$system/kernel \
|
||||
-kernel $system/kernel \
|
||||
-initrd $system/initrd \
|
||||
-append "$(cat $system/kernel-params) init=$system/init console=ttyS0,115200n8 loglevel=7 $QEMU_KERNEL_PARAMS"
|
||||
$QEMU_OPTS \
|
||||
"$@"
|
||||
-device vhost-vsock-pci,id=vhost-vsock-pci0,guest-cid=123 \
|
||||
-serial mon:stdio \
|
||||
-append "$(cat $system/kernel-params) init=$system/init console=ttyS0 loglevel=7 $QEMU_KERNEL_PARAMS" \
|
||||
$QEMU_OPTS'
|
||||
|
||||
if [[ "$QEMU_KERNEL_PARAMS" =~ bench2 ]]; then
|
||||
eval "$CMD &"
|
||||
echo "$!" > qemu.pid
|
||||
else
|
||||
eval "$CMD"
|
||||
fi
|
||||
}
|
||||
|
||||
if [[ "$QEMU_KERNEL_PARAMS" =~ bench2 ]]; then
|
||||
run_qemu | awk -f $CDIR/verify-bench2.awk
|
||||
else
|
||||
run_qemu
|
||||
fi
|
||||
|
||||
# QEMU OPTIONS GRAVEYARD
|
||||
|
||||
# -kernel $system/kernel \
|
||||
# -initrd $system/initrd \
|
||||
# -append "$(cat $system/kernel-params) init=$system/init regInfo=/nix/store/x3zpwfbk2wkiisxhgi7zwsfwbdfxk0w1-closure-info-riscv64-unknown-linux-gnu/registration console=ttyS0,115200n8 loglevel=7 $QEMU_KERNEL_PARAMS"
|
||||
|
||||
|
||||
|
||||
|
||||
# -kernel ${NIXPKGS_QEMU_KERNEL_visionfive_nix:-/nix/store/8n5fakqq44nsmbcn0vdm3mzsvcq9ihbi-nixos-system-visionfive-nix-24.05.20240115.c3e128f/kernel} \
|
||||
# -initrd /nix/store/96058frp51dn0xxfci4kyvzz0rvd5ngy-initrd-linux-riscv64-unknown-linux-gnu-6.1.72/initrd \
|
||||
# -append "$(cat /nix/store/8n5fakqq44nsmbcn0vdm3mzsvcq9ihbi-nixos-system-visionfive-nix-24.05.20240115.c3e128f/kernel-params) init=/nix/store/8n5fakqq44nsmbcn0vdm3mzsvcq9ihbi-nixos-system-visionfive-nix-24.05.20240115.c3e128f/init regInfo=/nix/store/bgqa92gznhcr9aryx6ac4ycx4s2385cr-closure-info-riscv64-unknown-linux-gnu/registration console=ttyS0,115200n8 console=tty0 $QEMU_KERNEL_PARAMS" \
|
||||
|
||||
|
||||
# -drive "file=$NIX_DISK_IMAGE,if=virtio,id=hd0" \
|
||||
# -hda "$NIX_DISK_IMAGE" \
|
||||
#-net nic,model=virtio,macaddr=16:da:11:b4:44:c9 -net user \
|
||||
# -net nic,netdev=user.0,model=virtio -netdev user,id=user.0,"$QEMU_NET_OPTS" \
|
||||
#console=tty0
|
||||
#console=ttyS0,115200n8
|
||||
#
|
||||
# -fsdev local,id=fsdev1,path=/nix/store,security_model=none \
|
||||
|
||||
# -device virtio-9p-pci,fsdev=fsdev1,mount_tag=store,bus=pcie.1 \
|
||||
#
|
||||
# -drive cache=writeback,file="$NIX_DISK_IMAGE",id=drive1,if=none,index=1,werror=report -device virtio-blk-pci,drive=drive1 \
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
#environment.systemPackages = with pkgs; [ vim gdb neofetch gcc bintools ];
|
||||
environment.systemPackages = with pkgs; [
|
||||
rvb riscv-tools stream spec-cpu-mini
|
||||
rvb-clang riscv-tools stream spec-cpu-mini
|
||||
config.boot.kernelPackages.perf
|
||||
];
|
||||
|
||||
|
||||
51
flake.nix
51
flake.nix
@@ -18,6 +18,7 @@
|
||||
system = "${system}";
|
||||
modules = [
|
||||
./configuration.nix
|
||||
./lagarto-ox.nix
|
||||
./vm.nix
|
||||
];
|
||||
};
|
||||
@@ -54,6 +55,18 @@
|
||||
./no-compressed.nix
|
||||
];
|
||||
};
|
||||
|
||||
# QEMU configuration (x86 host) for a FPGA Lagarto Ox CPU virtual machine
|
||||
qemu-lagarto-ox = nixosSystem {
|
||||
specialArgs = { inherit self; };
|
||||
system = "${system}";
|
||||
modules = [
|
||||
./configuration.nix
|
||||
./lagarto-ox.nix
|
||||
./no-compressed.nix
|
||||
./vm.nix
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# A development shell with QEMU ready to boot the RISC-V system in an x86
|
||||
@@ -105,6 +118,7 @@
|
||||
in syspkgs.mkShell rec {
|
||||
pname = "lagarto-ox-shell";
|
||||
COMMIT = if self ? rev then self.rev else "dirty";
|
||||
REPO = self;
|
||||
TOPLEVEL = build.toplevel;
|
||||
OPENSBI = syspkgs.opensbi;
|
||||
KERNEL = build.kernel;
|
||||
@@ -116,6 +130,42 @@
|
||||
GCROOT = mkRoots syspkgs [
|
||||
syspkgs.stdenv KERNEL OPENSBI syspkgs.riscv-tools
|
||||
];
|
||||
nativeBuildInputs = with syspkgs; [ rsync ];
|
||||
shellHook = ''
|
||||
echo "Here are the current system pieces:"
|
||||
echo " COMMIT = $COMMIT"
|
||||
echo " REPO = $REPO"
|
||||
echo " TOPLEVEL = $TOPLEVEL"
|
||||
echo " KERNEL = $KERNEL"
|
||||
echo " OPENSBI = $OPENSBI"
|
||||
echo " INITRD = $INITRD"
|
||||
echo " ROOTFS = $ROOTFS"
|
||||
echo " UBOOT_ENV = $UBOOT_ENV"
|
||||
echo " BITSTREAM = $BITSTREAM"
|
||||
echo " BOOTROM = $BOOTROM"
|
||||
echo " GCROOT = $GCROOT"
|
||||
'';
|
||||
};
|
||||
|
||||
devShells.x86_64-linux.qemu-lagarto-ox =
|
||||
let
|
||||
nixosconf = self.nixosConfigurations.qemu-lagarto-ox;
|
||||
syspkgs = nixosconf.pkgs;
|
||||
build = nixosconf.config.system.build;
|
||||
in syspkgs.mkShell rec {
|
||||
pname = "lagarto-ox-shell";
|
||||
nativeBuildInputs = with syspkgs; [ qemu_full ];
|
||||
COMMIT = if self ? rev then self.rev else "dirty";
|
||||
TOPLEVEL = build.toplevel;
|
||||
OPENSBI = syspkgs.opensbi;
|
||||
KERNEL = build.kernel;
|
||||
INITRD = build.initialRamdisk;
|
||||
UBOOT_ENV = syspkgs.uboot-env;
|
||||
BITSTREAM = syspkgs.bitstream;
|
||||
BOOTROM = syspkgs.bootrom;
|
||||
GCROOT = mkRoots syspkgs [
|
||||
syspkgs.stdenv KERNEL OPENSBI syspkgs.riscv-tools
|
||||
];
|
||||
shellHook = ''
|
||||
echo "Here are the current system pieces:"
|
||||
echo " COMMIT = $COMMIT"
|
||||
@@ -123,7 +173,6 @@
|
||||
echo " KERNEL = $KERNEL"
|
||||
echo " OPENSBI = $OPENSBI"
|
||||
echo " INITRD = $INITRD"
|
||||
echo " ROOTFS = $ROOTFS"
|
||||
echo " UBOOT_ENV = $UBOOT_ENV"
|
||||
echo " BITSTREAM = $BITSTREAM"
|
||||
echo " BOOTROM = $BOOTROM"
|
||||
|
||||
142
lagarto-ox.nix
142
lagarto-ox.nix
@@ -401,7 +401,23 @@
|
||||
# };
|
||||
#}));
|
||||
|
||||
blackscholesInput = final.fetchurl {
|
||||
url = "https://gitlab.bsc.es/benchmarks/risc-v-benchmarks/-/wikis/uploads/fd1fa29bc83f24f246da304ecd8ca840/in_1024.input";
|
||||
hash = "sha256-CCS4vMzIn0NxBASyFN57gnZDWWUaqykoTJS106sFLMo=";
|
||||
};
|
||||
|
||||
bench2 = final.writeShellScript "bench2" ''
|
||||
#Tests if a benchmark exection was successful
|
||||
function bench_test {
|
||||
$@
|
||||
local status=$?
|
||||
if (( status != 0)); then
|
||||
echo "BENCHMARK-ERROR-STATE"
|
||||
fi
|
||||
return $status
|
||||
}
|
||||
|
||||
echo --------BENCHMARKING PHASE---------
|
||||
# Performs minimal FS setup and runs the SPEC benchmark
|
||||
mkdir /tmp /bin /root
|
||||
mount -t tmpfs tmpfs /tmp
|
||||
@@ -410,8 +426,45 @@
|
||||
ln -s $(which sh) /bin/sh
|
||||
# Check CPU usage
|
||||
vmstat 5 5
|
||||
bash -x speclaunch
|
||||
cat /tmp/spec/time.csv
|
||||
#bash -x speclaunch
|
||||
#cat /tmp/spec/time.csv
|
||||
# hpc_benchmarks
|
||||
set -x
|
||||
|
||||
bench_test "axpy-autovect 800 1000"
|
||||
bench_test "axpy-cblas 800 1000"
|
||||
bench_test "axpy-omp-simd 800 1000"
|
||||
bench_test "axpy-scalar 800 1000"
|
||||
|
||||
bench_test "gemm-autovect 256"
|
||||
bench_test "gemm-omp-simd 256"
|
||||
bench_test "gemm-scalar 256"
|
||||
|
||||
bench_test "somier-autovect 4 32"
|
||||
bench_test "somier-omp-simd 4 32"
|
||||
bench_test "somier-scalar 4 32"
|
||||
|
||||
bench_test "lulesh2.0 -s 4"
|
||||
|
||||
bench_test "jacobi2d_scalar_vanilla 16 2"
|
||||
|
||||
bench_test "hacckernels-scalar 10"
|
||||
|
||||
# desktop_benchmarks
|
||||
|
||||
bench_test "blackscholes_scalar 1 ${final.blackscholesInput} /dev/null"
|
||||
|
||||
bench_test "streamcluster_scalar 3 10 16 16 16 10 none output.txt 1"
|
||||
|
||||
bench_test "pathfinder_serial.exe 64 64 output_64_64.txt"
|
||||
bench_test "pathfinder_vector.exe 64 64 output_64_64.txt"
|
||||
|
||||
bench_test "swaptions_scalar -ns 2 -sm 1024 -nt 1"
|
||||
|
||||
# micro_benchmarks (NO WORKING BENCHMARKS FOR NOW...)
|
||||
|
||||
echo "BENCHMARK-SUCESS-STATE"
|
||||
|
||||
# Give me a shell at the end
|
||||
bash -l
|
||||
'';
|
||||
@@ -546,6 +599,91 @@
|
||||
EOF
|
||||
'';
|
||||
|
||||
# A tarball with all the parts to boot NixOS in a FPGA
|
||||
fpga-tarball = let
|
||||
build = config.system.build;
|
||||
in prev.stdenv.mkDerivation rec {
|
||||
name = "nixos-riscv";
|
||||
src = ./fpga;
|
||||
|
||||
COMMIT = if self ? rev then self.rev
|
||||
else throw ("Refusing to build tarball from a dirty Git tree!");
|
||||
|
||||
TOPLEVEL = build.toplevel;
|
||||
OPENSBI = final.opensbi;
|
||||
KERNEL = build.kernel;
|
||||
INITRD = build.initialRamdisk;
|
||||
ROOTFS = build.sdImage;
|
||||
UBOOT_ENV = final.uboot-env;
|
||||
BITSTREAM = final.bitstream;
|
||||
BOOTROM = final.bootrom;
|
||||
bitName = builtins.baseNameOf BITSTREAM;
|
||||
|
||||
unpackPhase = ''
|
||||
mkdir -p src/nixos-riscv
|
||||
ln -s $src fpga
|
||||
fpga/upload.sh src/nixos-riscv
|
||||
chmod +w -R src
|
||||
sourceRoot=src
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
cat > nixos-riscv/README.txt <<EOF
|
||||
-----------------------------------------
|
||||
NixOS image for Lagarto Ox in a U55C FPGA
|
||||
-----------------------------------------
|
||||
|
||||
Author: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
|
||||
|
||||
These files allow you to boot NixOS on Lagarto Ox. They correspond to
|
||||
this commit:
|
||||
|
||||
https://pm.bsc.es/gitlab/rarias/nixos-riscv/-/commit/${COMMIT}
|
||||
|
||||
Here are the pieces used by this system:
|
||||
|
||||
COMMIT = ${COMMIT}
|
||||
TOPLEVEL = ${TOPLEVEL}
|
||||
OPENSBI = ${OPENSBI}
|
||||
KERNEL = ${KERNEL}
|
||||
INITRD = ${INITRD}
|
||||
ROOTFS = ${ROOTFS}
|
||||
UBOOT_ENV = ${UBOOT_ENV}
|
||||
BITSTREAM = ${BITSTREAM}
|
||||
BOOTROM = ${BOOTROM}
|
||||
|
||||
Copy these files into a MEEP FPGA node, then allocate a FPGA node and
|
||||
run from this directory (don't forget the dot at the end):
|
||||
|
||||
$ ./run-node.sh .
|
||||
|
||||
That would flash the bitstream and NixOS and boot the whole system
|
||||
until the login, and exit after some inactivity period. You should see
|
||||
this message near the end:
|
||||
|
||||
__________________
|
||||
< Welcome to NixOS >
|
||||
------------------
|
||||
^__^
|
||||
(oo)_______
|
||||
(__) )/
|
||||
||----w |
|
||||
|| ||
|
||||
|
||||
If you can read this message then then you have
|
||||
successfully booted NixOS into the login shell.
|
||||
|
||||
EOF
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
tar --zstd -cvf $out/${COMMIT}.tar.zst nixos-riscv
|
||||
'';
|
||||
|
||||
nativeBuildInputs = with final.buildPackages; [ rsync zstd ];
|
||||
};
|
||||
|
||||
opensbi = prev.opensbi.overrideAttrs (old: rec {
|
||||
#version = "1.4";
|
||||
version = "1.5";
|
||||
|
||||
@@ -3,7 +3,7 @@ final: prev:
|
||||
# Changes to packages from nixpkgs
|
||||
|
||||
{
|
||||
clangEpi = final.callPackage ./pkgs/llvm-epi/default.nix { openmp = null; };
|
||||
clangEpi = final.callPackage ./pkgs/llvm-epi/default.nix { };
|
||||
clangEpiUnwrapped = final.callPackage ./pkgs/llvm-epi/clang.nix { };
|
||||
stdenvClangEpi = final.stdenv.override { cc = final.buildPackages.clangEpi; allowedRequisites = null; };
|
||||
|
||||
|
||||
@@ -41,6 +41,8 @@ in wrapCCWith {
|
||||
|
||||
echo "--gcc-toolchain=${gcc}" >> $out/nix-support/cc-cflags
|
||||
|
||||
# Protect against access to clang/clang++ instead of $CC/$CXX
|
||||
wrap clang $wrapper $ccPath/clang
|
||||
wrap clang++ $wrapper $ccPath/clang++
|
||||
'';
|
||||
}
|
||||
|
||||
@@ -2,61 +2,62 @@ include Makefile.in
|
||||
|
||||
HPC_BENCHMARKS_DIRS=\
|
||||
axpy \
|
||||
gemm \
|
||||
hacckernels \
|
||||
jacobi-2d \
|
||||
lulesh \
|
||||
somier \
|
||||
# Require submodules:
|
||||
# fft \
|
||||
spmv-ellpack \
|
||||
stream \
|
||||
# Require submodules
|
||||
# fftp \
|
||||
# Require vehave:
|
||||
# lulesh \
|
||||
# Missing compare_array_double:
|
||||
# gemm \
|
||||
# Broken, not found:
|
||||
# spmv
|
||||
|
||||
DESKTOP_BENCHMARKS_DIRS=\
|
||||
blackscholes \
|
||||
canneal \
|
||||
particlefilter \
|
||||
streamcluster \
|
||||
swaptions
|
||||
#pathfinder
|
||||
pathfinder \
|
||||
swaptions \
|
||||
# particlefilter \
|
||||
|
||||
MICRO_BENCHMARKS_DIRS=
|
||||
#BuffCopyUnit \
|
||||
MICRO_BENCHMARKS_DIRS=\
|
||||
#BuffCopyStrided \
|
||||
#BuffCopyIndexed \
|
||||
#BuffCopyUnit \
|
||||
#FpuMicroKernel \
|
||||
#InstrNopBalance \
|
||||
#BuffCopyIndexed \
|
||||
#MemArithBalance \
|
||||
#LatencyVrgather
|
||||
#LatencyVrgather \
|
||||
|
||||
.PHONY: default all clean $(HPC_BENCHMARKS_DIRS) $(MICRO_BENCHMARKS_DIRS)
|
||||
|
||||
all: base
|
||||
|
||||
default:
|
||||
@cd common; make; cd ..
|
||||
@$(foreach dir,$(HPC_BENCHMARKS_DIRS),${MAKE} -C hpc_benchmarks/$(dir);)
|
||||
@$(foreach dir,$(DESKTOP_BENCHMARKS_DIRS),${MAKE} -C desktop_benchmarks/$(dir);)
|
||||
@$(foreach dir,$(MICRO_BENCHMARKS_DIRS),${MAKE} -C micro_benchmarks/$(dir);)
|
||||
cd common; make; cd ..
|
||||
$(foreach dir,$(HPC_BENCHMARKS_DIRS),${MAKE} -C hpc_benchmarks/$(dir) || exit;)
|
||||
$(foreach dir,$(DESKTOP_BENCHMARKS_DIRS),${MAKE} -C desktop_benchmarks/$(dir) || exit;)
|
||||
$(foreach dir,$(MICRO_BENCHMARKS_DIRS),${MAKE} -C micro_benchmarks/$(dir) || exit;)
|
||||
|
||||
all-types:
|
||||
@cd common; make all; cd ..
|
||||
@$(foreach dir,$(HPC_BENCHMARKS_DIRS),${MAKE} -C hpc_benchmarks/$(dir) all ;)
|
||||
@$(foreach dir,$(DESKTOP_BENCHMARKS_DIRS),${MAKE} -C desktop_benchmarks/$(dir) all ;)
|
||||
@$(foreach dir,$(MICRO_BENCHMARKS_DIRS),${MAKE} -C micro_benchmarks/$(dir) all ;)
|
||||
cd common; make all; cd ..
|
||||
$(foreach dir,$(HPC_BENCHMARKS_DIRS),${MAKE} -C hpc_benchmarks/$(dir) all || exit;)
|
||||
$(foreach dir,$(DESKTOP_BENCHMARKS_DIRS),${MAKE} -C desktop_benchmarks/$(dir) all || exit;)
|
||||
$(foreach dir,$(MICRO_BENCHMARKS_DIRS),${MAKE} -C micro_benchmarks/$(dir) all || exit;)
|
||||
|
||||
base:
|
||||
@cd common; make all; cd ..
|
||||
@$(foreach dir,$(HPC_BENCHMARKS_DIRS),${MAKE} -C hpc_benchmarks/$(dir) base ;)
|
||||
@$(foreach dir,$(DESKTOP_BENCHMARKS_DIRS),${MAKE} -C desktop_benchmarks/$(dir) base ;)
|
||||
@$(foreach dir,$(MICRO_BENCHMARKS_DIRS),${MAKE} -C micro_benchmarks/$(dir) base ;)
|
||||
cd common; make all; cd ..
|
||||
$(foreach dir,$(HPC_BENCHMARKS_DIRS),${MAKE} -C hpc_benchmarks/$(dir) base || exit;)
|
||||
$(foreach dir,$(DESKTOP_BENCHMARKS_DIRS),${MAKE} -C desktop_benchmarks/$(dir) base || exit;)
|
||||
$(foreach dir,$(MICRO_BENCHMARKS_DIRS),${MAKE} -C micro_benchmarks/$(dir) base || exit;)
|
||||
|
||||
install:
|
||||
@$(foreach dir,$(HPC_BENCHMARKS_DIRS),${MAKE} -C hpc_benchmarks/$(dir) install ;)
|
||||
@$(foreach dir,$(DESKTOP_BENCHMARKS_DIRS),${MAKE} -C desktop_benchmarks/$(dir) install ;)
|
||||
@$(foreach dir,$(MICRO_BENCHMARKS_DIRS),${MAKE} -C micro_benchmarks/$(dir) install ;)
|
||||
$(foreach dir,$(HPC_BENCHMARKS_DIRS),${MAKE} -C hpc_benchmarks/$(dir) install || exit;)
|
||||
$(foreach dir,$(DESKTOP_BENCHMARKS_DIRS),${MAKE} -C desktop_benchmarks/$(dir) install || exit;)
|
||||
$(foreach dir,$(MICRO_BENCHMARKS_DIRS),${MAKE} -C micro_benchmarks/$(dir) install || exit;)
|
||||
|
||||
fftp:
|
||||
${MAKE} -C third_party fftw
|
||||
@@ -71,9 +72,9 @@ spmv-ellpack:
|
||||
INDEX64=1 EPI_EXT=07 PATH=${EPI_LLVM_HOME}/bin:${PATH} make
|
||||
|
||||
clean:
|
||||
@cd common; make clean; cd ..
|
||||
@$(foreach dir,$(HPC_BENCHMARKS_DIRS),${MAKE} -C hpc_benchmarks/$(dir) clean ;)
|
||||
@$(foreach dir,$(DESKTOP_BENCHMARKS_DIRS),${MAKE} -C desktop_benchmarks/$(dir) clean ;)
|
||||
@$(foreach dir,$(MICRO_BENCHMARKS_DIRS),${MAKE} -C micro_benchmarks/$(dir) clean ;)
|
||||
@rm -rf hpc_benchmarks/spmv-ellpack/spmv/build
|
||||
cd common; make clean; cd ..
|
||||
$(foreach dir,$(HPC_BENCHMARKS_DIRS),${MAKE} -C hpc_benchmarks/$(dir) clean ;)
|
||||
$(foreach dir,$(DESKTOP_BENCHMARKS_DIRS),${MAKE} -C desktop_benchmarks/$(dir) clean ;)
|
||||
$(foreach dir,$(MICRO_BENCHMARKS_DIRS),${MAKE} -C micro_benchmarks/$(dir) clean ;)
|
||||
rm -rf hpc_benchmarks/spmv-ellpack/spmv/build
|
||||
|
||||
|
||||
@@ -2,8 +2,11 @@
|
||||
stdenv
|
||||
, blis
|
||||
, gitBranch ? "nix-fixes"
|
||||
#, gitURL ? "git@gitlab-internal.bsc.es:dbautist/risc-v-benchmarks.git"
|
||||
#, gitCommit ? "bfa96504976dc48f6781c2cafb1e07f8d9eb7476"
|
||||
, gitURL ? "git@gitlab-internal.bsc.es:rarias/risc-v-benchmarks.git"
|
||||
, gitCommit ? "da202d6f818421b72e06c39b5417ad2f8f6ca23c"
|
||||
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
@@ -11,6 +14,7 @@ stdenv.mkDerivation rec {
|
||||
version = "${src.shortRev}";
|
||||
|
||||
src = builtins.fetchGit {
|
||||
#url = "/home/Computational/dbautist/nixos_riscv_master/nix-fixes-rvb/risc-v-benchmarks"; #change pwd to the local file
|
||||
url = gitURL;
|
||||
ref = gitBranch;
|
||||
rev = gitCommit;
|
||||
|
||||
20
verify-bench2.awk
Normal file
20
verify-bench2.awk
Normal file
@@ -0,0 +1,20 @@
|
||||
BEGIN {
|
||||
bench_success_flag = 0
|
||||
}
|
||||
|
||||
function terminate_qemu() {
|
||||
system("kill $(cat qemu.pid)");
|
||||
|
||||
if (bench_success_flag) {
|
||||
print "Benchmark execution has finished successfully. \n"
|
||||
exit 0;
|
||||
} else {
|
||||
print "Benchmark execution has been interrupted by an error. \n"
|
||||
exit 1;
|
||||
}
|
||||
}
|
||||
|
||||
/^BENCHMARK-SUCESS-STATE/ { bench_success_flag = 1; terminate_qemu()}
|
||||
/^BENCHMARK-ERROR-STATE/ { bench_success_flag = 0; terminate_qemu()}
|
||||
{print $0}
|
||||
|
||||
18
vm.nix
18
vm.nix
@@ -8,7 +8,9 @@
|
||||
];
|
||||
|
||||
# Enable ssh on boot
|
||||
services.openssh.enable = true;
|
||||
services.openssh.enable = lib.mkForce true;
|
||||
networking.dhcpcd.enable = lib.mkForce true;
|
||||
services.timesyncd.enable = lib.mkForce true;
|
||||
|
||||
boot = {
|
||||
kernelParams = [
|
||||
@@ -47,8 +49,8 @@
|
||||
INET y
|
||||
NETWORK_FILESYSTEMS y
|
||||
OVERLAY_FS y
|
||||
#"9P_FS" y
|
||||
#"9P_FS_POSIX_ACL" y
|
||||
9P_FS y
|
||||
9P_FS_POSIX_ACL y
|
||||
PCI y
|
||||
VIRTIO_PCI y
|
||||
PCI_HOST_GENERIC y
|
||||
@@ -63,16 +65,6 @@
|
||||
|
||||
nixpkgs.overlays = [
|
||||
(final: prev: {
|
||||
qemu = prev.qemu.override {
|
||||
pulseSupport = false;
|
||||
pipewireSupport = false;
|
||||
sdlSupport = false;
|
||||
jackSupport = false;
|
||||
gtkSupport = false;
|
||||
vncSupport = false;
|
||||
smartcardSupport = false;
|
||||
};
|
||||
|
||||
uboot-custom = prev.ubootQemuRiscv64Smode.override {
|
||||
# Override preboot to set 'bootcmd' directly to the kernel address in RAM
|
||||
extraConfig = ''
|
||||
|
||||
Reference in New Issue
Block a user