Skip to content
Merged
Show file tree
Hide file tree
Changes from 25 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
42 changes: 42 additions & 0 deletions arch/csr/Smcsrind/mireg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# 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: |
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.

The behavior upon accessing mireg from M-mode, while miselect holds a value
that is not implemented, is UNSPECIFIED.

[Note]
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.

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.

[Note]
Ordinarily, mireg will access register state, access read-only 0 state, or raise an
illegal instruction exception.

[Note]
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:
location_rv32: 31-0
location_rv64: 63-0
type: RW
description: Register state of the CSR selected by the current `miselect` value
reset_value: UNDEFINED_LEGAL
sw_read(): |
43 changes: 43 additions & 0 deletions arch/csr/Smcsrind/mireg2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# 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: |
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`.

The behavior upon accessing `mireg2` from M-mode, while `miselect` holds a value
that is not implemented, is UNSPECIFIED.

[Note]
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.

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.

[Note]
Ordinarily, `mireg2` will access register state, access read-only 0 state, or raise an
illegal instruction exception.

[Note]
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:
location_rv32: 31-0
location_rv64: 63-0
type: RW
description: Register state of the CSR selected by the current `miselect` value
reset_value: UNDEFINED_LEGAL
sw_read(): |
43 changes: 43 additions & 0 deletions arch/csr/Smcsrind/mireg3.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# 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: |
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`.

The behavior upon accessing `mireg3` from M-mode, while `miselect` holds a value
that is not implemented, is UNSPECIFIED.

[Note]
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.

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.

[Note]
Ordinarily, `mireg3` will access register state, access read-only 0 state, or raise an
illegal instruction exception.

[Note]
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:
location_rv32: 31-0
location_rv64: 63-0
type: RW
description: Register state of the CSR selected by the current `miselect` value
reset_value: UNDEFINED_LEGAL
sw_read(): |
43 changes: 43 additions & 0 deletions arch/csr/Smcsrind/mireg4.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# 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: |
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`.

The behavior upon accessing `mireg4` from M-mode, while `miselect` holds a value
that is not implemented, is UNSPECIFIED.

[Note]
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.

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.

[Note]
Ordinarily, `mireg4` will access register state, access read-only 0 state, or raise an
illegal instruction exception.

[Note]
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:
location_rv32: 31-0
location_rv64: 63-0
type: RW
description: Register state of the CSR selected by the current `miselect` value
reset_value: UNDEFINED_LEGAL
sw_read(): |
43 changes: 43 additions & 0 deletions arch/csr/Smcsrind/mireg5.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# 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: |
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`.

The behavior upon accessing `mireg5` from M-mode, while `miselect` holds a value
that is not implemented, is UNSPECIFIED.

[Note]
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.

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.

[Note]
Ordinarily, `mireg5` will access register state, access read-only 0 state, or raise an
illegal instruction exception.

[Note]
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:
location_rv32: 31-0
location_rv64: 63-0
type: RW
description: Register state of the CSR selected by the current `miselect` value
reset_value: UNDEFINED_LEGAL
sw_read(): |
43 changes: 43 additions & 0 deletions arch/csr/Smcsrind/mireg6.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# yaml-language-server: $schema=../../../schemas/csr_schema.json
$schema: csr_schema.json#
kind: csr
name: mireg6
long_name: Machine Indirect Register Alias 6
address: 0x357
priv_mode: M
length: MXLEN
definedBy: Smcsrind
description: |
The `mireg6` machine indirect alias CSR is used to access register state indirectly
upon a read or write, as determined by the value of `miselect`.

The behavior upon accessing `mireg6` from M-mode, while `miselect` holds a value
that is not implemented, is UNSPECIFIED.

[Note]
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.

Attempts to access `mireg6` while `miselect` holds a number in an allocated and implemented
range results in a specific behavior that, for each combination of `miselect` and `mireg6`, is
defined by the extension to which the `miselect` value is allocated.

[Note]
Ordinarily, `mireg6` will access register state, access read-only 0 state, or raise an
illegal instruction exception.

[Note]
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 `mireg6`,
while the lower 32 bits are accessed through `mireg3`.

fields:
VALUE:
location_rv32: 31-0
location_rv64: 63-0
type: RW
description: Register state of the CSR selected by the current `miselect` value
reset_value: UNDEFINED_LEGAL
sw_read(): |
36 changes: 36 additions & 0 deletions arch/csr/Smcsrind/miselect.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# yaml-language-server: $schema=../../../schemas/csr_schema.json
$schema: csr_schema.json#
kind: csr
name: miselect
long_name: Machine Indirect Register Select
address: 0x350
priv_mode: M
length: MXLEN
definedBy: Smcsrind
description: |
The CSRs listed in the table above provide a window for accessing register state indirectly. The value
of `miselect` determines which register is accessed upon read or write of each of the machine
indirect alias CSRs (`mireg*`). `miselect` value ranges are allocated to dependent extensions, which
specify the register state accessible via each `miregi` register, for each `miselect` value.
`miselect` is a WARL register.

