Skip to content

Commit

Permalink
Add rule for vendor CSR naming scheme
Browse files Browse the repository at this point in the history
In the last LLVM sync up meeting, we have dicussed the vendor CSR
stuffs, and we realized that we have rule for vendor extenison name and assembly
mnemonic, but no rule for vendor CSR naming scheme yet.

So it's would be great we have one before anyone start to upstream their
own CSR definition.

The naming scheme basically follow the assembly mnemonic - use vendor
prefix, the only difference is use underscore rather than dot, because
it could be used in marco definition, but dot can't, that's an important
character since that allow user to use marco before assmbler support,
and eaiser to migrate to new version once assmbler support.
  • Loading branch information
kito-cheng authored and cmuellner committed Apr 12, 2024
1 parent 3a6efe1 commit 3e7dc6b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,15 @@ Vendors should also aim to follow the conventions used for naming mnemonics
in the ratified base ISA and extensions (e.g. the use of 'w', 'd',
'u', and 's' suffixes).

### CSR naming scheme

Vendors may define their own CSRs within the custom read-only CSR address range
specified in the RISC-V ISA spec. However, to avoid conflicts, each vendor CSR
must include a prefix corresponding to the vendor's name.

The vendor prefix should match the prefix defined in assembly mnemonics and be
separated by a dot, e.g., `th.vxrm`.

### List of vendor prefixes


Expand Down

0 comments on commit 3e7dc6b

Please sign in to comment.