From 3e7dc6b942f2d621d125631be8190627606834f0 Mon Sep 17 00:00:00 2001 From: Kito Cheng Date: Mon, 11 Mar 2024 13:14:42 +0800 Subject: [PATCH] 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. --- README.mkd | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.mkd b/README.mkd index 441266f..4758683 100644 --- a/README.mkd +++ b/README.mkd @@ -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