Skip to content

Commit 3e7dc6b

Browse files
kito-chengcmuellner
authored andcommitted
Add rule for vendor CSR naming scheme
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.
1 parent 3a6efe1 commit 3e7dc6b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

README.mkd

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,15 @@ Vendors should also aim to follow the conventions used for naming mnemonics
333333
in the ratified base ISA and extensions (e.g. the use of 'w', 'd',
334334
'u', and 's' suffixes).
335335

336+
### CSR naming scheme
337+
338+
Vendors may define their own CSRs within the custom read-only CSR address range
339+
specified in the RISC-V ISA spec. However, to avoid conflicts, each vendor CSR
340+
must include a prefix corresponding to the vendor's name.
341+
342+
The vendor prefix should match the prefix defined in assembly mnemonics and be
343+
separated by a dot, e.g., `th.vxrm`.
344+
336345
### List of vendor prefixes
337346

338347

0 commit comments

Comments
 (0)