The `miselect` register implements at least enough bits to support all implemented `miselect` values
(corresponding to the implemented extensions that utilize `miselect`/`mireg*` to indirectly access
register state). The `miselect` register may be read-only zero if there are no extensions implemented
that utilize it.

Values of `miselect` with the most-significant bit set (bit XLEN - 1 = 1) are designated only for
custom use, presumably for accessing custom registers through the alias CSRs. Values of `miselect`
with the most-significant bit clear are designated only for standard use and are reserved until
allocated to a standard architecture extension. If XLEN is changed, the most-significant bit of
`miselect` moves to the new position, retaining its value from before.

An implementation is not required to support any custom values for `miselect`.
fields:
Value:
location_rv32: 31-0
location_rv64: 63-0
type: RW
description: Selects which indirect register is accessed via `mireg*`.
reset_value: UNDEFINED_LEGAL
sw_read(): |
44 changes: 44 additions & 0 deletions arch/csr/Smcsrind/sireg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# yaml-language-server: $schema=../../../schemas/csr_schema.json
$schema: csr_schema.json#
kind: csr
name: sireg
long_name: Supervisor Indirect Register Alias
address: 0x151
priv_mode: S
length: SXLEN
definedBy: Sscsrind
description: |
Access to `sireg` from M-mode or S-mode while `siselect` holds a number in a
standard-defined and implemented range results in specific behavior that, for each combination of
`siselect` and `sireg`, is defined by the extension to which the `siselect` value is allocated.

[Note]
Ordinarily, `sireg` will access register state, access read-only 0 state, or, unless
executing in a virtual machine (covered in the next section), raise an illegal instruction
exception.

Note that the widths of `siselect` and `sireg` are always the current XLEN rather than SXLEN. Hence,
for example, if MXLEN = 64 and SXLEN = 32, then this register is 64 bits when the current
privilege mode is M (running RV64 code) but 32 bits when the privilege mode is S (RV32 code).

The behavior upon accessing `sireg` from M-mode or S-mode, while `siselect` holds a value that is
not implemented at supervisor level, is UNSPECIFIED.

[Note]
It is recommended that implementations raise an illegal instruction exception for such
accesses, to facilitate possible emulation (by M-mode) of these accesses.

[Note]
An extension is considered not to be implemented at supervisor level if machine level has
disabled the extension for S-mode, such as by the settings of certain fields in CSR
`menvcfg`, for example.

fields:
VALUE:
location_rv32: 31-0
location_rv64: 63-0
type: RW
description: |
The data read from or written to the register selected by the current `siselect` value.
reset_value: UNDEFINED_LEGAL
sw_read(): |
44 changes: 44 additions & 0 deletions arch/csr/Smcsrind/sireg2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# yaml-language-server: $schema=../../../schemas/csr_schema.json
$schema: csr_schema.json#
kind: csr
name: sireg2
long_name: Supervisor Indirect Register Alias 2
address: 0x152
priv_mode: S
length: SXLEN
definedBy: Sscsrind
description: |
Access to `sireg2` from M-mode or S-mode while `siselect` holds a number in a
standard-defined and implemented range results in specific behavior that, for each combination of
`siselect` and `sireg2`, is defined by the extension to which the `siselect` value is allocated.

[Note]
Ordinarily, `sireg2` will access register state, access read-only 0 state, or, unless
executing in a virtual machine (covered in the next section), raise an illegal instruction
exception.

Note that the widths of `siselect` and `sireg2` are always the current XLEN rather than SXLEN. Hence,
for example, if MXLEN = 64 and SXLEN = 32, then this register is 64 bits when the current
privilege mode is M (running RV64 code) but 32 bits when the privilege mode is S (RV32 code).

The behavior upon accessing `sireg2` from M-mode or S-mode, while `siselect` holds a value that is
not implemented at supervisor level, is UNSPECIFIED.

[Note]
It is recommended that implementations raise an illegal instruction exception for such
accesses, to facilitate possible emulation (by M-mode) of these accesses.

[Note]
An extension is considered not to be implemented at supervisor level if machine level has
disabled the extension for S-mode, such as by the settings of certain fields in CSR
`menvcfg`, for example.

fields:
VALUE:
location_rv32: 31-0
location_rv64: 63-0
type: RW
description: |
The data read from or written to the register selected by the current `siselect` value.
reset_value: UNDEFINED_LEGAL
sw_read(): |
Loading
Loading