-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Inject CPU options to spike run test from elf file
* Refactor CPU options for exacting common part between qemu and spike. * Inject CPU options to spike run command line. The below common CPU options are extracted to common part. * xlen * vlen * extensions The above CPU options will be leveraged to build the run arguments for both the qemu and spike, for example. QEMU: qemu-riscv64 -cpu rv64,v=true,vlen=1024,elen=64,vext_spec=v1.0 SPIKE: spike --isa=rv64imafdcv_zicsr_zifencei_zmmul --varch=vlen:1024,elen:64 Signed-off-by: Pan Li <[email protected]>
- Loading branch information
1 parent
82c3d65
commit 1749dfb
Showing
3 changed files
with
106 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
#!/bin/sh | ||
#!/bin/bash | ||
|
||
xlen="$(readelf -h $1 | grep 'Class' | cut -d: -f 2 | xargs echo | sed 's/^ELF//')" | ||
arch="${ARCH_STR#*=}" | ||
spike \ | ||
--isa=${arch} \ | ||
${PK_PATH}/pk${xlen} "$@" | ||
xlen="$(march-to-cpu-opt --elf-file-path $1 --print-xlen)" | ||
isa="$(march-to-cpu-opt --elf-file-path $1 --print-spike-isa)" | ||
varch="$(march-to-cpu-opt --elf-file-path $1 --print-spike-varch)" | ||
|
||
[[ -z ${varch} ]] && spike --isa=${isa} ${PK_PATH}/pk${xlen} "$@" | ||
[[ ! -z ${varch} ]] && spike --isa=${isa} --varch=${varch} ${PK_PATH}/pk${xlen} "$@" |