summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtest.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/test.sh b/test.sh
new file mode 100755
index 000000000..a50b3bc86
--- /dev/null
+++ b/test.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+GEM5="./build/X86_MESI_Two_Level/gem5.opt -q configs/example/se.py --cpu-type=DerivO3CPU --ruby --needsTSO=1 --output=stdout.txt"
+SCMS=(
+"--scheme=UnsafeBaseline"
+"--scheme=SpectreSafeInvisibleSpec --useIFT=0"
+"--scheme=SpectreSafeInvisibleSpec --useIFT=1 --trackBranch=0"
+"--scheme=SpectreSafeInvisibleSpec --useIFT=1 --trackBranch=1"
+"--scheme=SpectreSafeFence --useIFT=0"
+"--scheme=SpectreSafeFence --useIFT=1 --trackBranch=0"
+"--scheme=SpectreSafeFence --useIFT=1 --trackBranch=1"
+)
+
+echo "Testing Spectre PoC victim function"
+for scm in "${SCMS[@]}"
+do
+ echo "$scm"
+ $GEM5 $scm -c attack
+ grep hit stdout.txt && echo unsafe || echo safe
+done
+
+echo "Testing victim function v10"
+for scm in "${SCMS[@]}"
+do
+ echo "$scm"
+ $GEM5 $scm -c attack_v10
+ grep '^[123]' stdout.txt && echo unsafe || echo safe
+done