Skip to content

Commit 56160be

Browse files
2 parents 3c504c5 + 6637604 commit 56160be

File tree

12 files changed

+127
-46
lines changed

12 files changed

+127
-46
lines changed

ctp/src/coverage.adoc

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -36,27 +36,34 @@ As compared to the base RVVI, Extended RVVI adds the following signals:
3636
|virt_adr_d|XLEN|Virtual address of data accessed by instruction
3737
|phys_adr_i|PA_BITS|Physical address of instruction
3838
|phys_adr_d|PA_BITS|Physical address of data accessed by instruction
39-
|pte_i|XLEN|Instruction page table entry
40-
|pte_d|XLEN|Data page table entry
41-
|ppn_i|PPN_BITS|Instruction physical page number
42-
|ppn_d|PPN_BITS|Data physical page number
43-
|page_type_i|2|Instruction page type ***explain
44-
|page_type_d|2|Data page type
45-
|read_access|1|Instruction reads data (loads, AMOs, ***CMO)
46-
|write_access|1|Instruction writes data (stores, AMO, ***cbo.zero)
47-
|execute_access|1|***define - is this jumps? when asserted, and does it only affect data accesses?
39+
|g_phys_adr_i|PA_BITS|Guest physical address of instruction (when Hypervisor is active, 0 when inactive)
40+
|g_phys_adr_d|PA_BITS|Guest physical address of data accessed by instruction (when Hypervisor is active, 0 when inactive)
41+
|pte_i|XLEN|Instruction page table entry (VS-stage when Hypervisor is active)
42+
|pte_d|XLEN|Data page table entry (VS-stage when Hypervisor is active)
43+
|g_pte_i|XLEN|Instruction page table entry (G-stage when Hypervisor is active, 0 when inactive)
44+
|g_pte_d|XLEN|Data page table entry (G-stage when Hypervisor is active, 0 when inactive)
45+
|page_type_i|3|Instruction page type (VS-stage when hypervisor is active))
46+
|page_type_d|3|Data page type (VS-stage when hypervisor is active))
47+
|g_page_type_i|3|Instruction page type (G-stage when hypervisor is inactive, 0 when inactive)
48+
|g_page_type_d|3|Data page type (G-stage when hypervisor is inactive, 0 when inactive)
4849
|===
4950

50-
*** PA_BITS
51-
PPN_BITS = PA_BITS - 12
52-
*** why do we need ppn when we have phys_addr? Why not derive locally?
53-
54-
*** do we need to add guest physical address? Such as
55-
56-
* gpa_adr_i
57-
* gpa_adr_d
51+
[[t-pagetypes]]
52+
.Page Types
53+
[options=header]
54+
[cols="1, 4" options=header]
55+
[%AUTOWIDTH]
56+
|===
57+
|Code|Type
58+
|000|kilopage
59+
|001|megapage
60+
|010|gigapage
61+
|011|terapage
62+
|100|petapage
63+
|other|reserved
64+
|===
5865

59-
maybe guest page table entries?
66+
Some accesses touch more than one physical page. Examples include misaligned accesses wrapping a page boundary, and some vector accesses. Extended RVVI provideds the signals corresponding to the base address of the access. For vector, they correspond to the base address of the initial element access.
6067

6168
=== riscvISACOV Signals
6269

ctp/src/ctp.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ include::intro.adoc[]
6262
include::cert.adoc[]
6363
include::profiles.adoc[]
6464
include::strategy.adoc[]
65+
include::req.adoc[]
6566
include::unpriv.adoc[]
6667
include::priv.adoc[]
6768
include::nonisa.adoc[]

