test/sync/run 589 B raw
1
#!/bin/sh
2
# Execute the synchronization boundary under deterministic hart interleaving.
3
set -eu
4
emulator=${RAD_EMULATOR:-emulator}
5
work=$(mktemp -d)
6
trap 'rm -rf "$work"' EXIT HUP INT TERM
7
for harts in 1 2 8; do
8
    printf '.constant HARTS %s;\n' "$harts" > "$work/sync.ras"
9
    cat test/sync/machine.ras kernel/kernel/sync.ras >> "$work/sync.ras"
10
    "$emulator" -run bin/sync.build.rv64 -- "$work/sync.ras" "$work/sync.rv64"
11
    "$emulator" -machine -harts="$harts" -run "$work/sync.rv64"
12
done
13
printf 'synchronization: code publication, locks, atomics, and MMIO passed on 1/2/8 harts\n'