Skip to content

Commit

Permalink
Add misaligned memory access for spike.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Yanzhang Wang committed Dec 8, 2023
1 parent fcc49c7 commit 72a1fc0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/wrapper/spike/riscv64-unknown-linux-gnu-run
Original file line number Diff line number Diff line change
Expand Up @@ -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} "$@"

0 comments on commit 72a1fc0

Please sign in to comment.