ctp/src/exceptions.adoc

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,41 @@ These additional exception tests are run on configurations with floating-point (
4747
,===
4848
https://docs.google.com/spreadsheets/d/1W95I4jPbuQBnXzDdIZtOG4kae8vi7djpKtJXWCXPxMU/edit?gid=1241522932#gid=1241522932[Google Sheet Testplan]
4949
50-
==== ExceptionsV Vector Exceptions
50+
==== ExceptionsVx Vector Integer Exceptions
5151
52-
These additional exception tests are run on configurations with vector (V extension or subsets thereof that rely on mstatus.VS).
52+
These additional exception tests are run on configurations with vector (V extension or subsets thereof that rely on mstatus.VS) related to vector integer instructions.
5353
54-
[[t-ExceptionsV-coverpoints]]
55-
.ExceptionsV Coverpoints
54+
[[t-ExceptionsVx-coverpoints]]
55+
.ExceptionsVx Coverpoints
5656
,===
57-
//include::{testplansdir}/ExceptionsV.adoc[]
57+
//include::{testplansdir}/ExceptionsVx.adoc[]
5858
,===
5959
60-
*** add link
60+
https://docs.google.com/spreadsheets/d/11VGlIA__UYr7H47ZNqXtyYnGH5Fb41E8P9h53rN72ok/edit?gid=1139310135#gid=1139310135[Google Sheet Testplan]
61+
62+
[[t-ExceptionsVf-coverpoints]]
63+
.ExceptionsVf Coverpoints
64+
65+
These additional exception tests are run on configurations with vector (V extension or subsets thereof that rely on mstatus.VS) related to vector floating-point instructions.
66+
67+
68+
,===
69+
//include::{testplansdir}/ExceptionsVf.adoc[]
70+
,===
71+
72+
https://docs.google.com/spreadsheets/d/11VGlIA__UYr7H47ZNqXtyYnGH5Fb41E8P9h53rN72ok/edit?gid=1839120623#gid=1839120623[Google Sheet Testplan]
73+
74+
75+
[[t-ExceptionsVls-coverpoints]]
76+
.ExceptionsVls Coverpoints
77+
78+
These additional exception tests are run on configurations with vector (V extension or subsets thereof that rely on mstatus.VS) related to vector load/store instructions.
79+
80+
,===
81+
//include::{testplansdir}/ExceptionsVls.adoc[]
82+
,===
83+
84+
https://docs.google.com/spreadsheets/d/11VGlIA__UYr7H47ZNqXtyYnGH5Fb41E8P9h53rN72ok/edit?gid=1814229778#gid=1814229778[Google Sheet Testplan]
6185
6286
==== ExceptionsZalrsc Atomic LR/SC Exceptions
6387

ctp/src/intro.adoc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,20 @@
33

44
This Certification Test Plan describes the coverpoints and tests to certify RISC-V profiles. It summarizes the profiles intended to be supported and the test suites that need to run on each profile. It also summarizes the contents of each test suite.
55

6+
=== Certificates and Certification
7+
8+
A RISC-V _Certificate_ is a named set of requirements for a RISC-V implementation, typically defined by a ratified profile and a set of additional requirements. For example, the RVA23 Certificate requires meeting the RVA23S64 profile and having a conforming machine mode implementation.***
9+
10+
_Certification_ is the process of testing that a RISC-V implementation meets the requirements of a RISC-V certificate. The goal of certification is to deliver software interoperability across implementations.
11+
12+
There is a fuzzy line between certification and verification. Certification involves testing that an implementation meets all of the normative rules in ratified specifications relevant to the certificate, but does not involve testing that requires detailed knowledge of the microarchitecture. Specifically, certification does not check timing (such as the arrival of interrupts relative to the start, middle, or end of multicycle instructions), pipeline hazards, power management features, etc.
13+
14+
Certification assumes the ratified specification is read and interpreted with knowledge of computer architecture and reasonable judgement, because not every detail is spelled out in normative rules. For example, certification that "ADD performs the addition of _rs1_ and _rs2_" involves testing ADD with a reasonable set of values. The test plan author exercises judgement selecting these values because they are not spelled out. For example, the values might involve every combination of {0, 1, -1, maximum positive integer, maximum negative integer, intermediate value} for the two source register values. The intermediate value involves an arbitrary choice. A reasonable author might pick some other sensible edge values, such as some values one more or less than those in the set above. However, certification does not attempt to prove every bit of a carry chain works for every possible input, or that all stuck-at faults would be detected. Similarly, the test plan author may exercise all 32 registers as sources or destinations for each instruction, which is implicitly required but not spelled out in a normative rule.
15+
16+
When in doubt, it is better to test slightly more than strictly necessary for normative rules, rather than slightly less. Over-testing is acceptable, as long as it does not cause false failures or excessive test time. It is often easier to test cross-products of all relevant inputs, even if not all combinations are explicitly named by normative rules. It also reduces the risk of human error missing a required combination.
17+
18+
An implementation that passes certification tests is said to be certified for the relevant certificate. The process of certification is described in ***.
19+
620
=== Coverpoints and Tests
721

822
Coverpoints are the key to certification. They are the features of the RISC-V architecture that need to be tested in order to certify a profile. Each coverpoint has a set of tests that exercise it, and each test has a set of coverpoints that it hits.

ctp/src/profiles.adoc

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,19 @@
22

33
== Profiles & Test Suites
44

5-
This test plan addresses Phase 0, Phase 1, and Phase 2 RISC-V certification objectives, including the following ratified and unratified profiles:
5+
This test plan addresses Phase 0, Phase 1, and Phase 2 RISC-V certification objectives, including the following ratified and unratified profiles.
66

77
* https://drive.google.com/file/d/1Kg7Ner5ZlxFDclf92-9Tz88JvmZWt5Wb/view[RVI20 Profile] (Ratified): Phase 0
88
** RV{32/64}IMAFDC_Zifencei_Zicntr_Zihpm with machine mode, no PMP
9-
* Microcontroller Profile (Not Ratified, but market demand): Phase 1
10-
** RV{32/64}IMZca_Zcb_Zifencei_Zicsr_Zicntr with machine mode, user mode, interrupts, PMP16 footnote:[Tentative; may need updating based on the MRD Market Requirements Document]
9+
* MC100 Microcontroller Profile (https://github.com/riscv-software-src/riscv-unified-db/releases/tag/v0.1.0[MC100-32-CRD.pdf]): Phase 1
10+
** RV{32/64}IMZca_Zcb_Zifencei_Zicsr_Zicntr with machine mode, user mode, interrupts, PMP16 footnote:[Tentative; may need updating based on the MRD Market Requirements Document] ***update
1111
* https://drive.google.com/file/d/1Kg7Ner5ZlxFDclf92-9Tz88JvmZWt5Wb/view[RVA22S64 Profile] (Ratified): Phase 1.5, stepping stone to phase 2
1212
** Application processor without vector, hypervisor, and other newer extensions
1313
* https://github.com/riscv/riscv-profiles/blob/main/src/rvb23-profile.adoc#rvb23s64-profile[RVB23S64 Profile] (Ratified): Phase 1.8, stepping stone to phase 2
1414
** RVA23 less vector and hypervisor
15-
* https://github.com/riscv/riscv-profiles/blob/main/src/rva23-profile.adoc#rva23s64-profile[RVA23S64 Profile] (Ratified): Phase 2
15+
* RVA23 Profile (https://riscv-software-src.github.io/riscv-unified-db/pdfs/AC200-CRD.pdf[AC200 CRD]): Phase 2
16+
17+
Where a CRD is available, it lists the mandatory and optional extensions and IN/OUT-OF_SCOPE parameters.
1618

1719
=== Profile Coverage Matrix
1820

@@ -28,7 +30,7 @@ All privileged suites require at least version 1.12 of the privileged specificat
2830
[cols="1, 4, 1, 1, 1, 1, 1, 1" options=header]
2931
[%AUTOWIDTH]
3032
|===
31-
|Coverage File|Description|Test Plan|RVI20|uController|RVA22S64|RVB23S64|RVA23S64
33+
|Coverage File|Description|Test Plan|RVI20|MC100|RVA22S64|RVB23S64|RVA23S64
3234
|XLEN|||32/64|32|64|64|64
3335
8+^|Unprivileged
3436
|I|Integer|<<t-I-coverpoints>>|x|x|x|x|x
@@ -123,6 +125,7 @@ All privileged suites require at least version 1.12 of the privileged specificat
123125
|VMPMPZicbo|VM + PMP + CBOM/CBOZ|<<t-VMPMPZicbo-coverpoints>>|||x|x|x
124126
|Svade|Page Table A/D Exceptions|<<t-Svade-coverpoints>>|||x|x|x
125127
|Svadu|Page Table Update|<<t-Svadu-coverpoints>>||||o|o
128+
|SvaduPMP|Page Table Update + PMP|<<t-SvaduPMP-coverpoints>>||||o|o
126129
|Svpbmt|Page-based Memory Types|<<t-Svpbmt-coverpoints>>|||x|x|x
127130
|Svnapot|Naturally Aligned Pages|<<t-Svnapot-coverpoints>>|||o|x|x
128131
|Sscofpmf|Counter Filtering|<<t-Sscofpmf-coverpoints>>|||o|x|x
@@ -165,8 +168,11 @@ All privileged suites require at least version 1.12 of the privileged specificat
165168
|Zvknha32|Vector Hash 32-bit|<<t-Zvknh-coverpoints>>|||||
166169
|Zvknhb64|Vector Hash 64-bit|<<t-Zvknh-coverpoints>>||||o|o
167170
8+^|Vector Privileged
168-
|ExceptionsV|Vector Exceptions|<<t-ExceptionsV-coverpoints>>|||o|o|x
171+
|ExceptionsVx|Vector Integer Exceptions|<<t-ExceptionsVx-coverpoints>>|||o|o|x
172+
|ExceptionsVf|Vector Float Exceptions|<<t-ExceptionsVf-coverpoints>>|||o|o|x
173+
|ExceptionsVls|Vector Load/Store Exceptions|<<t-ExceptionsVls-coverpoints>>|||o|o|x
169174
|ZicsrV|Vector CSRs|<<t-ZicsrV-coverpoints>>|||o|o|x
175+
|ZicsrVF|Vector FP CSRs|<<t-ZicsrVF-coverpoints>>|||o|o|x
170176
|ZicsrUV|User Vector CSRs|<<t-ZicsrUV-coverpoints>>|||o|o|x
171177
|SsstrictV|Vector Strict|<<t-SsstrictV-coverpoints>>|||o|o|o
172178
8+^|Hypervisor

ctp/src/req.adoc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
== Test Suite Requirements
2+
3+
The test suites may be provided by multiple suppliers, but must meet a common set of requirements to interoperate transparently for the user.
4+
5+
The following requirements appear to be non-controversial.
6+
7+
*
8+
The following requirements need analysis
9+
10+
*** Update profile for MC100, remove U requirements

ctp/src/ssstrict.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ Test that all behaviors called out as "reserved" in the vector specification cau
4444
//include::{testplansdir}/SsstrictV.adoc[]
4545
,===
4646
47-
*** need link
47+
https://docs.google.com/spreadsheets/d/11VGlIA__UYr7H47ZNqXtyYnGH5Fb41E8P9h53rN72ok/edit?gid=743730639#gid=743730639[Google Sheet Testplan]

ctp/src/strategy.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ _rs2_.#[#norm:inst:sub:operation]#SUB performs the subtraction of _rs2_ from _rs
175175

176176
=== Coverpoints
177177

178-
Coverpoints are written with one file that covers both RV32 and RV64, to reduce the duplication and risk of becoming out of sync. When a coverage file contains coverpoints that apply only to one XLEN or the other (e.g. 32 or 64-bit edge values), they are separated by ``ifdef XLEN32` or `XLEN64` directives. Similarly, when a coverpoint applies only to a certain parameter value (PMP NA4 regions are not supported for granularity coarser than 4 bytes), they uses ``ifdef`` to exclude tests based on the parameter value.
178+
Coverpoints are written with one file that covers both RV32 and RV64, to reduce the duplication and risk of becoming out of sync. When a coverage file contains coverpoints that apply only to one XLEN or the other (e.g. 32 or 64-bit edge values), they are separated by ```ifdef XLEN32`` or ``XLEN64`` directives. Similarly, when a coverpoint applies only to a certain parameter value (PMP NA4 regions are not supported for granularity coarser than 4 bytes), they uses ```ifdef`` to exclude tests based on the parameter value.
179179

180180
=== Tests
181181

ctp/src/trickbox.adoc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Each DUT requires a trick box to perform the following non-ISA functions:
66
* Run DUT-specific boot code
77
* Deliver each supported type of interrupt to the core (Machine/Supervisor External/Timer/Software + guest external interrupts)
88
* Send a character to a terminal to log a success message or test failure information
9-
* Terminate a test
10-
* If a debug module is supported, send commands to the DM
9+
* Terminate a test with a pass or fail indication
10+
* If a debug module is supported, send abstract commands to the DM and receive responses
1111

1212
=== Trick Box Macros
1313

@@ -21,10 +21,11 @@ The trick box is implemented with DUT-specific macros in given in <<t-trickbox>>
2121
|===
2222
|Macro|Description
2323
|RVMODEL_BOOT|Perform boot operations, such as turning on a phase-locked loop or DRAM controller
24-
|RVMODEL_HALT|Terminate test. When the test is run in simulation, this should end the simulation.
24+
|RVMODEL_HALT_PASS|Terminate test with a pass indication. When the test is run in simulation, this should end the simulation.
25+
|RVMODEL_HALT_FAIL|Terminate test with a fail indication. When the test is run in simulation, this should end the simulation.
2526
|RVMODEL_IO_INIT|Initialization steps needed prior to writing to the console
26-
|RVMODEL_IO_WRITE_STR(_R, _STR)|Write a null-terminated ASCII string to the console, where _R *** and _STR ***
27-
|RVMODE_SET_MEXT_INT| Sets the Machine External Interrupt (mip.MEIP = 1, if supported)
27+
|RVMODEL_IO_WRITE_STR(_R, _STR)|Write a null-terminated ASCII string to the console, where _R is a temporary register that may be trashed by the macro and _STR is a register containing the address of the first byte of the string
28+
|RVMODEL_SET_MEXT_INT| Sets the Machine External Interrupt (mip.MEIP = 1, if supported)
2829
|RVMODEL_CLR_MEXT_INT|Clears the Machine External Interrupt (mip.MEIP = 0)
2930
|RVMODEL_SET_MTIMER_INT|Sets the Machine Timer Interrupt (mip.MTIP = 1, if supported)
3031
|RVMODEL_CLR_MTIMER_INT|Clears the Machine Timer Interrupt (mip.MTIP = 0)
@@ -34,18 +35,17 @@ The trick box is implemented with DUT-specific macros in given in <<t-trickbox>>
3435
|RVMODEL_SET_SEXT_INT|Sets the Supervisor External Interrupt (sip.SEIP = 1, if supported)
3536
|RVMODEL_CLR_SEXT_INT|Clears the Supervisor External Interrupt (sip.SEIP = 0)
3637
|RVMODEL_SET_STIMER_INT|Sets the Supervisor Timer Interrupt (sip.STIP = 1, if supported)
37-
|RVMODEL_CLR_STIMER_INT|Clears the Supervisor Timer Interrupt (sip.STIP = 0)\
38+
|RVMODEL_CLR_STIMER_INT|Clears the Supervisor Timer Interrupt (sip.STIP = 0)
3839
|RVMODEL_SET_STIMER_INT_SOON|Cause the Supervisor Timer Interrupt to rise soon, but not immediately.
3940
|RVMODEL_SET_SSW_INT|Sets the Supervisor Software Interrupt (mip.SSIP = 1, if supported)
4041
|RVMODEL_CLR_SSW_INT|Clears the Supervisor Software Interrupt (mip.SSIP = 0)
4142
|RVMODEL_WRITE_GEIP(_R)|Write the value in _R to the Guext External Interrupt Pending (hgeip) register, if supported. This is used to test guest external interrupts. Only the bottom GEILEN bits are written.
4243
|ACCESS_FAULT_ADDRESS|An address that causes an access fault when read or written. This is used to test exceptions.
4344
|===
4445

45-
*** way to send success/fail code when terminating sim
46-
*** is STIMER_INT_SOON necessary?
46+
*** give a parameter defining delay for RVMODEL_SET_MTIMER_INT_SOON
4747

48-
The macros are defined in ***. *** shows sample implementations of these macros compatible with Spike.
48+
The macros are defined in model_test.h. sail_test.h shows sample implementations of these macros compatible with Sail and Spike***.
4949

5050

5151
=== Linker Script

ctp/src/v.adoc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,7 @@ As with other unprivileged testplans, an x in the spreadsheet indicates to use t
179179
* ls_e{8/16/32/64}: load/store edges with EEW=8,...,64. Used to convert strided loads from elements to bytes.
180180
* ls: load/store edges instead of integer edges: vs2={0, random < 2*VLMAX}. rs2= {1, 2, -1, -2, 0}
181181
* f: floating-point edges instead of integer edges: ***
182-
183-
*** discuss special cases
182+
* cp_custom_*: custom coverpoint defined in the coverage file. See definitions for https://docs.google.com/spreadsheets/d/11VGlIA__UYr7H47ZNqXtyYnGH5Fb41E8P9h53rN72ok/edit?gid=389766666#gid=389766666[CustomVx], https://docs.google.com/spreadsheets/d/11VGlIA__UYr7H47ZNqXtyYnGH5Fb41E8P9h53rN72ok/edit?gid=704208158#gid=704208158[CustomVf], https://docs.google.com/spreadsheets/d/11VGlIA__UYr7H47ZNqXtyYnGH5Fb41E8P9h53rN72ok/edit?gid=704208158#gid=704208158[CustomVls].
184183

185184
The coverpoints for each vector instruction are given in the following sections.
186185

0 commit comments

Comments
 (0)