From 72a1fc005c08605c94061d01022b5454ea6e3062 Mon Sep 17 00:00:00 2001 From: Yanzhang Wang Date: Fri, 8 Dec 2023 10:32:59 +0800 Subject: Add misaligned memory access for spike. The spec does not forbid the misaligned memory access. And the gcc will generate vector load/store to access misaligned memory by default. Currently the QEMU supports this feature, so to support in spike is also make sense. Reference test case: gcc/gcc/testsuite/gcc.dg/vect/vect-align-1.c --- scripts/wrapper/spike/riscv64-unknown-linux-gnu-run | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/wrapper/spike/riscv64-unknown-linux-gnu-run b/scripts/wrapper/spike/riscv64-unknown-linux-gnu-run index fb569f1..29f9bf3 100755 --- a/scripts/wrapper/spike/riscv64-unknown-linux-gnu-run +++ b/scripts/wrapper/spike/riscv64-unknown-linux-gnu-run @@ -6,7 +6,8 @@ varch="$(march-to-cpu-opt --elf-file-path $1 --print-spike-varch)" isa_option="--isa=${isa}" varch_option="" +memory_option="--misaligned" [[ ! -z ${varch} ]] && varch_option="--varch=${varch}" -spike ${isa_option} ${varch_option} ${PK_PATH}/pk${xlen} "$@" +spike ${memory_option} ${isa_option} ${varch_option} ${PK_PATH}/pk${xlen} "$@" -- cgit v1.1