aboutsummaryrefslogtreecommitdiff
path: root/scripts/march-to-cpu-opt
AgeCommit message (Collapse)AuthorFilesLines
2026-01-08scripts: Refactor QEMU extension handling in march-to-cpu-opt2026.01.09Kito Cheng1-26/+111
Replace QEMU_EXT_OPTS dict with QEMU_SUPPORTED_EXTS set for simpler extension handling. QEMU now uses unified naming, so we only need to track which extensions are supported rather than mapping to different option strings. Changes to march-to-cpu-opt: - Replace QEMU_EXT_OPTS dict with QEMU_SUPPORTED_EXTS set - Update print_qemu_cpu() to use "{ext}=true" format directly - Use rv64i/rv32i/rv64e/rv32e CPU models instead of rv64/rv32 The rv64/rv32 CPU models enable many extensions by default, which can conflict with explicit extension settings. The rv64i/rv32i/rv64e/rv32e models are bare bones CPUs that only enable the base I or E extension, requiring all other extensions to be explicitly enabled. This gives us full control over which extensions are active and eliminates the need for manual f/d disable logic for *inx extensions. Reference: QEMU commit deb0ff0c777d ("target/riscv: add rv32i, rv32e and rv64e CPUs") Add new script update-ext-cpu-opt to automatically sync the supported extension list from QEMU source (target/riscv/cpu.c). The script: - Parses ISA_EXT_DATA_ENTRY macros from QEMU - Parses MISA_EXT_INFO for base extensions (a, b, c, d, f, m, v) - Filters out has_priv_* extensions (no explicit switch) - Filters out s* supervisor extensions - Filters out i, e, g, s, u, h from MISA_EXT_INFO - Supports --dry-run for preview
2025-07-15march-to-cpu-opt: Add zvfh and zvfhminPaul-Antoine Arras1-0/+2
Add zvfh and zvfhmin to the list of ISA extension supported by QEMU.
2024-07-02Add filling-one for tail/mask agnostic on qemuKito Cheng1-0/+4
Default behavior of qemu is treat tail/mask agnostic as tail/mask undisturbed, and this may hidding some problem, one example is [PR115725](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115725) for GCC.
2024-07-02Qemu has deprecated extension name with capital 'Z'Kito Cheng1-4/+4
See this for detail: https://www.qemu.org/docs/master/about/deprecated.html#risc-v-cpu-properties-which-start-with-capital-z-since-8-2
2023-12-19Address the comments.2023.12.20Pan Li1-4/+8
Signed-off-by: Pan Li <pan2.li@intel.com>
2023-12-19Fix one bug of spike varch elenPan Li1-1/+11
According to the ISA, the zve32/zve64 xdf decides the elen of the RVV. Thus we should pick up extension instead of xlen for spike varch generation. Signed-off-by: Pan Li <pan2.li@intel.com>
2023-11-21Inject CPU options to spike run test from elf filePan Li1-32/+95
* 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 <pan2.li@intel.com>
2023-09-08Specify vector spec v1.0 in QEMU arguments.Patrick O'Neill1-1/+1
Some testcases in GCC's testsuite check stdout. Qemu will print a warning if the vector spec is not specified which will cause those testcases to fail. The warning: vector version is not specified, use the default value v1.0 Signed-off-by: Patrick O'Neill <patrick@rivosinc.com>
2023-04-24Add --get-elf-class for march-to-cpu-optKito Cheng1-3/+16
2023-04-24Change /usr/bin/python3 to /usr/bin/env python3Kito Cheng1-1/+1
2023-04-24Set qemu cpu option from ELF attributeKito Cheng1-1/+44
This could help multi-lib testing, but the price is slightly increase the testing time since it will need to extract ELF attribute from binary before running qemu. But I think the cost is acceptable compare to make build system more complicate, and actually we already use this approach in our internal stuffs for years.
2022-12-16Merge pull request #1168 from riscv-collab/march-to-cpu-opt-unittest2023.01.042023.01.032022.12.17Christoph Müllner1-1/+16
Add unittest to march-to-cpu-opt
2022-12-16Merge pull request #1162 from riscv-collab/fix-zhinxKito Cheng1-0/+9
Support testing zdinx/zfinx/zhinx.
2022-12-16Add unittest to march-to-cpu-optKito Cheng1-1/+16
https://github.com/riscv-collab/riscv-gnu-toolchain/pull/1167 has found some bug, and I realized the testing of march-to-cpu-opt is...not well, so spend some time to improve that a little bit, it's not complete testing, but at least it's a start :P
2022-12-16Fix wrong parse scriptKwanghoon Son1-2/+2
If test --with-arch=rv32imc_zve128x NameError: name 'arch' is not defined Signed-off-by: Kwanghoon Son <kwangson@yahoo.com>
2022-12-02Support testing zdinx/zfinx/zhinx.Kito Cheng1-0/+9
- We don't set correct qemu option for zdinx/zfinx/zhinx, this patch is fixing the march-to-cpu-opt, which is a script translate -march string to qemu options.
2022-06-03Pass right extension info to qemuKito Cheng1-0/+144
- Parse that from `--with-arch=` option