-
Notifications
You must be signed in to change notification settings - Fork 8.1k
riscv: use riscv,isa-extensions dt prop #97540
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
maass-hamburg
wants to merge
4
commits into
zephyrproject-rtos:main
Choose a base branch
from
maass-hamburg:use_riscv,isa-extensions
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.
+77
−6
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
ba32696
Kconfig: dt: add dt_node_array_prop_has_val
maass-hamburg 1bf2ae6
riscv: use riscv,isa-extensions dt prop
maass-hamburg d174dd7
riscv: make riscv,isa dt prop no longer required
maass-hamburg a53e068
litex: use riscv,isa-extensions dt prop
maass-hamburg 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,37 @@ | ||
# Copyright (c) 2022 Carlo Caione <[email protected]> | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
RISCV_ISA_BASE_PROP := riscv,isa-base | ||
RISCV_ISA_EXT_PROP := riscv,isa-extensions | ||
|
||
config RISCV_ISA_RV32I | ||
bool | ||
default y if $(dt_node_str_prop_equals,/cpus/cpu@0,$(RISCV_ISA_BASE_PROP),rv32i) | ||
help | ||
RV32I Base Integer Instruction Set - 32bit | ||
|
||
config RISCV_ISA_RV32E | ||
bool | ||
default y if $(dt_node_str_prop_equals,/cpus/cpu@0,$(RISCV_ISA_BASE_PROP),rv32e) | ||
help | ||
RV32E Base Integer Instruction Set (Embedded) - 32bit | ||
|
||
config RISCV_ISA_RV64I | ||
bool | ||
default y if $(dt_node_str_prop_equals,/cpus/cpu@0,$(RISCV_ISA_BASE_PROP),rv64i) | ||
default y if 64BIT | ||
help | ||
RV64I Base Integer Instruction Set - 64bit | ||
|
||
config RISCV_ISA_RV128I | ||
bool | ||
default y if $(dt_node_str_prop_equals,/cpus/cpu@0,$(RISCV_ISA_BASE_PROP),rv128i) | ||
help | ||
RV128I Base Integer Instruction Set - 128bit | ||
|
||
config RISCV_ISA_EXT_M | ||
bool | ||
default y if $(dt_node_array_prop_has_val,/cpus/cpu@0,$(RISCV_ISA_EXT_PROP),m) | ||
help | ||
(M) - Standard Extension for Integer Multiplication and Division | ||
|
||
|
@@ -33,6 +41,7 @@ config RISCV_ISA_EXT_M | |
|
||
config RISCV_ISA_EXT_A | ||
bool | ||
default y if $(dt_node_array_prop_has_val,/cpus/cpu@0,$(RISCV_ISA_EXT_PROP),a) | ||
imply RISCV_ISA_EXT_ZAAMO | ||
imply RISCV_ISA_EXT_ZALRSC | ||
help | ||
|
@@ -45,6 +54,7 @@ config RISCV_ISA_EXT_A | |
|
||
config RISCV_ISA_EXT_F | ||
bool | ||
default y if $(dt_node_array_prop_has_val,/cpus/cpu@0,$(RISCV_ISA_EXT_PROP),f) | ||
help | ||
(F) - Standard Extension for Single-Precision Floating-Point | ||
|
||
|
@@ -55,6 +65,7 @@ config RISCV_ISA_EXT_F | |
|
||
config RISCV_ISA_EXT_D | ||
bool | ||
default y if $(dt_node_array_prop_has_val,/cpus/cpu@0,$(RISCV_ISA_EXT_PROP),d) | ||
depends on RISCV_ISA_EXT_F | ||
help | ||
(D) - Standard Extension for Double-Precision Floating-Point | ||
|
@@ -66,6 +77,7 @@ config RISCV_ISA_EXT_D | |
|
||
config RISCV_ISA_EXT_G | ||
bool | ||
default y if $(dt_node_array_prop_has_val,/cpus/cpu@0,$(RISCV_ISA_EXT_PROP),g) | ||
select RISCV_ISA_EXT_M | ||
select RISCV_ISA_EXT_A | ||
select RISCV_ISA_EXT_F | ||
|
@@ -77,6 +89,7 @@ config RISCV_ISA_EXT_G | |
|
||
config RISCV_ISA_EXT_Q | ||
bool | ||
default y if $(dt_node_array_prop_has_val,/cpus/cpu@0,$(RISCV_ISA_EXT_PROP),q) | ||
depends on RISCV_ISA_RV64I | ||
depends on RISCV_ISA_EXT_F | ||
depends on RISCV_ISA_EXT_D | ||
|
@@ -89,6 +102,7 @@ config RISCV_ISA_EXT_Q | |
|
||
config RISCV_ISA_EXT_C | ||
bool | ||
default y if $(dt_node_array_prop_has_val,/cpus/cpu@0,$(RISCV_ISA_EXT_PROP),c) | ||
select RISCV_ISA_EXT_ZCA | ||
select RISCV_ISA_EXT_ZCD if RISCV_ISA_EXT_D | ||
select RISCV_ISA_EXT_ZCF if RISCV_ISA_EXT_F && (RISCV_ISA_RV32I || RISCV_ISA_RV32E) | ||
|
@@ -101,6 +115,7 @@ config RISCV_ISA_EXT_C | |
|
||
config RISCV_ISA_EXT_ZICNTR | ||
bool | ||
default y if $(dt_node_array_prop_has_val,/cpus/cpu@0,$(RISCV_ISA_EXT_PROP),zicntr) | ||
depends on RISCV_ISA_EXT_ZICSR | ||
help | ||
(Zicntr) - Standard Extension for Base Counters and Timers | ||
|
@@ -111,6 +126,7 @@ config RISCV_ISA_EXT_ZICNTR | |
|
||
config RISCV_ISA_EXT_ZICSR | ||
bool | ||
default y if $(dt_node_array_prop_has_val,/cpus/cpu@0,$(RISCV_ISA_EXT_PROP),zicsr) | ||
help | ||
(Zicsr) - Standard Extension for Control and Status Register (CSR) Instructions | ||
|
||
|
@@ -119,6 +135,7 @@ config RISCV_ISA_EXT_ZICSR | |
|
||
config RISCV_ISA_EXT_ZIFENCEI | ||
bool | ||
default y if $(dt_node_array_prop_has_val,/cpus/cpu@0,$(RISCV_ISA_EXT_PROP),zifencei) | ||
help | ||
(Zifencei) - Standard Extension for Instruction-Fetch Fence | ||
|
||
|
@@ -128,20 +145,23 @@ config RISCV_ISA_EXT_ZIFENCEI | |
|
||
config RISCV_ISA_EXT_ZAAMO | ||
bool | ||
default y if $(dt_node_array_prop_has_val,/cpus/cpu@0,$(RISCV_ISA_EXT_PROP),zaamo) | ||
help | ||
(Zaamo) - Atomic memory operation subset of the A extension | ||
|
||
The Zaamo extension enables support for AMO*.W/D-style instructions. | ||
|
||
config RISCV_ISA_EXT_ZALRSC | ||
bool | ||
default y if $(dt_node_array_prop_has_val,/cpus/cpu@0,$(RISCV_ISA_EXT_PROP),zalrsc) | ||
help | ||
(Zalrsc) - Load-Reserved/Store-Conditional subset of the A extension | ||
|
||
The Zalrsc extension enables support for LR.W/D and SC.W/D-style instructions. | ||
|
||
config RISCV_ISA_EXT_ZCA | ||
bool | ||
default y if $(dt_node_array_prop_has_val,/cpus/cpu@0,$(RISCV_ISA_EXT_PROP),zca) | ||
help | ||
(Zca) - Zba Extension for Compressed Instructions | ||
|
||
|
@@ -150,6 +170,7 @@ config RISCV_ISA_EXT_ZCA | |
|
||
config RISCV_ISA_EXT_ZCB | ||
bool | ||
default y if $(dt_node_array_prop_has_val,/cpus/cpu@0,$(RISCV_ISA_EXT_PROP),zcb) | ||
depends on RISCV_ISA_EXT_ZCA | ||
help | ||
(Zcb) - Zcb Extension for Simple Compressed Instructions | ||
|
@@ -159,6 +180,7 @@ config RISCV_ISA_EXT_ZCB | |
|
||
config RISCV_ISA_EXT_ZCD | ||
bool | ||
default y if $(dt_node_array_prop_has_val,/cpus/cpu@0,$(RISCV_ISA_EXT_PROP),zcd) | ||
depends on RISCV_ISA_EXT_D | ||
depends on RISCV_ISA_EXT_ZCA | ||
help | ||
|
@@ -169,6 +191,7 @@ config RISCV_ISA_EXT_ZCD | |
|
||
config RISCV_ISA_EXT_ZCF | ||
bool | ||
default y if $(dt_node_array_prop_has_val,/cpus/cpu@0,$(RISCV_ISA_EXT_PROP),zcf) | ||
depends on RISCV_ISA_RV32I || RISCV_ISA_RV32E | ||
depends on RISCV_ISA_EXT_F | ||
depends on RISCV_ISA_EXT_ZCA | ||
|
@@ -180,6 +203,7 @@ config RISCV_ISA_EXT_ZCF | |
|
||
config RISCV_ISA_EXT_ZCMP | ||
bool | ||
default y if $(dt_node_array_prop_has_val,/cpus/cpu@0,$(RISCV_ISA_EXT_PROP),zcmp) | ||
depends on RISCV_ISA_EXT_ZCA | ||
depends on !RISCV_ISA_EXT_ZCD | ||
help | ||
|
@@ -190,6 +214,7 @@ config RISCV_ISA_EXT_ZCMP | |
|
||
config RISCV_ISA_EXT_ZCMT | ||
bool | ||
default y if $(dt_node_array_prop_has_val,/cpus/cpu@0,$(RISCV_ISA_EXT_PROP),zcmt) | ||
depends on RISCV_ISA_EXT_ZICSR | ||
depends on RISCV_ISA_EXT_ZCA | ||
depends on !RISCV_ISA_EXT_ZCD | ||
|
@@ -201,6 +226,7 @@ config RISCV_ISA_EXT_ZCMT | |
|
||
config RISCV_ISA_EXT_ZBA | ||
bool | ||
default y if $(dt_node_array_prop_has_val,/cpus/cpu@0,$(RISCV_ISA_EXT_PROP),zba) | ||
help | ||
(Zba) - Zba BitManip Extension | ||
|
||
|
@@ -211,6 +237,7 @@ config RISCV_ISA_EXT_ZBA | |
|
||
config RISCV_ISA_EXT_ZBB | ||
bool | ||
default y if $(dt_node_array_prop_has_val,/cpus/cpu@0,$(RISCV_ISA_EXT_PROP),zbb) | ||
help | ||
(Zbb) - Zbb BitManip Extension (Basic bit-manipulation) | ||
|
||
|
@@ -220,6 +247,7 @@ config RISCV_ISA_EXT_ZBB | |
|
||
config RISCV_ISA_EXT_ZBC | ||
bool | ||
default y if $(dt_node_array_prop_has_val,/cpus/cpu@0,$(RISCV_ISA_EXT_PROP),zbc) | ||
help | ||
(Zbc) - Zbc BitManip Extension (Carry-less multiplication) | ||
|
||
|
@@ -228,6 +256,7 @@ config RISCV_ISA_EXT_ZBC | |
|
||
config RISCV_ISA_EXT_ZBS | ||
bool | ||
default y if $(dt_node_array_prop_has_val,/cpus/cpu@0,$(RISCV_ISA_EXT_PROP),zbs) | ||
help | ||
(Zbs) - Zbs BitManip Extension (Single-bit instructions) | ||
|
||
|
@@ -237,6 +266,7 @@ config RISCV_ISA_EXT_ZBS | |
|
||
config RISCV_ISA_EXT_ZMMUL | ||
bool | ||
default y if $(dt_node_array_prop_has_val,/cpus/cpu@0,$(RISCV_ISA_EXT_PROP),zmmul) | ||
help | ||
(Zmmul) - Zmmul Extension for Integer Multiplication | ||
|
||
|
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 |
---|---|---|
|
@@ -15,5 +15,12 @@ properties: | |
|
||
riscv,isa: | ||
description: RISC-V instruction set architecture | ||
required: true | ||
type: string | ||
|
||
riscv,isa-base: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Both |
||
description: The base ISA implemented by the hart. | ||
type: string | ||
|
||
riscv,isa-extensions: | ||
description: Extensions supported by the hart. | ||
type: string-array |
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
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
Oops, something went wrong.
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.
Should we remove the
riscv,isa
property then? Since it's made redundant withriscv,isa-base
andriscv,isa-extensions
?