Skip to content

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
Show file tree
Hide file tree
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 Mar 29, 2025
3f936d0
Added CSR YAML files for Smcsrind
syedowaisalishah Apr 1, 2025
713eed8
Rename yaml file mireg5.yaml
syedowaisalishah Apr 3, 2025
42ef4bd
Add Sscsrind CSR YAML files: siselect and sireg1–6
syedowaisalishah Apr 3, 2025
879e88a
Add Smcsrind CSR YAML files: vsiselect and vsisireg[1-6]
syedowaisalishah Apr 3, 2025
b52410f
Add Smcsrind CSR YAML files: miselect and miireg[1-6]
syedowaisalishah Apr 3, 2025
ae6544a
Merge branch 'main' into add-smcsrind/sscsrind-yaml
syedowaisalishah Apr 3, 2025
557e2b1
Merge branch 'riscv-software-src:main' into add-smcsrind/sscsrind-yaml
syedowaisalishah Apr 4, 2025
6db2f59
Fix: removed duplicate description line, updated reset_value to UNDEF…
syedowaisalishah Apr 5, 2025
2558427
Corrected Smcsrind CSR YAML files for: miselect, mireg[1-6]
syedowaisalishah Apr 10, 2025
d735d60
Corrected Sscsrind CSR YAML files for: siselect, sireg[1-6]
syedowaisalishah Apr 10, 2025
f2fa9a4
Corrected Smcsrind CSR YAML files for: vsiselect, vsireg[1-6]
syedowaisalishah Apr 10, 2025
f3539d9
Corrected Smcsrind extesnion and Sscsrind extension yaml
syedowaisalishah Apr 10, 2025
ebe985d
Merge branch 'riscv-software-src:main' into add-smcsrind/sscsrind-yaml
syedowaisalishah Apr 20, 2025
46ec8b2
Corrected Smcsrind extesnion and Sscsrind extension yaml and its csr …
syedowaisalishah Apr 20, 2025
66307c2
Corrected Smcsrind CSR YAML files: miselect and mireg[1-6]
syedowaisalishah Apr 22, 2025
090ce4a
Corrected Smcsrind CSR YAML files: siselect and sireg[1-6]
syedowaisalishah Apr 22, 2025
6ecf0a6
Corrected Smcsrind CSR YAML files: vsiselect and vsireg[1-6]
syedowaisalishah Apr 22, 2025
b52f970
Merge branch 'riscv-software-src:main' into add-smcsrind/sscsrind-yaml
syedowaisalishah Apr 28, 2025
c448c46
Corrected Smcsrind CSR YAML files: mireg[2-6]
syedowaisalishah Apr 28, 2025
99bd63c
Corrected Smcsrind extesnion yaml
syedowaisalishah Apr 28, 2025
36cf1f1
Corrected Smcsrind extesnion yaml
syedowaisalishah Apr 28, 2025
b728a99
Merge branch 'add-smcsrind/sscsrind-yaml' of https://github.com/syedo…
syedowaisalishah Apr 28, 2025
b0997d5
Corrected Smcsrind CSR YAML files: mireg[1-6]
syedowaisalishah Apr 28, 2025
8b7cc93
Corrected Smcsrind extesnion yaml
syedowaisalishah Apr 28, 2025
e282820
Merge branch 'riscv-software-src:main' into add-smcsrind/sscsrind-yaml
syedowaisalishah May 5, 2025
399ce0d
docs(smcsrind): correct smcsrind CSR YAML files: mireg[1-6]
syedowaisalishah May 5, 2025
0efc653
docs(smcsrind): correct smcsrind CSR YAML files: siselect and sireg[1-6]
syedowaisalishah May 5, 2025
34a9a1f
docs(smcsrind): correct smcsrind CSR YAML files: vsiselect and vsireg…
syedowaisalishah May 5, 2025
76fc8b1
docs(smcsrind): update smcsrind CSR YAML files: mireg[1-6]
syedowaisalishah May 5, 2025
31d2cfe
docs(smcsrind): update smcsrind CSR YAML files: sireg[1-6]
syedowaisalishah May 5, 2025
4036f19
docs(smcsrind): update smcsrind CSR YAML files: vsireg[1-6]
syedowaisalishah May 5, 2025
05b85a5
docs(smcsrind): update smcsrind CSR YAML files: mireg[1-6]
syedowaisalishah May 5, 2025
1a2225a
docs(smcsrind): update smcsrind CSR YAML files: sireg[1-6]
syedowaisalishah May 5, 2025
d407f0e
docs(smcsrind): update smcsrind CSR YAML files: vsireg[1-6]
syedowaisalishah May 5, 2025
7478bfc
Merge branch 'main' into add-smcsrind/sscsrind-yaml
ThinkOpenly May 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions arch/csr/Smcsrind/mireg.yaml
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
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(): |
Csr handle = indirect_csr_lookup(CSR[miselect].VALUE, 1);
if (!handle.valid) {
unimplemented_csr($encoding);
}
return csr_sw_read(handle);
77 changes: 77 additions & 0 deletions arch/csr/Smcsrind/mireg2.yaml
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);
77 changes: 77 additions & 0 deletions arch/csr/Smcsrind/mireg3.yaml
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);
77 changes: 77 additions & 0 deletions arch/csr/Smcsrind/mireg4.yaml
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);
77 changes: 77 additions & 0 deletions arch/csr/Smcsrind/mireg5.yaml
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);
Loading
Loading