The ISA manuals contain a mix of normative and informative (AKA non-normative) content. We use AsciiDoctor’s anchor facility to tag normative text which is extracted by tools provided in the docs-resources GitHub repository to create machine-readable and human-readable representations of normative rules.
First, please read the How to Tag Normative Rules in RISC-V International Standards for information that applies to all RISC-V International standards. This document provides information such as:
-
What exactly is a "normative rule"?
-
How does one add normative rule tags to the AsciiDoc files using the AsciiDoc anchor facility?
-
Ins and outs and gotchas when using the AsciiDoc anchor facility.
-
How are the normative rules extracted from the AsciiDoc files?
Now that you’ve read How to Tag Normative Rules in RISC-V International Standards, here’s some information specific to tagging normative rules in the ISA manuals.
The ISA manual builds upon the anchor naming convention of a "norm:" prefix by following it with
an enum identifying the ISA manual object type, another colon,
one or more names describing the object(s) related to the tag,
another colon and finally an ID that identifies the associated behavior.
It looks like this (where <> delimit names, [] indicates optional, * means 0 or more, and
_ is used to separate multiple object names if needed):
norm:<object-type>:<object-name>[_<object-name>]*:<id>There are some cases (e.g., CSR field names) where there is a hierachy of object names and so there are additional colon-separated object-names. Here’s what it looks like with 2 hiearchy levels with a parent/child relationship:
norm:<object-type>:<parent-object-name>[_<parent-object-name>]*:<child-object-name>[_child-<object-name>]*:<id>|
Note
|
We aren’t too worried about having long tag names since they are invisible unless viewing the raw AsciiDoc source so don’t clutter the ISA manual output formats like PDFs. So, we’ve leaned in the direction of having longer names that provide information about what is being tagged. |
The justification for this naming convention is:
-
Encourages consistency and regularity in names
-
Helps ensure anchor names are unique across both ISA manuals (they are in one global namespace)
-
Provides some information about which ISA objects (e.g., instructions, extensions, CSRs) are related to the tagged text
The following table shows the supported ISA object types, the naming convention for them, and examples for each.
| Format | Description |
|---|---|
Format |
One base ISA (rv32i/rv32e/rv64i) |
Format |
List of bases |
Format |
Named group of bases (e.g., rv32, all) |
Format |
Single extension |
Format |
List of extensions |
Format |
Named group of extensions |
Format |
Table cell for instruction encoding |
Format |
Single instruction |
Format |
List of instructions |
Format |
Named group of insts (e.g., branch, load) |
Format |
Single CSR |
Format |
List of CSRs |
Format |
Named group of CSRs |
Format |
Single CSR field |
Format |
List of fields in the same CSR |
Format |
Same field in the listed CSRs |
Format |
Single parameter |
Format |
List of parameters |
Format |
Named group of parameters |