-
Notifications
You must be signed in to change notification settings - Fork 40
Add Smcsrind and Sscsrind CSR YAML Files #590
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
Merged
ThinkOpenly
merged 36 commits into
riscv-software-src:main
from
syedowaisalishah:add-smcsrind/sscsrind-yaml
May 5, 2025
Merged
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
630f39e
Add Smcsrind and Sscsrind extensions with YAML data
syedowaisalishah 3f936d0
Added CSR YAML files for Smcsrind
syedowaisalishah 713eed8
Rename yaml file mireg5.yaml
syedowaisalishah 42ef4bd
Add Sscsrind CSR YAML files: siselect and sireg1–6
syedowaisalishah 879e88a
Add Smcsrind CSR YAML files: vsiselect and vsisireg[1-6]
syedowaisalishah b52410f
Add Smcsrind CSR YAML files: miselect and miireg[1-6]
syedowaisalishah ae6544a
Merge branch 'main' into add-smcsrind/sscsrind-yaml
syedowaisalishah 557e2b1
Merge branch 'riscv-software-src:main' into add-smcsrind/sscsrind-yaml
syedowaisalishah 6db2f59
Fix: removed duplicate description line, updated reset_value to UNDEF…
syedowaisalishah 2558427
Corrected Smcsrind CSR YAML files for: miselect, mireg[1-6]
syedowaisalishah d735d60
Corrected Sscsrind CSR YAML files for: siselect, sireg[1-6]
syedowaisalishah f2fa9a4
Corrected Smcsrind CSR YAML files for: vsiselect, vsireg[1-6]
syedowaisalishah f3539d9
Corrected Smcsrind extesnion and Sscsrind extension yaml
syedowaisalishah ebe985d
Merge branch 'riscv-software-src:main' into add-smcsrind/sscsrind-yaml
syedowaisalishah 46ec8b2
Corrected Smcsrind extesnion and Sscsrind extension yaml and its csr …
syedowaisalishah 66307c2
Corrected Smcsrind CSR YAML files: miselect and mireg[1-6]
syedowaisalishah 090ce4a
Corrected Smcsrind CSR YAML files: siselect and sireg[1-6]
syedowaisalishah 6ecf0a6
Corrected Smcsrind CSR YAML files: vsiselect and vsireg[1-6]
syedowaisalishah b52f970
Merge branch 'riscv-software-src:main' into add-smcsrind/sscsrind-yaml
syedowaisalishah c448c46
Corrected Smcsrind CSR YAML files: mireg[2-6]
syedowaisalishah 99bd63c
Corrected Smcsrind extesnion yaml
syedowaisalishah 36cf1f1
Corrected Smcsrind extesnion yaml
syedowaisalishah b728a99
Merge branch 'add-smcsrind/sscsrind-yaml' of https://github.com/syedo…
syedowaisalishah b0997d5
Corrected Smcsrind CSR YAML files: mireg[1-6]
syedowaisalishah 8b7cc93
Corrected Smcsrind extesnion yaml
syedowaisalishah e282820
Merge branch 'riscv-software-src:main' into add-smcsrind/sscsrind-yaml
syedowaisalishah 399ce0d
docs(smcsrind): correct smcsrind CSR YAML files: mireg[1-6]
syedowaisalishah 0efc653
docs(smcsrind): correct smcsrind CSR YAML files: siselect and sireg[1-6]
syedowaisalishah 34a9a1f
docs(smcsrind): correct smcsrind CSR YAML files: vsiselect and vsireg…
syedowaisalishah 76fc8b1
docs(smcsrind): update smcsrind CSR YAML files: mireg[1-6]
syedowaisalishah 31d2cfe
docs(smcsrind): update smcsrind CSR YAML files: sireg[1-6]
syedowaisalishah 4036f19
docs(smcsrind): update smcsrind CSR YAML files: vsireg[1-6]
syedowaisalishah 05b85a5
docs(smcsrind): update smcsrind CSR YAML files: mireg[1-6]
syedowaisalishah 1a2225a
docs(smcsrind): update smcsrind CSR YAML files: sireg[1-6]
syedowaisalishah d407f0e
docs(smcsrind): update smcsrind CSR YAML files: vsireg[1-6]
syedowaisalishah 7478bfc
Merge branch 'main' into add-smcsrind/sscsrind-yaml
ThinkOpenly 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 |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# yaml-language-server: $schema=../../../schemas/csr_schema.json | ||
$schema: csr_schema.json# | ||
kind: csr | ||
name: mireg | ||
long_name: Machine Indirect Register Alias | ||
address: 0x351 | ||
priv_mode: M | ||
length: MXLEN | ||
definedBy: Smcsrind | ||
description: | ||
- id: csr-mireg-purpose | ||
normative: true | ||
text: | | ||
The mireg machine indirect alias CSR is used to access another CSR's state | ||
indirectly upon a read or write, as determined by the value of miselect. | ||
- id: csr-mireg-unimplemented-miselect | ||
normative: true | ||
text: | | ||
The behavior upon accessing mireg from M-mode, while miselect holds a value | ||
that is not implemented, is UNSPECIFIED. | ||
- id: csr-mireg-unimplemented-miselect-note | ||
normative: false | ||
text: | | ||
It is expected that implementations will typically raise an illegal instruction exception for | ||
such accesses, so that, for example, they can be identified as software bugs. Platform | ||
specs, profile specs, and/or the Privileged ISA spec may place more restrictions on | ||
behavior for such accesses. | ||
- id: csr-mireg-implemented-miselect | ||
normative: true | ||
text: | | ||
Attempts to access mireg while miselect holds a number in an allocated and implemented range | ||
results in a specific behavior that, for each combination of miselect and mireg, is defined by the | ||
extension to which the miselect value is allocated. | ||
- id: csr-mireg-implemented-miselect-note | ||
normative: false | ||
text: | | ||
Ordinarily, mireg will access register state, access read-only 0 state, or raise an | ||
illegal instruction exception. | ||
- id: csr-mireg-rv32-64bit-access | ||
normative: false | ||
text: | | ||
For RV32, if an extension defines an indirectly accessed register as 64 bits wide, it is | ||
recommended that the lower 32 bits of the register are accessed through mireg, | ||
while the upper 32 bits are accessed through mireg4. | ||
fields: | ||
VALUE: | ||
long_name: Indirectly Selected Register Value | ||
location_rv32: 31-0 | ||
location_rv64: 63-0 | ||
type: RW | ||
description: | ||
- id: csr-mireg-value-purpose | ||
normative: true | ||
text: Register state of the CSR selected by the current `miselect` value | ||
reset_value: UNDEFINED_LEGAL | ||
syedowaisalishah marked this conversation as resolved.
Show resolved
Hide resolved
|
||
sw_write(csr_value): | | ||
Csr handle = indirect_csr_lookup(CSR[miselect].VALUE, 1); | ||
if (!handle.valid) { | ||
unimplemented_csr($encoding); | ||
} | ||
if (!handle.writable) { | ||
raise (ExceptionCode::IllegalInstruction, mode(), $encoding); | ||
} | ||
csr_sw_write(handle, csr_value.VALUE); | ||
return csr_hw_read(handle); | ||
sw_read(): | | ||
syedowaisalishah marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Csr handle = indirect_csr_lookup(CSR[miselect].VALUE, 1); | ||
if (!handle.valid) { | ||
unimplemented_csr($encoding); | ||
} | ||
return csr_sw_read(handle); |
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,77 @@ | ||
# yaml-language-server: $schema=../../../schemas/csr_schema.json | ||
$schema: csr_schema.json# | ||
kind: csr | ||
name: mireg2 | ||
long_name: Machine Indirect Register Alias 2 | ||
address: 0x352 | ||
priv_mode: M | ||
length: MXLEN | ||
definedBy: Smcsrind | ||
description: | ||
- id: csr-mireg2-purpose | ||
normative: true | ||
text: | | ||
The `mireg2` machine indirect alias CSR is used to access register state indirectly | ||
upon a read or write, as determined by the value of `miselect`. | ||
|
||
- id: csr-mireg2-unimplemented-miselect | ||
normative: true | ||
text: | | ||
The behavior upon accessing `mireg2` from M-mode, while `miselect` holds a value | ||
that is not implemented, is UNSPECIFIED. | ||
|
||
- id: csr-mireg2-unimplemented-miselect-typical | ||
normative: false | ||
text: | | ||
It is expected that implementations will typically raise an illegal instruction exception for | ||
such accesses, so that, for example, they can be identified as software bugs. Platform | ||
specs, profile specs, and/or the Privileged ISA spec may place more restrictions on | ||
behavior for such accesses. | ||
|
||
- id: csr-mireg2-implemented-miselect | ||
normative: true | ||
text: | | ||
Attempts to access `mireg2` while `miselect` holds a number in an allocated and implemented | ||
range results in a specific behavior that, for each combination of `miselect` and `mireg2`, is | ||
defined by the extension to which the `miselect` value is allocated. | ||
|
||
- id: csr-mireg2-behavior-typical | ||
normative: false | ||
text: | | ||
Ordinarily, `mireg2` will access register state, access read-only 0 state, or raise an | ||
illegal instruction exception. | ||
|
||
- id: csr-mireg2-rv32-64bit-access | ||
normative: false | ||
text: | | ||
For RV32, if an extension defines an indirectly accessed register as 64 bits wide, it is | ||
recommended that the lower 32 bits of the register are accessed through `mireg2`, | ||
while the upper 32 bits are accessed through `mireg5`. | ||
|
||
fields: | ||
VALUE: | ||
long_name: Indirect Register Value | ||
location_rv32: 31-0 | ||
location_rv64: 63-0 | ||
type: RW | ||
description: | ||
- id: csr-mireg2-value-purpose | ||
normative: true | ||
text: Register state of the CSR selected by the current `miselect` value | ||
reset_value: UNDEFINED_LEGAL | ||
sw_write(csr_value): | | ||
Csr handle = indirect_csr_lookup(CSR[miselect].VALUE, 2); | ||
if (!handle.valid) { | ||
unimplemented_csr($encoding); | ||
} | ||
if (!handle.writable) { | ||
raise (ExceptionCode::IllegalInstruction, mode(), $encoding); | ||
} | ||
csr_sw_write(handle, csr_value.VALUE); | ||
return csr_hw_read(handle); | ||
sw_read(): | | ||
Csr handle = indirect_csr_lookup(CSR[miselect].VALUE, 2); | ||
if (!handle.valid) { | ||
unimplemented_csr($encoding); | ||
} | ||
return csr_sw_read(handle); |
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,77 @@ | ||
# yaml-language-server: $schema=../../../schemas/csr_schema.json | ||
$schema: csr_schema.json# | ||
kind: csr | ||
name: mireg3 | ||
long_name: Machine Indirect Register Alias 3 | ||
address: 0x353 | ||
priv_mode: M | ||
length: MXLEN | ||
definedBy: Smcsrind | ||
description: | ||
- id: csr-mireg3-purpose | ||
normative: true | ||
text: | | ||
The `mireg3` machine indirect alias CSR is used to access register state indirectly | ||
upon a read or write, as determined by the value of `miselect`. | ||
|
||
- id: csr-mireg3-unimplemented-miselect | ||
normative: true | ||
text: | | ||
The behavior upon accessing `mireg3` from M-mode, while `miselect` holds a value | ||
that is not implemented, is UNSPECIFIED. | ||
|
||
- id: csr-mireg3-unimplemented-miselect-note | ||
normative: false | ||
text: | | ||
It is expected that implementations will typically raise an illegal instruction exception for | ||
such accesses, so that, for example, they can be identified as software bugs. Platform | ||
specs, profile specs, and/or the Privileged ISA spec may place more restrictions on | ||
behavior for such accesses. | ||
|
||
- id: csr-mireg3-implemented-miselect | ||
normative: true | ||
text: | | ||
Attempts to access `mireg3` while `miselect` holds a number in an allocated and implemented | ||
range results in a specific behavior that, for each combination of `miselect` and `mireg3`, is | ||
defined by the extension to which the `miselect` value is allocated. | ||
|
||
- id: csr-mireg3-implemented-miselect-note | ||
normative: false | ||
text: | | ||
Ordinarily, `mireg3` will access register state, access read-only 0 state, or raise an | ||
illegal instruction exception. | ||
|
||
- id: csr-mireg3-rv32-64bit-access | ||
normative: false | ||
text: | | ||
For RV32, if an extension defines an indirectly accessed register as 64 bits wide, it is | ||
recommended that the lower 32 bits of the register are accessed through `mireg3`, | ||
while the upper 32 bits are accessed through `mireg6`. | ||
|
||
fields: | ||
VALUE: | ||
long_name: Indirectly Selected Register Value | ||
location_rv32: 31-0 | ||
location_rv64: 63-0 | ||
type: RW | ||
description: | ||
- id: csr-mireg3-value-purpose | ||
normative: true | ||
text: Register state of the CSR selected by the current `miselect` value | ||
reset_value: UNDEFINED_LEGAL | ||
sw_write(csr_value): | | ||
Csr handle = indirect_csr_lookup(CSR[miselect].VALUE, 3); | ||
if (!handle.valid) { | ||
unimplemented_csr($encoding); | ||
} | ||
if (!handle.writable) { | ||
raise (ExceptionCode::IllegalInstruction, mode(), $encoding); | ||
} | ||
csr_sw_write(handle, csr_value.VALUE); | ||
return csr_hw_read(handle); | ||
sw_read(): | | ||
Csr handle = indirect_csr_lookup(CSR[miselect].VALUE, 3); | ||
if (!handle.valid) { | ||
unimplemented_csr($encoding); | ||
} | ||
return csr_sw_read(handle); |
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,77 @@ | ||
# yaml-language-server: $schema=../../../schemas/csr_schema.json | ||
$schema: csr_schema.json# | ||
kind: csr | ||
name: mireg4 | ||
long_name: Machine Indirect Register Alias 4 | ||
address: 0x355 | ||
priv_mode: M | ||
length: MXLEN | ||
definedBy: Smcsrind | ||
description: | ||
- id: csr-mireg4-purpose | ||
normative: true | ||
text: | | ||
The `mireg4` machine indirect alias CSR is used to access register state indirectly | ||
upon a read or write, as determined by the value of `miselect`. | ||
|
||
- id: csr-mireg4-unimplemented-miselect | ||
normative: true | ||
text: | | ||
The behavior upon accessing `mireg4` from M-mode, while `miselect` holds a value | ||
that is not implemented, is UNSPECIFIED. | ||
|
||
- id: csr-mireg4-unimplemented-miselect-note | ||
normative: false | ||
text: | | ||
It is expected that implementations will typically raise an illegal instruction exception for | ||
such accesses, so that, for example, they can be identified as software bugs. Platform | ||
specs, profile specs, and/or the Privileged ISA spec may place more restrictions on | ||
behavior for such accesses. | ||
|
||
- id: csr-mireg4-implemented-miselect | ||
normative: true | ||
text: | | ||
Attempts to access `mireg4` while `miselect` holds a number in an allocated and implemented | ||
range results in a specific behavior that, for each combination of `miselect` and `mireg4`, is | ||
defined by the extension to which the `miselect` value is allocated. | ||
|
||
- id: csr-mireg4-implemented-miselect-note | ||
normative: false | ||
text: | | ||
Ordinarily, `mireg4` will access register state, access read-only 0 state, or raise an | ||
illegal instruction exception. | ||
|
||
- id: csr-mireg4-rv32-64bit-access | ||
normative: false | ||
text: | | ||
For RV32, if an extension defines an indirectly accessed register as 64 bits wide, it is | ||
recommended that the upper 32 bits of the register are accessed through `mireg4`, | ||
while the lower 32 bits are accessed through `mireg`, `mireg2`, or `mireg3`. | ||
|
||
fields: | ||
VALUE: | ||
long_name: Indirectly Selected Register Value | ||
location_rv32: 31-0 | ||
location_rv64: 63-0 | ||
type: RW | ||
description: | ||
- id: csr-mireg4-value-purpose | ||
normative: true | ||
text: Register state of the CSR selected by the current `miselect` value | ||
reset_value: UNDEFINED_LEGAL | ||
sw_write(csr_value): | | ||
Csr handle = indirect_csr_lookup(CSR[miselect].VALUE, 4); | ||
if (!handle.valid) { | ||
unimplemented_csr($encoding); | ||
} | ||
if (!handle.writable) { | ||
raise (ExceptionCode::IllegalInstruction, mode(), $encoding); | ||
} | ||
csr_sw_write(handle, csr_value.VALUE); | ||
return csr_hw_read(handle); | ||
sw_read(): | | ||
Csr handle = indirect_csr_lookup(CSR[miselect].VALUE, 4); | ||
if (!handle.valid) { | ||
unimplemented_csr($encoding); | ||
} | ||
return csr_sw_read(handle); |
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,77 @@ | ||
# yaml-language-server: $schema=../../../schemas/csr_schema.json | ||
$schema: csr_schema.json# | ||
kind: csr | ||
name: mireg5 | ||
long_name: Machine Indirect Register Alias 5 | ||
address: 0x356 | ||
priv_mode: M | ||
length: MXLEN | ||
definedBy: Smcsrind | ||
description: | ||
- id: csr-mireg5-purpose | ||
normative: true | ||
text: | | ||
The `mireg5` machine indirect alias CSR is used to access register state indirectly | ||
upon a read or write, as determined by the value of `miselect`. | ||
|
||
- id: csr-mireg5-unimplemented-miselect | ||
normative: true | ||
text: | | ||
The behavior upon accessing `mireg5` from M-mode, while `miselect` holds a value | ||
that is not implemented, is UNSPECIFIED. | ||
|
||
- id: csr-mireg5-unimplemented-miselect-note | ||
normative: false | ||
text: | | ||
It is expected that implementations will typically raise an illegal instruction exception for | ||
such accesses, so that, for example, they can be identified as software bugs. Platform | ||
specs, profile specs, and/or the Privileged ISA spec may place more restrictions on | ||
behavior for such accesses. | ||
|
||
- id: csr-mireg5-implemented-miselect | ||
normative: true | ||
text: | | ||
Attempts to access `mireg5` while `miselect` holds a number in an allocated and implemented | ||
range results in a specific behavior that, for each combination of `miselect` and `mireg5`, is | ||
defined by the extension to which the `miselect` value is allocated. | ||
|
||
- id: csr-mireg5-implemented-miselect-note | ||
normative: false | ||
text: | | ||
Ordinarily, `mireg5` will access register state, access read-only 0 state, or raise an | ||
illegal instruction exception. | ||
|
||
- id: csr-mireg5-rv32-64bit-access | ||
normative: false | ||
text: | | ||
For RV32, if an extension defines an indirectly accessed register as 64 bits wide, it is | ||
recommended that the upper 32 bits of the register are accessed through `mireg5`, | ||
while the lower 32 bits are accessed through `mireg2`. | ||
|
||
fields: | ||
VALUE: | ||
long_name: Indirectly Selected Register Value | ||
location_rv32: 31-0 | ||
location_rv64: 63-0 | ||
type: RW | ||
description: | ||
- id: csr-mireg5-value-purpose | ||
normative: true | ||
text: Register state of the CSR selected by the current `miselect` value | ||
reset_value: UNDEFINED_LEGAL | ||
sw_write(csr_value): | | ||
Csr handle = indirect_csr_lookup(CSR[miselect].VALUE, 5); | ||
if (!handle.valid) { | ||
unimplemented_csr($encoding); | ||
} | ||
if (!handle.writable) { | ||
raise (ExceptionCode::IllegalInstruction, mode(), $encoding); | ||
} | ||
csr_sw_write(handle, csr_value.VALUE); | ||
return csr_hw_read(handle); | ||
sw_read(): | | ||
Csr handle = indirect_csr_lookup(CSR[miselect].VALUE, 5); | ||
if (!handle.valid) { | ||
unimplemented_csr($encoding); | ||
} | ||
return csr_sw_read(handle); |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.