-
Notifications
You must be signed in to change notification settings - Fork 22
Archdetect riscv update #243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
hugomeiland
wants to merge
7
commits into
EESSI:main
Choose a base branch
from
hugomeiland:archdetect-riscv
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
3685487
adding StarFive VisionFive cpu detection string
hugomeiland 2e67c0d
Match RISC-V ISA by expanded tokens; empty vendor = any
hugomeiland bc0d481
Strengthen RISC-V rva* floors and rename VisionFive to u74-mc
hugomeiland 9e84d31
Add RISC-V archdetect fixtures for u74-mc and rva* profiles
hugomeiland 2e2ee8e
Align RISC-V rva* floors with official RVA*U64 mandates
hugomeiland 66152db
Document full measured ISA for RISC-V vendor archdetect paths
hugomeiland 3d7f7e5
Add zifencei to official-aligned RISC-V rva* matching floors
hugomeiland File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,49 @@ | ||
| # RISC-V CPU architecture specifications (see https://github.com/riscv/learn?tab=readme-ov-file#open-risc-v-implementations) | ||
| # CPU vendors: SiFive (0x489), Spacemit (0x710) | ||
| # Spec lines must not use parentheses in trailing comments: update_arch_specs evals each line. | ||
| # | ||
| # Profile paths generic/rva*: empty Vendor ID means any vendor. Compact base ISA | ||
| # blobs like rv64imafdc are letter-expanded at match time in eessi_archdetect.sh. | ||
| # | ||
| # Matching floors ≈ detectable mandatory userspace ISA subset of the official | ||
| # RVA*U64 profiles — not optarch/-march assumptions. Sources: | ||
| # RVA20U64: https://docs.riscv.org/reference/rva20-rvi20-rva22/v1.0/rva20.html | ||
| # RVA22U64: https://docs.riscv.org/reference/rva20-rvi20-rva22/v1.0/rva22.html | ||
| # RVA23U64: https://docs.riscv.org/reference/rva23/v1.0/rva23-profiles.html | ||
| # Profiles repo: https://github.com/riscv/riscv-profiles | ||
| # | ||
| # Only tokens that can appear in Linux /proc/cpuinfo isa are required. Official | ||
| # mandates that are PMA / behaviour / EE contracts and are not advertised as | ||
| # cpuinfo extension tokens are omitted from floors (still mandated by the | ||
| # profile text): | ||
| # RVA20+: Ziccif, Ziccrse, Ziccamoa, Zicclsm; Za128rs (RVA20) / Za64rs (RVA22+) | ||
| # RVA22+: Zic64b | ||
| # RVA23+: Supm (pointer-masking EE contract; not a stable cpuinfo token yet) | ||
| # B in RVA23 is Zba+Zbb+Zbs; floors require those named extensions, not letter b. | ||
| # | ||
| # Floors (detectable mandatory subset): | ||
| # rva20u64: rv64imafdc zicsr zicntr zifencei | ||
| # rva22u64: + zihpm zihintpause zba zbb zbs zicbom zicbop zicboz zfhmin zkt | ||
| # rva23u64: + v zihintntl zicond zimop zcmop zcb zfa zawrs zvfhmin zvbb zvkt | ||
| # and retains zicbo* from RVA22 (still mandatory in RVA23) | ||
| # Vendor paths require the *full* measured /proc/cpuinfo isa from the matching | ||
| # archdetect fixture, not a truncated userspace subset. That includes S-mode | ||
| # tokens when the board advertises them, e.g. sscofpmf / sstc / sv*. A host | ||
| # whose kernel drops any required vendor token will miss that path and may fall | ||
| # through to generic/rva* — intentional for vendor-specific software trees. | ||
| # SpacemiT AI / custom bits such as xsmtvdot are omitted until a fixture isa | ||
| # line advertises them. x60 vs x60-k6.6 are two kernel views of the same SoC; | ||
| # neither is a clean rva22u64 host. Fixture sources: | ||
| # sifive/p550 <- tests/.../sifive/p550/premier-Ubuntu24.cpuinfo | ||
| # sifive/u74-mc <- tests/.../sifive/u74-mc/starvision-Ubuntu24.cpuinfo | ||
| # spacemit/x60 <- tests/.../spacemit/bananaf3-Armbian.cpuinfo | ||
| # spacemit/x60-k6.6 <- tests/.../spacemit/bananaf3-k6.6.cpuinfo | ||
|
|
||
| # Software path in EESSI | Vendor ID | List of defining CPU features | ||
| "riscv64/sifive/p550" "0x489" "rv64imafdch_zicsr_zifencei_zba_zbb_sscofpmf" # HiFive Premier P550 | ||
| "riscv64/spacemit/x60" "0x710" "rv64imafdcv_sscofpmf_sstc_svpbmt_zicbom_zicboz_zicbop_zihintpause" # Banana Pi F3 | ||
| "riscv64/spacemit/x60-k6.6" "0x710" "rv64imafdcv_zicbom_zicboz_zicntr_zicond_zicsr_zifencei_zihintpause_zihpm_zfh_zfhmin_zca_zcd_zba_zbb_zbc_zbs_zkt_zve32f_zve32x_zve64d_zve64f_zve64x_zvfh_zvfhmin_zvkt_sscofpmf_sstc_svinval_svnapot_svpbmt" # Banana Pi F3 k6.6 | ||
| "riscv64/generic/rva20u64" "" "rv64imafdc zicsr zicntr zifencei" | ||
| "riscv64/generic/rva22u64" "" "rv64imafdc zicsr zicntr zifencei zihpm zihintpause zba zbb zbs zicbom zicbop zicboz zfhmin zkt" | ||
| "riscv64/generic/rva23u64" "" "rv64imafdcv zicsr zicntr zifencei zihpm zihintpause zihintntl zba zbb zbs zicbom zicbop zicboz zfhmin zkt zicond zimop zcmop zcb zfa zawrs zvfhmin zvbb zvkt" | ||
| "riscv64/sifive/p550" "0x489" "rv64imafdch zicsr zifencei zba zbb sscofpmf" # full measured P550 isa | ||
| "riscv64/sifive/u74-mc" "0x489" "rv64imafdc zicntr zicsr zifencei zihpm zca zcd zba zbb" # full measured VisionFive 2 isa | ||
| "riscv64/spacemit/x60" "0x710" "rv64imafdcv sscofpmf sstc svpbmt zicbom zicboz zicbop zihintpause" # full Armbian-short isa | ||
| "riscv64/spacemit/x60-k6.6" "0x710" "rv64imafdcv zicbom zicboz zicntr zicond zicsr zifencei zihintpause zihpm zfh zfhmin zca zcd zba zbb zbc zbs zkt zve32f zve32x zve64d zve64f zve64x zvfh zvfhmin zvkt sscofpmf sstc svinval svnapot svpbmt" # full k6.6 isa |
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| riscv64/generic/rva20u64:riscv64/generic |
10 changes: 10 additions & 0 deletions
10
tests/archdetect/riscv64/generic/rva20u64/synthetic.cpuinfo
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # Synthetic RVA20U64-floor host: unknown vendor so only empty-vendor profile | ||
| # entries can match (not sifive/spacemit vendor lines). Floor is the detectable | ||
| # mandatory RVA20U64 subset: rv64imafdc zicsr zicntr. | ||
| processor : 0 | ||
| hart : 0 | ||
| isa : rv64imafdc_zicsr_zifencei_zicntr | ||
| mmu : sv39 | ||
| mvendorid : 0x123 | ||
| marchid : 0x0 | ||
| mimpid : 0x0 |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| riscv64/generic/rva20u64 |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| riscv64/generic/rva22u64:riscv64/generic/rva20u64:riscv64/generic |
10 changes: 10 additions & 0 deletions
10
tests/archdetect/riscv64/generic/rva22u64/synthetic.cpuinfo
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # Synthetic RVA22U64-floor host: unknown vendor; ISA tokens match the | ||
| # detectable mandatory RVA22U64 subset (base + zihpm/zihintpause/bitmanip/ | ||
| # zfhmin/zicbo*/zkt). | ||
| processor : 0 | ||
| hart : 0 | ||
| isa : rv64imafdc_zicsr_zifencei_zicntr_zihpm_zihintpause_zba_zbb_zbs_zicbom_zicbop_zicboz_zfhmin_zkt | ||
| mmu : sv39 | ||
| mvendorid : 0x123 | ||
| marchid : 0x0 | ||
| mimpid : 0x0 |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| riscv64/generic/rva22u64 |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| riscv64/generic/rva23u64:riscv64/generic/rva22u64:riscv64/generic/rva20u64:riscv64/generic |
11 changes: 11 additions & 0 deletions
11
tests/archdetect/riscv64/generic/rva23u64/synthetic.cpuinfo
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # Synthetic RVA23U64-floor host: unknown vendor; ISA tokens cover the | ||
| # detectable mandatory RVA23U64 subset (includes V, zicbo*, zicond, zimop/ | ||
| # zcmop, zcb, zfa, zawrs, vector crypto-adjacent zv*, etc.) so the host also | ||
| # matches the rva22 and rva20 floors. | ||
| processor : 0 | ||
| hart : 0 | ||
| isa : rv64imafdcv_zicsr_zifencei_zicntr_zihpm_zihintpause_zihintntl_zba_zbb_zbs_zicbom_zicbop_zicboz_zfhmin_zkt_zicond_zimop_zcmop_zcb_zfa_zawrs_zvfhmin_zvbb_zvkt | ||
| mmu : sv39 | ||
| mvendorid : 0x123 | ||
| marchid : 0x0 | ||
| mimpid : 0x0 |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| riscv64/generic/rva23u64 |
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions
1
tests/archdetect/riscv64/sifive/u74-mc/starvision-Ubuntu24.all.output
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| riscv64/sifive/u74-mc:riscv64/generic/rva20u64:riscv64/generic |
9 changes: 9 additions & 0 deletions
9
tests/archdetect/riscv64/sifive/u74-mc/starvision-Ubuntu24.cpuinfo
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| processor : 0 | ||
| hart : 1 | ||
| isa : rv64imafdc_zicntr_zicsr_zifencei_zihpm_zca_zcd_zba_zbb | ||
| mmu : sv39 | ||
| uarch : sifive,u74-mc | ||
| mvendorid : 0x489 | ||
| marchid : 0x8000000000000007 | ||
| mimpid : 0x4210427 | ||
| hart isa : rv64imafdc_zicntr_zicsr_zifencei_zihpm_zca_zcd_zba_zbb |
1 change: 1 addition & 0 deletions
1
tests/archdetect/riscv64/sifive/u74-mc/starvision-Ubuntu24.output
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| riscv64/sifive/u74-mc |
This file contains hidden or 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 +1 @@ | ||
| riscv64/spacemit/x60-k6.6:riscv64/generic | ||
| riscv64/spacemit/x60-k6.6:riscv64/generic/rva20u64:riscv64/generic |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While the format is open: the leading
rv64imafdchblob still matches as one token, so a superset host (sayrv64imafdcvh) fails a spec askingrv64imafdch.Splitting the blob into per-letter tokens would make the base extensions individually matchable, which I think is what the description is going for?
If the expansion happens on both sides at match time, the spec files keep the readable concatenated form, something like
so a superset host matches any subset spec without the spec files caring how the kernel concatenated the letters.
Also trailing whitespace on this line, and the comment block is tab-indented against the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed — done on this PR (tip 3d7f7e5; landed in 2e67c0d).
riscv_expand_base()expands compactrv64*blobs into per-letter tokens at match time on both host flags and the spec side (rv64imafdch→rv64 i m a f d c h;g→imafdbefore splitting). Multi-letter extensions pass through. Superset hosts now match subset specs without changing the readable concatenated form ineessi_arch_riscv.spec.Also cleaned the trailing whitespace / indentation on that block.