Skip to content

Commit 0e35289

Browse files
Merge pull request #241 from riscv-software-src/58-reduce-duplicate-code-between-profiles-and-crds
Created common base class called "Portfolio" that both Profiles and CRDs use.
2 parents ce98d6d + 86d4b54 commit 0e35289

File tree

23 files changed

+895
-618
lines changed

23 files changed

+895
-618
lines changed

.github/workflows/pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
- name: Copy cfg html
5959
run: cp -R gen/cfg_html_doc/generic_rv64/html _site/example_cfg
6060
- name: Create RVA Family PDF Spec
61-
run: ./do gen:profile_pdf[rva]
61+
run: ./do gen:profile[rva]
6262
- name: Copy RVA Family PDF
6363
run: cp gen/profile_doc/pdf/rva.pdf _site/pdfs/rva.pdf
6464
- name: Create MC-1 PDF Spec

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
diag-ditaa-*
1111
arch/manual/isa/**/riscv-isa-manual
1212
gen
13+
gen_expected
1314
node_modules
1415
_site
1516
images

Rakefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,8 @@ task :regress do
289289
Rake::Task["gen:html"].invoke("generic_rv64")
290290
Rake::Task["gen:crd_pdf"].invoke("MockCRD-1")
291291
Rake::Task["gen:crd_pdf"].invoke("MC-1")
292-
Rake::Task["gen:profile_pdf"].invoke("rva")
292+
Rake::Task["gen:profile"].invoke("MockProfileFamily")
293+
Rake::Task["gen:profile"].invoke("rva")
293294

294295
puts
295296
puts "Regression test PASSED"

arch/crd/MC-1.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,59 @@ MC-1:
88
# semantic version within the CRD family
99
version: "1.0"
1010

11+
revision_history:
12+
- revision: "0.7"
13+
date: 2024-07-29
14+
changes:
15+
- First version after moving non-microcontroller content in this document to a new document
16+
called “RISC-V CRDs (Certification Requirement Documents)”
17+
- Change MC-1 Unpriv ISA spec from
18+
“https://riscv.org/wp-content/uploads/2016/06/riscv-spec-v2.1.pdf[riscv-spec-v2.1], May 31,
19+
2016” to https://github.com/riscv/riscv-isa-manual/releases/tag/Ratified-IMAFDQC since the
20+
former isn't ratified by the latter is the oldest ratified version.
21+
- Added requirements for WFI instruction
22+
- Added requirements related to msip memory-mapped register
23+
- revision: "0.6"
24+
date: 2024-07-11
25+
changes:
26+
- Supporting multiple MC versions to support customers wanting to certify existing microcontrollers not using the latest version of ratified standards.
27+
- Changed versioning scheme to use major.minor.patch instead of 3-digit major & minor.
28+
- Added a table showing the mapping from MC version to ISA manuals.
29+
- Reluctantly made interrupts OUT OF SCOPE for MC-1 since only the CLINT interrupt controller
30+
was ratified at that time and isn’t anticipated to be the interrupt controller used by MC-1 implementations.
31+
- Clarified MANDATORY behaviors for mie and mip CSRs
32+
- Removed canonical discovery recipe because the OPT-* options directly inform the certification
33+
tests and certification reference model of the status of the various options. Also, canonical
34+
discovery recipes (e.g., probing for CLIC) violate the certification approach of avoiding writing
35+
potentially illegal values to CSR fields.
36+
- Added more options for interrupts
37+
- Moved non-microcontroller content in this document to a new document called “RISC-V Certification Plans”
38+
- revision: "0.5"
39+
date: 2024-06-03
40+
changes:
41+
- Renamed to “RISC-V Microcontroller Certification Plan” based on Jason’s recommendation
42+
- Added mvendorid, marchid, mimpid, and mhardid read-only priv CSRs because Allen pointed out
43+
these are mandatory in M-mode v1.13 (probably older versions too, haven’t looked yet).
44+
- Added table showing mapping of MC versions to associated RISC-V specifications
45+
- revision: "0.4"
46+
date: 2024-06-03
47+
changes:
48+
- Added M-mode instruction requirements
49+
- Made Zicntr MANDATORY due to very low cost for implementations to support (in the spirit of minimizing options).
50+
- Removed OPT-CNTR-PREC since minstret and mcycle must be a full 64 bits to be standard-compliant.
51+
- revision: "0.3"
52+
date: 2024-05-25
53+
changes:
54+
- Includes Zicntr as OPTIONAL and then has only 32-bit counters for instret and cycle.
55+
- revision: "0.2"
56+
date: 2024-05-20
57+
changes:
58+
- Very early draft
59+
- revision: "0.1"
60+
date: 2024-05-16
61+
changes:
62+
- Initial version
63+
1164
# XLEN used by rakefile
1265
base: 32
1366

arch/crd/MockCRD-1.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@ MockCRD-1:
1212
# semantic version within the CRD family
1313
version: "1.0"
1414

15+
revision_history:
16+
- revision: "0.1"
17+
date: 2024-10-04
18+
changes:
19+
- Created to test CRDs
20+
- revision: "0.2"
21+
date: 2024-10-05
22+
changes:
23+
- Also created to test CRDs
24+
1525
description: |
1626
Mock CRD description:
1727

arch/crd_family/MockCRDFamily.yaml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
MockCRDFamily:
22
name: MockCRDFamily
33
long_name: Mock CRD Family Long Name
4-
revision_history:
5-
- version: "0.1"
6-
date: 2024-10-04
7-
changes:
8-
- Created to test CRDs
9-
- version: "0.2"
10-
date: 2024-10-05
11-
changes:
12-
- Also created to test CRDs
134

145
introduction: |
156
Here's the Mock CRD Family's introduction.
@@ -18,4 +9,6 @@ MockCRDFamily:
189
Here's the Mock CRD Family's naming scheme.
1910
2011
mandatory_priv_modes:
21-
- M
12+
- M
13+
14+
description: Here's the Mock CRD Family's description.

arch/profile/MockProfile-1.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
MockProfile-1:
2+
family: MockProfileFamily
3+
description: This is the Mock Profile description.
4+
marketing_name: MockProfile-1 Marketing Name
5+
mode: S
6+
version: "1.0"
7+
contributors:
8+
- name: Krste Asanovic
9+
10+
company: SiFive
11+
extensions:
12+
- name: S
13+
presence: mandatory
14+
version: "= 1.11"
15+
- name: Zifencei
16+
presence: mandatory
17+
version: "= 2.0"
18+
note: |
19+
Zifencei is mandated as it is the only standard way to support
20+
instruction-cache coherence in RVA20 application processors. A new
21+
instruction-cache coherence mechanism is under development which might
22+
be added as an option in the future.
23+
- name: Zihpm
24+
presence: optional
25+
version: "= 2.0"
26+
- name: Sv48
27+
presence: optional
28+
version: "= 1.11"

arch/profile/rva20s64.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ rva20s64:
77
processors. RVA20S64 is based on privileged architecture version
88
1.11.
99
marketing_name: RVA20S64
10-
inherits: rva20u64
1110
mode: S
1211
version: "1.0"
1312
contributors:

arch/profile/rva20u64.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,15 @@ rva20u64:
102102
version: "= 2.0"
103103
note: |
104104
The number of counters is platform-specific.
105-
- name: Q
106-
presence: excluded
105+
extra_notes:
106+
- location: optional
107107
note: |
108108
The rationale to not make Q an optional extension is that
109109
quad-precision floating-point is unlikely to be implemented in
110110
hardware, and so we do not require or expect A-profile software to
111111
expend effort optimizing use of Q instructions in case they are
112112
present.
113-
- name: Zifencei
114-
presence: excluded
113+
- location: optional
115114
note: |
116115
Zifencei is not classed as a supported option in the user-mode
117116
profile because it is not sufficient by itself to produce the desired
@@ -123,7 +122,8 @@ rva20u64:
123122
instruction-cache coherence mechanisms can be used behind the OS
124123
abstraction. A separate extension is being developed for more general
125124
and efficient instruction cache coherence.
126-
125+
- location: optional
126+
note: |
127127
The execution environment must provide a means to synchronize writes to
128128
instruction memory with instruction fetches, the implementation of which
129129
likely relies on the Zifencei extension.

arch/profile/rva22s64.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ rva22s64:
66
supervisor-mode execution environment in 64-bit applications
77
processors. RVA22S64 is based on privileged architecture version
88
1.12.
9-
inherits: rva22u64
109
version: "2.0"
1110
mode: S
1211
marketing_name: RVA22S64

0 commit comments

Comments
 (0)