Contributors to all versions of the spec in alphabetical order

  • Allen Baum

  • Jordan Carlin

  • James Kaden Cassidy

  • David Harris

  • Georgia Tai

  • Mike Thompson

This document is released under a Creative Commons Attribution 4.0 International License.

This Certification Test Plan (CTP) is a work in progress. It describes the coverpoints and tests being developed by the RISC-V Certification Steering Committee. It is intended to be read in conjunction with the Certification Requirements Documents (CRDs) defining the features in each certificate, and the riscv-arch-test repository that contains information about how to use and contribute to the tests.

1. Introduction

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. This CTP will also include coverpoints and tests for features that are not part of a certified profile.

1.1. Certificates and Certification

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.

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.

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.

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.

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.

An implementation that passes certification tests is said to be certified for the relevant certificate. The process of certification is described in TODO CSC page.

1.2. Normative Rules, Coverpoints, and Tests

Normative rules 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. However, normative rules are human-readable portions of a specification and cannot be checked in an automated manner.

Instead, certification relies on coverpoints, which are machine-readable descriptions of the features to be tested. Every normative rule is tied to one or more coverpoints, such that if the coverpoints are hit, the normative rule is considered to be certified.

Each coverpoint has a set of tests that exercise it, and each test has a set of coverpoints that it hits.

This test plan defines the normative rules that must be hit for each profile, specifies the coverpoints that measure those rules, and outlines the tests that hit those coverpoints. The tests are self-checking, and report pass/fail results. The coverage report confirms that the tests hit all the coverpoints and thus all the normative rules.

Coverpoints are written in SystemVerilog, and are designed to be used with the Extended RISC-V Verification Interface (RVVI). They are written to be independent of the DUT (Device Under Test), so that they can be used with any RISC-V implementation. [1] Functional coverage is collected using SystemVerilog infrastructure adapted from riscvISACOV [2].

Coverpoints are organized into .svh SystemVerilog coverage files, each of which contain one or more covergroups, each of which contain one or more coverpoints. Coverage files apply to a DUT with a particular set of extensions. For example, the I_coverage.svh coverage file is used for any 32 or 64-bit DUT that supports the I extension. The ZicsrF_coverage.svh coverage file applies to a DUT that supports both the Zicsr and F extensions. Some covergroups in a coverage file apply only when another extension is also supported; for example, the half-double conversion covergroups in Zfh_coverage.svh are compiled only when D is supported.

Tests are written in assembly language .S files. Tests are organized into directories for each extension, and into a privileged directory. The coverpoints are hit by running all of the applicable tests in a directory. For example, RV32I coverage involves running add.S, addi.S, sub.S, etc. RV64I coverage also involves running addw.S, which is unique to RV64.

1.3. Glossary

The following terms are used in this test plan:

  • Extensions: named and ratified RISC-V extensions, such as RV32I, M, Zbb, Zicsr, or Svadu. Many extensions define instructions or CSRs, but some only define parameters (e.g. Sstvecd requires that STVEC_MODES includes 0).

  • Parameters: options describing the behavior of extensions. All parameters will be named by the Parameters Working Group (started February 2026) and will appear in UDB. For example, the PMP_GRANULARITY parameter defines the minimum size of a PMP region.

  • Configuration: A set of extensions and parameters partially or fully describing the behavior of a RISC-V hart. A full configuration is sufficient for a reference model to exactly match the behavior of a DUT except with regard to non-deterministic behaviors. Configurations are described in machine-readable YAML format that are read by UDB and used to generate configuration files for various tools.

  • Constrained Non-Deterministic Behaviors: behaviors that cannot be predicted based on either architectural configuration or defined parameters, but whose result are constrained to be a small number of possible values. The example of a tail-agnostic vector instruction is one of those, where the number of legal results is limited to just two: either the previous value, or all ones. Either behavior is correct, and the hart might change behaviors from one instruction to the next, so the DUT and reference model cannot be guaranteed to exactly match. Self-checking tests must accept all legal outcomes for non-deterministic behaviors.

  • Unconstrained Non-Deterministic Behaviors: behaviors that cannot be predicted based on either architectural configuration or defined parameters, and whose result is not constrained to a small number of possible values. For example, the value of an integer register after reset is an unconstrained non-deterministic behavior. Tests must not make any assumptions about the value of such behaviors, and must not check them against the reference model.

  • Profile: A named collection of required and optional extensions, such as RVI20 or RVA23S64. Profiles may be ratified by RISC-V or developed by the Certification Steering Committee to meet certification market needs, such as a simple microcontroller. A profile is a partial configuration. The test plan must allow the DUT configuration to indicate which optional extensions and other parameters are used, and fully test all optional profile extensions provided by the DUT.

  • UDB: Unified Database, a standardized way to describe the configuration and generate config files for various tools from a single point of truth.

  • Normative rule: Description of a single certifiable feature, preferably a direct quotation from a ratified specification.

  • Coverage files: a SystemVerilog .svh file containing all of the covergroups for an extension or combination of extensions, such as I_coverage.svh or ZfaD_coverage.svh.

  • Covergroup: A SystemVerilog construct that contains one or more coverpoints. Covergroups are used to collect functional coverage of a particular feature or set of features in the RISC-V architecture. For example, the I_coverage.svh file contains a covergroup for each instruction in the I extension, such as add, addi, sub, etc. The InterruptsSm_coverage.svh contains a single InterruptsSm_cg covergroup with all the coverpoints for machine-mode interrupts.

  • Coverpoint: A SystemVerilog construct describing a set of conditions to test. For example, the cp_rd coverpoint checks that all 32 destination registers x0-x31 are exercised by instructions that don’t trap. Each coverpoint has one or more bins; for example, cp_rd has 32 bins for the different registers.

  • Bin: One target value for a coverpoint. Each bin may be covered or not by a test suite.

  • Test files: A file containing one or more tests, typically written in assembly language. For example, rv32/I/add.S contains all of the RV32 tests to exercise the add_cg covergroup in I_coverage.svh.

  • Test: A snippet of code, typically a sequence of assembly language instructions, that exercises at least one bin of a coverpoint.

  • Test Suite: A collection of coverage and test files to test a particular extension, combination of extensions, or group of extensions. For example, the RV32I test suite contains the I_coverage.svh coverage file and the rv32/I/add.S, addi.S, sub.S, and other tests files with tests that hit the coverpoints in that coverage file. The RV64Zfa test suite contains the Zfa_coverage.svh coverage file and the rv64/Zfa/fround.s.S, fround.d.S, and other tests files with tests that hit the coverpoints in that coverage file. The RVA23S64 test suite contains all of the required and selected optional test suites for the profile, including RV64I, RV64Zfa, ExceptionsS, etc.

  • RVMODEL DUT-Specific Macros: A set of macros that perform semihosting/trick box functions such as booting the DUT, sending interrupts, and logging results. The macros are defined in RVMODEL DUT-Specific Macros.

Beware that Test Suite is also used outside this document to mean a full set of tests for a given profile from a given provider. For example, Synopsys, Breker, and riscv-arch-test all have test suites for the RVI20U32 profile.

2. Certification Process

Certifying a RISC-V Device-Under-Test (DUT) involves the following steps:

  • Selecting a profile for the DUT

  • Providing a Unified Database (UDB) configuration for the DUT, such as optional extensions, peripheral addresses, and PMP granularity

  • Generating self-checking tests based on the selected profile and UDB

  • Running the tests and reporting pass/fail

Test developers also need to

  • Generate a coverage report confirming that the tests hit all the coverpoints based on a trace from the RISC-V Sail model

TODO: Update to point to CSC page when ready.

3. Profiles & Test Suites

This test plan contains test suites for all of the mandatory and optional extensions in the RVA23 and earlier profiles, and for various other extensions. Some of these profiles, ratified and unratified, are listed below:

  • RVI20 Profile (Ratified)

    • RV{32/64}IMAFDC_Zifencei_Zicntr_Zihpm with no Sm machine mode, no PMP. Zicsr instructions only access counters and floating-point CSRs. Optional support for misaligned loads/stores (MISALIGNED_LDST parameter).

  • MC100 Microcontroller Profile

    • RV{32/64}IMZca_Zifencei_Zicsr_Zicntr with machine mode 1.11, counters, exceptions, interrupts, PMP16

  • RVA22S64 Profile (Ratified)

    • Application processor without vector, hypervisor, and other newer extensions

  • RVB23S64 Profile (Ratified)

    • RVA23 less vector and hypervisor

  • RVA23 Profile (RVA23 CRD)

Where a CRD is available, it lists the mandatory and optional extensions and IN/OUT-OF_SCOPE parameters.

This test plan makes some further assumptions, which should be checked against the CRDs when they become available:

  • All certificates for profiles that support interrupts require that the platform be able to set and clear via software all implemented interrupt pending bits

  • Although the RVI20 profile states that ecall causes a trap to the execution environment, it also says that Zicsr instructions are not supported independent of the Zicntr or F instructions, so there is no way to control mtvec and write a trap handler. Therefore ecall is not exercised.

  • Atomics and fences are much more interesting in a multi-core / multi-master environment. The base test plan just checks that they execute on a single core.

3.1. Profile Coverage Matrix

Table 1 summarizes the coverage files applicable to each profile. x indicates a mandatory extension, and o indicates an optional extension. The certification test plan handles all mandatory and optional extensions.

Coverage files with multiple extensions in the name apply when all the extensions are supported; for example, ZicsrF is used in a system supporting the Zicsr and F extensions.

All privileged suites require at least version 1.12 of the privileged specification. Features specific to version 1.13 are tested separately in the Sm1p13 and Ss1p13 suites.

Table 1. Profile Coverage Files
Coverage File Description Test Plan RVI20 MC100 RVA22S64 RVB23S64 RVA23S64

XLEN

32/64

32

64

64

64

Unprivileged

I

Integer

Table 18

x

x

x

x

x

M

Mult/Div

Table 21

o

x

x

x

x

Zmmul

Mult Only

Table 23

Zaamo

Atomic Memory Ops

Table 34

o

x

x

x

Zalrsc

Load Reserved / Store Cond

Table 37

o

x

x

x

Zca

Compressed

Table 25

o

x

x

x

x

Zcb

Extra Compressed

Table 32

x

x

Zcf

Compressed Float

Table 28

o

Zcd

Compressed Double

Table 30

o

x

x

x

F

Float

Table 42

o

x

x

x

D

Double

Table 44

o

x

x

x

ZicsrF

Float CSRs

Table 54

o

x

x

x

Misalign

Misaligned Load/Store

Table 89

o

o

o

o

o

Zfh

Half

Table 46

o

o

o

Zfhmin

Half Converts

Table 48

x

o

x

Zfa

Additional Float

Table 50

x

x

Zba

Address Generation

Table 56

x

x

x

Zbb

Basic Bit Manipulation

Table 58

x

x

x

Zbc

Carryless Multiplication

Table 60

o

o

o

Zbs

Single-Bit

Table 62

x

x

x

Zbkb

Bit Manip for Crypto

Table 64

o

Zbkc

Carryless Multiply for Crypto

Table 66

o

Zbkx

Permutations

Table 68

o

Zknd

AES Decryption

Table 72

o

Zkne

AES Encryption

Table 70

o

Zknh

SHA2 Hashing

Table 74

o

Zksed

SM4 Cipher

Table 76

o

Zksh

SM3 Hashing

Table 78

o

Zicsr

CSR Instructions

Table 84

x

x

x

x

Zicond

Conditional Move

Table 94

x

x

Zifencei

Instruction Fence

Table 86

o

x

x

x

x

Zicclsm

Misaligned Loads / Stores

Table 93

o

o

x

x

x

Zihintpause

Pause Hint

Table 104

x

x

x

Zihintntl

Nontemporal Locality Hint

Table 106

x

x

Zicbom

Cache Block Flush/Inval

Table 111

x

x

x

Zicboz

Cache Block Zero

Table 109

x

x

x

Zicbop

Cache Block Prefetch

Table 113

x

x

x

Za64rs

Max 64B Reservation Sets

Table 115

x

x

x

Zic64bZicboz

64B Cache Blocks

Table 117

x

x

x

Privileged

Sm

Machine CSRs

Table 160

x

x

x

x

S

Supervisor CSRs

Table 163

x

x

x

U

User CSRs

Table 165

x

x

x

UF

User Float CSRs

Table 167

x

x

x

Zkr

Entropy CSR

Table 169

o

o

o

ExceptionsSm

Machine Exceptions

Table 171

x

x

x

x

ExceptionsS

Supervisor Exceptions

Table 174

x

x

x

ExceptionsU

User Exceptions

Table 176

x

x

x

ExceptionsF

Float Exceptions

Table 178

x

x

x

ExceptionsZalrsc

LR/SC Exceptions

Table 180

x

x

x

ExceptionsZaamo

AMO Exceptions

Table 183

x

x

x

ExceptionsZc

Compressed Exceptions

Table 185

x

x

x

x

ExceptionsZicboS

Supervisor CBO Exceptions

Table 187

x

x

x

ExceptionsZicboU

User CBO Exceptions

Table 189

x

x

x

ExceptionsSv

Virt Mem Exceptions

Table 193

x

x

x

ExceptionsSvZalrsc

Virt Mem LR/SC Exceptions

Table 197

x

x

x

ExceptionsSvZaamo

Virt Mem AMO Exceptions

Table 200

x

x

x

InterruptsSm

Machine Interrupts

Table 204

x

x

x

x

InterruptsS

Supervisor Interrupts

Table 208

x

x

x

SstcSm

Machine Supervisor Timer Compare

Table 211

x

x

x

Sstc

Supervisor Timer Compare

Table 213

x

x

x

ZicntrS

Supervisor Counters

Table 215

x

x

x

ZicntrU

User Counters

Table 217

x

x

x

Zihpm

Hardware Performance Monitors

Table 100

o

x

x

x

x

EndianSm

Machine Endian

Table 219

EndianS

Supervisor Endian

Table 221

EndianU

User Endian

Table 223

EndianZaamo

AMO Endian

Table 225

EndianZalrsc

LR/SC Endian

Table 226

EndianF

Float Endian

Table 227

EndianZca

Compressed Endian

Table 228

PMPSm

Machine PMP

Table 234

x

x

x

x

PMPS

Supervisor PMP

Table 236

x

x

x

PMPU

User PMP

Table 238

x

x

x

PMPF

Float PMP

Table 240

x

x

x

PMPZca

Compressed PMP

Table 242

x

x

x

x

PMPZicbo

PMP + CBOM/CBOZ

Table 244

x

x

x

PMPZaamo

AMO PMP

Table 246

x

x

x

PMPZalrsc

LR/SC PMP

Table 248

x

x

x

Svbare

No Virtual Memory

Table 254

x

x

x

Sv

Sv32/39/48/57 Virtual Memory

Table 250

x

x

x

SvSm

Machine-Mode Virtual Memory

Table 252

x

x

x

Svinval

TLB Invalidation

Table 264

x

x

x

SvPMP

VM + PMP

Table 258

x

x

x

SvZicbo

VM + CBOM/CBOZ

Table 260

x

x

x

SvPMPZicbo

VM + PMP + CBOM/CBOZ

Table 262

x

x

x

Svade

Page Table A/D Exceptions

Table 268

x

x

x

Svadu

Page Table Update

Table 270

o

o

SvaduPMP

Page Table Update + PMP

Table 272

o

o

Svpbmt

Page-based Memory Types

Table 274

x

x

x

Svnapot

Naturally Aligned Pages

Table 276

o

x

x

Svukte

User Kernel Translation Enable

Table 278

o

o

o

Sscofpmf

Counter Filtering

Table 311

o

x

x

Ssstateen

Supervisor State Enable

Table 313

o

x

Ssu64xl

64-bit UXL

Table 314

o

x

x

Sscounterenw

Counter Enables Writable

Table 316

x

x

x

Sstvecd

Direct Vector

Table 318

x

x

x

Sstvala

stval Addresses

Table 320

x

x

x

Strict

SsstrictSm

Machine Strict (unratified)

Section B.6.1

o

o

o

SsstrictS

Supervisor Strict

Section B.6.2

o

o

o

Vector

Vx8

Vector Integer 8-bit

Table 120

o

o

x

Vx16

Vector Integer 16-bit

Table 120

o

o

x

Vx32

Vector Integer 32-bit

Table 120

o

o

x

Vx64

Vector Integer 64-bit

Table 120

o

o

x

Vls8

Vector Load/Store 8-bit

Table 122

o

o

x

Vls16

Vector Load/Store 16-bit

Table 122

o

o

x

Vls32

Vector Load/Store 32-bit

Table 122

o

o

x

Vls64

Vector Load/Store 64-bit

Table 122

o

o

x

Vf16 (Zvfh)

Vector Float 16-bit

Table 124

o

o

Vf32

Vector Float 32-bit

Table 124

o

o

x

Vf64

Vector Float 64-bit

Table 124

o

o

x

Zvfhmin

Vector half conversions

Table 126

o

o

Zvfbfmin

Vector BF16 Convert

Table 127

o

o

Zvfbfwma

Vector BF16 MAC

Table 129

o

o

Zvbb8

Vector Bit Manip 8-bit

Table 131

o

x

Zvbb16

Vector Bit Manip 16-bit

Table 131

o

x

Zvbb32

Vector Bit Manip 32-bit

Table 131

o

x

Zvbb64

Vector Bit Manip 64-bit

Table 131

o

x

Zvkb8

Vector Crypto Bit Manip 8-bit

Table 135

o

o

Zvkb16

Vector Crypto Bit Manip 16-bit

Table 135

o

o

Zvkb32

Vector Crypto Bit Manip 32-bit

Table 135

o

o

Zvkb64

Vector Crypto Bit Manip 64-bit

Table 135

o

o

Zvbc64

Vector Carryless Mult

[t-Zvbc64-coverpoints]

o

o

Zvkg32

Vector GCM

Table 137

o

o

Zvkned32

Vector Crypt

Table 139

o

o

Zvknha32

Vector Hash 32-bit

Table 141

Zvknhb64

Vector Hash 64-bit

Table 142

o

o

Zvksed32

Vector ShangMi Crypt

Table 144

o

o

Zvksh32

Vector ShangMi Hash

Table 146

o

o

Vector Privileged

ExceptionsVx

Vector Integer Exceptions

Table 304

o

o

x

ExceptionsVf

Vector Float Exceptions

Table 306

o

o

x

ExceptionsVls

Vector Load/Store Exceptions

Table 308

o

o

x

UV

User Vector CSRs

Table 310

o

o

x

MisalignV

Vector Misalignment

Table 300

o

o

o

SsstrictV

Vector Strict

Table 302

o

o

o

Hypervisor

H

Hypervisor Instructions

Table 279

o

o

x

ExceptionsH

Hypervisor Exceptions

Table 280

o

o

x

ExceptionsHV

Hypervisor Vector Exceptions

Table 281

o

o

x

InterruptsH

Hypervisor Interrupts

Table 282

o

o

x

EndianH

Hypervisor Endian

Table 284

ZicntrH

Hypervisor Counters

Table 285

o

o

x

HV

Hypervisor + Vector CSRs

Table 283

o

o

x

PMPH

Hypervisor PMP

Table 286

o

o

x

SvH

Hypervisor Virtual Memory

Table 287

o

o

x

SvHZicbo

Hypervisor Virtual Memory + CBO

Table 288

o

o

x

Shcounterenw

Counter Enables

Table 289

o

o

x

Shvsatpa

VM Modes Supported

Table 290

o

o

x

Shgatpa

VM x4 Modes Supported

Table 291

o

o

x

Shvstvecd

Direct Vectoring

Table 292

o

o

x

Shvstvala

vstval Addresses

Table 293

o

o

x

Shtvala

htval Addresses

Table 294

o

o

x

Shlcofideleg

Counter Overflow Delegation

[t-Shlcofideleg-coverpoints]

o

o

x

ZkrH

Hypervisor Entropy

[t-ZkrH-coverpoints]

o

o

x

SstcH

Hypervisor Supervisor Timer

Table 295

o

o

x

SsstateenH

Hypervisor State Enable

[t-SsstateenH-coverpoints]

o

o

x

SvinvalH

Hypervisor TLB Inval

Table 296

o

o

x

SvaduH

Hypervisor TLB Update

Table 297

o

o

o

ZicfilpH

Hypervisor Landing Pad

Table 298

o

o

o

ZicfissH

Hypervisor Shadow Stack

Table 299

o

o

o

Miscellaneous RV{A/B}23 Extensions

Ss1p13

Supervisor 1p13

Table 324

x

x

Ssnpm

Pointer Masking

Table 326

x

x

SsnpmSm

Machine-Mode Pointer Masking with MPRV

Table 327

x

x

SsnpmH

Hypervisor Pointer Masking

[t-SsnpmH-coverpoints]

Zacas

Atomic Compare-And-Swap

Table 148

o

o

Zabha

Subword Atomics

Table 151

o

o

Zama16b

Main memory PMA supports misaligned atomics within 16-byte regions

Table 348

x

ZicfilpU

User Landing Pads

[t-ZicfilpU-coverpoints]

o

o

ZicfilpSm

Machine Landing Pads

Table 335

o

o

ZicfilpS

Supervisor Landing Pads

Table 336

o

o

ZicfissU

User Shadow Stack

Table 338

o

o

ZicfissS

Supervisor Shadow Stack

Table 339

o

o

ZicfissSm

Machine Shadow Stack

Table 340

o

o

Zfbfmin

BF16 Convert

Table 52

o

o

Zimop

Maybe-Ops

Table 153

x

x

Zcmop

Compressed Maybe-Ops

Table 155

x

x

ZawrsSm

Machine Wait on Reservation Set

Table 342

x

x

ZawrsS

Supervisor Wait on Reservation Set

Table 343

x

x

ZawrsU

User Wait on Reservation Set

Table 344

x

x

SdtrigSm

Debug Triggers

Table 350

o

o

Non-Profile Extensions

E

Embedded 16 Regs

Table 159

Zfinx

Float in Int Regs

Section A.15.2

Zdinx

Double in Int Regs

Section A.15.3

Zhinx

Half in Int Regs

Section A.15.4

Zhinxmin

Half Cvt in Int Regs

Section A.15.5

Q

Quad-Precision Float

Section A.15.6

ZfhQ

Half-Quad Converts

Section A.15.7

ZfhminQ

Half-Quad Converts

Section A.15.7

ZfaQ

Additional Quad

Section A.15.9

ZfaZfhQ

Additional Half-Quad Converts

Section A.15.10

MisalignQ

Misaligned Quad

none yet

Zcmp

Compressed Push/Pop

none yet

Zcmt

Compressed Table Jumps

none yet

Zilsd

Load/Store Double

Section A.15.13

Zclsd

Compressed Load/Store Double

Section A.16

Smcsrind

Machine Indirect CSRs

Smcsrind Coverpoints

Sscsrind

Supervisor Indirect CSRs

Section B.12.5

SscrindH

Hypervisor Indirect CSR

[t-SscrindH-coverpoints]

o

o

x

Smepmp

Enhanced PMP

Section B.12.6

Smrnmi

Machine Resumable Interrupts

Smrnmi Coverpoints

Ssrnmi

Supervisor Resumable Interrupts

Section B.12.8

Sm1p13

Machine 1p13

Table 352

x

x

Smstateen

Machine State Enable

Table 354

Smcntrpmf

Cycle and Instret Mode Filtering

Section B.12.9

Smcdeleg

Counter Delegation

Smcdeleg Coverpoints

Ssccfg

Counter Delegation

Section B.12.11

SscfgH

Hypervisor Counter Delegation

[t-SscfgH-coverpoints]

Smdbltrp

Machine Double Trap

Smdbltrp Coverpoints

Ssdbltrp

Supervisor Double Trap

Ssdbltrp Coverpoints

SsdbltrpH

Hypervisor Double Trap

[t-SsdbltrpH-coverpoints]

SmnpmS

Machine Pointer Masking with S-mode

Table 330

SmnpmSSm

Machine Pointer Masking with S-mode and MPRV

Table 331

SmnpmU

Machine Pointer Masking without S-mode

[t-SmnpmU-coverpoints]

SmnpmUSm

Machine Pointer Masking without S-mode and with MPRV

Table 332

Smmpm

Pointer Masking

Table 333

SmnpmH

Hypervisor Pointer Masking

[t-SmnpmH-coverpoints]

Smctr

Control Transfer Records

Section B.12.14

SmctrH

Hypervisor Control Transfer Records

[t-SmctrH-coverpoints]

Ssqosid

Quality-of-Service ID

Ssqosid Coverpoints

Debug

DM

Debug Module

none yet

DTM

Debug Transport Module

none yet

Sdext

Debug Mode

none yet

Advanced Interrupt Architecture

Smaia

Machine Advanced Interrupts

Section C.2.2

Ssaia

Supervisor Advanced Interrupts

Section C.2.3

IMSIC

Incoming MSI Controller

Section C.2.4

APLIC

Advanced Platform-Level Interrupt Controller

Section C.3

I/O Memory Management Unit

IOMMU

I/O Memory Management Unit

IOMMU Coverpoints

3.2. Out-of-Scope Extensions

Table 2 lists certain extensions whose behavior is presently outside the scope of certification. An x in the table means the extension is required for that profile. Some of these behaviors are not readily visible at the architectural level of observed program behavior, such as constant-time instructions. PMA properties are implicitly tested by executing instructions that depend on the property, but not tested comprehensively across the entire memory map. Entropy generation requires statistical analysis beyond the present scope of certification. These extensions might be added to scope in the future.

Table 2. Extensions Lacking Architectural Visibility for Certification Testing
Coverage File Description RVI20 uController RVA22S64 RVB23S64 RVA23S64

Ziccif

Main memory PMA supports instruction fetch

x

x

x

Ziccrse

Main memory PMA supports RsrvEventual

x

x

x

Ziccamoa

Main memory PMA supports atomics

x

x

x

Ziccamoc

Main memory PMA supports AMOCASQ

x

x

Zkt

Constant-time scalar crypto

x

x

x

Zvkt

Constant-time vector crypto

x

x

x

Svvptc

Valid PTEs appear within bounded time without fence

x

x

Furthermore, the following features are not supported in this version of the certification test plan:

  • sfence.vma, sinval, and hypervisor fences are lightly tested because it is hard to prove they don’t work

  • Physical Memory Attributes (PMA): no standard representation yet; tests assume programs run in main memory with full capabilities. TODO: Add a mechanism to define memory region PMAs in UDB, and exercise each type of access (load/store/execute, misaligned, at start/middle/end/partially wrapping) to each region.

  • Testing privilege modes whose XLEN differs from MXLEN; low ROI

  • Testing extensions that have been disabled with misa fields; behavior is unspecified.

  • Non-Maskable Interrupts (NMI) - no standard way to generate them yet

  • Reset behavior - no way for a program to reset itself

  • Delegation of MEI/MTI/MSI to S-mode - "most platforms will choose not to make these interrupts delegatable from M-mode to S-mode"

  • Multicore or multi-master systems; current tests only run on one core and atomics and memory consistency are only lightly tested. TODO: coming later.

  • Custom extensions

A hart with these features can still be certified if it meets all other requirements; these features are simply not tested.

TODO: ** which of the Zicc extensions are tested by regular instructions?

4. General Test Plan Strategy

This CTP describes tests for all supported RISC-V profiles, but the tests run on a specific DUT. The DUT memory map is defined by a Linker Script. The DUT configuration is described with RISC-V Unified Database, and supplementary files such as simulator configuration files are (TODO) automatically generated from the UDB so there is a single configuration file to maintain. The UDB describes the supported extensions, and also has parameters defining optional behaviors of those extensions. If a behavior is UNSPECIFIED in the specification, it is not tested because there are no wrong answers. A common purpose of parameters is to define the behavior of WARL fields in CSRs.

4.1. Configuration

The DUT is described with a Unified Database (UDB) YAML file. This file lists:

  • all of the supported extensions

  • all of the parameters required to describe the behavior of the extensions

The DUT also needs to know how to boot the core, terminate a test with a success code, send a message to a console, and cause interrupts. These DUT-specific behaviors are defined by RVMODEL DUT-Specific Macros, which are an assembly-language library implementing an API using DUT-specific hardware.

4.2. Unified Database

Unified Database allows partially- and fully-configured descriptions. A profile is an example of a partially configured description because it has a mix of required and optional extensions, and does not specify parameter values for most of the extensions. A DUT needs to have a fully configured description including precisely which versions of which extensions are supported and what parameter values are implemented, so that a simulator can exactly match its behavior.

The certification framework requires a fully-configured UDB description of the DUT and RVMODEL macros for the DUT. It uses UDB to produce supplementary configuration files including:

  • JSON file configuring the RISC-V Sail reference model to match the DUT

  • Configuration files for other optional simulators, such as Spike, ImperasFPM

  • SystemVerilog coverage.svh file describing which coverage files and parameter values to use for coverage measurement

  • Optional DUT configuration files (CORE-V Wally Example) providing parameter values to configurable RTL

4.2.1. Configuration Parameters

The UDB parameters for each extension are defined in:

  • The CSC Tests and Models working group developed the following list of configuration parameters. Need to check if they match the parameters in UDB extensions.

A partially-configured UDB description of each profile is given in:

4.3. Unspecified and Reserved Behaviors

Some RISC-V behaviors are UNSPECIFIED, which means an implementation can do anything. These behaviors are not tested because there is no wrong answer. Table 3 summarizes the normative rules regarding reserved behaviors.

Unimplemented opcodes (except in the custom space) and instructions accessing non-existent CSRs are reserved. The behavior of reserved instructions is UNSPECIFIED, so they should not be tested by most testplans. However, when the Ssstrict extension is enabled, reserved instructions raise an illegal instruction exception. This is tested by the SsstrictS test plan.

Table 3. I Normative Rules Regarding Behaviors
Spec Section Normative Rule

Unpriv 1.7

The term UNSPECIFIED refers to a behavior or value that is intentionally unconstrained.

Unpriv 2.2

For this purpose, we divide each RISC-V instruction-set encoding space (and related encoding spaces such as the CSRs) into three disjoint categories: standard, reserved, and custom. …​ Reserved encodings are currently not defined but are saved for future standard extensions; once thus used, they become standard encodings. …​ The behavior upon decoding a reserved instruction is UNSPECIFIED.

Privileged 2.1

Instructions that access a non-existent CSR are reserved.

rva23-profile

Ssstrict No non-conforming extensions are present. Attempts to execute unimplemented opcodes or access unimplemented CSRs in the standard or reserved encoding spaces raises an illegal instruction exception that results in a contained trap to the supervisor-mode trap handler.

TODO: Generate this table from norm rules via YAML when Ssstrict is tagged. Expand on definition of Ssstrict in light of github.com/riscv/riscv-isa-manual/issues/3258.

4.4. CSR Bitfields

CSR fields can be Write Preserves, Read Ignores (WPRI), Write Legal, Read Legal (WLRL), or Write Any, Read Legal (WARL). Examples of WPRI fields include undefined fields of xstatus, xenvcfg, mseccfg, and xstateen* that could have unintended side effects if they are subsequently defined and unwittingly set to nonzero values. Examples of WLRL fields include xcause.ExceptionCode and hstatus.VGEIN. Other CSR fields are generally WARL.

WPRI fields should be read-only zero if not furnished by the implementation, but are not tested because the test suite may be unaware of subsequently ratified extensions that furnish them. WLRL fields are tested with legal values but no illegal values. Similarly, WARL fields are tested with legal values. The legalization of illegal values is implementation-specific and can be difficult to convey to a reference model for multibit fields, so WARL fields are not tested with illegal values unless it is easy to determine their legality (e.g. 1-bit fields). Reserved values are never tested in CSRs because the behavior is implementation-defined.

Instructions and CSRs in the custom encoding space are never tested because the behavior is implementation-defined.

Table 4 summarizes the normative rules regarding CSR bitfields.

Table 4. I Normative Rules Regarding Bitfields
Spec Section Normative Rule

Privileged 2.3

Some whole read/write fields are reserved for future use. Software should ignore the values read from these fields, and should preserve the values held in these fields when writing values to other fields of the same register. For forward compatibility, implementations that do not furnish these fields must make them read-only zero. These fields are labeled WPRI in the register descriptions.

Privileged 2.3

Some read/write CSR fields specify behavior for only a subset of possible bit encodings, with other bit encodings reserved. Software should not write anything other than legal values to such a field, and should not assume a read will return a legal value unless the last write was of a legal value, or the register has not been written since another operation (e.g., reset) set the register to a legal value. These fields are labeled WLRL in the register descriptions.

Privileged 2.3

Implementations are permitted but not required to raise an illegal-instruction exception if an instruction attempts to write a non-supported value to a WLRL field. Implementations can return arbitrary bit patterns on the read of a WLRL field when the last write was of an illegal value, but the value returned should deterministically depend on the illegal written value and the value of the field prior to the write.

Privileged 2.3

Some read/write CSR fields are only defined for a subset of bit encodings, but allow any value to be written while guaranteeing to return a legal value whenever read. Assuming that writing the CSR has no other side effects, the range of supported values can be determined by attempting to write a desired setting then reading to see if the value was retained. These fields are labeled WARL in the register descriptions.

Privileged 2.3

Implementations will not raise an exception on writes of unsupported values to a WARL field. Implementations can return any legal value on the read of a WARL field when the last write was of an illegal value, but the legal value returned should deterministically depend on the illegal written value and the architectural state of the hart.

TODO: replace with references to normative rules tagged in spec.

4.5. Normative Rules

The testplan for each extension contains a list of normative rules applicable to that extension. Normative rules are generally direct quotations from a ratified RISC-V specification describing a single certifiable feature. Normative rules specify the behaviors an implementation must meet in order to be compliant with the standard. In particular, introductory overview and non-normative explanatory text is not quoted as a normative rule.

See tagging_normative_rules for more information about normative rules and IDs and how to tag them in the specification.

4.6. Coverpoints

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 UDB_MXLEN_32 or UDB_MXLEN_64 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.

Not all normative rules have coverpoints and tests. A normative rule that a behavior is UNSPECIFIED is not tested because there is no wrong answer. For example, writing satp.MODE = Bare with nonzero values in other fields has unspecified behavior and is untested. The CTP may declare that other normative rules are too difficult to test relative to their value (low return on investment) and choose not to test them. For example, if the Zcf extension is supported, misa.C depends on whether misa.F is supported. misa.F is WARL and may be read-only one, so it is not always possible to test the misa.C dependence on misa.F = 0 and, for simplicity, this dependence might never be tested.

To the extent that there are any normative rules associated with instruction opcodes or CSR numbers, if these rules can be tested by coverpoints that execute the instruction or access the CSR, then no other coverpoints are needed. For example, a normative rule that an add instruction has op = 0110011, funct3 = 000, and funct7 = 0000000 is tested by the ordinary coverpoints that exercise the add instruction.

4.7. Tests

Privileged tests are mostly generated by scripts. They preferably share a single .S file that can be compiled for either RV32 or RV64, again with ifdef directives to separate the two. Unprivileged tests are generated from a template using a Python script, and are divided into RV32 and RV64 directories because the random values differ with XLEN.

5. Test Suite Requirements

The test suites may be provided by multiple suppliers, but must meet a common set of requirements to interoperate transparently for the user:

  • All tests use a common set of DUT configuration files so the user only has to write them once:

    • <dut>.yaml for the UDB configuration including supported extensions and parameter values

    • rvmodel_macros.h for the RVMODEL DUT-Specific Macros

    • link.ld for the linker script

  • All tests are self-checking

    • Able to run on simulators, RTL, and hardware

    • Expected values may be produced by the RISC-V Sail reference model or the test code itself, and must account for relevant parameters

      • Alternate reference model may be used for development until RISC-V Sail is sufficiently mature

    • Only test features whose behavior is specified for the given parameters (e.g. only test unimplemented instructions if Ssstrict is supported)

    • Calls RVMODEL_BOOT for DUT-specific boot code (can be empty or omitted) before starting the test

    • Test begins in machine mode, if any privileged modes are implemented

    • Terminate with RVMODEL_HALT_PASS or RVMODEL_HALT_FAIL to indicate success

    • Print meaningful information to localize a failure with RVMODEL_IO_WRITE_STR, including:

      • PC at failure point

      • Expected and actual values of mismatching registers

      • Name of coverpoint and bin that failed, if practical

    • Tests should not contain loops over multiple bins. Each bin of each coverpoint should be tested by a unique instruction so that a failing bin can be uniquely identified from the program counter. Loops should go in the test generator instead of the test itself.

  • Tests are organized in a granular way so that each ISA feature can be tested independently of other features

  • All tests are written in assembly or C and work with the latest release of both GCC and Clang

    • The latest release is typically needed because new extensions are rapidly being added to these compilers

    • Certificates will be tied to specific compiler versions to ensure consistency

  • Qualifying each test includes running on the RISC-V Sail reference model, Spike, and Whisper for at least one choice of parameters

    • Exceptions can be made for specific tests when there are known bugs or unimplemented extensions

  • Tests are for certification, not verification

    • Every normative rule is addressed by at least one coverpoint, defined in the CTP

      • Specific normative rules can be omitted from testing if they are not testable. In this case, the rule should still be listed in the CTP and should be explicitly marked as not tested

    • Every test is directed to a specific normative rule/coverpoint bin, not fuzzing in the hopes of randomly hitting a rule/coverpoint

      • Exception: Multicore memory ordering is necessarily nondeterministic

    • Tests emphasize RISC-V architectural behavior, not microarchitectural behavior such as complex pipeline hazards or timing

    • Runtime is important

    • Size is important

  • All tests have SystemVerilog coverpoints

    • Use standard syntax compatible with Questa, VCS and Xcelium (regression on at least Questa)

    • All coverpoints must use the RVVI interface

  • All testing collateral (tests, test generators, coverpoints, frameworks, documentation, etc.) are owned by RVI and distributed under an open-source license ** TODO: Jeff/Tom/Moiz to update this section

    • Hosted in the RISC-V architectural test repository under the stewardship of Architectural Certification Test (ACT) SIG

    • Repository contains tests for ratified and in-development features, not just features in certificates

    • Generators necessary to recreate the tests for a DUT are included in the repository, but, when tests are not unique to a DUT, the generated tests themselves are also included to reduce requiring users to run generators and to make the tests easier to view and understand

  • Don’t let the perfect be the enemy of the good

    • If necessary to meet schedule, tests can be released addressing most of the normative rules and coverpoints for a feature, and improved over time

    • Initial test development prioritizes the common parameter choices (such as XLEN=MXLEN, Endian=Little), and other parameter choices can be added over time

    • All limitations must be documented in CTP

5.1. For discussion:

  • Testing of WARL, WLRL, WPRI fields, and the necessary parameters to define what fields should be tested and behaviors should be expected, in collaboration with the Parameters Working Group

  • Regression requirements, including multiple parameters

6. Abstraction Layer

  • separate this into parts required for all test suites including TT vs. parts required only for ACT4

  • key for TT is to invoke RVMODEL_BOOT and RVMODEL_BOOT_TO_xMODE if they exist, and to implement SBI, also use other RVMODEL macros and link.ld

The abstraction layer provides a set of macros that allow test programs and coverpoints to interact with the DUT in a platform-specific way. This allows the same test program and coverpoint source code to be used across different DUTs, with only the abstraction layer macros needing to be modified for each DUT. In particular, the abstraction layer includes

  • Boot macros to initialize state.

  • Trap handler

  • Supervisor Binary Interface (SBI) calls

  • RVMODEL DUT-specific macros (semihosting/trick box)

  • Memory map (linker script)

Fundamental design considerations are:

  • For unprivileged extensions, RISC-V tests cannot assume the existence of any privileged capabilities whatsoever unless a profile explicitly requires them. For example, RV32I tests should be able to run on a microcontroller that does not implement any CSRs, including mtvec, and thus cannot have a trap handler.

  • Even if machine-mode exists, the tests cannot assume the existence of a Standard Machine Mode, i.e. a machine mode that implements all of the features in the ISA specification. A DUT might implement a Custom Machine Mode, such as a minimal implementation for a specific application, or additional security features. In particular, the RVA23S64 profile of particular interest for certification does not require standard M-mode, only an execution environment that responds to certain things such as ecall.

  • Nevertheless, most users will implement standard M-mode on their DUT. Therefore, the abstraction layer should provide default implementations of boot macros, trap handler, and SBI calls that assume a standard M-mode, and users can override these implementations as needed for their DUT.

  • To reduce the risk of bugs from uninitialized state and the burden on test developers, the boot process places known values in all applicable GPRs and CSRs.

The boot sequence boots to the lowest available privilege mode sufficient to run the tests. Tests may define the BOOT_TO_MMODE or BOOT_TO_SMODE symbols to force booting to M-mode or S-mode, respectively, if the DUT supports those modes. If neither symbol is defined, the boot sequence boots to U-mode if supported, and M-mode (possibly custom) otherwise. Note that hypervisor tests should define BOOT_TO_SMODE to boot into S (effectively HS)-mode and then are responsible for setting up and switching to VS/VU mode if desired.

In the ACT framework, BOOT_TO_MMODE is defined when REQUIRED_EXTENSIONS contains Sm. BOOT_TO_SMODE is defined when REQUIRED_EXTENSIONS contains S. Otherwise, neither symbol is defined. Hence, privileged tests that specify Sm, S, or U will boot into these modes, respectively. Unprivileged tests run in U-mode if supported, and in M-mode (possibly custom) otherwise. Another consequence is that if the DUT defines STANDARD_SM_SUPPORTED, then the trap handler is enabled even for unprivileged tests, helping produce graceful error messages for illegal instructions. However, a simple core such as an RV32I microcontroller may not enable STANDARD_SM_SUPPORTED and will not set up a trap handler.

6.1. Controlling Parameters

Every DUT has S_SUPPORTED, U_SUPPORTED, and H_SUPPORTED parameters from the UDB that indicate which privilege modes are supported. All DUT UDB configs support Sm, but not necessarily standard M-mode (and possibly no CSRs at all). Therefore, the DUT’s rvmodel_macros.h defines STANDARD_SM_SUPPORTED when the DUT implements mandatory portions of the M-mode spec, and leaves it undefined otherwise.

A DUT with no CSRs at all, such as an RV32I microcontroller, still declares Sm in its UDB config, because UDB defines MXLEN only when Sm is implemented, but does not declare Zicsr. It leaves STANDARD_SM_SUPPORTED undefined, so the boot code and trap handler touch no CSRs, and sets include_priv_tests: False in its test_config.yaml, so the privileged tests that the Sm declaration would otherwise select are skipped. config/cores/picorv32/picorv32-rv32imc is an example.

6.2. Boot Sequence

The user is responsible for loading the test ELF onto the DUT and jumping to rvtest_entry_point. The user may optionally run some other firmware or custom boot loader that performs DUT-specific initialization before loading the test ELF.

The test ELF begins with the RVTEST_BEGIN macro, which defines rvtest_entry_point (at an address specified in the link.ld file), and jumps to rvmodel_boot.

rvmodel_boot in turn calls the RVMODEL_BOOT macro, which optionally contains DUT-specific boot code such as turning on a PLL or memory controller. This macro can be empty or undefined in the common case that no DUT-specific boot code is required or that the DUT-specific boot is performed earlier by a separate bootloader.

Next, rvmodel_boot calls RVMODEL_IO_INIT to perform any necessary I/O initialization, such as configuring baud rate and flow control in a UART. This macro can also be empty or undefined if no I/O initialization is needed.

Next, rvmodel_boot calls RVTEST_BOOT_TO_MMODE to set up the trap handlers and initialize M-mode CSRs. This macro first checks if RVMODEL_BOOT_TO_MMODE is defined. If undefined, it runs default boot code assuming standard M-mode. If defined, it runs the DUT-specific RVMODEL_BOOT_TO_MMODE that performs the same general steps for custom M-mode. The default boot code touches CSRs only when STANDARD_SM_SUPPORTED is defined, so a DUT with no M-mode CSRs, such as an RV32I DUT, leaves both STANDARD_SM_SUPPORTED and RVMODEL_BOOT_TO_MMODE undefined.

CSR initialization includes

  • mie/mip = 0 (disable all interrupts)

  • mideleg/medeleg = 0 (don’t delegate traps unless turned on during S-mode boot)

  • mstatus (SXLEN/UXLEN = MXLEN, SBE/UBE = MBE, other features off)

  • menvcfg (enable unpriv features if U supported)

  • mstateen0 (enable unpriv features if SMSTATEN_SUPPORTED)

  • mcountinhibit = 0 * if exists

  • mhpmenvent3…​31/h = 0

  • mseccfg (disable features if supported)

  • mnstatus (disable resumable NMI fields if SMRNMI_SUPPORTED)

  • pmpaddr0/pmpcfg0 if PMP_ENTRIES > 0

  • turn off virtual memory and perform sfence.vma to synchronize MMU if SV32_SUPPORTED or SV39_SUPPORTED

Even if standard M-mode is not supported or RVMODEL_BOOT_TO_MMODE is defined, the boot code still attempts to turn on mstatus.FS/VS if float or vector is supported, because these are needed for unprivileged tests, even on a RV32I DUT that has no other M-mode features.

The boot process ends in M-mode if the BOOT_TO_MMODE symbol is defined in the test (for tests intended to run in machine mode), or if no lower privilege mode is supported.

If the test is continuing to boot to a lower privilege mode, it next checks if S_SUPPORTED and, if so, calls RVTEST_BOOT_TO_SMODE. This initializes S-mode CSRs, and adjusts M-mode CSRs such as trap delegation and environment configuration. It then enters S-mode. This entire routine can be overridden by a RVMODEL equivalent for custom M-mode implementations that cannot access M-mode CSRs or use the standard mret method of entering S-mode.

S-mode CSR initialization includes

  • medeleg = 0xFCB5FF (delegate all exceptions except for ecall from M and S mode, and double traps)

  • mideleg = 0x366 (delegate all user and supervisor-mode interrupts, including counter overflow)

  • sstateen0 (enable unprivileged features if SSSTATEEN)

  • scounteren = all 1s (enable counter access from lower priv modes)

  • senvcfg (enable unpriv features)

The boot process ends in S-mode if the BOOT_TO_SMODE symbol is defined in the test (for tests intended to run in supervisor mode).

If the test is not intended to run in S-mode, and U-mode is supported, rvmodel_boot calls RVTEST_BOOT_TO_UMODE, which switches to U-mode through T-SBI. Again, it can be overridden by RVMODEL_BOOT_TO_UMODE for custom M-mode implementations.

Finally, rvmodel_boot jumps to rvtest_init, which calls RVTEST_INIT_REGS to initialize GPRs, then sets up the signature pointer and checks a canary if applicable.*

6.3. RVMODEL DUT-Specific Macros

Each DUT requires implementing a set of macros to perform the following non-ISA functions:

  • Run DUT-specific boot code

  • Terminate a test with a pass or fail indication

  • Send a character to a terminal

  • Deliver each supported type of interrupt to the core (Machine/Supervisor External/Timer/Software + guest external interrupts)

The macro names begin with RVMODEL, so they are called RVMODEL DUT-Specific Macros. Their functions are sometimes called semihosting or trick box.

The RVMODEL DUT-Specific Macros rely on the capabilities of the SoC and/or testbench. For example, a SoC with a 16550-compatible UART sends a character by writing a byte to the UART’s memory-mapped Transmit Holding Register. A SoC without a UART may have a testbench that monitors writes to a specific memory address and prints the byte written to that address.

6.3.1. Macros

The RVMODEL DUT-Specific Macros are given in Table 5. The "Can Be Empty?" field indicates circumstances under which the macro can be empty. The Mode column indicates the privilege mode from which the macro can be called. All macros can clobber a0, a1, and a2 if needed to make T-SBI calls.

Table 5. RVMODEL DUT-Specific Macros
Macro Description Can be Empty? Mode

RVMODEL_BOOT

Perform boot operations, such as turning on a phase-locked loop or DRAM controller or initializing custom state. Cannot clobber x1/ra, but any other registers may be trashed.

Empty or omitted if no boot operations are needed, or a separate DUT-specific executable is used for booting before loading and invoking the test ELF.

Machine

RVMODEL_HALT_PASS

Terminate test with a pass indication. When the test is run in simulation, this should end the simulation.

No

Any

RVMODEL_HALT_FAIL

Terminate test with a fail indication. When the test is run in simulation, this should end the simulation.

No

Any

RVMODEL_IO_INIT(_R1, _R2, _R3)

Initialization steps needed prior to writing to the console. _R1, _R2, and _R3 are temporary registers that may be trashed by the macro.

Empty or omitted if no I/O initialization is needed.

Machine

RVMODEL_IO_WRITE_STR(_R1, _R2, _R3, _STR_PTR)

Write a null-terminated ASCII string to the console, where _R1, _R2, and _R3 are temporary registers that may be trashed by the macro and _STR_PTR is a register containing the address of the first byte of the string.

If the console is unavailable and the user implements an alternate way to signal success (such as test bench reporting or colored LEDs controlled by RVMODEL_HALT). However, a console is required for certification.

Any

RVMODEL_SET_MEXT_INT(_R1, _R2)

Sets the Machine External Interrupt mip.MEIP using platform-specific interrupt controller, if supported. _R1 and _R2 are temporary registers that may be trashed by the macro. Uses T-SBI if necessary to access controller from any privilege mode.

If machine external interrupts are not tested.

Any

RVMODEL_CLR_MEXT_INT_M(_R1, _R2)

Clears the Machine External Interrupt mip.MEIP using platform-specific interrupt controller. _R1 and _R2 are temporary registers that may be trashed by the macro. Only runs in machine mode, so it is usable within a M-mode interrupt handler without making a T-SBI call. Leave undefined to use non-M version. Must be defined if RVMODEL_CLR_MEXT_INT uses T-SBI.

If machine external interrupts are not tested.

Machine

RVMODEL_CLR_MEXT_INT(_R1, _R2)

Clears the Machine External Interrupt mip.MEIP using platform-specific interrupt controller. _R1 and _R2 are temporary registers that may be trashed by the macro. Uses T-SBI if necessary to access controller from any privilege mode.

If machine external interrupts are not supported.

Any

RVMODEL_SET_MSW_INT(_R1, _R2)

Sets the Machine Software Interrupt mip.MSIP using a memory-mapped control register, if supported. _R1 and _R2 are temporary registers that may be trashed by the macro. Uses T-SBI if necessary to access controller from any privilege mode.

If RVMODEL_MSIP_ADDRESS is defined or machine software interrupts are not tested.

Any

RVMODEL_CLR_MSW_INT_M(_R1, _R2)

Clears the Machine Software Interrupt mip.MSIP using a memory-mapped control register. _R1 and _R2 are temporary registers that may be trashed by the macro. Only runs in machine mode, so it is usable within a M-mode interrupt handler without making a T-SBI call. Leave undefined to use non-M version. Must be defined if RVMODEL_CLR_MSW_INT uses T-SBI.

If RVMODEL_MSIP_ADDRESS is defined or machine software interrupts are not tested.

Machine

RVMODEL_CLR_MSW_INT(_R1, _R2)

Clears the Machine Software Interrupt mip.MSIP using a memory-mapped control register. _R1 and _R2 are temporary registers that may be trashed by the macro. Uses T-SBI if necessary to access controller from any privilege mode.

If RVMODEL_MSIP_ADDRESS is defined and accessible from lower privilege modes or if machine software interrupts are not tested.

Any

RVMODEL_SET_SEXT_INT(_R1, _R2)

Sets the Supervisor External Interrupt sip.SEIP using platform-specific interrupt controller, if supported. _R1 and _R2 are temporary registers that may be trashed by the macro. Uses T-SBI if necessary to access controller from any privilege mode.

If supervisor external interrupts are not supported.

Any

RVMODEL_CLR_SEXT_INT_M(_R1, _R2)

Clears the Supervisor External Interrupt sip.SEIP using platform-specific interrupt controller. _R1 and _R2 are temporary registers that may be trashed by the macro. Only runs in machine mode, so it is usable within a M-mode interrupt handler without making a T-SBI call. Leave undefined to use non-M version. Must be defined if RVMODEL_CLR_SEXT_INT uses T-SBI.

If supervisor external interrupts are not supported.

Machine

RVMODEL_CLR_SEXT_INT(_R1, _R2)

Clears the Supervisor External Interrupt sip.SEIP using platform-specific interrupt controller. _R1 and _R2 are temporary registers that may be trashed by the macro. Uses T-SBI if necessary to access controller from any privilege mode.

If supervisor external interrupts are not supported.

Any

RVMODEL_SET_SSW_INT(_R1, _R2)

Sets the Supervisor Software Interrupt sip.SSIP using a platform-specific interrupt controller, if supported. _R1 and _R2 are temporary registers that may be trashed by the macro. Uses T-SBI if necessary to access controller from any privilege mode.

If there is no platform-specific interrupt controller for SSI or no supervisor software interrupts.

Any

RVMODEL_CLR_SSW_INT_M(_R1, _R2)

Clears the Supervisor Software Interrupt sip.SSIP by using a platform-specific interrupt controller, if supported. _R1 and _R2 are temporary registers that may be trashed by the macro. Only runs in machine mode, so it is usable within a M-mode interrupt handler without making a T-SBI call. Leave undefined to use non-M version. Must be defined if RVMODEL_CLR_SSW_INT uses T-SBI.

If there is no platform-specific interrupt controller for SSI or no supervisor software interrupts.

Machine

RVMODEL_CLR_SSW_INT(_R1, _R2)

Clears the Supervisor Software Interrupt sip.SSIP by using a platform-specific interrupt controller, if supported. _R1 and _R2 are temporary registers that may be trashed by the macro. Uses T-SBI if necessary to access controller from any privilege mode.

If there is no platform-specific interrupt controller for SSI or no supervisor software interrupts.

Any

RVMODEL_HPM_COUNTER

The index, 3 to 31, of the HPM counter used by the Sscofpmf tests. The tests derive the mhpmevent and mhpmcounter CSRs, and their RV32 high halves, from it.

If Sscofpmf is not supported.

n/a

RVMODEL_MHPMEVENT_VAL

The event selector written to bits 55:0 of the selected mhpmevent CSR so that RVMODEL_MHPMEVENT_CODE increments the selected counter. The Sail reference model does not have to count the same event: its build runs a fence in place of RVMODEL_MHPMEVENT_CODE, so map EV_FENCE to this selector value in event_selectors of the DUT’s sail.json, and the event should not also be generated by the T-SBI trap handler, or the S- and U-mode tests count the handler as well as the workload. 0 if the DUT cannot count any event; leave event_selectors empty, and the overflow checks are vacuous.

If Sscofpmf is not supported.

n/a

RVMODEL_MHPMEVENT_CODE(_R1, _R2)

Code that makes the selected counter increment one or more times in the current privilege mode. The tests check that the counter moved, not by how much. _R1 holds the address of a writable scratch word; _R2 may be trashed. The code must not trap, and it must assemble to 4 bytes.

If Sscofpmf is not supported.

Any

RVMODEL_ACCESS_FAULT_ADDRESS

The base physical address of a region that causes an access fault when any part of the region is read or written. This is used to test exceptions. The faulting region must be at least 128 bytes; if vector fault-only-first loads are tested, it must be at least ceil(VLEN*LMUL/8) bytes (the vector coverpoints exercise up to 2*VLEN/8 bytes with LMUL=2). For typical implementations where address 0 is unmapped, the entire first page satisfies both requirements.

Omit if DUT does not generate some/all access faults.

n/a

RVMODEL_MSIP_ADDRESS

The address of the memory-mapped msip register, used to set and clear machine software interrupts (mip.MSIP).Formally defined only for Sm version 1.13 and above; preferred over RVMODEL_SET_MSW_INT if msip exists.

Omit if machine software interrupts are not tested or require a platform-specific controller.

n/a

RVMODEL_MTIME_ADDRESS

The address of the memory-mapped mtime register, used for timer accesses and interrupts.

Omit if machine timer interrupts are not tested.

n/a

RVMODEL_MTIMECMP_ADDRESS

The address of the memory-mapped mtimecmp register, used for timer interrupts.

Omit if machine timer interrupts are not tested.

n/a

RVMODEL_INTERRUPT_LATENCY

Expected latency (in cycles/NOPs) for interrupt trap processing. Ensures interrupt is received and can be processed before test continues.

Can be 0 if interrupt controller adds no delay. Omit if the DUT has neither standard M-mode (STANDARD_SM_SUPPORTED) nor S-mode.

n/a

RVMODEL_TIMER_INT_SOON_DELAY

The delay (in timer ticks) before a timer interrupt fires when an interrupt is requested "soon". Used in logic such as mtimecmp = mtime + delay. Must be long enough for the test to return from the RVTEST_SET_*INT_SOON* routine and reach the instruction under test before the interrupt fires. When the test runs below machine mode that routine takes a T-SBI round trip through the machine-mode trap handler, so the delay must cover an ecall, the handler, and the return to the original mode.

If timer interrupts, wfi, and wrs are not tested. Omit if the DUT has neither standard M-mode (STANDARD_SM_SUPPORTED) nor S-mode.

n/a

RVMODEL_MAX_CYCLES_PER_TIMER_TICK

The highest possible ratio of the clock frequency to the timer frequency in any mode of operation. Defaults to 1 if not defined

If Machine timer interrupts, wfi, and wrs are not tested.

n/a

RVMODEL_DATA_SECTION

DUT-specific data that will be placed in a .data section. Used for memory-mapped regions like tohost/fromhost.

Yes, if not needed by DUT.

n/a

RVMODEL_INVISIBLE_TRAP_HANDLER(_PC_REG, _INSTRUCTION_REG, _ACTION_REG, _DEST_REG, _VALUE_REG)

Optionally emulates an illegal instruction in the M-mode invisible trap handler. _PC_REG and _INSTRUCTION_REG are read-only and contain the trapping PC and instruction, respectively. _ACTION_REG, _DEST_REG, and _VALUE_REG may be changed. See Section 6.3.3 for full details.

Omit if the DUT has no invisible trap emulation.

Machine

The RVMODEL_MTIME_ADDRESS, RVMODEL_MTIMECMP_ADDRESS and RVMODEL_TIMER_INT_SOON_DELAY macros are required in order to test timer interrupts. Similarly, the DUT (or its testbench) must implement the memory-mapped MTIME and MTIMECMP registers. The RVMODEL_SET_*INT and RVMODEL_CLR*_INT macros are only required for interrupts controlled in a platform-specific fashion.
If a macro needs machine mode privileges to perform its function but might be called from any mode, it must change privilege level. For example, if RVMODEL_IO_WRITE_STR needs machine mode to access a UART, it may call RVTEST_TSBI_GOTO_MMODE or use a T-SBI call to access UART memory. Printing (and halting) is done at the end of a test, so there is no need to return to the previous privilege mode.

6.3.2. The M-Mode Dance

Because profiles such as RVA23 do not require portable M-mode, the test suites go through weird and wonderful gymnastics to avoid directly using M-mode for supervisor and user-level features. This is described further in the RVA23 Certification Requirement Document. Thus, tests are divided into machine and non-machine tests.

Machine test suites are usually but not always suffixed with Sm. They boot to M-mode and test M-mode features as defined in the privileged ISA manual. They can freely switch privilege modes within tests, such as to check traps from a lower privilege mode into M-mode. Examples include Sm, InterruptsSm, ExceptionsSm, PMPZca, and Smstateen. Machine test suites are not part of the certification tests for RVA23 or other profiles that do not require M-mode.

Non-machine tests boot to S or U mode. They only access M-mode features via the T-SBI. They can switch privilege modes within tests, but never enter M-mode except via T-SBI calls that manipulate state and return to the calling mode. They expect all other traps to be delegated to supervisor level (or below) if supervisor exists.

All unprivileged tests are non-machine tests and run in the lowest available privilege mode (U if supported, otherwise M). These tests do not intentionally cause traps, though they do have the trap handler available to catch unexpected traps. Their behavior should be independent of the privilege mode. Examples include F, Zba, and Vx16.

All tests required for RVA23 certification are non-machine tests that require S-mode support.

Therefore, when booting to a non-M privilege mode, the boot code attempts to delegate all traps (aside from ecall from S/M modes, which are needed for the T-SBI; double trap, which is an undelegable M-mode feature; and machine-mode interrupts MEI/MTI/MSI, which are not part of a supervisor-level profile). Also, invisible traps must go to M-mode, be checked, and be relayed to lower-mode if not handled at M-mode, as described in the next section. The medeleg and mideleg CSRs may have read-only 0 bits that prevent such delegation. Therefore, on a system supporting S-mode, the M-mode trap handler performs the following functions even for non-machine tests:

  1. Check if the trap is a T-SBI call and if so, perform the requested T-SBI function and return from the ecall.

  2. Call custom firmware, if any exists, to handle invisible traps, as described in the next section.

  3. Otherwise, delegate the trap to the S-mode handler via software. This involves setting up sstatus, sepc, scause, and stval with values coming from the machine-mode trap CSRs, setting sstatus.SPP, SIE, and SPIE appropriately, and returning to the S-mode trap handler at stvec (possibly vectored). Traps from VS or VU must also set htval, htinst, and relevant hstatus bits. A trap from VS or VU that hedeleg also delegates goes on to the VS-mode handler instead, through vsstatus, vsepc, vscause, vstval, and vstvec.

The rvtest_setup.S and rvtest_trap_handler.S files implement the boot code, T-SBI, and machine-mode trap handler using standard M-mode capabilities. In theory, a DUT that does not implement standard M-mode might have to reimplement some or all of this code. In practice, we have not yet encountered any DUT that cannot use this standard M-mode code.

6.3.3. Invisible Trap Emulation

A DUT can use an invisible trap to emulate an instruction that is not implemented in hardware or has a known bug. When invisible traps are enabled, all illegal-instruction exceptions are first sent to M-mode for possible emulation before being forwarded to the normal trap handler. Invisible traps are enabled when RVMODEL_INVISIBLE_TRAP_HANDLER is defined or UDB_TIME_CSR_IMPLEMENTED is false. In the latter case, the framework emulates the time and timeh CSRs using mtime, adding htimedelta in VS and VU and applying the mcounteren, hcounteren, and scounteren checks.

Custom invisible traps implemented using the RVMODEL_INVISIBLE_TRAP_HANDLER macro must follow the conventions described below.

RVMODEL_INVISIBLE_TRAP_HANDLER gets five inputs:

  • _PC_REG: A register containing the trapping PC. Read-only.

  • _INSTRUCTION_REG: A register containing the trapping instruction. Read-only.

  • _ACTION_REG: The action to be taken by the trap handler.

  • _DEST_REG: The destination GPR number for action 2.

  • _VALUE_REG: The value to write for action 2.

The supported return codes in the _ACTION_REG are:

  • 0: The macro did not handle the instruction. Continue with the normal trap handling. _ACTION_REG is preset to 0 before RVMODEL_INVISIBLE_TRAP_HANDLER.

  • 1: The macro handled the instruction and wrote all required architectural state. Resume after the instruction.

  • 2: The macro handled the instruction and needs to write a GPR result. Write _VALUE_REG to the GPR whose number is in _DEST_REG, then resume after the instruction.

  • 3: The instruction raises a virtual-instruction exception, which is taken in HS-mode if medeleg delegates it and in M-mode otherwise. Valid only when H is supported.

  • Any other code is invalid and the test will produce an error.

Action 2 must be used to write GPR results because a direct write to a saved GPR would be lost when the trap handler restores that register upon exiting. Floating-point and vector registers are not restored, so they can be directly written without using action 2.

The following example emulates a read of custom CSR 0xBC0 and returns 42. It accepts CSRRS, CSRRC, CSRRSI, or CSRRCI only when rs1 or uimm is zero. The mask ignores the rd field and CSR function bit 12.

#define RVMODEL_INVISIBLE_TRAP_HANDLER(_PC_REG, _INSTRUCTION_REG, _ACTION_REG, _DEST_REG, _VALUE_REG) \
  li  _VALUE_REG, INSN_FIELD_CSR | INSN_FIELD_RS1 | INSN_FIELD_OPCODE | (2 << 12); \
  and _DEST_REG, _INSTRUCTION_REG, _VALUE_REG;                                         \
  li  _VALUE_REG, (0xBC0 << 20) | (2 << 12) | 0x73;                                   \
  bne _DEST_REG, _VALUE_REG, 1f;                                                       \
  li  _VALUE_REG, 42;                                                                  \
  srli _DEST_REG, _INSTRUCTION_REG, 7;                                                  \
  andi _DEST_REG, _DEST_REG, 0x1F;                                                     \
  li  _ACTION_REG, 2;                                                                  \
1:

The built-in RVTEST_INVISIBLE_TIME_HANDLER macro in tests/env/rvtest_invisible_trap_handler.h uses the same interface and is a larger example. It checks the CSR instruction and counter permissions, reads RVMODEL_MTIME_ADDRESS, and returns the value with action 2.

6.3.4. RVMODEL_BOOT Requirements

The RVMODEL_BOOT macro may be empty for a simple DUT.

For a complex SoC, the macro may need to perform initialization steps such as turning on a phase-locked loop or DRAM controller or initializing custom state. It must not clobber x1/ra, but any other registers may be trashed.

At the end of RVMODEL_BOOT, the system should be in standard machine mode, with XLEN and endianness for each lower privilege mode set to the same value as in machine mode (MXLEN = SXLEN = UXLEN = HSXLEN = VSXLEN and MBE = SBE = UBE = VSBE).

Alternatively, the DUT might run a separate proprietary bootloader executable file that initializes the system, then loads the test ELF and jumps to rvtest_entry_point. Or the DUT could modify link.ld to link proprietary bootloader code into the test ELF and jump to rvtest_entry_point. In these cases, RVMODEL_BOOT can be empty.

6.3.5. RVMODEL Macros for Spike and SAIL

RVMODEL macros for Spike are implemented in spike-rv64-max/rvmodel_macros.h. They use HTIF for termination, and write to a virtual UART at address 0x1000_0000 to print characters. TODO: Interrupts

RVMODEL macros for the RISC-V Sail model are implemented in tests/env/sail_test.h. They are similar to Spike but use HTIF for printing. TODO: interrupts

6.3.6. Host Target Interface

The host target interface (HTIF) is an unofficial semihosting method that has become widely used by RISC-V simulators (Spike, QEMU, RISC-V Sail) and test benches. If your SystemVerilog testbench supports it, you can share the same HTIF code as Spike and RISC-V Sail for the RVMODEL_HALT_PASS, RVMODEL_HALT_FAIL, and RVMODEL_IO_WRITE_STR DUT-specific macros. A drawback is that your testbench needs to parse the ELF labels to find the address of the tohost symbol, which is used for HTIF communication. If your testbench does not support HTIF, you can implement the RVMODEL macros using other methods, such as memory-mapped I/O to a SoC peripheral or an address monitored by the testbench.

For example, the testbench might implement the [unofficial HTIF semihosting specification] and print the character A by writing the doubleword 0x01010000_00000041 to a label called tohost in the .data section of the test program. The most significant byte is the device (console), the next byte is the command (write), and the least significant 4 bytes are the data (the ASCII code for A). Terminating with a failure code is done by writing the doubleword 0x00000000_00000003 to tohost, and terminating with a success code is done by writing the doubleword 0x00000000_00000001 to tohost.

Note that writing the upper word of the doubleword to tohost with sd is only properly defined for RV64. Therefore, RV32 can use HTIF to terminate with a success or failure code but not necessarily to write to the console.

6.3.7. RVMODEL Macros for Other DUTs

If you have a simple DUT designed to match the behavior of RISC-V Sail and Spike, you may be able to implement the RVMODEL macros with the same code used by RISC-V Sail. Your RVMODEL_BOOT macro can be empty. The interrupt macros for unsupported privilege modes can be empty.

If you have a complex DUT, you presumably have a team of sophisticated verification engineers who can adapt the example macros to your DUT’s requirements.

6.4. Linker Script

Each DUT needs a linker script tailored to its memory map. The linker script in config/<core>/<version>/link.ld defines where to place the code and data regions in the DUT’s memory map. It must contain .text.init, .text.rvtest, .data, and .text.rvmodel sections (in that order), and an ENTRY point named rvtest_entry_point. The first line of the list of SECTIONS in the linker script sets the starting address of the ELF (. = 0x…​) and is the only part of the sample linker script that most users will need to change. Set it to your reset address for simple DUTs. Users with special needs can customize the linker script to start at their own boot code (leaving the RVMODEL_BOOT macro blank) and then jump to rvtest_entry_point.

The .text.rvmodel section contains DUT-specific (RVMODEL) code and must be placed after the .data section. This ensures that variable-size model-specific macro expansions (which may differ between the DUT build and the reference-model build) do not affect the addresses of test data symbols such as scratch and begin_signature, preventing signature mismatches.

The virtual memory tests rely on an identity mapping between physical and virtual addresses in the code and data. Therefore, the starting address in the linker file should be a valid physical and virtual address. For systems supporting Sv39, this means that the starting address should be below 2^38 (typically a maximum of 0x20_0000_0000). For some systems, this may involve configuring a non-default physical address and size for main memory.

6.5. File Organization

Standard macros are defined in tests/env. DUT-specific macros are defined in rvmodel_macros.h, which is in a DUT-specific config directory (e.g. config/<dut>/<version>/rvmodel_macros.h for predefined simulators, or out-of-tree for custom DUTs).

Standard framework macros begin with RVTEST. They include rvtest_setup.h for boot macros and rvtest_trap_handler.h for standard trap handlers, and rvtest_failure_code.h for error reporting. Other macros are defined in ***util.h, …​ describe further

DUT-specific macros begin with RVMODEL. Some RVTEST macros check if corresponding RVMODEL macros are defined and invoke the RVMODEL macro instead for DUTs with custom M-mode, when defined.

6.6. Test Supervisor Binary Interface (T-SBI)

The test must implement a custom Test Supervisor Binary Interface (T-SBI) providing an abstraction layer to facilitate S and U-mode tests requesting services from a possibly custom M-mode. These services include testing ECALL to the execution environment and accessing CSRs.

The ratified SBI compiles into a ~1MB OpenSBI firmware binary, which is unnecessarily large to load with every test. Moreover, the SBI calling convention uses a7 and a6, which are not available on RV32E. Therefore, T-SBI is a lighter-weight implementation with a custom calling convention that is incompatible with the ratified SBI.

The SBI is invoked with the ecall instruction. The operation is passed in a0. An additional argument could be passed in a1 (and possibly a2) and a result could be returned in a0 if needed. Other values of a0 are reserved.

Table 6. T-SBI Calls
Function Name Operation(a0) Description

TSBI_ECALL_TEST

0x00000073

Test ecall to the execution environment. Returns xEPC in a0 to indicate that the trap handler was entered.

TSBI_CSR_SET

0x<CSR>5a073

Performs the functionality of a CSRS instruction specified by the opcode. a1 contains the value to write. <CSR> is the 12-bit CSR encoding.

TSBI_CSR_CLEAR

0x<CSR>5b073

Performs CSRC instruction specified by the opcode. a1 contains the value to write.

TSBI_CSR_WRITE

0x<CSR>59073

Performs CSRW instruction specified by the opcode. a1 contains the value to write.

TSBI_CSR_READ

0x<CSR>02573

Performs CSRR instruction specified by the opcode. Returns result in a0.

TSBI_LW

0x0005a503

LW a0, 0(a1) - Load word from physical address in a1 with machine-mode privileges. Returns result in a0. Used to read mtime or access other memory-mapped I/O.

TSBI_LWP4

0x0045a503

LW a0, 4(a1) - Load word from physical address in a1+4 with machine-mode privileges. Returns result in a0. Used to read upper half of mtime or access other memory-mapped I/O.

TSBI_LD

0x0005b503

LD a0, 0(a1) - Load doubleword from physical address in a1 with machine-mode privileges. Returns result in a0. Used to read mtime or access other memory-mapped I/O. RV64 only

TSBI_SW

0x00c5a023

SW a2, 0(a1) - Store word to physical address in a1 with machine-mode privileges. Used to write memory-mapped I/O.

TSBI_SWP4

0x00c5a223

SW a2, 4(a1) - Store word to physical address in a1+4 with machine-mode privileges. Used to write memory-mapped I/O.

TSBI_SD

0x00c5b023

SD a2, 0(a1) - Store doubleword to physical address in a1 with machine-mode privileges. Used to write memory-mapped I/O. RV64 only

TSBI_SFENCE_VMA

0x12000073

SFENCE.VMA x0, x0 - Flushes the address-translation caches. Used by a U-mode test that sets satp with TSBI_CSR_WRITE and cannot execute sfence.vma itself. Requires S-mode.

For example, an S-mode program can request setting mstatus.TW with a CSR_SET call corresponding to csrrs x0, mstatus, a1 (a0 = 0x3005a073) with a1 containing a 1 in bit 21 (the TW bit) and all other bits 0. The ACT trap handler implements this using an instruction table. If a custom M-mode does not implement mstatus.TW, it must emulate the behavior in some other way. Similarly, S-mode can read mip to a0 with a CSR_READ call corresponding to csrrs a0, mip, x0 (a0 = 0x34402573).

The ACT trap handlers implement an additional set of convenience calls changing between privilege modes in a standard fashion. This includes changing to M-mode. The behavior in M-mode is only predictable if STANDARD_SM_SUPPORTED is true. Another suite with different trap handlers might not support these calls.

Table 7. Additional ACT System Calls
Function Name Operation(a0) Description

TSBI_GOTO_MMODE

0x00000001

Switches to M-mode from any privilege mode. Behavior may be unpredictable if STANDARD_SM_SUPPORTED is false.

TSBI_GOTO_SMODE

0x00000002

Switches to S/HS-mode from any privilege mode.

TSBI_GOTO_UMODE

0x00000003

Switches to U-mode from any privilege mode.

TSBI_GOTO_VSMODE

0x00000004

Switches to VS-mode from any privilege mode.

TSBI_GOTO_VUMODE

0x00000005

Switches to VU-mode from any privilege mode.

The ACT S/HS and VS-mode trap handlers implement the same calls. Each trap handler performs the request if possible at the current privilege level, or else makes another ecall to pass the request up the privilege chain if necessary. For example, GOTO_MMODE is always passed up the chain. A CSR access to S-mode CSRs is handled by the S-mode handler, while a CSR access to M-mode received by the S-mode handler is passed up to the M-mode handler by an ecall with unchanged arguments.

6.6.1. System Call Macros

The following macros are defined for developer convenience to access the T-SBI and ACT system calls. They are not required.

  • RVTEST_TSBI_ECALL_TEST(): returns xEPC in a0

  • RVTEST_TSBI_CSR_SET(csr, imm)

  • RVTEST_TSBI_CSR_CLEAR(csr, imm)

  • RVTEST_TSBI_CSR_WRITE(csr, imm)

  • RVTEST_TSBI_CSR_WRITE_A1(csr): write value in a1

  • RVTEST_TSBI_CSR_READ(csr): returns value in a0

  • RVTEST_TSBI_SFENCE_VMA

    csr is the 12-bit CSR number (e.g. CSR_MIP from encoding.h) and imm is a constant that the macro loads into a1 with li before the call.

  • RVTEST_TSBI_GOTO_MMODE

  • RVTEST_TSBI_GOTO_SMODE

  • RVTEST_TSBI_GOTO_UMODE

  • RVTEST_TSBI_GOTO_VSMODE

  • RVTEST_TSBI_GOTO_VUMODE

  • RVTEST_TSBI_LW: performs lw a0, 0(a1) with machine-mode privileges. Returns result in a0. Used to read mtime or access other memory-mapped I/O.

  • RVTEST_TSBI_LWP4: performs lw a0, 4(a1) with machine-mode privileges. Returns result in a0. Used to read mtime or access other memory-mapped I/O.

  • RVTEST_TSBI_LD: performs ld a0, 0(a1) with machine-mode privileges. Returns result in a0. Used to read mtime or access other memory-mapped I/O. RV64 only.

  • RVTEST_TSBI_SW: performs sw a2, 0(a1) with machine-mode privileges. Used to write memory-mapped I/O such as mtimecmp or msip.

  • RVTEST_TSBI_SWP4: performs sw a2, 4(a1) with machine-mode privileges. Used to write memory-mapped I/O such as mtimecmph.

  • RVTEST_TSBI_SD: performs sd a2, 0(a1) with machine-mode privileges. Used to write memory-mapped I/O such as mtimecmp or msip. RV64 only.

TODO

testgen/src/testgen/io/templates.py format_params needs to accept STANDARD_SM_SUPPORTED parameter when available. How to deal with UDB? (Released in UDB 4/29/26).

remove mention of RVTEST_VECTOR from vector code

Test generator: Any test that lists Sm in REQUIRED_EXTENSIONS adds STANDARD_SM_SUPPORTED as a parameter (outdated; as of 9/16/26 it adds BOOT_TO_MMODE) DONE * edit generators/testgen/src/testgen/io/templates.py/generate_defines_from_extensions to define these boot_TO_*. DONE Drop RVTEST_FP and tweak where it was used (hopefully removed)

Restore this code when fully transitioned to S-SBI
    if any(ext in ext_components for ext in ["H", "S"]):
        extra_defines.append("#define BOOT_TO_SMODE")
    elif any(ext in ext_components for ext in ["Sm"]):
        extra_defines.append("#define BOOT_TO_MMODE")

7. Architectural Functional Coverage

In principle, a test plan could simply list a set of features to test, and a set of tests that exercise these features. Experienced verification engineers have learned that tests often have bugs and don’t exercise the feature that the author intended. Many of these bugs can be caught if a different engineer independently writes functional coverpoints that measure whether the tests exercised the features.

This Certification Test Plan focuses on whether a DUT implements all of the architectural features of a profile. Architectural features are those that are directly visible to the programmer, especially those defined in the unprivileged and privileged ISA specifications.

Later certificates may add ratified architectural features outside the ISA spec, such as IOMMU, debug, or AIA.

Certification differs from design verification in that it does not systematically test microarchitectural features. Design verification must be aware of DUT-specific features such as the pipeline design. For example, DV should test design-specific interactions of interrupt arrival time, pipeline hazards, multicycle instructions, MMU, and memory system. Design verification also should test tricky implementation issues, such as hard floating-point rounding cases.

This plan uses the term Architectural Functional Coverage to describe the functional coverpoints required for certification. In contrast, full design verification also has Microarchitectural Functional Coverage.

Functional coverage also differs from code coverage, which measures whether the test suite exercises all of the lines of code in the RTL. Each of these detects different types of bugs. Code coverage is part of DV but not certification.

Architectural functional coverage requires a way to measure the architectural state of the machine after each instruction. The RISC-V Verification Interface (RVVI) provides a standard way to observe this state in the DUT. This document defines Extended RVVI with additional signals to facilitate testing virtual memory.

7.1. Extended RVVI

As compared to the base RVVI, Extended RVVI adds the following signals:

Table 8. Extended RVVI Signals
Signal Width Description

virt_adr_i

XLEN

Virtual address of instruction

virt_adr_d

XLEN

Virtual address of data accessed by instruction

phys_adr_i

PA_BITS

Physical address of instruction

phys_adr_d

PA_BITS

Physical address of data accessed by instruction

g_phys_adr_i

PA_BITS

Guest physical address of instruction (when Hypervisor is active, 0 when inactive)

g_phys_adr_d

PA_BITS

Guest physical address of data accessed by instruction (when Hypervisor is active, 0 when inactive)

pte_i

XLEN

Instruction page table entry (VS-stage when Hypervisor is active)

pte_d

XLEN

Data page table entry (VS-stage when Hypervisor is active)

g_pte_i

XLEN

Instruction page table entry (G-stage when Hypervisor is active, 0 when inactive)

g_pte_d

XLEN

Data page table entry (G-stage when Hypervisor is active, 0 when inactive)

page_type_i

3

Instruction page type (VS-stage when hypervisor is active))

page_type_d

3

Data page type (VS-stage when hypervisor is active))

g_page_type_i

3

Instruction page type (G-stage when hypervisor is inactive, 0 when inactive)

g_page_type_d

3

Data page type (G-stage when hypervisor is inactive, 0 when inactive)

tdata1[NTRIGGERS]

XLEN*NTRIGGERS

Sdtrig Trigger Data 1 for each debug trigger

tdata2[NTRIGGERS]

XLEN*NTRIGGERS

Sdtrig Trigger Data 2 for each debug trigger

tdata3[NTRIGGERS]

XLEN*NTRIGGERS

Sdtrig Trigger Data 3 for each debug trigger

tinfo[NTRIGGERS]

XLEN*NTRIGGERS

Sdtrig Trigger Info for each debug trigger

Table 9. Page Types
Code Type

000

kilopage

001

megapage

010

gigapage

011

terapage

100

petapage

other

reserved

Some accesses touch more than one physical page. Examples include misaligned accesses wrapping a page boundary, and some vector accesses. Extended RVVI provides the signals corresponding to the base address of the access. For vector, they correspond to the base address of the initial element access.

NTRIGGERS is a new parameter similar to FLEN defining the number of Sdtrig debug triggers supported by the platform.

7.2. riscvISACOV Signals

Coverpoints are described using the open riscvISACOV framework.

The framework collects data coming across the RVVI interface and presents it with ins.current and ins.prev data structures to allow easy access to the architectural state at the end of the current and previous instructions. For example, ins.current.rs1 is the source register for the current instruction, and ins.current.rd_val is the value written to the destination register by the current instruction.

Most coverpoints use ins.current, to measure architectural state at the end of the instruction. However, some privileged coverpoints need to know the privilege mode or values of CSRs at the start of the instruction and thus use ins.prev.

The available fields are given in framework/src/act/fcov/coverage/RISCV_coverage_rvvi.svh. Most commonly used fields are summarized in Table 10. Other fields include floating-point and vector register IDs and values, MMU extended RVVI signals, vector type information, and pending interrupts. TODO: handling register pairs.

Table 10. riscvISACOV Signals for Coverpoints
Signal Width Description Example

insn

ILEN

Instruction bit pattern

* add x10, x11, x12

inst_name

string

Instruction name

add

disass

string

Disassembled instruction

add x10, x11, x12

trap

1

Instruction trapped rather than retiring

0

mode

2

Privilege mode 11 = machine, 01 = supervisor, 00 = user

11

pc_rdata

XLEN

PC of current instruction

0x80000000

pc_wdata

XLEN

PC of next instruction

0x80000004

rs1

5

Source register 1 ID

11

rs2

5

Source register 2 ID

12

rd

5

Destination register ID

10

rs1_val

XLEN

Source register 1 value

42

rs2_val

XLEN

Source register 2 value

69

rd_val

XLEN

Value written to destination register

111

imm

XLEN

Value of immediate

100

csr

XLEN x 4096

Value of CSRs

  • exact meaning of trap, importance in writing test

RVVI and riscvISACOV support the notion of multiple harts that retire multiple instructions per cycle. The number of instructions retired per cycle is a microarchitectural issue irrelevant to architectural functional verification, so it is set to 1, consistent with simulators that report each instruction retiring individually.

Our riscvISACOV implementation uses a SystemVerilog disassembler in fcov/disassemble.svh, replacing a proprietary disassembler from Imperas. When adding new extensions, update the disassembler accordingly.

7.3. Writing Coverpoints with riscvISACOV

Move this and the remainder to ACT repo

  • example of coverpoint

  • organization of files

7.4. Trace Coverage Flow

Coverage is measured by running tests on the RISC-V Sail model and generating a RVVI-Trace file, then passing this file to an RVVI agent in a SystemVerilog testbench that checks coverage.

The number of coverpoints and the number of tests both grow with the number of extensions, so the runtime to measure coverage can grow quadratically with the number of extensions, and becomes problematic. To avoid this, it is recommended to only enable coverpoints for one extension (or small group of extensions) at a time and to only run tests for that extension, and generate a Unified Coverage Database (UDCB) file and report for that extension. A script will kick off such tests in parallel for all extensions, and merge the coverage reports.

The RISC-V Sail model produces the trace file in a standard RVVI-Trace format (see Section Section 7.5). Any other simulator that implements the same trace format can also be used to cross-check coverage.

  • Jordan add instructions on how to run this

7.5. RVVI-Trace Format

  • Jordan write

  • how to handle instructions that change multiple CSRs, such as a write to mstatus.SIE also affecting sstatus.SIE

8. Reference Model

Certification may rely on a reference model (simulator) to compute the expected results of a test, such as sum of two numbers in an add instruction or the answer for a fsqrt.d instruction. Self-checking tests compare the result from the DUT against the expected result that was precomputed by the reference model and flag mismatches. Alternatively, the test may be generated with a set of one or more expected results for each test case (without a reference model), and the test can check that the DUT produces one of the expected results.

TODO: Discuss one vs. many reference models. RISC-V International has blessed RISC-V Sail as the golden RISC-V model, so RISC-V Sail is used as the reference model.

8.1. Deterministic, Nondeterministic, and Unspecified Behaviors

RISC-V feature behavior can be classified as deterministic, nondeterministic, and unspecified. Deterministic features have a unique expected value for a given configuration, such as the result of sub 1 - 2 on RV32. Nondeterministic features have a fine set of possible outcomes, and might vary unpredictably even on the same DUT. For example, vector tail-agnostic elements can preserve the input value or propagate all 1s, with no guarantee whether the same instruction has the same behavior on all elements or when executed twice in a row. Unspecified features, such as unimplemented instructions, could do anything, from being ignored, to predictably or unpredictably changing architectural state, to halting and catching fire.

All RISC-V simulators, when properly configured to match the behavior of a DUT, should produce the same answers as the DUT and each other for deterministic features. For nondeterministic features, they should produce one of the legal outcomes. For unspecified features, they can do anything.

Self-checking certification tests must check that the result of deterministic features match the reference model. Nondeterministic features must produce one of the finite set of legal outcomes, which must be provided by the test developer because a reference model only produces a single outcome. Unspecified features are not tested because there are no wrong answers.

This is harder than it seems because RISC-V has many features whose behaviors are not fully specified. Many of these features are not yet named, and the set of legal behaviors is not yet enumerated. Unified Database (UDB) is in the process of naming and enumerating all of these features and behaviors to fully describe the behavior of a DUT. Moreover, no simulator yet is fully configurable to match every feature. Some simulators, such as Spike, intentionally have a minimal set of configuration options and are hardwired to particular behaviors.

Nevertheless, the RISC-V Sail model is making rapid progress and is aiming to fully implement the ratified RVA23 profile, read a UDB configuration, and support at least the most reasonable behaviors in time for certification.

8.2. List of Fundamentally Nondeterministic Behaviors

  • Mask- and tail-agnostic vector operations

    • Self-checking tests must accept undisturbed and all 1s in each element

  • Traps on misaligned accesses

    • If mtval is written with a nonzero value, it can be any address within the access***

    • When it also causes access fault / misaligned store, Allen has list of 7ish possible outcomes.

If nondeterministic behaviors are tested, the test must accept all legal outcomes. This is costly, so some nondeterministic behaviors may be untested. Nevertheless, agnostic vector operations will definitely be tested and accept all legal results.

When possible, the behavior should be made deterministic by a parameter such that the reference model can match the DUT with that parameter setting.

8.3. List of Theoretically Nondeterministic Behaviors with Configurable Deterministic Implementations

  • CSR WARL Fields: any legal value could be read, and the value is theoretically nondeterministic and could change from one write to another. UDB will define configurations with a single sensible behavior (such as all 0s), and we may limit certification to DUTs that implement a reasonable configuration.

Appendix A: Unprivileged Test Plan

Unprivileged tests exercise every instruction using every applicable source and destination register, and reasonable architectural edge values of sources. They are intended for certification, not verification. For example, they do not stress interrupts arriving in the midst of multicycle instructions.

The unprivileged test plan is written to be easily reviewed by a human, and to be automatically converted to machine-readable coverpoints and tests. It is defined with spreadsheets in comma-separated value (CSV) format. A testplan may have an ExtraExtensions column. A non-empty entry names one or more extensions, separated by colons, that the row requires in addition to the testplan’s own, such as D in Table 48 or Zfh:D in Table 50. The row’s tests are in the testplan’s test suite directory, but they run only on configurations that also implement those extensions. Its tests and covergroups are named after the testplan followed by the extensions, such as ZfhminD-fcvt.d.h-00.S and ZfhminD_fcvt_d_h_cg, and the covergroups are compiled only when the extensions are supported.

A.1. Unprivileged Tests

Every bin in every coverpoint is associated with a specific test [3]. Unprivileged tests sweep some feature under test (such as the destination register rd) while randomizing all applicable register IDs and source values (including values to be loaded from memory). For example, the unprivileged test for the cp_rd coverpoint of the add instruction contains 32 add instructions, using the 32 different choices of rd. The rs1 and rs2 register numbers and values are selected randomly. Appendix E gives examples of unprivileged coverpoints and tests meeting these requirements and the coverpoints of Table 18 for the add instruction. Each test is self-checking, checking the destination register value against one provided by a reference model. Certain tests also test other state such as stores or floating-point flags, as described in those sections.

The random values are preferably selected in a deterministic way so that regenerating tests use the same random values where possible, minimizing differences between tests. This can be done by seeding the random number generator with a has of the instruction and coverpoint name.

Unprivileged tests are designed to never trap. Their results are independent of the privilege mode in which they are run, so they generally are run only in machine mode. They generally involve no privileged instructions, except that floating-point and vector tests turn on the mstatus.{FS/VS} bits to enable these extensions.

A.2. Unprivileged Coverpoints

The coverpoints in Table 11 are used in most of the unprivileged test plans in subsequent sections.

Table 11. Coverpoint Definitions
Coverpoint Bins Definition

Basic Coverpoints

cp_asm_count

1

Number of times the instruction is executed in the test, must be greater than 0.

cp_rs1

32

The rs1 register number used in the instruction.

cp_rs2

32

The rs2 register number used in the instruction.

cp_rd

32

The rd register number used in the instruction.

cp_rs1_edges

12 (RV32), 18 (RV64)

Edge values for rs1 (see Table 12).

cp_rs2_edges

12 (RV32), 18 (RV64)

Edge values for rs2 (see Table 12).

cp_imm_edges

20

Edge values for 12-bit immediates (see Table 13).

cr_rs1_imm_edges

12*20 (RV32), 18*20 (RV64)

Cross-product of rs1 and 12-bit immediate edges (see Table 13).

cr_rs1_rs2_edges

12*12 (RV32), 18*18 (RV64)

Cross-product of rs1 and rs2 edges, used for instructions with two source registers.

cmp_rs1_rs2

32

The rs1 and rs2 registers have the same register number.

cmp_rd_rs1

32

The rd register has the same register number as the rs1 register.

cmp_rd_rs2

32

The rd register has the same register number as the rs2 register.

cmp_rd_rs1_rs2

32

The rd register has the same register number as both the rs1 and rs2 registers.

cp_offset

2

A branch or jalr instruction has a positive and negative offset.

cp_uimm

XLEN

Exercise all XLEN unsigned immediate values, such as shift amounts.

cp_align

≤ 8

Alignment of naturally-aligned sub-doubleword load/store operand within doubleword

cp_memval

5

Edge values for integer memory values loaded by load instructions.

Coverpoints for Compressed Instructions

cp_rs1_p

8

The rs1 register number used in compressed instructions supporting x8-x15.

cp_rs2_p

8

The rs2 register number used in compressed instructions supporting x8-x15.

cp_rd_p

8

The rd register number used in compressed instructions supporting x8-x15.

cp_fd_p

8

The fd register number used in compressed floating-point instructions supporting f8-f15.

cp_fs2_p

8

The fs2 register number used in compressed floating-point instructions supporting f8-f15.

cp_imm_mul

32

Immediate offset for word-sized compressed loads/stores: multiples of 4 from 0 to 124.

Coverpoints for Floating-Point Instructions

cp_fs1

32

The fs1 register number used in the instruction.

cp_fs2

32

The fs2 register number used in the instruction.

cp_fs3

32

The fs3 register number used in the instruction.

cp_fd

32

The fd register number used in the instruction.

cp_fs1_edges

26

Edge values for fs1 (see Table 14)

cp_fs2_edges

26

Edge values for fs2 (see Table 14)

cp_fs3_edges

26

Edge values for fs3 (see Table 14)

cmp_fd_fs1

32

The fd register has the same register number as the fs1 register.

cmp_fd_fs2

32

The fd register has the same register number as the fs2 register.

cmp_fd_fs3

32

The fd register has the same register number as the fs3 register.

cp_frm

5

The floating-point rounding mode used in the instruction: rne, rdn, rup, rtz, rmm, dyn.

cp_csr_fflags

10

The instruction sets the {NV, DZ, OF, UF, NX} flags in the fflags CSR.

cp_csr_frm

5

Dynamic rounding mode in the frm CSR: rne, rdn, rup, rtz, rmm

cr_fs1_fs2_edges

26*26

Cross product of edges of fs1 and fs2 registers.

cr_fs1_fs3_edges

26*26

Cross product of edges of fs1 and fs3 registers.

cp_fclass

10

All 10 fclass classes.

cp_NaNBox

1

Upper bits of NaN-boxed value are all 1s

cp_fs1_badNB

12

The fs1 register contains an incorrectly-NaN-boxed lower-precision value.

cp_fs2_badNB

12

The fs2 register contains an incorrectly-NaN-boxed lower-precision value.

cp_fs3_badNB

12

The fs3 register contains an incorrectly-NaN-boxed lower-precision value.

cp_fpr_hazard

4

Floating-point register hazard detection: RAW, WAR, WAW, and no hazard. [TODO: this should be dropped when full hazards are implemented]

Miscellaneous Coverpoints

cp_bs

4

Byte select field for 32-bit AES instructions

cp_rnum

11

Round number for AES instructions

Notes:

  • These coverpoints are adapted from the Imperas riscvISACOV functional coverage project.

  • Register number is a 5-bit ID (e.g. x7), while register value is an XLEN-sized number.

  • Most coverpoints typically have 32 bins because they exercise all 32 integer registers.

  • Cross-products exercise all combinations of two or more coverpoints. They can have a large number of bins.

  • Each of these coverpoints can optionally have a modifier appended. For example, cp_rs1_nx0 is a modified version of cp_rs1, covering all 31 rs1 register numbers excluding x0. It is used for load/store/jalr instructions that can’t rely on address 0 specified by x0 being legal. Modifiers are defined in the extensions that they apply to.

  • The cmp_* and cp_*_hazard coverpoints occupy the fuzzy land at the edge of certification and verification. They are included because they are easy.

  • It would be possible to add more floating-point coverpoints such as cmp_fd_fs1_fs2_fs3 but the value is considered low.

  • The riscvISACOV test plan had cmp_rd_{rs1/rs2}_eqval coverpoints that compare if rd and one of the sources have the same value. These are generally hit by the cr_rs1_rs2_edges tests, so they don’t add interesting additional coverage and were dropped. riscvISACOV also had cp_{rs1/rs2/rd}_toggle tests that checked if each bit changed from 1 to 0 and vice versa. This is trivially exercised by providing all 0s followed by all 1s followed by all 0s again, so they were dropped.

Table 12. Integer Edge Case Definitions
Bin RV32 RV64

zero

00000000000000000000000000000000

0000000000000000000000000000000000000000000000000000000000000000

one

00000000000000000000000000000001

0000000000000000000000000000000000000000000000000000000000000001

two

00000000000000000000000000000010

0000000000000000000000000000000000000000000000000000000000000010

min

10000000000000000000000000000000

1000000000000000000000000000000000000000000000000000000000000000

minp1

10000000000000000000000000000001

1000000000000000000000000000000000000000000000000000000000000001

max

01111111111111111111111111111111

0111111111111111111111111111111111111111111111111111111111111111

maxm1

01111111111111111111111111111110

0111111111111111111111111111111111111111111111111111111111111110

ones

11111111111111111111111111111111

1111111111111111111111111111111111111111111111111111111111111111

onesm1

11111111111111111111111111111110

1111111111111111111111111111111111111111111111111111111111111110

walkodd

10101010101010101010101010101010

1010101010101010101010101010101010101010101010101010101010101010

walkeven

01010101010101010101010101010101

0101010101010101010101010101010101010101010101010101010101010101

random

01???????????????????????????010

01???????????????????????????????????????????????????????????010

Wmax

n/a

0000000000000000000000000000000011111111111111111111111111111111

Wmaxm1

n/a

0000000000000000000000000000000011111111111111111111111111111110

Wmaxp1

n/a

0000000000000000000000000000000100000000000000000000000000000000

Wmaxp2

n/a

0000000000000000000000000000000100000000000000000000000000000001

W80

n/a

0000000000000000000000000000000010000000000000000000000000000000

W7F

n/a

0000000000000000000000000000000001111111111111111111111111111111

Table 13. Immediate Edge Case Definitions (12-bit)
Bin 12-bit Signed Value

zero

0

p0

1

p1

2

three

3

p2

4

p3

8

p4

16

p5

32

p6

64

p7

128

p8

256

p9

512

hm1

1023

p10

1024

max

2047

min

-2048

minp1

-2047

onesm1

-2

ones

-1

randomp

1795

Table 14. Floating-Point Edge Case Definitions
Bin Half BF16 Float Double

pos0

0000

0000

00000000

0000000000000000

neg0

8000

8000

80000000

8000000000000000

pos1

3C00

3F80

3F800000

3FF0000000000000

neg1

BC00

BF80

BF800000

BFF0000000000000

pos2p5

4100

4020

40200000

4004000000000000

neg2p5

C100

C020

C0200000

C004000000000000

pos2prec

6800

4380

4B800000

4340000000000000

neg2prec

E800

C380

CB800000

C340000000000000

posminnorm

0400

0080

00800000

0010000000000000

negminnorm

8400

8080

80800000

8010000000000000

posmaxnorm

7BFF

7F7F

7F7FFFFF

7FEFFFFFFFFFFFFF

negmaxnorm

FBFF

FF7F

FF7FFFFF

FFEFFFFFFFFFFFFF

posmax_subnorm

03FF

007F

007FFFFF

000FFFFFFFFFFFFF

negmax_subnorm

83FF

807F

807FFFFF

800FFFFFFFFFFFFF

posmid_subnorm

0200

0040

00400000

0008000000000000

negmid_subnorm

8200

8040

80400000

8008000000000000

posmin_subnorm

0001

0001

00000001

0000000000000001

negmin_subnorm

8001

8001

80000001

8000000000000001

posinfinity

7C00

7F80

7F800000

7FF0000000000000

neginfinity

FC00

FF80

FF800000

FFF0000000000000

posQNaN

7E00-7FFF

7FC0-7FFF

7FC00000-7FFFFFFF

7FF8000000000000-7FFFFFFFFFFFFFFF

posSNaN

7C01-7DFF

7F81-7FBF

7F800001-7FBFFFFF

7FF0000000000001-7FF7FFFFFFFFFFFF

negQNaN

FE00-FFFF

FFC0-FFFF

FFC00000-FFFFFFFF

FFF8000000000000-FFFFFFFFFFFFFFFF

negSNaN

FC01-FDFF

FF81-FFBF

FF800001-FFBFFFFF

FFF0000000000001-FFF7FFFFFFFFFFFF

posrandom

58B4

7EF8

7EF8654F

5A392534A57711AD

negrandom

C93A

813D

813D9AB0

A6E895993737426C

±2.5 and ±2p (p is the format’s precision: 11 for half, 8 for BF16, 24 for float, 53 for double) are exact ties for some operations, so they distinguish RMM from RNE. Converting ±2.5 to an integer is a tie between 2 and 3. Adding ±1.0 to ±2p is a tie between 2p and 2p+2.

The register edge cases are selected to include extreme values and their immediate neighbors. They also include walking 1s and an arbitrary intermediate value. RV64 adds edge cases near the 32-bit boundary to stress W-type instructions. Immediate edge cases exercise each bit of the immediate, extreme values, and one random intermediate value.

A.2.1. Hazards

Hazard tests are applied to every unprivileged Instruction Under Test (IUT) that uses a source or destination. The hazard receives the source from Secondary_Producer_Instruction (SPI) or sends the destination value to a Secondary Consumer Instruction (SCI). All relevant Read-After-Write (RAW), Write-After-Read (WAR), and Write-After-Write (WAW) hazards are exercised. They are tested with the SI being adjacent to the IUT, and being separated by a small amount. The SI is selected as a representative instruction from each of many categories of instructions to exercise forwarding between different functional units.

The categories of SPI and SCI are given in Table 15 and Table 16, respectively.

Table 15. Secondary Producer Instruction Categories
Category ALU Complex Memory Control CSR (Zicsr) Mult (Zmmul/M) Float (F) VectorInt (Zve32x + Zvl64b) VectorFloat (Zve32f+Zvl64b)

Int (rd)

auipc, li

sll, cpop (Zbb), clmul (Zbc), sha256sig0 (Zknh)

lw, amoswap.w (Zaamo)

jal

csrr

mul, div

fcvt.w.s, fmv.x.w, fclass.s, feq.s

vmv.x.s

PC

jal, jalr, beq

FP (fd)

flw

fmadd.s, fdiv.s, fli.s (Zfa), fsqrt.d (D), fsqrt.h (Zfh), fsqrt.q (Q)

vmv.f.s

Vector (vd)

vle32.v

vadd.vi

vfadd.vf

Memory

sw, amoswap.w (Zaamo), cbo.zero (Zicboz)

fsw

vse32.v

CSR (rd)

csrr fflags

csrr vcsr

Table 16. Secondary Consumer Instruction Categories
Category ALU Complex Memory Control CSR (Zicsr) Mult (Zmmul/M) Float (F) VectorInt (Zve32x + Zvl64b) VectorFloat (Zve32f+Zvl64b)

Int

add (rs1/2), addi (rs1)

srl, sh1add (Zba), binv (Zbs), aes32dsmi (Zknd32), aes64dsm (Zknd32)

sw (rs2), amoswap.w (rs2, Zaamo)

beq (rs1/2)

csrw (rs1)

mul (rs1/2), div (rs1/2)

fcvt.s.w (rs1), fmv.w.x (rs1)

vadd.vx (rs1), vmv.v.x (rs1)

PC

auipc (implicit)

jal, jalr (implicit)

FP

fsw (fs2)

fmadd.s (fs1/2/3), fdiv.s (fs1/2), fli.s (fs1), fsqrt.d (fs1, D), fsqrt.h (fs1, Zfh), fsqrt.q (fs1, Q)

vfadd.vf (fs1), vmv.v.f (fs1)

Vector

vse32.v(vs2)

vadd.vv (vs1/2), vadd.vi (vs2), vmacc.vv (vs1/2/vd)

vfadd.vv (vs1/2), vfsqrt.v (vs2), vfmacc.vv (vs1/2/vd)

Memory

lw, amoswap.w (Zaamo)

fsw

vle32.v

CSR

csrw fflags

csrw vcsr

The types of hazards exercised are given in Table 17. Not all IUT have a source or destination, so not all hazard types are exercised for every IUT.

Table 17. Hazard Types
Type IUT First IUT Second

RAW

IUT dest → SCI source

SPI dest → IUT source

WAR

IUT source → SPI dest

SCI source → IUT dest

WAW

IUT dest → SPI dest

SPI dest → IUT dest

When multiple representative instructions are listed, one is randomly selected from the list for each test. Certain categories and certain instructions in a category (amoswap, fli, fsqrt.d/h/q) only may be selected if the relevant extension is present. Different source instructions consume one, two, or three sources. Loads, stores, and atomics always use rs1 as a pointer to a scratch memory location holding a random value. Subword load, store, and atomic IUTs use a random naturally aligned offset in the range [0, 3]. Tests assume mstatus.FS/VS are dirty, if applicable. Loads and atomics have a memory source operand. Stores, atomics, and cbo.zero have a memory destination operand. Vector instructions operate on a vector of 2 32-bit elements. They are omitted if the vector unit does not support this. Note that li is the pseudo-instruction for addi rd, x0, imm12.

The test cases are as follows:

  • If the IUT has {int/pc/fp/vector/memory/CSR} source operand:

    • For each IUT source

      • For each hazard_type in {RAW, WAR}

        • For each supported SPI category that can produce the source category (gated by #ifdef EXT_SUPPORTED)

          • For each delay in (0, random[1,3])

            • Pick random unused registers for IUT source(s) and destination from X1-x31 (-x15 for E), f0-f31, v0-v31. Ok to duplicate source registers.

            • Pick random representative SPI from category, and random unused source registers for SPI.

            • Initialize IUT and SPI sources to random values

            • If hazard_type = RAW // SPI dest → IUT source

              • SPI dest = random IUT source

              • Perform SPI

              • If delay > 0, perform delay dependent instructions

              • Perform IUT

              • SIGUPD IUT dest or otherwise test IUT result

            • If hazard_type = WAR // IUT source → SPI dest

              • SPI dest = random IUT source

              • Perform IUT

              • If delay > 0, perform delay dependent instructions

              • Perform SPI

              • SIGUPD IUT dest or otherwise test IUT result

              • SIGUPD SPI dest

  • If the IUT has {int/pc/fp/vector/memory/CSR} destination operand:

    • For each hazard_type in {RAW, WAR}

      • For each supported SCI category that can read the source category (gated by #ifdef EXT_SUPPORTED)

        • For each delay in (0, random[1,3])

          • Pick random unused registers for IUT source(s) and destination from X1-x15, f0-f31, v0-v31. Ok to duplicate source registers.

          • Pick random representative SCI from category, and random unused source registers for SCI.

          • Initialize IUT and SCI sources to random values

          • If hazard_type = RAW // IUT dest → SCI source

            • random SCI source = IUT dest

            • Perform IUT

            • If delay > 0, perform delay dependent instructions

            • Perform SCI

            • SIGUPD SI dest or otherwise test SI result

          • If hazard_type = WAR // SCI source → IUT dest

            • random SCI source = IUT dest

            • Perform SCI

            • If delay > 0, perform delay dependent instructions

            • Perform IUT

            • SIGUPD IUT dest or otherwise test IUT result

            • SIGUPD SCI dest

    • For hazard_type = WAW

      • For each supported SPI category that can produce the source category (gated by #ifdef EXT_SUPPORTED)

        • For each delay in (0, random[1,3])

          • Pick random unused registers for IUT source(s) and destination from X1-x31 (-x15 for E), f0-f31, v0-v31. Ok to duplicate source registers.

          • Pick random representative SPI from category, and random unused source registers for SPI.

          • Initialize IUT and SPI sources to random values

          • SPI dest = IUT dest

          • Perform SPI // SPI dest → IUT dest

          • If delay > 0, perform delay dependent instructions

          • Perform IUT

          • SIGUPD IUT dest or otherwise test IUT result

          • Perform IUT // IUT dest → SPI dest

          • If delay > 0, perform delay dependent instructions

          • Perform SPI

          • SIGUPD SPI dest or otherwise test SPI result

Hazard coverpoints are named cp_hazard_{hazard_type}_{IUT source/dest}_{to/from}_{SI category}_{delay}. IUT source/dest is one of {rs1, rs2, rd, fs1, fs2, fs3, fd, vs1, vs2, vd, memr, memw, csrr, csrw, pc}.

The number of hazard bins for a typical R-type integer IUT is 2 sources) * (2 hazard types) + (1 destination) * (4 hazard types * (8 categories) * (2 delays) = 128 bins.

A.3. I Base Integer Extension

Table 18 summarizes the coverpoints for the I extension. The Type column is used to generate tests with the appropriate operands. An x in the RV32 or RV64 column indicates that the instruction is supported in that XLEN. The remaining columns refer to coverpoints defined in Table 11. An x in a coverpoint column selects that coverpoint. Any other entry selects a modified coverpoint whose name is the column name followed by an underscore and the entry. For example, nx0 in the cp_rs1 column selects cp_rs1_nx0. Table 19 defines the modified coverpoints.

Table 18. I Instruction Coverpoints
Instruction add addi addiw addw and andi auipc beq bge bgeu blt bltu

RV32

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs1

x

x

x

x

x

x

x

x

x

x

x

cp_rs2

x

x

x

x

x

x

x

x

cp_rd

x

x

x

x

x

x

x

cp_rs1_edges

x

x

x

x

x

x

x

x

x

x

x

cp_rs2_edges

x

x

x

x

x

x

x

x

cr_rs1_imm_edges

x

x

x

cr_rs1_rs2_edges

x

x

x

offset

offset

offset

offset

offset

cmp_rs1_rs2

x

x

x

x

x

x

x

x

cmp_rd_rs1

x

x

x

x

x

x

cmp_rd_rs2

x

x

x

cmp_rd_rs1_rs2

x

x

x

cp_offset

x

x

x

x

x

cp_imm_edges

x

x

x

20bit

branch

branch

branch

branch

branch

Instruction bne fence jal jalr lb lbu ld lh lhu lui lw lwu

RV32

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs1

x

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

cp_rs2

x

cp_rd

x

x

x

x

x

x

x

x

x

x

cp_rs1_edges

x

cp_rs2_edges

x

cr_rs1_rs2_edges

offset

cmp_rs1_rs2

x

cmp_rd_rs1

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

cp_offset

x

x

jalr

cp_imm_edges

branch

jal

x

x

x

x

x

x

20bit

x

x

cp_align

byte

byte

hword

hword

word

word

cp_memval

byte

byte

double

hword

hword

word

word

cp_custom

fence

Instruction nop or ori sb sd sh sll slli slliw sllw slt slti

RV32

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs1

x

x

nx0

nx0

nx0

x

x

x

x

x

x

cp_rs2

x

x

x

x

x

x

x

cp_rd

x

x

x

nx0

nx0

x

nx0

nx0

cp_rs1_edges

x

x

x

x

x

x

x

x

cp_rs2_edges

x

x

x

x

x

x

x

cr_rs1_imm_edges

x

uimm

uimmw

x

cr_rs1_rs2_edges

x

x

x

x

cmp_rs1_rs2

x

x

x

x

cmp_rd_rs1

x

x

x

nx0

nx0

x

nx0

nx0

cmp_rd_rs2

x

x

x

nx0

cmp_rd_rs1_rs2

x

x

x

nx0

cp_uimm

x

5

cp_imm_edges

x

x

x

x

x

cp_align

byte

hword

Instruction sltiu sltu sra srai sraiw sraw srl srli srliw srlw sub subw

RV32

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs1

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs2

x

x

x

x

x

x

x

cp_rd

nx0

nx0

x

nx0

nx0

x

x

nx0

nx0

x

x

x

cp_rs1_edges

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs2_edges

x

x

x

x

x

x

x

cr_rs1_imm_edges

x

uimm

uimmw

uimm

uimmw

cr_rs1_rs2_edges

x

x

x

x

x

x

x

cmp_rs1_rs2

x

x

x

x

x

x

x

cmp_rd_rs1

nx0

nx0

x

nx0

nx0

x

x

nx0

nx0

x

x

x

cmp_rd_rs2

nx0

x

x

x

x

x

x

cmp_rd_rs1_rs2

nx0

x

x

x

x

x

x

cp_uimm

x

5

x

5

cp_imm_edges

x

Instruction sw xor xori

RV32

x

x

x

RV64

x

x

x

cp_asm_count

x

x

x

cp_rs1

nx0

x

x

cp_rs2

x

x

cp_rd

x

x

cp_rs1_edges

x

x

cp_rs2_edges

x

x

cr_rs1_imm_edges

x

cr_rs1_rs2_edges

x

cmp_rs1_rs2

x

cmp_rd_rs1

x

x

cmp_rd_rs2

x

cmp_rd_rs1_rs2

x

cp_imm_edges

x

x

cp_align

word

Table 19. I Modified Coverpoints
Modified Coverpoint Bins Definition

cp_rs1_nx0

31

The rs1 register number, excluding x0. Used by loads, stores, and jalr, whose address would otherwise be the immediate alone, which might not be accessible.

cp_rd_nx0

31

The rd register number, excluding x0. Used by instructions whose rd = x0 encodings are custom HINTs (see below).

cmp_rd_rs1_nx0, cmp_rd_rs2_nx0, cmp_rd_rs1_rs2_nx0

31

cmp_rd_rs1, cmp_rd_rs2, and cmp_rd_rs1_rs2, excluding x0. Used with cp_rs1_nx0 or cp_rd_nx0.

cp_offset_jalr

2 + 4

Expands to two coverpoints for jalr. cp_offset has 2 bins: the target address rs1 + imm is below or above the pc of the jalr. cp_offset_lsbs has 4 bins: every combination of rs1[0] and imm[0], because jalr clears the least-significant bit of rs1 + imm.

cp_imm_edges_branch

8

Branch offsets 4, 8, 16, 2048, 4092, -4, -8, and -4096. These include the most negative offset and the largest positive multiple of 4.

cr_rs1_rs2_edges_offset

12*12*2 (RV32), 18*18*2 (RV64)

Cross-product of rs1 edges, rs2 edges (see Table 12) and branch direction (cp_offset) for branches.

cr_rs1_imm_edges_uimm

5 + 12*5 (RV32), 10 + 18*10 (RV64)

Expands to cp_imm_edges_uimm and its cross-product with cp_rs1_edges, for slli, srli, and srai. cp_imm_edges_uimm has the shift amounts 0, 1, 19, 30, and 31, plus 32, 33, 45, 62, and 63 on RV64.

cr_rs1_imm_edges_uimmw

5 + 18*5

Expands to cp_imm_edges_uimmw and its cross-product with cp_rs1_edges, for slliw, srliw, and sraiw. cp_imm_edges_uimmw has the shift amounts 0, 1, 19, 30, and 31.

cp_uimm_5

32

5-bit unsigned shift amount for slliw, srliw, and sraiw.

cp_imm_edges_20bit

27

20-bit variant of Table 13 for lui and auipc.

cp_imm_edges_jal

24

jal offsets of ±2k for k = 2 to 13 (±4 to ±8192). The J-type offset reaches ±1 MiB, but long jumps take a large amount of program memory, so the bins cover a subset of the range.

cp_align_{byte/hword/word}

8/4/2

Position of a naturally aligned byte, halfword, or word access within a doubleword in memory.

cp_memval_{byte/hword/word/double}

5

The loaded value in the low 8, 16, 32, or 64 bits of rd is 0, 1, the largest positive value, the most negative value, or all ones.

cp_custom_fence_pred_succ

256

Every fence pred and succ set with fm = 0 and rd = rs1 = x0 executes without trapping, including the HINT encodings with pred = 0 or succ = 0.

cp_custom_fence_reserved

9

fence.tso, fm = 1000 with another pred and succ, a reserved fm value, fences with nonzero rd or rs1, and HINTs with pred = 0 or succ = 0 and nonzero rd or rs1 execute without trapping.

Table 20 summarizes the normative rules in the RV{32/64}I specification and the unprivileged coverpoints that check they have been exercised. Privileged coverpoints related to integer instructions are described in the relevant parts of Privileged Test Plan such as Sm and ExceptionsSm. In particular, ebreak and ecall are only tested in the Privileged test plan because their behavior is UNSPECIFIED without an mtvec trap vector CSR. Reserved behaviors are checked in Section B.6. Note that the testplans always test the following fundamental capabilities, even if no normative rule is cited:

  • Opcodes (cp_asm_count)

  • All Source and Destination Registers (cp_rs1, cp_rs2, cp_rd)

  • Edge values (cp_rs1_edges, cp_rs2_edges, cp_imm_edges, cr_rs1_rs2_edges, cr_rs1_imm_edges)

  • All other bitfields in the instruction

Table 20. I Normative Rules
Normative Rule Rule Text Coverpoints

ee_impl_flex

The implementation of a RISC-V execution environment can be pure hardware, pure software, or a combination of hardware and software. For example, opcode traps and software emulation can be used to implement functionality not provided in hardware.

Descriptive spec text with no separately testable behavior

base_integer_variants

There are two primary base integer variants, RV32I and RV64I, described in rv32 and rv64, which provide 32-bit or 64-bit address spaces respectively.

Definition, checked through UDB

xlen_definition

We use the term XLEN to refer to the width of an integer register in bits (either 32 or 64).

Definition, checked through UDB

exception_def

We use the term exception to refer to an unusual condition occurring at run time associated with an instruction in the current RISC-V hart.

Descriptive spec text with no separately testable behavior

interrupt_def

We use the term interrupt to refer to an external asynchronous event that may cause a RISC-V hart to experience an unexpected transfer of control.

Descriptive spec text with no separately testable behavior

trap_def

We use the term trap to refer to the transfer of control to a trap handler caused by either an exception or an interrupt.

Descriptive spec text with no separately testable behavior

rv32i_xreg_sz

For RV32I, the 32 x registers are each 32 bits wide, i.e., XLEN=32.

I_add_cg/{cp_rs1, cp_rs2, cp_rd, cr_rs1_rs2_edges}

rv32i_rv64i_other_xregs

General purpose registers x1&#8205;&#8211;&#8205;x31 hold values that various instructions interpret as a collection of Boolean values, or as two’s complement signed binary integers or unsigned binary integers.

I_add_cg/{cp_rs1, cp_rs2, cp_rd, cr_rs1_rs2_edges}

pcreg_op

There is one additional unprivileged register: the program counter pc holds the address of the current instruction.

I_auipc_cg/{cp_rd, cp_imm_edges_20bit}

slti_sltiu_op

SLTI (set less than immediate) places the value 1 in register rd if register rs1 is less than the sign-extended immediate when both are treated as signed numbers, else 0 is written to rd. SLTIU is similar but compares the values as unsigned numbers (i.e., the immediate is first sign-extended to XLEN bits then treated as an unsigned number).

I_slti_cg/{cp_rs1, cp_rd_nx0, cr_rs1_imm_edges}, I_sltiu_cg/{cp_rs1, cp_rd_nx0, cr_rs1_imm_edges}

x0eq0

Register x0 is hardwired with all bits equal to 0.

I_add_cg/{cp_rs1, cp_rs2, cp_rd, cr_rs1_rs2_edges}

twos_complement_signed_integers

The base integer instruction sets use a two’s-complement representation for signed integer values.

I_slt_cg/cr_rs1_rs2_edges, I_slti_cg/cr_rs1_imm_edges, I_blt_cg/cr_rs1_rs2_edges_offset, I_sra_cg/cr_rs1_rs2_edges

nop_enc

NOP is encoded as ADDI x0, x0, 0.

I_nop_cg/cp_asm_count

nop_op

The NOP instruction does not change any architecturally visible state, except for advancing the pc and incrementing any applicable performance counters.

I_nop_cg/{cp_asm_count}

addi_op

ADDI adds the sign-extended 12-bit immediate to register rs1.

I_addi_cg/{cp_rs1, cp_rd, cr_rs1_imm_edges}

addi_overflow

Arithmetic overflow is ignored and the result is simply the low XLEN bits of the result.

I_addi_cg/cr_rs1_imm_edges. Cases such as all 1s + all 1s overflow.

andi_ori_xori_op

ANDI, ORI, XORI are logical operations that perform bitwise AND, OR, and XOR on register rs1 and the sign-extended 12-bit immediate and place the result in rd.

{I_andi_cg, I_ori_cg, I_xori_cg}/{cp_rs1, cp_rd, cr_rs1_imm_edges}

slli_op

SLLI is a logical left shift (zeros are shifted into the lower bits);

I_slli_cg/{cp_rs1, cp_rd_nx0, cr_rs1_imm_edges_uimm}

srli_op

SRLI is a logical right shift (zeros are shifted into the upper bits);

I_srli_cg/{cp_rs1, cp_rd_nx0, cr_rs1_imm_edges_uimm}

srai_op

SRAI is an arithmetic right shift (the original sign bit is copied into the vacated upper bits).

I_srai_cg/{cp_rs1, cp_rd_nx0, cr_rs1_imm_edges_uimm}

lui_op

LUI places the 32-bit U-immediate value into the destination register rd, filling in the lowest 12 bits with zeros.

I_lui_cg/{cp_rd, cp_imm_edges_20bit}

auipc_op

AUIPC forms a 32-bit offset from the U-immediate, filling in the lowest 12 bits with zeros, adds this offset to the address of the AUIPC instruction, then places the result in register rd.

I_auipc_cg/{cp_rd, cp_imm_edges_20bit}

R-type_operands

All operations read the rs1 and rs2 registers as source operands and write the result into register rd.

I_add_cg/{cp_rs1, cp_rs2, cp_rd, cmp_rd_rs1_rs2}

add_op

ADD performs the addition of rs1 and rs2.

I_add_cg/{cp_rs1, cp_rs2, cp_rd, cr_rs1_rs2_edges}

sub_op

SUB performs the subtraction of rs2 from rs1.

I_sub_cg/{cp_rs1, cp_rs2, cp_rd, cr_rs1_rs2_edges}

add_sub_overflow

Overflows are ignored and the low XLEN bits of results are written to the destination rd.

{I_add_cg, I_sub_cg}/cr_rs1_rs2_edges. Cases such as all 1s + all 1s overflow.

slt_sltu_op

SLT and SLTU perform signed and unsigned compares respectively, writing 1 to rd if rs1 < rs2, 0 otherwise.

I_slt_cg/{cp_rs1, cp_rs2, cp_rd_nx0, cr_rs1_rs2_edges}, I_sltu_cg/{cp_rs1, cp_rs2, cp_rd_nx0, cr_rs1_rs2_edges}

and_or_xor_op

AND, OR, and XOR perform bitwise logical operations.

{I_and_cg, I_or_cg, I_xor_cg}/{cp_rs1, cp_rs2, cp_rd, cr_rs1_rs2_edges}

sll_srl_sra_op

SLL, SRL, and SRA perform logical left, logical right, and arithmetic right shifts on the value in register rs1 by the shift amount held in the lower 5 bits of register rs2.

{I_sll_cg, I_srl_cg, I_sra_cg}/{cp_rs1, cp_rs2, cp_rd, cr_rs1_rs2_edges}

no_cti_delay_slots

Control transfer instructions in RV32I do not have architecturally visible delay slots.

{I_beq_cg, I_jal_cg, I_jalr_cg}/cp_offset

jal_target

The offset is sign-extended and added to the address of the jump instruction to form the jump target address.

I_jal_cg/cp_offset

jal_op

JAL stores the address of the instruction following the jump (pc+4) into register rd.

I_jal_cg/{cp_rd}

jalr_target

The target address is obtained by adding the sign-extended 12-bit I-immediate to the register rs1, then setting the least-significant bit of the result to zero.

I_jalr_cg/{cp_imm_edges, cp_offset_lsbs}

jalr_op

The address of the instruction following the jump (pc+4) is written to register rd.

I_jalr_cg/{cp_rd}

br_target

The 12-bit B-immediate encodes signed offsets in multiples-of-two bytes. The offset is sign-extended and added to the address of the branch instruction to give the target address.

{I_beq_cg, I_bne_cg}/{cp_offset, cp_imm_edges_branch}

beq_bne_op

BEQ and BNE take the branch if registers rs1 and rs2 are equal or unequal respectively.

{I_beq_cg, I_bne_cg}/{cp_rs1, cp_rs2, cr_rs1_rs2_edges_offset}

blt_bltu_op

BLT and BLTU take the branch if rs1 is less than rs2, using signed and unsigned comparison respectively.

{I_blt_cg, I_bltu_cg}/{cp_rs1, cp_rs2, cr_rs1_rs2_edges_offset}

bge_bgeu_op

BGE and BGEU take the branch if rs1 is greater than or equal to rs2, using signed and unsigned comparison respectively.

{I_bge_cg, I_bgeu_cg}/{cp_rs1, cp_rs2, cr_rs1_rs2_edges_offset}

ldst_ea

The effective address is obtained by adding register rs1 to the sign-extended 12-bit offset.

{I_lw_cg, I_sw_cg}/{cp_rs1_nx0, cp_imm_edges}

ldst_no_exc_aligned

loads and stores whose effective addresses are naturally aligned shall not raise an address-misaligned exception.

I_lw_cg/cp_align_word, I_lh_cg/cp_align_hword, I_sw_cg/cp_align_word, I_sh_cg/cp_align_hword

load_op

Loads copy a value from memory to register rd.

I_lw_cg/{cp_memval_word}

store_op

Stores copy the value in register rs2 to memory.

I_sw_cg/{cp_rs2_edges}

lw_op

The LW instruction loads a 32-bit value from memory into rd.

I_lw_cg/{cp_rs1_nx0, cp_rd, cp_imm_edges, cp_memval_word}

lh_op

LH loads a 16-bit value from memory, then sign-extends to 32-bits before storing in rd.

I_lh_cg/{cp_rs1_nx0, cp_rd, cp_imm_edges, cp_memval_hword}

lhu_op

LHU loads a 16-bit value from memory but then zero extends to 32-bits before storing in rd.

I_lhu_cg/{cp_rs1_nx0, cp_rd, cp_imm_edges, cp_memval_hword}

lb_lbu_op

LB and LBU are defined analogously for 8-bit values.

I_lb_cg/{cp_rs1_nx0, cp_rd, cp_imm_edges, cp_memval_byte}, I_lbu_cg/{cp_rs1_nx0, cp_rd, cp_imm_edges, cp_memval_byte}

sw_sh_sb_op

The SW, SH, and SB instructions store 32-bit, 16-bit, and 8-bit values from the low bits of register rs2 to memory.

I_sw_cg/{cp_rs1_nx0, cp_rs2, cp_rs2_edges, cp_imm_edges}, I_sh_cg/{cp_rs1_nx0, cp_rs2, cp_rs2_edges, cp_imm_edges}, I_sb_cg/{cp_rs1_nx0, cp_rs2, cp_rs2_edges, cp_imm_edges}

ldst_atomicity_for_aligned

naturally aligned loads and stores are guaranteed to execute atomically

{I_lw_cg, I_sw_cg}/cp_align_word, Not tested: atomicity is not observable in single-hart signature tests

fence_op

A FENCE (with fm=0000) orders all memory operations in its predecessor set before all memory operations in its successor set.

I_fence_cg/{cp_custom_fence_pred_succ}, ordering not tested

fence-tso_op

FENCE.TSO orders all load operations in its predecessor set before all memory operations in its successor set, and all store operations in its predecessor set before all store operations in its successor set. This leaves non-AMO store operations in the FENCE.TSO’s predecessor set unordered with non-AMO loads in its successor set.

I_fence_cg/{cp_custom_fence_reserved}, ordering not tested

fence_unused_flds_rsv

The unused fields in the FENCE instructions, rs1 and rd, are reserved for finer-grain fences in future extensions. For forward compatibility, base implementations shall ignore these fields

I_fence_cg/{cp_custom_fence_reserved, cp_custom_fence_pred_succ}

hints_enc

Most RV32I HINTs are encoded as integer computational instructions with rd=x0. The other RV32I HINTs are encoded as FENCE instructions with a null predecessor or successor set and with fm=0.

{I_add_cg, I_addi_cg, I_lui_cg}/cp_rd, I_fence_cg/{cp_custom_fence_pred_succ, cp_custom_fence_reserved}

hints_op

HINTs do not change any architecturally visible state, except for advancing the pc and any applicable performance counters. Implementations are always allowed to ignore the encoded hints.

{I_add_cg, I_addi_cg}/cp_rd, I_fence_cg/{cp_custom_fence_pred_succ, cp_custom_fence_reserved}

rvwmo_single_hart_op

Under RVWMO, code running on a single hart appears to execute in order from the perspective of other memory instructions in the same hart, but memory instructions from another hart may observe the memory instructions from the first hart being executed in a different order.

{I_sw_cg, I_sh_cg, I_sb_cg, I_sd_cg}/cp_rs2_edges, Observation by other harts OUT-OF-SCOPE for single hart

rvwmo_single_copy_atomic

All memory operations are single-copy atomic: they can never be observed in a partially complete state.

OUT-OF-SCOPE for single hart

rvwmo_aligned_memop

Each aligned memory instruction that accesses XLEN or fewer bits gives rise to exactly one memory operation, unless specified otherwise.

OUT-OF-SCOPE for single hart

rvwmo_aligned_amo_memop

An aligned AMO gives rise to a single memory operation that is both a load operation and a store operation simultaneously.

OUT-OF-SCOPE for single hart

rvwmo_misaligned_ldst_memops

A misaligned load or store instruction may be decomposed into a set of component memory operations of any granularity.

OUT-OF-SCOPE for single hart

rvwmo_fp_gt_xlen_memops

A floating-point load or store of more than XLEN bits may also be decomposed into a set of component memory operations of any granularity.

OUT-OF-SCOPE for single hart

rvwmo_order_multi_memops

The memory operations generated by such instructions are not ordered with respect to each other in program order, but they are ordered normally with respect to the memory operations generated by preceding and subsequent instructions in program order.

OUT-OF-SCOPE for single hart

rvwmo_misaligned_in_atomic_pma

memory accesses affected by the misaligned atomicity granule PMA that lie within a misaligned atomicity granule are not decomposed.

OUT-OF-SCOPE for single hart

rvwmo_ppo_lead_in

The complete definition of preserved program order is as follows (and note that AMOs are simultaneously both loads and stores): memory operation a precedes memory operation b in preserved program order (and hence also in the global memory order) if a precedes b in program order, a and b both access regular main memory (rather than I/O regions), and any of the following hold:

OUT-OF-SCOPE for single hart

rvwmo_ppo_overlap1

b is a store, and a and b access overlapping memory addresses

TODO: load then store, and store then store, to one address, checking the load returns the old value and the later store’s value persists, Ordering seen by other harts OUT-OF-SCOPE for single hart

rvwmo_ppo_overlap2

a and b are loads, x is a byte read by both a and b, there is no store to x between a and b in program order, and a and b return values for x written by different memory operations

OUT-OF-SCOPE for single hart

rvwmo_ppo_overlap3

a is generated by an AMO or SC instruction, b is a load, and b returns a value written by a

OUT-OF-SCOPE for single hart

rvwmo_ppo_sync1

There is a FENCE instruction that orders a before b

OUT-OF-SCOPE for single hart

rvwmo_ppo_sync2

a has an acquire annotation

OUT-OF-SCOPE for single hart

rvwmo_ppo_sync3

b has a release annotation

OUT-OF-SCOPE for single hart

rvwmo_ppo_sync4

a and b both have RCsc annotations

OUT-OF-SCOPE for single hart

rvwmo_ppo_sync5

a is paired with b

OUT-OF-SCOPE for single hart

rvwmo_ppo_dep1

b has a syntactic address dependency on a

OUT-OF-SCOPE for single hart

rvwmo_ppo_dep2

b has a syntactic data dependency on a

OUT-OF-SCOPE for single hart

rvwmo_ppo_dep3

b is a store, and b has a syntactic control dependency on a

OUT-OF-SCOPE for single hart

rvwmo_ppo_pipe1

b is a load, and there exists some store m between a and b in program order such that m has an address or data dependency on a, and b returns a value written by m

OUT-OF-SCOPE for single hart

rvwmo_ppo_pipe2

b is a store, and there exists some instruction m between a and b in program order such that m has an address dependency on a

OUT-OF-SCOPE for single hart

rvwmo_obeyed

An execution of a RISC-V program obeys the RVWMO memory consistency model only if there exists a global memory order conforming to preserved program order and satisfying the load value axiom, the atomicity axiom, and the progress axiom.

OUT-OF-SCOPE for single hart

rvwmo_ld_val_axiom_lead_in

Each byte of each load i returns the value written to that byte by the store that is the latest in global memory order among the following stores:

{I_sw_cg, I_sh_cg, I_sb_cg, I_sd_cg}/cp_rs2_edges, Stores from other harts OUT-OF-SCOPE for single hart

rvwmo_ld_val_axiom_list

Stores that write that byte and that precede i in the global memory order Stores that write that byte and that precede i in program order

{I_sw_cg, I_sh_cg, I_sb_cg, I_sd_cg}/cp_rs2_edges, Stores from other harts OUT-OF-SCOPE for single hart

rvwmo_atomicity_axiom

If r and w are paired load and store operations generated by aligned LR and SC instructions in a hart h, s is a store to byte x, and r returns a value written by s, then s must precede w in the global memory order, and there can be no store from a hart other than h to byte x following s and preceding w in the global memory order.

OUT-OF-SCOPE for single hart

rvwmo_progress_axiom

No memory operation may be preceded in the global memory order by an infinite sequence of other memory operations.

OUT-OF-SCOPE for single hart

lui_enc

LUI

I_lui_cg/cp_asm_count

auipc_enc

AUIPC

I_auipc_cg/cp_asm_count

jal_enc

JAL

I_jal_cg/cp_asm_count

jalr_enc

JALR

I_jalr_cg/cp_asm_count

beq_enc

BEQ

I_beq_cg/cp_asm_count

bne_enc

BNE

I_bne_cg/cp_asm_count

blt_enc

BLT

I_blt_cg/cp_asm_count

bge_enc

BGE

I_bge_cg/cp_asm_count

bltu_enc

BLTU

I_bltu_cg/cp_asm_count

bgeu_enc

BGEU

I_bgeu_cg/cp_asm_count

lb_enc

LB

I_lb_cg/cp_asm_count

lh_enc

LH

I_lh_cg/cp_asm_count

lw_enc

LW

I_lw_cg/cp_asm_count

lbu_enc

LBU

I_lbu_cg/cp_asm_count

lhu_enc

LHU

I_lhu_cg/cp_asm_count

sb_enc

SB

I_sb_cg/cp_asm_count

sh_enc

SH

I_sh_cg/cp_asm_count

sw_enc

SW

I_sw_cg/cp_asm_count

addi_enc

ADDI

I_addi_cg/cp_asm_count

slti_enc

SLTI

I_slti_cg/cp_asm_count

sltiu_enc

SLTIU

I_sltiu_cg/cp_asm_count

xori_enc

XORI

I_xori_cg/cp_asm_count

ori_enc

ORI

I_ori_cg/cp_asm_count

andi_enc

ANDI

I_andi_cg/cp_asm_count

slli_enc

SLLI

I_slli_cg/cp_asm_count

srli_enc

SRLI

I_srli_cg/cp_asm_count

srai_enc

SRAI

I_srai_cg/cp_asm_count

add_enc

ADD

I_add_cg/cp_asm_count

sub_enc

SUB

I_sub_cg/cp_asm_count

sll_enc

SLL

I_sll_cg/cp_asm_count

slt_enc

SLT

I_slt_cg/cp_asm_count

sltu_enc

SLTU

I_sltu_cg/cp_asm_count

xor_enc

XOR

I_xor_cg/cp_asm_count

srl_enc

SRL

I_srl_cg/cp_asm_count

sra_enc

SRA

I_sra_cg/cp_asm_count

or_enc

OR

I_or_cg/cp_asm_count

and_enc

AND

I_and_cg/cp_asm_count

fence_enc

FENCE

I_fence_cg/cp_asm_count

fence-tso_enc

FENCE.TSO

I_fence_cg/cp_custom_fence_reserved

ecall_enc

ECALL

ExceptionsSm_cg/cp_ecall_m

ebreak_enc

EBREAK

ExceptionsSm_cg/cp_breakpoint

rv64i_xreg_sz

RV64I widens the integer registers and supported user address space to 64 bits, i.e., XLEN=64.

I_addw_cg/{cp_rs1, cp_rs2, cp_rd, cr_rs1_rs2_edges}

addiw_op

ADDIW is an RV64I instruction that adds the sign-extended 12-bit immediate to register rs1 and produces the proper sign extension of a 32-bit result in rd.

I_addiw_cg/{cp_rs1, cp_rd, cr_rs1_imm_edges}

addiw_overflow

Overflows are ignored and the result is the low 32 bits of the result sign-extended to 64 bits.

I_addiw_cg/cr_rs1_imm_edges

addw_subw_op

ADDW and SUBW are RV64I-only instructions that are defined analogously to ADD and SUB but operate on 32-bit values and produce signed 32-bit results.

{I_addw_cg, I_subw_cg}/{cp_rs1, cp_rs2, cp_rd, cr_rs1_rs2_edges}

addw_subw_overflow

Overflows are ignored, and the low 32-bits of the result is sign-extended to 64-bits and written to the destination register.

{I_addw_cg, I_subw_cg}/cr_rs1_rs2_edges

auipc_op_rv64i

AUIPC forms a 32-bit offset from the U-immediate, filling in the lowest 12 bits with zeros, sign-extends the result to 64 bits, adds it to the address of the AUIPC instruction, then places the result in register rd.

I_auipc_cg/{cp_rd, cp_imm_edges_20bit}

ld_op_rv64i

The LD instruction loads a 64-bit value from memory into register rd for RV64I.

I_ld_cg/{cp_rs1_nx0, cp_rd, cp_imm_edges, cp_memval_double}

lw_op_rv64i

The LW instruction loads a 32-bit value from memory and sign-extends this to 64 bits before storing it in register rd for RV64I.

I_lw_cg/cp_memval_word

lh_lhu_lb_lbu_op_rv64i

LH and LHU are defined analogously for 16-bit values, as are LB and LBU for 8-bit values.

I_lb_cg/cp_memval_byte, I_lbu_cg/cp_memval_byte, I_lh_cg/cp_memval_hword, I_lhu_cg/cp_memval_hword

lui_op_rv64i

LUI places the 32-bit U-immediate into register rd, filling in the lowest 12 bits with zeros. The 32-bit result is sign-extended to 64 bits.

I_lui_cg/cp_imm_edges_20bit

lwu_op

The LWU instruction, on the other hand, zero-extends the 32-bit value from memory for RV64I.

I_lwu_cg/cp_memval_word

rv64_w_sex

These *W instructions ignore the upper 32 bits of their inputs and always produce 32-bit signed values, sign-extending them to 64 bits, i.e. bits XLEN-1 through 31 are equal.

{I_addw_cg, I_sraw_cg}/cr_rs1_rs2_edges, I_addiw_cg/cr_rs1_imm_edges, I_sraiw_cg/cr_rs1_imm_edges_uimmw

sd_sw_sh_sb_op_rv64i

The SD, SW, SH, and SB instructions store 64-bit, 32-bit, 16-bit, and 8-bit values from the low bits of register rs2 to memory respectively.

I_sb_cg/cp_rs2_edges, I_sd_cg/cp_rs2_edges, I_sh_cg/cp_rs2_edges, I_sw_cg/cp_rs2_edges

sll_srl_sra_shamt_rv64i

In RV64I, only the low 6 bits of rs2 are considered for the shift amount.

I_sll_cg/cr_rs1_rs2_edges, I_sra_cg/cr_rs1_rs2_edges, I_srl_cg/cr_rs1_rs2_edges

slliw_srliw_sraiw_imm5_rsv

SLLIW, SRLIW, and SRAIW encodings with imm[5]≠0 are reserved.

I_slliw_cg/cp_uimm_5, See also Ssstrict in Section B.6, I_sraiw_cg/cp_uimm_5, See also Ssstrict in Section B.6, I_srliw_cg/cp_uimm_5, See also Ssstrict in Section B.6

slliw_srliw_sraiw_op

SLLIW, SRLIW, and SRAIW are RV64I-only instructions that are analogously defined but operate on 32-bit values and sign-extend their 32-bit results to 64 bits.

I_slliw_cg/{cp_rs1, cp_rd_nx0, cp_uimm_5, cr_rs1_imm_edges_uimmw}, I_sraiw_cg/{cp_rs1, cp_rd_nx0, cp_uimm_5, cr_rs1_imm_edges_uimmw}, I_srliw_cg/{cp_rs1, cp_rd_nx0, cp_uimm_5, cr_rs1_imm_edges_uimmw}

sllw_srlw_sraw_op

SLLW, SRLW, and SRAW are RV64I-only instructions that are analogously defined but operate on 32-bit values and sign-extend their 32-bit results to 64 bits. The shift amount is given by rs2[4:0].

I_sllw_cg/{cp_rs1, cp_rs2, cp_rd, cr_rs1_rs2_edges}, I_sraw_cg/{cp_rs1, cp_rs2, cp_rd, cr_rs1_rs2_edges}, I_srlw_cg/{cp_rs1, cp_rs2, cp_rd, cr_rs1_rs2_edges}

lwu_enc

LWU

I_lwu_cg/cp_asm_count

ld_enc

LD

I_ld_cg/cp_asm_count

sd_enc

SD

I_sd_cg/cp_asm_count

addiw_enc

ADDIW

I_addiw_cg/cp_asm_count

slliw_enc

SLLIW

I_slliw_cg/cp_asm_count

srliw_enc

SRLIW

I_srliw_cg/cp_asm_count

sraiw_enc

SRAIW

I_sraiw_cg/cp_asm_count

addw_enc

ADDW

I_addw_cg/cp_asm_count

subw_enc

SUBW

I_subw_cg/cp_asm_count

sllw_enc

SLLW

I_sllw_cg/cp_asm_count

srlw_enc

SRLW

I_srlw_cg/cp_asm_count

sraw_enc

SRAW

I_sraw_cg/cp_asm_count

UDB Parameters: None.

HINTs are covered as follows:

  • Standard HINTs encoded as integer computational instructions with rd = x0 are executed by the x0 bin of cp_rd. These instructions are lui, auipc, addi, andi, ori, xori, add, sub, and, or, xor, sll, srl, and sra, plus addiw, addw, subw, sllw, srlw, and sraw on RV64.

  • fence HINTs are covered by cp_custom_fence_pred_succ and cp_custom_fence_reserved.

  • Ratified HINTs such as Zihintpause and Zihintntl are covered in Section A.10.

  • The semihosting markers slli x0, x0, 31 and srai x0, x0, 7 are standard HINTs, but they are not tested.

  • Custom HINTs are not tested. They are the other rd = x0 encodings of slti, sltiu, slli, srli, srai, slt, and sltu, plus slliw, srliw, and sraiw on RV64. These instructions use cp_rd_nx0 and the cmp_*_nx0 coverpoints, so their tests never write x0.

A.4. M Extension for Integer Multiplication and Division

Table 21 summarizes the coverpoints for the M extension. Table 22 summarizes the relevant normative rules.

Table 21. M Instruction Coverpoints
Instruction div divu divuw divw mul mulh mulhsu mulhu mulw rem remu remuw

RV32

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs1

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs2

x

x

x

x

x

x

x

x

x

x

x

x

cp_rd

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs1_edges

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs2_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_rs1_rs2_edges

x

x

x

x

x

x

x

x

x

x

x

x

cmp_rs1_rs2

x

x

x

x

x

x

x

x

x

x

x

x

cmp_rd_rs1

x

x

x

x

x

x

x

x

x

x

x

x

cmp_rd_rs2

x

x

x

x

x

x

x

x

x

x

x

x

cmp_rd_rs1_rs2

x

x

x

x

x

x

x

x

x

x

x

x

Instruction remw

RV64

x

cp_asm_count

x

cp_rs1

x

cp_rs2

x

cp_rd

x

cp_rs1_edges

x

cp_rs2_edges

x

cr_rs1_rs2_edges

x

cmp_rs1_rs2

x

cmp_rd_rs1

x

cmp_rd_rs2

x

cmp_rd_rs1_rs2

x

Table 22. M Normative Rules
Normative Rule Rule Text Coverpoints

mul_op

MUL performs an XLEN-bit×XLEN-bit multiplication of rs1 by rs2 and places the lower XLEN bits in the destination register.

M_mul_cg/{cp_rs1, cp_rs2, cp_rd, cr_rs1_rs2_edges}

mulh_mulhu_mulhsu_op

MULH, MULHU, and MULHSU perform the same multiplication but return the upper XLEN bits of the full 2×XLEN-bit product, for signed×signed, unsigned×unsigned, and rs1×unsigned rs2 multiplication.

{M_mulh_cg, M_mulhu_cg, M_mulhsu_cg}/{cp_rs1, cp_rs2, cp_rd, cr_rs1_rs2_edges}

div_divu_op

DIV and DIVU perform an XLEN bits by XLEN bits signed and unsigned integer division of rs1 by rs2, rounding towards zero.

{M_div_cg, M_divu_cg}/{cp_rs1, cp_rs2, cp_rd, cr_rs1_rs2_edges}

divw_divuw_op

DIVW and DIVUW are RV64 instructions that divide the lower 32 bits of rs1 by the lower 32 bits of rs2, treating them as signed and unsigned integers, placing the 32-bit quotient in rd, sign-extended to 64 bits.

{M_divw_cg, M_divuw_cg}/{cp_rs1, cp_rs2, cp_rd, cr_rs1_rs2_edges}

rem_remu_op

REM and REMU provide the remainder of the corresponding division operation.

{M_rem_cg, M_remu_cg}/{cp_rs1, cp_rs2, cp_rd, cr_rs1_rs2_edges}

remw_remuw_op

REMW and REMUW are RV64 instructions that provide the corresponding signed and unsigned remainder operations.

{M_remw_cg, M_remuw_cg}/{cp_rs1, cp_rs2, cp_rd, cr_rs1_rs2_edges}

div_by_zero

The quotient of division by zero has all bits set

{M_div_cg, M_divu_cg, M_divw_cg, M_divuw_cg}/{cr_rs1_rs2_edges}

rem_by_zero

the remainder of division by zero equals the dividend.

{M_rem_cg, M_remu_cg, M_remw_cg, M_remuw_cg}/{cr_rs1_rs2_edges}

signed_div_overflow

Signed division overflow occurs only when the most-negative integer is divided by −1. The quotient of a signed division with overflow is equal to the dividend, and the remainder is zero.

{M_div_cg, M_rem_cg, M_divw_cg, M_remw_cg}/{cr_rs1_rs2_edges}

rem_result_sign

For REM, the sign of a nonzero result equals the sign of the dividend.

{M_rem_cg, M_remw_cg}/{cr_rs1_rs2_edges}

remw_remuw_result_sign

Both REMW and REMUW always sign-extend the 32-bit result to 64 bits, including on a divide by zero.

{M_remw_cg, M_remuw_cg}/{cr_rs1_rs2_edges}

mulw_op

MULW is an RV64 instruction that multiplies the lower 32 bits of the source registers, placing the sign extension of the lower 32 bits of the result into the destination register.

M_mulw_cg/{cp_rs1, cp_rs2, cp_rd, cr_rs1_rs2_edges}

mul_enc

MUL

M_mul_cg/cp_asm_count

mulh_enc

MULH

M_mulh_cg/cp_asm_count

mulhsu_enc

MULHSU

M_mulhsu_cg/cp_asm_count

mulhu_enc

MULHU

M_mulhu_cg/cp_asm_count

div_enc

DIV

M_div_cg/cp_asm_count

divu_enc

DIVU

M_divu_cg/cp_asm_count

rem_enc

REM

M_rem_cg/cp_asm_count

remu_enc

REMU

M_remu_cg/cp_asm_count

mulw_enc

MULW

M_mulw_cg/cp_asm_count

divw_enc

DIVW

M_divw_cg/cp_asm_count

divuw_enc

DIVUW

M_divuw_cg/cp_asm_count

remw_enc

REMW

M_remw_cg/cp_asm_count

remuw_enc

REMUW

M_remuw_cg/cp_asm_count

UDB Parameters: None.

A.4.1. Zmmul

The Zmmul extension is a subset of the M extension that includes only the multiply instructions. The coverpoints are listed in Table 23. If a configuration supports M, it implicitly also supports Zmmul, and thus these multiply instructions are tested twice. The runtime is negligible so multiplication is left in M to avoid confusion.

Table 23. Zmmul Instruction Coverpoints
Instruction mul mulh mulhsu mulhu mulw

RV32

x

x

x

x

RV64

x

x

x

x

x

cp_asm_count

x

x

x

x

x

cp_rs1

x

x

x

x

x

cp_rs2

x

x

x

x

x

cp_rd

x

x

x

x

x

cp_rs1_edges

x

x

x

x

x

cp_rs2_edges

x

x

x

x

x

cr_rs1_rs2_edges

x

x

x

x

x

cmp_rs1_rs2

x

x

x

x

x

cmp_rd_rs1

x

x

x

x

x

cmp_rd_rs2

x

x

x

x

x

cmp_rd_rs1_rs2

x

x

x

x

x

Table 24. Zmmul Normative Rules
Normative Rule Rule Text Coverpoints

Zmmul_insns

The Zmmul extension implements the multiplication subset of the M extension. It adds the following instructions defined in extm: MUL, MULH, MULHU, MULHSU, and (for RV64 only) MULW. The encodings and semantics are identical to those of the corresponding instructions in M. M implies Zmmul.

{Zmmul_mul_cg, Zmmul_mulh_cg, Zmmul_mulhu_cg, Zmmul_mulhsu_cg}/cp_asm_count

Zmmul_enc_same

The encodings and semantics are identical to those of the corresponding instructions in M.

{Zmmul_mul_cg, Zmmul_mulh_cg, Zmmul_mulhu_cg, Zmmul_mulhsu_cg}/cr_rs1_rs2_edges

M_implies_Zmmul

M implies Zmmul.

Definition, checked through UDB

mul_op

MUL performs an XLEN-bit×XLEN-bit multiplication of rs1 by rs2 and places the lower XLEN bits in the destination register.

Zmmul_mul_cg/{cp_rs1, cp_rs2, cp_rd, cr_rs1_rs2_edges}

mulh_mulhu_mulhsu_op

MULH, MULHU, and MULHSU perform the same multiplication but return the upper XLEN bits of the full 2×XLEN-bit product, for signed×signed, unsigned×unsigned, and rs1×unsigned rs2 multiplication.

{Zmmul_mulh_cg, Zmmul_mulhu_cg, Zmmul_mulhsu_cg}/cr_rs1_rs2_edges

mulw_op

MULW is an RV64 instruction that multiplies the lower 32 bits of the source registers, placing the sign extension of the lower 32 bits of the result into the destination register.

Zmmul_mulw_cg/{cp_rs1, cp_rs2, cp_rd, cr_rs1_rs2_edges}

UDB Parameters: None.

A.5. C Compressed Extension

The C extension is subdivided into Zca, Zcf, and Zcd. All configurations supporting C contain Zca. RV32CF configurations also contain Zcf, and RV{32/64}CD configurations also contain Zcd. A configuration supporting C should test all of the applicable Zc* extensions.

Compressed-instruction behavior that traps (reserved encodings, illegal instructions, misaligned and faulting loads and stores) is covered by the ExceptionsZc (Table 185) and SsstrictS (Table 231) test plans. Table 186 summarizes the normative rules for compressed-instruction exceptions.

A.5.1. Zca Compressed Extension

Table 25 summarizes the coverpoints for the Zca extension. These include the standard compressed HINTs in the cp_c_hint_* family. Note that some of these HINTs (c.add x0, x2-x5) are also Zihintntl HINTs. The c.slli, c.srli, and c.srai HINT encodings (shamt = 0, and c.slli with rd = x0) are designated for custom use, so they are deliberately not tested.

Table 25. Zca Instruction Coverpoints
Instruction c.add c.addi c.addi16sp c.addi4spn c.addiw c.addw c.and c.andi c.beqz c.bnez c.j c.jal

RV32

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs1

nx0

nx0

nx0

p

p

p

p

p

cp_rs2

nx0

p

p

cp_rd

p

cp_rs1_edges

x

x

x

x

x

x

x

x

cp_rs2_edges

x

x

x

cr_rs1_imm_edges

6bit_n0

6bit

6bit

cr_rs1_rs2_edges

x

x

x

cmp_rs1_rs2

nx0

c

c

cp_offset

x

x

x

x

cp_imm_edges

c_branch

c_branch

c_jal

c_jal

cp_imm_mul

addi16sp

addi4spn

cp_c_hint

add

addi

Instruction c.jalr c.jr c.ld c.ldsp c.li c.lui c.lw c.lwsp c.mv c.nop c.or c.sd

RV32

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

nop

x

x

cp_rs1

nx0

nx0

p

nx0

nx2

p

p

p

cp_rs2

nx0

p

p

cp_rd

p

nx0

p

nx0

nx0

cp_rs1_edges

x

cp_rs2_edges

x

x

x

cr_rs1_rs2_edges

x

cmp_rs1_rs2

nx0

c

cmp_rd_rs1

c

c

cp_offset

c_jr

c_jr

cp_imm_edges

6bit

6bit_n0

cp_imm_mul

8

8sp

x

4sp

8

cp_c_hint

li

lui

mv

nop

cp_memval

double

double

word

word

Instruction c.sdsp c.slli c.srai c.srli c.sub c.subw c.sw c.swsp c.xor

RV32

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

cp_rs1

nx0

p

p

p

p

p

p

cp_rs2

x

p

p

p

x

p

cp_rs1_edges

x

x

x

x

x

x

cp_rs2_edges

x

x

x

x

x

x

cr_rs1_imm_edges

c

c

c

cr_rs1_rs2_edges

x

x

x

cmp_rs1_rs2

c

c

c

cp_uimm

n0

n0

n0

cp_imm_mul

8sp

x

4sp

Modified coverpoints for Zc* are summarized in Table 26. As defined in Table 11, the p versions of coverpoints work on registers x8-x15.

Table 26. Zc Modified Coverpoints
Modified Coverpoint Bins Definition

cp_asm_count_nop

1

Number of times the canonical c.nop form is executed in the test with imm == 0, must be greater than 0.

cp_rs1_nx2

30

rs1 (the destination of c.lui) excluding x0 (a HINT) and x2 (c.addi16sp)

cp_uimm_n0

31 (RV32), 63 (RV64)

Nonzero 5- or 6-bit shift amounts 1 to XLEN-1

cp_imm_edges_6bit

13

Signed 6-bit immediates 0, 1, 2, 3, 4, 8, 16, 30, 31, -32, -31, -2, -1

cp_imm_edges_6bit_n0

12

cp_imm_edges_6bit excluding 0

cp_imm_edges_c

11 (RV32), 16 (RV64)

Unsigned 5- or 6-bit shift amounts 1, 2, 3, 4, 8, 14, 15, 16, 17, 30, 31. XLEN=64 adds 32, 33, 48, 62, 63

cr_rs1_imm_edges_6bit

12*13 (RV32), 18*13 (RV64)

rs1 edges x cp_imm_edges_6bit

cr_rs1_imm_edges_6bit_n0

12*12 (RV32), 18*12 (RV64)

rs1 edges x cp_imm_edges_6bit_n0

cr_rs1_imm_edges_c

12*11 (RV32), 18*16 (RV64)

rs1 edges x cp_imm_edges_c

cp_imm_edges_c_jal

21

Selected signed multiples of 2 from -2048 to 1024

cp_imm_edges_c_branch

15

Branch offsets for c.beqz and c.bnez: +2 to +128 setting each of offset[7:1] alone, and -2 to -256 in powers of 2

cmp_rs1_rs2_c

8

Same register x8-x15 for both rs1 and rs2 (and hence rd)

cmp_rd_rs1_c

8

Same register x8-x15 for both rd and rs1 (the base address of a compressed load)

cp_imm_mul

32

Multiples of 4 from 0 to 124

cp_imm_mul_4sp

64

Multiples of 4 from 0 to 252

cp_imm_mul_8

32

Multiples of 8 from 0 to 248

cp_imm_mul_8sp

64

Multiples of 8 from 0 to 504

cp_imm_mul_addi16sp

63

Nonzero multiples of 16 from -512 to 496

cp_imm_mul_addi4spn

255

Multiples of 4 from 4 to 1020

cp_offset_lsbs

4

rs1_val[1:0] of the c.jr/c.jalr jump target (used with cp_offset)

cp_uimm_2

4

Zcb byte offsets 0-3 for c.lbu and c.sb. The memory holds a distinct byte at each offset.

cp_uimm_2h

2

Zcb halfword offsets 0 and 2 for c.lh, c.lhu, and c.sh. The memory holds a distinct halfword at each offset.

cp_c_hint_{nop,addi,li,lui,mv,add}

63+31+64+63+31+31

Compressed standard HINTs c.nop (imm != 0), c.addi (imm = 0), c.li (rd = x0), c.lui (rd = x0), c.mv (rd = x0), c.add (rd = x0)

Table 27. Zca Normative Rules
Normative Rule Rule Text Coverpoints

C_dep_Zca

The C extension depends upon the Zca extension.

Definition, checked through UDB

Zca_offsets_mul2

As with base RVI instructions, the offsets of all Zca control transfer instructions are in multiples of 2 bytes.

Zca_c_j_cg/{cp_imm_edges_c_jal}, Zca_c_beqz_cg/{cp_imm_edges_c_branch}

Zca_regs8

CIW, CL, CS, CA, and CB are limited to just 8 of them. registers lists these popular registers, which correspond to registers x8 to x15.

Zca_c_and_cg/{cp_rs1_p, cp_rs2_p}

c-add_op

C.ADD adds the values in registers rd and rs2 and writes the result to register rd. It expands into ADD rd, rd, rs2.

Zca_c_add_cg/{cp_rs1_nx0, cp_rs2_nx0, cr_rs1_rs2_edges}

c-add_val

C.ADD is only valid when rs2≠x0; the code points with rs2=x0 correspond to the C.JALR and C.EBREAK instructions.

Zca_c_add_cg/{cp_rs1_nx0, cp_rs2_nx0}

c-addi16sp_op

C.ADDI16SP (add immediate to stack pointer) shares the opcode with C.LUI, but has a destination field of x2. C.ADDI16SP adds the non-zero sign-extended 6-bit immediate to the value in the stack pointer (sp=x2), where the immediate is scaled to represent multiples of 16 in the range [-512, 496]. C.ADDI16SP is used to adjust the stack pointer in procedure prologues and epilogues. It expands into ADDI x2, x2, nzimm[9:4].

Zca_c_addi16sp_cg/{cp_imm_mul_addi16sp}

c-addi4spn_op

C.ADDI4SPN (add immediate to stack pointer, non-destructive) is a CIW-format instruction that adds a zero-extended non-zero immediate, scaled by 4, to the stack pointer, x2, and writes the result to rd′. This instruction is used to generate pointers to stack-allocated variables, and expands to ADDI rd′, x2, nzuimm[9:2].

Zca_c_addi4spn_cg/{cp_imm_mul_addi4spn}

c-addi_nop

The code points with rd=x0 encode the C.NOP instruction, of which the code points with imm≠0 are HINTs.

Zca_c_nop_cg/{cp_asm_count_nop, cp_c_hint_nop}

c-addi_op

C.ADDI adds the non-zero sign-extended 6-bit immediate to the value in register rd then writes the result to rd. It expands into ADDI rd, rd, imm.

Zca_c_addi_cg/{cp_rs1_nx0, cr_rs1_imm_edges_6bit_n0}

c-addiw_op

C.ADDIW is an XLEN=64-only instruction that performs the same computation but produces a 32-bit result, then sign-extends result to 64 bits. It expands into ADDIW rd, rd, imm. The immediate can be zero for C.ADDIW, where this corresponds to SEXT.W rd.

Zca_c_addiw_cg/{cp_rs1_nx0, cr_rs1_imm_edges_6bit}

c-addw_op

C.ADDW is an XLEN=64-only instruction that adds the values in registers rd′ and rs2′, then sign-extends the lower 32 bits of the sum before writing the result to register rd′. It expands into ADDW rd′, rd′, rs2′.

Zca_c_addw_cg/{cp_rs1_p, cp_rs2_p, cr_rs1_rs2_edges}

c-and_op

C.AND computes the bitwise AND of the values in registers rd′ and rs2′, then writes the result to register rd′. It expands into AND rd′, rd′, rs2′.

Zca_c_and_cg/{cp_rs1_p, cp_rs2_p, cr_rs1_rs2_edges}

c-andi_op

C.ANDI is a CB-format instruction that computes the bitwise AND of the value in register rd′ and the sign-extended 6-bit immediate, then writes the result to rd′. It expands to ANDI rd′, rd′, imm.

Zca_c_andi_cg/{cp_rs1_p, cr_rs1_imm_edges_6bit}

c-beqz_op

C.BEQZ performs conditional control transfers. The offset is sign-extended and added to the pc to form the branch target address. It can therefore target a ±256 B range. C.BEQZ takes the branch if the value in register rs1′ is zero. It expands to BEQ rs1′, x0, offset`.

Zca_c_beqz_cg/{cp_rs1_p, cp_rs1_edges, cp_offset, cp_imm_edges_c_branch}

c-bnez_op

C.BNEZ is defined analogously, but it takes the branch if rs1′ contains a nonzero value. It expands to BNE rs1′, x0, offset`.

Zca_c_bnez_cg/{cp_rs1_p, cp_rs1_edges, cp_offset, cp_imm_edges_c_branch}

c-j_op

C.J performs an unconditional control transfer. The offset is sign-extended and added to the pc to form the jump target address. C.J can therefore target a ±2 KiB range. It expands to JAL x0, offset.

Zca_c_j_cg/{cp_imm_edges_c_jal}

c-jal_op

C.JAL is an XLEN=32-only instruction that performs the same operation as C.J, but additionally writes the address of the instruction following the jump (pc+2) to the link register, x1. It expands to JAL x1, offset.

Zca_c_jal_cg/{cp_imm_edges_c_jal}

c-jalr_op

C.JALR (jump and link register) performs the same operation as C.JR, but additionally writes the address of the instruction following the jump (pc+2) to the link register, x1. It expands to JALR x1, 0(rs1).

Zca_c_jalr_cg/{cp_rs1_nx0, cp_offset_lsbs}

c-jr_op

C.JR (jump register) performs an unconditional control transfer to the address in register rs1. It expands to JALR x0, 0(rs1).

Zca_c_jr_cg/{cp_rs1_nx0, cp_offset_lsbs}

c-ld_op

C.LD is an XLEN=64-only instruction that loads a 64-bit value from memory into register rd′. It computes an effective address by adding the zero-extended offset, scaled by 8, to the base address in register rs1′. It expands to LD rd′, offset(rs1′).

Zca_c_ld_cg/{cp_rs1_p, cp_rd_p, cp_imm_mul_8, cp_memval_double}

c-ldsp_op

C.LDSP is an XLEN=64-only instruction that loads a 64-bit value from memory into register rd. It computes its effective address by adding the zero-extended offset, scaled by 8, to the stack pointer, x2. It expands to LD rd, offset(x2).

Zca_c_ldsp_cg/{cp_rd_nx0, cp_imm_mul_8sp, cp_memval_double}

c-li_op

C.LI loads the sign-extended 6-bit immediate, imm, into register rd. It expands into ADDI rd, x0, imm.

Zca_c_li_cg/{cp_rs1_nx0, cp_imm_edges_6bit}

c-lui_op

C.LUI loads the non-zero 6-bit immediate field into bits 17–12 of the destination register, clears the bottom 12 bits, and sign-extends bit 17 into all higher bits of the destination. It expands into LUI rd, imm.

Zca_c_lui_cg/{cp_rs1_nx2, cp_imm_edges_6bit_n0}

c-lw_op

C.LW loads a 32-bit value from memory into register rd′. It computes an effective address by adding the zero-extended offset, scaled by 4, to the base address in register rs1′. It expands to LW rd′, offset(rs1′).

Zca_c_lw_cg/{cp_rs1_p, cp_rd_p, cp_imm_mul, cp_memval_word}

c-lwsp_op

C.LWSP loads a 32-bit value from memory into register rd. It computes an effective address by adding the zero-extended offset, scaled by 4, to the stack pointer, x2. It expands to LW rd, offset(x2).

Zca_c_lwsp_cg/{cp_rd_nx0, cp_imm_mul_4sp, cp_memval_word}

c-mv_jr

C.MV is valid only when rs2≠x0; the code points with rs2=x0 correspond to the C.JR instruction.

Zca_c_jr_cg/{cp_rs1_nx0, cp_offset_lsbs}

c-mv_op

C.MV copies the value in register rs2 into register rd. It expands into ADD rd, x0, rs2.

Zca_c_mv_cg/{cp_rd_nx0, cp_rs2_nx0}

c-nop_op

C.NOP is a CI-format instruction that does not change any user-visible state, except for advancing the pc and incrementing any applicable performance counters. C.NOP expands to NOP.

Zca_c_nop_cg/{cp_asm_count_nop}

c-or_op

C.OR computes the bitwise OR of the values in registers rd′ and rs2′, then writes the result to register rd′. It expands into OR rd′, rd′, rs2′.

Zca_c_or_cg/{cp_rs1_p, cp_rs2_p, cr_rs1_rs2_edges}

c-sd_op

C.SD is an XLEN=64-only instruction that stores a 64-bit value in register rs2′ to memory. It computes an effective address by adding the zero-extended offset, scaled by 8, to the base address in register rs1′. It expands to SD rs2′, offset(rs1′).

Zca_c_sd_cg/{cp_rs1_p, cp_rs2_p, cp_rs2_edges, cp_imm_mul_8}

c-sdsp_op

C.SDSP is an XLEN=64-only instruction that stores a 64-bit value in register rs2 to memory. It computes an effective address by adding the zero-extended offset, scaled by 8, to the stack pointer, x2. It expands to SD rs2, offset(x2).

Zca_c_sdsp_cg/{cp_rs2, cp_rs2_edges, cp_imm_mul_8sp}

c-slli_op

C.SLLI is a CI-format instruction that performs a logical left shift of the value in register rd then writes the result to rd. The shift amount is encoded in the shamt field. It expands into SLLI rd, rd, shamt[5:0].

Zca_c_slli_cg/{cp_rs1_nx0, cr_rs1_imm_edges_c}

c-slli_shamt5

For XLEN=32, shamt[5] must be zero; the code points with shamt[5]=1 are designated for custom extensions.

Zca_c_slli_cg/{cp_uimm_n0}

c-srai_op

C.SRAI is defined analogously to C.SRLI, but instead performs an arithmetic right shift. It expands to SRAI rd′, rd′, shamt.

Zca_c_srai_cg/{cp_rs1_p, cr_rs1_imm_edges_c}

c-srli_op

C.SRLI is a CB-format instruction that performs a logical right shift of the value in register rd′ then writes the result to rd′. The shift amount is encoded in the shamt field. It expands into SRLI rd′, rd′, shamt.

Zca_c_srli_cg/{cp_rs1_p, cr_rs1_imm_edges_c}

c-srli_shamt5

For XLEN=32, shamt[5] must be zero; the code points with shamt[5]=1 are designated for custom extensions.

Zca_c_srli_cg/{cp_uimm_n0}

c-sub_op

C.SUB subtracts the value in register rs2′ from the value in register rd′, then writes the result to register rd′. It expands into SUB rd′, rd′, rs2′.

Zca_c_sub_cg/{cp_rs1_p, cp_rs2_p, cr_rs1_rs2_edges}

c-subw_op

C.SUBW is an XLEN=64-only instruction that subtracts the value in register rs2′ from the value in register rd′, then sign-extends the lower 32 bits of the difference before writing the result to register rd′. It expands into SUBW rd′, rd′, rs2′.

Zca_c_subw_cg/{cp_rs1_p, cp_rs2_p, cr_rs1_rs2_edges}

c-sw_op

C.SW stores a 32-bit value in register rs2′ to memory. It computes an effective address by adding the zero-extended offset, scaled by 4, to the base address in register rs1′. It expands to SW rs2′, offset(rs1′).

Zca_c_sw_cg/{cp_rs1_p, cp_rs2_p, cp_rs2_edges, cp_imm_mul}

c-swsp_op

C.SWSP stores a 32-bit value in register rs2 to memory. It computes an effective address by adding the zero-extended offset, scaled by 4, to the stack pointer, x2. It expands to SW rs2, offset(x2).

Zca_c_swsp_cg/{cp_rs2, cp_rs2_edges, cp_imm_mul_4sp}

c-xor_op

C.XOR computes the bitwise XOR of the values in registers rd′ and rs2′, then writes the result to register rd′. It expands into XOR rd′, rd′, rs2′.

Zca_c_xor_cg/{cp_rs1_p, cp_rs2_p, cr_rs1_rs2_edges}

Zca_hints

A portion of the Zca encoding space is reserved for microarchitectural HINTs. Like the HINTs in the RV32I base ISA (see rv32i-hints), these instructions do not modify any architectural state, except for advancing the pc and any applicable performance counters. HINTs are executed as no-ops on implementations that ignore them.

Zca_c_add_cg/{cp_c_hint_add}

c-add_hint

The code points with rs2≠x0 and rd=x0 are HINTs.

Zca_c_add_cg/{cp_c_hint_add}

c-addi_hint

The code points with rd≠0 and imm=0 are HINTs.

Zca_c_addi_cg/{cp_c_hint_addi}

c-li_hint

The C.LI code points with rd=x0 are HINTs.

Zca_c_li_cg/{cp_c_hint_li}

c-lui_hint

The code points with rd=x0 and imm≠0 are HINTs.

Zca_c_lui_cg/{cp_c_hint_lui}

c-mv_hint

The code points with rs2≠x0 and rd=x0 are HINTs.

Zca_c_mv_cg/{cp_c_hint_mv}

c-nop_hint

The C.NOP code points with imm≠0 encode HINTs.

Zca_c_nop_cg/{cp_c_hint_nop}

c-slli_hint

The C.SLLI code points with shamt=0 or with rd=x0 are HINTs.

N/A custom hints not certified

c-srli_hint

The C.SRLI code points with shamt=0 are HINTs.

N/A custom hints not certified

UDB Parameters: None.

A.5.2. Zcf Compressed Floating-Point Extension

Table 28 summarizes the coverpoints for the Zcf extension.

Table 28. Zcf Instruction Coverpoints
Instruction c.flw c.flwsp c.fsw c.fswsp

RV32

x

x

x

x

cp_asm_count

x

x

x

x

cp_rs1

p

p

cp_fd

p

x

cp_fs2

p

x

cp_imm_mul

x

4sp

x

4sp

cp_memval

fp_single

fp_single

Table 29. Zcf Normative Rules
Normative Rule Rule Text Coverpoints

c-flwsp_op

C.FLWSP is an RV32FC-only instruction that loads a single-precision floating-point value from memory into floating-point register rd. It computes its effective address by adding the zero-extended offset, scaled by 4, to the stack pointer, x2. It expands to FLW rd, offset(x2). C.FLWSP uses the CI format.

Zcf_c_flwsp_cg/{cp_fd, cp_imm_mul_4sp, cp_memval_fp_single}

c-fswsp_op

C.FSWSP is an RV32FC-only instruction that stores a single-precision floating-point value in floating-point register rs2 to memory. It computes an effective address by adding the zero-extended offset, scaled by 4, to the stack pointer, x2. It expands to FSW rs2, offset(x2).

Zcf_c_fswsp_cg/{cp_fs2, cp_imm_mul_4sp}

Zc_fp_regs

Compressed register-based floating-point loads and stores use the CL and CS formats, respectively, with the eight registers mapping to f8 to f15.

Zcf_c_flw_cg/cp_fd_p, Zcf_c_fsw_cg/cp_fs2_p

c-flw_op

C.FLW is an RV32FC-only instruction that loads a single-precision floating-point value from memory into floating-point register rd′. It computes an effective address by adding the zero-extended offset, scaled by 4, to the base address in register rs1′. It expands to FLW rd′, offset(rs1′).

Zcf_c_flw_cg/{cp_rs1_p, cp_fd_p, cp_imm_mul, cp_memval_fp_single}

c-fsw_op

C.FSW is an RV32FC-only instruction that stores a single-precision floating-point value in floating-point register rs2′ to memory. It computes an effective address by adding the zero-extended offset, scaled by 4, to the base address in register rs1′. It expands to FSW rs2′, offset(rs1′).

Zcf_c_fsw_cg/{cp_rs1_p, cp_fs2_p, cp_imm_mul}

C_dep_Zcf

If XLEN=32 and the F extension is present, the C extension additionally depends upon the Zcf extension.

Not tested: extension dependency checked by the UDB configuration

Zce_dep_Zcf

If XLEN=32 and the F extension is present, the Zce extension additionally depends upon the Zcf extension.

Not tested: extension dependency checked by the UDB configuration

UDB Parameters: None.

A.5.3. Zcd Compressed Double-Precision FP Extension

Table 30 summarizes the coverpoints for the Zcd extension.

Table 30. Zcd Instruction Coverpoints
Instruction c.fld c.fldsp c.fsd c.fsdsp

RV32

x

x

x

x

RV64

x

x

x

x

cp_asm_count

x

x

x

x

cp_rs1

p

p

cp_fd

p

x

cp_fs2

p

x

cp_imm_mul

8

8sp

8

8sp

cp_memval

fp_double

fp_double

Table 31. Zcd Normative Rules
Normative Rule Rule Text Coverpoints

Zc_fp_regs

Compressed register-based floating-point loads and stores use the CL and CS formats, respectively, with the eight registers mapping to f8 to f15.

Zcd_c_fld_cg/cp_fd_p, Zcd_c_fsd_cg/cp_fs2_p

c-fldsp_op

C.FLDSP is an RV32DC/RV64DC-only instruction that loads a double-precision floating-point value from memory into floating-point register rd. It computes its effective address by adding the zero-extended offset, scaled by 8, to the stack pointer, x2. It expands to FLD rd, offset(x2).

Zcd_c_fldsp_cg/{cp_fd, cp_imm_mul_8sp, cp_memval_fp_double}

c-fsdsp_op

C.FSDSP is an RV32DC/RV64DC-only instruction that stores a double-precision floating-point value in floating-point register rs2 to memory. It computes an effective address by adding the zero-extended offset, scaled by 8, to the stack pointer, x2. It expands to FSD rs2, offset(x2).

Zcd_c_fsdsp_cg/{cp_fs2, cp_imm_mul_8sp}

c-fld_op

C.FLD is an RV32DC/RV64DC-only instruction that loads a double-precision floating-point value from memory into floating-point register rd′. It computes an effective address by adding the zero-extended offset, scaled by 8, to the base address in register rs1′. It expands to FLD rd′, offset(rs1′).

Zcd_c_fld_cg/{cp_rs1_p, cp_fd_p, cp_imm_mul_8, cp_memval_fp_double}

c-fsd_op

C.FSD is an RV32DC/RV64DC-only instruction that stores a double-precision floating-point value in floating-point register rs2′ to memory. It computes an effective address by adding the zero-extended offset, scaled by 8, to the base address in register rs1′. It expands to FSD rs2′, offset(rs1′).

Zcd_c_fsd_cg/{cp_rs1_p, cp_fs2_p, cp_imm_mul_8}

C_dep_Zcd

If the D extension is present, the C extension additionally depends upon the Zcd extension.

Not tested: extension dependency checked by the UDB configuration

UDB Parameters: None.

A.5.4. Zcb Additional Compressed Instructions

Table 32 summarizes the coverpoints for the Zcb extension. The rows with an entry in the ExtraExtensions column apply only when that extension is also supported: c.mul needs Zmmul (which M implies), c.zext.w needs Zba, and c.sext.b, c.sext.h, and c.zext.h need Zbb.

Table 32. Zcb Instruction Coverpoints
Instruction c.lbu c.lh c.lhu c.not c.sb c.sh c.zext.b c.mul c.zext.w c.sext.b c.sext.h c.zext.h

RV32

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

ExtraExtensions

Zmmul

Zba

Zbb

Zbb

Zbb

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs1

p

p

p

p

p

p

p

p

p

p

p

p

cp_rs2

p

p

p

cp_rd

p

p

p

cp_rs1_edges

x

x

x

x

x

x

x

cp_rs2_edges

x

x

x

cr_rs1_rs2_edges

x

cmp_rs1_rs2

c

cmp_rd_rs1

c

c

c

cp_uimm

2

2h

2h

2

2h

Table 33. Zcb Normative Rules
Normative Rule Rule Text Coverpoints

c-lbu_op

loads a byte from the memory address formed by adding rs1' to the zero extended immediate uimm. The resulting byte is zero extended to XLEN bits and is written to rd'.

Zcb_c_lbu_cg/{cp_rs1_p, cp_rd_p, cp_uimm_2}

c-lh_op

loads a halfword from the memory address formed by adding rs1' to the zero extended immediate uimm. The resulting halfword is sign extended to XLEN bits and is written to rd'.

Zcb_c_lh_cg/{cp_rs1_p, cp_rd_p, cp_uimm_2h}

c-lhu_op

loads a halfword from the memory address formed by adding rs1' to the zero extended immediate uimm. The resulting halfword is zero extended to XLEN bits and is written to rd'.

Zcb_c_lhu_cg/{cp_rs1_p, cp_rd_p, cp_uimm_2h}

c-mul_op

multiplies XLEN bits of the source operands from rsd' and rs2' and writes the lowest XLEN bits of the result to rsd'.

ZcbZmmul_c_mul_cg/{cp_rs1_p, cp_rs2_p, cr_rs1_rs2_edges}

c-not_op

takes the one’s complement of rd'/rs1' and writes the result to the same register.

Zcb_c_not_cg/{cp_rs1_p, cp_rs1_edges}

c-sb_op

stores the least significant byte of rs2' to the memory address formed by adding rs1' to the zero extended immediate uimm.

Zcb_c_sb_cg/{cp_rs1_p, cp_rs2_p, cp_rs2_edges, cp_uimm_2}

c-sext-b_op

sign-extends the least-significant byte in the operand to XLEN bits by copying the most-significant bit in the byte (i.e., bit 7) to all of the more-significant bits.

ZcbZbb_c_sext_b_cg/{cp_rs1_p, cp_rs1_edges}

c-sext-h_op

sign-extends the least-significant halfword in the operand to XLEN bits by copying the most-significant bit in the halfword (i.e., bit 15) to all of the more-significant bits.

ZcbZbb_c_sext_h_cg/{cp_rs1_p, cp_rs1_edges}

c-sh_op

stores the least significant halfword of rs2' to the memory address formed by adding rs1' to the zero extended immediate uimm.

Zcb_c_sh_cg/{cp_rs1_p, cp_rs2_p, cp_rs2_edges, cp_uimm_2h}

c-zext-b_op

zero-extends the least-significant byte of the operand to XLEN bits by inserting zeros into all of the bits more significant than 7.

Zcb_c_zext_b_cg/{cp_rs1_p, cp_rs1_edges}

c-zext-h_op

zero-extends the least-significant halfword of the operand to XLEN bits by inserting zeros into all of the bits more significant than 15.

ZcbZbb_c_zext_h_cg/{cp_rs1_p, cp_rs1_edges}

c-zext-w_op

zero-extends the least-significant word of the operand to XLEN bits by inserting zeros into all of the bits more significant than 31.

ZcbZba_c_zext_w_cg/{cp_rs1_p, cp_rs1_edges}

Zce_dep

The Zce extension depends upon the Zca, Zcb, Zcmp, and Zcmt extensions.

Definition, checked through UDB

UDB Parameters: None.

A.6. A Atomic Extension

The A extension is subdivided into Zaamo and Zalrsc.

This section exercises unprivileged tests that will not trap. Privileged tests are in other sections, such as ExceptionsZaamo.

A.6.1. Zaamo Atomic Memory Operations Extension

Table 34 summarizes the coverpoints for the Zaamo extension.

Table 34. Zaamo Instruction Coverpoints
Instruction amoadd.d amoadd.w amoand.d amoand.w amomax.d amomax.w amomaxu.d amomaxu.w amomin.d amomin.w amominu.d amominu.w

RV32

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs1

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

cp_rs2

x

x

x

x

x

x

x

x

x

x

x

x

cp_rd

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs2_edges

x

x

x

x

x

x

x

x

x

x

x

x

cmp_rs1_rs2

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

cmp_rd_rs1

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

cmp_rd_rs2

x

x

x

x

x

x

x

x

x

x

x

x

cmp_rd_rs1_rs2

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

cp_align

word

word

word

word

word

word

cp_memval

double

word

double

word

double

word

double

word

double

word

double

word

cp_custom

amo_aqrl

amo_aqrl

amo_aqrl

amo_aqrl

amo_aqrl

amo_aqrl

amo_aqrl

amo_aqrl

amo_aqrl

amo_aqrl

amo_aqrl

amo_aqrl

cr_memval_rs2_edges

double

word

double

word

double

word

double

word

Instruction amoor.d amoor.w amoswap.d amoswap.w amoxor.d amoxor.w

RV32

x

x

x

RV64

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

cp_rs1

nx0

nx0

nx0

nx0

nx0

nx0

cp_rs2

x

x

x

x

x

x

cp_rd

x

x

x

x

x

x

cp_rs2_edges

x

x

x

x

x

x

cmp_rs1_rs2

nx0

nx0

nx0

nx0

nx0

nx0

cmp_rd_rs1

nx0

nx0

nx0

nx0

nx0

nx0

cmp_rd_rs2

x

x

x

x

x

x

cmp_rd_rs1_rs2

nx0

nx0

nx0

nx0

nx0

nx0

cp_align

word

word

word

cp_memval

double

word

double

word

double

word

cp_custom

amo_aqrl

amo_aqrl

amo_aqrl

amo_aqrl

amo_aqrl

amo_aqrl

Table 35. Zaamo Coverpoint Definitions
Coverpoint Bins Definition

cp_custom_amo_aqrl coverpoints

cp_custom_aqrl

4

none, aq, rl, aqrl

cr_memval_rs2_edges coverpoints (amomin, amomax, amominu, amomaxu)

cr_memval_rs2_edges

cp_memval bins x cp_rs2_edges bins

Cross of the standard memory-value and rs2 edge coverpoints

Table 36. Zaamo Normative Rules
Normative Rule Rule Text Coverpoints

A_aq_rl_bits

each atomic instruction has two bits, aq and rl, used to specify additional memory ordering constraints as viewed by other RISC-V harts.

Zaamo_amoadd_w_cg/cp_custom_aqrl

amo_release_consistency

If the aq bit is set, then no later memory operations in this RISC-V hart can be observed to take place before the AMO. Conversely, if the rl bit is set, then other RISC-V harts will not observe the AMO before memory accesses preceding the AMO in this RISC-V hart. Setting both the aq and the rl bit on an AMO makes the sequence sequentially consistent, meaning that it cannot be reordered with earlier or later memory operations from the same hart.

OUT-OF-SCOPE for single hart

A_domain_specific_ordering

The bits order accesses to one of the two address domains, memory or I/O, depending on which address domain the atomic instruction is accessing. No ordering constraint is implied to accesses to the other domain, and a FENCE instruction should be used to order across both domains.

OUT-OF-SCOPE for single hart

A_no_aq_rl

If both bits are clear, no additional ordering constraints are imposed on the atomic memory operation.

OUT-OF-SCOPE for single hart

A_acquire_semantics

If only the aq bit is set, the atomic memory operation is treated as an acquire access, i.e., no following memory operations on this RISC-V hart can be observed to take place before the acquire memory operation.

OUT-OF-SCOPE for single hart

A_release_semantics

If only the rl bit is set, the atomic memory operation is treated as a release access, i.e., the release memory operation cannot be observed to take place before any earlier memory operations on this RISC-V hart.

OUT-OF-SCOPE for single hart

A_seq_cst_semantics

If both the aq and rl bits are set, the atomic memory operation is sequentially consistent and cannot be observed to happen before any earlier memory operations or after any later memory operations in the same RISC-V hart and to the same address domain.

OUT-OF-SCOPE for single hart

A_comprises

The A extension comprises the Zalrsc and Zaamo extensions, which are defined in the following sections.

Definition, checked through UDB

amo_op

These AMO instructions atomically load a data value from the address in rs1, place the value into register rd, apply a binary operator to the loaded value and the original value in rs2, then store the result back to the original address in rs1.

Zaamo_amoadd_w_cg/{cp_memval_word, cp_rs2_edges}, Zaamo_amoadd_d_cg/{cp_memval_double, cp_rs2_edges}

amo_ops_supported

The operations supported are swap, integer add, bitwise AND, bitwise OR, bitwise XOR, and signed and unsigned integer maximum and minimum.

{Zaamo_amoswap_w_cg, Zaamo_amoadd_w_cg, Zaamo_amoand_w_cg, Zaamo_amoor_w_cg, Zaamo_amoxor_w_cg}/cp_asm_count, {Zaamo_amomin_w_cg, Zaamo_amomax_w_cg, Zaamo_amominu_w_cg, Zaamo_amomaxu_w_cg}/cr_memval_rs2_edges_word

amo_operand_size

AMOs can either operate on doublewords (RV64 only) or words in memory. For RV64, 32-bit AMOs always sign-extend the value placed in rd, and ignore the upper 32 bits of the original value of rs2.

Zaamo_amoadd_w_cg/{cp_memval_word, cp_rs2_edges}, Zaamo_amoadd_d_cg/{cp_memval_double, cp_rs2_edges}

misaligned_atomicity_granule_size

The misaligned atomicity granule PMA, defined in sec:misaligned-atomicity-granule, optionally relaxes this alignment requirement. If present, the misaligned atomicity granule PMA specifies the size of a misaligned atomicity granule, a power-of-two number of bytes. The misaligned atomicity granule PMA applies only to AMOs defined in the Zaamo, Zabha, and Zacas extensions; loads and stores defined in the base ISAs; loads and stores of no more than XLEN bits defined in the F, D, and Q extensions; the load-acquire and store-release instructions defined in the Zalasr extension; and compressed encodings of the foregoing loads and stores. For an instruction in that set, if all accessed bytes lie within the same misaligned atomicity granule, the instruction will not raise an exception for reasons of address alignment, and the instruction will give rise to only one memory operation for the purposes of RVWMO—​i.e., it will execute atomically.

OUT-OF-SCOPE: aligned AMOs only; misaligned AMOs are exercised by Zama16b and ExceptionsZaamo

amo_alignment

For AMOs, the Zaamo extension requires that the address held in rs1 be naturally aligned to the size of the operand (i.e., eight-byte aligned for doublewords and four-byte aligned for words).

Zaamo_amoadd_w_cg/cp_align_word

pma_amo_sz_support

For each level of support, naturally aligned AMOs of a given width are supported if the underlying memory region supports reads and writes of that width.

{Zaamo_amoadd_w_cg, Zaamo_amoadd_d_cg}/cp_asm_count

UDB Parameters: None.

This test suite is unprivileged and does not perform misaligned accesses. The MISALIGNED_AMO parameter affects the expected results of ExceptionsZaamo/cp_amo_address_misaligned (Table 183).

A.6.2. Zalrsc Load-Reserved / Store-Conditional Extension

Table 37 summarizes the coverpoints for the Zalrsc extension.

Table 37. Zalrsc Instruction Coverpoints
Instruction lr.d lr.w sc.d sc.w

RV32

x

x

RV64

x

x

x

x

cp_asm_count

x

x

x

x

cp_rs1

nx0

nx0

nx0

nx0

cp_rs2

x

x

cp_rd

x

x

x

x

cp_rs2_edges

x

x

cmp_rs1_rs2

nx0

nx0

cmp_rd_rs1

nx0

nx0

nx0

nx0

cmp_rd_rs2

x

x

cmp_rd_rs1_rs2

nx0

nx0

cp_custom

lr

lr

sc

sc

Table 38. Zalrsc Coverpoint Definitions
Coverpoint Bins Definition

cp_custom_lr coverpoints

cp_custom_aqrl

3

none, aq, aqrl

cp_custom_rd_edges

3

rd_value = 0, 1, -1

cp_custom_sc coverpoints

cp_custom_aqrl

3

none, rl, aqrl. Each sc is retried in a constrained LR/SC loop of up to 100 attempts.

cp_custom_sc_after_sc

2

sc followed by sc. The lr and both sc are retried, up to 100 attempts, until the first sc succeeds; the second sc must fail. This is not a constrained LR/SC loop, because the second sc follows the LR/SC sequence.

cp_custom_sc_lr

2

lr followed by sc that fails and passes, sc pairs with most recent lr. The passing sc is retried in a constrained LR/SC loop of up to 100 attempts.

cp_custom_sc_addresses

32*2

lr followed by sc at address of 8, …​, 248 offset from lr address. For RV64, exercise both lr.d and lr.w. The sc may succeed if the reservation set includes its address, so it is retried up to 100 times. This is not a constrained LR/SC loop, because the sc and lr addresses differ.

A single LR/SC pair may fail spuriously, and only a constrained LR/SC loop is guaranteed to succeed eventually. Therefore, every sc test that can succeed retries its lr/sc pair up to 100 times, including the standard register and value coverpoints of sc.w and sc.d.

Table 39. Zalrsc Normative Rules
Normative Rule Rule Text Coverpoints

A_aq_rl_bits

each atomic instruction has two bits, aq and rl, used to specify additional memory ordering constraints as viewed by other RISC-V harts.

Zalrsc_lr_w_cg/cp_custom_aqrl

A_domain_specific_ordering

The bits order accesses to one of the two address domains, memory or I/O, depending on which address domain the atomic instruction is accessing. No ordering constraint is implied to accesses to the other domain, and a FENCE instruction should be used to order across both domains.

OUT-OF-SCOPE for single hart without defined I/O domains

A_no_aq_rl

If both bits are clear, no additional ordering constraints are imposed on the atomic memory operation.

OUT-OF-SCOPE for single hart

A_acquire_semantics

If only the aq bit is set, the atomic memory operation is treated as an acquire access, i.e., no following memory operations on this RISC-V hart can be observed to take place before the acquire memory operation.

OUT-OF-SCOPE for single hart

A_release_semantics

If only the rl bit is set, the atomic memory operation is treated as a release access, i.e., the release memory operation cannot be observed to take place before any earlier memory operations on this RISC-V hart.

OUT-OF-SCOPE for single hart

A_seq_cst_semantics

If both the aq and rl bits are set, the atomic memory operation is sequentially consistent and cannot be observed to happen before any earlier memory operations or after any later memory operations in the same RISC-V hart and to the same address domain.

OUT-OF-SCOPE for single hart

A_comprises

The A extension comprises the Zalrsc and Zaamo extensions, which are defined in the following sections.

Definition, checked through UDB

lr-w_op

LR.W loads a word from the address in rs1, places the sign-extended value in rd, and registers a reservation set: a set of bytes that subsumes the bytes in the addressed word.

Zalrsc_lr_w_cg/{cp_rs1_nx0, cp_rd}

sc-w_success

SC.W conditionally writes a word in rs2 to the address in rs1: the SC.W succeeds only if the reservation is still valid and the reservation set contains the bytes being written. If the SC.W succeeds, the instruction writes the word in rs2 to memory, and it writes zero to rd.

Zalrsc_sc_w_cg/cp_sc_pass_fail

sc-w_failure

If the SC.W fails, the instruction does not write to memory, and it writes a nonzero value to rd.

Zalrsc_sc_w_cg/cp_sc_pass_fail

sc_failed_side_effects

but it is UNSPECIFIED whether any side effects of implicit address translation and protection memory accesses (such as setting a page-table entry D bit) occur on a failed SC.W.

NONE: Behavior is UNSPECIFIED and OUT-OF-SCOPE

sc_reservation_invalidate

Regardless of success or failure, executing an SC.W instruction invalidates any reservation held by this hart.

Zalrsc_sc_w_cg/cp_custom_sc_after_sc

lr_sc_rv64

LR.D and SC.D act analogously on doublewords and are only available on RV64. For RV64, LR.W and SC.W sign-extend the value placed in rd.

Zalrsc_lr_d_cg/{cp_rs1_nx0, cp_rd}, Zalrsc_sc_d_cg/cp_sc_pass_fail

sc_failure_code

The failure code with value 1 encodes an unspecified failure. Other failure codes are reserved at this time. Portable software should only assume the failure code will be non-zero.

Zalrsc_sc_w_cg/cp_sc_pass_fail

lr_reservation_set_size

An implementation can register an arbitrarily large reservation set on each LR, provided the reservation set includes all bytes of the addressed data word or doubleword.

Zalrsc_sc_w_cg/cp_custom_sc_addresses

sc_pairs_latest_lr

An SC can only pair with the most recent LR in program order.

Zalrsc_sc_w_cg/cp_custom_sc_lr

sc_success_conditions

An SC may succeed only if no store from another hart to the reservation set can be observed to have occurred between the LR and the SC, and if there is no other SC between the LR and itself in program order.

Zalrsc_sc_w_cg/cp_custom_sc_after_sc; multihart not tested

sc_device_write_failure

An SC may succeed only if no write from a device other than a hart to the bytes accessed by the LR instruction can be observed to have occurred between the LR and SC.

OUT-OF-SCOPE: device writes not modeled

sc_addr_not_in_reservation_fail

The SC must fail if the address is not within the reservation set of the most recent LR in program order.

Zalrsc_sc_w_cg/cp_sc_pass_fail

sc_other_hart_store_fail

The SC must fail if a store to the reservation set from another hart can be observed to occur between the LR and SC.

OUT-OF-SCOPE for single hart

sc_other_device_write_fail

The SC must fail if a write from some other device to the bytes accessed by the LR can be observed to occur between the LR and SC.

OUT-OF-SCOPE: device writes not modeled

sc_intervening_sc_fail

An SC must fail if there is another SC (to any address) between the LR and the SC in program order.

Zalrsc_sc_w_cg/cp_custom_sc_after_sc

lr_sc_atomicity_axiom

The precise statement of the atomicity requirements for successful LR/SC sequences is defined by the Atomicity Axiom in rvwmo.

OUT-OF-SCOPE for single hart

sc_not_observable_before_lr

An SC instruction can never be observed by another RISC-V hart before the LR instruction that established the reservation.

OUT-OF-SCOPE for single hart

constrained_lrsc_loop_size

The loop comprises only an LR/SC sequence and code to retry the sequence in the case of failure, and must comprise at most 16 instructions placed sequentially in memory.

Untested

constrained_lrsc_instruction_set

An LR/SC sequence begins with an LR instruction and ends with an SC instruction. The dynamic code executed between the LR and SC instructions can only contain instructions from the I or E base instruction set, excluding loads, stores, backward jumps, taken backward branches, JALR, FENCE, and SYSTEM instructions.

Untested

constrained_lrsc_compressed_allowed

Compressed forms of the aforementioned I or E instructions in the C (hence Zca) and Zcb extensions are also permitted.

Untested

constrained_lrsc_retry_code

The code to retry a failing LR/SC sequence can contain backwards jumps and/or branches to repeat the LR/SC sequence, but otherwise has the same constraint as the code between the LR and SC.

Untested

lrsc_eventuality_region

The LR and SC addresses must lie within a memory region with the LR/SC eventuality property. The execution environment is responsible for communicating which regions have this property.

PMAs not tested

lrsc_same_address_and_size

The SC must be to the same effective address and of the same data size as the latest LR executed by the same hart.

Zalrsc_sc_w_cg/cp_custom_sc_addresses

unconstrained_lrsc_no_progress

LR/SC sequences that do not lie within constrained LR/SC loops are unconstrained. Unconstrained LR/SC sequences might succeed on some attempts on some implementations, but might never succeed on other implementations.

Behavior is unconstrained

constrained_lrsc_forward_progress_intro

If a hart H enters a constrained LR/SC loop, the execution environment must guarantee that one of the following events eventually occurs

{Zalrsc_sc_w_cg, Zalrsc_sc_d_cg}/cp_custom_sc_lr, other harts and devices OUT-OF-SCOPE for single hart

constrained_lrsc_forward_progress_sc

H or some other hart executes a successful SC to the reservation set of the LR instruction in H’s constrained LR/SC loops.

{Zalrsc_sc_w_cg, Zalrsc_sc_d_cg}/cp_custom_sc_lr, other harts OUT-OF-SCOPE for single hart

constrained_lrsc_forward_progress_store_amo

Some other hart executes an unconditional store or AMO instruction to the reservation set of the LR instruction in H’s constrained LR/SC loop, or some other device in the system writes to that reservation set.

OUT-OF-SCOPE for single hart

constrained_lrsc_forward_progress_branch

H executes a branch or jump that exits the constrained LR/SC loop.

Descriptive spec text with no separately testable behavior

constrained_lrsc_forward_progress_trap

H traps.

Descriptive spec text with no separately testable behavior

Table 40. Zalrsc UDB Parameters
Parameter Description Coverpoint Effect

LRSC_RESERVATION_STRATEGY

Strategy used to handle reservation sets.

* "reserve naturally-aligned 64-byte region": Always reserve the 64-byte block containing the LR/SC address * "reserve naturally-aligned 128-byte region": Always reserve the 128-byte block containing the LR/SC address * "reserve exactly enough to cover the access": Always reserve exactly the LR/SC access, and no more * "custom": Custom behavior, leading to an 'unpredictable' call on any LR/SC

Zalrsc_sc_w_cg/cp_custom_sc_addresses

Expected results

LRSC_FAIL_ON_NON_EXACT_LRSC

Whether or not a Store Conditional fails if its physical address and size do not exactly match the physical address and size of the last Load Reserved in program order (independent of whether or not the SC is in the current reservation set)

Zalrsc_sc_d_cg/cp_custom_sc_lr, Zalrsc_sc_w_cg/cp_custom_sc_addresses

Expected results

LRSC_FAIL_ON_VA_SYNONYM

Whether or not an sc.l/sc.d will fail if its VA does not match the VA of the prior lr.l/lr.d, even if the physical address of the SC and LR are the same

Not tested because spec does not require any specific behavior

The spec imposes no requirements on reservation set form, including alignment, NAPOT, or even being contiguous. Therefore, it is not practical to build reference models that reliably predict whether a sc would succeed or fail on every DUT. Current profiles require Za64rs or Za1284s, which can be supported by reference models. However, unusual DUTs that do not match any reasonable reference model may not be able to pass this test suite.

TODO: On implementations that support the C extension, compressed forms of the I instructions permitted inside constrained LR/SC sequences, as described in the ISA manual, are also permitted.

A.7. Floating-Point Extensions

Supporting floating-point involves enabling at least the F extension. Other extensions depend on F. The coverpoints are specified in the following sections. Some tests only apply when multiple extensions are supported.

The basic coverpoints are defined in Table 11. Modified coverpoints for floating-point instructions are defined in Table 41. D and H suffixes apply to double-precision and half-precision floating-point instructions, respectively.

Table 41. Floating-Point Modified Coverpoint Definitions
Modified Coverpoint Bins Definition

cp_frm_{2, 3, 4}

6

Rounding modes for instructions with 2/3/4 arguments

cr_fs1_edges_frm

26 * 6

Cross product of fs1 edges and rounding modes

cp_csr_fflags_{n, v, vn, von, voun, vdoun}

2-10

Set / preserve fflags bits

cp_memval_fp_single

26

Single-precision edge values loaded by fp memory load instructions

cp_memval_fp_double

26

Double-precision edge values loaded by fp memory load instructions

cp_memval_fp_half

26

Half-precision edge values loaded by fp memory load instructions

cr_fs1_fs2_edges_frm

26 * 26 * 6

Cross product of fs1 and fs2 edges and rounding modes

cr_fs1_fs2_edges_frm4

26 * 26 * 6

Cross product of fs1 and fs2 edges and rounding modes for fma

cr_fs1_fs3_edges_frm4

26 * 26 * 6

Cross product of fs1 and fs3 edges and rounding modes for fma

These coverpoints do not yet certify that floating-point operations conform to the IEEE 754 standard. More robust coverpoints based on the IBM suite are under development.

cr_fs1_fs2_edges_frm includes cases that affect all of the flags in each rounding mode.

A.7.1. F Single-Precision FP

Table 42. F Instruction Coverpoints
Instruction fadd.s fclass.s fcvt.l.s fcvt.lu.s fcvt.s.l fcvt.s.lu fcvt.s.w fcvt.s.wu fcvt.w.s fcvt.wu.s fdiv.s feq.s

RV32

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs1

x

x

x

x

cp_rd

x

x

x

x

x

x

cp_rs1_edges

x

x

x

x

cp_fs1

x

x

x

x

x

x

x

x

cp_fs2

x

x

x

cp_fd

x

x

x

x

x

x

cp_fs1_edges

x

x

frm

frm

frm

frm

x

x

cp_fs2_edges

x

x

x

cmp_fd_fs1

x

x

cmp_fd_fs2

x

x

cp_frm

3

2

2

2

2

2

2

2

2

3

cp_csr_fflags

von

vn

vn

n

n

n

n

vn

vn

vdoun

v

cp_csr_frm

x

x

x

x

x

x

x

x

x

x

cr_fs1_fs2_edges

frm

frm

x

cp_fclass

x

Instruction fle.s flt.s flw fmadd.s fmax.s fmin.s fmsub.s fmul.s fmv.w.x fmv.x.w fnmadd.s fnmsub.s

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs1

nx0

x

cp_rd

x

x

x

cp_rs1_edges

x

cp_imm_edges

x

cp_fs1

x

x

x

x

x

x

x

x

x

x

cp_fs2

x

x

x

x

x

x

x

x

x

cp_fs3

x

x

x

x

cp_fd

x

x

x

x

x

x

x

x

x

cp_fs1_edges

x

x

x

x

x

x

x

x

x

x

cp_fs2_edges

x

x

x

x

x

x

x

x

x

cp_fs3_edges

x

x

x

x

cmp_fd_fs1

x

x

x

x

x

x

x

cmp_fd_fs2

x

x

x

x

x

x

x

cmp_fd_fs3

x

x

x

x

cp_frm

4

4

3

4

4

cp_csr_fflags

v

v

voun

v

v

voun

voun

voun

voun

cp_csr_frm

x

x

x

x

x

cr_fs1_fs2_edges

x

x

frm4

x

x

frm4

frm

frm4

frm4

cr_fs1_fs3_edges

frm4

frm4

frm4

frm4

cp_memval

fp_single

Instruction fsgnj.s fsgnjn.s fsgnjx.s fsqrt.s fsub.s fsw

RV32

x

x

x

x

x

x

RV64

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

cp_rs1

nx0

cp_imm_edges

x

cp_fs1

x

x

x

x

x

cp_fs2

x

x

x

x

x

cp_fd

x

x

x

x

x

cp_fs1_edges

x

x

x

frm

x

cp_fs2_edges

x

x

x

x

x

cmp_fd_fs1

x

x

x

x

x

cmp_fd_fs2

x

x

x

x

cp_frm

2

3

cp_csr_fflags

vn

von

cp_csr_frm

x

x

cr_fs1_fs2_edges

x

x

x

frm

Table 43. F Normative Rules
Normative Rule Rule Text Coverpoints

flen_def

FLEN can be 32, 64, or 128 depending on which of the F, D, and Q extensions are supported.

Definition, checked through UDB

Zfinx_Zdinx_incompatible_F_D

These extensions, intended for lower-cost systems, are incompatible with the F and D extensions.

Definition, checked through UDB

F_ieee_compliance

computational instructions compliant with the IEEE 754-2008 arithmetic standard’s binary32 format and operations.

{F_fadd_s_cg, F_fdiv_s_cg}/cr_fs1_fs2_edges_frm, F_fmadd_s_cg/cr_fs1_fs2_edges_frm4, F_fsqrt_s_cg/cr_fs1_edges_frm

F_depends_Zicsr

The F extension depends on the Zicsr extension.

Not tested: extension dependency checked by the UDB configuration

flen

The F extension adds 32 floating-point registers, f0&#8205;&#8211;&#8205;f31, each 32 bits wide, i.e., FLEN=32.

F_fadd_s_cg/{cp_fs1, cp_fs2, cp_fd}

roundingmode_dynamic

Floating-point operations use either a static rounding mode encoded in the instruction, or a dynamic rounding mode held in frm. Rounding modes are encoded as shown in norm:dyn_round_enc. A value of 111 in the instruction’s rm field selects the dynamic rounding mode held in frm

F_fadd_s_cg/{cp_frm_3, cp_csr_frm}, {F_fsqrt_s_cg, F_fcvt_w_s_cg}/cp_csr_frm

dyn_round_enc

Rounding Mode|Mnemonic|Meaning === 000|RNE|Round to Nearest, ties to Even¶001|RTZ|Round towards Zero¶010|RDN|Round Down (towards −∞)¶011|RUP|Round Up (towards +∞)¶100|RMM|Round to Nearest, ties to Max Magnitude¶101||Reserved for future use.¶110||Reserved for future use.¶111|DYN|In instruction’s rm field, selects dynamic rounding mode; In Rounding Mode register, reserved. ===

F_fadd_s_cg/{cp_frm_3, cp_csr_frm}, F_fmadd_s_cg/{cp_frm_4, cp_csr_frm}

canonical_nan

Except when otherwise stated, if the result of a floating-point operation is NaN, it is the canonical NaN.

{F_fadd_s_cg, F_fdiv_s_cg}/cr_fs1_fs2_edges_frm, F_fsqrt_s_cg/cp_fs1_edges, F_fmin_s_cg/cr_fs1_fs2_edges

F_canonical_nan

For single-precision floating-point, the canonical NaN has a positive sign and all significand bits clear except the MSB, the quiet bit. In other words, for single-precision floating-point, the canonical NaN corresponds to the pattern 0x7fc00000.

{F_fadd_s_cg, F_fdiv_s_cg}/cr_fs1_fs2_edges_frm, F_fsqrt_s_cg/cp_fs1_edges, F_fmin_s_cg/cr_fs1_fs2_edges

ieee_std_subnormal

Operations on subnormal numbers are handled in accordance with IEEE 754-2008.

{F_fadd_s_cg, F_fmul_s_cg}/cr_fs1_fs2_edges_frm, F_fclass_s_cg/cp_fclass, ZicsrF_cg/cp_underflow_after_rounding_fma_s

ieee_std_tininess

In the parlance of IEEE 754-2008, tininess is detected after rounding.

ZicsrF_cg/{cp_underflow_after_rounding_fma_s, cp_underflow_after_rounding_fmul_s}

fsw_flw_op

Floating-point loads and stores use the same base+offset addressing mode as the integer base ISAs, with a base address in register rs1 and a 12-bit signed byte offset. The FLW instruction loads a single-precision floating-point value from memory into floating-point register rd. FSW stores a single-precision value from floating-point register rs2 to memory.

{F_flw_cg, F_fsw_cg}/{cp_rs1_nx0, cp_imm_edges}

fsw_flw_atomic_align

FLW and FSW are only guaranteed to execute atomically if the effective address is naturally aligned.

Not tested: atomicity is not observable in single-hart signature tests

fsw_flw_bits_maintained

FLW and FSW do not modify the bits being transferred; in particular, the payloads of non-canonical NaNs are preserved.

F_flw_cg/cp_memval_fp_single, F_fsw_cg/cp_fs2_edges

fadd-s_fmul-s_op

FADD.S and FMUL.S perform single-precision floating-point addition and multiplication respectively, between rs1 and rs2

{F_fadd_s_cg, F_fmul_s_cg}/{cp_fd, cr_fs1_fs2_edges_frm}

fsub-s_op

FSUB.S performs the single-precision floating-point subtraction of rs2 from rs1

F_fsub_s_cg/{cp_fs1, cp_fs2, cp_fd, cr_fs1_fs2_edges_frm}

fdiv-s_op

FDIV.S performs the single-precision floating-point division of rs1 by rs2

F_fdiv_s_cg/{cp_fs1, cp_fs2, cp_fd, cr_fs1_fs2_edges_frm}

fsqrt-s_op

FSQRT.S computes the square root of rs1

F_fsqrt_s_cg/{cp_fs1, cp_fd, cr_fs1_edges_frm}

fp_rd

In each case, the result is written to rd.

{F_fadd_s_cg, F_fmul_s_cg, F_fdiv_s_cg, F_fsqrt_s_cg}/cp_fd

F_fmt_single

The 2-bit floating-point format field fmt is encoded as shown in . It is set to S (00) for all instructions in the F extension.

{F_fadd_s_cg, F_fmadd_s_cg, F_fcvt_w_s_cg, F_fsgnj_s_cg}/cp_asm_count

F_rm_field

All floating-point operations that perform rounding can select the rounding mode using the rm field with the encoding shown in .

F_fadd_s_cg/cr_fs1_fs2_edges_frm, F_fmadd_s_cg/cr_fs1_fs2_edges_frm4, F_fsqrt_s_cg/cr_fs1_edges_frm, F_fcvt_w_s_cg/cr_fs1_edges_frm

fmin-s_fmax-s_op

Floating-point minimum-number and maximum-number instructions FMIN.S and FMAX.S write, respectively, the smaller or larger of rs1 and rs2 to rd

{F_fmin_s_cg, F_fmax_s_cg}/{cp_fd, cr_fs1_fs2_edges}

fmin-s_fmax-s_zero_compare

For the purposes of these instructions only, the value −0.0 is considered to be less than the value +0.0

{F_fmin_s_cg, F_fmax_s_cg}/cr_fs1_fs2_edges

fmin-s_fmax-s_both_nan_input

If both inputs are NaNs, the result is the canonical NaN

{F_fmin_s_cg, F_fmax_s_cg}/cr_fs1_fs2_edges

fmin-s_fmax-s_one_nan_input

If only one operand is a NaN, the result is the non-NaN operand

{F_fmin_s_cg, F_fmax_s_cg}/cr_fs1_fs2_edges

fmin-s_fmax-s_signaling_nan_nv

Signaling NaN inputs set the invalid operation exception flag, even when the result is not NaN

{F_fmin_s_cg, F_fmax_s_cg}/{cr_fs1_fs2_edges, cp_csr_fflags_v}

fma_rs3

Floating-point fused multiply-add (FMA) instructions require a new standard instruction format. R4-type instructions specify three source registers (rs1, rs2, and rs3) and a destination register (rd). This format is only used by the floating-point fused multiply-add instructions.

{F_fmadd_s_cg, F_fmsub_s_cg, F_fnmadd_s_cg, F_fnmsub_s_cg}/cp_fs3

fmadd-s_op

FMADD.S multiplies the values in rs1 and rs2, adds the value in rs3, and writes the final result to rd. FMADD.S computes (rs1×rs2)+rs3.

F_fmadd_s_cg/{cp_fs3, cp_fd, cr_fs1_fs2_edges_frm4, cr_fs1_fs3_edges_frm4}

fmsub-s_op

FMSUB.S multiplies the values in rs1 and rs2, subtracts the value in rs3, and writes the final result to rd. FMSUB.S computes (rs1×rs2)−rs3.

F_fmsub_s_cg/{cp_fs3, cp_fd, cr_fs1_fs2_edges_frm4, cr_fs1_fs3_edges_frm4}

fnmsub-s_op

FNMSUB.S multiplies the values in rs1 and rs2, negates the product, adds the value in rs3, and writes the final result to rd. FNMSUB.S computes −(rs1×rs2)+rs3.

F_fnmsub_s_cg/{cp_fs3, cp_fd, cr_fs1_fs2_edges_frm4, cr_fs1_fs3_edges_frm4}

fnmadd-s_op

FNMADD.S multiplies the values in rs1 and rs2, negates the product, subtracts the value in rs3, and writes the final result to rd. FNMADD.S computes −(rs1×rs2)−rs3.

F_fnmadd_s_cg/{cp_fs3, cp_fd, cr_fs1_fs2_edges_frm4, cr_fs1_fs3_edges_frm4}

fma_nv_flag

The fused multiply-add instructions must set the invalid operation exception flag when the multiplicands are ∞ and zero, even when the addend is a quiet NaN.

fcvt-l-s_fcvt-w-s_op

FCVT.W.S or FCVT.L.S converts a floating-point number in floating-point register rs1 to a signed 32-bit or 64-bit integer, respectively, in integer register rd

{F_fcvt_w_s_cg, F_fcvt_l_s_cg}/{cp_rd, cr_fs1_edges_frm}

fcvt-s-w_fcvt-s-l_op

FCVT.S.W or FCVT.S.L converts a 32-bit or 64-bit signed integer, respectively, in integer register rs1 into a floating-point number in floating-point register rd

{F_fcvt_s_w_cg, F_fcvt_s_l_cg}/{cp_fd, cp_rs1_edges}

fcvt-wu-s_fcvt-lu-s_fcvt-s-wu_fcvt-s-lu_op

FCVT.WU.S, FCVT.LU.S, FCVT.S.WU, and FCVT.S.LU variants convert to or from unsigned integer values. For XLEN>32, FCVT.W.S and FCVT.WU.S sign-extend the 32-bit result to the destination register width

{F_fcvt_wu_s_cg, F_fcvt_lu_s_cg}/cr_fs1_edges_frm, {F_fcvt_s_wu_cg, F_fcvt_s_lu_cg}/cp_rs1_edges

fcvt_long_float_rv64_only

FCVT.L.S, FCVT.LU.S, FCVT.S.L, and FCVT.S.LU are RV64-only instructions

{F_fcvt_l_s_cg, F_fcvt_lu_s_cg, F_fcvt_s_l_cg, F_fcvt_s_lu_cg}/cp_asm_count

fcvt_unrepresentable_nv

If the rounded result is not representable in the destination format, it is clipped to the nearest value and the invalid flag is set

{F_fcvt_w_s_cg, F_fcvt_wu_s_cg, F_fcvt_l_s_cg, F_fcvt_lu_s_cg}/cr_fs1_edges_frm

fcvt_int_float_valid_input

int_conv gives the range of valid inputs for FCVT.W.S, FCVT.WU.S, FCVT.L.S, and FCVT.LU.S and the behavior of these instructions for invalid inputs

{F_fcvt_w_s_cg, F_fcvt_wu_s_cg, F_fcvt_l_s_cg, F_fcvt_lu_s_cg}/cr_fs1_edges_frm

fcvt_round

All floating-point to integer and integer to floating-point conversion instructions round according to the rm field.

{F_fcvt_w_s_cg, F_fcvt_l_s_cg}/cr_fs1_edges_frm, {F_fcvt_s_w_cg, F_fcvt_s_l_cg}/cp_frm_2

fcvt_nx

All floating-point conversion instructions set the Inexact exception flag if the rounded result differs from the operand value and the Invalid exception flag is not set.

F_fcvt_w_s_cg/{cr_fs1_edges_frm, cp_csr_fflags_vn}, F_fcvt_s_w_cg/{cp_rs1_edges, cp_csr_fflags_n}

fsgnj-s_fsgnjn-s_fsgnjx-s_op

FSGNJ.S, FSGNJN.S, and FSGNJX.S are floating-point to floating-point sign-injection instructions that produce a result that takes all bits except the sign bit from rs1. For FSGNJ, the result’s sign bit is rs2’s sign bit; for FSGNJN, the result’s sign bit is the opposite of rs2’s sign bit; and for FSGNJX, the sign bit is the XOR of the sign bits of rs1 and rs2. Sign-injection instructions do not set floating-point exception flags, nor do they canonicalize NaNs

{F_fsgnj_s_cg, F_fsgnjn_s_cg, F_fsgnjx_s_cg}/cr_fs1_fs2_edges

fmv-x-w_op

FMV.X.W moves the single-precision value in floating-point register rs1 represented in the IEEE 754-2008 encoding to the lower 32 bits of integer register rd. The bits are not modified in the transfer, and in particular, the payloads of non-canonical NaNs are preserved. For RV64, the higher 32 bits of the destination register are filled with copies of the floating-point number’s sign bit

F_fmv_x_w_cg/{cp_rd, cp_fs1, cp_fs1_edges}

fmv-w-x_op

FMV.W.X moves the single-precision value encoded in the IEEE 754-2008 encoding from the lower 32 bits of integer register rs1 to the floating-point register rd. The bits are not modified in the transfer, and in particular, the payloads of non-canonical NaNs are preserved.

F_fmv_w_x_cg/{cp_rs1, cp_rs1_edges, cp_fd}

feq-s_flt-s_fle-s_op

Floating-point compare instructions (FEQ.S, FLT.S, FLE.S) perform the specified comparison between floating-point registers (rs1 = rs2, rs1 < rs2, rs1 ≤ rs2) writing 1 to the integer register rd if the condition holds, and 0 otherwise.

{F_feq_s_cg, F_flt_s_cg, F_fle_s_cg}/cr_fs1_fs2_edges

flt-s_fle-s_signaling

FLT.S and FLE.S perform what IEEE 754-2008 refers to as signaling comparisons: that is, they set the invalid operation exception flag if either input is NaN

{F_fle_s_cg, F_flt_s_cg}/{cr_fs1_fs2_edges, cp_csr_fflags_v}

feq-s_quiet

FEQ.S performs a quiet comparison: it only sets the invalid operation exception flag if either input is a signaling NaN

F_feq_s_cg/{cr_fs1_fs2_edges, cp_csr_fflags_v}

feq-s_flt-s_fle-s_nan_input

For all three instructions, the result is 0 if either operand is NaN

{F_feq_s_cg, F_fle_s_cg, F_flt_s_cg}/cr_fs1_fs2_edges

fclass-s_op

The FCLASS.S instruction examines the value in floating-point register rs1 and writes to integer register rd a 10-bit mask that indicates the class of the floating-point number. The format of the mask is described in . The corresponding bit in rd will be set if the property is true and clear otherwise. All other bits in rd are cleared. Note that exactly one bit in rd will be set. FCLASS.S does not set the floating-point exception flags.

F_fclass_s_cg/{cp_rd, cp_fs1, cp_fs1_edges, cp_fclass}

UDB Parameters: None.

A.7.2. D Double-Precision FP

Table 44. D Instruction Coverpoints
Instruction fadd.d fclass.d fcvt.d.l fcvt.d.lu fcvt.d.s fcvt.d.w fcvt.d.wu fcvt.l.d fcvt.lu.d fcvt.s.d fcvt.w.d fcvt.wu.d

RV32

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs1

x

x

x

x

cp_rd

x

x

x

x

x

cp_rs1_edges

x

x

x

x

cp_fs1

x

x

x

x

x

x

x

x

cp_fs2

x

cp_fd

x

x

x

x

x

x

x

cp_fs1_edges

D

D

x

frm_D

frm_D

frm_D

frm_D

frm_D

cp_fs2_edges

D

cmp_fd_fs1

x

x

x

cmp_fd_fs2

x

cp_frm

3

2

2

2

2

2

2

2

cp_csr_fflags

von

n

n

v

vn

vn

voun

vn

vn

cp_csr_frm

x

x

x

x

x

x

x

x

cr_fs1_fs2_edges

frm_D

cp_fclass

x

cp_NaNBox

D_S

cp_fs1_badNB

D_S

Instruction fdiv.d feq.d fld fle.d flt.d fmadd.d fmax.d fmin.d fmsub.d fmul.d fmv.d.x fmv.x.d

RV32

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs1

nx0

x

cp_rd

x

x

x

x

cp_rs1_edges

x

cp_imm_edges

x

cp_fs1

x

x

x

x

x

x

x

x

x

x

cp_fs2

x

x

x

x

x

x

x

x

x

cp_fs3

x

x

cp_fd

x

x

x

x

x

x

x

x

cp_fs1_edges

D

D

D

D

D

D

D

D

D

D

cp_fs2_edges

D

D

D

D

D

D

D

D

D

cp_fs3_edges

D

D

cmp_fd_fs1

x

x

x

x

x

x

cmp_fd_fs2

x

x

x

x

x

x

cmp_fd_fs3

x

x

cp_frm

3

4

4

3

cp_csr_fflags

vdoun

v

v

v

voun

v

v

voun

voun

cp_csr_frm

x

x

x

x

cr_fs1_fs2_edges

frm_D

D

D

D

frm4_D

D

D

frm4_D

frm_D

cr_fs1_fs3_edges

frm4_D

frm4_D

cp_memval

fp_double

Instruction fnmadd.d fnmsub.d fsd fsgnj.d fsgnjn.d fsgnjx.d fsqrt.d fsub.d

RV32

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

cp_rs1

nx0

cp_imm_edges

x

cp_fs1

x

x

x

x

x

x

x

cp_fs2

x

x

x

x

x

x

x

cp_fs3

x

x

cp_fd

x

x

x

x

x

x

x

cp_fs1_edges

D

D

D

D

D

D

D

cp_fs2_edges

D

D

x

D

D

D

D

cp_fs3_edges

D

D

cmp_fd_fs1

x

x

x

x

x

x

x

cmp_fd_fs2

x

x

x

x

x

x

cmp_fd_fs3

x

x

cp_frm

4

4

2

3

cp_csr_fflags

voun

voun

vn

von

cp_csr_frm

x

x

x

x

cr_fs1_fs2_edges

frm4_D

frm4_D

D

D

D

frm_D

cr_fs1_fs3_edges

frm4_D

frm4_D

Instruction fadd.s fclass.s fcvt.l.s fcvt.lu.s fcvt.s.l fcvt.s.lu fcvt.s.w fcvt.s.wu fcvt.w.s fcvt.wu.s fdiv.s feq.s

RV32

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_NaNBox

D_S

D_S

D_S

D_S

D_S

D_S

cp_fs1_badNB

D_S

D_S

D_S

D_S

D_S

D_S

D_S

D_S

cp_fs2_badNB

D_S

D_S

D_S

Instruction fle.s flt.s flw fmadd.s fmax.s fmin.s fmsub.s fmul.s fmv.w.x fmv.x.w fnmadd.s fnmsub.s

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_NaNBox

D_S

D_S

D_S

D_S

D_S

D_S

D_S

D_S

D_S

cp_fs1_badNB

D_S

D_S

D_S

D_S

D_S

D_S

D_S

D_S

D_S

D_S

cp_fs2_badNB

D_S

D_S

D_S

D_S

D_S

D_S

D_S

D_S

D_S

cp_fs3_badNB

D_S

D_S

D_S

D_S

Instruction fsgnj.s fsgnjn.s fsgnjx.s fsqrt.s fsub.s fsw

RV32

x

x

x

x

x

x

RV64

x

x

x

x

x

x

cp_NaNBox

D_S

D_S

D_S

D_S

D_S

cp_fs1_badNB

D_S

D_S

D_S

D_S

D_S

cp_fs2_badNB

D_S

D_S

D_S

D_S

D_S

Table 45. D Normative Rules
Normative Rule Rule Text Coverpoints

roundingmode_dynamic

Floating-point operations use either a static rounding mode encoded in the instruction, or a dynamic rounding mode held in frm. Rounding modes are encoded as shown in norm:dyn_round_enc. A value of 111 in the instruction’s rm field selects the dynamic rounding mode held in frm

D_fadd_d_cg/{cp_frm_3, cp_csr_frm}, {D_fsqrt_d_cg, D_fcvt_s_d_cg}/cp_csr_frm

dyn_round_enc

Rounding Mode|Mnemonic|Meaning === 000|RNE|Round to Nearest, ties to Even¶001|RTZ|Round towards Zero¶010|RDN|Round Down (towards −∞)¶011|RUP|Round Up (towards +∞)¶100|RMM|Round to Nearest, ties to Max Magnitude¶101||Reserved for future use.¶110||Reserved for future use.¶111|DYN|In instruction’s rm field, selects dynamic rounding mode; In Rounding Mode register, reserved. ===

D_fadd_d_cg/{cp_frm_3, cp_csr_frm}, D_fmadd_d_cg/{cp_frm_4, cp_csr_frm}

ieee_std_subnormal

Operations on subnormal numbers are handled in accordance with IEEE 754-2008.

{D_fadd_d_cg, D_fmul_d_cg}/cr_fs1_fs2_edges_frm_D, D_fclass_d_cg/cp_fclass, ZicsrF_cg/cp_underflow_after_rounding_fma_d

ieee_std_tininess

In the parlance of IEEE 754-2008, tininess is detected after rounding.

ZicsrF_cg/{cp_underflow_after_rounding_fma_d, cp_underflow_after_rounding_fmul_d, cp_underflow_after_rounding_fcvt_s_d}

fcvt_unrepresentable_nv

If the rounded result is not representable in the destination format, it is clipped to the nearest value and the invalid flag is set

{D_fcvt_w_d_cg, D_fcvt_wu_d_cg, D_fcvt_l_d_cg, D_fcvt_lu_d_cg}/cr_fs1_edges_frm_D

fcvt_round

All floating-point to integer and integer to floating-point conversion instructions round according to the rm field.

{D_fcvt_w_d_cg, D_fcvt_l_d_cg}/cr_fs1_edges_frm_D, {D_fcvt_d_l_cg, D_fcvt_d_lu_cg}/cp_frm_2

fcvt_nx

All floating-point conversion instructions set the Inexact exception flag if the rounded result differs from the operand value and the Invalid exception flag is not set.

D_fcvt_w_d_cg/{cr_fs1_edges_frm_D, cp_csr_fflags_vn}, D_fcvt_s_d_cg/{cr_fs1_edges_frm_D, cp_csr_fflags_voun}

D_canonical_nan

For double-precision floating-point, the canonical NaN corresponds to the pattern 0x7ff8000000000000.

{D_fadd_d_cg, D_fdiv_d_cg}/cr_fs1_fs2_edges_frm_D, D_fsqrt_d_cg/cp_fs1_edges_D, D_fmin_d_cg/cr_fs1_fs2_edges_D

D_flen_64

The D extension widens the 32 floating-point registers, f0&#8205;&#8211;&#8205;f31, to 64 bits, i.e., FLEN=64.

D_fadd_d_cg/cr_fs1_fs2_edges_frm_D, D_fld_cg/cp_memval_fp_double

fp_nan_boxing

When multiple floating-point precisions are supported, then valid values of narrower n-bit types, n<FLEN, are represented in the lower n bits of an FLEN-bit NaN value, in a process termed NaN-boxing. The upper bits of a valid NaN-boxed value must be all 1s. Valid NaN-boxed n-bit values therefore appear as negative quiet NaNs (qNaNs) when viewed as any wider m-bit value, n < m ≤ FLEN. Any operation that writes a narrower result to an f register must write all 1s to the uppermost FLEN-n bits to yield a legal NaN-boxed value.

{D_fadd_s_cg, D_fcvt_s_d_cg, D_flw_cg, D_fmv_w_x_cg}/cp_NaNBox_D_S

fp_transfer_instrs_narrow_transfer_in

A narrower n-bit transfer, n<FLEN, into the f registers will create a valid NaN-boxed value

{D_flw_cg, D_fmv_w_x_cg}/cp_NaNBox_D_S

fp_transfer_instrs_narrow_transfer_out

A narrower n-bit transfer out of the floating-point registers will transfer the lower n bits of the register ignoring the upper FLEN-n bits

D_fsw_cg/cp_fs2_badNB_D_S, D_fmv_x_w_cg/cp_fs1_badNB_D_S

fp_nontransfer_instrs_improper_nan_boxed_input

Apart from transfer operations described in the previous paragraph, all other floating-point operations on narrower n-bit operations, n<FLEN, check if the input operands are correctly NaN-boxed, i.e., all upper FLEN-n bits are 1. If so, the n least-significant bits of the input are used as the input value, otherwise the input value is treated as an n-bit canonical NaN.

D_fadd_s_cg/{cp_fs1_badNB_D_S, cp_fs2_badNB_D_S}, D_fmadd_s_cg/cp_fs3_badNB_D_S, D_fsqrt_s_cg/cp_fs1_badNB_D_S

fld_op

The FLD instruction loads a double-precision floating-point value from memory into floating-point register rd

D_fld_cg/{cp_rs1_nx0, cp_imm_edges, cp_fd, cp_memval_fp_double}

fsd_op

FSD stores a double-precision value from the floating-point registers to memory

D_fsd_cg/{cp_rs1_nx0, cp_imm_edges, cp_fs2, cp_fs2_edges}

fld_fsd_atomic_align

FLD and FSD are only guaranteed to execute atomically if the effective address is naturally aligned and XLEN≥64.

Not tested: atomicity is not observable in single-hart signature tests

fld_fsd_bits_maintained

FLD and FSD do not modify the bits being transferred; in particular, the payloads of non-canonical NaNs are preserved.

D_fld_cg/cp_memval_fp_double

D_computational_instrs

The double-precision floating-point computational instructions are defined analogously to their single-precision counterparts, but operate on double-precision operands and produce double-precision results.

{D_fadd_d_cg, D_fdiv_d_cg}/cr_fs1_fs2_edges_frm_D, D_fmadd_d_cg/cr_fs1_fs2_edges_frm4_D, D_fsqrt_d_cg/cp_fs1_edges_D

fcvt-w-d_fcvt-l-d_op

FCVT.W.D or FCVT.L.D converts a double-precision floating-point number in floating-point register rs1 to a signed 32-bit or 64-bit integer, respectively, in integer register rd

{D_fcvt_w_d_cg, D_fcvt_l_d_cg}/{cp_rd, cr_fs1_edges_frm_D}

fcvt-d-w_fcvt-d-l_op

FCVT.D.W or FCVT.D.L converts a 32-bit or 64-bit signed integer, respectively, in integer register rs1 into a double-precision floating-point number in floating-point register rd

{D_fcvt_d_w_cg, D_fcvt_d_l_cg}/{cp_fd, cp_rs1_edges}

fcvt-wu-d_fcvt-lu-d_fcvt-d-wu_fcvt-d-lu_op

FCVT.WU.D, FCVT.LU.D, FCVT.D.WU, and FCVT.D.LU variants convert to or from unsigned integer values

{D_fcvt_wu_d_cg, D_fcvt_lu_d_cg}/cr_fs1_edges_frm_D, {D_fcvt_d_wu_cg, D_fcvt_d_lu_cg}/cp_rs1_edges

fcvt-w-d_fcvt-wu-d_sign_ext

For RV64, FCVT.W.D and FCVT.WU.D sign-extend the 32-bit result

{D_fcvt_w_d_cg, D_fcvt_wu_d_cg}/cr_fs1_edges_frm_D

fcvt_long_double_rv64_only

FCVT.L.D, fcvt.lu.d[], fcvt.d.l[], and fcvt.d.lu[] are RV64-only instructions.

{D_fcvt_l_d_cg, D_fcvt_lu_d_cg, D_fcvt_d_l_cg, D_fcvt_d_lu_cg}/cp_asm_count

fcvt_int_double_valid_input

The range of valid inputs for FCVT.W.D, FCVT.WU.D, FCVT.L.D, and FCVT.LU.D and the behavior of these instructions for invalid inputs are the same as for FCVT.W.S, FCVT.WU.S, FCVT.L.S, and FCVT.LU.S

{D_fcvt_w_d_cg, D_fcvt_wu_d_cg, D_fcvt_l_d_cg, D_fcvt_lu_d_cg}/cr_fs1_edges_frm_D

fcvt-s-d_fcvt-d-s_op

The double-precision to single-precision and single-precision to double-precision conversion instructions, FCVT.S.D and FCVT.D.S, are encoded in the OP-FP major opcode space and both the source and destination are floating-point registers. The rs2 field encodes the datatype of the source, and the fmt field encodes the datatype of the destination

D_fcvt_s_d_cg/{cp_fd, cr_fs1_edges_frm_D}, D_fcvt_d_s_cg/{cp_fd, cp_fs1_edges}

fcvt_float_rounding

FCVT.S.D rounds according to the rm field; FCVT.D.S will never round

D_fcvt_s_d_cg/cr_fs1_edges_frm_D, D_fcvt_d_s_cg/{cp_fs1_edges, cp_csr_fflags_v}, ZicsrF_cg/cp_underflow_after_rounding_fcvt_s_d

fsgnj-d_fsgnjn-d_fsgnjx-d_op

Floating-point to floating-point sign-injection instructions, FSGNJ.D, FSGNJN.D, and FSGNJX.D, are defined analogously to the single-precision sign-injection instruction.

{D_fsgnj_d_cg, D_fsgnjn_d_cg, D_fsgnjx_d_cg}/cr_fs1_fs2_edges_D

fmv-x-d_op

FMV.X.D moves the double-precision value in floating-point register rs1 to a representation in the IEEE 754-2008 encoding in integer register rd

D_fmv_x_d_cg/{cp_rd, cp_fs1, cp_fs1_edges_D}

fmv-d-x_op

FMV.D.X moves the double-precision value encoded in the IEEE 754-2008 encoding from the integer register rs1 to the floating-point register rd

D_fmv_d_x_cg/{cp_rs1, cp_rs1_edges, cp_fd}

fmv_bits_preserved

FMV.X.D and FMV.D.X do not modify the bits being transferred; in particular, the payloads of non-canonical NaNs are preserved.

D_fmv_x_d_cg/cp_fs1_edges_D, D_fmv_d_x_cg/cp_rs1_edges

D_compare_instrs

The double-precision floating-point compare instructions are defined analogously to their single-precision counterparts, but operate on double-precision operands.

{D_feq_d_cg, D_flt_d_cg, D_fle_d_cg}/cr_fs1_fs2_edges_D, D_feq_d_cg/cp_csr_fflags_v

fclass-d_op

The double-precision floating-point classify instruction, FCLASS.D, is defined analogously to its single-precision counterpart, but operates on double-precision operands.

D_fclass_d_cg/{cp_rd, cp_fs1, cp_fs1_edges_D, cp_fclass}

UDB Parameters: None.

A.7.3. Zfh Half-Precision FP

The rows of Table 46 with D in the ExtraExtensions column apply only when D is also supported. They cover fcvt.d.h, fcvt.h.d, and NaN-boxing of half-precision values in 64-bit registers.

Table 46. Zfh Instruction Coverpoints
Instruction fadd.h fclass.h fcvt.h.l fcvt.h.lu fcvt.h.s fcvt.h.w fcvt.h.wu fcvt.l.h fcvt.lu.h fcvt.s.h fcvt.w.h fcvt.wu.h

RV32

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs1

x

x

x

x

cp_rd

x

x

x

x

x

cp_rs1_edges

x

x

x

x

cp_fs1

x

x

x

x

x

x

x

x

cp_fs2

x

cp_fd

x

x

x

x

x

x

x

cp_fs1_edges

H

H

frm

frm_H

frm_H

H

frm_H

frm_H

cp_fs2_edges

H

cmp_fd_fs1

x

x

x

cmp_fd_fs2

x

cp_frm

3

2

2

2

2

2

2

2

2

2

cp_csr_fflags

von

on

on

voun

on

on

vn

vn

v

vn

vn

cp_csr_frm

x

x

x

x

x

x

x

x

x

x

cr_fs1_fs2_edges

frm_H

cp_fclass

x

cp_NaNBox

S_H

S_H

S_H

S_H

S_H

S_H

cp_fs1_badNB

S_H

S_H

S_H

S_H

S_H

S_H

S_H

cp_fs2_badNB

S_H

Instruction fdiv.h feq.h fle.h flh flt.h fmadd.h fmax.h fmin.h fmsub.h fmul.h fmv.h.x fmv.x.h

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs1

nx0

x

cp_rd

x

x

x

x

cp_rs1_edges

x

cp_imm_edges

x

cp_fs1

x

x

x

x

x

x

x

x

x

x

cp_fs2

x

x

x

x

x

x

x

x

x

cp_fs3

x

x

cp_fd

x

x

x

x

x

x

x

x

cp_fs1_edges

H

H

H

H

H

H

H

H

H

H

cp_fs2_edges

H

H

H

H

H

H

H

H

H

cp_fs3_edges

H

H

cmp_fd_fs1

x

x

x

x

x

x

cmp_fd_fs2

x

x

x

x

x

x

cmp_fd_fs3

x

x

cp_frm

3

4

4

3

cp_csr_fflags

vdoun

v

v

v

voun

v

v

voun

voun

cp_csr_frm

x

x

x

x

cr_fs1_fs2_edges

frm_H

H

H

H

frm4_H

H

H

frm4_H

frm_H

cr_fs1_fs3_edges

frm4_H

frm4_H

cp_NaNBox

S_H

S_H

S_H

S_H

S_H

S_H

S_H

S_H

cp_fs1_badNB

S_H

S_H

S_H

S_H

S_H

S_H

S_H

S_H

S_H

S_H

cp_fs2_badNB

S_H

S_H

S_H

S_H

S_H

S_H

S_H

S_H

S_H

cp_fs3_badNB

S_H

S_H

cp_memval

fp_half

Instruction fnmadd.h fnmsub.h fsgnj.h fsgnjn.h fsgnjx.h fsh fsqrt.h fsub.h fcvt.d.h fcvt.h.d fadd.h fclass.h

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

ExtraExtensions

D

D

D

D

cp_asm_count

x

x

x

x

x

x

x

x

x

x

cp_rs1

nx0

cp_imm_edges

x

cp_fs1

x

x

x

x

x

x

x

x

x

cp_fs2

x

x

x

x

x

x

x

cp_fs3

x

x

cp_fd

x

x

x

x

x

x

x

x

x

cp_fs1_edges

H

H

H

H

H

H

H

H

frm_D

cp_fs2_edges

H

H

H

H

H

H

H

cp_fs3_edges

H

H

cmp_fd_fs1

x

x

x

x

x

x

x

x

x

cmp_fd_fs2

x

x

x

x

x

x

cmp_fd_fs3

x

x

cp_frm

4

4

2

3

2

cp_csr_fflags

voun

voun

vn

von

v

voun

cp_csr_frm

x

x

x

x

x

cr_fs1_fs2_edges

frm4_H

frm4_H

H

H

H

frm_H

cr_fs1_fs3_edges

frm4_H

frm4_H

cp_NaNBox

S_H

S_H

S_H

S_H

S_H

S_H

S_H

D_H

D_H

cp_fs1_badNB

S_H

S_H

S_H

S_H

S_H

S_H

S_H

D_H

D_H

D_H

cp_fs2_badNB

S_H

S_H

S_H

S_H

S_H

S_H

S_H

D_H

cp_fs3_badNB

S_H

S_H

Instruction fcvt.h.l fcvt.h.lu fcvt.h.s fcvt.h.w fcvt.h.wu fcvt.l.h fcvt.lu.h fcvt.s.h fcvt.w.h fcvt.wu.h fdiv.h feq.h

RV32

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

ExtraExtensions

D

D

D

D

D

D

D

D

D

D

D

D

cp_NaNBox

D_H

D_H

D_H

D_H

D_H

D_S

D_H

cp_fs1_badNB

D_H

D_H

D_H

D_H

D_H

D_H

D_H

D_H

cp_fs2_badNB

D_H

D_H

Instruction fle.h flh flt.h fmadd.h fmax.h fmin.h fmsub.h fmul.h fmv.h.x fmv.x.h fnmadd.h fnmsub.h

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

ExtraExtensions

D

D

D

D

D

D

D

D

D

D

D

D

cp_NaNBox

D_H

D_H

D_H

D_H

D_H

D_H

D_H

D_H

D_H

cp_fs1_badNB

D_H

D_H

D_H

D_H

D_H

D_H

D_H

D_H

D_H

D_H

cp_fs2_badNB

D_H

D_H

D_H

D_H

D_H

D_H

D_H

D_H

D_H

cp_fs3_badNB

D_H

D_H

D_H

D_H

Instruction fsgnj.h fsgnjn.h fsgnjx.h fsh fsqrt.h fsub.h

RV32

x

x

x

x

x

x

RV64

x

x

x

x

x

x

ExtraExtensions

D

D

D

D

D

D

cp_NaNBox

D_H

D_H

D_H

D_H

D_H

cp_fs1_badNB

D_H

D_H

D_H

D_H

D_H

cp_fs2_badNB

D_H

D_H

D_H

D_H

D_H

Table 47. Zfh Normative Rules
Normative Rule Rule Text Coverpoints

roundingmode_dynamic

Floating-point operations use either a static rounding mode encoded in the instruction, or a dynamic rounding mode held in frm. Rounding modes are encoded as shown in norm:dyn_round_enc. A value of 111 in the instruction’s rm field selects the dynamic rounding mode held in frm

Zfh_fadd_h_cg/{cp_frm_3, cp_csr_frm}, {Zfh_fsqrt_h_cg, Zfh_fcvt_h_s_cg}/cp_csr_frm

dyn_round_enc

Rounding Mode|Mnemonic|Meaning === 000|RNE|Round to Nearest, ties to Even¶001|RTZ|Round towards Zero¶010|RDN|Round Down (towards −∞)¶011|RUP|Round Up (towards +∞)¶100|RMM|Round to Nearest, ties to Max Magnitude¶101||Reserved for future use.¶110||Reserved for future use.¶111|DYN|In instruction’s rm field, selects dynamic rounding mode; In Rounding Mode register, reserved. ===

Zfh_fadd_h_cg/{cp_frm_3, cp_csr_frm}, Zfh_fmadd_h_cg/{cp_frm_4, cp_csr_frm}

ieee_std_subnormal

Operations on subnormal numbers are handled in accordance with IEEE 754-2008.

{Zfh_fadd_h_cg, Zfh_fmul_h_cg}/cr_fs1_fs2_edges_frm_H, Zfh_fclass_h_cg/cp_fclass, ZicsrF_cg/cp_underflow_after_rounding_fma_h

ieee_std_tininess

In the parlance of IEEE 754-2008, tininess is detected after rounding.

ZicsrF_cg/{cp_underflow_after_rounding_fma_h, cp_underflow_after_rounding_fmul_h, cp_underflow_after_rounding_fcvt_h_s}

fcvt_unrepresentable_nv

If the rounded result is not representable in the destination format, it is clipped to the nearest value and the invalid flag is set

{Zfh_fcvt_w_h_cg, Zfh_fcvt_wu_h_cg, Zfh_fcvt_l_h_cg, Zfh_fcvt_lu_h_cg}/cr_fs1_edges_frm_H

fcvt_round

All floating-point to integer and integer to floating-point conversion instructions round according to the rm field.

{Zfh_fcvt_w_h_cg, Zfh_fcvt_l_h_cg}/cr_fs1_edges_frm_H, {Zfh_fcvt_h_w_cg, Zfh_fcvt_h_l_cg}/cp_frm_2

fcvt_nx

All floating-point conversion instructions set the Inexact exception flag if the rounded result differs from the operand value and the Invalid exception flag is not set.

Zfh_fcvt_w_h_cg/{cr_fs1_edges_frm_H, cp_csr_fflags_vn}, Zfh_fcvt_h_w_cg/{cp_rs1_edges, cp_csr_fflags_on}

fp_nan_boxing

When multiple floating-point precisions are supported, then valid values of narrower n-bit types, n<FLEN, are represented in the lower n bits of an FLEN-bit NaN value, in a process termed NaN-boxing. The upper bits of a valid NaN-boxed value must be all 1s. Valid NaN-boxed n-bit values therefore appear as negative quiet NaNs (qNaNs) when viewed as any wider m-bit value, n < m ≤ FLEN. Any operation that writes a narrower result to an f register must write all 1s to the uppermost FLEN-n bits to yield a legal NaN-boxed value.

{Zfh_fadd_h_cg, Zfh_fcvt_h_s_cg, Zfh_flh_cg, Zfh_fmv_h_x_cg}/cp_NaNBox_S_H, {ZfhD_fadd_h_cg, ZfhD_fcvt_h_d_cg, ZfhD_flh_cg, ZfhD_fmv_h_x_cg}/cp_NaNBox_D_H

fp_transfer_instrs_narrow_transfer_in

A narrower n-bit transfer, n<FLEN, into the f registers will create a valid NaN-boxed value

{Zfh_flh_cg, Zfh_fmv_h_x_cg}/cp_NaNBox_S_H, {ZfhD_flh_cg, ZfhD_fmv_h_x_cg}/cp_NaNBox_D_H

fp_transfer_instrs_narrow_transfer_out

A narrower n-bit transfer out of the floating-point registers will transfer the lower n bits of the register ignoring the upper FLEN-n bits

Zfh_fsh_cg/cp_fs2_badNB_S_H, Zfh_fmv_x_h_cg/cp_fs1_badNB_S_H, ZfhD_fsh_cg/cp_fs2_badNB_D_H, ZfhD_fmv_x_h_cg/cp_fs1_badNB_D_H

fp_nontransfer_instrs_improper_nan_boxed_input

Apart from transfer operations described in the previous paragraph, all other floating-point operations on narrower n-bit operations, n<FLEN, check if the input operands are correctly NaN-boxed, i.e., all upper FLEN-n bits are 1. If so, the n least-significant bits of the input are used as the input value, otherwise the input value is treated as an n-bit canonical NaN.

Zfh_fadd_h_cg/{cp_fs1_badNB_S_H, cp_fs2_badNB_S_H}, Zfh_fmadd_h_cg/cp_fs3_badNB_S_H, Zfh_fcvt_s_h_cg/cp_fs1_badNB_S_H, ZfhD_fadd_h_cg/{cp_fs1_badNB_D_H, cp_fs2_badNB_D_H}, ZfhD_fmadd_h_cg/cp_fs3_badNB_D_H, ZfhD_fcvt_d_h_cg/cp_fs1_badNB_D_H

Zfh_canonical_nan

For half-precision floating-point, the canonical NaN corresponds to the pattern 0x7e00.

{Zfh_fadd_h_cg, Zfh_fdiv_h_cg}/cr_fs1_fs2_edges_frm_H, Zfh_fsqrt_h_cg/cp_fs1_edges_H, Zfh_fmin_h_cg/cr_fs1_fs2_edges_H, ZfhD_fcvt_h_d_cg/cr_fs1_edges_frm_D

fsh_flh_op

New 16-bit variants of LOAD-FP and STORE-FP instructions are added, encoded with a new value for the funct3 width field.

{Zfh_flh_cg, Zfh_fsh_cg}/{cp_rs1_nx0, cp_imm_edges}

fsh_flh_bits_maintained

FLH and FSH do not modify the bits being transferred; in particular, the payloads of non-canonical NaNs are preserved. FLH NaN-boxes the result written to rd, whereas FSH ignores all but the lower 16 bits in rs2.

Zfh_flh_cg/{cp_memval_fp_half, cp_NaNBox_S_H}, Zfh_fsh_cg/{cp_fs2_edges_H, cp_fs2_badNB_S_H}, ZfhD_flh_cg/cp_NaNBox_D_H, ZfhD_fsh_cg/cp_fs2_badNB_D_H

Zfh_computational_instrs

The half-precision floating-point computational instructions are defined analogously to their single-precision counterparts, but operate on half-precision operands and produce half-precision results.

{Zfh_fadd_h_cg, Zfh_fdiv_h_cg}/cr_fs1_fs2_edges_frm_H, Zfh_fmadd_h_cg/cr_fs1_fs2_edges_frm4_H, Zfh_fsqrt_h_cg/cp_fs1_edges_H

fcvt-w-h_fcvt-l-h_op

FCVT.W.H or FCVT.L.H converts a half-precision floating-point number to a signed 32-bit or 64-bit integer, respectively

{Zfh_fcvt_w_h_cg, Zfh_fcvt_l_h_cg}/{cp_rd, cr_fs1_edges_frm_H}

fcvt-h-w_fcvt-h-l_op

FCVT.H.W or FCVT.H.L converts a 32-bit or 64-bit signed integer, respectively, into a half-precision floating-point number

{Zfh_fcvt_h_w_cg, Zfh_fcvt_h_l_cg}/{cp_fd, cp_rs1_edges}

fcvt-wu-h_fcvt-lu-h_fcvt-h-wu_fcvt-h-lu_op

FCVT.WU.H, FCVT.LU.H, FCVT.H.WU, and FCVT.H.LU variants convert to or from unsigned integer values

{Zfh_fcvt_wu_h_cg, Zfh_fcvt_lu_h_cg}/cr_fs1_edges_frm_H, {Zfh_fcvt_h_wu_cg, Zfh_fcvt_h_lu_cg}/cp_rs1_edges

fcvt_long_half_rv64_only

FCVT.L.H, FCVT.LU.H, FCVT.H.L, and FCVT.H.LU are RV64-only instructions.

{Zfh_fcvt_l_h_cg, Zfh_fcvt_lu_h_cg, Zfh_fcvt_h_l_cg, Zfh_fcvt_h_lu_cg}/cp_asm_count

fcvt-s-h_fcvt-h-s_op

FCVT.S.H or FCVT.H.S converts a half-precision floating-point number to a single-precision floating-point number, or vice-versa, respectively

Zfh_fcvt_h_s_cg/{cp_fd, cr_fs1_edges_frm}, Zfh_fcvt_s_h_cg/{cp_fd, cp_fs1_edges_H}, ZfhD_fcvt_h_s_cg/cp_NaNBox_D_H, ZfhD_fcvt_s_h_cg/{cp_NaNBox_D_S, cp_fs1_badNB_D_H}

fcvt-d-h_fcvt-h-d_op

If the D extension is present, FCVT.D.H or FCVT.H.D converts a half-precision floating-point number to a double-precision floating-point number, or vice-versa, respectively

ZfhD_fcvt_d_h_cg/{cp_fd, cp_fs1_edges_H}, ZfhD_fcvt_h_d_cg/{cp_fd, cr_fs1_edges_frm_D}

fsgnj-h_fsgnjn-h_fsgnjx-h_op

Floating-point to floating-point sign-injection instructions, FSGNJ.H, FSGNJN.H, and FSGNJX.H are defined analogously to the single-precision sign-injection instruction.

{Zfh_fsgnj_h_cg, Zfh_fsgnjn_h_cg, Zfh_fsgnjx_h_cg}/cr_fs1_fs2_edges_H

fmv-x-h_op

FMV.X.H moves the half-precision value in floating-point register rs1 to a representation in the IEEE 754-2008 encoding in integer register rd, filling the upper XLEN-16 bits with copies of the floating-point number’s sign bit

Zfh_fmv_x_h_cg/{cp_rd, cp_fs1, cp_fs1_edges_H}, ZfhD_fmv_x_h_cg/cp_fs1_badNB_D_H

fmv-h-x_op

FMV.H.X moves the half-precision value encoded in the IEEE 754-2008 encoding from the lower 16 bits of integer register rs1 to the floating-point register rd, NaN-boxing the result.

Zfh_fmv_h_x_cg/{cp_rs1, cp_rs1_edges, cp_fd, cp_NaNBox_S_H}, ZfhD_fmv_h_x_cg/cp_NaNBox_D_H

Zfh_compare_instrs

The half-precision floating-point compare instructions are defined analogously to their single-precision counterparts, but operate on half-precision operands.

{Zfh_feq_h_cg, Zfh_flt_h_cg, Zfh_fle_h_cg}/cr_fs1_fs2_edges_H, Zfh_feq_h_cg/cp_csr_fflags_v

fclass-h_op

The half-precision floating-point classify instruction, FCLASS.H, is defined analogously to its single-precision counterpart, but operates on half-precision operands.

Zfh_fclass_h_cg/{cp_rd, cp_fs1, cp_fs1_edges_H, cp_fclass}

UDB Parameters: None.

Zfhmin

The rows of Table 48 with D in the ExtraExtensions column apply only when D is also supported. They cover fcvt.d.h, fcvt.h.d, and NaN-boxing of half-precision values in 64-bit registers.

Table 48. Zfhmin Instruction Coverpoints
Instruction fcvt.h.s fcvt.s.h flh fmv.h.x fmv.x.h fsh fcvt.d.h fcvt.h.d fcvt.h.s fcvt.s.h flh fmv.h.x

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

ExtraExtensions

D

D

D

D

D

D

cp_asm_count

x

x

x

x

x

x

x

x

cp_rs1

nx0

x

nx0

cp_rd

x

cp_rs1_edges

x

cp_imm_edges

x

x

cp_fs1

x

x

x

x

x

cp_fs2

x

cp_fd

x

x

x

x

x

x

cp_fs1_edges

x

H

H

H

frm_D

cp_fs2_edges

H

cmp_fd_fs1

x

x

x

x

cp_frm

2

2

cp_csr_fflags

voun

v

v

voun

cp_csr_frm

x

x

cp_NaNBox

S_H

S_H

S_H

D_H

D_H

D_H

D_H

cp_fs1_badNB

S_H

S_H

D_H

D_H

cp_fs2_badNB

S_H

cp_memval

fp_half

Instruction fmv.x.h fsh

RV32

x

x

RV64

x

x

ExtraExtensions

D

D

cp_fs1_badNB

D_H

cp_fs2_badNB

D_H

Table 49. Zfhmin Normative Rules
Normative Rule Rule Text Coverpoints

ieee_std_tininess

In the parlance of IEEE 754-2008, tininess is detected after rounding.

ZicsrF_cg/cp_underflow_after_rounding_fcvt_h_s

fp_nan_boxing

When multiple floating-point precisions are supported, then valid values of narrower n-bit types, n<FLEN, are represented in the lower n bits of an FLEN-bit NaN value, in a process termed NaN-boxing. The upper bits of a valid NaN-boxed value must be all 1s. Valid NaN-boxed n-bit values therefore appear as negative quiet NaNs (qNaNs) when viewed as any wider m-bit value, n < m ≤ FLEN. Any operation that writes a narrower result to an f register must write all 1s to the uppermost FLEN-n bits to yield a legal NaN-boxed value.

{Zfhmin_flh_cg, Zfhmin_fmv_h_x_cg, Zfhmin_fcvt_h_s_cg}/cp_NaNBox_S_H, {ZfhminD_fcvt_h_d_cg, ZfhminD_fcvt_h_s_cg, ZfhminD_flh_cg, ZfhminD_fmv_h_x_cg}/cp_NaNBox_D_H

fp_transfer_instrs_narrow_transfer_in

A narrower n-bit transfer, n<FLEN, into the f registers will create a valid NaN-boxed value

{Zfhmin_flh_cg, Zfhmin_fmv_h_x_cg}/cp_NaNBox_S_H, {ZfhminD_flh_cg, ZfhminD_fmv_h_x_cg}/cp_NaNBox_D_H

fp_transfer_instrs_narrow_transfer_out

A narrower n-bit transfer out of the floating-point registers will transfer the lower n bits of the register ignoring the upper FLEN-n bits

Zfhmin_fmv_x_h_cg/cp_fs1_badNB_S_H, Zfhmin_fsh_cg/cp_fs2_badNB_S_H, ZfhminD_fmv_x_h_cg/cp_fs1_badNB_D_H, ZfhminD_fsh_cg/cp_fs2_badNB_D_H

fp_nontransfer_instrs_improper_nan_boxed_input

Apart from transfer operations described in the previous paragraph, all other floating-point operations on narrower n-bit operations, n<FLEN, check if the input operands are correctly NaN-boxed, i.e., all upper FLEN-n bits are 1. If so, the n least-significant bits of the input are used as the input value, otherwise the input value is treated as an n-bit canonical NaN.

Zfhmin_fcvt_s_h_cg/cp_fs1_badNB_S_H, {ZfhminD_fcvt_d_h_cg, ZfhminD_fcvt_s_h_cg}/cp_fs1_badNB_D_H

Zfh_canonical_nan

For half-precision floating-point, the canonical NaN corresponds to the pattern 0x7e00.

Zfhmin_fcvt_h_s_cg/cp_fs1_edges, ZfhminD_fcvt_h_d_cg/cr_fs1_edges_frm_D

fsh_flh_op

New 16-bit variants of LOAD-FP and STORE-FP instructions are added, encoded with a new value for the funct3 width field.

{Zfhmin_flh_cg, Zfhmin_fsh_cg}/{cp_rs1_nx0, cp_imm_edges}

fsh_flh_atomic_align

FLH and FSH are only guaranteed to execute atomically if the effective address is naturally aligned.

Not tested: atomicity is not observable in single-hart signature tests

fsh_flh_bits_maintained

FLH and FSH do not modify the bits being transferred; in particular, the payloads of non-canonical NaNs are preserved. FLH NaN-boxes the result written to rd, whereas FSH ignores all but the lower 16 bits in rs2.

Zfhmin_flh_cg/{cp_memval_fp_half, cp_NaNBox_S_H}, Zfhmin_fsh_cg/{cp_fs2_edges_H, cp_fs2_badNB_S_H}, ZfhminD_flh_cg/cp_NaNBox_D_H, ZfhminD_fsh_cg/cp_fs2_badNB_D_H

fcvt-s-h_fcvt-h-s_op

FCVT.S.H or FCVT.H.S converts a half-precision floating-point number to a single-precision floating-point number, or vice-versa, respectively

Zfhmin_fcvt_h_s_cg/{cp_fd, cp_fs1_edges, cp_frm_2}, Zfhmin_fcvt_s_h_cg/cp_fs1_edges_H, ZfhminD_fcvt_h_s_cg/cp_NaNBox_D_H, ZfhminD_fcvt_s_h_cg/cp_fs1_badNB_D_H

fcvt-d-h_fcvt-h-d_op

If the D extension is present, FCVT.D.H or FCVT.H.D converts a half-precision floating-point number to a double-precision floating-point number, or vice-versa, respectively

ZfhminD_fcvt_d_h_cg/{cp_fd, cp_fs1_edges_H}, ZfhminD_fcvt_h_d_cg/{cp_fd, cr_fs1_edges_frm_D}

fcvt-q-h_fcvt-h-q_op

If the Q extension is present, FCVT.Q.H or FCVT.H.Q converts a half-precision floating-point number to a quad-precision floating-point number, or vice-versa, respectively

fmv-x-h_op

FMV.X.H moves the half-precision value in floating-point register rs1 to a representation in the IEEE 754-2008 encoding in integer register rd, filling the upper XLEN-16 bits with copies of the floating-point number’s sign bit

Zfhmin_fmv_x_h_cg/{cp_rd, cp_fs1, cp_fs1_edges_H}, ZfhminD_fmv_x_h_cg/cp_fs1_badNB_D_H

fmv-h-x_op

FMV.H.X moves the half-precision value encoded in the IEEE 754-2008 encoding from the lower 16 bits of integer register rs1 to the floating-point register rd, NaN-boxing the result.

Zfhmin_fmv_h_x_cg/{cp_rs1, cp_rs1_edges, cp_fd, cp_NaNBox_S_H}, ZfhminD_fmv_h_x_cg/cp_NaNBox_D_H

fmv_half_bits_preserved

FMV.X.H and FMV.H.X do not modify the bits being transferred; in particular, the payloads of non-canonical NaNs are preserved.

Zfhmin_fmv_x_h_cg/cp_fs1_edges_H, Zfhmin_fmv_h_x_cg/cp_rs1_edges

Zfhmin

The Zfhmin extension includes the following instructions from the Zfh extension: FLH, FSH, FMV.X.H, FMV.H.X, FCVT.S.H, and FCVT.H.S. If the D extension is present, the FCVT.D.H and FCVT.H.D instructions are also included. If the Q extension is present, the FCVT.Q.H and FCVT.H.Q instructions are additionally included.

{Zfhmin_flh_cg, Zfhmin_fsh_cg, Zfhmin_fmv_x_h_cg, Zfhmin_fcvt_h_s_cg}/cp_asm_count

UDB Parameters: None.

A.7.4. Zfa Additional FP

The rows of Table 50 with an entry in the ExtraExtensions column apply only when those extensions are also supported. The D rows cover the double-precision instructions and NaN-boxing of single-precision values in 64-bit registers, and the Zfh rows cover the half-precision instructions. The Zfh:D rows, which need both Zfh and D, cover NaN-boxing of half-precision values in 64-bit registers. The Zvfh row covers fli.h, which Zfa provides with Zvfh even when Zfh is not supported.

Table 50. Zfa Instruction Coverpoints
Instruction fleq.s fli.s fltq.s fmaxm.s fminm.s fround.s froundnx.s fcvtmod.w.d fleq.d fli.d fltq.d fmaxm.d

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

ExtraExtensions

D

D

D

D

D

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs1

fli

fli

cp_rd

x

x

x

x

x

cp_fs1

x

x

x

x

x

x

x

x

x

x

cp_fs2

x

x

x

x

x

x

x

cp_fd

x

x

x

x

x

x

x

cp_fs1_edges

x

x

x

x

x

x

D

D

D

D

cp_fs2_edges

x

x

x

x

D

D

D

cmp_fd_fs1

x

x

x

x

x

cmp_fd_fs2

x

x

x

cp_frm

2

2

cp_csr_fflags

v

v

v

v

v

vn

vn

v

v

v

cp_csr_frm

x

x

cr_fs1_fs2_edges

x

x

x

x

D

D

D

Instruction fminm.d fmvh.x.d fmvp.d.x fround.d froundnx.d fleq.s fli.s fltq.s fmaxm.s fminm.s fround.s froundnx.s

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

ExtraExtensions

D

D

D

D

D

D

D

D

D

D

D

D

cp_asm_count

x

x

x

x

x

cp_rs1

x

cp_rs2

x

cp_rd

x

cp_rs1_edges

x

cp_rs2_edges

x

cp_fs1

x

x

x

x

cp_fs2

x

cp_fd

x

x

x

x

cp_fs1_edges

D

D

D

D

cp_fs2_edges

D

cmp_fd_fs1

x

x

x

cmp_fd_fs2

x

cp_frm

2

2

cp_csr_fflags

v

v

vn

cp_csr_frm

x

x

cr_fs1_fs2_edges

D

cp_NaNBox

D_S

D_S

D_S

D_S

D_S

cp_fs1_badNB

D_S

D_S

D_S

D_S

D_S

D_S

cp_fs2_badNB

D_S

D_S

D_S

D_S

Instruction fleq.h fli.h fltq.h fmaxm.h fminm.h fround.h froundnx.h fli.h fleq.h fli.h fltq.h fmaxm.h

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

ExtraExtensions

Zfh

Zfh

Zfh

Zfh

Zfh

Zfh

Zfh

Zvfh

Zfh:D

Zfh:D

Zfh:D

Zfh:D

cp_asm_count

x

x

x

x

x

x

x

x

cp_rs1

fli

fli

cp_rd

x

x

cp_fs1

x

x

x

x

x

x

cp_fs2

x

x

x

x

cp_fd

x

x

x

x

x

x

cp_fs1_edges

H

H

H

H

H

H

cp_fs2_edges

H

H

H

H

cmp_fd_fs1

x

x

x

x

cmp_fd_fs2

x

x

cp_frm

2

2

cp_csr_fflags

v

v

v

v

v

vn

cp_csr_frm

x

x

cr_fs1_fs2_edges

H

H

H

H

cp_NaNBox

S_H

S_H

S_H

S_H

S_H

S_H

D_H

D_H

cp_fs1_badNB

S_H

S_H

S_H

S_H

S_H

S_H

D_H

D_H

D_H

cp_fs2_badNB

S_H

S_H

S_H

S_H

D_H

D_H

D_H

Instruction fminm.h fround.h froundnx.h

RV32

x

x

x

RV64

x

x

x

ExtraExtensions

Zfh:D

Zfh:D

Zfh:D

cp_NaNBox

D_H

D_H

D_H

cp_fs1_badNB

D_H

D_H

D_H

cp_fs2_badNB

D_H

Table 51. Zfa Normative Rules
Normative Rule Rule Text Coverpoints

fp_nan_boxing

When multiple floating-point precisions are supported, then valid values of narrower n-bit types, n<FLEN, are represented in the lower n bits of an FLEN-bit NaN value, in a process termed NaN-boxing. The upper bits of a valid NaN-boxed value must be all 1s. Valid NaN-boxed n-bit values therefore appear as negative quiet NaNs (qNaNs) when viewed as any wider m-bit value, n < m ≤ FLEN. Any operation that writes a narrower result to an f register must write all 1s to the uppermost FLEN-n bits to yield a legal NaN-boxed value.

{ZfaD_fli_s_cg, ZfaD_fminm_s_cg, ZfaD_fround_s_cg, ZfaD_froundnx_s_cg}/cp_NaNBox_D_S, {ZfaZfh_fli_h_cg, ZfaZfh_fminm_h_cg, ZfaZfh_fround_h_cg}/cp_NaNBox_S_H, {ZfaZfhD_fli_h_cg, ZfaZfhD_fminm_h_cg, ZfaZfhD_fround_h_cg, ZfaZfhD_froundnx_h_cg}/cp_NaNBox_D_H

fp_nontransfer_instrs_improper_nan_boxed_input

Apart from transfer operations described in the previous paragraph, all other floating-point operations on narrower n-bit operations, n<FLEN, check if the input operands are correctly NaN-boxed, i.e., all upper FLEN-n bits are 1. If so, the n least-significant bits of the input are used as the input value, otherwise the input value is treated as an n-bit canonical NaN.

{ZfaD_fleq_s_cg, ZfaD_fminm_s_cg}/{cp_fs1_badNB_D_S, cp_fs2_badNB_D_S}, {ZfaZfh_fleq_h_cg, ZfaZfh_fminm_h_cg}/{cp_fs1_badNB_S_H, cp_fs2_badNB_S_H}, {ZfaZfhD_fleq_h_cg, ZfaZfhD_fminm_h_cg}/{cp_fs1_badNB_D_H, cp_fs2_badNB_D_H}

fli-s_op

The FLI.S instruction loads one of 32 single-precision floating-point constants, encoded in the rs1 field, into floating-point register rd. The correspondence of rs1 field values and single-precision floating-point values is shown in . FLI.S is encoded like FMV.W.X, but with rs2=1.

Zfa_fli_s_cg/{cp_rs1_fli, cp_fd}

fli-d_op

If the D extension is implemented, FLI.D performs the analogous operation, but loads a double-precision value into floating-point register rd. Note that entry 1 (corresponding to the minimum positive normal value) has a numerically different value for double-precision than for single-precision. FLI.D is encoded like FLI.S, but with fmt=D.

ZfaD_fli_d_cg/{cp_rs1_fli, cp_fd}

fli-q_op

If the Q extension is implemented, FLI.Q performs the analogous operation, but loads a quad-precision value into floating-point register rd. Note that entry 1 (corresponding to the minimum positive normal value) has a numerically different value for quad-precision. FLI.Q is encoded like FLI.S, but with fmt=Q.

fli-h_op

If the Zfh or Zvfh extension is implemented, FLI.H performs the analogous operation, but loads a half-precision floating-point value into register rd. Note that entry 1 (corresponding to the minimum positive normal value) has a numerically different value for half-precision. Furthermore, since 216 is not representable in half-precision floating-point, entry 29 in the table instead loads positive infinity—i.e., it is redundant with entry 30. FLI.H is encoded like FLI.S, but with fmt=H.

ZfaZfh_fli_h_cg/{cp_rs1_fli, cp_fd}, ZfaZvfh_fli_h_cg/{cp_rs1_fli, cp_fd, cp_NaNBox_S_H}, ZfaZfhD_fli_h_cg/cp_NaNBox_D_H

fmaxm-s_fminm-s_op

The FMINM.S and FMAXM.S instructions are defined like the FMIN.S and FMAX.S instructions, except that if either input is NaN, the result is the canonical NaN.

{Zfa_fminm_s_cg, Zfa_fmaxm_s_cg}/{cr_fs1_fs2_edges, cp_csr_fflags_v}

fmaxm-d_fminm-d_op

If the D extension is implemented, FMINM.D and FMAXM.D instructions are analogously defined to operate on double-precision numbers.

{ZfaD_fminm_d_cg, ZfaD_fmaxm_d_cg}/{cr_fs1_fs2_edges_D, cp_csr_fflags_v}

fmaxm-q_fminm-q_op

If the Q extension is implemented, FMINM.Q and FMAXM.Q instructions are analogously defined to operate on quad-precision numbers.

fmaxm-h_fminm-h_op

If the Zfh extension is implemented, FMINM.H and FMAXM.H instructions are analogously defined to operate on half-precision numbers.

{ZfaZfh_fminm_h_cg, ZfaZfh_fmaxm_h_cg}/{cr_fs1_fs2_edges_H, cp_csr_fflags_v}, {ZfaZfhD_fminm_h_cg, ZfaZfhD_fmaxm_h_cg}/{cp_fs1_badNB_D_H, cp_fs2_badNB_D_H}

fround-s_op

The FROUND.S instruction rounds the single-precision floating-point number in floating-point register rs1 to an integer, according to the rounding mode specified in the instruction’s rm field. It then writes that integer, represented as a single-precision floating-point number, to floating-point register rd

Zfa_fround_s_cg/{cp_fs1_edges, cp_frm_2, cp_csr_frm, cp_csr_fflags_v}

fround-s_zero_inf

Zero and infinite inputs are copied to rd unmodified

{Zfa_fround_s_cg, Zfa_froundnx_s_cg}/cp_fs1_edges

fround-s_nan_nv

Signaling NaN inputs cause the invalid operation exception flag to be set; no other exception flags are set

Zfa_fround_s_cg/{cp_fs1_edges, cp_csr_fflags_v}, Zfa_froundnx_s_cg/{cp_fs1_edges, cp_csr_fflags_vn}

froundnx-s_op

The FROUNDNX.S instruction is defined similarly, but it also sets the inexact exception flag if the input differs from the rounded result and is not NaN. FROUNDNX.S is encoded like FCVT.S.D, but with rs2=5.

Zfa_froundnx_s_cg/{cp_fs1_edges, cp_frm_2, cp_csr_frm, cp_csr_fflags_vn}

fround-d_froundnx-d_op

If the D extension is implemented, FROUND.D and FROUNDNX.D instructions are analogously defined to operate on double-precision numbers. They are encoded like FCVT.D.S, but with rs2=4 and 5, respectively,

{ZfaD_fround_d_cg, ZfaD_froundnx_d_cg}/{cp_fs1_edges_D, cp_frm_2}

fround-q_froundnx-q_op

If the Q extension is implemented, FROUND.Q and FROUNDNX.Q instructions are analogously defined to operate on quad-precision numbers. They are encoded like FCVT.Q.S, but with rs2=4 and 5, respectively,

fround-h_froundnx-h_op

If the Zfh extension is implemented, FROUND.H and FROUNDNX.H instructions are analogously defined to operate on half-precision numbers. They are encoded like FCVT.H.S, but with rs2=4 and 5, respectively,

{ZfaZfh_fround_h_cg, ZfaZfh_froundnx_h_cg}/{cp_fs1_edges_H, cp_frm_2}, {ZfaZfhD_fround_h_cg, ZfaZfhD_froundnx_h_cg}/{cp_NaNBox_D_H, cp_fs1_badNB_D_H}

fcvtmod-w-d_op

The FCVTMOD.W.D instruction is defined similarly to the FCVT.W.D instruction, with the following differences. FCVTMOD.W.D always rounds towards zero. Bits 31:0 are taken from the rounded, unbounded two’s complement result, then sign-extended to XLEN bits and written to integer register rd. ±∞ and NaN are converted to zero.

ZfaD_fcvtmod_w_d_cg/{cp_rd, cp_fs1, cp_fs1_edges_D, cp_csr_fflags_vn}

fcvtmod-w-d_flags

Floating-point exception flags are raised the same as they would be for FCVT.W.D with the same input operand.

ZfaD_fcvtmod_w_d_cg/{cp_fs1_edges_D, cp_csr_fflags_vn}

fmvh-x-d_op

For RV32 only, if the D extension is implemented, the FMVH.X.D instruction moves bits 63:32 of floating-point register rs1 into integer register rd. It is encoded in the OP-FP major opcode with funct3=0, rs2=1, and funct7=1110001.

ZfaD_fmvh_x_d_cg/{cp_rd, cp_fs1, cp_fs1_edges_D}

fmvp-d-x_op

For RV32 only, if the D extension is implemented, the FMVP.D.X instruction moves a double-precision number from a pair of integer registers into a floating-point register. Integer registers rs1 and rs2 supply bits 31:0 and 63:32, respectively; the result is written to floating-point register rd. FMVP.D.X is encoded in the OP-FP major opcode with funct3=0 and funct7=1011001.

ZfaD_fmvp_d_x_cg/{cp_rs1_edges, cp_rs2_edges, cp_fd}

fmvh-x-q_op

For RV64 only, if the Q extension is implemented, the FMVH.X.Q instruction moves bits 127:64 of floating-point register rs1 into integer register rd. It is encoded in the OP-FP major opcode with funct3=0, rs2=1, and funct7=1110011.

fmvp-q-x_op

For RV64 only, if the Q extension is implemented, the FMVP.Q.X instruction moves a double-precision number from a pair of integer registers into a floating-point register. Integer registers rs1 and rs2 supply bits 63:0 and 127:64, respectively; the result is written to floating-point register rd. FMVP.Q.X is encoded in the OP-FP major opcode with funct3=0 and funct7=1011011.

fleq-s_fltq-s_op

The FLEQ.S and FLTQ.S instructions are defined like the FLE.S and FLT.S instructions, except that quiet NaN inputs do not cause the invalid operation exception flag to be set.

{Zfa_fleq_s_cg, Zfa_fltq_s_cg}/{cr_fs1_fs2_edges, cp_csr_fflags_v}

fleq-d_fltq-d_op

If the D extension is implemented, FLEQ.D and FLTQ.D instructions are analogously defined to operate on double-precision numbers.

{ZfaD_fleq_d_cg, ZfaD_fltq_d_cg}/{cr_fs1_fs2_edges_D, cp_csr_fflags_v}

fleq-q_fltq-q_op

If the Q extension is implemented, FLEQ.Q and FLTQ.Q instructions are analogously defined to operate on quad-precision numbers.

fleq-h_fltq-h_op

If the Zfh extension is implemented, FLEQ.H and FLTQ.H instructions are analogously defined to operate on half-precision numbers.

{ZfaZfh_fleq_h_cg, ZfaZfh_fltq_h_cg}/{cr_fs1_fs2_edges_H, cp_csr_fflags_v}, {ZfaZfhD_fleq_h_cg, ZfaZfhD_fltq_h_cg}/{cp_fs1_badNB_D_H, cp_fs2_badNB_D_H}

UDB Parameters: None.

Zfbfmin Scalar BF16 Converts
Table 52. Zfbfmin Instruction Coverpoints
Instruction fcvt.bf16.s fcvt.s.bf16 flh fmv.h.x fmv.x.h fsh

RV32

x

x

x

x

x

x

RV64

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

cp_rs1

nx0

x

nx0

cp_rd

x

cp_rs1_edges

x

cp_imm_edges

x

x

cp_fs1

x

x

x

cp_fs2

x

cp_fd

x

x

x

x

cp_fs1_edges

x

BF16

H

cp_fs2_edges

H

cmp_fd_fs1

x

x

cp_frm

2

cp_csr_fflags

voun

v

cp_csr_frm

x

cp_NaNBox

S_H

S_H

S_H

cp_fs1_badNB

S_H

S_H

cp_fs2_badNB

S_H

Table 53. Zfbfmin Normative Rules
Normative Rule Rule Text Coverpoints

fp_nan_boxing

When multiple floating-point precisions are supported, then valid values of narrower n-bit types, n<FLEN, are represented in the lower n bits of an FLEN-bit NaN value, in a process termed NaN-boxing. The upper bits of a valid NaN-boxed value must be all 1s. Valid NaN-boxed n-bit values therefore appear as negative quiet NaNs (qNaNs) when viewed as any wider m-bit value, n < m ≤ FLEN. Any operation that writes a narrower result to an f register must write all 1s to the uppermost FLEN-n bits to yield a legal NaN-boxed value.

{Zfbfmin_fcvt_bf16_s_cg, Zfbfmin_flh_cg, Zfbfmin_fmv_h_x_cg}/cp_NaNBox_S_H

fp_transfer_instrs_narrow_transfer_in

A narrower n-bit transfer, n<FLEN, into the f registers will create a valid NaN-boxed value

{Zfbfmin_flh_cg, Zfbfmin_fmv_h_x_cg}/cp_NaNBox_S_H

fp_transfer_instrs_narrow_transfer_out

A narrower n-bit transfer out of the floating-point registers will transfer the lower n bits of the register ignoring the upper FLEN-n bits

Zfbfmin_fmv_x_h_cg/cp_fs1_badNB_S_H, Zfbfmin_fsh_cg/cp_fs2_badNB_S_H

fp_nontransfer_instrs_improper_nan_boxed_input

Apart from transfer operations described in the previous paragraph, all other floating-point operations on narrower n-bit operations, n<FLEN, check if the input operands are correctly NaN-boxed, i.e., all upper FLEN-n bits are 1. If so, the n least-significant bits of the input are used as the input value, otherwise the input value is treated as an n-bit canonical NaN.

Zfbfmin_fcvt_s_bf16_cg/cp_fs1_badNB_S_H

fsh_flh_op

New 16-bit variants of LOAD-FP and STORE-FP instructions are added, encoded with a new value for the funct3 width field.

{Zfbfmin_flh_cg, Zfbfmin_fsh_cg}/{cp_rs1_nx0, cp_imm_edges}

fmv-x-h_op

FMV.X.H moves the half-precision value in floating-point register rs1 to a representation in the IEEE 754-2008 encoding in integer register rd, filling the upper XLEN-16 bits with copies of the floating-point number’s sign bit

Zfbfmin_fmv_x_h_cg/{cp_rd, cp_fs1, cp_fs1_edges_H}

fmv-h-x_op

FMV.H.X moves the half-precision value encoded in the IEEE 754-2008 encoding from the lower 16 bits of integer register rs1 to the floating-point register rd, NaN-boxing the result.

Zfbfmin_fmv_h_x_cg/{cp_rs1, cp_rs1_edges, cp_fd, cp_NaNBox_S_H}

bf16_subnorm

BF16 computational instructions defined in this chapter support all IEEE 754-2008 features, including all rounding modes, subnormal inputs and outputs, overflow and underflow, and default exception handling. Tininess is detected after rounding.

Zfbfmin_fcvt_bf16_s_cg/{cp_fs1_edges, cp_frm_2, cp_csr_fflags_voun}

bf16_canonical_nan

For BF16, the canonical NaN corresponds to the pattern 0x7fc0.

Zfbfmin_fcvt_bf16_s_cg/cp_fs1_edges

fcvt-bf16-s_op

Narrowing convert FP32 value to a BF16 value. Round according to the RM field.

Zfbfmin_fcvt_bf16_s_cg/{cp_fd, cp_fs1_edges, cp_frm_2, cp_csr_frm}

fcvt-s-bf16_op

Converts a BF16 value to an FP32 value. The conversion is exact.

Zfbfmin_fcvt_s_bf16_cg/{cp_fd, cp_fs1_edges_BF16, cp_csr_fflags_v}

UDB Parameters: None.

A.7.5. ZicsrF Floating-Point CSRs

These test additional CSRs that exist when floating-point is supported. Although these tests, like most privileged tests, are generated from a spreadsheet and manual coverpoints rather than a CSV, they do not assume any privileged capabilities, including the existence of machine mode. Hence they are compatible with RVI20 and simple cores that lack privileged modes.

Note that this suite also tests that the underflow flag is set only if the result is tiny after rounding, per the RISC-V spec.

Table 54. ZicsrF Coverpoints
Coverpoint Goal Feature Description Normative Rule

cp_fcsr_access

Writing to the CSR field
(WARL)

csr read, write all 1s, write all 0s, set all 1s, clear all 1s, write back initial value of each register: fcsr, fflags, frm

fcsr_op_sz_acc
fcsr_rsv

cp_fcsr_frm_write

Writing to the CSR field
(WARL)

Write 0-7 to fcsr.frm and read back fcsr and frm and fflags

fflags_op_sz_acc
frm_op_sz_acc

cp_fcsr_fflags_write

Writing to the CSR field
(WARL)

Write 0-31 to fcsr.fflags and read back fcsr and frm and fflags

fflags_op_sz_acc
frm_op_sz_acc

cp_fcsr_walk

Writing to the CSR field
(WARL)

Write walking 1s to fcsr, frm, fflags

fcsr_op_sz_acc
fcsr_rsv

cp_frm_write

Writing to the CSR field
(WARL)

Write 0-7 to frm and read back fcsr, frm, fflags

fflags_op_sz_acc
frm_op_sz_acc

cp_fflags_write

Writing to the CSR field
(WARL)

write 0-31 to fflags and read back fflags, frm, fcsr

fflags_op_sz_acc
frm_op_sz_acc

csr_fflags_set_m_*

Writing to the CSR field
(WARL)

Reset fflags to 0, then execute following instructions: 1/0 (DivZero), 1/3 (Inexact), largest + largest (overflow), smallest * smallest (underflow), infinity - infinity (invalid)

cp_underflow_after_rounding

Test each of the following floating-point operations does not set the underflow flag, even though it would if underflow were detected before rounding. Note that these test cases are obtained from TestFloat.
fma.s.rdn 3F00FBFF x 80000001 + 807FFFFF = 80800000
fmul.s.rup 00800001 x 3F7FFFFE = 00800000
if D supported:
fma.d.rup 802FFFFFFFBFFEFF x 000FFFFFFFFFFFFE + 0010000000000000 = 0010000000000000
fmul.rdn 0010000000000001 x BFEFFFFFFFFFFFFE = 8010000000000000
fcvt.s.d.rne B80FFFFFFFFDFEFF = 80800000
if Q supported:
fma.q.rdn 3F9800000000000001FFFFFFFF7FFFFE x 00000000000000000000000000000001 + 80010000000000000000000000000000 = 80010000000000000000000000000000
fmul.q.rne 0000FFFFFFFFFFFFFFFFFFFFFFFFFFFF x 3FFF0000000000000000000000000001 = 00010000000000000000000000000000
fcvt.s.q.rup 3F80FFFFFFFE0000000000FFFFFFFFFF = 00800000
If Zfh supported:
fma.h.rne 0BC7 x 03FF + 8400 = 8400
fmul.h.rup 0401 x 3BF8 = 0400
fcvt.h.s.rne 387FF000 = *
Notes:
sqrt, add, sub cannot cause underflow so are not tested
TODO: Adding division underflow tests would be good
No Zfa tests cause underflow

ieee_std_tininess
fcvt_float_rounding
ieee_std_subnormal

These are unprivileged tests that should never trap. Suitable for RVI20 and other systems with no machine mode.

Tests run in M mode with mstatus.FS = 11 if Sm is supported, or else mode is not set

fdiv.h.rne 07FF 4000 = 03FF

Table 55. ZicsrF Normative Rules
Normative Rule Rule Text Coverpoints

fcsr_op_sz_acc

The floating-point CSR, fcsr, is a 32-bit read/write register that selects the dynamic rounding mode for floating-point arithmetic operations and holds the accrued exception flags, as shown in .

ZicsrF_cg/{cp_fcsr_access, cp_fcsr_walk}, F_fadd_s_cg/cp_csr_frm

fcsr_rsv

Bits 31‍–‍8 of the fcsr are reserved for other standard extensions. If these extensions are not present, implementations shall ignore writes to these bits and supply a zero value when read. Standard software should preserve the contents of these bits.

ZicsrF_cg/{cp_fcsr_walk, cp_fcsr_access}

fflags_op_sz_acc, frm_op_sz_acc

fflags_op_sz_acc: The fflags CSR contains the Accrued Exception Flags field (fcsr bits 4&#8205;&#8211;&#8205;0), zero-extended. frm_op_sz_acc: The frm CSR contains the Rounding Mode field (fcsr bits 7&#8205;&#8211;&#8205;5), zero-extended.

ZicsrF_cg/{cp_fcsr_frm_write, cp_frm_write, cp_fcsr_fflags_write, cp_fflags_write, cp_fcsr_swap}

dyn_round_enc

Rounding Mode|Mnemonic|Meaning === 000|RNE|Round to Nearest, ties to Even¶001|RTZ|Round towards Zero¶010|RDN|Round Down (towards −∞)¶011|RUP|Round Up (towards +∞)¶100|RMM|Round to Nearest, ties to Max Magnitude¶101||Reserved for future use.¶110||Reserved for future use.¶111|DYN|In instruction’s rm field, selects dynamic rounding mode; In Rounding Mode register, reserved. ===

ZicsrF_cg/cp_frm_reserved_static_rm, F_fadd_s_cg/cp_csr_frm

roundingmode_dynamic

Floating-point operations use either a static rounding mode encoded in the instruction, or a dynamic rounding mode held in frm. Rounding modes are encoded as shown in norm:dyn_round_enc. A value of 111 in the instruction’s rm field selects the dynamic rounding mode held in frm

ZicsrF_cg/cp_frm_reserved_static_rm, F_fadd_s_cg/{cp_frm_3, cp_csr_frm}

fcsr_fflags_op

The accrued exception flags indicate the exception conditions that have arisen on any floating-point arithmetic instruction since the field was last reset by software, as shown in bitdef

ZicsrF_cg/{cp_fflags_set_m_NV, cp_fflags_set_m_DZ, cp_fflags_set_m_OF, cp_fflags_set_m_UF, cp_fflags_set_m_NX}, F_fdiv_s_cg/cp_csr_fflags_vdoun

ieee_std_subnormal

Operations on subnormal numbers are handled in accordance with IEEE 754-2008.

ZicsrF_cg/cp_underflow_after_rounding_fma_s

ieee_std_tininess

In the parlance of IEEE 754-2008, tininess is detected after rounding.

ZicsrF_cg/{cp_underflow_after_rounding_fma_s, cp_underflow_after_rounding_fmul_s}

UDB Parameters: None.

A.8. Zb* Bit Manipulation Extensions

A.8.1. Zba Bit-Manipulation for Addressing

Table 56. Zba Instruction Coverpoints
Instruction add.uw sh1add sh1add.uw sh2add sh2add.uw sh3add sh3add.uw slli.uw

RV32

x

x

x

RV64

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

cp_rs1

x

x

x

x

x

x

x

x

cp_rs2

x

x

x

x

x

x

x

cp_rd

x

x

x

x

x

x

x

x

cp_rs1_edges

x

x

x

x

x

x

x

x

cp_rs2_edges

x

x

x

x

x

x

x

cr_rs1_rs2_edges

x

x

x

x

x

x

x

cmp_rs1_rs2

x

x

x

x

x

x

x

cmp_rd_rs1

x

x

x

x

x

x

x

x

cmp_rd_rs2

x

x

x

x

x

x

x

cmp_rd_rs1_rs2

x

x

x

x

x

x

x

cp_uimm

x

cr_rs1_imm_edges

uimm

Table 57. Zba Normative Rules
Normative Rule Rule Text Coverpoints

Zba_insns_tbl

RV32|RV64|Mnemonic|Instruction === |✓|ADD.UW rd, rs1, rs2|¶✓|✓|SH1ADD rd, rs1, rs2|¶|✓|SH1ADD.UW rd, rs1, rs2|¶✓|✓|SH2ADD rd, rs1, rs2|¶|✓|SH2ADD.UW rd, rs1, rs2|¶✓|✓|SH3ADD rd, rs1, rs2|¶|✓|SH3ADD.UW rd, rs1, rs2|¶|✓|SLLI.UW rd, rs1, imm| ===

{Zba_sh1add_cg, Zba_sh2add_cg, Zba_sh3add_cg, Zba_add_uw_cg}/cp_asm_count

bitmanip_rv32_rv64

The bitmanip extensions are defined for RV32 and RV64.

Zba_sh1add_cg/cr_rs1_rs2_edges

bitmanip_uw_suffix_semantics

Bitmanip instructions with the suffix .UW have one operand that is an unsigned 32-bit value that is extracted from the least-significant 32 bits of the specified register. Other than that, these perform full-XLEN operations.

{Zba_add_uw_cg, Zba_sh1add_uw_cg}/cr_rs1_rs2_edges, Zba_slli_uw_cg/cr_rs1_imm_edges_uimm

slli-uw_op

Operation

Zba_slli_uw_cg/cr_rs1_imm_edges_uimm

sh1add_enc

Encoding

Zba_sh1add_cg/cr_rs1_rs2_edges

sh1add_op

Operation

Zba_sh1add_cg/cr_rs1_rs2_edges

sh1add-uw_enc

Encoding

Zba_sh1add_uw_cg/cr_rs1_rs2_edges

sh1add-uw_op

Operation

Zba_sh1add_uw_cg/cr_rs1_rs2_edges

sh2add_enc

Encoding

Zba_sh2add_cg/cr_rs1_rs2_edges

sh2add_op

Operation

Zba_sh2add_cg/cr_rs1_rs2_edges

sh2add-uw_enc

Encoding

Zba_sh2add_uw_cg/cr_rs1_rs2_edges

sh2add-uw_op

Operation

Zba_sh2add_uw_cg/cr_rs1_rs2_edges

sh3add_enc

Encoding

Zba_sh3add_cg/cr_rs1_rs2_edges

sh3add_op

Operation

Zba_sh3add_cg/cr_rs1_rs2_edges

sh3add-uw_enc

Encoding

Zba_sh3add_uw_cg/cr_rs1_rs2_edges

sh3add-uw_op

Operation

Zba_sh3add_uw_cg/cr_rs1_rs2_edges

add-uw_enc

Encoding

Zba_add_uw_cg/cr_rs1_rs2_edges

add-uw_op

Operation

Zba_add_uw_cg/cr_rs1_rs2_edges

slli-uw_enc

Encoding

Zba_slli_uw_cg/cr_rs1_imm_edges_uimm

UDB Parameters: None.

A.8.2. Zbb Basic Bit-Manipulation

Table 58. Zbb Instruction Coverpoints
Instruction andn clz clzw cpop cpopw ctz ctzw max maxu min minu orc.b

RV32

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs1

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs2

x

x

x

x

x

cp_rd

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs1_edges

x

walkone

walkonew

walkmask

walkmaskw

walkone

walkonew

x

x

x

x

orcb

cp_rs2_edges

x

x

x

x

x

cr_rs1_rs2_edges

x

x

x

x

x

cmp_rs1_rs2

x

x

x

x

x

cmp_rd_rs1

x

x

x

x

x

x

x

x

x

x

x

x

cmp_rd_rs2

x

x

x

x

x

cmp_rd_rs1_rs2

x

x

x

x

x

Instruction orn rev8 rol rolw ror rori roriw rorw sext.b sext.h xnor zext.h

RV32

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs1

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs2

x

x

x

x

x

x

cp_rd

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs1_edges

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs2_edges

x

x

x

x

x

x

cr_rs1_rs2_edges

x

x

x

x

x

x

cmp_rs1_rs2

x

x

x

x

x

x

cmp_rd_rs1

x

x

x

x

x

x

x

x

x

x

x

x

cmp_rd_rs2

x

x

x

x

x

x

cmp_rd_rs1_rs2

x

x

x

x

x

x

cp_uimm

x

5

cr_rs1_imm_edges

uimm

uimmw

Table 59. Zbb Normative Rules
Normative Rule Rule Text Coverpoints

bitmanip_w_suffix_semantics

The bitmanip extension follows the convention in RV64 that *W-suffixed instructions (without a dot before the W) ignore the upper 32 bits of their inputs, operate on the least-significant 32 bits as signed values, and produce a 32-bit signed result that is sign-extended to XLEN.

Zbb_clzw_cg/cp_rs1_edges_walkonew, Zbb_cpopw_cg/cp_rs1_edges_walkmaskw, Zbb_rolw_cg/cr_rs1_rs2_edges, Zbb_roriw_cg/cr_rs1_imm_edges_uimmw

bitmanip_bhw_suffix_semantics

Bitmanip instructions with the suffixes .B, .H, and .W only look at the least-significant 8 bits, 16 bits, and 32 bits of the input (respectively) and produce an XLEN-wide result that is sign-extended or zero-extended, based on the specific instruction.

Zbb_orc_b_cg/cp_rs1_edges_orcb, {Zbb_sext_b_cg, Zbb_sext_h_cg}/cp_rs1_edges

B_extension_composition

The B standard extension comprises instructions provided by the Zba, Zbb, and Zbs extensions.

Definition, checked through UDB

Zbb_sign_zero_extension_function

These instructions perform the sign extension or zero extension of the least-significant 8 bits or 16 bits of the source register.

{Zbb_sext_b_cg, Zbb_sext_h_cg, Zbb_zext_h_cg}/cp_rs1_edges

Zbb_rotate_semantics

where the shift-logical instructions shift in zeros, the rotate instructions shift in the bits that were shifted out of the other side of the value.

{Zbb_rol_cg, Zbb_ror_cg}/cr_rs1_rs2_edges, Zbb_rori_cg/cr_rs1_imm_edges_uimm

Zbb_orc-b_semantics

ORC.B sets the bits of each byte in the result rd to all zeros if no bit within the respective byte of rs is set, or to all ones if any bit within the respective byte of rs is set.

Zbb_orc_b_cg/cp_rs1_edges_orcb

andn_enc

Encoding

Zbb_andn_cg/cr_rs1_rs2_edges

andn_op

Operation

Zbb_andn_cg/cr_rs1_rs2_edges

clz_enc

Encoding

Zbb_clz_cg/cp_rs1_edges_walkone

clz_op

Operation

Zbb_clz_cg/cp_rs1_edges_walkone

clzw_enc

Encoding

Zbb_clzw_cg/cp_rs1_edges_walkonew

clzw_op

Operation

Zbb_clzw_cg/cp_rs1_edges_walkonew

cpop_enc

Encoding

Zbb_cpop_cg/cp_rs1_edges_walkmask

cpop_op

Operation

Zbb_cpop_cg/cp_rs1_edges_walkmask

cpopw_enc

Encoding

Zbb_cpopw_cg/cp_rs1_edges_walkmaskw

cpopw_op

Operation

Zbb_cpopw_cg/cp_rs1_edges_walkmaskw

ctz_enc

Encoding

Zbb_ctz_cg/cp_rs1_edges_walkone

ctz_op

Operation

Zbb_ctz_cg/cp_rs1_edges_walkone

ctzw_enc

Encoding

Zbb_ctzw_cg/cp_rs1_edges_walkonew

ctzw_op

Operation

Zbb_ctzw_cg/cp_rs1_edges_walkonew

max_enc

Encoding

Zbb_max_cg/cr_rs1_rs2_edges

max_op

Operation

Zbb_max_cg/cr_rs1_rs2_edges

maxu_enc

Encoding

Zbb_maxu_cg/cr_rs1_rs2_edges

maxu_op

Operation

Zbb_maxu_cg/cr_rs1_rs2_edges

min_enc

Encoding

Zbb_min_cg/cr_rs1_rs2_edges

min_op

Operation

Zbb_min_cg/cr_rs1_rs2_edges

minu_enc

Encoding

Zbb_minu_cg/cr_rs1_rs2_edges

minu_op

Operation

Zbb_minu_cg/cr_rs1_rs2_edges

orc-b_enc

Encoding

Zbb_orc_b_cg/cp_rs1_edges_orcb

orc-b_op

Operation

Zbb_orc_b_cg/cp_rs1_edges_orcb

orn_enc

Encoding

Zbb_orn_cg/cr_rs1_rs2_edges

orn_op

Operation

Zbb_orn_cg/cr_rs1_rs2_edges

rev8_rv32_enc

Encoding (RV32)

Zbb_rev8_cg/cp_rs1_edges

rev8_rv64_enc

Encoding (RV64)

Zbb_rev8_cg/cp_rs1_edges

rev8_op

Operation

Zbb_rev8_cg/cp_rs1_edges

rol_enc

Encoding

Zbb_rol_cg/cr_rs1_rs2_edges

rol_op

Operation

Zbb_rol_cg/cr_rs1_rs2_edges

rolw_enc

Encoding

Zbb_rolw_cg/cr_rs1_rs2_edges

rolw_op

Operation

Zbb_rolw_cg/cr_rs1_rs2_edges

ror_enc

Encoding

Zbb_ror_cg/cr_rs1_rs2_edges

ror_op

Operation

Zbb_ror_cg/cr_rs1_rs2_edges

rori_rv32_enc

Encoding (RV32)

Zbb_rori_cg/cr_rs1_imm_edges_uimm

rori_rv64_enc

Encoding (RV64)

Zbb_rori_cg/cr_rs1_imm_edges_uimm

rori_op

Operation

Zbb_rori_cg/cr_rs1_imm_edges_uimm

roriw_enc

Encoding

Zbb_roriw_cg/cr_rs1_imm_edges_uimmw

roriw_op

Operation

Zbb_roriw_cg/cr_rs1_imm_edges_uimmw

rorw_enc

Encoding

Zbb_rorw_cg/cr_rs1_rs2_edges

rorw_op

Operation

Zbb_rorw_cg/cr_rs1_rs2_edges

sext-b_enc

Encoding

Zbb_sext_b_cg/cp_rs1_edges

sext-b_op

Operation

Zbb_sext_b_cg/cp_rs1_edges

sext-h_enc

Encoding

Zbb_sext_h_cg/cp_rs1_edges

sext-h_op

Operation

Zbb_sext_h_cg/cp_rs1_edges

xnor_enc

Encoding

Zbb_xnor_cg/cr_rs1_rs2_edges

xnor_op

Operation

Zbb_xnor_cg/cr_rs1_rs2_edges

zext-h_rv32_enc

Encoding (RV32)

Zbb_zext_h_cg/cp_rs1_edges

zext-h_rv64_enc

Encoding (RV64)

Zbb_zext_h_cg/cp_rs1_edges

zext-h_op

Operation

Zbb_zext_h_cg/cp_rs1_edges

UDB Parameters: None.

A.8.3. Zbc Carry-less Multiplication

Table 60. Zbc Instruction Coverpoints
Instruction clmul clmulh clmulr

RV32

x

x

x

RV64

x

x

x

cp_asm_count

x

x

x

cp_rs1

x

x

x

cp_rs2

x

x

x

cp_rd

x

x

x

cp_rs1_edges

x

x

x

cp_rs2_edges

x

x

x

cr_rs1_rs2_edges

x

x

x

cmp_rs1_rs2

x

x

x

cmp_rd_rs1

x

x

x

cmp_rd_rs2

x

x

x

cmp_rd_rs1_rs2

x

x

x

Table 61. Zbc Normative Rules
Normative Rule Rule Text Coverpoints

Zbc_clmul_clmulh_results

CLMUL produces the lower half of the carry-less product and CLMULH produces the upper half of the 2×XLEN carry-less product.

Zbc_clmul_cg/cr_rs1_rs2_edges, Zbc_clmulh_cg/cr_rs1_rs2_edges

Zbc_clmulr_results

CLMULR produces bits 2×XLEN−2:XLEN-1 of the 2×XLEN carry-less product.

Zbc_clmulr_cg/cr_rs1_rs2_edges

clmul_enc

Encoding

Zbc_clmul_cg/cr_rs1_rs2_edges

clmul_op

Operation

Zbc_clmul_cg/cr_rs1_rs2_edges

clmulh_enc

Encoding

Zbc_clmulh_cg/cr_rs1_rs2_edges

clmulh_op

Operation

Zbc_clmulh_cg/cr_rs1_rs2_edges

clmulr_enc

Encoding

Zbc_clmulr_cg/cr_rs1_rs2_edges

clmulr_op

Operation

Zbc_clmulr_cg/cr_rs1_rs2_edges

UDB Parameters: None.

A.8.4. Zbs Single-Bit Manipulation

Table 62. Zbs Instruction Coverpoints
Instruction bclr bclri bext bexti binv binvi bset bseti

RV32

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

cp_rs1

x

x

x

x

x

x

x

x

cp_rs2

x

x

x

x

cp_rd

x

x

x

x

x

x

x

x

cp_rs1_edges

x

x

x

x

x

x

x

x

cp_rs2_edges

x

x

x

x

cr_rs1_rs2_edges

x

x

x

x

cmp_rs1_rs2

x

x

x

x

cmp_rd_rs1

x

x

x

x

x

x

x

x

cmp_rd_rs2

x

x

x

x

cmp_rd_rs1_rs2

x

x

x

x

cp_uimm

x

x

x

x

cr_rs1_imm_edges

uimm

uimm

uimm

uimm

Table 63. Zbs Normative Rules
Normative Rule Rule Text Coverpoints

Zbs_single_bit_functionality

The single-bit instructions provide a mechanism to set, clear, invert, or extract a single bit in a register. The bit is specified by its index.

{Zbs_bset_cg, Zbs_bclr_cg, Zbs_binv_cg}/cr_rs1_rs2_edges, Zbs_bexti_cg/cr_rs1_imm_edges_uimm

bclr_enc

Encoding

Zbs_bclr_cg/cr_rs1_rs2_edges

bclr_op

Operation

Zbs_bclr_cg/cr_rs1_rs2_edges

bclri_rv32_enc

Encoding (RV32)

Zbs_bclri_cg/cr_rs1_imm_edges_uimm

bclri_rv64_enc

Encoding (RV64)

Zbs_bclri_cg/cr_rs1_imm_edges_uimm

bclri_op

Operation

Zbs_bclri_cg/cr_rs1_imm_edges_uimm

bext_enc

Encoding

Zbs_bext_cg/cr_rs1_rs2_edges

bext_op

Operation

Zbs_bext_cg/cr_rs1_rs2_edges

bexti_rv32_enc

Encoding (RV32)

Zbs_bexti_cg/cr_rs1_imm_edges_uimm

bexti_rv64_enc

Encoding (RV64)

Zbs_bexti_cg/cr_rs1_imm_edges_uimm

bexti_op

Operation

Zbs_bexti_cg/cr_rs1_imm_edges_uimm

binv_enc

Encoding

Zbs_binv_cg/cr_rs1_rs2_edges

binv_op

Operation

Zbs_binv_cg/cr_rs1_rs2_edges

binvi_rv32_enc

Encoding (RV32)

Zbs_binvi_cg/cr_rs1_imm_edges_uimm

binvi_rv64_enc

Encoding (RV64)

Zbs_binvi_cg/cr_rs1_imm_edges_uimm

binvi_op

Operation

Zbs_binvi_cg/cr_rs1_imm_edges_uimm

bset_enc

Encoding

Zbs_bset_cg/cr_rs1_rs2_edges

bset_op

Operation

Zbs_bset_cg/cr_rs1_rs2_edges

bseti_rv32_enc

Encoding (RV32)

Zbs_bseti_cg/cr_rs1_imm_edges_uimm

bseti_rv64_enc

Encoding (RV64)

Zbs_bseti_cg/cr_rs1_imm_edges_uimm

bseti_op

Operation

Zbs_bseti_cg/cr_rs1_imm_edges_uimm

UDB Parameters: None.

A.8.5. Zbkb Bit-Manipulation for Cryptography

Table 64. Zbkb Instruction Coverpoints
Instruction andn brev8 orn pack packh packw rev8 rol rolw ror rori roriw

RV32

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs1

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs2

x

x

nx0

x

nx0

x

x

x

cp_rd

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs1_edges

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs2_edges

x

x

x

x

x

x

x

x

cr_rs1_rs2_edges

x

x

x

x

x

x

x

x

cmp_rs1_rs2

x

x

nx0

x

nx0

x

x

x

cmp_rd_rs1

x

x

x

x

x

x

x

x

x

x

cmp_rd_rs2

x

x

nx0

x

nx0

x

x

x

cmp_rd_rs1_rs2

x

x

nx0

x

nx0

x

x

x

cp_uimm

x

5

cr_rs1_imm_edges

uimm

uimmw

Instruction rorw unzip xnor zip

RV32

x

x

x

RV64

x

x

cp_asm_count

x

x

x

x

cp_rs1

x

x

x

x

cp_rs2

x

x

cp_rd

x

x

x

x

cp_rs1_edges

x

x

x

x

cp_rs2_edges

x

x

cr_rs1_rs2_edges

x

x

cmp_rs1_rs2

x

x

cmp_rd_rs1

x

x

x

x

cmp_rd_rs2

x

x

cmp_rd_rs1_rs2

x

x

Table 65. Zbkb Normative Rules
Normative Rule Rule Text Coverpoints

Zbkb_insns_tbl

RV32|RV64|Mnemonic|Instruction === ✓|✓|ROL|¶|✓|ROLW|¶✓|✓|ROR|¶✓|✓|RORI|¶|✓|RORIW|¶|✓|RORW|¶✓|✓|ANDN|¶✓|✓|ORN|¶✓|✓|XNOR|¶✓|✓|PACK|¶✓|✓|PACKH|¶|✓|PACKW|¶✓|✓|BREV8|¶✓|✓|REV8|¶✓||ZIP|¶✓||UNZIP| ===

{Zbkb_rol_cg, Zbkb_andn_cg, Zbkb_pack_cg, Zbkb_brev8_cg}/cp_asm_count

pack_enc

Encoding

Zbkb_pack_cg/cr_rs1_rs2_edges

pack_op

Operation

Zbkb_pack_cg/cr_rs1_rs2_edges

packh_enc

Encoding

Zbkb_packh_cg/cr_rs1_rs2_edges

packh_op

Operation

Zbkb_packh_cg/cr_rs1_rs2_edges

packw_enc

Encoding

Zbkb_packw_cg/cr_rs1_rs2_edges

packw_op

Operation

Zbkb_packw_cg/cr_rs1_rs2_edges

brev8_enc

Encoding

Zbkb_brev8_cg/cp_rs1_edges

brev8_op

Operation

Zbkb_brev8_cg/cp_rs1_edges

unzip_enc

Encoding

Zbkb_unzip_cg/cp_rs1_edges

unzip_op

Operation

Zbkb_unzip_cg/cp_rs1_edges

zip_enc

Encoding

Zbkb_zip_cg/cp_rs1_edges

zip_op

Operation

Zbkb_zip_cg/cp_rs1_edges

UDB Parameters: None.

See also normative rules from Zbb.

A.8.6. Zbkc Carry-less Multiplication for Cryptography

Table 66. Zbkc Instruction Coverpoints
Instruction clmul clmulh

RV32

x

x

RV64

x

x

cp_asm_count

x

x

cp_rs1

x

x

cp_rs2

x

x

cp_rd

x

x

cp_rs1_edges

x

x

cp_rs2_edges

x

x

cr_rs1_rs2_edges

x

x

cmp_rs1_rs2

x

x

cmp_rd_rs1

x

x

cmp_rd_rs2

x

x

cmp_rd_rs1_rs2

x

x

Table 67. Zbkc Normative Rules
Normative Rule Rule Text Coverpoints

Zbkc_insns

This extension is a subset of the Zbc extension, and only provides CLMUL and CLMULH.

{Zbkc_clmul_cg, Zbkc_clmulh_cg}/cr_rs1_rs2_edges

UDB Parameters: None.

See also normative rules from Zbc.

A.8.7. Zbkx Permutation

Table 68. Zbkx Instruction Coverpoints
Instruction xperm4 xperm8

RV32

x

x

RV64

x

x

cp_asm_count

x

x

cp_rs1

x

x

cp_rs2

x

x

cp_rd

x

x

cp_rs1_edges

x

x

cp_rs2_edges

x

x

cr_rs1_rs2_edges

x

x

cmp_rs1_rs2

x

x

cmp_rd_rs1

x

x

cmp_rd_rs2

x

x

cmp_rd_rs1_rs2

x

x

Table 69. Zbkx Normative Rules
Normative Rule Rule Text Coverpoints

Zbkx_lookup_table_model

These instructions implement a lookup table for 4- and 8-bit elements inside the general purpose registers.

{Zbkx_xperm4_cg, Zbkx_xperm8_cg}/cr_rs1_rs2_edges

Zbkx_indexing_behavior

Each element of the result is formed by using the corresponding index element from rs2 to select an element from rs1, or zero if the index element is out of bounds.

{Zbkx_xperm4_cg, Zbkx_xperm8_cg}/cr_rs1_rs2_edges

xperm8_enc

Encoding

Zbkx_xperm8_cg/cr_rs1_rs2_edges

xperm8_op

Operation

Zbkx_xperm8_cg/cr_rs1_rs2_edges

xperm4_enc

Encoding

Zbkx_xperm4_cg/cr_rs1_rs2_edges

xperm4_op

Operation

Zbkx_xperm4_cg/cr_rs1_rs2_edges

UDB Parameters: None.

A.9. Zk* Cryptographic Extensions

A.9.1. Zkne NIST AES Encryption

Table 70. Zkne Instruction Coverpoints
Instruction aes32esi aes32esmi aes64es aes64esm aes64ks1i aes64ks2

RV32

x

x

RV64

x

x

x

x

cp_asm_count

x

x

x

x

x

x

cp_rs1

x

x

x

x

x

x

cp_rs2

x

x

x

x

x

cp_rd

x

x

x

x

x

x

cp_rs1_edges

x

x

x

x

x

x

cp_rs2_edges

x

x

x

x

x

cr_rs1_rs2_edges

x

x

x

x

x

cmp_rs1_rs2

x

x

x

x

x

cmp_rd_rs1

x

x

x

x

x

x

cmp_rd_rs2

x

x

x

x

x

cmp_rd_rs1_rs2

x

x

x

x

x

cp_bs

x

x

cp_rnum

x

cp_sbox

x

x

x

x

rs1

Table 71. Zkne Normative Rules
Normative Rule Rule Text Coverpoints

Zkn_impl_all

A core which implements Zkn must implement all of the above extensions.

Definition, checked through UDB

Zk_impl_all

A core which implements Zk must implement all of the above extensions.

Definition, checked through UDB

Zk_scalar_xreg_op

All instructions described herein use the general-purpose x registers, and obey the 2-read-1-write register access constraint.

{Zkne_aes32esi_cg, Zkne_aes64es_cg}/{cr_rs1_rs2_edges}

aes32esi_enc

Encoding

Zkne_aes32esi_cg/{cr_rs1_rs2_edges}

aes32esi_op

Operation

Zkne_aes32esi_cg/{cr_rs1_rs2_edges, cp_bs, cp_sbox}

aes32esmi_enc

Encoding

Zkne_aes32esmi_cg/{cr_rs1_rs2_edges, cp_bs, cp_sbox}

aes32esmi_op

Operation

Zkne_aes32esmi_cg/{cr_rs1_rs2_edges, cp_bs, cp_sbox}

aes64es_enc

Encoding

Zkne_aes64es_cg/{cr_rs1_rs2_edges, cp_sbox}

aes64es_op

Operation

Zkne_aes64es_cg/{cr_rs1_rs2_edges, cp_sbox}

aes64esm_enc

Encoding

Zkne_aes64esm_cg/{cr_rs1_rs2_edges, cp_sbox}

aes64esm_op

Operation

Zkne_aes64esm_cg/{cr_rs1_rs2_edges, cp_sbox}

aes64ks1i_enc

Encoding

Zkne_aes64ks1i_cg/{cp_rs1_edges, cp_rnum, cp_sbox_rs1}

aes64ks1i_op

Operation

Zkne_aes64ks1i_cg/{cp_rs1_edges, cp_rnum, cp_sbox_rs1}

aes64ks2_enc

Encoding

Zkne_aes64ks2_cg/cr_rs1_rs2_edges

aes64ks2_op

Operation

Zkne_aes64ks2_cg/cr_rs1_rs2_edges

UDB Parameters: None.

A.9.2. Zknd NIST AES Decryption

Table 72. Zknd Instruction Coverpoints
Instruction aes32dsi aes32dsmi aes64ds aes64dsm aes64im aes64ks1i aes64ks2

RV32

x

x

RV64

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

cp_rs1

x

x

x

x

x

x

x

cp_rs2

x

x

x

x

x

cp_rd

x

x

x

x

x

x

x

cp_rs1_edges

x

x

x

x

x

x

x

cp_rs2_edges

x

x

x

x

x

cr_rs1_rs2_edges

x

x

x

x

x

cmp_rs1_rs2

x

x

x

x

x

cmp_rd_rs1

x

x

x

x

x

x

x

cmp_rd_rs2

x

x

x

x

x

cmp_rd_rs1_rs2

x

x

x

x

x

cp_bs

x

x

cp_rnum

x

cp_sbox

x

x

x

x

rs1

Table 73. Zknd Normative Rules
Normative Rule Rule Text Coverpoints

aes32dsi_enc

Encoding

Zknd_aes32dsi_cg/{cr_rs1_rs2_edges, cp_bs, cp_sbox}

aes32dsi_op

Operation

Zknd_aes32dsi_cg/{cr_rs1_rs2_edges, cp_bs, cp_sbox}

aes32dsmi_enc

Encoding

Zknd_aes32dsmi_cg/{cr_rs1_rs2_edges, cp_bs, cp_sbox}

aes32dsmi_op

Operation

Zknd_aes32dsmi_cg/{cr_rs1_rs2_edges, cp_bs, cp_sbox}

aes64ds_enc

Encoding

Zknd_aes64ds_cg/{cr_rs1_rs2_edges, cp_sbox}

aes64ds_op

Operation

Zknd_aes64ds_cg/{cr_rs1_rs2_edges, cp_sbox}

aes64dsm_enc

Encoding

Zknd_aes64dsm_cg/{cr_rs1_rs2_edges, cp_sbox}

aes64dsm_op

Operation

Zknd_aes64dsm_cg/{cr_rs1_rs2_edges, cp_sbox}

aes64im_enc

Encoding

Zknd_aes64im_cg/cp_rs1_edges

aes64im_op

Operation

Zknd_aes64im_cg/cp_rs1_edges

UDB Parameters: None.

A.9.3. Zknh NIST SHA2 Hashing

Table 74. Zknh Instruction Coverpoints
Instruction sha256sig0 sha256sig1 sha256sum0 sha256sum1 sha512sig0 sha512sig0h sha512sig0l sha512sig1 sha512sig1h sha512sig1l sha512sum0 sha512sum0r

RV32

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs1

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs2

x

x

x

x

x

cp_rd

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs1_edges

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs2_edges

x

x

x

x

x

cr_rs1_rs2_edges

x

x

x

x

x

cmp_rs1_rs2

x

x

x

x

x

cmp_rd_rs1

x

x

x

x

x

x

x

x

x

x

x

x

cmp_rd_rs2

x

x

x

x

x

cmp_rd_rs1_rs2

x

x

x

x

x

Instruction sha512sum1 sha512sum1r

RV32

x

RV64

x

cp_asm_count

x

x

cp_rs1

x

x

cp_rs2

x

cp_rd

x

x

cp_rs1_edges

x

x

cp_rs2_edges

x

cr_rs1_rs2_edges

x

cmp_rs1_rs2

x

cmp_rd_rs1

x

x

cmp_rd_rs2

x

cmp_rd_rs1_rs2

x

Table 75. Zknh Normative Rules
Normative Rule Rule Text Coverpoints

sha256sig0_enc

Encoding

Zknh_sha256sig0_cg/cp_rs1_edges

sha256sig0_op

Operation

Zknh_sha256sig0_cg/cp_rs1_edges

sha256sig1_enc

Encoding

Zknh_sha256sig1_cg/cp_rs1_edges

sha256sig1_op

Operation

Zknh_sha256sig1_cg/cp_rs1_edges

sha256sum0_enc

Encoding

Zknh_sha256sum0_cg/cp_rs1_edges

sha256sum0_op

Operation

Zknh_sha256sum0_cg/cp_rs1_edges

sha256sum1_enc

Encoding

Zknh_sha256sum1_cg/cp_rs1_edges

sha256sum1_op

Operation

Zknh_sha256sum1_cg/cp_rs1_edges

sha512sig0h_enc

Encoding

Zknh_sha512sig0h_cg/cr_rs1_rs2_edges

sha512sig0h_op

Operation

Zknh_sha512sig0h_cg/cr_rs1_rs2_edges

sha512sig0l_enc

Encoding

Zknh_sha512sig0l_cg/cr_rs1_rs2_edges

sha512sig0l_op

Operation

Zknh_sha512sig0l_cg/cr_rs1_rs2_edges

sha512sig1h_enc

Encoding

Zknh_sha512sig1h_cg/cr_rs1_rs2_edges

sha512sig1h_op

Operation

Zknh_sha512sig1h_cg/cr_rs1_rs2_edges

sha512sig1l_enc

Encoding

Zknh_sha512sig1l_cg/cr_rs1_rs2_edges

sha512sig1l_op

Operation

Zknh_sha512sig1l_cg/cr_rs1_rs2_edges

sha512sum0r_enc

Encoding

Zknh_sha512sum0r_cg/cr_rs1_rs2_edges

sha512sum0r_op

Operation

Zknh_sha512sum0r_cg/cr_rs1_rs2_edges

sha512sum1r_enc

Encoding

Zknh_sha512sum1r_cg/cr_rs1_rs2_edges

sha512sum1r_op

Operation

Zknh_sha512sum1r_cg/cr_rs1_rs2_edges

sha512sig0_enc

Encoding

Zknh_sha512sig0_cg/cp_rs1_edges

sha512sig0_op

Operation

Zknh_sha512sig0_cg/cp_rs1_edges

sha512sig1_enc

Encoding

Zknh_sha512sig1_cg/cp_rs1_edges

sha512sig1_op

Operation

Zknh_sha512sig1_cg/cp_rs1_edges

sha512sum0_enc

Encoding

Zknh_sha512sum0_cg/cp_rs1_edges

sha512sum0_op

Operation

Zknh_sha512sum0_cg/cp_rs1_edges

sha512sum1_enc

Encoding

Zknh_sha512sum1_cg/cp_rs1_edges

sha512sum1_op

Operation

Zknh_sha512sum1_cg/cp_rs1_edges

UDB Parameters: None.

A.9.4. Zksed ShangMi SM4 Block Cipher

Table 76. Zksed Instruction Coverpoints
Instruction sm4ed sm4ks

RV32

x

x

RV64

x

x

cp_asm_count

x

x

cp_rs1

x

x

cp_rs2

x

x

cp_rd

x

x

cp_rs1_edges

x

x

cp_rs2_edges

x

x

cr_rs1_rs2_edges

x

x

cmp_rs1_rs2

x

x

cmp_rd_rs1

x

x

cmp_rd_rs2

x

x

cmp_rd_rs1_rs2

x

x

cp_bs

x

x

cp_sbox

x

x

Table 77. Zksed Normative Rules
Normative Rule Rule Text Coverpoints

Zks_impl_all

A core which implements Zks must implement all of the above extensions.

Definition, checked through UDB

sm4ed_enc

Encoding

Zksed_sm4ed_cg/{cr_rs1_rs2_edges, cp_bs, cp_sbox}

sm4ed_op

Operation

Zksed_sm4ed_cg/{cr_rs1_rs2_edges, cp_bs, cp_sbox}

sm4ks_enc

Encoding

Zksed_sm4ks_cg/{cr_rs1_rs2_edges, cp_bs, cp_sbox}

sm4ks_op

Operation

Zksed_sm4ks_cg/{cr_rs1_rs2_edges, cp_bs, cp_sbox}

UDB Parameters: None.

A.9.5. Zksh ShangMi SM3 Hashing

Table 78. Zksh Instruction Coverpoints
Instruction sm3p0 sm3p1

RV32

x

x

RV64

x

x

cp_asm_count

x

x

cp_rs1

x

x

cp_rd

x

x

cp_rs1_edges

x

x

cmp_rd_rs1

x

x

Table 79. Zksh Normative Rules
Normative Rule Rule Text Coverpoints

sm3p0_enc

Encoding

Zksh_sm3p0_cg/{cp_rs1_edges}

sm3p0_op

Operation

Zksh_sm3p0_cg/{cp_rs1_edges}

sm3p1_enc

Encoding

Zksh_sm3p1_cg/{cp_rs1_edges}

sm3p1_op

Operation

Zksh_sm3p1_cg/{cp_rs1_edges}

UDB Parameters: None.

A.9.6. Zkt Constant-Time Instructions

Not tested yet.

Table 80. Zkt Normative Rules
Normative Rule Rule Text Coverpoints

Zkt_optional_instr

Vendors do not have to implement all of the list’s instructions to be Zkt compliant;

Definition, checked through UDB

Zkt_impl_must_constant_latency

if they claim to have Zkt and implement any of the listed instructions, it must have data-independent latency.

Not tested: microarchitectural timing

UDB Parameters: None.

A.10. Zi* Additional Unpriv Extensions

This section includes a variety of unprivileged extensions.

A.10.1. Zibi Branch with Immediate

The Zibi extension adds the beqi and bnei instructions, which compare an integer register with a small immediate value and conditionally branch.

Table 81. Zibi Instruction Coverpoints
Instruction beqi bnei

RV32

x

x

RV64

x

x

cp_asm_count

x

x

cp_rs1

x

x

cp_rs1_edges

x

x

cr_rs1_imm_edges

5bit_u_n0_offset

5bit_u_n0_offset

cp_offset

x

x

cp_imm_edges

5bit_u_n0

5bit_u_n0

cr_imm_edges_5bit_u_n0_rs1_rel

x

x

Table 82. Zibi Modified Coverpoints
Modified Coverpoint Bins Definition

cp_imm_edges_5bit_u_n0

9

The Zibi comparison constants -1, 1, 2, 3, 4, 8, 16, 30, and 31. The value -1 exercises the all-zero cimm encoding.

cr_rs1_imm_edges_5bit_u_n0_offset

RV32: 216; RV64: 288

Cross-product of rs1 edge values, cp_imm_edges_5bit_u_n0, and positive and negative branch offsets.

cr_imm_edges_5bit_u_n0_rs1_rel

RV32: 27; RV64: 36

Cross-product of cp_imm_edges_5bit_u_n0 with the relation of rs1 to the constant: equal, constant plus 1, constant minus 1, and (RV64 only) same low word with a different upper word.

cp_instr_adr_misaligned_zibi_branch

2

Taken beqi and bnei branches to misaligned instruction addresses.

cp_instr_adr_misaligned_zibi_branch_nottaken

2

Not-taken beqi and bnei branches to misaligned instruction addresses.

The instruction-address-misaligned exception rule uses Zibi-specific tests in ExceptionsSm, ExceptionsS, and ExceptionsU, which check both taken branches that trap and not-taken branches that do not trap for beqi and bnei.

Table 83. Zibi Normative Rules
Normative Rule Rule Text Coverpoints

zibi_btype_offset

{Zibi_beqi_cg, Zibi_bnei_cg}/{cp_offset, cr_rs1_imm_edges_5bit_u_n0_offset}

zibi_enc

{Zibi_beqi_cg, Zibi_bnei_cg}/cp_asm_count

zibi_cimm_decode

{Zibi_beqi_cg, Zibi_bnei_cg}/{cp_imm_edges_5bit_u_n0, cr_rs1_imm_edges_5bit_u_n0_offset, cr_imm_edges_5bit_u_n0_rs1_rel}

zibi_misaligned_exception

ExceptionsSm_cg/{cp_instr_adr_misaligned_zibi_branch, cp_instr_adr_misaligned_zibi_branch_nottaken}, ExceptionsS_cg/{cp_instr_adr_misaligned_zibi_branch, cp_instr_adr_misaligned_zibi_branch_nottaken}, ExceptionsU_cg/{cp_instr_adr_misaligned_zibi_branch, cp_instr_adr_misaligned_zibi_branch_nottaken}

zibi_beqi_op

Zibi_beqi_cg/{cp_rs1, cp_rs1_edges, cp_imm_edges_5bit_u_n0, cp_offset, cr_rs1_imm_edges_5bit_u_n0_offset}

zibi_bnei_op

Zibi_bnei_cg/{cp_rs1, cp_rs1_edges, cp_imm_edges_5bit_u_n0, cp_offset, cr_rs1_imm_edges_5bit_u_n0_offset}

UDB Parameters: None.

A.10.2. Zicsr Control/Status Register Instructions

Table 84. Zicsr Instruction Coverpoints
Instruction csrrc csrrci csrrs csrrsi csrrw csrrwi

RV32

x

x

x

x

x

x

RV64

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

cp_rs1

x

x

x

cp_rd

x

x

x

x

x

x

cp_rs1_edges

x

x

x

cmp_rd_rs1

x

x

x

cp_uimm

5

5

5

Table 85. Zicsr Normative Rules
Normative Rule Rule Text Coverpoints

csrrc_op

The CSRRC (Atomic Read and Clear Bits in CSR) instruction reads the value of the CSR, zero-extends the value to XLEN bits, and writes it to integer register rd. The initial value in integer register rs1 is treated as a bit mask that specifies bit positions to be cleared in the CSR. Any bit that is high in rs1 will cause the corresponding bit to be cleared in the CSR, if that CSR bit is writable.

Zicsr_csrrc_cg/{cp_rs1, cp_rd, cp_rs1_edges}

csrrwi_csrrsi_csrrci_ops

The CSRRWI, CSRRSI, and CSRRCI variants are similar to CSRRW, CSRRS, and CSRRC respectively, except they update the CSR using an XLEN-bit value obtained by zero-extending a 5-bit unsigned immediate (uimm[4:0]) field encoded in the rs1 field instead of a value from an integer register. For CSRRSI and CSRRCI, if the uimm[4:0] field is zero, then these instructions will not write to the CSR, and shall not cause any of the side effects that might otherwise occur on a CSR write, nor raise illegal-instruction exceptions on accesses to read-only CSRs. For CSRRWI, if rd=x0, then the instruction shall not read the CSR and shall not cause any of the side effects that might occur on a CSR read. Both CSRRSI and CSRRCI will always read the CSR and cause any read side effects regardless of rd and rs1 fields.

{Zicsr_csrrwi_cg, Zicsr_csrrsi_cg, Zicsr_csrrci_cg}/cp_uimm_5

csrrs_op

The CSRRS (Atomic Read and Set Bits in CSR) instruction reads the value of the CSR, zero-extends the value to XLEN bits, and writes it to integer register rd. The initial value in integer register rs1 is treated as a bit mask that specifies bit positions to be set in the CSR. Any bit that is high in rs1 will cause the corresponding bit to be set in the CSR, if that CSR bit is writable.

Zicsr_csrrs_cg/{cp_rs1, cp_rd, cp_rs1_edges}

csrrw_op

The CSRRW (Atomic Read/Write CSR) instruction atomically swaps values in the CSRs and integer registers. CSRRW reads the old value of the CSR, zero-extends the value to XLEN bits, then writes it to integer register rd. The initial value in rs1 is written to the CSR. If rd=x0, then the instruction shall not read the CSR and shall not cause any of the side effects that might occur on a CSR read.

Zicsr_csrrw_cg/{cp_rs1, cp_rd, cp_rs1_edges}

csrrs_csrrc_rs1_x0

For both CSRRS and CSRRC, if rs1=x0, then the instruction will not write to the CSR at all, and so shall not cause any of the side effects that might otherwise occur on a CSR write, nor raise illegal-instruction exceptions on accesses to read-only CSRs. Both CSRRS and CSRRC always read the addressed CSR and cause any read side effects regardless of rs1 and rd fields. Note that if rs1 specifies a register other than x0, and that register holds a zero value, the instruction will not action any attendant per-field side effects, but will action any side effects caused by writing to the entire CSR.

Zicsr_csrrs_cg/cp_rs1, Zicsr_csrrc_cg/cp_rs1, Zicntr_csrrs_cg/cp_cntr, Zicntr_csrrc_cg/cp_cntr

csrrw_rs1_x0

A CSRRW with rs1=x0 will attempt to write zero to the destination CSR.

Zicsr_csrrw_cg/cp_rs1

csrrsi_csrrci_uimm_zero

For CSRRSI and CSRRCI, if the uimm[4:0] field is zero, then these instructions will not write to the CSR, and shall not cause any of the side effects that might otherwise occur on a CSR write, nor raise illegal-instruction exceptions on accesses to read-only CSRs.

Zicsr_csrrsi_cg/cp_uimm_5, Zicsr_csrrci_cg/cp_uimm_5, TODO: csrrsi and csrrci with uimm=0 on a read-only CSR must not trap

csrrwi_rd_x0

For CSRRWI, if rd=x0, then the instruction shall not read the CSR and shall not cause any of the side effects that might occur on a CSR read.

Zicsr_csrrwi_cg/cp_rd, Skipping the read is not observable: standard CSRs have no read side effects

csr_side_effects

summarizes the behavior of the CSR instructions with respect to whether they read and/or write the CSR.

Zicsr_csrrw_cg/cp_rd, Zicsr_csrrs_cg/cp_rs1, Zicsr_csrrwi_cg/cp_rd, Zicsr_csrrsi_cg/cp_uimm_5

csr_rs1_uimm_side_effect

CSRRS, CSRRSI, CSRRC, and CSRRCI only action side effects for fields for which the rs1 or uimm argument has at least one bit set corresponding to that field.

Not tested: no standard CSR has side effects on field writes

csr_access_order

In particular, unless specified otherwise, a CSR access is performed after the execution of any prior instructions in program order whose behavior modifies or is modified by the CSR state and before the execution of any subsequent instructions in program order whose behavior modifies or is modified by the CSR state.

ZicsrF_cg/{cp_fflags_set_m_NV, cp_fflags_set_m_NX}, F_fadd_s_cg/cp_csr_frm

csrr_order

an explicit CSR read returns the CSR state before the execution of the instruction

{Zicsr_csrrw_cg, Zicsr_csrrs_cg, Zicsr_csrrc_cg}/cp_rs1_edges, Sm_mcsr_cg/cp_minstret_wraparound

csrw_order

an explicit CSR write suppresses and overrides any implicit writes or modifications to the same CSR by the same instruction.

Sm_mcsr_cg/cp_minstret_wraparound

csr_side_effects_synchronous

Likewise, any side effects from an explicit CSR access are normally observed to occur synchronously in program order. Unless specified otherwise, the full consequences of any such side effects are observable by the very next instruction, and no consequences may be observed out-of-order by preceding instructions.

csr_weakly_ordered

For the RVWMO memory consistency model (memorymodel), CSR accesses are weakly ordered by default, so other harts or devices may observe CSR accesses in an order different from program order.

OUT-OF-SCOPE for single hart

csr_memory_access_ordering

In addition, CSR accesses are not ordered with respect to explicit memory accesses, unless a CSR access modifies the execution behavior of the instruction that performs the explicit memory access or unless a CSR access and an explicit memory access are ordered by either the syntactic dependencies defined by the memory model or the ordering requirements defined in sec:memory-ordering-pmas.

OUT-OF-SCOPE for single hart

csr_fence_ordering

For the purposes of the FENCE instruction, CSR read accesses are classified as device input (I), and CSR write accesses are classified as device output (O).

OUT-OF-SCOPE for single hart

csr_strongly_ordered

The hardware platform may define that accesses to certain CSRs are strongly ordered, as defined in sec:memory-ordering-pmas. Accesses to strongly ordered CSRs have stronger ordering constraints with respect to accesses to both weakly ordered CSRs and accesses to memory-mapped I/O regions.

OUT-OF-SCOPE for single hart

Zicsr_no_read_side_effects

Standard CSRs do not have side effects on reads but may have side effects on writes.

Zicsr_nonexistent_rsv

Instructions that access a non-existent CSR address are reserved.

SsstrictSm_mcsr_cg/{cp_csrr, cp_csrw_edges, cp_csrcs}, SsstrictU_ucsr_cg/cp_csrr

Zicsr_debug_range

Machine-mode standard read-write CSRs 0x7A0&#8205;&#8211;&#8205;0x7BF are reserved for use by the debug system. Of these CSRs, 0x7A0&#8205;&#8211;&#8205;0x7AF are accessible to machine mode, whereas

SdtrigSm_trig_module_reg_cg/{cp_csr_access_global, cp_csr_access_local}

Zicsr_wlrl_deterministic

Implementations can return arbitrary bit patterns on the read of a WLRL field when the last write was of an illegal value, but the value returned should deterministically depend on the illegal written value and the value of the field prior to the write.

Not tested: the value read after an illegal WLRL write is implementation-specific

Zicsr_warl_def

Some read/write CSR fields are only defined for a subset of bit encodings, but allow any value to be written while guaranteeing to return a legal value whenever read.

Sm_mcsr_cg/{cp_mcsrwalk, cp_mcsrwalk_masked}, S_scsr_cg/cp_scsrwalk

Zicsr_warl_deterministic

Implementations can return any legal value on the read of a WARL field when the last write was of an illegal value, but the legal value returned should deterministically depend on the illegal written value and the architectural state of the hart.

Not tested: the legal value returned after an illegal WARL write is implementation-specific; CSR walks check only that it is legal

Zicsr_field_modulation

If a write to one CSR changes the set of legal values allowed for a field of a second CSR, then unless specified otherwise, the second CSR’s field immediately gets an UNSPECIFIED value from among its new legal values. This is true even if the field’s value before the write remains legal after the write; the value of the field may be changed in consequence of the write to the controlling CSR.

Not tested: behavior is UNSPECIFIED

Zicsr_field_modulation_no_side_effects

A change to the value of a CSR for this reason is not a write to the affected CSR and thus does not trigger any side effects specified for that CSR.

Zicsr_implicit_read

Unless otherwise specified, the value returned by an implicit read of a CSR is the same value that would have been returned by an explicit read of the CSR, using a CSR-access instruction in a sufficient privilege mode.

F_fadd_s_cg/cp_csr_frm, Sm_mprivinst_cg/cp_mret

Zicsr_width_modulation

If the width of a CSR is changed (for example, by changing SXLEN or UXLEN, as described in ), the values of the writable fields and bits of the new-width CSR are, unless specified otherwise, determined from the previous-width CSR as though by this algorithm:

Not tested: changing SXLEN or UXLEN is not tested

Zicsr_width_modulation_no_side_effects

Changing the width of a CSR is not a read or write of the CSR and thus does not trigger any side effects.

Not tested: changing SXLEN or UXLEN is not tested

Zicsr_wide_csr_access

If a standard CSR is wider than XLEN bits, then an explicit read of the CSR returns the register’s least-significant XLEN bits, and an explicit write to the CSR modifies only the register’s least-significant XLEN bits, leaving the upper bits unchanged.

Sm_mcsr_cg/{cp_mcycle_wraparound, cp_minstret_wraparound}

Zicsr_high_half_alias

The high-half CSR aliases bits 63:32 of its namesake 64-bit CSR, thus providing a way for RV32 software to read and modify the otherwise-unreachable 32 bits.

Sm_mcsr_cg/{cp_mtimeh_write, cp_mcycleh_wraparound, cp_minstreth_wraparound}

Zicsr_high_half_rv64_rsv

Standard high-half CSRs are accessible only when the base RISC-V instruction set is RV32 (XLEN=32). For RV64 (when XLEN=64), the addresses of all standard high-half CSRs are reserved, so an attempt to access a high-half CSR typically raises an illegal-instruction exception.

SsstrictSm_mcsr_cg/{cp_csrr, cp_csrw_edges, cp_csrcs}

UDB Parameters: None.

=== TRAP_ON_UNIMPLEMENTED_CSR affects the results of Ssstrict/cp_csrr (Table 231). It does not affect Zicsr because this is an unprivileged test that should never perform operations that trap. ===

A.10.3. Zifencei Instruction-Fetch Fence

Table 86. Zifencei Instruction Coverpoints
Instruction fence.i

RV32

x

RV64

x

cp_asm_count

x

cp_custom

fencei

Table 87. Zifencei Normative Rules
Normative Rule Rule Text Coverpoints

fence-i_op

A FENCE.I instruction orders all explicit memory accesses and instruction fetches that precede the FENCE.I in program order before all instruction fetches that follow the FENCE.I in program order.

Zifencei_fence_i_cg/{cp_custom_fencei}

fence-i_rsv

The unused fields in the FENCE.I instruction, funct12, rs1, and rd, are reserved for finer-grain fences in future extensions. For forward compatibility, base implementations shall ignore these fields, and standard software shall zero these fields.

Zifencei_fence_i_cg/{cp_custom_fencei}

UDB Parameters: None.

Table 88. Zifencei Coverpoint Definitions
Coverpoint Bins Definition

cp_custom_fencei

4

Executes normal fence.i and fence.i instructions with nonzero rs1, rd, and funct12 fields to verify that they execute without trapping.

The Zifencei tests must write an instruction to an address, execute fence.i, and then execute the instruction to check that the new instruction is executed.

A.10.4. Misalign: Misaligned Loads/Stores

Misaligned loads/stores to main memory optionally can be handled in hardware. When the UDB MISALIGNED_LDST parameter is true, misaligned scalar loads and stores to main memory do not throw an exception. This parameter is a simplification of the "Access Type PMAs" which could define misaligned behavior on each memory region.

The misaligned family of tests exercises integer, compressed, and single/double-precision floating-point loads/stores. It uses the new cp_misalign and cp_misalign_cross64_{hword/word/double} coverpoints defined in Table 92. Each instruction is tested at byte offsets 0-8 in two 16-byte windows of the scratch area: one at the start of the 256-byte-aligned scratch area, and one starting 56 bytes in, so that misaligned accesses straddle the 64-byte boundary (and hence any 16-, 32- or 64-byte cache line or bus beat) at scratch+64. Each window is filled with 16 distinct bytes before the accesses. Loads are repeated with the bitwise complement of the pattern so that every width and offset is loaded with both a clear and a set sign bit, checking sign and zero extension. Stores check all 16 bytes of the window. It assumes that if these work, then Zfh and Zcb loads/stores will also work correctly. Misaligned atomics are exercised with {ExceptionsZaamo, ExceptionsZalrsc}/{cp_amo/load/store_address_misaligned}. Misaligned vector load/stores are exercised in Section B.10.1.

The rows with Zca, F or D in the ExtraExtensions column apply only when that extension is also supported.

Table 89. Misalign Instruction Coverpoints
Instruction ld lh lhu lw lwu sd sh sw c.lw c.lwsp c.ld c.ldsp

RV32

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

ExtraExtensions

Zca

Zca

Zca

Zca

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_misalign

x

x

x

x

x

x

x

x

x

x

x

x

cp_misalign_cross64

double

hword

hword

word

word

double

hword

word

word

word

double

double

Instruction c.sw c.swsp c.sd c.sdsp flw fsw fld fsd

RV32

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

ExtraExtensions

Zca

Zca

Zca

Zca

F

F

D

D

cp_asm_count

x

x

x

x

x

x

x

x

cp_misalign

x

x

x

x

x

x

x

x

cp_misalign_cross64

word

word

double

double

word

word

double

double

Table 90. Misalign Normative Rules
Normative Rule Rule Text Coverpoints

lh_op

LH loads a 16-bit value from memory, then sign-extends to 32-bits before storing in rd.

Misalign_lh_cg/{cp_misalign}

lhu_op

LHU loads a 16-bit value from memory but then zero extends to 32-bits before storing in rd.

Misalign_lhu_cg/{cp_misalign}

lw_op

The LW instruction loads a 32-bit value from memory into rd.

Misalign_lw_cg/{cp_misalign}

sw_sh_sb_op

The SW, SH, and SB instructions store 32-bit, 16-bit, and 8-bit values from the low bits of register rs2 to memory.

Misalign_sh_cg/{cp_misalign}, Misalign_sw_cg/{cp_misalign}

lwu_op

The LWU instruction, on the other hand, zero-extends the 32-bit value from memory for RV64I.

Misalign_lwu_cg/{cp_misalign}

ld_op_rv64i

The LD instruction loads a 64-bit value from memory into register rd for RV64I.

Misalign_ld_cg/{cp_misalign}

sd_sw_sh_sb_op_rv64i

The SD, SW, SH, and SB instructions store 64-bit, 32-bit, 16-bit, and 8-bit values from the low bits of register rs2 to memory respectively.

Misalign_sd_cg/{cp_misalign}

misaligned_ldst_eei_dependent_behavior

Loads and stores whose effective address is not naturally aligned to the referenced datatype (i.e., the effective address is not divisible by the size of the access in bytes) have behavior dependent on the EEI.

{Misalign_lw_cg,Misalign_sw_cg}/{cp_misalign}

misaligned_ldst_hw_support

misaligned loads and stores can be handled in hardware, or via an invisible trap into the execution environment implementation, or possibly a combination of hardware and invisible trap depending on address.

{Misalign_lw_cg,Misalign_sw_cg,Misalign_ld_cg,Misalign_sd_cg}/{cp_misalign}

misaligned_ldst_exc_type

loads and stores that are not naturally aligned may either complete execution successfully or raise an exception. The exception raised can be either an address-misaligned exception or an access-fault exception. For a memory access that would otherwise be able to complete except for the misalignment, an access-fault exception can be raised instead of an address-misaligned exception if the misaligned access should not be emulated, e.g., if accesses to the memory region have side effects.

{Misalign_lw_cg,Misalign_sw_cg}/{cp_misalign}

c-lw_op

C.LW loads a 32-bit value from memory into register rd′. It computes an effective address by adding the zero-extended offset, scaled by 4, to the base address in register rs1′. It expands to LW rd′, offset(rs1′).

MisalignZca_c_lw_cg/{cp_misalign}

c-lwsp_op

C.LWSP loads a 32-bit value from memory into register rd. It computes an effective address by adding the zero-extended offset, scaled by 4, to the stack pointer, x2. It expands to LW rd, offset(x2).

MisalignZca_c_lwsp_cg/{cp_misalign}

c-ld_op

C.LD is an XLEN=64-only instruction that loads a 64-bit value from memory into register rd′. It computes an effective address by adding the zero-extended offset, scaled by 8, to the base address in register rs1′. It expands to LD rd′, offset(rs1′).

MisalignZca_c_ld_cg/{cp_misalign}

c-ldsp_op

C.LDSP is an XLEN=64-only instruction that loads a 64-bit value from memory into register rd. It computes its effective address by adding the zero-extended offset, scaled by 8, to the stack pointer, x2. It expands to LD rd, offset(x2).

MisalignZca_c_ldsp_cg/{cp_misalign}

c-sw_op

C.SW stores a 32-bit value in register rs2′ to memory. It computes an effective address by adding the zero-extended offset, scaled by 4, to the base address in register rs1′. It expands to SW rs2′, offset(rs1′).

MisalignZca_c_sw_cg/{cp_misalign}

c-swsp_op

C.SWSP stores a 32-bit value in register rs2 to memory. It computes an effective address by adding the zero-extended offset, scaled by 4, to the stack pointer, x2. It expands to SW rs2, offset(x2).

MisalignZca_c_swsp_cg/{cp_misalign}

c-sd_op

C.SD is an XLEN=64-only instruction that stores a 64-bit value in register rs2′ to memory. It computes an effective address by adding the zero-extended offset, scaled by 8, to the base address in register rs1′. It expands to SD rs2′, offset(rs1′).

MisalignZca_c_sd_cg/{cp_misalign}

c-sdsp_op

C.SDSP is an XLEN=64-only instruction that stores a 64-bit value in register rs2 to memory. It computes an effective address by adding the zero-extended offset, scaled by 8, to the stack pointer, x2. It expands to SD rs2, offset(x2).

MisalignZca_c_sdsp_cg/{cp_misalign}

fsw_flw_op

Floating-point loads and stores use the same base+offset addressing mode as the integer base ISAs, with a base address in register rs1 and a 12-bit signed byte offset. The FLW instruction loads a single-precision floating-point value from memory into floating-point register rd. FSW stores a single-precision value from floating-point register rs2 to memory.

MisalignF_flw_cg/{cp_misalign}, MisalignF_fsw_cg/{cp_misalign}

fp_misaligned

As described in , the execution environment defines whether misaligned floating-point loads and stores are handled invisibly or raise a contained or fatal trap.

{MisalignF_flw_cg,MisalignF_fsw_cg,MisalignD_fld_cg,MisalignD_fsd_cg}/{cp_misalign}

fld_op

The FLD instruction loads a double-precision floating-point value from memory into floating-point register rd

MisalignD_fld_cg/{cp_misalign}

fsd_op

FSD stores a double-precision value from the floating-point registers to memory

MisalignD_fsd_cg/{cp_misalign}

Table 91. Misalign UDB Parameters
Parameter Description Coverpoint Effect

MISALIGNED_LDST

Does the implementation perform non-atomic misaligned loads and stores to main memory (does not affect misaligned support to device memory)? If not, the implementation always throws a misaligned exception.

cp_misalign, cp_misalign_cross64_hword, cp_misalign_cross64_word, cp_misalign_cross64_double

Coverpoints only run if True, and should not throw exceptions

Table 92. Misalign Coverpoint Definitions
Modified Coverpoint Bins Definition

cp_misalign

8

All 8 byte offsets within a doubleword: the three least significant bits of the effective address, on both RV32 and RV64.

cp_misalign_cross64_{hword/word/double}

2

Whether a 2-, 4-, or 8-byte access crosses a 64-byte boundary, from effective address bits [5:0].

A.10.5. Zicclsm Misaligned Loads/Stores

The Zicclsm extension requires that the UDB MISALIGNED_LDST parameter be true. It is tested with the misaligned scalar load/store tests above and with misaligned vector load/store tests (see Section B.10.1). It does not apply to Za* atomic extensions.

Table 93. Zicclsm Normative Rules
Normative Rule Rule Text Coverpoints

Zicclsm_misaligned_support

If the Zicclsm extension is implemented, then misaligned loads and stores to main memory regions with both the coherence and cacheability PMAs must be supported.

{Misalign_lw_cg, Misalign_sw_cg}/cp_misalign, MisalignZca_c_lw_cg/cp_misalign, MisalignV_vle32_v_cg/cp_misalignv_ls_element_misaligned

Ziccif_if_atomicity

If the Ziccif extension is implemented, main memory regions with both the coherence and cacheability PMAs must support instruction fetch, and any instruction fetches of naturally aligned power-of-2 sizes of at most min(ILEN,XLEN) bits are atomic.

Instruction fetch from main memory is exercised by every test; fetch atomicity is OUT-OF-SCOPE for single hart

Ziccif_fetch_mechanism

An implementation with the Ziccif extension fetches instructions in a manner equivalent to the following state machine.

OUT-OF-SCOPE for single hart

Ziccif_pma_application

Memory protection and executability PMAs are applied only to bytes that are not discarded by this algorithm.

Ziccrse_rsrv_eventual

If the Ziccrse extension is implemented, then main memory regions with both the coherence and cacheability PMAs must support the RsrvEventual PMA.

{Zalrsc_sc_w_cg, Zalrsc_sc_d_cg}/cp_sc_pass_fail

Ziccrse_pma_rsrv_req

The Ziccrse extension requires RsrvEventual support to main memory regions with both the coherence and cacheability PMAs.

{Zalrsc_sc_w_cg, Zalrsc_sc_d_cg}/cp_sc_pass_fail

Ziccamoa_amo_pma

If the Ziccamoa extension is implemented, then main memory regions with both the coherence and cacheability PMAs must provide AMOArithmetic-level PMA support as defined in .

Zaamo_amoswap_w_cg/cp_asm_count, Zaamo_amoand_w_cg/cp_asm_count, Zaamo_amoadd_w_cg/cp_asm_count, Zaamo_amomax_w_cg/cp_asm_count

Ziccamoa_pma_amo_req

The Ziccamoa extension requires AMOArithmetic-level support to main memory regions with both the coherence and cacheability PMAs.

Zaamo_amoswap_w_cg/cp_asm_count, Zaamo_amoand_w_cg/cp_asm_count, Zaamo_amoadd_w_cg/cp_asm_count, Zaamo_amomax_w_cg/cp_asm_count

Ziccamoc_casq_pma

If the Ziccamoc extension is implemented, then main memory regions with both the coherence and cacheability PMAs must provide AMOCASQ-level PMA support as defined in .

Zacas_amocas_w_cg/cp_asm_count, Zacas_amocas_d_cg/cp_asm_count, Zacas_amocas_q_cg/cp_asm_count

Ziccamoc_pma_amo_req

The Ziccamoc extension requires AMOCASQ-level support to main memory regions with both the coherence and cacheability PMAs.

Zacas_amocas_w_cg/cp_asm_count, Zacas_amocas_d_cg/cp_asm_count, Zacas_amocas_q_cg/cp_asm_count

UDB Parameters: None.

A.10.6. Zicond Conditional Instructions

Table 94. Zicond Instruction Coverpoints
Instruction czero.eqz czero.nez

RV32

x

x

RV64

x

x

cp_asm_count

x

x

cp_rs1

x

x

cp_rs2

x

x

cp_rd

x

x

cp_rs1_edges

x

x

cp_rs2_edges

x

x

cr_rs1_rs2_edges

x

x

cmp_rs1_rs2

x

x

cmp_rd_rs1

x

x

cmp_rd_rs2

x

x

cmp_rd_rs1_rs2

x

x

Table 95. Zicond Normative Rules
Normative Rule Rule Text Coverpoints

czero-eqz_op

If rs2 contains the value zero, this instruction writes the value zero to rd. Otherwise, this instruction copies the contents of rs1 to rd.

Zicond_czero_eqz_cg/{cp_rs1, cp_rs2, cp_rd, cr_rs1_rs2_edges}

czero-eqz_inst_ctime

Furthermore, if the Zkt extension is implemented, this instruction’s timing is independent of the data values in rs1 and rs2.

Not tested: microarchitectural timing

czero-nez_op

If rs2 contains a nonzero value, this instruction writes the value zero to rd. Otherwise, this instruction copies the contents of rs1 to rd.

Zicond_czero_nez_cg/{cp_rs1, cp_rs2, cp_rd, cr_rs1_rs2_edges}

czero-nez_Zkt_timing

Furthermore, if the Zkt extension is implemented, this instruction’s timing is independent of the data values in rs1 and rs2.

Not tested: microarchitectural timing

UDB Parameters: None.

A.10.7. Zicntr Counters

Zicntr provides unprivileged read access to the cycle, time, and instret counters. Note that, like all other unprivileged tests, these tests are performed in M-mode. The ZicntrS and ZicntrU privileged tests exercise reading the counters in S-mode and U-mode, with control by mcounteren and scounteren CSRs. The Sm privileged tests exercise mcycle, minstret, and HPMs from M-mode.

Table 96. Zicntr Instruction Coverpoints
Instruction csrrs csrrc

RV32

x

x

RV64

x

x

cp_cntr

x

x

Table 97. Zicntr Normative Rules
Normative Rule Rule Text Coverpoints

Zihpm_op_sz_mode_acc_count

RISC-V ISAs provide a set of up to thirty-two 64-bit performance counters and timers

Zicntr_csrrs_cg/{cp_cntr}

Zihpm_op_sz_mode_acc_xlen32

when XLEN=32, the upper 32 bits are accessed via CSR registers 0xC80–0xC9F

Zicntr_csrrs_cg/{cp_cntr}

Zihpm_op_sz_mode_acc_partition

These counters are divided between the Zicntr and Zihpm extensions.

Zicntr_csrrs_cg/{cp_cntr}

Zihpm_op_sz_mode_acc_priv

accessible via unprivileged XLEN-bit read-only CSR registers 0xC00–0xC1F

Zicntr_csrrs_cg/{cp_cntr}, ZicntrU_cg/cp_mcounteren_access_u, ZicntrSm_cg/cp_mcounteren_access_m

Zicntr_rdcycle_op

The RDCYCLE pseudoinstruction reads the low XLEN bits of the cycle CSR which holds a count of the number of clock cycles executed by the processor core on which the hart is running from an arbitrary start time in the past.

Zicntr_csrrs_cg/{cp_cntr}

Zicntr_rdcycleh_op

RDCYCLEH is only present when XLEN=32 and reads bits 63-32 of the same cycle counter.

Zicntr_csrrs_cg/{cp_cntr}

Zicntr_rdtime_op

The RDTIME pseudoinstruction reads the low XLEN bits of the time CSR, which counts wall-clock real time that has passed from an arbitrary start time in the past.

Zicntr_csrrs_cg/{cp_cntr}

Zicntr_rdtimeh_op

RDTIMEH is only present when XLEN=32 and reads bits 63-32 of the same real-time counter.

Zicntr_csrrs_cg/{cp_cntr}

Zicntr_rdinstret_op

The RDINSTRET pseudoinstruction reads the low XLEN bits of the instret CSR, which counts the number of instructions retired by this hart from some arbitrary start point in the past.

Zicntr_csrrs_cg/{cp_cntr}, ZicntrU_cg/cp_instret_add

Zicntr_rdinstreth_op

RDINSTRETH is only present when XLEN=32 and reads bits 63-32 of the same instruction counter.

Zicntr_csrrs_cg/{cp_cntr}

Zicntr_time_hart_sync

The real-time clocks of all harts must be synchronized to within one tick of the real-time clock.

OUT-OF-SCOPE for single hart

Table 98. Zicntr UDB Parameters
Parameter Description Coverpoint Effect

TIME_CSR_IMPLEMENTED

Whether or not a real hardware time CSR exists. Implementations can either provide a real CSR or emulate access at M-mode.

Possible values:

true:: time/timeh exists, and accessing it will not cause an IllegalInstruction trap

false:: time/timeh does not exist. Accessing the CSR will cause an IllegalInstruction trap or enter an unpredictable state, depending on TRAP_ON_UNIMPLEMENTED_CSR. Privileged software may emulate the time CSR, or may pass the exception to a lower level.

cp_cntr

Skip time and timeh if False

TODO: add normative rule for TIME_CSR_IMPLEMENTED UDB parameter referencing the following text from the priv spec:

` emulate this functionality on behalf of less-privileged modes in M-mode software. ` This rule is checked by the time bin of cp_cntr coverpoint.

Table 99. Zicntr Coverpoint Definition
Coverpoint Bins Definition

cp_cntr

3

Read each of the counters (cycle, time, instret) twice using csrrs rd, csr, x0 and check that the difference is exactly right for instret, or at least 1 for cycle, 0 for time (time may not increment between reads). For RV32, also check cycleh, timeh, instreth with the same definitions. Skip time and timeh if parameter TIME_CSR_IMPLEMENTED = False.

A.10.8. Zihpm Hardware Performance Monitors

Zihpm provides unprivileged read access to custom hardware performance monitor CSRs.

Table 100. Zihpm Instruction Coverpoints
Instruction csrrs csrrc

RV32

x

x

RV64

x

x

cp_cntr

hpm

hpm

Table 101. Zihpm Normative Rules
Normative Rule Rule Text Coverpoints

Zihpm_op_sz_mode_acc_count

RISC-V ISAs provide a set of up to thirty-two 64-bit performance counters and timers

Zihpm_csrrs_cg/{cp_cntr_hpm}

Zihpm_op_sz_mode_acc_partition

These counters are divided between the Zicntr and Zihpm extensions.

Zihpm_csrrs_cg/{cp_cntr_hpm}

Zihpm_op_sz_mode_acc_priv

accessible via unprivileged XLEN-bit read-only CSR registers 0xC00–0xC1F

Zihpm_csrrs_cg/{cp_cntr_hpm}

Zihpm_op_sz_mode_acc_xlen32

when XLEN=32, the upper 32 bits are accessed via CSR registers 0xC80–0xC9F

Zihpm_csrrs_cg/{cp_cntr_hpm}

hpmcounter_op_sz_mode

The Zihpm extension comprises up to 29 additional unprivileged 64-bit hardware performance counters, hpmcounter3-hpmcounter31.

Zihpm_csrrs_cg/{cp_cntr_hpm}

hpm_counter_op_sz_mode_xlen32

When XLEN=32, the upper 32 bits of these performance counters are accessible via additional CSRs hpmcounter3h-hpmcounter31h.

Zihpm_csrrs_cg/cp_cntr_hpm/{hpmcounter3h, hpmcounter4h, hpmcounter5h, hpmcounter6h, hpmcounter7h, hpmcounter8h, hpmcounter9h, hpmcounter10h, hpmcounter11h, hpmcounter12h, hpmcounter13h, hpmcounter14h, hpmcounter15h, hpmcounter16h, hpmcounter17h, hpmcounter18h, hpmcounter19h, hpmcounter20h, hpmcounter21h, hpmcounter22h, hpmcounter23h, hpmcounter24h, hpmcounter25h, hpmcounter26h, hpmcounter27h, hpmcounter28h, hpmcounter29h, hpmcounter30h, hpmcounter31h}

hpm_counter_op_sz_mode_dependency

The Zihpm extension depends on the Zicsr extension.

Not tested: extension dependency checked by the UDB configuration

hpm_platform_specific_impl

The implemented number and width of these additional counters, and the set of events they count, are platform-specific.

Not tested: platform-specific. The implemented counters come from HPM_COUNTER_EN, and events are not tested.

hpm_misconfigured_event_behavior

If the configuration used to select the events counted by a counter is misconfigured, the counter may return a constant value.

Not tested: event selection is platform-specific, so there is no portable misconfiguration to test.

hpm_unimplemented_counter_access

Accessing an unimplemented counter may cause an illegal-instruction exception or may return a constant value.

Not tested: implementation-defined behavior; an unimplemented counter may trap or return a constant value, so neither response can be required. cp_cntr_hpm reads only the counters HPM_COUNTER_EN implements.

Table 102. Zihpm UDB Parameters
Parameter Description Coverpoint Effect

HPM_COUNTER_EN

Whether each HPM counter is implemented in hardware.

HPM_COUNTER_EN[n] being false means hpmcounter<n>/mhpmcounter<n> and the corresponding mhpmevent<n> are not implemented and are hardwired read-only zero. (It does not mean the counter is implemented but currently stopped from counting; that is a separate, run-time concept controlled by mcountinhibit.)

There is one entry for each hpmcounter, indexed 0-31.

Indices 0-2 must be false: they are placeholders for the three counters (cycle/mcycle (CY), time ™, and instret/minstret (IR)) whose implementation this parameter does not control. These counters are associated with indexes 0, 1, and 2. The rest of the HPM counters logically follow at indexes 3-31. Index 3 in HPM_COUNTER_EN corresponds to mhpmcounter3. Index 31 in HPM_COUNTER_EN corresponds to mhpmcounter31.

cp_cntr_hpm

Reads only hpmcounter<n> (and hpmcounter<n>h on RV32) with HPM_COUNTER_EN[n] true

Table 103. Zihpm Coverpoint Definition
Coverpoint Bins Definition

cp_cntr_hpm

up to 29 (58 on RV32)

Read each implemented hpmcounter<n> twice using csrrs rd, csr, x0 (and csrrc) and check that the difference is non-negative. For RV32, also read hpmcounter<n>h and check that the difference is exactly 0. There is one bin per counter with HPM_COUNTER_EN[n] = True; other counters are not read. The boot code writes mhpmevent<n> = 0 (no event), so the counters are frozen and this is an accessibility check: each read must not trap and the value must be stable.

Accessing an unimplemented counter may trap or return a constant value, so those counters are not read. The suite assumes that mcounteren and scounteren allow reads of the implemented counters from U-mode (the boot code sets every bit). See RISC-V ISA Manual Issue #2558 for discussion.

MCOUNTENABLE_EN, SCOUNTENABLE_EN and HCOUNTENABLE_EN are exercised by the ZicntrS/U/H cp_mcounteren_access_*, cp_scounteren_access_* and cp_hcounteren_access_* coverpoints (Table 215). COUNTINHIBIT_EN is exercised by the Sm cp_inhibit_* coverpoints (Table 160).

A.10.9. Zihintpause Pause Hint

Table 104. Zihintpause Instruction Coverpoints
Instruction pause

RV32

x

RV64

x

cp_asm_count

x

Table 105. Zihintpause Normative Rules
Normative Rule Rule Text Coverpoints

pause_op

The PAUSE instruction is a HINT that indicates the current hart’s rate of instruction retirement should be temporarily reduced or paused. The duration of its effect must be bounded and may be zero.

Zihintpause_pause_cg/cp_asm_count

pause_enc_fence

PAUSE is encoded as a FENCE instruction with pred=W, succ=0, fm=0, rd=x0, and rs1=x0.

Zihintpause_pause_cg/cp_asm_count

pause_enc

PAUSE

Zihintpause_pause_cg/cp_asm_count

UDB Parameters: None.

A.10.10. Zihintntl Non-temporal Locality Hint

These instructions are hints that behave as nops. They are simply executed once. The rows of Table 106 with Zca in the ExtraExtensions column are the compressed instructions c.ntl.p1, c.ntl.pall, c.ntl.s1, and c.ntl.all, a subset of the c.add hints, and apply only when Zca is also supported.

Table 106. Zihintntl Instruction Coverpoints
Instruction ntl.p1 ntl.s1 ntl.pall ntl.all c.ntl.p1 c.ntl.s1 c.ntl.pall c.ntl.all

RV32

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

ExtraExtensions

Zca

Zca

Zca

Zca

cp_asm_count

x

x

x

x

x

x

x

x

Table 107. Zihintntl Normative Rules
Normative Rule Rule Text Coverpoints

ntl-p1_op

The NTL.P1 instruction indicates that the target instruction does not exhibit temporal locality within the capacity of the innermost level of private cache in the memory hierarchy.

Zihintntl_ntl_p1_cg/cp_asm_count

ntl-p1_enc

NTL.P1 is encoded as ADD x0, x0, x2.

Zihintntl_ntl_p1_cg/cp_asm_count

ntl-all_op

The NTL.ALL instruction indicates that the target instruction does not exhibit temporal locality within the capacity of any level of cache in the memory hierarchy.

Zihintntl_ntl_all_cg/cp_asm_count

ntl-all_enc

NTL.ALL is encoded as ADD x0, x0, x5.

Zihintntl_ntl_all_cg/cp_asm_count

ntl-pall_op

The NTL.PALL instruction indicates that the target instruction does not exhibit temporal locality within the capacity of any level of private cache in the memory hierarchy.

Zihintntl_ntl_pall_cg/cp_asm_count

ntl-pall_enc

NTL.PALL is encoded as ADD x0, x0, x3.

Zihintntl_ntl_pall_cg/cp_asm_count

ntl-s1_op

The NTL.S1 instruction indicates that the target instruction does not exhibit temporal locality within the capacity of the innermost level of shared cache in the memory hierarchy.

Zihintntl_ntl_s1_cg/cp_asm_count

ntl-s1_enc

NTL.S1 is encoded as ADD x0, x0, x4.

Zihintntl_ntl_s1_cg/cp_asm_count

ntl_compressed_variants

If the C or Zca extension is provided, compressed variants of these HINTs are also provided: C.NTL.P1 is encoded as C.ADD x0, x2; C.NTL.PALL is encoded as C.ADD x0, x3; C.NTL.S1 is encoded as C.ADD x0, x4; and C.NTL.ALL is encoded as C.ADD x0, x5.

{ZihintntlZca_c_ntl_p1_cg, ZihintntlZca_c_ntl_pall_cg, ZihintntlZca_c_ntl_s1_cg, ZihintntlZca_c_ntl_all_cg}/cp_asm_count

ntl_target_definition

The NTL instructions do not change architectural state, nor do they alter the architecturally visible effects of the target instruction.

{Zihintntl_ntl_p1_cg, Zihintntl_ntl_pall_cg, Zihintntl_ntl_s1_cg, Zihintntl_ntl_all_cg}/cp_asm_count

ntl_range

The NTL instructions affect all memory-access instructions except the cache-management instructions in the Zicbom extension.

Not tested: no architecturally visible effect

ntl_Zicbop_prefetch_outer

When an NTL instruction is applied to a prefetch hint in the Zicbop extension, it indicates that a cache line should be prefetched into a cache that is outer from the level specified by the NTL.

Not tested: no architecturally visible effect

ntl_trap_behavior

In the event that a trap is taken on the target instruction, implementations are discouraged from applying the NTL to the first instruction in the trap handler. Instead, implementations are recommended to ignore the HINT in this case.

Not tested: recommendation with no architecturally visible effect

UDB Parameters: None.

A.10.11. Zicboz Cache Block Zero

The cbo.zero instruction zeros a cache line. The cache line size may vary from one machine to another.

Table 108. Zicbo Coverpoint Definition
Coverpoint Bins Definition

cp_custom_cbo

65*2

Writes 65 words (260 bytes) of arbitrary data to scratch memory, executes cbo instruction at the aligned start of scratch, and then reads back all 260 bytes and stores them to the signature. The first cache line (often 64 bytes) of data should be zeroed and the rest unchanged. It repeats this operation with an offset of 255 bytes. The instruction ignores the offset within a cache line, so for 64-byte lines, this would zero bytes 192-255 and leave the others unchanged.

Table 109. Zicboz Instruction Coverpoints
Instruction cbo.zero

RV32

x

RV64

x

cp_asm_count

x

cp_rs1

nx0

cp_custom

cbo

Table 110. Zicboz Normative Rules
Normative Rule Rule Text Coverpoints

cache_block_size

The capacity and organization of a cache and the size of a cache block are both implementation-specific, and

Zicboz_cbo_zero_cg/cp_custom_cbo

cache_block_discovery

the execution environment provides software a means to discover information about the caches and cache blocks in a system.

Definition, checked through UDB

cache_block_size_uniform

In the initial set of CMO extensions, the size of a cache block shall be uniform throughout the system.

Definition, checked through UDB

cbo-zero_op

A CBO.ZERO instruction performs stores of zeros to the full set of bytes corresponding to the cache block that contains the address specified in rs1.

Zicboz_cbo_zero_cg/cp_custom_cbo

cbo-zero_unaligned

It is not required that rs1 is aligned to the size of a cache block.

Zicboz_cbo_zero_cg/cp_custom_cbo, Zic64bZicboz_cg/cp_zic64b

cbo-zero_specified_block

These instructions operate on the cache block, or the memory locations corresponding to the cache block, whose effective address is specified in rs1.

Zicboz_cbo_zero_cg/cp_custom_cbo

UDB Parameters: None.

A.10.12. Zicbom Cache Block Flush/Invalidate

Zicbom runs the same tests as Zicboz. cbo.flush and cbo.clean should have no architecturally visible effect. cbo.inval could discard the cache block, leaving the initial value of 0s. This may be difficult to match against a reference model, so perhaps this test needs to accept both the original data and 0s as correct answers. TODO - adjust if any machines need this.

Table 111. Zicbom Instruction Coverpoints
Instruction cbo.inval cbo.clean cbo.flush

RV32

x

x

x

RV64

x

x

x

cp_asm_count

x

x

x

cp_rs1

nx0

nx0

nx0

cp_custom

cbo

cbo

cbo

Table 112. Zicbom Normative Rules
Normative Rule Rule Text Coverpoints

ppo_overlap_1

if a precedes b in program order, then a will precede b in the global memory order if:

Not testable on a single core without DMA or other non-coherent agents

ppo_overlap_2

a is an invalidate, clean, or flush, b is a load, and a and b access overlapping memory addresses

Not testable on a single core without DMA or other non-coherent agents

invalidate_load_val_no_preceding_cmo

If no clean or flush operations on x precede i in the global memory order, either the initial value of x or the value of any store to x that precedes i

Not testable on a single core without DMA or other non-coherent agents

invalidate_load_val_no_store_before_cmo

If no store to x precedes a clean or flush operation on x in the global memory order and if the clean or flush operation on x precedes i in the global memory order, either the initial value of x or the value of any store to x that precedes i

Not testable on a single core without DMA or other non-coherent agents

invalidate_load_val_store_before_cmo

If a store to x precedes a clean or flush operation on x in the global memory order and if the clean or flush operation on x precedes i in the global memory order, either the value of the latest store to x that precedes the latest clean or flush operation on x or the value of any store to x that both precedes i and succeeds the latest clean or flush operation on x that precedes i

Not testable on a single core without DMA or other non-coherent agents

invalidate_load_val_noncoherent_store

The value of any store to x by a non-coherent agent regardless of the above conditions

Not testable on a single core without DMA or other non-coherent agents

pmp_same

The PMP access control bits shall be the same for all physical addresses in the cache block, and if write permission is granted by the PMP access control bits, read permission shall also be granted

Not tested: behavior is UNSPECIFIED

pma_same

The PMAs shall be the same for all physical addresses in the cache block, and if write permission is granted by the supported access type PMAs, read permission shall also be granted

Not tested: behavior is UNSPECIFIED

cbo_rsv

If the above constraints are not met, the behavior of a CBO instruction is UNSPECIFIED.

Not tested: behavior is UNSPECIFIED

H_trans_cache

For a standard cache-block management instruction (CBO.CLEAN, CBO.FLUSH, or CBO.INVAL) or cache-block zero instruction (CBO.ZERO), the transformed instruction has the format shown in . The operation field corresponds to the 12 most significant bits of the trapping instruction.

TODO: Hypervisor tests

cbo-clean_op

A CBO.CLEAN instruction performs a clean operation on the cache block whose effective address is the base address specified in rs1.

Zicbom_cbo_clean_cg/cp_custom_cbo

cbo-flush_op

A CBO.FLUSH instruction performs a flush operation on the cache block that contains the address specified in rs1.

Zicbom_cbo_flush_cg/cp_custom_cbo

cbo-flush_unaligned

It is not required that rs1 is aligned to the size of a cache block.

Zicbom_cbo_flush_cg/cp_custom_cbo

cbo-inval_op

A CBO.INVAL instruction performs an invalidate operation on the cache block that contains the address specified in rs1.

Zicbom_cbo_inval_cg/cp_custom_cbo

cbo-inval_unaligned

It is not required that rs1 is aligned to the size of a cache block.

Zicbom_cbo_inval_cg/cp_custom_cbo

UDB Parameters: None.

A.10.13. Zicbop Cache Block Prefetch

The Zicbop prefetch instructions are hints that do not have to do anything. They are tested by being executed with a variety of rs1 values and offsets to ensure that they are decoded and executed without trapping, but no specific behavior is required or checked except that the 65 words written to scratch are still read back correctly.

Table 113. Zicbop Instruction Coverpoints
Instruction prefetch.i prefetch.r prefetch.w

RV32

x

x

x

RV64

x

x

x

cp_asm_count

x

x

x

cp_rs1

x

x

x

cp_custom

prefetch

prefetch

prefetch

Table 114. Zicbop Normative Rules
Normative Rule Rule Text Coverpoints

prefetch-i_op

A PREFETCH.I instruction indicates to hardware that the cache block whose effective address is the sum of the base address specified in rs1 and the sign-extended offset encoded in imm[11:0], where imm[4:0] equals 0b00000, is likely to be accessed by an instruction fetch in the near future.

Zicbop_prefetch_i_cg/cp_custom_prefetch

prefetch-r_op

A PREFETCH.R instruction indicates to hardware that the cache block whose effective address is the sum of the base address specified in rs1 and the sign-extended offset encoded in imm[11:0], where imm[4:0] equals 0b00000, is likely to be accessed by a data read (i.e. load) in the near future.

Zicbop_prefetch_r_cg/cp_custom_prefetch

prefetch-w_op

A PREFETCH.W instruction indicates to hardware that the cache block whose effective address is the sum of the base address specified in rs1 and the sign-extended offset encoded in imm[11:0], where imm[4:0] equals 0b00000, is likely to be accessed by a data write (i.e. store) in the near future.

Zicbop_prefetch_w_cg/cp_custom_prefetch

prefetch_operating_block

These instructions operate on the cache block whose effective address is the sum of the base address specified in rs1 and the sign-extended offset encoded in imm[11:0], where imm[4:0] shall equal 0b00000.

{Zicbop_prefetch_i_cg, Zicbop_prefetch_r_cg, Zicbop_prefetch_w_cg}/cp_custom_prefetch

cbp_access

A cache-block prefetch instruction is permitted to access the specified cache block whenever a load instruction, store instruction, or instruction fetch is permitted to access the corresponding physical addresses.

{Zicbop_prefetch_i_cg, Zicbop_prefetch_r_cg, Zicbop_prefetch_w_cg}/cp_custom_prefetch

cbp_unperm_noexcep

If access to the cache block is not permitted, a cache-block prefetch instruction does not raise any exceptions and shall not access any caches or memory.

PMPZicbo_cg/{cp_prefetch_i, cp_prefetch_r, cp_prefetch_w}

UDB Parameters: None.

A.10.14. Za64rs Max 64B Reservation Set

Table 115. Za64rs Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule

cp_za64rs

reservation set size

For each offset in [0, 64] that is a multiple of 4, lr.w from base address that a multiple of 64 and then sc.w to an address with that offset from base

sc success code in rd matches reference model, succeeding for small offsets and failing for large offsets (definitely for 64, optionally smaller)

17

Za64rs_res_set_req
Reservation sets are contiguous, naturally aligned, and a maximum of 64 bytes.

Note:

Can borrow tests from sc.w unprivileged test

Table 116. Za64rs Normative Rules
Normative Rule Rule Text Coverpoints

Za128rs_res_set_req

The Za128rs extension requires that the reservation sets used by the instructions in the Zalrsc extension be contiguous, naturally aligned, and at most 128 bytes in size.

Za64rs_res_set_req

The Za64rs extension requires that the reservation sets used by the instructions in the Zalrsc extension be contiguous, naturally aligned, and at most 64 bytes in size.

Za64rs_cg/cp_za64rs

Za64rs_implies_Za128rs

The Za64rs extension implies the Za128rs extension.

Definition, checked through UDB

UDB Parameters: None.

A.10.15. Zic64bZicboz 64B Cache Block Zero

Table 117. Zic64bZicboz Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule

cp_zic64b

Cache block zeros

For each offset in range of [0, 64]: Write all 1s to 128 consecutive bytes, then do cbo with offset from 64-bit aligned base. Read back words at offsets of 0, 60, 64, 124 from base.

Match ref model. Only 64 bytes written. When offset is 64, they are in the second block.

65

Zic64b_cache_block_size
cbo-zero_unaligned

Table 118. Zic64b Normative Rules
Normative Rule Rule Text Coverpoints

Zic64b_cache_block_size

If the Zic64b extension is implemented, then cache blocks must be 64 bytes in size, naturally aligned in the address space.

Zic64bZicboz_cg/cp_zic64b

UDB Parameters: None.

A.11. V Vector Extension

The vector coverpoints are intended to be flexible to support the full V extension, the Zve* embedded vector extensions, and arbitrary mixes of supported vector length (VLEN), element lengths (SEWMIN, ELEN), and floating-point precisions.

The vector extension is huge. The testplan is partitioned into three unprivileged portions discussed here, and two privileged portions (ExceptionsV, SsstrictV) discussed in Section B.10.

The full V extension supports all selected element widths SEW={8, 16, 32, 64}. The vector coverage files and tests are organized by SEW. Thus, a DUT could handle any contiguous subset of SEW from SEWMIN to ELEN. For example, a DUT with SEWMIN=16 and ELEN=32 would support SEW={16, 32}.

The tests detect VLMAX and set the vector length accordingly, up to some configurable maximum VLEN (default 4096 bits, although the vector extension theoretically supports up to 65536). Therefore, there is no need for different test suites for different VLENs.

A.11.1. Vector File Organization

Listing 1 summarizes the structure of the coverpoint and test files for the vector extension. The unprivileged vector tests are organized by integer (Vx), load/store (Vls), and floating-point (Vf) types of instructions. Each applies to SEW=8, 16, 32, and/or 64. The ExceptionsV, V, and SsstrictV privileged tests are described in section XREF.

The vector tests are organized by XLEN=32 and XLEN=64 because the scalar registers behavior differs by XLEN. For example, vadd.vx with SEW=64 sign-extends XLEN=32 scalar registers but does not modify XLEN=64 scalar registers. For a given XLEN, the vector tests are organized by type (Vx/Vls/Vf) and SEW (8/16/32/64). Each directory contains a .S file for every vector instruction of that type [4]. Vector load/store instructions run with any SEW but also specify EEW as part of the instruction name. For example, vle8.v and vle16.v can both be executed in either SEW=8 or SEW=16, and the EMUL behavior is different between these modes. Therefore, all the load/store variants are included in all of Vls{8/16/32/64}.

Vx and Vf are separated because certain extensions such as Zve64x do not support floating-point. Vls could be lumped with Vx, but the coverpoints are so different that it is easier to define the tests separately, and facilitates just running integer vs. load/store tests during development.

Listing 1. Vector Organization
fcov
    unpriv
        Vx8_coverage.svh
        Vx16_coverage.svh
        Vx32_coverage.svh
        Vx64_coverage.svh
        Vls8_coverage.svh
        Vls16_coverage.svh
        Vls32_coverage.svh
        Vls64_coverage.svh
        Vf16_coverage.svh
        Vf32_coverage.svh
        Vf64_coverage.svh
      priv
        ExceptionsVx_coverage.svh
        ExceptionsVls_coverage.svh
        ExceptionsVf16_coverage.svh
        ExceptionsVf32_coverage.svh
        ExceptionsVf64_coverage.svh
        ExceptionsVfmin_coverage.svh
        MisalignV_coverage.svh
        SsstrictV_coverage.svh
        Sm_coverage.svh (Sm_V_cg, Sm_VF_cg)
        UV_coverage.svh
tests
    rv32
        Vx8
            vadd.vv.S
            vadd.vx.S
            vadd.vi.S
            vsub.vv.S
            ...
        Vx16
            vadd.vv.S
            ...
        Vx32
            vadd.vv.S
            ...
        Vx64
            vadd.vv.S
            ...
        Vls8
            vle8.v.S
            vle16.v.S
            vle32.v.S
            vle64.v.S
            vlseg2e8.v.S
            ...
        Vls16
            vle8.v.S
            ...
        Vls32
            vle8.v.S
            ...
        Vls64
            vle8.v.S
            ...
        Vf16
            vfadd.vv.S
            vfadd.vf.S
            vfwadd.vv.S
            vfsub.vv.S
            ...
        Vf32
            vfadd.vv.S
            ...
        Vf64
            vfadd.vv.S
            ...
    rv64
        Vx8
        Vx16
        Vx32
        Vx64
        Vls8
        Vls16
        Vls32
        Vls64
        Vf16
        Vf32
        Vf64
    priv
        ExceptionsVx
        ExceptionsVls
        ExceptionsVf16
        ExceptionsVf32
        MisalignV
        SsstrictV
        Sm (Sm_V_*.S, Sm_VF-*.S)
        UV

When an instruction’s EEW is not a supported SEW, the coverage files and tests exclude the instruction from testing. For example, vwadd.vv is not supported when SEW=32 and ELEN = 32 because it cannot widen to 64 bits.

The tests also account for unsupported register group overlap. For example, a widening add vwadd.wv v0, v2, v2 is unsupported because the source registers cannot be read with different EEWs. On the other hand vwadd.vv v0, v1, v8 with LMUL=1 is supported even though the destination vd=v0 widens to write [v0-v1], which overlaps with vs2=v1. The tests exercise all supported overlaps, but do not attempt any unsupported overlaps because the behavior is reserved and unpredictable.

A.11.2. Vector Configuration Parameters

The coverpoints and tests are parameterized by the minimum supported element width SEWMIN and the maximum supported element width ELEN. The coverpoints and tests exclude unsupported edge cases, such as widening to more than ELEN or using LMUL=1/8 with ELEN=32 but SEWMIN=8.

A.11.3. Vector Coverpoints

Running long vectors is computationally expensive, so only a subset of vectors tests run on multi-element vectors. Coverpoints for source and destination registers, edge values, etc. run on a vector length of vl = 1.

Table 119 defines the coverpoints used in vector instructions. Unless otherwise specified, each coverpoint uses vector length vl=1 and length multiplier LMUL=1, no mask (vm=1), and vstart=0. Hence, they act on exactly one vector element. For such coverpoints, instructions that require a mask use v0=0.

Table 119. Vector Coverpoint Definitions
Coverpoint # Bins Definition

Coverpoints acting on single element vl=1

cp_vd

32

All vector destination registers vd=0-31

cp_vs2

32

All vector source registers vs2=0-31

cp_vs1

32

All vector source registers vs1=0-31

cp_vs3

32

All vector source registers vs3=0-31

cp_rs1

32

All scalar registers rs1=0-31

cp_rs2

32

All scalar registers rs2=0-31

cp_imm_5bit

32

Signed immediate values -16 to +15

cmp_rs1_rs2

32

rs1 and rs2 are same register ID

cmp_vd_vs2

32

vd and vs2 are same register ID

cmp_vd_vs1

32

vd and vs1 are same register ID

cmp_vs2_vs1

32

vs2 and vs1 are same register ID

cmp_vs3_vs2

32

vs3 and vs2 are the same register ID

cmp_vd_vs1_vs2

32

vd and vs1 and vs2 are same register ID

cp_rs1_edges

9

0, 1, 2, -1, -2, most negative, most negative+1, most positive, most positive-1

cp_rs2_edges

5

0, 1, 2, -1, -2 (for strided vector load/store)

cp_fs1_edges

20

0, -1, -smallest subnorm, -inf, 1, 1+ulp, 0.5, 1.5, 2, 4, pi, 2^emax, largest normal, smallest normal, largest subnormal, subnormal with leading 1 in fraction, infinity, canonical quite NaN, noncanonical quiet NaN, signaling NaN with payload of 1

cp_vs2_edges

9 or 20

see cp_rs1_edges or cp_fs1_edges

cp_vs1_edges

9 or 20

see cp_rs1_edges

cr_vs2_vs1_edges

9^2 or 20^2

Cross-product of edges of vs2 and vs1

cr_vs2_rs1_edges

9*9

Cross-product of edges of vs2 and rs1

cr_vs2_fs1_edges

20*20

Cross-product of edges of vs2 and fs1

cr_vs2_imm_edges

9*9

Cross-product of edges of vs2 and imm={0, 1, 2, 14, 15, -1, -2, -15,-16}

cr_vxrm_vs2_vs1_edges

9*9*4

Cross-product of edges of vs2 and vs1 with vector rounding mode={rod, rdn, rne, rnu}

cr_vxrm_vs2_rs1_edges

9*9*4

See cr_vxrm_vs2_vs1_edges

cr_vxrm_vs2_imm_edges

9*9*4

See cr_vxrm_vs2_vs1_edges

cp_csr_frm

5*10

Floating-point rounding mode={rdn, rmm, rne, rtz, rup} with 10 random inputs per mode

cp_csr_fflags

5*2

Floating-point sets and clears all applicable flags

Coverpoints acting on multiple elements vl ≠ 1

cp_masking_edges

5

Mask edge cases v0=all 1s, all 0s, random, first VLMAX-1 ones, first VLMAX/2+1 ones; vl=VLMAX, vm=1 to mask, vma = random, vta = 0

cr_vl_lmul

7*3

Cross legal combinations of LMUL={1/2/4/8/f2/f4/f8} and vl={1, random, VLMAX}, while randomizing v0 mask value, vm, vta, vma.

cr_vtype_agnostic

4

Cross vta={0/1} and vma={0/1}. Random legal LMUL, random legal vl, vm=1, v0=random mask

cp_vxsat

2

vxsat={0, 1}. Hit by cr_vs2_vs1_edges so no tests needed.

cp_vl_0

1

vl=0. LMUL=1, no mask, vma=0, vta=1

As with other unprivileged testplans, an x in the spreadsheet indicates to use the coverpoint. Other values in the spreadsheet indicate a variant of the coverpoint:

  • nv0: Do not include v0 in the coverpoint. For example, cp_vd_nv0 means that the destination register vd does not include v0.

  • emul2: Only exercise even-numbered registers. For example cp_vs2_emul2 uses vs2={v0, v2, v4, …​v30}. For edge values, emul2 means the edge value is twice the width of SEW.

  • emul4/8: Similar to emul2

  • emulf2, emulf4, emulf8: edge values are 1/2, 1/4, or 1/8 the width of SEW. Used in extension instructions such as vsext.vf2.

  • u: Treat immediate as unsigned 0 to 31 rather than signed -16 to +15. For edge values, {0, 1, 2, 15, 16, 30, 31}.

  • eew1/mm: Mask instructions with 1-bit elements such as vmand.mm use at least vl=8 to operate on multi-bit masks.

  • wv: vs2 is double-width and uses emul2 for its edge values. vs1 is normal width.

  • wred: vs1 is double-width and uses emul2 for its edge values. vs2 is normal width.

  • wx: vs2 is double-width and uses emul2 for its edge values. rs1 is normal width.

  • wi/wiu: vs2 is double-width and uses emul2 for its edge values. immediate is 5 bit signed or unsigned.

  • lmul4max/emul4max: maximum LMUL/EMUL is 4 instead of 8. vwadd.vv uses lmul4max because it cannot accept LMUL=8 widened to 16. vlseg2e8.v uses emul4max because the number of segments * EMUL cannot exceed 8.

  • lmul2max/lmul1max/emul2max/emul1max: see lmul4max

  • lte30/…​/lte24: Register number is less than or equal to 30, …​, 24. Used for segmented load/store so segments won’t overflow the register file.

  • ls_e{8/16/32/64}: load/store edges with EEW=8,…​,64. Used to convert strided loads from elements to bytes.

  • ls: load/store edges instead of integer edges: vs2={0, random < 2*VLMAX}. rs2= {1, 2, -1, -2, 0}

  • f: floating-point edges instead of integer edges: *

  • cp_custom_*: custom coverpoint defined in the coverage file. See definitions for "Vx_custom_definitions, "VxCustom", "Vf_custom_definitions", "Vls_custom_definitions".

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

A.11.4. Vx

The Vx testplan is the same for SEW={8, 16, 32, 64}. Each SEW has its own coverage file (e.g. Vx8_coverages.svh) independent of XLEN, as well as tests that depend on XLEN (e.g. rv32/Vx8/vadd.vx.S).

Table 120. Vx Instruction Coverpoints
Instruction vadd.vv vadd.vx vadd.vi vwadd.vv vwadd.vx vwaddu.vv vwaddu.vx vwadd.wv vwadd.wx vwaddu.wv vwaddu.wx vsub.vv

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vd

x

x

x

emul2

emul2

emul2

emul2

emul2

emul2

emul2

emul2

x

cp_vs2

x

x

x

x

x

x

x

emul2

emul2

emul2

emul2

x

cp_vs1

x

x

x

x

x

x

cp_rs1

x

x

x

x

x

cp_imm_5bit

x

cmp_vd_vs2

x

x

x

emul2

emul2

emul2

emul2

x

cmp_vd_vs1

x

x

cmp_vs1_vs2

x

x

x

x

cmp_vd_vs1_vs2

x

x

cp_vs2_edges

x

x

x

x

x

x

x

emul2

emul2

emul2

emul2

x

cp_vs1_edges

x

x

x

x

x

x

cr_vs2_vs1_edges

x

x

x

wv

wv

x

cp_rs1_edges

x

x

x

x

x

cr_vs2_rs1_edges

x

x

x

wx

wx

cr_vs2_imm_edges

x

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

x

x

x

lmul4max

lmul4max

lmul4max

lmul4max

lmul4max

lmul4max

lmul4max

lmul4max

x

cr_vtype_agnostic

x

x

x

lmul4max

lmul4max

lmul4max

lmul4max

lmul4max

lmul4max

lmul4max

lmul4max

x

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

std_vec

x

x

x

x

x

x

cp_custom

wvv_all

wvx_all

wvv

wvx

wwv_all

wwv

Instruction vsub.vx vwsub.vv vwsub.vx vwsubu.vv vwsubu.vx vwsub.wv vwsub.wx vwsubu.wv vwsubu.wx vrsub.vx vrsub.vi vzext.vf2

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vd

x

emul2

emul2

emul2

emul2

emul2

emul2

emul2

emul2

x

x

x

cp_vs2

x

x

x

x

x

emul2

emul2

emul2

emul2

x

x

x

cp_vs1

x

x

x

x

cp_rs1

x

x

x

x

x

x

cp_imm_5bit

x

cmp_vd_vs2

x

emul2

emul2

emul2

emul2

x

x

cmp_vs1_vs2

x

x

cp_vs2_edges

x

x

x

x

x

emul2

emul2

emul2

emul2

x

x

emulf2

cp_vs1_edges

x

x

x

x

cr_vs2_vs1_edges

x

x

wv

wv

cp_rs1_edges

x

x

x

x

x

x

cr_vs2_rs1_edges

x

x

x

wx

wx

x

cr_vs2_imm_edges

x

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

x

lmul4max

lmul4max

lmul4max

lmul4max

lmul4max

lmul4max

lmul4max

lmul4max

x

x

x

cr_vtype_agnostic

x

lmul4max

lmul4max

lmul4max

lmul4max

lmul4max

lmul4max

lmul4max

lmul4max

x

x

x

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

std_vec

x

x

x

x

x

x

x

cp_custom

wvv

wvx

wvv

wvx

wwv

wwv

vext2

Instruction vzext.vf4 vzext.vf8 vsext.vf2 vsext.vf4 vsext.vf8 vadc.vvm vadc.vxm vadc.vim vsbc.vvm vsbc.vxm vmadc.vvm vmadc.vxm

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vd

x

x

x

x

x

nv0

nv0

nv0

nv0

nv0

x

x

cp_vs2

x

x

x

x

x

nv0

nv0

nv0

nv0

nv0

nv0

nv0

cp_vs1

nv0

nv0

nv0

cp_rs1

x

x

x

cp_imm_5bit

x

cmp_vd_vs2

nv0

nv0

nv0

nv0

nv0

cmp_vd_vs1

nv0

nv0

cmp_vs1_vs2

nv0

nv0

nv0

cmp_vd_vs1_vs2

nv0

nv0

cp_vs2_edges

emulf4

emulf8

emulf2

emulf4

emulf8

x

x

x

x

x

x

x

cp_vs1_edges

x

x

x

cr_vs2_vs1_edges

x

x

x

cp_rs1_edges

x

x

x

cr_vs2_rs1_edges

x

x

x

cr_vs2_imm_edges

x

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

x

x

x

x

x

x

x

x

x

x

x

x

cr_vtype_agnostic

x

x

x

x

x

x

x

x

x

x

x

x

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

std_vec

x

x

x

x

x

x

x

cp_custom

vext4

vext8

vext2

vext4

vext8

maskwrite_masked

maskwrite_masked

Instruction vmadc.vim vmadc.vv vmadc.vx vmadc.vi vmsbc.vvm vmsbc.vxm vmsbc.vv vmsbc.vx vand.vv vand.vx vand.vi vor.vv

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vd

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs2

nv0

x

x

x

nv0

nv0

x

x

x

x

x

x

cp_vs1

x

nv0

x

x

x

cp_rs1

x

x

x

x

cp_imm_5bit

x

x

x

cmp_vd_vs2

x

x

x

x

cmp_vd_vs1

x

x

cmp_vs1_vs2

x

nv0

x

x

x

cmp_vd_vs1_vs2

x

x

cp_vs2_edges

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs1_edges

x

x

x

x

x

cr_vs2_vs1_edges

x

x

x

x

x

cp_rs1_edges

x

x

x

x

cr_vs2_rs1_edges

x

x

x

x

cr_vs2_imm_edges

x

x

x

cp_masking_edges

x

x

x

x

x

x

x

cr_vl_lmul

x

nomask

nomask

nomask

x

x

nomask

nomask

x

x

x

x

cr_vtype_agnostic

x

nomask

nomask

nomask

x

x

nomask

nomask

x

x

x

x

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

std_vec

x

x

x

x

x

x

x

x

cp_custom

maskwrite_masked

maskwrite_unmasked

maskwrite_unmasked

maskwrite_unmasked

maskwrite_masked

maskwrite_masked

maskwrite_unmasked

maskwrite_unmasked

Instruction vor.vx vor.vi vxor.vv vxor.vx vxor.vi vsll.vv vsll.vx vsll.vi vsrl.vv vsrl.vx vsrl.vi vnsrl.wv

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vd

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs2

x

x

x

x

x

x

x

x

x

x

x

emul2

cp_vs1

x

x

x

x

cp_rs1

x

x

x

x

cp_imm_5bit

x

x

u

u

cmp_vd_vs2

x

x

x

x

x

x

x

x

x

x

x

cmp_vd_vs1

x

x

x

x

cmp_vs1_vs2

x

x

x

cmp_vd_vs1_vs2

x

x

x

cp_vs2_edges

x

x

x

x

x

x

x

x

x

x

x

emul2

cp_vs1_edges

x

x

x

x

cr_vs2_vs1_edges

x

x

x

wv

cp_rs1_edges

x

x

x

x

cr_vs2_rs1_edges

x

x

x

x

cr_vs2_imm_edges

x

x

u

u

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

x

x

x

x

x

x

x

x

x

x

x

lmul4max

cr_vtype_agnostic

x

x

x

x

x

x

x

x

x

x

x

lmul4max

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

std_vec

x

x

x

x

x

cp_custom

shift_vv

shift_vx

shift_vv

shift_vx

shift_wv

Instruction vnsrl.wx vnsrl.wi vsra.vv vsra.vx vsra.vi vnsra.wv vnsra.wx vnsra.wi vmseq.vv vmseq.vx vmseq.vi vmsne.vv

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vd

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs2

emul2

emul2

x

x

x

emul2

emul2

emul2

x

x

x

x

cp_vs1

x

x

x

x

cp_rs1

x

x

x

x

cp_imm_5bit

u

u

u

x

cmp_vd_vs2

x

x

x

cmp_vd_vs1

x

x

cmp_vs1_vs2

x

x

x

cmp_vd_vs1_vs2

x

cp_vs2_edges

emul2

emul2

x

x

x

emul2

emul2

emul2

x

x

x

x

cp_vs1_edges

x

x

x

x

cr_vs2_vs1_edges

x

wv

x

x

cp_rs1_edges

x

x

x

x

cr_vs2_rs1_edges

wx

x

wx

x

cr_vs2_imm_edges

wiu

u

wiu

x

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

lmul4max

lmul4max

x

x

x

lmul4max

lmul4max

lmul4max

x

x

x

x

cr_vtype_agnostic

lmul4max

lmul4max

x

x

x

lmul4max

lmul4max

lmul4max

x

x

x

x

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

std_vec

x

x

x

x

x

x

x

x

x

x

x

cp_custom

shift_wx

shift_wi

shift_vv

shift_vx

shift_wv

shift_wx

shift_wi

maskwrite_masked

maskwrite_masked

maskwrite_masked

maskwrite_masked

cp_custom_shift_wi_all

x

x

Instruction vmsne.vx vmsne.vi vmslt.vv vmslt.vx vmsltu.vv vmsltu.vx vmsle.vv vmsle.vx vmsle.vi vmsleu.vv vmsleu.vx vmsleu.vi

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vd

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs2

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs1

x

x

x

x

cp_rs1

x

x

x

x

x

cp_imm_5bit

x

x

x

cmp_vs1_vs2

x

x

x

x

cp_vs2_edges

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs1_edges

x

x

x

x

cr_vs2_vs1_edges

x

x

x

x

cp_rs1_edges

x

x

x

x

x

cr_vs2_rs1_edges

x

x

x

x

x

cr_vs2_imm_edges

x

x

x

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

x

x

x

x

x

x

x

x

x

x

x

x

cr_vtype_agnostic

x

x

x

x

x

x

x

x

x

x

x

x

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

std_vec

x

x

x

x

x

x

x

x

x

x

x

x

cp_custom

maskwrite_masked

maskwrite_masked

maskwrite_masked

maskwrite_masked

maskwrite_masked

maskwrite_masked

maskwrite_masked

maskwrite_masked

maskwrite_masked

maskwrite_masked

maskwrite_masked

maskwrite_masked

Instruction vmsgt.vx vmsgt.vi vmsgtu.vx vmsgtu.vi vmin.vv vmin.vx vminu.vv vminu.vx vmax.vv vmax.vx vmaxu.vv vmaxu.vx

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vd

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs2

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs1

x

x

x

x

cp_rs1

x

x

x

x

x

x

cp_imm_5bit

x

x

cmp_vd_vs2

x

x

x

x

x

x

x

x

cmp_vd_vs1

x

x

x

x

cmp_vs1_vs2

x

x

x

x

cmp_vd_vs1_vs2

x

x

x

x

cp_vs2_edges

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs1_edges

x

x

x

x

cr_vs2_vs1_edges

x

x

x

x

cp_rs1_edges

x

x

x

x

x

x

cr_vs2_rs1_edges

x

x

x

x

x

x

cr_vs2_imm_edges

x

x

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

x

x

x

x

x

x

x

x

x

x

x

x

cr_vtype_agnostic

x

x

x

x

x

x

x

x

x

x

x

x

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

std_vec

x

x

x

x

cp_custom

maskwrite_masked

maskwrite_masked

maskwrite_masked

maskwrite_masked

Instruction vmul.vv vmul.vx vmulh.vv vmulh.vx vmulhu.vv vmulhu.vx vmulhsu.vv vmulhsu.vx vwmul.vv vwmul.vx vwmulu.vv vwmulu.vx

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vd

x

x

x

x

x

x

x

x

emul2

emul2

emul2

emul2

cp_vs2

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs1

x

x

x

x

x

x

cp_rs1

x

x

x

x

x

x

cmp_vd_vs2

x

x

x

x

x

x

x

x

cmp_vd_vs1

x

x

x

x

cmp_vs1_vs2

x

x

x

x

x

x

cmp_vd_vs1_vs2

x

x

x

x

cp_vs2_edges

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs1_edges

x

x

x

x

x

x

cr_vs2_vs1_edges

x

x

x

x

x

x

cp_rs1_edges

x

x

x

x

x

x

cr_vs2_rs1_edges

x

x

x

x

x

x

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

x

x

x

x

x

x

x

x

lmul4max

lmul4max

lmul4max

lmul4max

cr_vtype_agnostic

x

x

x

x

x

x

x

x

lmul4max

lmul4max

lmul4max

lmul4max

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

std_vec

x

x

x

x

cp_custom

wvv

wvx

wvv

wvx

Instruction vwmulsu.vv vwmulsu.vx vdiv.vv vdiv.vx vdivu.vv vdivu.vx vrem.vv vrem.vx vremu.vv vremu.vx vmacc.vv vmacc.vx

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vd

emul2

emul2

x

x

x

x

x

x

x

x

x

x

cp_vs2

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs1

x

x

x

x

x

x

cp_rs1

x

x

x

x

x

x

cmp_vd_vs2

x

x

x

x

x

x

x

x

x

x

cmp_vd_vs1

x

x

x

x

x

cmp_vs1_vs2

x

x

x

x

x

x

cmp_vd_vs1_vs2

x

x

x

x

x

cp_vs2_edges

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs1_edges

x

x

x

x

x

x

cr_vs2_vs1_edges

x

x

x

x

x

x

cp_rs1_edges

x

x

x

x

x

x

cr_vs2_rs1_edges

x

x

x

x

x

x

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

lmul4max

lmul4max

x

x

x

x

x

x

x

x

x

x

cr_vtype_agnostic

lmul4max

lmul4max

x

x

x

x

x

x

x

x

x

x

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

std_vec

x

x

cp_custom

wvv

wvx

Instruction vnmsac.vv vnmsac.vx vmadd.vv vmadd.vx vnmsub.vv vnmsub.vx vwmacc.vv vwmacc.vx vwmaccu.vv vwmaccu.vx vwmaccsu.vv vwmaccsu.vx

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vd

x

x

x

x

x

x

emul2

emul2

emul2

emul2

emul2

emul2

cp_vs2

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs1

x

x

x

x

x

x

cp_rs1

x

x

x

x

x

x

cmp_vd_vs2

x

x

x

x

x

x

cmp_vd_vs1

x

x

x

cmp_vs1_vs2

x

x

x

x

x

x

cmp_vd_vs1_vs2

x

x

x

cp_vs2_edges

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs1_edges

x

x

x

x

x

x

cr_vs2_vs1_edges

x

x

x

x

x

x

cp_rs1_edges

x

x

x

x

x

x

cr_vs2_rs1_edges

x

x

x

x

x

x

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

x

x

x

x

x

x

lmul4max

lmul4max

lmul4max

lmul4max

lmul4max

lmul4max

cr_vtype_agnostic

x

x

x

x

x

x

lmul4max

lmul4max

lmul4max

lmul4max

lmul4max

lmul4max

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vwmaccus.vx vmerge.vvm vmerge.vxm vmerge.vim vmv.v.v vmv.v.x vmv.v.i vsadd.vv vsadd.vx vsadd.vi vsaddu.vv vsaddu.vx

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vd

emul2

nv0

nv0

nv0

x

x

x

x

x

x

x

x

cp_vs2

x

nv0

nv0

nv0

x

x

x

x

x

cp_vs1

nv0

x

x

x

cp_rs1

x

x

x

x

x

cp_imm_5bit

x

x

x

cmp_vd_vs2

nv0

nv0

nv0

x

x

x

x

x

cmp_vd_vs1

nv0

x

x

x

cmp_vs1_vs2

nv0

x

x

cmp_vd_vs1_vs2

nv0

x

x

cp_vs2_edges

x

x

x

x

x

x

x

x

x

cp_vs1_edges

x

x

x

x

cr_vs2_vs1_edges

x

x

x

cp_rs1_edges

x

x

x

x

x

cr_vs2_rs1_edges

x

x

x

x

cr_vs2_imm_edges

x

x

cp_masking_edges

x

x

x

x

x

x

x

x

x

cr_vl_lmul

lmul4max

x

x

x

nomask

nomask

nomask

x

x

x

x

x

cr_vtype_agnostic

lmul4max

x

x

x

nomask

nomask

nomask

x

x

x

x

x

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

cp_csr_vxsat

x

x

x

x

x

Instruction vsaddu.vi vssub.vv vssub.vx vssubu.vv vssubu.vx vaadd.vv vaadd.vx vaaddu.vv vaaddu.vx vasub.vv vasub.vx vasubu.vv

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vd

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs2

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs1

x

x

x

x

x

x

cp_rs1

x

x

x

x

x

cp_imm_5bit

x

cmp_vd_vs2

x

x

x

x

x

x

x

x

x

x

x

x

cmp_vd_vs1

x

x

x

x

x

x

cmp_vs1_vs2

x

x

x

x

x

x

cmp_vd_vs1_vs2

x

x

x

x

x

x

cp_vs2_edges

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs1_edges

x

x

x

x

x

x

cr_vs2_vs1_edges

x

x

x

x

x

x

cr_vxrm_vs2_vs1_edges

x

x

x

x

cp_rs1_edges

x

x

x

x

x

cr_vs2_rs1_edges

x

x

x

x

x

cr_vxrm_vs2_rs1_edges

x

x

x

cr_vs2_imm_edges

x

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

x

x

x

x

x

x

x

x

x

x

x

x

cr_vtype_agnostic

x

x

x

x

x

x

x

x

x

x

x

x

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

cp_csr_vxsat

x

x

x

x

x

Instruction vasubu.vx vsmul.vv vsmul.vx vssrl.vv vssrl.vx vssrl.vi vssra.vv vssra.vx vssra.vi vnclip.wv vnclip.wx vnclip.wi

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vd

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs2

x

x

x

x

x

x

x

x

x

emul2

emul2

emul2

cp_vs1

x

x

x

x

cp_rs1

x

x

x

x

x

cp_imm_5bit

u

u

u

cmp_vd_vs2

x

x

x

x

x

x

x

x

x

cmp_vd_vs1

x

x

x

x

cmp_vs1_vs2

x

x

x

cmp_vd_vs1_vs2

x

x

x

cp_vs2_edges

x

x

x

x

x

x

x

x

x

emul2

emul2

emul2

cp_vs1_edges

x

x

x

x

cr_vs2_vs1_edges

x

x

x

wv

cr_vxrm_vs2_vs1_edges

x

x

x

wv

cp_rs1_edges

x

x

x

x

x

cr_vs2_rs1_edges

x

x

x

x

wx

cr_vxrm_vs2_rs1_edges

x

x

x

x

wx

cr_vs2_imm_edges

u

u

wiu

cr_vxrm_vs2_imm_edges

x

x

wi

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

x

x

x

x

x

x

x

x

x

lmul4max

lmul4max

lmul4max

cr_vtype_agnostic

x

x

x

x

x

x

x

x

x

lmul4max

lmul4max

lmul4max

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

cp_csr_vxsat

x

no_rv32_sew64

std_vec

x

x

x

x

x

x

x

cp_custom

shift_vv

shift_vx

shift_vv

shift_vx

shift_wv

shift_wx

shift_wi

cp_custom_shift_wi_all

x

Instruction vnclipu.wv vnclipu.wx vnclipu.wi vredsum.vs vwredsum.vs vwredsumu.vs vredmax.vs vredmaxu.vs vredmin.vs vredminu.vs vredand.vs vredor.vs

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vd

x

x

x

x

emul2

emul2

x

x

x

x

x

x

cp_vs2

emul2

emul2

emul2

x

x

x

x

x

x

x

x

x

cp_vs1

x

x

emul2

emul2

x

x

x

x

x

x

cp_rs1

x

cp_imm_5bit

u

cmp_vd_vs2

x

x

x

x

x

x

x

cmp_vd_vs1

x

x

emul2

emul2

x

x

x

x

x

x

cmp_vs1_vs2

x

x

x

x

x

x

x

cmp_vd_vs1_vs2

x

x

x

x

x

x

x

cp_vs2_edges

emul2

emul2

emul2

x

x

x

x

x

x

x

x

x

cp_vs1_edges

x

x

emul2

emul2

x

x

x

x

x

x

cr_vs2_vs1_edges

wv

x

wred

wred

x

x

x

x

x

x

cr_vxrm_vs2_vs1_edges

wv

cp_rs1_edges

x

cr_vs2_rs1_edges

wx

cr_vxrm_vs2_rs1_edges

wx

cr_vs2_imm_edges

wiu

cr_vxrm_vs2_imm_edges

wi

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

lmul4max

lmul4max

lmul4max

x

lmul4max

lmul4max

x

x

x

x

x

x

cr_vtype_agnostic

lmul4max

lmul4max

lmul4max

x

lmul4max

lmul4max

x

x

x

x

x

x

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

std_vec

x

x

x

x

x

x

x

x

x

x

x

x

cp_custom

shift_wv

shift_wx

shift_wi

red

wred

wred

red

red

red

red

red

red

cp_custom_shift_wi_all

x

cp_custom_vreductionw

x

x

Instruction vredxor.vs vmand.mm vmnand.mm vmandn.mm vmxor.mm vmor.mm vmnor.mm vmorn.mm vmxnor.mm vcpop.m vfirst.m vmsbf.m

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vd

x

x

x

x

x

x

x

x

x

x

cp_rd

x

x

cp_vs2

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs1

x

x

x

x

x

x

x

x

x

cmp_vd_vs2

x

x

x

x

x

x

x

x

x

cmp_vd_vs1

x

x

x

x

x

x

x

x

x

cmp_vs1_vs2

x

x

x

x

x

x

x

x

x

cmp_vd_vs1_vs2

x

x

x

x

x

x

x

x

x

cp_vs2_edges

x

eew1

eew1

eew1

eew1

eew1

eew1

eew1

eew1

eew1

eew1

eew1

cp_vs1_edges

x

eew1

eew1

eew1

eew1

eew1

eew1

eew1

eew1

cr_vs2_vs1_edges

x

mm

mm

mm

mm

mm

mm

mm

mm

cp_masking_edges

x

x

x

x

cr_vl_lmul

x

nomask

nomask

nomask

nomask

nomask

nomask

nomask

nomask

x

x

x

cr_vtype_agnostic

x

nomask

nomask

nomask

nomask

nomask

nomask

nomask

nomask

x

x

x

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

std_vec

x

x

x

x

x

x

x

x

x

x

x

x

cp_custom

red

maskwrite_unmasked

maskwrite_unmasked

maskwrite_unmasked

maskwrite_unmasked

maskwrite_unmasked

maskwrite_unmasked

maskwrite_unmasked

maskwrite_unmasked

gprwrite

gprwrite

maskwrite_unmasked

Instruction vmsif.m vmsof.m viota.m vid.v vmv.x.s vmv.s.x vslideup.vx vslideup.vi vslidedown.vx vslidedown.vi vslide1up.vx vslide1down.vx

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vd

x

x

x

x

x

x

x

x

x

x

x

cp_rd

x

cp_vs2

x

x

x

x

x

x

x

x

x

x

cp_rs1

x

x

x

x

x

cp_imm_5bit

u

u

cmp_vd_vs2

x

x

x

cp_vs2_edges

eew1

eew1

eew1

x

x

x

x

x

x

x

cp_rs1_edges

x

x

x

x

x

cr_vs2_rs1_edges

x

x

x

x

cr_vs2_imm_edges

u

u

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

x

x

x

x

nomask

nomask

x

x

x

x

x

x

cr_vtype_agnostic

x

x

x

x

nomask

nomask

x

x

x

x

x

x

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

std_vec

x

x

x

x

x

cp_custom

maskwrite_unmasked

maskwrite_unmasked

vmv_x_s

vmv_s_x

vindexVX

Instruction vrgather.vv vrgather.vx vrgather.vi vrgatherei16.vv vcompress.vm vmv1r.v vmv2r.v vmv4r.v vmv8r.v

RV32

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

cp_vd

x

x

x

x

x

x

emul2

emul4

emul8

cp_vs2

x

x

x

x

x

x

emul2

emul4

emul8

cp_vs1

x

x

x

cp_rs1

x

cp_imm_5bit

u

cmp_vd_vs2

x

emul2

emul4

emul8

cmp_vs1_vs2

x

sew16

cp_vs2_edges

x

x

x

x

x

cp_vs1_edges

x

x

x

cr_vs2_vs1_edges

x

x

x

cp_rs1_edges

x

cr_vs2_rs1_edges

x

cr_vs2_imm_edges

u

cp_masking_edges

x

x

x

x

cr_vl_lmul

x

x

x

x

nomask

nomask

nomask

nomask

nomask

cr_vtype_agnostic

x

x

x

x

nomask

nomask

nomask

nomask

nomask

cp_vl_0

x

x

x

x

x

x

x

x

x

std_vec

x

x

x

cp_custom

vindexVV

vindexVX

vindexVV

cp_custom_vindexCorners

x

x

Table 121. Vx Normative Rules
Normative Rule Rule Text Coverpoints

elen

The maximum size in bits of a vector element that any operation can produce or consume, ELEN ≥ 8, which must be a power of 2.

Implicit

vlen

The number of bits in a single vector register, VLEN ≥ 8, which must be a power of 2, and must be no greater than 216.

Implicit: a fixed implementation parameter - every other coverpoint’s vl/lmul arithmetic implicitly depends on it being correct

hw_mstatus_vs_dirty_update

Implementations may also change mstatus.⁠VS or vsstatus.⁠VS from Initial or Clean to Dirty at any time, even when there is no change in vector state.

Untestable: whether an implementation opportunistically marks mstatus.VS/vsstatus.VS Dirty is a permissive implementation choice with no single correct answer to assert

reserved_vill_set

Implementations may set VILL in either case.

Untestable: Implementation Specific, Theoretically Implicit with Correct Sail Config

vreg_count

The vector extension adds 32 architectural vector registers, v0-v31 to the base scalar RISC-V ISA.

Vf16_vfmv_f_s_cg/cp_custom_fmv_fs_vs2_all_lmul_regs

mstatus_vs_op

The VS field encodes the status of the vector extension state, including the vector registers v0&#8205;&#8211;&#8205;v31 and the CSRs vcsr, vxrm, vxsat, vstart, vl, vtype, and vlenb.

Sm_V_cg/cp_vcsrs_walking1s

mstatus_vs_sstatus_vs_op

A vector context status field, VS, is added to mstatus[10:9] and shadowed in sstatus[10:9]. It is defined analogously to the floating-point context status field, FS.

Sm_V_cg/{cp_mstatus_vs_set_dirty_arithmetic, cp_mstatus_vs_off_arithmetic}

mstatus_vs_op_initial_clean

When mstatus.⁠VS is set to Initial or Clean, executing any instruction that changes vector state, including the vector CSRs, will change mstatus.⁠VS to Dirty. Implementations may also change mstatus.⁠VS from Initial or Clean to Dirty at any time, even when there is no change in vector state.

Sm_V_cg/cp_mstatus_vs_set_dirty_arithmetic, Sm_V_cg/cp_mstatus_vs_set_dirty_csr

vsstatus_vs_mstatus_vs_op_off

When V=1, both vsstatus.⁠VS and mstatus.⁠VS are in effect: attempts to execute any vector instruction, or to access the vector CSRs, raise an illegal-instruction exception when either field is set to Off.

ExceptionsHV_cg/cp_mstatus_vs_off, ExceptionsHV_cg/cp_vsstatus_vs_off

vsstatus_vs_sz_acc

When the hypervisor extension is present, a vector context status field, VS, is added to vsstatus[10:9]. It is defined analogously to the floating-point context status field, FS.

ExceptionsHV_cg/cp_vsstatus_vs_off

mstatus_vs_op_off

Attempts to execute any vector instruction, or to access the vector CSRs, raise an illegal-instruction exception when mstatus.⁠VS is set to Off.

Sm_V_cg/cp_mstatus_vs_off_arithmetic

vsstatus_vs_mstatus_vs_op_active

When V=1 and neither vsstatus.⁠VS nor mstatus.⁠VS is set to Off, executing any instruction that changes vector state, including the vector CSRs, will change both mstatus.⁠VS and vsstatus.⁠VS to Dirty.

Sm_V_cg/cp_mstatus_vs_set_dirty_arithmetic, Sm_V_cg/cp_mstatus_vs_set_dirty_csr

vsstatus_vs_op

Similarly, when V=1, both vsstatus.VS and the HS-level sstatus.VS are in effect. Attempts to execute a vector instruction when either field is 0 (Off) raise an illegal-instruction exception. Modifying the vector state when V=1 causes both fields to be set to 3 (Dirty).

Untestable: requires the H extension configured; see mstatus_vs_op_off for the non-hypervisor form

vsstatus_sd_op_vs

If vsstatus.⁠VS is Dirty, vsstatus.⁠SD is 1; otherwise, vsstatus.⁠SD is set in accordance with existing specifications.

Untestable: vsstatus.SD is a CSR-layout consequence of VS state, not independently observable via a coverpoint

mstatus_sd_summary_op

summarizes whether either the FS, VS, or XS fields signal the presence of some dirty state that will require saving extended user context to memory.

Sm_mstatus_cg/cp_mstatus_sd_write

mstatus_sd_vs_dirty_op

If mstatus.⁠VS is Dirty, mstatus.⁠SD is 1; otherwise, mstatus.⁠SD is set in accordance with existing specifications.

Sm_mstatus_cg/cp_mstatus_sd_write

mstatus_sd_op_vs

If mstatus.⁠VS is Dirty, mstatus.⁠SD is 1; otherwise, mstatus.⁠SD is set in accordance with existing specifications.

Untestable: mstatus.SD is a CSR-layout consequence of VS state, not independently observable via a coverpoint

mutable_misa_v

Implementations may have a writable misa.⁠V field.

Sm_mcsr_cg/cp_misa_v

mstatus_vs_exists

Analogous to the way in which the floating-point unit is handled, the mstatus.⁠VS field may exist even if misa.⁠V is clear.

Untestable: field-existence-independent-of-misa.V is an implementation/config fact, not a runtime coverpoint

vsstatus_vs_exists

For implementations with a writable misa.⁠V field, the vsstatus.⁠VS field may exist even if misa.⁠V is clear.

Untestable: field-existence-independent-of-misa.V is an implementation/config fact, not a runtime coverpoint

vtype_sz_acc_op

The read-only XLEN-wide vector type CSR, vtype provides the default type used to interpret the contents of the vector register file, and can only be updated by VSETVLI, VSETIVLI, and VSETVL instructions.

Sm_V_cg/cp_sew_lmul_vset_i_vli, Sm_V_cg/cp_sew_lmul_vsetvl

vtype_fields_sz

The vtype register has five fields, VILL, VMA, VTA, VSEW, and VLMUL. Bits vtype[XLEN-2:8] should be written with zero, and non-zero values in this field are reserved.

Sm_V_cg/cp_sew_lmul_vsetvl

vtype_vsew_op

The value in VSEW sets the dynamic selected element width (SEW). By default, a vector register is viewed as being divided into VLEN/SEW elements.

Sm_V_cg/cp_sew_lmul_vset_i_vli, Vf16_vfadd_vf_cg/cr_vl_lmul_sew16

vtype_lmul_val

Implementations must support LMUL integer values of 1, 2, 4, and 8.

Vf16_vfadd_vf_cg/cr_vl_lmul_sew16, Sm_V_cg/cp_sew_lmul_vset_i_vli

vtype_lmul_fval

Implementations must provide fractional LMUL settings that allow the narrowest supported type to occupy a fraction of a vector register corresponding to the ratio of the narrowest supported type’s width to the smaller of VLEN and the largest supported type’s width. In general, the requirement is to support LMUL ≥ SEWMIN/min(ELEN, VLEN), where SEWMIN is the narrowest supported SEW value, ELEN is the widest supported SEW value and VLEN is the number of bits in a vector register. In the standard extensions, SEWMIN=8. For vector extensions with ELEN=32, fractional LMULs of 1/2 and 1/4 must be supported. For vector extensions with ELEN=64 and ELEN ≤ VLEN, fractional LMULs of 1/2, 1/4, and 1/8 must be supported. For vector extensions with SEWMIN=8, ELEN=64 and VLEN=32, fractional LMULs of 1/2 and 1/4 must be supported.

Vf16_vfadd_vf_cg/cr_vl_lmul_sew16, Sm_V_cg/cp_sew_lmul_vset_i_vli

vtype_sew_val

For a given supported fractional LMUL setting, implementations must support SEW settings between SEWMIN and LMUL * min(ELEN, VLEN), inclusive.

Sm_V_cg/cp_sew_lmul_vset_i_vli

vtype_lmul_fval_rsv

The use of vtype encodings with LMUL < SEWMIN/min(ELEN, VLEN) is reserved, but implementations can set VILL if they do not support these configurations.

Sm_V_cg/cp_vtype_vill_set_vl_0

lmul

LMUL is set by the signed VLMUL field in vtype (i.e., LMUL = 2csr::[vlmul]).

Vf16_vfadd_vf_cg/cr_vl_lmul_sew16

vlmax

The derived value VLMAX = LMUL*VLEN/SEW represents the maximum number of elements that can be operated on with a single vector instruction given the current SEW and LMUL settings as shown in the table below.

Vx16_vrgather_vv_cg/cp_custom_vindexCorners_index_ge_vlmax, Vx16_vrgather_vv_cg/cp_custom_vindexCorners_index_gt_vl_lt_vlmax

vreg_offgroup_lmul2_rsv

Instructions specifying an LMUL=2 vector register group with an odd-numbered vector register are reserved.

Out-of-Scope: reserved behavior that depends on prior CSR state is unspecified and outside Ssstrict’s encoding-only methodology

vreg_offgroup_lmul4_rsv

instructions specifying an LMUL=4 vector register group using vector register numbers that are not multiples of four are reserved.

Out-of-Scope: reserved behavior that depends on prior CSR state is unspecified and outside Ssstrict’s encoding-only methodology

vreg_offgroup_lmul8_rsv

instructions specifying an LMUL=8 vector register group using register numbers that are not multiples of eight are reserved.

Out-of-Scope: reserved behavior that depends on prior CSR state is unspecified and outside Ssstrict’s encoding-only methodology

vreg_mask_lmul_indp

Mask registers are always contained in a single vector register, regardless of LMUL.

Vls16_vlm_v_cg/cp_custom_maskLS_emul_ge_16, Vx16_vmadc_vi_cg/cp_custom_vmask_write_lmulge1

vtype_vta_vma_op

These two bits modify the behavior of destination tail elements and destination inactive masked-off elements respectively during the execution of vector instructions. The tail and inactive sets contain element positions that are not receiving new results during a vector operation, as defined in .

Vf16_vfadd_vf_cg/cr_vtype_agnostic

vtype_vta_vma_val

All systems must support all four options:

Vf16_vfadd_vf_cg/cr_vtype_agnostic

vreg_mask_tail_agn

Mask destination tail elements are always treated as tail-agnostic, regardless of the setting of VTA.

Vx8_vmor_mm_cg/cr_vtype_agnostic_nomask

vreg_mask_op

When a set is marked undisturbed, the corresponding set of destination elements in a vector register group retain the value they previously held.

Vf16_vfadd_vf_cg/cp_masking_edges

vreg_agnostic_op

When a set is marked agnostic, the corresponding set of destination elements in any vector destination operand can either retain the value they previously held, or are overwritten with 1s. Within a single vector instruction, each destination element can be either left undisturbed or overwritten with 1s, in any combination, and the pattern of undisturbed or overwritten with 1s is not required to be deterministic when the instruction is executed with the same inputs.

Vf16_vfadd_vf_cg/cp_masking_edges

vreg_mask_tail_op

In addition, except for mask load instructions, any element in the tail of a mask result can also be written with the value the mask-producing operation would have calculated with vl=VLMAX. Furthermore, for mask-logical instructions and VMSBF.M, VMSIF.M, VMSOF.M mask-manipulation instructions, any element in the tail of the result can be written with the value the mask-producing operation would have calculated with vl=VLEN, SEW=8, and LMUL=8 (i.e., all bits of the mask register can be overwritten).

Vx16_vmseq_vv_cg/cr_vtype_agnostic

vtype_vill_op

If the VILL bit is set, then any attempt to execute a vector instruction that depends upon vtype will raise an illegal-instruction exception.

ExceptionsVx_vsaddu_vv_cg/cp_vill

vl_acc

The XLEN-bit-wide read-only vl CSR can only be updated by the VSET* instructions, and the fault-only-first vector load instruction variants.

Sm_V_cg/cp_vsetvl_i_rd_nx0_rs1_x0, Vls16_vle16ff_v_cg/cp_custom_ffLS_update_vl

vl_op

The vl register holds an unsigned integer specifying the number of elements to be updated with results from a vector instruction, as further detailed in .

Vf16_vfadd_vf_cg/cr_vl_lmul_sew16, Vf16_vfadd_vf_cg/cp_vl_0

vlenb_acc_op

The XLEN-bit-wide read-only CSR vlenb holds the value VLEN/8, i.e., the vector register length in bytes.

Sm_V_cg/cp_vcsrrswc

vstart_acc_sz

The XLEN-bit-wide read-write vstart CSR specifies the index of the first element to be executed by a vector instruction, as described in .

Sm_V_cg/cp_vcsrs_walking1s, Sm_V_cg/cp_vstart_out_of_bounds

vstart_op

All vector instructions are defined to begin execution with the element number given in the vstart CSR, leaving earlier elements in the destination vector undisturbed

Vx16_vcpop_m_cg/cp_custom_gprWriting_vstart_eq_vl, ExceptionsVls_vle8_v_cg/cp_vstart

vstart_update

reset the vstart CSR to zero at the end of execution.

vstart_unmodified

vstart is not modified by vector instructions that raise illegal-instruction exceptions.

vstart_sz_writable

The vstart CSR is defined to have only enough writable bits to hold the largest element index (one less than the maximum VLMAX).

Sm_V_cg/cp_vstart_out_of_bounds

vstart_val_rsv

The use of vstart values greater than the largest element index for the current vtype setting is reserved.

ExceptionsVx_vsaddu_vv_cg/cp_vstart_gt_vl

vstart_vtype_dep

Implementations are permitted to raise illegal-instruction exceptions when attempting to execute a vector instruction with a value of vstart that the implementation can never produce when executing that same instruction with the same vtype setting.

Untestable: implementations are permitted, not required, to raise this exception, so no behavior can be asserted

vxrm_val_sz_acc

The vector fixed-point rounding-mode register holds a two-bit read-write rounding-mode field in the least-significant bits (vxrm[1:0]). The upper bits, vxrm[XLEN-1:2], should be written as zeros.

Sm_V_cg/cp_vcsrs_walking1s, Vx16_vaadd_vv_cg/cr_vxrm_vs2_vs1_edges, Vx16_vaadd_vx_cg/cr_vxrm_vs2_rs1_edges, Vx16_vssra_vi_cg/cr_vxrm_vs2_imm_edges

vcsr_vxrm_op

The vector fixed-point rounding-mode is given a separate CSR address to allow independent access, but is also reflected as a field in vcsr.

Sm_V_cg/cp_vcsrrswc

vxrm_op

The fixed-point rounding algorithm is specified as follows. Suppose the pre-rounding result is v, and d bits of that result are to be rounded off. Then the rounded result is (v >> d) + r, where r depends on the rounding mode as specified in the following table.

Vx16_vaadd_vx_cg/cr_vxrm_vs2_rs1_edges, Vx16_vssra_vi_cg/cr_vxrm_vs2_imm_edges, Vx16_vaadd_vv_cg/cr_vxrm_vs2_vs1_edges

vxsat_op_acc_sz

The vxsat CSR has a single read-write least-significant bit (vxsat[0]) that indicates if a fixed-point instruction has had to saturate an output value to fit into a destination format. The remaining bits, vxsat[XLEN-1:1], should be written as zeros.

Sm_V_cg/cp_vcsrs_walking1s, Vx16_vsaddu_vv_cg/cp_csr_vxsat

vcsr_vxsat_op

The vxsat bit is mirrored in vcsr.

Sm_V_cg/cp_vcsrrswc

vcsr_vxrm_vxsat_acc

The vxrm and vxsat separate CSRs can also be accessed via fields in the XLEN-bit-wide vector control and status CSR, vcsr.

Sm_V_cg/cp_vcsrrswc

vreg_lmul1_op

When LMUL=1, elements are simply packed in order from the least-significant to most-significant bits of the vector register.

Vx16_vadd_vv_cg/cp_vd

vreg_flmul_op

When LMUL < 1, only the first LMUL*VLEN/SEW elements in the vector register are used. The remaining space in the vector register is treated as part of the tail, and hence must obey the vta setting.

Vf16_vfadd_vf_cg/cr_vl_lmul_sew16

vreg_lmulge2_op

When vector registers are grouped, the elements of the vector register group are packed contiguously in element order beginning with the lowest-numbered vector register and moving to the next-highest-numbered vector register in the group once each vector register is filled.

Vx16_vsext_vf2_cg/cp_custom_vext2_overlapping_vd_vs2_lmul4, Vx16_vsext_vf2_cg/cp_custom_vext2_overlapping_vd_vs2_lmul8, Vx64_vsext_vf8_cg/cp_custom_vext8_overlapping_vd_vs2_lmul8, Vx16_vwaddu_vv_cg/cp_custom_vdOverlapTopVs1_vd_vs1_lmul4, Vx16_vwaddu_vv_cg/cp_custom_vdOverlapTopVs2_vd_vs2_lmul4, Vx16_vwadd_vv_cg/cp_custom_allVdOverlapTopVs2_vd_vs2_lmul2, Vf16_vfadd_vf_cg/cr_vl_lmul_sew16

vreg_mask_vtype_indp

A vector mask occupies only one vector register regardless of SEW and LMUL.

Vls16_vlm_v_cg/cp_custom_maskLS_emul_ge_16, Vx16_vmadc_vi_cg/cp_custom_vmask_write_lmulge1

vreg_mask_sz

Each element is allocated a single mask bit in a mask vector register. The mask bit for element i is located in bit i of the mask register, independent of SEW or LMUL.

Vf16_vfadd_vf_cg/cp_masking_edges

vreg_scalar_lmul_indp

Any vector register can be used to hold a scalar regardless of the current LMUL setting.

Vf16_vfmv_s_f_cg/cp_custom_fmv_sf_vd_all_lmul_regs, Vf16_vfmv_f_s_cg/cp_custom_fmv_fs_vs2_all_lmul_regs, Vx16_vmv_s_x_cg/cp_custom_voffgroup_vd_lmul2, Vx16_vredand_vs_cg/cp_custom_voffgroup_vs1_lmul2, Vx16_vmv_x_s_cg/cp_custom_voffgroup_vs2_lmul2, Vx16_vmv_s_x_cg/cp_custom_voffgroup_vd_lmul4, Vx16_vmv_s_x_cg/cp_custom_voffgroup_vd_lmul8, Vx16_vwredsum_vs_cg/cp_custom_vreductionw_vd_vs1_emul_16

eew_emul

Each vector operand has an effective element width (EEW) and an effective LMUL (EMUL) that is used to determine the size and location of all the elements within a vector register group. By default, for most operands of most instructions, EEW=SEW and EMUL=LMUL.

Vx16_vaadd_vv_cg/cp_vs2_edges, Vx16_vwadd_vv_cg/cp_custom_allVdOverlapTopVs2_vd_vs2_lmul2, Vx16_vwadd_wv_cg/cr_vl_lmul_lmul4max_sew16, Vx16_vsext_vf2_cg/cp_custom_vext2_overlapping_vd_vs2_lmul4

eew_emul_sew_lmul_dep

EEW/EMUL = SEW/LMUL.

Vx16_vwadd_wv_cg/cr_vl_lmul_lmul4max_sew16, Vx16_vsext_vf2_cg/cp_custom_vext2_overlapping_vd_vs2_lmul4

vnarrowing_eew_emul

Narrowing instructions have a source operand that has EEW=2*SEW and EMUL=2*LMUL but with a destination where EEW=SEW and EMUL=LMUL.

Vx16_vnclip_wi_cg/cp_custom_vdOverlapBtmVs2_vd_vs2_lmul2, Vx16_vnclip_wi_cg/cp_custom_allVdOverlapBtmVs2_vd_vs2_lmul2, Vx16_vnclip_wi_cg/cr_vl_lmul_lmul4max_sew16

emul_offgroup_rsv

Using other than the lowest-numbered vector register to specify a vector register group is a reserved encoding.

Out-of-Scope: this behavior is unspecified even under Ssstrict, which does not cover CSR-state-dependent reserved conditions

vreg_source_eew_rsv

A vector register cannot be used to provide source operands with more than one EEW for a single instruction. A mask register source is considered to have EEW=1 for this constraint. An encoding that would result in the same vector register being read with two or more different EEWs, including when the vector register appears at different positions within two or more vector register groups, is reserved.

SsstrictV_vwadd_wv_cg/cp_ssstrictv_widening_source_overlap

vreg_overlap_legal

A destination vector register group can overlap a source vector register group only if one of the following holds:

Vx16_vsext_vf2_cg/cp_custom_vext2_overlapping_vd_vs2_lmul4, Vx32_vsext_vf4_cg/cp_custom_vext4_overlapping_vd_vs2_lmul4, Vx64_vsext_vf8_cg/cp_custom_vext8_overlapping_vd_vs2_lmul8, Vx16_vwaddu_vv_cg/cp_custom_vdOverlapTopVs1_vd_vs1_lmul2, Vx16_vwaddu_vv_cg/cp_custom_vdOverlapTopVs2_vd_vs2_lmul2, Vx16_vwadd_vv_cg/cp_custom_allVdOverlapTopVs1_vd_vs1_lmul2, Vx16_vwadd_vv_cg/cp_custom_allVdOverlapTopVs2_vd_vs2_lmul2, Vx16_vnclip_wi_cg/cp_custom_vdOverlapBtmVs2_vd_vs2_lmul2, Vf16_vfadd_vf_cg/cmp_vd_vs2, Vf16_vfadd_vv_cg/cmp_vd_vs1, Vf16_vfadd_vv_cg/cmp_vs1_vs2, Vf16_vfadd_vv_cg/cmp_vd_vs1_vs2, Vls16_vsoxei16_v_cg/cmp_vs3_vs2_eew_eq_sew

vreg_mask_overlap

For the purpose of determining register group overlap constraints, mask elements have EEW=1.

SsstrictV_vwadd_wv_cg/cp_ssstrictv_masking_vd_eq_v0

vreg_overlap_rsv

Any instruction encoding that violates the overlap constraints is reserved.

SsstrictV_vwadd_wv_cg/cp_ssstrictv_widening_source_overlap

vreg_overlap_agn

When source and destination registers overlap and have different EEW, the instruction is mask- and tail-agnostic, regardless of the setting of the VTA and VMA bits in vtype.

Vx16_vnclip_wi_cg/cp_masking_edges

emul_rsv

The largest vector register group used by an instruction can not be greater than 8 vector registers (i.e., EMUL≤8), and if a vector instruction would require greater than 8 vector registers in a group, the instruction encoding is reserved. For example, a widening operation that produces a widened vector register group result when LMUL=8 is reserved as this would imply a result EMUL=16.

Out-of-Scope: reserved behavior that is not covered by Ssstrict

vreg_scalar_emul

Widened scalar values, e.g., input and output to a widening reduction operation, are held in the first element of a vector register and have EMUL=1. If an implementation supports EEW > VLEN, EEW-wide widened scalar values are held in a vector register group with EMUL = EEW/VLEN.

Vx16_vwredsum_vs_cg/cp_custom_vreductionw_vd_vs1_emul_16

vmask_inactive_op

Element operations that are masked off (inactive) never generate exceptions.

Vf16_vfrsqrt7_v_cg/cp_custom_vfp_flags_inactive_not_set, Vf16_vfadd_vf_cg/cp_masking_edges

vmask_agn_op

The destination vector register elements corresponding to masked-off elements are handled with either a mask-undisturbed or mask-agnostic policy depending on the setting of the VMA bit in vtype

Vf16_vfrsqrt7_v_cg/cp_custom_vfp_flags_inactive_not_set, Vf16_vfadd_vf_cg/cp_masking_edges

vmask_vm_enc

Where available, masking is encoded in a single-bit vm field in the instruction (inst[25]).

Implicit: the vm field encoding is exercised by every masked and unmasked vector instruction the suite runs

vreg_vmask

The mask value used to control execution of a masked vector instruction is always supplied by vector register v0.

Vls16_vloxei16_v_cg/cp_masking_edges, Vf16_vfadd_vf_cg/cp_masking_edges

vreg_vmask_rsv

The destination vector register group for a masked vector instruction cannot overlap the source mask register (v0), unless the destination vector register is being written with a mask value (e.g., compares) or the scalar result of a reduction. These instruction encodings are reserved.

SsstrictV_vadd_vv_cg/cp_ssstrictv_masking_vd_eq_v0

vstart_vl_dep

When vstart ≥ vl, there are no body elements, and no elements are updated in any destination vector register group, including that no tail elements are updated with agnostic values.

ExceptionsVx_vsaddu_vv_cg/cp_vstart_gt_vl

vstart_vl_scalar_indp

Instructions that write an x register or f register do so even when vstart ≥ vl, including when vl=0.

Vx16_vcpop_m_cg/cp_custom_gprWriting_vstart_eq_vl

vector_prestart_element

The prestart elements do not raise exceptions and do not update the destination vector register.

ExceptionsVls_vle8_v_cg/cp_vstart

vector_inactive_element

The inactive elements do not raise exceptions and do not update any destination vector register group unless masked agnostic is specified (vtype.⁠VMA=1), in which case inactive elements may be overwritten with 1s.

Vf16_vfadd_vf_cg/cr_vtype_agnostic, Vf16_vfrsqrt7_v_cg/cp_custom_vfp_flags_inactive_not_set, Vx16_vadd_vv_cg/cp_masking_edges

vector_tail_element

The tail elements do not raise exceptions, and do not update any destination vector register group unless tail agnostic is specified (vtype.⁠VTA=1), in which case tail elements may be overwritten with 1s, or with the result of the instruction in the case of mask-producing instructions except for mask loads. When LMUL < 1, the tail includes the elements past VLMAX that are held in the same vector register.

Vf16_vfadd_vf_cg/cp_vl_0, Vf16_vfadd_vf_cg/cp_masking_edges

vset_op

The VSETVLI, VSETIVLI, and VSETVL instructions set the vtype and vl CSRs based on their arguments, and write the new value of vl into rd.

Sm_V_cg/cp_sew_lmul_vsetvl, Sm_V_cg/cp_sew_lmul_vset_i_vli, Sm_V_cg/cp_vsetvl_i_avl_eq_vlmax, Sm_V_cg/cp_vsetivli_avl_edges

vtype_vstart_op

the vl register is also set to zero.

Sm_V_cg/cp_sew_lmul_vset_i_vli, Sm_V_cg/cp_sew_lmul_vsetvl, Sm_V_cg/cp_vtype_vill_set_vl_0

vtype_acc

The new vtype value is encoded in the immediate fields of VSETVLI and VSETIVLI, and in the rs2 register for VSETVL.

Sm_V_cg/cp_sew_lmul_vset_i_vli, Sm_V_cg/cp_sew_lmul_vsetvl

vtype_vill_val

If the vtype value is not supported by the implementation, then the VILL bit is set in vtype, the remaining bits in vtype are set to zero

Vls16_vl1re16_v_cg/cp_custom_vwholeRegLS_vill, Sm_V_cg/cp_vill_vsetvl

vtype_vill_val_vill

A vtype value with VILL set is treated as an unsupported configuration.

Vls16_vl1re16_v_cg/cp_custom_vwholeRegLS_vill, Sm_V_cg/cp_vill_vsetvl

vtype_vill_all_bits

Implementations must consider all bits of the vtype value to determine if the configuration is supported. An unsupported value in any location within the vtype value must result in VILL being set.

Vls16_vl1re16_v_cg/cp_custom_vwholeRegLS_vill, Sm_V_cg/cp_vill_vsetvl

vsetvl_op

When rs1 is not x0, the AVL is an unsigned integer held in the x register specified by rs1, and the new vl value is also written to the x register specified by rd.

Sm_V_cg/cp_vsetvl_i_rd_x0_rs1_x0, Sm_V_cg/cp_vsetvl_i_rd_nx0_rs1_x0, Sm_V_cg/cp_vsetvl_i_avl_eq_zero, Sm_V_cg/cp_vsetvl_i_avl_eq_vlmax, Sm_V_cg/cp_vsetvl_i_avl_lt_2x_vlmax, Sm_V_cg/cp_vsetvl_i_avl_eq_2x_vlmax, Sm_V_cg/cp_vsetvl_i_avl_gt_2x_vlmax

vsetvl_op_rs1_x0_rd_nx0

When rs1=x0 but rd≠x0, the maximum unsigned integer value (~0) is used as the AVL, and the resulting VLMAX is written to vl and also to the x register specified by rd.

Sm_V_cg/cp_vsetvl_i_rd_nx0_rs1_x0

vsetvl_op_rs1_x0_rd_x0

When rs1=x0 and rd=x0, the instructions operate as if the current vector length in vl is used as the AVL, and the resulting value is written to vl, but not to a destination register. This form can only be used when VLMAX and hence vl is not actually changed by the new SEW/LMUL ratio.

Sm_V_cg/cp_vsetvl_i_rd_x0_rs1_x0

vtype_vset_rsv

Use of the instructions with a new SEW/LMUL ratio that would result in a change of VLMAX is reserved. Use of the instructions is also reserved if VILL was 1 beforehand.

Out-of-Scope: we cannot test reserved behavior that depends on prior vill state; outside Ssstrict’s encoding-only methodology

vsetivli_op

For the VSETIVLI instruction, the AVL is encoded as a 5-bit zero-extended immediate (0—​31) in the rs1 field.

Sm_V_cg/cp_vsetivli_avl_edges

vl_val_lead_in

The VSET* instructions first set VLMAX according to their vtype argument, then set vl obeying the following constraints:

Sm_V_cg/cp_vsetvl_i_avl_eq_vlmax, Sm_V_cg/cp_vsetvl_i_avl_lt_2x_vlmax, Sm_V_cg/cp_vsetvl_i_avl_gt_2x_vlmax, Sm_V_cg/cp_vsetvl_i_avl_eq_zero

vl_val_list

vl = AVL if AVL ≤ VLMAX ceil(AVL / 2) ≤ vl ≤ VLMAX if AVL < (2 * VLMAX) vl = VLMAX if AVL ≥ (2 * VLMAX) Deterministic on any given implementation for same input AVL and VLMAX values These specific properties follow from the prior rules: vl = 0 if AVL = 0 vl > 0 if AVL > 0 vl ≤ VLMAX vl ≤ AVL a value read from vl when used as the AVL argument to VSET* results in the same value in vl, provided the resultant VLMAX equals the value of VLMAX at the time that vl was read

Sm_V_cg/cp_vsetvl_i_avl_eq_vlmax, Sm_V_cg/cp_vsetvl_i_avl_lt_2x_vlmax, Sm_V_cg/cp_vsetvl_i_avl_gt_2x_vlmax, Sm_V_cg/cp_vsetvl_i_avl_eq_zero

vector_ls_vstart

All vector loads and stores may generate and accept a non-zero vstart value.

ExceptionsVls_vle8_v_cg/cp_vstart

vector_ls_base_stride_regtype

Vector load/store base registers and strides are taken from the x registers.

Vls16_vlse16_v_cg/cp_rs1_nx0, Vls16_vlse16_v_cg/cp_rs2

vector_ls_base

The base effective address for all vector accesses is given by the contents of the x register named in rs1.

Vls16_vle8_v_cg/cp_rs1_nx0, Vls16_vse8_v_cg/cp_rs1_nx0

vector_ls_unit_stride_op

Vector unit-stride operations access elements stored contiguously in memory starting from the base effective address.

Vls16_vle8_v_cg/cp_vd

vector_ls_constant_stride_op

Vector constant-stride operations access the first memory element at the base effective address, and then access subsequent elements at address increments given by the byte offset contained in the x register specified by rs2.

Vls16_vlse8_v_cg/cp_rs2

vector_ls_strided_eew

Vector memory unit-stride and constant-stride operations directly encode EEW of the data to be transferred statically in the instruction to reduce the number of vtype changes when accessing memory in a mixed-width routine.

{Vls16_vlse16_v_cg,Vls32_vlse32_v_cg,Vls64_vlse64_v_cg}/cp_asm_count

vector_ls_seg_unit_stride_vd_vs3

For loads, the vd register will hold the first field loaded from the segment. For stores, the vs3 register is read to provide the first field to be stored to each segment.

Vls16_vlseg2e8_v_cg/cp_vd_lte30, Vls16_vsseg2e8_v_cg/cp_vs3_lte30

vector_ls_scalar_misaligned_independence

Support for misaligned vector memory accesses is independent of an implementation’s support for misaligned scalar memory accesses.

Untestable: independence from the scalar misaligned-access implementation cannot be observed from a self-checking test

vector_ls_scalar_misaligned_dependence

Vector misaligned memory accesses follow the same rules for atomicity as scalar misaligned memory accesses.

Not Tested: atomicity of misaligned vector accesses is not exercised by this suite

vector_ls_seg_indexed_unordered

However, even for the ordered form, accesses to the fields within an individual segment are not ordered with respect to each other.

Untestable: memory-ordering guarantees are not observable from a single-hart self-checking signature

vector_ff_op

If element 0 raises an exception, vl is not modified, and the trap is taken. If an element > 0 raises an exception, the corresponding trap is not taken, and the vector length vl is reduced to the index of the element that would have raised an exception.

Vls16_vle8ff_v_cg/cp_custom_ffLS_update_vl

vector_ls_indexed_op

Vector indexed operations add the contents of each element of the vector offset operand specified by vs2 to the base effective address to give the effective address of each element. The data vector register group has EEW=SEW, EMUL=LMUL, while the offset vector register group has EEW encoded in the instruction and EMUL=(EEW/SEW)*LMUL.

Vls16_vloxei16_v_cg/cp_vs2, Vls16_vloxei16_v_cg/cp_vs2_edges_ls

vector_ls_indexed_eew

Indexed operations use the explicit EEW encoding in the instruction to set the size of the indices used, and use SEW/LMUL to specify the data width.

{Vls8_vloxei16_v_cg,Vls16_vloxei16_v_cg,Vls32_vloxei16_v_cg,Vls64_vloxei16_v_cg}/cp_asm_count

vector_ls_ins_req

Implementations must provide vector loads and stores with EEWs corresponding to all supported SEW settings.

{Vls8_vle8_v_cg,Vls16_vle16_v_cg,Vls32_vle32_v_cg,Vls64_vle64_v_cg}/cp_asm_count

vector_ls_ins_rsv

Vector load/store encodings for unsupported EEW widths are reserved.

SsstrictV_vle8_v_cg/cp_ssstrictv_ls_eew_lt_sewmin

vector_ls_bytewise

The vector offset operand is treated as a vector of byte-address offsets.

Vls16_vloxei16_v_cg/cp_vs2_edges_ls

vector_ls_xlen_dep

If the vector offset elements are narrower than XLEN, they are zero-extended to XLEN before adding to the base effective address. If the vector offset elements are wider than XLEN, the least-significant XLEN bits are used in the address calculation.

Vls16_vloxei64_v_cg/cp_custom_ls_indexed_truncated

vector_ls_eew_rsv

If the implementation does not support the EEW of the offset elements, the instruction is reserved.

ExceptionsVls_vloxei16_v_cg/cp_exceptionsv_index_eew16

vector_ls_stride_ordered_op

Vector unit-stride and constant-stride memory accesses do not guarantee ordering between individual element accesses. The vector indexed load and store memory operations have two forms, ordered and unordered. The indexed-ordered variants preserve element ordering on memory accesses.

Vls16_vloxei16_v_cg/index_register_data_overlap

vector_ls_stride_unordered_op

For unordered instructions (mop[1:0]!=11) there is no guarantee on element access order. If the accesses are to a strongly ordered IO region, the element accesses can be initiated in any order.

Untestable: memory-ordering guarantees are not observable from a single-hart self-checking signature

vector_ls_stride_unordered_precise

For implementations with precise vector traps, exceptions on indexed-unordered stores must also be precise.

ExceptionsVls_vsoxei16_v_cg/cp_exceptionsv_address_fault

vector_ls_nf_op

The nf[2:0] field encodes the number of fields in each segment. For regular vector loads and stores, nf=0, indicating that a single value is moved between a vector register group and memory at each element position. Larger values in the nf field are used to access multiple contiguous fields within a segment as described below in .

Vls16_vlseg2e8_v_cg/cp_asm_count

vector_wholels_nf_op

The nf[2:0] field also encodes the number of whole vector registers to transfer for the whole vector register load/store instructions.

{Vls16_vl1re8_v_cg,Vls16_vl2re8_v_cg,Vls16_vl4re8_v_cg,Vls16_vl8re8_v_cg}/cp_asm_count

vector_ls_eew_emul

Vector loads and stores have an EEW encoded directly in the instruction. The corresponding EMUL is calculated as EMUL = (EEW/SEW)*LMUL.

{Vls8_vle8_v_cg,Vls16_vle8_v_cg,Vls32_vle8_v_cg,Vls64_vle8_v_cg}/cp_asm_count, Vls16_vl2re8_v_cg/cp_vd_emul2

vector_ls_emul_rsv

If the EMUL would be out of range (EMUL>8 or EMUL<1/8), the instruction encoding is reserved.

ExceptionsVls_vloxei16_v_cg/cp_exceptionsv_index_eew16

vector_ls_emul_offgroup_rsv

The vector register groups must have legal register specifiers for the selected EMUL, otherwise the instruction encoding is reserved.

SsstrictV_vl8re8_v_cg/cp_ssstrictv_ls_wr_nreg8_vd_unaligned

vector_ls_indexed_eew_emul

Vector unit-stride and constant-stride use the EEW/EMUL encoded in the instruction for the data values, while vector indexed loads and stores use the EEW/EMUL encoded in the instruction for the index values and the SEW/LMUL encoded in vtype for the data values.

Vls16_vloxei16_v_cg/cp_vd, Vls16_vloxei16_v_cg/cp_vs2_edges_ls

vector_ls_mew_rsv

The mew bit (inst[28]) when set is expected to be used to encode expanded memory sizes of 128 bits and above, but these encodings are currently reserved.

SsstrictV_vle8_v_cg/cp_ssstrictv_ls_mew_reserved

vector_ls_unit_stride_mask

Additional unit-stride mask load and store instructions are provided to transfer mask values to/from memory. These operate similarly to unmasked byte loads or stores (EEW=8), except that the effective vector length is evl = ceil(vl/8) (i.e. EMUL=1), and the destination register is always written with a tail-agnostic policy.

Vls16_vlm_v_cg/cp_custom_maskLS_emul_ge_16

vector_ls_neg_zero_stride

Negative and zero strides are supported.

Vls16_vlse8_v_cg/cp_rs2_edges_ls_e8

vector_ls_constant_stride_unordered

Element accesses within a constant-stride instruction are unordered with respect to each other.

Untestable: memory-ordering guarantees are not observable from a single-hart self-checking signature

vector_ls_constant_stride_x0

When rs2=x0, then an implementation is allowed, but not required, to perform fewer memory operations than the number of active elements, and may perform different numbers of memory operations across different dynamic executions of the same static instruction.

Vls16_vlse8_v_cg/cp_rs2_edges_ls_e8

vector_ff_trigger

The unit-stride fault-only-first load instructions are used to vectorize loops with data-dependent exit conditions (while loops). These instructions execute as a regular load except that they will only take a trap caused by a synchronous exception on element 0.

Vls16_vle8ff_v_cg/cp_custom_ffLS_fault_addr

vector_ls_overwrite_past_trap

Load instructions may overwrite active destination vector register group elements past the element index at which the trap is reported.

ExceptionsVls_vle8_v_cg/cp_exceptionsv_address_fault

vector_ff_past_trap

Similarly, fault-only-first load instructions may update active destination elements past the element that causes trimming of the vector length (but not past the original vector length). The values of these spurious updates do not have to correspond to the values in memory at the addressed memory locations. Non-idempotent memory locations can only be accessed when it is known the corresponding element load operation will not be restarted due to a trap or vector-length trimming.

Untestable: implementation-defined spurious past-trap updates are not observable from a self-checking signature

vector_ff_no_exception

Even when an exception is not raised, implementations are permitted to process fewer than vl elements and reduce vl accordingly, but if vstart=0 and vl>0, then at least one element must be processed.

Vls16_vle8ff_v_cg/cp_custom_ffLS_update_vl

vector_ff_interrupt_behavior

When the fault-only-first instruction takes a trap due to an interrupt, implementations should not reduce vl and should instead set a vstart value.

nfields

The three-bit nf field in the vector instruction encoding is an unsigned integer that contains one less than the number of fields per segment, NFIELDS.

{Vls16_vlseg2e8_v_cg,Vls16_vlseg4e8_v_cg,Vls16_vlseg8e8_v_cg}/cp_asm_count

nfields_op

Each field will be held in successively numbered vector register groups. When EMUL>1, each field will occupy a vector register group held in multiple successively numbered vector registers, and the vector register group for each field must follow the usual vector register alignment constraints (e.g., when EMUL=2 and NFIELDS=4, each field’s vector register group must start at an even vector register, but does not have to start at a multiple of 8 vector register number).

{Vls16_vlseg2e8_v_cg,Vls16_vlseg4e8_v_cg,Vls16_vlseg8e8_v_cg}/cp_asm_count

emul_nfields_rsv

The EMUL setting must be such that EMUL * NFIELDS ≤ 8, otherwise the instruction encoding is reserved.

SsstrictV_vlseg2e8_v_cg/cp_ssstrictv_ls_seg_vd_overflow

vector_ls_seg_rsv

If the vector register numbers accessed by the segment load or store would increment past 31, then the instruction encoding is reserved.

SsstrictV_vlseg2e8_v_cg/cp_ssstrictv_ls_seg_vd_overflow

vector_ls_seg_op

The vl register gives the number of segments to move, which is equal to the number of elements transferred to each vector register group. Masking is also applied at the level of whole segments.

Vls16_vlseg2e8_v_cg/cr_vl_lmul_e8_emul4max_sew16

vector_ls_seg_unordered

For segment loads and stores, the individual memory accesses used to access fields within each segment are unordered with respect to each other even for ordered indexed segment loads and stores.

Untestable: memory-ordering guarantees are not observable from a single-hart self-checking signature

vector_ls_seg_vstart_dep

The vstart value is in units of whole segments.

ExceptionsVls_vlseg2e8_v_cg/cp_vstart

vector_ls_seg_partial_access

If a trap occurs during access to a segment, it is implementation-defined whether a subset of the faulting segment’s accesses are performed before the trap is taken.

Untestable: implementation-defined partial-segment-access behavior is not observable from a self-checking signature

vector_ls_seg_unit_stride_op

The vector unit-stride load and store segment instructions move packed contiguous segments into multiple destination vector register groups.

Vls16_vlseg2e8_v_cg/cp_vd_lte30

vector_ls_seg_ff_unit_stride_op

For fault-only-first segment loads, if an exception is detected partway through accessing the zeroth segment, the trap is taken. If an exception is detected partway through accessing a subsequent segment, vl is reduced to the index of that segment.

ExceptionsVls_vlseg2e8ff_v_cg/cp_exceptionsv_ffLS_first_elm_trap

vector_ff_seg_partial_access

In both cases, it is implementation-defined whether a subset of the segment is loaded.

Untestable: implementation-defined partial-segment-access behavior is not observable from a self-checking signature

vector_ls_seg_ff_overload

These instructions may overwrite destination vector register group elements past the point at which a trap is reported or past the point at which vector length is trimmed.

Untestable: implementation-defined spurious past-trap updates are not observable from a self-checking signature

vector_ls_seg_constant_stride_op

Vector constant-stride segment loads and stores move contiguous segments where each segment is separated by the byte-stride offset given in the rs2 argument.

Vls16_vlsseg2e8_v_cg/cp_rs2

vector_ls_seg_constant_stride_unordered

Accesses to the fields within each segment can occur in any order, including the case where the byte stride is such that segments overlap in memory.

Untestable: memory-ordering guarantees are not observable from a single-hart self-checking signature

vector_ls_seg_indexed_op

Vector indexed segment loads and stores move contiguous segments where each segment is located at an address given by adding the scalar base address in the rs1 field to byte offsets in vector register vs2.

Vls16_vloxseg2ei8_v_cg/cp_vs2

vector_ls_seg_indexed_eew_emul_op

The data vector register group has EEW=SEW, EMUL=LMUL, while the index vector register group has EEW encoded in the instruction with EMUL=(EEW/SEW)*LMUL.

Vls16_vloxseg2ei8_v_cg/cr_vl_lmul_e8_emul4max_sew16

vector_ls_seg_indexed_emul_nfields_val

The EMUL * NFIELDS ≤ 8 constraint applies to the data vector register group.

SsstrictV_vlseg2e8_v_cg/cp_ssstrictv_ls_seg_vd_overflow

vector_ls_seg_indexed_vreg_rsv

For vector indexed segment loads, the destination vector register groups cannot overlap the source vector register group (specified by vs2), else the instruction encoding is reserved.

SsstrictV_vloxseg2ei8_v_cg/cp_ssstrictv_ls_seg_idx_vd_vs2_overlap

vector_ls_seg_wholereg_eew

The load instructions have the element width encoded in the mew and width fields following the pattern of regular unit-stride loads. EEW is computed as EEW=min(VLEN*NFIELDS, EEW_encoded).

Vls16_vl1re16_v_cg/cp_custom_vwholeRegLS_lmul, Vls16_vl1re8_v_cg/cp_asm_count, Vls16_vl1re16_v_cg/cp_asm_count, Vls16_vl1re32_v_cg/cp_asm_count, Vls16_vl1re64_v_cg/cp_asm_count, Vls16_vl2re8_v_cg/cp_asm_count, Vls16_vl2re16_v_cg/cp_asm_count, Vls16_vl2re32_v_cg/cp_asm_count, Vls16_vl2re64_v_cg/cp_asm_count, Vls16_vl4re8_v_cg/cp_asm_count, Vls16_vl4re16_v_cg/cp_asm_count, Vls16_vl4re32_v_cg/cp_asm_count, Vls16_vl4re64_v_cg/cp_asm_count, Vls16_vl8re8_v_cg/cp_asm_count, Vls16_vl8re16_v_cg/cp_asm_count, Vls16_vl8re32_v_cg/cp_asm_count, Vls16_vl8re64_v_cg/cp_asm_count

vector_ls_seg_wholereg_op

NFIELDS indicates the number of vector registers to transfer, numbered successively after the base.

{Vls16_vl1re8_v_cg,Vls16_vl2re8_v_cg,Vls16_vl4re8_v_cg,Vls16_vl8re8_v_cg}/cp_asm_count

vector_ls_seg_wholereg_nf_rsv

Only NFIELDS values of 1, 2, 4, 8 are supported, with other values reserved.

SsstrictV_vl1re8_v_cg/cp_ssstrictv_ls_wr_nf_not_pow2, SsstrictV_vs1r_v_cg/cp_ssstrictv_ls_wr_nf_not_pow2

vector_ls_seg_wholereg_op_cont

When multiple registers are transferred, the lowest-numbered vector register is held in the lowest-numbered memory addresses and successive vector register numbers are placed contiguously in memory.

Vls16_vl2re8_v_cg/cp_custom_vwholeRegLS_lmul

vector_ls_seg_wholereg_evl

The instructions operate with an effective vector length, evl=NFIELDS*VLEN/EEW, regardless of current settings in vtype and vl. The usual property that no elements are written if vstart ≥ vl does not apply to these instructions. Similarly, the property that the instructions are reserved if vstart exceeds the largest element index for the current vtype setting does not apply. Instead, the instructions are reserved if vstart ≥ evl.

Vls16_vl2re8_v_cg/cr_vl_lmul_lmul4max_sew16

vector_ls_wholereg_misaligned_exception

Implementations are allowed to raise a misaligned address exception on whole register loads and stores if the base address is not naturally aligned to the larger of the size of the encoded EEW in bytes (EEW/8) or the implementation’s smallest supported SEW size in bytes (SEWMIN/8).

MisalignV_vl1re16_v_cg/cp_misalignv_ls_wholereg_misaligned, MisalignV_vl1re32_v_cg/cp_misalignv_ls_wholereg_misaligned, MisalignV_vl1re64_v_cg/cp_misalignv_ls_wholereg_misaligned, MisalignV_vl1re8_v_cg/cp_misalignv_ls_wholereg_misaligned, MisalignV_vl2re16_v_cg/cp_misalignv_ls_wholereg_misaligned, MisalignV_vl2re32_v_cg/cp_misalignv_ls_wholereg_misaligned, MisalignV_vl2re64_v_cg/cp_misalignv_ls_wholereg_misaligned, MisalignV_vl2re8_v_cg/cp_misalignv_ls_wholereg_misaligned, MisalignV_vl4re16_v_cg/cp_misalignv_ls_wholereg_misaligned, MisalignV_vl4re32_v_cg/cp_misalignv_ls_wholereg_misaligned, MisalignV_vl4re64_v_cg/cp_misalignv_ls_wholereg_misaligned, MisalignV_vl4re8_v_cg/cp_misalignv_ls_wholereg_misaligned, MisalignV_vl8re16_v_cg/cp_misalignv_ls_wholereg_misaligned, MisalignV_vl8re32_v_cg/cp_misalignv_ls_wholereg_misaligned, MisalignV_vl8re64_v_cg/cp_misalignv_ls_wholereg_misaligned, MisalignV_vl8re8_v_cg/cp_misalignv_ls_wholereg_misaligned, MisalignV_vs1r_v_cg/cp_misalignv_ls_wholereg_misaligned, MisalignV_vs2r_v_cg/cp_misalignv_ls_wholereg_misaligned, MisalignV_vs4r_v_cg/cp_misalignv_ls_wholereg_misaligned, MisalignV_vs8r_v_cg/cp_misalignv_ls_wholereg_misaligned

vector_ls_misaligned_exception

If an element accessed by a vector memory instruction is not naturally aligned to the size of the element, either the element is transferred successfully or an address-misaligned exception is raised on that element.

MisalignV_vle16_v_cg/cp_misalignv_ls_element_misaligned, MisalignV_vle32_v_cg/cp_misalignv_ls_element_misaligned, MisalignV_vle64_v_cg/cp_misalignv_ls_element_misaligned, MisalignV_vle8_v_cg/cp_misalignv_ls_element_misaligned, MisalignV_vse16_v_cg/cp_misalignv_ls_element_misaligned, MisalignV_vse32_v_cg/cp_misalignv_ls_element_misaligned, MisalignV_vse64_v_cg/cp_misalignv_ls_element_misaligned, MisalignV_vse8_v_cg/cp_misalignv_ls_element_misaligned, MisalignV_vlm_v_cg/cp_misalignv_ls_element_misaligned, MisalignV_vlse16_v_cg/cp_misalignv_ls_element_misaligned, MisalignV_vlse32_v_cg/cp_misalignv_ls_element_misaligned, MisalignV_vlse64_v_cg/cp_misalignv_ls_element_misaligned, MisalignV_vlse8_v_cg/cp_misalignv_ls_element_misaligned, MisalignV_vsm_v_cg/cp_misalignv_ls_element_misaligned, MisalignV_vsse16_v_cg/cp_misalignv_ls_element_misaligned, MisalignV_vsse32_v_cg/cp_misalignv_ls_element_misaligned, MisalignV_vsse64_v_cg/cp_misalignv_ls_element_misaligned, MisalignV_vsse8_v_cg/cp_misalignv_ls_element_misaligned, MisalignV_vle16ff_v_cg/cp_misalignv_ls_element_misaligned, MisalignV_vle32ff_v_cg/cp_misalignv_ls_element_misaligned, MisalignV_vle64ff_v_cg/cp_misalignv_ls_element_misaligned, MisalignV_vle8ff_v_cg/cp_misalignv_ls_element_misaligned

vector_ls_program_order

Vector memory instructions appear to execute in program order on the local hart.

Not Tested: RVWMO program-order guarantees would require a concurrent/multi-hart checking methodology this repo doesn’t have yet

vector_ls_rvwmo

Vector memory instructions follow RVWMO at the instruction level.

Not Tested: RVWMO memory-ordering guarantees would require a concurrent/multi-hart checking methodology this repo doesn’t have yet

vector_ls_indexed_ordered_ordered

Except for vector indexed-ordered loads and stores, element operations are unordered within the instruction.

Untestable: memory-ordering guarantees are not observable from a single-hart self-checking signature

vector_ls_indexed_ordered_rvwmo

Vector indexed-ordered loads and stores read and write elements from/to memory in element order respectively, obeying RVWMO at the element level.

Not Tested: RVWMO memory-ordering guarantees would require a concurrent/multi-hart checking methodology this repo doesn’t have yet

vl_control_dependency

Instructions affected by the vector length register vl have a control dependency on vl, rather than a data dependency.

Not Tested: control-dependency timing is not exercised by any suite yet

vmask_control_dependency

Similarly, masked vector instructions have a control dependency on the source mask register, rather than a data dependency.

Not Tested: control-dependency timing is not exercised by any suite yet

V_fp_frm

All vector floating-point operations use the dynamic rounding mode in the frm register.

Vf16_vfadd_vv_cg/cp_csr_frm_v

V_inv_frm_rsv

Use of the frm field when it contains an invalid rounding mode by any vector floating-point instruction—​even those that do not depend on the rounding mode—​is reserved, irrespective of the values of vstart and vl.

Out-of-Scope: Ssstrict does not apply to CSR values

vop-vv_vreg_vs2_vs1

Vector-vector operations take two vectors of operands from vector register groups specified by vs2 and vs1 respectively.

Vx16_vadd_vv_cg/cr_vs2_vs1_edges

vop-vx_vop-vi_vreg_vs2

the vector register group operand is specified by vs2.

{Vx16_vadd_vx_cg,Vx16_vadd_vi_cg}/cp_vs2

vop-vi_imm_5bit

For integer operations, the scalar can be a 5-bit immediate, imm[4:0], encoded in the rs1 field. The value is sign-extended to SEW bits, unless otherwise specified.

Vx16_vadd_vi_cg/cp_imm_edges_5bit

vop-vx_xreg_rs1

For integer operations, the scalar can be taken from the scalar x register specified by rs1.

Vx16_vadd_vx_cg/cp_rs1

vop-vx_rs1_trunc_lsb_sewbits

If XLEN>SEW, the least-significant SEW bits of the x register are used, unless otherwise specified.

Vx16_vadd_vx_cg/cp_rs1_edges

vop-vx_rs1_sext_sewbits

If XLEN<SEW, the value from the x register is sign-extended to SEW bits.

Vx64_vadd_vx_cg/cp_rs1_edges

vfop_freg

For floating-point operations, the scalar can be taken from a scalar f register.

Vf16_vfadd_vf_cg/cp_fs1

vfop_freg_nanbox_lsb_sewbits

If FLEN > SEW, the value in the f registers is checked for a valid NaN-boxed value, in which case the least-significant SEW bits of the f register are used, else the canonical NaN value is used.

V_fp_eew_rsv

Vector instructions where any floating-point vector operand’s EEW is not a supported floating-point type width (which includes when FLEN < SEW) are reserved.

ExceptionsVf16_vfadd_vv_cg/cp_vill

V_masked

Vector arithmetic instructions are masked under control of the vm field.

Vx16_vadd_vv_cg/cp_masking_edges

vwop_vd_eew_emul

A few vector arithmetic instructions are defined to be widening operations where the destination vector register group has EEW=2*SEW and EMUL=2*LMUL.

Vx16_vwaddu_vv_cg/cp_vd_emul2

vnop_vd_vs2_eew_emul

A few instructions are provided to convert double-width source vectors into single-width destination vectors. These instructions convert a vector register group specified by vs2 with EEW/EMUL=2*SEW/2*LMUL to a vector register group with the current SEW/LMUL setting.

Vx16_vnsrl_wv_cg/cp_vs2_emul2

vnop_vs1_eew_emul

Where there is a second source vector register group (specified by vs1), this has the same (narrower) width as the result (i.e., EEW=SEW).

Vx16_vnsrl_wv_cg/cp_vs1_edges

vadd_vsub_op

Vector integer add and subtract are provided.

Vx16_vadd_vv_cg/cp_vd, Vx16_vsub_vv_cg/cp_vd

vrsub_op

Reverse-subtract instructions are also provided for the vector-scalar forms.

Vx16_vrsub_vx_cg/cp_vd

vwaddu_vwadd_vwsubu_vwsub_op

The widening add/subtract instructions are provided in both signed and unsigned variants, depending on whether the narrower source operands are first sign- or zero-extended before forming the double-width sum.

Vx16_vwaddu_vv_cg/cp_vd_emul2

vsext_vzext_op

The vector integer extension instructions zero- or sign-extend a source vector integer operand with EEW less than SEW to fill SEW-sized elements in the destination.

Vx16_vsext_vf2_cg/cp_vd

vsext_vzext_vs_eew_emul

The EEW of the source is 1/2, 1/4, or 1/8 of SEW, while EMUL of the source is (EEW/SEW)*LMUL.

Vx16_vsext_vf2_cg/cp_vs2_edges_emulf2

vsext_vzext_vd_eew_emul

The destination has EEW equal to SEW and EMUL equal to LMUL.

Vx16_vsext_vf2_cg/cp_vd

vsext_vzext_ill_eew_emul_rsv

If the source EEW is not a supported width, or source EMUL would be below the minimum legal LMUL, the instruction encoding is reserved.

ExceptionsVx_vsext_vf2_cg/cp_vill

vmadc_vmsbc_vadc_vsbc_carry_v0

The carry inputs and outputs are represented using the mask register layout as described in sec-mask-register-layout. Due to encoding constraints, the carry input must come from the implicit v0 register,

Vx16_vadc_vvm_cg/cp_masking_edges

vadc_vsbc_op

VADC and VSBC add or subtract the source operands and the carry-in or borrow-in, and write the result to vector register vd.

Vx16_vadc_vvm_cg/cp_vd_nv0

vadc_vsbc_masked_write_all_elem

These instructions are encoded as masked instructions (vm=0), but they operate on and write back all body elements.

Vx16_vadc_vvm_cg/cp_masking_edges

vadc_vsbc_unmasked_rsv

Encodings corresponding to the unmasked versions (vm=1) are reserved.

{SsstrictV_vadc_vvm_cg,SsstrictV_vsbc_vvm_cg}/cp_ssstrictv_vadc_vsbc_vm1_reserved

vmadc_vmsbc_op_masked

VMADC and VMSBC add or subtract the source operands, optionally add the carry-in or subtract the borrow-in if masked (vm=0), and write the resulting carry-out or borrow-out back to mask register vd.

Vx16_vmadc_vi_cg/cp_vd, Vx16_vmsbc_vvm_cg/cp_vd

vmadc_vmsbc_op_unmasked

If unmasked (vm=1), there is no carry-in or borrow-in.

Vx16_vmadc_vv_cg/cr_vs2_vs1_edges, Vx16_vmsbc_vv_cg/cr_vs2_vs1_edges

vmadc_vmsbc_masked_write_all_elem

These instructions operate on and write back all body elements, even if masked.

Vx16_vmadc_vim_cg/cp_masking_edges

vmadc_vmsbc_tail_agnostic

Because these instructions produce a mask value, they always operate with a tail-agnostic policy.

Vx16_vmadc_vim_cg/cr_vtype_agnostic

vmsbc_borrow_neg

For VMSBC, the borrow is defined to be 1 iff the difference, prior to truncation, is negative.

Vx16_vmsbc_vvm_cg/cp_vs2_edges

vadc_vsbc_vd_v0_rsv

For VADC and VSBC, the instruction encoding is reserved if the destination vector register is v0.

SsstrictV_vadc_vim_cg/cp_ssstrictv_masking_vd_eq_v0

vand_vor_vxor_op

# Bitwise logical operations. vand.vv vd, vs2, vs1, vm # Vector-vector vand.vx vd, vs2, rs1, vm # vector-scalar vand.vi vd, vs2, imm, vm # vector-immediate vor.vv vd, vs2, vs1, vm # Vector-vector vor.vx vd, vs2, rs1, vm # vector-scalar vor.vi vd, vs2, imm, vm # vector-immediate vxor.vv vd, vs2, vs1, vm # Vector-vector vxor.vx vd, vs2, rs1, vm # vector-scalar vxor.vi vd, vs2, imm, vm # vector-immediate

Vx16_vand_vv_cg/cp_vd

vsll_vsrl_vsra_op

A full set of vector shift instructions are provided, including logical shift left (SLL), and logical (zero-extending SRL) and arithmetic (sign-extending SRA) shift right. The data to be shifted is in the vector register group specified by vs2 and the shift amount value can come from a vector register group vs1, a scalar integer register rs1, or a zero-extended 5-bit immediate.

Vx16_vsll_vv_cg/cp_vd

vsll_vsrl_vsra_shamt

Only the low lg2(SEW) bits of the shift-amount value are used to control the shift amount.

Vx16_vsll_vv_cg/cp_custom_vshift_upperbits_vs1_ones, Vx16_vsll_vx_cg/cp_custom_vshift_upperbits_rs1_ones

vnsrl_vnsra_op

The narrowing right shifts extract a smaller field from a wider operand and have both zero-extending (SRL) and sign-extending (SRA) forms. The shift amount can come from a vector register group, or a scalar x register, or a zero-extended 5-bit immediate.

{Vx16_vnsrl_wv_cg,Vx16_vnsra_wv_cg}/cp_custom_vshiftn_upperbits_vs1_ones

vnsrl_vnsra_shamt

The low lg2(2*SEW) bits of the shift-amount value are used (e.g., the low 6 bits for a SEW=64-bit to SEW=32-bit narrowing operation).

Vx16_vnsrl_wv_cg/cp_custom_vshiftn_upperbits_vs1_ones

vmseq_vmsne_vmsltu_vmslt_vmsleu_vmsle_vmsgtu_vmsgt_op

The following integer compare instructions write 1 to the destination mask register element if the comparison evaluates to true, and 0 otherwise. The destination mask vector is always held in a single vector register, with a layout of elements as described in sec-mask-register-layout.

Vx16_vmseq_vv_cg/cp_vd

vmseq_vmsne_vmsltu_vmslt_vmsleu_vmsle_vmsgtu_vmsgt_vd_v0_legal

The destination mask vector register may be the same as the source vector mask register (v0).

Vx16_vmseq_vv_cg/cp_custom_vmask_write_v0_masked

vmseq_vmsne_vmsltu_vmslt_vmsleu_vmsle_vmsgtu_vmsgt_maskundisturbed

Compares effectively AND in the mask under a mask-undisturbed policy if the destination register is v0,

Vx16_vmseq_vv_cg/cp_custom_vmask_write_v0_masked

vmseq_vmsne_vmsltu_vmslt_vmsleu_vmsle_vmsgtu_vmsgt_tail_agnostic

Compares write mask registers, and so always operate under a tail-agnostic policy.

Vx16_vmseq_vv_cg/cr_vtype_agnostic

vminu_vmin_vmaxu_vmax_op

Signed and unsigned integer minimum and maximum instructions are supported.

Vx16_vmin_vv_cg/cp_vd

vmul_vmulh_vmulhu_vmulhsu_op

The single-width multiply instructions perform a SEW-bit*SEW-bit multiply to generate a 2*SEW-bit product, then return one half of the product in the SEW-bit-wide destination. The mul versions write the low half of the product to the destination register, while the mulh versions write the high half of the product to the destination register.

Vx16_vmul_vv_cg/cp_vd

vdivu_vdiv_vremu_vrem_op

The divide and remainder instructions are equivalent to the RISC-V standard scalar integer multiply/divides, with the same results for extreme inputs.

Vx16_vdiv_vv_cg/cp_vd

vwmul_vwmulu_vwmulsu_op

The widening integer multiply instructions return the full 2*SEW-bit product from an SEW-bit*SEW-bit multiply.

Vx16_vwmul_vv_cg/cp_vd_emul2

vmacc_vnmsac_vmadd_vnmsub_op

The integer multiply-add instructions are destructive and are provided in two forms, one that overwrites the addend or minuend (VMACC, VNMSAC) and one that overwrites the first multiplicand (VMADD, VNMSUB).

Vx16_vmacc_vv_cg/cp_vd, Vx16_vnmsac_vv_cg/cp_vd, Vx16_vmadd_vv_cg/cp_vd, Vx16_vnmsub_vv_cg/cp_vd

vmacc_vnmsac_vmadd_vnmsub_op_lowhalf

The low half of the product is added or subtracted from the third operand.

Vx16_vmacc_vv_cg/cr_vs2_vs1_edges, Vx16_vnmsac_vv_cg/cr_vs2_vs1_edges, Vx16_vmadd_vv_cg/cr_vs2_vs1_edges, Vx16_vnmsub_vv_cg/cr_vs2_vs1_edges

vwmaccu_vwmacc_vwmaccsu_vwmaccus_op

The widening integer multiply-add instructions add the full 2*SEW-bit product from a SEW-bit*SEW-bit multiply to a 2*SEW-bit value and produce a 2*SEW-bit result.

Vx16_vwmaccu_vv_cg/cp_vd_emul2

vmerge_op

The vector integer merge instructions combine two source operands based on a mask.

Vx16_vmerge_vvm_cg/cp_vd_nv0

vmerge_op_mask

The VMERGE instructions are encoded as masked instructions (vm=0). The instructions combine two sources as follows. At elements where the mask value is zero, the first operand is copied to the destination element, otherwise the second operand is copied to the destination element. The first operand is always a vector register group specified by vs2. The second operand is a vector register group specified by vs1 or a scalar x register specified by rs1 or a 5-bit sign-extended immediate.

Vx16_vmerge_vvm_cg/cp_masking_edges, Vx16_vmerge_vvm_cg/cr_vs2_vs1_edges

vmerge_all_elem

Unlike regular arithmetic instructions, the merge operates on all body elements (i.e., the set of elements from vstart up to the current vector length in vl).

Vx16_vmerge_vvm_cg/cp_masking_edges

vmv_op

The vector integer move instructions copy a source operand to a vector register group. The VMV.V.V variant copies a vector register group, whereas the VMV.V.X and VMV.V.I variants splat a scalar register or immediate to all active elements of the destination vector register group.

{Vx16_vmv_v_v_cg,Vx16_vmv_v_x_cg,Vx16_vmv_v_i_cg}/cp_vd

vmv_vs2_nv0_rsv

The first operand specifier (vs2) must contain v0, and any other vector register number in vs2 is reserved.

SsstrictV_vmv_v_v_cg/cp_ssstrictv_vmv_vs2_not_v0_reserved, SsstrictV_vmv_v_x_cg/cp_ssstrictv_vmv_vs2_not_v0_reserved, SsstrictV_vmv_v_i_cg/cp_ssstrictv_vmv_vs2_not_v0_reserved

vsaddu_vsadd_vssubu_vssub_op

Saturating forms of integer add and subtract are provided, for both signed and unsigned integers.

Vx16_vsaddu_vv_cg/cr_vs2_vs1_edges, Vx16_vsadd_vv_cg/cr_vs2_vs1_edges, Vx16_vssubu_vv_cg/cr_vs2_vs1_edges, Vx16_vssub_vv_cg/cr_vs2_vs1_edges

vsaddu_vsadd_vssubu_vssub_op_overflow_vxsat_op_vsaddsub

If the result would overflow the destination, the result is replaced with the closest representable value, and the vxsat bit is set.

Vx16_vsaddu_vv_cg/cp_csr_vxsat, Vx16_vsadd_vv_cg/cp_csr_vxsat, Vx16_vssubu_vv_cg/cp_csr_vxsat, Vx16_vssub_vv_cg/cp_csr_vxsat

vaaddu_vaadd_vasubu_vasub_op

The averaging add and subtract instructions right shift the result by one bit and round off the result according to the setting in vxrm. Computation is performed in infinite precision before rounding and truncating.

Vx16_vaadd_vv_cg/cr_vxrm_vs2_vs1_edges, Vx16_vasubu_vv_cg/cr_vxrm_vs2_vs1_edges, Vx16_vasub_vv_cg/cr_vxrm_vs2_vs1_edges

vasub_vasubu_op_overflow

For VASUB and VASUBU, overflow is ignored and the result wraps around.

Vx16_vasub_vv_cg/cr_vxrm_vs2_vs1_edges, Vx16_vasubu_vv_cg/cr_vxrm_vs2_vs1_edges

vsmul_op

The signed fractional multiply instruction produces a 2*SEW product of the two SEW inputs, then shifts the result right by SEW-1 bits, rounding these bits according to vxrm, then saturates the result to fit into SEW bits.

Vx16_vsmul_vv_cg/cp_csr_vxrm

vxsat_op_vsmul

If the result causes saturation, the vxsat bit is set.

Vx16_vsmul_vv_cg/cp_csr_vxsat

vssrl_vssra_op

These instructions shift the input value right, and round off the shifted out bits according to vxrm. The scaling right shifts have both zero-extending (VSSRL) and sign-extending (VSSRA) forms. The data to be shifted is in the vector register group specified by vs2 and the shift amount value can come from a vector register group vs1, a scalar integer register rs1, or a zero-extended 5-bit immediate.

Vx16_vssrl_vv_cg/cp_csr_vxrm

vssrl_vssra_shamt

Only the low lg2(SEW) bits of the shift-amount value are used to control the shift amount.

Vx16_vssrl_vv_cg/cp_custom_vshift_upperbits_vs1_ones

vnclipu_vnclip_op

The VNCLIP instructions are used to pack a fixed-point value into a narrower destination. The instructions support rounding, scaling, and saturation into the final destination format. The source data is in the vector register group specified by vs2. The scaling shift amount value can come from a vector register group vs1, a scalar integer register rs1, or a zero-extended 5-bit immediate.

Vx16_vnclipu_wv_cg/cp_vd

vnclipu_vnclip_shamt

The low lg2(2*SEW) bits of the vector or scalar shift-amount value (e.g., the low 6 bits for a SEW=64-bit to SEW=32-bit narrowing operation) are used to control the right shift amount, which provides the scaling.

Vx16_vnclipu_wv_cg/cp_custom_vshiftn_upperbits_vs1_ones

vnclipu_overflow

For VNCLIPU, the shifted rounded source value is treated as an unsigned integer and saturates if the result would overflow the destination viewed as an unsigned integer.

Vx16_vnclipu_wv_cg/cp_vs2_edges_emul2

vnclip_overflow

For VNCLIP, the shifted rounded source value is treated as a signed integer and saturates if the result would overflow the destination viewed as a signed integer.

Vx16_vnclip_wv_cg/cp_vs2_edges_emul2

vxsat_op_vnclip_u

If any destination element is saturated, the least-significant bit is set in the vxsat register.

V_fp_eew_ieee_nsupported_rsv

If the EEW of a vector floating-point operand does not correspond to a supported IEEE floating-point type, the instruction encoding is reserved.

ExceptionsVf16_vfmv_f_s_cg/cp_vill

mstatus_fs_off_V_fp_ill

If the floating-point unit status field mstatus.⁠FS is Off then any attempt to execute a vector floating-point instruction will raise an illegal-instruction exception.

ExceptionsVf16_vfadd_vv_cg/cp_mstatus_fs_off

mstatus_fs_dirty_V_fp

Any vector floating-point instruction that modifies any floating-point extension state (i.e., floating-point CSRs or f registers) must set mstatus.⁠FS to Dirty.

Sm_VF_cg/cp_vectorfp_mstatus_fs_state_affecting_register

vsstatus_mstatus_fs_off_hypervisor_V_fp_ill

If the hypervisor extension is implemented and V=1, the vsstatus.⁠FS field is additionally in effect for vector floating-point instructions. If vsstatus.⁠FS or mstatus.⁠FS is Off then any attempt to execute a vector floating-point instruction will raise an illegal-instruction exception.

vsstatus_mstatus_fs_dirty_hypervisor_V_fp

Any vector floating-point instruction that modifies any floating-point extension state (i.e., floating-point CSRs or f registers) must set both mstatus.⁠FS and vsstatus.⁠FS to Dirty.

fflags_op_V_fp

A vector floating-point exception at any active floating-point element sets the standard FP exception flags in the fflags register. Inactive elements do not set FP exception flags.

Vf16_vfadd_vv_cg/cp_csr_fflags_vdoun_set, Vf16_vfrsqrt7_v_cg/cp_custom_vfp_flags_inactive_not_set

vfadd_vfsub_vfrsub_op

# Floating-point add vfadd.vv vd, vs2, vs1, vm # Vector-vector vfadd.vf vd, vs2, rs1, vm # vector-scalar # Floating-point subtract vfsub.vv vd, vs2, vs1, vm # Vector-vector vfsub.vf vd, vs2, rs1, vm # Vector-scalar vd[i] = vs2[i] - f[rs1] vfrsub.vf vd, vs2, rs1, vm # Scalar-vector vd[i] = f[rs1] - vs2[i]

Vf16_vfadd_vv_cg/cp_vd

vfwadd_op

# Widening FP add/subtract, 2*SEW = SEW +/- SEW vfwadd.vv vd, vs2, vs1, vm # vector-vector vfwadd.vf vd, vs2, rs1, vm # vector-scalar vfwsub.vv vd, vs2, vs1, vm # vector-vector vfwsub.vf vd, vs2, rs1, vm # vector-scalar # Widening FP add/subtract, 2*SEW = 2*SEW +/- SEW vfwadd.wv vd, vs2, vs1, vm # vector-vector vfwadd.wf vd, vs2, rs1, vm # vector-scalar vfwsub.wv vd, vs2, vs1, vm # vector-vector vfwsub.wf vd, vs2, rs1, vm # vector-scalar

Vf16_vfwadd_vv_cg/cp_vd_emul2

vfmul_vfdiv_vfrdiv_op

# Floating-point multiply vfmul.vv vd, vs2, vs1, vm # Vector-vector vfmul.vf vd, vs2, rs1, vm # vector-scalar # Floating-point divide vfdiv.vv vd, vs2, vs1, vm # Vector-vector vfdiv.vf vd, vs2, rs1, vm # vector-scalar # Reverse floating-point divide vector = scalar / vector vfrdiv.vf vd, vs2, rs1, vm # scalar-vector, vd[i] = f[rs1]/vs2[i]

Vf16_vfmul_vv_cg/cp_vd, Vf16_vfdiv_vv_cg/cp_vd

vfwmul_op

# Widening floating-point multiply vfwmul.vv vd, vs2, vs1, vm # vector-vector vfwmul.vf vd, vs2, rs1, vm # vector-scalar

Vf16_vfwmul_vv_cg/cp_vd_emul2

vfmacc_vfnmacc_vfmsac_vfnmsac_vfmadd_vfnmadd_vfmsub_vfnmsub_op

All four varieties of fused multiply-add are provided, and in two destructive forms that overwrite one of the operands, either the addend or the first multiplicand.

Vf16_vfmacc_vv_cg/cp_vd, Vf16_vfmadd_vv_cg/cp_vd

vfwmacc_vfwnmacc_vfwmsac_vfwnmsac_op

The widening floating-point fused multiply-add instructions all overwrite the wide addend with the result. The multiplier inputs are all SEW wide, while the addend and destination is 2*SEW bits wide.

Vf16_vfwmacc_vv_cg/cp_vd_emul2

vfsqrt_op

The VFSQRT.V instruction is a unary vector-vector instruction.

Vf16_vfsqrt_v_cg/cp_vd

vfrsqrt7_op

This is a unary vector-vector instruction that returns an estimate of 1/sqrt(x) accurate to 7 bits.

Vf16_vfrsqrt7_v_cg/cp_custom_FpRecSqrtEst_edges

vfrsqrt7_op_unex

For the non-exceptional cases, the low bit of the exponent and the six high bits of significand (after the leading one) are concatenated and used to address the following table. The output of the table becomes the seven high bits of the result significand (after the leading one); the remainder of the result significand is zero. Subnormal inputs are normalized and the exponent adjusted appropriately before the lookup. The output exponent is chosen to make the result approximate the reciprocal of the square root of the argument.

Vf16_vfrsqrt7_v_cg/cp_custom_FpRecSqrtEst_edges

vfrsqrt7_op_precise

More precisely, the result is computed as follows. Let the normalized input exponent be equal to the input exponent if the input is normal, or 0 minus the number of leading zeros in the significand otherwise. If the input is subnormal, the normalized input significand is given by shifting the input significand left by 1 minus the normalized input exponent, discarding the leading 1 bit. The output exponent equals floor((3*B - 1 - the normalized input exponent) / 2), where B is the exponent bias. The output sign equals the input sign.

Vf16_vfrsqrt7_v_cg/cp_custom_FpRecSqrtEst_edges

vfrec7_op

This is a unary vector-vector instruction that returns an estimate of 1/x accurate to 7 bits.

Vf16_vfrec7_v_cg/cp_custom_FpRecipEst_edges

vfrec7_op_unex

For the non-exceptional cases, the seven high bits of significand (after the leading one) are used to address the following table. The output of the table becomes the seven high bits of the result significand (after the leading one); the remainder of the result significand is zero. Subnormal inputs are normalized and the exponent adjusted appropriately before the lookup. The output exponent is chosen to make the result approximate the reciprocal of the argument, and subnormal outputs are denormalized accordingly.

Vf16_vfrec7_v_cg/cp_custom_FpRecipEst_edges

vfrec7_op_precise

More precisely, the result is computed as follows. Let the normalized input exponent be equal to the input exponent if the input is normal, or 0 minus the number of leading zeros in the significand otherwise. The normalized output exponent equals (2*B - 1 - the normalized input exponent). If the normalized output exponent is outside the range [-1, 2*B], the result corresponds to one of the exceptional cases in the table above.

Vf16_vfrec7_v_cg/cp_custom_FpRecipEst_edges

vfrec7_op_subnorm

If the input is subnormal, the normalized input significand is given by shifting the input significand left by 1 minus the normalized input exponent, discarding the leading 1 bit. Otherwise, the normalized input significand equals the input significand. The following table gives the seven MSBs of the normalized output significand as a function of the seven MSBs of the normalized input significand; the other bits of the normalized output significand are zero.

Vf16_vfrec7_v_cg/cp_custom_FpRecipEst_edges

vfrec7_op_output

If the normalized output exponent is 0 or -1, the result is subnormal: the output exponent is 0, and the output significand is given by concatenating a 1 bit to the left of the normalized output significand, then shifting that quantity right by 1 minus the normalized output exponent. Otherwise, the output exponent equals the normalized output exponent, and the output significand equals the normalized output significand. The output sign equals the input sign.

Vf16_vfrec7_v_cg/cp_custom_FpRecipEst_edges

vfmin_vfmax_op

The vector floating-point VFMIN and VFMAX instructions have the same behavior as the corresponding scalar floating-point instructions in the F, D, and Q extensions: they perform the IEEE 754-2019 minimumNumber or maximumNumber operation on active elements.

Vf16_vfmax_vv_cg/cp_vd

vfsgnj_vfsgnjn_vfsgnjx_op

Vector versions of the scalar sign-injection instructions. The result takes all bits except the sign bit from the vector vs2 operands.

Vf16_vfsgnj_vv_cg/cp_vd

vmfeq_vmfne_vmflt_vmfle_vmfgt_vmfge_op

These vector FP compare instructions compare two source operands and write the comparison result to a mask register.

Vf16_vmfeq_vv_cg/cp_vd

vmfeq_vmfne_vmflt_vmfle_vmfgt_vmfge_vd_single_vreg

The destination mask vector is always held in a single vector register, with a layout of elements as described in sec-mask-register-layout.

{Vf32_vmfeq_vv_cg, Vf32_vmflt_vv_cg, Vf32_vmfle_vv_cg, Vf32_vmfne_vv_cg}/cr_vl_lmul_sew32

vmfeq_vmfne_vmflt_vmfle_vmfgt_vmfge_vd_eq_v0

The destination mask vector register may be the same as the source vector mask register (v0).

SsstrictV_vmfeq_vv_cg/cp_ssstrictv_masking_vd_eq_v0

vmfeq_vmfne_vmflt_vmfle_vmfgt_vmfge_tail_agnostic

Compares write mask registers, and so always operate under a tail-agnostic policy.

Vf16_vmfeq_vv_cg/cr_vtype_agnostic

vmfeq_vmfne_snan_invalid

VMFEQ and VMFNE raise the invalid operation exception only on signaling NaN inputs.

Vf16_vmfeq_vv_cg/cp_custom_vfp_NaN_input

vmflt_vmfle_vmfgt_vmfge_sqnan_invalid

VMFLT, VMFLE, VMFGT, and VMFGE raise the invalid operation exception on both signaling and quiet NaN inputs.

Vf16_vmflt_vv_cg/cp_custom_vfp_flags_nv

vmfne_vdval1_nan

VMFNE writes 1 to the destination element when either operand is NaN,

Vf16_vmfeq_vv_cg/cp_custom_vfp_NaN_input

vmfeq_vmflt_vmfle_vmfgt_vmfge_vdval0_nan

whereas the other compares write 0 when either operand is NaN.

Vf16_vmfeq_vv_cg/cp_custom_vfp_NaN_input

vfclass_op

This is a unary vector-vector instruction that operates in the same way as the scalar classify instruction.

Vf16_vfclass_v_cg/cp_custom_vfclass_onehot

vfclass_op_result

The 10-bit mask produced by this instruction is placed in the least-significant bits of the result elements. The upper (SEW-10) bits of the result are filled with zeros.

Vf16_vfclass_v_cg/cp_custom_vfclass_onehot

vfclass_sewge16

The instruction is only defined for SEW=16b and above, so the result will always fit in the destination elements.

Vf16_vfclass_v_cg/cp_vd

vfmerge_op

A vector-scalar floating-point merge instruction is provided,

Vf16_vfmerge_vfm_cg/cp_masking_edges

vfmerge_op_mask

At elements where the mask value is zero, the first vector operand is copied to the destination element, otherwise a scalar floating-point register value is copied to the destination element.

Vf16_vfmerge_vfm_cg/cp_masking_edges

vfmerge_all_elem

operates on all body elements from vstart up to the current vector length in vl regardless of mask value.

Vf16_vfmerge_vfm_cg/cp_masking_edges

vfmv_op

The vector floating-point move instruction splats a floating-point scalar operand to a vector register group. The instruction copies a scalar f register value to all active elements of a vector register group.

Vf16_vfmv_v_f_cg/cp_vd

vfmv_vs2_nv0_rsv

The instruction must have the vs2 field set to v0, with all other values for vs2 reserved.

SsstrictV_vfmv_v_f_cg/cp_ssstrictv_vfmv_vs2_not_v0_reserved

vfcvt_op

Conversion operations are provided to convert to and from floating-point values and unsigned and signed integers, where both source and destination are SEW wide.

Vf16_vfcvt_x_f_v_cg/cp_vd

vfcvt_op_exceptions

The conversions follow the same rules on exceptional conditions as the scalar conversion instructions.

Vf16_vfcvt_x_f_v_cg/cp_custom_vfp_flags_nv_nx

vfcvt_op_frm

The conversions use the dynamic rounding mode in frm, except for the rtz variants, which round towards zero.

Vf16_vfcvt_x_f_v_cg/cp_csr_frm_v

vfwcvt_op

A set of conversion instructions is provided to convert between narrower integer and floating-point datatypes to a type of twice the width.

Vf16_vfwcvt_x_f_v_cg/cp_vd_emul2

vfwcvt_vreg_constr

These instructions have the same constraints on vector register overlap as other widening instructions (see sec-widening).

Vf16_vfwadd_vv_cg/cp_custom_allVdOverlapTopVs2_vd_vs2_lmul1

vfncvt_op

A set of conversion instructions is provided to convert wider integer and floating-point datatypes to a type of half the width.

Vf16_vfncvt_x_f_w_cg/cp_vd

vfncvt_vreg_constr

These instructions have the same constraints on vector register overlap as other narrowing instructions (see sec-narrowing).

SsstrictV_vfncvt_x_f_w_cg/cp_ssstrictv_vnarrow_overlapping_vd_vs2

vreduction_scalar_def

Vector reduction operations take a vector register group of elements and a scalar held in element 0 of a vector register group, and perform a reduction using some binary operator, to produce a scalar result in element 0 of a vector register group.

Vx16_vredsum_vs_cg/cp_custom_voffgroup_vs1_lmul2, Vx16_vredsum_vs_cg/cp_custom_element0Masked

vreduction_scalar_disregard_lmul

The scalar input and output operands are held in element 0 of a group with EMUL = ceil(EEW/VLEN), regardless of LMUL setting.

Vx16_vredsum_vs_cg/cp_custom_voffgroup_vs1_lmul2

vreduction_scalar_disregard_maskval

Inactive elements from the source vector register group are excluded from the reduction, but the scalar operand is always included regardless of the mask values.

Vx16_vredsum_vs_cg/cp_custom_element0Masked

vreduction_vd_overlap_vs

The destination vector register can overlap the source operands, including the mask register.

Vx16_vredsum_vs_cg/cmp_vd_vs2

vreduction_tail_policy

The other elements in the destination vector register (0 < index < VLEN/SEW) are considered the tail and are managed with the current tail agnostic/undisturbed policy.

Vx16_vredsum_vs_cg/cr_vtype_agnostic

vreduction_vl_0

If vl=0, no operation is performed and the destination register is not updated.

Vx16_vredsum_vs_cg/cp_vl_0

vreduction_trap

Traps on vector reduction instructions are always reported with a vstart of 0.

vreduction_vstart_n0_ill

Vector reduction operations raise an illegal-instruction exception if vstart is non-zero.

ExceptionsVx_vredsum_vs_cg/cp_vstart, ExceptionsVx_vwredsum_vs_cg/cp_vstart, ExceptionsVf32_vfredosum_vs_cg/cp_vstart, ExceptionsVf32_vfwredosum_vs_cg/cp_vstart

vredsum_vredmaxu_vredmax_vredminu_vredmin_vredand_vredor_vredxor_op

All operands and results of single-width reduction instructions have the same SEW width.

Vx8_vredsum_vs_cg/cp_vd, Vx16_vredsum_vs_cg/cp_vd, Vx32_vredsum_vs_cg/cp_vd, Vx64_vredsum_vs_cg/cp_vd, Vx8_vredmaxu_vs_cg/cp_vd, Vx16_vredmaxu_vs_cg/cp_vd, Vx32_vredmaxu_vs_cg/cp_vd, Vx64_vredmaxu_vs_cg/cp_vd, Vx8_vredmax_vs_cg/cp_vd, Vx16_vredmax_vs_cg/cp_vd, Vx32_vredmax_vs_cg/cp_vd, Vx64_vredmax_vs_cg/cp_vd, Vx8_vredminu_vs_cg/cp_vd, Vx16_vredminu_vs_cg/cp_vd, Vx32_vredminu_vs_cg/cp_vd, Vx64_vredminu_vs_cg/cp_vd, Vx8_vredmin_vs_cg/cp_vd, Vx16_vredmin_vs_cg/cp_vd, Vx32_vredmin_vs_cg/cp_vd, Vx64_vredmin_vs_cg/cp_vd, Vx8_vredand_vs_cg/cp_vd, Vx16_vredand_vs_cg/cp_vd, Vx32_vredand_vs_cg/cp_vd, Vx64_vredand_vs_cg/cp_vd, Vx8_vredor_vs_cg/cp_vd, Vx16_vredor_vs_cg/cp_vd, Vx32_vredor_vs_cg/cp_vd, Vx64_vredor_vs_cg/cp_vd, Vx8_vredxor_vs_cg/cp_vd, Vx16_vredxor_vs_cg/cp_vd, Vx32_vredxor_vs_cg/cp_vd, Vx64_vredxor_vs_cg/cp_vd

vredsum_vredmaxu_vredmax_vredminu_vredmin_vredand_vredor_vredxor_overflow

Overflows wrap around on arithmetic sums.

Vx8_vredsum_vs_cg/cr_vs2_vs1_edges, Vx16_vredsum_vs_cg/cr_vs2_vs1_edges, Vx32_vredsum_vs_cg/cr_vs2_vs1_edges, Vx64_vredsum_vs_cg/cr_vs2_vs1_edges, Vx8_vredmaxu_vs_cg/cr_vs2_vs1_edges, Vx16_vredmaxu_vs_cg/cr_vs2_vs1_edges, Vx32_vredmaxu_vs_cg/cr_vs2_vs1_edges, Vx64_vredmaxu_vs_cg/cr_vs2_vs1_edges, Vx8_vredmax_vs_cg/cr_vs2_vs1_edges, Vx16_vredmax_vs_cg/cr_vs2_vs1_edges, Vx32_vredmax_vs_cg/cr_vs2_vs1_edges, Vx64_vredmax_vs_cg/cr_vs2_vs1_edges, Vx8_vredminu_vs_cg/cr_vs2_vs1_edges, Vx16_vredminu_vs_cg/cr_vs2_vs1_edges, Vx32_vredminu_vs_cg/cr_vs2_vs1_edges, Vx64_vredminu_vs_cg/cr_vs2_vs1_edges, Vx8_vredmin_vs_cg/cr_vs2_vs1_edges, Vx16_vredmin_vs_cg/cr_vs2_vs1_edges, Vx32_vredmin_vs_cg/cr_vs2_vs1_edges, Vx64_vredmin_vs_cg/cr_vs2_vs1_edges, Vx8_vredand_vs_cg/cr_vs2_vs1_edges, Vx16_vredand_vs_cg/cr_vs2_vs1_edges, Vx32_vredand_vs_cg/cr_vs2_vs1_edges, Vx64_vredand_vs_cg/cr_vs2_vs1_edges, Vx8_vredor_vs_cg/cr_vs2_vs1_edges, Vx16_vredor_vs_cg/cr_vs2_vs1_edges, Vx32_vredor_vs_cg/cr_vs2_vs1_edges, Vx64_vredor_vs_cg/cr_vs2_vs1_edges, Vx8_vredxor_vs_cg/cr_vs2_vs1_edges, Vx16_vredxor_vs_cg/cr_vs2_vs1_edges, Vx32_vredxor_vs_cg/cr_vs2_vs1_edges, Vx64_vredxor_vs_cg/cr_vs2_vs1_edges

vwredsumu_op

The unsigned VWREDSUMU.VS instruction zero-extends the SEW-wide vector elements before summing them, then adds the 2*SEW-width scalar element, and stores the result in a 2*SEW-width scalar element.

Vx8_vwredsumu_vs_cg/cr_vs2_vs1_edges_wred, Vx16_vwredsumu_vs_cg/cr_vs2_vs1_edges_wred, Vx32_vwredsumu_vs_cg/cr_vs2_vs1_edges_wred

vwredsumu_vwredsum_op_overflow

For both VWREDSUMU.VS and VWREDSUM.VS, overflows wrap around.

Vx8_vwredsumu_vs_cg/cr_vs2_vs1_edges_wred, Vx16_vwredsumu_vs_cg/cr_vs2_vs1_edges_wred, Vx32_vwredsumu_vs_cg/cr_vs2_vs1_edges_wred, Vx8_vwredsum_vs_cg/cr_vs2_vs1_edges_wred, Vx16_vwredsum_vs_cg/cr_vs2_vs1_edges_wred, Vx32_vwredsum_vs_cg/cr_vs2_vs1_edges_wred

vwredsum_op

The VWREDSUM.VS instruction sign-extends the SEW-wide vector elements before summing them.

Vx8_vwredsum_vs_cg/cr_vs2_vs1_edges_wred, Vx16_vwredsum_vs_cg/cr_vs2_vs1_edges_wred, Vx32_vwredsum_vs_cg/cr_vs2_vs1_edges_wred

vfredosum_op

The VFREDOSUM instruction must sum the floating-point values in element order, starting with the scalar in vs1[0]

Vf16_vfredosum_vs_cg/cp_custom_vfredosum_ordered_sum

vfredosum_op_exceptions

where each addition operates identically to the scalar floating-point instructions in terms of raising exception flags and generating or propagating special values.

Vf16_vfredosum_vs_cg/cp_custom_vfp_flags_nv_nx

vfredosum_maskoff

When the operation is masked (vm=0), the masked-off elements do not affect the result or the exception flags.

Vf16_vfredosum_vs_cg/cp_masking_edges

vfredusum_op

The implementation must produce a result equivalent to a reduction tree composed of binary operator nodes, with the inputs being elements from the source vector register group (vs2) and the source scalar value (vs1[0]). Each operator in the tree accepts two inputs and produces one result. Each operator first computes an exact sum as a RISC-V scalar floating-point addition with infinite exponent range and precision, then converts this exact sum to a floating-point format with range and precision each at least as great as the element floating-point format indicated by SEW, rounding using the currently active floating-point dynamic rounding mode and raising exception flags as necessary. A different floating-point range and precision may be chosen for the result of each operator. A node where one input is derived only from elements masked-off or beyond the active vector length may either treat that input as the additive identity of the appropriate EEW or simply copy the other input to its output. The rounded result from the root node in the tree is converted (rounded again, using the dynamic rounding mode) to the standard floating-point format indicated by SEW.

Vf16_vfredusum_vs_cg/cp_vd

vfredusum_additive_impl

The additive identity is +0.0 when rounding down (towards -∞) or -0.0 for all other rounding modes.

Implicit: the additive-identity sign is whatever the reference model produces and is checked by the ordinary signature comparison, just not isolated by a dedicated coverpoint

vfredusum_redtree

The reduction tree structure must be deterministic for a given value in vtype and vl.

Untestable: reduction-tree determinism across runs is not observable from a single self-checking execution

vfredmin_vfredmax_op

The VFREDMIN and VFREDMAX instructions reduce the scalar argument in vs1[0] and active elements in vs2 using the IEEE 754-2019 minimumNumber and maximumNumber operations, respectively.

Vf16_vfredmin_vs_cg/cp_vd

vfwredosum_vfwredusum_op

Widening forms of the sum reductions are provided that read and write a double-width reduction result.

Vf16_vfwredosum_vs_cg/cp_vd_emul2, Vf16_vfwredusum_vs_cg/cp_vd_emul2

vfwredosum_vfwredusum_op_reduction

The reduction of the SEW-width elements is performed as in the single-width reduction case, with the elements in vs2 promoted to 2*SEW bits before adding to the 2*SEW-bit accumulator.

Vf16_vfwredosum_vs_cg/cp_vd_emul2, Vf16_vfwredusum_vs_cg/cp_vd_emul2

vmask_maskreg_def

Vector mask-register logical operations operate on mask registers. Each element in a mask register is a single bit,

Vx16_vmand_mm_cg/cp_vd

vmask_vd_overlap_vs

The destination vector register may be the same as either source vector register.

Vx16_vmand_mm_cg/cmp_vd_vs1

vmask_vstart

As with other vector instructions, the elements with indices less than vstart are unchanged, and vstart is reset to zero after execution.

ExceptionsVx_vmand_mm_cg/cp_vstart

vmasklogical_unmasked

Vector mask logical instructions are always unmasked,

Vx16_vmand_mm_cg/cr_vtype_agnostic_nomask

vmasklogical_masked_rsv

so there are no inactive elements, and the encodings with vm=0 are reserved.

SsstrictV_vmand_mm_cg/cp_ssstrictv_mask_logical_vm0_reserved, SsstrictV_vmnand_mm_cg/cp_ssstrictv_mask_logical_vm0_reserved, SsstrictV_vmor_mm_cg/cp_ssstrictv_mask_logical_vm0_reserved, SsstrictV_vmxor_mm_cg/cp_ssstrictv_mask_logical_vm0_reserved

vmasklogical_tail_agnostic

Mask elements past vl, the tail elements, are always updated with a tail-agnostic policy.

Vx16_vmand_mm_cg/cr_vtype_agnostic_nomask

vmand_vmnand_vmandn_vmxor_vmor_vmnor_vmorn_vmxnor_op

vmand.mm vd, vs2, vs1 # vd.mask[i] = vs2.mask[i] && vs1.mask[i] vmnand.mm vd, vs2, vs1 # vd.mask[i] = !(vs2.mask[i] && vs1.mask[i]) vmandn.mm vd, vs2, vs1 # vd.mask[i] = vs2.mask[i] && !vs1.mask[i] vmxor.mm vd, vs2, vs1 # vd.mask[i] = vs2.mask[i] ^^ vs1.mask[i] vmor.mm vd, vs2, vs1 # vd.mask[i] = vs2.mask[i] || vs1.mask[i] vmnor.mm vd, vs2, vs1 # vd.mask[i] = !(vs2.mask[i] || vs1.mask[i]) vmorn.mm vd, vs2, vs1 # vd.mask[i] = vs2.mask[i] || !vs1.mask[i] vmxnor.mm vd, vs2, vs1 # vd.mask[i] = !(vs2.mask[i] ^^ vs1.mask[i])

Vx16_vmand_mm_cg/cr_vs2_vs1_edges_mm, Vx16_vmnand_mm_cg/cr_vs2_vs1_edges_mm, Vx16_vmandn_mm_cg/cr_vs2_vs1_edges_mm, Vx16_vmxor_mm_cg/cr_vs2_vs1_edges_mm, Vx16_vmor_mm_cg/cr_vs2_vs1_edges_mm, Vx16_vmnor_mm_cg/cr_vs2_vs1_edges_mm, Vx16_vmorn_mm_cg/cr_vs2_vs1_edges_mm, Vx16_vmxnor_mm_cg/cr_vs2_vs1_edges_mm

vcpop_vs_single_vreg

The source operand is a single vector register holding mask register values as described in sec-mask-register-layout.

Vx16_vcpop_m_cg/cp_vs2_edges_eew1

vcpop_op

The VCPOP.M instruction counts the number of mask elements of the active elements of the vector source mask register that have the value 1 and writes the result to a scalar x register.

Vx16_vcpop_m_cg/cp_rd

vcpop_op_mask

The operation can be performed under a mask, in which case only the masked elements are counted.

Vx16_vcpop_m_cg/cp_masking_edges

vcpop_vl0

The VCPOP.M instruction writes x[rd] even if vl=0 (with the value 0, since no mask elements are active).

Vx16_vcpop_m_cg/cp_vl_0

vcpop_trap

Traps on VCPOP.M are always reported with a vstart of 0.

vcpop_vstart_n0_ill

The VCPOP.M instruction will raise an illegal-instruction exception if vstart is non-zero.

ExceptionsVx_vcpop_m_cg/cp_vstart_gt_vl, ExceptionsVx_vcpop_m_cg/cp_vstart

vfirst_op

The VFIRST instruction finds the lowest-numbered active element of the source mask vector that has the value 1 and writes that element’s index to rd. If no active element has the value 1, -1 is written to rd.

Vx16_vfirst_m_cg/cp_rd

vfirst_vl0

The VFIRST.M instruction writes x[rd] even if vl=0 (with the value -1, since no mask elements are active).

Vx16_vfirst_m_cg/cp_vl_0

vfirst_trap

Traps on VFIRST are always reported with a vstart of 0.

vfirst_vstart_n0_ill

The VFIRST instruction will raise an illegal-instruction exception if vstart is non-zero.

ExceptionsVx_vfirst_m_cg/cp_vstart_gt_vl, ExceptionsVx_vfirst_m_cg/cp_vstart

vmsbf_op

The VMSBF.M instruction takes a mask register as input and writes results to a mask register. The instruction writes a 1 to all active mask elements before the first active source element that is a 1, then writes a 0 to that element and all following active elements. If there is no set bit in the active elements of the source vector, then all active elements in the destination are written with a 1.

Vx16_vmsbf_m_cg/cp_vd

vmsbf_tail_agnostic

The tail elements in the destination mask register are updated under a tail-agnostic policy.

Vx16_vmsbf_m_cg/cr_vtype_agnostic

vmsbf_trap

Traps on VMSBF.M are always reported with a vstart of 0.

vmsbf_vstart_n0_ill

The VMSBF.M instruction will raise an illegal-instruction exception if vstart is non-zero.

ExceptionsVx_vmsbf_m_cg/cp_vstart_gt_vl, ExceptionsVx_vmsbf_m_cg/cp_vstart

vmsbf_vreg_constr

The destination register cannot overlap the source register and, if masked, cannot overlap the mask register (v0).

SsstrictV_vmsbf_m_cg/cp_ssstrictv_masking_vd_eq_v0

vmsif_op

The vector mask set-including-first instruction is similar to set-before-first, except it also includes the element with a set bit.

Vx16_vmsif_m_cg/cp_vd

vmsif_tail_agnostic

The tail elements in the destination mask register are updated under a tail-agnostic policy.

Vx16_vmsif_m_cg/cr_vtype_agnostic

vmsif_trap

Traps on VMSIF.M are always reported with a vstart of 0.

vmsif_vstart_n0_ill

The VMSIF.M instruction will raise an illegal-instruction exception if vstart is non-zero.

ExceptionsVx_vmsif_m_cg/cp_vstart_gt_vl, ExceptionsVx_vmsif_m_cg/cp_vstart

vmsif_vreg_constr

The destination register cannot overlap the source register and, if masked, cannot overlap the mask register (v0).

SsstrictV_vmsif_m_cg/cp_ssstrictv_masking_vd_eq_v0

vmsof_op

The vector mask set-only-first instruction is similar to set-before-first, except it only sets the first element with a bit set, if any.

Vx16_vmsof_m_cg/cp_vd

vmsof_tail_agnostic

The tail elements in the destination mask register are updated under a tail-agnostic policy.

Vx16_vmsof_m_cg/cr_vtype_agnostic

vmsof_trap

Traps on VMSOF.M are always reported with a vstart of 0.

vmsof_vstart_n0_ill

The VMSOF.M instruction will raise an illegal-instruction exception if vstart is non-zero.

ExceptionsVx_vmsof_m_cg/cp_vstart_gt_vl, ExceptionsVx_vmsof_m_cg/cp_vstart

vmsof_vreg_constr

The destination register cannot overlap the source register and, if masked, cannot overlap the mask register (v0).

SsstrictV_vmsof_m_cg/cp_ssstrictv_masking_vd_eq_v0

viota_op

The VIOTA.M instruction reads a source vector mask register and writes to each element of the destination vector register group the sum of all the bits of elements in the mask register whose index is less than the element, e.g., a parallel prefix sum of the mask values.

Vx16_viota_m_cg/cp_vd

viota_op_masked

This instruction can be masked, in which case only the enabled elements contribute to the sum.

Vx16_viota_m_cg/cp_masking_edges

viota_op_zext

The result value is zero-extended to fill the destination element if SEW is wider than the result.

Vx16_viota_m_cg/cr_vl_lmul_sew16, Vx32_viota_m_cg/cr_vl_lmul_sew32, Vx64_viota_m_cg/cr_vl_lmul_sew64

viota_op_overflow

If the result value would overflow the destination SEW, the least-significant SEW bits are retained.

Vx8_viota_m_cg/cr_vl_lmul_sew8

viota_trap

Traps on VIOTA.M are always reported with a vstart of 0,

viota_vstart_n0_ill

An illegal-instruction exception is raised if vstart is non-zero.

ExceptionsVx_viota_m_cg/cp_vstart_gt_vl, ExceptionsVx_viota_m_cg/cp_vstart

viota_vreg_constr

The destination register group cannot overlap the source register and, if masked, cannot overlap the mask register (v0).

SsstrictV_viota_m_cg/cp_exceptionsv_vd_vs2_overlap, SsstrictV_viota_m_cg/cp_ssstrictv_masking_vd_eq_v0

vid_op

The VID.V instruction writes each element’s index to the destination vector register group, from 0 to vl-1.

Vx16_vid_v_cg/cp_vd

vid_op_mask

The instruction can be masked. Masking does not change the index value written to active elements.

Vx16_vid_v_cg/cp_masking_edges

vid_op_zext

The result value is zero-extended to fill the destination element if SEW is wider than the result.

Vx16_vid_v_cg/cr_vl_lmul_sew16, Vx32_vid_v_cg/cr_vl_lmul_sew32, Vx64_vid_v_cg/cr_vl_lmul_sew64

vid_op_overflow

If the result value would overflow the destination SEW, the least-significant SEW bits are retained.

Vx8_vid_v_cg/cr_vl_lmul_sew8

vid_vs2_nv0_rsv

The vs2 field of the instruction must be set to v0, otherwise the encoding is reserved.

SsstrictV_vid_v_cg/cp_ssstrictv_vid_vs2_not_v0_reserved

vmv-x-s_vmv-s-x_ignorelmul

The instructions ignore LMUL; EMUL is computed as ceil(EEW/VLEN).

Vx16_vmv_s_x_cg/cp_custom_voffgroup_vd_lmul2, Vx16_vmv_x_s_cg/cp_custom_voffgroup_vs2_lmul2

vmv-x-s_op

The VMV.X.S instruction copies a single SEW-wide element from index 0 of the source vector register to a destination integer register. If SEW > XLEN, the least-significant XLEN bits are transferred and the upper SEW-XLEN bits are ignored. If SEW < XLEN, the value is sign-extended to XLEN bits.

Vx16_vmv_x_s_cg/cp_rd, Vx16_vmv_x_s_cg/cp_custom_gprWriting_vstart_eq_vl, Vx16_vmv_x_s_cg/cp_vl_0

vmv-s-x_op

The VMV.S.X instruction copies the scalar integer register to element 0 of the destination vector register group with EMUL = ceil(EEW/VLEN). If SEW < XLEN, the least-significant bits are copied and the upper XLEN-SEW bits are ignored. If SEW > XLEN, the value is sign-extended to SEW bits. The other elements in the destination vector register ( 0 < index < VLEN/SEW) are treated as tail elements using the current tail agnostic/undisturbed policy.

Vx16_vmv_s_x_cg/cp_rs1_edges

vmv-s-x_vstart_ge_vl

If vstart ≥ vl, no operation is performed and the destination register is not updated.

ExceptionsVx_vmv_s_x_cg/cp_vstart_gt_vl

vmv-s-x_vmv-x-s_masked_rsv

The encodings corresponding to the masked versions (vm=0) of VMV.X.S and VMV.S.X are reserved.

SsstrictV_vmv_s_x_cg/cp_ssstrictv_vmv_xs_sx_vm0_reserved

vfmv-f-s_vfmv-s-f_ignorelmul

The instructions ignore LMUL; EMUL is computed as ceil(EEW/VLEN).

Vf16_vfmv_f_s_cg/cp_custom_fmv_fs_vs2_all_lmul_regs, Vf16_vfmv_s_f_cg/cp_custom_fmv_sf_vd_all_lmul_regs

vfmv-f-s_op

The VFMV.F.S instruction copies a single SEW-wide element from index 0 of the source vector register to a destination scalar floating-point register.

Vf16_vfmv_f_s_cg/cp_fd

vfmv-s-f_op

The VFMV.S.F instruction copies the scalar floating-point register to element 0 of the destination vector register. The other elements in the destination vector register (0 < index < VLEN/SEW) are treated as tail elements using the current tail agnostic/undisturbed policy.

Vf16_vfmv_s_f_cg/cp_fs1

vfmv-s-f_vstart_ge_vl

If vstart ≥ vl, no operation is performed and the destination register is not updated.

ExceptionsVf16_vfmv_s_f_cg/cp_vstart_gt_vl

vfmv-s-f_masked_rsv

The encodings corresponding to the masked versions (vm=0) of VFMV.F.S and VFMV.S.F are reserved.

SsstrictV_vfmv_s_f_cg/cp_ssstrictv_vfmv_fs_sf_vm0_reserved

vslide_vstart_ge_vl

For all of the VSLIDEUP, VSLIDEDOWN, VSLIDE1UP, VFSLIDE1UP, VSLIDE1DOWN, and VFSLIDE1DOWN instructions, if vstart ≥ vl, the instruction performs no operation and leaves the destination vector register unchanged.

ExceptionsVx_vslideup_vx_cg/cp_vstart_gt_vl, ExceptionsVx_vslidedown_vx_cg/cp_vstart_gt_vl, ExceptionsVx_vslide1up_vx_cg/cp_vstart_gt_vl, ExceptionsVx_vslide1down_vx_cg/cp_vstart_gt_vl, ExceptionsVf16_vfslide1up_vf_cg/cp_vstart_gt_vl, ExceptionsVf16_vfslide1down_vf_cg/cp_vstart_gt_vl

vslide_mask

The slide instructions may be masked, with mask element i controlling whether destination element i is written. The mask undisturbed/agnostic policy is followed for inactive elements.

Vx16_vslideup_vx_cg/cp_masking_edges, Vx16_vslidedown_vx_cg/cp_masking_edges, Vx16_vslide1up_vx_cg/cp_masking_edges, Vx16_vslide1down_vx_cg/cp_masking_edges, Vf16_vfslide1up_vf_cg/cp_masking_edges, Vf16_vfslide1down_vf_cg/cp_masking_edges

vslideup_op

For VSLIDEUP, the value in vl specifies the maximum number of destination elements that are written. The start index (OFFSET) for the destination can be either specified using an unsigned integer in the x register specified by rs1, or a 5-bit immediate, zero-extended to XLEN bits. If XLEN > SEW, OFFSET is not truncated to SEW bits. Destination elements OFFSET through vl-1 are written if unmasked and if OFFSET < vl.

Vx16_vslideup_vx_cg/cr_vs2_rs1_edges

vslideup_vreg_constr

The destination vector register group for VSLIDEUP cannot overlap the source vector register group, otherwise the instruction encoding is reserved.

SsstrictV_vslideup_vx_cg/cp_ssstrictv_vslideup_vd_vs2_overlap, SsstrictV_vslideup_vi_cg/cp_ssstrictv_vslideup_vd_vs2_overlap

vslidedown_op

For VSLIDEDOWN, the value in vl specifies the maximum number of destination elements that are written. The remaining elements past vl are handled according to the current tail policy (sec-agnostic).

Vx16_vslidedown_vx_cg/cr_vs2_rs1_edges

vslidedown_op_src

The start index (OFFSET) for the source can be either specified using an unsigned integer in the x register specified by rs1, or a 5-bit immediate, zero-extended to XLEN bits. If XLEN > SEW, OFFSET is not truncated to SEW bits.

Vx16_vslidedown_vx_cg/cp_rs1_edges, Vx16_vslidedown_vx_cg/cp_custom_vindexVX_rs1_not_truncated_32, Vx16_vslidedown_vx_cg/cp_custom_vindexVX_rs1_not_truncated_64

vslide1up-vx_op

The VSLIDE1UP instruction places the x register argument at location 0 of the destination vector register group, provided that element 0 is active, otherwise the destination element update follows the current mask agnostic/undisturbed policy. If XLEN < SEW, the value is sign-extended to SEW bits. If XLEN > SEW, the least-significant bits are copied over and the high XLEN-SEW bits are ignored.

Vx16_vslide1up_vx_cg/cr_vs2_rs1_edges

vslide1up-vx_op_rem_elem

The remaining active vl-1 elements are copied over from index i in the source vector register group to index i+1 in the destination vector register group.

Vx16_vslide1up_vx_cg/cr_vs2_rs1_edges

vslide1up-vx_op_vl

The vl register specifies the maximum number of destination vector register elements updated with source values, and remaining elements past vl are handled according to the current tail policy (sec-agnostic).

Vx16_vslide1up_vx_cg/cp_csr_vl_edges

vslide1up-vx_vreg_constr

The VSLIDE1UP instruction requires that the destination vector register group does not overlap the source vector register group. Otherwise, the instruction encoding is reserved.

SsstrictV_vslide1up_vx_cg/cp_ssstrictv_vslide1up_vd_vs2_overlap

vslide1up-vf_op

The VFSLIDE1UP instruction is defined analogously to VSLIDE1UP, but sources its scalar argument from an f register.

Vf16_vfslide1up_vf_cg/cr_vs2_fs1_edges_f_sew16

vslide1down-vx_op

The VSLIDE1DOWN instruction copies the first vl-1 active elements values from index i+1 in the source vector register group to index i in the destination vector register group.

Vx16_vslide1down_vx_cg/cr_vs2_rs1_edges

vslide1down-vx_op_vl

The vl register specifies the maximum number of destination vector register elements written with source values, and remaining elements past vl are handled according to the current tail policy (sec-agnostic).

Vx16_vslide1down_vx_cg/cp_csr_vl_edges

vslide1down-vx_op_details

The VSLIDE1DOWN instruction places the x register argument at location vl-1 in the destination vector register, provided that element vl-1 is active, otherwise the destination element update follows the current mask agnostic/undisturbed policy. If XLEN < SEW, the value is sign-extended to SEW bits. If XLEN > SEW, the least-significant bits are copied over and the high SEW-XLEN bits are ignored.

Vx16_vslide1down_vx_cg/cp_masking_edges, Vx16_vslide1down_vx_cg/cr_vl_lmul_sew16

vslide1down-vf_op

The VFSLIDE1DOWN instruction is defined analogously to VSLIDE1DOWN, but sources its scalar argument from an f register.

Vf16_vfslide1down_vf_cg/cr_vs2_fs1_edges_f_sew16

vrgather_vrgatherei16_vs2_uint

The index values in the second vector are treated as unsigned integers.

Vx16_vrgather_vv_cg/cp_vs1_edges, Vx16_vrgatherei16_vv_cg/cp_vs1_edges

vrgather_vrgatherei16_vs_ignore_vl

The source vector can be read at any index < VLMAX regardless of vl.

Vx16_vrgather_vv_cg/cp_custom_vindexCorners_index_gt_vl_lt_vlmax, Vx16_vrgatherei16_vv_cg/cp_custom_vindexCorners_index_gt_vl_lt_vlmax

vrgather_vrgatherei16_vl

The maximum number of elements to write to the destination register is given by vl,

Vx16_vrgather_vv_cg/cr_vl_lmul_sew16, Vx16_vrgatherei16_vv_cg/cr_vl_lmul_sew16

vrgather_vrgatherei16_tail

and the remaining elements past vl are handled according to the current tail policy (sec-agnostic).

Vx16_vrgather_vv_cg/cr_vtype_agnostic, Vx16_vrgatherei16_vv_cg/cr_vtype_agnostic

vrgather_vrgatherei16_mask

The operation can be masked, and the mask undisturbed/agnostic policy is followed for inactive elements.

Vx16_vrgather_vv_cg/cp_masking_edges, Vx16_vrgatherei16_vv_cg/cp_masking_edges

vrgather-vv_sew_lmul

The VRGATHER.VV form uses SEW/LMUL for both the data and indices.

Vx16_vrgather_vv_cg/cr_vl_lmul_sew16

vrgatherei16-vv_sew_lmul

The VRGATHEREI16.VV form uses SEW/LMUL for the data in vs2 but EEW=16 and EMUL = (16/SEW)*LMUL for the indices in vs1.

Vx32_vrgatherei16_vv_cg/cp_vs1_edges

vrgather_vrgatherei16_id_ge_vlmax

If an element index is out of range ( vs1[i] ≥ VLMAX ) then zero is returned for the element value.

{Vx16_vrgather_vv_cg,Vx16_vrgatherei16_vv_cg}/cp_custom_vindexCorners_index_ge_vlmax

vrgather-vx_vrgather-vi_op

Vector-scalar and vector-immediate forms of the register gather are also provided. These read one element from the source vector at the given index, and write this value to the active elements of the destination vector register. The index value in the scalar register and the immediate, zero-extended to XLEN bits, are treated as unsigned integers. If XLEN > SEW, the index value is not truncated to SEW bits.

{Vx16_vrgather_vx_cg,Vx16_vrgather_vi_cg}/cp_vd, Vx16_vrgather_vx_cg/cp_custom_vindexVX_rs1_not_truncated_64

vrgather_vrgatherei16_vreg_constr

For any VRGATHER instruction, the destination vector register group cannot overlap with the source vector register groups, otherwise the instruction encoding is reserved.

{SsstrictV_vrgather_vv_cg,SsstrictV_vrgatherei16_vv_cg}/cp_ssstrictv_vrgather_vd_vs2_overlap

vcompress_op

The vector mask register specified by vs1 indicates which of the first vl elements of vector register group vs2 should be extracted and packed into contiguous elements at the beginning of vector register vd. The remaining elements of vd are treated as tail elements according to the current tail policy (sec-agnostic).

Vx16_vcompress_vm_cg/cr_vs2_vs1_edges

vcompress_enc

VCOMPRESS is encoded as an unmasked instruction (vm=1).

Vx8_vcompress_vm_cg/cp_asm_count, Vx16_vcompress_vm_cg/cp_asm_count, Vx32_vcompress_vm_cg/cp_asm_count, Vx64_vcompress_vm_cg/cp_asm_count, SsstrictV_vcompress_vm_cg/cp_ssstrictv_vcompress_vm0_reserved

vcompress_masked_rsv

The equivalent masked instruction (vm=0) is reserved.

SsstrictV_vcompress_vm_cg/cp_ssstrictv_vcompress_vm0_reserved

vcompress_vreg_constr

The destination vector register group cannot overlap the source vector register group or the source mask register, otherwise the instruction encoding is reserved.

SsstrictV_vcompress_vm_cg/cp_ssstrictv_vcompress_vd_vs2_overlap

vcompress_trap

A trap on a VCOMPRESS instruction is always reported with a vstart of 0.

vcompress_vstart_n0_ill

Executing a VCOMPRESS instruction with a non-zero vstart raises an illegal-instruction exception.

ExceptionsVx_vcompress_vm_cg/cp_vstart_gt_vl, ExceptionsVx_vcompress_vm_cg/cp_vstart

vmv-nr-r_op

The VMV<NR>R.V instructions copy whole vector registers (i.e., all VLEN bits) and can copy whole vector register groups. The nr value in the opcode is the number of individual vector registers, NREG, to copy. The instructions operate as if EMUL = NREG, EEW = min(VLEN*EMUL, SEW), and effective length evl = EMUL * VLEN/EEW.

Vx8_vmv1r_v_cg/cr_vl_lmul_sew8, Vx8_vmv2r_v_cg/cr_vl_lmul_sew8, Vx8_vmv4r_v_cg/cr_vl_lmul_sew8, Vx8_vmv8r_v_cg/cr_vl_lmul_sew8

vmv-nr-r_enc

The instruction is encoded as an OPIVI instruction. The number of vector registers to copy is encoded in the low three bits of the imm field (imm[2:0]) using the same encoding as the nf[2:0] field for memory instructions (Figure fig-nf), i.e., imm[2:0] = NREG-1.

SsstrictV_vmv1r_v_cg/cp_ssstrictv_vmvnr_simm_reserved, Vx8_vmv1r_v_cg/cp_asm_count, Vx8_vmv2r_v_cg/cp_asm_count, Vx8_vmv4r_v_cg/cp_asm_count, Vx8_vmv8r_v_cg/cp_asm_count

vmv-nr-r_nreg_rsv

The value of NREG must be 1, 2, 4, or 8, and values of imm[4:0] other than 0, 1, 3, and 7 are reserved.

SsstrictV_vmv1r_v_cg/cp_ssstrictv_vmvnr_simm_reserved

vmv-nr-r_vreg_constr

The source and destination vector register numbers must be aligned appropriately for the vector register group size,

SsstrictV_vmv2r_v_cg/cp_ssstrictv_vmv2r_both_unaligned

vmv-nr-r_unaligned_rsv

encodings with other vector register numbers are reserved.

SsstrictV_vmv4r_v_cg/cp_ssstrictv_vmv4r_both_unaligned

epc_vstart_op_V_trap

On a trap during a vector instruction (caused by either a synchronous exception or an asynchronous interrupt), the existing *epc CSR is written with a pointer to the trapping vector instruction, while the vstart CSR contains the element index on which the trap was taken.

ExceptionsVx_vsaddu_vv_cg/cp_vstart

Zve_xlen

Zve32x is compatible with all currently defined base ISAs.

Implicit: extension-support requirement exercised by the config simply running under that XLEN

Zve32f_Zve64x_dependent_Zve32x

Zve64x depends upon the Zve32x extension.

Implicit: extension-composition fact exercised implicitly whenever the config runs at all

Zve64f_dependent_Zve32f_Zve64x

Zve64f depends on the Zve64x and Zve32f extensions.

Implicit: extension-composition fact exercised implicitly whenever the config runs at all

Zve64d_dependent_Zve64f

The Zve64d extension depends on the Zve64f and D extensions.

Implicit: extension-composition fact exercised implicitly whenever the config runs at all

Zve_precise_traps

The Zve32x extension has precise traps.

Untestable: trap precision is a cross-cutting property of every exception test, not something one coverpoint can isolate

Zve_eew

Zve32x provides support for EEW of 8, 16, and 32.

Implicit: extension-support requirement exercised implicitly by which EEWs the generated suite runs at all

Zve_nsupport_eew64_xlen32

Zve64x supports all vector load and store instructions (sec-vector-memory), except EEW=64 for index values is not supported when XLEN=32.

Implicit: extension-support exclusion exercised implicitly by config-driven test generation filtering

Zve64_eew64_nsupport_vmulh

Zve64x supports all vector integer instructions (sec-vector-integer), except that the VMULH integer multiply variants that return the high half of the product (VMULH.VV, VMULH.VX, VMULHU.VV, VMULHU.VX, VMULHSU.VV, VMULHSU.VX) are not included for EEW=64.

Implicit: config-driven instruction exclusion exercised implicitly by test generation filtering

Zve64_eew64_nsupport_vsmul

Zve64x supports all vector fixed-point arithmetic instructions (sec-vector-fixed-point), except that VSMUL.VV and VSMUL.VX are not included for EEW=64.

Implicit: config-driven instruction exclusion exercised implicitly by test generation filtering

Zve32x_Zve64x_nsupport_freg

Zve32x supports all vector integer permutation instructions (sec-vector-integer-permute).

Implicit: extension-support requirement exercised implicitly by config-driven test generation filtering

Zve32x_dependent_Zicsr

The Zve32x extension depends on the Zicsr extension.

Sm_V_cg/cp_vcsrrswc

Zve32f_Zve64f_dependent_F

The Zve32f extension depends on the Zve32x and F extensions.

Implicit: extension-composition fact exercised implicitly whenever the config runs at all

misa_v_op

The misa.⁠V bit is set for implementations providing misa and supporting V.

Sm_mcsr_cg/cp_misa_v

V_precise_traps

The V vector extension has precise traps.

Untestable: trap precision is a cross-cutting property of every exception test, not something one coverpoint can isolate

V_dependent_Zvl128b_Zve64d

The V vector extension depends upon the Zvl128b and Zve64d extensions.

Implicit: extension-composition fact exercised implicitly whenever the config runs at all

V_supported_eew

The V extension supports EEW of 8, 16, 32, and 64.

{Vx8_vadd_vv_cg,Vx16_vadd_vv_cg,Vx32_vadd_vv_cg,Vx64_vadd_vv_cg}/cp_asm_count

V_instr_config

The V extension supports the vector configuration instructions (sec-vector-config).

Implicit: extension-support requirement exercised implicitly by which instructions the generated suite runs at all

V_instr_ls_eew64_nsupported_xlen32

The V extension supports all vector load and store instructions (sec-vector-memory), except the V extension does not support EEW=64 for index values when XLEN=32.

Implicit: extension-support requirement exercised implicitly by which instructions the generated suite runs at all

V_instr_int

The V extension supports all vector integer instructions (sec-vector-integer).

Implicit: extension-support requirement exercised implicitly by which instructions the generated suite runs at all

V_instr_fixedpt

The V extension supports all vector fixed-point arithmetic instructions (sec-vector-fixed-point).

Implicit: extension-support requirement exercised implicitly by which instructions the generated suite runs at all

V_instr_red

The V extension supports all vector integer single-width and widening reduction operations (sec-vector-integer-reduce, sec-vector-integer-reduce-widen).

Implicit: extension-support requirement exercised implicitly by which instructions the generated suite runs at all

V_instr_mask

The V extension supports all vector mask instructions (sec-vector-mask).

Implicit: extension-support requirement exercised implicitly by which instructions the generated suite runs at all

V_instr_perm

The V extension supports all vector permutation instructions (sec-vector-integer-permute, sec-vector-float-permute).

Implicit: extension-support requirement exercised implicitly by which instructions the generated suite runs at all

V_dependent_F_D

The V extension depends upon the F and D extensions, and implements all vector floating-point instructions (sec-vector-float) for floating-point operands with EEW=32 or EEW=64 (including widening instructions and conversions between FP32 and FP64).

Implicit: the F and D dependency is satisfied by the configuration under test; the vector floating-point tests cannot run without it

Zvfhmin_dependent_Zve32f

The Zvfhmin extension depends on the Zve32f extension.

Implicit: extension-composition fact exercised implicitly whenever the config runs at all

Zvfh_instr

When the Zvfh extension is implemented, all instructions in sec-vector-float, sec-vector-float-reduce, sec-vector-float-reduce-widen, sec-vector-float-move, sec-vfslide1up, and sec-vfslide1down become defined when SEW=16.

Implicit: extension-support requirement exercised implicitly by which instructions the generated suite runs at all

Zvfh_instr_cvt

Additionally, conversions between 8-bit integers and binary16 values are provided. The floating-point-to-integer narrowing conversions (VFNCVT.X.F.W, VFNCVT.XU.F.W, VFNCVT.RTZ.X.F.W, and VFNCVT.RTZ.XU.F.W) and integer-to-floating-point widening conversions (VFWCVT.F.X.V and VFWCVT.F.XU.V) become defined when SEW=8.

Vf16_vfwcvt_f_x_v_cg/cp_asm_count, Vf16_vfwcvt_f_xu_v_cg/cp_asm_count, Vf16_vfncvt_x_f_w_cg/cp_asm_count, Vf16_vfncvt_xu_f_w_cg/cp_asm_count, Vf16_vfncvt_rtz_x_f_w_cg/cp_asm_count, Vf16_vfncvt_rtz_xu_f_w_cg/cp_asm_count

Zvfh_eew16

The EEW=16 floating-point operands of these instructions use the binary16 format.

Implicit: extension-support requirement exercised implicitly by which EEWs the generated suite runs at all

Zvfh_dependent_Zve32f_Zfhmin

The Zvfh extension depends on the Zve32f and Zfhmin extensions.

Implicit: extension-composition fact exercised implicitly whenever the config runs at all

egs_ge_vlmax_rsv

Vector instructions with EGS > VLMAX are reserved.

Out-of-Scope: no Ssstrict-equivalent suite exists for the vector-crypto (Zvk*) extensions, and this reserved condition depends on CSR state, matching Ssstrict’s own encoding-only scope boundary

egs_vl_rsv

When an operand is a vector of element groups, the vl setting must correspond to an integer multiple of the element group size, with other values of vl reserved.

Out-of-Scope: no Ssstrict-equivalent suite exists for the vector-crypto (Zvk*) extensions, and this reserved condition depends on CSR state, matching Ssstrict’s own encoding-only scope boundary

egs_vl_avl

When element group instructions are present, an additional constraint is placed on the setting of vl based on an AVL value (augmenting constraints-on-setting-vl). EGSMAX is the largest EGS supported by the implementation. When AVL > VLMAX, the value of vl must be set to either VLMAX or a positive integer multiple of EGSMAX.

Untestable: AVL-to-vl rounding under EGSMAX is not exercised by any suite and depends on an implementation-chosen EGSMAX

egs_sew_eew

The vtype SEW can be used to indicate or calculate the effective element size (EEW) of one or more operands of an element group instruction. Where the operand is an element group, SEW and EEW refer to the number of bits in each individual element within a group not the number of bits in the group as a whole.

Zvknha_vsha2ch_vv_cg/cp_csr_vtype_lmul_egs4_sew32

egs_lmul_emul

The vtype LMUL setting can be used to indicate or calculate the effective length multiplier (EMUL) for one or more operands. Element group instructions tend to exhibit a much wider range of relationships between various operand EEW/EMUL values. For example, an instruction might take a vector of length N of 4-element groups with EEW=8b and reduce each group to produce a vector length N of 1-element groups with EEW=32b. In this case, the input and output EMUL values are equal even though the EEW settings differ by a factor of 4.

Zvknha_vsha2ch_vv_cg/cr_vl_lmul_egs4_sew32

egs_egw

The element group width (EGW) is the number of bits in the element group as a whole. For example, the SHA-256 instructions in the Zvknha extension operate on an EGW of 128, with EGS=4 and EEW=32. It is possible to use LMUL to concatenate multiple vector registers together to support larger EGW>VLEN.

Zvknha_vsha2ch_vv_cg/cp_vd_egs4

vector_active_element

The active elements can raise exceptions and update the destination vector register group.

Vx16_vadd_vv_cg/cp_masking_edges

vector_ls_rvtso

If the Ztso extension is implemented, vector memory instructions additionally follow RVTSO at the instruction level.

Not Tested: no Ztso-configured vector test config exists yet to exercise RVTSO ordering

vnclipu_vnclip_rounding

For VNCLIPU and VNCLIP, the rounding mode is specified in the vxrm CSR. Rounding occurs around the least-significant bit of the destination and before saturation.

{Vx16_vnclip_wv_cg,Vx16_vnclipu_wv_cg}/cr_vxrm_vs2_vs1_edges_wv

vf_requires_vx

Vector floating-point instructions require the presence of base scalar floating-point extensions corresponding to the supported vector floating-point element widths.

Implicit: the vector floating-point tests cannot run unless the scalar floating-point extensions are present

instrgrp_vmask_disregard_vlmul

so these instructions all operate on single vector registers regardless of the setting of the VLMUL field in vtype. They do not change the value of VLMUL.

Vx16_vmseq_vv_cg/cp_custom_vmask_write_lmulge1

viota_restart

execution is always restarted from the beginning when resuming after a trap handler.

Not Tested: restart-from-vstart-after-trap sequencing is not generated by this suite yet

vrgather-vv_op_vrgatherei16-vv_op

vrgather.vv vd, vs2, vs1, vm # vd[i] = (vs1[i] >= VLMAX) ? 0 : vs2[vs1[i]]; vrgatherei16.vv vd, vs2, vs1, vm # vd[i] = (vs1[i] >= VLMAX) ? 0 : vs2[vs1[i]];

Vx16_vrgather_vv_cg/cp_custom_vindexCorners_index_gt_vl_lt_vlmax

vector_reset_state

The vector extension must have a consistent state at reset. In particular, vtype and vl must have values that can be read and then restored with a single vsetvl instruction.

Untestable: reset-time CSR state is not observable via a coverpoint in a self-checking test that boots past reset

Zve32f_instr_perm

Zve32f supports all vector floating-point permutation instructions (sec-vector-float-permute) for floating-point operands with EEW=32.

Implicit: extension-support requirement exercised implicitly by which instructions the generated suite runs at all

Zve64d_instr_perm

Zve64d supports all vector floating-point permutation instructions (sec-vector-float-permute) for floating-point operands with EEW=32 or EEW=64.

Implicit: extension-support requirement exercised implicitly by which instructions the generated suite runs at all

vset_vstart

The configuration-setting instructions do not depend on vstart; they reset vstart to zero.

TODO: vset* with nonzero vstart; result unaffected and vstart reset to 0

vec_store_nonidempotent_no_update

Non-idempotent memory regions must not have been updated for indices equal to or greater than the element that caused a synchronous trap during a vector store instruction.

Untestable: no I/O devices defined in profile

UDB Parameters: None.

A.11.5. Vls

Table 122. Vls Instruction Coverpoints
Instruction vle8.v vle16.v vle32.v vle64.v vlseg2e8.v vlseg2e16.v vlseg2e32.v vlseg2e64.v vlseg3e8.v vlseg3e16.v vlseg3e32.v vlseg3e64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vd

x

x

x

x

lte30

lte30

lte30

lte30

lte29

lte29

lte29

lte29

cp_rs1

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

e8

e16

e32

e64

e8_emul4max

e16_emul4max

e32_emul4max

e64_emul4max

e8_emul2max

e16_emul2max

e32_emul2max

e64_emul2max

cr_vtype_agnostic

e8

e16

e32

e64

e8_emul4max

e16_emul4max

e32_emul4max

e64_emul4max

e8_emul2max

e16_emul2max

e32_emul2max

e64_emul2max

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

std_vec

x

x

x

x

x

x

x

x

x

x

x

Instruction vlseg4e8.v vlseg4e16.v vlseg4e32.v vlseg4e64.v vlseg5e8.v vlseg5e16.v vlseg5e32.v vlseg5e64.v vlseg6e8.v vlseg6e16.v vlseg6e32.v vlseg6e64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vd

lte28

lte28

lte28

lte28

lte27

lte27

lte27

lte27

lte26

lte26

lte26

lte26

cp_rs1

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

e8_emul2max

e16_emul2max

e32_emul2max

e64_emul2max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

cr_vtype_agnostic

e8_emul2max

e16_emul2max

e32_emul2max

e64_emul2max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

std_vec

x

x

x

x

x

x

x

x

x

x

x

Instruction vlseg7e8.v vlseg7e16.v vlseg7e32.v vlseg7e64.v vlseg8e8.v vlseg8e16.v vlseg8e32.v vlseg8e64.v vle8ff.v vle16ff.v vle32ff.v vle64ff.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vd

lte25

lte25

lte25

lte25

lte24

lte24

lte24

lte24

x

x

x

x

cp_rs1

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8

e16

e32

e64

cr_vtype_agnostic

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8

e16

e32

e64

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

std_vec

x

x

x

x

x

x

x

x

x

x

x

x

cp_custom_ffLS_update_vl

x

x

x

sew_ge16

cp_custom_ffLS

x

x

x

x

Instruction vlseg2e8ff.v vlseg2e16ff.v vlseg2e32ff.v vlseg2e64ff.v vlseg3e8ff.v vlseg3e16ff.v vlseg3e32ff.v vlseg3e64ff.v vlseg4e8ff.v vlseg4e16ff.v vlseg4e32ff.v vlseg4e64ff.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vd

lte30

lte30

lte30

lte30

lte29

lte29

lte29

lte29

lte28

lte28

lte28

lte28

cp_rs1

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

e8_emul4max

e16_emul4max

e32_emul4max

e64_emul4max

e8_emul2max

e16_emul2max

e32_emul2max

e64_emul2max

e8_emul2max

e16_emul2max

e32_emul2max

e64_emul2max

cr_vtype_agnostic

e8_emul4max

e16_emul4max

e32_emul4max

e64_emul4max

e8_emul2max

e16_emul2max

e32_emul2max

e64_emul2max

e8_emul2max

e16_emul2max

e32_emul2max

e64_emul2max

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

std_vec

x

x

x

x

x

x

x

x

x

x

x

cp_custom_ffLS_update_vl

x

x

sew_ge16

sew_ge32

x

sew_ge16

sew_ge64

x

sew_ge16

sew_ge32

sew_ge64

cp_custom_ffLS

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vlseg5e8ff.v vlseg5e16ff.v vlseg5e32ff.v vlseg5e64ff.v vlseg6e8ff.v vlseg6e16ff.v vlseg6e32ff.v vlseg6e64ff.v vlseg7e8ff.v vlseg7e16ff.v vlseg7e32ff.v vlseg7e64ff.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

EFFEW16

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vd

lte27

lte27

lte27

lte27

lte26

lte26

lte26

lte26

lte25

lte25

lte25

lte25

cp_rs1

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

cr_vtype_agnostic

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

std_vec

x

x

x

x

x

x

x

x

x

x

x

x

cp_custom_ffLS_update_vl

sew_ge16

sew_ge32

sew_ge64

sew_ge16

sew_ge32

sew_ge64

sew_ge16

sew_ge32

sew_ge64

cp_custom_ffLS

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vlseg8e8ff.v vlseg8e16ff.v vlseg8e32ff.v vlseg8e64ff.v vlse8.v vlse16.v vlse32.v vlse64.v vlsseg2e8.v vlsseg2e16.v vlsseg2e32.v vlsseg2e64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vd

lte24

lte24

lte24

lte24

x

x

x

x

lte30

lte30

lte30

lte30

cp_rs1

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

cp_rs2

x

x

x

x

x

x

x

x

cp_rs2_edges

ls_e8

ls_e16

ls_e32

ls_e64

ls_e8

ls_e16

ls_e32

ls_e64

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8

e16

e32

e64

e8_emul4max

e16_emul4max

e32_emul4max

e64_emul4max

cr_vtype_agnostic

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8

e16

e32

e64

e8_emul4max

e16_emul4max

e32_emul4max

e64_emul4max

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

std_vec

x

x

x

x

x

x

x

x

x

x

x

x

cp_custom_ffLS_update_vl

sew_ge16

sew_ge32

sew_ge64

cp_custom_ffLS

x

x

x

x

Instruction vlsseg3e8.v vlsseg3e16.v vlsseg3e32.v vlsseg3e64.v vlsseg4e8.v vlsseg4e16.v vlsseg4e32.v vlsseg4e64.v vlsseg5e8.v vlsseg5e16.v vlsseg5e32.v vlsseg5e64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vd

lte29

lte29

lte29

lte29

lte28

lte28

lte28

lte28

lte27

lte27

lte27

lte27

cp_rs1

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

cp_rs2

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs2_edges

ls_e8

ls_e16

ls_e32

ls_e64

ls_e8

ls_e16

ls_e32

ls_e64

ls_e8

ls_e16

ls_e32

ls_e64

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

e8_emul2max

e16_emul2max

e32_emul2max

e64_emul2max

e8_emul2max

e16_emul2max

e32_emul2max

e64_emul2max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

cr_vtype_agnostic

e8_emul2max

e16_emul2max

e32_emul2max

e64_emul2max

e8_emul2max

e16_emul2max

e32_emul2max

e64_emul2max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

std_vec

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vlsseg6e8.v vlsseg6e16.v vlsseg6e32.v vlsseg6e64.v vlsseg7e8.v vlsseg7e16.v vlsseg7e32.v vlsseg7e64.v vlsseg8e8.v vlsseg8e16.v vlsseg8e32.v vlsseg8e64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

EFFEW16

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vd

lte26

lte26

lte26

lte26

lte25

lte25

lte25

lte25

lte24

lte24

lte24

lte24

cp_rs1

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

cp_rs2

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs2_edges

ls_e8

ls_e16

ls_e32

ls_e64

ls_e8

ls_e16

ls_e32

ls_e64

ls_e8

ls_e16

ls_e32

ls_e64

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

cr_vtype_agnostic

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

std_vec

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vluxei8.v vluxei16.v vluxei32.v vluxei64.v vluxseg2ei8.v vluxseg2ei16.v vluxseg2ei32.v vluxseg2ei64.v vluxseg3ei8.v vluxseg3ei16.v vluxseg3ei32.v vluxseg3ei64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vd

x

x

x

x

lte30

lte30

lte30

lte30

lte29

lte29

lte29

lte29

cp_vs2

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs2_edges

ls

ls

ls

ls

ls

ls

ls

ls

ls

ls

ls

ls

cmp_vd_vs2

eew_eq_sew

eew_eq_sew

eew_eq_sew

eew_eq_sew

cp_rs1

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

e8

e16

e32

e64

e8_emul4max

e16_emul4max

e32_emul4max

e64_emul4max

e8_emul2max

e16_emul2max

e32_emul2max

e64_emul2max

cr_vtype_agnostic

e8

e16

e32

e64

e8_emul4max

e16_emul4max

e32_emul4max

e64_emul4max

e8_emul2max

e16_emul2max

e32_emul2max

e64_emul2max

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

std_vec

x

x

x

x

x

x

x

x

x

x

x

x

cp_custom_ls_indexed_truncated

x

x

x

cp_custom_indexed_emul_data_only

x

x

sew_ge16

sew_ge32

cp_custom_indexed_overlap

eew8

eew16

eew32

eew64

Instruction vluxseg4ei8.v vluxseg4ei16.v vluxseg4ei32.v vluxseg4ei64.v vluxseg5ei8.v vluxseg5ei16.v vluxseg5ei32.v vluxseg5ei64.v vluxseg6ei8.v vluxseg6ei16.v vluxseg6ei32.v vluxseg6ei64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vd

lte28

lte28

lte28

lte28

lte27

lte27

lte27

lte27

lte26

lte26

lte26

lte26

cp_vs2

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs2_edges

ls

ls

ls

ls

ls

ls

ls

ls

ls

ls

ls

ls

cp_rs1

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

e8_emul2max

e16_emul2max

e32_emul2max

e64_emul2max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

cr_vtype_agnostic

e8_emul2max

e16_emul2max

e32_emul2max

e64_emul2max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

std_vec

x

x

x

x

x

x

x

x

x

x

x

x

cp_custom_ls_indexed_truncated

x

x

x

cp_custom_indexed_emul_data_only

x

x

x

sew_ge16

Instruction vluxseg7ei8.v vluxseg7ei16.v vluxseg7ei32.v vluxseg7ei64.v vluxseg8ei8.v vluxseg8ei16.v vluxseg8ei32.v vluxseg8ei64.v vloxei8.v vloxei16.v vloxei32.v vloxei64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vd

lte25

lte25

lte25

lte25

lte24

lte24

lte24

lte24

x

x

x

x

cp_vs2

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs2_edges

ls

ls

ls

ls

ls

ls

ls

ls

ls

ls

ls

ls

cmp_vd_vs2

eew_eq_sew

eew_eq_sew

eew_eq_sew

eew_eq_sew

cp_rs1

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8

e16

e32

e64

cr_vtype_agnostic

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8

e16

e32

e64

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

std_vec

x

x

x

x

x

x

x

x

x

x

x

x

cp_custom_ls_indexed_truncated

x

x

x

cp_custom_indexed_emul_data_only

x

x

x

x

cp_custom_indexed_overlap

eew8

eew16

eew32

eew64

cp_custom_ordered_index_overlap

x

x

x

x

Instruction vloxseg2ei8.v vloxseg2ei16.v vloxseg2ei32.v vloxseg2ei64.v vloxseg3ei8.v vloxseg3ei16.v vloxseg3ei32.v vloxseg3ei64.v vloxseg4ei8.v vloxseg4ei16.v vloxseg4ei32.v vloxseg4ei64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vd

lte30

lte30

lte30

lte30

lte29

lte29

lte29

lte29

lte28

lte28

lte28

lte28

cp_vs2

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs2_edges

ls

ls

ls

ls

ls

ls

ls

ls

ls

ls

ls

ls

cp_rs1

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

e8_emul4max

e16_emul4max

e32_emul4max

e64_emul4max

e8_emul2max

e16_emul2max

e32_emul2max

e64_emul2max

e8_emul2max

e16_emul2max

e32_emul2max

e64_emul2max

cr_vtype_agnostic

e8_emul4max

e16_emul4max

e32_emul4max

e64_emul4max

e8_emul2max

e16_emul2max

e32_emul2max

e64_emul2max

e8_emul2max

e16_emul2max

e32_emul2max

e64_emul2max

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

std_vec

x

x

x

x

x

x

x

x

x

x

x

x

cp_custom_ls_indexed_truncated

x

x

x

cp_custom_indexed_emul_data_only

x

x

sew_ge16

sew_ge32

x

x

x

sew_ge16

cp_custom_ordered_index_overlap

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vloxseg5ei8.v vloxseg5ei16.v vloxseg5ei32.v vloxseg5ei64.v vloxseg6ei8.v vloxseg6ei16.v vloxseg6ei32.v vloxseg6ei64.v vloxseg7ei8.v vloxseg7ei16.v vloxseg7ei32.v vloxseg7ei64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vd

lte27

lte27

lte27

lte27

lte26

lte26

lte26

lte26

lte25

lte25

lte25

lte25

cp_vs2

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs2_edges

ls

ls

ls

ls

ls

ls

ls

ls

ls

ls

ls

ls

cp_rs1

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

cr_vtype_agnostic

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

std_vec

x

x

x

x

x

x

x

x

x

x

x

x

cp_custom_ls_indexed_truncated

x

x

x

cp_custom_ordered_index_overlap

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vloxseg8ei8.v vloxseg8ei16.v vloxseg8ei32.v vloxseg8ei64.v vse8.v vse16.v vse32.v vse64.v vsseg2e8.v vsseg2e16.v vsseg2e32.v vsseg2e64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vd

lte24

lte24

lte24

lte24

cp_vs3

x

x

x

x

lte30

lte30

lte30

lte30

cp_vs2

x

x

x

x

cp_vs2_edges

ls

ls

ls

ls

cp_rs1

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8

e16

e32

e64

e8_emul4max

e16_emul4max

e32_emul4max

e64_emul4max

cr_vtype_agnostic

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8

e16

e32

e64

e8_emul4max

e16_emul4max

e32_emul4max

e64_emul4max

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

std_vec

x

x

x

x

x

x

x

x

x

x

x

x

cp_custom_ls_indexed_truncated

x

cp_custom_indexed_emul_data_only

x

x

x

x

cp_custom_ordered_index_overlap

x

x

x

x

Instruction vsseg3e8.v vsseg3e16.v vsseg3e32.v vsseg3e64.v vsseg4e8.v vsseg4e16.v vsseg4e32.v vsseg4e64.v vsseg5e8.v vsseg5e16.v vsseg5e32.v vsseg5e64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs3

lte29

lte29

lte29

lte29

lte28

lte28

lte28

lte28

lte27

lte27

lte27

lte27

cp_rs1

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

e8_emul2max

e16_emul2max

e32_emul2max

e64_emul2max

e8_emul2max

e16_emul2max

e32_emul2max

e64_emul2max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

cr_vtype_agnostic

e8_emul2max

e16_emul2max

e32_emul2max

e64_emul2max

e8_emul2max

e16_emul2max

e32_emul2max

e64_emul2max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

std_vec

x

x

x

x

x

x

x

x

x

x

Instruction vsseg6e8.v vsseg6e16.v vsseg6e32.v vsseg6e64.v vsseg7e8.v vsseg7e16.v vsseg7e32.v vsseg7e64.v vsseg8e8.v vsseg8e16.v vsseg8e32.v vsseg8e64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

EFFEW16

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs3

lte26

lte26

lte26

lte26

lte25

lte25

lte25

lte25

lte24

lte24

lte24

lte24

cp_rs1

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

cr_vtype_agnostic

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

std_vec

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vsse8.v vsse16.v vsse32.v vsse64.v vssseg2e8.v vssseg2e16.v vssseg2e32.v vssseg2e64.v vssseg3e8.v vssseg3e16.v vssseg3e32.v vssseg3e64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs3

x

x

x

x

lte30

lte30

lte30

lte30

lte29

lte29

lte29

lte29

cp_rs1

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

cp_rs2

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs2_edges

ls_e8

ls_e16

ls_e32

ls_e64

ls_e8

ls_e16

ls_e32

ls_e64

ls_e8

ls_e16

ls_e32

ls_e64

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

e8

e16

e32

e64

e8_emul4max

e16_emul4max

e32_emul4max

e64_emul4max

e8_emul2max

e16_emul2max

e32_emul2max

e64_emul2max

cr_vtype_agnostic

e8

e16

e32

e64

e8_emul4max

e16_emul4max

e32_emul4max

e64_emul4max

e8_emul2max

e16_emul2max

e32_emul2max

e64_emul2max

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

std_vec

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vssseg4e8.v vssseg4e16.v vssseg4e32.v vssseg4e64.v vssseg5e8.v vssseg5e16.v vssseg5e32.v vssseg5e64.v vssseg6e8.v vssseg6e16.v vssseg6e32.v vssseg6e64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs3

lte28

lte28

lte28

lte28

lte27

lte27

lte27

lte27

lte26

lte26

lte26

lte26

cp_rs1

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

cp_rs2

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs2_edges

ls_e8

ls_e16

ls_e32

ls_e64

ls_e8

ls_e16

ls_e32

ls_e64

ls_e8

ls_e16

ls_e32

ls_e64

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

e8_emul2max

e16_emul2max

e32_emul2max

e64_emul2max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

cr_vtype_agnostic

e8_emul2max

e16_emul2max

e32_emul2max

e64_emul2max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

std_vec

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vssseg7e8.v vssseg7e16.v vssseg7e32.v vssseg7e64.v vssseg8e8.v vssseg8e16.v vssseg8e32.v vssseg8e64.v vsuxei8.v vsuxei16.v vsuxei32.v vsuxei64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs3

lte25

lte25

lte25

lte25

lte24

lte24

lte24

lte24

x

x

x

x

cp_vs2

x

x

x

x

cp_vs2_edges

ls

ls

ls

ls

cmp_vs3_vs2

eew_eq_sew

eew_eq_sew

eew_eq_sew

eew_eq_sew

cp_rs1

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

cp_rs2

x

x

x

x

x

x

x

x

cp_rs2_edges

ls_e8

ls_e16

ls_e32

ls_e64

ls_e8

ls_e16

ls_e32

ls_e64

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8

e16

e32

e64

cr_vtype_agnostic

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8

e16

e32

e64

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

std_vec

x

x

x

x

x

x

x

x

x

x

x

x

cp_custom_ls_indexed_truncated

x

Instruction vsuxseg2ei8.v vsuxseg2ei16.v vsuxseg2ei32.v vsuxseg2ei64.v vsuxseg3ei8.v vsuxseg3ei16.v vsuxseg3ei32.v vsuxseg3ei64.v vsuxseg4ei8.v vsuxseg4ei16.v vsuxseg4ei32.v vsuxseg4ei64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs3

lte30

lte30

lte30

lte30

lte29

lte29

lte29

lte29

lte28

lte28

lte28

lte28

cp_vs2

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs2_edges

ls

ls

ls

ls

ls

ls

ls

ls

ls

ls

ls

ls

cmp_vs3_vs2

eew_eq_sew_lte30

eew_eq_sew_lte30

eew_eq_sew_lte30

eew_eq_sew_lte30

eew_eq_sew_lte29

eew_eq_sew_lte29

eew_eq_sew_lte29

eew_eq_sew_lte29

eew_eq_sew_lte28

eew_eq_sew_lte28

eew_eq_sew_lte28

eew_eq_sew_lte28

cp_rs1

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

e8_emul4max

e16_emul4max

e32_emul4max

e64_emul4max

e8_emul2max

e16_emul2max

e32_emul2max

e64_emul2max

e8_emul2max

e16_emul2max

e32_emul2max

e64_emul2max

cr_vtype_agnostic

e8_emul4max

e16_emul4max

e32_emul4max

e64_emul4max

e8_emul2max

e16_emul2max

e32_emul2max

e64_emul2max

e8_emul2max

e16_emul2max

e32_emul2max

e64_emul2max

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

std_vec

x

x

x

x

x

x

x

x

x

x

x

x

cp_custom_ls_indexed_truncated

x

x

x

cp_custom_indexed_emul_data_only

x

x

sew_ge16

sew_ge32

x

x

x

sew_ge16

Instruction vsuxseg5ei8.v vsuxseg5ei16.v vsuxseg5ei32.v vsuxseg5ei64.v vsuxseg6ei8.v vsuxseg6ei16.v vsuxseg6ei32.v vsuxseg6ei64.v vsuxseg7ei8.v vsuxseg7ei16.v vsuxseg7ei32.v vsuxseg7ei64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs3

lte27

lte27

lte27

lte27

lte26

lte26

lte26

lte26

lte25

lte25

lte25

lte25

cp_vs2

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs2_edges

ls

ls

ls

ls

ls

ls

ls

ls

ls

ls

ls

ls

cmp_vs3_vs2

eew_eq_sew_lte27

eew_eq_sew_lte27

eew_eq_sew_lte27

eew_eq_sew_lte27

eew_eq_sew_lte26

eew_eq_sew_lte26

eew_eq_sew_lte26

eew_eq_sew_lte26

eew_eq_sew_lte25

eew_eq_sew_lte25

eew_eq_sew_lte25

eew_eq_sew_lte25

cp_rs1

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

cr_vtype_agnostic

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

std_vec

x

x

x

x

x

x

x

x

x

x

x

x

cp_custom_ls_indexed_truncated

x

x

x

Instruction vsuxseg8ei8.v vsuxseg8ei16.v vsuxseg8ei32.v vsuxseg8ei64.v vsoxei8.v vsoxei16.v vsoxei32.v vsoxei64.v vsoxseg2ei8.v vsoxseg2ei16.v vsoxseg2ei32.v vsoxseg2ei64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs3

lte24

lte24

lte24

lte24

x

x

x

x

lte30

lte30

lte30

lte30

cp_vs2

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs2_edges

ls

ls

ls

ls

ls

ls

ls

ls

ls

ls

ls

ls

cmp_vs3_vs2

eew_eq_sew_lte24

eew_eq_sew_lte24

eew_eq_sew_lte24

eew_eq_sew_lte24

eew_eq_sew

eew_eq_sew

eew_eq_sew

eew_eq_sew

eew_eq_sew_lte30

eew_eq_sew_lte30

eew_eq_sew_lte30

eew_eq_sew_lte30

cp_rs1

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8

e16

e32

e64

e8_emul4max

e16_emul4max

e32_emul4max

e64_emul4max

cr_vtype_agnostic

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8

e16

e32

e64

e8_emul4max

e16_emul4max

e32_emul4max

e64_emul4max

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

std_vec

x

x

x

x

x

x

x

x

x

x

x

x

cp_custom_ls_indexed_truncated

x

x

x

cp_custom_indexed_emul_data_only

x

x

x

x

x

x

sew_ge16

sew_ge32

cp_custom_ordered_index_overlap

x

x

x

x

x

x

x

x

Instruction vsoxseg3ei8.v vsoxseg3ei16.v vsoxseg3ei32.v vsoxseg3ei64.v vsoxseg4ei8.v vsoxseg4ei16.v vsoxseg4ei32.v vsoxseg4ei64.v vsoxseg5ei8.v vsoxseg5ei16.v vsoxseg5ei32.v vsoxseg5ei64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs3

lte29

lte29

lte29

lte29

lte28

lte28

lte28

lte28

lte27

lte27

lte27

lte27

cp_vs2

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs2_edges

ls

ls

ls

ls

ls

ls

ls

ls

ls

ls

ls

ls

cmp_vs3_vs2

eew_eq_sew_lte29

eew_eq_sew_lte29

eew_eq_sew_lte29

eew_eq_sew_lte29

eew_eq_sew_lte28

eew_eq_sew_lte28

eew_eq_sew_lte28

eew_eq_sew_lte28

eew_eq_sew_lte27

eew_eq_sew_lte27

eew_eq_sew_lte27

eew_eq_sew_lte27

cp_rs1

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

e8_emul2max

e16_emul2max

e32_emul2max

e64_emul2max

e8_emul2max

e16_emul2max

e32_emul2max

e64_emul2max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

cr_vtype_agnostic

e8_emul2max

e16_emul2max

e32_emul2max

e64_emul2max

e8_emul2max

e16_emul2max

e32_emul2max

e64_emul2max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

std_vec

x

x

x

x

x

x

x

x

x

x

x

x

cp_custom_ls_indexed_truncated

x

x

x

cp_custom_indexed_emul_data_only

x

x

x

sew_ge16

cp_custom_ordered_index_overlap

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vsoxseg6ei8.v vsoxseg6ei16.v vsoxseg6ei32.v vsoxseg6ei64.v vsoxseg7ei8.v vsoxseg7ei16.v vsoxseg7ei32.v vsoxseg7ei64.v vsoxseg8ei8.v vsoxseg8ei16.v vsoxseg8ei32.v vsoxseg8ei64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs3

lte26

lte26

lte26

lte26

lte25

lte25

lte25

lte25

lte24

lte24

lte24

lte24

cp_vs2

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs2_edges

ls

ls

ls

ls

ls

ls

ls

ls

ls

ls

ls

ls

cmp_vs3_vs2

eew_eq_sew_lte26

eew_eq_sew_lte26

eew_eq_sew_lte26

eew_eq_sew_lte26

eew_eq_sew_lte25

eew_eq_sew_lte25

eew_eq_sew_lte25

eew_eq_sew_lte25

eew_eq_sew_lte24

eew_eq_sew_lte24

eew_eq_sew_lte24

eew_eq_sew_lte24

cp_rs1

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

cr_vtype_agnostic

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

e8_emul1max

e16_emul1max

e32_emul1max

e64_emul1max

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

std_vec

x

x

x

x

x

x

x

x

x

x

x

x

cp_custom_ls_indexed_truncated

x

x

x

cp_custom_indexed_emul_data_only

x

x

x

x

cp_custom_ordered_index_overlap

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vl1re8.v vl2re8.v vl4re8.v vl8re8.v vl1re16.v vl2re16.v vl4re16.v vl8re16.v vl1re32.v vl2re32.v vl4re32.v vl8re32.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vd

x

emul2

emul4

emul8

x

emul2

emul4

emul8

x

emul2

emul4

emul8

cp_rs1

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

cr_vl_lmul

x

lmul4max

lmul2max

lmul1max

x

lmul4max

lmul2max

lmul1max

x

lmul4max

lmul2max

lmul1max

cr_vtype_agnostic

nomask

lmul4max_nomask

lmul2max_nomask

lmul1max_nomask

nomask

lmul4max_nomask

lmul2max_nomask

lmul1max_nomask

nomask

lmul4max_nomask

lmul2max_nomask

lmul1max_nomask

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

std_vec

x

x

x

x

x

x

x

x

x

x

x

x

cp_custom_vwholeRegLS_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_custom_vwholeRegLS_lmul

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vl1re64.v vl2re64.v vl4re64.v vl8re64.v vs1r.v vs2r.v vs4r.v vs8r.v vsm.v vlm.v

RV32

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

cp_vd

x

emul2

emul4

emul8

x

cp_vs3

x

emul2

emul4

emul8

x

cp_rs1

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

cr_vl_lmul

x

lmul4max

lmul2max

lmul1max

x

x

x

x

nomask

nomask

cr_vtype_agnostic

nomask

lmul4max_nomask

lmul2max_nomask

lmul1max_nomask

nomask

nomask

nomask

nomask

nomask

nomask

cp_vl_0

x

x

x

x

x

x

x

x

x

x

std_vec

x

x

x

x

x

x

x

x

x

x

cp_custom_vwholeRegLS_vill

x

x

x

x

x

x

x

x

cp_custom_vwholeRegLS_lmul

x

x

x

x

x

x

x

x

cp_custom_maskLS

x

x

Table 123. Vls Normative Rules
Normative Rule Rule Text Coverpoints

vector_load_store_semantics

Vector loads and stores move values between vector registers and memory.

Vls16_vle8_v_cg/cp_vd, Vls8_vle8_v_cg/cr_vl_lmul_e8_sew8, Vls8_vse8_v_cg/cr_vl_lmul_e8_sew8, Vls64_vle64_v_cg/cr_vl_lmul_e64_sew64, Vls64_vse64_v_cg/cr_vl_lmul_e64_sew64

vector_masked_memory_access

Vector loads and stores can be masked, and they only access memory or raise exceptions for active elements.

Vls16_vle8_v_cg/cp_masking_edges

vector_ls_strided_eew

Vector memory unit-stride and constant-stride operations directly encode EEW of the data to be transferred statically in the instruction to reduce the number of vtype changes when accessing memory in a mixed-width routine.

{Vls16_vlse16_v_cg,Vls32_vlse32_v_cg,Vls64_vlse64_v_cg}/cp_asm_count

vector_ls_ins_req

Implementations must provide vector loads and stores with EEWs corresponding to all supported SEW settings.

{Vls8_vle8_v_cg,Vls16_vle16_v_cg,Vls32_vle32_v_cg,Vls64_vle64_v_cg}/cp_asm_count

vector_ls_ins_rsv

Vector load/store encodings for unsupported EEW widths are reserved.

SsstrictV_vle8_v_cg/cp_ssstrictv_ls_eew_lt_sewmin

vector_ls_eew_rsv

If the implementation does not support the EEW of the offset elements, the instruction is reserved.

ExceptionsVls_vloxei16_v_cg/cp_exceptionsv_index_eew16

vector_ls_nf_op

The nf[2:0] field encodes the number of fields in each segment. For regular vector loads and stores, nf=0, indicating that a single value is moved between a vector register group and memory at each element position. Larger values in the nf field are used to access multiple contiguous fields within a segment as described below in .

Vls16_vlseg2e8_v_cg/cp_asm_count

vector_ls_emul_rsv

If the EMUL would be out of range (EMUL>8 or EMUL<1/8), the instruction encoding is reserved.

ExceptionsVls_vloxei16_v_cg/cp_exceptionsv_index_eew16

vector_ls_mew_rsv

The mew bit (inst[28]) when set is expected to be used to encode expanded memory sizes of 128 bits and above, but these encodings are currently reserved.

SsstrictV_vle8_v_cg/cp_ssstrictv_ls_mew_reserved

emul_nfields_rsv

The EMUL setting must be such that EMUL * NFIELDS ≤ 8, otherwise the instruction encoding is reserved.

SsstrictV_vlseg2e8_v_cg/cp_ssstrictv_ls_seg_vd_overflow

vector_ls_seg_indexed_emul_nfields_val

The EMUL * NFIELDS ≤ 8 constraint applies to the data vector register group.

SsstrictV_vlseg2e8_v_cg/cp_ssstrictv_ls_seg_vd_overflow

vector_ls_seg_wholereg_eew

The load instructions have the element width encoded in the mew and width fields following the pattern of regular unit-stride loads. EEW is computed as EEW=min(VLEN*NFIELDS, EEW_encoded).

Vls16_vl1re16_v_cg/cp_custom_vwholeRegLS_lmul, Vls16_vl1re8_v_cg/cp_asm_count, Vls16_vl1re16_v_cg/cp_asm_count, Vls16_vl1re32_v_cg/cp_asm_count, Vls16_vl1re64_v_cg/cp_asm_count, Vls16_vl2re8_v_cg/cp_asm_count, Vls16_vl2re16_v_cg/cp_asm_count, Vls16_vl2re32_v_cg/cp_asm_count, Vls16_vl2re64_v_cg/cp_asm_count, Vls16_vl4re8_v_cg/cp_asm_count, Vls16_vl4re16_v_cg/cp_asm_count, Vls16_vl4re32_v_cg/cp_asm_count, Vls16_vl4re64_v_cg/cp_asm_count, Vls16_vl8re8_v_cg/cp_asm_count, Vls16_vl8re16_v_cg/cp_asm_count, Vls16_vl8re32_v_cg/cp_asm_count, Vls16_vl8re64_v_cg/cp_asm_count

vector_masked_inactive_behavior

Masked vector loads do not update inactive elements in the destination vector register group, unless masked agnostic is specified (vtype.⁠VMA=1).

Vls8_vle8_v_cg/cr_vtype_agnostic_e8, Vls16_vle16_v_cg/cr_vtype_agnostic_e16, Vls32_vle32_v_cg/cr_vtype_agnostic_e32, Vls64_vle64_v_cg/cr_vtype_agnostic_e64

UDB Parameters: None.

A.11.6. Vf

Table 124. Vf Instruction Coverpoints
Instruction vfadd.vv vfadd.vf vfwadd.vv vfwadd.vf vfwadd.wv vfwadd.wf vfsub.vv vfsub.vf vfwsub.vv vfwsub.vf vfwsub.wv vfwsub.wf

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vd

x

x

emul2

emul2

emul2

emul2

x

x

emul2

emul2

emul2

emul2

cp_vs2

x

x

x

x

emul2

emul2

x

x

x

x

emul2

emul2

cp_vs1

x

x

x

x

x

x

cp_fs1

x

x

x

x

x

x

cmp_vd_vs2

x

x

emul2

emul2

x

x

emul2

emul2

cmp_vd_vs1

x

x

cmp_vs1_vs2

x

x

x

x

cmp_vd_vs1_vs2

x

x

cp_vs2_edges

f

f

f

f

f_emul2

f_emul2

f

f

f

f

f_emul2

f_emul2

cp_vs1_edges

f

f

f

f

f

f

cr_vs2_vs1_edges

f

f

fwv

f

f

fwv

cp_fs1_edges

v

v

v

v

v

v

cr_vs2_fs1_edges

x

x

wf

x

x

wf

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

x

x

lmul4max

lmul4max

lmul4max

lmul4max

x

x

lmul4max

lmul4max

lmul4max

lmul4max

cr_vtype_agnostic

x

x

lmul4max

lmul4max

lmul4max

lmul4max

x

x

lmul4max

lmul4max

lmul4max

lmul4max

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

cp_csr_fflags

von

von

vn

vn

vn

vn

von

von

vn

vn

vn

vn

cp_csr_frm

v

v

v

v

v

v

v

v

v

v

v

v

std_vec

x

x

x

x

x

x

x

x

x

x

x

x

cp_custom_vfp_NaN_input

x

x

x

x

w

w

x

x

x

x

w

w

cp_custom_vfp_flags_set

x

x

x

x

x

x

x

x

x

x

x

x

cp_custom_vfp_flags

nv_nx_of

nv_nx_of

nv

nv

nv_nx

nv_nx

nv_nx

nv_nx

nv

nv

nv_nx

nv_nx

cp_custom

wvv_all

wvx_all

wwv_all

wvv_all

wvx_all

wwv_all

Instruction vfrsub.vf vfmul.vv vfmul.vf vfwmul.vv vfwmul.vf vfdiv.vv vfdiv.vf vfrdiv.vf vfmacc.vv vfmacc.vf vfnmacc.vv vfnmacc.vf

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vd

x

x

x

emul2

emul2

x

x

x

x

x

x

x

cp_vs2

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs1

x

x

x

x

x

cp_fs1

x

x

x

x

x

x

x

cmp_vd_vs2

x

x

x

x

x

x

x

x

x

x

cmp_vd_vs1

x

x

x

x

cmp_vs1_vs2

x

x

x

x

x

cmp_vd_vs1_vs2

x

x

x

x

cp_vs2_edges

f

f

f

f

f

f

f

f

f

f

f

f

cp_vs1_edges

f

f

f

f

f

cr_vs2_vs1_edges

f

f

f

f

f

cp_fs1_edges

v

v

v

v

v

v

v

cr_vs2_fs1_edges

x

x

x

x

x

x

x

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

x

x

x

lmul4max

lmul4max

x

x

x

x

x

x

x

cr_vtype_agnostic

x

x

x

lmul4max

lmul4max

x

x

x

x

x

x

x

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

cp_csr_fflags

von

voun

voun

v

v

vdoun

vdoun

vdoun

voun

voun

voun

voun

cp_csr_frm

v

v

v

v

v

v

v

v

v

v

v

v

std_vec

x

x

x

x

x

x

x

x

x

x

x

x

cp_custom_vfp_NaN_input

x

x

x

x

x

x

x

x

x

x

x

x

cp_custom_vfp_flags_set

x

x

x

x

x

x

x

x

x

x

x

x

cp_custom_vfp_flags

nv_nx

nv_nx_of_uf

nv_nx_of_uf

nv

nv

nv_nx_dz

nv_nx_dz

nv_nx_dz

nv_nx

nv_nx

nv_nx

nv_nx

cp_custom

wvv_all

wvx_all

Instruction vfmsac.vv vfmsac.vf vfnmsac.vv vfnmsac.vf vfmadd.vv vfmadd.vf vfnmadd.vv vfnmadd.vf vfmsub.vv vfmsub.vf vfnmsub.vv vfnmsub.vf

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vd

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs2

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs1

x

x

x

x

x

x

cp_fs1

x

x

x

x

x

x

cmp_vd_vs2

x

x

x

x

x

x

x

x

x

x

x

x

cmp_vd_vs1

x

x

x

x

x

x

cmp_vs1_vs2

x

x

x

x

x

x

cmp_vd_vs1_vs2

x

x

x

x

x

x

cp_vs2_edges

f

f

f

f

f

f

f

f

f

f

f

f

cp_vs1_edges

f

f

f

f

f

f

cr_vs2_vs1_edges

f

f

f

f

f

f

cp_fs1_edges

v

v

v

v

v

v

cr_vs2_fs1_edges

x

x

x

x

x

x

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

x

x

x

x

x

x

x

x

x

x

x

x

cr_vtype_agnostic

x

x

x

x

x

x

x

x

x

x

x

x

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

cp_csr_fflags

voun

voun

voun

voun

voun

voun

voun

voun

voun

voun

voun

voun

cp_csr_frm

v

v

v

v

v

v

v

v

v

v

v

v

std_vec

x

x

x

x

x

x

x

x

x

x

x

x

cp_custom_vfp_NaN_input

x

x

x

x

x

x

x

x

x

x

x

x

cp_custom_vfp_flags_set

x

x

x

x

x

x

x

x

x

x

x

x

cp_custom_vfp_flags

nv_nx

nv_nx

nv_nx

nv_nx

nv_nx

nv_nx

nv_nx

nv_nx

nv_nx

nv_nx

nv_nx

nv_nx

Instruction vfwmacc.vv vfwmacc.vf vfwnmacc.vv vfwnmacc.vf vfwmsac.vv vfwmsac.vf vfwnmsac.vv vfwnmsac.vf vfsqrt.v vfrsqrt7.v vfrec7.v vfmin.vv

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vd

emul2

emul2

emul2

emul2

emul2

emul2

emul2

emul2

x

x

x

x

cp_vs2

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs1

x

x

x

x

x

cp_fs1

x

x

x

x

cmp_vd_vs2

x

x

x

x

cmp_vd_vs1

x

cmp_vs1_vs2

x

x

x

x

x

cmp_vd_vs1_vs2

x

cp_vs2_edges

f

f

f

f

f

f

f

f

f

f

f

f

cp_vs1_edges

f

f

f

f

f

cr_vs2_vs1_edges

f

f

f

f

f

cp_fs1_edges

v

v

v

v

cr_vs2_fs1_edges

x

x

x

x

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

lmul4max

lmul4max

lmul4max

lmul4max

lmul4max

lmul4max

lmul4max

lmul4max

x

x

x

x

cr_vtype_agnostic

lmul4max

lmul4max

lmul4max

lmul4max

lmul4max

lmul4max

lmul4max

lmul4max

x

x

x

x

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

cp_csr_fflags

vn

vn

vn

vn

vn

vn

vn

vn

vn

vd

vdon

v

cp_csr_frm

v

v

v

v

v

v

v

v

v

v

v

std_vec

x

x

x

x

x

x

x

x

x

x

x

x

cp_custom_FpRecSqrtEst_flag_edges

x

cp_custom_FpRecipEst_flag_edges

x

cp_custom_FpRecSqrtEst_edges

x

cp_custom_FpRecipEst_edges

x

cp_custom_vfp_NaN_input

x

x

x

x

x

x

x

x

x

x

x

x

cp_custom_vfp_flags_set

x

x

x

x

x

x

x

x

x

x

x

x

cp_custom_vfp_flags

nv_nx

nv_nx

nv_nx

nv_nx

nv_nx

nv_nx

nv_nx

nv_nx

nv_nx

nv_dz

nv_dz

nv

cp_custom_vfp_flags_inactive_not_set

x

Instruction vfmin.vf vfmax.vv vfmax.vf vfsgnj.vv vfsgnj.vf vfsgnjn.vv vfsgnjn.vf vfsgnjx.vv vfsgnjx.vf vfredosum.vs vfwredosum.vs vfredusum.vs

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vd

x

x

x

x

x

x

x

x

x

x

emul2

x

cp_vs2

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs1

x

x

x

x

x

emul2

x

cp_fs1

x

x

x

x

x

cmp_vd_vs2

x

x

x

x

x

x

x

x

x

x

x

cmp_vd_vs1

x

x

x

x

x

emul2

x

cmp_vs1_vs2

x

x

x

x

x

x

cmp_vd_vs1_vs2

x

x

x

x

x

x

cp_vs2_edges

f

f

f

f

f

f

f

f

f

f

f

f

cp_vs1_edges

f

f

f

f

f

f_emul2

f

cr_vs2_vs1_edges

f

f

f

f

f

fwred

f

cp_fs1_edges

v

v

v

v

v

cr_vs2_fs1_edges

x

x

x

x

x

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

x

x

x

x

x

x

x

x

x

x

lmul4max

x

cr_vtype_agnostic

x

x

x

x

x

x

x

x

x

x

lmul4max

x

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

cp_csr_fflags

v

v

v

von

vn

von

cp_csr_frm

v

v

v

std_vec

x

x

x

x

x

x

x

x

x

x

x

x

cp_custom_vfp_NaN_input

x

x

x

x

x

x

x

x

x

x

x

x

cp_custom_vfredosum_ordered_sum

x

cp_custom_vfredosum_NAN_vl0

x

x

cp_custom_vfp_flags_set

x

x

x

x

x

x

cp_custom_vfp_flags

nv

nv

nv

nv_nx

nv_nx

nv_nx

cp_custom

wred

Instruction vfwredusum.vs vfredmax.vs vfredmin.vs vmfeq.vv vmfeq.vf vmfne.vv vmfne.vf vmflt.vv vmflt.vf vmfle.vv vmfle.vf vmfgt.vf

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vd

emul2

x

x

x

x

x

x

x

x

x

x

x

cp_vs2

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs1

emul2

x

x

x

x

x

x

cp_fs1

x

x

x

x

x

cmp_vd_vs2

x

x

cmp_vd_vs1

emul2

x

x

cmp_vs1_vs2

x

x

x

x

x

x

cmp_vd_vs1_vs2

x

x

cp_vs2_edges

f

f

f

f

f

f

f

f

f

f

f

f

cp_vs1_edges

f_emul2

f

f

f

f

f

f

cr_vs2_vs1_edges

fwred

f

f

f

f

f

f

cp_fs1_edges

v

v

v

v

v

cr_vs2_fs1_edges

x

x

x

x

x

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

lmul4max

x

x

x

x

x

x

x

x

x

x

x

cr_vtype_agnostic

lmul4max

x

x

x

x

x

x

x

x

x

x

x

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

cp_csr_fflags

vn

v

v

v

v

v

v

v

v

v

v

v

cp_csr_frm

v

std_vec

x

x

x

x

x

x

x

x

x

x

x

x

cp_custom_vfp_NaN_input

x

x

x

x

x

x

x

x

x

x

x

x

cp_custom_vfp_flags_set

x

x

x

x

x

x

x

x

x

x

x

x

cp_custom_vfp_flags

nv_nx

nv

nv

nv

nv

nv

nv

nv

nv

nv

nv

nv

cp_custom

wred

Instruction vmfge.vf vfmerge.vfm vfmv.v.f vfmv.f.s vfmv.s.f vfslide1up.vf vfslide1down.vf vfcvt.xu.f.v vfwcvt.xu.f.v vfncvt.xu.f.w vfcvt.x.f.v vfwcvt.x.f.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vd

x

nv0

x

x

x

x

x

emul2

x

x

emul2

cp_fd

x

cp_vs2

x

nv0

x

x

x

x

x

emul2

x

x

cp_fs1

x

x

x

x

x

x

cmp_vd_vs2

nv0

x

x

x

cp_vs2_edges

f

f

f

f

f

f

f

f_emul2

f

f

cp_fs1_edges

v

v

v

v

v

v

cr_vs2_fs1_edges

x

x

x

x

cp_masking_edges

x

x

x

x

x

x

x

x

x

cr_vl_lmul

x

x

nomask

nomask

nomask

x

x

x

lmul4max

lmul4max

x

lmul4max

cr_vtype_agnostic

x

x

nomask

nomask

nomask

x

x

x

lmul4max

lmul4max

x

lmul4max

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

cp_csr_fflags

v

vn

vn

vn

vn

vn

cp_csr_frm

v

v

v

v

v

std_vec

x

x

x

x

x

x

x

x

x

x

x

x

cp_custom_vfp_state

x

cp_custom_vfp_NaN_input

x

x

x

x

x

x

x

w

x

x

cp_custom_fmv_sf_vd_all_lmul

x

cp_custom_fmv_fs_vs2_all_lmul

x

cp_custom_vfp_flags_set

x

x

x

x

x

x

cp_custom_vfp_flags

nv

nv_nx

nv_nx

nv_nx

nv_nx

nv_nx

cp_custom

shift_wi

Instruction vfncvt.x.f.w vfcvt.rtz.xu.f.v vfwcvt.rtz.xu.f.v vfncvt.rtz.xu.f.w vfcvt.rtz.x.f.v vfwcvt.rtz.x.f.v vfncvt.rtz.x.f.w vfcvt.f.xu.v vfwcvt.f.xu.v vfncvt.f.xu.w vfcvt.f.x.v vfwcvt.f.x.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vd

x

x

emul2

x

x

emul2

x

x

emul2

x

x

emul2

cp_vs2

emul2

x

x

emul2

x

x

emul2

x

x

emul2

x

x

cmp_vd_vs2

x

x

x

x

cp_vs2_edges

f_emul2

f

f

f_emul2

f

f

f_emul2

f

f

f_emul2

f

f

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

lmul4max

x

lmul4max

lmul4max

x

lmul4max

lmul4max

x

lmul4max

lmul4max

x

lmul4max

cr_vtype_agnostic

lmul4max

x

lmul4max

lmul4max

x

lmul4max

lmul4max

x

lmul4max

lmul4max

x

lmul4max

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

cp_csr_fflags

vn

vn

vn

vn

vn

vn

vn

n

n

n

cp_csr_frm

v

v

v

v

std_vec

x

x

x

x

x

x

x

x

x

x

x

x

cp_custom_vfp_NaN_input

w

x

x

w

x

x

w

x

x

w

x

x

cp_custom_vfp_flags_set

x

x

x

x

x

x

x

cp_custom_vfp_flags

nv_nx

nv_nx

nv_nx

nv_nx

nv_nx

nv_nx

nv_nx

nx

nx

nx

cp_custom

shift_wi

shift_wi

shift_wi

shift_wi

Instruction vfncvt.f.x.w vfwcvt.f.f.v vfncvt.f.f.w vfncvt.rod.f.f.w vfclass.v

RV32

x

x

x

x

x

RV64

x

x

x

x

x

EFFEW16

x

x

x

x

EFFEW32

x

x

x

x

EFFEW64

x

cp_asm_count

x

x

x

x

x

cp_vd

x

emul2

x

x

x

cp_vs2

emul2

x

emul2

emul2

x

cmp_vd_vs2

x

cp_vs2_edges

f_emul2

f

f_emul2

f_emul2

f

cp_masking_edges

x

x

x

x

x

cr_vl_lmul

lmul4max

lmul4max

lmul4max

lmul4max

x

cr_vtype_agnostic

lmul4max

lmul4max

lmul4max

lmul4max

x

cp_vl_0

x

x

x

x

x

cp_csr_fflags

n

v

voun

voun

cp_csr_frm

v

v

std_vec

x

x

x

x

x

cp_custom_vfncvt_rup_overflow

x

x

cp_custom_vfp_NaN_input

w

x

w

w

x

cp_custom_vfclass_onehot

x

cp_custom_vfncvt_rod_overflow

x

cp_custom_vfp_flags_set

x

x

x

cp_custom_vfp_flags

nx

nv

nv_nx

nv_nx

cp_custom

shift_wi

shift_wi

shift_wi

Table 125. Vf Normative Rules
Normative Rule Rule Text Coverpoints

vmfeq_vmfne_vmflt_vmfle_vmfgt_vmfge_vd_eq_v0

The destination mask vector register may be the same as the source vector mask register (v0).

SsstrictV_vmfeq_vv_cg/cp_ssstrictv_masking_vd_eq_v0

vmflt_vmfle_vmfgt_vmfge_sqnan_invalid

VMFLT, VMFLE, VMFGT, and VMFGE raise the invalid operation exception on both signaling and quiet NaN inputs.

Vf16_vmflt_vv_cg/cp_custom_vfp_flags_nv

vmfne_vdval1_nan

VMFNE writes 1 to the destination element when either operand is NaN,

Vf16_vmfeq_vv_cg/cp_custom_vfp_NaN_input

vmfeq_vmflt_vmfle_vmfgt_vmfge_vdval0_nan

whereas the other compares write 0 when either operand is NaN.

Vf16_vmfeq_vv_cg/cp_custom_vfp_NaN_input

vfmv_vs2_nv0_rsv

The instruction must have the vs2 field set to v0, with all other values for vs2 reserved.

SsstrictV_vfmv_v_f_cg/cp_ssstrictv_vfmv_vs2_not_v0_reserved

vfmv-s-f_masked_rsv

The encodings corresponding to the masked versions (vm=0) of VFMV.F.S and VFMV.S.F are reserved.

SsstrictV_vfmv_s_f_cg/cp_ssstrictv_vfmv_fs_sf_vm0_reserved

V_dependent_F_D

The V extension depends upon the F and D extensions, and implements all vector floating-point instructions (sec-vector-float) for floating-point operands with EEW=32 or EEW=64 (including widening instructions and conversions between FP32 and FP64).

Implicit: the F and D dependency is satisfied by the configuration under test; the vector floating-point tests cannot run without it

vf_requires_vx

Vector floating-point instructions require the presence of base scalar floating-point extensions corresponding to the supported vector floating-point element widths.

Implicit: the vector floating-point tests cannot run unless the scalar floating-point extensions are present

V_fp_reductions

Vector single-width floating-point reductions (sec-vector-float-reduce) for EEW=32 and EEW=64 are supported as well as widening reductions from FP32 to FP64.

Vf32_vfredosum_vs_cg/cp_asm_count, Vf64_vfredosum_vs_cg/cp_asm_count, Vf32_vfwredosum_vs_cg/cp_asm_count, Vf32_vfwredusum_vs_cg/cp_asm_count

Zve32f_instr_perm

Zve32f supports all vector floating-point permutation instructions (sec-vector-float-permute) for floating-point operands with EEW=32.

Vf32_vfmv_f_s_cg/cp_asm_count, Vf32_vfmv_s_f_cg/cp_asm_count, Vf32_vfslide1up_vf_cg/cp_asm_count, Vf32_vfslide1down_vf_cg/cp_asm_count

Zve64d_instr_perm

Zve64d supports all vector floating-point permutation instructions (sec-vector-float-permute) for floating-point operands with EEW=32 or EEW=64.

Vf64_vfmv_f_s_cg/cp_asm_count, Vf64_vfmv_s_f_cg/cp_asm_count, Vf64_vfslide1up_vf_cg/cp_asm_count, Vf64_vfslide1down_vf_cg/cp_asm_count

UDB Parameters: None.

vfredusum.vs is difficult to test because the results depend on the ordering. It may eventually need to exclude testing for multi-element vectors, but is presently passing multi-element vectors on the simulators tested.

A.11.7. Temporarily Skipped Vector Tests

Some vector tests are currently skipped pending fixes to the Sail RISC-V reference model. These can be restored by uncommenting the corresponding generation lines or removing the hardcoded skips once the upstream issues are resolved:

Both upstream fixes have since landed (sail-riscv PR #1703 was merged in June 2026 and issue #1709 was closed in May 2026), but the skips have not yet been removed. The vstart generation lines and the vmv<nr>r.v tests should be re-enabled once they have been verified against a Sail build that includes those fixes.

A.11.8. Zvfh Vector Half-Precision Floating-Point Extension

Half-precision vector floating-point is part of the Zvfh and Zvfhmin extensions, not the base V extension. Nevertheless, Zvfh tests are in the same directory structure as V, under Vf16. Zvfh uses Vf16 Table 124 to exercise all floating-point instructions with SEW=16.

A.11.9. Zvfhmin Half-Precision Conversions

Zvfhmin only exercises the widening and narrowing conversions: vfwcvt.f.f.v and vfncvt.f.f.w.

Table 126. Zvfhmin Instruction Coverpoints
Instruction vfwcvt.f.f.v vfncvt.f.f.w

RV32

x

x

RV64

x

x

EFFEW16

x

x

cp_asm_count

x

x

cp_vd

emul2

x

cp_vs2

x

emul2

cp_vs2_edges

f

f_emul2

cp_masking_edges

x

x

cr_vl_lmul

lmul4max

lmul4max

cr_vtype_agnostic

lmul4max

lmul4max

cp_vl_0

x

x

cp_csr_fflags

v

voun

cp_csr_frm

v

Zvfhmin Normative Rules

No normative rules found for this section.

UDB Parameters: None.

A.11.10. Zvfbfmin BF16 Conversions

Table 127. Zvfbfmin Instruction Coverpoints
Instruction vfwcvtbf16.f.f.v vfncvtbf16.f.f.w

RV32

x

x

RV64

x

x

EFFEW16

x

x

cp_asm_count

x

x

cp_vd

emul2

x

cp_vs2

x

emul2

cp_vs2_edges

f_bf16

f_emul2

cp_masking_edges

x

x

cr_vl_lmul

lmul4max

lmul4max

cr_vtype_agnostic

lmul4max

lmul4max

cp_vl_0

x

x

cp_csr_fflags

v

voun

cp_csr_frm

v

std_vec

x

cp_custom

vfncvt_rup_overflow_bf16

Table 128. Zvfbfmin Normative Rules
Normative Rule Rule Text Coverpoints

Zvfbfmin_depends_Zve32f

This extension depends upon the Zve32f extension.

Definition, checked through UDB

vfwcvtbf16-f-f-v_op

Widening convert from BF16 to FP32. The conversion is exact.

Zvfbfmin_vfwcvtbf16_f_f_v_cg/{cp_vd_emul2, cp_vs2, cp_vs2_edges_f_bf16_sew16, cp_masking_edges, cr_vl_lmul_lmul4max_sew16, cr_vtype_agnostic_lmul4max, cp_vl_0, cp_csr_fflags_v}

vfwcvtbf16-f-f-v_enc

Encoding

Zvfbfmin_vfwcvtbf16_f_f_v_cg/cp_asm_count

vfwcvtbf16-f-f-v_sew_rsv

SEW is any value other than 16

TODO: SsstrictV test with SEW other than 16

vfncvtbf16-f-f-w_op

Narrowing convert from FP32 to BF16. Round according to the frm register.

Zvfbfmin_vfncvtbf16_f_f_w_cg/{cp_vd, cp_vs2_emul2, cp_vs2_edges_f_emul2_sew16, cp_masking_edges, cr_vl_lmul_lmul4max_sew16, cr_vtype_agnostic_lmul4max, cp_vl_0, cp_csr_fflags_voun, cp_csr_frm_v}

vfncvtbf16-f-f-w_enc

Encoding

Zvfbfmin_vfncvtbf16_f_f_w_cg/cp_asm_count

vfncvtbf16-f-f-w_sew_rsv

SEW is any value other than 16

TODO: SsstrictV test with SEW other than 16

UDB Parameters: None.

A.11.11. Zvfbfwma BF16 MAC

Table 129. Zvfbfwma Instruction Coverpoints
Instruction vfwmaccbf16.vv vfwmaccbf16.vf

RV32

x

x

RV64

x

x

EFFEW16

x

x

cp_asm_count

x

x

cp_vd

emul2

emul2

cp_vs2

x

x

cp_vs1

x

cp_fs1

x

cmp_vs1_vs2

x

cp_vs2_edges

f_bf16

f_bf16

cp_vs1_edges

f_bf16

cr_vs2_vs1_edges

f_bf16

cp_fs1_edges

v_bf16

cr_vs2_fs1_edges

bf16

cp_masking_edges

x

x

cr_vl_lmul

lmul4max

lmul4max

cr_vtype_agnostic

lmul4max

lmul4max

cp_vl_0

x

x

cp_csr_fflags

voun

voun

cp_csr_frm

v

v

Table 130. Zvfbfwma Normative Rules
Normative Rule Rule Text Coverpoints

vfwmaccbf16_op

This instruction performs a widening fused multiply-accumulate operation, where each pair of BF16 values are multiplied and their unrounded product is added to the corresponding FP32 accumulate value. The sum is rounded according to the frm register.

Zvfbfwma_vfwmaccbf16_vv_cg/cr_vs2_vs1_edges_f_bf16_sew16, Zvfbfwma_vfwmaccbf16_vf_cg/cr_vs2_fs1_edges_f_bf16_sew16

vfwmaccbf16-vf

The vector-scalar version is similar, but instead of reading elements from vs1, a scalar BF16 value is read from the FPU register rs1.

Zvfbfwma_vfwmaccbf16_vf_cg/cr_vs2_fs1_edges_f_bf16_sew16

bf16_subnorm

BF16 computational instructions defined in this chapter support all IEEE 754-2008 features, including all rounding modes, subnormal inputs and outputs, overflow and underflow, and default exception handling. Tininess is detected after rounding.

Zvfbfwma_vfwmaccbf16_vv_cg/cr_vs2_vs1_edges_f_bf16_sew16, Zvfbfwma_vfwmaccbf16_vf_cg/cr_vs2_fs1_edges_f_bf16_sew16

vfwmaccbf16_sew_rsv

SEW is any value other than 16

vfwmaccbf16-vv

In the vector-vector version, the BF16 elements are read from vs1 and vs2 and FP32 accumulate value is read from vd. The FP32 result is written to the destination register vd.

Zvfbfwma_vfwmaccbf16_vv_cg/cr_vs2_vs1_edges_f_bf16_sew16

Zvfbfwma_depends

This extension depends upon the Zvfbfmin and Zfbfmin extensions.

Definition, checked through UDB

vfwmaccbf16_encoding_vv

Zvfbfwma_vfwmaccbf16_vv_cg/cp_asm_count

vfwmaccbf16_encoding_vf

Zvfbfwma_vfwmaccbf16_vf_cg/cp_asm_count

UDB Parameters: None.

A.12. Zvb* Vector Bit Manipulation Extension

Vector bit manipulation extensions include Zvbb and Zvbc. They use the same coverpoint definitions as Vx.

A.12.1. Zvbb Vector Basic Bit Manipulation Extension

Zvbb is organized by SEW like other unprivileged vector extensions.

Table 131. Zvbb Instruction Coverpoints
Instruction vandn.vv vandn.vx vbrev.v vbrev8.v vrev8.v vclz.v vctz.v vcpop.v vrol.vv vrol.vx vror.vv vror.vx

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_vd

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs2

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs1

x

x

x

cp_rs1

x

x

x

cmp_vd_vs2

x

x

x

x

x

x

x

x

x

x

x

x

cmp_vd_vs1

x

x

x

cmp_vs1_vs2

x

x

x

cmp_vd_vs1_vs2

x

x

x

cp_vs2_edges

x

x

x

x

x

x

x

x

x

x

x

x

cp_vs1_edges

x

x

x

cr_vs2_vs1_edges

x

x

x

cp_rs1_edges

x

x

x

cr_vs2_rs1_edges

x

x

x

cp_masking_edges

x

x

x

x

x

x

x

x

x

x

x

x

cr_vl_lmul

x

x

x

x

x

x

x

x

x

x

x

x

cr_vtype_agnostic

x

x

x

x

x

x

x

x

x

x

x

x

cp_vl_0

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vror.vi vwsll.vv vwsll.vx vwsll.vi

RV32

x

x

x

x

RV64

x

x

x

x

EFFEW8

x

x

x

x

EFFEW16

x

x

x

x

EFFEW32

x

x

x

x

EFFEW64

x

cp_asm_count

x

x

x

x

cp_vd

x

emul2

emul2

emul2

cp_vs2

x

x

x

x

cp_vs1

x

cp_rs1

x

cp_imm_5bit

u

cp_uimm

6bit_v

cmp_vd_vs2

x

cmp_vs1_vs2

x

cp_vs2_edges

x

x

x

x

cp_vs1_edges

x

cr_vs2_vs1_edges

x

cp_rs1_edges

x

cr_vs2_rs1_edges

x

cr_vs2_imm_edges

6bit_u

u

cp_masking_edges

x

x

x

x

cr_vl_lmul

x

lmul4max

lmul4max

lmul4max

cr_vtype_agnostic

x

lmul4max

lmul4max

lmul4max

cp_vl_0

x

x

x

x

std_vec

x

x

x

cp_custom

wvv_all

wvx_all

wvx_all

Table 132. Zvbb Normative Rules
Normative Rule Rule Text Coverpoints

Zvbb_dependent_Zve32x

Zvbb depends upon the Zve32x extension.

Definition, checked through UDB

Zvbb_eew

Zvbb provides support for EEW of 8, 16, and 32.

Zvbb8_vclz_v_cg/cp_asm_count, Zvbb16_vclz_v_cg/cp_asm_count, Zvbb32_vclz_v_cg/cp_asm_count

vandn_op

Each bit of Op1 is inverted and logically ANDed with the corresponding bits in vs2.

Zvbb16_vandn_vv_cg/cp_vd

vandn-vx_rs1

In the vector-scalar version, Op1 is the sign-extended or truncated value in scalar register rs1.

Zvbb16_vandn_vx_cg/cp_rs1_edges

vandn-vv_vs1

In the vector-vector version, Op1 is vs1.

Zvbb16_vandn_vv_cg/cp_vs1

vbrev-v_op

A bit reversal is performed on the bits of each element.

Zvbb8_vbrev_v_cg/cp_vs2_edges, Zvbb8_vbrev_v_cg/cr_vl_lmul_sew8, Zvbb64_vbrev_v_cg/cp_vs2_edges, Zvbb64_vbrev_v_cg/cr_vl_lmul_sew64

vbrev8-v_op

A bit reversal is performed on the bits of each byte.

Zvbb16_vbrev8_v_cg/cp_vd

vclz-v_op

A leading zero count is performed on each element.

Zvbb16_vclz_v_cg/cp_vs2_edges, Zvbb8_vclz_v_cg/cp_vs2_edges, Zvbb8_vclz_v_cg/cr_vl_lmul_sew8, Zvbb64_vclz_v_cg/cp_vs2_edges, Zvbb64_vclz_v_cg/cr_vl_lmul_sew64

vcpop-v_op

A population count is performed on each element.

Zvbb16_vcpop_v_cg/cp_vd, Zvbb8_vcpop_v_cg/cp_vs2_edges, Zvbb8_vcpop_v_cg/cr_vl_lmul_sew8, Zvbb64_vcpop_v_cg/cp_vs2_edges, Zvbb64_vcpop_v_cg/cr_vl_lmul_sew64

vctz-v_op

A trailing zero count is performed on each element.

Zvbb16_vctz_v_cg/cp_vd, Zvbb8_vctz_v_cg/cp_vs2_edges, Zvbb8_vctz_v_cg/cr_vl_lmul_sew8, Zvbb64_vctz_v_cg/cp_vs2_edges, Zvbb64_vctz_v_cg/cr_vl_lmul_sew64

vrev8-v_op

A byte reversal is performed on each element of vs2, effectively performing an endian swap.

Zvbb16_vrev8_v_cg/cp_vd

vrol_op

The elements in vs2 are rotated left by the rotate amount specified by either the corresponding elements of vs1 (vector-vector), or integer register rs1 (vector-scalar). Only the low log2(SEW) bits of the rotate-amount value are used, all other bits are ignored.

Zvbb16_vrol_vv_cg/cp_vs1_edges, Zvbb16_vrol_vx_cg/cp_rs1_edges

vror_op

The elements in vs2 are rotated right by the rotate amount specified by either the corresponding elements of vs1 (vector-vector), integer register rs1 (vector-scalar), or an immediate value (vector-immediate). Only the low log2(SEW) bits of the rotate-amount value are used, all other bits are ignored.

Zvbb16_vror_vx_cg/cp_rs1_edges

vwsll_op

The elements in vs2 are zero-extended to 2×SEW bits, then shifted left by the shift amount specified by either the corresponding elements of vs1 (vector-vector), integer register rs1 (vector-scalar), or an immediate value (vector-immediate). Only the low log2(2×SEW) bits of the shift-amount value are used, all other bits are ignored.

Zvbb16_vwsll_vx_cg/cp_rs1_edges, Zvbb8_vwsll_vv_cg/cr_vs2_vs1_edges, Zvbb8_vwsll_vx_cg/cr_vs2_rs1_edges, Zvbb8_vwsll_vi_cg/cr_vs2_imm_edges, Zvbb32_vwsll_vv_cg/cr_vs2_vs1_edges

Zvbb_eew_Zve64x

If Zve64x is supported then Zvbb also adds support for EEW=64.

Zvbb64_vclz_v_cg/cp_asm_count

vclz-v_op_zeroinput

The result for zero-valued inputs is the value SEW.

Zvbb8_vclz_v_cg/cp_vs2_edges, Zvbb16_vclz_v_cg/cp_vs2_edges, Zvbb32_vclz_v_cg/cp_vs2_edges, Zvbb64_vclz_v_cg/cp_vs2_edges

UDB Parameters: None.

A.12.2. Zvbc Vector Carryless Multiplication Extension

Zvbc only applies to SEW=64.

Table 133. Zvbc Instruction Coverpoints
Instruction vclmul.vv vclmul.vx vclmulh.vv vclmulh.vx

RV32

x

x

x

x

RV64

x

x

x

x

EFFEW64

x

x

x

x

cp_asm_count

x

x

x

x

cp_vd

x

x

x

x

cp_vs2

x

x

x

x

cp_vs1

x

x

cp_rs1

x

x

cmp_vd_vs2

x

x

x

x

cmp_vd_vs1

x

x

cmp_vs1_vs2

x

x

cmp_vd_vs1_vs2

x

x

cp_vs2_edges

x

x

x

x

cp_vs1_edges

x

x

cr_vs2_vs1_edges

x

x

cp_rs1_edges

x

x

cr_vs2_rs1_edges

x

x

cp_masking_edges

x

x

x

x

cr_vl_lmul

x

x

x

x

cr_vtype_agnostic

x

x

x

x

cp_vl_0

x

x

x

x

Table 134. Zvbc Normative Rules
Normative Rule Rule Text Coverpoints

Zvbc_dependent_Zve64x

Zvbc depends upon the Zve64x extension.

Definition, checked through UDB

Zvbc_sew64only

The instructions in Zvbc are only defined for SEW=64.

Zvbc64_vclmul_vv_cg/cp_asm_count, Zvbc64_vclmul_vx_cg/cp_asm_count, Zvbc64_vclmulh_vv_cg/cp_asm_count, Zvbc64_vclmulh_vx_cg/cp_asm_count

vclmul_sewn64_rsv

SEW is any value other than 64

Out-of-Scope: reserved because of CSR state (vtype.sew); no Ssstrict-equivalent suite exists for Zvbc to exercise this reserved SEW encoding

vclmul_op

Each 64-bit element in the vs2 vector register is carry-less multiplied by either each 64-bit element in vs1 (vector-vector), or the 64-bit value from integer register rs1 (vector-scalar). The result is the least significant 64 bits of the carry-less product.

Zvbc64_vclmul_vv_cg/cp_vs2_edges, Zvbc64_vclmul_vv_cg/cr_vs2_vs1_edges, Zvbc64_vclmul_vv_cg/cr_vl_lmul_sew64, Zvbc64_vclmul_vx_cg/cr_vs2_rs1_edges, Zvbc64_vclmul_vx_cg/cr_vl_lmul_sew64

vclmulh_sewn64_rsv

SEW is any value other than 64

Out-of-Scope: reserved because of CSR state (vtype.sew); no Ssstrict-equivalent suite exists for Zvbc to exercise this reserved SEW encoding

vclmulh_op

Each 64-bit element in the vs2 vector register is carry-less multiplied by either each 64-bit element in vs1 (vector-vector), or the 64-bit value from integer register rs1 (vector-scalar). The result is the most significant 64 bits of the carry-less product.

Zvbc64_vclmulh_vv_cg/cp_vs2_edges, Zvbc64_vclmulh_vv_cg/cr_vs2_vs1_edges, Zvbc64_vclmulh_vv_cg/cr_vl_lmul_sew64, Zvbc64_vclmulh_vx_cg/cr_vs2_rs1_edges, Zvbc64_vclmulh_vx_cg/cr_vl_lmul_sew64

UDB Parameters: None.

A.13. Zvk* Vector Cryptography Extension

There are several Zvk* vector cryptography extensions.

A.13.1. Zvkb Vector Crypto Bit Manipulation Extension

Each SEW has its own suite.

Table 135. Zvkb Instruction Coverpoints
Instruction vandn.vv vandn.vx vbrev8.v vrev8.v vrol.vv vrol.vx vror.vv vror.vx vror.vi

RV32

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

cp_vd

x

x

x

x

x

x

x

x

x

cp_vs2

x

x

x

x

x

x

x

x

x

cp_vs1

x

x

x

cp_rs1

x

x

x

cp_uimm

6bit_v

cmp_vd_vs2

x

x

x

x

x

x

x

x

x

cmp_vd_vs1

x

x

x

cmp_vs1_vs2

x

x

x

cmp_vd_vs1_vs2

x

x

x

cp_vs2_edges

x

x

x

x

x

x

x

x

x

cp_vs1_edges

x

x

x

cr_vs2_vs1_edges

x

x

x

cp_rs1_edges

x

x

x

cr_vs2_rs1_edges

x

x

x

cr_vs2_imm_edges

6bit_u

cp_masking_edges

x

x

x

x

x

x

x

x

x

cr_vl_lmul

x

x

x

x

x

x

x

x

x

cr_vtype_agnostic

x

x

x

x

x

x

x

x

x

cp_vl_0

x

x

x

x

x

x

x

x

x

Table 136. Zvkb Normative Rules
Normative Rule Rule Text Coverpoints

zvk_dataindep_timing

All instructions shall be implemented with data-independent timing. That is, the latency of the execution of these instructions shall not vary with different input values.

TODO: data-independent execution timing (a side-channel-resistance property) cannot be observed from a final-state signature comparison

veccrypto_eeweqsew

For all of the vector crypto instructions in this specification, EEW=SEW.

TODO: EEW=SEW is inherent in every vector-crypto instruction’s encoding; no dedicated coverpoint isolates it

veccrypto_vl_vstart_egsconstr

Since vl and vstart refer to elements, Vector Crypto instructions that use elements groups (See crypto-vector-element-groups) require that these values are an integer multiple of the Element Group Size (EGS).

TODO: no coverpoint verifies vl/vstart are rejected when not a multiple of EGS - the functional suites only ever generate compliant values

veccrypto_vl_vstart_rsv

Instructions that violate the vl or vstart requirements are reserved.

TODO: no Ssstrict-equivalent suite exists for the vector-crypto extensions to exercise vl/vstart values that violate the EGS constraint

veccrypto_lmul_egwconstr

For element-group instructions, LMUL×VLEN must always be at least as large as EGW, otherwise an illegal-instruction exception is raised, even if vl=0.

TODO: no ExceptionsZvk-style suite exists yet to exercise the LMUL*VLEN<EGW illegal-instruction condition

veccrypto_sew_rsv

Some Vector Crypto instructions are only defined for a specific SEW. In such a case all other SEW values are reserved.

Out-of-Scope: reserved because of CSR state (vtype.sew); no Ssstrict-equivalent suite exists to exercise these reserved SEW encodings; see the per-instruction _sewn32_rsv/_sewn64_rsv rules in each extension’s own file

veccrypto_vsins_vs2

In the case of the *.VS instructions defined in this specification, vs2 holds a 128-bit scalar element group.

Zvkned_vaesdf_vs_cg/cp_vs2_egs4

veccrypto_vsins_vdvs2overlap

For implementations with VLEN ≥ 128, vs2 refers to a single register. Thus, the vd register group must not overlap the vs2 register. However, in implementations where VLEN < 128, vs2 refers to a register group comprised of the number of registers needed to hold the 128-bit scalar element group. In this case, the vd register group must not overlap this vs2 register group.

TODO: this is an SsstrictV-style reserved-encoding test; no register-overlap coverpoint exists yet for the *.vs instruction forms (e.g. Zvkned_vaesdf_vs_cg has no cmp_vd_vs2-style coverpoint)

veccrypto_vsins_vd

they return vector results to vd, which is also a source vector operand.

Zvkg_vghsh_vv_cg/cp_vd_egs4

Zvknhb_Zvkn_Zvknc_Zvkng_Zvksc_depZve64x

The Zvknhb, Zvkn, Zvknc, Zvkng, and Zvksc depend on Zve64x.

TODO: extension-composition fact; no dedicated coverpoint exists for it (Zvkn/Zvknc/Zvkng/Zvksc are not separate suites in this repo)

Zvkb_Zvkg_Zvkned_Zvknha_Zvksed_Zvksh_Zvks_Zvksc_Zvksg_Zvkt_depZve32x

All of the other Vector Crypto Extensions depend on Zve32x.

TODO: extension-composition fact; no dedicated coverpoint exists for it (Zvks/Zvksc/Zvksg/Zvkt are not separate suites in this repo)

veccrypto_indepZkt

It is important to note that the Vector Crypto instructions are independent of the implementation of the Zkt extension and do not require that Zkt is implemented.

TODO: independence from an unrelated extension’s implementation is not something a coverpoint can assert one way or the other

vandn_op

Each bit of Op1 is inverted and logically ANDed with the corresponding bits in vs2.

Zvkb8_vandn_vv_cg/cr_vs2_vs1_edges, Zvkb8_vandn_vx_cg/cr_vs2_rs1_edges, Zvkb64_vandn_vv_cg/cr_vs2_vs1_edges, Zvkb64_vandn_vx_cg/cr_vs2_rs1_edges

vandn-vx_rs1

In the vector-scalar version, Op1 is the sign-extended or truncated value in scalar register rs1.

Zvkb8_vandn_vx_cg/cr_vs2_rs1_edges, Zvkb16_vandn_vx_cg/cr_vs2_rs1_edges, Zvkb32_vandn_vx_cg/cr_vs2_rs1_edges, Zvkb64_vandn_vx_cg/cr_vs2_rs1_edges

vandn-vv_vs1

In the vector-vector version, Op1 is vs1.

Zvkb8_vandn_vv_cg/cr_vs2_vs1_edges, Zvkb16_vandn_vv_cg/cr_vs2_vs1_edges, Zvkb32_vandn_vv_cg/cr_vs2_vs1_edges, Zvkb64_vandn_vv_cg/cr_vs2_vs1_edges

vbrev8-v_op

A bit reversal is performed on the bits of each byte.

Zvkb8_vbrev8_v_cg/{cp_vs2_edges, cr_vl_lmul_sew8}, Zvkb64_vbrev8_v_cg/{cp_vs2_edges, cr_vl_lmul_sew64}

vrev8-v_op

A byte reversal is performed on each element of vs2, effectively performing an endian swap.

Zvkb8_vrev8_v_cg/{cp_vs2_edges, cr_vl_lmul_sew8}, Zvkb64_vrev8_v_cg/{cp_vs2_edges, cr_vl_lmul_sew64}

vrol_op

The elements in vs2 are rotated left by the rotate amount specified by either the corresponding elements of vs1 (vector-vector), or integer register rs1 (vector-scalar). Only the low log2(SEW) bits of the rotate-amount value are used, all other bits are ignored.

Zvkb8_vrol_vv_cg/cr_vs2_vs1_edges, Zvkb8_vrol_vx_cg/cr_vs2_rs1_edges, Zvkb64_vrol_vv_cg/cr_vs2_vs1_edges, Zvkb64_vrol_vx_cg/cr_vs2_rs1_edges

vror_op

The elements in vs2 are rotated right by the rotate amount specified by either the corresponding elements of vs1 (vector-vector), integer register rs1 (vector-scalar), or an immediate value (vector-immediate). Only the low log2(SEW) bits of the rotate-amount value are used, all other bits are ignored.

Zvkb8_vror_vv_cg/cr_vs2_vs1_edges, Zvkb8_vror_vx_cg/cr_vs2_rs1_edges, Zvkb8_vror_vi_cg/cr_vs2_imm_edges, Zvkb64_vror_vi_cg/cr_vs2_imm_edges, TODO: vror.vi with i5=1 (rotate amounts 32-63 at SEW=64)

Zvkt_req

The Zvkt extension requires all implemented instructions from the following list to be executed with data-independent execution latency as defined in the RISC-V Scalar Cryptography Extensions specification.

Untestable: microarchitectural timing

Zvkt_diel_def

Data-independent execution latency (DIEL) applies to all data operands of an instruction, even those that are not a part of the body or that are inactive. However, DIEL does not apply to other values such as vl, vtype, and the mask (when used to control execution of a masked vector instruction).

Untestable: microarchitectural timing

Zvkt_diel_constants_exempt

Also, DIEL does not apply to constant values specified in the instruction encoding such as the use of the zero register (x0), and, in the case of immediate forms of an instruction, the values in the immediate fields (i.e., imm and uimm).

Untestable: microarchitectural timing

Zvkt_diel_control_exempt

In some cases—​which are explicitly specified in the lists below—​operands that are used as control rather than data are exempt from DIEL.

Untestable: microarchitectural timing

UDB Parameters: None.

A.13.2. Zvkg Vector Crypto Galois Field Extension

Only SEW=32 is defined.

Table 137. Zvkg Instruction Coverpoints
Instruction vghsh.vv vgmul.vv

RV32

x

x

RV64

x

x

EFFEW32

x

x

cp_asm_count

x

x

cp_vd

egs4

egs4

cp_vs2

egs4

egs4

cp_vs1

egs4

cmp_vd_vs2

egs4

egs4

cmp_vd_vs1

egs4

cmp_vs1_vs2

egs4

cmp_vd_vs1_vs2

egs4

cp_vs2_edges

egs4

egs4

cp_vs1_edges

egs4

cp_vd_edges

egs4

egs4

cr_vs2_vs1_edges

egs4

cr_vs1_vd_edges

egs4

cr_vs2_vd_edges

egs4

egs4

cr_vl_lmul

egs4

egs4

cr_vtype_agnostic

egs4

egs4

cp_custom

nist_gcm

nist_gcm

Table 138. Zvkg Normative Rules
Normative Rule Rule Text Coverpoints

Zvkg_egw128b_elem32b

All of these instructions work on 128-bit element groups comprised of four 32-bit elements.

Zvkg_vghsh_vv_cg/cp_csr_vtype_lmul_egs4_sew32, Zvkg_vghsh_vv_cg/cr_vl_lmul_egs4_sew32, Zvkg_vgmul_vv_cg/cr_vl_lmul_egs4_sew32

Zvkg_dataindeptiming

To help avoid side-channel timing attacks, these instructions shall be implemented with data-independent timing.

Untestable: microarchitectural timing

Zvkg_vl

The number of element groups to be processed is vl/EGS. vl must be set to the number of SEW=32 elements to be processed and therefore must be a multiple of EGS=4.

Zvkg_vghsh_vv_cg/cr_vl_lmul_egs4_sew32, Zvkg_vgmul_vv_cg/cr_vl_lmul_egs4_sew32

Zvkg_vstart

Likewise, vstart must be a multiple of EGS=4.

TODO: no coverpoint samples vstart for this suite yet; nothing wired in coverpoints/unpriv/Zvkg_coverage.svh

vghsh-vv_sewn32_rsv

SEW is any value other than 32

Out-of-Scope: reserved because of CSR state (vtype.sew); Zvkg only generates SEW=32 tests and there is no Ssstrict-equivalent suite for vector-crypto

vghsh-vv_op

This instruction treats all of the inputs and outputs as 128-bit polynomials and performs operations over GF[2]. It produces the next partial hash (Yi+1) by adding the current partial hash (Yi) to the cipher text block (Xi) and then multiplying (over GF(2128)) this sum by the Hash Subkey (H).

Zvkg_vghsh_vv_cg/cp_vd_egs4, Zvkg_vghsh_vv_cg/cr_vs2_vs1_edges_egs4, Zvkg_vghsh_vv_cg/cr_vs1_vd_edges_egs4, Zvkg_vghsh_vv_cg/cr_vs2_vd_edges_egs4, Zvkg_vghsh_vv_cg/cr_vl_lmul_egs4_sew32

vghsh-vv_exeindepdata

This instruction must always be implemented such that its execution latency does not depend on the data being operated upon.

Untestable: microarchitectural timing

vgmul-vv_sewn32_rsv

SEW is any value other than 32

Out-of-Scope: reserved because of CSR state (vtype.sew); Zvkg only generates SEW=32 tests and there is no Ssstrict-equivalent suite for vector-crypto

vgmul-vv_op

This instruction treats all of the inputs and outputs as 128-bit polynomials and performs operations over GF[2]. It produces the product over GF(2128) of the two 128-bit inputs.

Zvkg_vgmul_vv_cg/cp_vd_egs4, Zvkg_vgmul_vv_cg/cr_vs2_vd_edges_egs4, Zvkg_vgmul_vv_cg/cr_vl_lmul_egs4_sew32

vgmul-vv_exeindepdata

This instruction must always be implemented such that its execution latency does not depend on the data being operated upon.

Untestable: microarchitectural timing

vghsh-vv_op_gf

The multiplication over GF(2128) is a carry-less multiply of two 128-bit polynomials modulo GHASH’s irreducible polynomial (x128 + x7 + x2 + x + 1).

Zvkg_vghsh_vv_cg/{cr_vs2_vs1_edges_egs4, cr_vs1_vd_edges_egs4, cr_vs2_vd_edges_egs4}

vghsh-vv_op_coeff

The NIST specification (see Zvkg) orders the coefficients from left to right x0x1x2…​x127 for a polynomial x0 + x1u +x2 u2 + …​ + x127u127. This can be viewed as a collection of byte elements in memory with the byte containing the lowest coefficients (i.e., 0,1,2,3,4,5,6,7) residing at the lowest memory address. Since the bits in the bytes are reversed, this instruction internally performs bit swaps within bytes to put the bits in the standard ordering (e.g., 7,6,5,4,3,2,1,0).

Zvkg_vghsh_vv_cg/{cr_vs2_vs1_edges_egs4, cr_vs1_vd_edges_egs4, cr_vs2_vd_edges_egs4}

vgmul-vv_op_gf

The multiplication over GF(2128) is a carry-less multiply of two 128-bit polynomials modulo GHASH’s irreducible polynomial (x128 + x7 + x2 + x + 1).

Zvkg_vgmul_vv_cg/cr_vs2_vd_edges_egs4

vgmul-vv_op_coeff

The NIST specification (see Zvkg) orders the coefficients from left to right x0x1x2…​x127 for a polynomial x0 + x1u +x2 u2 + …​ + x127u127. This can be viewed as a collection of byte elements in memory with the byte containing the lowest coefficients (i.e., 0,1,2,3,4,5,6,7) residing at the lowest memory address. Since the bits in the bytes are reversed, This instruction internally performs bit swaps within bytes to put the bits in the standard ordering (e.g., 7,6,5,4,3,2,1,0).

Zvkg_vgmul_vv_cg/cr_vs2_vd_edges_egs4

UDB Parameters: None.

A.13.3. Zvkned Vector NIST Encryption and Decryption

Only SEW=32 is defined.

Table 139. Zvkned Instruction Coverpoints
Instruction vaesef.vv vaesef.vs vaesem.vv vaesem.vs vaesdf.vv vaesdf.vs vaesdm.vv vaesdm.vs vaeskf1.vi vaeskf2.vi vaesz.vs

RV32

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

cp_vd

egs4

egs4

egs4

egs4

egs4

egs4

egs4

egs4

egs4

egs4

egs4

cp_vs2

egs4

egs4

egs4

egs4

egs4

egs4

egs4

egs4

egs4

egs4

egs4

cp_imm_5bit

u

u

cmp_vd_vs2

egs4

egs4

egs4

egs4

egs4

egs4

cp_vs2_edges

egs4

egs4

egs4

egs4

egs4

egs4

egs4

egs4

egs4_subbytes

egs4_subbytes

egs4

cp_vd_edges

egs4_subbytes

egs4_subbytes

egs4_subbytes

egs4_subbytes

egs4_subbytes

egs4_subbytes

egs4_subbytes

egs4_subbytes

egs4

egs4

cr_vs2_vd_edges

egs4_subbytes

egs4_subbytes

egs4_subbytes

egs4_subbytes

egs4_subbytes

egs4_subbytes

egs4_subbytes

egs4_subbytes

egs4_subbytes_vs2

egs4

cr_vl_lmul

egs4

egs4

egs4

egs4

egs4

egs4

egs4

egs4

egs4

egs4

egs4

cr_vtype_agnostic

egs4

egs4

egs4

egs4

egs4

egs4

egs4

egs4

egs4

egs4

egs4

cp_vl_0

egs4

egs4

cp_custom

act3_crypto

act3_crypto

act3_crypto

act3_crypto

act3_crypto

act3_crypto

act3_crypto

act3_crypto

act3_crypto

act3_crypto

act3_crypto

Table 140. Zvkned Normative Rules
Normative Rule Rule Text Coverpoints

Zvkned_egw128b_elem32b

All of these instructions work on 128-bit element groups comprised of four 32-bit elements.

Zvkned_vaesef_vv_cg/cp_csr_vtype_lmul_egs4_sew32, Zvkned_vaesef_vv_cg/cr_vl_lmul_egs4_sew32, Zvkned_vaeskf1_vi_cg/cr_vl_lmul_egs4_sew32, Zvkned_vaesz_vs_cg/cr_vl_lmul_egs4_sew32

Zvkned_dataindeptiming

To help avoid side-channel timing attacks, these instructions shall be implemented with data-independent timing.

Untestable: microarchitectural timing

Zvkned_vl

The number of element groups to be processed is vl/EGS. vl must be set to the number of SEW=32 elements to be processed and therefore must be a multiple of EGS=4.

Zvkned_vaesef_vv_cg/cr_vl_lmul_egs4_sew32, Zvkned_vaeskf1_vi_cg/cr_vl_lmul_egs4_sew32, Zvkned_vaesz_vs_cg/cr_vl_lmul_egs4_sew32

Zvkned_vstart

Likewise, vstart must be a multiple of EGS=4.

TODO: no coverpoint samples a vstart-multiple-of-EGS constraint for Zvkned; only vl is exercised

vaesdf_final

A final-round AES block cipher decryption is performed.

Zvkned_vaesdf_vv_cg/cp_vd_egs4, Zvkned_vaesdf_vv_cg/cr_vs2_vd_edges_egs4_subbytes_0, Zvkned_vaesdf_vv_cg/cr_vl_lmul_egs4_sew32, Zvkned_vaesdf_vs_cg/cr_vs2_vd_edges_egs4_subbytes_0, Zvkned_vaesdf_vs_cg/cr_vl_lmul_egs4_sew32

vaesdf_ops

The InvShiftRows and InvSubBytes steps are applied to each round state element group from vd.

Zvkned_vaesdf_vv_cg/cp_vd_egs4, Zvkned_vaesdf_vv_cg/cp_vd_edges_egs4_byte_0, Zvkned_vaesdf_vv_cg/cp_vd_edges_egs4_byte_15, Zvkned_vaesdf_vs_cg/cp_vd_edges_egs4_byte_0, Zvkned_vaesdf_vs_cg/cp_vd_edges_egs4_byte_15

vaesdf_xor_form

This is then XORed with the round key in either the corresponding element group in vs2 (vector-vector form) or scalar element group in vs2 (vector-scalar form).

{Zvkned_vaesdf_vv_cg,Zvkned_vaesdf_vs_cg}/cp_vs2_egs4, Zvkned_vaesdf_vv_cg/cp_vs2_edges_egs4, Zvkned_vaesdf_vv_cg/cr_vs2_vd_edges_egs4_subbytes_0, Zvkned_vaesdf_vs_cg/cp_vs2_edges_egs4, Zvkned_vaesdf_vs_cg/cr_vs2_vd_edges_egs4_subbytes_0

vaesdm_mid

A middle-round AES block cipher decryption is performed.

Zvkned_vaesdm_vv_cg/cp_vd_egs4, Zvkned_vaesdm_vv_cg/cr_vs2_vd_edges_egs4_subbytes_0, Zvkned_vaesdm_vv_cg/cr_vl_lmul_egs4_sew32, Zvkned_vaesdm_vs_cg/cr_vs2_vd_edges_egs4_subbytes_0, Zvkned_vaesdm_vs_cg/cr_vl_lmul_egs4_sew32

vaesdm_ops

The InvShiftRows and InvSubBytes steps are applied to each round state element group from vd.

Zvkned_vaesdm_vv_cg/cp_vd_egs4, Zvkned_vaesdm_vv_cg/cp_vd_edges_egs4_byte_0, Zvkned_vaesdm_vv_cg/cp_vd_edges_egs4_byte_15, Zvkned_vaesdm_vs_cg/cp_vd_edges_egs4_byte_0, Zvkned_vaesdm_vs_cg/cp_vd_edges_egs4_byte_15

vaesdm_xor_form

This is then XORed with the round key in either the corresponding element group in vs2 (vector-vector form) or the scalar element group in vs2 (vector-scalar form).

{Zvkned_vaesdm_vv_cg,Zvkned_vaesdm_vs_cg}/cp_vs2_egs4, Zvkned_vaesdm_vv_cg/cp_vs2_edges_egs4, Zvkned_vaesdm_vv_cg/cr_vs2_vd_edges_egs4_subbytes_0, Zvkned_vaesdm_vs_cg/cp_vs2_edges_egs4, Zvkned_vaesdm_vs_cg/cr_vs2_vd_edges_egs4_subbytes_0

vaesdm_invmix

InvMixColumns step.

Zvkned_vaesdm_vv_cg/cp_vd_egs4, Zvkned_vaesdm_vv_cg/cr_vs2_vd_edges_egs4_subbytes_0, Zvkned_vaesdm_vs_cg/cr_vs2_vd_edges_egs4_subbytes_0

vaesef_final

A final-round encryption function of the AES block cipher is performed.

Zvkned_vaesef_vv_cg/cp_vd_egs4, Zvkned_vaesef_vv_cg/cr_vs2_vd_edges_egs4_subbytes_0, Zvkned_vaesef_vv_cg/cr_vl_lmul_egs4_sew32, Zvkned_vaesef_vs_cg/cr_vs2_vd_edges_egs4_subbytes_0, Zvkned_vaesef_vs_cg/cr_vl_lmul_egs4_sew32

vaesef_ops

The SubBytes and ShiftRows steps are applied to each round state element group from vd.

Zvkned_vaesef_vv_cg/cp_vd_egs4, Zvkned_vaesef_vv_cg/cp_vd_edges_egs4_byte_0, Zvkned_vaesef_vv_cg/cp_vd_edges_egs4_byte_15, Zvkned_vaesef_vs_cg/cp_vd_edges_egs4_byte_0, Zvkned_vaesef_vs_cg/cp_vd_edges_egs4_byte_15

vaesef_xor_form

This is then XORed with the round key in either the corresponding element group in vs2 (vector-vector form) or the scalar element group in vs2 (vector-scalar form).

{Zvkned_vaesef_vv_cg,Zvkned_vaesef_vs_cg}/cp_vs2_egs4, Zvkned_vaesef_vv_cg/cp_vs2_edges_egs4, Zvkned_vaesef_vv_cg/cr_vs2_vd_edges_egs4_subbytes_0, Zvkned_vaesef_vs_cg/cp_vs2_edges_egs4, Zvkned_vaesef_vs_cg/cr_vs2_vd_edges_egs4_subbytes_0

vaesem_mid

A middle-round encryption function of the AES block cipher is performed.

Zvkned_vaesem_vv_cg/cp_vd_egs4, Zvkned_vaesem_vv_cg/cr_vs2_vd_edges_egs4_subbytes_0, Zvkned_vaesem_vv_cg/cr_vl_lmul_egs4_sew32, Zvkned_vaesem_vs_cg/cr_vs2_vd_edges_egs4_subbytes_0, Zvkned_vaesem_vs_cg/cr_vl_lmul_egs4_sew32

vaesem_ops

The SubBytes, ShiftRows, and MixColumns steps are applied to each round state element group from vd.

Zvkned_vaesem_vv_cg/cp_vd_egs4, Zvkned_vaesem_vv_cg/cp_vd_edges_egs4_byte_0, Zvkned_vaesem_vv_cg/cp_vd_edges_egs4_byte_15, Zvkned_vaesem_vs_cg/cp_vd_edges_egs4_byte_0, Zvkned_vaesem_vs_cg/cp_vd_edges_egs4_byte_15

vaesem_xor_form

This is then XORed with the round key in either the corresponding element group in vs2 (vector-vector form) or the scalar element group in vs2 (vector-scalar form).

{Zvkned_vaesem_vv_cg,Zvkned_vaesem_vs_cg}/cp_vs2_egs4, Zvkned_vaesem_vv_cg/cp_vs2_edges_egs4, Zvkned_vaesem_vv_cg/cr_vs2_vd_edges_egs4_subbytes_0, Zvkned_vaesem_vs_cg/cp_vs2_edges_egs4, Zvkned_vaesem_vs_cg/cr_vs2_vd_edges_egs4_subbytes_0

vaeskf1_round

A single round of the forward AES-128 KeySchedule is performed.

Zvkned_vaeskf1_vi_cg/cp_vd_egs4, Zvkned_vaeskf1_vi_cg/cp_imm_5bit_u, Zvkned_vaeskf1_vi_cg/cp_vs2_edges_egs4_byte_0, Zvkned_vaeskf1_vi_cg/cp_vs2_edges_egs4_byte_15, Zvkned_vaeskf1_vi_cg/cr_vl_lmul_egs4_sew32

vaeskf1_wordgen

The next round key is generated word by word from the current round key element group in vs2 and the immediately previous word of the round key.

Zvkned_vaeskf1_vi_cg/cp_vs2_egs4, Zvkned_vaeskf1_vi_cg/cp_vs2_edges_egs4_byte_0, Zvkned_vaeskf1_vi_cg/cp_vs2_edges_egs4_byte_15

vaeskf1_uimm_src

ranges from 1 to 10, comes from uimm[3:0]; uimm[4] is ignored.

Zvkned_vaeskf1_vi_cg/cp_imm_5bit_u

vaeskf1_uimm_map

The out-of-range uimm[3:0] values of 0 and 11&#8205;&#8211;&#8205;15 are mapped to in-range values by inverting uimm[3].

Zvkned_vaeskf1_vi_cg/cp_imm_5bit_u

vaeskf2_round

A single round of the forward AES-256 KeySchedule is performed.

Zvkned_vaeskf2_vi_cg/cp_vd_egs4, Zvkned_vaeskf2_vi_cg/cp_imm_5bit_u, Zvkned_vaeskf2_vi_cg/cr_vs2_vd_edges_egs4_subbytes_vs2_0, Zvkned_vaeskf2_vi_cg/cr_vs2_vd_edges_egs4_subbytes_vs2_15, Zvkned_vaeskf2_vi_cg/cr_vl_lmul_egs4_sew32

vaeskf2_wordgen

The next round key is generated word by word from the previous round key element group in vd and the immediately previous word of the round key.

Zvkned_vaeskf2_vi_cg/cp_vd_edges_egs4, Zvkned_vaeskf2_vi_cg/cr_vs2_vd_edges_egs4_subbytes_vs2_0

vaeskf2_rcon_lsw

least significant word of the next round key is generated by applying a function to the most significant word of the current round key and then XORing the result with the round constant.

Zvkned_vaeskf2_vi_cg/cp_vs2_egs4, Zvkned_vaeskf2_vi_cg/cp_imm_5bit_u, Zvkned_vaeskf2_vi_cg/cp_vs2_edges_egs4_byte_12, Zvkned_vaeskf2_vi_cg/cp_vs2_edges_egs4_byte_15

vaeskf2_rcon_func

The round number is used to select the round constant as well as the function.

Zvkned_vaeskf2_vi_cg/cp_imm_5bit_u

vaeskf2_uimm_src

ranges from 2 to 14, comes from uimm[3:0]; uimm[4] is ignored.

Zvkned_vaeskf2_vi_cg/cp_imm_5bit_u

vaeskf2_uimm_map

The out-of-range uimm[3:0] values of 0&#8205;&#8211;&#8205;1 and 15 are mapped to in-range values by inverting uimm[3].

Zvkned_vaeskf2_vi_cg/cp_imm_5bit_u

vaesz_round0

A round-0 AES block cipher operation is performed.

Zvkned_vaesz_vs_cg/cp_vd_egs4, Zvkned_vaesz_vs_cg/cr_vs2_vd_edges_egs4, Zvkned_vaesz_vs_cg/cr_vl_lmul_egs4_sew32

vaesz-vs_only

There is only a *.VS form of the instruction.

Zvkned_vaesz_vs_cg/cp_asm_count

vaesz_vs2_rk

vs2 holds a scalar element group that is used as the round key for all of the round state element groups.

Zvkned_vaesz_vs_cg/cp_vs2_egs4, Zvkned_vaesz_vs_cg/cp_vs2_edges_egs4, Zvkned_vaesz_vs_cg/cr_vl_lmul_egs4_sew32

zvk_dataindep_timing

All instructions shall be implemented with data-independent timing. That is, the latency of the execution of these instructions shall not vary with different input values.

Untestable: microarchitectural timing

veccrypto_eeweqsew

For all of the vector crypto instructions in this specification, EEW=SEW.

Zvkned_vaesef_vv_cg/cr_vl_lmul_egs4_sew32, Zvkg_vghsh_vv_cg/cr_vl_lmul_egs4_sew32, Zvknhb64_vsha2ch_vv_cg/cr_vl_lmul_egs4_sew64, Zvksh_vsm3c_vi_cg/cr_vl_lmul_egs8_sew32

veccrypto_vl_vstart_egsconstr

Since vl and vstart refer to elements, Vector Crypto instructions that use elements groups (See crypto-vector-element-groups) require that these values are an integer multiple of the Element Group Size (EGS).

Zvkned_vaesef_vv_cg/cr_vl_lmul_egs4_sew32, Zvksh_vsm3me_vv_cg/cr_vl_lmul_egs8_sew32, TODO: vstart set to a nonzero multiple of EGS

veccrypto_lmul_egwconstr

For element-group instructions, LMUL×VLEN must always be at least as large as EGW, otherwise an illegal-instruction exception is raised, even if vl=0.

TODO: LMUL×VLEN < EGW, even with vl=0, raises an illegal-instruction exception

veccrypto_vsins_vs2

In the case of the *.VS instructions defined in this specification, vs2 holds a 128-bit scalar element group.

Zvkned_vaesef_vs_cg/cp_vs2_edges_egs4, Zvkned_vaesz_vs_cg/cp_vs2_edges_egs4, Zvksed_vsm4r_vs_cg/cp_vs2_edges_egs4

veccrypto_vsins_vd

they return vector results to vd, which is also a source vector operand.

Zvkned_vaesef_vs_cg/{cp_vd_edges_egs4_byte_0, cr_vl_lmul_egs4_sew32}, Zvksed_vsm4r_vs_cg/{cp_vd_edges_egs4_sm_byte_0, cr_vl_lmul_egs4_sew32}

veccrypto_vsins_vs2function

These instructions enable a single key, specified as a scalar element group in vs2, to be applied to each element group of register group vd.

Zvkned_vaesef_vs_cg/cr_vl_lmul_egs4_sew32, Zvkned_vaesdf_vs_cg/cr_vl_lmul_egs4_sew32, Zvkned_vaesz_vs_cg/cr_vl_lmul_egs4_sew32, Zvksed_vsm4r_vs_cg/cr_vl_lmul_egs4_sew32

veccrypto_indepZkt

It is important to note that the Vector Crypto instructions are independent of the implementation of the Zkt extension and do not require that Zkt is implemented.

Definition, checked through UDB

Zvkn_def

Included Extension|Description === Zvkned|extzvkned¶Zvknhb|extzvknhb¶Zvkb|extzvkb¶Zvkt|extzvkt ===

Definition, checked through UDB

Zvknc_def

Included Extension|Description === Zvkn|extzvkn¶Zvbc|extzvbc ===

Definition, checked through UDB

Zvkng_def

Included Extension|Description === Zvkn|extzvkn¶Zvkg|extzvkg ===

Definition, checked through UDB

UDB Parameters: None.

A.13.4. Zvknh{a/b} Vector NIST Hashing

Both Zvknha32 and Zvknhb64 are defined.

Table 141 and Table 142 list the vector hashing instructions for Zvknha and Zvknhb respectively.

Table 141. Zvknha Instruction Coverpoints
Instruction vsha2ms.vv vsha2ch.vv vsha2cl.vv

RV32

x

x

x

RV64

x

x

x

EFFEW32

x

x

x

cp_asm_count

x

x

x

cp_vd

egs4

egs4

egs4

cp_vs2

egs4

egs4

egs4

cp_vs1

egs4

egs4

egs4

cmp_vs1_vs2

egs4

egs4

egs4

cp_vs2_edges

egs4

egs4

egs4

cp_vs1_edges

egs4

egs4

egs4

cp_vd_edges

egs4

egs4

egs4

cr_vs2_vs1_edges

egs4

egs4

egs4

cr_vs2_vd_edges

egs4

egs4

egs4

cr_vs1_vd_edges

egs4

egs4

egs4

cr_vl_lmul

egs4

egs4

egs4

cr_vtype_agnostic

egs4

egs4

egs4

cp_custom

nist_sha

nist_sha

nist_sha

Table 142. Zvknhb Instruction Coverpoints
Instruction vsha2ms.vv vsha2ch.vv vsha2cl.vv

RV32

x

x

x

RV64

x

x

x

EFFEW32

x

x

x

EFFEW64

x

x

x

cp_asm_count

x

x

x

cp_vd

egs4

egs4

egs4

cp_vs2

egs4

egs4

egs4

cp_vs1

egs4

egs4

egs4

cmp_vs1_vs2

egs4

egs4

egs4

cp_vs2_edges

egs4

egs4

egs4

cp_vs1_edges

egs4

egs4

egs4

cp_vd_edges

egs4

egs4

egs4

cr_vs2_vs1_edges

egs4

egs4

egs4

cr_vs2_vd_edges

egs4

egs4

egs4

cr_vs1_vd_edges

egs4

egs4

egs4

cr_vl_lmul

egs4

egs4

egs4

cr_vtype_agnostic

egs4

egs4

egs4

cp_custom

nist_sha

nist_sha

nist_sha

Table 143. Zvknh Normative Rules
Normative Rule Rule Text Coverpoints

Zvknhb_impZvknha

Zvknhb implies Zvknha.

Zvknhb32_vsha2ch_vv_cg/cp_asm_count

Zvknhb_sha512_egw256b_elem64b

SHA-512: these instructions work on 256-bit element groups comprised of four 64-bit elements.

Zvknhb64_vsha2ch_vv_cg/cp_csr_vtype_lmul_egs4_sew64, Zvknhb64_vsha2ch_vv_cg/cr_vl_lmul_egs4_sew64, Zvknhb64_vsha2cl_vv_cg/cr_vl_lmul_egs4_sew64, Zvknhb64_vsha2ms_vv_cg/cr_vl_lmul_egs4_sew64

Zvknhb_sha256_sha512

Zvknhb supports SHA-256 and SHA-512.

Zvknhb32_vsha2ch_vv_cg/cp_asm_count, Zvknhb32_vsha2ms_vv_cg/cp_asm_count, Zvknhb64_vsha2ch_vv_cg/cp_asm_count, Zvknhb64_vsha2ms_vv_cg/cp_asm_count

Zvknha_sha256

Zvknha supports only SHA-256.

Zvknha_vsha2ch_vv_cg/cp_asm_count, Zvknha_vsha2cl_vv_cg/cp_asm_count, Zvknha_vsha2ms_vv_cg/cp_asm_count

Zvknha_Zvknhb_vstart

Likewise, vstart must be a multiple of EGS=4.

TODO: no coverpoint samples vstart for this suite and no ExceptionsZvk-style suite exists to exercise a non-multiple-of-EGS vstart value

vsha2chl-vv_Zvknha_sewn32_rsv

Zvknha: SEW is any value other than 32

Out-of-Scope: reserved because of CSR state (vtype.sew); no suite drives it to a reserved value under Zvknha and there is no Ssstrict-equivalent suite for vector-crypto

vsha2chl-vv_Zvknhb_sewn32or64_rsv

Zvknhb: SEW is any value other than 32 or 64

Out-of-Scope: reserved because of CSR state (vtype.sew); no suite drives it to a reserved value under Zvknhb and there is no Ssstrict-equivalent suite for vector-crypto

vsha2chl-vv_vdoverlapvs1vs2_rsv

The vd register group overlaps with either vs1 or vs2

TODO: this is an SsstrictV-style reserved-encoding test; no cmp_vd_vs1/cmp_vd_vs2-style register-aliasing coverpoint exists for this suite and no SsstrictV-equivalent suite exists for vector crypto

vsha2ms-vv_Zvknha_sewn32_rsv

Zvknha: SEW is any value other than 32

Out-of-Scope: reserved because of CSR state (vtype.sew); no suite drives it to a reserved value under Zvknha and there is no Ssstrict-equivalent suite for vector-crypto

vsha2ms-vv_Zvknhb_sewn32or64_rsv

Zvknhb: SEW is any value other than 32 or 64

Out-of-Scope: reserved because of CSR state (vtype.sew); no suite drives it to a reserved value under Zvknhb and there is no Ssstrict-equivalent suite for vector-crypto

vsha2ms-vv_vdoverlapvs1vs2_rsv

The vd register group overlaps with either vs1 or vs2

TODO: this is an SsstrictV-style reserved-encoding test; no cmp_vd_vs1/cmp_vd_vs2-style register-aliasing coverpoint exists for this suite and no SsstrictV-equivalent suite exists for vector crypto

vsha2ms-vv_op

Eleven of the last 16 SEW-sized message-schedule words from vd (oldest), vs2, and vs1 (most recent) are processed to produce the next 4 message-schedule words.

Zvknha_vsha2ms_vv_cg/cp_vd_egs4, Zvknha_vsha2ms_vv_cg/cr_vs2_vs1_edges_egs4, Zvknha_vsha2ms_vv_cg/cr_vs1_vd_edges_egs4, Zvknha_vsha2ms_vv_cg/cr_vs2_vd_edges_egs4, Zvknhb64_vsha2ms_vv_cg/cr_vs2_vs1_edges_egs4

Zvknhb_Zvkn_Zvknc_Zvkng_Zvksc_depZve64x

The Zvknhb, Zvkn, Zvknc, Zvkng, and Zvksc depend on Zve64x.

Definition, checked through UDB

Zvknha_Zvknhb_sha256_egw128b_elem32b

SHA-256: these instructions work on 128-bit element groups comprised of four 32-bit elements.

Zvknha_vsha2ch_vv_cg/cp_csr_vtype_lmul_egs4_sew32, Zvknha_vsha2ch_vv_cg/cr_vl_lmul_egs4_sew32, Zvknha_vsha2ms_vv_cg/cr_vl_lmul_egs4_sew32, Zvknhb32_vsha2ch_vv_cg/cr_vl_lmul_egs4_sew32, Zvknhb32_vsha2ms_vv_cg/cr_vl_lmul_egs4_sew32

Zvknha_Zvknhb_dataindeptiming

To help avoid side-channel timing attacks, these instructions shall be implemented with data-independent timing.

Untestable: microarchitectural timing

Zvknha_Zvknhb_vl

The number of element groups to be processed is vl/EGS. vl must be set to the number of SEW elements to be processed and therefore must be a multiple of EGS=4.

Zvknha_vsha2ch_vv_cg/cr_vl_lmul_egs4_sew32, Zvknhb32_vsha2ch_vv_cg/cr_vl_lmul_egs4_sew32, Zvknhb64_vsha2ch_vv_cg/cr_vl_lmul_egs4_sew64

vsha2chl-vv_op_sew32

riscv.github.io/riscv-isa-manual/snapshot/spec/index.html#norm%3Avsha2chl-vv_op_sew32

Zvknha_vsha2ch_vv_cg/cr_vs2_vd_edges_egs4, Zvknha_vsha2cl_vv_cg/cr_vs2_vd_edges_egs4, Zvknhb32_vsha2ch_vv_cg/cr_vs2_vd_edges_egs4, Zvknhb32_vsha2cl_vv_cg/cr_vs2_vd_edges_egs4

vsha2chl-vv_op_sew64

riscv.github.io/riscv-isa-manual/snapshot/spec/index.html#norm%3Avsha2chl-vv_op_sew64

Zvknhb64_vsha2ch_vv_cg/{cr_vs2_vd_edges_egs4, cr_vs2_vs1_edges_egs4}, Zvknhb64_vsha2cl_vv_cg/{cr_vs2_vd_edges_egs4, cr_vs2_vs1_edges_egs4}

vsha2chl-vv_op

Two words of vs1 are processed with the 8 words of current state held in vd and vs2 to perform two rounds of hash computation producing four words of the next state.

Zvknha_vsha2ch_vv_cg/cp_vd_egs4, Zvknha_vsha2ch_vv_cg/{cr_vs2_vs1_edges_egs4, cr_vs1_vd_edges_egs4}, Zvknha_vsha2cl_vv_cg/{cr_vs2_vs1_edges_egs4, cr_vs1_vd_edges_egs4}

vsha2ms-vv_op_sew32

riscv.github.io/riscv-isa-manual/snapshot/spec/index.html#norm%3Avsha2ms-vv_op_sew32

Zvknha_vsha2ms_vv_cg/{cr_vs2_vs1_edges_egs4, cr_vs1_vd_edges_egs4}, Zvknhb32_vsha2ms_vv_cg/{cr_vs2_vs1_edges_egs4, cr_vs1_vd_edges_egs4}

vsha2ms-vv_op_sew64

riscv.github.io/riscv-isa-manual/snapshot/spec/index.html#norm%3Avsha2ms-vv_op_sew64

Zvknhb64_vsha2ms_vv_cg/{cr_vs2_vs1_edges_egs4, cr_vs1_vd_edges_egs4, cr_vs2_vd_edges_egs4}

UDB Parameters: None.

A.13.5. Zvksed Vector ShangMi SM4 Block Cipher

Only Zvksed32 is defined.

Table 144. Zvksed Instruction Coverpoints
Instruction vsm4k.vi vsm4r.vv vsm4r.vs

RV32

x

x

x

RV64

x

x

x

EFFEW32

x

x

x

cp_asm_count

x

x

x

cp_vd

egs4

egs4

egs4

cp_vs2

egs4

egs4

egs4

cp_imm_5bit

u

cmp_vd_vs2

egs4

egs4

cp_vs2_edges

egs4_subbytes_sm

egs4

egs4

cp_vd_edges

egs4_subbytes_sm

egs4_subbytes_sm

cr_vs2_vd_edges

egs4_subbytes_sm

egs4_subbytes_sm

cr_vl_lmul

egs4

egs4

egs4

cr_vtype_agnostic

egs4

egs4

egs4

cp_vl_0

egs4

Table 145. Zvksed Normative Rules
Normative Rule Rule Text Coverpoints

Zvksed_egw128b_elem32b

All of these instructions work on 128-bit element groups comprised of four 32-bit elements.

Zvksed_vsm4k_vi_cg/cp_csr_vtype_lmul_egs4_sew32, Zvksed_vsm4k_vi_cg/cr_vl_lmul_egs4_sew32, Zvksed_vsm4r_vv_cg/cr_vl_lmul_egs4_sew32, Zvksed_vsm4r_vs_cg/cr_vl_lmul_egs4_sew32

Zvksed_dataindeptiming

To help avoid side-channel timing attacks, these instructions shall be implemented with data-independent timing.

Untestable: microarchitectural timing

Zvksed_vl

The number of element groups to be processed is vl/EGS. vl must be set to the number of SEW=32 elements to be processed and therefore must be a multiple of EGS=4.

Zvksed_vsm4k_vi_cg/cr_vl_lmul_egs4_sew32, Zvksed_vsm4r_vv_cg/cr_vl_lmul_egs4_sew32, Zvksed_vsm4r_vs_cg/cr_vl_lmul_egs4_sew32

Zvksed_vstart

Likewise, vstart must be a multiple of EGS=4.

TODO: no coverpoint samples vstart for this suite yet; nothing wired in coverpoints/unpriv/Zvksed_coverage.svh

vsm4k-vi_sewn32_rsv

SEW is any value other than 32

Out-of-Scope: reserved because of CSR state (vtype.sew); Zvksed only generates SEW=32 tests and there is no Ssstrict-equivalent suite for vector-crypto

vsm4k-vi_op

Four rounds of the SM4 Key Expansion are performed.

Zvksed_vsm4k_vi_cg/cp_vd_egs4, Zvksed_vsm4k_vi_cg/cp_imm_5bit_u, Zvksed_vsm4k_vi_cg/cp_vs2_edges_egs4_sm_byte_0, Zvksed_vsm4k_vi_cg/cp_vs2_edges_egs4_sm_byte_3, Zvksed_vsm4k_vi_cg/cr_vl_lmul_egs4_sew32

vsm4r_sewn32_rsv

SEW is any value other than 32

Out-of-Scope: reserved because of CSR state (vtype.sew); Zvksed only generates SEW=32 tests and there is no Ssstrict-equivalent suite for vector-crypto

vsm4r-vs_vdoverlapvs2_rsv

Only for the *.VS form: the vd register group overlaps the vs2 register

TODO: this is an SsstrictV-style reserved-encoding test; Zvksed_vsm4r_vs_cg has no vd/vs2 register-aliasing coverpoint and there is no Ssstrict-equivalent suite for vector-crypto

vsm4r_op

Four rounds of SM4 Encryption/Decryption are performed.

Zvksed_vsm4r_vv_cg/cp_vd_egs4, Zvksed_vsm4r_vv_cg/cr_vs2_vd_edges_egs4_subbytes_sm_0, Zvksed_vsm4r_vv_cg/cr_vl_lmul_egs4_sew32, Zvksed_vsm4r_vs_cg/cr_vs2_vd_edges_egs4_subbytes_sm_0, Zvksed_vsm4r_vs_cg/cr_vl_lmul_egs4_sew32

Zvks_def

Included Extension|Description === Zvksed|extzvksed¶Zvksh|extzvksh¶Zvkb|extzvkb¶Zvkt|extzvkt ===

Definition, checked through UDB

Zvksc_def

Included Extension|Description === Zvks|extzvks¶Zvbc|extzvbc ===

Definition, checked through UDB

Zvksg_def

Included Extension|Description === Zvks|extzvks¶Zvkg|extzvkg ===

Definition, checked through UDB

vsm4k-vi_op_sm4k

Four round keys are read in as a 4-element group from vs2. Each of the next four round keys are generated by iteratively XORing the last three round keys with a constant that is indexed by the Round Group Number, performing a byte-wise substitution, and then performing XORs between rotated versions of this value and the corresponding current round key.

Zvksed_vsm4k_vi_cg/{cp_vs2_edges_egs4_sm_byte_0, cp_vs2_edges_egs4_sm_byte_1, cp_vs2_edges_egs4_sm_byte_2, cp_vs2_edges_egs4_sm_byte_3}

vsm4k-vi_op_rnd

The Round group number comes from uimm[2:0]; the bits in uimm[4:3] are ignored. Round group numbers range from 0 to 7 and indicate which group of four round keys are being generated. Round Keys range from 0&#8205;&#8211;&#8205;31. For example, if uimm=1, then round keys 4, 5, 6, and 7 are being generated.

Zvksed_vsm4k_vi_cg/cp_imm_5bit_u

vsm4r_op_sm4encdec

The four words of current state are read as a 4-element group from vd and the round keys are read from either the corresponding 4-element group in vs2 (vector-vector form) or the scalar element group in vs2 (vector-scalar form). The next four words of state are generated by iteratively XORing the last three words of the state with the corresponding round key, performing a byte-wise substitution, and then performing XORs between rotated versions of this value and the corresponding current state.

Zvksed_vsm4r_vv_cg/{cp_vd_edges_egs4_sm_byte_0, cr_vs2_vd_edges_egs4_subbytes_sm_0}, Zvksed_vsm4r_vs_cg/{cp_vd_edges_egs4_sm_byte_0, cr_vs2_vd_edges_egs4_subbytes_sm_0}

UDB Parameters: None.

A.13.6. Zvksh Vector ShangMi SM3 Hashing

Only Zvksh32 is defined.

Table 146. Zvksh Instruction Coverpoints
Instruction vsm3me.vv vsm3c.vi

RV32

x

x

RV64

x

x

EFFEW32

x

x

cp_asm_count

x

x

cp_vd

egs8

egs8

cp_vs2

egs8

egs8

cp_vs1

egs8

cp_imm_5bit

u

cmp_vd_vs1

egs8

cmp_vs1_vs2

egs8

cp_vs2_edges

egs8

egs8

cp_vd_edges

egs8

cp_vs1_edges

egs8

cr_vs2_vs1_edges

egs8

cr_vs2_vd_edges

egs8

cr_vl_lmul

egs8

egs8

cr_vtype_agnostic

egs8

egs8

cp_vl_0

egs8

egs8

Table 147. Zvksh Normative Rules
Normative Rule Rule Text Coverpoints

Zvksh_egw256b_elem32b

All of these instructions work on 256-bit element groups comprised of eight 32-bit elements.

Zvksh_vsm3c_vi_cg/cp_csr_vtype_lmul_egs8_sew32, Zvksh_vsm3c_vi_cg/cr_vl_lmul_egs8_sew32, Zvksh_vsm3me_vv_cg/cr_vl_lmul_egs8_sew32

Zvksh_dataindeptiming

To help avoid side-channel timing attacks, these instructions shall be implemented with data-independent timing.

Untestable: microarchitectural timing

Zvksh_vl

The number of element groups to be processed is vl/EGS. vl must be set to the number of SEW=32 elements to be processed and therefore must be a multiple of EGS=8.

Zvksh_vsm3c_vi_cg/cr_vl_lmul_egs8_sew32, Zvksh_vsm3me_vv_cg/cr_vl_lmul_egs8_sew32

Zvksh_vstart

Likewise, vstart must be a multiple of EGS=8.

TODO: no coverpoint samples vstart for this suite yet; nothing wired in coverpoints/unpriv/Zvksh_coverage.svh

vsm3c-vi_sewn32_rsv

SEW is any value other than 32

Out-of-Scope: reserved because of CSR state (vtype.sew); Zvksh only generates SEW=32 tests and there is no Ssstrict-equivalent suite for vector-crypto

vsm3c-vi_vdoverlapvs2_rsv

The vd register group overlaps with the vs2 register group

TODO: this is an SsstrictV-style reserved-encoding test; Zvksh_vsm3c_vi_cg has no vd/vs2 register-aliasing coverpoint and there is no Ssstrict-equivalent suite for vector-crypto

vsm3c-vi_op

Two rounds of SM3 compression are performed.

Zvksh_vsm3c_vi_cg/cp_vd_egs8, Zvksh_vsm3c_vi_cg/cp_imm_5bit_u, Zvksh_vsm3c_vi_cg/cr_vs2_vd_edges_egs8, Zvksh_vsm3c_vi_cg/cr_vl_lmul_egs8_sew32

vsm3me-vv_sewn32_rsv

SEW is any value other than 32

Out-of-Scope: reserved because of CSR state (vtype.sew); Zvksh only generates SEW=32 tests and there is no Ssstrict-equivalent suite for vector-crypto

vsm3me-vv_vdoverlapvs2_rsv

The vd register group overlaps with the vs2 register group.

TODO: this is an SsstrictV-style reserved-encoding test; Zvksh_vsm3me_vv_cg has no vd/vs2 register-aliasing coverpoint (only vd/vs1 and vs1/vs2) and there is no Ssstrict-equivalent suite for vector-crypto

vsm3me-vv_op

Eight rounds of SM3 message expansion are performed.

Zvksh_vsm3me_vv_cg/cp_vd_egs8, Zvksh_vsm3me_vv_cg/cr_vs2_vs1_edges_egs8, Zvksh_vsm3me_vv_cg/cr_vl_lmul_egs8_sew32

vsm3c-vi_op_sm3

The current state of eight 32-bit words is read in as an element group from vd. Eight 32-bit message words are read in as an element group from vs2, although only four of them are used. All of the 32-bit input words are byte-swapped from big endian to little endian. These inputs are processed somewhat differently based on the round group (as specified in uimm), and the next state is generated as an element group of eight 32-bit words. The next state of eight 32-bit words are generated, swapped from little endian to big endian, and are returned in an eight-element group.

Zvksh_vsm3c_vi_cg/{cp_vd_edges_egs8, cp_vs2_edges_egs8, cr_vs2_vd_edges_egs8, cp_imm_5bit_u}

vsm3c-vi_op_rnd

The round number is provided by the 5-bit uimm unsigned immediate. Legal values are 0&#8205;&#8211;&#8205;31 and indicate which group of two rounds are being performed. For example, if uimm=1, then rounds 2 and 3 are being performed.

Zvksh_vsm3c_vi_cg/cp_imm_5bit_u

vsm3me-vv_op_sm3

The sixteen most recent 32-bit message words are read in as two eight-element groups from vs1 and vs2. Each of these words is swapped from big endian to little endian. The next eight 32-bit message words are generated, swapped from little endian to big endian, and are returned in an eight-element group.

Zvksh_vsm3me_vv_cg/{cp_vs1_edges_egs8, cp_vs2_edges_egs8, cr_vs2_vs1_edges_egs8}

UDB Parameters: None.

A.13.7. Zvkt Constant-Time Vector Instructions

Not tested yet.

A.14. Miscellaneous RV23 Unprivileged Extensions

A.14.1. Zacas Atomic Compare-and-Swap

Table 148 summarizes the coverpoints for the Zacas extension. The rows with Zabha in the ExtraExtensions column, amocas.b and amocas.h, apply only when Zabha is also supported.

Table 148. Zacas Instruction Coverpoints
Instruction amocas.w amocas.d amocas.d amocas.q amocas.h amocas.b

RV32

x

x

x

x

RV64

x

x

x

x

x

ExtraExtensions

Zabha

Zabha

cp_asm_count

x

x

x

x

x

x

cp_rs1

nx0

nx0

nx0

nx0

nx0

nx0

cp_rs2

x

x

pair

pair

x

x

cp_rd

x

x

pair

pair

x

x

cp_rs2_edges

x

x

x

x

x

x

cmp_rs1_rs2

nx0

nx0

nx0_pair

nx0_pair

nx0

nx0

cmp_rd_rs1

nx0

nx0

nx0_pair

nx0_pair

nx0

nx0

cmp_rd_rs2

x

x

pair

pair

x

x

cmp_rd_rs1_rs2

nx0

nx0

nx0_pair

nx0_pair

nx0

nx0

cp_align

word

hword

byte

cmp_rd_rs1_val_eq

x

x

x

x

cmp_rd_rs1_val_lsb

x

x

x

x

cmp_rd_rs1_val_hw

x

x

x

x

cmp_rd_rs1_val_w

x

x

cmp_rd_rs1_pair_partial_val

x

x

cmp_rd_sign_ext

x

cp_custom

amo_aqrl

amo_aqrl

amo_aqrl

amo_aqrl

amo_aqrl

amo_aqrl

Table 149. Zacas Coverpoint Definitions
Coverpoint Bins Definition

Zacas Value Comparison Coverpoints

cmp_rd_rs1_val_eq

2

original rd value and rs1 value are equal/not equal.

cmp_rd_rs1_val_lsb

2

Least significant byte of original rd and rs1 are equal/not equal.

cmp_rd_rs1_val_hw

2

Lowest 16 bits of original rd and rs1 are equal/not equal.

cmp_rd_rs1_val_w

2

Lowest 32 bits of original rd and rs1 are equal/not equal.

cmp_rd_rs1_pair_partial_val

2

For register pairs, original rd and rs1 have matching high or low halves, but not both.

cmp_rd_sign_ext

2

Value loaded into rd by amocas.w is sign-extended from bit 31 or not.

Table 150. Zacas Normative Rules
Normative Rule Rule Text Coverpoints

Zacas_rv32_amocas-w_op

For RV32, AMOCAS.W atomically loads a 32-bit data value from address in rs1, compares the loaded value to the 32-bit value held in rd, and if the comparison is bitwise equal, then stores the 32-bit value held in rs2 to the original address in rs1. The value loaded from memory is placed into register rd.

Zacas_amocas_w_cg/{cp_rs1_nx0, cp_rs2, cp_rd, cmp_rd_rs1_val_eq}

Zacas_rv32_amocas-d_op

For RV32, AMOCAS.D atomically loads 64-bits of a data value from address in rs1, compares the loaded value to a 64-bit value held in a register pair consisting of rd and rd+1, and if the comparison is bitwise equal, then stores the 64-bit value held in the register pair rs2 and rs2+1 to the original address in rs1. The value loaded from memory is placed into the register pair rd and rd+1.

Zacas_amocas_d_cg/{cp_rs2_pair, cp_rd_pair, cmp_rd_rs1_val_eq, cmp_rd_rs1_pair_partial_val}

Zacas_rv32_amocas-d_frst_pair_entry_reg_even

The instruction requires the first register in the pair to be even numbered; encodings with odd numbered registers specified in rs2 and rd are reserved.

Zacas_amocas_d_cg/{cp_rs2_pair, cp_rd_pair}

Zacas_rv32_amocas-d_rs2_frst_reg_x0

When the first register of a source register pair is x0, then both halves of the pair read as zero.

Zacas_amocas_d_cg/cp_rs2_pair

Zacas_rv32_amocas-d_rd_frst_reg_x0

When the first register of a destination register pair is x0, then the entire register result is discarded and neither destination register is written.

Zacas_amocas_d_cg/cp_rd_pair

Zacas_rv64_amocas-w_op

For RV64, AMOCAS.W atomically loads a 32-bit data value from address in rs1, compares the loaded value to the lower 32 bits of the value held in rd, and if the comparison is bitwise equal, then stores the lower 32 bits of the value held in rs2 to the original address in rs1. The 32-bit value loaded from memory is sign-extended and is placed into register rd.

Zacas_amocas_w_cg/{cp_rs2, cp_rd, cmp_rd_rs1_val_eq, cmp_rd_sign_ext}

Zacas_rv64_amocas-d_op

For RV64, AMOCAS.D atomically loads 64-bits of a data value from address in rs1, compares the loaded value to a 64-bit value held in rd, and if the comparison is bitwise equal, then stores the 64-bit value held in rs2 to the original address in rs1. The value loaded from memory is placed into register rd.

Zacas_amocas_d_cg/{cp_rs1_nx0, cp_rs2, cp_rd, cmp_rd_rs1_val_eq}

Zacas_rv64_amocas-q_op

AMOCAS.Q (RV64 only) atomically loads 128-bits of a data value from address in rs1, compares the loaded value to a 128-bit value held in a register pair consisting of rd and rd+1, and if the comparison is bitwise equal, then stores the 128-bit value held in the register pair rs2 and rs2+1 to the original address in rs1. The value loaded from memory is placed into the register pair rd and rd+1.

Zacas_amocas_q_cg/{cp_rs2_pair, cp_rd_pair, cmp_rd_rs1_val_eq, cmp_rd_rs1_pair_partial_val}

Zacas_rv64_amocas-q_frst_pair_entry_reg_even

The instruction requires the first register in the pair to be even numbered; encodings with odd numbered registers specified in rs2 and rd are reserved.

Zacas_amocas_q_cg/{cp_rs2_pair, cp_rd_pair}

Zacas_rv64_amocas-q_rs2_frst_reg_x0

When the first register of a source register pair is x0, then both halves of the pair read as zero.

Zacas_amocas_q_cg/cp_rs2_pair

Zacas_rv64_amocas-q_rd_frst_reg_x0

When the first register of a destination register pair is x0, then the entire register result is discarded and neither destination register is written.

Zacas_amocas_q_cg/cp_rd_pair

Zacas_amocas_rs1_addr_alignment

AMOCAS.W/D/Q requires that the address held in rs1 be naturally aligned to the size of the operand (i.e., 16-byte aligned for quadwords, eight-byte aligned for doublewords, and four-byte aligned for words).

ExceptionsZaamo_cg/{cp_amo_address_misaligned}

Zacas_amocas_mem_op_success_aq_rl

The memory operation performed by an AMOCAS.W/D/Q, when successful, has acquire semantics if aq bit is 1 and has release semantics if rl bit is 1.

{Zacas_amocas_w_cg, Zacas_amocas_d_cg, Zacas_amocas_q_cg}/cp_custom_aqrl, Ordering OUT-OF-SCOPE for single hart

Zacas_amocas_mem_op_fail_aq_rl

The memory operation performed by an AMOCAS.W/D/Q, when not successful, has acquire semantics if aq bit is 1 but does not have release semantics, regardless of rl.

{Zacas_amocas_w_cg, Zacas_amocas_d_cg, Zacas_amocas_q_cg}/cp_custom_aqrl, Ordering OUT-OF-SCOPE for single hart

Zacas_amocas_w_permission

An AMOCAS.W/D/Q instruction always requires write permissions.

Zabha_amocas-bh_ignore_bits

The AMOCAS.B/H instructions similarly ignore the –1— bits of the original value in rd.

UDB Parameters: None.

A.14.2. Zabha Subword Atomics

Table 151. Zabha Instruction Coverpoints
Instruction amoadd.b amoadd.h amoand.b amoand.h amomax.b amomax.h amomaxu.b amomaxu.h amomin.b amomin.h amominu.b amominu.h

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs1

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

cp_rs2

x

x

x

x

x

x

x

x

x

x

x

x

cp_rd

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs2_edges

x

x

x

x

x

x

x

x

x

x

x

x

cmp_rs1_rs2

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

cmp_rd_rs1

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

cmp_rd_rs2

x

x

x

x

x

x

x

x

x

x

x

x

cmp_rd_rs1_rs2

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

nx0

cp_align

byte

hword

byte

hword

byte

hword

byte

hword

byte

hword

byte

hword

cp_memval

byte

hword

byte

hword

byte

hword

byte

hword

byte

hword

byte

hword

cp_custom

amo_aqrl

amo_aqrl

amo_aqrl

amo_aqrl

amo_aqrl

amo_aqrl

amo_aqrl

amo_aqrl

amo_aqrl

amo_aqrl

amo_aqrl

amo_aqrl

Instruction amoor.b amoor.h amoswap.b amoswap.h amoxor.b amoxor.h

RV32

x

x

x

x

x

x

RV64

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

cp_rs1

nx0

nx0

nx0

nx0

nx0

nx0

cp_rs2

x

x

x

x

x

x

cp_rd

x

x

x

x

x

x

cp_rs2_edges

x

x

x

x

x

x

cmp_rs1_rs2

nx0

nx0

nx0

nx0

nx0

nx0

cmp_rd_rs1

nx0

nx0

nx0

nx0

nx0

nx0

cmp_rd_rs2

x

x

x

x

x

x

cmp_rd_rs1_rs2

nx0

nx0

nx0

nx0

nx0

nx0

cp_align

byte

hword

byte

hword

byte

hword

cp_memval

byte

hword

byte

hword

byte

hword

cp_custom

amo_aqrl

amo_aqrl

amo_aqrl

amo_aqrl

amo_aqrl

amo_aqrl

Table 152. Zabha Normative Rules
Normative Rule Rule Text Coverpoints

Zabha_rd_sign_extension

Byte and halfword AMOs always sign-extend the value placed in rd, and ignore the –0— bits of the original value in rs2.

{Zabha_amoswap_b_cg, Zabha_amoswap_h_cg}/cp_rs2_edges, Zabha_amoswap_b_cg/cp_memval_byte, Zabha_amoswap_h_cg/cp_memval_hword

Zabha_rs1_align_addr

Similar to the AMOs specified in the Zaamo extension, the Zabha extension mandates that the address contained in the rs1 register must be naturally aligned to the size of the operand.

Zabha_amoswap_b_cg/cp_align_byte, Zabha_amoswap_h_cg/cp_align_hword, ExceptionsZaamo_cg/cp_amo_address_misaligned

pma_amo_sz_support

For each level of support, naturally aligned AMOs of a given width are supported if the underlying memory region supports reads and writes of that width.

{Zabha_amoadd_b_cg, Zabha_amoadd_h_cg}/cp_asm_count

UDB Parameters: None.

A.14.3. Zimop Maybe-Ops

Should write 0 to rd unless an extension redefines them.

Table 153. Zimop Instruction Coverpoints
Instruction mop.r.0 mop.r.1 mop.r.2 mop.r.3 mop.r.4 mop.r.5 mop.r.6 mop.r.7 mop.r.8 mop.r.9 mop.r.10 mop.r.11

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_rd

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs1

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs1_edges

x

x

x

x

x

x

x

x

x

x

x

x

cmp_rd_rs1

x

x

x

x

x

x

x

x

x

x

x

x

Instruction mop.r.12 mop.r.13 mop.r.14 mop.r.15 mop.r.16 mop.r.17 mop.r.18 mop.r.19 mop.r.20 mop.r.21 mop.r.22 mop.r.23

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_rd

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs1

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs1_edges

x

x

x

x

x

x

x

x

x

x

x

x

cmp_rd_rs1

x

x

x

x

x

x

x

x

x

x

x

x

Instruction mop.r.24 mop.r.25 mop.r.26 mop.r.27 mop.r.28 mop.r.29 mop.r.30 mop.r.31 mop.rr.0 mop.rr.1 mop.rr.2 mop.rr.3

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

x

x

x

x

cp_rd

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs1

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs2

x

x

x

x

cp_rs1_edges

x

x

x

x

x

x

x

x

x

x

x

x

cp_rs2_edges

x

x

x

x

cmp_rd_rs1

x

x

x

x

x

x

x

x

x

x

x

x

cmp_rs1_rs2

x

x

x

x

cmp_rd_rs2

x

x

x

x

cmp_rd_rs1_rs2

x

x

x

x

Instruction mop.rr.4 mop.rr.5 mop.rr.6 mop.rr.7

RV32

x

x

x

x

RV64

x

x

x

x

cp_asm_count

x

x

x

x

cp_rd

x

x

x

x

cp_rs1

x

x

x

x

cp_rs2

x

x

x

x

cp_rs1_edges

x

x

x

x

cp_rs2_edges

x

x

x

x

cmp_rd_rs1

x

x

x

x

cmp_rs1_rs2

x

x

x

x

cmp_rd_rs2

x

x

x

x

cmp_rd_rs1_rs2

x

x

x

x

Table 154. Zimop Normative Rules
Normative Rule Rule Text Coverpoints

Zimop_mop-r_op

The Zimop extension defines 32 MOP instructions named MOP.R.n, where n is an integer between 0 and 31, inclusive. Unless redefined by another extension, these instructions simply write 0 to x[rd].

{Zimop_mop_r_0_cg, Zimop_mop_r_31_cg}/{cp_rd, cp_rs1_edges}

Zimop_mop-rr_op

The Zimop extension additionally defines 8 MOP instructions named MOP.RR.n, where n is an integer between 0 and 7, inclusive. Unless redefined by another extension, these instructions simply write 0 to x[rd].

{Zimop_mop_rr_0_cg, Zimop_mop_rr_7_cg}/{cp_rd, cp_rs1_edges}

Zimop_mop-r_enc

{Zimop_mop_r_0_cg, Zimop_mop_r_1_cg, Zimop_mop_r_30_cg, Zimop_mop_r_31_cg}/cp_asm_count

Zimop_mop-rr_enc

{Zimop_mop_rr_0_cg, Zimop_mop_rr_1_cg, Zimop_mop_rr_6_cg, Zimop_mop_rr_7_cg}/cp_asm_count

UDB Parameters: None.

A.14.4. Zcmop Compressed Maybe-Ops

Should write 0 to rd unless an extension redefines them.

Table 155. Zcmop Instruction Coverpoints
Instruction c.mop.1 c.mop.3 c.mop.5 c.mop.7 c.mop.9 c.mop.11 c.mop.13 c.mop.15

RV32

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

cp_asm_count

x

x

x

x

x

x

x

x

cp_custom

mop_no_write

mop_no_write

mop_no_write

mop_no_write

mop_no_write

mop_no_write

mop_no_write

mop_no_write

Table 156. Zcmop Normative Rules
Normative Rule Rule Text Coverpoints

Zcmop_op

This section defines the Zcmop extension, which defines eight 16-bit MOP instructions named C.MOP.N, where N is an odd integer between 1 and 15, inclusive.

{Zcmop_c_mop_1_cg, Zcmop_c_mop_3_cg, Zcmop_c_mop_5_cg, Zcmop_c_mop_7_cg}/cp_asm_count

Zcmop_enc

C.MOP.N is encoded in the reserved encoding space corresponding to C.LUI xN, 0, as shown in norm:c-mop_enc.

{Zcmop_c_mop_1_cg, Zcmop_c_mop_3_cg, Zcmop_c_mop_5_cg, Zcmop_c_mop_7_cg}/cp_asm_count

c-mop_enc

Mnemonic|Encoding|Redefinable to read register === C.MOP.1|0110000010000001|x1¶C.MOP.3|0110000110000001|x3¶C.MOP.5|0110001010000001|x5¶C.MOP.7|0110001110000001|x7¶C.MOP.9|0110010010000001|x9¶C.MOP.11|0110010110000001|x11¶C.MOP.13|0110011010000001|x13¶C.MOP.15|0110011110000001|x15 ===

{Zcmop_c_mop_1_cg, Zcmop_c_mop_3_cg, Zcmop_c_mop_5_cg, Zcmop_c_mop_7_cg}/cp_asm_count

Zcmop_instr_write

Unlike the MOPs defined in the Zimop extension, the C.MOP.N instructions are defined to not write any register.

{Zcmop_c_mop_1_cg, Zcmop_c_mop_3_cg, Zcmop_c_mop_5_cg, Zcmop_c_mop_7_cg}/cp_custom_mop_no_write

UDB Parameters: None.

A.15. Miscellaneous Non-RV23 Unprivileged Extensions

A.15.1. Zfinx Float in Integer Regs

Zfinx replaces the F extension with a similar set of instructions that operate on x registers instead of f registers. Zdinx and Zhinx are similar.

A.15.2. Zdinx Double in Integer Regs

A.15.3. Zhinx Half in Integer Regs

A.15.4. Zhinxmin Half Converts in Integer Regs

A.15.5. Q Quad-Precision Floating-Point

A.15.6. ZfhQ Half-Quad Instructions

A.15.7. ZfhminQ Half-Quad Conversion Instructions

ZfhQ Coverpoints

Note that ZfhminQ is the same as ZfhQ

A.15.8. ZfaQ Additional Quad-Precision Floating-Point Instructions

A.15.9. ZfaZfhQ Additional Half-Quad Conversion Instructions

A.15.11. Zcmt Compressed Jump Tables

Table 158. Zcmt Normative Rules
Normative Rule Rule Text Coverpoints

cm-jalt_op

CM.JALT reads an entry from the jump vector table in memory and jumps to the address that was read, linking to ra.

TODO

cm-jt_op

CM.JT reads an entry from the jump vector table in memory and jumps to the address that was read.

TODO

cm-mva01s_op

moves r1s' into a0 and r2s' into a1.

TODO

cm-mva01s_sreg

The encoding uses sreg number specifiers instead of xreg number specifiers to save encoding space.

TODO

cm-mvsa01_op

moves a0 into r1s' and a1 into r2s'. r1s' and r2s' must be different.

TODO

cm-mvsa01_sreg

The encoding uses sreg number specifiers instead of xreg number specifiers to save encoding space.

TODO

cm-pop_op

This instruction pops (loads) the registers in reg_list from stack memory, and then adjusts the stack pointer by stack_adj.

TODO

cm-popret_op

pops (loads) the registers in reg_list from stack memory, adjusts the stack pointer by stack_adj and then returns to ra.

TODO

cm-popretz_op

pops (loads) the registers in reg_list from stack memory, adjusts the stack pointer by stack_adj, moves zero into a0 and then returns to ra.

TODO

cm-push_op

pushes (stores) the registers in reg_list to the memory below the stack pointer, and then creates the stack frame by decrementing the stack pointer by stack_adj, including any additional stack space requested by the value of spimm.

TODO

jvt_base_vm

jvt.⁠BASE is a virtual address, whenever virtual memory is enabled.

TODO

jvt_mode_acc

jvt.⁠MODE is a WARL field, so can only be programmed to modes which are implemented.

TODO

jvt_op

If Zcmt is implemented then jvt must also be implemented, but can contain a read-only value.

TODO

jvt_reg

The jvt register is an XLEN-bit WARL read/write register that holds the jump table configuration, consisting of the jump table base address (BASE) and the jump table mode (MODE).

TODO

Zcmt_endian

Table entries follow the current data endianness. This is different from normal instruction fetch which is always little-endian.

TODO

Zcmt_entry_sz

The base of the table is in the jvt CSR (see csrs-jvt), each table entry is XLEN bits.

TODO

Zcmt_fetch

For a table jump instruction, the table entry that the instruction selects is considered an extension of the instruction itself.

TODO

Zcmt_table

Table jump uses a 256-entry XLEN wide table in instruction memory to contain function addresses. The table must be a minimum of 64-byte aligned.

TODO

Zcmt_trap

If an exception occurs on either instruction fetch, xEPC is set to the PC of the table jump instruction, xCAUSE is set as expected for the type of fault and xTVAL (if not set to zero) contains the fetch address which caused the fault.

TODO

UDB Parameters: None.

A.15.12. Zilsd Load/Store Double

A.15.13. Zclsd Compressed Load/Store Double

A.16. E Base Embedded Extension

Zclsd Coverpoints

The E Base ISA is a variant of I with 16 general purpose registers. This test plan also includes tests restricted to these 16 registers for simple extensions most likely to be implemented on an embedded core.

All unprivileged tests for RV32 and RV64 can have E equivalents. They are distinguished in the tests directory by rv32i, rv64i, rv32e, and rv64e subdirectories. By default, the test generator only creates rv32e/rv64e tests for the following extensions because embedded cores are most likely to implement these extensions. However, embedded tests for more extensions can be generated by editing the E_EXTENSION_TESTS variable in the riscv-arch-test generators/testgen/src/testgen/testgen.py script.

  • E (base ISA)

  • M (multiply/divide)

  • Zmmul (multiply)

  • Zca (compressed)

  • Zcb (more compressed)

  • Zcmp (compressed push/pop)

  • Zcmt (compressed table jumps)

  • Zba (bitmanip address)

  • Zbb (bitmanip basic)

  • Zbs (bitmanip single-bit)

The normative rule specific to the E base ISA is given in Table 159. Each instruction also has normative rules inherited from its extension.

Table 159. E Normative Rules
Normative Rule Rule Text Coverpoints

diff_rv32e_rv32i

RV32E and RV64E use the same instruction-set encoding as RV32I and RV64I respectively, except that only registers x0‍–‍x15 are provided. All encodings specifying the other registers x16‍–‍x31 are reserved.

E_add_cg/{cp_rs1, cp_rs2, cp_rd}, SsstrictSm_instr_cg/cp_upperreg_rs1

UDB Parameters: None.

The E base ISA and other extensions based on it use the same coverpoints as the I base ISA. However, the register coverpoints such as cp_rd, cpr_rs1, cp_rs2, cmp_rd_rs1, etc. only exercise the 16 registers x0 through x15 when E is enabled. (See the get_gpr_reg function in framework/src/act/fcov/coverage/RISCV_instruction_base.svh, which is controlled by the COVER_E symbol).

Privileged tests are written using only x0-x15, so they work for both E and I base ISAs. One exception is that Ssstrict tests using the upper registers, which should be reserved and trap in E.

Appendix B: Privileged Test Plan

Privileged test plan spreadsheets are available. They need to be edited into a more standardized format. Each test plan spreadsheet contains multiple columns for the applicable configurations. For example, Sm applies to any configuration with machine mode, S applies to any configuration with supervisor mode, and the Sm_F tests within Sm apply to any configuration that also has floating-point.

The privileged testplan is organized by major categories of behaviors or extensions in the following sections. Each of these categories has multiple coverage files with suffixes indicating the circumstances to which they apply. For example, InterruptsSm applies to any configuration with Zicsr and M-mode, and InterruptsS applies to any configuration with Zicsr and S-mode. Each test boots to the mode in its suffix and then runs in every supported privilege mode at or below that mode: InterruptsSm exercises M-, S-, U-, VS- and VU-mode, while InterruptsS boots to S-mode and exercises S-, U-, VS- and VU-mode with mideleg left at its boot value, so a delegated interrupt taken in U-mode is checked to arrive in S-mode.

B.1. Priv

The privileged tests exercise CSRs that are mandatory in each privilege mode. They also test mandatory privileged instructions: ecall, ebreak, mret, and sret. The CSR read/write/set/clear instructions themselves are tested in the unprivileged Zicsr tests of Section A.10.2.

wfi is tested in Section B.3 and sfence.vma is tested in Section B.8.

Privileged tests do not test reserved or custom instructions or CSRs because their behavior is UNSPECIFIED. Reserved instructions and CSRs are tested in the Section B.6 Ssstrict tests, where they should throw an Illegal Instruction exception if not implemented.

B.1.1. Sm Machine-Mode CSRs and Instructions

These test CSRs and privileged instructions in machine mode. The Sm suite also contains the Sm_F, Sm_V, and Sm_VF tests of the floating-point and vector CSRs and mstatus.FS/mstatus.VS, which run only when F, Zve32x, or Zve32f is also supported.

Table 160. Sm Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule Notes

cp_mcsr_access

Access to all M-mode CSRs

csr read, write all 1s, write all 0s, set all 1s, clear all 1s, write back initial value of each register below plus read-only mvendorid, marchid, mimpid, mhartid, mconfigptr

Traps on writes to read-only registers. Otherwise writable bits match reference model.

(14+5) regs * 6 ops

m_mode_first_at_reset
medelegh_sz_acc_enc_xlen32
medeleg_sz_acc
mideleg_sz_acc
medeleg_mideleg_mandatory_s_mode
medeleg_mideleg_warl
medeleg_no_rd1
mideleg_no_rd1
mideleg_rd1_lower_level
medeleg_when_rd0
medeleg_16_rdonly0
mip_sz_acc
mip_mandatory
mie_sz_acc
mie_mandatory
mhpmcounter_mhpmevent_rdonly0
mhpmevent_sz_warl_op
mcounteren_sz
mcounteren_enc_img
mcounteren_flds_mandatory_warl
mcounteren_flds_rdonly0
mcountinhibit_enc_img
mcountinhibit_sz_warl
mscratch_sz_acc
mscratch_enc_img
mepc_sz_acc
mepc_align
mepc_warl
mepc_enc_img
mtval_sz_acc
mtval_rdonly0
mtval_enc_img
mtval_warl
Zicsr_write_ro
Zicsr_warl
m_mode_priv_at_reset
mcause (WLRL), mstatus/h (WPRI), menvcfg/h (WPRI), mseccfg/h (WPRI) could be weird/hard to model

cp_mcsrwalk

Walking 1s and 0s in each writeable M-mode CSR

Set and clear each bit of each writable M-mode CSR to exercise bitfields: mstatus, medeleg, mideleg, mie, mtvec, mcounteren, mscratch, mepc, mcause, mtval, mip, menvcfg, mseccfg. For RV32 also mstatush, medelegh, menvcfgh, mseccfgh, mcountinhibit, mhpmevent31:3.. misa is fussy to model and is tested in cp_misa* instead. Iterations that write a reserved mstatus.MPP, menvcfg.CBIE, or menvcfg/mseccfg.PMM value check the other bits exactly and only check that the field reads back a legal value.

Writable bits match reference model.

14 regs * (64 set + 64 clear)

mip_meip_rdonly
mip_mtip_rdonly
mip_msip_rdonly
mip_mandatory
mip_bits_wr_or_rdonly
mie_bits_wr
mie_bits_rdonly0
mip_msip_mie_msie_maybe_rdonly0
std_mach_intr_impl
mip_sxip_mie_sxie_rdonly0
mip_lcofip_acc
mip_lcofip_mie_lcofie_rdonly0
Zicsr_warl_def

cp_misa_mxl

misa.MXL

Attempt to write all four values to misa.MXL, clear, set.. Read back

matches MXLEN and does not change

7

misa_acc
misa_always_rd
misa_csr_implemented
misa_enc_img
misa_mxl_op_isa
misa_mxl_op_nz
xlen_le_mxlen
misa_mxl_acc
misa_mxl_enc
misa_sz
misa_extensions_reset_maximal
misa_extensions_reset_ref
misa_extensions_rsv_ret_0
misa_i_op
misa_e_op
misa_m_op
misa_s_op
misa_u_op
misa_e_not_i
Zicsr_write_ro
Other MISA bits are unpredictable and thus not tested.

cp_misa_dependencies

Attempt to write I, E = 1. E should read 0 if I reads 1
Attempt to write I, E = 0. One should read 1
Attempt to write F=0, D=1. D should read 0 if F reads 0
Attempt to write F = 1, D = 0, Q = 1. Q should read 0 if D reads 0
Attempt to write S = 1, U = 0. S should read 0 if U = 0
Attempt to write H = 1, S = 0. H should read 0 if S = 0
Attempt to write H = 1, S = 1, U = 0. H should read 0 if U = 0

See tests

7

misa_acc
misa_enc_img
misa_extensions_enc_txt
misa_extensions_enc_tbl
misa_extensions_warl_op
misa_extensions_dependencies
misa_extensions_collective_warl

cp_misa_clear_c

Attempt to clear C when subsequent instruction is not a multiple of 2. C should not change.

C should not change

1

misa_inc_ialign

cp_csrr_insufficient_priv

Debug registers should be inaccessible from M-mode

Read Debug CSRS 7B0-7BF

Illegal Instruction

16

cp_csrw_readonly

Read-only registers should trap when written

Write read-only CSRs (C00-FFF)

Illegal Instruction

1024 CSRs

cp_cntr_access

Access to all 32 counters

csr_read, write nonzero, write 0, set nonzero, clear all for each of for mcycle, minstret, mhpmcounter31…​3. If RV32 is supported, also do mcycleh, minstreth, mhpmcounterh31…​3. Read back value and check if it is within some threshold of the written value (because counters will continue to increment).

Writable bits match reference model.

32 regs * 6 ops

mcycle_op
mcycle_minstret_sz
mcycle_minstret_rst
mcycle_minstret_wr
mcycleh_minstreth_mhpmh_op
minstret_op
mhpmcounter_num
mhpmcounter_warl
mhpmcounter_mandatory
mhpmcounter_mhpmevent_rdonly0
mhpmcounter_sz

cp_mtime_write

Writing memory-mapped MTIME shows up in time CSR

If Zicntr is supported, Write walking 1s and 0s to memory-mapped mtime, read back from time CSR

Time reflects memory-mapped mtime. Difference should be small.

time_op_rdonly
mtime_acc
mtime_enc_img
time_timeh_visibility_mtime
Presently just writing one value

cp_inhibit

mcountinhibit prevents counting

With mcountinhibit[2/0] = {0, 1}, read mcycle and minstret multiple times and check whether they increment.

Count when not inhibited, remain constant when inhibited

2

mcountinhibit_sz_warl
mcountinhibit_clear_op

cp_mcause_write

Legal values can be written to mcause

with interrupt = 1: 0-13
with interrupt = 0: 0-23

writes mcause

81 values

mcause_sz_acc
mcause_mandatory
mcause_enc_img
mcause_exccode_wlrl
Zicsr_wlrl
mcause_exccode_enc_img

cp_mstatus_sd_write

FS/VS/XS combinations can be written and SD is true when any are dirty.

Write 1 and 0 to SD with FS/VS/XS all 0. Write cross-product of all bits of SD/ FS/ VS/XS. 128 bins of writes.

FS =1 iff any of FS/VS/XS are dirty.

2 SD * 4 FS * 4 VS * 4 XS = 128

mstatus_sd_acc
mstatus_sd_summary_op
mstatus_sd_vs_dirty_op
mstatus_sd_rdonly0
mstatus_sd_formula

cp_mprivinst

ecall and ebreak cause traps

Execute ecall and ebreak in machine mode

ecall and breakpoint exceptions

2

ecall_ebreak_epc_value

cp_mret

mret returns and affects status bits

Execute mret in machine mode with cross-product of values written to mstatus.MPP/ MPRV/ MPIE/MIE. Return to machine mode and MIE = 1 after each mret.

2 MPRV * 2 MIPE * 2 MIE = 8

mstatus_xret_op
mstatus_mprv_clr_mret_sret_less_priv
xret_op
xret_enc_img
mret_presence
priv_levels_tbl
Zicsr_implicit_read

cp_sret

sret returns and affects status bits

Execute sret in machine mode with cross-product of mstatus.SPP/MPRV/TSR/SPIE/SIE

Illegal instruction if TSR

2 SPP * 2 MPRV * 2 TSR * 2 SPIE * 2 SIE = 32

mstatus_xret_op
mstatus_mprv_clr_mret_sret_less_priv
sret_presence
xret_in_higher_mode
xret_enc_img

cp_sret_s

If S_SUPPORTED:
Execute sret in supervisor mode with cross-product of all values of sstatus.SPP/SPIE/SIE, mstatus.TSR. Return to supervisor mode after each sret. This differs from cp_sret_s in S that doesn’t turn on mstatus.TSR (which would require illegal instructions not to be delegated in S mode to avoid a sret trap loop).

sstatus_spp
sstatus_spie
sret_ill_inst_exc_rst
mstatus_xret_op
mstatus_mprv_clr_mret_sret_less_priv
mstatus_tsr_op
sepc should be pointing two instructions ahead.

cp_scsr_from_m

If S supported, read/write/set/clear each S-mode CSR: sstatus, scause, sie, stvec, scounteren, senvcfg, sscratch, sip. sepc and stval are not tested because it is hard to express what values are legal.

Zicsr_higher_priv
m_access_all_lower_priv_csrs

cp_satp_from_m

If S is supported, read satp with mstatus.TVM=0/1

shouldn’t trap on either TVM. Value is not predictable.

cp_satp_from_s

If S is supported, read satp with mstatus.TVM=0/1 from S mode

cp_shadow

Check subset

If S_supported:
Write all zeros and all 1s to mstatus, mie, mip. Read back sstatus, sie, sip. Write all 0s and all 1s to sstatus, sie, sip. Read back mstatus/mie/mip.

sstatus_subset_mstatus

cp_shadow_deleg

Delegation affects shadowing

With delegation on and off, write mip/mie, read back sip/sie. Write sip/sie, read back mip/mie

cp_shadow_deleg_walk

With walking 1s in mideleg, mip/mie = 1s, read back sip/sie

Sm does not access unsupported lower privilege mode CSRs because they are reserved if not implemented, and their behavior is UNSPECIFIED.

If F is mutable, zeroing it should also zero D and Q and V. Same with D zeroing Q and V. Zeroing U should zero S.

Writing misa may increase IALIGN, e.g., by disabling the "C" extension. If an instruction that would write misa increases IALIGN, and the subsequent instruction’s address is not IALIGN-bit aligned, the write to misa is suppressed, leaving misa unchanged."

Sm_F tests (Sm_F-NN.S): the floating-point CSRs and mstatus.FS, run when F is also supported.

cp_fcsr_access

Writing to the CSR field
(WARL)

Write 0s and 1s to fcsr, frm, fflags cross with mstatus.FS init/clean/dirty

Zicsr_higher_priv
m_access_all_lower_priv_csrs
mstatus_fs_vs_xs_off_op
mstatus_fs_vs_xs_dirty_op

cp_mstatus_FS_transition

Writing to the CSR field
(WARL)

Each different type of floating-point instruction crossed with four values of FS. Includes integer-result instructions that raise a flag after fflags is cleared (feq.s with a signaling NaN, fcvt.w.s of an inexact value, fcvt.wu.s of an out-of-range value, fcvtmod.w.d of a NaN).

mstatus_fs_op
mstatus_fs_vs_xs_enc
mstatus_fs_acc1
mstatus_sd_summary_op
mstatus_sd_formula
mstatus_fs_vs_xs_off_op
mstatus_fs_vs_xs_dirty_op
mstatus_fs_no_dirty_track
check FS becomes dirty where appropriate
instructions that set fflags must set FS to dirty even if they write no floating-point register

cp_mstatus_FS_transition_nondeterministic

Writing to the CSR field
(WARL)

Floating-point instructions that need not modify floating-point state (fsw, fmv.x.w, fclass.s, csrr of the FP CSRs, fmvh.x.d) crossed with mstatus.FS = Off and Dirty

Illegal-instruction trap when FS = Off; FS stays Dirty when Dirty. Initial and Clean are omitted because these instructions may dirty FS imprecisely.

mstatus_fs_imprecise

Sm_V tests (Sm_V_vcsr-NN.S, Sm_V_vset-NN.S): the vector CSRs, vset{i}vl{i}, vstart and mstatus.VS, run when Zve32x is also supported.

cp_vcsrrswc

Confirm that all vector CSR properties are properly set with regards to read write, clear, and set privileges with the csr instructions

With each of the vector CSRs conduct a read, write, clear, and set operation on the CSR

Will abide by spec’s read and write permissions for each csr

3 csr instructions * 7 CSRs

Zicsr_higher_priv
m_access_all_lower_priv_csrs
vlenb_acc_op
vcsr_vxrm_op
vcsr_vxsat_op
vcsr_vxrm_vxsat_acc
Zve32x_dependent_Zicsr

test written: yes
spec: The vector extension adds 32 vector registers, and seven unprivileged CSRs (vstart, vxsat, vxrm, vcsr, vtype, vl, vlenb) to a base scalar RISC-V ISA.
read-only CSR vlenb
The XLEN-bit-wide read-only vl CSR can only be updated by the vset{i}vl{i} instructions, and the fault-only-first vector load instruction variants.
read-only XLEN-wide vector type CSR, vtype provides the default type used to interpret the contents of the vector register file, and can only be updated by vset{i}vl{i}

cp_vcsrs_walking1s

Confirm that that all writable vector CSRs have the correct bits writeable

With each of the vector CSRs that are writable, write all XLEN 1-hot values to the csr

csrs will be updated based on which bits they support to be writable

4 CSRs * XLEN 1-hot values

mstatus_vs_op
vstart_acc_sz
vxrm_val_sz_acc
vxsat_op_acc_sz

test written: yes
spec: vstart, vxrm, vxsat, vcsr are all writable

cp_mstatus_vs_set_dirty_arithmetic

Confirm that after running an arithmetic vector instruction that mstatus.VS is set to dirty when set to "clean" or "initial"

Run a .vv vector arithmetic instruction with mstatus.VS = {clean, initial}

mstatus.VS is set to dirty

2 mstatus.VS bins

mstatus_vs_sstatus_vs_op
mstatus_vs_op_initial_clean
vsstatus_vs_mstatus_vs_op_active

test written: yes
spec: When mstatus.VS is set to Initial or Clean, executing any instruction that changes vector state, including the vector CSRs, will change mstatus.VS to Dirty.

cp_mstatus_vs_set_dirty_csr

Confirm that after running a vsetvli instruction that mstatus.VS is set to dirty when set to "clean" or "initial"

Run a vsetvli instruction with mstatus.VS = {clean, initial}

mstatus.VS is set to dirty

2 mstatus.VS bins

mstatus_vs_op
mstatus_vs_op_initial_clean
vsstatus_vs_mstatus_vs_op_active

test written: yes
spec: When mstatus.VS is set to Initial or Clean, executing any instruction that changes vector state, including the vector CSRs, will change mstatus.VS to Dirty.

Analogous to the way in which the floating-point unit is handled, the mstatus.VS field may exist even if misa.V is clear.

feature (coverpoint written): Untestable

cp_mstatus_vs_off_arithmetic

Confirm that when misa.V is 1 and mstatus.VS is off, an arithmetic vector instruction raises an illegal instruction exception

With misa.V = 1 (its reset value), set mstatus.VS = {00} and run a .vv vector instruction

illegal instruction exception

1

mstatus_vs_sstatus_vs_op
mstatus_fs_vs_xs_off_op
mstatus_vs_op_off

test written: yes, confirm sig
spec: Attempts to execute any vector instruction, or to access the vector CSRs, raise an illegal-instruction exception when mstatus.VS is set to Off.

cp_mstatus_vs_off_csr

Confirm that when misa.V is 1 and mstatus.VS is off, an csr vector instruction raises an illegal instruction exception

With misa.V = 1 (its reset value), set mstatus.VS = {00} and run a vsetvli

illegal instruction exception

1

mstatus_fs_vs_xs_off_op

test written: yes, confirm sig
spec: Attempts to execute any vector instruction, or to access the vector CSRs, raise an illegal-instruction exception when mstatus.VS is set to Off.

For implementations with a writable misa.V field, the vsstatus.VS field may exist even if misa.V is clear.

feature (coverpoint written): Untestable

Vset{i}vl{i}

cp_sew_lmul_vset_i_vli

Confirm that all combinations of lmul crossed with sew correctly set the vtype register in accordance with the vill field

Use all vset{i}vli instructions to cross eSEW={8/16/32/64} with mLMUL = {f8/f4/f2/1/2/4/8} rd and uimm can be any nonzero value

vtype.vill becomes 1 and other bits become 0 on illegal combinations, such as sew = 1xx.

2 instructions * 7 lmul bins * 4 sew bins

vtype_sz_acc_op
vtype_vsew_op
vtype_lmul_val
vtype_lmul_fval
vtype_sew_val
vset_op
vtype_vstart_op
vtype_acc

test written: yes
spec: Implementations must consider all bits of the vtype value to determine if the configuration is supported. An unsupported value in any location within the vtype value must result in vill being set. In particular, all XLEN bits of the register vtype argument to the vsetvl instruction must be checked. Implementations cannot ignore fields they do not implement. All bits must be checked to ensure that new code assuming unsupported vector features in vtype traps instead of executing incorrectly on an older implementation…​.The supported element width may vary with LMUL
The use of vtype encodings with LMUL < SEWMIN/ELEN is reserved, but implementations can set vill if they do not support these configurations.

cp_sew_lmul_vsetvl

Confirm that all combinations of lmul crossed with sew correctly set the type register in accordance with the vill field

Use vsetvl to cross rs2.sew= [3’b000:3’b011] with rs2.lmul = [000, 001, 010, 011, 101, 110, 111]. rd and uimm can be any nonzero value. Make sure rs2_val[`XLEN-1:8] = 0
rs2 must be this way to be a legal setting

vtype.vill becomes 1 and other bits become 0 on illegal combinations, such as sew = 1xx.

7 lmul bins * 4 sew bins

vtype_sz_acc_op
vtype_fields_sz
vset_op
vtype_vstart_op
vtype_acc

test written: yes
spec: Implementations must consider all bits of the vtype value to determine if the configuration is supported. An unsupported value in any location within the vtype value must result in vill being set. In particular, all XLEN bits of the register vtype argument to the vsetvl instruction must be checked. Implementations cannot ignore fields they do not implement. All bits must be checked to ensure that new code assuming unsupported vector features in vtype traps instead of executing incorrectly on an older implementation…​.The supported element width may vary with LMUL
The use of vtype encodings with LMUL < SEWMIN/ELEN is reserved, but implementations can set vill if they do not support these configurations.

cp_sew_lmul_vset_i_vli / cp_sew_lmul_vsetvl

Confirm on the supported values of lmul are recognized as legal

Use vsetivli rd, 1, sew={supported}, vlmul={supported(mf8/mf4/mf2/)m1/m2/m4/m8}, tu, mu to attempt to set all values of lmul

Expect vill is set for all values of lmul that aren’t legal, otherwise the correct lmul is set

0

feature (coverpoint written): Covered by coverpoint above
spec: Implementations must support LMUL integer values of 1, 2, 4, and 8…​.Implementations must provide fractional LMUL settings that allow the narrowest supported type to occupy a fraction of a vector register corresponding to the ratio of the narrowest supported type’s width to that of the largest supported type’s width

cp_sew_lmul_vset_i_vli / cp_sew_lmul_vsetvl

Check all values of sew to Confirm only correctly supported values are recognized as legal

Use vsetivli rd, 1, sew={e8/e16/e32/e64}, vlmul={m1}, tu, mu to attempt to set all values of lmul

Expect vill will be set when an attempted unsupported sew values are attempted to be written, otherwise vtype will contain supported sew

0

feature (coverpoint written): Covered by coverpoint above
spec: Implementations must support LMUL integer values of 1, 2, 4, and 8…​.Implementations must provide fractional LMUL settings that allow the narrowest supported type to occupy a fraction of a vector register corresponding to the ratio of the narrowest supported type’s width to that of the largest supported type’s width

cp_vill_vset_i_vli

Check that vset{i}vli instructions properly clear the vill bit when writing a valid vtype configuration

Run vsetvli and vsetivli with eSEW = {8/16/32/64} with mLMUL = {8} and vtype.vill = {1}
we set lmul to 8 to write a non-zero value to the CSR

expect vill bit is cleared and vtype written when sew is legal

2 instructions * 4 sew bins

test written: yes
spec: If the vill bit is set, then any attempt to execute a vector instruction that depends upon vtype will raise an illegal-instruction exception [except]…​.vset{i}vl{i} …​. [does] not depend upon vtype

cp_vill_vsetvl

Check that vsetvl instruction properly clears the vill bit when writing a valid vtype configuration

Run vsetvl with rs2.sew = {8/16/32/64} with rs2.lmul = {8} and vtype.vill = {1} making sure rs2_val[`XLEN-1:8] = 0
we set lmul to 8 to write a non-zero value to the CSR. rs2 must be in this manner to be a legal setting

expect vill bit is cleared and vtype written when sew is legal

4 sew bins

vtype_vill_val
vtype_vill_val_vill
vtype_vill_all_bits

test written: yes
spec: If the vill bit is set, then any attempt to execute a vector instruction that depends upon vtype will raise an illegal-instruction exception [except]…​.vset{i}vl{i} …​. [does] not depend upon vtype

cp_vill_vsetvl_rs2_vill

Check that when attempting to set a valid configuration but with the rs2.vill bit set, and the vtype.vill bit set, that the register remains all zeros besides the vill bit

Run vsetvl with rs2.sew = {8/16/32/64} with vtype.lmul = {8} and vtype.vill = {1} making sure rs2_val[`XLEN-2:8] = 0 and rs2[XLEN-1] = 1
we set lmul to 8 to attempt to write a non-zero value to the CSR. rs2 must be in this manner to be a legal setting.

vtype register remains unchanged

4 sew bins

test written: yes
spec: If the vill bit is set, then any attempt to execute a vector instruction that depends upon vtype will raise an illegal-instruction exception [except]…​.vset{i}vl{i} …​. [does] not depend upon vtype

cp_vsetvl_rs2_vill

Confirm that with vsetvl if rs2 has the vill bit set that it is treated as an unsupported configuration

run a vsetvl with rs2[XLEN-1] = 1, rs2[XLEN-2:8]=0 and rs2.sew = {supported} and rs2.lmul = 1 and vtype.vill = {0}
sew must be supported and rs2[XLEN-2:8] zero to verify the configuration is illegal due to the vill bit being set

vill bit should be set

spec: A vtype value with vill set is treated as an unsupported configuration.

cp_vset_vill

Confirm that writing 1 to vill clears other bits of vtype

Set rs1 nonzero, rs1 = 1 in XLEN-1, 11 in 7:6 (vma/vta). vsetvl rd, rs1, rs2 and vtype.vill = {0}

vtype.vill becomes 1 and other bits become 0

1

feature (coverpoint written): covered by coverpoint above
spec: When the vill bit is set, the other XLEN-1 bits in vtype shall be zero.

cp_vtype_vill_set_vl_0

Confirm that if an unsupported configuration is set, that vl is set to zero

Run vsetvl with rs1 non-zero and rs2 vill bit set and vl =! 0

vl should be set to zero

1

vtype_lmul_fval_rsv
vtype_vstart_op

test written: yes
spec: If the vtype value is not supported by the implementation, then the vill bit is set in vtype, the remaining bits in vtype are set to zero, and the vl register is also set to zero.

cp_vsetvl_rd_nx0_rs1_x0

Confirm that when running a vsetvl instruction with rd != x0 and rs1 = x0 that vl is set to vlmax

with vl != vlmax, conduct vsetvl with rd != x0 and rs1 = x0. Cross with sew = {8/16/32/64} and respective supported lmul {supported(f8,f4,f2,)1,2,4,8}
we want vl != vlmax since similar syntax leaves vl unmodified.

vl csr is set to vlmax

4 sew bins * 7 lmul bins

test written: yes
spec: When rs1=x0 but rd≠x0, the maximum unsigned integer value (~0) is used as the AVL, and the resulting VLMAX is written to vl and also to the x register specified by rd.

cp_vsetvli_rd_nx0_rs1_x0

Confirm that when running a vsetvli instruction with rd != x0 and rs1 = x0 that vl is set to vlmax

with vl != vlmax, conduct vsetvli with rd != x0 and rs1 = x0. Cross with sew = {8/16/32/64} and respective supported lmul {supported(f8,f4,f2,)1,2,4,8}
we want vl != vlmax since similar syntax leaves vl unmodified.

vl csr is set to vlmax

4 sew bins * 7 lmul bins

test written: yes
spec: When rs1=x0 but rd≠x0, the maximum unsigned integer value (~0) is used as the AVL, and the resulting VLMAX is written to vl and also to the x register specified by rd.

cp_vsetvl_rd_x0_rs1_x0

Confirm that when running a vsetvl instruction with rd = x0 and rs1 = x0 that vl is unchanged

with vl != 0, conduct vsetvl with rd = x0 and rs1 = x0. sew and lmul must be such that vlmax does not change
vlmax must not change for the instruction to not be reserved.

vl is unchanged

1

test written: yes
spec: When rs1=x0 and rd=x0, the instruction operates as if the current vector length in vl is used as the AVL, and the resulting value is written to vl, but not to a destination register. This form can only be used when VLMAX and hence vl is not actually changed by the new SEW/LMUL ratio.

cp_vsetvli_rd_x0_rs1_x0

Confirm that when running a vsetvli instruction with rd = x0 and rs1 = x0 that vl is unchanged

with vl != 0, conduct vsetvli with rd = x0 and rs1 = x0. sew and lmul must be such that vlmax does not change
vlmax must not change for the instruction to not be reserved.

vl is unchanged

1

test written: yes
spec: When rs1=x0 and rd=x0, the instruction operates as if the current vector length in vl is used as the AVL, and the resulting value is written to vl, but not to a destination register. This form can only be used when VLMAX and hence vl is not actually changed by the new SEW/LMUL ratio.

AVL

cp_vsetvl_i_avl_eq_zero

Confirm that vsetvl{i} instructions follow vl requirements when avl is zero

Run vsetvli and vsetvl with rs1 = 0

vl = 0

1

vsetvl_op
vl_val_lead_in
vl_val_list

test written: yes
spec: The vset{i}vl{i} instructions first set VLMAX according to their vtype argument, then set vl obeying the following constraints:
These specific properties follow from the prior rules: vl = 0 if AVL = 0

cp_vsetvl_i_avl_eq_vlmax

Confirm that vsetvl{i} instructions follow avl requirements when equal to vlmax

Run vsetvli and vsetvl with rs1 = vlmax

vl = avl

1

vset_op
vsetvl_op
vl_val_lead_in
vl_val_list

test written: yes
spec: The vset{i}vl{i} instructions first set VLMAX according to their vtype argument, then set vl obeying the following constraints:
vl = AVL if AVL ≤ VLMAX

cp_vsetvl_i_avl_lt_2x_vlmax

Confirm that vsetvl{i} instructions follow avl requirements when greater than vlmax and less than equal to 2*vlmax (if avl is less than 2* vlmax)

Run vsetvli and vsetvl with vlmax < rs1 < 2 *vlmax

ceil(AVL / 2) ≤ vl ≤ VLMAX

1

vsetvl_op
vl_val_lead_in
vl_val_list

test written: yes, is a chance that sig don’t match
spec: The vset{i}vl{i} instructions first set VLMAX according to their vtype argument, then set vl obeying the following constraints:
ceil(AVL / 2) ≤ vl ≤ VLMAX if AVL < (2 * VLMAX)

cp_vsetvl_i_avl_eq_2x_vlmax

Confirm that vsetvl{i} instructions follow avl requirements when greater than 2 * vlmax (when avl is greater than equal to 2 * vlmax)

Run vsetvli and vsetvl with rs1 ≥ 2 *vlmax

vl = VLMAX

1

vsetvl_op

test written: yes
spec: The vset{i}vl{i} instructions first set VLMAX according to their vtype argument, then set vl obeying the following constraints:
vl = VLMAX if AVL ≥ (2 * VLMAX)

cp_vsetvl_i_avl_gt_2x_vlmax

Confirm that vsetvl{i} instructions follow avl requirements when greater than 2 * vlmax (when avl is greater than equal to 2 * vlmax)

Run vsetvli and vsetvl with rs1 ≥ 2 *vlmax

vl = VLMAX

1

vsetvl_op
vl_val_lead_in
vl_val_list

test written: yes
spec: The vset{i}vl{i} instructions first set VLMAX according to their vtype argument, then set vl obeying the following constraints:
vl = VLMAX if AVL ≥ (2 * VLMAX)

cp_vsetivli_avl_corners

Confirm that vsetivli abides by the avl corners

Run vsetivli with all values of imm = {[0:31]} with sew = {all_supported} and lmul = 1

Abides by avl rules depending on

4 sew bins * 32 imm bins

test written: yes
spec: The vset{i}vl{i} instructions first set VLMAX according to their vtype argument, then set vl obeying the following constraints:

vstart

cp_vstart_out_of_bounds

Confirm that the vstart CSR only has enough writeable bits to hold the largest element index (2^16-1)

conduct a csr write with rs1 = 2^16 on the vstart register

Not defined in spec, either vstart takes the bottom bits or sets to vlmax-1

1

vstart_acc_sz
vstart_sz_writable

test written: yes
spec: The vstart CSR is defined to have only enough writable bits to hold the largest element index (one less than the maximum VLMAX). Try to write a number greater than what is legal

cp_sew_illegal

Cannot set SEW < 8, all set SEW must be powers of 2 (can accomplish this by looping and setting sew of 2x until vill bit is set and then confirm that vill bit is set whenever setting a non power of 2 sew in that range)

feature (coverpoint written): can’t be tested

cp_vl_walking1s_sew_lmul

Confirm that all vl CSR bit fields are correctly set for all combinations of sew and lmul (thus all VLMAX)

Running the vsetvli instruction, cross all sew = {8/16/32/64} lmul = {f8, f4,f2, 1, 2, 4, 8} with rs1 ={XLEN 1-hot values}
This is done by conducting a vsetivli every time followed by a walking one csr write to ensure the target sew and lmul were attempted to be written

vl register will be set in accordance with vlmax

4sew * 7 lmul * XLEN 1-hot values

cp_vlen_illegal

Cannot set VLEN greater than 2^16, can check vl with eew = 8

vsetvli rs1={0, 1, 2, 3, 4, 7, 8, 9, 16, 32, 64…​ 2^16}
corners: (rs1 - 1)

feature (coverpoint written): covered by csr writing tests

The vector extension must have a consistent state at reset. In particular, vtype and vl must have values that can be read and then restored with a single vsetvl instruction. (make sure reset is called)

feature (coverpoint written): untestable

Sm_VF tests (Sm_VF-NN.S): vector floating-point instructions and mstatus.FS, run when Zve32f is also supported.

It should be understood that for most coverpoints that are based on arithmetic instructions, the coverpoints will check to make sure they’re non-trivial, meaning that vl != 0, vstart=0, vill=0, and they do not trap. It may be useful to know that when using vsetvl{i} instructions if rd != x0 and rs1 = x0, vl = vlmax

cp_vectorfp_mstatus_fs_state_affecting_register

Confirm vector floating point instructions set mstatus.FS to dirty when modifying floating point register state

Set mstatus.FS = {initial/clean} and run a fd writing instruction

mstatus.FS is set to dirty

1

mstatus_fs_dirty_V_fp

spec: Any vector floating-point instruction that modifies any floating-point extension state (i.e., floating-point CSRs or f registers) must set mstatus.FS to Dirty.

cp_vectorfp_mstatus_fs_state_affecting_csr

Confirm vector floating point instructions set mstatus.FS to dirty when modifying floating point csr state

Set mstatus.FS = {initial/clean} and run an instruction that would raise a fp flag after clearing the fp flags (vfdiv.vv divide by zero, vfadd.vv inf + -inf, and vmflt.vv with a NaN operand, which writes only a mask register)

mstatus.FS is set to dirty

1

spec: Any vector floating-point instruction that modifies any floating-point extension state (i.e., floating-point CSRs or f registers) must set mstatus.FS to Dirty.

cp_vectorfp_mstatus_fs_state_nonaffecting

Confirm vector floating point instructions properly set mstatus.FS when not modifying floating point state

Set mstatus.FS = {initial/clean} and run a vector fp instruction that does not affect floating point state (chosen situation for coverpoint is a .vv ins where vs1 = vs2 = 0)

mstatus.FS may be set to dirty or not depending on implementation

1

spec: Any vector floating-point instruction that modifies any floating-point extension state (i.e., floating-point CSRs or f registers) must set mstatus.FS to Dirty.

cp_vectorfp_mstatus_fs_off

Confirm that vector floating point instructions (even if they dont modify fp state) raise an illegal instruction exception if mstatus.FS is set to off

Set mstatus.FS = {off} and run a vector fp instruction that does not affect floating point state (chosen situation for coverpoint is a .vv ins where vs1 = vs2 = 0)

illegal instruction exception

1

spec: If the floating-point unit status field mstatus.FS is Off then any attempt to execute a vector floating-point instruction will raise an illegal instruction exception.

TODO: Plan how to check WARL, WPRI, WLRL fields. It seems every CSR needs parameters, either to tell the reference model how they should behave (to generate expected values), or to tell the tests and coverpoints which values are legal to test.

Table 161. Sm Normative Rules
Normative Rule Rule Text Coverpoints

m_highest_priv_mode

machine-mode (M-mode), which is the highest privilege mode in a RISC-V hart.

Implicit

m_mode_first_at_reset

M-mode is used for low-level access to a hardware platform and is the first mode entered at reset.

Sm_mcsr_cg/cp_mcsr_access

m_access_all_lower_priv_csrs

M-mode code can access all CSRs at lower privilege levels.

Sm_mcsr_cg/cp_scsr_from_m, Sm_F_cg/cp_fcsr_access, Sm_V_cg/cp_vcsrrswc, H_mcsr_cg/cp_hcsr_access

misa_acc

The misa CSR is a WARL read-write register

Sm_mcsr_cg/{cp_misa_mxl, cp_misa_dependencies}

misa_always_rd

This register must be readable in any implementation

Sm_mcsr_cg/cp_misa_mxl

misa_csr_implemented

a value of zero can be returned to indicate this feature has not been implemented

Sm_mcsr_cg/cp_misa_mxl

misa_enc_img

Sm_mcsr_cg/{cp_misa_mxl, cp_misa_dependencies}

misa_mxl_op_isa

The MXL (Machine XLEN) field encodes the native base integer ISA width as shown in norm:misa_mxl_enc.

Sm_mcsr_cg/cp_misa_mxl

misa_mxl_op_nz

If misa is nonzero, the MXL field indicates the effective XLEN in M-mode, a constant termed MXLEN.

Sm_mcsr_cg/cp_misa_mxl

xlen_le_mxlen

XLEN is never greater than MXLEN, but XLEN might be smaller than MXLEN in less-privileged modes.

Sm_mcsr_cg/cp_misa_mxl

misa_mxl_acc

The MXL field is read-only.

Sm_mcsr_cg/cp_misa_mxl

misa_mxl_enc

MXL|XLEN === 1|32¶2|64¶3|Reserved ===

Sm_mcsr_cg/cp_misa_mxl

misa_sz

The misa CSR is MXLEN bits wide.

Sm_mcsr_cg/cp_misa_mxl

misa_extensions_enc_txt

The Extensions field encodes the presence of the standard extensions, with a single bit per letter of the alphabet (bit 0 encodes presence of extension A, bit 1 encodes presence of extension B, through to bit 25 which encodes Z).

Sm_mcsr_cg/{cp_misa_dependencies, cp_misa_b, cp_misa_v}

misa_extensions_enc_tbl

Bit|Character|Description === 0|`A`|Atomic extension¶1|`B`|B extension¶2|`C`|Compressed extension¶3|`D`|Double-precision floating-point extension¶4|`E`|RV32E/64E base ISA¶5|`F`|Single-precision floating-point extension¶6|`G`|Reserved¶7|`H`|Hypervisor extension¶8|`I`|RV32I/64I base ISA¶9|`J`|Reserved¶10|`K`|Reserved¶11|`L`|Reserved¶12|`M`|Integer Multiply/Divide extension¶13|`N`|Tentatively reserved for User-Level Interrupts extension¶14|`O`|Reserved¶15|`P`|Tentatively reserved for Packed-SIMD extension¶16|`Q`|Quad-precision floating-point extension¶17|`R`|Reserved¶18|`S`|Supervisor mode implemented¶19|`T`|Reserved¶20|`U`|User mode implemented¶21|`V`|Vector extension¶22|`W`|Reserved¶23|`X`|Non-standard extensions implemented¶24|`Y`|Reserved¶25|`Z`|Reserved ===

Sm_mcsr_cg/{cp_misa_dependencies, cp_misa_b, cp_misa_v}

misa_extensions_warl_op

The Extensions field is a WARL field that can contain writable bits where the implementation allows the supported ISA to be modified.

Sm_mcsr_cg/{cp_misa_dependencies, cp_misa_b, cp_misa_v}

misa_extensions_reset_maximal

At reset, the Extensions field shall contain the maximal set of supported extensions, and I shall be selected over E if both are available.

Sm_mcsr_cg/cp_misa_mxl

misa_extensions_reset_ref

The misa register is reset to enable the maximal set of supported extensions, as described in misa.

Sm_mcsr_cg/cp_misa_mxl

misa_extensions_disabling

When a standard extension is disabled by clearing its bit in misa, the instructions and CSRs defined or modified by the extension revert to their defined or reserved behaviors as if the extension is not implemented.

Out of scope; also untestable without Ssstrict because reserved instructions behavior is UNSPECIFIED

misa_extensions_rsv_ret_0

All bits that are reserved for future use must return zero when read.

Sm_mcsr_cg/cp_misa_mxl

misa_i_op

The I bit will be set for the RV32I and RV64I base ISAs

Sm_mcsr_cg/cp_misa_mxl

misa_e_op

the E bit will be set for RV32E and RV64E.

Sm_mcsr_cg/cp_misa_mxl

misa_x_op

The X bit will be set if there are any non-standard extensions.

Non-standard extensions are not certified

misa_B_op

When the B bit is 1, the implementation supports the instructions provided by the Zba, Zbb, and Zbs extensions.

Sm_mcsr_cg/cp_misa_b

misa_m_op

When the M bit is 1, the implementation supports all multiply and division instructions defined by the M extension.

Sm_mcsr_cg/cp_misa_mxl

misa_s_op

When the S bit is 1, the implementation supports supervisor mode.

Sm_mcsr_cg/cp_misa_mxl

misa_u_op

When the U bit is 1, the implementation supports user mode.

Sm_mcsr_cg/cp_misa_mxl

misa_e_not_i

Unless misa is all read-only zero, the E bit always reads as the complement of the I bit.

Sm_mcsr_cg/cp_misa_mxl

Zmmul_misa_m

if the Zmmul extension is supported then the multiply instructions it specifies are supported irrespective of the value of the M bit.

TODO: execute Zmmul multiply instructions with misa.M cleared

misa_e_acc

The E bit is read-only.

TODO: write misa.E and check that it does not change

misa_extensions_dependencies

If an ISA feature x depends on an ISA feature y, then attempting to enable feature x but disable feature y results in both features being disabled.

Sm_mcsr_cg/cp_misa_dependencies

misa_extensions_collective_warl

An implementation may impose additional constraints on the collective setting of two or more misa fields, in which case they function collectively as a single WARL field. An attempt to write an unsupported combination causes those bits to be set to some supported combination.

Sm_mcsr_cg/cp_misa_dependencies

misa_inc_ialign

Writing misa may increase IALIGN, e.g., by disabling the C extension. If an instruction that would write misa increases IALIGN, and the subsequent instruction’s address is not IALIGN-bit aligned, the write to misa is suppressed, leaving misa unchanged.

Sm_mcsr_cg/cp_misa_clear_c

misa_extensions_reenable_unspec

When software enables an extension that was previously disabled, then all state uniquely associated with that extension is UNSPECIFIED, unless otherwise specified by that extension.

Behavior is UNSPECIFIED by the specification; not tested

mvendorid_sz_acc_op

The mvendorid CSR is a 32-bit read-only register providing the JEDEC manufacturer ID of the provider of the core.

Sm_mcsr_cg/cp_mcsr_access_ro/mvendorid

mvendorid_always_rd

This register must be readable in any implementation, but a value of 0 can be returned to indicate the field is not implemented or that this is a non-commercial implementation.

Sm_mcsr_cg/cp_mcsr_access_ro/mvendorid

mvendorid_enc

JEDEC manufacturer IDs are ordinarily encoded as a sequence of one-byte continuation codes 0x7f, terminated by a one-byte ID not equal to 0x7f, with an odd parity bit in the most-significant bit of each byte. mvendorid encodes the number of one-byte continuation codes in the Bank field, and encodes the final byte in the Offset field, discarding the parity bit.

Sm_mcsr_cg/cp_mcsr_access_ro/mvendorid

marchid_sz_acc_op

The marchid CSR is an MXLEN-bit read-only register encoding the base microarchitecture of the hart.

Sm_mcsr_cg/cp_mcsr_access_ro/marchid

marchid_always_rd

This register must be readable in any implementation, but a value of 0 can be returned to indicate the field is not implemented.

Sm_mcsr_cg/cp_mcsr_access_ro/marchid

mimpid_op

The mimpid CSR provides a unique encoding of the version of the processor implementation.

Sm_mcsr_cg/cp_mcsr_access_ro/mimpid

mimpid_always_rd

This register must be readable in any implementation, but a value of 0 can be returned to indicate that the field is not implemented.

Sm_mcsr_cg/cp_mcsr_access_ro/mimpid

mhartid_sz_acc_op

The mhartid CSR is an MXLEN-bit read-only register containing the integer ID of the hardware thread running the code.

Sm_mcsr_cg/cp_mcsr_access_ro/mhartid

mhartid_always_rd

This register must be readable in any implementation.

Sm_mcsr_cg/cp_mcsr_access_ro/mhartid

mhartid_one_is_zero

one hart must have a hart ID of zero.

Sm_mcsr_cg/cp_mcsr_access_ro/mhartid

mhartid_unique

Hart IDs must be unique within the execution environment.

Sm_mcsr_cg/cp_mcsr_access_ro/mhartid

mstatus_sz_acc

The mstatus register is an MXLEN-bit read/write register formatted as shown in mstatusreg-rv32 for RV32 and mstatusreg for RV64. mstatus must be implemented.

Sm_mcsr_cg/cp_mcsr_access_masked/mstatus

mstatush_sz_acc

For RV32 only, mstatush is a 32-bit read/write register formatted as shown in mstatushreg.

Sm_mcsr_cg/cp_mcsr_access_masked/mstatush

mstatus_xret_op

When executing an xRET instruction, supposing xPP holds the value y, xIE is set to xPIE; the privilege mode is changed to y; xPIE is set to 1; and xPP is set to the least-privileged supported mode (U if U-mode is implemented, else M). If y≠M, xRET also sets MPRV=0.

Sm_mprivinst_cg/{cp_mret, cp_sret, cp_sret_s}, S_sprivinst_cg/cp_sret_s

mstatush_enc

Bits 30:4 of mstatush generally contain the same fields found in bits 62:36 of mstatus for RV64. Fields SD, SXL, and UXL do not exist in mstatush.

Sm_mcsr_cg/cp_mcsr_access_masked/mstatush

mstatus_sie_spie_rdonly0

MIE and MPIE must be writable. If supervisor mode is not implemented, then SIE and SPIE are read-only 0; otherwise, they must be writable.

Sm_mcsr_cg/cp_mcsr_access_masked/mstatush

mstatus_xpp_enc

The xPP fields can only hold privilege modes up to x

Sm_mcsr_cg/cp_mcsr_access_masked/mstatus

mstatus_mpp_sz

MPP is two bits wide

Sm_mcsr_cg/cp_mcsr_access_masked/mstatus

mstatus_xpp_warl

xPP fields are WARL fields that can hold only privilege mode x and any implemented privilege mode lower than x.

Sm_mcsr_cg/{cp_mcsr_access_masked,cp_mcsrwalk_masked}/mstatus

mstatus_xpp_rdonly0

If privilege mode x is not implemented, then xPP must be read-only 0.

Sm_mcsr_cg/cp_mcsr_access_masked/mstatus

mstatus_spp_sz

SPP is one bit wide.

Sm_mcsr_cg/cp_mcsr_access_masked/mstatus

mstatus_mdt_sz_warl

The M-mode-disable-trap (MDT) bit is a WARL field introduced by the Smdbltrp extension.

Sm_mcsr_cg/cp_mcsr_access_masked/mstatus, Sm_mcsr_cg/cp_mcsrwalk_masked/mstatus

mstatus_sxl_uxl_warl_op

For RV64 harts, the SXL and UXL fields are WARL fields that control the value of XLEN for S-mode and U-mode, respectively.

Sm_mcsr_cg/cp_mcsr_access_masked/mstatus

mstatus_sxl_uxl_enc

The encoding of these fields is the same as the MXL field of misa, shown in norm:misa_mxl_enc.

Out of scope

mstatus_sxl_uxl_sxlen_uxlen_mxlen32

When MXLEN=32, the SXL and UXL fields do not exist, and SXLEN=32 and UXLEN=32.

Sm_mcsr_cg/cp_mcsr_access_masked/mstatus

mstatus_sxl_acc_mxlen64

When MXLEN=64, if S-mode is not supported, then SXL is read-only zero. Otherwise, it is a WARL field that encodes the current value of SXLEN.

Sm_mcsr_cg/cp_mcsr_access_masked/mstatus

mstatus_sxl_rdonly_mxlen64

an implementation may make SXL be a read-only field whose value always ensures that SXLEN=MXLEN.

Sm_mcsr_cg/cp_mcsr_access_masked/mstatus

mstatus_uxl_acc_mxlen64

When MXLEN=64, if U-mode is not supported, then UXL is read-only zero. Otherwise, it is a WARL field that encodes the current value of UXLEN.

Sm_mcsr_cg/cp_mcsr_access_masked/mstatus

mstatus_uxl_rdonly_mxlen64

an implementation may make UXL be a read-only field whose value always ensures that UXLEN=MXLEN or UXLEN=SXLEN.

Sm_mcsr_cg/cp_mcsr_access_masked/mstatus

mstatus_uxl_legal_vals_smode

If S-mode is implemented, the set of legal values that the UXL field may assume excludes those that would cause UXLEN to be greater than SXLEN.

Sm_mcsr_cg/cp_mcsr_access_masked/mstatus

mstatus_mprv_ldst_op

When MPRV=0, explicit memory accesses behave as normal, using the translation and protection mechanisms of the current privilege mode. When MPRV=1, load and store memory addresses are translated and protected, and endianness is applied, as though the current privilege mode were set to MPP.

SvSm_mstatus_mprv_cg/{cp_mprv_load, cp_mprv_store}, PMPS_cg/cp_mprv_lw, PMPU_cg/cp_mprv_sw

mstatus_mprv_inst_xlat_op

Instruction address-translation and protection are unaffected by the setting of MPRV.

SvSm_mstatus_mprv_cg/{cp_mprv_ins, cp_mprv_upage_smode_sumset_exec}, PMPS_cg/cp_mprv_jalr, PMPU_cg/cp_mprv_jalr

mstatus_mprv_rdonly0_no_umode

MPRV is read-only 0 if U-mode is not supported; otherwise, it must be writable.

Sm_mcsr_cg/cp_mcsr_access_masked/mstatus

mstatus_mprv_clr_mret_sret_less_priv

An MRET or SRET instruction that changes the privilege mode to a mode less privileged than M also sets MPRV=0.

Sm_mprivinst_cg/{cp_mret, cp_sret, cp_sret_s}, S_sprivinst_cg/cp_sret_s

xret_op

In addition to manipulating the privilege stack as described in privstack, xRET sets the pc to the value stored in the xepc register.

Sm_mprivinst_cg/cp_mret

sret_presence

SRET must be provided if supervisor mode is supported, and should raise an illegal-instruction exception otherwise.

Sm_mprivinst_cg/cp_sret

sret_ill_inst_exc_rst

SRET should also raise an illegal-instruction exception when TSR=1 in mstatus, as described in virt-control.

TODO

xret_in_higher_mode

An xRET instruction can be executed in privilege mode x or higher, where executing a lower-privilege xRET instruction will pop the relevant lower-privilege interrupt enable and privilege mode stack.

Sm_mprivinst_cg/cp_sret

mstatus_mxr_op

When MXR=0, only loads from pages marked readable (R=1 in sv32pte) will succeed. When MXR=1, loads from pages marked either readable or executable (R=1 or X=1) will succeed. MXR only affects loads whose effective privilege mode is less than M.

Sv_vm_permissions_cg/{cp_xpage_mxrunset_read_s, cp_xpage_mxrunset_read_u}, Sv_vm_permissions_cg/{cp_xpage_mxrset_read_s, cp_xpage_mxrset_read_u}

mstatus_mxr_rdonly0_no_smode

MXR is read-only 0 if S-mode is not supported or if satp.⁠MODE is read-only 0; otherwise, it must be writable.

Sm_mcsr_cg/cp_mcsr_access_masked/mstatus

mstatus_sum_op

When SUM=0, S-mode memory accesses to pages that are accessible by U-mode (U=1 in sv32pte) will fault. When SUM=1, these accesses are permitted.

Sv_vm_permissions_cg/{cp_upage_smode_sumunset_noread_s, cp_upage_smode_sumunset_nowrite_s}, Sv_vm_permissions_cg/{cp_upage_smode_sumset_read_s, cp_upage_smode_sumset_write_s}

mstatus_sum_op_no_vm

SUM has no effect when page-based virtual memory is not in effect.

TODO

mstatus_sum_op_mprv_mpp

while SUM is ordinarily ignored when not executing in S-mode, it is in effect when MPRV=1 and MPP=S.

SvSm_mstatus_mprv_cg/{cp_mprv_upage_smode_sumunset_noread, cp_mprv_upage_smode_sumunset_nowrite}, SvSm_mstatus_mprv_cg/{cp_mprv_upage_smode_sumset_read, cp_mprv_upage_smode_sumset_write}

mstatus_sum_rdonly0

SUM is read-only 0 if S-mode is not supported or if satp.⁠MODE is read-only 0; otherwise, it must be writable.

Sm_mcsr_cg/cp_mcsr_access_masked/mstatus

mstatus_mxr_sum_op_acc_fault

The MXR and SUM mechanisms only affect the interpretation of permissions encoded in page-table entries. In particular, they have no impact on whether access-fault exceptions are raised due to PMAs or PMP.

mstatus_mstatush_xbe_warl

The MBE, SBE, and UBE bits in mstatus and mstatush are WARL fields that control the endianness of memory accesses other than instruction fetches. Each may be read/write or read-only.

Sm_mcsr_cg/cp_mcsr_access_masked/mstatus, Sm_mcsr_cg/cp_mcsr_access_masked/mstatush

mstatus_tvm_warl

The TVM (Trap Virtual Memory) bit is a WARL field that supports intercepting supervisor virtual-memory management operations.

Sm_mcsr_cg/cp_mcsr_access_masked/mstatus

mstatus_tvm_op

When TVM=1, attempts to read or write the satp CSR or execute an SFENCE.VMA or SINVAL.VMA instruction while executing in S-mode will raise an illegal-instruction exception. When TVM=0, these operations are permitted in S-mode.

SvSm_mstatus_mprv_cg/cp_tvm_exception_s, Svinval_cg/cp_svinval

mstatus_tvm_acc

TVM is read-only 0 when S-mode is not supported or if satp.⁠MODE is read-only 0; otherwise, it must be writable.

Sm_mcsr_cg/cp_mcsr_access_masked/mstatus, Sm_mcsr_cg/cp_mcsrwalk_masked/mstatus

mstatus_tw_acc

TW is read-only 0 when there are no modes less privileged than M; otherwise, it must be writable.

Sm_mcsr_cg/cp_mcsr_access_masked/mstatus

mstatus_tsr_warl

The TSR (Trap SRET) bit is a WARL field that supports intercepting the supervisor exception return instruction, SRET.

Sm_mcsr_cg/cp_mcsr_access_masked/mstatus

mstatus_tsr_op

When TSR=1, attempts to execute SRET while executing in S-mode will raise an illegal-instruction exception. When TSR=0, this operation is permitted in S-mode.

Sm_mprivinst_cg/cp_sret_s

mstatus_tsr_acc

TSR is read-only 0 when S-mode is not supported; otherwise, it must be writable.

Sm_mcsr_cg/cp_mcsr_access_masked/mstatus

mstatus_fs_vs_warl

The FS[1:0] and VS[1:0] WARL fields and the XS[1:0] read-only field are used to reduce the cost of context save and restore by setting and tracking the current state of the floating-point unit and any other user-mode extensions respectively.

Sm_mcsr_cg/cp_mcsr_access_masked/mstatus, Sm_mcsr_cg/cp_mcsrwalk_masked/mstatus

mstatus_fs_op

The FS field encodes the status of the floating-point unit state, including the floating-point registers f0&#8205;&#8211;&#8205;f31 and the CSRs fcsr, frm, and fflags.

Sm_F_cg/cp_mstatus_FS_transition

mstatus_vs_op

The VS field encodes the status of the vector extension state, including the vector registers v0&#8205;&#8211;&#8205;v31 and the CSRs vcsr, vxrm, vxsat, vstart, vl, vtype, and vlenb.

Sm_V_cg/{cp_mstatus_vs_set_dirty_vcsr, cp_mstatus_vs_set_dirty_csr}

mstatus_vs_sstatus_vs_op

A vector context status field, VS, is added to mstatus[10:9] and shadowed in sstatus[10:9]. It is defined analogously to the floating-point context status field, FS.

Sm_V_cg/{cp_mstatus_vs_set_dirty_arithmetic, cp_mstatus_vs_off_arithmetic}

mstatus_xs_encodes_op

The XS field encodes the status of additional user-mode extensions and associated state.

Untested

mstatus_xs_summary_op

The XS field represents a summary of all extensions' status as shown in norm:mstatus_fs_vs_xs_enc.

Untested

mstatus_fs_vs_xs_enc

Status|FS and VS Meaning|XS Meaning === 0|Off|All off¶1|Initial|None dirty or clean, some on¶2|Clean|None dirty, some clean¶3|Dirty|Some dirty ===

Sm_F_cg/cp_mstatus_FS_transition

mstatus_fs_acc1

If the F extension is implemented, the FS field shall not be read-only zero.

Sm_F_cg/cp_mstatus_FS_transition

mstatus_fs_acc2

If neither the F extension nor S-mode is implemented, then FS is read-only zero.

Sm_mcsr_cg/cp_mcsr_access_masked/mstatus

mstatus_fs_rdonly0_s_no_F

If S-mode is implemented but the F extension is not, FS may optionally be read-only zero.

Sm_mcsr_cg/cp_mcsr_access_masked/mstatus

mstatus_vs_acc1

If the v registers are implemented, the VS field shall not be read-only zero.

Sm_mcsr_cg/cp_mcsr_access_masked/mstatus

mstatus_vs_acc2

If neither the v registers nor S-mode is implemented, then VS is read-only zero.

Sm_mcsr_cg/cp_mcsr_access_masked/mstatus

mstatus_vs_rdonly0_s_no_V

If S-mode is implemented but the v registers are not, VS may optionally be read-only zero.

TODO

mstatus_xs_acc

In harts without additional user extensions requiring new state, the XS field is read-only zero.

Sm_mcsr_cg/cp_mcsr_access_masked/mstatus

mstatus_xs_equiv

Every additional extension with state provides a CSR field that encodes the equivalent of the XS states.

Out of scope

mstatus_sd_acc

The SD bit is a read-only bit

Sm_mstatus_cg/cp_mstatus_sd_write

mstatus_sd_summary_op

summarizes whether either the FS, VS, or XS fields signal the presence of some dirty state that will require saving extended user context to memory.

Sm_mstatus_cg/cp_mstatus_sd_write, Sm_F_cg/cp_mstatus_FS_transition

mstatus_sd_vs_dirty_op

If mstatus.⁠VS is Dirty, mstatus.⁠SD is 1; otherwise, mstatus.⁠SD is set in accordance with existing specifications.

Sm_mstatus_cg/cp_mstatus_sd_write

mstatus_sd_rdonly0

If FS, VS, and XS are all read-only zero, then SD is also always zero.

Sm_mstatus_cg/cp_mstatus_sd_write

mstatus_sd_formula

The SD bit is read-only and is set when either the FS, VS, or XS bits encode a Dirty state (i.e., SD=(FS==0b11 OR XS==0b11 OR VS==0b11)).

Sm_mstatus_cg/cp_mstatus_sd_write, Sm_F_cg/cp_mstatus_FS_transition

mstatus_fs_vs_xs_off_op

When an extension’s status is set to Off, any instruction that attempts to read or write the corresponding state will cause an illegal-instruction exception.

Sm_F_cg/{cp_fcsr_access, cp_mstatus_FS_transition}, Sm_V_cg/{cp_mstatus_vs_off_arithmetic, cp_mstatus_vs_off_csr}

mstatus_fs_vs_xs_initial_op

When the status is Initial, the corresponding state should have an initial constant value.

Not tested: the initial constant value is not specified and software can change it

mstatus_fs_vs_xs_clean_op

When the status is Clean, the corresponding state is potentially different from the initial value, but matches the last value stored on a context swap.

Not tested: whether the state matches the last context save depends on software

mstatus_fs_vs_xs_dirty_op

When the status is Dirty, the corresponding state has potentially been modified since the last context save.

Sm_F_cg/{cp_mstatus_FS_transition, cp_fcsr_access}

mstatus_vs_wr

the setting of VS has no effect on the contents of the vector register state.

TODO: test with vector

mstatus_fs_no_dirty_track

dirtiness might not be tracked at all, in which case the valid FS states are Off and Dirty, and an attempt to set FS to Initial or Clean causes it to be set to Dirty.

Sm_F_cg/cp_mstatus_FS_transition, Sm_mcsr_cg/cp_mcsrwalk_masked/mstatus

mstatus_fs_no_change_dirty

If an instruction explicitly or implicitly writes a floating-point register or the fcsr but does not alter its contents, and FS=Initial or FS=Clean, it is implementation-defined whether FS transitions to Dirty.

Not tested: implementation-defined whether FS becomes Dirty when the contents do not change, and no UDB parameter controls this behavior in the ref model

mstatus_fs_imprecise

Implementations may choose to track the dirtiness of the floating-point register state imprecisely by reporting the state to be dirty even when it has not been modified. On some implementations, some instructions that do not mutate the floating-point state may cause the state to transition from Initial or Clean to Dirty.

Sm_F_cg/cp_mstatus_FS_transition_nondeterministic

mstatus_vs_imprecise

Implementations may choose to track the dirtiness of the vector register state in an analogous imprecise fashion, including possibly setting VS to Dirty when software attempts to set VS=Initial or VS=Clean.

Untestable

mstatus_vs_no_change_dirty

When VS=Initial or VS=Clean, it is implementation-defined whether an instruction that writes a vector register or vector CSR but does not alter its contents causes VS to transition to Dirty.

Untestable

mtvec_enc

TODO: Sm_mcsr_cg has no mtvec bin; Sm.py writes mtvec but checks only bit 1

mtvec_sz_warl_acc

The mtvec register is an MXLEN-bit WARL read/write register that holds trap vector configuration, consisting of a vector base address (BASE) and a vector mode (MODE).

TODO: Sm_mcsr_cg has no mtvec bin; Sm.py writes mtvec but checks only bit 1

mtvec_mandatory

The mtvec register must always be implemented

TODO: Sm_mcsr_cg has no mtvec bin; Sm.py writes mtvec but checks only bit 1

mtvec_rdonly

can contain a read-only value.

TODO: Sm_mcsr_cg has no mtvec bin; Sm.py writes mtvec but checks only bit 1

mtvec_base_align_4b

The value in the BASE field must always be aligned on a 4-byte boundary

TODO: Sm_mcsr_cg has no mtvec bin; Sm.py writes mtvec but checks only bit 1

mtvec_base_align_func_mode

the MODE setting may impose additional alignment constraints on the value in the BASE field.

TODO: Sm_mcsr_cg has no mtvec bin; Sm.py writes mtvec but checks only bit 1

medelegh_sz_acc_enc_xlen32

When XLEN=32, medelegh is a 32-bit read/write register that aliases bits 63:32 of medeleg.

Sm_mcsr_cg/cp_mcsr_access/medelegh

medelegh_omit_xlen64

The medelegh register does not exist when XLEN=64.

SsstrictSm_mcsr_cg/cp_csrr

medeleg_sz_acc

The machine exception delegation register (medeleg) is a 64-bit read/write register.

Sm_mcsr_cg/cp_mcsr_access/medeleg

mideleg_sz_acc

The machine interrupt delegation (mideleg) register is an MXLEN-bit read/write register.

Sm_mcsr_cg/cp_mcsr_access/mideleg

medeleg_mideleg_mandatory_s_mode

In harts with S-mode, the medeleg and mideleg registers must exist

Sm_mcsr_cg/cp_mcsr_access/{medeleg, mideleg}

medeleg_mideleg_omit_wo_s_mode

In harts without S-mode, the medeleg and mideleg registers should not exist.

SsstrictSm_mcsr_cg/cp_csrr

medeleg_mideleg_warl

An implementation can choose to subset the delegatable traps, with the supported delegatable bits found by writing one to every bit location, then reading back the value in medeleg or mideleg to see which bit positions hold a one.

Sm_mcsr_cg/cp_mcsr_access/mideleg

medeleg_no_rd1

An implementation shall not have any bits of medeleg be read-only one

Sm_mcsr_cg/cp_mcsr_access/medeleg

mideleg_no_rd1

an implementation shall not fix as read-only one any bits of mideleg corresponding to machine-level interrupts

Sm_mcsr_cg/cp_mcsr_access/mideleg

mideleg_rd1_lower_level

may do so for lower-level interrupts

Sm_mcsr_cg/cp_mcsr_access/mideleg

medeleg_when_rd0

For exceptions that cannot occur in less privileged modes, the corresponding medeleg bits should be read-only zero. In particular, medeleg[11] is read-only zero.

Sm_mcsr_cg/cp_mcsr_access/medeleg

medeleg_16_rdonly0

The medeleg[16] is read-only zero as double trap is not delegatable.

Sm_mcsr_cg/cp_mcsr_access/medeleg

mip_sz_acc

The mip register is an MXLEN-bit read/write register containing information on pending interrupts

Sm_mcsr_cg/cp_mcsr_access/mip

mip_mandatory

The mip register must always be implemented, but can contain read-only zeros in any position, indicating that interrupt can never become pending.

Sm_mcsr_cg/cp_mcsr_access/mip, Sm_mcsr_cg/cp_mcsrwalk/mip

mie_sz_acc

mie is the corresponding MXLEN-bit read/write register containing interrupt enable bits.

Sm_mcsr_cg/cp_mcsr_access/mie

mie_mandatory

The mie register must always be implemented.

Sm_mcsr_cg/cp_mcsr_access/mie

mip_bits_wr_or_rdonly

Each individual bit in register mip may be writable or may be read-only.

Sm_mcsr_cg/cp_mcsrwalk/mip

mie_bits_wr

A bit in mie must be writable if the corresponding interrupt can ever become pending.

Sm_mcsr_cg/cp_mcsrwalk/mie

mie_bits_rdonly0

Bits of mie that are not writable must be read-only zero.

Sm_mcsr_cg/cp_mcsrwalk/mie

mip_msip_mie_msie_maybe_rdonly0

If a system has only one hart, or if a platform standard supports the delivery of machine-level interprocessor interrupts through external interrupts (MEI) instead, then mip.⁠MSIP and mie.⁠MSIE may both be read-only zeros.

Sm_mcsr_cg/cp_mcsrwalk/{mip,mie}

std_mach_intr_impl

Each standard machine interrupt type (MEI, MTI, MSI) might not be implemented, in which case the corresponding interrupt-pending and interrupt-enable bits are read-only zeros.

Sm_mcsr_cg/cp_mcsrwalk/{mip,mie}

mip_sxip_mie_sxie_rdonly0

If supervisor mode is not implemented, bits SEIP, STIP, and SSIP of mip and SEIE, STIE, and SSIE of mie are read-only zeros.

Sm_mcsr_cg/cp_mcsrwalk/{mip,mie}

mip_lcofip_acc

LCOFIP is read-write in mip

Sm_mcsr_cg/cp_mcsrwalk/{mip,mie}

mip_lcofip_mie_lcofie_rdonly0

If the Sscofpmf extension is not implemented, mip.⁠LCOFIP and mie.⁠LCOFIE are read-only zeros.

Sm_mcsr_cg/cp_mcsrwalk/{mip,mie}

menvcfg_sz_acc

The menvcfg CSR is a 64-bit read/write register, formatted as shown in norm:menvcfg_enc_img

Sm_mcsr_cg/cp_mcsr_access_masked/menvcfg, Sm_mcsr_cg/cp_mcsr_access_masked/menvcfgh

menvcfg_op

controls certain characteristics of the execution environment for modes less privileged than M.

Descriptive spec text with no separately testable behavior

menvcfg_enc_img

Sm_mcsr_cg/cp_mcsrwalk_masked/menvcfg

menvcfg_fiom_fence_op

If bit FIOM (Fence of I/O implies Memory) is set to one in menvcfg, FENCE instructions executed in modes less privileged than M are modified so the requirement to order accesses to device I/O implies also the requirement to order main memory accesses. norm:menvcfg_fiom_fence_presuc_op details the modified interpretation of FENCE instruction bits PI, PO, SI, and SO for modes less privileged than M when FIOM=1.

Untestable: no I/O devices defined in profile

menvcfg_fiom_atomic_op

for modes less privileged than M when FIOM=1, if an atomic instruction that accesses a region ordered as device I/O has its aq and/or rl bit set, then that instruction is ordered as though it accesses both device I/O and memory.

Untestable: no I/O devices defined in profile

menvcfg_fiom_rdonly0_ok

If S-mode is not supported, or if satp.MODE is read-only zero (always Bare), the implementation may make FIOM read-only zero.

Sm_mcsr_cg/cp_mcsrwalk_masked/menvcfg

menvcfg_fiom_fence_presuc_op

Instruction bit|Meaning when set === PI PO|Predecessor device input and memory reads (PR implied) Predecessor device output and memory writes (PW implied)¶SI SO|Successor device input and memory reads (SR implied) Successor device output and memory writes (SW implied) ===

Untestable: no I/O devices defined in profile

menvcfg_cde_rdonly0

If Smcdeleg is not implemented, CDE is read-only zero.

TODO: check menvcfg.CDE in the Sm walk once Sail supports Smcdeleg

menvcfg_stce_exists

The Sstc extension adds the STCE (STimecmp Enable) bit to menvcfg CSR.

Sm_mcsr_cg/cp_mcsrwalk_masked/menvcfg

menvcfg_stce_rdonly0

When the Sstc extension is not implemented, STCE is read-only zero.

Sm_mcsr_cg/cp_mcsrwalk_masked/menvcfg

menvcfg_cbze_op

The Zicboz extension adds the CBZE (Cache Block Zero instruction enable) field to menvcfg. When the CBZE field is set to 1, it enables execution of the cache block zero instruction, CBO.ZERO, in modes less privileged than M. Otherwise, the instruction raises an illegal-instruction exception in modes less privileged than M.

Sm_mcsr_cg/cp_mcsrwalk_masked/menvcfg, ExceptionsZicboS_cg/cp_cbze, ExceptionsZicboU_cg/cp_cbze

menvcfg_cbze_rdonly0

When the Zicboz extension is not implemented, CBZE is read-only zero.

Sm_mcsr_cg/cp_mcsrwalk_masked/menvcfg

menvcfg_cbcfe_op

The Zicbom extension adds the CBCFE (Cache Block Clean and Flush instruction Enable) field to menvcfg. When the CBCFE field is set to 1, it enables execution of the cache block clean instruction (CBO.CLEAN) and the cache block flush instruction (CBO.FLUSH) in modes less privileged than M. Otherwise, these instructions raise an illegal-instruction exception in modes less privileged than M.

Sm_mcsr_cg/cp_mcsrwalk_masked/menvcfg, ExceptionsZicboS_cg/cp_cbcfe, ExceptionsZicboU_cg/cp_cbcfe

menvcfg_cbcfe_rdonly0

When the Zicbom extension is not implemented, CBCFE is read-only zero.

Sm_mcsr_cg/cp_mcsrwalk_masked/menvcfg

menvcfg_cbie_warl_op

The Zicbom extension adds the CBIE (Cache Block Invalidate instruction Enable) WARL field to menvcfg to control execution of the cache block invalidate instruction (CBO.INVAL) in modes less privileged than M. When CBIE is set to 0b00, the instruction raises an illegal-instruction exception in modes less privileged than M.

Sm_mcsr_cg/cp_mcsrwalk_masked/menvcfg, ExceptionsZicboS_cg/cp_cbie, ExceptionsZicboU_cg/cp_cbie

menvcfg_cbie_rdonly0

When the Zicbom extension is not implemented, CBIE is read-only zero.

Sm_mcsr_cg/cp_mcsrwalk_masked/menvcfg

menvcfg_cbie_cbo-inval_op_lead_in

When CBIE is set to 0b01 or 0b11, and when enabled for execution in modes less privileged than M, it behaves as follows:

ExceptionsZicboS_cg/cp_cbie, ExceptionsZicboU_cg/cp_cbie

menvcfg_cbie_cbo-inval_op_list

0b01 — The instruction is executed and performs a flush operation, even if configured by a mode less privileged than M to perform an invalidate operation. 0b11 — The instruction is executed and performs an invalidate operation, unless configured by a mode less privileged than M to perform a flush operation.

ExceptionsZicboS_cg/cp_cbie, ExceptionsZicboU_cg/cp_cbie

menvcfg_pmm_op

If the Smnpm extension is implemented, the PMM field enables or disables pointer masking (see Zpm) for the next-lower privilege mode (S-/HS-mode if S-mode is implemented, or U-mode otherwise), according to the values in norm:menvcfg_pmm_enc.

SmnpmS_cg/cp_pmlen_masking, SmnpmU_cg/cp_pmlen_masking

menvcfg_pmm_rdonly0

If Smnpm is not implemented, PMM is read-only zero. The PMM field is read-only zero for RV32.

Sm_mcsr_cg/cp_mcsrwalk_masked/menvcfg, Sm_mcsr_cg/cp_mcsrwalk_masked/menvcfgh

menvcfg_pmm_enc

Value|Description === 00|Pointer masking is disabled (PMLEN = 0)¶01|Reserved¶10|Pointer masking is enabled with PMLEN = XLEN - 57 (PMLEN = 7 on RV64)¶11|Pointer masking is enabled with PMLEN = XLEN - 48 (PMLEN = 16 on RV64) ===

SmnpmS_cg/cp_pmlen_masking, SmnpmU_cg/cp_pmlen_masking, Sm_mcsr_cg/cp_mcsrwalk_masked/menvcfg

menvcfg_dte_sdt_rdonly0

When Ssdbltrp is not implemented sstatus.SDT, vsstatus.SDT, and henvcfg.DTE bits are read-only zero.

Sm_mcsr_cg/cp_mcsrwalk_masked/mstatus

menvcfg_mandatory_u_mode

In harts with U-mode, menvcfg must be implemented, but all WARL fields may be read-only zero.

Sm_mcsr_cg/cp_mcsr_access_masked/menvcfg

menvcfgh_mandatory_s_mode_rv32

For harts with S-mode and XLEN=32, menvcfgh must be similarly implemented.

Sm_mcsr_cg/cp_mcsr_access_masked/menvcfgh

mseccfg_sz_acc

mseccfg is a 64-bit read/write register, formatted as shown in norm:mseccfg_enc_img, that controls security features.

Sm_mcsr_cg/cp_mcsr_access_masked/mseccfg, Sm_mcsr_cg/cp_mcsr_access_masked/mseccfgh

mseccfg_presence

It exists if any extension that adds a field to mseccfg is implemented. Otherwise, it is reserved.

Sm_mcsr_cg/cp_mcsr_access_masked/mseccfg, TODO: check that mseccfg is reserved when no extension adds a field to it

mseccfg_enc_img

Sm_mcsr_cg/cp_mcsrwalk_masked/mseccfg

mseccfg_sseed_useed_presence

The Zkr extension adds the SSEED and USEED fields to the mseccfg CSR to control access to the seed CSR from modes less privileged than M.

Sm_mcsr_cg/cp_mcsrwalk_masked/mseccfg

mseccfg_useed_rdonly0

If Zkr or U-mode is not implemented, USEED is read-only zero.

Sm_mcsr_cg/cp_mcsrwalk_masked/mseccfg

mseccfg_sseed_rdonly0

If Zkr or S-mode is not implemented, SSEED is read-only zero.

Sm_mcsr_cg/cp_mcsrwalk_masked/mseccfg

mseccfg_rlb_mmwp_mml_presence

The Smepmp extension adds the RLB, MMWP, and the MML fields in mseccfg.

TODO: check MML, MMWP, and RLB in the Sm mseccfg walk once Sail supports Smepmp

mseccfg_rlb_op_warl

mseccfg.RLB (Rule Locking Bypass) is a WARL field that provides a mechanism to temporarily modify Locked PMP rules. When mseccfg.RLB is 1, locked PMP rules may be removed or modified. When mseccfg.RLB is 0 and pmpcfg.L is 1 in any rule or entry (including disabled entries), then mseccfg.RLB remains 0 and any further modifications to mseccfg.RLB are ignored until a PMP reset.

TODO: Smepmp is not yet tested

mseccfg_mmwp_op_warl

The mseccfg.MMWP (Machine-Mode Allowlist Policy) is a WARL field. This field changes the default PMP policy for Machine mode when accessing memory regions that don’t have a matching PMP rule. This is a sticky bit, meaning that once set it cannot be unset until a PMP reset. When set it changes the default PMP policy for M-mode when accessing memory regions that don’t have a matching PMP rule, to denied instead of ignored.

TODO: Smepmp is not yet tested

mseccfg_mml_warl

The mseccfg.MML (Machine Mode Lockdown) is a WARL field.

TODO: Smepmp is not yet tested

mseccfg_mml_sticky

This is a sticky bit, meaning that once set it cannot be unset until a PMP reset.

TODO: Smepmp is not yet tested

mseccfg_mml_set

When mseccfg.MML is set the system’s behavior changes in the following way:

TODO: Smepmp is not yet tested

mseccfg_mml_pmpcfg_l_op

The meaning of pmpcfg.L changes: Instead of marking a rule as locked and enforced in all modes, it now marks a rule as M-mode-only when set and S/U-mode-only when unset. The formerly reserved encoding of pmpcfg.RW=01, and the encoding pmpcfg.LRWX=1111, now encode a Shared-Region.

TODO: Smepmp is not yet tested

mseccfg_mml_m_rule_op

An M-mode-only rule is enforced on accesses whose effective privilege mode is Machine and denied to accesses whose effective privilege mode is Supervisor or User. It also remains locked so that any further modifications to its associated configuration or address registers are ignored until a PMP reset, unless mseccfg.RLB is set.

TODO: Smepmp is not yet tested

mseccfg_mml_soru_rule_op

An S/U-mode-only rule is enforced on accesses whose effective privilege mode is Supervisor or User and denied to accesses whose effective privilege mode is Machine.

TODO: Smepmp is not yet tested

mseccfg_mml_shared_rule_op

A Shared-Region rule is enforced on all modes, with restrictions depending on the pmpcfg.L and pmpcfg.X bits:

TODO: Smepmp is not yet tested

mseccfg_mml_shared_l0_op

A Shared-Region rule where pmpcfg.L is not set can be used for sharing data between M-mode and S/U-mode, so is not executable. M-mode has read/write access to that region, and S/U-mode has read access if pmpcfg.X is not set, or read/write access if pmpcfg.X is set.

TODO: Smepmp is not yet tested

mseccfg_mml_shared_l1_op

A Shared-Region rule where pmpcfg.L is set can be used for sharing code between M-mode and S/U-mode, so is not writable. Both M-mode and S/U-mode have execute access on the region, and M-mode also has read access if pmpcfg.X is set. The rule remains locked so that any further modifications to its associated configuration or address registers are ignored until a PMP reset, unless mseccfg.RLB is set.

TODO: Smepmp is not yet tested

mseccfg_mml_shared_lrwx_1111_op

The encoding pmpcfg.LRWX=1111 can be used for sharing data between M-mode and S/U mode, where both modes only have read-only access to the region. The rule remains locked so that any further modifications to its associated configuration or address registers are ignored until a PMP reset, unless mseccfg.RLB is set.

TODO: Smepmp is not yet tested

mseccfg_mml_x_restrict

Adding a rule with executable privileges that either is M-mode-only or a locked Shared-Region is not possible and such pmpcfg writes are ignored, leaving pmpcfg unchanged. This restriction can be temporarily lifted by setting mseccfg.RLB

TODO: Smepmp is not yet tested

mseccfg_mml_exec_code

Executing code with Machine mode privileges is only possible from memory regions with a matching M-mode-only rule or a locked Shared-Region rule with executable privileges. Executing code from a region without a matching rule or with a matching S/U-mode-only rule is denied.

TODO: Smepmp is not yet tested

pmp_rw01_rsv

If mseccfg.MML is not set, the combination of pmpcfg.RW=01 remains reserved for future standard use.

Reserved encoding for future use; nothing to test

mseccfg_pmm_presence_op

If the Smmpm extension is implemented, the PMM field enables or disables pointer masking (see Zpm) for M-mode according to the values in norm:mseccfg_pmm_enc.

Smmpm_cg/cp_pmlen_masking

mseccfg_pmm_rdonly0

If Smmpm is not implemented, PMM is read-only zero. The PMM field is read-only zero for RV32.

Sm_mcsr_cg/cp_mcsrwalk_masked/mseccfg, Sm_mcsr_cg/cp_mcsrwalk_masked/mseccfgh

mseccfg_pmm_enc

Value|Description === 00|Pointer masking is disabled (PMLEN = 0)¶01|Reserved¶10|Pointer masking is enabled with PMLEN = XLEN - 57 (PMLEN = 7 on RV64)¶11|Pointer masking is enabled with PMLEN = XLEN - 48 (PMLEN = 16 on RV64) ===

Smmpm_cg/cp_pmlen_masking, Sm_mcsr_cg/cp_mcsrwalk_masked/mseccfg

mseccfgh_sz_acc_op

When XLEN=32 only, mseccfgh is a 32-bit read/write register that aliases bits 63:32 of mseccfg.

Sm_mcsr_cg/cp_mcsr_access_masked/mseccfgh, Sm_mcsr_cg/cp_mcsrwalk_masked/mseccfgh

mcycle_op

The mcycle CSR counts the number of clock cycles executed by the processor core on which the hart is running.

Sm_mcsr_cg/cp_cntr_access/mcycle, Sm_mcsr_cg/cp_mcycle_wraparound

mcycle_minstret_sz

The mcycle and minstret registers have 64-bit precision on all RV32 and RV64 harts.

Sm_mcsr_cg/cp_cntr_access/mcycle, Sm_mcsr_cg/cp_cntr_access

mcycle_minstret_rst

The counter registers have an arbitrary value after the hart is reset, and can be written with a given value.

Sm_mcsr_cg/cp_cntr_access/mcycle, Sm_mcsr_cg/cp_cntr_access/minstret

mcycle_minstret_wr

Any CSR write takes effect after the writing instruction has otherwise completed.

Sm_mcsr_cg/cp_cntr_access

mcycle_shared

The mcycle CSR may be shared between harts on the same core, in which case writes to mcycle will be visible to those harts.

Not tested; requires multi-hart core

mcycleh_minstreth_mhpmh_op

reads of the mcycleh, minstreth, mhpmcounternh, and mhpmeventnh CSRs return bits 63-32 of the corresponding register, and writes change only bits 63-32.

Sm_mcsr_cg/cp_cntr_access/{mcycleh, minstreth, mhpmcounter3h}, SscofpmfSm_cg/cp_sscofpmf_access

minstret_op

The minstret CSR counts the number of instructions the hart has retired.

Sm_mcsr_cg/cp_cntr_access/minstret, Sm_mcsr_cg/cp_minstret_wraparound, ZicntrSm_cg/cp_instret_add, ZicntrSm_cg/cp_instret_mret, ZicntrSm_cg/cp_instret_sret

mhpmcounter_num

The hardware performance monitor includes 29 additional 64-bit event counters, mhpmcounter3&#8205;&#8211;&#8205;`mhpmcounter31`.

Sm_mcsr_cg/cp_cntr_access

mhpmcounter_warl

The mhpmcounters are WARL registers

Sm_mcsr_cg/cp_cntr_access

mhpmcounter_mandatory

All counters should be implemented

Sm_mcsr_cg/cp_cntr_access

mhpmcounter_mhpmevent_rdonly0

a legal implementation is to make both the counter and its corresponding event selector be read-only 0.

Sm_mcsr_cg/cp_cntr_access, Sm_mcsr_cg/cp_mcsr_access

mhpmcounter_sz

support up to 64 bits of precision on RV32 and RV64.

Sm_mcsr_cg/cp_cntr_access

mhpmevent_sz_warl_op

The event selector CSRs, mhpmevent3&#8205;&#8211;&#8205;`mhpmevent31`, are 64-bit WARL registers that control which event causes the corresponding counter to increment.

Sm_mcsr_cg/cp_mcsr_access

mhpmevent_enc

The meaning of these events is defined by the platform, but event 0 is defined to mean no event.

TODO: check no counting on event 0

mcounteren_sz

The counter-enable mcounteren register is a 32-bit register

Sm_mcsr_cg/cp_mcsr_access/mcounteren

mcounteren_enc_img

Sm_mcsr_cg/cp_mcsr_access/mcounteren

mcounteren_flds_mandatory_warl

In harts with U-mode, the mcounteren must be implemented, but all fields are WARL

Sm_mcsr_cg/cp_mcsr_access/mcounteren

mcounteren_flds_rdonly0

may be read-only zero, indicating reads to the corresponding counter will cause an illegal-instruction exception when executing in a less-privileged mode.

Sm_mcsr_cg/cp_mcsr_access/mcounteren

mcounteren_presence

In harts without U-mode, the mcounteren register should not exist.

SsstrictSm_mcsr_cg/cp_csrr

cycle_instret_hpmcounter_op_rdonly

The cycle, instret, and hpmcountern CSRs are read-only shadows of mcycle, minstret, and mhpmcountern, respectively.

Zicntr_csrrs_cg/cp_cntr, Zihpm_csrrs_cg/cp_cntr_hpm, Sm_mcsr_cg/cp_csr_ro

time_op_rdonly

The time CSR is a read-only shadow of the memory-mapped mtime register.

Zicntr_csrrs_cg/cp_cntr/csr_time, Sm_mcsr_cg/{cp_mtime_write, cp_mtime_wraparound, cp_csr_ro}

cycleh_instreth_hpmcounternh_op_rdonly

when XLEN=32, the cycleh, instreth and hpmcounternh CSRs are read-only shadows of mcycleh, minstreth and mhpmcounternh, respectively.

Zicntr_csrrs_cg/cp_cntr, Zihpm_csrrs_cg/cp_cntr_hpm, Sm_mcsr_cg/cp_csr_ro

timeh_op_rdonly

When XLEN=32, the timeh CSR is a read-only shadow of the upper 32 bits of the memory-mapped mtime register

Zicntr_csrrs_cg/cp_cntr/csr_timeh, Sm_mcsr_cg/{cp_mtimeh_write, cp_csr_ro}

mcountinhibit_enc_img

Sm_mcsr_cg/cp_mcsr_access/mcountinhibit

mcountinhibit_sz_warl

The counter-inhibit register mcountinhibit is a 32-bit WARL register that controls which of the hardware performance-monitoring counters increment.

Sm_mcsr_cg/cp_mcsr_access/mcountinhibit, Sm_mcsr_cg/{cp_inhibit_mcycle, cp_inhibit_minstret}, Other counters do not increment predictably and are not tested

mcountinhibit_only_inc

The settings in this register only control whether the counters increment; their accessibility is not affected by the setting of this register.

TODO

mcountinhibit_clear_op

When the CY, IR, or HPMn bit in the mcountinhibit register is clear, the mcycle, minstret, or mhpmcountern register increments as usual. When the CY, IR, or HPMn bit is set, the corresponding counter does not increment.

Sm_mcsr_cg/{cp_inhibit_mcycle, cp_inhibit_minstret}, Other counters do not increment predictably and are not tested

mcountinhibit_cy_shared

The mcycle CSR may be shared between harts on the same core, in which case the mcountinhibit.⁠CY field is also shared between those harts, and so writes to mcountinhibit.⁠CY will be visible to those harts.

Untested because requires multi-hart core

mcountinhibit_not_impl

If the mcountinhibit register is not implemented, the implementation behaves as though the register were set to zero.

Sm_mcsr_cg/{cp_mcycle_wraparound, cp_minstret_wraparound}

mscratch_sz_acc

The mscratch register is an MXLEN-bit read/write register dedicated for use by machine mode. The mscratch register must be implemented.

Sm_mcsr_cg/cp_mcsr_access/mscratch

mscratch_enc_img

Sm_mcsr_cg/cp_mcsr_access/mscratch

mepc_sz_acc

mepc is an MXLEN-bit read/write register

Sm_mcsr_cg/cp_mcsr_access/mepc

mepc_align

The low bit of mepc (mepc[0]) is always zero. On implementations that support only IALIGN=32, the two low bits (mepc[1:0]) are always zero.

Sm_mcsr_cg/cp_mcsr_access/mepc

mepc_bit1_dyn_ialign_op

If an implementation allows IALIGN to be either 16 or 32 (by changing CSR misa, for example), then, whenever IALIGN=32, bit mepc[1] is masked on reads so that it appears to be 0. This masking occurs also for the implicit read by the MRET instruction. Though masked, mepc[1] remains writable when IALIGN=32.

Out of scope.

mepc_warl

mepc is a WARL register that must be implemented and must be able to hold all valid virtual addresses. It need not be capable of holding all possible invalid addresses.

Sm_mcsr_cg/cp_mcsr_access/mepc

mepc_inv_addr_conv

Prior to writing mepc, implementations may convert an invalid address into some other invalid address that mepc is capable of holding.

Sm_mcsr_cg/cp_mepc_vaddr_walk1, Sm_mcsr_cg/cp_mepc_vaddr_walk0

mepc_enc_img

Sm_mcsr_cg/cp_mcsr_access/mepc

mcause_sz_acc

The mcause register is an MXLEN-bit read-write register

Sm_mcause_cg/{cp_mcause_write_exception, cp_mcause_write_interrupt}

mcause_mandatory

The mcause register must be implemented.

Sm_mcause_cg/{cp_mcause_write_exception, cp_mcause_write_interrupt}

mcause_enc_img

Sm_mcause_cg/{cp_mcause_write_exception, cp_mcause_write_interrupt}

mcause_exccode_enc_img

Interrupt|Exception Code|Description === 1 1 1 1|0 1 2 3|Reserved Supervisor software interrupt Reserved Machine software interrupt¶1 1 1 1|4 5 6 7|Reserved Supervisor timer interrupt Reserved Machine timer interrupt¶1 1 1 1|8 9 10 11|Reserved Supervisor external interrupt Reserved Machine external interrupt¶1 1 1 1|12 13 14-15 ≥16|Reserved Counter-overflow interrupt Reserved Designated for platform use¶0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0|0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20-23 24-31 32-47 48-63 ≥64|Instruction address misaligned Instruction access fault Illegal instruction Breakpoint Load address misaligned Load access fault Store/AMO address misaligned Store/AMO access fault Environment call from U-mode Environment call from S-mode Reserved Environment call from M-mode Instruction page fault Load page fault Reserved Store/AMO page fault Double trap Reserved Software check Hardware error Reserved Designated for custom use Reserved Designated for custom use Reserved ===

See mcause_op

mcause_exccode_wlrl

The Exception Code is a WLRL field, so is only guaranteed to hold supported exception codes.

Sm_mcause_cg/{cp_mcause_write_exception, cp_mcause_write_interrupt}

custom_exc_priority

The priority of any custom synchronous exceptions is implementation-defined.

Custom exceptions are non-standard and not certified

mtval_sz_acc

The mtval register is an MXLEN-bit read-write register formatted as shown in norm:mtval_enc_img

Sm_mcsr_cg/cp_mcsr_access/mtval

mtval_per_exc_behavior

The hardware platform will specify which exceptions must set mtval informatively, which may unconditionally set it to zero, and which may exhibit either behavior, depending on the underlying event that caused the exception.

Definition, checked through UDB

mtval_rdonly0

The mtval register must always be implemented. If the hardware platform specifies that no exceptions set mtval to a nonzero value, then mtval is read-only zero.

Sm_mcsr_cg/cp_mcsr_access/mtval

mtval_enc_img

Sm_mcsr_cg/cp_mcsr_access/mtval

mtval_vaddr_wr_misaligned_addr

If mtval is written with a nonzero value when a misaligned load or store causes an access-fault, page-fault, or hardware-error exception, then mtval will contain the virtual address of the portion of the access that caused the fault.

TODO: misaligned loads and stores that straddle a PMA, PMP, or page boundary and fault on the upper part

mtval_other_traps_zero

For other traps, mtval is set to zero

ExceptionsSm_cg/cp_ecall_m, InterruptsSm_cg/cp_trigger

mtval_vaddr_and_0_sz

must be able to hold all valid virtual addresses and the value zero.

Sm_mcsr_cg/{cp_mtval_zero, cp_mtval_vaddr_walk1, cp_mtval_vaddr_walk0}

mtval_instr_bits_sz

If the feature to return the faulting instruction bits is implemented, mtval must also be able to hold all values less than 2N, where N is the smaller of MXLEN and ILEN.

Sm_mcsr_cg/cp_mtval_ilen_walk1, Sm_mcsr_cg/cp_mtval_ilen_ones

mtval_warl

If mtval is not read-only zero, it is a WARL register

Sm_mcsr_cg/cp_mcsr_access/mtval

mtval_inv_addr_conv

Prior to writing mtval, implementations may convert an invalid address into some other invalid address that mtval is capable of holding.

Sm_mcsr_cg/cp_mtval_vaddr_walk1, Sm_mcsr_cg/cp_mtval_vaddr_walk0

mconfigptr_sz_acc

The mconfigptr register is an MXLEN-bit read-only CSR formatted as shown in norm:mconfigptr_enc_img

Sm_mcsr_cg/cp_mcsr_access_ro/mconfigptr

mconfigptr_op

holds the physical address of a configuration data structure.

Definition, checked through UDB

mconfigptr_enc_img

Sm_mcsr_cg/cp_mcsr_access_ro/mconfigptr

mconfigptr_align

The pointer alignment in bits must be no smaller than MXLEN: i.e., if MXLEN is 8×n, then mconfigptr[log2n-1:0] must be zero.

TODO: check that mconfigptr[log2(MXLEN/8)-1:0] reads as zero

mconfigptr_mandatory

The mconfigptr register must be implemented

Sm_mcsr_cg/cp_mcsr_access_ro/mconfigptr

mconfigptr_val

it may be zero to indicate the configuration data structure does not exist or that an alternative mechanism must be used to locate it.

Sm_mcsr_cg/cp_mcsr_access_ro/mconfigptr

sxlen_uxlen

The effective XLEN in S-mode and U-mode are termed SXLEN and UXLEN, respectively.

Sm_mcsr_cg/cp_mcsr_access_masked/mstatus

xlen_reduction_op

Whenever XLEN in any mode is set to a value less than the widest supported XLEN, all operations must ignore source operand register bits above the configured XLEN, and must sign-extend results to fill the entire widest supported XLEN in the destination register. Similarly, pc bits above XLEN are ignored, and when the pc is written, it is sign-extended to fill the widest supported XLEN.

NOT TESTED

xlen_reduction_hint_op

Some HINT instructions are encoded as integer computational instructions that overwrite their destination register with its current value, e.g., C.ADDI x8, 0. When such a HINT is executed with XLEN < MXLEN and bits MXLEN..XLEN of the destination register not all equal to bit XLEN-1, it is implementation-defined whether bits MXLEN..XLEN of the destination register are unchanged or are overwritten with copies of bit XLEN-1.

Out of scope

endianness_inst_fetch_little

Instruction fetches are always little-endian.

Tested by executing instructions

trap_del_s_mode_no_m_mode

The mcause, mepc, and mtval registers and the MPP and MPIE fields of mstatus are not written.

Untested; S-mode handler does not have access to M-mode CSRs and changing to M-mode disturbs CSRs

Zicsr_illegal_acc

Attempts to write a read-only CSR address raise illegal-instruction exceptions.

Sm_mcsr_cg/cp_csr_ro

Zicsr_illegal_mode

Attempts to access a CSR address without sufficient privilege raise illegal-instruction exceptions or, as described in sec:hcauses, virtual-instruction exceptions.

Sm_mcsr_cg/cp_csr_insufficient_priv

Zicsr_debug_illegal

0x7B0&#8205;&#8211;&#8205;0x7BF are only visible to debug mode. Implementations must raise illegal-instruction exceptions on machine-mode access to the latter set of registers.

Sm_mcsr_cg/cp_csr_insufficient_priv

Zicsr_write_ro

A read/write register might also contain some bits that are read-only, in which case writes to the read-only bits are ignored.

Sm_mcsr_cg/{cp_mcsr_access, cp_misa_mxl}

Zicsr_wpri_roz

For forward compatibility, implementations that do not furnish these fields must make them read-only zero. These fields are labeled WPRI in the register descriptions.

Sm_mcsr_cg/cp_mcsr_access_masked/mstatus

Zicsr_wlrl

Software should not write anything other than legal values to such a field, and should not assume a read will return a legal value unless the last write was of a legal value, or the register has not been written since another operation (e.g., reset) set the register to a legal value. These fields are labeled WLRL in the register descriptions.

Sm_mcause_cg/{cp_mcause_write_exception, cp_mcause_write_interrupt}

Zicsr_warl

Implementations will not raise an exception on writes of unsupported values to a WARL field.

Sm_mcsr_cg/cp_mcsr_access

mtime_acc

Platforms provide a real-time counter, exposed as a memory-mapped machine-mode read-write register, mtime.

Sm_mcsr_cg/{cp_mtime_write, cp_mtime_wraparound}

mtime_op

mtime must increment at constant frequency

Sm_mcsr_cg/cp_mtime_wraparound, Constant frequency is untestable without an independent time reference

mtime_tick_period

the platform must provide a mechanism for determining the period of an mtime tick.

Platform requirement outside the ISA; not tested

mtime_wrap

The mtime register will wrap around if the count overflows.

Sm_mcsr_cg/cp_mtime_wraparound

mtime_sz

The mtime register has a 64-bit precision on all RV32 and RV64 systems.

Sm_mcsr_cg/{cp_mtimeh_write, cp_mtimeh_wraparound}, TODO: on RV64, check that mtime bits 63:32 are writable

mtimecmp_sz

Platforms provide a 64-bit memory-mapped machine-mode timer compare register (mtimecmp).

TODO: write and read back all 64 bits of mtimecmp

mtime_enc_img

Sm_mcsr_cg/{cp_mtime_write, cp_mtime_wraparound}

mtimecmp_enc_img

TODO: write and read back all 64 bits of mtimecmp

mtimecmp_rv32_wr

In RV32, memory-mapped writes to mtimecmp modify only one 32-bit part of the register.

TODO: on RV32, write each half of mtimecmp and read back both halves

mtime_mtimecmp_rv64_wr

For RV64, naturally aligned 64-bit memory accesses to the mtime and mtimecmp registers are additionally supported and are atomic.

Sm_mcsr_cg/cp_mtime_wraparound, ZawrsSm_cg/cp_wrs_resume, Atomicity is not observable in a single-hart test

time_timeh_visibility_mtime

When mtime changes, it is guaranteed to be reflected in time and timeh eventually, but not necessarily immediately.

Sm_mcsr_cg/{cp_mtime_write, cp_mtimeh_write}

ecall_ebreak_epc_value

ECALL and EBREAK cause the receiving privilege mode’s epc register to be set to the address of the ECALL or EBREAK instruction itself, not the address of the following instruction.

Sm_mprivinst_cg/cp_mprivinst, ExceptionsSm_cg/{cp_ecall_m, cp_breakpoint}

xret_enc_img

Sm_mprivinst_cg/{cp_mret, cp_sret}

mret_presence

MRET is always provided.

Sm_mprivinst_cg/cp_mret

xret_clr_lr_resv

If the Zalrsc extension is supported, the xRET instruction is allowed to clear any outstanding LR address reservation but is not required to.

Either behavior is legal; not tested

m_mode_priv_at_reset

Upon reset, a hart’s privilege mode is set to M.

Sm_mcsr_cg/cp_mcsr_access

mstatus_mie_mprv_rst

The mstatus fields MIE and MPRV are reset to 0.

TODO: record mstatus.MIE and MPRV before the boot code writes mstatus

mstatus_mstatush_mbe_rst

If little-endian memory accesses are supported, the mstatus/mstatush field MBE is reset to 0.

TODO: record mstatus/mstatush.MBE before the boot code writes it

ld_rsv_rst

For implementations with the Zalrsc standard extension, there is no valid load reservation.

TODO: execute an SC before any LR after reset and check that it fails

pc_rst

The pc is set to an implementation-defined reset vector.

Tested with linker script

mcause_rst1_val

The mcause register is set to a value indicating the cause of the reset.

Implementation-specific reset cause; not tested

pmp_a_l_rst

Writable PMP registers’ A and L fields are set to 0, unless the platform mandates a different reset value for some PMP registers’ A and L fields.

TODO: record the writable pmpcfg A and L fields before the boot code writes them

hgatp_vsatp_mode_rst

If the hypervisor extension is implemented, the hgatp.MODE and vsatp.MODE fields are reset to 0.

TODO: record hgatp.MODE and vsatp.MODE after reset, before any write

warl_rst

No WARL field contains an illegal value.

TODO: check that WARL fields hold legal values before the boot code writes them

rst_other_state_unspec

All other hart state is UNSPECIFIED.

Behavior is UNSPECIFIED by the specification; not tested

mseccfg_mml_mmwp_rlb_rst

The MML, MMWP, and RLB fields of the mseccfg register are set to 0, unless the platform mandates a different reset value.

TODO: record mseccfg.MML, MMWP, and RLB after reset, before any write

mcause_rst2_val

The mcause values after reset have implementation-specific interpretation

Implementation-specific reset cause; not tested

mcause_rst_zero

the value 0 should be returned on implementations that do not distinguish different reset conditions. Implementations that distinguish different reset conditions should only use 0 to indicate the most complete reset.

Implementation-specific reset cause; not tested

mseccfg_useed_sseed_rst

The USEED and SSEED fields of the mseccfg CSR must have defined reset values. The system must not allow them to be in an undefined state after reset.

TODO: record mseccfg.USEED and SSEED after reset, before any write

nmi_op

cause an immediate jump to an implementation-defined NMI vector running in M-mode regardless of the state of a hart’s interrupt enable bits. The mepc register is written with the virtual address of the instruction that was interrupted,

TODO: needs a platform mechanism (RVMODEL macro) to raise an NMI

nmi_mcause_source

mcause is set to a value indicating the source of the NMI.

TODO: needs a platform mechanism (RVMODEL macro) to raise an NMI

nmi_mcause_impl_def

The values written to mcause on an NMI are implementation-defined.

Implementation-defined; not tested

nmi_mcause_restrictions

The high Interrupt bit of mcause should be set to indicate that this was an interrupt. An Exception Code of 0 is reserved to mean unknown cause and implementations that do not distinguish sources of NMIs via the mcause register should return 0 in the Exception Code.

TODO: needs a platform mechanism (RVMODEL macro) to raise an NMI

nmi_no_rst

NMIs do not reset processor state

TODO: needs a platform mechanism (RVMODEL macro) to raise an NMI

Table 162. Sm UDB Parameters
Parameter Description Coverpoint Effect

MXLEN

XLEN in machine mode, specified in bits

all tests

Implicitly tested by all the XLEN-dependent tests (e.g. add would fail if XLEN is wrong)

MISA_CSR_IMPLEMENTED

Options:

true:: The misa CSR returns a non-zero value.

false:: The misa CSR is read-only-0.

cp_mcsr_access

misa bin results depend on parameter

TIME_CSR_IMPLEMENTED

Whether or not a real hardware time CSR exists. Implementations can either provide a real CSR or emulate access at M-mode.

Possible values:

true:: time/timeh exists, and accessing it will not cause an IllegalInstruction trap

false:: time/timeh does not exist. Accessing the CSR will cause an IllegalInstruction trap or enter an unpredictable state, depending on TRAP_ON_UNIMPLEMENTED_CSR. Privileged software may emulate the time CSR, or may pass the exception to a lower level.

cp_mtime_write

coverpoint only applies if parameter is True

COUNTINHIBIT_EN

Indicates which hardware performance monitor counters can be disabled from mcountinhibit.

COUNTINHIBIT_EN[n] controls whether mcountinhibit.HPM<n> is writable. It does not depend on whether hpmcounter<n>/mhpmcounter<n> is read-only zero.

COUNTINHIBIT_EN[1] can never be true, since it corresponds to mcountinhibit.TM, which is always read-only-0.

cp_inhibit

bins 0 and 2 for mcycle and minstret are affected by this parameter. Other bins are OUT-OF-SCOPE and not tested because HPM behavior is UNSPECIFIED

MARCHID_IMPLEMENTED

* false: marchid is not implemented, and must be read-only-0 * true: marchid is implemented, and the value is determined by ARCH_ID_VALUE

cp_mcsr_access

if false, marchid bin is read-only zero

ARCH_ID_VALUE

The value of marchid The combination of mvendorid and marchid should uniquely identify the type of hart microarchitecture that is implemented.

cp_mcsr_access

marchid value

MIMPID_IMPLEMENTED

* false: mimpid is not implemented, and must be read-only-0 * true: mimpid is implemented, and the value is determined by IMP_ID_VALUE

cp_mcsr_access

if false, mimpid is read-only zero.

IMP_ID_VALUE

A unique encoding of the version of the processor implementation.

cp_mcsr_access

mimpid value

VENDOR_ID_BANK

Encodes the number of one-byte continuation codes in the Bank field of mvendorid.

iN JEDEC’s parlance, the bank number is one greater than the number of continuation codes; hence, the mvendorid Bank field encodes a value that is one less than the JEDEC bank number.

cp_mcsr_access

mvendorid value

VENDOR_ID_OFFSET

Encodes the final byte of a JEDEC manufactor ID, discarding the parity bit.

cp_mcsr_access

mvendorid value

TODO: Many new normative rules have been added since this was written. Update Sm.yaml.

B.1.2. S Supervisor-Mode CSRs and Instructions

These test additional CSRs that exist in supervisor mode, and privileged instructions in supervisor mode.

Table 163. S Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule

cp_scsr_access

csr read, write all 1s, write all 0s, set all 1s, clear all 1s, write back initial value of each register below

sstatus
std_super_intr_impl
sip_sie_warl
sscratch
sepc
stval
senvcfg
senvcfg_fiom
senvcfg_fiom_acc
Zicsr_write_ro
Zicsr_wpri_roz
Zicsr_warl
scounteren
csrrs and csrrc to each bit

cp_scsrwalk

Walking 1s of legal supervisor CSRs

Set and clear each bit of each writable S-mode CSR to exercise bitfields: sstatus, scause, sie, stvec, scounteren, senvcfg, sscratch, sip. Iterations that write a reserved senvcfg.CBIE (0b10) or senvcfg.PMM (0b01) value check the other bits exactly and only check that the field reads back a legal value. sepc and stval are not tested because it is hard to express what values are legal.

sstatus
sstatus_sum_satp_mode
sip_sie
sip_acc
sie_acc
sip_sie_bits_sz
sip_seip_sie_seie
sip_stip_sie_stie
mip_sip_stip_op
sip_ssip_sie_ssie
sip_sie_warl
senvcfg_cbze_rdonly0
senvcfg_cbcfe_rdonly0
senvcfg_cbie_rsv
senvcfg_cbie_rdonly0
senvcfg_pmm_ssnpm
senvcfg_pmm_enc
Zicsr_warl_def
pmlen_future_reserved
pmlen_illegal_warl
Illegal Instruction

cp_csr_ro

Write read-only CSRs (C00-EFF)

Zicsr_rw
Zicsr_illegal_acc
Turning on satp.mode without having page tables will hang the system

cp_satp

Read satp

Read satp

Reads when 0, illegal instruction when 1. Value is unpredictable because it is not reset and has WARL fields that might not even support Bare.

cp_ucsr_from_s

In supervisor mode, read/write/set/clear from each U-mode CSR if F/V are supported

Zicsr_higher_priv

cp_csrr_insufficient_priv

Read Machine CSRS 300-3FF, 700-7FF, B00-BFF, F000-FFF, excluding 7AA (mscontext)

cp_scause_write

Write scause values
(WLRL)

Write scause values:
with interrupt = 1: 0-15
with interrupt = 0: 0-64

scause
scause_interrupt
scause_exception_code_acc
scause_exception_code_sz
scause_exccode_enc_tbl
Zicsr_wlrl

cp_sstatus_sd_write

Writing to the CSR field
(WARL)

Write 1 and 0 to SD with FS/VS/XS all 0. Write cross-product of all bits of SD/ FS/ VS/XS. 128 bins of writes.

Illegal instruction exception

cp_sprivinst

Execute ecall and ebreak and mret and and sfence.vma in supervisor mode

Changes affecting coverpoints:
moved scsr accesses from M to Sm
duplicated cp_sret_s to Sm and stripped TSR out of the S version.

ecall_service_request_op
ecall_priv_mode_op
ebreak_debug_env_op
ebreak_debugger_transfer_op
xret_in_lower_mode
sfence_vma_op
sepc should be pointing two instructions ahead.

cp_sret_s

Execute sret in supervisor mode with cross-product of all values of sstatus.SPP/SPIE/SIE. Return to supervisor mode after each sret.

sstatus_spp
sstatus_spie
sret_presence
xret_op
mstatus_xret_op
mstatus_mprv_clr_mret_sret_less_priv
sepc should be pointing two instructions ahead.

SXL tested with EndianS

* if other supervisor extensions are supported, ifdef them in to run in M-mode, such as sstc to test access to stimecmp.

Table 164. S Normative Rules
Normative Rule Rule Text Coverpoints

sstatus

The sstatus register is an SXLEN-bit read/write register formatted as shown in when SXLEN=32 and when SXLEN=64. The sstatus register keeps track of the processor’s current operating state.

S_scsr_cg/cp_scsr_access/sstatus, S_scsr_cg/cp_scsrwalk/sstatus

sstatus_spp

The SPP bit indicates the privilege level at which a hart was executing before entering supervisor mode. When a trap is taken, SPP is set to 0 if the trap originated from user mode, or 1 otherwise. When an SRET instruction (see ) is executed to return from the trap handler, the privilege level is set to user mode if the SPP bit is 0, or supervisor mode if the SPP bit is 1; SPP is then set to 0.

S_sprivinst_cg/cp_sret_s, Sm_mprivinst_cg/cp_sret_s (sweep with mstatus.TSR, runs in Sm)

sstatus_sie

The SIE bit enables or disables all interrupts in supervisor mode. When SIE is clear, interrupts are not taken while in supervisor mode. When the hart is running in user-mode, the value in SIE is ignored, and supervisor-level interrupts are enabled. The supervisor can disable individual interrupt sources using the sie CSR.

InterruptsS_cg/{cp_trigger, cp_enable_zero}

sstatus_spie

The SPIE bit indicates whether supervisor interrupts were enabled prior to trapping into supervisor mode. When a trap is taken into supervisor mode, SPIE is set to SIE, and SIE is set to 0. When an SRET instruction is executed, SIE is set to SPIE, then SPIE is set to 1.

InterruptsS_cg/cp_trigger_tsbi, ExceptionsSm_cg/cp_medeleg_msu_illegalinstruction, S_sprivinst_cg/cp_sret_s, Sm_mprivinst_cg/cp_sret_s

sstatus_subset_mstatus

The sstatus register is a subset of the mstatus register.

Sm_mcsr_cg/cp_shadow

sstatus_uxl

The UXL field controls the value of XLEN for U-mode, termed UXLEN, which may differ from the value of XLEN for S-mode, termed SXLEN. The encoding of UXL is the same as that of the MXL field of misa, shown in .

Ssu64xl_cg/cp_ssu64xl

sstatus_uxl_sz

When SXLEN=32, the UXL field does not exist, and UXLEN=32. When SXLEN=64, it is a WARL field that encodes the current value of UXLEN. In particular, an implementation may make UXL be a read-only field whose value always ensures that UXLEN=SXLEN.

S_sstatus_cg/cp_sxlen_ge_uxlen

sstatus_uxl_behavior

If UXLEN≠SXLEN, instructions executed in the narrower mode must ignore source register operand bits above the configured XLEN, and must sign-extend results to fill the widest supported XLEN in the destination register.

Not tested: ACT does not run U-mode with UXLEN different from SXLEN

sstatus_uxl_addr_modulo

If UXLEN < SXLEN, user-mode instruction-fetch addresses and load and store effective addresses are taken modulo 2UXLEN.

Not tested: ACT does not run U-mode with UXLEN different from SXLEN

hint_sxlen

Some HINT instructions are encoded as integer computational instructions that overwrite their destination register with its current value, e.g., c.addi x8, 0. When such a HINT is executed with XLEN < SXLEN and bits SXLEN..XLEN of the destination register not all equal to bit XLEN-1, it is implementation-defined whether bits SXLEN..XLEN of the destination register are unchanged or are overwritten with copies of bit XLEN-1.

Not tested: ACT does not run U-mode with UXLEN different from SXLEN

sstatus_sum_satp_mode

SUM is read-only 0 if satp.MODE is read-only 0.

S_scsr_cg/cp_scsrwalk

stvec

The stvec register is an SXLEN-bit read/write register that holds trap vector configuration, consisting of a vector base address (BASE) and a vector mode (MODE).

S_scsr_cg/{cp_stvec_vaddr_pc, cp_stvec_vaddr_scratch}

stvec_img

S_scsr_cg/{cp_stvec_vaddr_walk1, cp_stvec_vaddr_walk0}

stvec_op

The BASE field in stvec is a WARL field that can hold any valid virtual or physical address, subject to the following alignment constraints: the address must be 4-byte aligned, and MODE settings other than Direct might impose additional alignment constraints on the value in the BASE field.

S_scsr_cg/cp_stvec_vaddr_walk1, S_scsr_cg/cp_stvec_vaddr_walk0, S_scsr_cg/cp_stvec_vaddr_pc, S_scsr_cg/cp_stvec_vaddr_scratch

stvec_sz_base

Note that the CSR contains only bits XLEN-1 through 2 of the address BASE. When used as an address, the lower two bits are filled with zeroes to obtain an XLEN-bit address that is always aligned on a 4-byte boundary.

S_scsr_cg/{cp_stvec_vaddr_walk1, cp_stvec_vaddr_walk0}, ExceptionsS_cg/cp_stvec

stvec_mode_enc

Value|Name|Description === 0 1 ≥2|Direct Vectored|All exceptions set pc to BASE. Asynchronous interrupts set pc to BASE+4×cause. Reserved ===

ExceptionsS_cg/cp_stvec (Direct), TODO: S-mode interrupts with stvec.MODE=Vectored, and a write of a reserved MODE value

sip_sie

The sip register is an SXLEN-bit read/write register containing information on pending interrupts, while sie is the corresponding SXLEN-bit read/write register containing interrupt enable bits. Interrupt cause number i (as reported in CSR scause, ) corresponds with bit i in both sip and sie. Bits 15:0 are allocated to standard interrupt causes only, while bits 16 and above are designated for platform use.

S_scsr_cg/cp_scsrwalk, InterruptsS_cg/cp_priority_sip

sie_sip_supervisor_strap

An interrupt i will trap to S-mode if both of the following are true: (a) either the current privilege mode is S and the SIE bit in the sstatus register is set, or the current privilege mode has less privilege than S-mode; and (b) bit i is set in both sip and sie.

InterruptsS_cg/{cp_trigger, cp_enable_one, cp_enable_zero}

sie_sip_strap_time_constraint

These conditions for an interrupt trap to occur must be evaluated in a bounded amount of time from when an interrupt becomes, or ceases to be, pending in sip, and must also be evaluated immediately following the execution of an SRET instruction or an explicit write to a CSR on which these interrupt trap conditions expressly depend (including sip, sie and sstatus).

TODO

s_interrupt_priority

Interrupts to S-mode take priority over any interrupts to lower privilege modes.

TODO: move to hypervisor VS interrupts

sip_acc

Each individual bit in register sip may be writable or may be read-only.

S_scsr_cg/cp_scsrwalk/sip

sip_op

When bit i in sip is writable, a pending interrupt i can be cleared by writing 0 to this bit. If interrupt i can become pending but bit i in sip is read-only, the implementation must provide some other mechanism for clearing the pending interrupt (which may involve a call to the execution environment).

InterruptsS_cg/cp_trigger_reg_sip_ssip

sie_acc

A bit in sie must be writable if the corresponding interrupt can ever become pending. Bits of sie that are not writable are read-only zero.

S_scsr_cg/cp_scsrwalk/sie, InterruptsS_cg/cp_priority_sie

sip_sie_bits_sz

The standard portions (bits 15:0) of registers sip and sie are formatted as shown in Figures and respectively.

S_scsr_cg/cp_scsrwalk/sie

sip_seip_sie_seie

Bits sip.SEIP and sie.SEIE are the interrupt-pending and interrupt-enable bits for supervisor-level external interrupts. If implemented, SEIP is read-only in sip, and is set and cleared by the execution environment, typically through a platform-specific interrupt controller.

S_scsr_cg/cp_scsrwalk/sip, InterruptsS_cg/cp_trigger

sip_stip_sie_stie

Bits sip.STIP and sie.STIE are the interrupt-pending and interrupt-enable bits for supervisor-level timer interrupts. If implemented, STIP is read-only in sip. When the Sstc extension is not implemented, STIP is set and cleared by the execution environment. When the Sstc extension is implemented, STIP reflects the timer interrupt signal resulting from stimecmp. The sip.STIP bit, in response to timer interrupts generated by stimecmp, is set by writing stimecmp with a value that is less than or equal to time, and is cleared by writing stimecmp with a value greater than time.

S_scsr_cg/cp_scsrwalk/sip, InterruptsS_cg/{cp_trigger, cp_trigger_sti_sstc}

mip_sip_stip_op

A supervisor timer interrupt becomes pending, as reflected in the STIP bit in the mip and sip registers whenever time contains a value greater than or equal to stimecmp, treating the values as unsigned integers. If the result of this comparison changes, it is guaranteed to be reflected in STIP eventually, but not necessarily immediately. The interrupt remains posted until stimecmp becomes greater than time, typically as a result of writing stimecmp. The interrupt will be taken based on the standard interrupt enable and delegation rules.

S_scsr_cg/cp_scsrwalk/sip, InterruptsS_cg/cp_trigger_sti_sstc

sip_ssip_sie_ssie

Bits sip.SSIP and sie.SSIE are the interrupt-pending and interrupt-enable bits for supervisor-level software interrupts. If implemented, SSIP is writable in sip and may also be set to 1 by a platform-specific interrupt controller.

S_scsr_cg/cp_scsrwalk/sip, InterruptsS_cg/{cp_trigger, cp_trigger_reg_sip_ssip}

std_super_intr_impl

Each standard interrupt type (SEI, STI, SSI, or LCOFI) might not be implemented, in which case the corresponding interrupt-pending and interrupt-enable bits are read-only zeros.

S_scsr_cg/cp_scsr_access/{sie, sip}

sip_sie_warl

All bits in sip and sie are WARL fields.

S_scsr_cg/{cp_scsr_access, cp_scsrwalk}

sip_sie_priority_bit_order

Multiple simultaneous interrupts destined for supervisor mode are handled in the following decreasing priority order: SEI, SSI, STI, LCOFI.

InterruptsS_cg/{cp_priority_sip, cp_priority_sie}

supervisor_timer_scheduling

The implementation must provide a facility for scheduling timer interrupts in terms of the real-time counter, time.

OUT-OF-SCOPE: too vague if handled by software setting STIP. Tested by InterruptsS_cg/cp_trigger_sti_sstc when Sstc implemented

sscratch

The sscratch CSR is an SXLEN-bit read/write register, dedicated for use by the supervisor.

S_scsr_cg/cp_scsr_access/sscratch

sepc

sepc is an SXLEN-bit read/write CSR formatted as shown in . The low bit of sepc (sepc[0]) is always zero. On implementations that support only IALIGN=32, the two low bits (sepc[1:0]) are always zero.

S_scsr_cg/cp_scsr_access/sepc

sepc_op_mask_ialign32

If an implementation allows IALIGN to be either 16 or 32 (by changing CSR misa, for example), then, whenever IALIGN=32, bit sepc[1] is masked on reads so that it appears to be 0. This masking occurs also for the implicit read by the SRET instruction. Though masked, sepc[1] remains writable when IALIGN=32.

Not tested: ACT does not switch IALIGN by writing misa

sepc_acc_invalid_addr

sepc is a WARL register that must be able to hold all valid virtual addresses. It need not be capable of holding all possible invalid addresses. Prior to writing sepc, implementations may convert an invalid address into some other invalid address that sepc is capable of holding.

S_scsr_cg/cp_sepc_vaddr_walk1, S_scsr_cg/cp_sepc_vaddr_walk0

sepc_op_trap_write

When a trap is taken into S-mode, sepc is written with the virtual address of the instruction that was interrupted or that encountered the exception. Otherwise, sepc is never written by the implementation, though it may be explicitly written by software.

ExceptionsS_cg/cp_illegal_instruction, InterruptsS_cg/cp_trigger

scause

The scause CSR is an SXLEN-bit read-write register formatted as shown in . When a trap is taken into S-mode, scause is written with a code indicating the event that caused the trap. Otherwise, scause is never written by the implementation, though it may be explicitly written by software.

S_scause_cg/{cp_scause_write_exception, cp_scause_write_interrupt}, ExceptionsS_cg/cp_illegal_instruction, InterruptsS_cg/cp_trigger

scause_interrupt

The Interrupt bit in the scause register is set if the trap was caused by an interrupt. The Exception Code field contains a code identifying the last exception or interrupt. lists the possible exception codes for the current supervisor ISAs. The Exception Code is a WLRL field. It is required to hold the values 0–31 (i.e., bits 4–0 must be implemented), but otherwise it is only guaranteed to hold supported exception codes.

S_scause_cg/cp_scause_write_{interrupt, exception}, ExceptionsS_cg/cp_illegal_instruction, InterruptsS_cg/cp_trigger

scause_exception_code_acc

The Exception Code is a WLRL field.

S_scause_cg/cp_scause_write_{interrupt, exception}

scause_exception_code_sz

It is required to hold the values 0–31 (i.e., bits 4–0 must be implemented), but otherwise it is only guaranteed to hold supported exception codes.

S_scause_cg/cp_scause_write_{interrupt, exception}

scause_exccode_enc_tbl

Interrupt|Exception Code|Description === 1 1 1 1 1 1 1 1 1 1|0 1 2-4 5 6-8 9 10-12 13 14-15 ≥16|Reserved Supervisor software interrupt Reserved Supervisor timer interrupt Reserved Supervisor external interrupt Reserved Counter-overflow interrupt Reserved Designated for platform use¶0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0|0 1 2 3 4 5 6 7 8 9 10-11 12 13 14 15 16-17 18 19 20-23 24-31 32-47 48-63 ≥64|Instruction address misaligned Instruction access fault Illegal instruction Breakpoint Load address misaligned Load access fault Store/AMO address misaligned Store/AMO access fault Environment call from U-mode Environment call from S-mode Reserved Instruction page fault Load page fault Reserved Store/AMO page fault Reserved Software check Hardware error Reserved Designated for custom use Reserved Designated for custom use Reserved ===

S_scause_cg/{cp_scause_write_exception, cp_scause_write_interrupt}, ExceptionsS_cg/{cp_illegal_instruction, cp_breakpoint}

stval

The stval CSR is an SXLEN-bit read-write register formatted as shown in . When a trap is taken into S-mode, stval is written with exception-specific information to assist software in handling the trap. Otherwise, stval is never written by the implementation, though it may be explicitly written by software. The hardware platform will specify which exceptions must set stval informatively, which may unconditionally set it to zero, and which may exhibit either behavior, depending on the underlying event that caused the exception.

S_scsr_cg/cp_scsr_access/stval, ExceptionsS_cg/cp_illegal_instruction

stval_op_faulting_addr

If stval is written with a nonzero value when a breakpoint, address-misaligned, access-fault, page-fault, or hardware-error exception occurs on an instruction fetch, load, or store, then stval will contain the faulting virtual address.

ExceptionsS_cg/{cp_breakpoint, cp_load_address_misaligned, cp_instr_access_fault, cp_store_access_fault}

stval_op_breakpoint

On a breakpoint exception raised by an EBREAK or C.EBREAK instruction, stval is written with either zero or the virtual address of the instruction.

ExceptionsS_cg/cp_breakpoint

stval_op_load_store_fault

If stval is written with a nonzero value when a misaligned load or store causes an access-fault, page-fault, or hardware-error exception, then stval will contain the virtual address of the portion of the access that caused the fault.

TODO: write coverpoints for misaligned loads that wrap PMA/PMP/page boundaries to cause faults on upper part of access

stval_faulting_address_variable_instr

If stval is written with a nonzero value when an instruction access-fault, page-fault, or hardware-error exception occurs on a hart with variable-length instructions, then stval will contain the virtual address of the portion of the instruction that caused the fault, while sepc will point to the beginning of the instruction.

stval_op_illegal_instr

The stval register can optionally also be used to return the faulting instruction bits on an illegal-instruction exception (sepc points to the faulting instruction in memory). If stval is written with a nonzero value when an illegal-instruction exception occurs, then stval will contain the shortest of:

ExceptionsS_cg/cp_illegal_instruction

stval_op_illegal_instr_format

On an illegal-instruction exception, the instruction bits are zero-extended and loaded into stval.

ExceptionsZc_cg/cp_illegal_instruction, SsstrictS_comp_instr_cg/cp_compressed00

stval_op_other_traps

For other traps, stval is set to zero, but a future standard may redefine stval’s setting for other traps.

InterruptsS_cg/cp_trigger

stval_acc

stval is a WARL register that must be able to hold all valid virtual addresses and the value 0. It need not be capable of holding all possible invalid addresses.

S_scsr_cg/cp_stval_vaddr_walk1, S_scsr_cg/cp_stval_vaddr_walk0

stval_inv_addr_conv

Prior to writing stval, implementations may convert an invalid address into some other invalid address that stval is capable of holding.

Not tested: the tests write only valid addresses to stval

stval_instr_bits_sz

If the feature to return the faulting instruction bits is implemented, stval must also be able to hold all values less than 2N, where N is the smaller of SXLEN and ILEN.

S_scsr_cg/{cp_stval_ilen_walk1, cp_stval_ilen_ones}

senvcfg

The senvcfg CSR is an SXLEN-bit read/write register, formatted as shown in , that controls certain characteristics of the U-mode execution environment.

S_scsr_cg/cp_scsr_access/senvcfg

senvcfg_fiom

If bit FIOM (Fence of I/O implies Memory) is set to one in senvcfg, FENCE instructions executed in U-mode are modified so the requirement to order accesses to device I/O implies also the requirement to order main memory accesses. details the modified interpretation of FENCE instruction bits PI, PO, SI, and SO in U-mode when FIOM=1.

S_scsr_cg/cp_scsr_access/senvcfg

senvcfg_fiom_op_atomic

Similarly, for U-mode when FIOM=1, if an atomic instruction that accesses a region ordered as device I/O has its aq and/or rl bit set, then that instruction is ordered as though it accesses both device I/O and memory.

Not tested: I/O ordering is not observable in single-hart signature tests

senvcfg_fiom_acc

If satp.MODE is read-only zero (always Bare), the implementation may make FIOM read-only zero.

S_scsr_cg/cp_scsr_access/senvcfg

senvcfg_fiom_fence_presuc_op

Instruction bit|Meaning when set === PI PO|Predecessor device input and memory reads (PR implied) Predecessor device output and memory writes (PW implied)¶SI SO|Successor device input and memory reads (SR implied) Successor device output and memory writes (SW implied) ===

Not tested: I/O ordering is not observable in single-hart signature tests

senvcfg_cbze_rdonly0

When the Zicboz extension is not implemented, CBZE is read-only zero.

S_scsr_cg/cp_scsrwalk/senvcfg (configurations without Zicboz)

senvcfg_cbcfe_rdonly0

When the Zicbom extension is not implemented, CBCFE is read-only zero.

S_scsr_cg/cp_scsrwalk/senvcfg (configurations without Zicbom)

senvcfg_cbie_rsv

The encoding 0b10 is reserved.

S_scsr_cg/cp_scsrwalk/senvcfg (the walk writes CBIE=0b10)

senvcfg_cbie_rdonly0

When the Zicbom extension is not implemented, CBIE is read-only zero.

S_scsr_cg/cp_scsrwalk/senvcfg (configurations without Zicbom)

Zicsr_higher_priv

although CSRs and instructions are associated with one privilege level, they are also accessible at all higher privilege levels.

Sm_mcsr_cg/cp_scsr_from_m, S_scsr_cg/cp_ucsr_from_s, Sm_F_cg/cp_fcsr_access, Sm_V_cg/cp_vcsrrswc

Zicsr_rw

The top two bits (csr[11:10]) indicate whether the register is read/write (00,01, or 10) or read-only (11).

S_scsr_cg/cp_csr_ro

Zicsr_access

The next two bits (csr[9:8]) encode the lowest privilege level that can access the CSR, with the pattern 10 representing hypervisor CSRs.

S_scsr_cg/cp_csr_insufficient_priv

Zicsr_illegal_mode

Attempts to access a CSR address without sufficient privilege raise illegal-instruction exceptions or, as described in sec:hcauses, virtual-instruction exceptions.

S_scsr_cg/cp_csr_insufficient_priv

Zicsr_illegal_acc

Attempts to write a read-only CSR address raise illegal-instruction exceptions.

S_scsr_cg/cp_csr_ro

Zicsr_write_ro

A read/write register might also contain some bits that are read-only, in which case writes to the read-only bits are ignored.

S_scsr_cg/cp_scsr_access checks this if applicable

Zicsr_wpri_roz

For forward compatibility, implementations that do not furnish these fields must make them read-only zero. These fields are labeled WPRI in the register descriptions.

S_scsr_cg/cp_scsr_access (e.g. sstatus)

Zicsr_wlrl

Software should not write anything other than legal values to such a field, and should not assume a read will return a legal value unless the last write was of a legal value, or the register has not been written since another operation (e.g., reset) set the register to a legal value. These fields are labeled WLRL in the register descriptions.

S_scause_cg/{cp_scause_write_exception, cp_scause_write_interrupt}

Zicsr_wlrl_exception

Implementations are permitted but not required to raise an illegal-instruction exception if an instruction attempts to write a non-supported value to a WLRL field.

Not tested: the exception is optional, so no result is wrong

Zicsr_warl

Implementations will not raise an exception on writes of unsupported values to a WARL field.

S_scsr_cg/cp_scsr_access

ecall_service_request_op

The ECALL instruction is used to make a service request to the execution environment.

S_sprivinst_cg/cp_sprivinst ecall bin

ecall_priv_mode_op

The ECALL instruction is used to make a request to the supporting execution environment. When executed in U-mode, S-mode, or M-mode, it generates an environment-call-from-U-mode exception, environment-call-from-S-mode exception, or environment-call-from-M-mode exception, respectively, and performs no other operation.

S_sprivinst_cg/cp_sprivinst ecall bin

ebreak_debug_env_op

The EBREAK instruction is used to return control to a debugging environment.

S_sprivinst_cg/cp_sprivinst ebreak bin

ebreak_debugger_transfer_op

The EBREAK instruction is used by debuggers to cause control to be transferred back to a debugging environment. Unless overridden by an external debug environment, EBREAK raises a breakpoint exception and performs no other operation.

S_sprivinst_cg/cp_sprivinst ebreak bin

xret_in_lower_mode

Attempting to execute an xRET instruction in a mode less privileged than x will raise an illegal-instruction exception.

S_sprivinst_cg/cp_sprivinst mret bin

sret_presence

SRET must be provided if supervisor mode is supported, and should raise an illegal-instruction exception otherwise.

S_sprivinst_cg/cp_sret_s

sret_ill_inst_exc_rst

SRET should also raise an illegal-instruction exception when TSR=1 in mstatus, as described in virt-control.

Sm_mprivinst_cg/cp_sret_s

xret_op

In addition to manipulating the privilege stack as described in privstack, xRET sets the pc to the value stored in the xepc register.

S_sprivinst_cg/cp_sret_s

sfence_vma_op

The supervisor memory-management fence instruction SFENCE.VMA is used to synchronize updates to in-memory memory-management data structures with current execution. Instruction execution causes implicit reads and writes to these data structures; however, these implicit references are ordinarily not ordered with respect to explicit loads and stores.

S_sprivinst_cg/cp_sprivinst sfence_vma bin

UDB Parameters: None.

sie_sip_strap_time_constraint is not tested yet. How to handle timing constraints in certification? How to handle interrupts that don’t get evaluated immediately after the macro sets them? The macro could spin until they fire, but needs to know if they should fire (e.g. not blocked by xstatus.xIE).

B.1.3. U User-Mode CSRs and Instructions

These test additional CSRs that exist in user mode, and privileged instructions in user mode.

Table 165. U Coverpoints
Coverpoint Feature Description Normative Rule

cp_uprivinst

Execute ecall and ebreak, mret, uret in user mode

non_priv_exc
ecall_service_request_op
ecall_priv_mode_op
ebreak_debug_env_op
ebreak_debugger_transfer_op
xret_in_lower_mode
sret_presence
ecall throws environment call. ebreak throws breakpoint. mret and sret throw illegal instructions.

cp_csrr_insufficient_priv

Read Machine, Hypervisor, Supervisor CSRS100-3FF, 500-7FF, 900-BFF, D000-FFF

cp_csr_ro

Write User read-only CSRs C00-CFF

Zicsr_rw
Zicsr_illegal_acc

Accessing user-mode CSRs such as F, V, Zicntr, Zihpm from machine mode are tested in Sm_F, Sm_V, Zicntr, Zihpm and are not tested again here.

Table 166. U Normative Rules
Normative Rule Rule Text Coverpoints

always_priv_level

At any time, a RISC-V hardware thread (hart) is running at some privilege level encoded as a mode in one or more CSRs (control and status registers).

Descriptive spec text with no separately testable behavior

priv_levels_txt

Three RISC-V privilege levels are currently defined

Descriptive spec text with no separately testable behavior

priv_levels_tbl

Level|Encoding|Name|Abbreviation === 0|00|User/Application|U¶1|01|Supervisor|S¶2|10|Reserved| ¶3|11|Machine|M ===

Sm_mprivinst_cg/cp_mret, Sm_mcsr_cg/cp_mcsrwalk_masked

non_priv_exc

attempts to perform operations not permitted by the current privilege mode will cause an exception to be raised.

U_ucsr_cg/cp_csr_insufficient_priv, U_uprivinst_cg/cp_uprivinst

m_level_high_priv_only_mandatory

The machine level has the highest privileges and is the only mandatory privilege level for a RISC-V hardware platform.

Definition, checked through UDB

priv_combs_txt

Implementations might provide anywhere from 1 to 3 privilege modes

Definition, checked through UDB

priv_combs_tbl

Number of levels|Supported Modes|Intended Usage === 1|M|Simple embedded systems¶2|M, U|Secure embedded systems¶3|M, S, U|Systems running Unix-like operating systems ===

Definition, checked through UDB

m_mode_mandatory

All hardware implementations must provide M-mode

Definition, checked through UDB

Zicsr_rw

The top two bits (csr[11:10]) indicate whether the register is read/write (00,01, or 10) or read-only (11).

U_ucsr_cg/cp_csr_ro

Zicsr_access

The next two bits (csr[9:8]) encode the lowest privilege level that can access the CSR, with the pattern 10 representing hypervisor CSRs.

U_ucsr_cg/cp_csr_insufficient_priv

Zicsr_illegal_mode

Attempts to access a CSR address without sufficient privilege raise illegal-instruction exceptions or, as described in sec:hcauses, virtual-instruction exceptions.

U_ucsr_cg/cp_csr_insufficient_priv

Zicsr_illegal_acc

Attempts to write a read-only CSR address raise illegal-instruction exceptions.

U_ucsr_cg/cp_csr_ro

ecall_service_request_op

The ECALL instruction is used to make a service request to the execution environment.

U_uprivinst_cg/cp_uprivinst/ecall

ecall_priv_mode_op

The ECALL instruction is used to make a request to the supporting execution environment. When executed in U-mode, S-mode, or M-mode, it generates an environment-call-from-U-mode exception, environment-call-from-S-mode exception, or environment-call-from-M-mode exception, respectively, and performs no other operation.

U_uprivinst_cg/cp_uprivinst/ecall

ebreak_debug_env_op

The EBREAK instruction is used to return control to a debugging environment.

U_uprivinst_cg/cp_uprivinst/ebreak

ebreak_debugger_transfer_op

The EBREAK instruction is used by debuggers to cause control to be transferred back to a debugging environment. Unless overridden by an external debug environment, EBREAK raises a breakpoint exception and performs no other operation.

U_uprivinst_cg/cp_uprivinst/ebreak

xret_in_lower_mode

Attempting to execute an xRET instruction in a mode less privileged than x will raise an illegal-instruction exception.

U_uprivinst_cg/cp_uprivinst/mret, U_uprivinst_cg/cp_uprivinst/sret

sret_presence

SRET must be provided if supervisor mode is supported, and should raise an illegal-instruction exception otherwise.

U_uprivinst_cg/cp_uprivinst/sret

UDB Parameters: None.

B.1.4. UF User-Mode Floating-Point CSRs

These test additional CSR scenarios that exist when floating-point and user mode are supported.

Table 167. UF Coverpoints
Coverpoint Goal Feature Description Normative Rule

cp_ufcsr_access

CSR access

csr read, write all 1s, write all 0s, set all 1s, clear all 1s, write back initial value of each register below

fcsr_op_sz_acc

cp_ufcsrwalk

CSR access

Set and clear each bit of each writable CSR to exercise bitfields: fcsr, frm, fflags

fflags_op_sz_acc
frm_op_sz_acc
fcsr_rsv

Attempt these tests in user mode unless otherwise specified

Table 168. UF Normative Rules
Normative Rule Rule Text Coverpoints

fcsr_op_sz_acc

The floating-point CSR, fcsr, is a 32-bit read/write register that selects the dynamic rounding mode for floating-point arithmetic operations and holds the accrued exception flags, as shown in .

UF_ufcsr_cg/cp_ufcsr_access

fflags_op_sz_acc, frm_op_sz_acc

fflags_op_sz_acc: The fflags CSR contains the Accrued Exception Flags field (fcsr bits 4&#8205;&#8211;&#8205;0), zero-extended. frm_op_sz_acc: The frm CSR contains the Rounding Mode field (fcsr bits 7&#8205;&#8211;&#8205;5), zero-extended.

UF_ufcsr_cg/cp_ufcsrwalk

fcsr_rsv

Bits 31‍–‍8 of the fcsr are reserved for other standard extensions. If these extensions are not present, implementations shall ignore writes to these bits and supply a zero value when read. Standard software should preserve the contents of these bits.

UF_ufcsr_cg/cp_ufcsrwalk

mstatus_fs_vs_xs_update_indep_priv

The status fields are also updated during execution of instructions, regardless of privilege mode.

UDB Parameters: None.

B.1.5. Zkr Entropy CSR

These test CSRs when the Zkr entropy extension is supported. The seed CSR tests run once per privilege mode: ZkrSm in M-mode, ZkrS in S-mode, and ZkrU in U-mode.

Table 169. Zkr Coverpoints
Coverpoint Goal Feature Description Expectation Bins

cp_zkr_seed_csrrw

seed CSR is readable and writable across allowed privilege modes

Execute csrrw rd, seed, rs1 crossed with {privilege mode = M, S, U for supported modes} crossed with {mseccfg.sseed = 0/1, mseccfg.useed = 0/1.

No exception when access is allowed

3 modes * 4 mseccfg = 12 bins

cp_zkr_seed_illegal_csr_op

Non-CSRRW CSR instructions on seed cause illegal instruction

For each op in {CSRRS, CSRRC, CSRRW, CSRRWI, CSRRSI, CSRRCI} crossed with rs1/imm in {0/1} crossed with {mode = M, S (sseed=1), U (useed=1)} for supported modes: attempt the instruction on the seed CSR.

An illegal instruction exception is raised for every effective read (CSRRS/C with x0 or imm 0), regardless of privilege mode or access control settings.

6 ops * 2 rs1 * 3 modes = 30 bins

cp_zkr_seed_entropy_zero_non_es16

# When OPST is not ES16, entropy must be 0.

Execute csrrw rd, seed, rs1
Execute csrrw rd, seed, rs1 again
check that if OPST is not ES16, sigupd entropy
if OPST is ES16, sigupd 0x0BADBEEF

entropy is 0 if OPST is not ES16

1

Table 170. Zkr Normative Rules
Normative Rule Rule Text Coverpoints

Zkr_seed_addr

The entropy source extension defines the seed CSR at address 0x015. This CSR provides up to 16 physical ENTROPY bits that can be used to seed cryptographic random bit generators.

{ZkrSm_cg,ZkrS_cg,ZkrU_cg}/{cp_zkr_seed_csrrw}

seed_ro_illegal

Attempts to access the seed CSR using a read-only CSR-access instruction (CSRRS/CSRRC with rs1=x0 or CSRRSI/CSRRCI with uimm=0) raise an illegal-instruction exception; any other CSR-access instruction may be used to access seed.

{ZkrSm_cg,ZkrS_cg,ZkrU_cg}/{cp_zkr_seed_illegal_csr_op}

seed_write_ignore

The write value (in rs1 or uimm) must be ignored by implementations.

{ZkrSm_cg,ZkrS_cg,ZkrU_cg}/{cp_zkr_seed_csrrw}

seed_csr_unpriv

seed is an unprivileged CSR located at address 0x015.

ZkrU_cg/cp_zkr_seed_csrrw

seed_exec_mode_control

The seed CSR is also access controlled by execution mode, and attempted read or write access will raise an illegal-instruction exception outside M-mode unless access is explicitly granted. See crypto_scalar_es_access for more details.

{ZkrSm_cg,ZkrS_cg,ZkrU_cg}/{cp_zkr_seed_csrrw}

seed_entropy_unique

Each returned seed[15:0] = ENTROPY value represents unique randomness when OPST=ES16 (seed[31:30] = 10), even if its numerical value is the same as that of a previously polled ENTROPY value.

Not tested: randomness quality is not observable in an architectural signature test

seed_entropy_zero_non_es16

When OPST is not ES16, ENTROPY must be set to 0.

{ZkrSm_cg,ZkrS_cg,ZkrU_cg}/{cp_zkr_seed_entropy_zero_non_es16}

seed_wipe_on_read

For security reasons, the interface guarantees that secret ENTROPY words are not made available multiple times. Hence polling (reading) must also have the side effect of clearing (wipe-on-read) the ENTROPY contents and changing the state to WAIT (unless there is ENTROPY immediately available for ES16). Other states (BIST, WAIT, and DEAD) may be unaffected by polling.

Not tested: entropy values and OPST sequencing are nondeterministic, so they cannot be compared against a reference model

seed_bist_latch

Such a BIST alarm must be latched until polled at least once to enable software to record its occurrence.

Not tested: needs a platform mechanism to force a BIST alarm

seed_min_security_256

Any implementation of the seed CSR that limits the security strength shall not reduce it to less than 256 bits.

Not tested: security strength is not architecturally observable

seed_disable_if_weak

If the security level is under 256 bits, then the interface must not be available.

Not tested: security strength is not architecturally observable

mseccfg_useed_u_mode_op

When USEED is 0, access to the seed CSR in U-mode raises an illegal-instruction exception. When USEED is 1, read-write access to the seed CSR from U-mode is allowed; all other types of accesses raise an illegal-instruction exception.

ZkrU_cg/{cp_zkr_seed_csrrw, cp_zkr_seed_illegal_csr_op}

mseccfg_sseed_sorhs_mode_op

When SSEED is 0, access to the seed CSR from S-/HS-mode raises an illegal-instruction exception. When SSEED is 1, read-write access to the seed CSR from S-/HS-mode is allowed; all other types of accesses raise an illegal-instruction exception.

ZkrS_cg/{cp_zkr_seed_csrrw, cp_zkr_seed_illegal_csr_op}

mseccfg_sseed_vsorvu_mode_op

When the H extension is also implemented, access to the seed CSR from an HS-qualified instruction leads to a virtual-instruction exception in VS and VU modes; all other types of accesses raise an illegal-instruction exception.

TODO: seed access from VS-mode and VU-mode

mseccfg_sseed_useed_op_tbl

Mode|SSEED|USEED|Description === M|-|-|The seed CSR is always available in machine mode as normal (with a CSR read-write instruction.) Attempted read without a write raises an illegal-instruction exception regardless of mode and access control bits.¶U|-|0|Any seed CSR access raises an illegal-instruction exception.¶U|-|1|The seed CSR is accessible as normal. No exception is raised for read-write.¶S/HS|0|-|Any seed CSR access raises an illegal-instruction exception.¶S/HS|1|-|The seed CSR is accessible as normal. No exception is raised for read-write.¶VS/VU|0|-|Any seed CSR access raises an illegal-instruction exception.¶VS/VU|1|-|A read-write seed access raises a virtual-instruction exception, while other access conditions raise an illegal-instruction exception. ===

{ZkrSm_cg,ZkrS_cg,ZkrU_cg}/{cp_zkr_seed_csrrw, cp_zkr_seed_illegal_csr_op}, TODO: the VS and VU rows need the H extension

UDB Parameters: None.

B.2. Exceptions

Exception tests are organized according to the privilege mode or extension supported. For example, a configuration with Machine, Supervisor, User, and Floating-Point supported should run ExceptionsSm, ExceptionsS, ExceptionsU, and ExceptionsF. Note that vector exceptions are in Section B.10.

B.2.1. ExceptionsSm Machine-Mode Exceptions

These tests are run on any configuration with machine mode that supports exceptions.

exceptionsm covergroup

Table 171. ExceptionsSm Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule

cp_instr_adr_misaligned_branch

Instruction Address Misaligned

Branch taken to an address that is an odd multiple of 2
PC[1] = 0 and imm[1]=1

Instruction Misaligned Exception if C is not supported

6 branches

taken_cti_misaligned_exc
branch_misaligned_taken_exception
Zca_no_misaligned

cp_instr_adr_misaligned_branch_nottaken

Instruction Address Misaligned

Each type of branch not taken to an address that is an odd multiple of 2

No exception

6 branches

cond_br_no_ia_misaligned_exc_not_taken
branch_misaligned_untaken_exception

cp_instr_adr_misaligned_jal

Instruction Address Misaligned

jal to an address that is an odd multiple of 2
PC[1] = 0 and imm[1]=1
Instruction at multiple of 4. Offset is an odd multiple of 2.

Instruction Misaligned Exception if C is not supported

1

taken_cti_misaligned_exc
jump_misaligned_exception
Zca_no_misaligned

cp_instr_adr_misaligned_jalr

Instruction Address Misaligned

jalr to an address that is an odd multiple of 2 and odd multiple of 2 + 1.
Every combination of rs1_val[1:0] and offset[1:0]

Instruction Misaligned Exception if C is not supported

4 rs1[1:0] * 4 offset[1:0]

taken_cti_misaligned_exc
jump_misaligned_exception
Zca_no_misaligned

cp_instr_access_fault

Instruction Access Fault

Fetch instruction from unimplemented memory

Instruction Access Fault

1

mepc_op
mcause_op
mcause_exccode_op
mcause_exccode_enc_img
mtvec_mode_enc
trap_def_m_mode
ia_fault_exc_on_target
pma_precise_recom

cp_illegal_instruction

Illegal Instruction

Executing instruction 0x00000000 and 0xFFFFFFFF throws an illegal instruction exception.

Illegal Instruction Exception

2 instr

mepc_op
mcause_op
mcause_exccode_op
mcause_exccode_enc_img
mtvec_mode_enc
trap_def_m_mode
mtval_op
mtval_instr_bits_lead_in
mtval_instr_bits_list
mtval_ill_instr_exc_in_low_bits

cp_illegal_instruction_seed

Illegal Read-only access to a CSR

csrrs x*, seed, x0 throws illegal instruction in machine mode, as do
csrrc x*, seed, x0
csrrsi x*, seed, 0
csrrci x*, seed, 0

Illegal Instruction Exception

4 csr ops

cp_breakpoint

Breakpoint

ebreak throws breakpoint exception
also test when straddling 64B boundary

Breakpoint Exception

1

mepc_op
mcause_op
mcause_exccode_op
mcause_exccode_enc_img
mtvec_mode_enc
trap_def_m_mode
ebreak_debug_env_op
ebreak_debugger_transfer_op
mtval_op
mtval_ebreak_op
ebreak_enc
ecall_ebreak_epc_value

cp_load_address_misaligned

Load Misaligned

Attempt lb, lbu, lh, lhu, lw, lwu, ld with every combination of three address lsbs: 000 - 111

Possible Load Misaligned Instruction

7 ops * 8 lsbs

mcause_exccode_ld_ldrsv
ldst_no_exc_aligned
misaligned_ldst_eei_dependent_behavior
misaligned_ldst_hw_support
misaligned_ldst_exc_type
misaligned_ldst_contained_or_fatal_trap
ldst_atomicity_for_aligned
pma_mm_rw
pma_mag_exc
mtval_op

cp_load_access_fault

Load Access Fault

Attempt lb, lbu, lh, lhu, lw, lwu, ld from an illegal address (parameterized). Also exercised in PMP, VM.

Load Access Fault

7 ops

mcause_op
mcause_exccode_op
mcause_exccode_enc_img
mtvec_mode_enc
trap_def_m_mode
mcause_exccode_ld_ldrsv
pma_precise_recom

cp_store_address_misaligned

Store Misaligned

Attempt sb, sh, sw, (sd) with every combination of three lsbs: 000-111

Possible Store Misaligned Instruction

4 ops * 8 lsbs

ldst_no_exc_aligned
misaligned_ldst_eei_dependent_behavior
misaligned_ldst_hw_support
misaligned_ldst_exc_type
misaligned_ldst_contained_or_fatal_trap
ldst_atomicity_for_aligned
pma_mm_rw
pma_mag_exc
mtval_op

cp_store_access_fault

Store Access Fault

Attempt sb, sh, sw, sd from an illegal address (parameterized). Also exercised in PMP, VM.

Store Access Fault

4 ops

pma_precise_recom

cp_ecall_m

ecall

ecall from machine mode

Ecall from M Exception

1

mepc_op
ecall_service_request_op
ecall_priv_mode_op
ecall_enc
mtval_other_traps_zero
ecall_ebreak_epc_value

cp_misaligned_priority_load

Priority of exceptions

Attempt lb, lbu, lh, lhu, lw, (lwu, ld) from memory location causing access fault and misaligned. Also exercised in PMP, VM.

Highest priority exception should be taken.

7 ops * 8 lsbs

mcause_exccode_priority_order
exc_priority
mcause_exccode_priority_misaligned

cp_misaligned_priority_store

Priority of exceptions

Attempt sb, sh, sw (sd) from memory location causing access fault and misaligned}. Also exercised in PMP, VM.

Highest priority exception should be taken.

4 ops * 8 lsbs

mcause_exccode_priority_order
exc_priority
mcause_exccode_priority_misaligned

cp_misaligned_priority_fetch

Priority of exceptions

Attempt fetch from memory location causing access fault and misaligned}. Also exercised in PMP, VM.

Highest priority exception should be taken.

*

exc_priority
* missing from ExceptionsM. Split other Exceptions* test plans by type of cp_misaligned_priority as well

cp_mstatus_ie

Interrupt Enables

ecall with mstatus.MIE = {0/1}

mpie gets mie, mie gets 0

2 MIE

cp_xstatus_ie

Interrupt Enables

if S_SUPPORTED:
ecall cross {mode = user/supervisor, medeleg[8] = {0/1}, mstatus.mie = {0/1}, mstatus.sie = {0/1}}

xpie gets xie, xie gets 0

3 modes * 2 medleg * 2 mie * 2 sie

cp_medeleg_msu

Delegation to supervisor mode

If S_SUPPORTED:
Attempt instruction/load/store access fault, instruction/load/store misaligned fault, illegal instruction, ebreak, ecall, crossed with privilege mode S/U/M crossed with medeleg = [ {1011_0001_1111_1111}, {0}, and 12 different walking 1s]

Should delegate from user/supervisor but not machine when a 1 is in the appropriate column. Note medeleg[11] is hardwired to 0 because ecall from M cannot be delegated, and medeleg[9] is 0 because delegating an ecall from supervisor mode makes it impossible to get back to machine mode.

9 ops * 3 modes * 14 medeleg

medeleg_enc_img
medeleg_enc_txt
trap_del_s_mode_op
trap_never_trans_lower
trap_horiz
mstatus_xpie_xie_xpp_trap_op
sstatus_spp
sstatus_spie
pma_indep_exec_context

Notes: xepc, xcause, xtval, xtvec, mstatus.xpp are inherently tested with exceptions taking place

Note: load/store misaligned, access fault, page fault for Zaamo, Zalrsc, Zicbo* are exercised in PMA, PMP, VM

menvcfg.STCE = 0 causes access to stimecmp outside of M mode to illegal instruction

Table 172. ExceptionsSm Normative Rules
Normative Rule Rule Text Coverpoints

taken_cti_misaligned_exc

An instruction-address-misaligned exception is generated on a taken branch or unconditional jump if the target address is not IALIGN-bit aligned. This exception is reported on the branch or jump instruction, not on the target instruction.

ExceptionsSm_cg/{cp_instr_adr_misaligned_branch, cp_instr_adr_misaligned_jal, cp_instr_adr_misaligned_jalr}

mepc_op

When a trap is taken into M-mode, mepc is written with the virtual address of the instruction that was interrupted or that encountered the exception. Otherwise, mepc is never written by the implementation, though it may be explicitly written by software.

ExceptionsSm_cg/{cp_instr_access_fault, cp_illegal_instruction, cp_breakpoint, cp_ecall_m}

mcause_op

When a trap is taken into M-mode, mcause is written with a code indicating the event that caused the trap. Otherwise, mcause is never written by the implementation, though it may be explicitly written by software.

ExceptionsSm_cg/{cp_instr_access_fault, cp_illegal_instruction, cp_breakpoint, cp_load_access_fault}

mcause_exccode_op

The Exception Code field contains a code identifying the last exception or interrupt.

ExceptionsSm_cg/{cp_instr_access_fault, cp_illegal_instruction, cp_breakpoint, cp_load_access_fault}

mcause_exccode_enc_img

Interrupt|Exception Code|Description === 1 1 1 1|0 1 2 3|Reserved Supervisor software interrupt Reserved Machine software interrupt¶1 1 1 1|4 5 6 7|Reserved Supervisor timer interrupt Reserved Machine timer interrupt¶1 1 1 1|8 9 10 11|Reserved Supervisor external interrupt Reserved Machine external interrupt¶1 1 1 1|12 13 14-15 ≥16|Reserved Counter-overflow interrupt Reserved Designated for platform use¶0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0|0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20-23 24-31 32-47 48-63 ≥64|Instruction address misaligned Instruction access fault Illegal instruction Breakpoint Load address misaligned Load access fault Store/AMO address misaligned Store/AMO access fault Environment call from U-mode Environment call from S-mode Reserved Environment call from M-mode Instruction page fault Load page fault Reserved Store/AMO page fault Double trap Reserved Software check Hardware error Reserved Designated for custom use Reserved Designated for custom use Reserved ===

ExceptionsSm_cg/{cp_instr_access_fault, cp_illegal_instruction, cp_breakpoint, cp_load_access_fault}

mtvec_mode_enc

Value|Name|Description === 0|Direct|All traps set pc to BASE.¶1|Vectored|Asynchronous interrupts set pc to BASE+4×cause.¶≥2| — |Reserved ===

ExceptionsSm_cg/{cp_instr_access_fault, cp_illegal_instruction, cp_breakpoint, cp_load_access_fault}

mtvec_mode_direct_op

When MODE=Direct, all traps into machine mode cause the pc to be set to the address in the BASE field.

TODO: add a coverpoint for exceptions using mtvec direct and vectored

mtvec_mode_vectored_op

When MODE=Vectored, all synchronous exceptions into machine mode cause the pc to be set to the address in the BASE field, whereas interrupts cause the pc to be set to the address in the BASE field plus four times the interrupt cause number.

TODO: add a coverpoint for exceptions using mtvec direct and vectored

trap_def_m_mode

By default, all traps at any privilege level are handled in machine mode

ExceptionsSm_cg/{cp_instr_access_fault, cp_illegal_instruction, cp_breakpoint, cp_load_access_fault}

mcause_exccode_ld_ldrsv

Note that load and load-reserved instructions generate load exceptions

ExceptionsSm_cg/{cp_load_address_misaligned, cp_load_access_fault}, ExceptionsZalrsc_cg/{cp_load_address_misaligned, cp_load_access_fault}

cond_br_no_ia_misaligned_exc_not_taken

No instruction-address-misaligned exception is generated for a conditional branch that is not taken.

ExceptionsSm_cg/cp_instr_adr_misaligned_branch_nottaken

ia_fault_exc_on_target

If an instruction access-fault or instruction page-fault exception occurs on the target of a jump or taken branch, the exception is reported on the target instruction, not on the jump or branch instruction.

ExceptionsSm_cg/cp_instr_access_fault, ExceptionsSv_cg/cp_instr_page_fault_s

branch_misaligned_taken_exception

The conditional branch instructions will generate an instruction-address-misaligned exception if the target address is not aligned to a four-byte boundary and the branch condition evaluates to true.

ExceptionsSm_cg/cp_instr_adr_misaligned_branch

branch_misaligned_untaken_exception

If the branch condition evaluates to false, the instruction-address-misaligned exception will not be raised.

ExceptionsSm_cg/cp_instr_adr_misaligned_branch_nottaken

jump_misaligned_exception

The JAL and JALR instructions will generate an instruction-address-misaligned exception if the target address is not aligned to a four-byte boundary.

ExceptionsSm_cg/{cp_instr_adr_misaligned_jal, cp_instr_adr_misaligned_jalr}

ldst_no_exc_aligned

loads and stores whose effective addresses are naturally aligned shall not raise an address-misaligned exception.

ExceptionsSm_cg/{cp_load_address_misaligned, cp_store_address_misaligned}

load_exc_x0

Loads with a destination of x0 must still raise any exceptions and cause any other side effects even though the load value is discarded.

TODO: currently have no cp in ExceptionsSm that tests for load with rd = x0

misaligned_ldst_eei_dependent_behavior

Loads and stores whose effective address is not naturally aligned to the referenced datatype (i.e., the effective address is not divisible by the size of the access in bytes) have behavior dependent on the EEI.

ExceptionsSm_cg/{cp_load_address_misaligned, cp_store_address_misaligned}

misaligned_ldst_hw_support

misaligned loads and stores can be handled in hardware, or via an invisible trap into the execution environment implementation, or possibly a combination of hardware and invisible trap depending on address.

ExceptionsSm_cg/{cp_load_address_misaligned, cp_store_address_misaligned}

misaligned_ldst_exc_type

loads and stores that are not naturally aligned may either complete execution successfully or raise an exception. The exception raised can be either an address-misaligned exception or an access-fault exception. For a memory access that would otherwise be able to complete except for the misalignment, an access-fault exception can be raised instead of an address-misaligned exception if the misaligned access should not be emulated, e.g., if accesses to the memory region have side effects.

ExceptionsSm_cg/{cp_load_address_misaligned, cp_store_address_misaligned}

misaligned_ldst_contained_or_fatal_trap

When an EEI does not guarantee misaligned loads and stores are handled invisibly, the EEI must define if exceptions caused by address misalignment result in a contained trap (allowing software running inside the execution environment to handle the trap) or a fatal trap (terminating execution).

ExceptionsSm_cg/{cp_load_address_misaligned, cp_store_address_misaligned}

ldst_atomicity_for_aligned

naturally aligned loads and stores are guaranteed to execute atomically

ExceptionsSm_cg/{cp_load_address_misaligned, cp_store_address_misaligned}

ecall_service_request_op

The ECALL instruction is used to make a service request to the execution environment.

ExceptionsSm_cg/cp_ecall_m

ecall_priv_mode_op

The ECALL instruction is used to make a request to the supporting execution environment. When executed in U-mode, S-mode, or M-mode, it generates an environment-call-from-U-mode exception, environment-call-from-S-mode exception, or environment-call-from-M-mode exception, respectively, and performs no other operation.

ExceptionsSm_cg/cp_ecall_m

ebreak_debug_env_op

The EBREAK instruction is used to return control to a debugging environment.

ExceptionsSm_cg/cp_breakpoint

ebreak_debugger_transfer_op

The EBREAK instruction is used by debuggers to cause control to be transferred back to a debugging environment. Unless overridden by an external debug environment, EBREAK raises a breakpoint exception and performs no other operation.

ExceptionsSm_cg/cp_breakpoint

mcause_exccode_priority_order

If an instruction may raise multiple synchronous exceptions, the decreasing priority order of norm:exc_priority indicates which exception is taken and reported in mcause.

ExceptionsSm_cg/{cp_misaligned_priority_load, cp_misaligned_priority_store}

exc_priority

Priority|Exc.Code|Description === Highest|3|Instruction address breakpoint¶|12, 1|During instruction address translation: First encountered page fault or access fault¶|1|With physical address for instruction: Instruction access fault¶|2 0 8,9,11 3 3|Illegal instruction Instruction address misaligned Environment call Environment break Load/store/AMO address breakpoint¶|4,6|Optionally: Load/store/AMO address misaligned¶|13, 15, 5, 7|During address translation for an explicit memory access: First encountered page fault or access fault¶|5,7|With physical address for an explicit memory access: Load/store/AMO access fault¶Lowest|4,6|If not higher priority: Load/store/AMO address misaligned ===

ExceptionsSm_cg/{cp_misaligned_priority_load, cp_misaligned_priority_store, cp_misaligned_priority_fetch}

medeleg_enc_img

ExceptionsSm_cg/{cp_medeleg_msu_illegalinstruction, cp_medeleg_msu_ecall, cp_medeleg_msu_ebreak, cp_medeleg_msu_loadaccessfault}

medeleg_enc_txt

medeleg has a bit position allocated for every synchronous exception shown in norm:mcause_exccode_enc_img, with the index of the bit position equal to the value returned in the mcause register

ExceptionsSm_cg/{cp_medeleg_msu_illegalinstruction, cp_medeleg_msu_ecall, cp_medeleg_msu_ebreak, cp_medeleg_msu_loadaccessfault}

trap_del_s_mode_op

When a trap is delegated to S-mode, the scause register is written with the trap cause; the sepc register is written with the virtual address of the instruction that took the trap; the stval register is written with an exception-specific datum; the SPP field of mstatus is written with the active privilege mode at the time of the trap; the SPIE field of mstatus is written with the value of the SIE field at the time of the trap; and the SIE field of mstatus is cleared.

ExceptionsSm_cg/{cp_medeleg_msu_illegalinstruction, cp_medeleg_msu_ebreak, cp_medeleg_msu_loadaccessfault}

trap_never_trans_lower

Traps never transition from a more-privileged mode to a less-privileged mode. For example, if M-mode has delegated illegal-instruction exceptions to S-mode, and M-mode software later executes an illegal instruction, the trap is taken in M-mode, rather than being delegated to S-mode.

ExceptionsSm_cg/{cp_medeleg_msu_illegalinstruction, cp_medeleg_msu_ecall, cp_medeleg_msu_ebreak, cp_medeleg_msu_loadaccessfault}

trap_horiz

traps may be taken horizontally. Using the same example, if M-mode has delegated illegal-instruction exceptions to S-mode, and S-mode software later executes an illegal instruction, the trap is taken in S-mode.

ExceptionsSm_cg/{cp_medeleg_msu_illegalinstruction, cp_medeleg_msu_ecall, cp_medeleg_msu_ebreak, cp_medeleg_msu_loadaccessfault}

mstatus_xpie_xie_xpp_trap_op

When a trap is taken from privilege mode y into privilege mode x, xPIE is set to the value of xIE; xIE is set to 0; and xPP is set to y.

ExceptionsSm_cg/{cp_medeleg_msu_illegalinstruction, cp_medeleg_msu_ebreak, cp_medeleg_msu_loadaccessfault}

sstatus_spp

The SPP bit indicates the privilege level at which a hart was executing before entering supervisor mode. When a trap is taken, SPP is set to 0 if the trap originated from user mode, or 1 otherwise. When an SRET instruction (see ) is executed to return from the trap handler, the privilege level is set to user mode if the SPP bit is 0, or supervisor mode if the SPP bit is 1; SPP is then set to 0.

ExceptionsSm_cg/{cp_medeleg_msu_illegalinstruction, cp_medeleg_msu_ebreak, cp_medeleg_msu_loadaccessfault}

pma_indep_exec_context

PMAs do not vary by execution context.

ExceptionsSm_cg/{cp_medeleg_msu_instraccessfault, cp_medeleg_msu_loadaccessfault, cp_medeleg_msu_storeaccessfault}

pma_precise_recom

Precisely trapped PMA violations manifest as instruction, load, or store access-fault exceptions, distinct from virtual-memory page-fault exceptions.

ExceptionsSm_cg/{cp_instr_access_fault, cp_load_access_fault, cp_store_access_fault}

pma_imprecise_ok

Precise PMA traps might not always be possible, for example, when probing a legacy bus architecture that uses access failures as part of the discovery mechanism. In this case, error responses from peripheral devices will be reported as imprecise bus-error interrupts.

Untestable: no I/O devices defined in profile

pma_mm_vs_io_def

The most important characterization of a given memory address range is whether it holds regular main memory or I/O devices. Regular main memory is required to have a number of properties, specified below, whereas I/O devices can have a much broader range of attributes. Memory regions that do not fit into regular main memory, for example, device scratchpad RAMs, are categorized as I/O regions.

Descriptive spec text with no separately testable behavior

pma_mm_rw

Main memory regions always support read and write of all access widths required by the attached devices

ExceptionsSm_cg/{cp_load_address_misaligned, cp_store_address_misaligned}

pma_mm_ifetch

can specify whether instruction fetch is supported.

Untestable: profile defines no main-memory region without instruction fetch

pma_io_rwx_per_sz

I/O regions can specify which combinations of read, write, or execute accesses to which data widths are supported.

Untestable: no I/O devices defined in profile

pma_vm_hw_tbl_acc

For systems with page-based virtual memory, I/O and memory regions can specify which combinations of hardware page-table reads and hardware page-table writes are supported.

TODO: walk a page table at RVMODEL_ACCESS_FAULT_ADDRESS and check for an access fault

pma_amo_levels

Within AMOs, there are four levels of support: AMONone, AMOSwap, AMOLogical, and AMOArithmetic. AMONone indicates that no AMO operations are supported. AMOSwap indicates that only amoswap instructions are supported in this address range. AMOLogical indicates that swap instructions plus all the logical AMOs (amoand, amoor, amoxor) are supported. AMOArithmetic indicates that all RISC-V AMOs defined by the A extension are supported.

Untestable: no I/O devices defined in profile

pma_amo_far_subset_proc

Main memory and I/O regions may only support a subset or none of the processor-supported atomic operations.

Untestable: no I/O devices defined in profile

pma_amo_Zacas_levels1

The Zacas extension defines three additional levels of support: AMOCASW, AMOCASD, and AMOCASQ.

Descriptive spec text with no separately testable behavior

pma_amo_Zacas_levels2

AMOCASW indicates that in addition to instructions indicated by AMOArithmetic-level support, the AMOCAS.W instruction is supported. AMOCASD indicates that in addition to instructions indicated by AMOCASW-level support, the AMOCAS.D instruction is supported. AMOCASQ indicates that in addition to instructions indicated by AMOCASD-level support, the AMOCAS.Q instruction is supported.

Untestable: no I/O devices defined in profile

pma_amo_Zabha_req

The AMOs specified by the Zabha extension require the same level of support as the corresponding instructions in the Zaamo standard extension or the Zacas extension.

Untestable: no I/O devices defined in profile

pma_rsrv_levels

For LR/SC, there are three levels of support indicating combinations of the reservability and eventuality properties: RsrvNone, RsrvNonEventual, and RsrvEventual. RsrvNone indicates that no LR/SC operations are supported (the location is non-reservable). RsrvNonEventual indicates that the operations are supported (the location is reservable), but without the eventual success guarantee described in the unprivileged ISA specification. RsrvEventual indicates that the operations are supported and provide the eventual success guarantee.

Untestable: no I/O devices defined in profile

pma_mag_exc

Implementations may raise access-fault exceptions instead of address-misaligned exceptions for some misaligned accesses, indicating the instruction should not be emulated by a trap handler.

ExceptionsSm_cg/{cp_load_address_misaligned, cp_store_address_misaligned}

pma_mo_io_chan_def

Each strongly ordered I/O region specifies a numbered ordering channel, which is a mechanism by which ordering guarantees can be provided between different I/O regions.

Untestable: no I/O devices defined in profile

pma_mo_io_chan_0

Channel 0 is used to indicate point-to-point strong ordering only, where only accesses by the hart to the single associated I/O region are strongly ordered.

Untestable: no I/O devices defined in profile

pma_mo_io_chan_1

Channel 1 is used to provide global strong ordering across all I/O regions. Any accesses by a hart to any I/O region associated with channel 1 can only be observed to have occurred in program order by all other harts and I/O devices, including relative to accesses made by that hart to relaxed I/O regions or strongly ordered I/O regions with different channel numbers. In other words, any access to a region in channel 1 is equivalent to executing a fence io,io instruction before and after the instruction.

Untestable: no I/O devices defined in profile

pma_mo_io_chan_other

Other larger channel numbers provide program ordering to accesses by that hart across any regions with the same channel number

Untestable: no I/O devices defined in profile

pma_mo_dyn

Systems might support dynamic configuration of ordering properties on each memory region.

Descriptive spec text with no separately testable behavior

pma_non_cacheable

If a PMA indicates non-cacheability, then accesses to that region must be satisfied by the memory itself, not by any caches.

Untestable: no non-cacheable PMA region defined in profile

pma_idp_mm

Main memory regions are assumed to be idempotent.

Descriptive spec text with no separately testable behavior

pma_idp_no_spec

If accesses are non-idempotent, i.e., there is potentially a side effect on any read or write access, then speculative or redundant accesses must be avoided.

Untestable: no I/O devices defined in profile

pma_idp_implicit_ok

For non-idempotent regions, implicit reads and writes must not be performed early or speculatively, with the following exceptions. When a non-speculative implicit read is performed, an implementation is permitted to additionally read any of the bytes within a naturally aligned power-of-2 region containing the address of the non-speculative implicit read. Furthermore, when a non-speculative instruction fetch is performed, an implementation is permitted to additionally read any of the bytes within the next naturally aligned power-of-2 region of the same size (with the address of the region taken modulo 2XLEN).

Untestable: no I/O devices defined in profile

pma_idp_implicit_sz

The size of these naturally aligned power-of-2 regions is implementation-defined, but, for systems with page-based virtual memory, must not exceed the smallest supported page size.

Untestable: no I/O devices defined in profile

mcause_exccode_priority_misaligned

Load/store/AMO address-misaligned exceptions may have either higher or lower priority than load/store/AMO page-fault and access-fault exceptions.

ExceptionsSm_cg/{cp_misaligned_priority_load, cp_misaligned_priority_store}, ExceptionsSvSm_cg/cp_misaligned_priority_m

mtval_op

When a trap is taken into M-mode, mtval is either set to zero or written with exception-specific information to assist software in handling the trap. Otherwise, mtval is never written by the implementation, though it may be explicitly written by software.

ExceptionsSm_cg/{cp_illegal_instruction, cp_breakpoint, cp_load_address_misaligned, cp_store_address_misaligned}

mtval_ebreak_op

On a breakpoint exception raised by an EBREAK or C.EBREAK instruction, mtval is written with either zero or the virtual address of the instruction.

ExceptionsSm_cg/{cp_breakpoint, cp_ebreak_straddle64}, ExceptionsZc_cg/cp_breakpoint

mtval_instr_bits_lead_in

The mtval register can optionally also be used to return the faulting instruction bits on an illegal-instruction exception

ExceptionsSm_cg/cp_illegal_instruction

mtval_instr_bits_list

the actual faulting instruction the first ILEN bits of the faulting instruction the first MXLEN bits of the faulting instruction

ExceptionsSm_cg/cp_illegal_instruction, ExceptionsZc_cg/cp_illegal_instruction

mtval_ill_instr_exc_in_low_bits

On an illegal-instruction exception, the instruction bits are zero-extended and loaded into mtval.

ExceptionsSm_cg/cp_illegal_instruction, ExceptionsZc_cg/cp_illegal_instruction

Table 173. ExceptionsSm UDB Parameters
Parameter Description Coverpoint Effect

MISALIGNED_LDST

Does the implementation perform non-atomic misaligned loads and stores to main memory (does not affect misaligned support to device memory)? If not, the implementation always throws a misaligned exception.

cp_{load_address_misaligned, store_address_misaligned, cp_misaligned_priority_load, cp_misaligned_priority_store}

When true, misaligned loads and stores do not cause exceptions

MISALIGNED_LDST_EXCEPTION_PRIORITY

The relative priority of a load/store/AMO exception vs. load/store/AMO page-fault or access-fault exceptions.

May be one of:

[separator="!"] !=== ! low ! Misaligned load/store/AMO exceptions are always lower priority than load/store/AMO page-fault and access-fault exceptions. ! high ! Misaligned load/store/AMO exceptions are always higher priority than load/store/AMO page-fault and access-fault exceptions. !===

MISALIGNED_LDST_EXCEPTION_PRIORITY cannot be "high" when MISALIGNED_MAX_ATOMICITY_GRANULE_SIZE is non-zero, since the atomicity of an access cannot be determined in that case until after address translation.

cp_misaligned_priority_load, cp_misaligned_priority_store

When true, misaligned loads and stores do not cause exceptions

MTVAL_WIDTH

The number of implemented bits in the mtval CSR. This is the CSR that may be written when a trap is taken into M-mode with exception-specific information to assist software in handling the trap (e.g., address associated with exception).

Must be greater than or equal to max(PHYS_ADDR_WIDTH, VA_SIZE)

TODO

MTVEC_ACCESS

Options:

ro:: mtvec is read-only.

rw:: mtvec is read-write, but may not accept all values.

all exception coverpoints

If 'ro', tests cannot set mtvec and generate a trap signature

MTVEC_BASE_ALIGNMENT_DIRECT

Minimum alignment of the base pointer. Because mtvec excludes the two least-significant bits of the base, the minimum alignment cannot be less than 4.

all exception coverpoints

Trap handler is aligned to the appropriate boundary

MTVEC_ILLEGAL_WRITE_BEHAVIOR

Options:

retain:: When either mtvec.MODE or mtvec.BASE is illegal, mtvec will retain its current value

custom:: When either mtvec.MODE or mtvec.BASE is illegal, mtvec will obtain an unpredictable value

Other values may be added over time once other common behaviors are identified.

all exception coverpoints

If mtvec cannot be written with trap handler, tests will not operate

REPORT_ENCODING_IN_MTVAL_ON_ILLEGAL_INSTRUCTION

Options:

* true: mtval is written with the encoding of an instruction causing an IllegalInstruction exception * false: mtval is written with 0 when an instruction causes an IllegalInstruction exception.

cp_illegal_instruction

Affects value written to mtval

REPORT_VA_IN_MTVAL_ON_BREAKPOINT

Options:

* true: mtval is written with the virtual PC of an EBREAK instruction (same information as mepc). * false: mtval is written with 0 on an EBREAK instruction.

Regardless, mtval is always written with a virtual PC when an external breakpoint is generated

cp_breakpoint

Affects value written to mtval

REPORT_VA_IN_MTVAL_ON_INSTRUCTION_ACCESS_FAULT

Options:

* true: mtval is written with the virtual address of a fetch causing the access fault * false: mtval is written with 0 when a fetch causes an access fault

cp_instr_access_fault

Affects value written to mtval

REPORT_VA_IN_MTVAL_ON_INSTRUCTION_MISALIGNED

Options:

* true: mtval is written with the virtual address of a trapping misaligned fetch * false: mtval is written with 0 when a misaligned fetch traps

cp_instr_adr_misaligned_branch, cp_instr_misaligned_jal, cp_instr_misaligned_jalr

Affects value written to mtval

REPORT_VA_IN_MTVAL_ON_LOAD_ACCESS_FAULT

Options:

* true: mtval is written with the virtual address of a load causing the access fault * false: mtval is written with 0 when a load causes an access fault

cp_load_access_fault

Affects value written to mtval

REPORT_VA_IN_MTVAL_ON_LOAD_MISALIGNED

Options:

* true: mtval is written with the virtual address of a trapping misaligned load. * false: mtval is written with 0 when a misaligned load traps.

cp_load_address_misaligned

Affects value written to mtval

REPORT_VA_IN_MTVAL_ON_STORE_AMO_ACCESS_FAULT

Options:

* true: mtval is written with the virtual address of a store or AMO causing the access fault * false: mtval is written with 0 when a store or AMO causes an access fault

cp_store_access_fault

Affects value written to mtval

REPORT_VA_IN_MTVAL_ON_STORE_AMO_MISALIGNED

Options:

* true: mtval is written with the virtual address of a trapping misaligned store or AMO. * false: mtval is written with 0 when a misaligned store or AMO traps.

cp_store_address_misaligned

Affects value written to mtval

TRAP_ON_EBREAK

The spec states that implementations may handle EBREAKs transparently without raising a trap, in which case the EEI must provide a builtin.

cp_breakpoint

TODO

TRAP_ON_ECALL_FROM_M

The spec states that implementations may handle ECALLs transparently without raising a trap, in which case the EEI must provide a builtin.

cp_ecall_m

TODO

B.2.2. ExceptionsS Supervisor-Mode Exceptions

These additional exception tests are run on configurations with supervisor mode.

The following exceptions should be exercised in supervisor mode unless otherwise noted. All inherently require Zicsr.

Table 174. ExceptionsS Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule Notes

cp_instr_adr_misaligned_branch

Instruction Address Misaligned

Each type of branch taken to an address that is an odd multiple of 2
PC[1] = 0 and imm[1]=1

Only throws an exception if C is not supported.

6 branches

taken_cti_misaligned_exc
branch_misaligned_taken_exception

cp_instr_adr_misaligned_branch_nottaken

Instruction Address Misaligned

Each type of branch not taken to an address that is an odd multiple of 2

No exception

6 branches

cond_br_no_ia_misaligned_exc_not_taken
branch_misaligned_untaken_exception

cp_instr_adr_misaligned_jal

Instruction Address Misaligned

jal to an address that is an odd multiple of 2
PC[1] = 0 and imm[1]=1

Instruction at multiple of 4. Offset is an odd multiple of 2.

1

taken_cti_misaligned_exc
jump_misaligned_exception

cp_instr_adr_misaligned_jalr

Instruction Address Misaligned

jalr to an address that is an odd multiple of 2 and odd multiple of 2 + 1.
Every combination of rs1_val[1:0] and offset[1:0]

Only throws an exception if C is not supported.

4 rs1[1:0] * 4 offset[1:0]

taken_cti_misaligned_exc
jump_misaligned_exception

cp_instr_access_fault

Instruction Access Fault

Fetch instruction from unimplemented memory

Access fault

1

ia_fault_exc_on_target
stval_op_faulting_addr

cp_illegal_instruction

Illegal Instruction

Executing instruction 0x00000000 and 0xFFFFFFFF

throws an illegal instruction exception (trap and mcause)

2 instr

sstatus_spp
mstatus_xpie_xie_xpp_trap_op
sepc_op_trap_write
scause
scause_interrupt
scause_exccode_enc_tbl
stval
stval_op_illegal_instr

cp_illegal_instruction_seed

Illegal Read-only access to a CSR

csrrs x*, seed, x0 throws illegal instruction as do
csrrc x*, seed, x0
csrrsi x*, seed, 0
csrrci x*, seed, 0

Illegal instruction exception

4 csr ops

* this could be reserved and should be moved to an Zkr spreadsheet for all priv modes

cp_breakpoint

Breakpoint

ebreak throws breakpoint exception
also test when straddling 64B boundary

throws breakpoint exception (trap and mcause)

1

ebreak_debug_env_op
ebreak_debugger_transfer_op
ecall_ebreak_epc_value
trap_del_s_mode_op
sstatus_spp
mstatus_xpie_xie_xpp_trap_op
scause_exccode_enc_tbl
stval_op_faulting_addr
stval_op_breakpoint

cp_load_address_misaligned

Load Misaligned

Attempt lh, lhu, lw, lwu, ld with every combination of three address lsbs: 000 - 111

Might not cause exception

7 ops * 8 lsbs

ldst_no_exc_aligned
stval_op_faulting_addr

cp_load_access_fault

Load Access Fault

Attempt lb, lbu, lh, lhu, lw, lwu, ld from an illegal address (parameterized)

Load access fault

7 ops

mcause_exccode_ld_ldrsv
trap_del_s_mode_op

cp_store_address_misaligned

Store Misaligned

Attempt sh, sw, sd with every combination of three lsbs: 000-111

Might not cause exception

4 ops * 8 lsbs

ldst_no_exc_aligned

cp_store_access_fault

Store Access Fault

Attempt sb, sh, sw, sd from an illegal address (parameterized)

Store access fault

4 ops

mcause_exccode_st_sc_amo
trap_del_s_mode_op
stval_op_faulting_addr

cp_ecall_s

ecall

ecall from supervisor mode throws ecall supervisor exception (trap and mcause)

ecall to M-mode (should not be delegated to S-mode because there would be no path to M-mode)

1

ecall_ebreak_epc_value

cp_misaligned_priority

Priority of exceptions

Attempt lw and sw and fetch from memory location causing access fault and misaligned

System-dependent

3 ops

mcause_exccode_priority_misaligned

cp_stvec

Cause delegated exception in s and u mode with stvec != mtvec

Delegates to stvec handler

2 modes

stvec_sz_base
stvec_mode_enc

cp_xstatus_ie

Interrupt Enables

ecall cross {mode = user/supervisor, mstatus.mie = {0/1}, mstatus.sie = {0/1}}

xpie gets xie, xie gets 0

3 modes * 2 medleg * 2 mie * 2 sie

Note: instruction/load/store fault pages are being tested in ExceptionsSv

Note: tests that differ from ExceptionsSm are cp_medeleg_mu and cp_stvec. Also, cp_misaligned_priority is not split here.

Table 175. ExceptionsS Normative Rules
Normative Rule Rule Text Coverpoints

taken_cti_misaligned_exc

An instruction-address-misaligned exception is generated on a taken branch or unconditional jump if the target address is not IALIGN-bit aligned. This exception is reported on the branch or jump instruction, not on the target instruction.

ExceptionsS_cg/cp_instr_adr_misaligned_{branch, jal, jalr}

branch_misaligned_taken_exception

The conditional branch instructions will generate an instruction-address-misaligned exception if the target address is not aligned to a four-byte boundary and the branch condition evaluates to true.

ExceptionsS_cg/cp_instr_adr_misaligned_branch

jump_misaligned_exception

The JAL and JALR instructions will generate an instruction-address-misaligned exception if the target address is not aligned to a four-byte boundary.

ExceptionsS_cg/cp_instr_adr_misaligned_{jal, jalr}

cond_br_no_ia_misaligned_exc_not_taken

No instruction-address-misaligned exception is generated for a conditional branch that is not taken.

ExceptionsS_cg/cp_instr_adr_misaligned_branch_nottaken

branch_misaligned_untaken_exception

If the branch condition evaluates to false, the instruction-address-misaligned exception will not be raised.

ExceptionsS_cg/cp_instr_adr_misaligned_branch_nottaken

ia_fault_exc_on_target

If an instruction access-fault or instruction page-fault exception occurs on the target of a jump or taken branch, the exception is reported on the target instruction, not on the jump or branch instruction.

ExceptionsS_cg/cp_instr_access_fault

ebreak_debug_env_op, ebreak_debugger_transfer_op

ebreak_debug_env_op: The EBREAK instruction is used to return control to a debugging environment. ebreak_debugger_transfer_op: The EBREAK instruction is used by debuggers to cause control to be transferred back to a debugging environment. Unless overridden by an external debug environment, EBREAK raises a breakpoint exception and performs no other operation.

ExceptionsS_cg/cp_breakpoint

ecall_ebreak_epc_value

ECALL and EBREAK cause the receiving privilege mode’s epc register to be set to the address of the ECALL or EBREAK instruction itself, not the address of the following instruction.

ExceptionsS_cg/{cp_ecall_s, cp_breakpoint}

ldst_no_exc_aligned

loads and stores whose effective addresses are naturally aligned shall not raise an address-misaligned exception.

ExceptionsS_cg/cp_{load, store}_address_misaligned

mcause_exccode_ld_ldrsv

Note that load and load-reserved instructions generate load exceptions

ExceptionsS_cg/cp_load_access_fault

mcause_exccode_st_sc_amo

store, store-conditional, and AMO instructions generate store/AMO exceptions.

ExceptionsS_cg/cp_store_access_fault

mcause_exccode_priority_misaligned

Load/store/AMO address-misaligned exceptions may have either higher or lower priority than load/store/AMO page-fault and access-fault exceptions.

ExceptionsS_cg/cp_misaligned_priority

trap_del_s_mode_op

When a trap is delegated to S-mode, the scause register is written with the trap cause; the sepc register is written with the virtual address of the instruction that took the trap; the stval register is written with an exception-specific datum; the SPP field of mstatus is written with the active privilege mode at the time of the trap; the SPIE field of mstatus is written with the value of the SIE field at the time of the trap; and the SIE field of mstatus is cleared.

ExceptionsS_cg/{cp_breakpoint, cp_load_access_fault, cp_store_access_fault}

sstatus_spp

The SPP bit indicates the privilege level at which a hart was executing before entering supervisor mode. When a trap is taken, SPP is set to 0 if the trap originated from user mode, or 1 otherwise. When an SRET instruction (see ) is executed to return from the trap handler, the privilege level is set to user mode if the SPP bit is 0, or supervisor mode if the SPP bit is 1; SPP is then set to 0.

ExceptionsS_cg/{cp_illegal_instruction, cp_breakpoint}

mstatus_xpie_xie_xpp_trap_op

When a trap is taken from privilege mode y into privilege mode x, xPIE is set to the value of xIE; xIE is set to 0; and xPP is set to y.

ExceptionsS_cg/{cp_illegal_instruction, cp_breakpoint}

UDB Parameters: None.

B.2.3. ExceptionsU User-Mode Exceptions

These additional exception tests are run on configurations with user mode.

Table 176. ExceptionsU Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule

cp_instr_adr_misaligned_branch

Instruction Address Misaligned

Branch taken to an address that is an odd multiple of 2
PC[1] = 0 and imm[1]=1

Only throws an exception if C is not supported.

6 branches

taken_cti_misaligned_exc
branch_misaligned_taken_exception

cp_instr_adr_misaligned_branch_nottaken

Instruction Address Misaligned

Branch not taken to an address that is an odd multiple of 2

No exception

6 branches

cond_br_no_ia_misaligned_exc_not_taken
branch_misaligned_untaken_exception

cp_instr_adr_misaligned_jal

Instruction Address Misaligned

jal to an address that is an odd multiple of 2
PC[1] = 0 and imm[1]=1

Instruction at multiple of 4. Offset is an odd multiple of 2.

1

taken_cti_misaligned_exc
jump_misaligned_exception

cp_instr_adr_misaligned_jalr

Instruction Address Misaligned

jalr to an address that is an odd multiple of 2 and odd multiple of 2 + 1.
Every combination of rs1_val[1:0] and offset[1:0]

Only throws an exception if C is not supported.

4 rs1[1:0] * 4 offset[1:0]

taken_cti_misaligned_exc
jump_misaligned_exception

cp_instr_access_fault

Instruction Access Fault

Jump to access fault address

Instruction access fault is raised (trap and mcause)

1

ia_fault_exc_on_target

cp_illegal_instruction

Illegal Instruction

Executing instruction 0x00000000 and 0xFFFFFFFF

throws an illegal instruction exception (trap and mcause)

2 instr

mstatus_xpie_xie_xpp_trap_op
sstatus_spp

cp_illegal_instruction_seed

Illegal Read-only access to a CSR

csrrs x*, seed, x0 throws illegal instruction, as do
csrrc x*, seed, x0
csrrsi x*, seed, 0
csrrci x*, seed, 0

illegal instruction exception

4 csr ops

* move to Zkr

cp_breakpoint

Breakpoint

ebreak throws breakpoint exception
also test when straddling 64B boundary

throws breakpoint exception (trap and mcause)

1

mstatus_xpie_xie_xpp_trap_op
sstatus_spp
trap_del_s_mode_op
ecall_ebreak_epc_value
ebreak_debug_env_op
ebreak_debugger_transfer_op

cp_load_address_misaligned

Load Misaligned

Attempt lh, lhu, lw, lwu, ld with every combination of three address lsbs: 000 - 111

Might not cause exception

7 ops * 8 lsbs

ldst_no_exc_aligned

cp_load_access_fault

Load Access Fault

Attempt lb, lbu, lh, lhu, lw, lwu, ld from an illegal address (parameterized)

load access fault

7 ops

trap_del_s_mode_op
mcause_exccode_ld_ldrsv

cp_store_address_misaligned

Store Misaligned

Attempt sh, sw, sd with every combination of three lsbs: 000-111

Might not cause exception

4 ops * 8 lsbs

ldst_no_exc_aligned

cp_store_access_fault

Store Access Fault

Attempt sb, sh, sw, sd from an illegal address (parameterized)

store access fault

4 ops

trap_del_s_mode_op
mcause_exccode_st_sc_amo

cp_ecall_u

ecall

ecall from user mode

throws ecall user exception (trap and mcause)

1

ecall_priv_mode_op
ecall_ebreak_epc_value

cp_misaligned_priority

Priority of exceptions

Attempt lw and sw and fetch from memory location causing access fault and misaligned

priority may vary.

3 ops

mcause_exccode_priority_order
mcause_exccode_priority_misaligned

cp_mstatus_ie

Interrupt Enables

ecall to machine cross mie = {0/1}

mpie gets xie, mie gets 0

2 mie

Table 177. ExceptionsU Normative Rules
Normative Rule Rule Text Coverpoints

mstatus_xpie_xie_xpp_trap_op

When a trap is taken from privilege mode y into privilege mode x, xPIE is set to the value of xIE; xIE is set to 0; and xPP is set to y.

ExceptionsU_cg/{cp_illegal_instruction, cp_breakpoint}

sstatus_spp

The SPP bit indicates the privilege level at which a hart was executing before entering supervisor mode. When a trap is taken, SPP is set to 0 if the trap originated from user mode, or 1 otherwise. When an SRET instruction (see ) is executed to return from the trap handler, the privilege level is set to user mode if the SPP bit is 0, or supervisor mode if the SPP bit is 1; SPP is then set to 0.

ExceptionsU_cg/{cp_illegal_instruction, cp_breakpoint}

trap_del_s_mode_op

When a trap is delegated to S-mode, the scause register is written with the trap cause; the sepc register is written with the virtual address of the instruction that took the trap; the stval register is written with an exception-specific datum; the SPP field of mstatus is written with the active privilege mode at the time of the trap; the SPIE field of mstatus is written with the value of the SIE field at the time of the trap; and the SIE field of mstatus is cleared.

ExceptionsU_cg/{cp_breakpoint, cp_load_access_fault, cp_store_access_fault}

ecall_priv_mode_op

The ECALL instruction is used to make a request to the supporting execution environment. When executed in U-mode, S-mode, or M-mode, it generates an environment-call-from-U-mode exception, environment-call-from-S-mode exception, or environment-call-from-M-mode exception, respectively, and performs no other operation.

ExceptionsU_cg/cp_ecall_u

ecall_ebreak_epc_value

ECALL and EBREAK cause the receiving privilege mode’s epc register to be set to the address of the ECALL or EBREAK instruction itself, not the address of the following instruction.

ExceptionsU_cg/{cp_ecall_u, cp_breakpoint}

taken_cti_misaligned_exc

An instruction-address-misaligned exception is generated on a taken branch or unconditional jump if the target address is not IALIGN-bit aligned. This exception is reported on the branch or jump instruction, not on the target instruction.

ExceptionsU_cg/cp_instr_adr_misaligned_{branch, jal, jalr}

branch_misaligned_taken_exception

The conditional branch instructions will generate an instruction-address-misaligned exception if the target address is not aligned to a four-byte boundary and the branch condition evaluates to true.

ExceptionsU_cg/cp_instr_adr_misaligned_branch

jump_misaligned_exception

The JAL and JALR instructions will generate an instruction-address-misaligned exception if the target address is not aligned to a four-byte boundary.

ExceptionsU_cg/cp_instr_adr_misaligned_{jal, jalr}

cond_br_no_ia_misaligned_exc_not_taken

No instruction-address-misaligned exception is generated for a conditional branch that is not taken.

ExceptionsU_cg/cp_instr_adr_misaligned_branch_nottaken

branch_misaligned_untaken_exception

If the branch condition evaluates to false, the instruction-address-misaligned exception will not be raised.

ExceptionsU_cg/cp_instr_adr_misaligned_branch_nottaken

ia_fault_exc_on_target

If an instruction access-fault or instruction page-fault exception occurs on the target of a jump or taken branch, the exception is reported on the target instruction, not on the jump or branch instruction.

ExceptionsU_cg/cp_instr_access_fault

ebreak_debug_env_op

The EBREAK instruction is used to return control to a debugging environment.

ExceptionsU_cg/cp_breakpoint

ebreak_debugger_transfer_op

The EBREAK instruction is used by debuggers to cause control to be transferred back to a debugging environment. Unless overridden by an external debug environment, EBREAK raises a breakpoint exception and performs no other operation.

ExceptionsU_cg/cp_breakpoint

ldst_no_exc_aligned

loads and stores whose effective addresses are naturally aligned shall not raise an address-misaligned exception.

ExceptionsU_cg/cp_{load, store}_address_misaligned

mcause_exccode_ld_ldrsv

Note that load and load-reserved instructions generate load exceptions

ExceptionsU_cg/cp_load_access_fault

mcause_exccode_st_sc_amo

store, store-conditional, and AMO instructions generate store/AMO exceptions.

ExceptionsU_cg/cp_store_access_fault

mcause_exccode_priority_order

If an instruction may raise multiple synchronous exceptions, the decreasing priority order of norm:exc_priority indicates which exception is taken and reported in mcause.

ExceptionsU_cg/cp_misaligned_priority_{load, store}

mcause_exccode_priority_misaligned

Load/store/AMO address-misaligned exceptions may have either higher or lower priority than load/store/AMO page-fault and access-fault exceptions.

ExceptionsU_cg/cp_misaligned_priority_{load, store}

UDB Parameters: None.

B.2.4. ExceptionsF Floating-Point Exceptions

These additional exception tests are run on configurations with floating-point (at least the F extension).

Table 178. ExceptionsF Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule

cp_mstatus_fs_illegal_instr

Illegal Instruction

Executing a floating-point instruction when mstatus.FS=00

causes illegal instruction exception.

19 instructions selected for testing

mstatus_fs_vs_xs_off_op

cp_mstatus_fs_csr_access

Illegal Instruction

Access (read, write, set, clear) fcsr, fflags, frm when mstatus.FS=00

causes illegal instruction exception.

3 instructions * 3 CSRs

mstatus_fs_vs_xs_off_op

cp_mstatus_fs_legal

legal instruction

Executing a floating-point instruction when mstatus.FS=01, 10, 11
cross with legal frm values

does not cause an illegal instruction exception

3 FS * 19 instructions * 5 legal frm values

mstatus_fs_wr

cp_load_address_misaligned

misaligned load

Execute flw with all 4 lsbs in address. If supported, also do flh, fld, flq.

might cause misaligned load fault

16 addresses * up to 4 instructions

ldst_no_exc_aligned
misaligned_ldst_exc_type
mcause_exccode_op
mcause_exccode_ld_ldrsv

cp_load_access_fault

load access fault

Execute flw from access fault address. If supported, also do flh, fld, flq

load access fault

up to 4 instructions

misaligned_ldst_exc_type
mcause_exccode_op
mcause_exccode_ld_ldrsv

cp_store_address_misaligned

misaligned store

Execute fsw with all 4 lsbs in address. If supported, also do fsh, fsd, fsq.

might cause misaligned load fault

16 addresses * up to 4 instructions

ldst_no_exc_aligned
misaligned_ldst_exc_type
mcause_exccode_op

cp_store_access_fault

store access fault

Execute fsw from access fault address. If supported, also do fsh, fsd, fsq.

load access fault

up to 4 instructions

misaligned_ldst_exc_type
mcause_exccode_op

Table 179. ExceptionsF Normative Rules
Normative Rule Rule Text Coverpoints

ldst_no_exc_aligned

loads and stores whose effective addresses are naturally aligned shall not raise an address-misaligned exception.

ExceptionsF_cg/cp_{load_address_misaligned, store_address_misaligned}

misaligned_ldst_exc_type

loads and stores that are not naturally aligned may either complete execution successfully or raise an exception. The exception raised can be either an address-misaligned exception or an access-fault exception. For a memory access that would otherwise be able to complete except for the misalignment, an access-fault exception can be raised instead of an address-misaligned exception if the misaligned access should not be emulated, e.g., if accesses to the memory region have side effects.

ExceptionsF_cg/cp_{load_address_misaligned, store_address_misaligned, load_access_fault, store_access_fault}

mstatus_fs_vs_xs_off_op

When an extension’s status is set to Off, any instruction that attempts to read or write the corresponding state will cause an illegal-instruction exception.

ExceptionsF_cg/{cp_mstatus_fs_illegal_instr, cp_mstatus_fs_csr_access}

mstatus_fs_wr

Changing the setting of FS has no effect on the contents of the floating-point register state. In particular, setting FS=Off does not destroy the state, nor does setting FS=Initial clear the contents.

ExceptionsF_cg/cp_mstatus_fs_legal

mcause_exccode_op

The Exception Code field contains a code identifying the last exception or interrupt.

ExceptionsF_cg/cp_{load_address_misaligned, store_address_misaligned, load_access_fault, store_access_fault}

mcause_exccode_ld_ldrsv

Note that load and load-reserved instructions generate load exceptions

ExceptionsF_cg/cp_{load_address_misaligned, load_access_fault}

UDB Parameters: None.

B.2.5. ExceptionsZalrsc Atomic LR/SC Exceptions

Table 180. ExceptionsZalrsc Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule

cp_load_address_misaligned

Load Misaligned

Misaligned lr.w, lr.d (8 bins for bottom 3 bits of address)

8 lsbs * 2 instr

mcause_exccode_ld_ldrsv
lr_sc_alignment
ldst_no_exc_aligned

cp_load_access_fault

Load Access Fault

Access fault of lr.w, lr.d

Access fault

2 instructions

mcause_exccode_ld_ldrsv

cp_load_access_misaligned_priority

Load with both faults

Access fault of lr.w and lr.d with misaligned address

2 instr

mcause_exccode_priority_misaligned

cp_store_address_misaligned

Store Misaligned

Misaligned sc.w, sc.d cross match lr address (8 bins for bottom 3 bits of address) cross rd having an initial value > 1

Faulting sc should not change rd

8 lsbs * 2 instr

lr_sc_alignment
mcause_exccode_st_sc_amo
ldst_no_exc_aligned

cp_store_access_fault

Store Access Fault

Access fault of sc.w, sc.d cross match lr address cross rd having an initial value > 1

Faulting sc should not change rd

2 instr

mcause_exccode_st_sc_amo
sc_retire_permission
sc_failed_as_store

cp_store_access_misaligned_priority

Store with both faults

Access fault and missalign of sc.w and sc.d cross match lr address cross rd having an initial value > 1

Faulting sc should not change rd

2 instr

mcause_exccode_priority_misaligned

Table 181. ExceptionsZalrsc Normative Rules
Normative Rule Rule Text Coverpoints

mcause_exccode_st_sc_amo

store, store-conditional, and AMO instructions generate store/AMO exceptions.

ExceptionsZalrsc_cg/{cp_store_access_fault, cp_store_address_misaligned_illegal_w}

sc_retire_permission

No SC.W instruction shall retire unless it passes memory permission checks,

ExceptionsZalrsc_cg/cp_store_access_fault

sc_failed_as_store

For the purposes of memory protection, a failed SC.W may be treated like a store.

ExceptionsZalrsc_cg/cp_store_access_fault

lr_sc_alignment

For LR and SC, the Zalrsc extension requires that the address held in rs1 be naturally aligned to the size of the operand (i.e., eight-byte aligned for doublewords and four-byte aligned for words). If the address is not naturally aligned, an address-misaligned exception or an access-fault exception will be generated. The access-fault exception can be generated for a memory access that would otherwise be able to complete except for the misalignment, if the misaligned access should not be emulated.

ExceptionsZalrsc_cg/{cp_load_address_misaligned, cp_store_address_misaligned_illegal_w, cp_store_address_misaligned_illegal_d}

ldst_no_exc_aligned

loads and stores whose effective addresses are naturally aligned shall not raise an address-misaligned exception.

ExceptionsZalrsc_cg/{cp_load_address_misaligned, cp_store_address_misaligned_legal_w}

mcause_exccode_ld_ldrsv

Note that load and load-reserved instructions generate load exceptions

ExceptionsZalrsc_cg/{cp_load_address_misaligned, cp_load_access_fault}

mcause_exccode_priority_misaligned

Load/store/AMO address-misaligned exceptions may have either higher or lower priority than load/store/AMO page-fault and access-fault exceptions.

ExceptionsZalrsc_cg/{cp_load_access_misaligned_priority, cp_store_access_misaligned_priority}

Table 182. ExceptionsZalrsc UDB Parameters
Parameter Description Coverpoint Effect

LRSC_MISALIGNED_BEHAVIOR

What to do when an LR/SC address is misaligned and MISALIGNED_AMO == false.

* 'always raise misaligned exception': self-explanatory * 'always raise access fault': self-explanatory * 'custom': Custom behavior; misaligned LR/SC may sometimes raise a misaligned exception and sometimes raise an access fault. Will lead to an 'unpredictable' call on any misaligned LR/SC access

cp_{load,store}_address_misaligned

Misaligned LR/SC throws misaligned exception or access fault

B.2.6. ExceptionsZaamo Atomic Memory Operation Exceptions

Table 183. ExceptionsZaamo Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule

cp_amo_address_misaligned

AMO Misaligned

Misaligned amoswap.w, amoadd.w, amoxor.w, amoand.w, amoor.w, amomin.w, amomax.w, amominu.w, amomaxu.w. RV64: also .d. Zabha: also .h, .b.
Use all offsets up to MISALIGNED_MAX_ATOMICITY_GRANULE_SIZE+1. This inherently tests Zama16b if it is supported.

May produce misaligned or access fault or may succeed

up to (9*4) instr * 32 lsbs

mcause_exccode_st_sc_amo
amo_alignment
pma_mag_op_amo
misaligned_atomicity_granule_size
pma_mag_insts
pma_mag_exc
Zabha_rs1_align_addr
Zacas_amocas_rs1_addr_alignment

cp_amo_access_fault

AMO Access Fault

Access fault on amoswap.w, amoadd.w, amoxor.w, amoand.w, amoor.w, amomin.w, amomax.w, amominu.w, amomaxu.w. RV64: also .d. Zabha: also .h, .b.

Access Fault.

up to (9*4) instr

mcause_exccode_st_sc_amo

Table 184. ExceptionsZaamo Normative Rules
Normative Rule Rule Text Coverpoints

mcause_exccode_st_sc_amo

store, store-conditional, and AMO instructions generate store/AMO exceptions.

ExceptionsZaamo_cg/cp_amo_{address_misaligned, access_fault}

amo_alignment

For AMOs, the Zaamo extension requires that the address held in rs1 be naturally aligned to the size of the operand (i.e., eight-byte aligned for doublewords and four-byte aligned for words).

ExceptionsZaamo_cg/cp_amo_address_misaligned

pma_mag_op_amo

If a misaligned AMO accesses a region that does not specify a misaligned atomicity granule PMA, or if not all accessed bytes lie within the same misaligned atomicity granule, then an exception is raised.

ExceptionsZaamo_cg/cp_amo_address_misaligned

misaligned_atomicity_granule_size, pma_mag_insts

misaligned_atomicity_granule_size: The misaligned atomicity granule PMA, defined in sec:misaligned-atomicity-granule, optionally relaxes this alignment requirement. If present, the misaligned atomicity granule PMA specifies the size of a misaligned atomicity granule, a power-of-two number of bytes. The misaligned atomicity granule PMA applies only to AMOs defined in the Zaamo, Zabha, and Zacas extensions; loads and stores defined in the base ISAs; loads and stores of no more than XLEN bits defined in the F, D, and Q extensions; the load-acquire and store-release instructions defined in the Zalasr extension; and compressed encodings of the foregoing loads and stores. For an instruction in that set, if all accessed bytes lie within the same misaligned atomicity granule, the instruction will not raise an exception for reasons of address alignment, and the instruction will give rise to only one memory operation for the purposes of RVWMO—​i.e., it will execute atomically. pma_mag_insts: The misaligned atomicity granule PMA applies only to AMOs defined in the Zaamo, Zabha, and Zacas extensions; loads and stores defined in the base ISAs; loads and stores of no more than XLEN bits defined in the F, D, and Q extensions; the load-acquire and store-release instructions defined in the Zalasr extension; and compressed encodings of the foregoing loads and stores.

ExceptionsZaamo_cg/cp_amo_address_misaligned

pma_mag_exc

Implementations may raise access-fault exceptions instead of address-misaligned exceptions for some misaligned accesses, indicating the instruction should not be emulated by a trap handler.

ExceptionsZaamo_cg/cp_amo_address_misaligned

UDB Parameters: None.

B.2.7. ExceptionsZc Compressed Instruction Exceptions

These additional exception tests are run on configurations with compressed instructions (C, Zca, Zcb, etc.). They attempt to test all compressed loads and stores, but may throw an illegal instruction fault on compressed subword load/store if Zcb is not supported.

Table 185. ExceptionsZc Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule

cp_breakpoint

Compressed breakpoint

c.ebreak

Breakpoint exception

1

mtval_ebreak_op
c-ebreak_op
c-jalr_ebreak

cp_load_address_misaligned

Compressed loads with misaligned addresses

Attempt c.lw, c.lwsp, c.ld, c.ldsp with every combination of three lsbs:000-111.
If Zcb supported, also c.lbu,c.lh, c.lhu
If Zcf supported, also c.flw, c.flwsp
If Zcd supported, also c.fld, c.fldsp

If misaligned not supported, accesses that are not naturally aligned will throw load misaligned fault.

up to 11 instructions * 8 addresses

cp_load_access_fault

Compressed loads to nonexistent address

Attempt instructions above from an illegal address (parameterized)

Load access fault

up to 11 instructions

cp_store_address_misaligned

Compressed stores with misaligned addresses

Attempt c.sw, c.swsp, c.sd,c.sdsp with every combination of three lsbs: 000-111
If Zcb supported, also c.sb, c.sh
If Zcf supported, also c.fsw, c.fswsp
If Zcd supported, also c.fsd, c.fsdsp

If misaligned not supported, accesses that are not naturally aligned will throw store misaligned fault.

up to 10 instructions * 8 addresses

cp_store_access_fault

Compressed stores to nonexistent address

Attempt instructions above to an illegal address (parameterized)

Store access fault

up to 10 instructions

cp_illegal_instruction

CompressedIllegal Instruction

c.illegal (0x0000)

Illegal instruction fault.

1

mtval_instr_bits_list
mtval_ill_instr_exc_in_low_bits
Zca_illegal
stval_op_illegal_instr_format

Table 186. ExceptionsZc Normative Rules
Normative Rule Rule Text Coverpoints

Zca_no_misaligned

With the addition of the Zca extension, no instructions can raise instruction-address-misaligned exceptions.

ExceptionsSm_cg/{cp_instr_adr_misaligned_branch, cp_instr_adr_misaligned_jal, cp_instr_adr_misaligned_jalr}

Zca_illegal

A 16-bit instruction with all bits zero is permanently reserved as an illegal instruction.

ExceptionsZc_cg/cp_illegal_instruction

c-ebreak_op

Debuggers can use the C.EBREAK instruction, which expands to EBREAK, to cause control to be transferred back to the debugging environment. C.EBREAK shares the opcode with the C.ADD instruction, but with rd and rs2 both zero, thus can also use the CR format.

ExceptionsZc_cg/cp_breakpoint

c-jalr_ebreak

C.JALR is valid only when rs1≠x0; the code point with rs1=x0 corresponds to the C.EBREAK instruction.

ExceptionsZc_cg/cp_breakpoint

Zca_align16

The Zca extension allows 16-bit instructions to be freely intermixed with 32-bit instructions, with the latter now able to start on any 16-bit boundary, i.e., IALIGN=16.

ExceptionsSm_cg/cp_ebreak_straddle64

UDB Parameters: None.

B.2.8. ExceptionsZicboS Supervisor-Mode CBO Exceptions

Tests done in supervisor and user mode. Configure menvcfg via T-SBI.

Table 187. ExceptionsZicboS Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule

cp_cbie

cbo.inval

If ZICBOM_SUPPORTED & SM1P12P0_OR_LATER_SUPPORTED:
Execute cbo.inval in {supervisor/user} mode with {menvcfg x senvcfg}.cbie = {00/01/11 x 00/01/11}

Trap when prohibited

2 modes * 3 menvcfg * 3 senvcfg

menvcfg_cbie_warl_op
menvcfg_cbie_cbo-inval_op_lead_in
menvcfg_cbie_cbo-inval_op_list
senvcfg_cbie
senvcfg_cbie_umode_op
cbo-inval_s_mode_enabled_op
cbo-inval_s_mode_flush_enc
cbo-inval_s_mode_inval_enc
cbo-inval

cp_cbcfe

cbo.flushclean

If ZICBOM_SUPPORTED & SM1P12P0_OR_LATER_SUPPORTED:
Execute cbo.{clean, flush} in {supervisor/user} mode with {menvcfg x senvcfg}.cbcfe = {0/1 x 0/1}

Trap when prohibited

2 instr * 2 modes * 2 menvcfg * 2 senvcfg

menvcfg_cbcfe_op
senvcfg_cbcfe
senvcfg_cbcfe_umode_op
cbo-clean_cbo-flush

cp_cbze

cbo.zero

If ZICBOZ_SUPPORTED & SM1P12P0_OR_LATER_SUPPORTED:
Execute cbo.zero in {supervisor/user} mode with {menvcfg x senvcfg}.cbze = {0/1 x 0/1}

Trap when prohibited

2 modes * 2 menvcfg * 2 senvcfg

menvcfg_cbze_op
senvcfg_cbze
senvcfg_cbze_op
senvcfg_cbze_umode_op
cbo-zero_basedon_xenvcfg_cbze

cp_cbo_access_fault

Access fault

For each supported cbo op {inval, clean, flush, zero, prefetch.{i/w/r}}
Execute op to RVMODEL_ACCESS_FAULT_ADDRESS with menvcfg and senvcfg enabled

CBO: Store access fault
Prefetch: no access fault

7 instr * 2 modes

fault_excep_csr
cbm_unperm_fault
cbz_unperm_fault
cbp_unperm_noexcep
cbo-zero_unaligned
cbo-flush_unaligned
cbo-inval_unaligned

cp_cbo_address_misaligned

No misaligned fault

For each supported cbo op {inval, clean, flush, zero, prefetch.{i/w/r}}
Execute op to valid address + 1 with menvcfg and senvcfg enabled

No misaligned faults

7 instr * 2 modes

no_addr_misaligned_excep
cbo-zero_unaligned
cbo-flush_unaligned
cbo-inval_unaligned

Table 188. ExceptionsZicboS Normative Rules
Normative Rule Rule Text Coverpoints

menvcfg_cbze_op

The Zicboz extension adds the CBZE (Cache Block Zero instruction enable) field to menvcfg. When the CBZE field is set to 1, it enables execution of the cache block zero instruction, CBO.ZERO, in modes less privileged than M. Otherwise, the instruction raises an illegal-instruction exception in modes less privileged than M.

ExceptionsZicboS_cg/cp_cbze

menvcfg_cbcfe_op

The Zicbom extension adds the CBCFE (Cache Block Clean and Flush instruction Enable) field to menvcfg. When the CBCFE field is set to 1, it enables execution of the cache block clean instruction (CBO.CLEAN) and the cache block flush instruction (CBO.FLUSH) in modes less privileged than M. Otherwise, these instructions raise an illegal-instruction exception in modes less privileged than M.

ExceptionsZicboS_cg/cp_cbcfe

menvcfg_cbie_warl_op

The Zicbom extension adds the CBIE (Cache Block Invalidate instruction Enable) WARL field to menvcfg to control execution of the cache block invalidate instruction (CBO.INVAL) in modes less privileged than M. When CBIE is set to 0b00, the instruction raises an illegal-instruction exception in modes less privileged than M.

ExceptionsZicboS_cg/cp_cbie

menvcfg_cbie_cbo-inval_op_lead_in

When CBIE is set to 0b01 or 0b11, and when enabled for execution in modes less privileged than M, it behaves as follows:

ExceptionsZicboS_cg/cp_cbie

menvcfg_cbie_cbo-inval_op_list

0b01 — The instruction is executed and performs a flush operation, even if configured by a mode less privileged than M to perform an invalidate operation. 0b11 — The instruction is executed and performs an invalidate operation, unless configured by a mode less privileged than M to perform a flush operation.

ExceptionsZicboS_cg/cp_cbie

senvcfg_cbcfe

The Zicbom extension adds the CBCFE (Cache Block Clean and Flush instruction Enable) field to senvcfg to control execution of the CBO.CLEAN and CBO.FLUSH instructions in U-mode.

ExceptionsZicboS_cg/cp_cbcfe

senvcfg_cbcfe_umode_op

Execution of these instructions in U-mode is enabled only if execution of these instructions is enabled for use in S-mode and CBCFE is set to 1; otherwise, an illegal-instruction exception is raised.

ExceptionsZicboS_cg/cp_cbcfe

senvcfg_cbie

The Zicbom extension adds the CBIE (Cache Block Invalidate instruction Enable) WARL field to senvcfg to control execution of the CBO.INVAL instruction in U-mode.

ExceptionsZicboS_cg/cp_cbie

senvcfg_cbie_umode_op

Execution of CBO.INVAL in U-mode is enabled only if execution of the instruction is enabled for use in S-mode and CBIE is set to 0b01 or 0b11; otherwise, an illegal-instruction exception is raised.

ExceptionsZicboS_cg/cp_cbie

cbo-inval_s_mode_enabled_op

If CBO.INVAL is enabled in S-mode to perform a flush operation, then when the instruction is enabled in U-mode it performs a flush operation, even if CBIE is set to 0b11. Otherwise, the instruction behaves as follows, depending on the CBIE encoding:

ExceptionsZicboS_cg/cp_cbie

cbo-inval_s_mode_flush_enc

ExceptionsZicboS_cg/cp_cbie

cbo-inval_s_mode_inval_enc

ExceptionsZicboS_cg/cp_cbie

senvcfg_cbze

The Zicboz extension adds the CBZE (Cache Block Zero instruction enable) field to senvcfg.

ExceptionsZicboS_cg/cp_cbze

senvcfg_cbze_op

The CBZE field controls execution of the cache block zero instruction (CBO.ZERO) in U-mode.

ExceptionsZicboS_cg/cp_cbze

senvcfg_cbze_umode_op

Execution of CBO.ZERO in U-mode is enabled only if execution of the instruction is enabled for use in S-mode and CBZE is set to 1; otherwise, an illegal-instruction exception is raised.

ExceptionsZicboS_cg/cp_cbze

cbxe_unaffected

The CBIE/CBCFE/CBZE fields in each envcfg register do not affect the read and write behavior of the same fields in the other envcfg registers.

cbo-inval

A CBO.INVAL instruction executes or raises either an illegal-instruction exception or a virtual-instruction exception based on the state of the envcfg.⁠CBIE fields:

ExceptionsZicboS_cg/cp_cbie

cbo-clean_cbo-flush

A CBO.CLEAN or CBO.FLUSH instruction executes or raises an illegal-instruction or virtual-instruction exception based on the state of the envcfg.⁠CBCFE bits:

ExceptionsZicboS_cg/cp_cbcfe

cbo-zero_basedon_xenvcfg_cbze

Finally, a CBO.ZERO instruction executes or raises an illegal-instruction or virtual-instruction exception based on the state of the envcfg.⁠CBZE bits:

ExceptionsZicboS_cg/cp_cbze

fault_excep_csr

When a page-fault, guest-page-fault, or access-fault exception is taken, the relevant *tval CSR is written with the faulting effective address (i.e. the value of rs1).

ExceptionsZicboS_cg/cp_cbo_access_fault

no_addr_misaligned_excep

CMO instructions do not generate address-misaligned exceptions.

ExceptionsZicboS_cg/cp_cbo_address_misaligned

cbm_access

A cache-block management instruction is permitted to access the specified cache block whenever a load instruction or store instruction is permitted to access the corresponding physical addresses.

Zicbom_cbo_clean_cg/cp_custom_cbo

cbm_unperm_fault

If access to the cache block is not permitted, a cache-block management instruction raises a store page-fault or store guest-page-fault exception if address translation does not permit any access or raises a store access-fault exception otherwise.

ExceptionsZicboS_cg/cp_cbo_access_fault

cbz_access

A cache-block zero instruction is permitted to access the specified cache block whenever a store instruction is permitted to access the corresponding physical addresses and when the PMAs indicate that cache-block zero instructions are a supported access type.

Zicboz_cbo_zero_cg/cp_custom_cbo

cbz_unperm_fault

If access to the cache block is not permitted, a cache-block zero instruction raises a store page-fault or store guest-page-fault exception if address translation does not permit write access or raises a store access-fault exception otherwise.

ExceptionsZicboS_cg/cp_cbo_access_fault

cbp_unperm_noexcep

If access to the cache block is not permitted, a cache-block prefetch instruction does not raise any exceptions and shall not access any caches or memory.

ExceptionsZicboS_cg/cp_cbo_access_fault

cbo-zero_unaligned

It is not required that rs1 is aligned to the size of a cache block.

ExceptionsZicboS_cg/{cp_cbo_access_fault, cp_cbo_address_misaligned}

cbo-flush_unaligned

It is not required that rs1 is aligned to the size of a cache block.

ExceptionsZicboS_cg/{cp_cbo_access_fault, cp_cbo_address_misaligned}

cbo-inval_unaligned

It is not required that rs1 is aligned to the size of a cache block.

ExceptionsZicboS_cg/{cp_cbo_access_fault, cp_cbo_address_misaligned}

UDB Parameters: None.

B.2.9. ExceptionsZicboU User-Mode CBO Exceptions

Tests done in user mode. Configure menvcfg via T-SBI.

Table 189. ExceptionsZicboU Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule

cp_cbie

cbo.inval

If ZICBOM_SUPPORTED & SM1P12P0_OR_LATER_SUPPORTED:
Execute cbo.inval with menvcfg.cbie = {00/01/11}

Trap when prohibited

3 vals

menvcfg_cbie_warl_op
menvcfg_cbie_cbo-inval_op_lead_in
menvcfg_cbie_cbo-inval_op_list
cbo-inval

cp_cbcfe

cbo.flushclean

If ZICBOM_SUPPORTED & SM1P12P0_OR_LATER_SUPPORTED:
Execute cbo.{clean, flush} with menvcfg.cbcfe = {0/1}

Trap when prohibited

2 instr * 2 vals

menvcfg_cbcfe_op
cbo-clean_cbo-flush

cp_cbze

cbo.zero

If ZICBOM_SUPPORTED & SM1P12P0_OR_LATER_SUPPORTED:
Execute cbo.zero with menvcfg.cbze = {0/1}

Trap when prohibited

2 vals

menvcfg_cbze_op
cbo-zero_basedon_xenvcfg_cbze

cp_cbo_access_fault

Access fault

For each supported cbo op {inval, clean, flush, zero, prefetch.{i/w/r}}
Execute op to RVMODEL_ACCESS_FAULT_ADDRESS with menvcfg enabled

CBO: Store access fault
Prefetch: no access fault

7 instr

fault_excep_csr
cbm_unperm_fault
cbz_unperm_fault
cbp_unperm_noexcep
cbo-zero_unaligned
cbo-flush_unaligned
cbo-inval_unaligned

cp_cbo_address_misaligned

No misaligned fault

For each supported cbo op {inval, clean, flush, zero, prefetch.{i/w/r}}
Execute op to valid address + 1 with menvcfg enabled

No misaligned faults

7 instr

no_addr_misaligned_excep
cbo-zero_unaligned
cbo-flush_unaligned
cbo-inval_unaligned

Table 190. ExceptionsZicboU Normative Rules
Normative Rule Rule Text Coverpoints

menvcfg_cbze_op

The Zicboz extension adds the CBZE (Cache Block Zero instruction enable) field to menvcfg. When the CBZE field is set to 1, it enables execution of the cache block zero instruction, CBO.ZERO, in modes less privileged than M. Otherwise, the instruction raises an illegal-instruction exception in modes less privileged than M.

ExceptionsZicboU_cg/cp_cbze

menvcfg_cbcfe_op

The Zicbom extension adds the CBCFE (Cache Block Clean and Flush instruction Enable) field to menvcfg. When the CBCFE field is set to 1, it enables execution of the cache block clean instruction (CBO.CLEAN) and the cache block flush instruction (CBO.FLUSH) in modes less privileged than M. Otherwise, these instructions raise an illegal-instruction exception in modes less privileged than M.

ExceptionsZicboU_cg/cp_cbcfe

menvcfg_cbie_warl_op

The Zicbom extension adds the CBIE (Cache Block Invalidate instruction Enable) WARL field to menvcfg to control execution of the cache block invalidate instruction (CBO.INVAL) in modes less privileged than M. When CBIE is set to 0b00, the instruction raises an illegal-instruction exception in modes less privileged than M.

ExceptionsZicboU_cg/cp_cbie

menvcfg_cbie_cbo-inval_op_lead_in

When CBIE is set to 0b01 or 0b11, and when enabled for execution in modes less privileged than M, it behaves as follows:

ExceptionsZicboU_cg/cp_cbie

menvcfg_cbie_cbo-inval_op_list

0b01 — The instruction is executed and performs a flush operation, even if configured by a mode less privileged than M to perform an invalidate operation. 0b11 — The instruction is executed and performs an invalidate operation, unless configured by a mode less privileged than M to perform a flush operation.

ExceptionsZicboU_cg/cp_cbie

cbo-inval

A CBO.INVAL instruction executes or raises either an illegal-instruction exception or a virtual-instruction exception based on the state of the envcfg.⁠CBIE fields:

ExceptionsZicboU_cg/cp_cbie

cbo-clean_cbo-flush

A CBO.CLEAN or CBO.FLUSH instruction executes or raises an illegal-instruction or virtual-instruction exception based on the state of the envcfg.⁠CBCFE bits:

ExceptionsZicboU_cg/cp_cbcfe

cbo-zero_basedon_xenvcfg_cbze

Finally, a CBO.ZERO instruction executes or raises an illegal-instruction or virtual-instruction exception based on the state of the envcfg.⁠CBZE bits:

ExceptionsZicboU_cg/cp_cbze

fault_excep_csr

When a page-fault, guest-page-fault, or access-fault exception is taken, the relevant *tval CSR is written with the faulting effective address (i.e. the value of rs1).

ExceptionsZicboU_cg/cp_cbo_access_fault

no_addr_misaligned_excep

CMO instructions do not generate address-misaligned exceptions.

ExceptionsZicboU_cg/cp_cbo_address_misaligned

cbm_access

A cache-block management instruction is permitted to access the specified cache block whenever a load instruction or store instruction is permitted to access the corresponding physical addresses.

Zicbom_cbo_clean_cg/cp_custom_cbo

cbm_unperm_fault

If access to the cache block is not permitted, a cache-block management instruction raises a store page-fault or store guest-page-fault exception if address translation does not permit any access or raises a store access-fault exception otherwise.

ExceptionsZicboU_cg/cp_cbo_access_fault

cbz_access

A cache-block zero instruction is permitted to access the specified cache block whenever a store instruction is permitted to access the corresponding physical addresses and when the PMAs indicate that cache-block zero instructions are a supported access type.

Zicboz_cbo_zero_cg/cp_custom_cbo

cbz_unperm_fault

If access to the cache block is not permitted, a cache-block zero instruction raises a store page-fault or store guest-page-fault exception if address translation does not permit write access or raises a store access-fault exception otherwise.

ExceptionsZicboU_cg/cp_cbo_access_fault

cbp_unperm_noexcep

If access to the cache block is not permitted, a cache-block prefetch instruction does not raise any exceptions and shall not access any caches or memory.

ExceptionsZicboU_cg/cp_cbo_access_fault

cbo-zero_unaligned

It is not required that rs1 is aligned to the size of a cache block.

ExceptionsZicboU_cg/{cp_cbo_access_fault, cp_cbo_address_misaligned}

cbo-flush_unaligned

It is not required that rs1 is aligned to the size of a cache block.

ExceptionsZicboU_cg/{cp_cbo_access_fault, cp_cbo_address_misaligned}

cbo-inval_unaligned

It is not required that rs1 is aligned to the size of a cache block.

ExceptionsZicboU_cg/{cp_cbo_access_fault, cp_cbo_address_misaligned}

UDB Parameters: None.

B.2.10. ExceptionsZicboSm Machine-Mode CBO Exceptions

Tests done in machine mode. Only touch menvcfg if U is supported

Table 191. ExceptionsZicboSm Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule

cp_cbie

cbo.inval

If ZICBOM_SUPORTED & U_SUPPORTED & SM1P12P0_OR_LATER_SUPPORTED:
Execute cbo.inval with menvcfg.cbie = {00/01/11}

No trap

3 vals

menvcfg_cbie_warl_op

cp_cbcfe

cbo.flushclean

If ZICBOM_SUPORTED & U_SUPPORTED & SM1P12P0_OR_LATER_SUPPORTED:
Execute cbo.{clean, flush} with menvcfg.cbcfe = {0/1}

No trap

2 instr * 2 vals

menvcfg_cbcfe_op

cp_cbze

cbo.zero

If ZICBOZ_SUPORTED & U_SUPPORTED & SM1P12P0_OR_LATER_SUPPORTED:
Execute cbo.zero with menvcfg.cbze = {0/1}

No trap

2 vals

menvcfg_cbze_op

cp_cbo_access_fault

Access fault

For each supported cbo op {inval, clean, flush, zero, prefetch.{i/w/r}}
Execute op to RVMODEL_ACCESS_FAULT_ADDRESS with menvcfg enabled

CBO: Store access fault
Prefetch: no access fault

7 instr

fault_excep_csr
cbm_unperm_fault
cbz_unperm_fault
cbp_unperm_noexcep
cbo-zero_unaligned
cbo-flush_unaligned
cbo-inval_unaligned

cp_cbo_address_misaligned

No misaligned fault

For each supported cbo op {inval, clean, flush, zero, prefetch.{i/w/r}}
Execute op to valid address + 1 with menvcfg enabled

No misaligned faults

7 instr

no_addr_misaligned_excep
cbo-zero_unaligned
cbo-flush_unaligned
cbo-inval_unaligned

Table 192. ExceptionsZicboSm Normative Rules
Normative Rule Rule Text Coverpoints

menvcfg_cbze_op

The Zicboz extension adds the CBZE (Cache Block Zero instruction enable) field to menvcfg. When the CBZE field is set to 1, it enables execution of the cache block zero instruction, CBO.ZERO, in modes less privileged than M. Otherwise, the instruction raises an illegal-instruction exception in modes less privileged than M.

ExceptionsZicboSm_cg/cp_cbze

menvcfg_cbcfe_op

The Zicbom extension adds the CBCFE (Cache Block Clean and Flush instruction Enable) field to menvcfg. When the CBCFE field is set to 1, it enables execution of the cache block clean instruction (CBO.CLEAN) and the cache block flush instruction (CBO.FLUSH) in modes less privileged than M. Otherwise, these instructions raise an illegal-instruction exception in modes less privileged than M.

ExceptionsZicboSm_cg/cp_cbcfe

menvcfg_cbie_warl_op

The Zicbom extension adds the CBIE (Cache Block Invalidate instruction Enable) WARL field to menvcfg to control execution of the cache block invalidate instruction (CBO.INVAL) in modes less privileged than M. When CBIE is set to 0b00, the instruction raises an illegal-instruction exception in modes less privileged than M.

ExceptionsZicboSm_cg/cp_cbie

cbxe_unaffected

The CBIE/CBCFE/CBZE fields in each envcfg register do not affect the read and write behavior of the same fields in the other envcfg registers.

fault_excep_csr

When a page-fault, guest-page-fault, or access-fault exception is taken, the relevant *tval CSR is written with the faulting effective address (i.e. the value of rs1).

ExceptionsZicboSm_cg/cp_cbo_access_fault

no_addr_misaligned_excep

CMO instructions do not generate address-misaligned exceptions.

ExceptionsZicboSm_cg/cp_cbo_address_misaligned

cbm_access

A cache-block management instruction is permitted to access the specified cache block whenever a load instruction or store instruction is permitted to access the corresponding physical addresses.

Zicbom_cbo_clean_cg/cp_custom_cbo

cbm_unperm_fault

If access to the cache block is not permitted, a cache-block management instruction raises a store page-fault or store guest-page-fault exception if address translation does not permit any access or raises a store access-fault exception otherwise.

ExceptionsZicboSm_cg/cp_cbo_access_fault

cbz_access

A cache-block zero instruction is permitted to access the specified cache block whenever a store instruction is permitted to access the corresponding physical addresses and when the PMAs indicate that cache-block zero instructions are a supported access type.

Zicboz_cbo_zero_cg/cp_custom_cbo

cbz_unperm_fault

If access to the cache block is not permitted, a cache-block zero instruction raises a store page-fault or store guest-page-fault exception if address translation does not permit write access or raises a store access-fault exception otherwise.

ExceptionsZicboSm_cg/cp_cbo_access_fault

cbp_unperm_noexcep

If access to the cache block is not permitted, a cache-block prefetch instruction does not raise any exceptions and shall not access any caches or memory.

ExceptionsZicboSm_cg/cp_cbo_access_fault

cbo-zero_unaligned

It is not required that rs1 is aligned to the size of a cache block.

ExceptionsZicboSm_cg/{cp_cbo_access_fault, cp_cbo_address_misaligned}

cbo-flush_unaligned

It is not required that rs1 is aligned to the size of a cache block.

ExceptionsZicboSm_cg/{cp_cbo_access_fault, cp_cbo_address_misaligned}

cbo-inval_unaligned

It is not required that rs1 is aligned to the size of a cache block.

ExceptionsZicboSm_cg/{cp_cbo_access_fault, cp_cbo_address_misaligned}

UDB Parameters: None.

B.2.11. ExceptionsSv Virtual Memory Exceptions

The following coverpoints should be exercised in supervisor mode

Table 193. ExceptionsSv Coverpoints
Coverpoint Goal Feature Description Bins Normative Rule

cp_instr_page_fault_s

Instruction Page Fault

jump to address that causes instruction page fault

ia_fault_exc_on_target

cp_load_page_fault_s

Load Page Fault

load from address that causes load page fault

cp_store_page_fault_s

Store Page Fault

store to address that causes store page fault

cp_misaligned_priority_s

Priority of exceptions

Attempt lw and sw and fetch from memory location causing {access fault and page fault}, {page fault and misaligned}, {access fault, page fault, misaligned}

mcause_exccode_priority_misaligned
exc_priority

cp_misaligned_load_page_fault_s

Page fault on each part of a misaligned access

Check behavior of a misaligned load spanning a page boundary, in which one of the two pages faults.
Set up two consecutive virtual kilopages, with both combinations of one page RWX=111 and the other RWX=000.
Issue misaligned lw crossing page boundary.
If misaligned accesses are supported, expect a misaligned load fault.
If misaligned access is supported, expect a load page fault.
stval could be 0, or should be the address of the load if the fault occurs in the first page,
or the address of the start of the second virtual page if the fault occurs in the second page.

2 bins

cp_misaligned_store_page_fault_s

Page fault on each part of a misaligned access

Same as cp_misaligned_load_page_fault_u but with sw and store faults.

2 bins

cp_misaligned_instr_page_fault_s

Page fault on each part of a misaligned instruction

Same setup as cp_misaligned_load_page_fault_s
Issue jalr to 4-byte instruction on odd multiple of 2 address spanning the two virtual pages.
If Zca is not supported, expect a misaligned instruction fault.
If Zca is supported, expect a instruction fetch page fault.
See cp_misaligned_load_page_fault_s about possible MTVAL outcomes.

2 bins

The following coverpoints should be exercised in user mode

cp_instr_page_fault_u

Instruction Page Fault

jump to address that causes instruction page fault

cp_load_page_fault_u

Load Page Fault

load from address that causes load page fault

cp_store_page_fault_u

Store Page Fault

store to address that causes store page fault

cp_misaligned_priority_u

Priority of exceptions

Attempt lw and sw and fetch from memory location causing {access fault and page fault}, {page fault and misaligned}, {access fault, page fault, misaligned}

mcause_exccode_priority_misaligned
exc_priority

Table 194. ExceptionsSv Normative Rules
Normative Rule Rule Text Coverpoints

mcause_exccode_priority_misaligned

Load/store/AMO address-misaligned exceptions may have either higher or lower priority than load/store/AMO page-fault and access-fault exceptions.

ExceptionsSv_cg/{cp_misaligned_priority_s, cp_misaligned_priority_u}

exc_priority

Priority|Exc.Code|Description === Highest|3|Instruction address breakpoint¶|12, 1|During instruction address translation: First encountered page fault or access fault¶|1|With physical address for instruction: Instruction access fault¶|2 0 8,9,11 3 3|Illegal instruction Instruction address misaligned Environment call Environment break Load/store/AMO address breakpoint¶|4,6|Optionally: Load/store/AMO address misaligned¶|13, 15, 5, 7|During address translation for an explicit memory access: First encountered page fault or access fault¶|5,7|With physical address for an explicit memory access: Load/store/AMO access fault¶Lowest|4,6|If not higher priority: Load/store/AMO address misaligned ===

ExceptionsSv_cg/{cp_misaligned_priority_s, cp_misaligned_priority_u, cp_misaligned_priority_fetch_s, cp_misaligned_priority_fetch_u}

UDB Parameters: None.

B.2.12. ExceptionsSvSm Virtual Memory Exceptions with M-mode State

Table 195. ExceptionsSvSm Coverpoints
Coverpoint Goal Feature Description Expectation Normative Rule

The following coverpoints should be exercised in machine mode.

cp_instr_page_fault_m

Instruction Page Fault

jump to address that would cause instruction page fault in non-M-mode because mstatus.MPRV=1 and mstatus.MPP={01, 00}, but no fault occurs because MPRV should not affect instruction fetch in M-mode.

cp_load_page_fault_m

Load Page Fault

load from address that causes load page fault because mstatus.MPRV=1 and mstatus.MPP={01, 00}

cp_store_page_fault_m

Store Page Fault

store to address that causes store page fault because mstatus.MPRV=1 and mstatus.MPP={01, 00}

cp_misaligned_priority_m

Priority of exceptions

Attempt lw and sw and fetch from memory location causing {access fault and page fault}, {page fault and misaligned}, {access fault, page fault, misaligned}

M-mode needs MPRV to S or U mode to be able to cause access fault. No fetch fault occurs because MPRV does not affect fetch privilege.

mcause_exccode_priority_misaligned
exc_priority

cp_medeleg_m

Machine mode exception not affected by medeleg

Attempt instruction/load/store page faults crossed crossed with medeleg = [ {1011_0011_1111_1111}, {0}, and 13 different walking 1s]

medeleg should not affect machine mode exceptions. No instruction page fault occurs because MPRV does not affect fetch privilege.

The following coverpoints should be exercised in supervisor mode

cp_medeleg_s

Delegation to supervisor mode

Attempt instruction/load/store page faults crossed crossed with medeleg = [ {1011_0011_1111_1111}, {0}, and 13 different walking 1s]

Should delegate when a 1 is in the appropriate column.

The following coverpoints should be exercised in user mode

cp_medeleg_u

Delegation to supervisor mode

Attempt instruction/load/store page faults crossed crossed with medeleg = [ {1011_0011_1111_1111}, {0}, and 13 different walking 1s]

Should delegate when a 1 is in the appropriate column.

Table 196. ExceptionsSvSm Normative Rules
Normative Rule Rule Text Coverpoints

mcause_exccode_priority_misaligned

Load/store/AMO address-misaligned exceptions may have either higher or lower priority than load/store/AMO page-fault and access-fault exceptions.

ExceptionsSvSm_cg/cp_misaligned_priority_m

exc_priority

Priority|Exc.Code|Description === Highest|3|Instruction address breakpoint¶|12, 1|During instruction address translation: First encountered page fault or access fault¶|1|With physical address for instruction: Instruction access fault¶|2 0 8,9,11 3 3|Illegal instruction Instruction address misaligned Environment call Environment break Load/store/AMO address breakpoint¶|4,6|Optionally: Load/store/AMO address misaligned¶|13, 15, 5, 7|During address translation for an explicit memory access: First encountered page fault or access fault¶|5,7|With physical address for an explicit memory access: Load/store/AMO access fault¶Lowest|4,6|If not higher priority: Load/store/AMO address misaligned ===

ExceptionsSvSm_cg/cp_misaligned_priority_m

UDB Parameters: None.

B.2.13. ExceptionsSvZalrsc Virtual Memory LR/SC Exceptions

This testplan is for systems supporting supervisor mode and virtual memory. Also requires Zalrsc The following coverpoints should be exercised in supervisor mode

Table 197. ExceptionsSvZalrsc Coverpoints
Coverpoint Goal Feature Description Normative Rule

cp_misaligned_priority_s

Priority of exceptions

Attempt lr.w and sc.w from memory location causing {access fault and page fault}, {page fault and misaligned}, {access fault, page fault, misaligned}

sc_retire_permission
lr_sc_alignment
exc_priority
mcause_exccode_priority_misaligned

The following coverpoints should be exercised in user mode

cp_misaligned_priority_u

Priority of exceptions

Attempt lr.w and sc.w from memory location causing {access fault and page fault}, {page fault and misaligned}, {access fault, page fault, misaligned}

sc_retire_permission
lr_sc_alignment
exc_priority
mcause_exccode_priority_misaligned

Table 198. ExceptionsSvZalrsc Normative Rules
Normative Rule Rule Text Coverpoints

sc_retire_permission

No SC.W instruction shall retire unless it passes memory permission checks,

ExceptionsSvZalrsc_cg/{cp_misaligned_priority_s, cp_misaligned_priority_u}

lr_sc_alignment

For LR and SC, the Zalrsc extension requires that the address held in rs1 be naturally aligned to the size of the operand (i.e., eight-byte aligned for doublewords and four-byte aligned for words). If the address is not naturally aligned, an address-misaligned exception or an access-fault exception will be generated. The access-fault exception can be generated for a memory access that would otherwise be able to complete except for the misalignment, if the misaligned access should not be emulated.

ExceptionsSvZalrsc_cg/{cp_misaligned_priority_s, cp_misaligned_priority_u}

exc_priority

Priority|Exc.Code|Description === Highest|3|Instruction address breakpoint¶|12, 1|During instruction address translation: First encountered page fault or access fault¶|1|With physical address for instruction: Instruction access fault¶|2 0 8,9,11 3 3|Illegal instruction Instruction address misaligned Environment call Environment break Load/store/AMO address breakpoint¶|4,6|Optionally: Load/store/AMO address misaligned¶|13, 15, 5, 7|During address translation for an explicit memory access: First encountered page fault or access fault¶|5,7|With physical address for an explicit memory access: Load/store/AMO access fault¶Lowest|4,6|If not higher priority: Load/store/AMO address misaligned ===

ExceptionsSvZalrsc_cg/{cp_misaligned_priority_s, cp_misaligned_priority_u}

mcause_exccode_priority_misaligned

Load/store/AMO address-misaligned exceptions may have either higher or lower priority than load/store/AMO page-fault and access-fault exceptions.

ExceptionsSvZalrsc_cg/{cp_misaligned_priority_s, cp_misaligned_priority_u}

UDB Parameters: None.

B.2.14. ExceptionsSvZalrscSm Virtual Memory LR/SC Exceptions with M-mode State

This testplan is for systems supporting supervisor mode and virtual memory. Also requires Zalrsc

Table 199. ExceptionsSvZalrscSm Coverpoints
Coverpoint Goal Feature Description Notes

The following coverpoints should be exercised in machine mode.

cp_misaligned_priority_m

Priority of exceptions

Attempt lr.w and sc.w from memory location causing {access fault and page fault}, {page fault and misaligned}, {access fault, page fault, misaligned}

M-mode needs MPRV to S or U mode to be able to cause access fault.

cp_medeleg_m

Machine mode exception not affected by medeleg

Attempt lr.w and sc.w causing page faults crossed crossed with medeleg = [ {1011_0011_1111_1111}, {0}, and 13 different walking 1s]

medeleg should not affect machine mode exceptions

The following coverpoints should be exercised in supervisor mode

cp_medeleg_s

Delegation to supervisor mode

Attempt lr.w and sc.w causing page faults crossed crossed with medeleg = [ {1011_0011_1111_1111}, {0}, and 13 different walking 1s]

Should delegate when a 1 is in the appropriate column.

The following coverpoints should be exercised in user mode

cp_medeleg_u

Delegation to supervisor mode

Attempt lr.w and sc.w causing page faults crossed crossed with medeleg = [ {1011_0011_1111_1111}, {0}, and 13 different walking 1s]

Should delegate when a 1 is in the appropriate column.

B.2.15. ExceptionsSvZaamo Virtual Memory AMO Exceptions

This testplan is for systems supporting supervisor mode and virtual memory. Also requires Zaamo The following coverpoints should be exercised in supervisor mode

Table 200. ExceptionsSvZaamo Coverpoints
Coverpoint Goal Feature Description Normative Rule

cp_misaligned_priority_s

Priority of exceptions

Attempt amoadd.w from memory location causing {access fault and page fault}, {page fault and misaligned}, {access fault, page fault, misaligned}

amo_alignment
misaligned_atomicity_granule_size
exc_priority
mcause_exccode_priority_misaligned

The following coverpoints should be exercised in user mode

cp_misaligned_priority_u

Priority of exceptions

Attempt amoadd.w from memory location causing {access fault and page fault}, {page fault and misaligned}, {access fault, page fault, misaligned}

amo_alignment
misaligned_atomicity_granule_size
exc_priority
mcause_exccode_priority_misaligned

Table 201. ExceptionsSvZaamo Normative Rules
Normative Rule Rule Text Coverpoints

amo_alignment

For AMOs, the Zaamo extension requires that the address held in rs1 be naturally aligned to the size of the operand (i.e., eight-byte aligned for doublewords and four-byte aligned for words).

ExceptionsSvZaamo_cg/{cp_misaligned_priority_s, cp_misaligned_priority_u}

misaligned_atomicity_granule_size

The misaligned atomicity granule PMA, defined in sec:misaligned-atomicity-granule, optionally relaxes this alignment requirement. If present, the misaligned atomicity granule PMA specifies the size of a misaligned atomicity granule, a power-of-two number of bytes. The misaligned atomicity granule PMA applies only to AMOs defined in the Zaamo, Zabha, and Zacas extensions; loads and stores defined in the base ISAs; loads and stores of no more than XLEN bits defined in the F, D, and Q extensions; the load-acquire and store-release instructions defined in the Zalasr extension; and compressed encodings of the foregoing loads and stores. For an instruction in that set, if all accessed bytes lie within the same misaligned atomicity granule, the instruction will not raise an exception for reasons of address alignment, and the instruction will give rise to only one memory operation for the purposes of RVWMO—​i.e., it will execute atomically.

ExceptionsSvZaamo_cg/{cp_misaligned_priority_s, cp_misaligned_priority_u}

exc_priority

Priority|Exc.Code|Description === Highest|3|Instruction address breakpoint¶|12, 1|During instruction address translation: First encountered page fault or access fault¶|1|With physical address for instruction: Instruction access fault¶|2 0 8,9,11 3 3|Illegal instruction Instruction address misaligned Environment call Environment break Load/store/AMO address breakpoint¶|4,6|Optionally: Load/store/AMO address misaligned¶|13, 15, 5, 7|During address translation for an explicit memory access: First encountered page fault or access fault¶|5,7|With physical address for an explicit memory access: Load/store/AMO access fault¶Lowest|4,6|If not higher priority: Load/store/AMO address misaligned ===

ExceptionsSvZaamo_cg/{cp_misaligned_priority_s, cp_misaligned_priority_u}

mcause_exccode_priority_misaligned

Load/store/AMO address-misaligned exceptions may have either higher or lower priority than load/store/AMO page-fault and access-fault exceptions.

ExceptionsSvZaamo_cg/{cp_misaligned_priority_s, cp_misaligned_priority_u}

UDB Parameters: None.

B.2.16. ExceptionsSvZaamoSm Virtual Memory AMO Exceptions with M-mode State

This testplan is for systems supporting supervisor mode and virtual memory. Also requires Zaamo

Table 202. ExceptionsSvZaamoSm Coverpoints
Coverpoint Goal Feature Description Notes

The following coverpoints should be exercised in machine mode.

cp_misaligned_priority_m

Priority of exceptions

Attempt amoadd.w from memory location causing {access fault and page fault}, {page fault and misaligned}, {access fault, page fault, misaligned}

M-mode needs MPRV to S or U mode to be able to cause access fault.

cp_medeleg_m

Machine mode exception not affected by medeleg

Attempt amoadd.w causing page faults crossed crossed with medeleg = [ {1011_0011_1111_1111}, {0}, and 13 different walking 1s]

medeleg should not affect machine mode exceptions

The following coverpoints should be exercised in supervisor mode

cp_medeleg_s

Delegation to supervisor mode

Attempt amoadd.w causing page faults crossed crossed with medeleg = [ {1011_0011_1111_1111}, {0}, and 13 different walking 1s]

Should delegate when a 1 is in the appropriate column.

The following coverpoints should be exercised in user mode

cp_medeleg_u

Delegation to supervisor mode

Attempt amoadd.w causing page faults crossed crossed with medeleg = [ {1011_0011_1111_1111}, {0}, and 13 different walking 1s]

Should delegate when a 1 is in the appropriate column.

B.3. Interrupts

Interrupt tests are organized according to the privilege mode or extension supported. InterruptsSm boots to M-mode and exercises interrupts in every supported privilege mode; InterruptsS boots to S-mode and exercises only the interrupts visible to supervisor software. The Sstc tests check access to the stimecmp register; the timer interrupts that stimecmp generates are covered by the cp_trigger_sti_sstc and cp_write_stip_sstc coverpoints of the Interrupts tests.

B.3.1. InterruptsSm Machine-Mode Interrupts

These tests are run on any configuration with machine mode that supports interrupts.

Tests if Sm exists (not run for RVA23 certification) Boot to MMODE, run tests in each supported priv mode of <M,S,U,VS,VU> Reference model needs to know if each of the 10 types of interrupts are supported menvcfg.STCE = 0 unless otherwise stated mideleg = 0s unless otherwise stated. mtvec.MODE uses boot value RVTEST_SET_MTI_INT writes mtimecmp = 0 (with tsbi if necessary) Define ways to cause all of the interrupts that are standard as much as possible, only need RV macros for special stuff

Table 203. InterruptsSm Test Setup
Step Sm S U VS VU

setup_interrupts_sm

write mstatus.MIE = {0/1}, SIE = {0/1}
write mideleg = {0s/1s}
write mie = 1s
write mtvec.MODE = {00, 01} if each supported

Same as Sm

Same as Sm

*

*

trigger_interrupts <type>

RVTEST_SET_<type>_INT_<priv>
RVTEST_IDLE_FOR_INTERRUPT to wait for interrupt
RVTEST_CLR_<type>_INT_<priv>

Same as Sm but with priv = S

Same as S but with priv = U

Coverpoint

mideleg<typ> = {0, 1 if UDB_<TYPE>_DELEGATION_SUPPORTED}
mie<type> = 1 if UDB_<TYPE>_SUPPORTED}
mstatus.MIE = {0/1}, SIE = 1 if S_SUPPORTED

Same as Sm

Same as S

Expectation

<type> pending if UDB_<TYPE>_SUPPORTED and mideleg = 0, trap if MIE=1

<type> pending if UDB_<TYPE>_SUPPORTED, trap if SIE = 1

pending and trap if UDB_<TYPE>_SUPPORTED

Table 204. InterruptsSm Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule

cp_trigger

Assert each interrupt

For <type> = {LCOFI, MTI, MSI, MEI, STI, SSI, SEI, VSTI, VSEI, VSSI}
setup_interrupts_sm
trigger_interrupts_<type>

supported interrupts will fire if
- not delegted to a lower priv mode than the current mode
- enabled by MIE if running in M mode and not delegated

10 int * 5 priv * 2 MIE * 2 SIE * 2 vecMODE * 2 mideleg

trap_never_trans_lower
trap_del_intr_priv_lvl
mepc_op
mcause_op
mcause_intr_op
mcause_exccode_op
mcause_exccode_enc_img
trap_def_m_mode
mtvec_mode_enc
mtvec_mode_direct_op
mtvec_mode_vectored_op
mstatus_mie_sie_exist
mstatus_mie_sie_op
mstatus_xie_intr_en_dis
mstatus_xpie_xpp_op
mstatus_xpie_xie_xpp_trap_op
mip_mie_enc_txt
mip_enc_img
mip_mie_std_enc_txt
mip_std_enc_img
mideleg_enc_img
mideleg_enc_txt
mip_bits_rdonly_op
mip_meip_mie_meie_op
mip_meip_rdonly
mip_mtip_mie_mtie_op
mip_mtip_rdonly
mip_msip_mie_msie_op
mip_msip_rdonly
msip_sz_acc
msip_update_max_time
mtime_intr_pending
mtime_intr_taken
mtime_intr_mtip_visibility
mip_seip_mie_seie_op
intr_sei_op
mip_stip_mie_stie_op
mip_stip_no_stimecmp_acc
mip_stip_no_stimecmp_mmode_write
mip_ssip_mie_ssie_op
mip_ssip_intr_ctrl
intr_mip_mie_op
intr_mip_mie_bounded_time
mtval_other_traps_zero
mstatus_mie_op
mstatus_sie_op
mstatus_xpie_op
mstatus_xpp_op
mstatus_xpie_trap_op
mstatus_xie_trap_op

cp_trigger_reg

Same as cp_trigger, but use mip.SEIP, mip.SSIP, and sip.SSIP rather than macros.

same as above

3 int * 5 priv * 2 MIE * 2 SIE * 2 vecMODE * 2 mideleg

mip_seip_rdcsr
mip_seip_wrcsr

cp_trigger_sti_sstc

STI with SSTC

if SSTC_SUPPORTED:
setup_interrupts_sm
write menvcfg.STCE = {0/1}
trigger_interrupts_SSTC

STI should trigger if
STCE = 1
- when mideleg = 0, MIE = 1, running in M mode,
anytime running in non M mode,

5 priv * 2 STCE * 2 MIE * 2 SIE * 2 vecMODE * 2 mideleg

mip_stip_mie_stie_op
mip_stip_reflects_stimecmp
mip_stip_stimecmp_clr
menvcfg_stce_enable_op
menvcfg_stce_zero_op
menvcfg_stce_exists
menvcfg_stce_rdonly0
menvcfg_stce_zero_vstip
mip_sip_stip_op
sip_stip_sie_stie

cp_enable

Enables control interrupts

mideleg = 0 (if S_SUPPORTED)
write mstatus.MIE = 1
For <type> in <types above>:
mie = {1 in type, 1s everywhere except type}
RVTEST_SET_<type>_INT
RVTEST_IDLE_FOR_INT
RVTEST_CLR_<type>_INT

Interrupt if mie and mip match

10 int * 5 priv * 2 mie

mip_mie_enc_txt
mie_enc_img
mip_mie_std_enc_txt
mie_std_enc_img
mip_meip_mie_meie_op
mip_mtip_mie_mtie_op
mip_msip_mie_msie_op
mip_seip_mie_seie_op
mip_stip_mie_stie_op
mip_ssip_mie_ssie_op
intr_mip_mie_op
intr_mip_mie_xret_csrwr
mtime_intr_taken

cp_priority_mip

Priority of pending interrupts

mideleg = 0 (if S_SUPPORTED)
write mstatus.MIE = 1
write mie = 0s
RVTEST_SET_<type>_INT (10 choose 2) pairs of mip.<TYPE1, TYPE2>
write mie = 1s
RVTEST_IDLE_FOR_INT
RVTEST_CLR_<type>_INT for both

if supported - higher priority interrupt will fire

45 int * 5 priv

mip_enc_img
mip_std_enc_img
intr_m_mode_pri

cp_priority_mie

Priority of enabled interrupts

mideleg = 0 (if S_SUPPORTED)
write mstatus.MIE = 1
write mie = 0s
RVTEST_SET_<type>_INT for all 10 types
write mie with two ones for all (10 choose 2) pairs
RVTEST_IDLE_FOR_INT
RVTEST_CLR_<type>_INT for all

if supported - higher priority enabled interrupt will fire

45 int * 5 priv

mie_enc_img
mie_std_enc_img
intr_m_mode_pri

cp_priority_mideleg

Priority of delegated interrupts

if S_SUPPORTED:
write mstatus.MIE = 1
write mie = 0s
RVTEST_SET_<type>_INT (10 choose 2) pairs of mip.<TYPE1, TYPE2>
mideleg = 0s except {1 in TYPE1, 1 in TYPE2} (one at a time)
write mie = 1s
RVTEST_IDLE_FOR_INT
RVTEST_CLR_<type>_INT for both

if supported - undelegated interrupt takes priority

21 int * 2 mideleg * 5 priv

medeleg_mideleg_per_bit_rw
medeleg_mideleg_delegate_op
mideleg_enc_img
mideleg_enc_txt
intr_m_mode_highest_pri
trap_del_intr_priv_lvl
intr_mip_mie_op

cp_wfi

WFI waits until timer interrupt

Only test if machine timer interrupts are supported
Do not test in U mode if S_SUPPORTED
mideleg = 0 (if S_SUPPORTED)
write mstatus.TW = 0 (also 1 in M-mode)
write mstatus.MIE = {0/1}
write mie.MTIE = 1
RVTEST_SET_MTI_SOON to set MTIMECMP = TIME + RVMODEL_TIMER_INT_SOON_DELAY
do {
WFI instruction
} until MTI has fired (see Zawrs)
RVTEST_CLR_MTI_INT

Wait for timer interrupt. MIE, SIE and TW should not affect results.

4priv * 2 MIE + M mode * 2 MIE * 2 TW

mstatus_tw_op
wfi_op
wfi_all_privileged_modes
wfi_opt_u_mode
wfi_mepc_val
wfi_resume_reason
wfi_unaffected_conditions
wfi_resume_any_priv

cp_wfi_timeout

WFI waits until timeout

Only applies to modes < M
write mstatus.TW = 1 (also 0 in U-mode if S_SUPPORTED)
write mstatus.MIE = {0/1}
write mie.MTIE = {0/1}
WFI instruction

Note: may need sufficient Sail parameter to determine if we get illegal instruction or if WFI just retires. Or may need to accept both behaviors.

4 priv * 2 MIE * 2 MTIE

mstatus_tw_warl
mstatus_tw_op
mstatus_tw_umode_op
wfi_ill_exc
MSTATUS_TW_TIME_LIMIT
MSTATUS_TW_ALWAYS_ILLEGAL

cp_write_stip_sstc

test STIP writability when SSTC supported

if SSTC_SUPPORTED:
In M mode
mideleg = 0
mie = 0s
Write menvcfg.STCE = 1
Write stimecmp = 0s/1s x mip.STIP = {0/1}
Read back STIP & sigupd
Clear STIP through stimecmp

mip.STIP is controlled by stimecmp, ignores writes.

2 stimecmp x 2 STIP

menvcfg_stce_exists
menvcfg_stce_rdonly0
menvcfg_stce_enable_op
menvcfg_stce_zero_op
menvcfg_stce_zero_vstip
mip_sip_stip_op
sip_stip_sie_stie

Table 205. InterruptsSm Normative Rules
Normative Rule Rule Text Coverpoints

mepc_op

When a trap is taken into M-mode, mepc is written with the virtual address of the instruction that was interrupted or that encountered the exception. Otherwise, mepc is never written by the implementation, though it may be explicitly written by software.

InterruptsSm_cg/{cp_trigger, cp_trigger_tsbi}

mcause_op

When a trap is taken into M-mode, mcause is written with a code indicating the event that caused the trap. Otherwise, mcause is never written by the implementation, though it may be explicitly written by software.

InterruptsSm_cg/{cp_trigger, cp_trigger_tsbi}

mcause_intr_op

The Interrupt bit in the mcause register is set if the trap was caused by an interrupt.

InterruptsSm_cg/{cp_trigger, cp_trigger_tsbi}

mcause_exccode_op

The Exception Code field contains a code identifying the last exception or interrupt.

InterruptsSm_cg/{cp_trigger, cp_trigger_tsbi}

mcause_exccode_enc_img

Interrupt|Exception Code|Description === 1 1 1 1|0 1 2 3|Reserved Supervisor software interrupt Reserved Machine software interrupt¶1 1 1 1|4 5 6 7|Reserved Supervisor timer interrupt Reserved Machine timer interrupt¶1 1 1 1|8 9 10 11|Reserved Supervisor external interrupt Reserved Machine external interrupt¶1 1 1 1|12 13 14-15 ≥16|Reserved Counter-overflow interrupt Reserved Designated for platform use¶0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0|0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20-23 24-31 32-47 48-63 ≥64|Instruction address misaligned Instruction access fault Illegal instruction Breakpoint Load address misaligned Load access fault Store/AMO address misaligned Store/AMO access fault Environment call from U-mode Environment call from S-mode Reserved Environment call from M-mode Instruction page fault Load page fault Reserved Store/AMO page fault Double trap Reserved Software check Hardware error Reserved Designated for custom use Reserved Designated for custom use Reserved ===

InterruptsSm_cg/{cp_trigger, cp_trigger_tsbi}

trap_def_m_mode

By default, all traps at any privilege level are handled in machine mode

InterruptsSm_cg/{cp_trigger, cp_trigger_tsbi}

mtvec_mode_enc

Value|Name|Description === 0|Direct|All traps set pc to BASE.¶1|Vectored|Asynchronous interrupts set pc to BASE+4×cause.¶≥2| — |Reserved ===

InterruptsSm_cg/cp_trigger

mtvec_mode_direct_op

When MODE=Direct, all traps into machine mode cause the pc to be set to the address in the BASE field.

InterruptsSm_cg/{cp_trigger, cp_trigger_tsbi}

mtvec_mode_vectored_op

When MODE=Vectored, all synchronous exceptions into machine mode cause the pc to be set to the address in the BASE field, whereas interrupts cause the pc to be set to the address in the BASE field plus four times the interrupt cause number.

InterruptsSm_cg/{cp_trigger, cp_trigger_tsbi}

mstatus_mie_sie_exist

Global interrupt-enable bits, MIE and SIE, are provided for M-mode and S-mode respectively.

InterruptsSm_cg/cp_trigger

mstatus_mie_sie_op

When a hart is executing in privilege mode x, interrupts are globally enabled when xIE=1 and globally disabled when xIE=0.

InterruptsSm_cg/{cp_trigger, cp_wfi_m}

mstatus_xie_intr_en_dis

Interrupts for lower-privilege modes, w<x, are always globally disabled regardless of the setting of any global wIE bit for the lower-privilege mode. Interrupts for higher-privilege modes, y>x, are always globally enabled regardless of the setting of the global yIE bit for the higher-privilege mode.

InterruptsSm_cg/{cp_trigger, cp_trigger_tsbi}

mstatus_xpie_xpp_op

each privilege mode x that can respond to interrupts has a two-level stack of interrupt-enable bits and privilege modes. xPIE holds the value of the interrupt-enable bit active prior to the trap, and xPP holds the previous privilege mode.

InterruptsSm_cg/{cp_trigger, cp_trigger_tsbi}

mstatus_xpie_xie_xpp_trap_op

When a trap is taken from privilege mode y into privilege mode x, xPIE is set to the value of xIE; xIE is set to 0; and xPP is set to y.

InterruptsSm_cg/{cp_trigger, cp_trigger_tsbi}

mstatus_tw_warl

The TW (Timeout Wait) bit is a WARL field that supports intercepting the WFI instruction (see wfi).

InterruptsSm_cg/{cp_wfi_m, cp_wfi_timeout}

mstatus_tw_op

When TW=0, the WFI instruction may execute in modes less privileged than M when not prevented for some other reason. When TW=1, then if WFI is executed in any less-privileged mode, and it does not complete within an implementation-specific, bounded time limit, the WFI instruction causes an illegal-instruction exception.

InterruptsSm_cg/{cp_wfi, cp_wfi_timeout}

mstatus_tw_umode_op

When S-mode is implemented, then executing WFI in U-mode causes an illegal-instruction exception, regardless of the value of the TW bit, unless the instruction completes within an implementation-specific, bounded time limit.

InterruptsSm_cg/{cp_wfi_timeout, cp_wfi_timeout_tw_zero}

mstatus_tw_always_illegal

An implementation may have WFI always raise an illegal-instruction exception in modes less privileged than M when TW=1, even if there are pending globally-disabled interrupts when the instruction is executed.

Not tested: permission; no test executes WFI below M-mode with TW=1 while an interrupt is pending, so both behaviors pass

mip_mie_enc_txt

Interrupt cause number i (as reported in CSR mcause, mcause) corresponds with bit i in both mip and mie. Bits 15:0 are allocated to standard interrupt causes only, while bits 16 and above are designated for platform use.

InterruptsSm_cg/{cp_trigger, cp_enable_one}

mip_enc_img

InterruptsSm_cg/{cp_trigger, cp_priority_mip}

mie_enc_img

InterruptsSm_cg/{cp_enable_one, cp_priority_mie}

mip_mie_std_enc_txt

The standard portions (bits 15:0) of the mip and mie registers are formatted as shown in norm:mip_std_enc_img and norm:mie_std_enc_img respectively.

InterruptsSm_cg/{cp_trigger, cp_enable_one}

mip_std_enc_img

InterruptsSm_cg/{cp_trigger, cp_priority_mip}

mie_std_enc_img

InterruptsSm_cg/{cp_enable_one, cp_priority_mie}

mideleg_enc_img

InterruptsSm_cg/cp_trigger, InterruptsSm_cg/cp_priority_mideleg

mideleg_enc_txt

mideleg holds trap delegation bits for individual interrupts, with the layout of bits matching those in the mip register

InterruptsSm_cg/cp_trigger, InterruptsSm_cg/cp_priority_mideleg

mip_bits_rdonly_op

If interrupt i can become pending but bit i in mip is read-only, the implementation must provide some other mechanism for clearing the pending interrupt.

InterruptsSm_cg/cp_trigger

mip_bits_wr_op

When bit i in mip is writable, a pending interrupt i can be cleared by writing 0 to this bit.

InterruptsSm_cg/{cp_trigger_reg_mip_ssip, cp_trigger_reg_mip_seip}

mip_meip_mie_meie_op

Bits mip.⁠MEIP and mie.⁠MEIE are the interrupt-pending and interrupt-enable bits for machine-level external interrupts.

InterruptsSm_cg/{cp_trigger, cp_enable_one, cp_enable_zero}

mip_meip_rdonly

MEIP is read-only in mip, and is set and cleared by a platform-specific interrupt controller.

Sm_mcsr_cg/cp_mcsrwalk/mip, InterruptsSm_cg/cp_trigger

mip_mtip_mie_mtie_op

Bits mip.⁠MTIP and mie.⁠MTIE are the interrupt-pending and interrupt-enable bits for machine timer interrupts.

InterruptsSm_cg/{cp_trigger, cp_enable_one, cp_enable_zero}

mip_mtip_rdonly

MTIP is read-only in the mip register, and is cleared by writing to the memory-mapped machine-mode timer compare register.

Sm_mcsr_cg/cp_mcsrwalk/mip, InterruptsSm_cg/cp_trigger

mip_msip_mie_msie_op

Bits mip.⁠MSIP and mie.⁠MSIE are the interrupt-pending and interrupt-enable bits for machine-level software interrupts.

InterruptsSm_cg/{cp_trigger, cp_enable_one, cp_enable_zero}

mip_msip_rdonly

MSIP is read-only in mip, and is written by accesses to memory-mapped control registers, which are used to provide machine-level interprocessor interrupts.

Sm_mcsr_cg/cp_mcsrwalk/mip, Sm_mcsr_cg/cp_msip, InterruptsSm_cg/cp_trigger

msip_sz_acc

A hart’s memory-mapped msip register is a 32-bit read/write register

Sm_mcsr_cg/cp_msip, InterruptsSm_cg/cp_trigger

msip_enc

bits 31&#8205;&#8211;&#8205;1 read as zero and bit 0 contains the MSIP bit.

Sm_mcsr_cg/cp_msip

msip_update_max_time

When the memory-mapped msip register changes, it is guaranteed to be reflected in mip.⁠MSIP eventually, but not necessarily immediately.

Sm_mcsr_cg/cp_msip, InterruptsSm_cg/cp_trigger

mtime_intr_pending

A machine timer interrupt becomes pending whenever mtime contains a value greater than or equal to mtimecmp, treating the values as unsigned integers. The interrupt remains posted until mtimecmp becomes greater than mtime

InterruptsSm_cg/{cp_trigger, cp_wfi_m}

mtime_intr_taken

The interrupt will only be taken if interrupts are enabled and the MTIE bit is set in the mie register.

InterruptsSm_cg/{cp_trigger, cp_enable_zero, cp_wfi_m}

mtime_intr_mtip_visibility

If the result of the comparison between mtime and mtimecmp changes, it is guaranteed to be reflected in MTIP eventually, but not necessarily immediately.

InterruptsSm_cg/{cp_trigger, cp_wfi_m}

mip_seip_mie_seie_op

If supervisor mode is implemented, bits mip.⁠SEIP and mie.⁠SEIE are the interrupt-pending and interrupt-enable bits for supervisor-level external interrupts.

InterruptsSm_cg/{cp_trigger, cp_trigger_reg_mip_seip, cp_enable_one}

mip_seip_acc

SEIP is writable in mip

InterruptsSm_cg/cp_trigger_reg_mip_seip

mip_seip_rdcsr

When mip is read with a CSR instruction, the value of the SEIP bit returned in the rd destination register is the logical-OR of the software-writable bit and the interrupt signal from the interrupt controller

InterruptsSm_cg/cp_trigger_reg

mip_seip_wrcsr

the signal from the interrupt controller is not used to calculate the value written to SEIP. Only the software-writable SEIP bit participates in the read-modify-write sequence of a CSRRS or CSRRC instruction.

InterruptsSm_cg/cp_trigger_reg

intr_sei_op

Supervisor-level external interrupts are made pending based on the logical-OR of the software-writable SEIP bit and the signal from the external interrupt controller.

InterruptsSm_cg/{cp_trigger, cp_trigger_reg_mip_seip}

mip_stip_mie_stie_op

If supervisor mode is implemented, its mip.⁠STIP and mie.⁠STIE are the interrupt-pending and interrupt-enable bits for supervisor-level timer interrupts.

InterruptsSm_cg/{cp_trigger, cp_trigger_sti_sstc, cp_enable_one}

mip_stip_no_stimecmp_acc, mip_stip_no_stimecmp_mmode_write

mip_stip_no_stimecmp_acc: If the stimecmp register is not implemented, STIP is writable in mip mip_stip_no_stimecmp_mmode_write: may be written by M-mode software to deliver timer interrupts to S-mode.

InterruptsSm_cg/cp_trigger

mip_stip_stimecmp_acc

If the stimecmp (supervisor-mode timer compare) register is implemented, STIP is read-only in mip

InterruptsSm_cg/{cp_write_stip_sstc_csrrs, cp_write_stip_sstc_csrrc}

mip_stip_reflects_stimecmp, mip_stip_stimecmp_clr

mip_stip_reflects_stimecmp: reflects the supervisor-level timer interrupt signal resulting from stimecmp. mip_stip_stimecmp_clr: This timer interrupt signal is cleared by writing stimecmp with a value greater than the current time value.

InterruptsSm_cg/{cp_trigger_sti_sstc, cp_trigger_sti_sstc_tsbi}

mip_ssip_mie_ssie_op

If supervisor mode is implemented, bits mip.⁠SSIP and mie.⁠SSIE are the interrupt-pending and interrupt-enable bits for supervisor-level software interrupts.

InterruptsSm_cg/{cp_trigger, cp_trigger_reg_mip_ssip, cp_enable_one}

mip_ssip_acc

SSIP is writable in mip

InterruptsSm_cg/{cp_trigger_reg_mip_ssip, cp_trigger_reg_sip_ssip}

mip_ssip_intr_ctrl

may also be set to 1 by a platform-specific interrupt controller.

InterruptsSm_cg/cp_trigger

intr_mip_mie_op

An interrupt i will trap to M-mode (causing the privilege mode to change to M-mode) if all of the following are true: (a) either the current privilege mode is M and the MIE bit in the mstatus register is set, or the current privilege mode has less privilege than M-mode; (b) bit i is set in both mip and mie; and (c) if register mideleg exists, bit i is not set in mideleg.

InterruptsSm_cg/{cp_trigger, cp_enable_one, cp_enable_zero, cp_priority_mideleg}

intr_mip_mie_bounded_time

These conditions for an interrupt trap to occur must be evaluated in a bounded amount of time from when an interrupt becomes, or ceases to be, pending in mip,

InterruptsSm_cg/{cp_trigger, cp_wfi_m}

intr_mip_mie_xret_csrwr

be evaluated immediately following the execution of an xRET instruction or an explicit write to a CSR on which these interrupt trap conditions expressly depend (including mip, mie, mstatus, and mideleg).

InterruptsSm_cg/{cp_trigger_tsbi, cp_trigger_reg_mip_ssip, cp_trigger_reg_mip_seip, cp_enable_one_tsbi}

intr_m_mode_pri

Multiple simultaneous interrupts destined for M-mode are handled in the following decreasing priority order: MEI, MSI, MTI, SEI, SSI, STI, LCOFI.

InterruptsSm_cg/{cp_priority_mip, cp_priority_mie, cp_priority_mip_tsbi, cp_priority_mie_tsbi}

trap_del_intr_priv_lvl

Delegated interrupts result in the interrupt being masked at the delegator privilege level. For example, if the supervisor timer interrupt (STI) is delegated to S-mode by setting mideleg[5], STIs will not be taken when executing in M-mode. By contrast, if mideleg[5] is clear, STIs can be taken in any mode and regardless of current mode will transfer control to M-mode.

InterruptsSm_cg/cp_trigger, InterruptsSm_cg/cp_priority_mideleg

intr_m_mode_highest_pri

Interrupts to M-mode take priority over any interrupts to lower privilege modes.

InterruptsSm_cg/{cp_priority_mideleg, cp_priority_mideleg_tsbi}

wfi_op

The Wait for Interrupt instruction (WFI) informs the implementation that the current hart can be stalled until an interrupt might need servicing.

InterruptsSm_cg/{cp_wfi_m, cp_wfi}

wfi_enc_img

InterruptsSm_cg/cp_wfi_m

wfi_all_privileged_modes

WFI is available in all privileged modes

InterruptsSm_cg/{cp_wfi_m, cp_wfi}

wfi_opt_u_mode

optionally available to U-mode.

InterruptsSm_cg/{cp_wfi, cp_wfi_timeout_tw_zero}

wfi_ill_exc

This instruction may raise an illegal-instruction exception when TW=1 in mstatus, as described in virt-control.

InterruptsSm_cg/cp_wfi_timeout

wfi_mepc_val

If an enabled interrupt is present or later becomes present while the hart is stalled, the interrupt trap will be taken on the following instruction, i.e., execution resumes in the trap handler and mepc = pc + 4.

InterruptsSm_cg/{cp_wfi_m, cp_wfi}

wfi_resume_reason

Implementations are permitted to resume execution for any reason, even if an enabled interrupt has not become pending. Hence, a legal implementation is to simply implement the WFI instruction as a NOP.

InterruptsSm_cg/{cp_wfi_m, cp_wfi}

wfi_intr_dis

The WFI instruction can also be executed when interrupts are disabled.

InterruptsSm_cg/cp_wfi_m

wfi_unaffected_conditions

The operation of WFI must be unaffected by the global interrupt bits in mstatus (MIE and SIE) and the delegation register mideleg (i.e., the hart must resume if a locally enabled interrupt becomes pending, even if it has been delegated to a less-privileged mode), but should honor the individual interrupt enables (e.g, MTIE) (i.e., implementations should avoid resuming the hart if the interrupt is pending but not locally enabled).

InterruptsSm_cg/{cp_wfi_m, cp_wfi}

wfi_resume_any_priv

WFI is also required to resume execution for locally enabled interrupts pending at any privilege level, regardless of the global interrupt enable at each privilege level.

InterruptsSm_cg/{cp_wfi_m, cp_wfi}

wfi_no_intr_pc

If the event that causes the hart to resume execution does not cause an interrupt to be taken, execution will resume at pc + 4

InterruptsSm_cg/cp_wfi_m

Table 206. InterruptsSm UDB Parameters
Parameter Description Coverpoint Effect

MTVEC_ACCESS

Options:

ro:: mtvec is read-only.

rw:: mtvec is read-write, but may not accept all values.

all exception coverpoints

If 'ro', tests cannot set mtvec and generate a trap signature

MTVEC_BASE_ALIGNMENT_DIRECT

Minimum alignment of the base pointer. Because mtvec excludes the two least-significant bits of the base, the minimum alignment cannot be less than 4.

all exception coverpoints

Trap handler is aligned to the appropriate boundary

MTVEC_BASE_ALIGNMENT_VECTORED

Because mtvec excludes the two least-significant bits of the base, the minimum alignment cannot be less than 4.

all

Trap handler is aligned to the appropriate boundary

MTVEC_ILLEGAL_WRITE_BEHAVIOR

Options:

retain:: When either mtvec.MODE or mtvec.BASE is illegal, mtvec will retain its current value

custom:: When either mtvec.MODE or mtvec.BASE is illegal, mtvec will obtain an unpredictable value

Other values may be added over time once other common behaviors are identified.

all

If mtvec cannot be written with trap handler, tests will not operate

MTVEC_MODES

Options:

0:: Direct; All traps set pc to mtvec.BASE 1:: Vectored; Asynchronous interrupts set pc to mtvec.BASE + 4 x cause.

If only one mode is given, mtvec.MODE is assumed to be read-only with that value. Otherwise, mtvec.MODE is read-write.

TODO

If direct or vectored are not supported, tests relying on those modes will not operate TODO should not be run

TODO: coverpoints will need to ignore bins with mie.msie nonzero: # If a system has only one hart, or if a platform standard supports the delivery # of machine-level interprocessor interrupts through external interrupts (MEI) # instead, then mip.MSIP and mie.MSIE may both be read-only zeros. - name: mip_msip_mie_msie_maybe_rdonly0 TODO: mip.MSIP update time # When the memory-mapped msip register changes, it is guaranteed to be reflected # in mip.MSIP eventually, but not necessarily immediately. - name: msip_update_max_time

B.3.2. InterruptsS Supervisor-Mode Interrupts

These tests are run on any configuration with supervisor mode that supports interrupts. They boot to S-mode and also run in U-mode (and VS/VU-mode when the H extension is supported); mideleg keeps its boot value with all supervisor-level interrupts delegated.

Tests run if S exists (and don’t use MTI/MSI/MEI that are outside supervisor-mode spec) Boot to SMODE, run tests in each supported priv mode of <S,U,VS,VU> Reference model needs to know if each of the types of interrupts are supported menvcfg.STCE = 0 unless otherwise stated mideleg boots with 1s below M-mode and does not change stvec.MODE uses boot value RVTEST_SET_MTI_INT writes mtimecmp = 0 (with tsbi if necessary) Define ways to cause all of the interrupts that are standard as much as possible, only need RV macros for special stuff

Table 207. InterruptsS Test Setup
Step S U VS VU

setup_interrupts_s

mideleg boots with all non-M interrupts delegated
write sstatus.SIE= {0/1}
write sie = 1s
write stvec.MODE = {00, 01} if each supported

Same as S

*

*

trigger_interrupts <type>

RVTEST_SET_<type>_INT
RVTEST_IDLE_FOR_INTERRUPT to wait for interrupt
RVTEST_CLR_<type>_INT

Same as but with priv = U

Coverpoint

mideleg<typ> = 1 if UDB_<TYPE>_DELEGATION_SUPPORTED
sie<type> = 1 if UDB_<TYPE>_SUPPORTED
sstatus.SIE = {0/1}

Same as S

Expectation

<type> pending if UDB_<TYPE>_SUPPORTED, trap if SIE = 1

pending and trap if UDB_<TYPE>_SUPPORTED

Table 208. InterruptsS Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule

cp_trigger

Assert each interrupt

For <type> = {LCOFI, STI, SSI, SEI, VSTI, VSEI, VSSI}
setup_interrupts_s
trigger_interrupts_<type>

in S mode, supported interrupt will fire if SIE = 1
SIE should not affect result in lower modes

4 priv * 7 int * 2 SIE * 2 vecMODE

trap_del_s_mode_op
medeleg_mideleg_per_bit_rw
medeleg_mideleg_delegate_op
mideleg_enc_img
mideleg_enc_txt
mstatus_mie_sie_exist
mstatus_mie_sie_op
mstatus_xie_intr_en_dis
mstatus_xpie_xpp_op
mstatus_xpie_xie_xpp_trap_op
intr_mip_mie_op
intr_sei_op
trap_horiz
mip_seip_mie_seie_op
mip_stip_no_stimecmp_acc
mip_stip_mie_stie_op
mip_stip_no_stimecmp_mmode_write
mip_ssip_mie_ssie_op
mip_ssip_intr_ctrl
sstatus_spp
sstatus_sie
sie_sip_supervisor_strap
sip_seip_sie_seie
sip_stip_sie_stie
sip_ssip_sie_ssie
sepc_op_trap_write
scause
scause_interrupt
stval_op_other_traps
mstatus_xpie_op

cp_trigger_reg

Same as cp_trigger, but use mip.SEIP, mip.SSIP, and sip.SSIP rather than macros.

same as above

4 priv * 3 int * 2 SIE * 2 vecMODE

mip_bits_wr_op
intr_sei_op
mip_seip_acc
mip_ssip_acc
mip_ssip_intr_ctrl
sip_op
sip_ssip_sie_ssie

cp_trigger_sti_sstc

STI with SSTC

if SSTC_SUPPORTED:
setup_interrupts_s
write menvcfg.STCE = {0/1}
trigger_interrupts_SSTC

STI trigger if
in S mode, all 3 enables are true
in lower mode, STCE and STIE are true (SIE does not matter)

4 priv * 2 STCE * 2 SIE * 2 vecMODE

mip_stip_mie_stie_op
mip_stip_reflects_stimecmp
mip_stip_stimecmp_clr
sip_stip_sie_stie
mip_sip_stip_op
supervisor_timer_scheduling

cp_enable

Enables control interrupts

write sstatus.SIE = 1
For <type> in <types above>:
sie = {1 in type, 1s everywhere except type}
RVTEST_SET_<type>_INT
RVTEST_IDLE_FOR_INT
RVTEST_CLR_<type>_INT

Interrupt if sie and sip match

4 priv * 2 sie * 7 int

mip_mie_enc_txt
mip_enc_img
intr_mip_mie_op
mip_seip_mie_seie_op
mip_ssip_mie_ssie_op
sie_sip_supervisor_strap
intr_mip_mie_xret_csrwr
mip_stip_mie_stie_op
sstatus_sie

cp_priority_sip

Priority of pending interrupts

write sstatus.SIE = 1
write sie = 0s
RVTEST_SET_<type>_INT (7 choose 2) pairs of sip.<TYPE1, TYPE2>
write sie = 1s
RVTEST_IDLE_FOR_INT
RVTEST_CLR_<type>_INT for both

highest priority pending interrupt will fire

21 int * 4 priv

mip_mie_enc_txt
mip_enc_img
sip_sie
sip_sie_priority_bit_order

cp_priority_sie

Priority of enabled interrupts

write sstatus.SIE = 1
write sie = 0s
RVTEST_SET_<type>_INT for all 7 types
write sie with two ones for all (7 choose 2) pairs
RVTEST_IDLE_FOR_INT
RVTEST_CLR_<type>_INT for all

highest priority enabled interrupt will fire

21 int * 4 priv

mip_mie_enc_txt
mip_enc_img
intr_mip_mie_xret_csrwr
sie_acc
sip_sie_priority_bit_order

cp_wfi

WFI waits until timer interrupt

Do not test in U mode.
if SSTC_SUPPORTED:
write mstatus.TW = 0
write sstatus.SIE = {0/1}
write sie.STIE = 1
RVTEST_SET_SSTC_INT_SOON
do {
WFI instruction
} until STI has fired (see Zawrs)
RVTEST_CLR_SSTC_INT

Wait for timer interrupt. MIE and SIE not affect results.

4 priv * 2 SIE

mstatus_tw_op
mip_stip_stimecmp_clr

cp_wfi_timeout

WFI waits until timeout

write mstatus.TW = 1 (also 0 in U-mode if S_SUPPORTED)
write sie.STIE = {0/1}
write sstatus.SIE = {0/1}
WFI instruction

mstatus_tw_op
mstatus_tw_umode_op
mstatus_tw_always_illegal

Table 209. InterruptsS Normative Rules
Normative Rule Rule Text Coverpoints

trap_del_s_mode_op

When a trap is delegated to S-mode, the scause register is written with the trap cause; the sepc register is written with the virtual address of the instruction that took the trap; the stval register is written with an exception-specific datum; the SPP field of mstatus is written with the active privilege mode at the time of the trap; the SPIE field of mstatus is written with the value of the SIE field at the time of the trap; and the SIE field of mstatus is cleared.

InterruptsS_cg/cp_trigger

medeleg_mideleg_per_bit_rw

implementations can provide individual read/write bits within medeleg and mideleg to indicate that certain exceptions and interrupts should be processed directly by a lower privilege level.

InterruptsS_cg/cp_trigger, InterruptsSm_cg/cp_priority_mideleg

medeleg_mideleg_delegate_op

setting a bit in medeleg or mideleg will delegate the corresponding trap, when occurring in S-mode or U-mode, to the S-mode trap handler.

InterruptsS_cg/cp_trigger, InterruptsSm_cg/cp_priority_mideleg

mideleg_enc_img

InterruptsS_cg/cp_trigger, InterruptsSm_cg/cp_priority_mideleg

mideleg_enc_txt

mideleg holds trap delegation bits for individual interrupts, with the layout of bits matching those in the mip register

InterruptsS_cg/cp_trigger, InterruptsSm_cg/cp_priority_mideleg

mstatus_mie_sie_exist

Global interrupt-enable bits, MIE and SIE, are provided for M-mode and S-mode respectively.

InterruptsS_cg/cp_trigger

mstatus_mie_sie_op

When a hart is executing in privilege mode x, interrupts are globally enabled when xIE=1 and globally disabled when xIE=0.

InterruptsS_cg/cp_trigger

mstatus_xie_intr_en_dis

Interrupts for lower-privilege modes, w<x, are always globally disabled regardless of the setting of any global wIE bit for the lower-privilege mode. Interrupts for higher-privilege modes, y>x, are always globally enabled regardless of the setting of the global yIE bit for the higher-privilege mode.

InterruptsS_cg/cp_trigger

mstatus_xpie_xpp_op

each privilege mode x that can respond to interrupts has a two-level stack of interrupt-enable bits and privilege modes. xPIE holds the value of the interrupt-enable bit active prior to the trap, and xPP holds the previous privilege mode.

InterruptsS_cg/cp_trigger

mstatus_xpie_xie_xpp_trap_op

When a trap is taken from privilege mode y into privilege mode x, xPIE is set to the value of xIE; xIE is set to 0; and xPP is set to y.

InterruptsS_cg/cp_trigger

mstatus_tw_op

When TW=0, the WFI instruction may execute in modes less privileged than M when not prevented for some other reason. When TW=1, then if WFI is executed in any less-privileged mode, and it does not complete within an implementation-specific, bounded time limit, the WFI instruction causes an illegal-instruction exception.

InterruptsS_cg/cp_wfi, InterruptsS_cg/cp_wfi_timeout

mstatus_tw_umode_op

When S-mode is implemented, then executing WFI in U-mode causes an illegal-instruction exception, regardless of the value of the TW bit, unless the instruction completes within an implementation-specific, bounded time limit.

InterruptsS_cg/cp_wfi_timeout

mstatus_tw_always_illegal

An implementation may have WFI always raise an illegal-instruction exception in modes less privileged than M when TW=1, even if there are pending globally-disabled interrupts when the instruction is executed.

InterruptsS_cg/cp_wfi_timeout

mip_mie_enc_txt

Interrupt cause number i (as reported in CSR mcause, mcause) corresponds with bit i in both mip and mie. Bits 15:0 are allocated to standard interrupt causes only, while bits 16 and above are designated for platform use.

InterruptsS_cg/{cp_enable_one, cp_priority_sip, cp_priority_sie}

mip_enc_img

InterruptsS_cg/{cp_enable_one, cp_priority_sip, cp_priority_sie}

mip_bits_wr_op

When bit i in mip is writable, a pending interrupt i can be cleared by writing 0 to this bit.

InterruptsS_cg/{cp_trigger_reg_mip_ssip, cp_trigger_reg_mip_seip}

intr_mip_mie_op

An interrupt i will trap to M-mode (causing the privilege mode to change to M-mode) if all of the following are true: (a) either the current privilege mode is M and the MIE bit in the mstatus register is set, or the current privilege mode has less privilege than M-mode; (b) bit i is set in both mip and mie; and (c) if register mideleg exists, bit i is not set in mideleg.

InterruptsS_cg/{cp_trigger, cp_enable_one, cp_enable_zero}

intr_mip_mie_xret_csrwr

be evaluated immediately following the execution of an xRET instruction or an explicit write to a CSR on which these interrupt trap conditions expressly depend (including mip, mie, mstatus, and mideleg).

InterruptsS_cg/{cp_trigger_tsbi, cp_enable_one_tsbi, cp_priority_sie}

intr_m_mode_highest_pri

Interrupts to M-mode take priority over any interrupts to lower privilege modes.

InterruptsSm_cg/cp_priority_mideleg

intr_sei_op

Supervisor-level external interrupts are made pending based on the logical-OR of the software-writable SEIP bit and the signal from the external interrupt controller.

InterruptsS_cg/{cp_trigger, cp_trigger_reg_mip_seip}

trap_never_trans_lower

Traps never transition from a more-privileged mode to a less-privileged mode. For example, if M-mode has delegated illegal-instruction exceptions to S-mode, and M-mode software later executes an illegal instruction, the trap is taken in M-mode, rather than being delegated to S-mode.

InterruptsSm_cg/cp_trigger

trap_horiz

traps may be taken horizontally. Using the same example, if M-mode has delegated illegal-instruction exceptions to S-mode, and S-mode software later executes an illegal instruction, the trap is taken in S-mode.

InterruptsS_cg/cp_trigger

trap_del_intr_priv_lvl

Delegated interrupts result in the interrupt being masked at the delegator privilege level. For example, if the supervisor timer interrupt (STI) is delegated to S-mode by setting mideleg[5], STIs will not be taken when executing in M-mode. By contrast, if mideleg[5] is clear, STIs can be taken in any mode and regardless of current mode will transfer control to M-mode.

InterruptsSm_cg/cp_trigger, InterruptsSm_cg/cp_priority_mideleg

mip_seip_mie_seie_op

If supervisor mode is implemented, bits mip.⁠SEIP and mie.⁠SEIE are the interrupt-pending and interrupt-enable bits for supervisor-level external interrupts.

InterruptsS_cg/{cp_trigger, cp_enable_one}

mip_seip_acc

SEIP is writable in mip

InterruptsS_cg/cp_trigger_reg_mip_seip

mip_seip_rdcsr

When mip is read with a CSR instruction, the value of the SEIP bit returned in the rd destination register is the logical-OR of the software-writable bit and the interrupt signal from the interrupt controller

TODO: read mip while software SEIP is clear and the interrupt controller asserts SEI

mip_seip_wrcsr

the signal from the interrupt controller is not used to calculate the value written to SEIP. Only the software-writable SEIP bit participates in the read-modify-write sequence of a CSRRS or CSRRC instruction.

TODO: csrrs/csrrc mip with the SEIP bit clear in rs1 while the interrupt controller asserts SEI

mip_stip_no_stimecmp_acc

If the stimecmp register is not implemented, STIP is writable in mip

InterruptsS_cg/cp_trigger

mip_stip_mie_stie_op

If supervisor mode is implemented, its mip.⁠STIP and mie.⁠STIE are the interrupt-pending and interrupt-enable bits for supervisor-level timer interrupts.

InterruptsS_cg/{cp_trigger, cp_trigger_sti_sstc, cp_enable_one_tsbi}

mip_stip_no_stimecmp_mmode_write

may be written by M-mode software to deliver timer interrupts to S-mode.

InterruptsS_cg/cp_trigger

mip_stip_reflects_stimecmp

reflects the supervisor-level timer interrupt signal resulting from stimecmp.

InterruptsS_cg/cp_trigger_sti_sstc

mip_stip_stimecmp_clr

This timer interrupt signal is cleared by writing stimecmp with a value greater than the current time value.

InterruptsS_cg/cp_trigger_sti_sstc, InterruptsS_cg/cp_wfi

mip_ssip_acc

SSIP is writable in mip

InterruptsS_cg/cp_trigger_reg_mip_ssip

mip_ssip_mie_ssie_op

If supervisor mode is implemented, bits mip.⁠SSIP and mie.⁠SSIE are the interrupt-pending and interrupt-enable bits for supervisor-level software interrupts.

InterruptsS_cg/{cp_trigger, cp_enable_one}

mip_ssip_intr_ctrl

may also be set to 1 by a platform-specific interrupt controller.

InterruptsS_cg/{cp_trigger_reg_mip_ssip, cp_trigger}

sstatus_spp

The SPP bit indicates the privilege level at which a hart was executing before entering supervisor mode. When a trap is taken, SPP is set to 0 if the trap originated from user mode, or 1 otherwise. When an SRET instruction (see ) is executed to return from the trap handler, the privilege level is set to user mode if the SPP bit is 0, or supervisor mode if the SPP bit is 1; SPP is then set to 0.

InterruptsS_cg/cp_trigger

Table 210. InterruptsS UDB Parameters
Parameter Description Coverpoint Effect

STVEC_MODES

Options:

0:: Direct; All traps set pc to stvec.BASE 1:: Vectored; Asynchronous interrupts set pc to stvec.BASE + 4 x cause.

If only one mode is given, stvec.MODE is assumed to be read-only with that value. Otherwise, stvec.MODE is read-write.

TODO

If direct or vectored are not supported, tests relying on those modes will not operate TODO should not be run

STVEC_BASE_ALIGNMENT_VECTORED

Minimum alignment of the base pointer when stvec.MODE is Vectored. Because stvec excludes the two least-significant bits of the base, the minimum alignment cannot be less than 4 bytes.

all

Trap handler is aligned to the appropriate boundary

B.3.3. SstcSm Machine-Mode Supervisor Timer Compare

These tests are run on any configuration with machine mode when the Sstc supervisor timer compare extension is supported.

  • for RV32, also access stimcmph

Table 211. SstcSm Coverpoints
Coverpoint Goal Feature Description Expectation Pass/Fail Criteria Normative Rule Status Coverage

In machine mode

cp_machine_tm

Access stimecmp

Read stimecmp with mcounteren.TM = {0/1} * for RV32, also access stimcmph

stimecmp always readable in machine mode

Check against RM

To be Done

Uncovered

cp_machine_stce

Access stimecmp

Read stimecmp with menvcfg.stce (menvcfgh in RV32) = {0/1} * for RV32, also access stimcmph

stimecmp always readable in machine mode

Check against RM

menvcfg_stce_exists
menvcfg_stce_rdonly0
menvcfg_stce_enable_op
menvcfg_stce_zero_op
menvcfg_stce_zero_vstip

To be Done

Uncovered

Table 212. SstcSm Normative Rules
Normative Rule Rule Text Coverpoints

menvcfg_stce_exists

The Sstc extension adds the STCE (STimecmp Enable) bit to menvcfg CSR.

SstcSm_cg/cp_machine_stce, InterruptsSm_cg/cp_trigger_sti_sstc, InterruptsSm_cg/cp_write_stip_sstc

menvcfg_stce_rdonly0

When the Sstc extension is not implemented, STCE is read-only zero.

SstcSm_cg/cp_machine_stce, InterruptsSm_cg/cp_trigger_sti_sstc, InterruptsSm_cg/cp_write_stip_sstc

menvcfg_stce_enable_op

The STCE bit enables stimecmp for S-mode when set to one.

SstcSm_cg/cp_machine_stce, InterruptsSm_cg/cp_trigger_sti_sstc, InterruptsSm_cg/cp_write_stip_sstc

menvcfg_stce_zero_op

When this extension is implemented and STCE in menvcfg is zero, an attempt to access stimecmp or vstimecmp in a mode other than M-mode raises an illegal-instruction exception, STCE in henvcfg is read-only zero, and STIP in mip and sip reverts to its defined behavior as if this extension is not implemented.

SstcSm_cg/cp_machine_stce, InterruptsSm_cg/cp_trigger_sti_sstc, InterruptsSm_cg/cp_write_stip_sstc

menvcfg_stce_zero_vstip

Further, if the H extension is implemented, then hip.VSTIP also reverts its defined behavior as if this extension is not implemented.

SstcSm_cg/cp_machine_stce, InterruptsSm_cg/cp_trigger_sti_sstc, InterruptsSm_cg/cp_write_stip_sstc

stimecmp_stimecmph_sz_acc

The stimecmp CSR is a 64-bit register and has 64-bit precision on all RV32 and RV64 systems. In RV32 only, accesses to the stimecmp CSR access the low 32 bits, while accesses to the stimecmph CSR access the high 32 bits of stimecmp.

mip_sip_stip_op

A supervisor timer interrupt becomes pending, as reflected in the STIP bit in the mip and sip registers whenever time contains a value greater than or equal to stimecmp, treating the values as unsigned integers. If the result of this comparison changes, it is guaranteed to be reflected in STIP eventually, but not necessarily immediately. The interrupt remains posted until stimecmp becomes greater than time, typically as a result of writing stimecmp. The interrupt will be taken based on the standard interrupt enable and delegation rules.

InterruptsSm_cg/cp_trigger_sti_sstc, InterruptsSm_cg/cp_write_stip_sstc

sip_stip_sie_stie

Bits sip.STIP and sie.STIE are the interrupt-pending and interrupt-enable bits for supervisor-level timer interrupts. If implemented, STIP is read-only in sip. When the Sstc extension is not implemented, STIP is set and cleared by the execution environment. When the Sstc extension is implemented, STIP reflects the timer interrupt signal resulting from stimecmp. The sip.STIP bit, in response to timer interrupts generated by stimecmp, is set by writing stimecmp with a value that is less than or equal to time, and is cleared by writing stimecmp with a value greater than time.

InterruptsSm_cg/cp_trigger_sti_sstc, InterruptsSm_cg/cp_write_stip_sstc

UDB Parameters: None.

B.3.4. Sstc Supervisor-Mode Supervisor Timer Compare

These tests are run on any configuration with supervisor mode when the Sstc supervisor timer compare extension is supported.

  • for RV32, also access stimcmph Boot to S-mode. Run S and U-mode tests.

Table 213. Sstc Coverpoints
Coverpoint Goal Feature Description Expectation Pass/Fail Criteria Normative Rule Status Coverage

In supervisor mode

cp_supervisor_tm

Access stimecmp

Read stimecmp with mcounteren.TM = {0/1} for RV32, also access stimcmph

stimecmp only readable in supervisor mode if mcounteren.TM = 1

Check against RM

stimecmp_exist
mcounteren_tm_clr
mcounteren_tm_set
stimecmp_stimecmph_sz_acc

To be Done

Uncovered

cp_supervisor_stce

Access stimecmp

Read stimecmp with menvcfg.stce (menvcfgh in RV32) = {0/1} for RV32, also access stimcmph

stimecmp only readable in supervisor mode if menvcfg.STCE = 1

Check against RM

stimecmp_exist
stce_bit_exist
menvcfg_stce_enable_op
menvcfg_stce_zero_op
stimecmp_stimecmph_sz_acc

To be Done

Uncovered

In user mode

cp_user_tm

Access stimecmp

Read stimecmp with mcounteren.TM = {0/1} * scounteren.TM = {0/1} (if S_SUPPORTED) for RV32, also access stimcmph

stimecmp never readable in user mode

Check against RM

To be Done

Uncovered

cp_user_stce

Access stimecmp

Read stimecmp with menvcfg.stce (menvcfgh in RV32) = {0/1} for RV32, also access stimcmph

stimecmp never readable in user mode (too little privilege)

Check against RM

stce_bit_exist
menvcfg_stce_zero_op

To be Done

Uncovered

Table 214. Sstc Normative Rules
Normative Rule Rule Text Coverpoints

stimecmp_exist

This extension adds the S-level stimecmp CSR (stimecmp)

Sstc_cg/{cp_supervisor_stce, cp_supervisor_tm}

stce_bit_exist

This extension adds the STCE bit to the menvcfg (sec:menvcfg) and henvcfg (sec:henvcfg) CSRs.

Sstc_cg/{cp_supervisor_stce, cp_user_stce}, SstcH_vs_cg/cp_vs_stimecmp_accessible

menvcfg_stce_enable_op

The STCE bit enables stimecmp for S-mode when set to one.

Sstc_cg/cp_supervisor_stce, InterruptsSm_cg/cp_trigger_sti_sstc

menvcfg_stce_zero_op

When this extension is implemented and STCE in menvcfg is zero, an attempt to access stimecmp or vstimecmp in a mode other than M-mode raises an illegal-instruction exception, STCE in henvcfg is read-only zero, and STIP in mip and sip reverts to its defined behavior as if this extension is not implemented.

Sstc_cg/{cp_supervisor_stce, cp_user_stce}, InterruptsSm_cg/cp_trigger_sti_sstc

menvcfg_stce_zero_vstip

Further, if the H extension is implemented, then hip.VSTIP also reverts its defined behavior as if this extension is not implemented.

mcounteren_tm_clr

when the TM bit in the mcounteren register is clear, attempts to access the stimecmp or vstimecmp register while executing in a mode less privileged than M will cause an illegal-instruction exception.

Sstc_cg/cp_supervisor_tm

mcounteren_tm_set

When this bit is set, access to the stimecmp or vstimecmp register is permitted in S-mode if implemented, and access to the vstimecmp register (via stimecmp) is permitted in VS-mode if implemented and not otherwise prevented by the TM bit in hcounteren.

Sstc_cg/cp_supervisor_tm

stimecmp_stimecmph_sz_acc

The stimecmp CSR is a 64-bit register and has 64-bit precision on all RV32 and RV64 systems. In RV32 only, accesses to the stimecmp CSR access the low 32 bits, while accesses to the stimecmph CSR access the high 32 bits of stimecmp.

Sstc_cg/cp_supervisor_tm, Sstc_cg/cp_supervisor_tm_h, Sstc_cg/cp_supervisor_stce

UDB Parameters: None.

TODO: beef up testing stimecmp values, behavior near wraparound

B.4. Zicntr

These privileged tests exercise counter and HPM reads (time, cycle, instret, hpmcounter[31:3]) from lower privilege modes, as controlled by mcounteren and scounteren. Note that the Zicntr and Zihpm unprivileged tests exercise access to these counters from U-mode (or from M-mode when U-mode is not supported), and the Sm tests exercise access to mcycle, minstret, mhpmcounter, etc. from M-mode.

B.4.2. ZicntrU User-Mode Counter Reads

Table 217. ZicntrU Coverpoints

Google Sheet Testplan

Table 218. ZicntrU Normative Rules
Normative Rule Rule Text Coverpoints

mcounteren_op

controls the availability of the hardware performance-monitoring counters to the next-lower privileged mode.

ZicntrS_cg/cp_mcounteren_access_s, ZicntrU_cg/cp_mcounteren_access_u, ZicntrSm_cg/cp_mcounteren_access_m, ZicntrH_cg/cp_mcounteren_access_vs

mcounteren_inc_inaccessible

The settings in this register only control accessibility. The act of reading or writing this register does not affect the underlying counters, which continue to increment even when not accessible.

ZicntrU_cg/cp_mcounter_inc_inaccessible

mcounteren_clr_ill_inst_exc

When the CY, TM, IR, or HPMn bit in the mcounteren register is clear, attempts to read the cycle, time, instret, or hpmcountern register while executing in S-mode or U-mode will cause an illegal-instruction exception.

ZicntrS_cg/cp_mcounteren_access_s, ZicntrU_cg/cp_mcounteren_access_u

mcounteren_set_nxt_priv

When one of these bits is set, access to the corresponding register is permitted in the next implemented privilege mode (S-mode if implemented, otherwise U-mode).

ZicntrS_cg/cp_mcounteren_access_s, ZicntrU_cg/cp_mcounteren_access_u

ecall_ebreak_no_minstret_inc

As ECALL and EBREAK cause synchronous exceptions, they are not considered to retire, and should not increment the minstret CSR.

ZicntrU_cg/{cp_instret_ecall, cp_instret_ebreak}

UDB Parameters: None.

B.5. Endian

B.5.1. EndianSm Machine-Mode Endianness

Table 219. EndianSm Coverpoints
Coverpoint Goal Feature Description Notes Normative Rule

cp_mstatus_mbe_endianness

Read from memory in an endian fashion

For each endianness, sd 0x0102030405060708 to scratch, and also write all subwords with sw, sh, sb. For each endianness (independent), ld, lw, lwu, lh, lhu, lb, lbu it back. In RV32, use mstatush and don’t need the doubles.

restore endianness to normal afterward
MBE
when mstatus.MPRV=0

mstatus_mbe_op

Table 220. EndianSm Normative Rules
Normative Rule Rule Text Coverpoints

mstatus_mbe_op

MBE controls whether non-instruction-fetch memory accesses made from M-mode (assuming mstatus.⁠MPRV=0) are little-endian (MBE=0) or big-endian (MBE=1).

EndianSm_cg/{cp_mstatus_mbe_endianness_sw, cp_mstatus_mbe_endianness_lw, cp_mstatus_mbe_endianness_sh, cp_mstatus_mbe_endianness_lbu}

UDB Parameters: None.

B.5.2. EndianS Supervisor-Mode Endianness

Table 221. EndianS Coverpoints
Coverpoint Goal Feature Description Notes Normative Rule

cp_mstatus_sbe_endianness

Read from memory in an endian fashion in supervisor mode.

Run test in supervisor mode. For each endianness given by mstatus.SBE, sd 0x0102030405060708 to scratch, and also write all subwords with sw, sh, sb. For each endianness (independent), ld, lw, lwu, lh, lhu, lb, lbu it back. In RV32, use mstatush and don’t need the doubles.

restore endianness to normal afterward
SBE

mstatus_sbe_op

cp_mstatus_mprv_sbe_endianness

Read from memory in an endian fashion based on MBE and SBE for systems with supervisor mode.

Run test in machine mode. Each endianness is a cross-product of MPRV = 0/1, MPP = 01/11, MBE = 0/1, SBE = 0/1 (16 bins). For each endianness, sd 0x0102030405060708 to scratch, and also write all subwords with sw, sh, sb. For each endianness (independent), ld, lw, lwu, lh, lhu, lb, lbu it back. In RV32, use mstatush and don’t need the doubles.

restore endianness to normal afterward
MPRV, MBE, SBE

mstatus_mprv_ldst_op

cp_sstatus_ube_endianness

Read from memory in an endian fashion

Run test in user mode. For each endianness given in sstatus.UBE, sd 0x0102030405060708 to scratch, and also write all subwords with sw, sh, sb. For each endianness (independent), ld, lw, lwu, lh, lhu, lb, lbu it back. In RV32, use mstatush and don’t need the doubles.

restore endianness to normal afterward
UBE

sstatus_ube_endianness_op
sstatus_ube
sstatus_ube_implicit

Table 222. EndianS Normative Rules
Normative Rule Rule Text Coverpoints

sstatus_ube

The UBE bit is a WARL field that controls the endianness of explicit memory accesses made from U-mode, which may differ from the endianness of memory accesses in S-mode. An implementation may make UBE be a read-only field that always specifies the same endianness as for S-mode.

EndianS_cg/cp_sstatus_ube_endianness_lw

sstatus_ube_implicit

UBE has no effect on instruction fetches, which are implicit memory accesses that are always little-endian.

EndianS_cg/cp_sstatus_ube_endianness_lw

sstatus_ube_endianness_op

UBE controls whether explicit load and store memory accesses made from U-mode are little-endian (UBE=0) or big-endian (UBE=1).

EndianS_cg/{cp_sstatus_ube_endianness_sw, cp_sstatus_ube_endianness_lw, cp_sstatus_ube_endianness_sh, cp_sstatus_ube_endianness_lbu}

sstatus_ube_implicit_smode

For implicit accesses to supervisor-level memory management data structures, such as page tables, S-mode endianness always applies and UBE is ignored.

TODO: U-mode accesses through Sv translation with UBE≠SBE, checking page tables are read with S-mode endianness

endianness

The EEI will define whether the memory system is little-endian or big-endian.

ldst_endian_byte_invariant

In RISC-V, endianness is byte-address invariant.

mstatus_mprv_ldst_op

When MPRV=0, explicit memory accesses behave as normal, using the translation and protection mechanisms of the current privilege mode. When MPRV=1, load and store memory addresses are translated and protected, and endianness is applied, as though the current privilege mode were set to MPP.

EndianS_cg/cp_mstatus_mprv_sbe_endianness_sw, EndianS_cg/cp_mstatus_mprv_sbe_endianness_sb, EndianS_cg/cp_mstatus_mprv_sbe_endianness_lw, EndianS_cg/cp_mstatus_mprv_sbe_endianness_lbu

mstatus_sbe_op

If S-mode is not supported, SBE is read-only 0. Otherwise, SBE controls whether explicit load and store memory accesses made from S-mode are little-endian (SBE=0) or big-endian (SBE=1).

EndianS_cg/{cp_mstatus_sbe_endianness_sw, cp_mstatus_sbe_endianness_lw, cp_mstatus_sbe_endianness_sh, cp_mstatus_sbe_endianness_lbu}

mstatus_sbe_implicit

For implicit accesses to supervisor-level memory management data structures, such as page tables, endianness is always controlled by SBE.

mstatus_sbe_change_fence

Since changing SBE alters the implementation’s interpretation of these data structures, if any such data structures remain in use across a change to SBE, M-mode software must follow such a change to SBE by executing an SFENCE.VMA instruction with rs1=x0 and rs2=x0.

mstatus_sbe_rocopy

If S-mode is supported, an implementation may make SBE be a read-only copy of MBE.

UDB Parameters: None.

B.5.3. EndianU User-Mode Endianness

Table 223. EndianU Coverpoints
Coverpoint Goal Feature Description Notes Normative Rule

cp_mstatus_ube_endianness

Read from memory in an endian fashion

Run in user mode. For each endianness, sd 0x0102030405060708 to scratch, and also write all subwords with sw, sh, sb. For each endianness (independent), ld, lw, lwu, lh, lhu, lb, lbu it back. In RV32, don’t need the doubles.

restore endianness to normal afterward
UBE

mstatus_ube_op

cp_mstatus_mprv_ube_endianness

Read from memory in an endian fashion

Run in machine mode. Each endianness is a cross-product of MPRV = 0/1, MPP = 00/11, MBE = 0/1, UBE = 0/1 (16 bins). Run test in machine mode. For each endianness, sd 0x0102030405060708 to scratch, and also write all subwords with sw, sh, sb. For each endianness (independent), ld, lw, lwu, lh, lhu, lb, lbu it back. In RV32, don’t need the doubles.

restore endianness to normal afterward
MPRV

mstatus_mprv_ldst_op

UXL is not always modifiable, so there is no way to write coverpoints for different values

Table 224. EndianU Normative Rules
Normative Rule Rule Text Coverpoints

mstatus_mprv_ldst_op

When MPRV=0, explicit memory accesses behave as normal, using the translation and protection mechanisms of the current privilege mode. When MPRV=1, load and store memory addresses are translated and protected, and endianness is applied, as though the current privilege mode were set to MPP.

EndianU_cg/cp_mstatus_mprv_ube_endianness_sw, EndianU_cg/cp_mstatus_mprv_ube_endianness_sb, EndianU_cg/cp_mstatus_mprv_ube_endianness_lw, EndianU_cg/cp_mstatus_mprv_ube_endianness_lbu

mstatus_ube_op

If U-mode is not supported, UBE is read-only 0. Otherwise, UBE controls whether explicit load and store memory accesses made from U-mode are little-endian (UBE=0) or big-endian (UBE=1).

EndianU_cg/{cp_mstatus_ube_endianness_sw, cp_mstatus_ube_endianness_lw, cp_mstatus_ube_endianness_sh, cp_mstatus_ube_endianness_lbu}

mstatus_ube_rocopy

If U-mode is supported, an implementation may make UBE be a read-only copy of either MBE or SBE.

UDB Parameters: None.

B.5.4. EndianZaamo Endianness for AMOs

Table 225. EndianZaamo Coverpoints
Coverpoint Goal Feature Description Notes

cp_endianness_amo

Read from memory in an endian fashion

Write 0x0102030405060708 to scratch. For each endianness, amoadd.w a different value to scratch. For RV64, also amoadd.d

restore endianness to normal afterward
MBE
when mstatus.MPRV=0

B.5.5. EndianZalrsc Endianness for LR/SC

Table 226. EndianZalrsc Coverpoints
Coverpoint Goal Feature Description Notes

cp_endianness_lr
cp_endianness_sc

Read from memory in an endian fashion

Write 0x0102030405060708 to scratch. For each endianness, lr.w from scratch and sc.w a different value back to scratch. For RV64, also lr.d and sc.d

restore endianness to normal afterward
MBE
when mstatus.MPRV=0

B.5.6. EndianF Endianness for Floats

Table 227. EndianF Coverpoints
Coverpoint Goal Feature Description Notes

cp_endianness_f

Read from memory in an endian fashion

Write 0x0102030405060708 to scratch. For each endianness, flw from scratch, and fsw back to scratch. For D, also fld and fsd.

restore endianness to normal afterward
MBE
when mstatus.MPRV=0

B.5.7. EndianZca Endianness for Compressed Instructions

Table 228. EndianZca Coverpoints
Coverpoint Goal Feature Description Notes

cp_endianness_zca

Read from memory in an endian fashion

Write 0x0102030405060708 to scratch. For each endianness, c.lw from scratch, and c.sw back to scratch. For RV64, also c.ld and c.sd.

restore endianness to normal afterward
MBE
when mstatus.MPRV=0

B.6. Ssstrict

The Ssstrict extension indicates that executing unimplemented instructions or accessing unimplemented CSR in the standard or reserved encoding spaces raises an illegal instruction exception.

No non-conforming extensions are present. Attempts to execute unimplemented opcodes or access unimplemented CSRs in the standard or reserved encoding spaces raises an illegal instruction exception that results in a contained trap to the supervisor-mode trap handler.
— https://github.com/riscv/riscv-profiles/blob/main/src/rva23-profile.adoc[RVA23 profile Ssstrict definition]

Vector instructions introduce complex register constraints and are tested separately in SsstrictV.

B.6.1. SsstrictSm

RISC-V does not have a ratified equivalent of Ssstrict for machine mode, but this optional test suite checks the behavior of unimplemented instructions and CSRs from machine mode. It runs the same tests as SsstrictS but from machine mode.

The following CSR accesses and instructions should be exercised in machine mode. All inherently require Zicsr.

Table 229. SsstrictSm Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule Notes

cp_csrr

CSR Accesses

Read all 4096 CSRs in M-mode (CSRR with rd≠x0). Skips: PMP regs 0x3A0-0x3EF, debug-only 0x7B0-0x7BF, and custom CSRs (0x7C0-0x7FF, 0xBC0-0xBFF, 0xFC0-0xFFF).

Legal CSRs return a value; non-existent/inaccessible CSRs raise illegal-instruction exception.

One bin per CSR address 0x000–0xFBF (excluding skips)

medelegh_omit_xlen64
medeleg_mideleg_omit_wo_s_mode
mcounteren_presence
menvcfgh_sz_acc_op
mseccfgh_presence
mstatush_sz_acc
stateen_rv32_upper_bits_csrs
rv32_high_access
menvcfg_menvcfgh_no_u_mode
Zicsr_nonexistent_rsv
Zicsr_high_half_rv64_rsv

csrr instruction, save value

cp_csrw_corners

CSR Accesses

Write all-zeros then all-ones to every CSR in M-mode. Skips PMP regs (0x3A0-0x3EF) to avoid corrupting PMP configuration and custom CSRs.

Write to legal CSRs succeeds; write to read-only or non-existent CSRs raises illegal-instruction.

Two bins per CSR: write 0x000…​0 and write 0xFFF…​F

csrw instruction

cp_csrcs

CSR Accesses

Set all bits (CSRRS with rs1=all-ones) then clear all bits (CSRRC with rs1=all-ones) for every CSR in M-mode. Skips PMP and custom CSRs.

Same as cp_csrw_corners — legal writes succeed, illegal CSRs trap.

Two bins per CSR: CSRRS all-ones, CSRRC all-ones

medelegh_omit_xlen64
menvcfgh_sz_acc_op
mseccfgh_presence
mstatush_sz_acc
stateen_rv32_upper_bits_csrs
rv32_high_access
menvcfg_menvcfgh_no_u_mode
Zicsr_nonexistent_rsv
Zicsr_high_half_rv64_rsv

csrc -1

cp_illegal_instruction

Illegal Uncompressed Instructions

Exhaustively test reserved and illegal 32-bit instruction encodings across all major opcodes and sub-fields: reserved opcodes (op7/15/21/23/26/29/31), reserved funct3 in LOAD/STORE/BRANCH/JALR, reserved funct7 in R-type/FP, reserved immediate fields (IWshift imm[5]=1, aes64ks1i rnum), reserved FP fmt/rs2 combos, reserved SYSTEM encodings, reserved FENCE fm/rs1/rd fields, and reserved vector vset encodings.

Each reserved encoding raises an illegal-instruction exception. Legal encodings of unimplemented extensions may also trap.

One bin per distinct template×exhaustive-bit combination from illegalinstrtests.py. Templates use R=random, E=exhaustive, 0/1=fixed bits.

cp_illegal_compressed_instruction

Illegal Compressed Instructions

Exhaustively test all 2^14 encodings in each 16-bit quadrant (quadrant 00 = bits[1:0]=00, quadrant 01, quadrant 10), covering reserved encodings in Zca/Zcb/Zcd/Zcf/Zcmt/Zcmp.

Each reserved compressed encoding raises illegal-instruction. Legal encodings succeed or cause addressable exceptions for memory ops.

~16384 per quadrant minus excluded branches/jumps/memory ops tested separately.
Final sanity-check instructions for excluded memory encodings: c.fld, c.fsd, c.lw, c.sw, c.lbu, c.lhu, c.lh, c.sb, c.sh, c.lwsp, c.swsp, c.fldsp, c.fsdsp, c.jalr-rs1=0 (illegal), c.jr-rs1=0 (illegal).

cp_upperreg

Instructions using x16-x31

For each register x16–x31 as rd, rs1, or rs2, execute: ADD rd,rs1,rs2 / ADDI rd,rs1,0 / ADDI rd,rs1,-1 / MUL rd,rs1,rs2 (integer). Also: FADD.S fd,fs1,fs2 / FMV.X.W rd,fs1 / FMV.W.X fd,rs1 (float). Sweeps all 16 upper register positions in each operand slot.

If RV32E/RV64E is active (misa.E=1): all x16-x31 accesses raise illegal-instruction. If standard I base: all succeed. F registers f0-f31 always succeed if F supported.

16 bins × {rd, rs1, rs2} × {add, addi×2, mul} = 192 integer bins
16 bins × {rd, rs1, rs2} × {fadd.s, fmv.x.w, fmv.w.x} = 144 float bins

diff_rv32e_rv32i

All f registers should succeed if F is supported. x16-31 should trap if E base extension is used.

cp_misa_ext_disable

Extension bits

For each MUTABLE_MISA_* parameter (A, B, C, D, F, H, I, M, Q, V, S, U): disable the misa bit, execute a representative instruction from that extension, then re-enable.
A: amoadd.w / B: sb.set+sh3add+clmul+bext / C: c.addi / D: fadd.d / F: fadd.s / H: hfence.vvma / I: addi x16,x16,0 / M: mul / Q: fadd.q / V: vadd.vv / S: enter S-mode / U: enter U-mode

Each instruction raises illegal-instruction with the misa bit cleared. Zbc is NOT controlled by B bit (clmul should still work when B=0). Entering S/U mode with S/U bit cleared should trap.

One bin per {extension × instruction-sample}
B-extension sub-bins: Zba (sh3add), Zbb (andn), Zbc (clmul — no trap), Zbs (bext)

Should throw illegal instruction. For B, run instruction from each of Zba, Zbb, Zbc, Zbs (Zbc should be unaffected). For I, run an instruction that uses x16-x31.

cp_amocas_odd

Zacas instructions with odd register IDs

For each of AMOCAS.W, AMOCAS.D, AMOCAS.Q: attempt odd rd and odd rs2 register IDs (register pairs must be even-aligned). AMOCAS.D odd regs trap on RV32; AMOCAS.Q odd regs trap on both RV32/RV64.

AMOCAS.D/Q with odd rd or rs2 raises illegal-instruction exception.

Odd rd bins × {.w, .d, .q} + Odd rs2 bins × {.w, .d, .q}

d should trap for RV32 and q for both

cp_reserved_frm

Reserved FP rounding modes

Execute a floating-point instruction (FADD.S) with each rounding mode 0–7 written explicitly to FRM. Rounding modes 5 and 6 are reserved; mode 7 (DYN) with FRM=5/6/7 should raise invalid-operation exception (NV flag set).

FRM=0-4: legal, no exception. FRM=5,6: reserved — DUT may raise illegal-instruction or invalid FP exception. FRM=7 with dynamic FRM=5/6/7: raises invalid FP exception.

8 bins: FRM ∈ {0,1,2,3,4,5,6,7} with FADD.S using rounding mode 7 (DYN)

* add vector Ssstrict instruction tests for all SEW to SsstrictV

Table 230. SsstrictSm Normative Rules
Normative Rule Rule Text Coverpoints

medelegh_omit_xlen64

The medelegh register does not exist when XLEN=64.

SsstrictSm_mcsr_cg/{cp_csrr, cp_csrw_edges, cp_csrcs}/medelegh

menvcfgh_sz_acc_op

When XLEN=32, menvcfgh is a 32-bit read/write register that aliases bits 63:32 of menvcfg. The menvcfgh register does not exist when XLEN=64.

SsstrictSm_mcsr_cg/{cp_csrr, cp_csrw_edges, cp_csrcs}/menvcfgh

mseccfgh_presence

Register mseccfgh exists when XLEN=32 and mseccfg is implemented; it does not exist when XLEN=64.

SsstrictSm_mcsr_cg/{cp_csrr, cp_csrw_edges, cp_csrcs}/mseccfgh

mstatush_sz_acc

For RV32 only, mstatush is a 32-bit read/write register formatted as shown in mstatushreg.

SsstrictSm_mcsr_cg/{cp_csrr, cp_csrw_edges, cp_csrcs}/mstatush

stateen_rv32_upper_bits_csrs

For RV32, there are CSR addresses for accessing the upper 32 bits of corresponding machine-level and hypervisor CSRs: mstateen0h, mstateen1h, mstateen2h, mstateen3h, hstateen0h, hstateen1h, hstateen2h, and hstateen3h.

SsstrictSm_mcsr_cg/{cp_csrr, cp_csrw_edges, cp_csrcs}/{mstateen0h, mstateen1h, mstateen2h, mstateen3h}

rv32_high_access

In RV32 only, accesses to the mcyclecfg and minstretcfg CSRs access the low 32 bits, while accesses to the mcyclecfgh and minstretcfgh CSRs access the high 32 bits of mcyclecfg and minstretcfg, respectively.

SsstrictSm_mcsr_cg/{cp_csrr, cp_csrw_edges, cp_csrcs}/{mcyclecfgh, minstretcfgh}

menvcfg_menvcfgh_no_u_mode

If U-mode is not supported, then registers menvcfg and menvcfgh do not exist.

SsstrictSm_mcsr_cg/{cp_csrr, cp_csrw_edges, cp_csrcs}/{menvcfg, menvcfgh}

UDB Parameters: None.

B.6.2. SsstrictS

Attempt to issue all flavors of 32-bit instructions in the standard and reserved spaces and all 16-bit compressed instructions. Also attempt to access all CSRs in the standard and reserved spaces that should be inaccessible. Expect illegal instruction trap for unimplemented instructions and CSRs, matching reference model.

According to the RVA23 profile spec, the illegal instruction should be cause a trap to the supervisor trap handler. However, delegation is the business of the firmware, not the hardware. These tests only check that a trap occurs and matches the reference model.

The following CSR accesses and instructions should be exercised in supervisor mode. All inherently require Zicsr.

Table 231. SsstrictS Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule Notes

cp_csrr

CSR Accesses

Read all 4096 CSRs from S-mode (CSRR with rd≠x0). Skips: satp (0x180, would enable virtual memory), custom S/H CSRs (0x5C0-0x5FF, 0x6C0-0x6FF, 0x9C0-0x9FF, 0xAC0-0xAFF, 0xDC0-0xDFF, 0xEC0-0xEFF).

S-mode CSRs return values; M-mode/H-mode/debug CSRs raise illegal-instruction from S-mode.

One bin per CSR 0x000–0xFFF (excluding skips), executed from S-mode

Ssstrict_unimplemented_opcodes_csr_exception
hedelegh_sz_acc_op
henvcfgh_sz_acc_op
htimedeltah_sz_acc_op
stateen_rv32_upper_bits_csrs
vstimecmp_acc
stimecmp_stimecmph_sz_acc

Switch to S-mode (ecall with a0=1) before CSR sweep.
Fast trap handler must be installed from M-mode first.
Excludes satp to avoid activating virtual memory.

cp_csrw_corners

CSR Accesses

Write all-zeros and all-ones to every CSR from S-mode. Skips satp and same custom CSRs as cp_csrr.

S-mode writable CSRs accept writes; read-only or higher-privilege CSRs trap.

Two bins per CSR: write 0 and write all-ones

Same as SsstrictSm but with mode switch to S-mode first.

cp_csrcs

CSR Accesses

Set and clear all bits of every CSR from S-mode using CSRRS/CSRRC with rs1=all-ones.

Same as cp_csrw_corners.

Two bins per CSR: CSRRS all-ones and CSRRC all-ones from S-mode

Ssstrict_unimplemented_opcodes_csr_exception
hedelegh_sz_acc_op
henvcfgh_sz_acc_op
htimedeltah_sz_acc_op
stateen_rv32_upper_bits_csrs
vstimecmp_acc
stimecmp_stimecmph_sz_acc

CSRRS/CSRRC with x=−1 from S-mode.

cp_shadow_m

Shadow CSR verification (M-mode write)

Write all-ones and all-zeros to mstatus, mie, mip from M-mode, verifying the S-mode shadow registers (sstatus, sie, sip) reflect the correct subset of bits. Also write all-ones/zeros to sstatus, sie, sip from S-mode and verify the M-mode shadows reflect the changes.

mstatus↔sstatus, mie↔sie, mip↔sip are consistent: bits shared between the views have the same value; sstatus-only bits do not appear in mstatus and vice versa.

6 bins: {mstatus, mie, mip} × {write 0, write 1s} from M-mode
6 bins: {sstatus, sie, sip} × {write 0, write 1s} from S-mode

From M-mode: csrrw x0, mstatus, x2 (x2=-1) then csrrw x0, mstatus, x0.
Implemented as inline code after S-mode CSR sweep.

cp_illegal_instruction

Illegal Uncompressed Instructions

Same encoding sweep as SsstrictSm but executed from S-mode. All reserved/illegal encodings must trap; M-mode-only instructions (MRET, debug CSR access) also trap from S-mode.

Identical to M-mode case — illegal-instruction exception per reserved encoding.

Same as SsstrictSm cp_illegal_instruction but with S-mode priv_mode context

Switch to S-mode before #include of SsstrictInstr-Tests.h.
mstatus.FS/VS must be enabled from M-mode before switching.

cp_illegal_compressed_instruction

Illegal Compressed Instructions

Same compressed quadrant sweep (00/01/10) as SsstrictSm but from S-mode.

Same as SsstrictSm — each reserved encoding traps.

Same as SsstrictSm cp_illegal_compressed_instruction but S-mode context

Switch to S-mode before #include of SsstrictInstrCompressed-Tests.h.

cp_upperreg

Instructions using x16-x31 from S-mode

Same upper-register sweep as SsstrictSm but executed in S-mode. Tests that E-extension illegal-instruction behavior is consistent across privilege modes.

If RV32E/RV64E: trap on x16-x31 access. If standard I: succeed. F regs always succeed.

Same bins as SsstrictSm cp_upperreg, S-mode context

diff_rv32e_rv32i

Switch to S-mode first. Raw .word encodings for upper register positions.

cp_misa_ext_disable

Extension bits

Same extension disable sweep as SsstrictSm but: disable misa bit from M-mode, switch to S-mode, execute instruction, switch back, re-enable. Extensions: A, B, C, D, F, H, I, M, Q, U, V (S-mode cannot disable S itself). U-mode entry with U=0 should trap.

Each instruction executed in S-mode with misa bit cleared raises illegal-instruction. Entering U-mode with misa.U=0 should fail.

One bin per extension per {M-mode-disable → S-mode-execute}

M-mode: clear misa bit / ecall to S-mode / execute instruction / ecall back to M-mode / restore misa.
U-mode entry: ecall(0) with misa.U=0 should trap.

cp_reserved_frm

Reserved FP rounding modes from S-mode

Same as SsstrictSm cp_reserved_frm but executed from S-mode. Verify reserved FRM behavior is consistent across privilege levels.

Same as SsstrictSm — FRM 5/6 reserved, mode 7 with DYN FRM=5/6/7 raises FP exception.

8 bins: FRM ∈ {0..7} with FADD.S in S-mode

Switch to S-mode, then csrwi frm,N / fadd.s f0,f1,f2 for N=0..7.

Note that satp is already tested in VM, so it is safe to exclude here

Table 232. SsstrictS Normative Rules
Normative Rule Rule Text Coverpoints

Ssstrict_no_nonconforming_extensions

If the Ssstrict extension is implemented, then no non-conforming extensions are present.

SsstrictS_instr_cg/{cp_illegal, cp_reserved}, SsstrictS_comp_instr_cg/{cp_compressed00, cp_compressed01}

Ssstrict_unimplemented_opcodes_csr_exception

Furthermore, attempts to execute unimplemented opcodes or access unimplemented CSRs in the standard or reserved encoding spaces raises an illegal instruction exception that results in a contained trap to the supervisor-mode trap handler.

SsstrictS_scsr_cg/cp_csrr, SsstrictS_scsr_cg/cp_csrw_edges, SsstrictS_scsr_cg/cp_csrcs, SsstrictS_instr_cg/cp_illegal

slliw_srliw_sraiw_imm5_rsv

SLLIW, SRLIW, and SRAIW encodings with imm[5]≠0 are reserved.

SsstrictS_instr_cg/cp_IWshift

c-addi16sp_rsv

C.ADDI16SP is valid only when nzimm≠0; the code point with nzimm=0 is reserved.

SsstrictS_comp_instr_cg/cp_compressed01

c-addi4spn_rsv

C.ADDI4SPN is valid only when nzuimm≠0; the code points with nzuimm=0 are reserved.

SsstrictS_comp_instr_cg/cp_compressed00

c-addiw_rsv

C.ADDIW is valid only when rd≠x0; the code points with rd=x0 are reserved.

SsstrictS_comp_instr_cg/cp_compressed01

c-jr_rsv

C.JR is valid only when rs1≠x0; the code point with rs1=x0 is reserved.

SsstrictS_comp_instr_cg/cp_compressed10

c-ldsp_rsv

C.LDSP is valid only when rd≠x0; the code points with rd=x0 are reserved.

SsstrictS_comp_instr_cg/cp_compressed10

c-lui_rsv

C.LUI is valid only when rd≠x2, and when the immediate is not equal to zero. The code points with imm=0 are reserved. The code points with rd=x2 and imm≠0 correspond to the C.ADDI16SP instruction.

SsstrictS_comp_instr_cg/cp_compressed01

c-lwsp_rsv

C.LWSP is valid only when rd≠x0; the code points with rd=x0 are reserved.

SsstrictS_comp_instr_cg/cp_compressed10

Zilsd_c-ldsp_x0

For C.LDSP, usage of x0 as the destination is reserved.

SsstrictS_comp_instr_cg/cp_compressed10

roundingmode_rsv

The behavior of floating-point instructions that depend on rounding mode when executed with a reserved rounding mode is reserved, including both static reserved rounding modes (101&#8205;&#8211;&#8205;110) and dynamic reserved rounding modes (101&#8205;&#8211;&#8205;111).

SsstrictS_instr_cg/cp_Ftype, SsstrictS_instr_cg/cp_reserved

roundingmode_unaffected_rm_decode

Some instructions, including widening conversions, have the rm field but are nevertheless mathematically unaffected by the rounding mode; software should set their rm field to RNE (000) but implementations must treat the rm field as usual (in particular, with regard to decoding legal vs. reserved encodings).

TODO: sweep reserved rm values (101, 110, and 111 with reserved frm) on widening conversions such as fcvt.d.s, fcvt.s.h, and fcvt.d.w

fcvtmod-w-d_enc

It is encoded like FCVT.W.D, but with the rs2 field set to 8 and the rm field set to 1 (RTZ). Other rm values are reserved.

SsstrictS_instr_cg/cp_cvtmodwdfrm

Zdinx_x_reg_pair

For RV32, double-precision operands in Zdinx are held in aligned x-register pairs. In other words, register numbers must be even. Use of misaligned (odd-numbered) registers for double-width floating-point operands is reserved.

TODO

bclri_shamt_rsv_rv32

For RV32, the encodings corresponding to shamt[5]=1 are reserved.

SsstrictS_instr_cg/cp_Itype

bexti_shamt_rsv_rv32

For RV32, the encodings corresponding to shamt[5]=1 are reserved.

SsstrictS_instr_cg/cp_Itype

binvi_shamt_rsv_rv32

For RV32, the encodings corresponding to shamt[5]=1 are reserved.

SsstrictS_instr_cg/cp_Itype

bseti_shamt_rsv_rv32

For RV32, the encodings corresponding to shamt[5]=1 are reserved.

SsstrictS_instr_cg/cp_Itype

Zacas_rv32_amocas-d_frst_pair_entry_reg_even

The instruction requires the first register in the pair to be even numbered; encodings with odd numbered registers specified in rs2 and rd are reserved.

SsstrictS_instr_cg/cp_amocas_odd

Zacas_rv64_amocas-q_frst_pair_entry_reg_even

The instruction requires the first register in the pair to be even numbered; encodings with odd numbered registers specified in rs2 and rd are reserved.

SsstrictS_instr_cg/cp_amocas_odd

ldaq_no_aq_reserved

The versions without the aq bit set are RESERVED.

TODO

sdrl_no_rl_reserved

The versions without the rl bit set are RESERVED.

TODO

diff_rv32e_rv32i

RV32E and RV64E use the same instruction-set encoding as RV32I and RV64I respectively, except that only registers x0‍–‍x15 are provided. All encodings specifying the other registers x16‍–‍x31 are reserved.

SsstrictS_instr_cg/cp_upperreg_rs1, SsstrictS_instr_cg/cp_upperreg_rs2, SsstrictS_instr_cg/cp_upperreg_rd, SsstrictS_instr_cg/cp_upperreg_imm_rd

hedelegh_sz_acc_op

When XLEN=32, hedelegh is a 32-bit read/write register that aliases bits 63:32 of hedeleg. Register hedelegh does not exist when XLEN=64.

SsstrictS_scsr_cg/{cp_csrr, cp_csrw_edges, cp_csrcs}/hedelegh

henvcfgh_sz_acc_op

When XLEN=32, henvcfgh is a 32-bit read/write register that aliases bits 63:32 of henvcfg. Register henvcfgh does not exist when XLEN=64.

SsstrictS_scsr_cg/{cp_csrr, cp_csrw_edges, cp_csrcs}/henvcfgh

htimedeltah_sz_acc_op

When XLEN=32, htimedeltah is a 32-bit read/write register that aliases bits 63:32 of htimedelta. Register htimedeltah does not exist when XLEN=64.

SsstrictS_scsr_cg/{cp_csrr, cp_csrw_edges, cp_csrcs}/htimedeltah

stateen_rv32_upper_bits_csrs

For RV32, there are CSR addresses for accessing the upper 32 bits of corresponding machine-level and hypervisor CSRs: mstateen0h, mstateen1h, mstateen2h, mstateen3h, hstateen0h, hstateen1h, hstateen2h, and hstateen3h.

SsstrictS_scsr_cg/{cp_csrr, cp_csrw_edges, cp_csrcs}/{hstateen0h, hstateen1h, hstateen2h, hstateen3h}

vstimecmp_acc

In RV32 only, accesses to the vstimecmp CSR access the low 32 bits, while accesses to the vstimecmph CSR access the high 32 bits of vstimecmp.

SsstrictS_scsr_cg/{cp_csrr, cp_csrw_edges, cp_csrcs}/vstimecmph

stimecmp_stimecmph_sz_acc

The stimecmp CSR is a 64-bit register and has 64-bit precision on all RV32 and RV64 systems. In RV32 only, accesses to the stimecmp CSR access the low 32 bits, while accesses to the stimecmph CSR access the high 32 bits of stimecmp.

SsstrictS_scsr_cg/{cp_csrr, cp_csrw_edges, cp_csrcs}/stimecmph

UDB Parameters: None.

B.6.3. SsstrictU

Same as SsstrictS, but runs from user mode and includes attempts to access supervisor CSRs that should be inaccessible from user mode.

The following CSR accesses and instructions should be exercised in user mode. All inherently require Zicsr.

Table 233. SsstrictU Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule

cp_csrr

CSR Accesses

Read all 4096 CSRs from U-mode (CSRR with rd≠x0). Skips user-custom CSRs only (0x800-0x8FF, 0xCC0-0xCFF). All non-user CSRs should raise illegal-instruction from U-mode.

User-level CSRs (cycle, time, instret, hpmcounters, fflags, frm, fcsr, vtype etc.) succeed if enabled; all others trap.

One bin per CSR 0x000–0xFFF (excluding user-custom ranges), executed from U-mode

Zicsr_nonexistent_rsv

cp_csrw_corners

CSR Accesses

Write all-zeros and all-ones to every CSR from U-mode. Skips user-custom CSRs. Writable user-level CSRs: fflags, frm, fcsr. All others trap.

Only fflags/frm/fcsr accept writes from U-mode; all other writes raise illegal-instruction.

Two bins per CSR: write 0 and write all-ones from U-mode

cp_csrcs

CSR Accesses

CSRRS/CSRRC with rs1=all-ones for every CSR from U-mode.

Same as cp_csrw_corners — only fp CSRs succeed, all others trap.

Two bins per CSR: CSRRS and CSRRC all-ones from U-mode

cp_illegal_instruction

Illegal Uncompressed Instructions

Same encoding sweep as SsstrictSm/S but from U-mode. S-mode and M-mode instructions (SRET, MRET, CSR M/S access) also trap from U-mode.

All reserved encodings and privilege-elevated instructions raise illegal-instruction from U-mode.

Same as SsstrictSm cp_illegal_instruction, U-mode priv_mode context

cp_illegal_compressed_instruction

Illegal Compressed Instructions

Same compressed quadrant sweep as SsstrictSm/S but from U-mode.

All reserved encodings trap from U-mode.

Same as SsstrictSm cp_illegal_compressed_instruction, U-mode context

cp_upperreg

Instructions using x16-x31 from U-mode

Same upper-register sweep as SsstrictSm but executed in U-mode.

If RV32E/RV64E: trap on x16-x31 use. Standard I: succeed. F regs succeed if F supported.

Same bins as SsstrictSm cp_upperreg, U-mode context

cp_misa_ext_disable

Extension bits

Same extension disable sweep as SsstrictSm but: disable misa bit from M-mode, switch to U-mode, execute instruction, switch back, re-enable. Extensions: A, B, C, D, F, H, I, M, Q, V.

Each instruction executed in U-mode with misa bit cleared raises illegal-instruction.

One bin per extension per {M-mode-disable → U-mode-execute}

cp_reserved_frm

Reserved FP rounding modes from U-mode

Same as SsstrictSm cp_reserved_frm but from U-mode. Requires F extension with mstatus.FS≠Off (FP enabled by M-mode before switching).

Same FRM reserved-mode behavior as M/S modes.

8 bins: FRM ∈ {0..7} with FADD.S in U-mode

B.7. PMP

B.7.1. PMPSm

General Test Environment (PMPSm): - Runs when Sm is implemented and NUM_PMP_ENTRIES > 0. Boots to M-mode; every access on this sheet is made from M-mode. - Test files are split by UDB parameter: base, RV64 only (MXLEN = 64), PMP_NA4_SUPPORTED, PMP_NAPOT_SUPPORTED and PMP_TOR_SUPPORTED. The NA4 and TOR coverpoints are compiled out when the mode is not supported; the NAPOT ones are not. - Background entry: the highest usable entry (15 of 16, 63 of 64) is L=1, XWR=111, NAPOT over all of memory (TOR up to all ones when NAPOT is not supported), so accesses that match no lower entry succeed. cp_none_* runs before it is set. - Grain g = 2^(G+2) bytes from PMP_GRANULARITY. A standard region is a NAPOT region of max(g, 8) bytes in .data, g-aligned past the code. A TOR region is one grain. - Fetch probe = jalr into the region, which holds a return instruction. Loads = lb, lbu, lh, lhu, lw (+ lwu, ld on RV64). Stores = sb, sh, sw (+ sd on RV64). - Legal XWR = {000, 001, 011, 100, 101, 111}. R=0 with W=1 is reserved and never written. - After every PMP CSR write the tests execute sfence.vma when S-mode is implemented. - Coverpoints compare addresses and pmpaddr values on their low bits (PMP_ADDR_LOWMASK), so bins match wherever .data lands. - Entries 0-14 are the entries below the background entry of a 16-entry PMP; with 64 entries, cp_pmp64_* covers entries 15-62.

Table 234. PMPSm Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule

Permission bits, locked entry

cp_cfg_X

Verify that X alone controls execute permission when the entry is locked (L=1).

PMP_NAPOT_SUPPORTED only. One standard NAPOT region. Walk the six legal XWR values with L=1, each in its own entry (XWR=000 in entry 5 down to XWR=111 in entry 0), so the newest entry is the highest-priority match. jalr to the start of the region.

Instruction access fault (mcause = 1) when X=0. The fetch completes when X=1.

6 XWR × jalr = 6

pmp_access_fault_exception
pmp_cfg_permissions
pmp_exec_fault
pmp_rwx_check
pmp_mmode_locking
pmp_l_bit_m_mode_enforcement

cp_cfg_R

Verify that R controls every load width when the entry is locked.

Same walk as cp_cfg_X. Every load (lb, lbu, lh, lhu, lw (+ lwu, ld on RV64)) at the start of the region.

Load access fault (mcause = 5) when R=0.

6 XWR × 5 loads = 30 (42 on RV64)

pmp_access_fault_exception
pmp_cfg_permissions
pmp_rwx_check
pmp_mmode_locking
pmp_load_fault
pmp_l_bit_m_mode_enforcement

cp_cfg_W

Verify that W controls every store width when the entry is locked.

Same walk as cp_cfg_X. Every store (sb, sh, sw (+ sd on RV64)) at the start of the region.

Store/AMO access fault (mcause = 7) when W=0.

6 XWR × 3 stores = 18 (24 on RV64)

pmp_access_fault_exception
pmp_cfg_permissions
pmp_rwx_check
pmp_mmode_locking
pmp_store_fault
pmp_l_bit_m_mode_enforcement

Permission bits in every entry

cp_cfg_X0_all
cp_cfg_X1_all

Verify that X is enforced by each of entries 0-14.

Entries 0-14 all cover the same standard NAPOT region. Program L=1 and a rolling legal XWR into entries 14 down to 0, one entry at a time (four test files), and jalr to the region after each write. The newest entry is the lowest-numbered match.

X=0: instruction access fault. X=1: the fetch completes.

15 entries each

pmp_l_bit_m_mode_enforcement
pmp_exec_fault
pmp_cfg_permissions
pmp_rwx_check
pmp_entry_priority
pmp_access_fault_exception

cp_cfg_Rw00_all
cp_cfg_Rw10_all
cp_cfg_Rw11_all

Verify that R is enforced by each of entries 0-14.

Same walk as cp_cfg_X0_all. Every load (lb, lbu, lh, lhu, lw (+ lwu, ld on RV64)) after each write. The suffix gives R then W: Rw00 = R0 W0, Rw10 = R1 W0, Rw11 = R1 W1.

Load access fault when R=0.

3 RW values × 15 entries × 5 loads (7 on RV64)

pmp_load_fault
pmp_cfg_permissions
pmp_rwx_check
pmp_l_bit_m_mode_enforcement
pmp_entry_priority

cp_cfg_rW00_all
cp_cfg_rW10_all
cp_cfg_rW11_all

Verify that W is enforced by each of entries 0-14.

Same walk as cp_cfg_X0_all. Every store (sb, sh, sw (+ sd on RV64)) after each write. The suffix gives R then W, as for cp_cfg_Rw*_all.

Store/AMO access fault when W=0.

3 RW values × 15 entries × 3 stores (4 on RV64)

pmp_store_fault
pmp_cfg_permissions
pmp_rwx_check
pmp_l_bit_m_mode_enforcement
pmp_entry_priority

L bit

cp_cfg_L_access_exec
cp_cfg_L_access_read
cp_cfg_L_access_write

Verify that an unlocked entry (L=0) never restricts an M-mode access.

For each of entries 0-14: L=0, A=NAPOT, XWR=000 over a standard region. jalr, lw and sw in the region.

All accesses succeed.

15 entries each

pmp_l_bit_m_mode_enforcement
pmp_rwx_check

cp_cfg_L_modify

Verify that a locked entry ignores writes to its pmpcfg and pmpaddr, and that a locked TOR entry also protects the preceding pmpaddr.

Entry 1: L={0,1}, A={OFF, TOR, NAPOT}, XWR=111, pmpaddr1 = 0x100. Clear pmpaddr1, clear pmpcfg0 (zeroing pmp1cfg), set pmp0cfg.XWR=111 through pmpcfg0, and write all ones to pmpaddr0; read each back. NA4 is not used because it is not selectable when G ≥ 1.

L=1: pmp1cfg and pmpaddr1 keep their values; pmpaddr0 keeps its value only when entry 1 is TOR; pmp0cfg is always writable. L=0: every write takes effect.

2 L × 3 A × 4 CSR writes = 24 (16 without TOR)

pmp_l_bit_function
pmp_mmode_locking
pmp_l_bit_write_protection
pmp_locked_until_reset

Address-matching mode (A field)

cp_cfg_A_all_even
cp_cfg_A_all_odd

Verify that every pmpcfg byte accepts each address-matching mode.

With L=0 and XWR=000, write A = OFF, TOR, NA4 and NAPOT into every byte of every pmpcfg CSR and read each back. cp_cfg_A_all_odd covers the odd pmpcfg CSRs (RV32 only).

Readback matches the reference model. A supported mode reads back as written. NA4 when G ≥ 1, or a mode the hart does not support, reads back as a legal value of the WARL field.

4 A (fewer without TOR or NA4) × even pmpcfg CSRs (2, or 8 with 64 entries); odd: 4 A × odd pmpcfg CSRs (RV32)

pmp_na4_select_restriction
pmp_a_field_encoding
pmp_csrs_warl_access
pmp_cfg_rv32_layout
pmp_cfg_rv64_layout

cp_cfg_A_OFF_all_read
cp_cfg_A_OFF_all_write
cp_cfg_A_OFF_all_exec

Verify that A=OFF disables each of entries 0-14.

For each entry: L=1, A=OFF, XWR=000, pmpaddr = a standard region. lw, sw and jalr in the region.

All accesses succeed: the OFF entry matches nothing and the background entry grants access.

15 entries each

pmp_a_field_encoding
pmp_a_field_off

cp_cfg_A_napot_all

Verify that A=NAPOT matches exactly its region, in each of entries 0-14.

PMP_NAPOT_SUPPORTED only. For each entry: L=1, A=NAPOT, XWR=000 over a standard region. lw 4 bytes below the region, at its base, and just past its top.

Load access fault at the base only. The two accesses outside the region succeed.

15 entries × 3 addresses = 45

pmp_access_fault_exception
pmp_a_field_encoding
pmp_napot_encoding_low_bits
pmp_a_field_napot_na4
pmp_load_fault

cp_cfg_A_napot_x
cp_cfg_A_napot_r
cp_cfg_A_napot_w

Verify that XWR is enforced across a locked NAPOT region and not outside it.

PMP_NAPOT_SUPPORTED only. Same walk as cp_cfg_X. jalr, lw and sw at base-4, base, base+4, the highest word, and just past the top.

Inside the region: access fault when the permission is clear. Outside: the access succeeds.

6 XWR × 5 addresses = 30 each

pmp_exec_fault
pmp_napot_encoding_low_bits
pmp_a_field_napot_na4
pmp_addr_encoding
pmp_rwx_check
pmp_load_fault
pmp_store_fault

cp_cfg_A_NA4_all

Verify that A=NA4 matches exactly four bytes, in each of entries 0-14.

PMP_NA4_SUPPORTED only (G = 0). For each entry: L=1, A=NA4, XWR=000. lw at region-4, region and region+4.

Load access fault at the region only.

15 entries × 3 addresses = 45

pmp_a_field_napot_na4
pmp_granularity
pmp_a_field_encoding
pmp_load_fault

cp_cfg_A_na4_x
cp_cfg_A_na4_r
cp_cfg_A_na4_w

Verify that XWR is enforced on a locked NA4 region and not on its neighbors.

PMP_NA4_SUPPORTED only. One NA4 region, six legal XWR with L=1. jalr, lw and sw at region-4, region and region+4.

Access fault at the region when the permission is clear. The neighbors succeed.

6 XWR × 3 addresses = 18 each

pmp_a_field_napot_na4
pmp_rwx_check
pmp_exec_fault
pmp_load_fault
pmp_store_fault

cp_cfg_A_tor_all0
cp_cfg_A_tor_all1
cp_cfg_A_tor_all2
cp_cfg_A_tor_all3
cp_cfg_A_tor_all4
cp_cfg_A_tor_all5
cp_cfg_A_tor_all6
cp_cfg_A_tor_all7
cp_cfg_A_tor_all8
cp_cfg_A_tor_all9
cp_cfg_A_tor_all10
cp_cfg_A_tor_all11
cp_cfg_A_tor_all12
cp_cfg_A_tor_all13
cp_cfg_A_tor_all14

Verify that A=TOR works in each of entries 0-14, with each region’s bottom taken from the preceding pmpaddr.

PMP_TOR_SUPPORTED only. Program pmpaddr0-14 so that TOR region i spans i+1 grains; region 0 runs from address 0 to pmpaddr0 and holds the code. All L=1, A=TOR; XWR=111 in entry 0, 001 in odd entries and 000 in even entries. lw in the last word of region 0 and at the start of every other region.

Region 0 and the odd regions: the load succeeds. Even regions 2-14: load access fault.

15 coverpoints × 1 bin

pmp_cfg_rv32_layout
pmp_cfg_rv64_layout
pmp_a_field_tor
pmp_entry_structure
pmp_load_fault

cp_cfg_A_tor_x
cp_cfg_A_tor_r
cp_cfg_A_tor_w

Verify that XWR is enforced across a locked TOR region and not outside it.

PMP_TOR_SUPPORTED only. One TOR region of one grain [bottom, top) from a pair of entries (the odd entry is TOR, the even one below it holds the bottom). Six legal XWR with L=1. jalr, lw and sw at bottom-4, bottom, bottom+4, top-4 and top.

Inside the region: access fault when the permission is clear. bottom-4 and top: the access succeeds.

6 XWR × 5 addresses = 30 each

pmp_exec_fault
pmp_a_field_encoding
pmp_a_field_tor
pmp_addr_encoding
pmp_rwx_check
pmp_load_fault
pmp_store_fault

cp_cfg_A_tor0_r
cp_cfg_A_tor0_w
cp_cfg_A_tor0_x

Verify that TOR entry 0 uses 0 as its bottom bound.

PMP_TOR_SUPPORTED only. Entry 0: L=1, A=TOR, XWR=111, pmpaddr0 = start of the test region, so region 0 is [0, pmpaddr0) and contains the code. lw, sw and jalr at pmpaddr0-4 and pmpaddr0.

All accesses succeed: pmpaddr0-4 matches entry 0, and pmpaddr0 falls through to the background entry.

2 addresses each

pmp_a_field_tor

cp_cfg_A_tor_bot_L0_x
cp_cfg_A_tor_bot_L0_w
cp_cfg_A_tor_bot_L0_r
cp_cfg_A_tor_bot_L1_x
cp_cfg_A_tor_bot_L1_w
cp_cfg_A_tor_bot_L1_r

Verify that TOR entry i spans [pmpaddr(i-1), pmpaddr(i)) whatever pmpcfg(i-1) holds.

PMP_TOR_SUPPORTED only. Entry 1: L=1, A=TOR, XWR=101. Entry 0: A=OFF, XWR=000, with L=0 (L0 coverpoints) and then L=1 (L1 coverpoints). pmpaddr1 = pmpaddr0 + g. jalr, sw and lw at pmpaddr0-4, pmpaddr0, pmpaddr1-4 and pmpaddr1.

In the region: jalr and lw succeed, sw raises a store/AMO access fault. Outside: all succeed. Entry 0’s L bit does not change the result.

4 addresses each

pmp_a_field_tor
pmp_entry_structure
pmp_store_fault
pmp_rwx_check

cp_cfg_A_tor_nonoverlap1_x
cp_cfg_A_tor_nonoverlap1_w
cp_cfg_A_tor_nonoverlap1_r
cp_cfg_A_tor_nonoverlap2_x
cp_cfg_A_tor_nonoverlap2_w
cp_cfg_A_tor_nonoverlap2_r
cp_cfg_A_tor_nonoverlap3_x
cp_cfg_A_tor_nonoverlap3_w
cp_cfg_A_tor_nonoverlap3_r

Verify that a TOR entry matches nothing when pmpaddr(i-1) ≥ pmpaddr(i).

PMP_TOR_SUPPORTED only. Entry 1: L=1, A=TOR, XWR=000, pmpaddr1 = R. Entry 0: A=OFF, L=0. pmpaddr0 = R (nonoverlap1), R + g (nonoverlap2), all ones (nonoverlap3). jalr, sw and lw at R-4, R and R+4.

All accesses succeed.

3 addresses each

pmp_a_field_tor

Priority and matching

cp_priority_lw
cp_priority_sw
cp_priority_jalr

Verify that the lowest-numbered matching entry decides the access.

PMP_NAPOT_SUPPORTED only. Entries 0-6: L=1, A=NAPOT, seven nested regions with a common base; entry i covers g·2^i bytes. XWR = 000, 101, 011, 100, 001, 111, 000 for entries 0-6. lw, sw and jalr at the last word of each region, which lies in entries i..6 only.

Each access follows entry i’s XWR: access fault when its permission is clear.

7 regions each

pmp_entry_priority
pmp_napot_encoding_low_bits
pmp_rwx_check
pmp_access_fault_exception

cp_priority_off_lw
cp_priority_off_sw
cp_priority_off_jalr

Verify that OFF entries are skipped and the first matching entry decides.

PMP_NAPOT_SUPPORTED only. Entries 0-3, all L=1: entry 0 OFF XWR=000, entry 1 NAPOT XWR=101, entry 2 OFF XWR=000, entry 3 NAPOT XWR=111. pmpaddr0 and pmpaddr2 hold the probed address; entries 1 and 3 cover it. lw, sw and jalr at that address.

jalr and lw succeed; sw raises a store/AMO access fault (entry 1 decides).

1 each

pmp_a_field_off
pmp_entry_priority
pmp_store_fault

cp_none_lw
cp_none_sw
cp_none_jalr

Verify that an M-mode access that matches no entry succeeds.

Before the background entry is set: every pmpcfg.A = OFF and pmpaddr0-15 = 0. lw, sw and jalr.

All accesses succeed.

1 each

pmp_no_entry_match
pmp_a_field_off

Grain

cp_grain_OFF_to_OFF
cp_grain_OFF_to_NAPOT
cp_grain_NAPOT_to_OFF
cp_grain_NAPOT_to_NAPOT
cp_grain_OFF_to_TOR
cp_grain_NAPOT_to_TOR

Verify that the low pmpaddr bits read back according to G and the current mode, and keep their stored value when the mode changes.

G ≥ 1 only (compiled out at PMP_GRANULARITY = 2). Write zeros, ones and a checkerboard to pmpaddr0 with pmpcfg0.A = NAPOT or OFF, then change A to OFF, NAPOT or TOR and read pmpaddr0[G-1:0].

NAPOT: pmpaddr0[G-2:0] read as ones and bit G-1 returns the written value, even if it was written while the entry was OFF. OFF and TOR: pmpaddr0[G-1:0] read as zeros.

6 transitions (4 without TOR); the tests write 3 patterns per transition

pmp_tor_off_addr_read_mask
pmp_napot_addr_read_mask
pmp_addr_retention_on_mode_change
pmp_region_granularity_g

cp_grain_check_write
cp_grain_check_read

Verify the grain G seen in pmpaddr0.

pmpcfg0 = 0. Write all ones to pmpaddr0 and read it back.

Bits G-1:0 read as zero and bit G reads as one, matching PMP_GRANULARITY.

1 each

pmp_granularity
pmp_region_granularity_g
pmp_addr_registers
pmp_addr_warl
pmp_csrs_warl_access
pmp_tor_off_addr_read_mask

PMP CSR access

cp_pmpaddr_upper_zero

Verify that pmpaddr bits 63:54 are zero on RV64.

RV64 only. Write all ones to every implemented pmpaddr CSR and read it back.

Bits 63:54 read as zero.

16 or 64 pmpaddr CSRs

pmp_addr_registers
pmp_addr_warl
pmp_csrs_warl_access
pmp_addr_encoding

cp_pmpcfg_walk
cp_pmpcfg_walk_odd
cp_pmpcfg_zero

Verify the layout and WARL behavior of the pmpcfg CSRs.

Write zero, then a walking one through each bit of every implemented pmpcfg CSR (pmpcfg0-15 on RV32, the even pmpcfg CSRs on RV64), and read each back. The walk skips bit 1 (W alone is reserved) and bit 4 (A = NA4) of every byte. cp_pmpcfg_walk_odd and cp_pmpcfg_zero cover the odd CSRs on RV32.

Readback matches the reference model: bits 6:5 of each byte read as zero, and a one written to bit 7 locks that entry.

Walking-one values (24 on RV32, 48 on RV64) × even pmpcfg CSRs; on RV32 also × odd CSRs, plus zero to each odd CSR

pmp_csrs_warl_access
pmp_cfg_rv32_layout
pmp_cfg_rv64_layout
pmp_rwx_warl
pmp_entry_structure

64 PMP entries

cp_pmp64_write
cp_pmp64_read

Verify that entries 15-62 of a 64-entry PMP enforce permissions.

NUM_PMP_ENTRIES = 64 and PMP_NAPOT_SUPPORTED only. For each of entries 62 down to 15: L=1, A=NAPOT, XWR=101 over a standard region. sw and lw in the region (the test also issues jalr).

lw succeeds; sw raises a store/AMO access fault.

48 entries each

pmp_entry_count
pmp_cfg_rv64_layout
pmp_addr_registers
pmp_cfg_rv32_layout
pmp_store_fault
pmp_cfg_permissions

cp_pmpcfg_odd_rv64

Verify that the odd pmpcfg CSRs are illegal on RV64.

RV64 only. csrr and csrw each of pmpcfg1, pmpcfg3, …, pmpcfg15 from M-mode.

Illegal-instruction exception (mcause = 2) on every access.

8 CSRs × 2 operations = 16

pmp_cfg_rv64_illegal

cp_na4_boundary

Verify that an aligned doubleword that only half matches an NA4 entry fails.

RV64, PMP_NA4_SUPPORTED only. Entry i: L=1, A=NA4, XWR=111 over the lower or the upper word of an aligned doubleword. ld and sd on the doubleword.

Load or store/AMO access fault: the entry matches only some bytes of one memory operation.

2 halves × 2 accesses = 4

pmp_full_match_required
pmp_entry_priority
pmp_access_fault_exception

cp_tor_boundary

Verify that an aligned doubleword that only half matches a TOR entry fails.

RV64, G = 0, PMP_TOR_SUPPORTED only. Entry i: L=1, A=TOR, XWR=111, a 4-byte region over the lower or upper word of an aligned doubleword (entry i-1: OFF, pmpaddr(i-1) = pmpaddr(i) - 4). ld and sd on the doubleword.

Load or store/AMO access fault. (The original plan also allowed success for a split access; an aligned doubleword is one memory operation.)

2 halves × 2 accesses = 4

pmp_full_match_required
pmp_entry_priority
pmp_access_fault_exception

cp_tor_doubleregionfail

Verify that an aligned doubleword split across two TOR entries fails.

RV64, G = 0, PMP_TOR_SUPPORTED only. Entries i and i+1: XWR=111, TOR, each covering one word of an aligned doubleword (entry i-1: OFF, pmpaddr at the doubleword). ld and sd on the doubleword.

Load or store/AMO access fault: no single entry matches all bytes.

2 accesses

pmp_full_match_required
pmp_entry_priority
pmp_access_fault_exception

cp_misaligned_napot
cp_misaligned_na4
cp_misaligned_tor

Verify that a misaligned load or store that straddles a region boundary is checked byte by byte.

Standard NAPOT region, NA4 region (G = 0) or one-grain TOR region with L={0,1}, XWR=111. Misaligned lh, lhu, lw, sh, sw (+ lwu, ld, sd on RV64) at each offset straddling the start and the end of the region.

Address-misaligned exception, access fault, or success if the hart splits the access into operations that each match fully. Depends on MISALIGNED_LDST, MISALIGNED_LDST_EXCEPTION_PRIORITY and MISALIGNED_SPLIT_STRATEGY.

~(3 lw + 3 sw + 1 lh + 1 lhu + 1 sh) offsets × 2 ends × 2 L, per mode

pmp_misaligned_access_behavior
pmp_full_match_required
pmp_entry_priority
pmp_access_fault_exception

cp_misaligned_off

Verify that a misaligned access across an OFF entry’s region only sees the background entry.

Standard region with A=OFF, L={0,1}, XWR=111. The same misaligned accesses as cp_misaligned_napot.

Address-misaligned exception or success; never an access fault.

~(3 lw + 3 sw + 1 lh + 1 lhu + 1 sh) offsets × 2 ends × 2 L

pmp_a_field_off
pmp_misaligned_access_behavior

cp_misaligned_na4_wrap
cp_misaligned_tor_wrap

Verify that a doubleword that starts before and ends after a 4-byte region fails.

RV64, G = 0. A 4-byte NA4 or TOR region with L={0,1}, XWR=111. ld and sd that start 2 bytes before the region and end 2 bytes after it.

Address-misaligned exception or access fault (the entry matches only the middle bytes). Depends on MISALIGNED_LDST and MISALIGNED_LDST_EXCEPTION_PRIORITY.

2 accesses × 2 L, per mode

pmp_full_match_required
pmp_misaligned_access_behavior
pmp_entry_priority

Open item from the original plan: add mstatus.MXR to cp_cfg_R and cp_cfg_W.

Open item from the original plan: add a check of the default (background) region.

Open item from the original plan: add a check of different region types in combination.

Open item from the original plan: a misaligned instruction or data access that spans a 4 KiB page boundary and translates to two physical pages, one outside the PMP region. Belongs in SvPMP.

Table 235. PMPSm Normative Rules
Normative Rule Rule Text Coverpoints

pmp_access_fault_exception

Failed memory operations generate an instruction, load, or store access-fault exception.

PMPSm_cg/{cp_cfg_X, cp_cfg_R, cp_cfg_W, cp_cfg_A_napot_all}

pmp_cfg_permissions

pmpcfg shows the layout of a PMP configuration register. The R, W, and X bits, when set, indicate that the PMP entry permits read, write, and instruction execution, respectively. When one of these bits is clear, the corresponding access type is denied.

PMPSm_cg/{cp_cfg_X, cp_cfg_R, cp_cfg_W, cp_cfg_X1_all}

pmp_l_bit_m_mode_enforcement

In addition to locking the PMP entry, the L bit indicates whether the R/W/X permissions are additionally enforced on M-mode accesses. When the L bit is set, these permissions are enforced for all privilege modes. When the L bit is clear, any M-mode access matching the PMP entry will succeed; the R/W/X permissions apply only to S and U modes.

PMPSm_cg/{cp_cfg_X0_all, cp_cfg_L_access_exec, cp_cfg_L_access_read, cp_cfg_L_access_write}

pmp_exec_fault

Attempting to fetch an instruction from a PMP region that does not have execute permissions raises an instruction access-fault exception.

PMPSm_cg/{cp_cfg_X, cp_cfg_X0_all, cp_cfg_A_napot_x, cp_cfg_A_tor_x}

pmp_rwx_check

If a PMP entry matches all bytes of a memory operation, then the L, R, W, and X bits determine whether the operation succeeds or fails. If the L bit is clear and the privilege mode of the access is M, the operation succeeds. Otherwise, if the L bit is set or the privilege mode of the access is S or U, then the operation succeeds only if the R, W, or X bit corresponding to the access type is set.

PMPSm_cg/{cp_cfg_X, cp_cfg_R, cp_cfg_W, cp_cfg_L_access_read}

pmp_l_bit_function

The L bit indicates that the PMP entry is locked, i.e., writes to the configuration register and associated address registers are ignored.

PMPSm_cg/cp_cfg_L_modify

pmp_mmode_locking

Optionally, PMP checks may additionally apply to M-mode accesses, in which case the PMP registers themselves are locked, so that even M-mode software cannot change them until the hart is reset.

PMPSm_cg/{cp_cfg_L_modify, cp_cfg_X, cp_cfg_R, cp_cfg_W}

pmp_l_bit_write_protection

If PMP entry i is locked, writes to pmpicfg and pmpaddri are ignored. Additionally, if PMP entry i is locked and pmpicfg.A is set to TOR, writes to pmpaddri-1 are ignored.

PMPSm_cg/cp_cfg_L_modify

pmp_locked_until_reset

Locked PMP entries remain locked until the hart is reset.

PMPSm_cg/cp_cfg_L_modify

pmp_na4_select_restriction

When G ≥ 1, the NA4 mode is not selectable.

PMPSm_cg/{cp_cfg_A_all_even, cp_cfg_A_all_odd}

pmp_a_field_encoding

The A field in a PMP entry’s configuration register encodes the address-matching mode of the associated PMP address register. The encoding of this field is shown in pmpcfg-a.

PMPSm_cg/{cp_cfg_A_all_even, cp_cfg_A_OFF_all_read, cp_cfg_A_napot_all, cp_cfg_A_tor_r}

pmp_a_field_off

When A=0, this PMP entry is disabled and matches no addresses.

PMPSm_cg/{cp_cfg_A_OFF_all_read, cp_cfg_A_OFF_all_write, cp_cfg_A_OFF_all_exec, cp_priority_off_lw}

pmp_napot_encoding_low_bits

NAPOT ranges make use of the low-order bits of the associated address register to encode the size of the range, as shown in pmpcfg-napot.

PMPSm_cg/{cp_cfg_A_napot_all, cp_cfg_A_napot_x, cp_cfg_A_napot_r, cp_cfg_A_napot_w}

pmp_a_field_napot_na4

naturally aligned power-of-2 regions (NAPOT), including the special case of naturally aligned four-byte regions (NA4);

PMPSm_cg/{cp_cfg_A_napot_all, cp_cfg_A_napot_r, cp_cfg_A_NA4_all, cp_cfg_A_na4_r}

pmp_a_field_tor

If TOR is selected, the associated address register forms the top of the address range, and the preceding PMP address register forms the bottom of the address range. If PMP entry i’s A field is set to TOR, the entry matches any address y such that pmpaddri-1≤y<pmpaddri (irrespective of the value of pmpcfgi-1). If PMP entry 0’s A field is set to TOR, zero is used for the lower bound, and so it matches any address y<pmpaddr0.

PMPSm_cg/{cp_cfg_A_tor_r, cp_cfg_A_tor0_r, cp_cfg_A_tor_bot_L1_r, cp_cfg_A_tor_nonoverlap2_r}

pmp_entry_priority

PMP entries are statically prioritized. The lowest-numbered PMP entry that matches any byte of a memory operation determines whether that operation succeeds or fails.

PMPSm_cg/{cp_priority_lw, cp_priority_sw, cp_priority_off_lw}, PMPZca_cg/cp_misaligned_napot

pmp_napot_addr_read_mask

When G ≥ 2 and pmpcfgi.A[1] is set, i.e. the mode is NAPOT, then bits pmpaddri[G-2:0] read as all ones.

PMPSm_cg/{cp_grain_OFF_to_NAPOT, cp_grain_NAPOT_to_NAPOT}

pmp_tor_off_addr_read_mask

When G ≥ 1 and pmpcfgi.A[1] is clear, i.e. the mode is OFF or TOR, then bits pmpaddri[G-1:0] read as all zeros. Bits pmpaddri[G-1:0] do not affect the TOR address-matching logic.

PMPSm_cg/{cp_grain_OFF_to_OFF, cp_grain_OFF_to_TOR, cp_grain_NAPOT_to_OFF, cp_grain_NAPOT_to_TOR}

pmp_granularity

The granularity of PMP access control settings are platform-specific, but the standard PMP encoding supports regions as small as four bytes.

PMPSm_cg/{cp_grain_check_write, cp_grain_check_read, cp_cfg_A_NA4_all}

pmp_region_granularity_g

Although the PMP mechanism supports regions as small as four bytes, platforms may specify coarser PMP regions. In general, the PMP grain is 2G+2 bytes and must be the same across all PMP regions.

PMPSm_cg/{cp_grain_check_write, cp_grain_check_read}

pmp_mmode_only_regions

Certain regions’ privileges can be hardwired—for example, some regions might only ever be visible in machine mode but in no lower-privilege layers.

Descriptive spec text with no separately testable behavior

pmp_addr_registers

The PMP address registers are CSRs named pmpaddr0-pmpaddr63.

PMPSm_cg/{cp_pmpaddr_upper_zero, cp_grain_check_write}

pmp_addr_warl

Not all physical address bits may be implemented, and so the pmpaddr registers are WARL.

PMPSm_cg/{cp_pmpaddr_upper_zero, cp_grain_check_write}

pmp_csrs_warl_access

All PMP CSR fields are WARL and may be read-only zero.

PMPSm_cg/{cp_pmpcfg_walk, cp_cfg_A_all_even, cp_grain_check_write, cp_pmpaddr_upper_zero}

pmp_addr_encoding

Each PMP address register encodes bits 33-2 of a 34-bit physical address for RV32, as shown in pmpaddr-rv32. For RV64, each PMP address register encodes bits 55-2 of a 56-bit physical address, as shown in pmpaddr-rv64.

PMPSm_cg/{cp_pmpaddr_upper_zero, cp_cfg_A_tor_r, cp_cfg_A_napot_r}

pmp_cfg_rv32_layout

For RV32, sixteen CSRs, pmpcfg0–pmpcfg15, hold the configurations pmp0cfg–pmp63cfg for the 64 PMP entries, as shown in pmpcfg-rv32.

PMPSm_cg/{cp_pmpcfg_walk, cp_pmpcfg_walk_odd, cp_cfg_A_tor_all3, cp_cfg_A_tor_all4}

pmp_cfg_rv64_layout

For RV64, eight even-numbered CSRs, pmpcfg0, pmpcfg2, …, pmpcfg14, hold the configurations for the 64 PMP entries, as shown in pmpcfg-rv64.

PMPSm_cg/{cp_pmpcfg_walk, cp_cfg_A_tor_all7, cp_cfg_A_tor_all8, cp_pmp64_read}

pmp_cfg_rv64_illegal

For RV64, the odd-numbered configuration registers, pmpcfg1, pmpcfg3, …, pmpcfg15, are illegal.

TODO: access the odd-numbered pmpcfg CSRs on RV64 and check for an illegal-instruction exception

pmp_rwx_warl

The R, W, and X fields form a collective WARL field for which the combinations with R=0 and W=1 are reserved.

PMPSm_cg/cp_pmpcfg_walk

pmp_full_match_required

The matching PMP entry must match all bytes of a memory operation, or the operation fails, irrespective of the L, R, W, and X bits.

PMPZca_cg/{cp_misaligned_napot, cp_misaligned_tor, cp_misaligned_na4}

pmp_violation_precise_trap

PMP violations are always trapped precisely at the processor.

PMPZaamo_cg/cp_cfg_RW

pmp_entry_count

Up to 64 PMP entries are supported. Implementations may implement zero, 16, or 64 PMP entries; the lowest-numbered PMP entries must be implemented first.

PMPSm_cg/{cp_pmp64_read, cp_pmp64_write}

pmp_load_fault

Attempting to execute a load or load-reserved instruction that accesses a physical address within a PMP region without read permissions raises a load access-fault exception.

PMPSm_cg/cp_cfg_R, PMPZalrsc_cg/cp_cfg_RW, PMPF_cg/cp_cfg_R, PMPZca_cg/cp_cfg_R

pmp_store_fault

Attempting to execute a store, store-conditional, AMO, or cache-block zero instruction that accesses a physical address within a PMP region without write permissions raises a store access-fault exception.

PMPSm_cg/cp_cfg_W, PMPZalrsc_cg/cp_cfg_RW, PMPZaamo_cg/cp_cfg_RW, PMPZicbo_cg/cp_cbo_zero

pmp_misaligned_access_behavior

On some implementations, misaligned loads, stores, and instruction fetches may be decomposed into multiple memory operations, some of which may succeed before an access-fault exception occurs, as described in the RVWMO specification. PMP checking is performed on each memory operation independently.

PMPZca_cg/{cp_misaligned_napot, cp_misaligned_tor, cp_misaligned_na4, cp_misaligned_off}, TODO: misaligned loads and stores that straddle two PMP regions

pmp_no_entry_match

If no PMP entry matches an M-mode memory operation, the operation succeeds. If no PMP entry matches an S-mode or U-mode memory operation, the operation fails if at least one PMP entry is implemented and succeeds otherwise.

PMPSm_cg/{cp_none_lw, cp_none_sw, cp_none_jalr}, TODO: S-mode and U-mode accesses that match no PMP entry

pmp_addr_retention_on_mode_change

Although changing pmpcfgi.A[1] affects the value read from pmpaddri, it does not affect the underlying value stored in that register—in particular, pmpaddri[G-1] retains its original value when pmpcfgi.A is changed from NAPOT to TOR/OFF then back to NAPOT.

PMPSm_cg/{cp_grain_OFF_to_NAPOT, cp_grain_NAPOT_to_OFF, cp_grain_NAPOT_to_TOR}

pmp_entry_structure

PMP entries are described by an 8-bit configuration register and one MXLEN-bit address register. Some PMP settings additionally use the address register associated with the preceding PMP entry.

PMPSm_cg/cp_pmpcfg_walk

UDB Parameters: None.

B.7.2. PMPS

General Test Environment (PMPS): - Runs when S and Sm are implemented and NUM_PMP_ENTRIES > 0. The NA4, NAPOT and TOR test files also need PMP_NA4_SUPPORTED, PMP_NAPOT_SUPPORTED or PMP_TOR_SUPPORTED. - Boots to M-mode and programs the PMP there, then switches to S-mode (RVTEST_TSBI_GOTO_SMODE) for each set of probes and back to M-mode (RVTEST_TSBI_GOTO_MMODE). cp_mprv_* probes run in M-mode. - Background entry, grain, standard region, loads, stores and the fetch probe are as in PMPSm. - Entries under test are unlocked (L=0) unless a row says otherwise: R/W/X apply to S-mode accesses whatever L is.

Table 236. PMPS Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule

Permission bits

cp_cfg_X

Verify that X controls S-mode instruction fetch whether or not the entry is locked.

One standard NAPOT region. Walk the six legal XWR values with L=1, then again with L=0, each in its own entry as in PMPSm cp_cfg_X. jalr to the start of the region from S-mode.

Instruction access fault when X=0, for both L=0 and L=1.

2 L × 6 XWR = 12

pmp_check_priv_modes
pmp_rwx_check
pmp_cfg_permissions
pmp_l_bit_m_mode_enforcement
pmp_access_fault_exception
pmp_exec_fault

cp_cfg_R

Verify that R controls every S-mode load width whether or not the entry is locked.

Same walk as cp_cfg_X. Every load (lb, lbu, lh, lhu, lw (+ lwu, ld on RV64)) at the start of the region from S-mode.

Load access fault when R=0, for both L=0 and L=1.

2 L × 6 XWR × 5 loads = 60 (84 on RV64)

pmp_check_priv_modes
pmp_rwx_check
pmp_cfg_permissions
pmp_access_fault_exception
pmp_load_fault
pmp_l_bit_m_mode_enforcement

cp_cfg_W

Verify that W controls every S-mode store width whether or not the entry is locked.

Same walk as cp_cfg_X. Every store (sb, sh, sw (+ sd on RV64)) at the start of the region from S-mode.

Store/AMO access fault when W=0, for both L=0 and L=1.

2 L × 6 XWR × 3 stores = 36 (48 on RV64)

pmp_rwx_check
pmp_cfg_permissions
pmp_access_fault_exception
pmp_store_fault
pmp_check_priv_modes
pmp_l_bit_m_mode_enforcement

Address-matching modes

cp_cfg_A_off_jalr
cp_cfg_A_off_lw
cp_cfg_A_off_sw

Verify that an OFF entry does not match S-mode accesses.

Entry 0: L=0, A=OFF, XWR=000, pmpaddr0 = all ones. jalr, lw and sw in the region from S-mode.

All accesses succeed through the background entry.

1 each

pmp_a_field_off
pmp_check_priv_modes

cp_cfg_A_napot_jalr
cp_cfg_A_napot_lw
cp_cfg_A_napot_sw

Verify that XWR is enforced for S-mode across an unlocked NAPOT region and not outside it.

PMP_NAPOT_SUPPORTED only. One standard NAPOT region, six legal XWR with L=0. jalr, lw and sw at base-4, base, base+4, the highest word and just past the top, from S-mode.

Inside the region: access fault when the permission is clear. Outside: the access succeeds.

6 XWR × 5 addresses = 30 each

pmp_a_field_tor
pmp_a_field_napot_na4
pmp_napot_encoding_low_bits
pmp_check_priv_modes
pmp_rwx_check
pmp_exec_fault
pmp_load_fault
pmp_store_fault

cp_cfg_A_na4_jalr
cp_cfg_A_na4_lw
cp_cfg_A_na4_sw

Verify that XWR is enforced for S-mode on an unlocked NA4 region and not on its neighbors.

PMP_NA4_SUPPORTED only. One NA4 region, six legal XWR with L=0. jalr, lw and sw at region-4, region and region+4, from S-mode.

Access fault at the region when the permission is clear. The neighbors succeed.

6 XWR × 3 addresses = 18 each

pmp_a_field_tor
pmp_a_field_napot_na4
pmp_check_priv_modes
pmp_rwx_check
pmp_exec_fault
pmp_load_fault
pmp_store_fault

cp_cfg_A_tor_jalr
cp_cfg_A_tor_lw
cp_cfg_A_tor_sw

Verify that XWR is enforced for S-mode across an unlocked TOR region and not outside it.

PMP_TOR_SUPPORTED only. One TOR region of one grain [bottom, top) from a pair of entries, six legal XWR with L=0. jalr, lw and sw at bottom-4, bottom, top-4 and top, from S-mode.

Inside the region: access fault when the permission is clear. bottom-4 and top: the access succeeds.

6 XWR × 4 addresses = 24 each

pmp_a_field_tor
pmp_a_field_napot_na4
pmp_check_priv_modes
pmp_rwx_check
pmp_exec_fault
pmp_load_fault
pmp_store_fault

MPRV

cp_mprv_jalr
cp_mprv_lw
cp_mprv_sw

Verify that M-mode loads and stores are checked as S-mode when mstatus.MPRV=1 and MPP=S, and that fetches are not.

M-mode. Entry 0 over a standard region: L={0,1}, A=NAPOT, XWR={000, 111}. mstatus.MPP = S, MPRV = {0,1}. jalr, lw and sw in the region.

XWR=111: all succeed. XWR=000: lw and sw fault when MPRV=1 (even with L=0) or when L=1, and succeed when MPRV=0 and L=0. jalr ignores MPRV: it faults only when L=1.

2 MPRV × 2 L × 2 XWR = 8 each. MPP=M is not binned: with MPRV=1 it behaves as MPRV=0.

pmp_exec_fault
mstatus_mprv_inst_xlat_op
pmp_check_priv_modes
pmp_l_bit_m_mode_enforcement
pmp_load_fault
mstatus_mprv_ldst_op
pmp_store_fault
pmp_rwx_check

PMP CSR access

cp_pmpaddr_access_s

Verify that the pmpaddr CSRs are not accessible from S-mode.

From S-mode, write all ones to pmpaddr0-63.

Illegal-instruction exception on every write.

64 CSRs

pmp_csr_mode
pmp_addr_registers

cp_pmpcfg_access_s

Verify that the pmpcfg CSRs are not accessible from S-mode.

From S-mode, write all ones to pmpcfg0-15.

Illegal-instruction exception on every write.

16 CSRs

pmp_csr_mode

Not yet implemented in ACT4 (no coverpoint or test yet)

cp_none

Verify that a S-mode access that matches no entry fails when PMP entries are implemented.

No background entry. Program one entry that covers only the code the probes run from, then jalr, lw and sw from S-mode to an address that no entry matches. (The original plan cleared every entry, which faults on the first S-mode fetch and ends the test.)

Instruction, load or store/AMO access fault.

3 types of access

pmp_no_entry_match
pmp_check_priv_modes
pmp_access_fault_exception

Table 237. PMPS Normative Rules
Normative Rule Rule Text Coverpoints

pmp_check_priv_modes

PMP checks are applied to all accesses whose effective privilege mode is S or U, including instruction fetches and data accesses in S and U mode, and data accesses in M-mode when the MPRV bit in mstatus is set and the MPP field in mstatus contains S or U.

PMPS_cg/{cp_cfg_X, cp_cfg_R, cp_mprv_lw, cp_mprv_sw}

pmp_csr_mode

PMP CSRs are only accessible to M-mode.

PMPS_cg/{cp_pmpaddr_access_s, cp_pmpcfg_access_s}

pmp_addr_registers

The PMP address registers are CSRs named pmpaddr0-pmpaddr63.

PMPS_cg/cp_pmpaddr_access_s

pmp_rwx_check, pmp_cfg_permissions

pmp_rwx_check: If a PMP entry matches all bytes of a memory operation, then the L, R, W, and X bits determine whether the operation succeeds or fails. If the L bit is clear and the privilege mode of the access is M, the operation succeeds. Otherwise, if the L bit is set or the privilege mode of the access is S or U, then the operation succeeds only if the R, W, or X bit corresponding to the access type is set. pmp_cfg_permissions: pmpcfg shows the layout of a PMP configuration register. The R, W, and X bits, when set, indicate that the PMP entry permits read, write, and instruction execution, respectively. When one of these bits is clear, the corresponding access type is denied.

PMPS_cg/{cp_cfg_X, cp_cfg_R, cp_cfg_W}

pmp_l_bit_m_mode_enforcement

In addition to locking the PMP entry, the L bit indicates whether the R/W/X permissions are additionally enforced on M-mode accesses. When the L bit is set, these permissions are enforced for all privilege modes. When the L bit is clear, any M-mode access matching the PMP entry will succeed; the R/W/X permissions apply only to S and U modes.

PMPS_cg/{cp_cfg_X, cp_mprv_lw, cp_mprv_sw}

pmp_access_fault_exception

Failed memory operations generate an instruction, load, or store access-fault exception.

PMPS_cg/{cp_cfg_X, cp_cfg_R, cp_cfg_W}

pmp_exec_fault

Attempting to fetch an instruction from a PMP region that does not have execute permissions raises an instruction access-fault exception.

PMPS_cg/{cp_cfg_X, cp_mprv_jalr}

pmp_load_fault

Attempting to execute a load or load-reserved instruction that accesses a physical address within a PMP region without read permissions raises a load access-fault exception.

PMPS_cg/{cp_cfg_R, cp_mprv_lw}

pmp_store_fault

Attempting to execute a store, store-conditional, AMO, or cache-block zero instruction that accesses a physical address within a PMP region without write permissions raises a store access-fault exception.

PMPS_cg/{cp_cfg_W, cp_mprv_sw}

pmp_a_field_off

When A=0, this PMP entry is disabled and matches no addresses.

PMPS_cg/{cp_cfg_A_off_jalr, cp_cfg_A_off_lw, cp_cfg_A_off_sw}

pmp_a_field_tor, pmp_a_field_napot_na4

pmp_a_field_tor: If TOR is selected, the associated address register forms the top of the address range, and the preceding PMP address register forms the bottom of the address range. If PMP entry i’s A field is set to TOR, the entry matches any address y such that pmpaddri-1≤y<pmpaddri (irrespective of the value of pmpcfgi-1). If PMP entry 0’s A field is set to TOR, zero is used for the lower bound, and so it matches any address y<pmpaddr0. pmp_a_field_napot_na4: naturally aligned power-of-2 regions (NAPOT), including the special case of naturally aligned four-byte regions (NA4);

PMPS_cg/{cp_cfg_A_tor_lw, cp_cfg_A_na4_lw, cp_cfg_A_napot_lw}

UDB Parameters: None.

B.7.3. PMPU

General Test Environment (PMPU): - Runs when U and Sm are implemented and NUM_PMP_ENTRIES > 0. The NA4, NAPOT and TOR test files also need PMP_NA4_SUPPORTED, PMP_NAPOT_SUPPORTED or PMP_TOR_SUPPORTED. - Boots to M-mode and programs the PMP there, then switches to U-mode (RVTEST_TSBI_GOTO_UMODE) for each set of probes and back to M-mode (RVTEST_TSBI_GOTO_MMODE). cp_mprv_* probes run in M-mode. - Background entry, grain, standard region, loads, stores and the fetch probe are as in PMPSm. - Entries under test are unlocked (L=0) unless a row says otherwise: R/W/X apply to U-mode accesses whatever L is.

Table 238. PMPU Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule

Permission bits

cp_cfg_X

Verify that X controls U-mode instruction fetch whether or not the entry is locked.

One standard NAPOT region. Walk the six legal XWR values with L=1, then again with L=0, each in its own entry as in PMPSm cp_cfg_X. jalr to the start of the region from U-mode.

Instruction access fault when X=0, for both L=0 and L=1.

2 L × 6 XWR = 12

pmp_check_priv_modes
pmp_rwx_check
pmp_cfg_permissions
pmp_l_bit_m_mode_enforcement
pmp_access_fault_exception
pmp_exec_fault

cp_cfg_R

Verify that R controls every U-mode load width whether or not the entry is locked.

Same walk as cp_cfg_X. Every load (lb, lbu, lh, lhu, lw (+ lwu, ld on RV64)) at the start of the region from U-mode.

Load access fault when R=0, for both L=0 and L=1.

2 L × 6 XWR × 5 loads = 60 (84 on RV64)

pmp_check_priv_modes
pmp_rwx_check
pmp_cfg_permissions
pmp_access_fault_exception
pmp_load_fault
pmp_l_bit_m_mode_enforcement

cp_cfg_W

Verify that W controls every U-mode store width whether or not the entry is locked.

Same walk as cp_cfg_X. Every store (sb, sh, sw (+ sd on RV64)) at the start of the region from U-mode.

Store/AMO access fault when W=0, for both L=0 and L=1.

2 L × 6 XWR × 3 stores = 36 (48 on RV64)

pmp_rwx_check
pmp_cfg_permissions
pmp_access_fault_exception
pmp_store_fault
pmp_check_priv_modes
pmp_l_bit_m_mode_enforcement

Address-matching modes

cp_cfg_A_off_jalr
cp_cfg_A_off_lw
cp_cfg_A_off_sw

Verify that an OFF entry does not match U-mode accesses.

Entry 0: L=0, A=OFF, XWR=000, pmpaddr0 = all ones. jalr, lw and sw in the region from U-mode.

All accesses succeed through the background entry.

1 each

pmp_a_field_off
pmp_check_priv_modes

cp_cfg_A_napot_jalr
cp_cfg_A_napot_lw
cp_cfg_A_napot_sw

Verify that XWR is enforced for U-mode across an unlocked NAPOT region and not outside it.

PMP_NAPOT_SUPPORTED only. One standard NAPOT region, six legal XWR with L=0. jalr, lw and sw at base-4, base, base+4, the highest word and just past the top, from U-mode.

Inside the region: access fault when the permission is clear. Outside: the access succeeds.

6 XWR × 5 addresses = 30 each

pmp_a_field_tor
pmp_a_field_napot_na4
pmp_napot_encoding_low_bits
pmp_check_priv_modes
pmp_rwx_check
pmp_exec_fault
pmp_load_fault
pmp_store_fault

cp_cfg_A_na4_jalr
cp_cfg_A_na4_lw
cp_cfg_A_na4_sw

Verify that XWR is enforced for U-mode on an unlocked NA4 region and not on its neighbors.

PMP_NA4_SUPPORTED only. One NA4 region, six legal XWR with L=0. jalr, lw and sw at region-4, region and region+4, from U-mode.

Access fault at the region when the permission is clear. The neighbors succeed.

6 XWR × 3 addresses = 18 each

pmp_a_field_tor
pmp_a_field_napot_na4
pmp_check_priv_modes
pmp_rwx_check
pmp_exec_fault
pmp_load_fault
pmp_store_fault

cp_cfg_A_tor_jalr
cp_cfg_A_tor_lw
cp_cfg_A_tor_sw

Verify that XWR is enforced for U-mode across an unlocked TOR region and not outside it.

PMP_TOR_SUPPORTED only. One TOR region of one grain [bottom, top) from a pair of entries, six legal XWR with L=0. jalr, lw and sw at bottom-4, bottom, top-4 and top, from U-mode.

Inside the region: access fault when the permission is clear. bottom-4 and top: the access succeeds.

6 XWR × 4 addresses = 24 each

pmp_a_field_tor
pmp_a_field_napot_na4
pmp_check_priv_modes
pmp_rwx_check
pmp_exec_fault
pmp_load_fault
pmp_store_fault

MPRV

cp_mprv_jalr
cp_mprv_lw
cp_mprv_sw

Verify that M-mode loads and stores are checked as U-mode when mstatus.MPRV=1 and MPP=U, and that fetches are not.

M-mode. Entry 0 over a standard region: L={0,1}, A=NAPOT, XWR={000, 111}. mstatus.MPP = U, MPRV = {0,1}. jalr, lw and sw in the region.

XWR=111: all succeed. XWR=000: lw and sw fault when MPRV=1 (even with L=0) or when L=1, and succeed when MPRV=0 and L=0. jalr ignores MPRV: it faults only when L=1.

2 MPRV × 2 L × 2 XWR = 8 each. MPP=M is not binned: with MPRV=1 it behaves as MPRV=0.

pmp_exec_fault
mstatus_mprv_inst_xlat_op
pmp_check_priv_modes
pmp_l_bit_m_mode_enforcement
pmp_load_fault
pmp_store_fault
mstatus_mprv_ldst_op
pmp_rwx_check

PMP CSR access

cp_pmpaddr_access_u

Verify that the pmpaddr CSRs are not accessible from U-mode.

From U-mode, write all ones to pmpaddr0-63.

Illegal-instruction exception on every write.

64 CSRs

pmp_csr_mode
pmp_addr_registers

cp_pmpcfg_access_u

Verify that the pmpcfg CSRs are not accessible from U-mode.

From U-mode, write all ones to pmpcfg0-15.

Illegal-instruction exception on every write.

16 CSRs

pmp_csr_mode

Not yet implemented in ACT4 (no coverpoint or test yet)

cp_none

Verify that a U-mode access that matches no entry fails when PMP entries are implemented.

No background entry. Program one entry that covers only the code the probes run from, then jalr, lw and sw from U-mode to an address that no entry matches. (The original plan cleared every entry, which faults on the first U-mode fetch and ends the test.)

Instruction, load or store/AMO access fault.

3 types of access

pmp_no_entry_match
pmp_check_priv_modes
pmp_access_fault_exception

Table 239. PMPU Normative Rules
Normative Rule Rule Text Coverpoints

pmp_check_priv_modes

PMP checks are applied to all accesses whose effective privilege mode is S or U, including instruction fetches and data accesses in S and U mode, and data accesses in M-mode when the MPRV bit in mstatus is set and the MPP field in mstatus contains S or U.

PMPU_cg/{cp_cfg_X, cp_cfg_R, cp_mprv_lw, cp_mprv_sw}

pmp_csr_mode

PMP CSRs are only accessible to M-mode.

PMPU_cg/{cp_pmpaddr_access_u, cp_pmpcfg_access_u}

pmp_addr_registers

The PMP address registers are CSRs named pmpaddr0-pmpaddr63.

PMPU_cg/cp_pmpaddr_access_u

pmp_rwx_check, pmp_cfg_permissions

pmp_rwx_check: If a PMP entry matches all bytes of a memory operation, then the L, R, W, and X bits determine whether the operation succeeds or fails. If the L bit is clear and the privilege mode of the access is M, the operation succeeds. Otherwise, if the L bit is set or the privilege mode of the access is S or U, then the operation succeeds only if the R, W, or X bit corresponding to the access type is set. pmp_cfg_permissions: pmpcfg shows the layout of a PMP configuration register. The R, W, and X bits, when set, indicate that the PMP entry permits read, write, and instruction execution, respectively. When one of these bits is clear, the corresponding access type is denied.

PMPU_cg/{cp_cfg_X, cp_cfg_R, cp_cfg_W}

pmp_l_bit_m_mode_enforcement

In addition to locking the PMP entry, the L bit indicates whether the R/W/X permissions are additionally enforced on M-mode accesses. When the L bit is set, these permissions are enforced for all privilege modes. When the L bit is clear, any M-mode access matching the PMP entry will succeed; the R/W/X permissions apply only to S and U modes.

PMPU_cg/{cp_cfg_X, cp_mprv_lw, cp_mprv_sw}

pmp_access_fault_exception

Failed memory operations generate an instruction, load, or store access-fault exception.

PMPU_cg/{cp_cfg_X, cp_cfg_R, cp_cfg_W}

pmp_exec_fault

Attempting to fetch an instruction from a PMP region that does not have execute permissions raises an instruction access-fault exception.

PMPU_cg/{cp_cfg_X, cp_mprv_jalr}

pmp_load_fault

Attempting to execute a load or load-reserved instruction that accesses a physical address within a PMP region without read permissions raises a load access-fault exception.

PMPU_cg/{cp_cfg_R, cp_mprv_lw}

pmp_store_fault

Attempting to execute a store, store-conditional, AMO, or cache-block zero instruction that accesses a physical address within a PMP region without write permissions raises a store access-fault exception.

PMPU_cg/{cp_cfg_W, cp_mprv_sw}

pmp_a_field_off

When A=0, this PMP entry is disabled and matches no addresses.

PMPU_cg/{cp_cfg_A_off_jalr, cp_cfg_A_off_lw, cp_cfg_A_off_sw}

pmp_a_field_tor, pmp_a_field_napot_na4

pmp_a_field_tor: If TOR is selected, the associated address register forms the top of the address range, and the preceding PMP address register forms the bottom of the address range. If PMP entry i’s A field is set to TOR, the entry matches any address y such that pmpaddri-1≤y<pmpaddri (irrespective of the value of pmpcfgi-1). If PMP entry 0’s A field is set to TOR, zero is used for the lower bound, and so it matches any address y<pmpaddr0. pmp_a_field_napot_na4: naturally aligned power-of-2 regions (NAPOT), including the special case of naturally aligned four-byte regions (NA4);

PMPU_cg/{cp_cfg_A_tor_lw, cp_cfg_A_na4_lw, cp_cfg_A_napot_lw}

UDB Parameters: None.

B.7.4. PMPF

Table 240. PMPF Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule

General Test Environment (PMPF):
- Runs when F and Sm are implemented and NUM_PMP_ENTRIES > 0. M-mode only, mstatus.FS != 0.
- Loads = flh, flw, fld. Stores = fsh, fsw, fsd. A width the hart does not implement raises an illegal-instruction exception before any PMP check; the access is still sampled.
- Standard region and L=1 XWR walk as in PMPSm cp_cfg_X/R/W.

cp_cfg_R

Verify that R controls floating-point loads when the entry is locked.

Six legal XWR with L=1, one entry each (as in PMPSm cp_cfg_R). flh, flw and fld at the start of the region.

Load access fault when R=0.

6 XWR × 3 loads = 18

pmp_load_fault
pmp_l_bit_m_mode_enforcement
pmp_cfg_permissions
pmp_rwx_check

cp_cfg_W

Verify that W controls floating-point stores when the entry is locked.

Same walk. fsh, fsw and fsd at the start of the region.

Store/AMO access fault when W=0.

6 XWR × 3 stores = 18

pmp_store_fault
pmp_l_bit_m_mode_enforcement
pmp_cfg_permissions
pmp_rwx_check

Table 241. PMPF Normative Rules
Normative Rule Rule Text Coverpoints

pmp_load_fault

Attempting to execute a load or load-reserved instruction that accesses a physical address within a PMP region without read permissions raises a load access-fault exception.

PMPF_cg/cp_cfg_R

pmp_store_fault

Attempting to execute a store, store-conditional, AMO, or cache-block zero instruction that accesses a physical address within a PMP region without write permissions raises a store access-fault exception.

PMPF_cg/cp_cfg_W

pmp_l_bit_m_mode_enforcement

In addition to locking the PMP entry, the L bit indicates whether the R/W/X permissions are additionally enforced on M-mode accesses. When the L bit is set, these permissions are enforced for all privilege modes. When the L bit is clear, any M-mode access matching the PMP entry will succeed; the R/W/X permissions apply only to S and U modes.

PMPF_cg/{cp_cfg_R, cp_cfg_W}

UDB Parameters: None.

B.7.5. PMPZca

Table 242. PMPZca Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule

General Test Environment (PMPZca):
- Runs when Zca and Sm are implemented and NUM_PMP_ENTRIES > 0. Zcb, Zcf and Zcd test files add their instructions; NA4, NAPOT and TOR rows need PMP_NA4_SUPPORTED, PMP_NAPOT_SUPPORTED or PMP_TOR_SUPPORTED. M-mode only.
- Loads = c.lw, c.lwsp (+ c.ld, c.ldsp on RV64; c.flw, c.flwsp with Zcf on RV32; c.fld, c.fldsp with Zcd; c.lbu, c.lh, c.lhu with Zcb).
- Stores = c.sw, c.swsp (+ c.sd, c.sdsp on RV64; c.fsw, c.fswsp with Zcf on RV32; c.fsd, c.fsdsp with Zcd; c.sb, c.sh with Zcb).
- Fetch rows jump with c.jalr to a target that holds a 32-bit ret (jalr x0, 0(ra)) or a 16-bit c.ret. c.jr, c.j and c.jal are not tested; their 32-bit forms are covered in PMPSm.
- Standard region and L=1 XWR walk as in PMPSm cp_cfg_X/R/W.

Compressed loads and stores

cp_cfg_R

Verify that R controls every compressed load when the entry is locked.

Six legal XWR with L=1, one entry each. Every compressed load at the start of the region.

Load access fault when R=0.

6 XWR × compressed loads. c.lwsp and c.ldsp are ignored in the cross.

pmp_load_fault
pmp_cfg_permissions
pmp_rwx_check
pmp_l_bit_m_mode_enforcement

cp_cfg_W

Verify that W controls every compressed store when the entry is locked.

Same walk. Every compressed store at the start of the region.

Store/AMO access fault when W=0.

6 XWR × compressed stores

pmp_cfg_permissions
pmp_store_fault
pmp_rwx_check
pmp_l_bit_m_mode_enforcement

32-bit fetch across a region boundary (IALIGN = 16)

cp_misaligned_napot

Verify that a 32-bit instruction straddling two NAPOT regions must be fully matched.

PMP_NAPOT_SUPPORTED only. Three consecutive standard NAPOT regions A, B, C in entries 0-2, all L=1, XWR = 111, 111, 000. A 32-bit ret inside A, inside B, straddling A|B and straddling B|C. c.jalr to each.

Inside a region: executes. A|B: instruction access fault, or executes if the hart splits the fetch into parcels that each match fully. B|C: instruction access fault (C has X=0). On a fault mepc holds the instruction address and a nonzero mtval holds the address of the faulting portion.

4 addresses

pmp_entry_priority
pmp_full_match_required
pmp_misaligned_access_behavior
mtval_varlen_wr
mepc_varlen_wr
pmp_exec_fault
Zca_align16
pmp_access_fault_exception

cp_misaligned_tor

Verify that a 32-bit instruction straddling two TOR regions must be fully matched.

PMP_TOR_SUPPORTED only. Three consecutive one-grain TOR regions in entries 1-3 (entry 0 is OFF and holds the bottom), all L=1, XWR = 111, 111, 000. Same four ret positions as cp_misaligned_napot.

As for cp_misaligned_napot.

4 addresses

pmp_full_match_required
pmp_misaligned_access_behavior
mtval_varlen_wr
mepc_varlen_wr
pmp_entry_priority
pmp_exec_fault
Zca_align16
pmp_access_fault_exception

cp_misaligned_na4

Verify that a 32-bit instruction straddling two NA4 regions must be fully matched.

PMP_NA4_SUPPORTED only (G = 0). Three consecutive NA4 regions in entries 0-2, all L=1, XWR = 111, 111, 000. A 32-bit ret straddling the first and second, and the second and third regions. c.jalr to each.

First|second: instruction access fault, or executes if split. Second|third: instruction access fault.

2 addresses

pmp_full_match_required
pmp_misaligned_access_behavior
mtval_varlen_wr
mepc_varlen_wr
pmp_entry_priority
pmp_exec_fault
pmp_access_fault_exception
Zca_align16

cp_misaligned_off

Verify that a 32-bit instruction straddling OFF entries' regions only sees the background entry.

Three consecutive regions in entries 0-2, all L=1, A=OFF, XWR=111. Same four ret positions as cp_misaligned_napot.

All execute: the background entry matches every byte.

4 addresses

pmp_misaligned_access_behavior
pmp_a_field_off

16-bit fetch at a region boundary

cp_cret_napot

Verify that 16-bit instructions at the edges of a NAPOT region execute.

PMP_NAPOT_SUPPORTED only. One standard NAPOT region in entry 0, L=1, XWR=111. c.ret 2 bytes below the region, at its base, 2 bytes below its top, and at its top. c.jalr to each.

All execute: each 16-bit fetch lies wholly inside the region or wholly in the background.

4 addresses

pmp_full_match_required
pmp_entry_priority
Zca_align16

cp_cret_tor

Verify that 16-bit instructions at the edges of a TOR region execute.

PMP_TOR_SUPPORTED only. One one-grain TOR region in entry 1 (bottom in pmpaddr0), L=1, XWR=111. c.ret at the same four positions as cp_cret_napot.

All execute.

4 addresses

pmp_full_match_required
pmp_entry_priority
Zca_align16

cp_cret_na4

Verify that 16-bit instructions at the edges of an NA4 region execute.

PMP_NA4_SUPPORTED only. One NA4 region in entry 0, L=1, XWR=111. c.ret at region-2, region, region+2 and region+4.

All execute.

4 addresses

pmp_full_match_required
pmp_entry_priority
Zca_align16

Table 243. PMPZca Normative Rules
Normative Rule Rule Text Coverpoints

mtval_varlen_wr

If mtval is written with a nonzero value when an instruction access-fault, page-fault, or hardware-error exception occurs on a hart with variable-length instructions, then mtval will contain the virtual address of the portion of the instruction that caused the fault

PMPZca_cg/{cp_misaligned_tor, cp_misaligned_napot, cp_misaligned_na4}, TODO: instruction page fault on the second half of a 32-bit instruction that straddles a page

mepc_varlen_wr

mepc will point to the beginning of the instruction.

PMPZca_cg/{cp_misaligned_tor, cp_misaligned_napot, cp_misaligned_na4}

pmp_full_match_required

The matching PMP entry must match all bytes of a memory operation, or the operation fails, irrespective of the L, R, W, and X bits.

PMPZca_cg/{cp_cret_tor, cp_cret_napot, cp_cret_na4, cp_misaligned_tor}

pmp_entry_priority

PMP entries are statically prioritized. The lowest-numbered PMP entry that matches any byte of a memory operation determines whether that operation succeeds or fails.

PMPZca_cg/{cp_misaligned_napot, cp_misaligned_tor, cp_misaligned_na4}

pmp_a_field_off

When A=0, this PMP entry is disabled and matches no addresses.

PMPZca_cg/cp_misaligned_off

pmp_exec_fault

Attempting to fetch an instruction from a PMP region that does not have execute permissions raises an instruction access-fault exception.

PMPZca_cg/{cp_misaligned_napot, cp_misaligned_tor, cp_misaligned_na4}

pmp_cfg_permissions

pmpcfg shows the layout of a PMP configuration register. The R, W, and X bits, when set, indicate that the PMP entry permits read, write, and instruction execution, respectively. When one of these bits is clear, the corresponding access type is denied.

PMPZca_cg/{cp_cfg_R, cp_cfg_W}

pmp_load_fault

Attempting to execute a load or load-reserved instruction that accesses a physical address within a PMP region without read permissions raises a load access-fault exception.

PMPZca_cg/cp_cfg_R

pmp_store_fault

Attempting to execute a store, store-conditional, AMO, or cache-block zero instruction that accesses a physical address within a PMP region without write permissions raises a store access-fault exception.

PMPZca_cg/cp_cfg_W

Zca_align16

The Zca extension allows 16-bit instructions to be freely intermixed with 32-bit instructions, with the latter now able to start on any 16-bit boundary, i.e., IALIGN=16.

PMPZca_cg/{cp_misaligned_napot, cp_misaligned_tor}

UDB Parameters: None.

B.7.6. PMPZicbo

Table 244. PMPZicbo Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule

General Test Environment (PMPZicbo):
- Runs when Sm and NUM_PMP_ENTRIES > 0, with Zicbom and Zicboz for the cbo rows and Zicbop for the prefetch rows. M-mode only.
- menvcfg.CBIE = 11, CBCFE = 1, CBZE = 1.
- The region under test is a 4 KiB-aligned NAPOT region much larger than a cache block, so every byte of the block has the same permissions. Misaligned or partially covered cache blocks are not tested: their behavior is unspecified (pmp_same).

cp_cbo_zero

Verify that cbo.zero needs W.

Entry 0 over the region: L=1, XWR = 000, 001, 011. cbo.zero at the start of the region.

Store/AMO access fault (mcause = 7, mtval = rs1) when W=0. Otherwise the block is zeroed.

3 XWR

pmp_store_fault
cbz_unperm_fault
cbz_access
fault_excep_csr

cp_cbo_clean
cp_cbo_flush
cp_cbo_inval

Verify that a cache-block management instruction needs R or W.

Same setup. cbo.clean, cbo.flush and cbo.inval at the start of the region.

XWR=000: store/AMO access fault (mtval = rs1). XWR = 001 or 011: no exception.

3 XWR each

cbm_unperm_fault
pmp_cbm_fault
cbm_access
fault_excep_csr

cp_prefetch_i
cp_prefetch_r
cp_prefetch_w

Verify that prefetches never trap on a PMP violation.

Six legal XWR with L=1, one entry each. prefetch.i, prefetch.r and prefetch.w at the start of the region.

No exception for any XWR.

6 XWR each

cbp_unperm_noexcep

Table 245. PMPZicbo Normative Rules
Normative Rule Rule Text Coverpoints

cbm_unperm_fault

If access to the cache block is not permitted, a cache-block management instruction raises a store page-fault or store guest-page-fault exception if address translation does not permit any access or raises a store access-fault exception otherwise.

PMPZicbo_cg/{cp_cbo_inval, cp_cbo_flush, cp_cbo_clean}

pmp_cbm_fault

The permissions required for a cache-block management instruction to access a PMP region are defined in cmo; when such access is not permitted, the instruction raises a store access-fault exception.

PMPZicbo_cg/{cp_cbo_inval, cp_cbo_flush, cp_cbo_clean}

cbz_unperm_fault

If access to the cache block is not permitted, a cache-block zero instruction raises a store page-fault or store guest-page-fault exception if address translation does not permit write access or raises a store access-fault exception otherwise.

PMPZicbo_cg/cp_cbo_zero

cbp_unperm_noexcep

If access to the cache block is not permitted, a cache-block prefetch instruction does not raise any exceptions and shall not access any caches or memory.

PMPZicbo_cg/{cp_prefetch_w, cp_prefetch_r, cp_prefetch_i}

cbm_access

A cache-block management instruction is permitted to access the specified cache block whenever a load instruction or store instruction is permitted to access the corresponding physical addresses.

PMPZicbo_cg/{cp_cbo_clean, cp_cbo_flush, cp_cbo_inval}

cbz_access

A cache-block zero instruction is permitted to access the specified cache block whenever a store instruction is permitted to access the corresponding physical addresses and when the PMAs indicate that cache-block zero instructions are a supported access type.

PMPZicbo_cg/cp_cbo_zero

pmp_store_fault

Attempting to execute a store, store-conditional, AMO, or cache-block zero instruction that accesses a physical address within a PMP region without write permissions raises a store access-fault exception.

PMPZicbo_cg/cp_cbo_zero

fault_excep_csr

When a page-fault, guest-page-fault, or access-fault exception is taken, the relevant *tval CSR is written with the faulting effective address (i.e. the value of rs1).

PMPZicbo_cg/{cp_cbo_zero, cp_cbo_clean}

UDB Parameters: None.

B.7.7. PMPZaamo

Table 246. PMPZaamo Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule

General Test Environment (PMPZaamo):
- Runs when Zaamo and Sm are implemented and NUM_PMP_ENTRIES > 0. M-mode only.
- AMOs = amoswap, amoadd, amoxor, amoand, amoor, amomin, amomax, amominu, amomaxu (.w; also .d on RV64).
- rd is checked after every AMO, and a later AMO’s return value shows whether a faulting AMO wrote memory.
- Standard region and L=1 XWR walk as in PMPSm cp_cfg_X/R/W.

cp_cfg_RW

Verify that an AMO needs both R and W, and otherwise raises a store/AMO access fault without side effects.

Six legal XWR with L=1, one entry each. Every AMO with rs1 at the start of the region.

XWR = 011 or 111: the AMO completes. Otherwise: store/AMO access fault (mcause = 7); rd and memory are unchanged.

6 XWR × 9 AMOs = 54 (108 on RV64)

pmp_violation_precise_trap
pmp_store_fault
mcause_exccode_st_sc_amo
pmp_l_bit_m_mode_enforcement
pmp_cfg_permissions
pmp_rwx_check

Table 247. PMPZaamo Normative Rules
Normative Rule Rule Text Coverpoints

pmp_store_fault

Attempting to execute a store, store-conditional, AMO, or cache-block zero instruction that accesses a physical address within a PMP region without write permissions raises a store access-fault exception.

PMPZaamo_cg/cp_cfg_RW

mcause_exccode_st_sc_amo

store, store-conditional, and AMO instructions generate store/AMO exceptions.

PMPZaamo_cg/cp_cfg_RW

pmp_l_bit_m_mode_enforcement

In addition to locking the PMP entry, the L bit indicates whether the R/W/X permissions are additionally enforced on M-mode accesses. When the L bit is set, these permissions are enforced for all privilege modes. When the L bit is clear, any M-mode access matching the PMP entry will succeed; the R/W/X permissions apply only to S and U modes.

PMPZaamo_cg/cp_cfg_RW

pmp_violation_precise_trap

PMP violations are always trapped precisely at the processor.

PMPZaamo_cg/cp_cfg_RW

UDB Parameters: None.

B.7.8. PMPZalrsc

Table 248. PMPZalrsc Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule

General Test Environment (PMPZalrsc):
- Runs when Zalrsc and Sm are implemented and NUM_PMP_ENTRIES > 0. M-mode only.
- lr.w, sc.w (also lr.d, sc.d on RV64). Each lr is followed by an sc to the same address; when W=1 the pair retries in a constrained LR/SC loop until the sc succeeds.
- Standard region and L=1 XWR walk as in PMPSm cp_cfg_X/R/W.

cp_cfg_RW

Verify that LR needs R and SC needs W.

Six legal XWR with L=1, one entry each. lr then sc at the start of the region. When R=0 the lr faults, so the sc runs without a reservation.

lr: load access fault (mcause = 5) when R=0. sc: store/AMO access fault (mcause = 7) when W=0, with or without a reservation; otherwise the sc stores.

6 XWR × 2 instructions = 12 (24 on RV64)

pmp_load_fault
pmp_store_fault
sc_retire_permission
mcause_exccode_ld_ldrsv
mcause_exccode_st_sc_amo
pmp_cfg_permissions
pmp_l_bit_m_mode_enforcement

Table 249. PMPZalrsc Normative Rules
Normative Rule Rule Text Coverpoints

pmp_load_fault

Attempting to execute a load or load-reserved instruction that accesses a physical address within a PMP region without read permissions raises a load access-fault exception.

PMPZalrsc_cg/cp_cfg_RW

pmp_store_fault

Attempting to execute a store, store-conditional, AMO, or cache-block zero instruction that accesses a physical address within a PMP region without write permissions raises a store access-fault exception.

PMPZalrsc_cg/cp_cfg_RW

sc_retire_permission

No SC.W instruction shall retire unless it passes memory permission checks,

PMPZalrsc_cg/cp_cfg_RW

mcause_exccode_ld_ldrsv

Note that load and load-reserved instructions generate load exceptions

PMPZalrsc_cg/cp_cfg_RW

UDB Parameters: None.

B.8. Sv* Virtual Memory

B.8.1. Sv

The UDB configuration file determines whether to run tests for Sv32, or for Sv39 and possibly Sv48 and Sv57.

Coverpoints that need M-mode state (mstatus.MPRV, mstatus.TVM, mstatus.SBE, or an M-mode CSR access) are in the Sm suites: SvSm, SvbareSm and SvinvalSm. The PMP suites (SvPMP, SvPMPZicbo, SvaduPMP) boot to M-mode because they program PMP entries.

Table 250. Sv Coverpoints
Coverpoint Goal Feature Description Expectation Bins ID Normative Rule

General Test Environment (Sv):
- T-SBI suite: boots to S-mode (BOOT_TO_SMODE) and drives the test from the boot identity map.
- The page under test is mapped at va_data.
- S-mode accesses run from the identity map.
- U-mode accesses use RVTEST_TSBI_GOTO_UMODE / RVTEST_TSBI_GOTO_SMODE; the handler moves execution to the U-accessible code alias va_rvtest_code_begin (registered with SAVE_AREA_SETUP) and back.
- menvcfg is written through T-SBI CSR calls.
- Page faults are delegated to S-mode, so causes are sampled from scause/stval.
- Run for every supported translation mode: Sv32 on RV32; Sv39, Sv48 and Sv57 on RV64, as selected by the UDB configuration.
- Coverpoints that need M-mode are in the SvSm sheet.

satp_asid_PPN

Verify the satp ASID and PPN fields hold zero and non-zero values

S-mode: read satp before translation is enabled (all fields 0). Then write satp with the current MODE, PPN = the identity-mapped root page table and ASID = 0, followed by writes with ASID bits set. Read satp back after each write.

satp[59:0] (satp[30:0] on RV32) reads 0 before translation is enabled and the written non-zero ASID/PPN afterwards.

satp_asid_PPN {all_zero, not_zero}
= 2 bins on RV64, 2 on RV32

satp_sz satp_acc satp_op satp_mode

satp
[norm:satp_sz] [norm:satp_acc] [norm:satp_op] [norm:satp_mode]

asid_length

Verify every implemented ASID bit is writable (determine ASIDLEN)

S-mode, with satp.MODE set and PPN = root page table: write ASID = all ones and read it back, then walk a single 1 through each ASID bit (16 bits on RV64, 9 on RV32), reading satp back each time.

Implemented ASID bits (the ASIDLEN least-significant bits) read back as written; unimplemented bits read 0.

asid_length {values}
= 1 bins on RV64, 1 on RV32

ASIDLEN

asidlen
asid_lsb_first
asidmax
[norm:ASIDLEN]

cp_access_u

Verify satp is not accessible from U-mode

With mstatus.TVM=0, switch to U-mode with RVTEST_TSBI_GOTO_UMODE and execute csrrw, csrrs and csrrc on satp, then return with RVTEST_TSBI_GOTO_SMODE.

Illegal-instruction exception (scause = 2) for each access; satp is unchanged.

Scause x tvm_mstatus x mode {U-mode}
= 1 bins on RV64, 1 on RV32

satp_sz satp_acc satp_op satp_mode

satp
[norm:satp_sz] [norm:satp_acc] [norm:satp_op] [norm:satp_mode]

cp_access_s

Verify satp is readable and writable from S-mode with csrrw, csrrs and csrrc

S-mode with mstatus.TVM=0 and scause cleared: csrrw satp with 4, csrrs with 8, csrrc with 4, reading satp back after each (satp.MODE stays Bare).

No exception; each read returns the value produced by the write.

cp_ins x Scause x tvm_mstatus x mode {S-mode}
= 3 bins on RV64, 3 on RV32

satp_sz satp_acc satp_op satp_mode

satp
[norm:satp_sz] [norm:satp_acc] [norm:satp_op] [norm:satp_mode]

cp_VA_i_mode

Verify instruction fetch at the lowest and highest virtual addresses of the translation mode

S-mode: map a 4 KiB execute-only page at VA 0 and at the highest aligned VA of the current mode (all ones); jump (jalr) to each and return.

No fault; execution runs at the extreme VA and returns.

mode_supported x VA_i
= 6 bins on RV64, 2 on RV32

satp_mode_sxlen32 satp_mode_sxlen64 satp_mode_sz satp_mode_acc satp_mode_op

satp_mode_sxlen32
satp_mode_sxlen64
Sv57_sxlen_va_sz
Sv57_vpn_sz
satp_ppn_Sv57_sz
Sv57_levels
Sv57_page_offset_sz
Sv57_ptesize
[norm:satp_mode_sxlen32] [norm:satp_mode_sxlen64] [norm:satp_mode_sz] [norm:satp_mode_acc] [norm:satp_mode_op]

cp_VA_d_mode

Verify loads and stores at the lowest and highest virtual addresses of the translation mode

S-mode: map a 4 KiB read/write page at VA 0 and at the all-ones VA of the current mode; store and load a byte at each (a word at VA 0 for Sv32 and Sv39).

No fault; each load returns the value stored.

mode_supported x VA_d
= 6 bins on RV64, 2 on RV32

satp_mode_sxlen32 satp_mode_sxlen64 satp_mode_sz satp_mode_acc satp_mode_op

satp_mode_sxlen32
satp_mode_sxlen64
Sv57_sxlen_va_sz
Sv57_vpn_sz
satp_ppn_Sv57_sz
Sv57_levels
Sv57_page_offset_sz
Sv57_ptesize
[norm:satp_mode_sxlen32] [norm:satp_mode_sxlen64] [norm:satp_mode_sz] [norm:satp_mode_acc] [norm:satp_mode_op]

cp_ins

Verify SFENCE.VMA executes in S-mode

Every Sv test executes sfence.vma x0, x0 in S-mode after each page-table update; the global-PTE test also executes sfence.vma x0, rs2 with the current ASID.

No exception.

cp_ins {sfence}
= 1 bins on RV64, 1 on RV32

satp_op_sfence_vma sfence_vma_op sfence_vma_ordering sfence_vma_invalidation sfence_vma_all_asid_va

satp_op_sfence_vma
sfence_vma_op
sfence_vma_ordering
sfence_vma_invalidation
sfence_vma_all_asid_va
[norm:satp_op_sfence_vma] [norm:sfence_vma_op] [norm:sfence_vma_ordering] [norm:sfence_vma_invalidation] [norm:sfence_vma_all_asid_va]

Nopagefault

Verify stval holds 0 while no page fault has been taken

Sampled on every instruction of the Sv tests before a page fault writes stval.

stval = 0.

Nopagefault {no_fault}
= 1 bins on RV64, 1 on RV32

cp_PTE_inv_exec_s_i

Verify an invalid leaf PTE (V=0) raises an instruction page fault on an instruction fetch from S-mode

S-mode: leaf PTE with V=0, R=W=X=1 and PTE.U=0, at every page-table level (4 KiB page and each superpage size of the Sv mode). Jump (jalr) into the page through va_data.

Instruction page fault (scause = 12); stval = faulting virtual address.

PTE_i_inv x PageType_i x ins_page_fault x exec_acc x mode {S-mode}
= 7 bins on RV64, 2 on RV32

Sv39_leaf_any_level Sv39_page_sizes Sv48_leaf_any_level Sv48_page_sizes Sv57_leaf_any_level Sv57_page_sizes stval_op_faulting_addr

[norm:Sv39_leaf_any_level] [norm:Sv39_page_sizes] [norm:Sv48_leaf_any_level] [norm:Sv48_page_sizes] [norm:Sv57_leaf_any_level] [norm:Sv57_page_sizes] [norm:stval_op_faulting_addr]

cp_PTE_inv_exec_u_i

Verify an invalid leaf PTE (V=0) raises an instruction page fault on an instruction fetch from U-mode

U-mode: leaf PTE with V=0, R=W=X=1 and PTE.U=1, at every page-table level (4 KiB page and each superpage size of the Sv mode). Jump (jalr) into the page through va_data.

Instruction page fault (scause = 12); stval = faulting virtual address.

PTE_i_inv x PageType_i x ins_page_fault x exec_acc x mode {U-mode}
= 7 bins on RV64, 2 on RV32

Sv39_leaf_any_level Sv39_page_sizes Sv48_leaf_any_level Sv48_page_sizes Sv57_leaf_any_level Sv57_page_sizes stval_op_faulting_addr

[norm:Sv39_leaf_any_level] [norm:Sv39_page_sizes] [norm:Sv48_leaf_any_level] [norm:Sv48_page_sizes] [norm:Sv57_leaf_any_level] [norm:Sv57_page_sizes] [norm:stval_op_faulting_addr]

cp_PTE_inv_read_s_d

Verify an invalid leaf PTE (V=0) raises a load page fault on a load from S-mode

S-mode: leaf PTE with V=0, R=W=X=1 and PTE.U=0, at every page-table level (4 KiB page and each superpage size of the Sv mode). Load (lw) from the page through va_data.

Load page fault (scause = 13); stval = faulting virtual address.

PTE_d_inv x PageType_d x load_page_fault x read_acc x mode {S-mode}
= 7 bins on RV64, 2 on RV32

sfence_vma_implicit_access Sv39_leaf_any_level Sv39_page_sizes Sv48_leaf_any_level Sv48_page_sizes Sv57_leaf_any_level Sv57_page_sizes stval_op_faulting_addr

sfence_vma_implicit_access
[norm:sfence_vma_implicit_access] [norm:Sv39_leaf_any_level] [norm:Sv39_page_sizes] [norm:Sv48_leaf_any_level] [norm:Sv48_page_sizes] [norm:Sv57_leaf_any_level] [norm:Sv57_page_sizes] [norm:stval_op_faulting_addr]

cp_PTE_inv_read_u_d

Verify an invalid leaf PTE (V=0) raises a load page fault on a load from U-mode

U-mode: leaf PTE with V=0, R=W=X=1 and PTE.U=1, at every page-table level (4 KiB page and each superpage size of the Sv mode). Load (lw) from the page through va_data.

Load page fault (scause = 13); stval = faulting virtual address.

PTE_d_inv x PageType_d x load_page_fault x read_acc x mode {U-mode}
= 7 bins on RV64, 2 on RV32

Sv39_leaf_any_level Sv39_page_sizes Sv48_leaf_any_level Sv48_page_sizes Sv57_leaf_any_level Sv57_page_sizes stval_op_faulting_addr

[norm:Sv39_leaf_any_level] [norm:Sv39_page_sizes] [norm:Sv48_leaf_any_level] [norm:Sv48_page_sizes] [norm:Sv57_leaf_any_level] [norm:Sv57_page_sizes] [norm:stval_op_faulting_addr]

cp_PTE_inv_write_s_d

Verify an invalid leaf PTE (V=0) raises a store/AMO page fault on a store from S-mode

S-mode: leaf PTE with V=0, R=W=X=1 and PTE.U=0, at every page-table level (4 KiB page and each superpage size of the Sv mode). Store (sw) to the page through va_data.

Store/AMO page fault (scause = 15); stval = faulting virtual address.

PTE_d_inv x PageType_d x store_page_fault x write_acc x mode {S-mode}
= 7 bins on RV64, 2 on RV32

Sv39_leaf_any_level Sv39_page_sizes Sv48_leaf_any_level Sv48_page_sizes Sv57_leaf_any_level Sv57_page_sizes stval_op_faulting_addr

[norm:Sv39_leaf_any_level] [norm:Sv39_page_sizes] [norm:Sv48_leaf_any_level] [norm:Sv48_page_sizes] [norm:Sv57_leaf_any_level] [norm:Sv57_page_sizes] [norm:stval_op_faulting_addr]

cp_PTE_inv_write_u_d

Verify an invalid leaf PTE (V=0) raises a store/AMO page fault on a store from U-mode

U-mode: leaf PTE with V=0, R=W=X=1 and PTE.U=1, at every page-table level (4 KiB page and each superpage size of the Sv mode). Store (sw) to the page through va_data.

Store/AMO page fault (scause = 15); stval = faulting virtual address.

PTE_d_inv x PageType_d x store_page_fault x write_acc x mode {U-mode}
= 7 bins on RV64, 2 on RV32

Sv39_leaf_any_level Sv39_page_sizes Sv48_leaf_any_level Sv48_page_sizes Sv57_leaf_any_level Sv57_page_sizes stval_op_faulting_addr

[norm:Sv39_leaf_any_level] [norm:Sv39_page_sizes] [norm:Sv48_leaf_any_level] [norm:Sv48_page_sizes] [norm:Sv57_leaf_any_level] [norm:Sv57_page_sizes] [norm:stval_op_faulting_addr]

cp_PTE_res_rwx_s_i_exec

Verify the reserved encoding W=1, R=0 raises an instruction page fault on an instruction fetch from S-mode

S-mode: leaf PTE with W=1 and R=0 (once with X=1, once with X=0) and PTE.U=0, at every page-table level (4 KiB page and each superpage size of the Sv mode). Jump (jalr) into the page through va_data.

Instruction page fault (scause = 12); stval = faulting virtual address.

PTE_i_res_rwx x PageType_i x ins_page_fault x exec_acc x mode {S-mode}
= 14 bins on RV64, 4 on RV32

Sv39_leaf_any_level Sv39_page_sizes Sv48_leaf_any_level Sv48_page_sizes Sv57_leaf_any_level Sv57_page_sizes stval_op_faulting_addr

[norm:Sv39_leaf_any_level] [norm:Sv39_page_sizes] [norm:Sv48_leaf_any_level] [norm:Sv48_page_sizes] [norm:Sv57_leaf_any_level] [norm:Sv57_page_sizes] [norm:stval_op_faulting_addr]

cp_PTE_res_rwx_u_i_exec

Verify the reserved encoding W=1, R=0 raises an instruction page fault on an instruction fetch from U-mode

U-mode: leaf PTE with W=1 and R=0 (once with X=1, once with X=0) and PTE.U=1, at every page-table level (4 KiB page and each superpage size of the Sv mode). Jump (jalr) into the page through va_data.

Instruction page fault (scause = 12); stval = faulting virtual address.

PTE_i_res_rwx x PageType_i x ins_page_fault x exec_acc x mode {U-mode}
= 14 bins on RV64, 4 on RV32

Sv39_leaf_any_level Sv39_page_sizes Sv48_leaf_any_level Sv48_page_sizes Sv57_leaf_any_level Sv57_page_sizes stval_op_faulting_addr

[norm:Sv39_leaf_any_level] [norm:Sv39_page_sizes] [norm:Sv48_leaf_any_level] [norm:Sv48_page_sizes] [norm:Sv57_leaf_any_level] [norm:Sv57_page_sizes] [norm:stval_op_faulting_addr]

cp_PTE_res_rwx_s_d_read

Verify the reserved encoding W=1, R=0 raises a load page fault on a load from S-mode

S-mode: leaf PTE with W=1 and R=0 (once with X=1, once with X=0) and PTE.U=0, at every page-table level (4 KiB page and each superpage size of the Sv mode). Load (lw) from the page through va_data.

Load page fault (scause = 13); stval = faulting virtual address.

PTE_d_res_rwx x PageType_d x load_page_fault x read_acc x mode {S-mode}
= 14 bins on RV64, 4 on RV32

Sv39_leaf_any_level Sv39_page_sizes Sv48_leaf_any_level Sv48_page_sizes Sv57_leaf_any_level Sv57_page_sizes stval_op_faulting_addr

[norm:Sv39_leaf_any_level] [norm:Sv39_page_sizes] [norm:Sv48_leaf_any_level] [norm:Sv48_page_sizes] [norm:Sv57_leaf_any_level] [norm:Sv57_page_sizes] [norm:stval_op_faulting_addr]

cp_PTE_res_rwx_u_d_read

Verify the reserved encoding W=1, R=0 raises a load page fault on a load from U-mode

U-mode: leaf PTE with W=1 and R=0 (once with X=1, once with X=0) and PTE.U=1, at every page-table level (4 KiB page and each superpage size of the Sv mode). Load (lw) from the page through va_data.

Load page fault (scause = 13); stval = faulting virtual address.

PTE_d_res_rwx x PageType_d x load_page_fault x read_acc x mode {U-mode}
= 14 bins on RV64, 4 on RV32

Sv39_leaf_any_level Sv39_page_sizes Sv48_leaf_any_level Sv48_page_sizes Sv57_leaf_any_level Sv57_page_sizes stval_op_faulting_addr

[norm:Sv39_leaf_any_level] [norm:Sv39_page_sizes] [norm:Sv48_leaf_any_level] [norm:Sv48_page_sizes] [norm:Sv57_leaf_any_level] [norm:Sv57_page_sizes] [norm:stval_op_faulting_addr]

cp_PTE_res_rwx_s_d_write

Verify the reserved encoding W=1, R=0 raises a store/AMO page fault on a store from S-mode

S-mode: leaf PTE with W=1 and R=0 (once with X=1, once with X=0) and PTE.U=0, at every page-table level (4 KiB page and each superpage size of the Sv mode). Store (sw) to the page through va_data.

Store/AMO page fault (scause = 15); stval = faulting virtual address.

PTE_d_res_rwx x PageType_d x store_page_fault x write_acc x mode {S-mode}
= 14 bins on RV64, 4 on RV32

Sv39_leaf_any_level Sv39_page_sizes Sv48_leaf_any_level Sv48_page_sizes Sv57_leaf_any_level Sv57_page_sizes stval_op_faulting_addr

[norm:Sv39_leaf_any_level] [norm:Sv39_page_sizes] [norm:Sv48_leaf_any_level] [norm:Sv48_page_sizes] [norm:Sv57_leaf_any_level] [norm:Sv57_page_sizes] [norm:stval_op_faulting_addr]

cp_PTE_res_rwx_u_d_write

Verify the reserved encoding W=1, R=0 raises a store/AMO page fault on a store from U-mode

U-mode: leaf PTE with W=1 and R=0 (once with X=1, once with X=0) and PTE.U=1, at every page-table level (4 KiB page and each superpage size of the Sv mode). Store (sw) to the page through va_data.

Store/AMO page fault (scause = 15); stval = faulting virtual address.

PTE_d_res_rwx x PageType_d x store_page_fault x write_acc x mode {U-mode}
= 14 bins on RV64, 4 on RV32

Sv39_leaf_any_level Sv39_page_sizes Sv48_leaf_any_level Sv48_page_sizes Sv57_leaf_any_level Sv57_page_sizes stval_op_faulting_addr

[norm:Sv39_leaf_any_level] [norm:Sv39_page_sizes] [norm:Sv48_leaf_any_level] [norm:Sv48_page_sizes] [norm:Sv57_leaf_any_level] [norm:Sv57_page_sizes] [norm:stval_op_faulting_addr]

cp_PTE_nonleaf_lvl0_s_i_exec

Verify a level-0 pointer PTE (V=1, R=W=X=0) raises an instruction page fault on an instruction fetch from S-mode

S-mode: level-0 PTE with V=1, R=W=X=0 and PTE.U=0, so the walk needs another level that does not exist. Jump (jalr) into the page through va_data.

Instruction page fault (scause = 12); stval = faulting virtual address.

PTE_nonleaf_lvl0_i x kilo_page_i x mode x ins_page_fault x exec_acc x mode {S-mode}
= 3 bins on RV64, 1 on RV32

stval_op_faulting_addr

[norm:stval_op_faulting_addr]

cp_PTE_nonleaf_lvl0_u_i_exec

Verify a level-0 pointer PTE (V=1, R=W=X=0) raises an instruction page fault on an instruction fetch from U-mode

U-mode: level-0 PTE with V=1, R=W=X=0 and PTE.U=1, so the walk needs another level that does not exist. Jump (jalr) into the page through va_data.

Instruction page fault (scause = 12); stval = faulting virtual address.

PTE_nonleaf_lvl0_i x kilo_page_i x mode x ins_page_fault x exec_acc x mode {U-mode}
= 3 bins on RV64, 1 on RV32

stval_op_faulting_addr

[norm:stval_op_faulting_addr]

cp_PTE_nonleaf_lvl0_s_d_read

Verify a level-0 pointer PTE (V=1, R=W=X=0) raises a load page fault on a load from S-mode

S-mode: level-0 PTE with V=1, R=W=X=0 and PTE.U=0, so the walk needs another level that does not exist. Load (lw) from the page through va_data.

Load page fault (scause = 13); stval = faulting virtual address.

PTE_nonleaf_lvl0_d x kilo_page_d x mode x load_page_fault x read_acc x mode {S-mode}
= 3 bins on RV64, 1 on RV32

sfence_vma_implicit_access stval_op_faulting_addr

sfence_vma_implicit_access
[norm:sfence_vma_implicit_access] [norm:stval_op_faulting_addr]

cp_PTE_nonleaf_lvl0_u_d_read

Verify a level-0 pointer PTE (V=1, R=W=X=0) raises a load page fault on a load from U-mode

U-mode: level-0 PTE with V=1, R=W=X=0 and PTE.U=1, so the walk needs another level that does not exist. Load (lw) from the page through va_data.

Load page fault (scause = 13); stval = faulting virtual address.

PTE_nonleaf_lvl0_d x kilo_page_d x mode x load_page_fault x read_acc x mode {U-mode}
= 3 bins on RV64, 1 on RV32

stval_op_faulting_addr

[norm:stval_op_faulting_addr]

cp_PTE_nonleaf_lvl0_s_d_write

Verify a level-0 pointer PTE (V=1, R=W=X=0) raises a store/AMO page fault on a store from S-mode

S-mode: level-0 PTE with V=1, R=W=X=0 and PTE.U=0, so the walk needs another level that does not exist. Store (sw) to the page through va_data.

Store/AMO page fault (scause = 15); stval = faulting virtual address.

PTE_nonleaf_lvl0_d x kilo_page_d x mode x store_page_fault x write_acc x mode {S-mode}
= 3 bins on RV64, 1 on RV32

stval_op_faulting_addr

[norm:stval_op_faulting_addr]

cp_PTE_nonleaf_lvl0_u_d_write

Verify a level-0 pointer PTE (V=1, R=W=X=0) raises a store/AMO page fault on a store from U-mode

U-mode: level-0 PTE with V=1, R=W=X=0 and PTE.U=1, so the walk needs another level that does not exist. Store (sw) to the page through va_data.

Store/AMO page fault (scause = 15); stval = faulting virtual address.

PTE_nonleaf_lvl0_d x kilo_page_d x mode x store_page_fault x write_acc x mode {U-mode}
= 3 bins on RV64, 1 on RV32

stval_op_faulting_addr

[norm:stval_op_faulting_addr]

cp_spage_exec_s_i

Verify an S-mode instruction fetch from a supervisor page succeeds when X=1, independent of SUM

S-mode: supervisor leaf PTE (U=0) at every page-table level (4 KiB page and each superpage size of the Sv mode), with X=1 (RWX, X-only, RX). Run with sstatus.SUM=0 and SUM=1. Jump (jalr) into the page through va_data.

No fault; SUM has no effect on supervisor pages.

PTE_x_spage_i x PageType_i x exec_acc x sum_sstatus x mode {S-mode}
= 14 bins on RV64, 4 on RV32

satp_op_active Sv39_sxlen Sv39_va_sz Sv39_vpn_sz satp_ppn_sv39_sz Sv39_levels Sv39_page_offset_sz Sv39_LEVELS Sv39_PTESIZE Sv39_leaf_any_level Sv39_page_sizes Sv39_pte_count Sv39_pte_sz Sv39_pt_sz Sv39_pt_align Sv48_sxlen Sv48_va_sz Sv48_vpn_sz satp_ppn_sv48_sz Sv48_levels Sv48_page_offset_sz Sv48_LEVELS Sv48_PTESIZE Sv48_leaf_any_level Sv48_page_sizes Sv57_sxlen Sv57_va_sz Sv57_vpn_sz satp_ppn_sv57_sz Sv57_levels Sv57_page_offset_sz Sv57_LEVELS Sv57_PTESIZE Sv57_leaf_any_level Sv57_page_sizes

satp_op_active
satp_ppn_Sv32_sz
Sv39_sxlen_va_sz
Sv39_vpn_sz
satp_ppn_Sv39_sz
Sv39_levels
Sv39_page_offset_sz
Sv39_ptesize
Sv39_leaf_any_level
Sv39_page_sizes
Sv39_pte_count_sz
Sv39_pt_sz
Sv39_pt_align
Sv48_sxlen
Sv48_va_sz
Sv48_vpn_sz
satp_ppn_Sv48_sz
Sv48_levels
Sv48_page_offset_sz
Sv48_ptesize
Sv48_leaf_any_level
Sv48_page_sizes
[norm:satp_op_active] [norm:Sv39_sxlen] [norm:Sv39_va_sz] [norm:Sv39_vpn_sz] [norm:satp_ppn_sv39_sz] [norm:Sv39_levels] [norm:Sv39_page_offset_sz] [norm:Sv39_LEVELS] [norm:Sv39_PTESIZE] [norm:Sv39_leaf_any_level] [norm:Sv39_page_sizes] [norm:Sv39_pte_count] [norm:Sv39_pte_sz] [norm:Sv39_pt_sz] [norm:Sv39_pt_align] [norm:Sv48_sxlen] [norm:Sv48_va_sz] [norm:Sv48_vpn_sz] [norm:satp_ppn_sv48_sz] [norm:Sv48_levels] [norm:Sv48_page_offset_sz] [norm:Sv48_LEVELS] [norm:Sv48_PTESIZE] [norm:Sv48_leaf_any_level] [norm:Sv48_page_sizes] [norm:Sv57_sxlen] [norm:Sv57_va_sz] [norm:Sv57_vpn_sz] [norm:satp_ppn_sv57_sz] [norm:Sv57_levels] [norm:Sv57_page_offset_sz] [norm:Sv57_LEVELS] [norm:Sv57_PTESIZE] [norm:Sv57_leaf_any_level] [norm:Sv57_page_sizes]

cp_spage_noexec_s_i

Verify an S-mode instruction fetch from a supervisor page with X=0 raises an instruction page fault

S-mode: supervisor leaf PTE (U=0) at every page-table level (4 KiB page and each superpage size of the Sv mode), with X=0 (RW, R-only). Run with sstatus.SUM=0 and SUM=1. Jump (jalr) into the page through va_data.

Instruction page fault (scause = 12); stval = faulting virtual address.

PTE_x_spage_i x PageType_i x ins_page_fault x exec_acc x sum_sstatus x mode {S-mode}
= 14 bins on RV64, 4 on RV32

fetch_page_fault_no_x Sv39_leaf_any_level Sv39_page_sizes Sv48_leaf_any_level Sv48_page_sizes Sv57_leaf_any_level Sv57_page_sizes stval_op_faulting_addr

fetch_page_fault_no_x
stval_op_faulting_addr
[norm:fetch_page_fault_no_x] [norm:Sv39_leaf_any_level] [norm:Sv39_page_sizes] [norm:Sv48_leaf_any_level] [norm:Sv48_page_sizes] [norm:Sv57_leaf_any_level] [norm:Sv57_page_sizes] [norm:stval_op_faulting_addr]

cp_spage_read_s_d

Verify an S-mode load from a supervisor page succeeds when R=1, independent of SUM

S-mode: supervisor leaf PTE (U=0) at every page-table level (4 KiB page and each superpage size of the Sv mode), with R=1 (RWX, RX, RW, R-only). Run with sstatus.SUM=0 and SUM=1. Load (lw) from the page through va_data.

No fault; SUM has no effect on supervisor pages.

PTE_rw_spage_d x PageType_d x read_acc x sum_sstatus x mode {S-mode}
= 14 bins on RV64, 4 on RV32

satp_op_active Sv39_sxlen Sv39_va_sz Sv39_vpn_sz satp_ppn_sv39_sz Sv39_levels Sv39_page_offset_sz Sv39_LEVELS Sv39_PTESIZE Sv39_leaf_any_level Sv39_page_sizes Sv39_pte_count Sv39_pte_sz Sv39_pt_sz Sv39_pt_align Sv48_sxlen Sv48_va_sz Sv48_vpn_sz satp_ppn_sv48_sz Sv48_levels Sv48_page_offset_sz Sv48_LEVELS Sv48_PTESIZE Sv48_leaf_any_level Sv48_page_sizes Sv57_sxlen Sv57_va_sz Sv57_vpn_sz satp_ppn_sv57_sz Sv57_levels Sv57_page_offset_sz Sv57_LEVELS Sv57_PTESIZE Sv57_leaf_any_level Sv57_page_sizes

satp_op_active
satp_ppn_Sv32_sz
Sv39_sxlen_va_sz
Sv39_vpn_sz
satp_ppn_Sv39_sz
Sv39_levels
Sv39_page_offset_sz
Sv39_ptesize
Sv39_leaf_any_level
Sv39_page_sizes
Sv39_pte_count_sz
Sv39_pt_sz
Sv39_pt_align
Sv48_sxlen
Sv48_va_sz
Sv48_vpn_sz
satp_ppn_Sv48_sz
Sv48_levels
Sv48_page_offset_sz
Sv48_ptesize
Sv48_leaf_any_level
Sv48_page_sizes
[norm:satp_op_active] [norm:Sv39_sxlen] [norm:Sv39_va_sz] [norm:Sv39_vpn_sz] [norm:satp_ppn_sv39_sz] [norm:Sv39_levels] [norm:Sv39_page_offset_sz] [norm:Sv39_LEVELS] [norm:Sv39_PTESIZE] [norm:Sv39_leaf_any_level] [norm:Sv39_page_sizes] [norm:Sv39_pte_count] [norm:Sv39_pte_sz] [norm:Sv39_pt_sz] [norm:Sv39_pt_align] [norm:Sv48_sxlen] [norm:Sv48_va_sz] [norm:Sv48_vpn_sz] [norm:satp_ppn_sv48_sz] [norm:Sv48_levels] [norm:Sv48_page_offset_sz] [norm:Sv48_LEVELS] [norm:Sv48_PTESIZE] [norm:Sv48_leaf_any_level] [norm:Sv48_page_sizes] [norm:Sv57_sxlen] [norm:Sv57_va_sz] [norm:Sv57_vpn_sz] [norm:satp_ppn_sv57_sz] [norm:Sv57_levels] [norm:Sv57_page_offset_sz] [norm:Sv57_LEVELS] [norm:Sv57_PTESIZE] [norm:Sv57_leaf_any_level] [norm:Sv57_page_sizes]

cp_spage_noread_s_d

Verify an S-mode load from a supervisor page with R=0 raises a load page fault

S-mode: supervisor leaf PTE (U=0) at every page-table level (4 KiB page and each superpage size of the Sv mode), with R=0 (X-only). Run with sstatus.SUM=0 and SUM=1. Load (lw) from the page through va_data.

Load page fault (scause = 13); stval = faulting virtual address.

PTE_rw_spage_d x PageType_d x load_page_fault x read_acc x sum_sstatus x mode {S-mode}
= 14 bins on RV64, 4 on RV32

load_page_fault_no_r Sv39_leaf_any_level Sv39_page_sizes Sv48_leaf_any_level Sv48_page_sizes Sv57_leaf_any_level Sv57_page_sizes stval_op_faulting_addr

load_page_fault_no_r
stval_op_faulting_addr
[norm:load_page_fault_no_r] [norm:Sv39_leaf_any_level] [norm:Sv39_page_sizes] [norm:Sv48_leaf_any_level] [norm:Sv48_page_sizes] [norm:Sv57_leaf_any_level] [norm:Sv57_page_sizes] [norm:stval_op_faulting_addr]

cp_spage_write_s_d

Verify an S-mode store from a supervisor page succeeds when W=1, independent of SUM

S-mode: supervisor leaf PTE (U=0) at every page-table level (4 KiB page and each superpage size of the Sv mode), with W=1 (RWX, RW). Run with sstatus.SUM=0 and SUM=1. Store (sw) to the page through va_data.

No fault; SUM has no effect on supervisor pages.

PTE_rw_spage_d x PageType_d x write_acc x sum_sstatus x mode {S-mode}
= 14 bins on RV64, 4 on RV32

satp_op_active Sv39_sxlen Sv39_va_sz Sv39_vpn_sz satp_ppn_sv39_sz Sv39_levels Sv39_page_offset_sz Sv39_LEVELS Sv39_PTESIZE Sv39_leaf_any_level Sv39_page_sizes Sv39_pte_count Sv39_pte_sz Sv39_pt_sz Sv39_pt_align Sv48_sxlen Sv48_va_sz Sv48_vpn_sz satp_ppn_sv48_sz Sv48_levels Sv48_page_offset_sz Sv48_LEVELS Sv48_PTESIZE Sv48_leaf_any_level Sv48_page_sizes Sv57_sxlen Sv57_va_sz Sv57_vpn_sz satp_ppn_sv57_sz Sv57_levels Sv57_page_offset_sz Sv57_LEVELS Sv57_PTESIZE Sv57_leaf_any_level Sv57_page_sizes

satp_ppn_Sv32_sz
Sv39_sxlen_va_sz
Sv39_vpn_sz
satp_ppn_Sv39_sz
Sv39_levels
Sv39_page_offset_sz
Sv39_ptesize
Sv39_leaf_any_level
Sv39_page_sizes
Sv39_pte_count_sz
Sv39_pt_sz
Sv39_pt_align
Sv48_sxlen
Sv48_va_sz
Sv48_vpn_sz
satp_ppn_Sv48_sz
Sv48_levels
Sv48_page_offset_sz
Sv48_ptesize
Sv48_leaf_any_level
Sv48_page_sizes
[norm:satp_op_active] [norm:Sv39_sxlen] [norm:Sv39_va_sz] [norm:Sv39_vpn_sz] [norm:satp_ppn_sv39_sz] [norm:Sv39_levels] [norm:Sv39_page_offset_sz] [norm:Sv39_LEVELS] [norm:Sv39_PTESIZE] [norm:Sv39_leaf_any_level] [norm:Sv39_page_sizes] [norm:Sv39_pte_count] [norm:Sv39_pte_sz] [norm:Sv39_pt_sz] [norm:Sv39_pt_align] [norm:Sv48_sxlen] [norm:Sv48_va_sz] [norm:Sv48_vpn_sz] [norm:satp_ppn_sv48_sz] [norm:Sv48_levels] [norm:Sv48_page_offset_sz] [norm:Sv48_LEVELS] [norm:Sv48_PTESIZE] [norm:Sv48_leaf_any_level] [norm:Sv48_page_sizes] [norm:Sv57_sxlen] [norm:Sv57_va_sz] [norm:Sv57_vpn_sz] [norm:satp_ppn_sv57_sz] [norm:Sv57_levels] [norm:Sv57_page_offset_sz] [norm:Sv57_LEVELS] [norm:Sv57_PTESIZE] [norm:Sv57_leaf_any_level] [norm:Sv57_page_sizes]

cp_spage_nowrite_s_d

Verify an S-mode store from a supervisor page with W=0 raises a store/AMO page fault

S-mode: supervisor leaf PTE (U=0) at every page-table level (4 KiB page and each superpage size of the Sv mode), with W=0 (X-only, RX, R-only). Run with sstatus.SUM=0 and SUM=1. Store (sw) to the page through va_data.

Store/AMO page fault (scause = 15); stval = faulting virtual address.

PTE_rw_spage_d x PageType_d x store_page_fault x write_acc x sum_sstatus x mode {S-mode}
= 14 bins on RV64, 4 on RV32

store_page_fault_no_w Sv39_leaf_any_level Sv39_page_sizes Sv48_leaf_any_level Sv48_page_sizes Sv57_leaf_any_level Sv57_page_sizes stval_op_faulting_addr

store_page_fault_no_w
stval_op_faulting_addr
[norm:store_page_fault_no_w] [norm:Sv39_leaf_any_level] [norm:Sv39_page_sizes] [norm:Sv48_leaf_any_level] [norm:Sv48_page_sizes] [norm:Sv57_leaf_any_level] [norm:Sv57_page_sizes] [norm:stval_op_faulting_addr]

cp_spage_rwx_s_i_noexec

Verify a U-mode instruction fetch from a supervisor page (U=0) raises an instruction page fault

U-mode: supervisor leaf PTE (U=0) with R=W=X=1, at every page-table level (4 KiB page and each superpage size of the Sv mode). Jump (jalr) into the page through va_data.

Instruction page fault (scause = 12); stval = faulting virtual address.

PTE_spage_i x PageType_i x ins_page_fault x exec_acc x mode {U-mode}
= 7 bins on RV64, 2 on RV32

fetch_page_fault_no_x Sv39_leaf_any_level Sv39_page_sizes Sv48_leaf_any_level Sv48_page_sizes Sv57_leaf_any_level Sv57_page_sizes stval_op_faulting_addr

fetch_page_fault_no_x
[norm:fetch_page_fault_no_x] [norm:Sv39_leaf_any_level] [norm:Sv39_page_sizes] [norm:Sv48_leaf_any_level] [norm:Sv48_page_sizes] [norm:Sv57_leaf_any_level] [norm:Sv57_page_sizes] [norm:stval_op_faulting_addr]

cp_spage_rwx_s_d_noread

Verify a U-mode load from a supervisor page (U=0) raises a load page fault

U-mode: supervisor leaf PTE (U=0) with R=W=X=1, at every page-table level (4 KiB page and each superpage size of the Sv mode). Load (lw) from the page through va_data.

Load page fault (scause = 13); stval = faulting virtual address.

PTE_spage_d x PageType_d x load_page_fault x read_acc x mode {U-mode}
= 7 bins on RV64, 2 on RV32

load_page_fault_no_r Sv39_leaf_any_level Sv39_page_sizes Sv48_leaf_any_level Sv48_page_sizes Sv57_leaf_any_level Sv57_page_sizes stval_op_faulting_addr

load_page_fault_no_r
pte_u_op
[norm:load_page_fault_no_r] [norm:Sv39_leaf_any_level] [norm:Sv39_page_sizes] [norm:Sv48_leaf_any_level] [norm:Sv48_page_sizes] [norm:Sv57_leaf_any_level] [norm:Sv57_page_sizes] [norm:stval_op_faulting_addr]

cp_spage_rwx_s_d_nowrite

Verify a U-mode store from a supervisor page (U=0) raises a store/AMO page fault

U-mode: supervisor leaf PTE (U=0) with R=W=X=1, at every page-table level (4 KiB page and each superpage size of the Sv mode). Store (sw) to the page through va_data.

Store/AMO page fault (scause = 15); stval = faulting virtual address.

PTE_spage_d x PageType_d x store_page_fault x write_acc x mode {U-mode}
= 7 bins on RV64, 2 on RV32

store_page_fault_no_w Sv39_leaf_any_level Sv39_page_sizes Sv48_leaf_any_level Sv48_page_sizes Sv57_leaf_any_level Sv57_page_sizes stval_op_faulting_addr

store_page_fault_no_w
[norm:store_page_fault_no_w] [norm:Sv39_leaf_any_level] [norm:Sv39_page_sizes] [norm:Sv48_leaf_any_level] [norm:Sv48_page_sizes] [norm:Sv57_leaf_any_level] [norm:Sv57_page_sizes] [norm:stval_op_faulting_addr]

cp_upage_smode_sumunset_noexec_s

Verify an S-mode instruction fetch from a user page (U=1) raises an instruction page fault when sstatus.SUM=0

S-mode with sstatus.SUM=0: user leaf PTE (U=1) swept through RWX, X-only, RX, RW and R-only, at every page-table level (4 KiB page and each superpage size of the Sv mode). Jump (jalr) into the page through va_data.

Instruction page fault (scause = 12); stval = faulting virtual address.

PTE_upage_i x PageType_i x ins_page_fault x exec_acc x sum_sstatus x mode {S-mode}
= 7 bins on RV64, 2 on RV32

sstatus_sum_sz sstatus_sum_acc sstatus_sum_op Sv39_leaf_any_level Sv39_page_sizes Sv48_leaf_any_level Sv48_page_sizes Sv57_leaf_any_level Sv57_page_sizes stval_op_faulting_addr

sstatus_sum
pte_u_no_s_exec
[norm:sstatus_sum_sz] [norm:sstatus_sum_acc] [norm:sstatus_sum_op] [norm:Sv39_leaf_any_level] [norm:Sv39_page_sizes] [norm:Sv48_leaf_any_level] [norm:Sv48_page_sizes] [norm:Sv57_leaf_any_level] [norm:Sv57_page_sizes] [norm:stval_op_faulting_addr]

cp_upage_smode_sumunset_noread_s

Verify an S-mode load from a user page (U=1) raises a load page fault when sstatus.SUM=0

S-mode with sstatus.SUM=0: user leaf PTE (U=1) swept through RWX, X-only, RX, RW and R-only, at every page-table level (4 KiB page and each superpage size of the Sv mode). Load (lw) from the page through va_data.

Load page fault (scause = 13); stval = faulting virtual address.

PTE_upage_d x PageType_d x load_page_fault x read_acc x sum_sstatus x mode {S-mode}
= 7 bins on RV64, 2 on RV32

sstatus_sum_sz sstatus_sum_acc sstatus_sum_op Sv39_leaf_any_level Sv39_page_sizes Sv48_leaf_any_level Sv48_page_sizes Sv57_leaf_any_level Sv57_page_sizes stval_op_faulting_addr

mstatus_sum_op
sstatus_sum
pte_u_op
[norm:sstatus_sum_sz] [norm:sstatus_sum_acc] [norm:sstatus_sum_op] [norm:Sv39_leaf_any_level] [norm:Sv39_page_sizes] [norm:Sv48_leaf_any_level] [norm:Sv48_page_sizes] [norm:Sv57_leaf_any_level] [norm:Sv57_page_sizes] [norm:stval_op_faulting_addr]

cp_upage_smode_sumunset_nowrite_s

Verify an S-mode store from a user page (U=1) raises a store/AMO page fault when sstatus.SUM=0

S-mode with sstatus.SUM=0: user leaf PTE (U=1) swept through RWX, X-only, RX, RW and R-only, at every page-table level (4 KiB page and each superpage size of the Sv mode). Store (sw) to the page through va_data.

Store/AMO page fault (scause = 15); stval = faulting virtual address.

PTE_upage_d x PageType_d x store_page_fault x write_acc x sum_sstatus x mode {S-mode}
= 7 bins on RV64, 2 on RV32

sstatus_sum_sz sstatus_sum_acc sstatus_sum_op Sv39_leaf_any_level Sv39_page_sizes Sv48_leaf_any_level Sv48_page_sizes Sv57_leaf_any_level Sv57_page_sizes stval_op_faulting_addr

mstatus_sum_op
[norm:sstatus_sum_sz] [norm:sstatus_sum_acc] [norm:sstatus_sum_op] [norm:Sv39_leaf_any_level] [norm:Sv39_page_sizes] [norm:Sv48_leaf_any_level] [norm:Sv48_page_sizes] [norm:Sv57_leaf_any_level] [norm:Sv57_page_sizes] [norm:stval_op_faulting_addr]

cp_upage_smode_sumset_noexec_s

Verify S-mode can never fetch from a user page, even with sstatus.SUM=1

S-mode with sstatus.SUM=1: user leaf PTE (U=1) with X=1 (RWX, X-only, RX), at every page-table level (4 KiB page and each superpage size of the Sv mode). Jump (jalr) into the page.

Instruction page fault (scause = 12); stval = faulting virtual address.

PTE_upage_i x PageType_i x ins_page_fault x exec_acc x sum_sstatus x mode {S-mode}
= 7 bins on RV64, 2 on RV32

sstatus_sum_sz sstatus_sum_acc sstatus_sum_op Sv39_leaf_any_level Sv39_page_sizes Sv48_leaf_any_level Sv48_page_sizes Sv57_leaf_any_level Sv57_page_sizes stval_op_faulting_addr

sstatus_sum
pte_u_no_s_exec
[norm:sstatus_sum_sz] [norm:sstatus_sum_acc] [norm:sstatus_sum_op] [norm:Sv39_leaf_any_level] [norm:Sv39_page_sizes] [norm:Sv48_leaf_any_level] [norm:Sv48_page_sizes] [norm:Sv57_leaf_any_level] [norm:Sv57_page_sizes] [norm:stval_op_faulting_addr]

cp_upage_smode_sumset_read_s

Verify an S-mode load from a user page succeeds when sstatus.SUM=1

S-mode with sstatus.SUM=1: user leaf PTE (U=1) with R=1 (RWX, RX, RW, R-only), at every page-table level (4 KiB page and each superpage size of the Sv mode). Load (lw) from the page through va_data.

No fault.

PTE_upage_d x PageType_d x read_acc x sum_sstatus x mode {S-mode}
= 7 bins on RV64, 2 on RV32

sstatus_sum_sz sstatus_sum_acc sstatus_sum_op Sv39_leaf_any_level Sv39_page_sizes Sv48_leaf_any_level Sv48_page_sizes Sv57_leaf_any_level Sv57_page_sizes

mstatus_sum_op
sstatus_sum
pte_u_op
[norm:sstatus_sum_sz] [norm:sstatus_sum_acc] [norm:sstatus_sum_op] [norm:Sv39_leaf_any_level] [norm:Sv39_page_sizes] [norm:Sv48_leaf_any_level] [norm:Sv48_page_sizes] [norm:Sv57_leaf_any_level] [norm:Sv57_page_sizes]

cp_upage_smode_sumset_write_s

Verify an S-mode store from a user page succeeds when sstatus.SUM=1

S-mode with sstatus.SUM=1: user leaf PTE (U=1) with W=1 (RWX, RW), at every page-table level (4 KiB page and each superpage size of the Sv mode). Store (sw) to the page through va_data.

No fault.

PTE_upage_d x PageType_d x write_acc x sum_sstatus x mode {S-mode}
= 7 bins on RV64, 2 on RV32

sstatus_sum_sz sstatus_sum_acc sstatus_sum_op Sv39_leaf_any_level Sv39_page_sizes Sv48_leaf_any_level Sv48_page_sizes Sv57_leaf_any_level Sv57_page_sizes

mstatus_sum_op
[norm:sstatus_sum_sz] [norm:sstatus_sum_acc] [norm:sstatus_sum_op] [norm:Sv39_leaf_any_level] [norm:Sv39_page_sizes] [norm:Sv48_leaf_any_level] [norm:Sv48_page_sizes] [norm:Sv57_leaf_any_level] [norm:Sv57_page_sizes]

cp_upage_umode_exec_u

Verify a U-mode instruction fetch from a user page succeeds when X=1

U-mode: user leaf PTE (U=1) with X=1 (RWX, X-only, RX), at every page-table level (4 KiB page and each superpage size of the Sv mode). Jump (jalr) into the page through va_data.

No fault.

PTE_x_upage_i x PageType_i x exec_acc x mode {U-mode}
= 7 bins on RV64, 2 on RV32

satp_op_active Sv39_leaf_any_level Sv39_page_sizes Sv48_leaf_any_level Sv48_page_sizes Sv57_leaf_any_level Sv57_page_sizes

[norm:satp_op_active] [norm:Sv39_leaf_any_level] [norm:Sv39_page_sizes] [norm:Sv48_leaf_any_level] [norm:Sv48_page_sizes] [norm:Sv57_leaf_any_level] [norm:Sv57_page_sizes]

cp_upage_umode_noexec_u

Verify a U-mode instruction fetch from a user page with X=0 raises an instruction page fault

U-mode: user leaf PTE (U=1) with X=0 (RW, R-only), at every page-table level (4 KiB page and each superpage size of the Sv mode). Jump (jalr) into the page through va_data.

Instruction page fault (scause = 12); stval = faulting virtual address.

PTE_x_upage_i x PageType_i x ins_page_fault x exec_acc x mode {U-mode}
= 7 bins on RV64, 2 on RV32

fetch_page_fault_no_x Sv39_leaf_any_level Sv39_page_sizes Sv48_leaf_any_level Sv48_page_sizes Sv57_leaf_any_level Sv57_page_sizes stval_op_faulting_addr

fetch_page_fault_no_x
[norm:fetch_page_fault_no_x] [norm:Sv39_leaf_any_level] [norm:Sv39_page_sizes] [norm:Sv48_leaf_any_level] [norm:Sv48_page_sizes] [norm:Sv57_leaf_any_level] [norm:Sv57_page_sizes] [norm:stval_op_faulting_addr]

cp_upage_umode_read_u

Verify a U-mode load from a user page succeeds when R=1

U-mode: user leaf PTE (U=1) with R=1 (RWX, RX, RW, R-only), at every page-table level (4 KiB page and each superpage size of the Sv mode). Load (lw) from the page through va_data.

No fault.

PTE_rw_upage_d x PageType_d x read_acc x mode {U-mode}
= 7 bins on RV64, 2 on RV32

satp_op_active Sv39_leaf_any_level Sv39_page_sizes Sv48_leaf_any_level Sv48_page_sizes Sv57_leaf_any_level Sv57_page_sizes

satp_op_active
pte_u_op
[norm:satp_op_active] [norm:Sv39_leaf_any_level] [norm:Sv39_page_sizes] [norm:Sv48_leaf_any_level] [norm:Sv48_page_sizes] [norm:Sv57_leaf_any_level] [norm:Sv57_page_sizes]

cp_upage_umode_noread_u

Verify a U-mode load from a user page with R=0 raises a load page fault

U-mode: user leaf PTE (U=1) with R=0 (X-only), at every page-table level (4 KiB page and each superpage size of the Sv mode). Load (lw) from the page through va_data.

Load page fault (scause = 13); stval = faulting virtual address.

PTE_rw_upage_d x PageType_d x load_page_fault x read_acc x mode {U-mode}
= 7 bins on RV64, 2 on RV32

load_page_fault_no_r Sv39_leaf_any_level Sv39_page_sizes Sv48_leaf_any_level Sv48_page_sizes Sv57_leaf_any_level Sv57_page_sizes stval_op_faulting_addr

load_page_fault_no_r
[norm:load_page_fault_no_r] [norm:Sv39_leaf_any_level] [norm:Sv39_page_sizes] [norm:Sv48_leaf_any_level] [norm:Sv48_page_sizes] [norm:Sv57_leaf_any_level] [norm:Sv57_page_sizes] [norm:stval_op_faulting_addr]

cp_upage_umode_write_u

Verify a U-mode store from a user page succeeds when W=1

U-mode: user leaf PTE (U=1) with W=1 (RWX, RW), at every page-table level (4 KiB page and each superpage size of the Sv mode). Store (sw) to the page through va_data.

No fault.

PTE_rw_upage_d x PageType_d x write_acc x mode {U-mode}
= 7 bins on RV64, 2 on RV32

satp_op_active Sv39_leaf_any_level Sv39_page_sizes Sv48_leaf_any_level Sv48_page_sizes Sv57_leaf_any_level Sv57_page_sizes

[norm:satp_op_active] [norm:Sv39_leaf_any_level] [norm:Sv39_page_sizes] [norm:Sv48_leaf_any_level] [norm:Sv48_page_sizes] [norm:Sv57_leaf_any_level] [norm:Sv57_page_sizes]

cp_upage_umode_nowrite_u

Verify a U-mode store from a user page with W=0 raises a store/AMO page fault

U-mode: user leaf PTE (U=1) with W=0 (X-only, RX, R-only), at every page-table level (4 KiB page and each superpage size of the Sv mode). Store (sw) to the page through va_data.

Store/AMO page fault (scause = 15); stval = faulting virtual address.

PTE_rw_upage_d x PageType_d x store_page_fault x write_acc x mode {U-mode}
= 7 bins on RV64, 2 on RV32

store_page_fault_no_w Sv39_leaf_any_level Sv39_page_sizes Sv48_leaf_any_level Sv48_page_sizes Sv57_leaf_any_level Sv57_page_sizes stval_op_faulting_addr

store_page_fault_no_w
[norm:store_page_fault_no_w] [norm:Sv39_leaf_any_level] [norm:Sv39_page_sizes] [norm:Sv48_leaf_any_level] [norm:Sv48_page_sizes] [norm:Sv57_leaf_any_level] [norm:Sv57_page_sizes] [norm:stval_op_faulting_addr]

cp_xpage_mxrunset_read_s

Verify an S-mode load from an execute-only page faults when sstatus.MXR=0

S-mode: execute-only leaf PTE (R=W=0, X=1) with PTE.U=0, at every page-table level (4 KiB page and each superpage size of the Sv mode); clear sstatus.MXR. Load (lw) through va_data (a store is also attempted).

Load page fault (scause = 13); the store raises a store/AMO page fault (scause = 15).

PTE_XnoRW_d x PageType_d x load_page_fault x read_acc x mxr_sstatus x mode {S-mode}
= 7 bins on RV64, 2 on RV32

sstatus_mxr_sz sstatus_mxr_acc sstatus_mxr_op sfence_vma_sum_mxr_effect Sv39_leaf_any_level Sv39_page_sizes Sv48_leaf_any_level Sv48_page_sizes Sv57_leaf_any_level Sv57_page_sizes stval_op_faulting_addr

mstatus_mxr_op
sstatus_mxr
sfence_vma_sum_mxr_effect
[norm:sstatus_mxr_sz] [norm:sstatus_mxr_acc] [norm:sstatus_mxr_op] [norm:sfence_vma_sum_mxr_effect] [norm:Sv39_leaf_any_level] [norm:Sv39_page_sizes] [norm:Sv48_leaf_any_level] [norm:Sv48_page_sizes] [norm:Sv57_leaf_any_level] [norm:Sv57_page_sizes] [norm:stval_op_faulting_addr]

cp_xpage_mxrunset_read_u

Verify a U-mode load from an execute-only page faults when sstatus.MXR=0

U-mode: execute-only leaf PTE (R=W=0, X=1) with PTE.U=1, at every page-table level (4 KiB page and each superpage size of the Sv mode); clear sstatus.MXR. Load (lw) through va_data (a store is also attempted).

Load page fault (scause = 13); the store raises a store/AMO page fault (scause = 15).

PTE_XnoRW_d x PageType_d x load_page_fault x read_acc x mxr_sstatus x mode {U-mode}
= 7 bins on RV64, 2 on RV32

sstatus_mxr_sz sstatus_mxr_acc sstatus_mxr_op sfence_vma_sum_mxr_effect Sv39_leaf_any_level Sv39_page_sizes Sv48_leaf_any_level Sv48_page_sizes Sv57_leaf_any_level Sv57_page_sizes stval_op_faulting_addr

mstatus_mxr_op
sstatus_mxr
sfence_vma_sum_mxr_effect
[norm:sstatus_mxr_sz] [norm:sstatus_mxr_acc] [norm:sstatus_mxr_op] [norm:sfence_vma_sum_mxr_effect] [norm:Sv39_leaf_any_level] [norm:Sv39_page_sizes] [norm:Sv48_leaf_any_level] [norm:Sv48_page_sizes] [norm:Sv57_leaf_any_level] [norm:Sv57_page_sizes] [norm:stval_op_faulting_addr]

cp_xpage_mxrset_read_s

Verify an S-mode load from an execute-only page succeeds when sstatus.MXR=1

S-mode: execute-only leaf PTE (R=W=0, X=1) with PTE.U=0, at every page-table level (4 KiB page and each superpage size of the Sv mode); set sstatus.MXR. Load (lw) through va_data (a store is also attempted).

The load succeeds; the store still raises a store/AMO page fault (scause = 15).

PTE_XnoRW_d x PageType_d x mxr_sstatus x read_acc x mode {S-mode}
= 7 bins on RV64, 2 on RV32

sstatus_mxr_sz sstatus_mxr_acc sstatus_mxr_op sfence_vma_sum_mxr_effect Sv39_leaf_any_level Sv39_page_sizes Sv48_leaf_any_level Sv48_page_sizes Sv57_leaf_any_level Sv57_page_sizes

mstatus_mxr_op
sstatus_mxr
sfence_vma_sum_mxr_effect
[norm:sstatus_mxr_sz] [norm:sstatus_mxr_acc] [norm:sstatus_mxr_op] [norm:sfence_vma_sum_mxr_effect] [norm:Sv39_leaf_any_level] [norm:Sv39_page_sizes] [norm:Sv48_leaf_any_level] [norm:Sv48_page_sizes] [norm:Sv57_leaf_any_level] [norm:Sv57_page_sizes]

cp_xpage_mxrset_read_u

Verify a U-mode load from an execute-only page succeeds when sstatus.MXR=1

U-mode: execute-only leaf PTE (R=W=0, X=1) with PTE.U=1, at every page-table level (4 KiB page and each superpage size of the Sv mode); set sstatus.MXR. Load (lw) through va_data (a store is also attempted).

The load succeeds; the store still raises a store/AMO page fault (scause = 15).

PTE_XnoRW_d x PageType_d x mxr_sstatus x read_acc x mode {U-mode}
= 7 bins on RV64, 2 on RV32

sstatus_mxr_sz sstatus_mxr_acc sstatus_mxr_op sfence_vma_sum_mxr_effect Sv39_leaf_any_level Sv39_page_sizes Sv48_leaf_any_level Sv48_page_sizes Sv57_leaf_any_level Sv57_page_sizes

mstatus_mxr_op
sstatus_mxr
sfence_vma_sum_mxr_effect
[norm:sstatus_mxr_sz] [norm:sstatus_mxr_acc] [norm:sstatus_mxr_op] [norm:sfence_vma_sum_mxr_effect] [norm:Sv39_leaf_any_level] [norm:Sv39_page_sizes] [norm:Sv48_leaf_any_level] [norm:Sv48_page_sizes] [norm:Sv57_leaf_any_level] [norm:Sv57_page_sizes]

cp_PTE_DAU_nleaf_read_s

Verify D, A or U set in a non-leaf PTE raises a load page fault on a load from S-mode

S-mode: valid level-0 leaf PTE (PTE.U=0); in each non-leaf PTE above it, set D, then A, then U (one at a time). Load (lw) from the page through va_data. Requires privileged spec 1.12 or later.

Load page fault (scause = 13); stval = faulting virtual address.

PTE_DAU_d x PageType_d x load_page_fault x mode {S-mode}
= 15 bins on RV64, 3 on RV32

Sv39_leaf_any_level Sv39_page_sizes Sv48_leaf_any_level Sv48_page_sizes Sv57_leaf_any_level Sv57_page_sizes stval_op_faulting_addr

[norm:Sv39_leaf_any_level] [norm:Sv39_page_sizes] [norm:Sv48_leaf_any_level] [norm:Sv48_page_sizes] [norm:Sv57_leaf_any_level] [norm:Sv57_page_sizes] [norm:stval_op_faulting_addr]

cp_PTE_DAU_nleaf_read_u

Verify D, A or U set in a non-leaf PTE raises a load page fault on a load from U-mode

U-mode: valid level-0 leaf PTE (PTE.U=1); in each non-leaf PTE above it, set D, then A, then U (one at a time). Load (lw) from the page through va_data. Requires privileged spec 1.12 or later.

Load page fault (scause = 13); stval = faulting virtual address.

PTE_DAU_d x PageType_d x load_page_fault x mode {U-mode}
= 15 bins on RV64, 3 on RV32

Sv39_leaf_any_level Sv39_page_sizes Sv48_leaf_any_level Sv48_page_sizes Sv57_leaf_any_level Sv57_page_sizes stval_op_faulting_addr

[norm:Sv39_leaf_any_level] [norm:Sv39_page_sizes] [norm:Sv48_leaf_any_level] [norm:Sv48_page_sizes] [norm:Sv57_leaf_any_level] [norm:Sv57_page_sizes] [norm:stval_op_faulting_addr]

cp_PTE_DAU_nleaf_write_s

Verify D, A or U set in a non-leaf PTE raises a store/AMO page fault on a store from S-mode

S-mode: valid level-0 leaf PTE (PTE.U=0); in each non-leaf PTE above it, set D, then A, then U (one at a time). Store (sw) to the page through va_data. Requires privileged spec 1.12 or later.

Store/AMO page fault (scause = 15); stval = faulting virtual address.

PTE_DAU_d x PageType_d x store_page_fault x mode {S-mode}
= 15 bins on RV64, 3 on RV32

Sv39_leaf_any_level Sv39_page_sizes Sv48_leaf_any_level Sv48_page_sizes Sv57_leaf_any_level Sv57_page_sizes stval_op_faulting_addr

[norm:Sv39_leaf_any_level] [norm:Sv39_page_sizes] [norm:Sv48_leaf_any_level] [norm:Sv48_page_sizes] [norm:Sv57_leaf_any_level] [norm:Sv57_page_sizes] [norm:stval_op_faulting_addr]

cp_PTE_DAU_nleaf_write_u

Verify D, A or U set in a non-leaf PTE raises a store/AMO page fault on a store from U-mode

U-mode: valid level-0 leaf PTE (PTE.U=1); in each non-leaf PTE above it, set D, then A, then U (one at a time). Store (sw) to the page through va_data. Requires privileged spec 1.12 or later.

Store/AMO page fault (scause = 15); stval = faulting virtual address.

PTE_DAU_d x PageType_d x store_page_fault x mode {U-mode}
= 15 bins on RV64, 3 on RV32

Sv39_leaf_any_level Sv39_page_sizes Sv48_leaf_any_level Sv48_page_sizes Sv57_leaf_any_level Sv57_page_sizes stval_op_faulting_addr

[norm:Sv39_leaf_any_level] [norm:Sv39_page_sizes] [norm:Sv48_leaf_any_level] [norm:Sv48_page_sizes] [norm:Sv57_leaf_any_level] [norm:Sv57_page_sizes] [norm:stval_op_faulting_addr]

cp_PTE_DAU_nleaf_exec_s

Verify D, A or U set in a non-leaf PTE raises an instruction page fault on an instruction fetch from S-mode

S-mode: valid level-0 leaf PTE (PTE.U=0); in each non-leaf PTE above it, set D, then A, then U (one at a time). Jump (jalr) into the page through va_data. Requires privileged spec 1.12 or later.

Instruction page fault (scause = 12); stval = faulting virtual address.

PTE_DAU_i x PageType_i x ins_page_fault x mode {S-mode}
= 15 bins on RV64, 3 on RV32

Sv39_leaf_any_level Sv39_page_sizes Sv48_leaf_any_level Sv48_page_sizes Sv57_leaf_any_level Sv57_page_sizes stval_op_faulting_addr

[norm:Sv39_leaf_any_level] [norm:Sv39_page_sizes] [norm:Sv48_leaf_any_level] [norm:Sv48_page_sizes] [norm:Sv57_leaf_any_level] [norm:Sv57_page_sizes] [norm:stval_op_faulting_addr]

cp_PTE_DAU_nleaf_exec_u

Verify D, A or U set in a non-leaf PTE raises an instruction page fault on an instruction fetch from U-mode

U-mode: valid level-0 leaf PTE (PTE.U=1); in each non-leaf PTE above it, set D, then A, then U (one at a time). Jump (jalr) into the page through va_data. Requires privileged spec 1.12 or later.

Instruction page fault (scause = 12); stval = faulting virtual address.

PTE_DAU_i x PageType_i x ins_page_fault x mode {U-mode}
= 15 bins on RV64, 3 on RV32

Sv39_leaf_any_level Sv39_page_sizes Sv48_leaf_any_level Sv48_page_sizes Sv57_leaf_any_level Sv57_page_sizes stval_op_faulting_addr

[norm:Sv39_leaf_any_level] [norm:Sv39_page_sizes] [norm:Sv48_leaf_any_level] [norm:Sv48_page_sizes] [norm:Sv57_leaf_any_level] [norm:Sv57_page_sizes] [norm:stval_op_faulting_addr]

cp_PTE_rsv_nleaf_read_s

Verify any of bits 63:54 set in a non-leaf PTE raises a load page fault on a load from S-mode

RV64, S-mode: valid level-0 leaf PTE; in each non-leaf PTE above it, set each of bits 63 (N), 62:61 (PBMT), and 60:54 in turn. These bits are reserved in non-leaf PTEs whether or not Svnapot and Svpbmt are implemented. Load (lw) from the page through va_data. Requires privileged spec 1.12 or later.

Load page fault (scause = 13); stval = faulting virtual address.

PTE_nonleaf_d x PTE_nonleaf_rsv_d x PageType_d x load_page_fault x mode {S-mode}
= 50 bins on RV64 (RV64 only)

Sv39_pte_future_rsv Svpbmt_nonleaf_pte_pbmt_must_be_zero stval_op_faulting_addr

[norm:Sv39_pte_future_rsv] [norm:Svpbmt_nonleaf_pte_pbmt_must_be_zero] [norm:stval_op_faulting_addr]

cp_PTE_rsv_nleaf_write_s

Verify any of bits 63:54 set in a non-leaf PTE raises a store/AMO page fault on a store from S-mode

RV64, S-mode: valid level-0 leaf PTE; in each non-leaf PTE above it, set each of bits 63 (N), 62:61 (PBMT), and 60:54 in turn. These bits are reserved in non-leaf PTEs whether or not Svnapot and Svpbmt are implemented. Store (sw) to the page through va_data. Requires privileged spec 1.12 or later.

Store/AMO page fault (scause = 15); stval = faulting virtual address.

PTE_nonleaf_d x PTE_nonleaf_rsv_d x PageType_d x store_page_fault x mode {S-mode}
= 50 bins on RV64 (RV64 only)

Sv39_pte_future_rsv Svpbmt_nonleaf_pte_pbmt_must_be_zero stval_op_faulting_addr

[norm:Sv39_pte_future_rsv] [norm:Svpbmt_nonleaf_pte_pbmt_must_be_zero] [norm:stval_op_faulting_addr]

cp_PTE_rsv_nleaf_exec_s

Verify any of bits 63:54 set in a non-leaf PTE raises an instruction page fault on an instruction fetch from S-mode

RV64, S-mode: valid level-0 leaf PTE; in each non-leaf PTE above it, set each of bits 63 (N), 62:61 (PBMT), and 60:54 in turn. These bits are reserved in non-leaf PTEs whether or not Svnapot and Svpbmt are implemented. Jump (jalr) into the page through va_data. Requires privileged spec 1.12 or later.

Instruction page fault (scause = 12); stval = faulting virtual address.

PTE_nonleaf_i x PTE_nonleaf_rsv_i x PageType_i x ins_page_fault x mode {S-mode}
= 50 bins on RV64 (RV64 only)

Sv39_pte_future_rsv Svpbmt_nonleaf_pte_pbmt_must_be_zero stval_op_faulting_addr

[norm:Sv39_pte_future_rsv] [norm:Svpbmt_nonleaf_pte_pbmt_must_be_zero] [norm:stval_op_faulting_addr]

cp_misaligned_exec_s

Verify a misaligned superpage raises an instruction page fault on an instruction fetch from S-mode

S-mode: superpage leaf PTE (level 1 and above) with PTE.U=0 whose PPN has non-zero bits below the superpage size, at each superpage level. Jump (jalr) into the page through va_data.

Instruction page fault (scause = 12); stval = faulting virtual address.

PTE_RWX_i x misaligned_PPN_i x ins_page_fault x exec_acc
= 5 bins on RV64, 1 on RV32

Sv39_superpage_align Sv39_superpage_align_fault Sv48_superpage_align Sv48_superpage_align_fault Sv57_superpage_align Sv57_superpage_align_fault stval_op_faulting_addr

Sv39_superpage_align
Sv39_superpage_align_fault
Sv48_superpage_align
Sv48_superpage_align_fault
[norm:Sv39_superpage_align] [norm:Sv39_superpage_align_fault] [norm:Sv48_superpage_align] [norm:Sv48_superpage_align_fault] [norm:Sv57_superpage_align] [norm:Sv57_superpage_align_fault] [norm:stval_op_faulting_addr]

cp_misaligned_exec_u

Verify a misaligned superpage raises an instruction page fault on an instruction fetch from U-mode

U-mode: superpage leaf PTE (level 1 and above) with PTE.U=1 whose PPN has non-zero bits below the superpage size, at each superpage level. Jump (jalr) into the page through va_data.

Instruction page fault (scause = 12); stval = faulting virtual address.

PTE_RWX_i x misaligned_PPN_i x ins_page_fault x exec_acc
= 5 bins on RV64, 1 on RV32

Sv39_superpage_align Sv39_superpage_align_fault Sv48_superpage_align Sv48_superpage_align_fault Sv57_superpage_align Sv57_superpage_align_fault stval_op_faulting_addr

[norm:Sv39_superpage_align] [norm:Sv39_superpage_align_fault] [norm:Sv48_superpage_align] [norm:Sv48_superpage_align_fault] [norm:Sv57_superpage_align] [norm:Sv57_superpage_align_fault] [norm:stval_op_faulting_addr]

cp_misaligned_read_s

Verify a misaligned superpage raises a load page fault on a load from S-mode

S-mode: superpage leaf PTE (level 1 and above) with PTE.U=0 whose PPN has non-zero bits below the superpage size, at each superpage level. Load (lw) from the page through va_data.

Load page fault (scause = 13); stval = faulting virtual address.

PTE_RWX_d x misaligned_PPN_d x load_page_fault x read_acc
= 5 bins on RV64, 1 on RV32

Sv39_superpage_align Sv39_superpage_align_fault Sv48_superpage_align Sv48_superpage_align_fault Sv57_superpage_align Sv57_superpage_align_fault stval_op_faulting_addr

Sv39_superpage_align
Sv39_superpage_align_fault
Sv48_superpage_align
Sv48_superpage_align_fault
[norm:Sv39_superpage_align] [norm:Sv39_superpage_align_fault] [norm:Sv48_superpage_align] [norm:Sv48_superpage_align_fault] [norm:Sv57_superpage_align] [norm:Sv57_superpage_align_fault] [norm:stval_op_faulting_addr]

cp_misaligned_read_u

Verify a misaligned superpage raises a load page fault on a load from U-mode

U-mode: superpage leaf PTE (level 1 and above) with PTE.U=1 whose PPN has non-zero bits below the superpage size, at each superpage level. Load (lw) from the page through va_data.

Load page fault (scause = 13); stval = faulting virtual address.

PTE_RWX_d x misaligned_PPN_d x load_page_fault x read_acc
= 5 bins on RV64, 1 on RV32

Sv39_superpage_align Sv39_superpage_align_fault Sv48_superpage_align Sv48_superpage_align_fault Sv57_superpage_align Sv57_superpage_align_fault stval_op_faulting_addr

[norm:Sv39_superpage_align] [norm:Sv39_superpage_align_fault] [norm:Sv48_superpage_align] [norm:Sv48_superpage_align_fault] [norm:Sv57_superpage_align] [norm:Sv57_superpage_align_fault] [norm:stval_op_faulting_addr]

cp_misaligned_write_s

Verify a misaligned superpage raises a store/AMO page fault on a store from S-mode

S-mode: superpage leaf PTE (level 1 and above) with PTE.U=0 whose PPN has non-zero bits below the superpage size, at each superpage level. Store (sw) to the page through va_data.

Store/AMO page fault (scause = 15); stval = faulting virtual address.

PTE_RWX_d x misaligned_PPN_d x store_page_fault x write_acc
= 5 bins on RV64, 1 on RV32

Sv39_superpage_align Sv39_superpage_align_fault Sv48_superpage_align Sv48_superpage_align_fault Sv57_superpage_align Sv57_superpage_align_fault stval_op_faulting_addr

Sv39_superpage_align
Sv39_superpage_align_fault
Sv48_superpage_align
Sv48_superpage_align_fault
[norm:Sv39_superpage_align] [norm:Sv39_superpage_align_fault] [norm:Sv48_superpage_align] [norm:Sv48_superpage_align_fault] [norm:Sv57_superpage_align] [norm:Sv57_superpage_align_fault] [norm:stval_op_faulting_addr]

cp_misaligned_write_u

Verify a misaligned superpage raises a store/AMO page fault on a store from U-mode

U-mode: superpage leaf PTE (level 1 and above) with PTE.U=1 whose PPN has non-zero bits below the superpage size, at each superpage level. Store (sw) to the page through va_data.

Store/AMO page fault (scause = 15); stval = faulting virtual address.

PTE_RWX_d x misaligned_PPN_d x store_page_fault x write_acc
= 5 bins on RV64, 1 on RV32

Sv39_superpage_align Sv39_superpage_align_fault Sv48_superpage_align Sv48_superpage_align_fault Sv57_superpage_align Sv57_superpage_align_fault stval_op_faulting_addr

[norm:Sv39_superpage_align] [norm:Sv39_superpage_align_fault] [norm:Sv48_superpage_align] [norm:Sv48_superpage_align_fault] [norm:Sv57_superpage_align] [norm:Sv57_superpage_align_fault] [norm:stval_op_faulting_addr]

cp_canonical_read_s

Verify a non-canonical virtual address raises a load page fault on a load from S-mode

RV64 (Sv39/48/57), S-mode: va_data has bit 63 set, so its upper bits are not a sign extension of the top VA bit. Valid RWX leaf PTE with PTE.U=0 for the canonical part, at every page-table level (4 KiB page and each superpage size of the Sv mode). Load (lw) from the page through va_data.

Load page fault (scause = 13); stval = faulting virtual address.

PTE_canonical_d x canonical_page_d x load_page_fault x read_acc
= 7 bins on RV64 (RV64 only)

Sv39_va_signext Sv48_va_signext Sv57_va_signext stval_op_faulting_addr

Sv39_va_signext
Sv48_va_signext
[norm:Sv39_va_signext] [norm:Sv48_va_signext] [norm:Sv57_va_signext] [norm:stval_op_faulting_addr]

cp_canonical_read_u

Verify a non-canonical virtual address raises a load page fault on a load from U-mode

RV64 (Sv39/48/57), U-mode: va_data has bit 63 set, so its upper bits are not a sign extension of the top VA bit. Valid RWX leaf PTE with PTE.U=1 for the canonical part, at every page-table level (4 KiB page and each superpage size of the Sv mode). Load (lw) from the page through va_data.

Load page fault (scause = 13); stval = faulting virtual address.

PTE_canonical_d x canonical_page_d x load_page_fault x read_acc
= 7 bins on RV64 (RV64 only)

Sv39_va_signext Sv48_va_signext Sv57_va_signext stval_op_faulting_addr

[norm:Sv39_va_signext] [norm:Sv48_va_signext] [norm:Sv57_va_signext] [norm:stval_op_faulting_addr]

cp_canonical_write_s

Verify a non-canonical virtual address raises a store/AMO page fault on a store from S-mode

RV64 (Sv39/48/57), S-mode: va_data has bit 63 set, so its upper bits are not a sign extension of the top VA bit. Valid RWX leaf PTE with PTE.U=0 for the canonical part, at every page-table level (4 KiB page and each superpage size of the Sv mode). Store (sw) to the page through va_data.

Store/AMO page fault (scause = 15); stval = faulting virtual address.

PTE_canonical_d x canonical_page_d x store_page_fault x write_acc
= 7 bins on RV64 (RV64 only)

Sv39_va_signext Sv48_va_signext Sv57_va_signext stval_op_faulting_addr

Sv39_va_signext
Sv48_va_signext
[norm:Sv39_va_signext] [norm:Sv48_va_signext] [norm:Sv57_va_signext] [norm:stval_op_faulting_addr]

cp_canonical_write_u

Verify a non-canonical virtual address raises a store/AMO page fault on a store from U-mode

RV64 (Sv39/48/57), U-mode: va_data has bit 63 set, so its upper bits are not a sign extension of the top VA bit. Valid RWX leaf PTE with PTE.U=1 for the canonical part, at every page-table level (4 KiB page and each superpage size of the Sv mode). Store (sw) to the page through va_data.

Store/AMO page fault (scause = 15); stval = faulting virtual address.

PTE_canonical_d x canonical_page_d x store_page_fault x write_acc
= 7 bins on RV64 (RV64 only)

Sv39_va_signext Sv48_va_signext Sv57_va_signext stval_op_faulting_addr

[norm:Sv39_va_signext] [norm:Sv48_va_signext] [norm:Sv57_va_signext] [norm:stval_op_faulting_addr]

cp_canonical_exec_s

Verify a non-canonical virtual address raises an instruction page fault on an instruction fetch from S-mode

RV64 (Sv39/48/57), S-mode: va_data has bit 63 set, so its upper bits are not a sign extension of the top VA bit. Valid RWX leaf PTE with PTE.U=0 for the canonical part, at every page-table level (4 KiB page and each superpage size of the Sv mode). Jump (jalr) into the page through va_data.

Instruction page fault (scause = 12); stval = faulting virtual address.

PTE_canonical_i x canonical_page_i x ins_page_fault x exec_acc
= 7 bins on RV64 (RV64 only)

Sv39_va_signext Sv48_va_signext Sv57_va_signext stval_op_faulting_addr

Sv39_va_signext
Sv48_va_signext
[norm:Sv39_va_signext] [norm:Sv48_va_signext] [norm:Sv57_va_signext] [norm:stval_op_faulting_addr]

cp_canonical_exec_u

Verify a non-canonical virtual address raises an instruction page fault on an instruction fetch from U-mode

RV64 (Sv39/48/57), U-mode: va_data has bit 63 set, so its upper bits are not a sign extension of the top VA bit. Valid RWX leaf PTE with PTE.U=1 for the canonical part, at every page-table level (4 KiB page and each superpage size of the Sv mode). Jump (jalr) into the page through va_data.

Instruction page fault (scause = 12); stval = faulting virtual address.

PTE_canonical_i x canonical_page_i x ins_page_fault x exec_acc
= 7 bins on RV64 (RV64 only)

Sv39_va_signext Sv48_va_signext Sv57_va_signext stval_op_faulting_addr

[norm:Sv39_va_signext] [norm:Sv48_va_signext] [norm:Sv57_va_signext] [norm:stval_op_faulting_addr]

cp_rsw_pte

Verify the RSW bits (PTE[9:8]) are ignored by the implementation

S-mode and U-mode: leaf PTE with RSW = 01, 10 and 11, at every page-table level (4 KiB page and each superpage size of the Sv mode). Store, load and fetch through va_data, then read the PTE back from the page table.

No fault; the PTE reads back with RSW unchanged.

RSW x mode
= 12 bins on RV64, 4 on RV32

pte_rsw_ignored

cp_global_read_s

Verify a global mapping (G=1) survives an ASID-specific SFENCE.VMA for a load from S-mode

S-mode: global leaf PTE (G=1) with PTE.U=0, at every page-table level (4 KiB page and each superpage size of the Sv mode). Load (lw) from the page through va_data, execute sfence.vma x0, rs2 with the current ASID, then repeat the access.

No fault on either access.

global_PTE_d x PageType_d x read_acc
= 7 bins on RV64, 2 on RV32

sfence_vma_asid_only

pte_g_op
[norm:sfence_vma_asid_only]

cp_global_read_u

Verify a global mapping (G=1) survives an ASID-specific SFENCE.VMA for a load from U-mode

U-mode: global leaf PTE (G=1) with PTE.U=1, at every page-table level (4 KiB page and each superpage size of the Sv mode). Load (lw) from the page through va_data, execute sfence.vma x0, rs2 with the current ASID, then repeat the access.

No fault on either access.

global_PTE_d x PageType_d x read_acc
= 7 bins on RV64, 2 on RV32

sfence_vma_asid_only

pte_g_op
[norm:sfence_vma_asid_only]

cp_global_write_s

Verify a global mapping (G=1) survives an ASID-specific SFENCE.VMA for a store from S-mode

S-mode: global leaf PTE (G=1) with PTE.U=0, at every page-table level (4 KiB page and each superpage size of the Sv mode). Store (sw) to the page through va_data, execute sfence.vma x0, rs2 with the current ASID, then repeat the access.

No fault on either access.

global_PTE_d x PageType_d x write_acc
= 7 bins on RV64, 2 on RV32

sfence_vma_asid_only

pte_g_op
[norm:sfence_vma_asid_only]

cp_global_write_u

Verify a global mapping (G=1) survives an ASID-specific SFENCE.VMA for a store from U-mode

U-mode: global leaf PTE (G=1) with PTE.U=1, at every page-table level (4 KiB page and each superpage size of the Sv mode). Store (sw) to the page through va_data, execute sfence.vma x0, rs2 with the current ASID, then repeat the access.

No fault on either access.

global_PTE_d x PageType_d x write_acc
= 7 bins on RV64, 2 on RV32

sfence_vma_asid_only

[norm:sfence_vma_asid_only]

cp_global_exec_s

Verify a global mapping (G=1) survives an ASID-specific SFENCE.VMA for an instruction fetch from S-mode

S-mode: global leaf PTE (G=1) with PTE.U=0, at every page-table level (4 KiB page and each superpage size of the Sv mode). Jump (jalr) into the page through va_data, execute sfence.vma x0, rs2 with the current ASID, then repeat the access.

No fault on either access.

global_PTE_i x PageType_i x exec_acc
= 7 bins on RV64, 2 on RV32

sfence_vma_asid_only

pte_g_op
[norm:sfence_vma_asid_only]

cp_global_exec_u

Verify a global mapping (G=1) survives an ASID-specific SFENCE.VMA for an instruction fetch from U-mode

U-mode: global leaf PTE (G=1) with PTE.U=1, at every page-table level (4 KiB page and each superpage size of the Sv mode). Jump (jalr) into the page through va_data, execute sfence.vma x0, rs2 with the current ASID, then repeat the access.

No fault on either access.

global_PTE_i x PageType_i x exec_acc
= 7 bins on RV64, 2 on RV32

sfence_vma_asid_only

[norm:sfence_vma_asid_only]

cp_svnapot_read_fault

Verify PTE.N (bit 63) is reserved when Svnapot is not implemented, for a load

RV64, S-mode: level-0 leaf PTE with N=1 and PPN[3:0]=1000. Load (lw) from the page through va_data.

Without Svnapot: load page fault (scause = 13). With Svnapot the encoding is a valid 64 KiB NAPOT mapping and the access succeeds.

svnapot_PTE_d x load_page_fault x read_acc x mode

Sv39_pte_svnapot_rsv

Sv39_pte_Svnapot_rsv
[norm:Sv39_pte_svnapot_rsv]

cp_svnapot_write_fault

Verify PTE.N (bit 63) is reserved when Svnapot is not implemented, for a store

RV64, S-mode: level-0 leaf PTE with N=1 and PPN[3:0]=1000. Store (sw) to the page through va_data.

Without Svnapot: store/AMO page fault (scause = 15). With Svnapot the encoding is a valid 64 KiB NAPOT mapping and the access succeeds.

svnapot_PTE_d x store_page_fault x write_acc x mode

Sv39_pte_svnapot_rsv

Sv39_pte_Svnapot_rsv
[norm:Sv39_pte_svnapot_rsv]

cp_svnapot_exec_fault

Verify PTE.N (bit 63) is reserved when Svnapot is not implemented, for an instruction fetch

RV64, S-mode: level-0 leaf PTE with N=1 and PPN[3:0]=1000. Jump (jalr) into the page through va_data.

Without Svnapot: instruction page fault (scause = 12). With Svnapot the encoding is a valid 64 KiB NAPOT mapping and the access succeeds.

svnapot_PTE_i x ins_page_fault x exec_acc x mode

Sv39_pte_svnapot_rsv

Sv39_pte_Svnapot_rsv
[norm:Sv39_pte_svnapot_rsv]

cp_svpbmt_read_fault

Verify PBMT (bits 62:61) is reserved when menvcfg.PBMTE=0, for a load

RV64, S-mode: clear menvcfg.PBMTE through T-SBI. Top-level leaf PTE with PBMT = 1, 2 and 3. Load (lw) from the page through va_data.

Load page fault (scause = 13); stval = faulting virtual address.

svpbmt_PTE_d x load_page_fault x read_acc x mode x PBMTE_unset
= 9 bins on RV64 (RV64 only)

Sv39_pte_svpbmt_rsv menvcfg_pbmte_op

Sv39_pte_Svpbmt_rsv
menvcfg_pbmte_op
[norm:Sv39_pte_svpbmt_rsv] [norm:menvcfg_pbmte_op]

cp_svpbmt_write_fault

Verify PBMT (bits 62:61) is reserved when menvcfg.PBMTE=0, for a store

RV64, S-mode: clear menvcfg.PBMTE through T-SBI. Top-level leaf PTE with PBMT = 1, 2 and 3. Store (sw) to the page through va_data.

Store/AMO page fault (scause = 15); stval = faulting virtual address.

svpbmt_PTE_d x store_page_fault x write_acc x mode x PBMTE_unset
= 9 bins on RV64 (RV64 only)

Sv39_pte_svpbmt_rsv menvcfg_pbmte_op

Sv39_pte_Svpbmt_rsv
menvcfg_pbmte_op
[norm:Sv39_pte_svpbmt_rsv] [norm:menvcfg_pbmte_op]

cp_svpbmt_exec_fault

Verify PBMT (bits 62:61) is reserved when menvcfg.PBMTE=0, for an instruction fetch

RV64, S-mode: clear menvcfg.PBMTE through T-SBI. Top-level leaf PTE with PBMT = 1, 2 and 3. Jump (jalr) into the page through va_data.

Instruction page fault (scause = 12); stval = faulting virtual address.

svpbmt_PTE_i x ins_page_fault x exec_acc x mode x PBMTE_unset
= 9 bins on RV64 (RV64 only)

Sv39_pte_svpbmt_rsv menvcfg_pbmte_op

Sv39_pte_Svpbmt_rsv
menvcfg_pbmte_op
[norm:Sv39_pte_svpbmt_rsv] [norm:menvcfg_pbmte_op]

cp_reserved_read_fault

Verify reserved PTE bits 60:54 raise a load page fault on a load

RV64, S-mode: top-level leaf PTE with each of bits 60..54 set in turn. Load (lw) from the page through va_data.

Load page fault (scause = 13); stval = faulting virtual address.

reserved_PTE_d x load_page_fault x read_acc x mode
= 21 bins on RV64 (RV64 only)

Sv39_pte_future_rsv

Sv39_pte_future_rsv
[norm:Sv39_pte_future_rsv]

cp_reserved_write_fault

Verify reserved PTE bits 60:54 raise a store/AMO page fault on a store

RV64, S-mode: top-level leaf PTE with each of bits 60..54 set in turn. Store (sw) to the page through va_data.

Store/AMO page fault (scause = 15); stval = faulting virtual address.

reserved_PTE_d x store_page_fault x read_acc x mode
= 21 bins on RV64 (RV64 only)

Sv39_pte_future_rsv

Sv39_pte_future_rsv
[norm:Sv39_pte_future_rsv]

cp_reserved_exec_fault

Verify reserved PTE bits 60:54 raise an instruction page fault on an instruction fetch

RV64, S-mode: top-level leaf PTE with each of bits 60..54 set in turn. Jump (jalr) into the page through va_data.

Instruction page fault (scause = 12); stval = faulting virtual address.

reserved_PTE_i x ins_page_fault x read_acc x mode
= 21 bins on RV64 (RV64 only)

Sv39_pte_future_rsv

Sv39_pte_future_rsv
[norm:Sv39_pte_future_rsv]

cp_read_nofault

Verify a PTE with bits 63:54 all zero translates normally for a load

S-mode and U-mode: loads through valid leaf PTEs whose extension and reserved bits 63:54 are zero (every Sv test).

No fault.

zeros_PTE_d x read_acc x mode
= 3 bins on RV64 (RV64 only)

Sv57_sxlen_va_sz
Sv57_vpn_sz
satp_ppn_Sv57_sz
Sv57_levels
Sv57_page_offset_sz
Sv57_ptesize

cp_write_nofault

Verify a PTE with bits 63:54 all zero translates normally for a store

S-mode and U-mode: stores through valid leaf PTEs whose extension and reserved bits 63:54 are zero (every Sv test).

No fault.

zeros_PTE_d x write_acc x mode
= 3 bins on RV64 (RV64 only)

cp_exec_nofault

Verify a PTE with bits 63:54 all zero translates normally for an instruction fetch

S-mode and U-mode: instruction fetches through valid leaf PTEs whose extension and reserved bits 63:54 are zero (every Sv test).

No fault.

zeros_PTE_i x exec_acc x mode
= 3 bins on RV64 (RV64 only)

Sv57_sxlen_va_sz
Sv57_vpn_sz
satp_ppn_Sv57_sz
Sv57_levels
Sv57_page_offset_sz
Sv57_ptesize

cp_svadu_disabled

Verify translation with hardware A/D updating disabled (menvcfg.ADUE=0)

Sampled on accesses while menvcfg.ADUE (menvcfgh.ADUE on RV32) is 0, which holds in every Sv test.

A and D bits are not updated by hardware.

ADUE_unset x mode
= 3 bins on RV64, 1 on RV32

Svadu_disabled_hw_update_falls_back_to_svade

[norm:Svadu_disabled_hw_update_falls_back_to_svade]

Table 251. Sv Normative Rules
Normative Rule Rule Text Coverpoints

sstatus_mxr

The MXR (Make eXecutable Readable) bit modifies the privilege with which loads access virtual memory. When MXR=0, only loads from pages marked readable (R=1 in ) will succeed. When MXR=1, loads from pages marked either readable or executable (R=1 or X=1) will succeed. MXR has no effect when page-based virtual memory is not in effect.

Sv_vm_permissions_cg/cp_xpage_{mxrunset,mxrset}_read_{s,u}

sstatus_sum

The SUM (permit Supervisor User Memory access) bit modifies the privilege with which S-mode loads and stores access virtual memory. When SUM=0, S-mode memory accesses to pages that are accessible by U-mode (U=1 in ) will fault. When SUM=1, these accesses are permitted. SUM has no effect when page-based virtual memory is not in effect, nor when executing in U-mode. Note that S-mode can never execute instructions from user pages, regardless of the state of SUM.

Sv_vm_permissions_cg/{cp_upage_smode_sumunset_noread_s, cp_upage_smode_sumunset_noexec_s}, Sv_vm_permissions_cg/{cp_upage_smode_sumset_read_s, cp_upage_smode_sumset_noexec_s}

satp

The satp CSR is an SXLEN-bit read/write register, formatted as shown in for SXLEN=32 and for SXLEN=64, which controls supervisor-mode address translation and protection. This register holds the physical page number (PPN) of the root page table, i.e., its supervisor physical address divided by 4 KiB; an address space identifier (ASID), which facilitates address-translation fences on a per-address-space basis; and the MODE field, which selects the current address-translation scheme. Further details on the access to this register are described in .

Sv_satp_cg/{cp_access_s,cp_access_u,satp_asid_PPN}, SvSm_satp_cg/cp_access_m

satp_mode

norm:satp_mode_enc shows the encodings of the MODE field when SXLEN=32 and SXLEN=64.

Sv_VA_cg/mode_supported, Svbare_cg/satp_bare

satp_mode_sxlen32

When SXLEN=32, the only other valid setting for MODE is Sv32, a paged virtual-memory scheme described in .

Sv_VA_cg/{cp_VA_i_mode,cp_VA_d_mode}

satp_mode_sxlen64

When SXLEN=64, three paged virtual-memory schemes are defined: Sv39, Sv48, and Sv57, described in , , and , respectively. One additional scheme, Sv64, will be defined in a later version of this specification. The remaining MODE settings are reserved for future use and may define different interpretations of the other fields in satp.

Sv_VA_cg/{cp_VA_i_mode,cp_VA_d_mode}

satp_mode_op_unsupported

Implementations are not required to support all MODE settings, and if satp is written with an unsupported MODE, the entire write has no effect; no fields in satp are modified.

TODO: write an unsupported satp.MODE and check that satp is unchanged

asidlen

The number of ASID bits is UNSPECIFIED and may be zero.

Sv_satp_cg/asid_length

asid_lsb_first

The least-significant bits of ASID are implemented first: that is, if ASIDLEN > 0, ASID[ASIDLEN-1:0] is writable.

Sv_satp_cg/asid_length

asidmax

The maximal value of ASIDLEN, termed ASIDMAX, is 9 for Sv32 or 16 for Sv39, Sv48, and Sv57.

Sv_satp_cg/asid_length

satp_mode_enc

riscv.github.io/riscv-isa-manual/snapshot/spec/index.html#norm%3Asatp_mode_enc

Sv_VA_cg/mode_supported, Svbare_cg/{satp_bare, cp_satp_bare_load, cp_satp_bare_store, cp_satp_bare_exec}, TODO: write reserved and custom MODE values (see satp_mode_op_unsupported)

satp_op_active

The satp CSR is considered active when the effective privilege mode is S-mode or U-mode. Executions of the address-translation algorithm may only begin using a given value of satp when satp is active.

Sv_vm_permissions_cg/{cp_spage_read_s_d, cp_spage_exec_s_i, cp_upage_umode_read_u}, SvSm_mstatus_mprv_cg/cp_mprv_load

satp_op_sfence_vma

Note that writing satp does not imply any ordering constraints between page-table updates and subsequent address translations, nor does it imply any invalidation of address-translation caches.

Sv_sfence_cg/cp_ins

sfence_vma_op

The supervisor memory-management fence instruction SFENCE.VMA is used to synchronize updates to in-memory memory-management data structures with current execution. Instruction execution causes implicit reads and writes to these data structures; however, these implicit references are ordinarily not ordered with respect to explicit loads and stores.

Sv_sfence_cg/cp_ins

sfence_vma_ordering

Executing an SFENCE.VMA instruction guarantees that any previous stores already visible to the current RISC-V hart are ordered before certain implicit references by subsequent instructions in that hart to the memory-management data structures. The specific set of operations ordered by SFENCE.VMA is determined by rs1 and rs2, as described below.

Sv_sfence_cg/cp_ins

sfence_vma_invalidation

SFENCE.VMA is also used to invalidate entries in the address-translation cache associated with a hart (see sv32algorithm).

Sv_sfence_cg/cp_ins

sfence_vma_local_only

SFENCE.VMA orders only the local hart’s implicit references to the memory-management data structures.

Not tested: needs more than one hart

sfence_vma_all_asid_va

If rs1=x0 and rs2=x0, the fence orders all reads and writes made to any level of the page tables, for all address spaces. The fence also invalidates all address-translation cache entries, for all address spaces.

Sv_sfence_cg/cp_ins

sfence_vma_asid_only

If rs1=x0 and rs2≠x0, the fence orders all reads and writes made to any level of the page tables, but only for the address space identified by integer register rs2. Accesses to global mappings (see translation) are not ordered. The fence also invalidates all address-translation cache entries matching the address space identified by integer register rs2, except for entries containing global mappings.

sfence_vma_va_all_asid

If rs1≠x0 and rs2=x0, the fence orders only reads and writes made to leaf page table entries corresponding to the virtual address in rs1, for all address spaces. The fence also invalidates all address-translation cache entries that contain leaf page table entries corresponding to the virtual address in rs1, for all address spaces.

TODO: SFENCE.VMA with rs1!=x0 is not exercised

sfence_vma_va_asid

If rs1≠x0 and rs2≠x0, the fence orders only reads and writes made to leaf page table entries corresponding to the virtual address in rs1, for the address space identified by integer register rs2. Accesses to global mappings are not ordered. The fence also invalidates all address-translation cache entries that contain leaf page table entries corresponding to the virtual address in rs1 and that match the address space identified by integer register rs2, except for entries containing global mappings.

TODO: SFENCE.VMA with rs1!=x0 is not exercised

sfence_vma_invalid_va

If the value held in rs1 is not a valid virtual address, then the SFENCE.VMA instruction has no effect. No exception is raised in this case.

TODO: SFENCE.VMA with an invalid virtual address in rs1 is not exercised

sfence_vma_rs2_bits

When rs2≠x0, bits SXLEN-1:ASIDMAX of the value held in rs2 are reserved for future standard use. Until their use is defined by a standard extension, they should be zeroed by software and ignored by current implementations. Furthermore, if ASIDLEN<ASIDMAX, the implementation shall ignore bits ASIDMAX-1:ASIDLEN of the value held in rs2.

TODO: SFENCE.VMA with reserved rs2 bits set is not exercised

sfence_vma_ordering_semantics

An implicit read of the memory-management data structures may return any translation for an address that was valid at any time since the most recent SFENCE.VMA that subsumes that address. The ordering implied by SFENCE.VMA does not place implicit reads and writes to the memory-management data structures into the global memory order in a way that interacts cleanly with the standard RVWMO ordering rules. In particular, even though an SFENCE.VMA orders prior explicit accesses before subsequent implicit accesses, and those implicit accesses are ordered before their associated explicit accesses, SFENCE.VMA does not necessarily place prior explicit accesses before subsequent explicit accesses in the global memory order. These implicit loads also need not otherwise obey normal program order semantics with respect to prior loads or stores to the same address.

Not tested: which stale translation an implicit read returns is implementation-dependent

sfence_vma_implicit_access

Implementations must only perform implicit reads of the translation data structures pointed to by the current contents of the satp register or a subsequent valid (V=1) translation data structure entry, and must only raise exceptions for implicit accesses that are generated as a result of instruction execution, not those that are performed speculatively.

Sv_vm_permissions_cg/{cp_PTE_inv_read_s_d,cp_PTE_nonleaf_lvl0_s_d_read}

sfence_vma_sum_mxr_effect

Changes to the sstatus fields SUM and MXR take effect immediately, without the need to execute an SFENCE.VMA instruction.

Sv_vm_permissions_cg/cp_xpage_{mxrunset,mxrset}_read_{s,u}

sfence_vma_mode_effect

Changing satp.MODE from Bare to other modes and vice versa also takes effect immediately, without the need to execute an SFENCE.VMA instruction.

Not tested: every test executes SFENCE.VMA after writing satp

sfence_vma_asid_effect

Likewise, changes to satp.ASID take effect immediately.

Not tested: every test executes SFENCE.VMA after writing satp

asid_hart_private

If a hart employs an address-translation cache, that cache must appear to be private to that hart. In particular, the meaning of an ASID is local to a hart; software may choose to use the same ASID to refer to different address spaces on different harts.

Not tested: needs more than one hart

satp_ppn_Sv32_sz

22-bit physical page number (PPN)

Sv_vm_permissions_cg/{cp_spage_read_s_d,cp_spage_write_s_d,cp_spage_exec_s_i}

fetch_page_fault_no_x

Attempting to fetch an instruction from a page that does not have execute permissions raises a fetch page-fault exception.

Sv_vm_permissions_cg/{cp_spage_noexec_s_i,cp_spage_rwx_s_i_noexec,cp_upage_umode_noexec_u}

load_page_fault_no_r

Attempting to execute a load or load-reserved instruction whose effective address lies within a page without read permissions raises a load page-fault exception.

Sv_vm_permissions_cg/{cp_spage_noread_s_d,cp_spage_rwx_s_d_noread,cp_upage_umode_noread_u}

store_page_fault_no_w

Attempting to execute a store, store-conditional, AMO, or cache-block zero instruction whose effective address lies within a page without write permissions raises a store page-fault exception.

Sv_vm_permissions_cg/{cp_spage_nowrite_s_d,cp_spage_rwx_s_d_nowrite,cp_upage_umode_nowrite_u}

pte_u_op

The U bit indicates whether the page is accessible to user mode. U-mode software may only access the page when U=1. If the SUM bit in the sstatus register is set, supervisor mode software may also access pages with U=1.

Sv_vm_permissions_cg/{cp_upage_umode_read_u, cp_spage_rwx_s_d_noread, cp_upage_smode_sumset_read_s, cp_upage_smode_sumunset_noread_s}

pte_u_no_s_exec

Irrespective of SUM, the supervisor may not execute code on pages with U=1.

Sv_vm_permissions_cg/{cp_upage_smode_sumunset_noexec_s, cp_upage_smode_sumset_noexec_s}

pte_g_op

The G bit designates a global mapping. Global mappings are those that exist in all address spaces. For non-leaf PTEs, the global setting implies that all mappings in the subsequent levels of the page table are global.

Sv_res_global_pte_cg/{cp_global_read_s, cp_global_write_s, cp_global_exec_s, cp_global_read_u}

pte_rsw_ignored

The RSW field is reserved for use by supervisor software; the implementation shall ignore this field.

Sv_res_global_pte_cg/cp_rsw_pte

pte_a_def

Each leaf PTE contains an accessed (A) and dirty (D) bit. The A bit indicates the virtual page has been read, written, or fetched from since the last time the A bit was cleared.

Svadu_cg/{Abit_unset_exec_s, Abit_unset_read_u}, Svade_cg/{Abit_unset_write_s, Abit_unset_read_u}

pte_d_def

The D bit indicates the virtual page has been written since the last time the D bit was cleared.

Svadu_cg/{Dbit_unset_write_s, Dbit_unset_write_u}, Svade_cg/{Dbit_unset_write_s, Dbit_unset_write_u}

pte_ad_scheme_uniform

All harts in a system must employ the same PTE-update scheme as each other.

Not tested: needs more than one hart

lr_sc_rsrv_set_page

For implementations with both page-based virtual memory and the A standard extension, the LR/SC reservation set must lie completely within a single base physical page (i.e., a naturally aligned 4 KiB physical-memory region).

TODO: an LR to one 4 KiB page followed by an SC to a different page must fail

Sv39_sxlen_va_sz

This section describes a simple paged virtual-memory system for SXLEN=64, which supports 39-bit virtual address spaces.

Sv_vm_permissions_cg/{cp_spage_read_s_d,cp_spage_write_s_d,cp_spage_exec_s_i}

Sv39_vpn_sz

27-bit VPN

Sv_vm_permissions_cg/{cp_spage_read_s_d,cp_spage_write_s_d,cp_spage_exec_s_i}

satp_ppn_Sv39_sz

44-bit PPN

Sv_vm_permissions_cg/{cp_spage_read_s_d,cp_spage_write_s_d,cp_spage_exec_s_i}

Sv39_levels

three-level page table

Sv_vm_permissions_cg/{cp_spage_read_s_d,cp_spage_write_s_d,cp_spage_exec_s_i}

Sv39_page_offset_sz

12-bit page offset is untranslated

Sv_vm_permissions_cg/{cp_spage_read_s_d,cp_spage_write_s_d,cp_spage_exec_s_i}

Sv39_ptesize

PTESIZE equals 8

Sv_vm_permissions_cg/{cp_spage_read_s_d,cp_spage_write_s_d,cp_spage_exec_s_i}

Sv39_va_signext

must have bits 63–39 all equal to bit 38, or else a page-fault exception will occur

Sv_vm_permissions_cg/cp_canonical_{read,write,exec}_s

Sv39_leaf_any_level, Sv39_page_sizes

Sv39_leaf_any_level: Any level of PTE may be a leaf PTE Sv39_page_sizes: 2 MiB megapages and 1 GiB gigapages

Sv_vm_permissions_cg/{cp_spage_read_s_d,cp_spage_write_s_d,cp_spage_exec_s_i}

Sv39_superpage_align, Sv39_superpage_align_fault

Sv39_superpage_align: must be virtually and physically aligned to a boundary equal to its size Sv39_superpage_align_fault: A page-fault exception is raised if the physical address is insufficiently aligned

Sv_vm_permissions_cg/cp_misaligned_{exec,read,write}_s

Sv39_pte_count_sz

Sv39 page tables contain 29 page table entries (PTEs), eight bytes each.

Sv_vm_permissions_cg/{cp_spage_read_s_d,cp_spage_write_s_d,cp_spage_exec_s_i}

Sv39_pt_sz

exactly the size of a page

Sv_vm_permissions_cg/{cp_spage_read_s_d,cp_spage_write_s_d,cp_spage_exec_s_i}

Sv39_pt_align

must always be aligned to a page boundary

Sv_vm_permissions_cg/{cp_spage_read_s_d,cp_spage_write_s_d,cp_spage_exec_s_i}

Sv39_pte_Svnapot_rsv

If Svnapot is not implemented, bit 63 remains reserved and must be zeroed by software for forward compatibility, or else a page-fault exception is raised

Sv_add_feature_cg/cp_svnapot_{read,write,exec}_fault

Sv39_pte_Svpbmt_rsv

If Svpbmt is not implemented, bits 62-61 remain reserved and must be zeroed by software for forward compatibility, or else a page-fault exception is raised

Sv_add_feature_cg/cp_svpbmt_{read,write,exec}_fault

Sv39_pte_future_rsv

must be zeroed by software for forward compatibility. If any of these bits are set, a page-fault exception is raised

Sv_add_feature_cg/cp_reserved_{read,write,exec}_fault

Sv48_sxlen

riscv.github.io/riscv-isa-manual/snapshot/spec/index.html#norm%3ASv48_sxlen

Sv_vm_permissions_cg/{cp_spage_read_s_d,cp_spage_write_s_d,cp_spage_exec_s_i}

Sv48_va_sz

48-bit virtual address spaces

Sv_vm_permissions_cg/{cp_spage_read_s_d,cp_spage_write_s_d,cp_spage_exec_s_i}

Sv48_vpn_sz

36-bit VPN

Sv_vm_permissions_cg/{cp_spage_read_s_d,cp_spage_write_s_d,cp_spage_exec_s_i}

satp_ppn_Sv48_sz

44-bit PPN

Sv_vm_permissions_cg/{cp_spage_read_s_d,cp_spage_write_s_d,cp_spage_exec_s_i}

Sv48_levels

four-level page table

Sv_vm_permissions_cg/{cp_spage_read_s_d,cp_spage_write_s_d,cp_spage_exec_s_i}

Sv48_page_offset_sz

12-bit page offset is untranslated

Sv_vm_permissions_cg/{cp_spage_read_s_d,cp_spage_write_s_d,cp_spage_exec_s_i}

Sv48_ptesize

PTESIZE equals 8

Sv_vm_permissions_cg/{cp_spage_read_s_d,cp_spage_write_s_d,cp_spage_exec_s_i}

Sv48_va_signext

must have bits 63–48 all equal to bit 47, or else a page-fault exception will occur

Sv_vm_permissions_cg/cp_canonical_{read,write,exec}_s

Sv48_leaf_any_level, Sv48_page_sizes

Sv48_leaf_any_level: Any level of PTE may be a leaf PTE Sv48_page_sizes: 2 MiB megapages, 1 GiB gigapages, and 512 GiB terapages

Sv_vm_permissions_cg/{cp_spage_read_s_d,cp_spage_write_s_d,cp_spage_exec_s_i}

Sv48_superpage_align, Sv48_superpage_align_fault

Sv48_superpage_align: must be virtually and physically aligned to a boundary equal to its size Sv48_superpage_align_fault: A page-fault exception is raised if the physical address is insufficiently aligned

Sv_vm_permissions_cg/cp_misaligned_{exec,read,write}_s

Sv48_requires_Sv39

Implementations that support Sv48 must also support Sv39

Not tested: extension dependency checked by the UDB configuration

Sv57_sxlen_va_sz

This section describes a simple paged virtual-memory system designed for RV64 systems, which supports 57-bit virtual address spaces.

Sv_VA_cg/{cp_VA_i_mode, cp_VA_d_mode}, Sv_add_feature_cg/{cp_read_nofault, cp_exec_nofault}

Sv57_vpn_sz

45-bit VPN

Sv_VA_cg/{cp_VA_i_mode, cp_VA_d_mode}, Sv_add_feature_cg/{cp_read_nofault, cp_exec_nofault}

satp_ppn_Sv57_sz

44-bit PPN

Sv_VA_cg/{cp_VA_i_mode, cp_VA_d_mode}, Sv_add_feature_cg/{cp_read_nofault, cp_exec_nofault}

Sv57_levels

five-level page table

Sv_VA_cg/{cp_VA_i_mode, cp_VA_d_mode}, Sv_add_feature_cg/{cp_read_nofault, cp_exec_nofault}

Sv57_page_offset_sz

12-bit page offset is untranslated

Sv_VA_cg/{cp_VA_i_mode, cp_VA_d_mode}, Sv_add_feature_cg/{cp_read_nofault, cp_exec_nofault}

Sv57_ptesize

PTESIZE equals 8

Sv_VA_cg/{cp_VA_i_mode, cp_VA_d_mode}, Sv_add_feature_cg/{cp_read_nofault, cp_exec_nofault}

Sv57_va_signext

must have bits 63–57 all equal to bit 56, or else a page-fault exception will occur

Sv57_leaf_any_level, Sv57_page_sizes

Sv57_leaf_any_level: Any level of PTE may be a leaf PTE Sv57_page_sizes: 2 MiB megapages, 1 GiB gigapages, 512 GiB terapages, and 256 TiB petapages

Sv57_superpage_align, Sv57_superpage_align_fault

Sv57_superpage_align: must be virtually and physically aligned to a boundary equal to its size Sv57_superpage_align_fault: A page-fault exception is raised if the physical address is insufficiently aligned

Sv57_requires_Sv48

Implementations that support Sv57 must also support Sv48

Not tested: extension dependency checked by the UDB configuration

stval_op_faulting_addr

If stval is written with a nonzero value when a breakpoint, address-misaligned, access-fault, page-fault, or hardware-error exception occurs on an instruction fetch, load, or store, then stval will contain the faulting virtual address.

Sv_vm_permissions_cg/{cp_spage_noread_s_d, cp_spage_nowrite_s_d, cp_spage_noexec_s_i}

mstatus_mxr_sum_op_acc_fault

The MXR and SUM mechanisms only affect the interpretation of permissions encoded in page-table entries. In particular, they have no impact on whether access-fault exceptions are raised due to PMAs or PMP.

TODO: combine MXR/SUM with a PMA or PMP access fault

UDB Parameters: None.

UDB Parameters:

  • REPORT_VA_IN_{MTVAL/STVAL}ON_{INSTRUCTION/LOAD/STORE_AMO}PAGE_FAULT affects result in {MTVAL,STVAL} during page-fault exceptions, such as coverpoints TODO

  • TODO other coverpoints at least SATP_MODE_BARE, TRAP_ON_SFENCE_VMA_WHEN_SATP_MODE_IS_READ_ONLY

B.8.2. SvSm Virtual Memory with M-mode State

Covers mstatus.MPRV accesses, mstatus.TVM trapping of satp and SFENCE.VMA, mstatus.SBE for implicit page-table accesses, and M-mode access to satp. The mstatus.SBE tests are generated but not run until a big-endian configuration is available.

Table 252. SvSm Coverpoints
Coverpoint Goal Feature Description Expectation Bins ID Normative Rule

General Test Environment (SvSm):
- Sm suite: boots to M-mode (BOOT_TO_MMODE) because each coverpoint needs M-mode state (mstatus.MPRV/MPP, mstatus.TVM, mstatus.SBE or an M-mode CSR access). Mode changes use RVTEST_TSBI_GOTO_*.
- These coverpoints were split out of Sv. Faults taken in M-mode are sampled from mcause.
- Run for every supported translation mode: Sv32 on RV32; Sv39, Sv48 and Sv57 on RV64, as selected by the UDB configuration.
- Split from Sv: the M-mode half of cp_access_m_s (now cp_access_m) and all of Sv_mstatus_mprv_cg.

cp_access_m

Verify satp is readable and writable from M-mode with csrrw, csrrs and csrrc

Sv32 and Sv39 configurations, M-mode: csrrw satp with 1, csrrs with 2, csrrc with 1, reading satp back after each; and the same three accesses with satp = 0 while mstatus.TVM=1, which does not restrict M-mode.

No exception; each read returns the value produced by the write.

cp_ins x Mcause x tvm_mstatus x mode {M-mode}
= 6 bins on RV64, 6 on RV32

satp_sz satp_acc satp_op satp_mode

satp
[norm:satp_sz] [norm:satp_acc] [norm:satp_op] [norm:satp_mode]

cp_tvm_exception_s

Verify mstatus.TVM=1 makes satp accesses and SFENCE.VMA illegal in S-mode

M-mode: set mstatus.TVM, read mstatus back, then csrw, csrs and csrc satp with 0. Switch to S-mode with RVTEST_TSBI_GOTO_SMODE, execute csrw, csrs and csrc on satp and sfence.vma, then return with RVTEST_TSBI_GOTO_MMODE.

Illegal-instruction exception (mcause = 2) for each instruction.

tvm_mstatus x Mcause x cp_ins x mode {S-mode}
= 4 bins on RV64, 4 on RV32

mstatus_tvm_op MSTATUS_TVM_WARL

mstatus_tvm_op
mstatus_tvm_warl
[norm:mstatus_tvm_op] [norm:MSTATUS_TVM_WARL]

cp_mprv_load

Verify MPRV=1 translates M-mode loads as if in the MPP mode

M-mode: map va_data at every page-table level (4 KiB page and each superpage size of the Sv mode) (supervisor page for MPP=S, user page for MPP=U). Set mstatus.MPRV=1 with MPP=S, then MPP=U, and load (lw) through va_data. Clear MPRV afterwards.

No fault; the load is translated through va_data.

mprv_mstatus x mpp_mstatus x read_acc x satp_mode x mode {M-mode}
= 6 bins on RV64, 2 on RV32

satp_op_active mstatus_mprv_ldst_op

mstatus_mprv_ldst_op
satp_op_active
[norm:satp_op_active] [norm:mstatus_mprv_ldst_op]

cp_mprv_store

Verify MPRV=1 translates M-mode stores as if in the MPP mode

M-mode: map va_data at every page-table level (4 KiB page and each superpage size of the Sv mode) (supervisor page for MPP=S, user page for MPP=U). Set mstatus.MPRV=1 with MPP=S, then MPP=U, and store (sw) through va_data. Clear MPRV afterwards.

No fault; the store is translated through va_data.

mprv_mstatus x mpp_mstatus x write_acc x satp_mode x mode {M-mode}
= 6 bins on RV64, 2 on RV32

satp_op_active mstatus_mprv_ldst_op

mstatus_mprv_ldst_op
[norm:satp_op_active] [norm:mstatus_mprv_ldst_op]

cp_mprv_ins

Verify MPRV=1 does not translate M-mode instruction fetches

M-mode with mstatus.MPRV=1 and MPP=S, then MPP=U: jump (jalr) to the physical address of the test page.

The fetch uses the physical address and does not fault.

mprv_mstatus x mpp_mstatus x exec_acc x satp_mode x mode {M-mode}
= 6 bins on RV64, 2 on RV32

mstatus_mprv_inst_xlat_op

mstatus_mprv_inst_xlat_op
[norm:mstatus_mprv_inst_xlat_op]

PTE_upage_i

Verify a user leaf PTE is observed on the instruction side during the MPRV tests

Sampled when an instruction fetch walks a user leaf PTE (U=1) during the MPRV/SUM tests.

A valid user leaf PTE (U=1) is seen by the fetch.

PTE_upage_i {leaflvl_u}
= 1 bins on RV64, 1 on RV32

cp_mprv_upage_smode_sumunset_noread

Verify an M-mode load with MPRV=1, MPP=S to a user page faults when mstatus.SUM=0

M-mode with MPRV=1, MPP=S and mstatus.SUM=0: user leaf PTE (U=1) at every page-table level (4 KiB page and each superpage size of the Sv mode). Load (lw) from the page through va_data.

Load page fault (mcause = 13); mtval = faulting virtual address.

mprv_mstatus x mpp_mstatus x read_acc x PTE_upage_d x PageType_d x load_page_fault x sum_sstatus x mode {M-mode}
= 7 bins on RV64, 2 on RV32

mstatus_sum_op mstatus_sum_op_mprv_mpp mtval_vaddr_wr1

mstatus_sum_op_mprv_mpp
mstatus_sum_op
[norm:mstatus_sum_op] [norm:mstatus_sum_op_mprv_mpp] [norm:mtval_vaddr_wr1]

cp_mprv_upage_smode_sumunset_nowrite

Verify an M-mode store with MPRV=1, MPP=S to a user page faults when mstatus.SUM=0

M-mode with MPRV=1, MPP=S and mstatus.SUM=0: user leaf PTE (U=1) at every page-table level (4 KiB page and each superpage size of the Sv mode). Store (sw) to the page through va_data.

Store/AMO page fault (mcause = 15); mtval = faulting virtual address.

mprv_mstatus x mpp_mstatus x write_acc x PTE_upage_d x PageType_d x store_page_fault x sum_sstatus x mode {M-mode}
= 7 bins on RV64, 2 on RV32

mstatus_sum_op mstatus_sum_op_mprv_mpp mtval_vaddr_wr1

mstatus_sum_op_mprv_mpp
mstatus_sum_op
[norm:mstatus_sum_op] [norm:mstatus_sum_op_mprv_mpp] [norm:mtval_vaddr_wr1]

cp_mprv_upage_smode_sumunset_noexec

Verify MPRV=1, MPP=S with mstatus.SUM=0 does not affect M-mode instruction fetch

M-mode with MPRV=1, MPP=S and SUM=0, user page (U=1) mapped at va_data: jump (jalr) to the physical address of the page.

No fault: instruction fetch ignores MPRV.

mprv_mstatus x mpp_mstatus x exec_acc x PageType_i x sum_sstatus x mode {M-mode}
= 7 bins on RV64, 2 on RV32

mstatus_sum_op mstatus_sum_op_mprv_mpp

[norm:mstatus_sum_op] [norm:mstatus_sum_op_mprv_mpp]

cp_mprv_upage_smode_sumset_exec

Verify MPRV=1, MPP=S with mstatus.SUM=1 does not affect M-mode instruction fetch

M-mode with MPRV=1, MPP=S and SUM=1, user page (U=1) mapped at va_data: jump (jalr) to the physical address of the page.

No fault: instruction fetch ignores MPRV.

mprv_mstatus x mpp_mstatus x exec_acc x PageType_i x sum_sstatus x mode {M-mode}
= 7 bins on RV64, 2 on RV32

mstatus_sum_op mstatus_sum_op_mprv_mpp

mstatus_mprv_inst_xlat_op
[norm:mstatus_sum_op] [norm:mstatus_sum_op_mprv_mpp]

cp_mprv_upage_smode_sumset_read

Verify an M-mode load with MPRV=1, MPP=S to a user page succeeds when mstatus.SUM=1

M-mode with MPRV=1, MPP=S and mstatus.SUM=1: user leaf PTE (U=1) at every page-table level (4 KiB page and each superpage size of the Sv mode). Load (lw) from the page through va_data.

No fault.

mprv_mstatus x mpp_mstatus x read_acc x PTE_upage_d x PageType_d x sum_sstatus x mode {M-mode}
= 7 bins on RV64, 2 on RV32

mstatus_sum_op mstatus_sum_op_mprv_mpp

mstatus_sum_op_mprv_mpp
mstatus_sum_op
[norm:mstatus_sum_op] [norm:mstatus_sum_op_mprv_mpp]

cp_mprv_upage_smode_sumset_write

Verify an M-mode store with MPRV=1, MPP=S to a user page succeeds when mstatus.SUM=1

M-mode with MPRV=1, MPP=S and mstatus.SUM=1: user leaf PTE (U=1) at every page-table level (4 KiB page and each superpage size of the Sv mode). Store (sw) to the page through va_data.

No fault.

mprv_mstatus x mpp_mstatus x write_acc x PTE_upage_d x PageType_d x sum_sstatus x mode {M-mode}
= 7 bins on RV64, 2 on RV32

mstatus_sum_op mstatus_sum_op_mprv_mpp

mstatus_sum_op_mprv_mpp
mstatus_sum_op
[norm:mstatus_sum_op] [norm:mstatus_sum_op_mprv_mpp]

cp_mstatus_sbe_read

Verify page-table walks use big-endian PTEs when mstatus.SBE=1 (load)

NORUN until a big-endian configuration exists. M-mode sets mstatus.SBE (mstatush.SBE on RV32) and writes the walk, leaf and identity-map PTEs big-endian, at every page-table level (4 KiB page and each superpage size of the Sv mode). S-mode then does the load through va_data (also with SUM=1 on a user page).

No fault; the walk interprets the big-endian PTEs.

read_acc x PTE_sbe_d x PageType_d x sbe_mstatus
= 28 bins on RV64, 8 on RV32

MSTATUS_SBE_WARL MSTATUSH_SBE_WARL mstatus_sbe_implicit

mstatus_mstatush_xbe_warl
mstatus_sbe_implicit
[norm:MSTATUS_SBE_WARL] [norm:MSTATUSH_SBE_WARL] [norm:mstatus_sbe_implicit]

cp_mstatus_sbe_write

Verify page-table walks use big-endian PTEs when mstatus.SBE=1 (store)

NORUN until a big-endian configuration exists. M-mode sets mstatus.SBE (mstatush.SBE on RV32) and writes the walk, leaf and identity-map PTEs big-endian, at every page-table level (4 KiB page and each superpage size of the Sv mode). S-mode then does the store through va_data (also with SUM=1 on a user page).

No fault; the walk interprets the big-endian PTEs.

write_acc x PTE_sbe_d x PageType_d x sbe_mstatus
= 28 bins on RV64, 8 on RV32

MSTATUS_SBE_WARL MSTATUSH_SBE_WARL mstatus_sbe_implicit

mstatus_mstatush_xbe_warl
mstatus_sbe_implicit
[norm:MSTATUS_SBE_WARL] [norm:MSTATUSH_SBE_WARL] [norm:mstatus_sbe_implicit]

Table 253. SvSm Normative Rules
Normative Rule Rule Text Coverpoints

satp

The satp CSR is an SXLEN-bit read/write register, formatted as shown in for SXLEN=32 and for SXLEN=64, which controls supervisor-mode address translation and protection. This register holds the physical page number (PPN) of the root page table, i.e., its supervisor physical address divided by 4 KiB; an address space identifier (ASID), which facilitates address-translation fences on a per-address-space basis; and the MODE field, which selects the current address-translation scheme. Further details on the access to this register are described in .

SvSm_satp_cg/cp_access_m

mstatus_mprv_ldst_op

When MPRV=0, explicit memory accesses behave as normal, using the translation and protection mechanisms of the current privilege mode. When MPRV=1, load and store memory addresses are translated and protected, and endianness is applied, as though the current privilege mode were set to MPP.

SvSm_mstatus_mprv_cg/cp_mprv_{load,store}

mstatus_mprv_inst_xlat_op

Instruction address-translation and protection are unaffected by the setting of MPRV.

SvSm_mstatus_mprv_cg/cp_mprv_ins

mstatus_sum_op, mstatus_sum_op_mprv_mpp

mstatus_sum_op: When SUM=0, S-mode memory accesses to pages that are accessible by U-mode (U=1 in sv32pte) will fault. When SUM=1, these accesses are permitted. mstatus_sum_op_mprv_mpp: while SUM is ordinarily ignored when not executing in S-mode, it is in effect when MPRV=1 and MPP=S.

SvSm_mstatus_mprv_cg/cp_mprv_upage_smode_sumunset_{noread,nowrite}, SvSm_mstatus_mprv_cg/cp_mprv_upage_smode_sumset_{read,write}

mstatus_tvm_op, mstatus_tvm_warl

mstatus_tvm_op: When TVM=1, attempts to read or write the satp CSR or execute an SFENCE.VMA or SINVAL.VMA instruction while executing in S-mode will raise an illegal-instruction exception. When TVM=0, these operations are permitted in S-mode. mstatus_tvm_warl: The TVM (Trap Virtual Memory) bit is a WARL field that supports intercepting supervisor virtual-memory management operations.

SvSm_mstatus_mprv_cg/cp_tvm_exception_s, SvinvalSm_cg/cr_svinival

mstatus_mstatush_xbe_warl

The MBE, SBE, and UBE bits in mstatus and mstatush are WARL fields that control the endianness of memory accesses other than instruction fetches. Each may be read/write or read-only.

SvSm_mstatus_mprv_cg/cp_mstatus_sbe_{read,write}

mstatus_sbe_implicit

For implicit accesses to supervisor-level memory management data structures, such as page tables, endianness is always controlled by SBE.

SvSm_mstatus_mprv_cg/cp_mstatus_sbe_{read,write}

mtval_vaddr_wr_faulting_addr

If mtval is written with a nonzero value when a breakpoint, address-misaligned, access-fault, page-fault, or hardware-error exception occurs on an instruction fetch, load, or store, then mtval will contain the faulting virtual address.

SvSm_mstatus_mprv_cg/{load_page_fault,store_page_fault}

UDB Parameters: None.

B.8.3. Svbare Virtual Memory Off

Table 254. Svbare Coverpoints
Coverpoint Goal Feature Description Expectation Bins ID Normative Rule

General Test Environment (Svbare):
- T-SBI suite: boots to S-mode with satp.MODE=Bare; the U-mode case uses RVTEST_TSBI_GOTO_UMODE / _SMODE.
Normative rules without a coverpoint in this suite:
- SATP_MODE_ROZ_SFENCE_ILLEGAL: Not tested: needs satp.MODE read-only zero (UDB TRAP_ON_SFENCE_VMA_WHEN_SATP_MODE_IS_READ_ONLY)

cp_satp_bare_load

Verify a load with satp.MODE=Bare uses the physical address in S-mode and U-mode

S-mode: write satp = 0 and read it back. Load (lw) from the page at the physical address of rvtest_data_1 in S-mode, then in U-mode (RVTEST_TSBI_GOTO_UMODE).

No fault; the access reaches physical memory untranslated.

satp_bare x read_acc x mode {S/U-mode}
= 2 bins on RV64, 2 on RV32

satp_mode svbare_satp_mode_bare

satp_mode_enc
satp_mode
satp_mode_bare_op
svbare_satp_mode_bare

cp_satp_bare_store

Verify a store with satp.MODE=Bare uses the physical address in S-mode and U-mode

S-mode: write satp = 0 and read it back. Store (sw) to the page at the physical address of rvtest_data_1 in S-mode, then in U-mode (RVTEST_TSBI_GOTO_UMODE).

No fault; the access reaches physical memory untranslated.

satp_bare x write_acc x mode {S/U-mode}
= 2 bins on RV64, 2 on RV32

satp_mode svbare_satp_mode_bare

satp_mode_enc
satp_mode
satp_mode_bare_op
svbare_satp_mode_bare

cp_satp_bare_exec

Verify an instruction fetch with satp.MODE=Bare uses the physical address in S-mode and U-mode

S-mode: write satp = 0 and read it back. Jump (jalr) into the page at the physical address of rvtest_data_1 in S-mode, then in U-mode (RVTEST_TSBI_GOTO_UMODE).

No fault; the access reaches physical memory untranslated.

satp_bare x exec_acc x mode {S/U-mode}
= 2 bins on RV64, 2 on RV32

satp_mode svbare_satp_mode_bare

satp_mode_enc
satp_mode
satp_mode_bare_op
svbare_satp_mode_bare

Table 255. Svbare Normative Rules
Normative Rule Rule Text Coverpoints

satp_mode

norm:satp_mode_enc shows the encodings of the MODE field when SXLEN=32 and SXLEN=64.

Svbare_cg/{satp_bare,cp_satp_bare_load,cp_satp_bare_store,cp_satp_bare_exec}

satp_mode_bare_op

When MODE=Bare, supervisor virtual addresses are equal to supervisor physical addresses, and there is no additional memory protection beyond the physical memory protection scheme described in pmp.

Svbare_cg/{cp_satp_bare_load, cp_satp_bare_store, cp_satp_bare_exec}

satp_mode_bare_zero_fields

To select MODE=Bare, software must write zero to the remaining fields of satp (bits 30–0 when SXLEN=32, or bits 59–0 when SXLEN=64).

Not tested: requirement on software; the tests write satp=0 to select Bare

satp_mode_bare_nonzero_unspec

Attempting to select MODE=Bare with a nonzero pattern in the remaining fields has an UNSPECIFIED effect on the value that the remaining fields assume and an UNSPECIFIED effect on address translation and protection behavior.

Not tested: behavior is UNSPECIFIED

satp_bare_rsv_custom

When SXLEN=32, the satp encodings corresponding to MODE=Bare and ASID[8:7]=3 are designated for custom use, whereas the encodings corresponding to MODE=Bare and ASID[8:7]≠3 are reserved for future standard use. When SXLEN=64, all satp encodings corresponding to MODE=Bare are reserved for future standard use.

Not tested: reserved and custom encodings

svbare_satp_mode_bare

If an implementation supports the Svbare extension, then the satp register’s MODE field must be capable of holding the value Bare.

Svbare_cg/satp_bare

satp_mode_roz_sfence_illegal

For implementations that make satp.MODE read-only zero (always Bare), attempts to execute an SFENCE.VMA instruction might raise an illegal-instruction exception.

Not tested: needs satp.MODE read-only zero (UDB TRAP_ON_SFENCE_VMA_WHEN_SATP_MODE_IS_READ_ONLY)

UDB Parameters: None.

B.8.4. SvbareSm Virtual Memory Off with MPRV

Table 256. SvbareSm Coverpoints
Coverpoint Goal Feature Description Expectation Bins ID Normative Rule

General Test Environment (SvbareSm):
- Sm suite: boots to M-mode (BOOT_TO_MMODE) because each coverpoint needs M-mode state (mstatus.MPRV/MPP, mstatus.TVM, mstatus.SBE or an M-mode CSR access). Mode changes use RVTEST_TSBI_GOTO_*. satp.MODE=Bare with mstatus.MPRV=1 and MPP=S or U.
- Split from Svbare: cp_satp_bare_mprv_{load,store,exec}.

cp_satp_bare_mprv_load

Verify an M-mode load with MPRV=1 and satp.MODE=Bare uses the physical address

M-mode with satp = 0: set mstatus.MPRV=1 with MPP=S, then MPP=U, reading mstatus back each time. Load (lw) from the page at the physical address of rvtest_data_1.

No fault; the access is untranslated for either MPP.

satp_bare x mprv_mstatus x mpp_mstatus x read_acc x mode {M-mode}
= 2 bins on RV64, 2 on RV32

mstatus_mprv_ldst_op

mstatus_mprv_ldst_op

cp_satp_bare_mprv_store

Verify an M-mode store with MPRV=1 and satp.MODE=Bare uses the physical address

M-mode with satp = 0: set mstatus.MPRV=1 with MPP=S, then MPP=U, reading mstatus back each time. Store (sw) to the page at the physical address of rvtest_data_1.

No fault; the access is untranslated for either MPP.

satp_bare x mprv_mstatus x mpp_mstatus x write_acc x mode {M-mode}
= 2 bins on RV64, 2 on RV32

mstatus_mprv_ldst_op

mstatus_mprv_ldst_op

cp_satp_bare_mprv_exec

Verify an M-mode instruction fetch with MPRV=1 and satp.MODE=Bare uses the physical address

M-mode with satp = 0: set mstatus.MPRV=1 with MPP=S, then MPP=U, reading mstatus back each time. Jump (jalr) into the page at the physical address of rvtest_data_1.

No fault; the access is untranslated for either MPP.

satp_bare x mprv_mstatus x mpp_mstatus x exec_acc x mode {M-mode}
= 2 bins on RV64, 2 on RV32

mstatus_mprv_inst_xlat_op

mstatus_mprv_inst_xlat_op

Table 257. SvbareSm Normative Rules
Normative Rule Rule Text Coverpoints

mstatus_mprv_ldst_op

When MPRV=0, explicit memory accesses behave as normal, using the translation and protection mechanisms of the current privilege mode. When MPRV=1, load and store memory addresses are translated and protected, and endianness is applied, as though the current privilege mode were set to MPP.

SvbareSm_cg/cp_satp_bare_mprv_{load,store}

mstatus_mprv_inst_xlat_op

Instruction address-translation and protection are unaffected by the setting of MPRV.

SvSm_mstatus_mprv_cg/cp_mprv_ins

UDB Parameters: None.

B.8.5. SvPMP VirtMem + PMP

Table 258. SvPMP Coverpoints
Coverpoint Goal Feature Description Expectation Bins ID Normative Rule

General Test Environment (SvPMP):
- Boots to M-mode (legacy mode hops) because each test programs PMP entries, which are M-mode CSRs. Unchanged by the T-SBI conversion. Run for every supported translation mode: Sv32 on RV32; Sv39, Sv48 and Sv57 on RV64, as selected by the UDB configuration.

mode

Verify each supported translation mode is exercised with PMP

Sampled while the SvPMP tests run under satp.MODE = Sv32, Sv39, Sv48 or Sv57.

Every supported mode is observed.

mode {sv57, sv48, sv39, sv32}
= 3 bins on RV64, 1 on RV32

pmp0_pte_noread_s

Verify PMP applies to the implicit page-table read of a load from S-mode

S-mode: PMP entry 0 (NAPOT) covers the page table used by the walk, at each level, with R=0; the background PMP region allows everything else. Load (lw) from the page through va_data.

Load access fault (mcause = 5); mtval = faulting virtual address.

PageType_d x PMP0_PTE x load_acc_fault x lw x mode {S-mode}
= 7 bins on RV64, 2 on RV32

pmp_check_pagetable_access pmp_with_paging pmp_sfence_required

pmp_check_pagetable_access
pmp_with_paging
pmp_sfence_required

pmp0_pte_noread_u

Verify PMP applies to the implicit page-table read of a load from U-mode

U-mode: PMP entry 0 (NAPOT) covers the page table used by the walk, at each level, with R=0; the background PMP region allows everything else. Load (lw) from the page through va_data.

Load access fault (mcause = 5); mtval = faulting virtual address.

PageType_d x PMP0_PTE x load_acc_fault x lw x mode {U-mode}
= 7 bins on RV64, 2 on RV32

pmp_check_pagetable_access pmp_with_paging pmp_sfence_required

pmp_check_pagetable_access
pmp_with_paging
pmp_sfence_required

pmp0_pte_nowrite_s

Verify PMP applies to the implicit page-table read of a store from S-mode

S-mode: PMP entry 0 (NAPOT) covers the page table used by the walk, at each level, with R=0; the background PMP region allows everything else. Store (sw) to the page through va_data.

Store/AMO access fault (mcause = 7); mtval = faulting virtual address.

PageType_d x PMP0_PTE x store_acc_fault x sw x mode {S-mode}
= 7 bins on RV64, 2 on RV32

pmp_check_pagetable_access pmp_with_paging pmp_sfence_required

pmp_check_pagetable_access
pmp_with_paging
pmp_sfence_required

pmp0_pte_nowrite_u

Verify PMP applies to the implicit page-table read of a store from U-mode

U-mode: PMP entry 0 (NAPOT) covers the page table used by the walk, at each level, with R=0; the background PMP region allows everything else. Store (sw) to the page through va_data.

Store/AMO access fault (mcause = 7); mtval = faulting virtual address.

PageType_d x PMP0_PTE x store_acc_fault x sw x mode {U-mode}
= 7 bins on RV64, 2 on RV32

pmp_check_pagetable_access pmp_with_paging pmp_sfence_required

pmp_check_pagetable_access
pmp_with_paging
pmp_sfence_required

pmp0_pte_noexec_s

Verify PMP applies to the implicit page-table read of an instruction fetch from S-mode

S-mode: PMP entry 0 (NAPOT) covers the page table used by the walk, at each level, with R=0; the background PMP region allows everything else. Jump (jalr) into the page through va_data.

Instruction access fault (mcause = 1); mtval = faulting virtual address.

PageType_i x PMP0_PTE x ins_acc_fault x jalr x mode {S-mode}
= 7 bins on RV64, 2 on RV32

pmp_check_pagetable_access pmp_with_paging pmp_sfence_required

pmp_check_pagetable_access
pmp_with_paging
pmp_sfence_required

pmp0_pte_noexec_u

Verify PMP applies to the implicit page-table read of an instruction fetch from U-mode

U-mode: PMP entry 0 (NAPOT) covers the page table used by the walk, at each level, with R=0; the background PMP region allows everything else. Jump (jalr) into the page through va_data.

Instruction access fault (mcause = 1); mtval = faulting virtual address.

PageType_i x PMP0_PTE x ins_acc_fault x jalr x mode {U-mode}
= 7 bins on RV64, 2 on RV32

pmp_check_pagetable_access pmp_with_paging pmp_sfence_required

pmp_check_pagetable_access
pmp_with_paging
pmp_sfence_required

pmp0_PA_noread_s

Verify PMP applies to the translated physical address of a load from S-mode

S-mode: valid leaf PTE with PTE.U=0 at every page-table level (4 KiB page and each superpage size of the Sv mode); PMP entry 0 removes R from the translated physical page. Load (lw) from the page through va_data.

Load access fault (mcause = 5); mtval = faulting virtual address.

PTE_d x PageType_d x PMP0_PA x load_acc_fault x read_acc x mode {S-mode}
= 7 bins on RV64, 2 on RV32

mtval_vaddr_not_paddr

mtval_vaddr_not_paddr

pmp0_PA_noread_u

Verify PMP applies to the translated physical address of a load from U-mode

U-mode: valid leaf PTE with PTE.U=1 at every page-table level (4 KiB page and each superpage size of the Sv mode); PMP entry 0 removes R from the translated physical page. Load (lw) from the page through va_data.

Load access fault (mcause = 5); mtval = faulting virtual address.

PTE_d x PageType_d x PMP0_PA x load_acc_fault x read_acc x mode {U-mode}
= 7 bins on RV64, 2 on RV32

mtval_vaddr_not_paddr

mtval_vaddr_not_paddr

pmp0_PA_nowrite_s

Verify PMP applies to the translated physical address of a store from S-mode

S-mode: valid leaf PTE with PTE.U=0 at every page-table level (4 KiB page and each superpage size of the Sv mode); PMP entry 0 removes W from the translated physical page. Store (sw) to the page through va_data.

Store/AMO access fault (mcause = 7); mtval = faulting virtual address.

PTE_d x PageType_d x PMP0_PA x store_acc_fault x write_acc x mode {S-mode}
= 7 bins on RV64, 2 on RV32

mtval_vaddr_not_paddr

mtval_vaddr_not_paddr

pmp0_PA_nowrite_u

Verify PMP applies to the translated physical address of a store from U-mode

U-mode: valid leaf PTE with PTE.U=1 at every page-table level (4 KiB page and each superpage size of the Sv mode); PMP entry 0 removes W from the translated physical page. Store (sw) to the page through va_data.

Store/AMO access fault (mcause = 7); mtval = faulting virtual address.

PTE_d x PageType_d x PMP0_PA x store_acc_fault x write_acc x mode {U-mode}
= 7 bins on RV64, 2 on RV32

mtval_vaddr_not_paddr

mtval_vaddr_not_paddr

pmp0_PA_noexec_s

Verify PMP applies to the translated physical address of an instruction fetch from S-mode

S-mode: valid leaf PTE with PTE.U=0 at every page-table level (4 KiB page and each superpage size of the Sv mode); PMP entry 0 removes X from the translated physical page. Jump (jalr) into the page through va_data.

Instruction access fault (mcause = 1); mtval = faulting virtual address.

PTE_i x PageType_i x PMP0_PA x ins_acc_fault x exec_acc x mode {S-mode}
= 7 bins on RV64, 2 on RV32

mtval_vaddr_not_paddr

mtval_vaddr_not_paddr

pmp0_PA_noexec_u

Verify PMP applies to the translated physical address of an instruction fetch from U-mode

U-mode: valid leaf PTE with PTE.U=1 at every page-table level (4 KiB page and each superpage size of the Sv mode); PMP entry 0 removes X from the translated physical page. Jump (jalr) into the page through va_data.

Instruction access fault (mcause = 1); mtval = faulting virtual address.

PTE_i x PageType_i x PMP0_PA x ins_acc_fault x exec_acc x mode {U-mode}
= 7 bins on RV64, 2 on RV32

mtval_vaddr_not_paddr

mtval_vaddr_not_paddr

Table 259. SvPMP Normative Rules
Normative Rule Rule Text Coverpoints

pmp_check_pagetable_access, pmp_with_paging

pmp_check_pagetable_access: PMP checks are also applied to page-table accesses for virtual-address translation, for which the effective privilege mode is S. pmp_with_paging: When paging is enabled, instructions that access virtual memory may result in multiple physical-memory accesses, including implicit references to the page tables. The PMP checks apply to all of these accesses.

SvPMP_cg/pmp0_pte_{noread,nowrite,noexec}_s

pmp_speculative_translations

Implementations with virtual memory are permitted to perform address translations speculatively and earlier than required by an explicit memory access, and are permitted to cache them in address translation cache structures—including possibly caching the identity mappings from effective address to physical address used in Bare translation modes and M-mode. The PMP settings for the resulting physical address may be checked (and possibly cached) at any point between the address translation and the explicit memory access.

Not tested: when translations and PMP checks are cached is not observable

pmp_sfence_required

when the PMP settings are modified, M-mode software must synchronize the PMP settings with the virtual memory system and any PMP or address-translation caches. This is accomplished by executing an SFENCE.VMA instruction with rs1=x0 and rs2=x0, after the PMP CSRs are written.

Not tested: the tests always execute SFENCE.VMA after writing the PMP CSRs

mtval_vaddr_not_paddr

When page-based virtual memory is enabled, mtval is written with the faulting virtual address, even for physical-memory access-fault exceptions.

SvPMP_cg/pmp0_PA_{noread,nowrite,noexec}_s

UDB Parameters: None.

B.8.6. SvZicbo VirtMem + CBOM/CBOZ

Table 260. SvZicbo Coverpoints
Coverpoint Goal Feature Description Expectation Bins ID Normative Rule

General Test Environment (SvZicbo):
- T-SBI suite: boots to S-mode (BOOT_TO_SMODE) and drives the test from the boot identity map. The page under test is mapped at va_data. S-mode accesses run from the identity map. U-mode accesses use RVTEST_TSBI_GOTO_UMODE / RVTEST_TSBI_GOTO_SMODE; the handler moves execution to the U-accessible code alias va_rvtest_code_begin (registered with SAVE_AREA_SETUP) and back. menvcfg is written through T-SBI CSR calls. Page faults are delegated to S-mode, so causes are sampled from scause/stval.
- menvcfg.CBCFE/CBIE/CBZE are set through T-SBI; U-mode tests also set senvcfg.
- Run for every supported translation mode: Sv32 on RV32; Sv39, Sv48 and Sv57 on RV64, as selected by the UDB configuration.

cp_PTE_rwx_zicbop_s

Verify prefetch.i/r/w through a valid mapping execute without exception from S-mode

S-mode: RWX leaf PTE with PTE.U=0, at every page-table level (4 KiB page and each superpage size of the Sv mode). Execute prefetch.i, prefetch.r and prefetch.w on va_data.

No exception; prefetches never fault.

PTE_RWX_d x PageType_d x zicbop_ins x mode {S-mode}
= 7 bins on RV64, 2 on RV32

cbp_unperm_translate

[norm:cbp_unperm_translate]

cp_PTE_rwx_zicbop_u

Verify prefetch.i/r/w through a valid mapping execute without exception from U-mode

U-mode: RWX leaf PTE with PTE.U=1, at every page-table level (4 KiB page and each superpage size of the Sv mode). Execute prefetch.i, prefetch.r and prefetch.w on va_data.

No exception; prefetches never fault.

PTE_RWX_d x PageType_d x zicbop_ins x mode {U-mode}
= 7 bins on RV64, 2 on RV32

cbp_unperm_translate

[norm:cbp_unperm_translate]

cp_PTE_inv_cbo_s

Verify a CBO through an invalid PTE (V=0) raises a store/AMO page fault from S-mode

S-mode: leaf PTE with V=0 and PTE.U=0, at every page-table level (4 KiB page and each superpage size of the Sv mode). Execute cbo.clean, cbo.flush and cbo.inval (Zicbom) or cbo.zero (Zicboz) on va_data.

Store/AMO page fault (scause = 15) for every CBO; stval = faulting virtual address.

PTE_d_inv x PageType_d x store_page_fault x cbo_ins x mode {S-mode}
= 14 bins on RV64, 4 on RV32

fault_excep_csr

fault_excep_csr
cbm_page_fault
[norm:fault_excep_csr]

cp_PTE_inv_cbo_u

Verify a CBO through an invalid PTE (V=0) raises a store/AMO page fault from U-mode

U-mode: leaf PTE with V=0 and PTE.U=1, at every page-table level (4 KiB page and each superpage size of the Sv mode). Execute cbo.clean, cbo.flush and cbo.inval (Zicbom) or cbo.zero (Zicboz) on va_data.

Store/AMO page fault (scause = 15) for every CBO; stval = faulting virtual address.

PTE_d_inv x PageType_d x store_page_fault x cbo_ins x mode {U-mode}
= 14 bins on RV64, 4 on RV32

fault_excep_csr

fault_excep_csr
[norm:fault_excep_csr]

cp_PTE_res_rwx_cbo_s

Verify a CBO through the reserved encoding W=1, R=0 raises a store/AMO page fault from S-mode

S-mode: leaf PTE with W=1, R=0 (with X=1 and with X=0) and PTE.U=0, at every page-table level (4 KiB page and each superpage size of the Sv mode). Execute the CBOs on va_data.

Store/AMO page fault (scause = 15).

PTE_d_res_rwx x PageType_d x store_page_fault x cbo_ins x mode {S-mode}
= 28 bins on RV64, 8 on RV32

cp_PTE_res_rwx_cbo_u

Verify a CBO through the reserved encoding W=1, R=0 raises a store/AMO page fault from U-mode

U-mode: leaf PTE with W=1, R=0 (with X=1 and with X=0) and PTE.U=1, at every page-table level (4 KiB page and each superpage size of the Sv mode). Execute the CBOs on va_data.

Store/AMO page fault (scause = 15).

PTE_d_res_rwx x PageType_d x store_page_fault x cbo_ins x mode {U-mode}
= 28 bins on RV64, 8 on RV32

cp_PTE_nonleaf_lvl0_cbo_s

Verify a CBO through a level-0 pointer PTE raises a store/AMO page fault from S-mode

S-mode: level-0 PTE with V=1, R=W=X=0 and PTE.U=0. Execute the CBOs on va_data.

Store/AMO page fault (scause = 15).

PTE_nonleaf_lvl0_d x kilo_page x mode x store_page_fault x cbo_ins x mode {S-mode}
= 6 bins on RV64, 2 on RV32

cp_PTE_nonleaf_lvl0_cbo_u

Verify a CBO through a level-0 pointer PTE raises a store/AMO page fault from U-mode

U-mode: level-0 PTE with V=1, R=W=X=0 and PTE.U=1. Execute the CBOs on va_data.

Store/AMO page fault (scause = 15).

PTE_nonleaf_lvl0_d x kilo_page x mode x store_page_fault x cbo_ins x mode {U-mode}
= 6 bins on RV64, 2 on RV32

cp_PTE_r_set_w_unset_zicbom_s

Verify Zicbom CBOs succeed with R=1 and W=0 from S-mode

S-mode: RX leaf PTE (R=1, W=0) with PTE.U=0, at every page-table level (4 KiB page and each superpage size of the Sv mode), with sstatus.SUM=0 and SUM=1. Execute cbo.clean, cbo.flush and cbo.inval on va_data.

No exception: Zicbom needs read or write permission.

PTE_r_set_w_unset_spage_d x PageType_d x cbo_ins x sum_sstatus x mode {S-mode}
= 14 bins on RV64, 4 on RV32

cbm_access

cp_PTE_r_set_w_unset_zicbom_u

Verify Zicbom CBOs succeed with R=1 and W=0 from U-mode

U-mode: RX leaf PTE (R=1, W=0) with PTE.U=1, at every page-table level (4 KiB page and each superpage size of the Sv mode). Execute cbo.clean, cbo.flush and cbo.inval on va_data.

No exception: Zicbom needs read or write permission.

PTE_r_set_w_unset_upage_d x PageType_d x cbo_ins x mode {U-mode}
= 7 bins on RV64, 2 on RV32

cbm_access

cp_PTE_rw_unset_zicbom_s

Verify Zicbom CBOs raise a store/AMO page fault with R=0 and W=0 from S-mode

S-mode: execute-only leaf PTE with PTE.U=0, at every page-table level (4 KiB page and each superpage size of the Sv mode). Execute cbo.clean, cbo.flush and cbo.inval on va_data.

Store/AMO page fault (scause = 15).

PTE_x_spage_d x PageType_d x store_page_fault x cbo_ins x mode {S-mode}
= 7 bins on RV64, 2 on RV32

cbm_unperm_fault

cbm_unperm_fault
cbm_page_fault
[norm:cbm_unperm_fault]

cp_PTE_rw_unset_zicbom_u

Verify Zicbom CBOs raise a store/AMO page fault with R=0 and W=0 from U-mode

U-mode: execute-only leaf PTE with PTE.U=1, at every page-table level (4 KiB page and each superpage size of the Sv mode). Execute cbo.clean, cbo.flush and cbo.inval on va_data.

Store/AMO page fault (scause = 15).

PTE_x_upage_d x PageType_d x store_page_fault x cbo_ins x mode {U-mode}
= 7 bins on RV64, 2 on RV32

cbm_unperm_fault

cbm_unperm_fault
cbm_page_fault
[norm:cbm_unperm_fault]

cp_PTE_w_unset_zicboz_s

Verify cbo.zero raises a store/AMO page fault with W=0 from S-mode

S-mode: RX leaf PTE (W=0) with PTE.U=0, at every page-table level (4 KiB page and each superpage size of the Sv mode), with sstatus.SUM=0 and SUM=1. Execute cbo.zero on va_data.

Store/AMO page fault (scause = 15).

PTE_w_unset_spage_d x PageType_d x store_page_fault x cbo_ins x sum_sstatus x mode {S-mode}
= 14 bins on RV64, 4 on RV32

cbz_unperm_fault

cbz_unperm_fault
[norm:cbz_unperm_fault]

cp_PTE_w_unset_zicboz_u

Verify cbo.zero raises a store/AMO page fault with W=0 from U-mode

U-mode: RX leaf PTE (W=0) with PTE.U=1, at every page-table level (4 KiB page and each superpage size of the Sv mode). Execute cbo.zero on va_data.

Store/AMO page fault (scause = 15).

PTE_w_unset_upage_d x PageType_d x store_page_fault x cbo_ins x mode {U-mode}
= 7 bins on RV64, 2 on RV32

cbz_unperm_fault

cbz_unperm_fault
[norm:cbz_unperm_fault]

cp_spage_rwx_cbo_u

Verify a U-mode CBO to a supervisor page (U=0) raises a store/AMO page fault

U-mode: supervisor RWX leaf PTE (U=0), at every page-table level (4 KiB page and each superpage size of the Sv mode). Execute the CBOs on va_data.

Store/AMO page fault (scause = 15).

PTE_spage_d x PageType_d x store_page_fault x cbo_ins x mode {U-mode}
= 14 bins on RV64, 4 on RV32

cbm_page_fault

cp_upage_sumunset_cbo_s

Verify an S-mode CBO to a user page (U=1) raises a store/AMO page fault when sstatus.SUM=0

S-mode with sstatus.SUM=0: user RWX leaf PTE (U=1), at every page-table level (4 KiB page and each superpage size of the Sv mode). Execute the CBOs on va_data.

Store/AMO page fault (scause = 15).

PTE_upage_d x PageType_d x store_page_fault x cbo_ins x sum_sstatus x mode {S-mode}
= 14 bins on RV64, 4 on RV32

cp_Abit_unset_cbo_s

Verify a CBO through a PTE with A=0 raises a store/AMO page fault from S-mode (no hardware A update)

S-mode: leaf PTE with A=0 and PTE.U=0, at every page-table level (4 KiB page and each superpage size of the Sv mode); menvcfg.ADUE=0. Execute the CBOs on va_data.

Store/AMO page fault (scause = 15).

PTE_Abit_unset_d x PageType_d x store_page_fault x cbo_ins x mode {S-mode}
= 14 bins on RV64, 4 on RV32

cbm_unperm_translate cbz_unperm_translate

cbm_unperm_translate
cbz_unperm_translate
[norm:cbm_unperm_translate] [norm:cbz_unperm_translate]

cp_Abit_unset_cbo_u

Verify a CBO through a PTE with A=0 raises a store/AMO page fault from U-mode (no hardware A update)

U-mode: leaf PTE with A=0 and PTE.U=1, at every page-table level (4 KiB page and each superpage size of the Sv mode); menvcfg.ADUE=0. Execute the CBOs on va_data.

Store/AMO page fault (scause = 15).

PTE_Abit_unset_d x PageType_d x store_page_fault x cbo_ins x mode {U-mode}
= 14 bins on RV64, 4 on RV32

cbm_unperm_translate

cbm_unperm_translate
cbz_unperm_translate
[norm:cbm_unperm_translate]

cp_Dbit_unset_zicbom_s

Verify Zicbom CBOs do not check PTE.D from S-mode

S-mode: leaf PTE with A=1, D=0 and PTE.U=0, at every page-table level (4 KiB page and each superpage size of the Sv mode). Execute cbo.clean, cbo.flush and cbo.inval on va_data.

No exception and D is not set.

PTE_Dbit_unset_d x PageType_d x cbo_ins x mode {S-mode}
= 7 bins on RV64, 2 on RV32

cp_Dbit_unset_zicbom_u

Verify Zicbom CBOs do not check PTE.D from U-mode

U-mode: leaf PTE with A=1, D=0 and PTE.U=1, at every page-table level (4 KiB page and each superpage size of the Sv mode). Execute cbo.clean, cbo.flush and cbo.inval on va_data.

No exception and D is not set.

PTE_Dbit_unset_d x PageType_d x cbo_ins x mode {U-mode}
= 7 bins on RV64, 2 on RV32

cp_Dbit_unset_zicboz_s

Verify cbo.zero through a PTE with D=0 raises a store/AMO page fault from S-mode (no hardware D update)

S-mode: leaf PTE with A=1, D=0 and PTE.U=0, at every page-table level (4 KiB page and each superpage size of the Sv mode); menvcfg.ADUE=0. Execute cbo.zero on va_data.

Store/AMO page fault (scause = 15).

PTE_Dbit_unset_d x PageType_d x store_page_fault x cbo_ins x mode {S-mode}
= 7 bins on RV64, 2 on RV32

cbz_unperm_translate

cbz_unperm_translate
[norm:cbz_unperm_translate]

cp_Dbit_unset_zicboz_u

Verify cbo.zero through a PTE with D=0 raises a store/AMO page fault from U-mode (no hardware D update)

U-mode: leaf PTE with A=1, D=0 and PTE.U=1, at every page-table level (4 KiB page and each superpage size of the Sv mode); menvcfg.ADUE=0. Execute cbo.zero on va_data.

Store/AMO page fault (scause = 15).

PTE_Dbit_unset_d x PageType_d x store_page_fault x cbo_ins x mode {U-mode}
= 7 bins on RV64, 2 on RV32

cbz_unperm_translate

cp_misaligned_page_cbo_s

Verify a CBO through a misaligned superpage raises a store/AMO page fault from S-mode

S-mode: superpage leaf PTE with PTE.U=0 whose PPN has non-zero bits below the superpage size, at each superpage level. Execute the CBOs on va_data.

Store/AMO page fault (scause = 15).

PTE_RWX_d x misaligned_PPN_d x store_page_fault x cbo_ins x mode {S-mode}
= 10 bins on RV64, 2 on RV32

cp_misaligned_page_cbo_u

Verify a CBO through a misaligned superpage raises a store/AMO page fault from U-mode

U-mode: superpage leaf PTE with PTE.U=1 whose PPN has non-zero bits below the superpage size, at each superpage level. Execute the CBOs on va_data.

Store/AMO page fault (scause = 15).

PTE_RWX_d x misaligned_PPN_d x store_page_fault x cbo_ins x mode {U-mode}
= 10 bins on RV64, 2 on RV32

cp_PTE_nonleaf_DAU_cbo

Verify a CBO with D, A or U set in a non-leaf PTE raises a store/AMO page fault

S-mode and U-mode: set D, A or U (one at a time) in the non-leaf PTE above a valid leaf. Execute the CBOs on va_data. Requires privileged spec 1.12 or later.

Store/AMO page fault (scause = 15).

PTE_DAU_d x PageType_d x store_page_fault x cbo_ins x mode {S/U-mode}
= 60 bins on RV64, 12 on RV32

cp_leaf_PTE_to_nonexistent_pa_cbo_s

Verify a CBO to a non-existent physical address raises a store/AMO access fault from S-mode

S-mode: valid leaf PTE with PTE.U=0 pointing at RVMODEL_ACCESS_FAULT_ADDRESS, at every page-table level (4 KiB page and each superpage size of the Sv mode). Execute the CBOs on va_data.

Store/AMO access fault (scause = 7); stval = faulting virtual address.

PTE_RWX_d x d_phys_address_nonexistent x PageType_d x store_acc_fault x cbo_ins x mode {S-mode}
= 14 bins on RV64, 4 on RV32

pma_chk_paddr

pma_chk_paddr
[norm:pma_chk_paddr]

cp_leaf_PTE_to_nonexistent_pa_cbo_u

Verify a CBO to a non-existent physical address raises a store/AMO access fault from U-mode

U-mode: valid leaf PTE with PTE.U=1 pointing at RVMODEL_ACCESS_FAULT_ADDRESS, at every page-table level (4 KiB page and each superpage size of the Sv mode). Execute the CBOs on va_data.

Store/AMO access fault (scause = 7); stval = faulting virtual address.

PTE_RWX_d x d_phys_address_nonexistent x PageType_d x store_acc_fault x cbo_ins x mode {U-mode}
= 14 bins on RV64, 4 on RV32

pma_chk_paddr

pma_chk_paddr
[norm:pma_chk_paddr]

cp_nonleaf_PTE_to_nonexistent_pa_cbo

Verify a CBO whose page-table walk reads a non-existent physical address raises a store/AMO access fault

S-mode and U-mode: non-leaf PTE pointing at RVMODEL_ACCESS_FAULT_ADDRESS instead of the next page table. Execute the CBOs on va_data.

Store/AMO access fault (scause = 7).

pointer_PTE_d x d_phys_address_nonexistent x PageType_d x store_acc_fault x cbo_ins x mode {S/U-mode}
= 20 bins on RV64, 4 on RV32

Table 261. SvZicbo Normative Rules
Normative Rule Rule Text Coverpoints

fault_excep_csr

When a page-fault, guest-page-fault, or access-fault exception is taken, the relevant *tval CSR is written with the faulting effective address (i.e. the value of rs1).

SvZicbo_cg/{cp_PTE_inv_cbo_s,cp_PTE_inv_cbo_u}, TODO: guest page fault

cbm_unperm_fault

If access to the cache block is not permitted, a cache-block management instruction raises a store page-fault or store guest-page-fault exception if address translation does not permit any access or raises a store access-fault exception otherwise.

SvZicbo_cg/{cp_PTE_rw_unset_zicbom_s,cp_PTE_rw_unset_zicbom_u}, TODO: guest page fault

cbm_page_fault

The permissions required for a cache-block management instruction are defined in cmo; when address translation does not permit any access, the instruction raises a store page-fault exception.

SvZicbo_cg/{cp_PTE_rw_unset_zicbom_s, cp_PTE_rw_unset_zicbom_u, cp_PTE_inv_cbo_s, cp_spage_rwx_cbo_u}

cbm_unperm_translate

During address translation, the instruction also checks the accessed bit and may either raise an exception or set the bit as required.

SvZicbo_cg/{cp_Abit_unset_cbo_s,cp_Abit_unset_cbo_u}, TODO: guest page fault

cbz_unperm_fault

If access to the cache block is not permitted, a cache-block zero instruction raises a store page-fault or store guest-page-fault exception if address translation does not permit write access or raises a store access-fault exception otherwise.

SvZicbo_cg/{cp_PTE_w_unset_zicboz_s,cp_PTE_w_unset_zicboz_u}, TODO: guest page fault

cbz_unperm_translate

During address translation, the instruction also checks the accessed and dirty bits and may either raise an exception or set the bits as required.

SvZicbo_cg/{cp_Abit_unset_cbo_s, cp_Abit_unset_cbo_u, cp_Dbit_unset_zicboz_s, cp_Dbit_unset_zicboz_u}

cbp_unperm_translate

During address translation, the instruction does not check the accessed and dirty bits and neither raises an exception nor sets the bits.

cbm_access

A cache-block management instruction is permitted to access the specified cache block whenever a load instruction or store instruction is permitted to access the corresponding physical addresses.

SvZicbo_cg/{cp_PTE_r_set_w_unset_zicbom_s,cp_PTE_r_set_w_unset_zicbom_u}

pma_chk_paddr

PMAs are checked for any access to physical memory, including accesses that have undergone virtual to physical memory translation.

SvZicbo_cg/{cp_leaf_PTE_to_nonexistent_pa_cbo_s,cp_leaf_PTE_to_nonexistent_pa_cbo_u}

UDB Parameters: None.

B.8.7. SvPMPZicbo VirtMem + PMP + CBOM/CBOZ

Table 262. SvPMPZicbo Coverpoints
Coverpoint Goal Feature Description Expectation Bins ID Normative Rule

General Test Environment (SvPMPZicbo):
- Boots to M-mode (PMP programming). Unchanged by the T-SBI conversion. Run for every supported translation mode: Sv32 on RV32; Sv39, Sv48 and Sv57 on RV64, as selected by the UDB configuration.

cp_PA_PMP_rw_unset_cbo_s

Verify PMP applies to CBOs on the translated physical address from S-mode

S-mode: valid leaf PTE with PTE.U=0 at every page-table level (4 KiB page and each superpage size of the Sv mode); PMP entry 0 removes R and W from the translated physical page. Execute Zicbom (cbo.clean/flush/inval) or Zicboz (cbo.zero) on va_data.

Store/AMO access fault (mcause = 7).

PTE_s x PageType_d x PMP_perm x cbo_ins x store_acc_fault x mode {S-mode}
= 14 bins on RV64, 4 on RV32

cbm_unperm_fault cbz_unperm_fault

cbm_unperm_fault
cbz_unperm_fault
fault_excep_csr

cp_PA_PMP_rw_unset_cbo_u

Verify PMP applies to CBOs on the translated physical address from U-mode

U-mode: valid leaf PTE with PTE.U=1 at every page-table level (4 KiB page and each superpage size of the Sv mode); PMP entry 0 removes R and W from the translated physical page. Execute Zicbom (cbo.clean/flush/inval) or Zicboz (cbo.zero) on va_data.

Store/AMO access fault (mcause = 7).

PTE_u x PageType_d x PMP_perm x cbo_ins x store_acc_fault x mode {U-mode}
= 14 bins on RV64, 4 on RV32

cbm_unperm_fault cbz_unperm_fault

cbm_unperm_fault
cbz_unperm_fault
fault_excep_csr

cp_PTE_PMP_rw_unset_cbo_s

Verify PMP applies to the page-table read made by a CBO from S-mode

S-mode: PMP entry 0 removes R from the page table used by the walk, at each level. Execute Zicbom or Zicboz on va_data.

Store/AMO access fault (mcause = 7).

PTE_s x PageType_d x PMP_perm x cbo_ins x store_acc_fault x mode {S-mode}
= 14 bins on RV64, 4 on RV32

cbp_unperm_translate pmp_check_pagetable_access

pmp_check_pagetable_access
pmp_with_paging
cbp_unperm_translate

cp_PTE_PMP_rw_unset_cbo_u

Verify PMP applies to the page-table read made by a CBO from U-mode

U-mode: PMP entry 0 removes R from the page table used by the walk, at each level. Execute Zicbom or Zicboz on va_data.

Store/AMO access fault (mcause = 7).

PTE_u x PageType_d x PMP_perm x cbo_ins x store_acc_fault x mode {U-mode}
= 14 bins on RV64, 4 on RV32

cbp_unperm_translate pmp_check_pagetable_access

pmp_check_pagetable_access
pmp_with_paging
cbp_unperm_translate

Table 263. SvPMPZicbo Normative Rules
Normative Rule Rule Text Coverpoints

cbm_unperm_fault

If access to the cache block is not permitted, a cache-block management instruction raises a store page-fault or store guest-page-fault exception if address translation does not permit any access or raises a store access-fault exception otherwise.

SvPMPZicbo_cg/{cp_PA_PMP_rw_unset_cbo_s,cp_PA_PMP_rw_unset_cbo_u}

cbz_unperm_fault

If access to the cache block is not permitted, a cache-block zero instruction raises a store page-fault or store guest-page-fault exception if address translation does not permit write access or raises a store access-fault exception otherwise.

SvPMPZicbo_cg/{cp_PA_PMP_rw_unset_cbo_s,cp_PA_PMP_rw_unset_cbo_u}

fault_excep_csr

When a page-fault, guest-page-fault, or access-fault exception is taken, the relevant *tval CSR is written with the faulting effective address (i.e. the value of rs1).

SvPMPZicbo_cg/{cp_PA_PMP_rw_unset_cbo_s,cp_PA_PMP_rw_unset_cbo_u}

pmp_check_pagetable_access, pmp_with_paging

pmp_check_pagetable_access: PMP checks are also applied to page-table accesses for virtual-address translation, for which the effective privilege mode is S. pmp_with_paging: When paging is enabled, instructions that access virtual memory may result in multiple physical-memory accesses, including implicit references to the page tables. The PMP checks apply to all of these accesses.

SvPMPZicbo_cg/{cp_PTE_PMP_rw_unset_cbo_s,cp_PTE_PMP_rw_unset_cbo_u}

UDB Parameters: None.

B.8.8. Svinval Memory Management Unit Table Invalidation

The Svinval extension defines instructions to update memory management tables for virtual memory and optionally for PMP. Their effect is system-dependent, so these tests simply check that the instructions run.

Table 264. Svinval Coverpoints
Coverpoint Goal Feature Description Expectation Bins ID Normative Rule

General Test Environment (Svinval):
- T-SBI suite: boots to S-mode; the U-mode case uses RVTEST_TSBI_GOTO_UMODE / _SMODE. mstatus.TVM=0.

cr_svinival

Verify the Svinval instructions in S-mode and U-mode with mstatus.TVM=0

S-mode: execute sfence.w.inval, sinval.vma x0, x0, sfence.inval.ir and sfence.vma x0, x0. Switch to U-mode with RVTEST_TSBI_GOTO_UMODE and execute the same four instructions.

S-mode: all four execute without exception. U-mode: illegal-instruction exception (scause = 2) for each.

cp_instr x cp_priv x cp_tvm
= 8 bins on RV64, 8 on RV32

Svinval_sinval_vma_invalidates_same_as_sfence_vma Svinval_sfence_w_inval_orders_before_sinval_vma Svinval_sequence_rs1_rs2 Svinval_illegal_instruction_u_mode Svinval_sfence_w_inval_inval_u_mode Svinval_sfence_w_inval_inval_s_vs_mode

Svinval_illegal_instruction_u_mode
Svinval_sfence_w_inval_inval_u_mode
Svinval_sfence_w_inval_inval_s_vs_mode
[norm:Svinval_sinval_vma_invalidates_same_as_sfence_vma] [norm:Svinval_sfence_w_inval_orders_before_sinval_vma] [norm:Svinval_sequence_rs1_rs2] [norm:Svinval_illegal_instruction_u_mode] [norm:Svinval_sfence_w_inval_inval_u_mode] [norm:Svinval_sfence_w_inval_inval_s_vs_mode]

Table 265. Svinval Normative Rules
Normative Rule Rule Text Coverpoints

Svinval_sinval_vma_invalidates_same_as_sfence_vma

However, unlike SFENCE.VMA, SINVAL.VMA instructions are only ordered with respect to SFENCE.VMA, SFENCE.W.INVAL, and SFENCE.INVAL.IR instructions as defined below.

Svinval_sfence_w_inval_orders_before_sinval_vma

The SFENCE.INVAL.IR instruction guarantees that any previous SINVAL.VMA instructions executed by the current hart are ordered before subsequent implicit references by that hart to the memory-management data structures.

Svinval_sequence_rs1_rs2

the values of rs1 and rs2 for the SFENCE.VMA are the same as those used in the SINVAL.VMA,

Svinval_sequence_reads_writes_before, Svinval_sequence_reads_writes_after

Svinval_sequence_reads_writes_before: reads and writes prior to the SFENCE.W.INVAL are considered to be those prior to the SFENCE.VMA, Svinval_sequence_reads_writes_after: reads and writes following the SFENCE.INVAL.IR are considered to be those subsequent to the SFENCE.VMA.

Not tested: ordering is not observable in single-hart signature tests

Svinval_illegal_instruction_u_mode

In particular, an attempt to execute any of these instructions in U-mode always raises an illegal-instruction exception.

Svinval_cg/cr_svinival

Svinval_sfence_w_inval_inval_u_mode

raises an illegal-instruction exception.

Svinval_cg/cr_svinival

Svinval_sfence_w_inval_inval_s_vs_mode

SFENCE.W.INVAL and SFENCE.INVAL.IR are unaffected by the mstatus.TVM and hstatus.VTVM fields and hence are always permitted in S-mode and VS-mode.

Svinval_cg/cr_svinival, SvinvalSm_cg/cr_svinival, TODO: test in hypervisor tests

Svinval_hinval_vvma_gvma, Svinval_hinval_gvma_uses_vmid, Svinval_virtual_instruction_vu_vs, Svinval_virtual_instruction_vtvms, Svinval_sfence_w_inval_inval_vu_mode

Svinval_hinval_vvma_gvma: These have the same semantics as SINVAL.VMA, except that they combine with SFENCE.W.INVAL and SFENCE.INVAL.IR to replace HFENCE.VVMA and HFENCE.GVMA, respectively, instead of SFENCE.VMA. Svinval_hinval_gvma_uses_vmid: HINVAL.GVMA uses VMIDs instead of ASIDs. Svinval_virtual_instruction_vu_vs: An attempt to execute HINVAL.VVMA or HINVAL.GVMA in VS-mode or VU-mode, or to execute SINVAL.VMA in VU-mode, raises a virtual-instruction exception. Svinval_virtual_instruction_vtvms: When hstatus.VTVM=1, an attempt to execute SINVAL.VMA in VS-mode also raises a virtual-instruction exception. Svinval_sfence_w_inval_inval_vu_mode: Doing so in VU-mode raises a virtual-instruction exception.

TODO: test in hypervisor tests (SvinvalH_cg/cr_svinivalH has no tests yet)

UDB Parameters: None.

B.8.9. SvinvalSm Table Invalidation with mstatus.TVM

Runs the Svinval instructions in M, S and U mode with mstatus.TVM=1.

Table 266. SvinvalSm Coverpoints
Coverpoint Goal Feature Description Expectation Bins ID Normative Rule

General Test Environment (SvinvalSm):
- Sm suite: boots to M-mode (BOOT_TO_MMODE) because each coverpoint needs M-mode state (mstatus.MPRV/MPP, mstatus.TVM, mstatus.SBE or an M-mode CSR access). Mode changes use RVTEST_TSBI_GOTO_*. Runs the Svinval instructions in M, S and U mode, first with mstatus.TVM=0 and then with mstatus.TVM=1.
- Split from Svinval: the M-mode and mstatus.TVM=1 bins of cr_svinival. The suite also repeats the S-mode and U-mode cases with TVM=0 so the cross closes without ignore_bins.

cr_svinival

Verify the Svinval instructions in M-mode, S-mode and U-mode with mstatus.TVM clear and set

Execute sfence.w.inval, sinval.vma x0, x0, sfence.inval.ir and sfence.vma x0, x0 in M-mode, then in S-mode (RVTEST_TSBI_GOTO_SMODE) and U-mode (RVTEST_TSBI_GOTO_UMODE); repeat the whole sequence after setting mstatus.TVM in M-mode and reading mstatus back.

M-mode: all execute for either TVM. S-mode with TVM=0: all execute; with TVM=1 sinval.vma and sfence.vma raise illegal instruction (mcause = 2) while sfence.w.inval and sfence.inval.ir execute. U-mode: illegal instruction for each, for either TVM.

cp_instr x cp_priv x cp_tvm
= 24 bins on RV64, 24 on RV32

mstatus_tvm_op MSTATUS_TVM_WARL Svinval_sfence_w_inval_inval_s_vs_mode Svinval_illegal_instruction_tvm

mstatus_tvm_op
mstatus_tvm_warl
Svinval_sfence_w_inval_inval_s_vs_mode
Svinval_illegal_instruction_tvm
[norm:mstatus_tvm_op] [norm:MSTATUS_TVM_WARL] [norm:Svinval_sfence_w_inval_inval_s_vs_mode] [norm:Svinval_illegal_instruction_tvm]

Table 267. SvinvalSm Normative Rules
Normative Rule Rule Text Coverpoints

Svinval_illegal_instruction_tvm

An attempt to execute SINVAL.VMA or HINVAL.GVMA in S-mode or HS-mode when mstatus.TVM=1 also raises an illegal-instruction exception.

SvinvalSm_cg/cr_svinival

Svinval_sfence_w_inval_inval_s_vs_mode

SFENCE.W.INVAL and SFENCE.INVAL.IR are unaffected by the mstatus.TVM and hstatus.VTVM fields and hence are always permitted in S-mode and VS-mode.

SvinvalSm_cg/cr_svinival

mstatus_tvm_op, mstatus_tvm_warl

mstatus_tvm_op: When TVM=1, attempts to read or write the satp CSR or execute an SFENCE.VMA or SINVAL.VMA instruction while executing in S-mode will raise an illegal-instruction exception. When TVM=0, these operations are permitted in S-mode. mstatus_tvm_warl: The TVM (Trap Virtual Memory) bit is a WARL field that supports intercepting supervisor virtual-memory management operations.

SvinvalSm_cg/cr_svinival

UDB Parameters: None.

B.8.10. Svade A/D Bit Page Fault Exception

Table 268. Svade Coverpoints
Coverpoint Goal Feature Description Expectation Bins ID Normative Rule

General Test Environment (Svade):
- T-SBI suite: boots to S-mode (BOOT_TO_SMODE) and drives the test from the boot identity map. The page under test is mapped at va_data. S-mode accesses run from the identity map. U-mode accesses use RVTEST_TSBI_GOTO_UMODE / RVTEST_TSBI_GOTO_SMODE; the handler moves execution to the U-accessible code alias va_rvtest_code_begin (registered with SAVE_AREA_SETUP) and back. menvcfg is written through T-SBI CSR calls. Page faults are delegated to S-mode, so causes are sampled from scause/stval.
- menvcfg.ADUE (menvcfgh.ADUE on RV32) is cleared through T-SBI so A/D bits are not updated by hardware.
- Run for every supported translation mode: Sv32 on RV32; Sv39, Sv48 and Sv57 on RV64, as selected by the UDB configuration.

Abit_unset_exec_s

Verify an instruction fetch through a PTE with A=0 raises an instruction page fault from S-mode (Svade)

S-mode: menvcfg.ADUE=0 (cleared through T-SBI). Leaf PTE with A=0 (with D=0 and D=1) and PTE.U=0, at every page-table level (4 KiB page and each superpage size of the Sv mode). Jump (jalr) into the page through va_data.

Instruction page fault (scause = 12); stval = faulting virtual address.

PTE_Abit_unset_s_i x PageType_i x Svade_enabled x ins_page_fault x exec_acc x mode {S-mode}
= 7 bins on RV64, 2 on RV32

Svade_access_ad_bit_clear Svadu_disabled_hw_update_falls_back_to_Svade menvcfg_adue_op

Svade_access_ad_bit_clear
Svadu_disabled_hw_update_falls_back_to_Svade
menvcfg_adue_op

Abit_unset_exec_u

Verify an instruction fetch through a PTE with A=0 raises an instruction page fault from U-mode (Svade)

U-mode: menvcfg.ADUE=0 (cleared through T-SBI). Leaf PTE with A=0 (with D=0 and D=1) and PTE.U=1, at every page-table level (4 KiB page and each superpage size of the Sv mode). Jump (jalr) into the page through va_data.

Instruction page fault (scause = 12); stval = faulting virtual address.

PTE_Abit_unset_u_i x PageType_i x Svade_enabled x ins_page_fault x exec_acc x mode {U-mode}
= 7 bins on RV64, 2 on RV32

Svade_access_ad_bit_clear Svadu_disabled_hw_update_falls_back_to_Svade menvcfg_adue_op

Svade_access_ad_bit_clear
Svadu_disabled_hw_update_falls_back_to_Svade
menvcfg_adue_op

Abit_unset_read_s

Verify a load through a PTE with A=0 raises a load page fault from S-mode (Svade)

S-mode: menvcfg.ADUE=0 (cleared through T-SBI). Leaf PTE with A=0 (with D=0 and D=1) and PTE.U=0, at every page-table level (4 KiB page and each superpage size of the Sv mode). Load (lw) from the page through va_data.

Load page fault (scause = 13); stval = faulting virtual address.

PTE_Abit_unset_s_d x PageType_d x Svade_enabled x load_page_fault x read_acc x mode {S-mode}
= 7 bins on RV64, 2 on RV32

Svade_access_ad_bit_clear Svadu_disabled_hw_update_falls_back_to_Svade menvcfg_adue_op

Svade_access_ad_bit_clear
Svadu_disabled_hw_update_falls_back_to_Svade
menvcfg_adue_op

Abit_unset_read_u

Verify a load through a PTE with A=0 raises a load page fault from U-mode (Svade)

U-mode: menvcfg.ADUE=0 (cleared through T-SBI). Leaf PTE with A=0 (with D=0 and D=1) and PTE.U=1, at every page-table level (4 KiB page and each superpage size of the Sv mode). Load (lw) from the page through va_data.

Load page fault (scause = 13); stval = faulting virtual address.

PTE_Abit_unset_u_d x PageType_d x Svade_enabled x load_page_fault x read_acc x mode {U-mode}
= 7 bins on RV64, 2 on RV32

Svade_access_ad_bit_clear Svadu_disabled_hw_update_falls_back_to_Svade menvcfg_adue_op

pte_a_def
Svade_access_ad_bit_clear
Svadu_disabled_hw_update_falls_back_to_Svade
menvcfg_adue_op

Abit_unset_write_s

Verify a store through a PTE with A=0 raises a store/AMO page fault from S-mode (Svade)

S-mode: menvcfg.ADUE=0 (cleared through T-SBI). Leaf PTE with A=0 (with D=0 and D=1) and PTE.U=0, at every page-table level (4 KiB page and each superpage size of the Sv mode). Store (sw) to the page through va_data.

Store/AMO page fault (scause = 15); stval = faulting virtual address.

PTE_Abit_unset_s_d x PageType_d x Svade_enabled x store_page_fault x write_acc x mode {S-mode}
= 7 bins on RV64, 2 on RV32

Svade_access_ad_bit_clear Svadu_disabled_hw_update_falls_back_to_Svade menvcfg_adue_op

pte_a_def
Svade_access_ad_bit_clear
Svadu_disabled_hw_update_falls_back_to_Svade
menvcfg_adue_op

Abit_unset_write_u

Verify a store through a PTE with A=0 raises a store/AMO page fault from U-mode (Svade)

U-mode: menvcfg.ADUE=0 (cleared through T-SBI). Leaf PTE with A=0 (with D=0 and D=1) and PTE.U=1, at every page-table level (4 KiB page and each superpage size of the Sv mode). Store (sw) to the page through va_data.

Store/AMO page fault (scause = 15); stval = faulting virtual address.

PTE_Abit_unset_u_d x PageType_d x Svade_enabled x store_page_fault x write_acc x mode {U-mode}
= 7 bins on RV64, 2 on RV32

Svade_access_ad_bit_clear Svadu_disabled_hw_update_falls_back_to_Svade menvcfg_adue_op

Svade_access_ad_bit_clear
Svadu_disabled_hw_update_falls_back_to_Svade
menvcfg_adue_op

Dbit_unset_write_s

Verify a store through a PTE with D=0 raises a store/AMO page fault from S-mode (Svade)

S-mode: menvcfg.ADUE=0. Leaf PTE with A=1, D=0 and PTE.U=0, at every page-table level (4 KiB page and each superpage size of the Sv mode). Store (sw) to the page; loads and fetches of the same page are also done.

Store/AMO page fault (scause = 15); the load and fetch succeed.

PTE_Dbit_unset_s_d x PageType_d x Svade_enabled x store_page_fault x write_acc x mode {S-mode}
= 7 bins on RV64, 2 on RV32

Svade_access_ad_bit_clear Svadu_disabled_hw_update_falls_back_to_Svade menvcfg_adue_op

pte_d_def
Svade_access_ad_bit_clear
Svadu_disabled_hw_update_falls_back_to_Svade
menvcfg_adue_op

Dbit_unset_write_u

Verify a store through a PTE with D=0 raises a store/AMO page fault from U-mode (Svade)

U-mode: menvcfg.ADUE=0. Leaf PTE with A=1, D=0 and PTE.U=1, at every page-table level (4 KiB page and each superpage size of the Sv mode). Store (sw) to the page; loads and fetches of the same page are also done.

Store/AMO page fault (scause = 15); the load and fetch succeed.

PTE_Dbit_unset_u_d x PageType_d x Svade_enabled x store_page_fault x write_acc x mode {U-mode}
= 7 bins on RV64, 2 on RV32

Svade_access_ad_bit_clear Svadu_disabled_hw_update_falls_back_to_Svade menvcfg_adue_op

pte_d_def
Svade_access_ad_bit_clear
Svadu_disabled_hw_update_falls_back_to_Svade
menvcfg_adue_op

Table 269. Svade Normative Rules
Normative Rule Rule Text Coverpoints

Svade_access_ad_bit_clear

The Svade extension: when a virtual page is accessed and the A bit is clear, or is written and the D bit is clear, a page-fault exception is raised.

Svade_cg/{Abit_unset_exec_s, Abit_unset_read_s, Abit_unset_write_s, Dbit_unset_write_s}

Svadu_disabled_hw_update_falls_back_to_Svade

When hardware updating of A/D bits is disabled, the Svade extension, which mandates exceptions when A/D bits need be set, instead takes effect.

Svade_cg/{Abit_unset_read_s, Dbit_unset_write_s}

menvcfg_adue_op

If the Svadu extension is implemented, the ADUE bit controls whether hardware updating of PTE A/D bits is enabled for S-mode and G-stage address translations. When ADUE=1, hardware updating of PTE A/D bits is enabled during S-mode address translation, and the implementation behaves as though the Svade extension were not implemented for S-mode address translation. When the hypervisor extension is implemented, if ADUE=1, hardware updating of PTE A/D bits is enabled during G-stage address translation, and the implementation behaves as though the Svade extension were not implemented for G-stage address translation. When ADUE=0, the implementation behaves as though Svade were implemented for S-mode and G-stage address translation.

Svade_cg/{Abit_unset_read_s, Dbit_unset_write_s}

UDB Parameters: None.

B.8.11. Svadu A/D Bit Hardware Update

Table 270. Svadu Coverpoints
Coverpoint Goal Feature Description Expectation Bins ID Normative Rule

General Test Environment (Svadu):
- T-SBI suite: boots to S-mode (BOOT_TO_SMODE) and drives the test from the boot identity map. The page under test is mapped at va_data. S-mode accesses run from the identity map. U-mode accesses use RVTEST_TSBI_GOTO_UMODE / RVTEST_TSBI_GOTO_SMODE; the handler moves execution to the U-accessible code alias va_rvtest_code_begin (registered with SAVE_AREA_SETUP) and back. menvcfg is written through T-SBI CSR calls. Page faults are delegated to S-mode, so causes are sampled from scause/stval.
- menvcfg.ADUE (menvcfgh.ADUE on RV32) is set through T-SBI.
- Run for every supported translation mode: Sv32 on RV32; Sv39, Sv48 and Sv57 on RV64, as selected by the UDB configuration.
Normative rules without a coverpoint in this suite:
- Svadu_hypervisor_adue_writable: TODO: test in hypervisor tests
- menvcfg_adue_rdonly0: Not tested: needs an implementation without Svadu
- menvcfg_adue_henvcfg_adue_rdonly0: TODO: test in hypervisor tests

Abit_unset_exec_s

Verify hardware sets PTE.A on an instruction fetch from S-mode (Svadu)

S-mode: menvcfg.ADUE=1 (set through T-SBI). Leaf PTE with A=0 and PTE.U=0, at every page-table level (4 KiB page and each superpage size of the Sv mode) (separate PTEs for store, load and fetch). Jump (jalr) into the page, then read the PTE back.

No fault; the PTE reads back with A=1 (and D=1 after a store).

PTE_Abit_unset_s_i x PageType_i x Svadu_enabled x exec_acc x mode {S-mode}
= 7 bins on RV64, 2 on RV32

Svadu_hw_update_a_d_bits menvcfg_adue_op menvcfg_adue_fence

pte_a_def
[norm:Svadu_hw_update_a_d_bits] [norm:menvcfg_adue_op] [norm:menvcfg_adue_fence]

Abit_unset_exec_u

Verify hardware sets PTE.A on an instruction fetch from U-mode (Svadu)

U-mode: menvcfg.ADUE=1 (set through T-SBI). Leaf PTE with A=0 and PTE.U=1, at every page-table level (4 KiB page and each superpage size of the Sv mode) (separate PTEs for store, load and fetch). Jump (jalr) into the page, then read the PTE back.

No fault; the PTE reads back with A=1 (and D=1 after a store).

PTE_Abit_unset_u_i x PageType_i x Svadu_enabled x exec_acc x mode {U-mode}
= 7 bins on RV64, 2 on RV32

Svadu_hw_update_a_d_bits menvcfg_adue_op menvcfg_adue_fence

[norm:Svadu_hw_update_a_d_bits] [norm:menvcfg_adue_op] [norm:menvcfg_adue_fence]

Abit_unset_read_s

Verify hardware sets PTE.A on a load from S-mode (Svadu)

S-mode: menvcfg.ADUE=1 (set through T-SBI). Leaf PTE with A=0 and PTE.U=0, at every page-table level (4 KiB page and each superpage size of the Sv mode) (separate PTEs for store, load and fetch). Load (lw) from the page, then read the PTE back.

No fault; the PTE reads back with A=1 (and D=1 after a store).

PTE_Abit_unset_s_d x PageType_d x Svadu_enabled x read_acc x mode {S-mode}
= 7 bins on RV64, 2 on RV32

Svadu_hw_update_a_d_bits menvcfg_adue_op menvcfg_adue_fence

Svadu_hw_update_a_d_bits
menvcfg_adue_op
[norm:Svadu_hw_update_a_d_bits] [norm:menvcfg_adue_op] [norm:menvcfg_adue_fence]

Abit_unset_read_u

Verify hardware sets PTE.A on a load from U-mode (Svadu)

U-mode: menvcfg.ADUE=1 (set through T-SBI). Leaf PTE with A=0 and PTE.U=1, at every page-table level (4 KiB page and each superpage size of the Sv mode) (separate PTEs for store, load and fetch). Load (lw) from the page, then read the PTE back.

No fault; the PTE reads back with A=1 (and D=1 after a store).

PTE_Abit_unset_u_d x PageType_d x Svadu_enabled x read_acc x mode {U-mode}
= 7 bins on RV64, 2 on RV32

Svadu_hw_update_a_d_bits menvcfg_adue_op menvcfg_adue_fence

pte_a_def
[norm:Svadu_hw_update_a_d_bits] [norm:menvcfg_adue_op] [norm:menvcfg_adue_fence]

Abit_unset_write_s

Verify hardware sets PTE.A on a store from S-mode (Svadu)

S-mode: menvcfg.ADUE=1 (set through T-SBI). Leaf PTE with A=0 and PTE.U=0, at every page-table level (4 KiB page and each superpage size of the Sv mode) (separate PTEs for store, load and fetch). Store (sw) to the page, then read the PTE back.

No fault; the PTE reads back with A=1 (and D=1 after a store).

PTE_Abit_unset_s_d x PageType_d x Svadu_enabled x write_acc x mode {S-mode}
= 7 bins on RV64, 2 on RV32

Svadu_hw_update_a_d_bits menvcfg_adue_op menvcfg_adue_fence

[norm:Svadu_hw_update_a_d_bits] [norm:menvcfg_adue_op] [norm:menvcfg_adue_fence]

Abit_unset_write_u

Verify hardware sets PTE.A on a store from U-mode (Svadu)

U-mode: menvcfg.ADUE=1 (set through T-SBI). Leaf PTE with A=0 and PTE.U=1, at every page-table level (4 KiB page and each superpage size of the Sv mode) (separate PTEs for store, load and fetch). Store (sw) to the page, then read the PTE back.

No fault; the PTE reads back with A=1 (and D=1 after a store).

PTE_Abit_unset_u_d x PageType_d x Svadu_enabled x write_acc x mode {U-mode}
= 7 bins on RV64, 2 on RV32

Svadu_hw_update_a_d_bits menvcfg_adue_op menvcfg_adue_fence

[norm:Svadu_hw_update_a_d_bits] [norm:menvcfg_adue_op] [norm:menvcfg_adue_fence]

Dbit_unset_write_s

Verify hardware sets PTE.D on a store from S-mode (Svadu)

S-mode: menvcfg.ADUE=1. Leaf PTE with A=1, D=0 and PTE.U=0, at every page-table level (4 KiB page and each superpage size of the Sv mode). Store (sw) to the page, then read the PTE back.

No fault; the PTE reads back with D=1.

PTE_Dbit_unset_s_d x PageType_d x Svadu_enabled x write_acc x mode {S-mode}
= 7 bins on RV64, 2 on RV32

Svadu_hw_update_a_d_bits menvcfg_adue_op menvcfg_adue_fence

pte_d_def
Svadu_hw_update_a_d_bits
menvcfg_adue_op
[norm:Svadu_hw_update_a_d_bits] [norm:menvcfg_adue_op] [norm:menvcfg_adue_fence]

Dbit_unset_write_u

Verify hardware sets PTE.D on a store from U-mode (Svadu)

U-mode: menvcfg.ADUE=1. Leaf PTE with A=1, D=0 and PTE.U=1, at every page-table level (4 KiB page and each superpage size of the Sv mode). Store (sw) to the page, then read the PTE back.

No fault; the PTE reads back with D=1.

PTE_Dbit_unset_u_d x PageType_d x Svadu_enabled x write_acc x mode {U-mode}
= 7 bins on RV64, 2 on RV32

Svadu_hw_update_a_d_bits menvcfg_adue_op menvcfg_adue_fence

pte_d_def
[norm:Svadu_hw_update_a_d_bits] [norm:menvcfg_adue_op] [norm:menvcfg_adue_fence]

fault_no_update_exec_s
fault_no_update_read_s
fault_no_update_write_s

No A/D update on a faulting access

With menvcfg.ADUE = 1, in supervisor mode, access leaf PTEs with A=0 and D=0 that must page fault, then read the PTE back.
Every page-table walk check for a leaf PTE must pass before the hardware A/D update.
Test Cases (store, load, and execute each, with sfence.vma before each access):
Misaligned superpage at each superpage level.
PTE.U=1 with sstatus.SUM=0.
Reserved encoding W=1, R=0.
RV64: reserved bit 54 set; PBMT=3; N=1 with ppn[3:0]=0000; N=1 with ppn[3:0]=1000 at each superpage level.

Load/store/instruction page fault; the PTE still has A=0 and D=0.

PTE_fault_reason x Svadu_enabled x access x page fault x mode {S-mode}
= 18 bins on RV64, 9 on RV32

Table 271. Svadu Normative Rules
Normative Rule Rule Text Coverpoints

Svadu_hw_update_a_d_bits

If the Svadu extension is implemented, the menvcfg.ADUE field is writable.

Sm_mcsr_cg/cp_mcsrwalk_masked/menvcfg, Svadu_cg/{Abit_unset_read_s, Dbit_unset_write_s}

Svadu_hypervisor_adue_writable

If the hypervisor extension is additionally implemented, the henvcfg.ADUE field is also writable.

TODO: test in hypervisor tests

Svadu_disabled_hw_update_falls_back_to_Svade

When hardware updating of A/D bits is disabled, the Svade extension, which mandates exceptions when A/D bits need be set, instead takes effect.

Svade_cg/{Abit_unset_read_s, Dbit_unset_write_s}

menvcfg_adue_op

If the Svadu extension is implemented, the ADUE bit controls whether hardware updating of PTE A/D bits is enabled for S-mode and G-stage address translations. When ADUE=1, hardware updating of PTE A/D bits is enabled during S-mode address translation, and the implementation behaves as though the Svade extension were not implemented for S-mode address translation. When the hypervisor extension is implemented, if ADUE=1, hardware updating of PTE A/D bits is enabled during G-stage address translation, and the implementation behaves as though the Svade extension were not implemented for G-stage address translation. When ADUE=0, the implementation behaves as though Svade were implemented for S-mode and G-stage address translation.

Svadu_cg/{Abit_unset_read_s, Dbit_unset_write_s}

menvcfg_adue_fence

After changing menvcfg.ADUE, executing an SFENCE.VMA instruction with rs1=x0 and rs2=x0 suffices to synchronize address-translation caches with respect to the altered interpretation of page-table entries' A/D bits.

Svadu_cg/Svadu_enabled

menvcfg_adue_rdonly0

If Svadu is not implemented, ADUE is read-only zero.

Sm_mcsr_cg/cp_mcsrwalk_masked/menvcfg

menvcfg_adue_henvcfg_adue_rdonly0

for implementations with the hypervisor extension, henvcfg.ADUE is read-only zero if menvcfg.ADUE is zero.

TODO: test in hypervisor tests

UDB Parameters: None.

B.8.12. Svadu A/D Bit Hardware Update + PMP

Table 272. SvaduPMP Coverpoints
Coverpoint Goal Feature Description Expectation Bins ID Normative Rule

General Test Environment (SvaduPMP):
- Boots to M-mode (PMP programming). Unchanged by the T-SBI conversion. Run for every supported translation mode: Sv32 on RV32; Sv39, Sv48 and Sv57 on RV64, as selected by the UDB configuration.

Abit_unset_pmpW_unset_exec_s

Verify PMP applies to the hardware PTE.A update of an instruction fetch from S-mode

S-mode: menvcfg.ADUE=1; page tables in a PMP region with W=0; leaf PTE with A=0 and PTE.U=0; satp points at each top-level table in turn. Jump (jalr) into the page through va_data.

Instruction access fault (mcause = 1) from the implicit PTE write.

PTE_Abit_unset_s_i x PageType_i x Svadu_enabled x PMP_pagetable x jalr x ins_acc_fault x mode {S-mode}
= 7 bins on RV64, 2 on RV32

Svadu_hw_update_a_d_bits pmp_check_pagetable_access

Svadu_hw_update_a_d_bits
pmp_check_pagetable_access

Abit_unset_pmpW_unset_exec_u

Verify PMP applies to the hardware PTE.A update of an instruction fetch from U-mode

U-mode: menvcfg.ADUE=1; page tables in a PMP region with W=0; leaf PTE with A=0 and PTE.U=1; satp points at each top-level table in turn. Jump (jalr) into the page through va_data.

Instruction access fault (mcause = 1) from the implicit PTE write.

PTE_Abit_unset_u_i x PageType_i x Svadu_enabled x PMP_pagetable x jalr x ins_acc_fault x mode {U-mode}
= 7 bins on RV64, 2 on RV32

Svadu_hw_update_a_d_bits pmp_check_pagetable_access

Svadu_hw_update_a_d_bits
pmp_check_pagetable_access

Abit_unset_pmpW_unset_read_s

Verify PMP applies to the hardware PTE.A update of a load from S-mode

S-mode: menvcfg.ADUE=1; page tables in a PMP region with W=0; leaf PTE with A=0 and PTE.U=0; satp points at each top-level table in turn. Load (lw) from the page through va_data.

Load access fault (mcause = 5) from the implicit PTE write.

PTE_Abit_unset_s_d x PageType_d x Svadu_enabled x PMP_pagetable x lw x load_acc_fault x mode {S-mode}
= 7 bins on RV64, 2 on RV32

Svadu_hw_update_a_d_bits pmp_check_pagetable_access

Svadu_hw_update_a_d_bits
pmp_check_pagetable_access

Abit_unset_pmpW_unset_read_u

Verify PMP applies to the hardware PTE.A update of a load from U-mode

U-mode: menvcfg.ADUE=1; page tables in a PMP region with W=0; leaf PTE with A=0 and PTE.U=1; satp points at each top-level table in turn. Load (lw) from the page through va_data.

Load access fault (mcause = 5) from the implicit PTE write.

PTE_Abit_unset_u_d x PageType_d x Svadu_enabled x PMP_pagetable x lw x load_acc_fault x mode {U-mode}
= 7 bins on RV64, 2 on RV32

Svadu_hw_update_a_d_bits pmp_check_pagetable_access

Svadu_hw_update_a_d_bits
pmp_check_pagetable_access

Abit_unset_pmpW_unset_write_s

Verify PMP applies to the hardware PTE.A update of a store from S-mode

S-mode: menvcfg.ADUE=1; page tables in a PMP region with W=0; leaf PTE with A=0 and PTE.U=0; satp points at each top-level table in turn. Store (sw) to the page through va_data.

Store/AMO access fault (mcause = 7) from the implicit PTE write.

PTE_Abit_unset_s_d x PageType_d x Svadu_enabled x PMP_pagetable x sw x store_acc_fault x mode {S-mode}
= 7 bins on RV64, 2 on RV32

Svadu_hw_update_a_d_bits pmp_check_pagetable_access

Svadu_hw_update_a_d_bits
pmp_check_pagetable_access

Abit_unset_pmpW_unset_write_u

Verify PMP applies to the hardware PTE.A update of a store from U-mode

U-mode: menvcfg.ADUE=1; page tables in a PMP region with W=0; leaf PTE with A=0 and PTE.U=1; satp points at each top-level table in turn. Store (sw) to the page through va_data.

Store/AMO access fault (mcause = 7) from the implicit PTE write.

PTE_Abit_unset_u_d x PageType_d x Svadu_enabled x PMP_pagetable x sw x store_acc_fault x mode {U-mode}
= 7 bins on RV64, 2 on RV32

Svadu_hw_update_a_d_bits pmp_check_pagetable_access

Svadu_hw_update_a_d_bits
pmp_check_pagetable_access

Dbit_unset_pmpW_unset_write_s

Verify PMP applies to the hardware PTE.D update of a store from S-mode

S-mode: menvcfg.ADUE=1; page tables in a PMP region with W=0; leaf PTE with A=1, D=0 and PTE.U=0. Store (sw) through va_data.

Store/AMO access fault (mcause = 7) from the implicit PTE write.

PTE_Dbit_unset_s_d x PageType_d x Svadu_enabled x PMP_pagetable x sw x store_acc_fault x mode {S-mode}
= 7 bins on RV64, 2 on RV32

Svadu_hw_update_a_d_bits pmp_check_pagetable_access

Svadu_hw_update_a_d_bits
pmp_check_pagetable_access

Dbit_unset_pmpW_unset_write_u

Verify PMP applies to the hardware PTE.D update of a store from U-mode

U-mode: menvcfg.ADUE=1; page tables in a PMP region with W=0; leaf PTE with A=1, D=0 and PTE.U=1. Store (sw) through va_data.

Store/AMO access fault (mcause = 7) from the implicit PTE write.

PTE_Dbit_unset_u_d x PageType_d x Svadu_enabled x PMP_pagetable x sw x store_acc_fault x mode {U-mode}
= 7 bins on RV64, 2 on RV32

Svadu_hw_update_a_d_bits pmp_check_pagetable_access

Svadu_hw_update_a_d_bits
pmp_check_pagetable_access

Table 273. SvaduPMP Normative Rules
Normative Rule Rule Text Coverpoints

Svadu_hw_update_a_d_bits, pmp_check_pagetable_access

Svadu_hw_update_a_d_bits: If the Svadu extension is implemented, the menvcfg.ADUE field is writable. pmp_check_pagetable_access: PMP checks are also applied to page-table accesses for virtual-address translation, for which the effective privilege mode is S.

SvaduPMP_cg/{Abit_unset_pmpW_unset_exec_s, Abit_unset_pmpW_unset_read_s, Abit_unset_pmpW_unset_write_u, Dbit_unset_pmpW_unset_write_s}

UDB Parameters: None.

B.8.13. Svpbmt Page-Based Memory Types

Table 274. Svpbmt Coverpoints
Coverpoint Goal Feature Description Expectation Bins ID Normative Rule

General Test Environment (Svpbmt):
- T-SBI suite: boots to S-mode (BOOT_TO_SMODE) and drives the test from the boot identity map. The page under test is mapped at va_data. S-mode accesses run from the identity map. U-mode accesses use RVTEST_TSBI_GOTO_UMODE / RVTEST_TSBI_GOTO_SMODE; the handler moves execution to the U-accessible code alias va_rvtest_code_begin (registered with SAVE_AREA_SETUP) and back. menvcfg is written through T-SBI CSR calls. Page faults are delegated to S-mode, so causes are sampled from scause/stval.
- menvcfg.PBMTE is set through T-SBI. RV64 only (Sv39, Sv48, Sv57).

nonleaf_PTE_pbmt_exec_s

Verify PBMT set in a non-leaf PTE raises an instruction page fault on an instruction fetch from S-mode

S-mode: menvcfg.PBMTE=1 (set through T-SBI). Non-leaf PTE with PBMT = 1, 2 and 3 above a valid leaf with PTE.U=0. Jump (jalr) into the page through va_data.

Instruction page fault (scause = 12); stval = faulting virtual address.

nonleaf_PTE_pbmt_i x PBMTE_set x PageType_i x jalr x ins_page_fault x mode {S-mode}
= 15 bins on RV64 (RV64 only)

Svpbmt_nonleaf_pte_pbmt_must_be_zero menvcfg_pbmte_op menvcfg_pbmte_fence

Svpbmt_nonleaf_pte_pbmt_must_be_zero
menvcfg_pbmte_op
menvcfg_pbmte_fence

nonleaf_PTE_pbmt_exec_u

Verify PBMT set in a non-leaf PTE raises an instruction page fault on an instruction fetch from U-mode

U-mode: menvcfg.PBMTE=1 (set through T-SBI). Non-leaf PTE with PBMT = 1, 2 and 3 above a valid leaf with PTE.U=1. Jump (jalr) into the page through va_data.

Instruction page fault (scause = 12); stval = faulting virtual address.

nonleaf_PTE_pbmt_i x PBMTE_set x PageType_i x jalr x ins_page_fault x mode {U-mode}
= 15 bins on RV64 (RV64 only)

Svpbmt_nonleaf_pte_pbmt_must_be_zero menvcfg_pbmte_op menvcfg_pbmte_fence

Svpbmt_nonleaf_pte_pbmt_must_be_zero
menvcfg_pbmte_op
menvcfg_pbmte_fence

nonleaf_PTE_pbmt_read_s

Verify PBMT set in a non-leaf PTE raises a load page fault on a load from S-mode

S-mode: menvcfg.PBMTE=1 (set through T-SBI). Non-leaf PTE with PBMT = 1, 2 and 3 above a valid leaf with PTE.U=0. Load (lw) from the page through va_data.

Load page fault (scause = 13); stval = faulting virtual address.

nonleaf_PTE_pbmt_d x PBMTE_set x PageType_d x lw x load_page_fault x mode {S-mode}
= 15 bins on RV64 (RV64 only)

Svpbmt_nonleaf_pte_pbmt_must_be_zero menvcfg_pbmte_op menvcfg_pbmte_fence

Svpbmt_nonleaf_pte_pbmt_must_be_zero
menvcfg_pbmte_op
menvcfg_pbmte_fence

nonleaf_PTE_pbmt_read_u

Verify PBMT set in a non-leaf PTE raises a load page fault on a load from U-mode

U-mode: menvcfg.PBMTE=1 (set through T-SBI). Non-leaf PTE with PBMT = 1, 2 and 3 above a valid leaf with PTE.U=1. Load (lw) from the page through va_data.

Load page fault (scause = 13); stval = faulting virtual address.

nonleaf_PTE_pbmt_d x PBMTE_set x PageType_d x lw x load_page_fault x mode {U-mode}
= 15 bins on RV64 (RV64 only)

Svpbmt_nonleaf_pte_pbmt_must_be_zero menvcfg_pbmte_op menvcfg_pbmte_fence

Svpbmt_nonleaf_pte_pbmt_must_be_zero
menvcfg_pbmte_op
menvcfg_pbmte_fence

nonleaf_PTE_pbmt_write_s

Verify PBMT set in a non-leaf PTE raises a store/AMO page fault on a store from S-mode

S-mode: menvcfg.PBMTE=1 (set through T-SBI). Non-leaf PTE with PBMT = 1, 2 and 3 above a valid leaf with PTE.U=0. Store (sw) to the page through va_data.

Store/AMO page fault (scause = 15); stval = faulting virtual address.

nonleaf_PTE_pbmt_d x PBMTE_set x PageType_d x sw x store_page_fault x mode {S-mode}
= 15 bins on RV64 (RV64 only)

Svpbmt_nonleaf_pte_pbmt_must_be_zero menvcfg_pbmte_op menvcfg_pbmte_fence

Svpbmt_nonleaf_pte_pbmt_must_be_zero
menvcfg_pbmte_op
menvcfg_pbmte_fence

nonleaf_PTE_pbmt_write_u

Verify PBMT set in a non-leaf PTE raises a store/AMO page fault on a store from U-mode

U-mode: menvcfg.PBMTE=1 (set through T-SBI). Non-leaf PTE with PBMT = 1, 2 and 3 above a valid leaf with PTE.U=1. Store (sw) to the page through va_data.

Store/AMO page fault (scause = 15); stval = faulting virtual address.

nonleaf_PTE_pbmt_d x PBMTE_set x PageType_d x sw x store_page_fault x mode {U-mode}
= 15 bins on RV64 (RV64 only)

Svpbmt_nonleaf_pte_pbmt_must_be_zero menvcfg_pbmte_op menvcfg_pbmte_fence

Svpbmt_nonleaf_pte_pbmt_must_be_zero
menvcfg_pbmte_op
menvcfg_pbmte_fence

leaf_PTE_pbmt_exec_s

Verify an instruction fetch through a leaf PTE with PBMT = NC or IO succeeds from S-mode

S-mode: menvcfg.PBMTE=1. Leaf PTE with PBMT = 1 (NC) and 2 (IO) and PTE.U=0, at every page-table level (4 KiB page and each superpage size of the Sv mode). Jump (jalr) into the page through va_data.

No fault.

leaf_PTE_pbmt_s_i x PBMTE_set x PageType_i x jalr x mode {S-mode}
= 14 bins on RV64 (RV64 only)

Svpbmt_depends_Sv39 menvcfg_pbmte_op menvcfg_pbmte_fence

Svpbmt_pte_bits
Svpbmt_depends_Sv39
menvcfg_pbmte_op
menvcfg_pbmte_fence

leaf_PTE_pbmt_exec_u

Verify an instruction fetch through a leaf PTE with PBMT = NC or IO succeeds from U-mode

U-mode: menvcfg.PBMTE=1. Leaf PTE with PBMT = 1 (NC) and 2 (IO) and PTE.U=1, at every page-table level (4 KiB page and each superpage size of the Sv mode). Jump (jalr) into the page through va_data.

No fault.

leaf_PTE_pbmt_u_i x PBMTE_set x PageType_i x jalr x mode {U-mode}
= 14 bins on RV64 (RV64 only)

Svpbmt_depends_Sv39 menvcfg_pbmte_op menvcfg_pbmte_fence

Svpbmt_depends_Sv39
menvcfg_pbmte_op
menvcfg_pbmte_fence

leaf_PTE_pbmt_read_s

Verify a load through a leaf PTE with PBMT = NC or IO succeeds from S-mode

S-mode: menvcfg.PBMTE=1. Leaf PTE with PBMT = 1 (NC) and 2 (IO) and PTE.U=0, at every page-table level (4 KiB page and each superpage size of the Sv mode). Load (lw) from the page through va_data.

No fault.

leaf_PTE_pbmt_s_d x PBMTE_set x PageType_d x lw x mode {S-mode}
= 14 bins on RV64 (RV64 only)

Svpbmt_depends_Sv39 menvcfg_pbmte_op menvcfg_pbmte_fence

Svpbmt_pte_bits
Svpbmt_enc_tbl
Svpbmt_depends_Sv39
menvcfg_pbmte_op
menvcfg_pbmte_fence

leaf_PTE_pbmt_read_u

Verify a load through a leaf PTE with PBMT = NC or IO succeeds from U-mode

U-mode: menvcfg.PBMTE=1. Leaf PTE with PBMT = 1 (NC) and 2 (IO) and PTE.U=1, at every page-table level (4 KiB page and each superpage size of the Sv mode). Load (lw) from the page through va_data.

No fault.

leaf_PTE_pbmt_u_d x PBMTE_set x PageType_d x lw x mode {U-mode}
= 14 bins on RV64 (RV64 only)

Svpbmt_depends_Sv39 menvcfg_pbmte_op menvcfg_pbmte_fence

Svpbmt_pte_bits
Svpbmt_depends_Sv39
menvcfg_pbmte_op
menvcfg_pbmte_fence

leaf_PTE_pbmt_write_s

Verify a store through a leaf PTE with PBMT = NC or IO succeeds from S-mode

S-mode: menvcfg.PBMTE=1. Leaf PTE with PBMT = 1 (NC) and 2 (IO) and PTE.U=0, at every page-table level (4 KiB page and each superpage size of the Sv mode). Store (sw) to the page through va_data.

No fault.

leaf_PTE_pbmt_s_d x PBMTE_set x PageType_d x sw x mode {S-mode}
= 14 bins on RV64 (RV64 only)

Svpbmt_depends_Sv39 menvcfg_pbmte_op menvcfg_pbmte_fence

Svpbmt_pte_bits
Svpbmt_depends_Sv39
menvcfg_pbmte_op
menvcfg_pbmte_fence

leaf_PTE_pbmt_write_u

Verify a store through a leaf PTE with PBMT = NC or IO succeeds from U-mode

U-mode: menvcfg.PBMTE=1. Leaf PTE with PBMT = 1 (NC) and 2 (IO) and PTE.U=1, at every page-table level (4 KiB page and each superpage size of the Sv mode). Store (sw) to the page through va_data.

No fault.

leaf_PTE_pbmt_u_d x PBMTE_set x PageType_d x sw x mode {U-mode}
= 14 bins on RV64 (RV64 only)

Svpbmt_depends_Sv39 menvcfg_pbmte_op menvcfg_pbmte_fence

Svpbmt_enc_tbl
Svpbmt_depends_Sv39
menvcfg_pbmte_op
menvcfg_pbmte_fence

leaf_PTE_pbmt_reserved_enc_exec_s

Verify PBMT = 3 in a leaf PTE raises an instruction page fault on an instruction fetch from S-mode

S-mode: menvcfg.PBMTE=1. Leaf PTE with PBMT = 3 and PTE.U=0, at every page-table level (4 KiB page and each superpage size of the Sv mode). Jump (jalr) into the page through va_data.

Instruction page fault (scause = 12); stval = faulting virtual address.

leaf_PTE_pbmt_res_s_i x PBMTE_set x PageType_i x jalr x ins_page_fault x mode {S-mode}
= 7 bins on RV64 (RV64 only)

Svpbmt_leaf_pte_pbmt_reserved_3_fault menvcfg_pbmte_op menvcfg_pbmte_fence

Svpbmt_leaf_pte_pbmt_reserved_3_fault
menvcfg_pbmte_op
menvcfg_pbmte_fence

leaf_PTE_pbmt_reserved_enc_exec_u

Verify PBMT = 3 in a leaf PTE raises an instruction page fault on an instruction fetch from U-mode

U-mode: menvcfg.PBMTE=1. Leaf PTE with PBMT = 3 and PTE.U=1, at every page-table level (4 KiB page and each superpage size of the Sv mode). Jump (jalr) into the page through va_data.

Instruction page fault (scause = 12); stval = faulting virtual address.

leaf_PTE_pbmt_res_u_i x PBMTE_set x PageType_i x jalr x ins_page_fault x mode {U-mode}
= 7 bins on RV64 (RV64 only)

Svpbmt_leaf_pte_pbmt_reserved_3_fault menvcfg_pbmte_op menvcfg_pbmte_fence

Svpbmt_enc_tbl
Svpbmt_leaf_pte_pbmt_reserved_3_fault
menvcfg_pbmte_op
menvcfg_pbmte_fence

leaf_PTE_pbmt_reserved_enc_read_s

Verify PBMT = 3 in a leaf PTE raises a load page fault on a load from S-mode

S-mode: menvcfg.PBMTE=1. Leaf PTE with PBMT = 3 and PTE.U=0, at every page-table level (4 KiB page and each superpage size of the Sv mode). Load (lw) from the page through va_data.

Load page fault (scause = 13); stval = faulting virtual address.

leaf_PTE_pbmt_res_s_d x PBMTE_set x PageType_d x lw x load_page_fault x mode {S-mode}
= 7 bins on RV64 (RV64 only)

Svpbmt_leaf_pte_pbmt_reserved_3_fault menvcfg_pbmte_op menvcfg_pbmte_fence

Svpbmt_enc_tbl
Svpbmt_leaf_pte_pbmt_reserved_3_fault
menvcfg_pbmte_op
menvcfg_pbmte_fence

leaf_PTE_pbmt_reserved_enc_read_u

Verify PBMT = 3 in a leaf PTE raises a load page fault on a load from U-mode

U-mode: menvcfg.PBMTE=1. Leaf PTE with PBMT = 3 and PTE.U=1, at every page-table level (4 KiB page and each superpage size of the Sv mode). Load (lw) from the page through va_data.

Load page fault (scause = 13); stval = faulting virtual address.

leaf_PTE_pbmt_res_u_d x PBMTE_set x PageType_d x lw x load_page_fault x mode {U-mode}
= 7 bins on RV64 (RV64 only)

Svpbmt_leaf_pte_pbmt_reserved_3_fault menvcfg_pbmte_op menvcfg_pbmte_fence

Svpbmt_leaf_pte_pbmt_reserved_3_fault
menvcfg_pbmte_op
menvcfg_pbmte_fence

leaf_PTE_pbmt_reserved_enc_write_s

Verify PBMT = 3 in a leaf PTE raises a store/AMO page fault on a store from S-mode

S-mode: menvcfg.PBMTE=1. Leaf PTE with PBMT = 3 and PTE.U=0, at every page-table level (4 KiB page and each superpage size of the Sv mode). Store (sw) to the page through va_data.

Store/AMO page fault (scause = 15); stval = faulting virtual address.

leaf_PTE_pbmt_res_s_d x PBMTE_set x PageType_d x sw x store_page_fault x mode {S-mode}
= 7 bins on RV64 (RV64 only)

Svpbmt_leaf_pte_pbmt_reserved_3_fault menvcfg_pbmte_op menvcfg_pbmte_fence

Svpbmt_leaf_pte_pbmt_reserved_3_fault
menvcfg_pbmte_op
menvcfg_pbmte_fence

leaf_PTE_pbmt_reserved_enc_write_u

Verify PBMT = 3 in a leaf PTE raises a store/AMO page fault on a store from U-mode

U-mode: menvcfg.PBMTE=1. Leaf PTE with PBMT = 3 and PTE.U=1, at every page-table level (4 KiB page and each superpage size of the Sv mode). Store (sw) to the page through va_data.

Store/AMO page fault (scause = 15); stval = faulting virtual address.

leaf_PTE_pbmt_res_u_d x PBMTE_set x PageType_d x sw x store_page_fault x mode {U-mode}
= 7 bins on RV64 (RV64 only)

Svpbmt_leaf_pte_pbmt_reserved_3_fault menvcfg_pbmte_op menvcfg_pbmte_fence

Svpbmt_leaf_pte_pbmt_reserved_3_fault
menvcfg_pbmte_op
menvcfg_pbmte_fence

Table 275. Svpbmt Normative Rules
Normative Rule Rule Text Coverpoints

Svpbmt_pte_bits

In Sv39, Sv48, and Sv57, bits 62-61 of a leaf page table entry indicate the use of page-based memory types that override the PMA(s) for the associated memory pages.

Svpbmt_cg/{leaf_PTE_pbmt_exec_s, leaf_PTE_pbmt_read_s, leaf_PTE_pbmt_write_s, leaf_PTE_pbmt_read_u}

Svpbmt_depends_Sv39

The Svpbmt extension depends on the Sv39 extension

Not tested: extension dependency checked by the UDB configuration

Svpbmt_enc_tbl

Mode|Value|Requested Memory Attributes === PMA NC IO -|0 1 2 3|None Non-cacheable, idempotent, weakly-ordered (RVWMO), main memory Non-cacheable, non-idempotent, strongly-ordered (I/O ordering), I/O Reserved for future standard use ===

Svpbmt_cg/{leaf_PTE_pbmt_read_s, leaf_PTE_pbmt_write_u, leaf_PTE_pbmt_reserved_enc_read_s, leaf_PTE_pbmt_reserved_enc_exec_u}

Svpbmt_nonleaf_pte_pbmt_must_be_zero

Until their use is defined by a standard extension, they must be cleared by software for forward compatibility, or else a page-fault exception is raised.

Svpbmt_cg/{nonleaf_PTE_pbmt_exec_s, nonleaf_PTE_pbmt_read_s, nonleaf_PTE_pbmt_write_s, nonleaf_PTE_pbmt_read_u}

Svpbmt_leaf_pte_pbmt_reserved_3_fault

Until this value is defined by a standard extension, using this reserved value in a leaf PTE raises a page-fault exception.

Svpbmt_cg/{leaf_PTE_pbmt_reserved_enc_exec_s, leaf_PTE_pbmt_reserved_enc_read_s, leaf_PTE_pbmt_reserved_enc_write_s, leaf_PTE_pbmt_reserved_enc_read_u}

menvcfg_pbmte_op

The PBMTE bit controls whether the Svpbmt extension is available for use in S-mode and G-stage address translation (i.e., for page tables pointed to by satp or hgatp). When PBMTE=1, Svpbmt is available for S-mode and G-stage address translation. When PBMTE=0, the implementation behaves as though Svpbmt were not implemented.

Svpbmt_cg/PBMTE_set, Sv_add_feature_cg/cp_svpbmt_{read,write,exec}_fault

menvcfg_pbmte_fence

After changing menvcfg.PBMTE, executing an SFENCE.VMA instruction with rs1=x0 and rs2=x0 suffices to synchronize address-translation caches with respect to the altered interpretation of page-table entries' PBMT fields.

Svpbmt_cg/PBMTE_set

menvcfg_pbmte_rdonly0

If Svpbmt is not implemented, PBMTE is read-only zero.

Sm_mcsr_cg/cp_mcsrwalk_masked/menvcfg

Svpbmt_impl_may_override_pmas

Implementations may override additional PMAs not explicitly listed in norm:Svpbmt_enc_tbl.

Not tested: implementation-defined PMA overrides

Svpbmt_obeys_mem_ordering, Svpbmt_io_pma_nc_pbmt_obey_rvwmo, Svpbmt_io_pma_nc_pbmt_treated_as_io_and_memory, Svpbmt_memory_pma_io_pbmt_strong_io_ordering, Svpbmt_memory_pma_io_pbmt_treated_as_io_and_memory, Svpbmt_aliasing_attribute, Svpbmt_noncacheable_aliasing_no_coherence_loss, Svpbmt_noncacheable_aliasing_may_weaken_ordering, Svpbmt_noncacheable_aliasing_fence_prevents_ordering_loss, Svpbmt_cacheable_aliasing_may_cause_coherence_loss, Svpbmt_cacheable_aliasing_fence_flush_fence_required

Svpbmt_obeys_mem_ordering: memory accesses to such pages obey the memory ordering rules of the final effective attribute, Svpbmt_io_pma_nc_pbmt_obey_rvwmo: If the underlying physical memory attribute for a page is I/O, and the page has PBMT=NC, then accesses to that page obey RVWMO. Svpbmt_io_pma_nc_pbmt_treated_as_io_and_memory: accesses to such pages are considered to be both I/O and main memory accesses for the purposes of FENCE, .aq, and .rl. Svpbmt_memory_pma_io_pbmt_strong_io_ordering: accesses to that page obey strong channel 0 I/O ordering rules. Svpbmt_memory_pma_io_pbmt_treated_as_io_and_memory: accesses to such pages are considered to be both I/O and main memory accesses for the purposes of FENCE, .aq, and .rl. Svpbmt_aliasing_attribute: When Svpbmt is used with non-zero PBMT encodings, it is possible for multiple virtual aliases of the same physical page to exist simultaneously with different memory attributes. It is also possible for a U-mode or S-mode mapping through a PTE with Svpbmt enabled to observe different memory attributes for a given region of physical memory than a concurrent access to the same page performed by M-mode or when MODE=Bare. In such cases, the behaviors dictated by the attributes (including coherence, which is otherwise unaffected) may be violated. Svpbmt_noncacheable_aliasing_no_coherence_loss: Accessing the same location using different attributes that are both non-cacheable (e.g., NC and IO) does not cause loss of coherence, Svpbmt_noncacheable_aliasing_may_weaken_ordering: might result in weaker memory ordering than the stricter attribute ordinarily guarantees. Svpbmt_noncacheable_aliasing_fence_prevents_ordering_loss: fence iorw, iorw instruction between such accesses suffices to prevent loss of memory ordering. Svpbmt_cacheable_aliasing_may_cause_coherence_loss: may cause loss of coherence. Svpbmt_cacheable_aliasing_fence_flush_fence_required: prevents both loss of coherence and loss of memory ordering:

Not tested: memory ordering, cacheability and coherence are not observable in single-hart signature tests

Svpbmt_hgatp_stage_override_rule, Svpbmt_vsatp_stage_override_rule, menvcfg_pbmte_henvcfg_pbmte_rdonly0

Svpbmt_hgatp_stage_override_rule: if hgatp.MODE is not equal to zero, non-zero G-stage PTE PBMT bits override the attributes in the PMA to produce an intermediate set of attributes. Svpbmt_vsatp_stage_override_rule: if vsatp.MODE is not equal to zero, non-zero VS-stage PTE PBMT bits override the intermediate attributes to produce the final set of attributes used by accesses to the page in question. menvcfg_pbmte_henvcfg_pbmte_rdonly0: for implementations with the hypervisor extension, henvcfg.PBMTE is read-only zero if menvcfg.PBMTE is zero.

TODO: test in hypervisor tests

UDB Parameters: None.

B.8.14. Svnapot Naturally-Aligned Power-of-Two Page Sizes

Table 276. Svnapot Coverpoints
Coverpoint Goal Feature Description Expectation Bins ID Normative Rule Pass/Fail Criteria Notes

General Test Environment (Svnapot):
- T-SBI suite: boots to S-mode (BOOT_TO_SMODE) and drives the test from the boot identity map. The page under test is mapped at va_data. S-mode accesses run from the identity map. U-mode accesses use RVTEST_TSBI_GOTO_UMODE / RVTEST_TSBI_GOTO_SMODE; the handler moves execution to the U-accessible code alias va_rvtest_code_begin (registered with SAVE_AREA_SETUP) and back. menvcfg is written through T-SBI CSR calls. Page faults are delegated to S-mode, so causes are sampled from scause/stval.
- RV64 only (Sv39, Sv48, Sv57).
Normative rules without a coverpoint in this suite:
- Svnapot_cache_entries: Not tested
- Svnapot_hyp_gstage: TODO: test in hypervisor tests

Svnapot_legal_enc_exec_s

Verify an instruction fetch through a 64 KiB NAPOT mapping succeeds from S-mode

S-mode: sixteen level-0 PTEs with N=1, PPN[3:0]=1000 and PTE.U=0 map a naturally aligned 64 KiB region. Jump (jalr) into the page at offsets 0, 0x2000 and 0xF000 of va_data.

No fault; each access reaches the matching 4 KiB page of the 64 KiB region.

PTE_RWX_s_i x PTE_Svnapot_i x PTE_N_i x kilopage_i x mode x exec_acc x mode {S-mode}
= 3 bins on RV64 (RV64 only)

Svnapot_depends_Sv39 Svnapot_pte_n Svnapot_range_napot Svnapot_valid_encoding_ppn_subst

Svnapot_pte_n
Svnapot_range_napot
Svnapot_enc_tbl
Svnapot_valid_encoding_ppn_subst
Svnapot_depends_Sv39

Svnapot_legal_enc_exec_u

Verify an instruction fetch through a 64 KiB NAPOT mapping succeeds from U-mode

U-mode: sixteen level-0 PTEs with N=1, PPN[3:0]=1000 and PTE.U=1 map a naturally aligned 64 KiB region. Jump (jalr) into the page at offsets 0, 0x2000 and 0xF000 of va_data.

No fault; each access reaches the matching 4 KiB page of the 64 KiB region.

PTE_RWX_u_i x PTE_Svnapot_i x PTE_N_i x kilopage_i x mode x exec_acc x mode {U-mode}
= 3 bins on RV64 (RV64 only)

Svnapot_depends_Sv39 Svnapot_pte_n Svnapot_range_napot Svnapot_valid_encoding_ppn_subst

Svnapot_pte_n
Svnapot_range_napot
Svnapot_valid_encoding_ppn_subst
Svnapot_depends_Sv39

Svnapot_legal_enc_read_s

Verify a load through a 64 KiB NAPOT mapping succeeds from S-mode

S-mode: sixteen level-0 PTEs with N=1, PPN[3:0]=1000 and PTE.U=0 map a naturally aligned 64 KiB region. Load (lw) from the page at offsets 0, 0x2000 and 0xF000 of va_data.

No fault; each access reaches the matching 4 KiB page of the 64 KiB region.

PTE_RWX_s_d x PTE_Svnapot_d x PTE_N_d x kilopage_d x mode x read_acc x mode {S-mode}
= 3 bins on RV64 (RV64 only)

Svnapot_legal_enc_read_u

Verify a load through a 64 KiB NAPOT mapping succeeds from U-mode

U-mode: sixteen level-0 PTEs with N=1, PPN[3:0]=1000 and PTE.U=1 map a naturally aligned 64 KiB region. Load (lw) from the page at offsets 0, 0x2000 and 0xF000 of va_data.

No fault; each access reaches the matching 4 KiB page of the 64 KiB region.

PTE_RWX_u_d x PTE_Svnapot_d x PTE_N_d x kilopage_d x mode x read_acc x mode {U-mode}
= 3 bins on RV64 (RV64 only)

Svnapot_enc_tbl

Svnapot_legal_enc_write_s

Verify a store through a 64 KiB NAPOT mapping succeeds from S-mode

S-mode: sixteen level-0 PTEs with N=1, PPN[3:0]=1000 and PTE.U=0 map a naturally aligned 64 KiB region. Store (sw) to the page at offsets 0, 0x2000 and 0xF000 of va_data.

No fault; each access reaches the matching 4 KiB page of the 64 KiB region.

PTE_RWX_s_d x PTE_Svnapot_d x PTE_N_d x kilopage_d x mode x write_acc x mode {S-mode}
= 3 bins on RV64 (RV64 only)

Svnapot_legal_enc_write_u

Verify a store through a 64 KiB NAPOT mapping succeeds from U-mode

U-mode: sixteen level-0 PTEs with N=1, PPN[3:0]=1000 and PTE.U=1 map a naturally aligned 64 KiB region. Store (sw) to the page at offsets 0, 0x2000 and 0xF000 of va_data.

No fault; each access reaches the matching 4 KiB page of the 64 KiB region.

PTE_RWX_u_d x PTE_Svnapot_d x PTE_N_d x kilopage_d x mode x write_acc x mode {U-mode}
= 3 bins on RV64 (RV64 only)

Svnapot_reserved_enc_exec_s

Verify a reserved NAPOT PPN encoding raises an instruction page fault on an instruction fetch from S-mode

S-mode: level-0 PTE with N=1, PTE.U=0 and PPN[3:0] = 0001, 0010, 0100 or 0000. Jump (jalr) into the page through va_data.

Instruction page fault (scause = 12); stval = faulting virtual address.

PTE_RWX_s_i x PTE_Svnapot_reserved_enc_i x PTE_N_i x kilopage_i x mode x exec_acc x ins_page_fault x mode {S-mode}
= 12 bins on RV64 (RV64 only)

Svnapot_reserved_encoding_fault

Svnapot_reserved_encoding_fault

Svnapot_reserved_enc_exec_u

Verify a reserved NAPOT PPN encoding raises an instruction page fault on an instruction fetch from U-mode

U-mode: level-0 PTE with N=1, PTE.U=1 and PPN[3:0] = 0001, 0010, 0100 or 0000. Jump (jalr) into the page through va_data.

Instruction page fault (scause = 12); stval = faulting virtual address.

PTE_RWX_u_i x PTE_Svnapot_reserved_enc_i x PTE_N_i x kilopage_i x mode x exec_acc x ins_page_fault x mode {U-mode}
= 12 bins on RV64 (RV64 only)

Svnapot_reserved_encoding_fault

Svnapot_reserved_encoding_fault

Svnapot_reserved_enc_read_s

Verify a reserved NAPOT PPN encoding raises a load page fault on a load from S-mode

S-mode: level-0 PTE with N=1, PTE.U=0 and PPN[3:0] = 0001, 0010, 0100 or 0000. Load (lw) from the page through va_data.

Load page fault (scause = 13); stval = faulting virtual address.

PTE_RWX_s_d x PTE_Svnapot_reserved_enc_d x PTE_N_d x kilopage_d x mode x read_acc x load_page_fault x mode {S-mode}
= 12 bins on RV64 (RV64 only)

Svnapot_reserved_enc_read_u

Verify a reserved NAPOT PPN encoding raises a load page fault on a load from U-mode

U-mode: level-0 PTE with N=1, PTE.U=1 and PPN[3:0] = 0001, 0010, 0100 or 0000. Load (lw) from the page through va_data.

Load page fault (scause = 13); stval = faulting virtual address.

PTE_RWX_u_d x PTE_Svnapot_reserved_enc_d x PTE_N_d x kilopage_d x mode x read_acc x load_page_fault x mode {U-mode}
= 12 bins on RV64 (RV64 only)

Svnapot_reserved_enc_write_s

Verify a reserved NAPOT PPN encoding raises a store/AMO page fault on a store from S-mode

S-mode: level-0 PTE with N=1, PTE.U=0 and PPN[3:0] = 0001, 0010, 0100 or 0000. Store (sw) to the page through va_data.

Store/AMO page fault (scause = 15); stval = faulting virtual address.

PTE_RWX_s_d x PTE_Svnapot_reserved_enc_d x PTE_N_d x kilopage_d x mode x write_acc x store_page_fault x mode {S-mode}
= 12 bins on RV64 (RV64 only)

Svnapot_enc_tbl

Svnapot_reserved_enc_write_u

Verify a reserved NAPOT PPN encoding raises a store/AMO page fault on a store from U-mode

U-mode: level-0 PTE with N=1, PTE.U=1 and PPN[3:0] = 0001, 0010, 0100 or 0000. Store (sw) to the page through va_data.

Store/AMO page fault (scause = 15); stval = faulting virtual address.

PTE_RWX_u_d x PTE_Svnapot_reserved_enc_d x PTE_N_d x kilopage_d x mode x write_acc x store_page_fault x mode {U-mode}
= 12 bins on RV64 (RV64 only)

Svnapot_reserved_ppni_exec_s

Verify PTE.N on a superpage raises an instruction page fault on an instruction fetch from S-mode

S-mode: superpage leaf PTE (level 1 and above) with N=1 and PTE.U=0. Jump (jalr) into the page through va_data.

Instruction page fault (scause = 12); stval = faulting virtual address.

PTE_RWX_s_i x PTE_N_i x PageType_i x exec_acc x ins_page_fault x mode {S-mode}
= 5 bins on RV64 (RV64 only)

Svnapot_reserved_ppni_exec_u

Verify PTE.N on a superpage raises an instruction page fault on an instruction fetch from U-mode

U-mode: superpage leaf PTE (level 1 and above) with N=1 and PTE.U=1. Jump (jalr) into the page through va_data.

Instruction page fault (scause = 12); stval = faulting virtual address.

PTE_RWX_u_i x PTE_N_i x PageType_i x exec_acc x ins_page_fault x mode {U-mode}
= 5 bins on RV64 (RV64 only)

Svnapot_reserved_ppni_read_s

Verify PTE.N on a superpage raises a load page fault on a load from S-mode

S-mode: superpage leaf PTE (level 1 and above) with N=1 and PTE.U=0. Load (lw) from the page through va_data.

Load page fault (scause = 13); stval = faulting virtual address.

PTE_RWX_s_d x PTE_N_d x PageType_d x read_acc x load_page_fault x mode {S-mode}
= 5 bins on RV64 (RV64 only)

Svnapot_enc_tbl

Svnapot_reserved_ppni_read_u

Verify PTE.N on a superpage raises a load page fault on a load from U-mode

U-mode: superpage leaf PTE (level 1 and above) with N=1 and PTE.U=1. Load (lw) from the page through va_data.

Load page fault (scause = 13); stval = faulting virtual address.

PTE_RWX_u_d x PTE_N_d x PageType_d x read_acc x load_page_fault x mode {U-mode}
= 5 bins on RV64 (RV64 only)

Svnapot_reserved_ppni_write_s

Verify PTE.N on a superpage raises a store/AMO page fault on a store from S-mode

S-mode: superpage leaf PTE (level 1 and above) with N=1 and PTE.U=0. Store (sw) to the page through va_data.

Store/AMO page fault (scause = 15); stval = faulting virtual address.

PTE_RWX_s_d x PTE_N_d x PageType_d x write_acc x store_page_fault x mode {S-mode}
= 5 bins on RV64 (RV64 only)

Svnapot_reserved_ppni_write_u

Verify PTE.N on a superpage raises a store/AMO page fault on a store from U-mode

U-mode: superpage leaf PTE (level 1 and above) with N=1 and PTE.U=1. Store (sw) to the page through va_data.

Store/AMO page fault (scause = 15); stval = faulting virtual address.

PTE_RWX_u_d x PTE_N_d x PageType_d x write_acc x store_page_fault x mode {U-mode}
= 5 bins on RV64 (RV64 only)

Svnapot_reserved_ppni_napot_enc_exec_s
Svnapot_reserved_ppni_napot_enc_exec_u
Svnapot_reserved_ppni_napot_enc_read_s
Svnapot_reserved_ppni_napot_enc_read_u
Svnapot_reserved_ppni_napot_enc_write_s
Svnapot_reserved_ppni_napot_enc_write_u

Set up a superpage leaf PTE (level i >= 1) with N=1 and the 64 KiB encoding pte.ppn[0][3:0] = 1000, at each superpage level.
The encoding is only defined for i = 0, so it is reserved here.
Store, load, and execute through the page in supervisor and user mode.

Svnapot_reserved_encoding_fault

Store/AMO, load, and instruction page faults

feature: Reserved Encoding

Table 277. Svnapot Normative Rules
Normative Rule Rule Text Coverpoints

Svnapot_depends_Sv39

The Svnapot extension depends on the Sv39 extension

Not tested: extension dependency checked by the UDB configuration

Svnapot_pte_n

In Sv39, Sv48, and Sv57, when a PTE has N=1, the PTE represents a translation that is part of a range of contiguous virtual-to-physical translations with the same values for PTE bits 5–0.

Svnapot_cg/Svnapot_legal_enc_exec_{s, u}

Svnapot_range_napot

Such ranges must be of a naturally aligned power-of-2 (NAPOT) granularity larger than the base page size

Svnapot_cg/Svnapot_legal_enc_exec_{s, u}

Svnapot_enc_tbl

i|pte.ppn[i]|Description|pte.napot_bits === 0 0 0 0 0 ≥1|x xxxx xxx1 x xxxx xx1x x xxxx x1xx x xxxx 1000 x xxxx 0xxx x xxxx xxxx|Reserved Reserved Reserved 64 KiB contiguous region Reserved Reserved|- - - 4 - - ===

Svnapot_cg/{Svnapot_legal_enc_exec_s, Svnapot_legal_enc_read_u, Svnapot_reserved_enc_write_s, Svnapot_reserved_ppni_read_s}

Svnapot_valid_encoding_ppn_subst

If the encoding in pte is valid according to norm:Svnapot_enc_tbl, then instead of returning the original value of pte, implicit reads of a NAPOT PTE return a copy of pte in which pte.ppn[i][pte.napot_bits-1:0] is replaced by vpn[i][pte.napot_bits-1:0].

Svnapot_cg/Svnapot_legal_enc_exec_{s, u}

Svnapot_reserved_encoding_fault

reserved according to norm:Svnapot_enc_tbl, then a page-fault exception must be raised

Svnapot_cg/Svnapot_reserved_enc_exec_{s, u}, Svnapot_cg/Svnapot_reserved_ppni_napot_enc_exec_{s, u}

Svnapot_cache_entries

Implicit reads of NAPOT page table entries may create address-translation cache entries mapping a + j×PTESIZE to a copy of pte in which pte.ppn[i][pte.napot_bits-1:0] is replaced by vpn[i][pte.napot_bits-1:0], for any or all j such that j >> napot_bits = vpn[i] >> napot_bits, all for the address space identified in satp as loaded by step 1

Not tested: address-translation cache contents are not observable in signature tests

Svnapot_hyp_gstage

Svnapot is also supported in G-stage translation

TODO: test in hypervisor tests

UDB Parameters: None.

B.8.15. Svukte User Kernel Translation Enable

Table 278. Svukte Coverpoints
Coverpoint Goal Feature Description Expectation Bins

General Test Environment (Svukte):
- Planned coverpoints; no Svukte generator or coverage file exists yet.
- The ISA manual normative-rule snapshot used by coverpoints/norm has no Svukte rules, so ID and Normative Rule are empty.

cp_svukte_qualified_exec_fault

Test qualified accesses from U-mode (instruction fetch)

While in U-mode, with senvcfg.UKTE=1 and any non-bare address translation mode (satp={SV39, SV48, SV57}) an access with vaddr >= (XLEN-1)^2 is Svukte-qualified.

Accesses should all cause the corresponding fault based on their access type

3 non-bare SATP modes (each)

cp_svukte_qualified_read_fault

Test qualified accesses from U-mode (load)

While in U-mode, with senvcfg.UKTE=1 and any non-bare address translation mode (satp={SV39, SV48, SV57}) an access with vaddr >= (XLEN-1)^2 is Svukte-qualified.

Accesses should all cause the corresponding fault based on their access type

3 non-bare SATP modes (each)

cp_svukte_qualified_write_fault

Test qualified accesses from U-mode (store)

While in U-mode, with senvcfg.UKTE=1 and any non-bare address translation mode (satp={SV39, SV48, SV57}) an access with vaddr >= (XLEN-1)^2 is Svukte-qualified.

Accesses should all cause the corresponding fault based on their access type

3 non-bare SATP modes (each)

cp_svukte_qualified_mprv_read_fault

Test accesses with effective U-mode from M-mode (load)

If MPRV=1 and MPP=U, accesses will have effective U-mode.
Thus, with senvcfg.UKTE=1 and any non-bare address translation mode (satp={SV39, SV48, SV57}), accesses with vaddr >= (XLEN-1)^2 will be Svukte-qualified.

3 non-bare SATP modes (each)

cp_svukte_qualified_mprv_write_fault

Test accesses with effective U-mode from M-mode (store)

If MPRV=1 and MPP=U, accesses will have effective U-mode.
Thus, with senvcfg.UKTE=1 and any non-bare address translation mode (satp={SV39, SV48, SV57}), accesses with vaddr >= (XLEN-1)^2 will be Svukte-qualified.

3 non-bare SATP modes (each)

cp_svukte_qualified_vu_exec_fault

Test accesses from VU-mode (instruction fetch)

While in VU-mode, with senvcfg.UKTE=1 and any non-bare address translation mode (satp={SV39, SV48, SV57}) an access with vaddr >= (XLEN-1)^2 is Svukte-qualified.

3 non-bare VSATP modes (each)

cp_svukte_qualified_vu_read_fault

Test accesses from VU-mode (load)

While in VU-mode, with senvcfg.UKTE=1 and any non-bare address translation mode (satp={SV39, SV48, SV57}) an access with vaddr >= (XLEN-1)^2 is Svukte-qualified.

3 non-bare VSATP modes (each)

cp_svukte_qualified_vu_write_fault

Test accesses from VU-mode (store)

While in VU-mode, with senvcfg.UKTE=1 and any non-bare address translation mode (satp={SV39, SV48, SV57}) an access with vaddr >= (XLEN-1)^2 is Svukte-qualified.

3 non-bare VSATP modes (each)

cp_svukte_qualified_hs_read_fault

Test accesses with effective VU-mode from HS-mode (load)

While in effective VU-mode, with senvcfg.UKTE=1 and any non-bare address translation mode (satp={SV39, SV48, SV57}) an access with vaddr >= (XLEN-1)^2 is Svukte-qualified.

3 non-bare VSATP modes (each)

cp_svukte_qualified_hs_write_fault

Test accesses with effective VU-mode from HS-mode (store)

While in effective VU-mode, with senvcfg.UKTE=1 and any non-bare address translation mode (satp={SV39, SV48, SV57}) an access with vaddr >= (XLEN-1)^2 is Svukte-qualified.

3 non-bare VSATP modes (each)

cp_svukte_qualified_hukte_read_fault

Test accesses virtual accesses from U-mode (load)

When an hlv, hlvx or hsv instruction is executed in U-mode (which is allowed if hstatus.HU=1), the access should be Svukte-qualified as if senvcfg.UKTE was set to the value of hstatus.HUKTE.

If hstatus.HUKTE=1, accesses should fail
If hstatus.HUKTE=0, accesses should not fail

3 non-bare VSATP modes (each) * 2 HUKTE values

cp_svukte_qualified_hukte_write_fault

Test accesses virtual accesses from U-mode (store)

When an hlv, hlvx or hsv instruction is executed in U-mode (which is allowed if hstatus.HU=1), the access should be Svukte-qualified as if senvcfg.UKTE was set to the value of hstatus.HUKTE.

If hstatus.HUKTE=1, accesses should fail
If hstatus.HUKTE=0, accesses should not fail

3 non-bare VSATP modes (each) * 2 HUKTE values

cp_svukte_unqualified_access

Test non-Svukte-qualified accesses

Accesses that do not have effective U-mode, are using Bare address translation, or the other qualifying criteria are not Svukte-qualified

Non-qualified accesses should succeed

B.9. H Hypervisor

The Hypervisor Extension adds an H coverage file containing new Hypervisor instructions, and additional coverage files related to exceptions, interrupts, endian, and virtual memory.


B.9.1. H Hypervisor CSRs and Instructions

Definitions: Machine H-Extension CSRs: mtval2, mtinst HS H-Extension CSRs: hstatus, hedeleg, hideleg, hie, hcounteren, hgeie, henvcfg, htval, hip, hvip, htinst, hgatp, hgeip (+ htimedelta for Zicntr) (+ hedelegh, htimedeltah, henvcfgh for RV32) VS H-Extension CSRs: vsstatus, vsie, vstval, vsip, vstvec, vsscratch, vsepc, vscause, vsatp (+ vstimecmp for SSTC, vstimecmph with RV32) h H-extension CSRS (RV64 only): hedelegh, htimedeltah, henvcfgh, vstimecmph S CSRs with VS replicas: sstatus, sie, stvec, sscratch, sepc, scause, stval, sip, satp S CSRs without VS replicas: scounteren, senvcfg, scountinhibit Note: * trap handler should also record hstatus, m/s status in signature

Table 279. H Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule Notes

Tests executed in M-mode (H_mcsr_cg)

cp_hcsr_access

All H-extension CSRs are able to read, write, set, and clear

Write all 1s and all 0s, then set all bits, then clear all bits, then read each {Machine/HS/VS} H-Extension CSR.

All registers are accessible. hgeip is read-only.

5 * (2 + 14-17 + 9-11)

m_access_all_lower_priv_csrs
mtval2_sz_acc_op
mtinst_sz_acc_op
hstatus_sz_acc_op
hedeleg_sz_acc
hideleg_sz_acc
hip_hie_sz_acc
htimedelta_sz_acc_op
hcounteren_sz
hgeie_sz_acc_op
henvcfg_sz_acc_op
htval_sz_acc_op
hvip_sz_op
htinst_sz_acc_op
hgatp_sz_acc_op
hgeip_sz_acc_op
hedelegh_sz_acc_op
htimedeltah_sz_acc_op
henvcfgh_sz_acc_op
vsstatus_sz_acc_op
vsip_vsie_sz_acc_op
vstval_sz_acc_op
vstvec_sz_acc_op
vsscratch_sz_acc_op
vsepc_sz_acc_op
vscause_sz_acc_op
vsatp_sz_acc_op
H_vscsrs_acc_m_hs
Zicsr_higher_priv
Zicsr_rw

* also capture 2.7 >xlen,2 "accessible at higher priv levels"

cp_hcsrwalk

Exercise each bit of H-extension CSRs

Set and clear each bit of each Machine H-Extension CSR.

All registers are accessible. Some fields are WARL and will not change.

64*2*(2 + 13-16 + 8-10)

mtval2_sz_acc_op
mtinst_sz_acc_op

* make sure each bit of hstatus, vsstatus are tested elsewhere

cp_replica

Writing to S/VS-mode CSRs doesn’t affect replica

Write different random values into S-mode CSRs and their VS-mode replicas. Read back

Each CSR should have value written.

9

H_vscsrs_v0

cp_mtvala

mtval must not be read-only zero

Write 1s to mtval

nonzero

1

H_mtval_nrz

Tests executed in HS-mode (H_hscsr_cg)

cp_hcsr_access

All H-extension CSRs are able to read, write, set, and clear

Write all 1s and all 0s, then set all bits, then clear all bits, then read each {HS/VS} H-Extension CSR.

All registers are accessible. hgeip is read-only.

5 * (14-17 + 9-11)

m_access_all_lower_priv_csrs
hstatus_sz_acc_op
hedeleg_sz_acc
hideleg_sz_acc
hip_hie_sz_acc
htimedelta_sz_acc_op
hcounteren_sz
hgeie_sz_acc_op
henvcfg_sz_acc_op
htval_sz_acc_op
hvip_sz_op
htinst_sz_acc_op
hgatp_sz_acc_op
hgeip_sz_acc_op
hedelegh_sz_acc_op
htimedeltah_sz_acc_op
henvcfgh_sz_acc_op
vsstatus_sz_acc_op
vsip_vsie_sz_acc_op
vstval_sz_acc_op
vstvec_sz_acc_op
vsscratch_sz_acc_op
vsepc_sz_acc_op
vscause_sz_acc_op
vsatp_sz_acc_op

cp_hcsrwalk

Exercise each bit of H-extension CSRs

Set and clear each bit of each {HS/VS} H-Extension CSR. Exclude hstatus, vsstatus because of WPRI bits.

All registers are accessible. Some fields are WARL and will not change.

64 * 2 * (13-16 + 8-10)

hedeleg_sz_acc
hideleg_sz_acc
hip_hie_sz_acc
htimedelta_sz_acc_op
hcounteren_sz
hgeie_sz_acc_op
henvcfg_sz_acc_op
htval_sz_acc_op
hvip_sz_op
htinst_sz_acc_op
hgatp_sz_acc_op
hgeip_sz_acc_op
hedelegh_sz_acc_op
htimedeltah_sz_acc_op
henvcfgh_sz_acc_op
vsip_vsie_sz_acc_op
vstval_sz_acc_op
vstvec_sz_acc_op
vsscratch_sz_acc_op
vsepc_sz_acc_op
vscause_sz_acc_op
vsatp_sz_acc_op

The …​X bits, when set, indicate that the PMP entry permits …​ instruction execution

cp_hcsr_inaccessible

M-mode H-extension registers are inaccessible from HS-mode

csrrw, csrrs, csrrc, csrr each Machine H-Extension CSR

Illegal instruction fault

5 * 2

Zicsr_illegal_mode

cp_replica

In HS, writing to S/VS-mode CSRs doesn’t affect replica

In M-mode, write different random values into S-mode CSRs and their VS-mode replicas. Switch to HS-mode and read, write random, and readback S and VS CSRs. Switch back to M-mode and read back both the S-mode CSRs and VS replicas.

Each CSR should have value written.

9

H_vscsrs_v0

cp_hstatus_vgein

VGEIN can hold values between 0 and GEILEN

Write {0, 1, GEILEN-1, GEILEN, GEILEN+1, 63} to hstatus.VGEIN

Only write legal values

6

hstatus_vgein_wlrl

cp_vscause_write

vscause WLRL fields writable

Write values
(WLRL)

with interrupt = 1: 0-15
with interrupt = 0: 0-64

81

cp_tvm

TVM traps access to satp and hgatp

With mstatus.TVM = {0/1} read and write satp and hgatp

Illegal instruction fault if TVM = 1

2 TVM * 2 accesses * 2 regs

* check if any other bitfields need special cases, including hstatus, vsstatus

Tests executed in VS-mode (H_vscsr_cg)

cp_hcsr_inaccessible

M-mode H-extension registers are inaccessible from VS-mode

csrrw, csrrs, csrrc, csrr each Machine H-Extension CSR

Illegal instruction fault

5 * 2

Zicsr_illegal_mode

cp_hcsr_virtualinstructionfault

HS and VS registers cause virtual instruction fault from VS-mode

csrrw, csrrc, csrrs, csrr each {HS/VS} H-Extension CSR

Virtual instruction fault

5 * (13-16 + 8-10)

H_csrs_hs_not_vs
H_vscsrs_acc_vs

cp_illegalupper

In RV64, h half of CSRs are illegal.

RV64 ONLY: csrrw, csrrs, csrrc, csrr each h H-extension CSR

Illegal instruction fault
* may need to remove vstimecmp from all cp_illegalupper coverpoints if not implemented

5 * 4

"When XLEN>32, an attempt to access a high-half CSR always raises an illegal-instruction exception."
* should this be every h register, not just these, and at lesat the unpriv counters?

cp_replica

In VS, writing to S-mode CSRs affects replica instead

In M-mode, write different random values into S-mode CSRs and their VS-mode replicas. Switch to VS-mode and write and readback S CSRs. Switch back to M-mode and read back both the S-mode CSRs and VS replicas.

VS replica should have changed but S CSR does not change.

9

H_vscsrs_v0
H_vscsrs_sub

cp_nonreplica

In VS, accessing nonreplicated S-mode CSRs behaves normally

csrrw, csrrc, csrrs, csrr each S CSR without VS replica

Normal access

5 * 3

H_scsrs_nomatch

cp_vsstatus_sd_write

vstatus.SD affected by vstatus.FS/VS

Write 1 and 0 to SD with FS/VS all 0. Write cross-product of all bits of vsstatus.SD/ FS/ VS.

vsstatus.SD = 1 if FS or VS are nonzero

2 * 4 * 4

cp_tvm

VTVM traps access to satp

With mstatus.TVM = {0/1} cross hstatus.VTVM = {0/1} read and write satp

Virtual instruction fault if VTVM = 1. TVM does not affect VS-mode.

2 TVM * 2 VTVM * 2 accesses

Tests executed in U-mode (H_ucsr_cg)

cp_hcsr_inaccessible

All H-extenion CSRs are inaccessible from U-mode

csrrw, csrrc, csrrs, csrr each {Machine/HS/VS} H-Extension CSR

Illegal instruction fault

5 * (2 + 14-17 + 9-11)

Zicsr_illegal_mode

cp_illegalupper

In RV64, h half of CSRs are illegal.

RV64 ONLY: csrrw, csrrs, csrrc, csrr each h H-extension CSR

Illegal instruction fault

5 * 4

Zicsr_illegal_mode

*

cp_scsr

Illegal instruction fault on U access to supervisor CSRs

csrrw, csrrc, csrrs, csrr each S CSRs {with/without VS replicas}*** this should get tested in ZicsrS, along with other illegal instruction faults for CSRs of too much priv

Illegal instruction fault

5 * (9 + 3)

Zicsr_illegal_mode

Tests executed in VU-mode (H_vucsr_cg)

cp_hcsr_inaccessible

M-mode H-extension registers are inaccessible from VS-mode

csrrw, csrrs, csrrc, csrr each {Machine/HS/VS} H-Extension and {Machine/Supervisor} CSR

Illegal instruction fault

5 * (2 + 14-17 + 9-11)

Zicsr_illegal_mode

cp_illegalupper

In RV64, h half of CSRs are illegal.

RV64 ONLY: csrrw, csrrs, csrrc, csrr each h H-extension CSR

Illegal instruction fault

5 * 4

Zicsr_illegal_mode

cp_scsr

Virtual instruction fault on VU access to hypervisor CSRs

csrrw, csrrc, csrrs, csrr each {HS/VS/S} CSRs {with/without VS replicas}

Virtual instruction fault or illegal instruction

5 * (9 + 3)

H_vscsrs_acc_vs
Zicsr_illegal_mode

Seems Zicsr* should write all 0s and all 1s to each standard CSR and read the CSR. Applies to all Zicsr* tabs. * maybe already done?

Instructions (H_inst_cg)

cp_hlv

Basic load

Set up non-identity G and VS-stage page tables. In {M, HS, U (with hstatus.HU = 1)}: Write a random value to scratch. hlv.b, hlv.bu, hlv.h, hlv.hu, hlv.w from scratch. For rv64, also test hlv.wu, hlv.d. Random source and destination registers.

Read and sign/zero extend

3 modes * 7 instr

cp_hlvx

Basic load

Set up non-identity G and VS-stage page tables. In {M, HS, U (with hstatus.HU = 1): Write a random value to scratch. hlvx.hu, hlvx.wu from scratch. Random source and destination registers.

Read and sign/zero extend

3 modes * 2 instr

cp_hsv

Basic store

Set up non-identity G and VS-stage page tables. In {M, HS, U (with hstatus.HU = 1): Write a random value to scratch. hsv.b, hsv.h, hsv.w to scratch. For rv64, also test hsv.d. Random source and destination registers and values.

Read and sign/zero extend

3 modes * 4 instr

cp_hfence

Basic fence

Execute hfence.vvma, hfence.gvma in {M, HS mode} cross with mstatus.TVM = {0,1} and with hstatus.VTVM = {0,1}

Only exception for HFENCE.GVMA in HS-mode with mstatus.TVM=1

2 modes * 2 instr * 2 TVM * 2 VTVM

cp_sfence

Basic fence

Execute sfence.vma in {M, HS, VS mode} cross with mstatus.TVM = {0,1} and with hstatus.VTVM = {0,1}

Only exception in HS mode when TVM = 1 or in VS-mode when VTMV = 1

3 modes * 2 TVM * 2 VTVM

cp_mret_m

mret uses MPV

Execute mret in machine mode with cross-product of mstatus.MPP / MPV / MPIE.

Goes to appropriate mode

2 MPP * 2 MPV * 2 MPIE

cp_mret_illegal

mret unavailable below M mode

Execute mret in {HS, VS, VU} modes.

Illegal instruction

3 modes

cp_sret_illegal

sret unavailable in VU mode

Execute sret in VU mode.

Virtual instruction

1 mode

cp_sret_m

sret from M mode

Execute sret in machine mode with cross-product of mstatus.SPP / SPV / SPIE.

Goes to appropriate mode

2 SPP * 2 SPV * 2 SPIE

cp_sret_hs

sret from HS mode

Execute sret in HS-mode with cross-product of sstatus.SPP / SPIE / hstatus.SPV. Check sstatus.SPP, SIE, SPIE, hstatus.SPV.

Goes to appropriate mode

2 SPP * 2 SPIE * 2 SPV

cp_sret_vs

sret from VS mode

Execute sret in VS-mod ewith cross-product of sstatus.SPP / SPIE / hstatus.VTSR. Check sstatus.SPP, SIE, SPIE.

Goes to appropriate mode, or virtual-instruction exception if VTSR=1.

2 SPP * 2 SPIE * 2 VTSR

B.9.2. ExceptionsH Hypervisor Exceptions

Note: M trap handler should log mcause/mepc/mtval/mstatus/mtinst/mtval2. Only certain mstatus bits need to be saved: GVA, SPP, MPP, SPIE, MPIE, MPV. HS trap handler should log scause/sepc/stval/sstatus/hstatus/htinst/htval. Only certain bits of status: hstatus.GVA/SPV/SPVP. sstatus.SPP, SPIE

Table 280. ExceptionsH Coverpoints
Coverpoint Goal Feature Description Expectation Bins ID Notes

VS trap handler should log scause/spec/stval/sstatus (these will be the VS versions). Save sstatu.SPP, SPIE

cp_hedeleg

Delegation to HS or VS

Attempt {instruction/load/store access fault, instruction/load/store misaligned fault, illegal instruction, ebreak} crossed with privilege mode M/HS/VS/VU/U crossed with medeleg = {0s/1111_0000_1011_0111_1111_111?} crossed with hedeleg = {0s/ 0000_11?0_1?11_0001_1111_111?/(walking 1s in hedeleg[8:1])}

VU/U/VS delegate to VS when bit is set in both delegation registers.
Check xcause, xtval, xtinst, xepc, mtval2, xstatus.GVA field, other xtstaus bits relevant to traps and other fields visible at the receiving priv level.

8 faults * 5 priv modes * 2 medeleg * 9 hedeleg
* might be too many

* a version of this is needed in VMH for page faults. Umer doing this.

Also covers {m/h}status.GVA; see also cp_gva

cp_ecall_to_vs

ecall to VS sets status bits

Delegate ecalls from VU to VS with medeleg and hedeleg. Make ecall from VU to VS. Check vsstatus.SPP, vsstatus.SPIE, vsstatus.SIE.

status bits written per spec

1 priv modes

cp_ecall_to_hs

ecall to HS sets status bits

Delegate ecalls from {U, VS, VU} to HS with medeleg with hedeleg = 0. Make ecall to HS cross with hstatus.SPVP={0/1}. Check hstatus.SPP/SPV/SPVP/GVA, sstatus.SIE/SPIE

status bits written per spec

4

cp_ecall_to_m

ecall to M sets status bits

No delegation of ecalls. Make ecall from M/HS/U/VS/VU to M. Check mstatus.MPV/MPP/GVA/MPIE/MIE

status bits written per spec

5

mode x medeleg ecall bits 0 x mstatus

note: medelg ecall bits 0 (check for this)

cp_ebreak_to_m

ebreak to M sets status bits

No delegation of ebreak. Make ebreak from M/HS/U/VS/VU to M. Check mstatus.MPV/MPP/GVA/MPIE/MIE

status bits written per spec

5

cp_vstvec

ecall to VS uses vstvec

Delegate ecall from {VU, VS} to VS with medeleg and hedeleg. Point vstvec to a different trap handler than stvec. Make ecall to VS from VU/VS

Goes to vstvec handler

2

Should this move to SvH because of page faults?

cp_priority

priority of illegal/virtual instruction, misaligned, access fault

Execute {hlv.w / hsv.w} x {legal/illegal address} x {addr[1:0] = 00/01} x {priv=M/HS/VS/VU/U} x hstatus.HU={0/1} to cause all combinations of illegal, virtual, access fault misaligned

Highest priority exception should occur

2 instr * 2 access * 2 misaligned * 5 priv * 2 HU

cp_virtual_instr_vs

exercise all ways to trigger virtual-instruction exceptions from VS

read instret with hcounteren[2] = 0, mcounteren[2] = 1
execute hlv.w, hlvx.wu, hsv.w, hfence.vvma, hfence.gvma
read vstval, htval
with mstatus.TVM = 0, read satp, vsatp
wfi with hstatus.VTW=1, mstatus.TW=0, no interrupt firing
sret with hstatus.VTSR=1
{sfence.vma, sinval.vma, read satp} with hstatus.VTVM=1
RV32 only:
access instreth with hcounteren[2] = 0, mcounteren[2] = 1
read hedelegh

virtual instruction exception

14+

* check which fences belong in each.

cp_virtual_instr_vu

exercise all ways to trigger virtual-instruction exceptions from VU

in VU:
read instret with hcounteren[2] = 0, scounteren[2] = 1, mcounteren[2] = 1
read instret with hcounteren[2] = 1, scounteren[2] = 0, mcounteren[2] = 1
execute hlv.w, hlvx.wu, hsv.w, hfence.vvma, hfence.gvma
read vstval, htval
read stval
with mstatus.TVM = 0, read satp, vsatp
wfi with mstatus.TW=0, no interrupt firing
sret, sfence.vma
RV32 only:
read instreth with hcounteren[2] = 0, scounteren[2] = 1, mcounteren[2] = 1
read instreth with hcounteren[2] = 1, scounteren[2] = 0, mcounteren[2] = 1
read hedelegh

virtual instruction exception

14+

* check which fences belong in each.

cp_loadstore_priv

Valid privilege modes of hypervisor load/store

In each privilege mode {M/HS/VS/U/VU} with hstatus.HU={0/1}, attempt {HLV.W, HLVX.W, HSV.W} from scratch memory

succeeds in M, HS; virtual-instruction in VS,VU; illegal instruction in U with HU=0

5 priv * 2 HU

cp_hfence_priv

valid priv mode of hypervisor fences

In each privilege mode {M/HS/VS/U/VU} with mstatus.TVM={0/1}, hstatus.VTVM = {0/1}, attempt {sfence.vma, hfence.vvma, hfence.gvma}

Illegal instruction in U/VU-mode or in HS-mode with TVM=1. Virtual instruction exception in VS-mode. Otherwise succeed.

5 priv * 2 TVM * 2 VTMV

cp_hlv_address_misaligned

Hypervisor Load Misaligned

In M mode with identity page tables set up and XR permission, attempt hlv.{b, bu, h, hu, w} and hlvx.{hu, wu} with every combination of three lsbs:000-111. For RV64, also hlv.d and hlv.wu

Success or load misaligned, affected by Zicclsm

8 instr * 8 addr

cp_hlv_access_fault

Hypervisor Load Access Fault

In M mode with identity page tables set up and XR permission, attempt hlv.{b, bu, h, hu, w} and hlvx.{hu, wu} from an illegal address (parameterized). For RV64, also hlv.d and hlv.wu

Access fault

8 instr

cp_hsv_address_misaligned

Hypervisor Store Misaligned

In M mode with identity page tables set up and WR permission, attempt hsv.{b, h, w} with every combination of three lsbs:000-111. For RV64, also hsv.d.

Success or store misaligned, affected by Zicclsm

3 instr * 8 addr

cp_hsv_access_fault

Hypervisor Store Access Fault

In M mode with identity page tables set up and WR permission, attempt hsv.{b, h, w} from an illegal address (parameterized). For RV64, also hsv.d.

Access fault

3 instr

cp_xtinst_instr_misaligned

Instruction address misaligned writes xtinst

From VS mode with medeleg = {0/1}, hedeleg = 0, random value written to mtinst and mtval2, jump to misaligned address. Note medeleg 0/1 refers to all bits except ecall from M/HS mode

If Zca supported, no fault. Otherwise, Instruction misaligned trap with {m/h}tinst = 0 or custom, Trap to machine also sets mtval2 = 0.

2

mtinst could be hardwired to 0 and would ignore random value

cp_xtinst_instr_access

Instruction acc fault writes xtinst

From VS mode with medeleg = {0/1}, hedeleg = 0, random value written to mtinst and mtval2, jump to access fault address

Inst Access fault with {m/h}tinst = 0. Trap to machine also sets mtval2 = 0.

2

cp_xtinst_illegalinstr

Illegal instruction writes xtinst

From VS mode with medeleg = {0/1}, hedeleg = 0, execute illegal instruction all 0s

Illegal Instr fault with {m/h}tinst = 0. Trap to machine also sets mtval2 = 0.

2

cp_xtinst_breakpoint

breakpoint writes xtinst

From VS mode with medeleg = {0/1}, hedeleg = 0, execute ebreak

Breakpoint exception with {m/h}tinst = 0 or custom. Trap to machine also sets mtval2 = 0.

2

cp_xtinst_virtinstr

Virtual instruction writes xtinst

From VS mode with medeleg = {0/1}, hedeleg = 0, csrr vstval

Virtual instr exception with {m/h}tinst = 0 or custom. Trap to machine also sets mtval2 = 0.

2

cp_xtinst_load_misaligned

load misaligned writes xtinst

From VS mode with medeleg = {0/1}, hedeleg = 0, misaligned load

If Zicclsm supported, no fault. Otherwise Load misaligned exception with {m/h}tinst = 0 or transformed or custom. Trap to machine also sets mtval2 = 0.

2

cp_xtinst_load_access

load access writes xtinst

From VS mode with medeleg = {0/1}, hedeleg = 0, load access fault

Load access exception with {m/h}tinst = 0 or transformed or custom. Trap to machine also sets mtval2 = 0.

2

cp_xtinst_store_misaligned

store misaligned writes xtinst

From VS mode with medeleg = {0/1}, hedeleg = 0, misaligned store

Store misaligned exception with {m/h}tinst = 0 or transformed or custom. Trap to machine also sets mtval2 = 0.

2

cp_xtinst_store_access

store access writes xtinst

From VS mode with medeleg = {0/1}, hedeleg = 0, store access fault

If Zicclsm supported, no trap. Otherwise store access exception with {m/h}tinst = 0 or transformed or custom. Trap to machine also sets mtval2 = 0.

2

cp_xtinst_ecall

ecall writes xtinst

From VS mode with medeleg = {0/1}, hedeleg = 0,ecall

ecall from vs mode with {m/h}tinst = 0 or custom. Trap to machine also sets mtval2 = 0.

2

B.9.3. ExceptionsHV Hypervisor Vector Exceptions

Table 281. ExceptionsHV Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule Notes

cp_mstatus_vs_off
cp_vsstatus_vs_off

mstatus.VS and vsstatus.VS are selected correctly according to the privilege level to disable vector instructions when off.

Set misa.V to 1. Cross mstatus.VS = {00, 01, 10, 11}, vsstatus.vs = {00, 01 10, 11}, mode = {M/HS/VS/VU/U}. Attempt csrr t0, vl and vadd.vv v1, v2, v3. Read back mstatus.VS and vssstatus.VS.

Illegal instruction if mstatus.VS = 00 or ((mode = VS or VU) and vsstatus.VS = 00). Otherwise, vadd.vv sets mstatus.VS to 11, and also sets vsstatus.VS to 11 if mode = VS or VU.

4 * 4 * 5

vsstatus_vs_mstatus_vs_op_off
vsstatus_vs_sz_acc
vsstatus_vs_op

cp_misa_V

vector instructions don’t work when misa.V = 0

Set misa.V to 0. Attempt vadd.vv.

Illegal instruction if V is not hardwired to 1

1

ins.prev = csrw misa x0; ins.current = vadd.v

B.9.4. InterruptsH Hypervisor Interrupts

Record all trap information including xstatus add to CTP an assumption that all interrupts are implemented

Table 282. InterruptsH Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule

Following tests are done in M-mode

cp_mideleg

hypervisor bits of mideleg are read-only 1

Write 0 to mideleg and read it back.

Bits 10, 6, 2 are 1s. If GEILEN > 0, bit 12 is also 1.

1

cp_mie

mie.VS*IE bits are alias of hie

With hie = 0x444, read mie.

0x444

1

cp_mip

mip.VS*IP bits are alias of hip

With hvip = 0x444, read mip and hip. Note that hip depends on hvip.

0x444

1

cp_nohint_m

VS*I never causes machine-mode interrupt

mstatus.MIE=1, hideleg = 0, mie = 0x444, mip = 0x444

No interrupt occurs because these are always delegated to HS or VS

1

Following tests are done in M-mode if GILEN > 0

cp_mie_gilen

mie.SGEIE is alias of hie

With hie = 0x1444, read mie.

0x1444

1

cp_mip_gilen

mip.SGEIP is alias of hip

Set hgeip nonzero and read mip

0x1000

1

Following tests are done in M-mode if GILEN = 0

cp_mie_gilen

mie.SGEIE is read-only zero if GILEN = 0

Write hie = 0x1000, read mie

0x0000

1

hie_acc

Following tests are done in HS-mode

cp_trigger_vsei

trigger HS-mode VSEI

With sstatus.SIE={0/1}, hideleg.VSEI = {0/1}, hie.VSEIE = {0/1}, write hvip.VSEIP

hip.VSEIP rises. if SIE=1 & hideleg = 0 & hie = 1, interrupt to HS-mode with cause 10

2 * 2 * 2

cp_trigger_vsti

trigger HS-mode VSTI

With sstatus.SIE={0/1}, hideleg.VSTI = {0/1}, hie.VSTIE = {0/1}, write hvip.VSTIP

hip.VSTIP rises. if SIE=1 & hideleg = 0 & hie = 1, interrupt to HS-mode with cause 6

2 * 2 * 2

cp_trigger_vssi

trigger HS-mode VSSI

With sstatus.SIE={0/1}, hideleg.VSSI = {0/1}, hie.VSSIE = {0/1}, write hvip.VSSIP

hip.VSSIP rises. if SIE=1 & hideleg = 0 & hie = 1, interrupt to HS-mode with cause 2

2 * 2 * 2

cp_hip_write

only hip.vssip is writable, and aliases to hvip

Write hip=0xFFFF and hip = 0x0000. Read back hvip and hip.

0x0004 and 0x0000 in both hip and hvip.

1

cp_priority_en_vsi

trigger highest priority enabled VSI

With sstatus.SIE=1, hideleg = 0, 2^3 combinations of hie.VS*IE, write 2^3 combinations of hvip.VS*IP

Highest priority enabled interrupt to HS-mode

8 * 8

cp_priority_deleg_vsi

trigger highest priority undelegated VSI

With sstatus.SIE = 1, hie=0x444, 2^3 combinations of hideleg, write 2^3 combinations of hvip.VS*IP

Highest priority undelegated interrupt to HS-mode

8 * 8

cp_priority_s

VS*I has lower priority than any S*I

With sstatus.SIE = 1, hvip = 0x444, hideleg = 0, hie = 0x444, sie = 1s, sip = {SEIP, STIP, SSIP, none}

Take highest priority interrupt (supervisor, if any asserted, else VSEI)

4

cp_hie

hie.VS*IE bits are alias of mie

With mie = 0x444, 2^3 combinations of hideleg, read hie and vsie

hie = 0x444; vsie = 1s in delegated bits

8

cp_hip

hip.VS*IP bits are alias of mip

With mip = 0x444, 2^3 combinations of hideleg, read hip and visp

hip = 0x444; visp = 1s in delegated bits

8

cp_hideleg

hideleg bits 10, 6, 2 are writable

Write 0xFFFF to hideleg, read back

0x444

1

cp_vsie

vsie is alias of hie when delegated

With 2^3 combinations of hideleg and 2^3 combinations of hie, read vsie

vsie bits = 1 if hideleg and hie bits = 1 (shifted)

8 * 8

cp_vsip

vsip is alias of hip when delegated

With 2^3 combinations of hideleg and 2^3 combinations of hip, read vsip

vsip bits = 1 if hideleg and hip bits = 1 (shifted)

8 * 8

cp_vsie_from_hie

hie is alias of vsie when delegated

With 2^3 combinations of hideleg, write 0xFFFF to vsie, read hie

delegated bits show up as 1 in hie (shifted)

8

Following tests are done in HS-mode if GILEN > 0

cp_hie_gilen

hie.SGEIE is alias of mie

With mie = 0x1444, read hie

0x1444

1

cp_priority_sgei

SGEI has higher priority than VS*I

With sstatus.SIE=1, hvip = 0x444, sgeip & sgeie != 0, hideleg = 0, hei = 0x1444

interrupt to HS-mode with cause 12

1

cp_priority_sgei_s

SGEI has lower priroity than any S*I

With sstatus.SIE = 1, hvip = 0x444, hideleg = 0, hie = 0x1444, sie = 1s, sip = {SEIP, STIP, SSIP, none}

Take highest priority interrupt (supervisor, if any are asserted)

4

cp_trigger_sgei

trigger HS-mode SGEI

With sstatus.SIE={0/1}, sgeip & sgeie != 0, hie.SGEIE = {0/1}

hip.SGEIP =1. if SIE=1 & hie = 1, interrupt to HS-mode with cause 12

2 * 2

cp_hgeie

hgeie enables SGEI

With sstatus.SIE = 0, for i in 1…​GILEN, with hgeip = {0, 1 in i, 1s in all writable bits}, hgeie = 1 in bit i

hip.SEGIP = 1 if hgeip & hgeie != 0

GLEN * 3

cp_trigger_vsei_hgeip

trigger HS-mode VSEI with HGEIP

With sstatus.SIE = 0, hvip = 0, hideleg = 0, hie = 0, for i in 1…​GLEN: hgeip = {0, 1 in i, 1 in all writable bits except i}, hgeie[i] = {0/1}, hstatus.VGEIN = i

hip.VSEIP = hgeip[i] independent of hgeie

GLEN * 2

cp_hgeip0

no VSEI selected when VGEIN=0

With statatus.SIE=0, hvip = 0, hideleg=0, hie = 0, hgeip = hgeie = 1s in all writable bits, hstatus.VGEIN = 0

hip.SEGIP = 0, hip.VSEIP = 0

1

Following tests are done in VS-mode

cp_hideleg_hip_vs

Set up 2^3 combinations of hideleg, 2^3 combinations of hip, hie = 0x444. Change to VS-mode with vsstatus.SIE = 1

Take highest priority interrupt to HS or VS. VS shifts to SEI/STI/SSI.

8 * 8

cp_hideleg_hie_vs

Set up 2^3 combinations of hideleg, 2^3 combinations of hie, hip = 0x444. Change to VS-mode with vsstatus.SIE = 1

Take highest priority interrupt to HS or VS. VS shifts to SEI/STI/SSI.

8 * 8

cp_hip_hie_vs

Set up 2^3 combinations of hip, 2^3 combinations of hie, hideleg = 0x444. Change to VS-mode with vsstatus.SIE = 1

Take highest priority interrupt to HS or VS. VS shifts to SEI/STI/SSI.

8 * 8

cp_sie_vs

hideleg = hip = hie = 0x444. Change to VS-mode with vsstatus.SIE = {0/1}

Take SEI if SIE=1

2

cp_mideleg_mip_vs

With mstatus.MIE=0, mideleg = {0/1s}, mip = {MEIP/MTIP/MSIP/SEI/STI/SSI}, mie = 1s, change to VS-mode with vsstatus.SIE=1

Take interrupt to M or HS

2 * 6

cp_mtinst

mtinst = 0 on interrupt

with mtinst randomized, mideleg = 0, exercise each interrupt.

mtinst = 0

10 interrupts

cp_htinst

htinst = 0 on interrupt

with htinst randomized, mideleg = 1, hideleg = 0 exercise each interrupt.

htinst = 0

10 interrupts

Following tests are done in VU-mode

cp_hideleg_hip_vu

Set up 2^3 combinations of hideleg, 2^3 combinations of hip, hie = 0x444. Change to VU-mode.

Take highest priority interrupt to HS or VS. VS shifts to SEI/STI/SSI.

8 * 8

cp_hideleg_hie_vu

Set up 2^3 combinations of hideleg, 2^3 combinations of hie, hip = 0x444. Change to VU-mode.

Take highest priority interrupt to HS or VS. VS shifts to SEI/STI/SSI.

8 * 8

cp_hip_hie_vu

Set up 2^3 combinations of hip, 2^3 combinations of hie, hideleg = 0x444. Change to VU-mode.

Take highest priority interrupt to HS or VS. VS shifts to SEI/STI/SSI.

8 * 8

cp_mideleg_mip_vu

With mstatus.MIE=0, mideleg = {0/1s}, mip = {MEIP/MTIP/MSIP/SEI/STI/SSI}, mie = 1s, change to VU-mode

Take interrupt to M or HS

2 * 6

Following tests are done in U-mode

cp_vsint_disabled_u

VS-mode interrupts are globally disabled in U-mode

hideleg = hip = hie = 0x444. Change to U-mode.

Nothing

1

Four hie/hip bits aliased to mie/mip

Generating hip.VSEIP with hvip

Generating hip.VSEIP with hgeip

Generating hip.VSTIP with hivip.vstip

Generating hip.VSTIP with vstimecmp and htimedelta (Sstc supported)

See SstcH

generating hip.VSSIP with hvip.VSSIP

generating hip.VSSIP by writing it directly

priority of interrupts

Generating hip.SGEIP with one or more of hgeip & hgeie

When hideleg is set, hip and hie bit is aliased to vsip and vsie * mideleg required too?

Delegated interrupts replace supervisor interrupts (test both)

Priority of interrupts

Interrupts not taken in higher mode?

Delegated interrupts are read-only zero in sie/sip. Undelegated read-only zero in hip/hie

delegated interrupts are masked at the delegator privilege level

interrupts to S mode take priority over interrupts to lower priv mode

However, interrupts directed to HS-level continue to be indicated in

the HS-level sip register, not in vsip, when V=1.

B.9.5. HV Hypervisor Vector CSRs

Table 283. HV Coverpoints

*[Google Sheet Testplan]

B.9.6. EndianH Hypervisor Endianness

Table 284. EndianH Coverpoints
Coverpoint Goal Feature Description Expectation Bins ID Notes

cp_hstatus_vbe_endianness

endianvs

VSBE

Read from memory in an endian fashion in supervisor mode.

Run test in VS mode. For each endianness given by hstatus.VSBE, sd 0x0102030405060708 to scratch, and also write all subwords with sw, sh, sb. For each endianness (independent), ld, lw, lwu, lh, lhu, lb, lbu it back. In RV32, don’t need the doubles.

restore endianness to normal afterward

Check against RM
To be Done
Uncovered

cp_mstatus_mprv_vsbe_endianness

endianvs

MPRV, MBE, VSBE

Read from memory in an endian fashion based on MBE and VSBE depending on MPRV.

Run test in machine mode. Each endianness is a cross-product of MPRV = 0/1, MPP = 01/11, MPV=0/1, MBE = 0/1, VSBE = 0/1 (32 bins). For each endianness, sd 0x0102030405060708 to scratch, and also write all subwords with sw, sh, sb. For each endianness (independent), ld, lw, lwu, lh, lhu, lb, lbu it back. In RV32, don’t need the doubles.

restore endianness to normal afterward

Check against RM
To be Done
Uncovered

cp_vsstatus_ube_endianness

endianvs

UBE

Read from memory in an endian fashion

Run test in VU mode. For each endianness given in vsstatus.UBE, sd 0x0102030405060708 to scratch, and also write all subwords with sw, sh, sb. For each endianness (independent), ld, lw, lwu, lh, lhu, lb, lbu it back. In RV32, don’t need the doubles.

restore endianness to normal afterward

Check against RM
To be Done
Uncovered

Note: some implementations may make UBE a read-only copy of hstatus.VSBE, or VSBE a read-only copy of sstatus.SBE, or SBE and MBE might not be writable.
Only run Endian tests if fields are writable.

B.9.7. ZicntrH Hypervisor Counters

Table 285. ZicntrH Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule ID Notes

in M mode

cp_mhscounteren_access_mcnt_m
cp_mhscounteren_access_hcnt_m
cp_mhscounteren_access_scnt_m

vscounters

Write walking 1s and 0s to all of mcounteren, hcounteren, scounteren. Read from corresponding counter and counterh in M-mode (should always succeed)

always succeeds

Reading back counter is part of test program but not coverpoint

cp_delta

htimedelta does not affect time in M mode

With htimedelta = {0, 2^30, 2^60, -2^30, -2^60}, read time. In RV32, this also involves htimedeltah and timeh. Note: do not check time directly against reference model, which might tick differently. Only look at the range of values.

0 < time < 2^30 in all circumstances

5

norm:csr:htimedleta:delta

in HS mode

cp_scounteren_access_scnt_hs

vscounters

Write walking 1s and 0s to scounteren with mcounteren = all 1s, hcounteren = all 0s. Read from corresponding counter and counterh in HS-mode (should always succeed)

always succeeds

Reading back counter is part of test program but not coverpoint

cp_delta

htimedelta does not affect time in HS mode

With htimedelta = {0, 2^30, 2^60, -2^30, -2^60}, read time. In RV32, this also involves htimedeltah and timeh. Note: do not check time directly against reference model, which might tick differently. Only look at the range of values.

0 < time < 2^30 in all circumstances

5

in VS mode

cp_mcounteren_access_vs

vscounters

Write walking 1s and 0s to mcounteren with hcounteren = all 1s and scounteren = all 0s. Read from corresponding counter and counterh in VS-mode (should fail when 0)

fails when 0

mcounteren_op

Reading back counter is part of test program but not coverpoint

cp_hcounteren_access_vs

vscounters

Write walking 1s and 0s to hcounteren with mcounteren = all 1s and scounteren = all 0s. Read from corresponding counter and counterh in VS-mode (should fail when 0)

fails when 0

Reading back counter is part of test program but not coverpoint

cp_delta

htimedelta affects time in VS mode

With htimedelta = {0, 2^30, 2^60, -2^30, -2^60}, read time. In RV32, this also involves htimedeltah and timeh. Note: do not check time directly against reference model, which might tick differently. Only look at the range of values.

0: 0 < time < 2^30
2^30: 2^30 < time < 2^60
2^60: 2^60 < time ^ 2^61
-2^30: -2^30 < time < 0
-2^60: -2^60 < time < 2^-59

5

in U mode

cp_scounteren_access_u

vscounters

Write walking 1s and 0s to scounteren with mcounteren = all 1s, hcounteren = all 0s. Read from corresponding counter and counterh in U-mode (should fail when 0)

fails when 0

Reading back counter is part of test program but not coverpoint

cp_delta

htimedelta does not affect time in U mode

With htimedelta = {0, 2^30, 2^60, -2^30, -2^60}, read time. In RV32, this also involves htimedeltah and timeh. Note: do not check time directly against reference model, which might tick differently. Only look at the range of values.

0 < time < 2^30 in all circumstances

5

in VU mode

cp_hcounteren_access_vu

vscounters

Write walking 1s and 0s to hcounteren with mcounteren = scounteren = all 1s. Read from corresponding counter and counterh in VU-mode (should fail when 0)

fails when 0

Reading back counter is part of test program but not coverpoint

cp_scounteren_access_vu

vscounters

Write walking 1s and 0s to scounteren with mcounteren = hcounteren = all 1s. Read from corresponding counter and counterh in VU-mode (should fail when 0)

fails when 0

cp_delta

htimedelta affects time in VU mode

With htimedelta = {0, 2^30, 2^60, -2^30, -2^60}, read time. In RV32, this also involves htimedeltah and timeh. Note: do not check time directly against reference model, which might tick differently. Only look at the range of values.

0: 0 < time < 2^30
2^30: 2^30 < time < 2^60
2^60: 2^60 < time ^ 2^61
-2^30: -2^30 < time < 0
-2^60: -2^60 < time < 2^-59

5

NOTE: xcounteren are WARL and some bits could be read-only zero. Currently, the coverpoints won’t be hit. What should we do about this?

* move everything related to htimedelta from ZicsrH to here

ZicntrH exercises hcounteren for all 32 counters, so no separate ZihpmH suite is needed.

B.9.8. PMPH Hypervisor Physical Memory Protection

Table 286. PMPH Coverpoints
Coverpoint Goal Feature Description Expectation Bins ID Normative Rule

This test plan verifies correct enforcement of PMP in systems implementing the RISC-V Hypervisor extension. It ensures that PMP permissions are applied consistently across all relevant privilege modes (M, HS, VS, and VU), including accesses performed through hypervisor-specific load and store instructions and under one-stage and two-stage address translation.
The test environment assumes a configurable number of writable PMP entries (PMP_writable_regs), typically 16, and tests are parameterized to allow execution on implementations with fewer writable regions. To reduce runtime, tests are executed with PMP_writable_regs = 16 where supported. The lowest-priority writable PMP region (region PMP_writable_regs−1, typically region 15) is always configured as a background region covering the entire physical address space, using NAPOT addressing with RWX permissions and the L bit set, and with the address register programmed to all ones. Functional coverage is written for PMP_writable_regs−1 regions, while tests are executed assuming PMP_writable_regs regions, ensuring full coverage even when the highest region is reserved as background.
Unless otherwise specified, tests execute in M-mode while configuring PMP state, and then transition into HS-mode, VS-mode, or VU-mode to observe PMP enforcement. Standard PMP regions are configured using NAPOT addressing with a size of max(g, 8) bytes, placed beyond the program code and not overlapping other standard regions. A default TOR region is aligned to the PMP grain size g and placed beyond the end of the program, with a size of exactly g. PMP grain size is derived from the platform parameter G, where g = 2^(G+2).
The pmpcfg_i field refers to the 8-bit configuration for region i, located in pmpcfg[i/4] on RV32 or pmpcfg[2*(i/8)] on RV64. Instruction fetch accesses are generated using jal and jalr. Read accesses include {lb, lbu, lh, lhu, lw, lwu, ld}, and write accesses include {sb, sh, sw, sd}. For RV32 systems, instructions lwu, ld, and sd are excluded. Legal PMP permission encodings tested are {000, 001, 011, 100, 101, 110}, with the W=1, R=0 combination treated as reserved and unpredictable.
For tests involving address translation, valid VS-stage and G-stage page tables are configured as required. Proper privilege mode transitions between HS, VS, and VU are explicitly performed to validate correct enforcement in virtualized contexts.
After modifying PMP CSRs, synchronization is performed to ensure consistent behavior. Since PMP permissions are not cached in translation structures, PMP changes are expected to take effect immediately; however, when PMP changes are combined with updates to translation structures, appropriate fencing is used. SFENCE.VMA is issued after VS-stage page table updates, and HFENCE.GVMA with rs1 = x0 and rs2 = x0 is issued after G-stage updates. On systems where satp.MODE is read-only zero, SFENCE.VMA may raise an illegal instruction exception; such traps are expected and may be ignored for test purposes. Memory barriers are used where required to ensure proper ordering of configuration changes relative to memory operations.

cp_pmp_hs_mode_access

Verify PMP applies in HS-mode

HS-mode executes {lw, sw, jalr} to PMP-protected region

Access allowed iff PMP permits on final PA

{R,W,X} × {allow/deny}

pmp_hs_access_v0

norm:pmp_check_priv_modes
norm:pmp_with_paging

cp_pmp_vs_mode_access

Verify PMP applies in VS-mode

Access allowed iff PMP permits on final PA

{R,W,X} × {allow/deny}

pmp_vs_access_v0

norm:pmp_check_priv_modes, norm:pmp_with_paging

cp_pmp_vu_mode_access

Verify PMP applies in VU-mode

VS-mode access via VS-stage or 2-stage translation

Access allowed iff PMP permits on final PA

{R,W,X} × {allow/deny}

pmp_vu_access_v0

norm:pmp_check_priv_modes
norm:pmp_with_paging

cp_pmp_hlv_read

Verify HLV obeys PMP.R

HS-mode executes HLV* into PMP.R=0 region

Load access fault

{HLVB,HLVH,HLVW,HLVD}

pmp_hlv_r_v0

norm:pmp_load_fault, norm:pmp_rwx_check

cp_pmp_hsv_write

Verify HSV obeys PMP.W

HS-mode executes HSV into PMP.W=0 region

Store access fault

{HSV}

pmp_hsv_w_v0

norm:pmp_store_fault

cp_pmp_hlvx_x_only

Ensure HLVX does not bypass X-only PMP

PMP region X=1, R=W=0; HS executes HLVX

Load access fault

{X-only}

pmp_hlvx_xonly_v0

norm:pmp_load_fault, norm:pmp_rwx_check

cp_pmp_hlvx_r_allowed

Verify HLVX works when PMP.R=1

PMP region R=1; HS executes HLVX

Load succeeds

{R=1}

pmp_hlvx_r_v0

norm:pmp_rwx_check

cp_pmp_after_gstage

Verify PMP checked after G-stage

G-stage translation succeeds, PMP denies

Access fault (not page fault)

{allow/deny}

pmp_gstage_order_v0

norm:pmp_with_paging

cp_pmp_after_vsstage

Verify PMP checked after VS-stage

VS-stage translation succeeds, PMP denies

Access fault

{deny}

pmp_vsstage_order_v0

norm:pmp_with_paging

cp_pmp_pf_priority

Verify page fault precedes PMP

VS or G-stage translation fault

Page fault raised

{VS,G}

pmp_pf_prio_v0

norm:pmp_with_paging

cp_pmp_exec_fault_h

PMP exec violation in virtualized mode

VS/HS instruction fetch denied by PMP

Instruction access fault

{HS,VS}

pmp_exec_fault_h_v0

norm:pmp_exec_fault

cp_pmp_precise_trap_h

PMP faults are precise

Faulting instruction does not retire

PC points to faulting insn

{all types}

pmp_precise_v0

norm:pmp_violation_precise_trap

cp_pmp_hfence_translation

HFENCE required only for G-stage

Change hgatp/PT + PMP

Translation changes visible only after HFENCE

{before/after}

pmp_hfence_v0

norm:pmp_with_paging

cp_pmp_block

Check PMP and PMPH enforcement

Execute {hlv*, hsv*, hlvx*} targeting addresses disallowed by PMP/PMPH config

Should raise Load/Store Access Fault

instr × priv_mode × pmp_cfg_case

pmp_twostage_interaction

Verify PMP interaction with two-stage translation

Test Setup: Configure G-stage page tables with various GPA to SPA mappings. Set up PMP regions covering different SPA ranges with varying permissions (R/W/X combinations). Execute memory operations from VS/VU modes that trigger two-stage translation.
Test Execution: 1) Perform loads/stores/fetches from VS-mode with addresses that map through G-stage to SPA addresses covered by different PMP regions. 2) Verify PMP checks occur on final SPA, not intermediate GPA. 3) Test with PMP regions using NAPOT, TOR, and NA4 addressing modes. 4) Use standard regions of max(g,8) bytes for NAPOT configurations. 5) Test with bottom region (PMP_writable_regs-1) configured as background with NAPOT, RWX, L=1, pmpaddr=All_ones. Synchronization: Issue HFENCE.GVMA after PMP configuration changes.

PMP should apply to final supervisor physical addresses regardless of virtualization mode

PMP configurations (R/W/X/A/L) × translation results (success/fail) × privilege modes (HS/VS/VU)

pmp_gstage_pagetable_access

Verify PMP protection of G-stage page tables

Test Setup: Configure PMP regions to selectively protect/allow access to G-stage page table memory locations. Map G-stage page tables at known physical addresses and configure PMP regions to cover these addresses with varying permissions.
Test Execution: 1) Configure PMP to deny read access to L0 G-stage page table memory, attempt VS-mode memory access requiring page table walk. 2) Configure PMP to deny write access to page table locations, attempt operations that would modify G-stage page tables. 3) Test all page table levels (L0/L1/L2/L3) with different PMP protection patterns. 4) Use TOR regions to precisely cover page table boundaries. 5) Test with PMP grain size g considerations for page table alignment. Verification: Confirm appropriate guest page faults or access faults occur when PMP denies page table access.

PMP should protect G-stage page table accesses and cause appropriate faults

PMP settings (deny/allow) × page table access patterns (read/write) × page table levels (L0/L1/L2/L3)

pmp_hypervisor_priority

Verify PMP vs hypervisor exception priority

Test Setup: Create scenarios where both PMP violations and guest page faults can occur simultaneously. Configure G-stage page tables with invalid entries and PMP regions that would also deny access.
Test Execution: 1) Configure invalid G-stage PTE and PMP region denying access to same SPA range, perform memory access from VS-mode. 2) Test priority with different fault combinations: PMP read fault + guest page fault, PMP write fault + guest store page fault, PMP execute fault + guest instruction page fault. 3) Test with different privilege levels (VS vs VU mode) to verify consistent priority ordering. 4) Verify mcause/scause values reflect correct exception priority. Exception Handling: Ensure proper trap delegation configuration to test fault routing.

PMP exceptions should have higher priority than virtualization exceptions

Exception combinations (PMP fault + guest page fault) × access types (read/write/execute) × privilege levels

pmp_gpa_spa_mapping

Verify PMP application to guest physical addresses

Test Setup: Configure G-stage page tables with various GPA to SPA mappings including identity, offset, and scattered mappings. Set up PMP regions covering specific SPA ranges.
Test Execution: 1) Create GPA ranges that map to SPA ranges with different PMP protections. 2) From VS-mode, access GPAs that map to PMP-protected SPAs, verify PMP checks SPA not GPA. 3) Test with overlapping GPA ranges mapping to same SPA region with PMP protection. 4) Test invalid G-stage translation scenarios where PMP should not be reached. 5) Use TOR regions for precise SPA boundary testing. Address Validation: Verify address translation completion before PMP evaluation.

PMP should check supervisor physical addresses, not guest physical addresses

GPA ranges × SPA mappings × PMP rule coverage × translation validity

pmp_atomic_operations

Verify PMP with atomic operations in virtualized environment

Test Setup: Configure atomic memory regions accessible through two-stage translation with various PMP protections. Set up alignment-sensitive test addresses.
Test Execution: 1) Test atomic memory operations (AMO.{ADD,XOR,OR,AND,MIN,MAX,MINU,MAXU}.{W,D}) through two-stage translation to PMP-protected memory.
2) Test load-reserved/store-conditional (LR.{W,D}/SC.{W,D}) sequences with PMP boundaries in HS-mode with G-stage translation enabled.
4) Verify atomic operations fail atomically when PMP denies access.

Atomic Operation will give guest page fault if PTE permissions are violated, else access fault if PMP permissions fail

Atomic operation types (AMO/LR/SC) × PMP permissions × virtualization modes × address alignment

pmp_instruction_fetch

Verify PMP execute permissions with virtualized instruction fetch

Test Setup: Place executable code at various SPA locations with different PMP execute permissions. Configure G-stage translation to map VS-mode code regions to these SPAs.
Test Execution: 1) Execute code from VS-mode where instructions are mapped to SPA with PMP X=1, verify successful execution. 2) Execute code from VS-mode where instructions map to SPA with PMP X=0, verify instruction access fault. 3) Test fetch instructions (jal, jalr) crossing PMP region boundaries. 4) Test with pmpcfg_i.L=1 and various legal XWR combinations focusing on X bit behavior. 5) Place test code in standard regions starting after main program code. Exception Handling: Verify instruction access faults properly trap and provide correct fault addresses.

Execute permissions should be enforced on final physical addresses

Instruction fetch scenarios × execute permissions (granted/denied) × translation stages × privilege transitions

pmp_interrupt_handling

Verify PMP during interrupt/exception handling in virtualized modes

Test Setup: Configure interrupt delegation (mideleg/sideleg) for VS-mode interrupt handling. Set up interrupt handlers at various SPA locations with different PMP protections.
Test Execution: 1) Configure VS-mode interrupt handlers in memory regions with PMP restrictions, test interrupt delivery and handler execution. 2) Test external, timer, and software interrupts with handlers requiring different PMP permissions (R/W/X). 3) Test interrupt handler code crossing PMP region boundaries. 4) Test nested interrupt scenarios with multiple PMP region transitions. 5) Verify interrupt handler memory accesses (stack operations, context save/restore) respect PMP boundaries. Handler Placement: Ensure interrupt handlers are in executable regions with appropriate PMP permissions.

Interrupt handlers should respect PMP boundaries after address translation

Interrupt types (external/timer/software) × handler locations × PMP rule coverage × virtualization modes

pmp_nested_virtualization

Verify PMP with nested virtualization scenarios

Test Setup: Configure nested hypervisor environment (if supported by implementation). Set up multiple levels of address translation with PMP enforcement at appropriate levels.
Test Execution: 1) Test PMP enforcement through multiple levels of address translation (Guest→Host→Physical). 2) Verify PMP applies consistently regardless of virtualization nesting depth. 3) Test privilege mode transitions across nesting levels with PMP enforcement. 4) Test address translation chains with PMP checks at final physical address. 5) Verify exception handling and delegation through nested virtualization with PMP interactions. Nesting Support: Adapt tests based on implementation-specific nested virtualization capabilities.

PMP should apply consistently across all virtualization levels

Nesting levels × PMP configurations × address translation chains × privilege mode combinations

pmp_memory_ordering

Verify memory ordering constraints with PMP in virtualized environment

Test Setup: Configure memory regions with different PMP permissions accessible via two-stage translation. Create memory operation sequences that can test ordering semantics across PMP faults.
Test Execution: 1) Create sequences of memory operations where some operations encounter PMP faults, verify memory ordering preserved for operations before fault. 2) Test acquire/release semantics (fence instructions) with PMP boundaries in virtualized environment. 3) Test memory ordering across PMP region boundaries with mixed cached/uncached regions. 4) Verify speculative execution doesn’t violate PMP permissions or affect memory ordering. 5) Test DMA and other non-CPU memory operations with PMP ordering requirements. Ordering Models: Test both TSO and weak memory ordering implementations where applicable.

Memory ordering should be preserved even when PMP violations occur

Memory operation sequences × PMP fault locations × ordering constraints × virtualization modes

pmp_fault_delegation

Verify fault delegation with PMP in virtualized environment

Test Setup: Configure trap delegation registers (medeleg/sedeleg, hideleg/hedeleg) for various fault types. Set up scenarios where PMP faults can occur in different privilege modes.
Test Execution: 1) Configure PMP faults to be delegated to S-mode, test fault handling from VS-mode PMP violations. 2) Test fault delegation priority between PMP faults and virtualization faults. 3) Test fault information accuracy (mtval/stval/htval) for PMP faults in virtualized environment. 4) Verify correct trap routing based on delegation settings and current privilege mode. 5) Test nested fault scenarios with multiple delegation levels. Fault Information: Verify fault cause codes and addresses correctly reflect PMP vs virtualization fault sources.

PMP faults should be delegated according to virtualization and delegation settings

Fault types × delegation configurations × virtualization modes × trap handling

pmp_edge_cases

Verify PMP edge cases in virtualized environment

Test Setup: Configure PMP regions at critical address boundaries (address space limits, wraparound conditions). Set up two-stage translation with edge case address mappings.
Test Execution: 1) Test PMP regions at maximum physical address boundaries with two-stage translation. 2) Test address wraparound conditions in GPA→SPA mapping with PMP enforcement. 3) Test misaligned PMP regions with grain size restrictions in virtualized environment. 4) Test maximum number of PMP regions (PMP_writable_regs) with overlapping virtualization mappings. 5) Test zero-sized and minimum-sized PMP regions with two-stage address translation. Boundary Testing: Focus on off-by-one conditions and alignment edge cases specific to combined PMP and virtualization.

System should handle edge cases gracefully without undefined behavior

Edge conditions (address boundaries/wrap-around/alignment) × PMP configurations × virtualization states

Test Configuration Notes

hypervisor loads and stores depend on PMP

hlvx does not override PMP execute-only

PMP intgeraction with fences G and VS-stage

General Setup for All Tests:

Use PMP_writable_regs = 16 for test runtime optimization

Configure bottom region (region 15 or PMP_writable_regs-1) as background: pmpcfg_n.A=NAPOT, RWX permissions, pmpcfg_n.L=1, pmpaddr_n=All_ones

Execute in M-mode unless specified otherwise

Standard regions use NAPOT of max(g,8) bytes, placed beyond code without overlapping other standard regions

Default TOR regions aligned to grain size g, starting beyond program end, size g

After PMP CSR writes, issue sfence.vma or hfence.gvma for synchronization

Handle sfence.vma illegal instruction traps on systems with satp.MODE read-only zero

Legal pmpcfg.XWR combinations: {000, 001, 011, 100, 101, 110} (W=1,R=0 is reserved)

Grain size g = 2^(G+2) where G is the PMP grain size parameter

For RV32 systems, exclude lwu, ld, sd instructions from testing

Address Translation Setup:

Configure valid G-stage page tables for two-stage translation testing

Use appropriate VMID and ASID values for TLB management tests

Set up hgatp register for G-stage translation control

Configure proper privilege mode transitions between HS, VS, and VU modes

Synchronization Requirements:

Issue HFENCE.GVMA with rs1=x0, rs2=x0 after PMP changes affecting translation structures

Use appropriate memory barriers for cache coherency testing

Ensure proper ordering of configuration changes relative to memory operations

B.9.9. SvH Hypervisor 2-Stage Virtual Memory

Table 287. SvH Coverpoints
Coverpoint Goal Feature Description Expectation Bins ID Normative Rule Notes

note that BARE-only implementations would likely make whole of satp read only 0

This test plan verifies functional behavior of RISC-V Hypervisor extension features, including memory translation across privilege modes, page fault handling, permission enforcement, and legal instruction execution in virtual environments. It includes both synchronous and asynchronous exception tests, and exercises fields like SPVP, HU, SUM, MPRV, and MXR under a variety of mode settings (M, HS, VS, VU). The plan ensures coverage of MMU, privilege enforcement, access faults, and instruction legality across different translation stages and address spaces.
- All tests must be run with the Hypervisor extension (H) enabled and two-stage translation (vsatp + hgatp) configured where applicable.
- For vsatp tests, hgatp.MODE = Bare. For hgatp tests, vsatp.MODE = Bare.
- Unless explicitly stated, translation and trap delegation should be enabled where needed to observe expected behavior.
- Set privilege bits such as MPRV, MPV, SPVP, SUM, MXR, and VU carefully per test requirement.
- After modifying hgatp, vsatp, or page tables, always execute sfence.vma (and vma.all) to flush stale TLBs.
- Run in VS-mode unless otherwise specified.
Valid Perms means XWRV=1111, A/D = 11 unless otherwise specified. MODE is Sv32 for RV32 or Sv39 for RV64 when exercising virtual memory, unless otherwise specified. Access means Read, Write, and Execute.

cp_vsatp_mode_field

supported/unsupported MODE encodings

RV64 Only:
Test Case: For x = {0…​15} In HS-mode: First write vsatp with {Bare, Sv39}. Then write vsatp.MODE field = {x} and read back.

write to vsatp with an unsupported MODE value is either ignored as it is for satp, or the fields of vsatp are treated as WARL in the normal way.

{16 x} * 2 starting modes

vsatp_mode_unsupported_v0_param

reviewed: y
coverpoint done: ✅ Done

cp_satp_mode_field

supported/unsupported MODE encodings

RV64 Only:
Test Case: For x = {0…​15} In VS-mode: First write satp with {Bare, Sv39}. Then write satp.MODE field = {x} and read back.

write to satp with an unsupported MODE value is ignored, so the old value is preserved

{16 x} * 2 starting modes

vsatp_mode_unsupported_v1

reviewed: y
coverpoint done: ✅ Done

cp_vsatp_ppn_field

programmability of PPN field

Environment: in HS mode, Set vsatp.MODE = Sv32 or Sv39.
Test Case: Write all-zeros, all legal ones, and legal walking-ones to vsatp.PPN.
Note: satp-ppn_sz_param defines # of legal bits

PPN field retains patterns (at least for legal PPNs).

{0s,1s,22 or 44 PPN walknig 1s}

vsatp-ppn_sz_param

reviewed: y
coverpoint done: ✅ Done

cp_vsatp_asidlen_detect

implemented ASID length

Environment: Set vsatp.MODE vsatp.MODE Sv32 or Sv39.
Test Case: Write 1s to all ASID bits, read back to determine implemented ASIDLEN.

Only implemented bits writable; readback equals ASIDLEN.

1

vsatp-asidlen

reviewed: y
coverpoint done: ✅ Done

cp_vsatp_mprv_effects

MPRV effects on address translation

Environment: While in M-mode, set MPRV=1, mstatus.MPP={S,U}, mstatus.MPV=1, vsatp.MODE = Sv32 or Sv39, hgatp.MODE=BARE, satp.MODE=BARE, page table with no read/write permission.
Test Case: Do load/store from M-mode. Instruction fetches unaffected, only data accesses translated (and throwing page fault).

Data accesses translated via VS page tables, causing fault; instructions bypass and don’t fault.

{read,write} × {MPP=S,U}

mstatus_mprv_hypervisor, add tag to machine.adoc Instruction address-translation and protection are unaffected by the
setting of MPRV.

reviewed: y
coverpoint done: ✅ Done

cp_vsatp_sum_effects

SUM=0 restriction and SUM=1 behavior

Environment: Valid PTE.U=1. Set vsstatus.SUM={0,1}, mode=VS.
Test Case: From VS, do read/write/exec. Test at leaf PTE with valid perms.

Page fault raised for all access types for SUM=0. Read/write succeed; exec raises page fault for SUM=1.

{read,write,exec}x{SUM=0,1}

norm:H_vscsrs_sub, add tag to supervisor instruction.adoc related to status.SUM & PTE.U

reviewed: y
coverpoint done: ✅ Done

vsatp_sum_set

SUM=1 behavior

Environment: Valid PTE.U=1. Set vsstatus.SUM=1, mode=VS.
Test Case: From VS, do read/write/exec. Test at leaf PTE with valid perms.

Read/write succeed; exec raises page fault.

{read,write,exec}

H_vscsrs_sub, add tag to supervisor instruction.adoc related to status.SUM & PTE.U

reviewed: y

cp_vsatp_endianess

SBE endianness

Environment: In VS mode, Set vsatp.MODE={Sv32 or Sv39}. Enable PTE perms.
Test Case: Set hstatus.VSBE=0 (little), then hstatus.VSBE=1 (big). Do load/store.
Notes: Ensure SFENCE.VMA after endian change.

RW succeeds; endian swap affects data ordering.

{SBE=0,SBE=1} × {read,write}

hstatus-vsbe_op

reviewed: y
coverpoint done: ✅ Done

cp_vsatp_pte_rsw

reserved RSW bits ignored

Environment: Construct valid PTE with RSW set to {00,01,10,11}.
Test Case: Write/read PTE.

RSW reads as written

{00,01,10,11}

H_vscsrs_sub, add tag to the supervisor instruction.adoc related to RSW set of PTE

reviewed: y
coverpoint done: ✅ Done

cp_vsatp_invalid_pte

invalid PTE behavior

Environment: PTE.V=0, vsatp.MODE={Sv32 orSv39}.
Test Case: Try read/write/exec VA.

Page fault on all access types.

{read,write,exec}

H_vscsrs_sub, add tag to the supervisor instruction.adoc related to PTE.V

reviewed: y
coverpoint done: ✅ Done

cp_vsatp_nonleaf_lvl0

non-leaf L0 PTE fault

Environment: PTE at L0 with RWX=0.
Test Case: read/write/exec VA.

Page fault.

{read,write,exec}

H_vscsrs_sub, add tag to the supervisor instruction.adoc related to non-leaf L0 PTE

reviewed: y
coverpoint done: ✅ Done

cp_vsatp_spages_sum

RWX on VS-mode pages, vsstaus.SUM=0

Environment: PTE.U=0. vsstatus.SUM=0. RWX = {001, 011, 100, 101, 111} vsatp.MODE={Sv32 orSv39}
Test Case: Do RWX accesses.

Allowed if perms; else page fault.

{read,write,exec} * 5 RWX

H_vscsrs_sub, add tag to supervisor instruction.adoc related to status.SUM & PTE.U

reviewed: y
coverpoint done: ✅ Done

cp_vsstatus_mxr_sum

MXR=0 on exec-only page

Environment: RWX = {001, 111} PTE.U = {0/1}. vsatp.MODE={Sv32 or Sv39}.
Test Case: Do {read, write, exec} in {VS, VU}-mode with vsstatus.MXR={0,1}, vsstatus.SUM={0,1}

Depends on case

{read, write, exec} * 2 RWX * 2 U * 2 SUM * 2 MXR * 2 modes

vsstatus-mxr_vm

vsstatus_mxr_vm

reviewed: y
coverpoint done: ✅ Done

cp_vsatp_svpbmt

SVpbmt extension

Environment: If RV64 & !SVPBMT_SUPPORTED, PTE[62:61] = {0…​3}
Test Case: Access page

Page fault if nonzero, else normal.

{read,write,exec} * 4 PTE[62:61]

reviewed: y
coverpoint done: ✅ Done

cp_vsatp_reserved_fields

reserved PTE bits

Environment: RV64 & PTE[60:54]: Walking 1s, all 1s, all 0s
Test Case: Access page

Page fault if nonzero, else normal.

{read,write,exec} * 9 values

H_vscsrs_sub, add tag to the supervisor instruction.adoc related to RSW set of PTE

reviewed: y
coverpoint done: ✅ Done

cp_hgatp_mode_field

supported/unsupported MODE encodings for hgatp

"RV64 Only:
Test Case: For x = {0…​15} In HS-mode: First write hgatp with {Bare, Sv39x4}. Then write hgatp.MODE field = {x} and read back. "

Supported MODEs accepted and retained; unsupported encodings get WARL handling (fields may be masked/unchanged).

2^4

hgatp-mode_warl

reviewed: y
coverpoint done: ✅ Done

cp_hgatp_ppn_field

programmability of PPN in hgatp

Environment: hgatp.MODE != Sv39x4 or Sv32x4.
Test Case: Write patterns (all-0, all-1, walking-1) to hgatp.PPN, read back. For paged modes lowest two PPN bits read zero; root must be 16KiB-aligned for Sv*x4 modes.

PPN retains written pattern within WARL constraints; PPN[1:0]=0 in paged modes.

2 + 44 (RV64) or
2 + 22 (RV64)

hgatp-ppn_op

reviewed: y
coverpoint done: ✅ Done

cp_hgatp_vmidlen_detect

implemented VMIDLEN via hgatp.VMID

Environment: Set hgatp.MODE Sv32x4 or Sv39x4.
Test Case: Write 1s to all VMID bits.

Only implemented bits writable

{RV32: 7, RV64:14}

hgatp-vmid_param

reviewed: y
coverpoint done: ✅ Done

cp_hgatp_tvm_effects

TVM gating on hgatp

Environment: Set mstatus.TVM={0,1} in HS.
Test Case: Attempt to write hgatp.

Access to hgatp from HS cause illegal-instruction trap when TVM=1.

{TVM=0,1}

hgatp_tvm_illegal

reviewed: y
coverpoint done: ✅ Done

cp_hgatp_mprv_effects

MPRV behavior when G-stage present

Environment: While in M-mode, set MPRV={0/1}, mstatus.MPP/MPV={M, HS, VS, U, VU}, hgatp.MODE = Sv32x4 or Sv39x4, identity page table with no read/write permission.
Test Case: Perform loads/stores and hypervisor load/store that should be translated by G-stage when MPV=1 & MPP in {S,U}. Notes: MPRV affects explicit memory accesses; HLV/HSV unaffected.

When MPRV=1 and MPV=1, data accesses via basic load/store instructions translated via HS page tables, causing fault; instructions bypass and don’t fault, HLV/HSV don’t fault. When MPRV=0 or MPV=0, no faults.

2 MPRV x 5 MPP/MPV x {lw,sw, hlv.w, hsv.w}

mstatus_mprv_hypervisor

reviewed: y
coverpoint done: ✅ Done

cp_hgatp_gpa_width_checks

guest-physical address width limits

RV64 Only
Environment: In VS-mode, For each supported hgatp.MODE in {Sv39x4, Sv48x4, Sv57x4}, set up G-stage PTEs with walking 1s in GPA[63:37]. Then VS-stage kilopage PTE translates to some arbitrary valid address if possible.
Test Case: Attempt accesses that require translating those GPAs. For Sv39x4 etc, ensure top bits canonicality rules apply to GPA.

Sv39x4: guest page fault if GPA bits 63:41 are nonzero.
Sv48x4: guest page fault if GPA bits 63:50 are nonzero.
Sv57x4: guest page fault if GPA bits 63:50 are nonzero

up to 3 modes x (63-37) bits GPA

H_vm_gpatrans

reviewed: y

cp_hgatp_perm_checks

G-stage permissions enforcement

Environment: Create G-stage PTEs with URWX = {0111, 1111, 0000, 1000}.
Test Case: From guest (VS/VU) perform accesses where VS-stage allows but G-stage denies. Access allowed only if both VS and G stage permit.

Access blocked if G-stage denies; guest page fault raised with appropriate cause.

2 modes * 4 URWX combinations

H_vm_gpatrans

reviewed: y
coverpoint done: ✅ Done

cp_hgatp_pte_g_bit

PTE.G bit is reserved in G-stage PTEs

Environment: Set G-stage PTE.G i(bit not used by Sv*x4).
Test Case: Access GPA mapped by this PTE. It must be ignored by hardware..

Normal.

{read,write,exec}

H_vm_gpa_g

reviewed: y
coverpoint done: ✅ Done

cp_hgatp_svpbmt

Svpbmt extension in G-stage

Environment: If RV64 & !SVPBMT_SUPPORTED, G-stage PTE[62:61] = {0…​3}
Test Case: Access page

Guest page fault if nonzero, else normal.

{read,write,exec} * 4 PTE[62:61]

* US add rule

reviewed: y
coverpoint done: ✅ Done

cp_hgatp_reserved_fields

reserved PTE bits in G-stage

Environment: RV64 & G-stage PTE[60:54]: Walking 1s, all 1s, all 0s
Test Case: Access page

Guest page fault if nonzero, else normal.

{read,write,exec} * 9 values

H_vm_gpatrans, add tag to the supervisor instruction.ado related to PTE.RSV bits

reviewed: y
coverpoint done: ✅ Done

cp_hgatp_pte_rsw

reserved RSW bits ignored

Environment: Construct valid G-stage PTE with RSW set to {00,01,10,11}.
Test Case: Access page

Normal.

{read,write,exec} * 4 PTE[9:8]

H_vm_gpatrans, add tag to the supervisor instruction.adoc related to RSW set of PTE

reviewed: y
coverpoint done: ✅ Done

cp_hgatp_invalid_pte

invalid PTE behavior

Environment: G-stage PTE.V=0, hgatp.MODE={Sv32x4 or Sv39x4}.
Test Case: Try read/write/exec VA.

Guest page fault on all access types.

{read,write,exec}

H_vm_gpatrans, add tag to the supervisor instruction.adoc related to PTE.V

reviewed: y
coverpoint done: ✅ Done

cp_hgatp_nonleaf_lvl0

non-leaf L0 PTE fault

Environment: PTE at L0 with RWX=0.
Test Case: read/write/exec VA.

Guest page fault.

{read,write,exec}

H_vm_gpatrans, add tag to the supervisor instruction.adoc related to non-leaf L0 PTE

reviewed: y
coverpoint done: ✅ Done

hgatp_misaligned_superpage

misaligned superpage detection in G-stage

Environment: Create G-stage superpage PTE with PPN low bits != 0 at given level.
Test Case: Access mapped GPA.

Page fault raised for misaligned superpage.

{level-specific tests per mode}

H_vm_gpatrans, add tag to the supervisor instruction.adoc related to misaligned superpage

reviewed: y

cp_hgatp_vmid_scoping

implemented VMID length

Environment: Set hgatp.MODE to Sv32 or Sv39.
Test Case: Write 1s to all VMID bits, read back to determine implemented VMIDLEN.

Only implemented bits writable; readback equals VMIDLEN.

1

hgatp-vmid_param

reviewed: y
coverpoint done: ✅ Done

hgatp_root_table_alignment_and_size

Validate root page table expansion and alignment for G-stage translation in Sv{32,39,48,57}x4 modes

Environment: Set hgatp.MODE = {Sv32x4 or Sv39x4}. Configure G-stage root page table at both {4 KiB-,16 KiB-}aligned addresses.
Test Case: Attempt to set hgatp.PPN such that root page table is only {4 KiB, 16KiB} aligned. Perform guest address translation to trigger G-stage walk.

When root page table is not 16 KiB aligned, translation fails with guest page fault.

{mode = 1 for HXLEN=32, 3 for HXLEN=64} × {4KiB aligned, 16 KiB aligned}

hgatp-mode_x4, hgatp-mode_sv32x4, hgatp-mode_sv39x4, hgatp-mode_sv48x4, hgatp-mode_sv57x4

reviewed: y

cp_hgatp_u_mode_access

Verify that all G-stage memory accesses are treated as U-mode accesses, including those made from VS-mode

Environment: In HS-mode, Configure G-stage page tables, Mark a G-stage PTE with U=0 (not user-accessible). Set vsatp=BARE.
Test Case: From VS-mode, makel access (e.g., load, store, and instruction fetch) that requires walking through this G-stage page table.

Since G-stage accesses are treated as U-mode, a guest-page fault should occur due to lack of user access permission, even though access was from VS-mode.

{access_type = inst_fetch, load, store} × {U-bit = 0, 1}

H_vm_gpapriv

reviewed: y
coverpoint done: ✅ Done

cp_hgatp_adbit_behavior

Verify that A/D bits in G-stage PTEs are updated for implicit page table accesses (not the original access type)

Environment: Configure a G-stage PTE with A=0, D=0. Configure VS-stage PTE with A=D={00, 11}. Do a sfence.vma to clear the TLB.
Test Case: Trigger a VS-stage page table walk (load/store/fetch) so that the hardware implicitly performs memory accesses using that G-stage PTE to read VS-level PTEs.

If Svade is supported and menvcfg.adue = 1, then the G-stage PTE should set A=1 because it is implicitly accessed. If the VS-stage PTE had A=D=00, then those bits are set to 1, which causes an implicit write, which sets D=1 in the G-stage PTE.
If Svade is not supported, then a {load/store/fetch} guest page fault occurs to update the G-stage PTE A/D bits. The type of fault depends on the original access. If VS-stage AD=00, there is also a regular page fault to update the VS-stage PTE A/D bits.

{implicit_access = read, write} × {A/D bits before/after}

H_vm_gpapriv

reviewed: y
coverpoint done: ✅ Done

hgatp_exception_reporting

Verify that G-stage page faults are reported with respect to the original access type

Environment: Configure G-stage PTEs to deny R/W/X permissions. Perform VS-stage instruction fetch, load, and store operations that trigger G-stage translation faults.
Test Case: Monitor the trap cause reported to HS-mode.

Even though all G-stage accesses are treated as U-mode, the trap cause (e.g., instruction guest page fault, load guest page fault, store/AMO guest page fault) must match the original access type.

{access_type = inst_fetch, load, store} × {permission_fault}

H_vm_gpapriv

cp_vsatp_perm_checks

VS-stage permissions enforcement

Environment: Create VS-stage PTEs with URWX = {0111, 1111, 0000, 1000}.
Test Case: From guest (VS/VU) perform accesses where G-stage allows but VS-stage denies. Access allowed only if both VS and G stage permit.

Access blocked if VS-stage denies; page fault raised with appropriate cause.

2 modes * 4 URWX combinations

reviewed: y
coverpoint done: ✅ Done

two_stage_read

Verify two-stage read translation (GVA to GPA to SPA) across all page sizes

Environment: In M-mode, initialize a known pattern in memory at a physical address (PA). Configure vsatp.MODE = {Sv32 or Sv39} with a non-identity VS page table mapping guest virtual addresses (GVAs) to guest physical addresses (GPAs), Configure hgatp.MODE = {Sv32x4 or Sv39x4} with a non-identity G-stage page table mapping GPAs to system physical addresses (SPAs). Ensure all PTEs are valid, readable. G stage accessible in U-mode and VS-stage accessible in S-mode.
Test Case: Switch to VS-mode. Perform naturally aligned reads from GVAs that traverses both VS and G stages. Repeat for each supported page size ({4 KiB, 2 MiB, 1 GiB} or equivalent in Sv32/Sv39).

The read value at GVA in VS-mode must match the initialized PA value in M-mode after GVA→GPA→SPA translation. No page faults or access faults should occur.

3 VS-stage pages sizes x 3 G-stage page sizes

hgatp-mode_x4, hgatp-mode_sv32x4, hgatp-mode_sv39x4, hgatp-mode_sv48x4, hgatp-mode_sv57x4

two_stage_write

Verify two-stage write translation and data propagation through both stages

Environment: Same VS and G-stage mappings as the read test. Ensure G-stage and VS-stage PTEs are writable. G stage accessible in U-mode and VS-stage accessible in S-mode.
Test Case: In VS-mode, perform a store to a GVA mapped through both stages. Switch to M-mode and directly read from the corresponding PA (or SPA) to check for data integrity. Repeat for different page sizes ({4 KiB, 2 MiB, 1 GiB}).

The data written in VS-mode must be visible when read from the same SPA in M-mode. No faults or misaligned accesses should occur.

3 VS-stage pages sizes x 3 G-stage page sizes

hgatp-mode_x4, hgatp-mode_sv32x4, hgatp-mode_sv39x4, hgatp-mode_sv48x4, hgatp-mode_sv57x4

two_stage_ifetch

Verify instruction fetch through two-stage translation (GVA, GPA, SPA) and interplay with MXR and X-permissions

Environment: Setup executable code region at a known PA. Configure VS-stage page table with executable PTE mapping GVA to GPA. Configure G-stage page table mapping GPA to SPA with executable permission. Also create variations where VS or G-stage PTEs have only R=1, X=0 to test MXR behavior. G stage accessible in U-mode and VS-stage accessible in S-mode. Repeat for different page sizes.
Test Case: Jump to the GVA and execute an instruction. Repeat with MXR=0 and MXR=1 in {mstatus,hstatus}. Observe whether instruction fetches succeed or fault based on combined permissions.

Instruction fetch should succeed only when both VS and G-stage PTEs permit execute or when MXR allows read-as-execute. If either stage denies execute, a guest instruction page fault should occur.

3 VS-satge page sizes x 3 G-stage page sizes x (1 executable + 2 mstatus.MXR x 2 hstatus.MXR) x (2 VS-stage X vs R) x (2 G-stage X vs R) = 180

hgatp-mode_x4, hgatp-mode_sv32x4, hgatp-mode_sv39x4, hgatp-mode_sv48x4, hgatp-mode_sv57x4

stage_both_bare

Validate direct VA to SPA mapping when both stages are Bare

Environment: Set vsatp.MODE = Bare and hgatp.MODE = Bare. Disable all address translation stages.
Test Case: Access arbitrary virtual addresses (GVAs). Compare the physical address used by memory access (SPA) with the original VA.

VA must be treated as SPA directly with no translation applied. No page walks or faults must occur.

{vsatp.MODE = Bare, hgatp.MODE = Bare}

hgatp-mode_x4, hgatp-mode_sv32x4, hgatp-mode_sv39x4, hgatp-mode_sv48x4, hgatp-mode_sv57x4

*

With virtualization enabled and two-stage translation active (hgatp.MODE = Sv32x4/Sv39x4), current privilege is {HS/VS/U/VU}. Suitable VS and G-Stage page tables with all combinations of {RWX = 111/000 and U = 1/0}. Perform read, write, execute.

*

3 Access types * 4 priv modes * 2 SUM x 4 VS permissions x 4 G permissions = 384

mprv_sum_effect_hs_two_stage

effect of mstatus.MPRV with MPP=HS on accesses to user pages (two-stage on)

With virtualization enabled and two-stage translation active (hgatp.MODE = Sv32x4/Sv39x4), set mstatus.MPRV=1, mstatus.{MPP,MPV}={M, HS, VS, U, VU}, current privilege is M. Suitable VS and G-Stage page tables with all combinations of {RWX = 111/000 and U = 1/0}. Perform read, write, execute.

For data accesses: when sstatus.SUM=0, HS data access to a U page must fault with page fault of the corresponding type (load page fault for load; store/AMO page fault for store). When sstatus.SUM=1, data access succeeds subject to normal PTE permissions. Instruction fetch is unaffected by MPRV/SUM (fetch uses current mode translation); executing test code does not require setting guest code PTEs. Trap PC (mepc) points to faulting instruction; cause (mcause) matches access type. ***update

3 Access type × 5 MPP/MPV × 2 SUM × 4 VS permissions x 4 G-stage permissions = 480

H_vm_gpatrans

VM_permission_invalid

that invalid permission in a guest PTE (pte.V=0) during 2-stage translation triggers correct page fault exceptions for instruction fetch, load, and store/AMO accesses across privilege modes.* update

With two-stage transnslation active, in each of {HS, VS, U, VU}, with each pages size {kilo/mega/giga} in VS and G stages, with leaf page V={0/1} in each stage, perform {read/write/execute}.

The following guest page faults must be raised depending on access type: - Instruction page fault for execute. - Load page fault for read. - Store/AMO page fault for write. Trap information: mtval must contain the faulting guest virtual address; scause must report the correct exception cause. ***update

4 Privilege Mode × 3 Access Type × 2 HS-stage valid x 2 VS-stage valid x 3 VS page sizes x 3 G page sizes = 432

H_vm_gpatrans

RWX access on Umode pages in Umode

RWX access permissions when U=1 in user mode across both guest (Stage-1) and host (Stage-2) translations.

Stage-1 (Guest PTEs):• If PTE.U=1, user mode can access the page.• Access type must match granted permissions (R, W, X).• If disallowed, raise a Stage-1 page fault:– Instruction page fault (exec)– Load page fault (read)– Store/AMO page fault (write).• Valid for leaf PTEs at all levels (L0–L3 depending on satp.mode).• Test with both granted and denied RWX combinations.
Stage-2 (Host PTEs for Guest Physical → Host Physical):• Even if Stage-1 grants permission, Stage-2 translation must also allow RWX access.• Stage-2 applies permission checks independently (e.g., R/W/X bits in VS-level PTE).• If Stage-2 denies, trap must occur even if Stage-1 allows.• Test at all levels with valid leaf PTE, ensuring PTE.U in guest context is honored only if Stage-2 permits corresponding access.• Both Stage-1 and Stage-2 faults are possible.

• Access succeeds if Stage-1 PTE grants permission and the U=1 condition matches user mode.• Faults raised if permission bit is 0.• m/scause = page fault exception according to access type.• m/sepc = virtual address of trapping instruction.
• Even if Stage-1 succeeds, access only completes if Stage-2 allows.• If Stage-2 denies, fault occurs with exception type tied to access (instruction/load/store page fault).• Serves as an extra permission filter on top of Stage-1.

RWX bins (for each stage):1. Read allowed (R=1), denied (R=0).2. Write allowed (W=1 & R=1), denied (W=0).3. Exec allowed (X=1), denied (X=0).4. Combinations where Stage-1 allows but Stage-2 denies (mismatched permissions).5. Different satp.modes (sv32, sv39, sv48, sv57).6. Faults at leaf level with higher levels cleared except V=1.

PTE with only X=1 and MXR=0, VS-stage, HS-mode

enforcement of MXR=0 across all relevant privilege modes.

Verifies that supervisor attempts to read from execute-only page cause load page fault at VS-stage translation
- satp.mode = sv32, sv39 - Valid leaf PTE (R=0, W=0, X=1) - s/mstatus.MXR=0 - PMP permissions allow access if enabled
Test Case: Attempt read access in HS mode - For leaf PTEs at all levels - Set higher-level PTEs to only V=1 so resolution reaches target leaf

Load page fault must be raised m/scause = Load Page Fault m/sepc = faulting VA instruction

PTE with only X=1 and MXR=0, VS-stage, VS-mode

fault is correctly raised at all valid page table levels.

Verifies same behavior when VS-mode accesses VS-stage translation
Same as above, but s/mstatus.MXR=0 applies for VS mode
Test Case: Attempt read access in VS mode with PTE: R=0, W=0, X=1 Set PTE.U=1 to allow user mapping under VS

Load page fault expected at VS-stage Trap visible in HS as virtual instruction trap

Execute-only PTE read access with MXR=0, VU-stage, VS-mode

Ensure exception behavior is consistent across all supported virtual memory configurations.

Ensures guest user access follows VS-stage semantics
Same test setup as above
Test Case: In VU mode, attempt read access on execute-only mapping

Load page fault raised at VS-stage Propagates to HS

Read (should fault)
Execute (should succeed, no trap)

Second stage translation of GPA with execute-only mapping and MXR=0, HS-mode, G-stage

Confirm that read attempts raise an exception while execute works fine.

Ensures G-stage honors MXR restrictions when translating GPAs for HS-mode
- hgatp.mode = sv32x4, sv39x4 - Leaf G-stage PTE with R=0, W=0, X=1 - hstatus.MXR=0
HS attempts to read GPA mapped execute-only

Load page fault raised at G-stage Trap in HS with correct mcause

PTE.U=0 with access from Supervisor/HS/VS
PTE.U=1 with access from U/VU

* hgatp misaligned super pages and 16KB (US)

* tests exercising successful translation with any bits of the GPA (including 33:32 for Sv32x4)

* need some tests involving translation through both G and VS-stage

* tests with cross-product of either G or VS denying

* add cases exercising SV48 and SV57

* add case of access from M-mode with MPRV=0 doing no translation

B.9.10. SvHZicbo Hypervisor VirtMem + Cache Block Operations

  • also includes hypervisor instructions, CSRs related to hypervisor

Table 288. SvHZicbo Coverpoints
Coverpoint Goal Feature Description Expectation Bins

Be sure hgatp WARL fields are exercised in VM tests.

vs_invalid_pte_cbo

Verify CBO faulting when VS-stage PTE.V=0

Environment: vsatp.mode={Sv32,Sv39,Sv48,Sv57}, PMP permits SPA.
Test Case: Set PTE.V=0, PTE.R=1, PTE.W=1. Execute CBO from VS and VU.

Store/AMO page fault at VS-stage.

satp.mode × {VS,VU}

g_invalid_pte_cbo

Verify CBO faulting when G-stage PTE.V=0

Environment: Valid VS mapping, invalid G PTE.V=0.
Test Case: Issue CBO to GVA.

Store/AMO page fault at G-stage.

hgatp.mode × {VS,VU}

reserved_rwx_vs

Detect reserved RWX encoding at VS-stage

Env: Leaf PTE with W=1,R=0.
Test Case: Execute CBO on GVA.

Page fault at VS-stage.

{VS,VU} × Levels

reserved_rwx_g

Detect reserved RWX encoding at G-stage

Env: Leaf G PTE with W=1,R=0.
Test Case: Execute CBO on GVA.

Page fault at G-stage.

{VS,VU} × Levels

nonleaf_vs

Detect CBO on VS non-leaf PTE at L0

Env: Level0 PTE with RWX=0.
Test Case: Execute CBO.

Page fault.

{VS,VU} × satp.mode

nonleaf_g

Detect CBO on G non-leaf PTE at L0

Env: G-stage level0 PTE with RWX=0.
Test Case: Execute CBO.

Page fault.

{VS,VU} × hgatp.mode

sum_effect_vs

Verify SUM effects in VS-stage

Env: PTE.U=1, SUM={0,1}.
Test Case: Issue CBO in VS-mode.

SUM=0 → page fault; SUM=1 → no fault.

SUM={0,1}

hu_effect_cbo

Verify hstatus.HU allows U-mode CBO

Env: hstatus.HU={0,1}.
Test Case: From U-mode issue CBO.

HU=1 → CBO permitted; HU=0 → illegal.

HU={0,1}

vs_access_bit

Verify PTE.A handling in VS-stage for CBO

Env: Leaf VS PTE.A=0. sfence.vma before.
Test Case: Execute CBO.

Page fault if Svade implemented.

{VS,VU} × satp.mode

g_access_bit

Verify PTE.A handling in G-stage for CBO

Env: Leaf G PTE.A=0.
Test Case: Execute CBO.

Page fault if Svade implemented.

hgatp.mode

vs_dirty_bit

Verify PTE.D handling in VS-stage for CBO

Env: Leaf VS PTE.D=0.
Test Case: Execute CBO.

No fault; CBO succeeds.

{VS,VU}

g_dirty_bit

Verify PTE.D handling in G-stage for CBO

Env: Leaf G PTE.D=0.
Test Case: Execute CBO.

No fault; CBO succeeds.

hgatp.mode

misaligned_superpage_vs

Detect misaligned VS superpage with CBO

Env: Leaf VS PTE with misaligned PPN.
Test Case: Execute CBO.

Page fault.

{levels L1–L4}

misaligned_superpage_g

Detect misaligned G superpage with CBO

Env: Leaf G PTE with misaligned PPN.
Test Case: Execute CBO.

Page fault.

{levels L1–L4}

leaf_invalid_pa_vs

Detect invalid PA in VS PTE

Env: VS leaf points to non-existent GPA.
Test Case: Execute CBO.

Store access fault.

{VS,VU}

leaf_invalid_pa_g

Detect invalid PA in G PTE

Env: G leaf points to non-existent SPA.
Test Case: Execute CBO.

Store access fault.

hgatp.mode

nonleaf_invalid_pa_vs

Detect invalid PA in VS non-leaf

Env: Non-leaf VS PTE invalid pointer.
Test Case: Execute CBO.

Store access fault.

satp.mode

nonleaf_invalid_pa_g

Detect invalid PA in G non-leaf

Env: Non-leaf G PTE invalid pointer.
Test Case: Execute CBO.

Store access fault.

hgatp.mode

dau_bits_vs

Verify DAU bits set in VS non-leaf PTE

Env: Non-leaf VS PTE with D/A/U set.
Test Case: Execute CBO.

Store/AMO page fault.

{D,A,U}

dau_bits_g

Verify DAU bits set in G non-leaf PTE

Env: Non-leaf G PTE with D/A/U set.
Test Case: Execute CBO.

Store/AMO page fault.

{D,A,U}

aliasing_vs_g

Check aliasing across 2-stage

Env: Map two GVAs to same SPA via VS+G.
Test Case: CBO on GVA1, probe via GVA2.

Both aliases affected.

{cbo.clean,cbo.flush,cbo.inval}

hfence_interaction

Verify HFENCE with CBO

Env: Modify VS/G tables; omit/insert HFENCE.VVMA/GVMA.
Test Case: Issue CBO post-modification.

Without HFENCE, stale ops; with HFENCE, correct.

{with fence, without fence}

vmid_reuse_cbo

Check VMID reuse without flush

Env: Run CBO under VMID1, reuse VMID for new mappings.
Test Case: Probe caches.

Without HFENCE, stale; with HFENCE, correct.

{reuse, fresh}

pmp_deny_spa

PMP denies SPA for CBO

Env: GPA valid, but PMP denies SPA.
Test Case: Execute CBO.

Store access fault.

PMP deny bit

B.9.11. Shcounterenw Writable Counter Enables

Table 289. Shcounterenw Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule

Following tests are done in HS-mode

cp_shcounterenw

which hcounteren bits are writable

Write a 0 and a -1 to hcounteren.

0 writes 32 bits of 0
-1 writes 1s to every bit with a non-read-only-zero hpmcounter, matching ref model

2

Shcounterenw_hpmcounter_hcounteren

check that hcounteren works with mcounteren and scounteren to control access to counters from lower privilege modes.

B.9.12. Shvsatpa Virtual Memory Modes Supported

Table 290. Shvsatpa Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule

Following tests are done in M-mode

cp_shvsatpa

Check all values writable to vsatp.mode

RV32: write vsatp.mode = 0/1
RV64: write vsatp.mode = 0, 8, 9, 10

Matches reference model, which should accept same values as satp.mode

2 or 4

Shvsatpa_satp_vsatp_modes

B.9.13. Shgatpa Virtual Memory x4 Modes Supported

Table 291. Shgatpa Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule

Following tests are done in M-mode

cp_shgatpa

Check all values writable to hgatp.mode

RV32: write hgatp.mode = 0/1
RV64: write hgatp.mode = 0, 8, 9, 10

Matches reference model, which should accept same values as satp.mode

2 or 4

Shgatpa_satp_hgatp_mode_support
Shgatpa_hgatp_bare_mode

B.9.14. Shvstvecd VS-Mode Direct Vectors

Table 292. Shvstvecd Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule

Following tests are done in M-mode

cp_shvstvecd

Check vstvec.MODE can be 0 and when it is, vstvec.base can hold valid 4-byte aligned addresses

Write vstvec = RAM_BASE_ADDR, RAM_BASE_ADDR+4

vstvec gets value written

2

Shvstvecd_vstvec_mode_direct
Shvstvecd_vstvec_base_aligned_address

B.9.15. Shvstvala VS-Mode Trap Address

Following tests are done in from VU-mode and VS-mode into VS-mode

Table 293. Shvstvala Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule Notes

Initialize vstval to some random value before each test

cp_load_page_fault

Fault writes VA to vstval

Load from bad page

vstval written with VA

2

Shvstvala_vstval_written

cp_store_page_fault

Fault writes VA to vstval

Store to bad page

vstval written with VA

2

cp_instr_page_fault

Fault writes VA to vstval

Fetch from bad page

vstval written with VA

2

cp_load_access_fault

Fault writes VA to vstval

Load from ACCESS_FAULT_ADDRESS+4

vstval written with VA

2

don’t use ACCESS_FAULT_ADDR because it is probably 0 and doesn’t prove hvstval is writable

cp_store_access_fault

Fault writes VA to vstval

Store to ACCESS_FAULT_ADDRESS+4

vstval written with VA

2

cp_instr_access_fault

Fault writes VA to vstval

Fetch from ACCESS_FAULT_ADDRESS+4

vstval written with VA

2

cp_misaligned_load

Fault writes VA to vstval

lw from scratch+2

no fault, or vstval written with VA

2

No fault when misaligned load/store supported (e.g. Zicclsm)

cp_misaligned_store

Fault writes VA to vstval

sw to scratch+2. Scratch should be 8 bytes

no fault, or vstval written with VA

2

No fault when misaligned load/store supported (e.g. Zicclsm)

cp_misaligned_instr

Fault writes VA to vstval

fetch ret from scratch+2.

no fault, or vstval written with VA

2

No fault when Zca is supported

cp_virt_instr

Fault writes instr to vstval

Cause virtual instruction fault

vstval written with instr

2

cp_illegal_instr

Fault writes instr to vstval

Cause illegal instruction fault

vstval written with instr

2

Note that debug breakpoint vstval is checked in Sdtrig ***confirm when written

B.9.16. Shtvala HS-Mode Trap Address

Following tests are done in from VU and VS-modes into HS-mode

Table 294. Shtvala Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule

Initialize htval to some random value before each test

cp_load_guest_page_fault

Fault writes GPA >> 2 to htval

Cause load guest-page fault

htval written with GPA

1

Shtvala_htval_faulting_gpa

cp_store_guest_page_fault

Fault writes GPA >> 2 to htval

Cause store guest-page fault

htval written with GPA

1

cp_instr_guest_page_fault

Fault writes GPA >> 2 to htval

Cause fetch guest-page fault

htval written with GPA

1

B.9.17. Shlcofideleg Hypervisor Counter Overflow Delegation

Develop this after baseline overflow delegation tests

B.9.18. ZkrH Hypervisor Entropy Register

Develop this after baseline entropy CSR tests focus on registers being accessible

B.9.19. SstcH Hypervisor Timer Compare

Table 295. SstcH Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule

In M-Mode

cp_vstip

OR of vstimecmp and hvip

Cross of menvcfg.STCE = {0/1}, henvcfg = {0/1}, hvip.VSTIP = {0/1}, htimedelta = 0, vstimecmp = {0, 2^30}. Check hip.VSTIP. For RV32, htimedeltah and vstimecmph = 0. Note that this assumes 0 < time << 2^29 when the test is run.

If both STCE = 1 and vstimecmp = 0, hip.VSTIP = 1. Else hip.VSTIP = hvip.VSTIP.

cp_htimedelta

htimedelta affects vstimecmp

menvcfg.STCE = 1, henvcfg.STCE = 1, hvip.VSTIP = 0, htimedelta = {0, 2^30, 2^60, 2^-30, 2^-60}, vstimecmp = {0, 2^29, 2^31, 2^61, -2^29, -2^31, -2^61}. Check hip.VSTIP. For RV32, htimedletah and vstimecmph are involved.

hip.VSTIP = (htimedelta >= vstimecmp)

cp_m_vstimecmp_accessible

TM and STCE control access depending on priv level

With cross of menvcfg.STCE = {0/1}, henvcfg.STCE = {0/1} mcounteren.TM = {0/1}, hcounteren.TM = {0/1} read vstimecmp. For RV32, also vstimecmph

success

2 mSTCE *2 hSTCE * 2 mTM * 2hTM * up to 2 regs

cp_m_vstimecmp_accesses

All types of access

With cross of menvcfg.STCE = 1, henvcfg.STCE = 0 mcounteren.TM = 0, hcounteren.TM =0, read/write (0s,1s)/set/clear vstimecmp. For RV32, also vstimecmph

success

5 accesses * up to 2 regs

In HS-Mode

cp_walk_vstimecmp

SSTC CSRs accessible

Walking 1s and 0s in vstimecmp. Also vstimecmph for RV32.

Writable

64

cp_hs_vstimecmp_accessible

TM and STCE control access depending on priv level

With cross of menvcfg.STCE = {0/1}, henvcfg.STCE = {0/1} mcounteren.TM = {0/1}, hcounteren.TM = {0/1} read vstimecmp. For RV32, also vstimecmph

illegal instruction if menvcfg.STCE = 0 or mcounteren.TM = 0

2 mSTCE *2 hSTCE * 2 mTM * 2hTM * up to 2 regs

cp_hs_vstimecmp_accesses

All types of access

With cross of menvcfg.STCE = 1, henvcfg.STCE = 0 mcounteren.TM = 1, hcounteren.TM = 0, read/write (0s,1s)/set/clear vstimecmp. For RV32, also vstimecmph

success

5 accesses * up to 2 regs

In VS-Mode

cp_vs_stimecmp_accessible

TM and STCE control access depending on priv level

Put different values in stimecmp and vstimecmp. With cross of menvcfg.STCE = {0/1}, henvcfg.STCE = {0/1} mcounteren.TM = {0/1}, hcounteren.TM = {0/1} read stimecmp (not vstimecmp). For RV32, also stimecmph

trap if menvcfg.STCE = 0 or mcounteren.TM = 0. virtual instruction trap if menvcfg.STCE = mcounteren.TM = 1 but henvcfg.STCE = 0 or hcounteren.TM = 0

2 mSTCE *2 hSTCE * 2 mTM * 2hTM * up to 2 regs

stce_bit_exist

cp_vs_stimecmp_accesses

All types of access

Put random value in stimecmp/h before entering VS-mode. With cross of menvcfg.STCE = 1, henvcfg.STCE = 1 mcounteren.TM = 1, hcounteren.TM = 1, read/write (0s,1s)/set/clear stimecmp. For RV32, also stimecmph. Check from M-mode that these are reflected in vstimecmp/vstimecmph but not stimecmp/h.

Changes should show up in vstimecmp/h

5 accesses * up to 2 regs

cp_vs_vstimecmp_inaccessible

With menvcfg.STCE=1, henvcft.STCE=1, mcounteren.TM = 1, hcounteren.TM = 1, read vstimecmp. For RV32, also vstimecmph

Illegal instruction trap

2

In VU-Mode

cp_vu_timecmp_inaccessible

With menvcfg.STCE=1, henvcfg.STCE=1, mcounteren.TM = 1, hcounteren.TM = 1, read stimecmp, vstimecmp. For RV32, also stimecmph, vstimecmph

Illegal instruction trap

4

In U-Mode

cp_u_timecmp_inaccessible

With menvcfg.STCE=1, henvcft.STCE=1, mcounteren.TM = 1, hcounteren.TM = 1, read stimecmp, vstimecmp. For RV32, also stimecmph, vstimecmph

Illegal instruction trap

4

B.9.20. SsstateenH Hypervisor State Enable

Develop this after baseline state enable tests

B.9.21. SscrindH Hypervisor Indirect CSR Access

Hypervisor indirect CSR access.

Develop this after baseline indirect CSR tests

B.9.22. SscfgH Hypervisor Counter Delegation

Develop this after baseline Sscfg tests

B.9.23. SmctrH Hypervisor Control Transfer Records

Develop this after baseline control transfer record tests

B.9.24. SvinvalH Hypervisor Memory Management Table Invalidation

Table 296. SvinvalH Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule

cr_svinivalH

Svinval instructions trap appropriately.

Test all Svinval instructions { sfence.w.inval, sfence.inval.ir, sinval.vma, hinval.vvma, hinval.gvma} in each privilege mode {M/HS/VS/U/VU} with TVM = {0/1} and VTVM = {0/1}

Instruction executes or throws illegal instruction trap. Doesn’t try to check that anything is actually invalidated.

5 instructions x 5 privilege modes x 2 TVM * 2 VTVM

Svinval_hinval_vvma_gvma
Svinval_hinval_gvma_uses_vmid
Svinval_virtual_instruction_vu_vs
Svinval_virtual_instruction_vtvms
Svinval_sfence_w_inval_inval_vu_mode

B.9.25. SvaduH Hypervisor Hardware Page Table A/D Updates

Table 297. SvaduH Coverpoints
Coverpoint Goal Feature Description Expectation Bins

Develop as part of virtual memory

vsatp_svadu

Verify SVADU

Environment: If unsupported, menvcfg.ADUE must=0.
Test Case: Read ADUE.

Always 0 if not implemented.

—

B.9.26. ZicfilpH Hypervisor Landing Pads

Table 298. ZicfilpH Coverpoints
Coverpoint Goal Feature Description Expectation Bins ID Normative Rule

General Test Environment:
(VS/VU-mode, H-extension)
same base environment as ZicfilpU plus H-extension implemented.
menvcfg.LPE=1 and henvcfg.LPE=1 unless stated otherwise.
VU additionally requires senvcfg.LPE=1.
G-stage translation active (hgatp.MODE != Bare) unless stated otherwise.

cp_elp_state_preservation_zicflip_vs

Verify trap in VS-mode saves and restores previous ELP via vsstatus.VSPELP

Test Environment:
Execute an indirect branch in VS-mode with rs1 != {x1,x5,x7} to set ELP = LP_EXPECTED.
Trigger a trap using ECALL. With virtual supervisor delegation enabled, trap is delivered to VS-mode, updating vsstatus.VSPELP with the previous ELP.

Trap delivered to VS-mode, vsstatus.VSPELP stores previous ELP value, after executing VSRET, ELP is restored to LP_EXPECTED

Origin mode (VS-mode) × Trap target (VS-mode) × ELP state

sstatus-spelp_op

[norm:sstatus-spelp_op]

B.9.27. ZicfissH Hypervisor Shadow Stack

Table 299. ZicfissH Coverpoints
Coverpoint Goal Feature Description Expectation Bins ID Normative Rule

General Test Environment (VS/VU-mode, H-extension):
- Same base environment as ZicfissU plus H-extension implemented.
- menvcfg.SSE=1 and henvcfg.SSE=1 unless stated otherwise. VU additionally requires senvcfg.SSE=1.
- G-stage translation active (hgatp.MODE != Bare) unless stated otherwise.

cp_ssp_csr_gating_virt_zicfiss

Verify ssp CSR accessibility from VS-mode and VU-mode across the henvcfg.SSE / senvcfg.SSE enable chain

With menvcfg.SSE=1, attempt ssp read and write:
from VS-mode for henvcfg.SSE = {0, 1};
from VU-mode for each (henvcfg.SSE, senvcfg.SSE) combination.

Exception flavour depends on WHICH field gates, not merely on V:
menvcfg.SSE=0 → ILLEGAL-instruction exception, even when V=1.
henvcfg.SSE=0 (V=1), or senvcfg.SSE=0 in VU-mode → VIRTUAL-instruction exception.
All required bits set for the mode: access allowed.

mode {VS, VU} x henvcfg.SSE {0,1} x senvcfg.SSE {0,1} x csr_op {read, write} x result {ok, virtual_instruction}

zicfiss_vs_henvcfg_sse zicfiss_vu_senvcfg_sse zicfiss_ssp_csr zicfiss_sse_access

[norm:zicfiss_vs_henvcfg_sse] [norm:zicfiss_vu_senvcfg_sse] [norm:zicfiss_ssp_csr] [norm:zicfiss_sse_access]

cp_ss_page_enc_virt_zicfiss

Verify the pte.xwr=010 encoding is reserved at VS/VU level when henvcfg.SSE=0

With menvcfg.SSE=1 and henvcfg.SSE=0, and V=1, build a VS-stage PTE with R=0, W=1, X=0 and access it from VS-mode and VU-mode. Repeat with henvcfg.SSE=1 as the positive control.

henvcfg.SSE=0: the encoding remains reserved at VS and VU levels — access raises a page-fault.
henvcfg.SSE=1: recognised as a valid SS page.

henvcfg.SSE {0,1} x mode {VS, VU} x access {ss_store, ordinary_load} x result {ok, page_fault}

ssmp_henvcfg_sse

[norm:ssmp_henvcfg_sse]

cp_ss_g_stage_zicfiss

Verify G-stage translation requirements and the guest-page-fault code for SS instructions

With V=1 and G-stage page tables active:
(a) map the shadow stack in the G-stage PTE WITHOUT read-write permission (read-only, and no-permission) and execute each SS memory instruction from VS-mode and VU-mode;
(b) force a guest-page-fault during each SS instruction (unmapped in G-stage);
(c) set vsatp.MODE=Bare and execute each SS instruction.

(a),(b): store/AMO GUEST-page-fault, cause=23 — remapped to the store/AMO flavour regardless of the instruction’s original access type, exactly as cause 7 and 15 are for the non-virtualised cases.
(c): store/AMO access-fault, cause=7 (vsatp.MODE=Bare with effective privilege < M).
ssp unchanged in all faulting cases.

instr {SSPUSH x1, SSPUSH x5, C.SSPUSH x1, SSPOPCHK x1, SSPOPCHK x5, C.SSPOPCHK x5, SSAMOSWAP.W, SSAMOSWAP.D} x mode {VS, VU} x g_stage {no_rw, unmapped, ok} x vsatp.MODE {Bare, Sv} x cause {none, 7, 23}

active_g_stage_pte ss_fault_exception_code satp_mode_bare

[norm:active_g_stage_pte] [norm:ss_fault_exception_code] [norm:satp_mode_bare]

cp_ssamoswap_sse_gating_virt_zicfiss

Verify SSAMOSWAP.W/D raises a VIRTUAL-instruction exception when the SSE chain is off and V=1

The virtualised counterpart of cp_ssamoswap_sse_gating_zicfiss. With menvcfg.SSE=1, execute SSAMOSWAP.W and SSAMOSWAP.D against a valid aligned SS address for:
(a) henvcfg.SSE=0, from VS-mode and VU-mode;
(b) henvcfg.SSE=1, senvcfg.SSE=0, from VU-mode.
Positive control: all required bits set — the instruction completes.

(a) virtual-instruction exception when V=1 and henvcfg.SSE=0.
(b) virtual-instruction exception in VU-mode when senvcfg.SSE=0.
Note the flavour split, which is why this is separate from the U sheet: the SAME gating condition yields ILLEGAL-instruction when V=0 and VIRTUAL-instruction when V=1. Gating by menvcfg.SSE stays ILLEGAL even at V=1.
Memory, rd and ssp unchanged.

instr {SSAMOSWAP.W, SSAMOSWAP.D} x mode {VS, VU} x gate {henvcfg.SSE=0, (henvcfg.SSE=1 & senvcfg.SSE=0)} x result {virtual_instruction}

henvcfg_sse_op senvcfg_sse_Zicfilp menvcfg_sse_op_list

[norm:henvcfg_sse_op] [norm:senvcfg_sse_Zicfilp] [norm:menvcfg_sse_op_list]

cp_envcfg_sse_rdonly0_virt_zicfiss

Verify the SSE read-only-zero chain through henvcfg and, at V=1, through senvcfg

Two links of the chain, observed by direct read-back rather than inferred from an ssp access.
Link 1 (from HS-mode): set menvcfg.SSE=0, then write henvcfg.SSE=1 using csrw, csrs and csrrw, reading henvcfg back after each. Repeat with menvcfg.SSE=1 as the positive control.
Link 2 (from VS-mode): with menvcfg.SSE=1 and henvcfg.SSE=0, write senvcfg.SSE=1 and read back — the h0s1 combination must be observed as h0s0. Repeat with henvcfg.SSE=1 as the control.

Link 1: with menvcfg.SSE=0, henvcfg.SSE reads back 0 after every write attempt. No exception — SSE is WARL, so the write is discarded rather than rejected.
Link 2: with henvcfg.SSE=0 and V=1, senvcfg.SSE reads back 0. The (henvcfg=0, senvcfg=1) combination is therefore architecturally unreachable, exactly as (menvcfg=0, senvcfg=1) is at V=0.
Positive controls: with the parent field set, the child is writable and reads back what was written.
Together with cp_senvcfg_sse_rdonly0_s_zicfiss (ZicfissS) and cp_envcfg_sse_rdonly0_zicfiss (ZicfissSm) this closes the whole menvcfg → henvcfg → senvcfg chain.

link {menvcfg→henvcfg, henvcfg→senvcfg@V=1} x parent {0,1} x csr_op {csrw, csrs, csrrw} x written {0,1} x readback {0 when parent=0, written when parent=1}

menvcfg_sse_rdonly0 henvcfg_sse_op

[norm:menvcfg_sse_rdonly0] [norm:henvcfg_sse_op]

cp_ss_enable_chain_cross_zicfiss

Cross all eight menvcfg/senvcfg/henvcfg SSE combinations against every SS instruction in every mode

The three enable bits do not all apply in every mode, and the negatives are as important as the positives:
(a) From HS-mode (V=0) with henvcfg.SSE=0: henvcfg gates V=1 only, so this must make NO difference — SS instructions behave exactly as they do with henvcfg.SSE=1.
(b) From VS-mode with senvcfg.SSE=0: senvcfg gates VU/U only, so this must make NO difference at VS.
(c) The general sweep: all 8 combinations of {menvcfg.SSE, senvcfg.SSE, henvcfg.SSE} against every SS instruction, executed from HS, VS and VU.
Unreachable combinations are still attempted and are expected to be observed as their collapsed form (see cp_envcfg_sse_rdonly0_virt_zicfiss).

Which field is consulted depends on the mode:
HS (V=0): menvcfg.SSE alone. senvcfg and henvcfg are irrelevant.
VS: menvcfg.SSE and henvcfg.SSE. senvcfg is irrelevant.
VU: menvcfg.SSE, henvcfg.SSE and senvcfg.SSE.
Where a mode’s required bits are all 1 the instruction executes normally; otherwise the MOP-encoded instructions revert to their Zimop/Zcmop no-op and SSAMOSWAP traps.
Exception flavour follows the gating field, not merely V: menvcfg.SSE=0 gives ILLEGAL-instruction even at V=1, while henvcfg/senvcfg gating at V=1 gives VIRTUAL-instruction.

{menvcfg.SSE, senvcfg.SSE, henvcfg.SSE} {000..111} x mode {HS, VS, VU} x instr {SSPUSH x1, SSPUSH x5, C.SSPUSH x1, SSPOPCHK x1, SSPOPCHK x5, C.SSPOPCHK x5, SSRDP, SSAMOSWAP.W, SSAMOSWAP.D} x result {executes, no-op, illegal_instruction, virtual_instruction}

zicfiss_ssp_csr zicfiss_m_menvcfg_sse zicfiss_vs_henvcfg_sse zicfiss_vu_senvcfg_sse zicfiss_sse_access henvcfg_sse_op menvcfg_sse_op_list senvcfg_sse_Zicfilp

[norm:zicfiss_ssp_csr] [norm:zicfiss_m_menvcfg_sse] [norm:zicfiss_vs_henvcfg_sse] [norm:zicfiss_vu_senvcfg_sse] [norm:zicfiss_sse_access] [norm:henvcfg_sse_op] [norm:menvcfg_sse_op_list] [norm:senvcfg_sse_Zicfilp]

cp_ss_g_stage_page_enc_zicfiss

Verify pte.xwr=010 remains a reserved encoding in G-stage page tables

The shadow stack encoding is defined for VS-stage and S-stage page tables only. G-stage has no notion of a shadow stack page, so xwr=010 there stays reserved regardless of menvcfg.SSE or henvcfg.SSE.
Map the guest physical page backing the shadow stack with a G-stage PTE of xwr=010, leaving the VS-stage PTE a correct SS page, and attempt every access type from VS and VU: SS instructions, ordinary loads, ordinary stores, and instruction fetch.
Repeat with menvcfg.SSE=1/henvcfg.SSE=1 and with them cleared, to show the encoding does not become valid at G-stage under any enable setting.

Every access type raises a store/AMO GUEST-page-fault (cause=23) — the reserved G-stage encoding makes the second-stage translation invalid, so the access never reaches the shadow stack rules.
This holds for loads and instruction fetch as well as stores, and is independent of the SSE enable bits.
Contrast with cp_ss_page_enc_virt_zicfiss, which covers the VS-stage encoding where henvcfg.SSE=0 is what makes xwr=010 reserved.

g_stage_pte.xwr {010} x access {SS instr, ordinary load, ordinary store, ifetch} x mode {VS, VU} x {menvcfg.SSE, henvcfg.SSE} {00, 11} x cause {23}

active_g_stage_pte ss_fault_exception_code H_vm_gstagetrans H_guest_page_fault

[norm:active_g_stage_pte] [norm:ss_fault_exception_code] [norm:H_vm_gstagetrans] [norm:H_guest_page_fault]

cp_ss_hlv_hsv_zicfiss

Verify hypervisor load/store access to a VS-stage shadow stack page: HLV succeeds, HSV faults

From HS-mode, with a VS-stage page correctly mapped as a shadow stack page (xwr=010), use the hypervisor virtual-machine load and store instructions to reach it:
HLV.B / HLV.H / HLV.W / HLV.D (and the unsigned forms) — these only load.
HSV.B / HSV.H / HSV.W / HSV.D — these store.
Repeat with hstatus.HU = 0 and 1, and from U-mode where HLV/HSV are only permitted when HU=1.

HLV succeeds. The shadow stack is readable by any instruction that only loads ([norm:ssmp_ss_load]), and HLV is such an instruction — being a hypervisor instruction does not change that.
HSV faults with a store/AMO access-fault: it is a store, and the set of instructions permitted to write an SS page is exactly SSPUSH, C.SSPUSH, SSAMOSWAP.W and SSAMOSWAP.D. HSV is not in it.
With hstatus.HU=0, HLV/HSV from U-mode raise a virtual-instruction exception before any shadow stack rule is consulted.

instr {HLV.B, HLV.H, HLV.W, HLV.D, HLVU variants, HSV.B, HSV.H, HSV.W, HSV.D} x hstatus.HU {0,1} x mode {HS, U} x result {ok for HLV, store/AMO access-fault for HSV, virtual_instruction when HU=0 from U}

hlsv_op hlsv_u_op ssmp_ss_load ssmp_ss_page_access_fault ss_fault_exception_code

[norm:hlsv_op] [norm:hlsv_u_op] [norm:ssmp_ss_load] [norm:ssmp_ss_page_access_fault] [norm:ss_fault_exception_code]

cp_ss_swcheck_delegation_zicfiss

Verify the shadow stack software-check exception is delegated correctly through medeleg and hedeleg

The software-check exception (cause=18) raised by a mismatching SSPOPCHK must follow the normal delegation chain. Sweep both delegation registers:
medeleg[18] = 0/1 — controls whether the exception is taken in M-mode or delegated below.
hedeleg[18] = 0/1 — with V=1, controls whether a delegated exception stops at HS or is further delegated to VS.
Trigger the mismatching SSPOPCHK from HS, VS and VU for each combination, and check where the trap lands and which tval register carries the shadow stack fault code.

medeleg[18]=0: trap taken in M-mode; mcause=18 and mtval=3.
medeleg[18]=1, V=0: trap taken in HS-mode; scause=18 and stval=3.
medeleg[18]=1, hedeleg[18]=0, V=1: trap taken in HS-mode, not VS.
medeleg[18]=1, hedeleg[18]=1, V=1: trap taken in VS-mode; vscause=18 and vstval=3.
The tval code (3, shadow stack fault) must appear in whichever tval register corresponds to the mode the trap landed in, subject to the REPORT_CAUSE_IN_xTVAL_ON_SHADOW_STACK_SOFTWARE_CHECK parameters.
hedeleg[18] must be writable if the software-check exception is delegatable at all; if the bit is read-only zero the VS case collapses into the HS case and that is what is checked.

medeleg[18] {0,1} x hedeleg[18] {0,1} x origin_mode {HS, VS, VU} x trap_lands {M, HS, VS} x {xcause==18, xtval==3}

sspop_exception mtval_swchk_lead-in mtval_swchk_list hedeleg_op medeleg_mideleg_op1

[norm:sspop_exception] [norm:mtval_swchk_lead-in] [norm:mtval_swchk_list] [norm:hedeleg_op] [norm:medeleg_mideleg_op1]

(reused) ZicfissU instruction coverpoints, re-run from VS-mode and VU-mode

Re-run the ZicfissU coverpoints with the hart in VS/VU instead of U

BOOKKEEPING ROW, not a new coverpoint. These 14 ZicfissU coverpoints are re-run with V=1, sampled into the H covergroup via priv_mode_vs / priv_mode_vu:
cp_ssp_access_zicfiss
cp_sspush_zicfiss
cp_sspopchk_match_zicfiss
cp_sspopchk_mismatch_zicfiss
cp_sspopchk_fault_priority_zicfiss
cp_ss_call_return_zicfiss
cp_ssrdp_zicfiss
cp_ssamoswap_zicfiss
cp_ss_address_alignment_zicfiss
cp_ss_instr_target_page_zicfiss
cp_ss_page_access_zicfiss
cp_ss_page_crossing_zicfiss
cp_ss_page_ad_bits_zicfiss
cp_ss_non_idempotent_zicfiss
NOT re-run: cp_ssp_csr_gating_u_zicfiss, cp_ss_instr_inactive_zicfiss and cp_ssamoswap_sse_gating_zicfiss — their virtualised equivalents are cp_ssp_csr_gating_virt_zicfiss, cp_ss_enable_chain_cross_zicfiss and cp_ssamoswap_sse_gating_virt_zicfiss on this sheet.
Two V=1 differences apply to every re-run: translation is two-stage, so a fault may surface as a guest-page-fault (cause 23) instead of 15; and the gating flavour differs, ILLEGAL for menvcfg versus VIRTUAL for henvcfg/senvcfg.

Identical architectural results to the U-mode runs except where two-stage translation or the enable-chain flavour changes the reported cause, as described above.

priv_mode {vs, vu} x (all bins of each reused coverpoint)

(inherits the ID list of each reused coverpoint)

(inherits the normative rules of each reused coverpoint)

Folded into cp_envcfg_sse_rdonly0_virt_zicfiss.

Write henvcfg.SSE=1 when menvcfg.SSE=0, read back and ensure henvcfg = 0

Folded into cp_envcfg_sse_rdonly0_virt_zicfiss.

in vs check h0s1 reads back as h0s0

PROMOTED to its own coverpoint: cp_ss_enable_chain_cross_zicfiss, including the two irrelevance claims (henvcfg at HS, senvcfg at VS).

Test SS instructions from HS with henvcfg.SSE=0 and confirm that doesn’t matter. Also test from VS with senvcfg.SSE=0, confirm it doesn’t matter. Generally cross all 8 m/s/h enables with each instruction.

PROMOTED to its own coverpoint: cp_ss_g_stage_page_enc_zicfiss.

Test G-stage PTE of xwr=010 remains reserved, guest page fault for every access type.

PROMOTED to its own coverpoint: cp_ss_hlv_hsv_zicfiss.

Test HLV/HSV from HS-mode to VS-stage SS page. HSV faults, HLV ok.

PROMOTED to its own coverpoint: cp_ss_swcheck_delegation_zicfiss, sweeping medeleg[18] and hedeleg[18] across HS/VS/VU.

Be sure software check extension is delegated appropriately with hedeleg as well as medeleg.

B.9.28. SsdbltrpH Hypervisor Double Trap

  • develop after Ssdbltrp

B.9.29. SsnpmH Hypervisor Pointer Masking

Develop this after baseline pointer masking tests

B.9.30. SmnpmH Hypervisor Pointer Masking

Develop this after baseline pointer masking tests

B.10. Vector Privileged Test Suites

All of the vector privileged suites are collected in this section. The machine-mode vector CSR tests, Sm_V and Sm_VF, are part of the Sm suite and its test plan.

B.10.1. MisalignV Vector Misalignment

MisalignV tests misaligned vector loads and stores. Unlike scalar misaligned suites, they are privileged tests that run whether or not misaligned accesses are supported, so they may trap or not depending on TODO UDBParameter.

Table 300. MisalignV Instruction Coverpoints
Instruction vl1re16.v vl1re32.v vl1re64.v vl1re8.v vl2re16.v vl2re32.v vl2re64.v vl2re8.v vl4re16.v vl4re32.v vl4re64.v vl4re8.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_misalignv_ls_wholereg_misaligned

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vl8re16.v vl8re32.v vl8re64.v vl8re8.v vle16.v vle16ff.v vle32.v vle32ff.v vle64.v vle64ff.v vle8.v vle8ff.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_misalignv_ls_element_misaligned

x

x

x

x

x

x

x

x

cp_misalignv_ls_wholereg_misaligned

x

x

x

x

Instruction vlm.v vloxei16.v vloxei32.v vloxei64.v vloxei8.v vloxseg2ei16.v vloxseg2ei32.v vloxseg2ei64.v vloxseg2ei8.v vloxseg3ei16.v vloxseg3ei32.v vloxseg3ei64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_misalignv_ls_element_misaligned

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vloxseg3ei8.v vloxseg4ei16.v vloxseg4ei32.v vloxseg4ei64.v vloxseg4ei8.v vloxseg5ei16.v vloxseg5ei32.v vloxseg5ei64.v vloxseg5ei8.v vloxseg6ei16.v vloxseg6ei32.v vloxseg6ei64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_misalignv_ls_element_misaligned

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vloxseg6ei8.v vloxseg7ei16.v vloxseg7ei32.v vloxseg7ei64.v vloxseg7ei8.v vloxseg8ei16.v vloxseg8ei32.v vloxseg8ei64.v vloxseg8ei8.v vlse16.v vlse32.v vlse64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_misalignv_ls_element_misaligned

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vlse8.v vlseg2e16.v vlseg2e16ff.v vlseg2e32.v vlseg2e32ff.v vlseg2e64.v vlseg2e64ff.v vlseg2e8.v vlseg2e8ff.v vlseg3e16.v vlseg3e16ff.v vlseg3e32.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_misalignv_ls_element_misaligned

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vlseg3e32ff.v vlseg3e64.v vlseg3e64ff.v vlseg3e8.v vlseg3e8ff.v vlseg4e16.v vlseg4e16ff.v vlseg4e32.v vlseg4e32ff.v vlseg4e64.v vlseg4e64ff.v vlseg4e8.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_misalignv_ls_element_misaligned

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vlseg4e8ff.v vlseg5e16.v vlseg5e16ff.v vlseg5e32.v vlseg5e32ff.v vlseg5e64.v vlseg5e64ff.v vlseg5e8.v vlseg5e8ff.v vlseg6e16.v vlseg6e16ff.v vlseg6e32.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_misalignv_ls_element_misaligned

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vlseg6e32ff.v vlseg6e64.v vlseg6e64ff.v vlseg6e8.v vlseg6e8ff.v vlseg7e16.v vlseg7e16ff.v vlseg7e32.v vlseg7e32ff.v vlseg7e64.v vlseg7e64ff.v vlseg7e8.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_misalignv_ls_element_misaligned

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vlseg7e8ff.v vlseg8e16.v vlseg8e16ff.v vlseg8e32.v vlseg8e32ff.v vlseg8e64.v vlseg8e64ff.v vlseg8e8.v vlseg8e8ff.v vlsseg2e16.v vlsseg2e32.v vlsseg2e64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_misalignv_ls_element_misaligned

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vlsseg2e8.v vlsseg3e16.v vlsseg3e32.v vlsseg3e64.v vlsseg3e8.v vlsseg4e16.v vlsseg4e32.v vlsseg4e64.v vlsseg4e8.v vlsseg5e16.v vlsseg5e32.v vlsseg5e64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_misalignv_ls_element_misaligned

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vlsseg5e8.v vlsseg6e16.v vlsseg6e32.v vlsseg6e64.v vlsseg6e8.v vlsseg7e16.v vlsseg7e32.v vlsseg7e64.v vlsseg7e8.v vlsseg8e16.v vlsseg8e32.v vlsseg8e64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_misalignv_ls_element_misaligned

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vlsseg8e8.v vluxei16.v vluxei32.v vluxei64.v vluxei8.v vluxseg2ei16.v vluxseg2ei32.v vluxseg2ei64.v vluxseg2ei8.v vluxseg3ei16.v vluxseg3ei32.v vluxseg3ei64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_misalignv_ls_element_misaligned

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vluxseg3ei8.v vluxseg4ei16.v vluxseg4ei32.v vluxseg4ei64.v vluxseg4ei8.v vluxseg5ei16.v vluxseg5ei32.v vluxseg5ei64.v vluxseg5ei8.v vluxseg6ei16.v vluxseg6ei32.v vluxseg6ei64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_misalignv_ls_element_misaligned

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vluxseg6ei8.v vluxseg7ei16.v vluxseg7ei32.v vluxseg7ei64.v vluxseg7ei8.v vluxseg8ei16.v vluxseg8ei32.v vluxseg8ei64.v vluxseg8ei8.v vs1r.v vs2r.v vs4r.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_misalignv_ls_element_misaligned

x

x

x

x

x

x

x

x

x

x

x

x

cp_misalignv_ls_wholereg_misaligned

x

x

x

Instruction vs8r.v vse16.v vse32.v vse64.v vse8.v vsm.v vsoxei16.v vsoxei32.v vsoxei64.v vsoxei8.v vsoxseg2ei16.v vsoxseg2ei32.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_misalignv_ls_element_misaligned

x

x

x

x

x

x

x

x

x

x

x

x

cp_misalignv_ls_wholereg_misaligned

x

Instruction vsoxseg2ei64.v vsoxseg2ei8.v vsoxseg3ei16.v vsoxseg3ei32.v vsoxseg3ei64.v vsoxseg3ei8.v vsoxseg4ei16.v vsoxseg4ei32.v vsoxseg4ei64.v vsoxseg4ei8.v vsoxseg5ei16.v vsoxseg5ei32.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_misalignv_ls_element_misaligned

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vsoxseg5ei64.v vsoxseg5ei8.v vsoxseg6ei16.v vsoxseg6ei32.v vsoxseg6ei64.v vsoxseg6ei8.v vsoxseg7ei16.v vsoxseg7ei32.v vsoxseg7ei64.v vsoxseg7ei8.v vsoxseg8ei16.v vsoxseg8ei32.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_misalignv_ls_element_misaligned

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vsoxseg8ei64.v vsoxseg8ei8.v vsse16.v vsse32.v vsse64.v vsse8.v vsseg2e16.v vsseg2e32.v vsseg2e64.v vsseg2e8.v vsseg3e16.v vsseg3e32.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_misalignv_ls_element_misaligned

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vsseg3e64.v vsseg3e8.v vsseg4e16.v vsseg4e32.v vsseg4e64.v vsseg4e8.v vsseg5e16.v vsseg5e32.v vsseg5e64.v vsseg5e8.v vsseg6e16.v vsseg6e32.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_misalignv_ls_element_misaligned

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vsseg6e64.v vsseg6e8.v vsseg7e16.v vsseg7e32.v vsseg7e64.v vsseg7e8.v vsseg8e16.v vsseg8e32.v vsseg8e64.v vsseg8e8.v vssseg2e16.v vssseg2e32.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_misalignv_ls_element_misaligned

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vssseg2e64.v vssseg2e8.v vssseg3e16.v vssseg3e32.v vssseg3e64.v vssseg3e8.v vssseg4e16.v vssseg4e32.v vssseg4e64.v vssseg4e8.v vssseg5e16.v vssseg5e32.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_misalignv_ls_element_misaligned

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vssseg5e64.v vssseg5e8.v vssseg6e16.v vssseg6e32.v vssseg6e64.v vssseg6e8.v vssseg7e16.v vssseg7e32.v vssseg7e64.v vssseg7e8.v vssseg8e16.v vssseg8e32.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_misalignv_ls_element_misaligned

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vssseg8e64.v vssseg8e8.v vsuxei16.v vsuxei32.v vsuxei64.v vsuxei8.v vsuxseg2ei16.v vsuxseg2ei32.v vsuxseg2ei64.v vsuxseg2ei8.v vsuxseg3ei16.v vsuxseg3ei32.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_misalignv_ls_element_misaligned

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vsuxseg3ei64.v vsuxseg3ei8.v vsuxseg4ei16.v vsuxseg4ei32.v vsuxseg4ei64.v vsuxseg4ei8.v vsuxseg5ei16.v vsuxseg5ei32.v vsuxseg5ei64.v vsuxseg5ei8.v vsuxseg6ei16.v vsuxseg6ei32.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

cp_misalignv_ls_element_misaligned

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vsuxseg6ei64.v vsuxseg6ei8.v vsuxseg7ei16.v vsuxseg7ei32.v vsuxseg7ei64.v vsuxseg7ei8.v vsuxseg8ei16.v vsuxseg8ei32.v vsuxseg8ei64.v vsuxseg8ei8.v

RV32

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

cp_misalignv_ls_element_misaligned

x

x

x

x

x

x

x

x

x

x

Table 301. MisalignV Normative Rules
Normative Rule Rule Text Coverpoints

vector_ls_misaligned_exception

If an element accessed by a vector memory instruction is not naturally aligned to the size of the element, either the element is transferred successfully or an address-misaligned exception is raised on that element.

{MisalignV_vle16_v_cg,MisalignV_vle32_v_cg,MisalignV_vle64_v_cg,MisalignV_vle8_v_cg}/{cp_misalignv_ls_element_misaligned}, {MisalignV_vse16_v_cg,MisalignV_vse32_v_cg,MisalignV_vse64_v_cg,MisalignV_vse8_v_cg}/{cp_misalignv_ls_element_misaligned}, {MisalignV_vlm_v_cg}/{cp_misalignv_ls_element_misaligned}, {MisalignV_vlse16_v_cg,MisalignV_vlse32_v_cg,MisalignV_vlse64_v_cg,MisalignV_vlse8_v_cg}/{cp_misalignv_ls_element_misaligned}, {MisalignV_vsm_v_cg}/{cp_misalignv_ls_element_misaligned}, {MisalignV_vsse16_v_cg,MisalignV_vsse32_v_cg,MisalignV_vsse64_v_cg,MisalignV_vsse8_v_cg}/{cp_misalignv_ls_element_misaligned}, {MisalignV_vle16ff_v_cg,MisalignV_vle32ff_v_cg,MisalignV_vle64ff_v_cg,MisalignV_vle8ff_v_cg}/{cp_misalignv_ls_element_misaligned}, {MisalignV_*_v_cg}/{cp_misalignv_ls_element_misaligned}

vector_ls_wholereg_misaligned_exception

Implementations are allowed to raise a misaligned address exception on whole register loads and stores if the base address is not naturally aligned to the larger of the size of the encoded EEW in bytes (EEW/8) or the implementation’s smallest supported SEW size in bytes (SEWMIN/8).

{MisalignV_vl1re16_v_cg,MisalignV_vl1re32_v_cg,MisalignV_vl1re64_v_cg,MisalignV_vl1re8_v_cg,MisalignV_vl2re16_v_cg,MisalignV_vl2re32_v_cg,MisalignV_vl2re64_v_cg,MisalignV_vl2re8_v_cg,MisalignV_vl4re16_v_cg,MisalignV_vl4re32_v_cg,MisalignV_vl4re64_v_cg,MisalignV_vl4re8_v_cg,MisalignV_vl8re16_v_cg,MisalignV_vl8re32_v_cg,MisalignV_vl8re64_v_cg,MisalignV_vl8re8_v_cg,MisalignV_vs1r_v_cg,MisalignV_vs2r_v_cg,MisalignV_vs4r_v_cg,MisalignV_vs8r_v_cg}/{cp_misalignv_ls_wholereg_misaligned}

vector_ls_scalar_misaligned_independence

Support for misaligned vector memory accesses is independent of an implementation’s support for misaligned scalar memory accesses.

See VECTOR_LS_MISALIGNED_EXCEPTION

vector_ls_scalar_misaligned_dependence

Vector misaligned memory accesses follow the same rules for atomicity as scalar misaligned memory accesses.

TODO

Zicclsm_misaligned_support

If the Zicclsm extension is implemented, then misaligned loads and stores to main memory regions with both the coherence and cacheability PMAs must be supported.

See VECTOR_LS_MISALIGNED_EXCEPTION

UDB Parameters: None.

B.10.2. SsstrictV Vector Strict Decoding

SsstrictV tests that reserved vector encodings trap when Ssstrict is implemented. It includes a comprehensive set of reserved overlapping register constraints. It also tests miscellaneous reserved conditions such as widening to unsupported SEWs, register groups not aligned to a multiple of LMUL, reserved mask overlaps, and constraints on vsetvl* operands.

Table 302. SsstrictV Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule Pass/Fail Criteria Notes

cp_ssstrictv_widening_source_overlap

Confirm for every instruction with the .w* suffix (and widening reduction operations), that if vs1 and vs2 are the same register, the encoding is reserved

Run a widening instruction with sew = {supported}, lmul = {1/2/4}, vs2 = vs1 = v8
Crossing all lmul (except 8 as it implies an emul of 16) confirms that the overlap is recognized for all sizes of register groups and running with v8 keeps register group alignment and removes and possible conflicts with v0

trap

4 lmul bins

vreg_overlap_rsv
vreg_source_eew_rsv

spec: An encoding that would result in the same vector register being read with two or more different EEWs, including when the vector register appears at different positions within two or more vector register groups, is reserved.
EMUL_SEW_LMUL_dep; vreg_source_EEW_rsv; vtype-lmul_val; vwop_vd_eew_emul

cp_ssstrictv_all_widening_source_overlap

Confirm for a single instruction with the .w* suffix (and widening reduction operations), every combination of vs1 and vs2 across lmul = {1/2/4/8} is reserved

With a widdening instruction cross vs1 = {0-31} with vs2 = {0-31} and lmul = {1/2/4} with sew = {supported}
Crossing all lmul (except 8 as it implies an emul of 16) confirms that the overlap is recognized for all sizes of register groups. Although much trapping will occur because of incorrect register alignment, this simplifies both the writing of the coverpoint and testing

trap

32 vs1 x 32 vs2 x 4 lmul

does not depend on csr state: ? Don’t know if we need a cross across lmul
spec: An encoding that would result in the same vector register being read with two or more different EEWs, including when the vector register appears at different positions within two or more vector register groups, is reserved.
EEW; EEW_SEW_LMUL_dep; EMUL; EMUL_SEW_LMUL_dep; EMUL_rsv; vreg_overlap_rsv; vreg_source_EEW_rsv; vwop_vd_eew_emul

All vzext and vsext instructions ending in f2

cp_ssstrictv_vext2_overlapping_vd_vs2

Confirm that with zero and sign extending instructions ending in "f2," when the vs2 overlaps the bottom half of the vd register group the operation is illegal

Conduct a widening operation with lmul=2, vd group aligned and vs2 overlapping the bottom half of the vd register group (if lmul is 2 and vd = v0 then vs2 would be v0 for vzext.vf2).
If vd and vs2 registers must overlap in this manner it is illegal

trap

1

does not depend on csr state: Only if vd == vs2
spec: A destination vector register group can overlap a source vector register group only if one of the following holds:
The destination EEW is greater than the source EEW, the source EMUL is at least 1, and the overlap is in the highest-numbered part of the destination register group (e.g., when LMUL=8, vzext.vf4 v0, v6 is legal, but a source of v0, v2, or v4 is not).
EEW; EMUL; EMUL_SEW_LMUL_dep; vreg_lmulge2_op; vreg_overlap_legal; vreg_overlap_rsv; vsext_op; vsext_vd_eew_emul; vsext_vs_eew_emul; vzext_op; vzext_vd_eew_emul; vzext_vs_eew_emul

All vzext and vsext instructions ending in f4

cp_ssstrictv_vext4_overlapping_vd_vs2

Confirm that with zero and sign extending instructions ending in "f4," when the vs2 overlaps the bottom 3/4 of the vd register group the operation is illegal

Conduct a widening operation with lmul=4, vd group aligned and vs2 overlapping the bottom 3/4 of the vd register group (if lmul is 4 and vd = v0 then vs2 could be v0, v1, or v2 for vzext.vf4).
If the vd and vs2 registers overlap in this manner it is illegal

trap

1

does not depend on csr state: Only if vd == vs2
spec: A destination vector register group can overlap a source vector register group only if one of the following holds:
The destination EEW is greater than the source EEW, the source EMUL is at least 1, and the overlap is in the highest-numbered part of the destination register group (e.g., when LMUL=8, vzext.vf4 v0, v6 is legal, but a source of v0, v2, or v4 is not).
EEW; EMUL; EMUL_SEW_LMUL_dep; vreg_overlap_legal; vreg_overlap_rsv; vsext_op; vsext_vd_eew_emul; vsext_vs_eew_emul; vzext_op; vzext_vd_eew_emul; vzext_vs_eew_emul

All vzext and vsext instructions ending in f8

cp_ssstrictv_vext8_overlapping_vd_vs2

Confirm that with zero and sign extending instructions ending in "f8," when the vs2 overlaps the bottom 7/8 of the vd register group the operation is illegal

Conduct a widening operation with lmul=8, vd group aligned and vs2 overlapping the bottom 7/8 of the vd register group (if lmul is 8 and vd = v0 then vs2 could be v{0-6} for vzext.vf8).
If the vd and vs2 registers must overlap in this manner it is illegal

trap

1

does not depend on csr state: Only if vd == vs2
spec: A destination vector register group can overlap a source vector register group only if one of the following holds:
The destination EEW is greater than the source EEW, the source EMUL is at least 1, and the overlap is in the highest-numbered part of the destination register group (e.g., when LMUL=8, vzext.vf4 v0, v6 is legal, but a source of v0, v2, or v4 is not).
EEW; EMUL; EMUL_rsv; vreg_overlap_legal; vreg_overlap_rsv; vsext_op; vsext_vd_eew_emul; vsext_vs_eew_emul; vzext_op; vzext_vd_eew_emul; vzext_vs_eew_emul

All widening instructions except reduction

cp_ssstrictv_vwiden_overlapping_vd_vs1_lmul1

Confirm that with widening instructions (must end in .v*) vs1 = vd is illegal

Conduct a widening operation with lmul=1, vs1 = vd and vd group aligned. vs2 should not overlap vd
The vd and vs1 register groups overlapping in this manner is illegal

trap

1

spec: A destination vector register group can overlap a source vector register group only if one of the following holds:
The destination EEW is greater than the source EEW, the source EMUL is at least 1, and the overlap is in the highest-numbered part of the destination register group (e.g., when LMUL=8, vzext.vf4 v0, v6 is legal, but a source of v0, v2, or v4 is not).
vreg_overlap_legal; vreg_overlap_rsv; vwop_vd_eew_emul

cp_ssstrictv_vwiden_overlapping_vd_vs2_lmul1

Confirm that with widening instructions (must end in .v*) vs2 = vd is illegal

Conduct a widening operation with lmul=1, vs2 = vd and vd group aligned. vs1 should not overlap vd
The vd and vs2 register groups overlapping in this manner is illegal

trap

1

spec: A destination vector register group can overlap a source vector register group only if one of the following holds:
The destination EEW is greater than the source EEW, the source EMUL is at least 1, and the overlap is in the highest-numbered part of the destination register group (e.g., when LMUL=8, vzext.vf4 v0, v6 is legal, but a source of v0, v2, or v4 is not).
EEW; EMUL; vreg_overlap_legal; vreg_overlap_rsv; vwop_vd_eew_emul

cp_ssstrictv_vwidenw_overlapping_vd_vs1_lmul1

Confirm that with widening instructions (must end in .w*) vs1 = vd is illegal

Conduct a widening operation with lmul=1, vs1 = vd and vd group aligned. vs2 should not overlap vd
The vd and vs1 register groups overlapping in this manner is illegal

trap

1

spec: A destination vector register group can overlap a source vector register group only if one of the following holds:
The destination EEW is greater than the source EEW, the source EMUL is at least 1, and the overlap is in the highest-numbered part of the destination register group (e.g., when LMUL=8, vzext.vf4 v0, v6 is legal, but a source of v0, v2, or v4 is not).
vreg_overlap_legal; vreg_overlap_rsv; vwop_vd_eew_emul

All narrowing instructions

cp_ssstrictv_vnarrow_overlapping_vd_vs2

Confirm that with narrowing instructions, vs2 = vd is illegal

Conduct a narrowing operation with lmul=1, vs1 = vd and vs2 group aligned. vs2 should not overlap vs1
The vd and vs2 register groups overlapping in this manner is illegal

trap

1

vfncvt_vreg_constr

spec: The destination EEW is smaller than the source EEW and the overlap is in the lowest-numbered part of the source register group (e.g., when LMUL=1, vnsrl.wi v0, v0, 3 is legal, but a destination of v1 is not).
vnarrowing_EEW; vnarrowing_EMUL; vreg_overlap_legal; vreg_overlap_rsv

cp_ssstrictv_widening_vd_emul_16

Confirm that with all widening instructions (ending in .v* and .w* excluding the widening reduction instructions) that EMUL>=16 traps

Set sew = {supported} and lmul = {8} and confirm that the instruction traps
sew needs to be supported to ensure the instruction does not trap due to vill, lmul of 8 will imply an emul of 16 with widening instructions

trap

1

spec: The largest vector register group used by an instruction can not be greater than 8 vector registers (i.e., EMUL≤8), and if a vector instruction would require greater than 8 vector registers in a group, the instruction encoding is reserved. For example, a widening operation that produces a widened vector register group result when LMUL=8 is reserved as this would imply a result EMUL=16.
EMUL_SEW_LMUL_dep; EMUL_rsv; vwop_vd_eew_emul

cp_ssstrictv_narrowing_vs2_emul_16

Confirm that with all narrowing instructions that EMUL>=16 traps

Set sew = {supported} and lmul = {8} and confirm that the instruction traps
sew needs to be supported to ensure the instruction does not trap due to vill, lmul of 8 will imply an emul of 16 with narrowing instructions

trap

1

spec: The largest vector register group used by an instruction can not be greater than 8 vector registers (i.e., EMUL≤8), and if a vector instruction would require greater than 8 vector registers in a group, the instruction encoding is reserved. For example, a widening operation that produces a widened vector register group result when LMUL=8 is reserved as this would imply a result EMUL=16.
EMUL_rsv; vnarrowing_EEW; vnarrowing_EMUL

cp_ssstrictv_widening_vd_sew_eq_elen

Confirm for all widening instructions (.v*, .w* and reduction) that if SEW=ELEN the instruction traps

Set sew = {8,16,32,64} and lmul = {1}, vd = 8, vs2 = 10, vs1 = 12
Attempt to set all sew as this is simpler than figuring out SEW_MAX, the instruction should only trap for the highest SEW. Registers were chosen to ensure the instruction does not trap due to register overlap

trap

4 sew bins

spec: EEW; ELEN; EMUL_SEW_LMUL_dep; RESERVED_VILL_SET; V_supported_eew; vnarrowing_EEW; vnarrowing_EMUL; vreduction_trap; vwop_vd_eew_emul

cp_ssstrictv_narrowing_vs2_sew_eq_elen

Confirm for all narrowing instructions that if SEW=ELEN the instruction traps

Set sew = {8,16,32,64} and lmul = {1}, vd = 8, vs2 = 10, vs1 = 12
Attempt to set all sew as this is simpler than figuring out SEW_MAX, the instruction should only trap for the highest SEW. Registers were chosen to ensure the instruction does not trap due to register overlap

trap

4 sew bins

spec: ELEN; V_supported_eew; Zve_eew; vnarrowing_EEW; vnarrowing_EMUL; vnclip_op; vnclipu_op; vnop_vs2_eew_emul; vnsra_op; vnsrl_op; vtype-sew_val

cp_ssstrictv_vrgather_vd_vs1_eq

Confirm for vrgather instructions that if vs1 and vd overlap that the encoding is reserved

Set vs1 = vd = {v0-28} and lmul = 4 with vs2 not overlapping
vs2 not overlapping ensures that the encoding is reserved due to vs1 not vs2, lmul of 4 ensures vrgatherei16 won’t be reserved due to emul

trap

8 register bins

spec: For any vrgather instruction, the destination vector register group cannot overlap with the source vector register groups, otherwise the instruction encoding is reserved.
vreg_overlap_rsv; vrgather_vreg_constr; vrgatherei16_vreg_constr

cp_ssstrictv_vrgather_vd_vs2_eq

Confirm for vrgather.v* instructions that if vs2 and vd overlap that the encoding is reserved

Set vs2 = vd = {v0-28} and lmul = 4 with vs1 not overlapping
vs1 not overlapping ensures that the encoding is reserved due to vs2 not vs1, lmul of 4 ensures vrgatherei16 won’t be reserved due to emul

trap

8 register bins

spec: For any vrgather instruction, the destination vector register group cannot overlap with the source vector register groups, otherwise the instruction encoding is reserved.
vreg_overlap_rsv; vrgather_vreg_constr; vrgatherei16_vreg_constr

cp_ssstrictv_vrgatherei16_emul_16

Confirm if vrgatherei16 implies an emul of 16 the encoding is reserved

run lmul = 8 and sew = 8 and vd != vs1 and vd != vs2 (all group aligned)
lmul = 8 and sew = 8 are the only values that can produce an emul of 16. Register restrictions ensure that encoding isn’t reserved for other reasons

trap

1

spec: The vrgather.vv form uses SEW/LMUL for both the data and indices. The vrgatherei16.vv form uses SEW/LMUL for the data in vs2 but EEW=16 and EMUL = (16/SEW)*LMUL for the indices in vs1
EMUL_rsv; vrgatherei16-vv_sew_lmul

cp_ssstrictv_vrgatherei16_emul_f16

Confirm if vrgatherei16 implies an emul of 1/16 the encoding is reserved

run {lmul, sew} = {(1/8, 32), (1/4, 64)} and vd != vs1 and vd != vs2 (all group aligned)
These are the two situations that produce an emul = 1/16. Register restrictions ensure that encoding isn’t reserved for other reasons

trap

2 lmul&sew combined bins

spec: The vrgather.vv form uses SEW/LMUL for both the data and indices. The vrgatherei16.vv form uses SEW/LMUL for the data in vs2 but EEW=16 and EMUL = (16/SEW)*LMUL for the indices in vs1
EMUL_SEW_LMUL_dep; EMUL_rsv; vrgatherei16-vv_sew_lmul

cp_ssstrictv_masking_vd_eq_v0

Confirm for a "masked vector instruction" that vd = v0 is reserved

Run a masked vector instruction (mask enabled) with lmul = 1 and vd = v0, vd != vs1, vd != vs2, vs2 != vs1
run with lmul of 1 to ensure all other vector registers are on group and the instruction is not reserved for that reason (same with registers equaling each other)

trap

1

vadc_vsbc_vd_v0_rsv
vreg_vmask_rsv
vmfeq_vmfne_vmflt_vmfle_vmfgt_vmfge_vd_eq_v0
vreg_mask_overlap
vmsbf_vreg_constr
vmsif_vreg_constr
vmsof_vreg_constr
viota_vreg_constr

does not depend on csr state: (I think, github issue says its wrong, but vm is part of the instruction)
spec: The destination vector register group for a masked vector instruction cannot overlap the source mask register (v0), unless the destination vector register is being written with a mask value (e.g., compares) or the scalar result of a reduction. These instruction encodings are reserved.
V_masked; vreg_overlap_rsv; vreg_vmask; vreg_vmask_rsv

cp_ssstrict_ls_nf_eew

Confirm any NFIELDS * EEW violation is checked, run on all instructions with nf and eew

Run segment load/store instructions with NFIELDS and EEW combinations where NFIELDS * EEW exceeds the implementation limit, across all segment load/store instruction variants

trap

spec: The EMUL setting must be such that EMUL * NFIELDS ≤ 8, otherwise the instruction encoding is reserved.
EMUL_NFIELDS_rsv; NFIELDS; vector_ls_EEW; vector_ls_EMUL; vector_ls_seg_indexed_EMUL_NFIELDS_val

cp_ssstrictv_masking_vd_eq_v0_lmulgt1

Confirm for a masked vector instruction that vd = v0 with LMUL > 1 is reserved

Run a masked vector instruction (mask enabled) with lmul = {2, 4, 8} and vd = v0, vd != vs1, vd != vs2, vs2 != vs1
Complements cp_ssstrictv_masking_vd_eq_v0 (LMUL=1) by testing higher LMUL values where the vd register group still overlaps v0

trap

3 lmul bins

does not depend on csr state: ? Isn’t this masking_vd_eq_v0
spec: LMUL; V_masked; vreg_overlap_rsv; vreg_vmask; vreg_vmask_rsv; vtype-lmul_val

cp_ssstrictv_ls_seg_vd_overflow

Confirm segment load/store traps when register numbers increment past 31

Run a segment load/store with LMUL=1 and NFIELDS/vd combinations where vd + NFIELDS > 32 (e.g., NFIELDS=2 vd=31, NFIELDS=4 vd=29, NFIELDS=8 vd=25)

trap

7 nf/vd overflow bins

emul_nfields_rsv
vector_ls_seg_rsv
vector_ls_seg_indexed_emul_nfields_val

cp_ssstrictv_ls_seg_idx_vd_vs2_overlap

Confirm indexed segment load traps when destination groups overlap vs2 index register

Run an indexed segment load with LMUL=1 and vd=8, with vs2 set to each destination register in the segment range (vs2=vd through vs2=vd+NFIELDS-1) across NFIELDS=2..8

trap

8 nf/vd/vs2 overlap bins

vector_ls_seg_indexed_vreg_rsv

spec: vector_ls_seg_indexed_vreg_rsv; vreg_overlap_rsv

cp_ssstrictv_ls_wr_nf_reserved

Confirm whole register load/store traps for non-power-of-2 nf and unaligned vd

Run a whole register load/store with nf encoding non-power-of-2 register counts (NREG=3,5,6,7). Also run with valid NREG (2,4,8) but vd not aligned to NREG

trap

4 non-pow2 nf bins + 16 vd off-group (NREG=2) + 24 vd off-group (NREG=4) + 28 vd off-group (NREG=8)

spec: vector_ls_seg_wholereg_nf_rsv; vector_wholels_nf_op; vmv-nr-r_nreg_rsv; vmv-nr-r_unaligned_rsv

cp_ssstrictv_vfp_frm_reserved

Confirm vector FP instructions trap when frm contains reserved rounding mode

Run a vector floating-point instruction with frm set to each invalid rounding mode (5, 6, 7). Also run with vl=0 and with vstart >= vl to confirm the reservation applies regardless of element activity

trap

3 frm bins x 3 conditions (normal / vl=0 / vstart>=vl)

spec: V_fp_frm; V_inv_frm_rsv

cp_ssstrictv_vfp_eew_unsupported

Confirm vector FP instructions trap when operand EEW is not a supported FP type width

Run a vector FP instruction with SEW=8 (never a valid FP width). Also run with SEW=64 when FLEN=32 (no D extension). Test under normal conditions, with vl=0, and with vstart >= vl

trap

1-2 sew bins x 3 conditions (normal / vl=0 / vstart>=vl)

spec: V_fp_EEW_IEEE_nsupported_rsv; V_fp_eew_rsv; vstart_vl_dep; vtype-vill_op; vtype-vill_set

cp_ssstrictv_vzext_src_reserved

Confirm vzext instructions trap when source EEW is unsupported or source EMUL is below minimum

Run vzext.vf2/vf4/vf8 with SEW/LMUL combinations where source EEW (SEW/N) < 8 or source EMUL (LMUL/N) < 1/8. For vf2: SEW=8 or LMUL=mf8. For vf4: SEW⇐16 or LMUL⇐mf4. For vf8: SEW⇐32 or LMUL⇐mf2

trap

3 src_eew crosses (1+2+3 sew bins) + 3 src_emul crosses (1+2+3 lmul bins)

spec: RESERVED_VILL_SET; V_supported_eew; vzext_ill_eew_emul_rsv; vzext_vs_eew_emul

cp_ssstrictv_vadc_vsbc_vm1_reserved

Confirm vadc/vsbc trap when encoded with vm=1 (unmasked)

Run a vadc or vsbc instruction with vm=1 (the reserved unmasked encoding)

trap

2 funct6 bins (vadc and vsbc) x vm=1

vadc_vsbc_unmasked_rsv

spec: vadc_unmasked_rsv; vsbc_unmasked_rsv

cp_ssstrictv_vadc_vsbc_vd_v0_reserved

Confirm vadc/vsbc trap when vd is v0

Run a vadc or vsbc instruction with the destination register set to v0

trap

2 funct6 bins (vadc and vsbc) x vd=v0

does not depend on csr state: ? Isn’t this covered by the general masking case?
spec: vadc_vd_v0_rsv; vsbc_vd_v0_rsv

cp_ssstrictv_vmv_vs2_not_v0_reserved

Confirm vmv.v.v traps when vs2 is not v0

Run a vmv.v.v instruction with vs2 set to any register other than v0

trap

31 vs2 bins (v1-v31)

vmv_vs2_nv0_rsv

spec: vmv_vs2_nv0_rsv

cp_ssstrictv_vfp_widen_eew_unsupported

Confirm widening/narrowing FP instructions trap when wider operand EEW is not a supported FP type

Run a widening or narrowing vector FP instruction with SEW=32 when FLEN=32 (no D extension), so the wider operand EEW=64 is unsupported. Test under normal conditions, with vl=0, and with vstart >= vl

trap

1 sew bin x 3 conditions (normal / vl=0 / vstart>=vl)

spec: V_dependent_F_D; V_fp_EEW_IEEE_nsupported_rsv; V_fp_eew_rsv; Vf_requrires_Vx; Zve32f_dependent_F; vstart_vl_dep; vwop_vd_eew_emul

cp_ssstrictv_vfmv_vs2_not_v0_reserved

Confirm vfmv.v.f traps when vs2 is not v0

Run a vfmv.v.f instruction with vs2 set to any register other than v0

trap

31 vs2 bins (v1-v31)

vfmv_vs2_nv0_rsv

spec: epc_op_V_trap; vfmv_vs2_nv0_rsv; vstart_op_V_trap

cp_ssstrictv_mask_logical_vm0_reserved

Confirm mask logical instructions trap when vm=0

Run a vector mask logical instruction (vmand/vmnand/vmandn/vmxor/vmor/vmnor/vmorn/vmxnor) with vm=0 (masked encoding)

trap

8 funct6 bins x vm=0

vmasklogical_masked_rsv

spec: vmasklogical_masked_rsv; vmasklogical_unmasked

cp_ssstrictv_vid_vs2_not_v0_reserved

Confirm vid.v traps when vs2 is not v0

Run a vid.v instruction with vs2 set to any register other than v0

trap

31 vs2 bins (v1-v31)

vid_vs2_nv0_rsv

spec: vid_vs2_nv0_rsv

cp_ssstrictv_vmv_xs_sx_vm0_reserved

Confirm vmv.x.s and vmv.s.x trap when vm=0

Run a vmv.x.s or vmv.s.x instruction with vm=0 (masked encoding)

trap

2 funct3 bins x vm=0

vmv-s-x_vmv-x-s_masked_rsv

spec: vmv-s-x_masked_rsv; vmv-x-s_masked_rsv

cp_ssstrictv_vfmv_fs_sf_vm0_reserved

Confirm vfmv.f.s and vfmv.s.f trap when vm=0

Run a vfmv.f.s or vfmv.s.f instruction with vm=0 (masked encoding)

trap

2 funct3 bins x vm=0

vfmv-s-f_masked_rsv

spec: vfmv-s-f_masked_rsv

cp_ssstrictv_vslideup_vd_vs2_overlap

Confirm vslideup traps when destination register group overlaps source register group

Run a vslideup instruction where the vd register group overlaps the vs2 register group, at each LMUL={1,2,4,8}

trap

4 LMUL bins (1 overlap per LMUL)

vslideup_vreg_constr

does not depend on csr state: Only vd = vs1, nothing to do with lmul overlaps

cp_ssstrictv_vrgather_vd_vs2_overlap

Confirm vrgather traps when destination register group overlaps vs2 register group

Run a vrgather instruction where the vd register group overlaps the vs2 register group, at each LMUL={1,2,4,8}

trap

4 LMUL bins (1 overlap per LMUL)

vrgather_vrgatherei16_vreg_constr

does not depend on csr state: Only vd = vs1, nothing to do with lmul overlaps
spec: LMUL; vreg_overlap_rsv; vrgather_vreg_constr

cp_ssstrictv_vrgather_vd_vs1_overlap

Confirm vrgather.vv traps when destination register group overlaps vs1 register group

Run a vrgather.vv instruction where the vd register group overlaps the vs1 register group, at each LMUL={1,2,4,8}

trap

4 LMUL bins (1 overlap per LMUL)

does not depend on csr state: Only vd = vs1, nothing to do with lmul overlaps

cp_ssstrictv_vcompress_vd_vs2_overlap

Confirm vcompress traps when destination register group overlaps source register group

Run a vcompress instruction where the vd register group overlaps the vs2 register group, at each LMUL={1,2,4,8}

trap

4 LMUL bins (1 overlap per LMUL)

vcompress_vreg_constr

does not depend on csr state: Only vd = vs1, nothing to do with lmul overlaps
spec: LMUL; vcompress_vreg_constr; vreg_lmulge2_op; vreg_overlap_rsv

cp_ssstrictv_vcompress_vd_v0_overlap

Confirm vcompress traps when destination register group overlaps source mask register (v0)

Run a vcompress instruction where the vd register group overlaps v0 (the source mask register), at each LMUL={1,2,4,8}

trap

4 LMUL bins (vd=v0 at each LMUL)

does not depend on csr state: Only vd = v0, nothing to do with lmul overlaps

cp_ssstrictv_vmvnr_simm_reserved

Confirm whole register move traps when simm[4:0] is a reserved value

Run a vmv<nr>r.v instruction with simm[4:0] set to a value other than 0/1/3/7 (the reserved encodings)

trap

28 reserved simm bins (all simm values except 0/1/3/7)

vmv-nr-r_nreg_rsv
vmv-nr-r_enc

spec: epc_op_V_trap; vmv-nr-r_nreg_rsv; vstart_op_V_trap

cp_ssstrictv_vmvnr_reg_align

Confirm whole register move traps when both vd and vs2 are misaligned for the register group size

Run vmv2r.v/vmv4r.v/vmv8r.v with both vd and vs2 unaligned for the NREG group size (not divisible by NREG)

trap

3 NREG variants x all unaligned vd x all unaligned vs2

spec: vmv-nr-r_unaligned_rsv; vmv-nr-r_vreg_constr; vreg_offgroup_LMUL2_rsv; vreg_offgroup_LMUL4_rsv; vreg_offgroup_LMUL8_rsv

cp_ssstrictv_vcsr_reserved_bits

Confirm vcsr top XLEN-3 bits are reserved and read as zero

Write vcsr via CSRRx with non-zero values in bits [XLEN-1:3], confirm they read back as zero

no trap

1 bin (upper bits zero after write with non-zero source)

does not depend on csr state: ? is this Ssstrict, should we be testing WARL?
spec: vcsr-vxrm_acc; vcsr-vxsat_acc

cp_ssstrictv_masking_vd_v0_overlap

Confirm masked vector instruction traps when vd=v0 at any LMUL

Run a masked vector instruction with vd=v0 at each LMUL={1,2,4,8} where vd != vs1 and vd != vs2

trap

4 LMUL bins (vd=v0 masked at each LMUL)

does not depend on csr state: Again?

cp_ssstrictv_lmulgt1_off_group

Confirm vector instructions trap when register specifier is not aligned to LMUL group size

Run a vector instruction with LMUL={2,4,8} where vd, vs1, or vs2 is not aligned to the register group size (e.g., odd register for LMUL=2)

trap

9 crosses: 3 LMUL values x 3 register operands (vd, vs1, vs2), each with all unaligned registers

spec: EMUL_offgroup_rsv; vreg_offgroup_LMUL2_rsv; vreg_offgroup_LMUL4_rsv; vreg_offgroup_LMUL8_rsv

cp_ssstrictv_ls_eew_2x_elen

Confirm that all load/store trap when violating EEW = 2 * ELEN

Run vector load/store instructions with EEW encoded in the width field set to 2 * ELEN (e.g., if ELEN=64, attempt EEW=128 encoding)

trap

spec: Vector loads and stores have an EEW encoded directly in the instruction. If the EEW is not a supported width, the instruction encoding is reserved.
vector_ls_EEW; vector_ls_ins_rsv; vector_ls_mew_rsv

cp_ssstrictv_ls_emul_16

Confirm that all load/store trap when EMUL = 16

Run vector load/store instructions with SEW/LMUL/EEW combinations producing (EEW/SEW)*LMUL = 16 (e.g., EEW=64, SEW=8, LMUL=2)

trap

spec: If the EMUL would be out of range (EMUL>8 or EMUL<1/8), the instruction encoding is reserved
EEW_SEW_LMUL_dep; EMUL_SEW_LMUL_dep; EMUL_rsv; vector_ls_EMUL; vector_ls_EMUL_rsv

cp_ssstrictv_ls_emul_f16

Confirm that all load/store trap when EMUL = 1/16

Run vle8/vse8 with {SEW=16/LMUL=1/8, SEW=32/LMUL=1/4, SEW=64/LMUL=1/2} to produce EMUL=1/16 (out of range, must trap)

trap

3 SEW/LMUL bins

spec: If the EMUL would be out of range (EMUL>8 or EMUL<1/8), the instruction encoding is reserved
EEW_SEW_LMUL_dep; EMUL_SEW_LMUL_dep; vector_ls_EMUL; vector_ls_EMUL_rsv

cp_ssstrictv_ls_emul_nfields_16

Confirm that using 16 registers with strided instructions is reserved

Run segment load/store instructions with EMUL and NFIELDS combinations where EMUL * NFIELDS > 8 (e.g., EMUL=2, NFIELDS=5)

trap

spec: The EMUL setting must be such that EMUL * NFIELDS ≤ 8, otherwise the instruction encoding is reserved.
EMUL_NFIELDS_rsv

cp_ssstrictv_vslide1up_vd_vs2_overlap

Confirm vslide1up traps when destination register group overlaps source register group

Run vslide1up.vx with LMUL={1,2,4,8} where vd register group overlaps vs2 register group

trap

4 crosses: LMUL=1 (vd==vs2), LMUL=2 (group overlap), LMUL=4 (group overlap), LMUL=8 (group overlap)

vslide1up-vx_vreg_constr

spec: The vslide1up instruction requires that the destination vector register group does not overlap the source vector register group. Otherwise the instruction encoding is reserved.
LMUL; epc_op_V_trap; vreg_overlap_rsv; vslide1up-vx_vreg_constr; vstart_op_V_trap

cp_ssstrictv_vcompress_vstart_nonzero

Confirm that vcompress with non-zero vstart raises an illegal instruction exception

Run a vcompress instruction with vstart != 0

trap

1 cross: vstart nonzero × trap × vcompress encoding

spec: Executing a vcompress instruction with a non-zero vstart raises an illegal instruction exception.
vcompress_trap; vcompress_vstart_n0_ill

cp_ssstrictv_vcompress_vstart_report_zero

Confirm that a trap on vcompress is always reported with vstart of 0

Run a vcompress instruction that traps and verify vstart is 0 after the trap

trap

1 cross: vcompress encoding × trap × vstart=0 after

does not depend on csr state: Put this in ExcpetionsVx
spec: A trap on a vcompress instruction is always reported with a vstart of 0.
vcompress_trap; vstart_op_V_trap

cp_ssstrictv_vmvnr_off_group

Confirm that vmv<nr>r.v instructions trap with off-group base registers

Run vmv2r.v, vmv4r.v, vmv8r.v with vd or vs2 not aligned to NREG.
For vmv2r.v: vd or vs2 must be divisible by 2
For vmv4r.v: vd or vs2 must be divisible by 4
For vmv8r.v: vd or vs2 must be divisible by 8

trap

16 vd off-group + 24 vs2 off-group

spec: Whole register move: The source and destination vector register numbers must be aligned appropriately for the vector register group size, and encodings with other vector register numbers are reserved.
RESERVED_VILL_SET; vmv-nr-r_unaligned_rsv; vmv-nr-r_vreg_constr; vreg_offgroup_LMUL2_rsv; vreg_offgroup_LMUL4_rsv; vreg_offgroup_LMUL8_rsv

cp_ssstrictv_ls_seg_idx_vd_vs2_grp_overlap

Confirm that indexed segment loads with EMUL>1 trap when any destination register group overlaps the vs2 index register group

Set LMUL=2 and execute an indexed segment load where vs2 falls within one of the destination register groups (each spanning EMUL=2 registers)

trap

8 overlap scenarios across nf=2/3/4

spec: For vector indexed segment loads, the destination vector register groups cannot overlap the source vector register group (specified by vs2), else the instruction encoding is reserved.
vector_ls_seg_indexed_vreg_rsv; vreg_overlap_rsv

cp_ssstrictv_reserved_vcsrs

Confirm CSR addresses 0x00B-0x00E raise illegal instruction exceptions

Attempt to read/write CSR addresses 0x00B, 0x00C, 0x00D, 0x00E (reserved for future vector CSRs) and confirm each raises an illegal instruction trap

trap

4 CSR address bins

cp_ssstrictv_vsetvli_reserved_vsew

Confirm vsetvli/vsetivli with vsew[2:0] = 1xx sets vill

Run vsetvli or vsetivli with vsew field set to 3’b100, 3’b101, 3’b110, 3’b111 (reserved encodings) and verify vill is set to 1

vill set

4 vsew bins

does not depend on csr state: This is not part of Ssstrict
spec: vset_op; vtype-vill_set; vtype-vsew_rsv; vtype_acc

cp_ssstrictv_vsetvli_lmul_sew_ratio

Confirm vsetvli with unsupported LMUL/SEW ratio sets vill

Run vsetvli with LMUL and SEW combinations where LMUL < minSEW/ELEN (the ratio is unsupported), and verify vill is set

vill set

Cross of all LMUL x SEW combinations

does not depend on csr state: This is not part of Ssstrict
spec: vset_op; vtype-lmul_fval_rsv; vtype-sew_val; vtype-vill_set

cp_ssstrictv_ls_eew_lt_sewmin

Confirm vector load/store instructions trap when EEW < SEWMIN

Execute a vector load/store instruction with EEW (encoded in width field) smaller than the minimum supported SEW (SEWMIN). For example, vle8.v when SEWMIN > 8

trap

Should trap as reserved encoding

vector_ls_ins_rsv

does not depend on csr state: Specifically, we can test things like vle8, where the width is part of the instruction
spec: Vector loads and stores have an EEW encoded directly in the instruction. If the EEW is not a supported width, the instruction encoding is reserved.
Zve_eew; vector_ls_EEW; vector_ls_EEW_rsv; vector_ls_ins_req; vector_ls_ins_rsv

cp_ssstrictv_ls_mew_reserved

Confirm vector load/store instructions trap when mew bit is set

Run a vector load or store instruction with mew=1 (bit 28 of instruction) and confirm the encoding is reserved

trap

1 bin

vector_ls_mew_rsv

spec: vector_ls_mew_rsv

cp_ssstrictv_vzext_vf2_reserved

Confirm vzext.vf2 traps when source EEW < 8 or source EMUL < 1/8

Run vzext.vf2 with SEW=8 (source EEW=4, unsupported). Also run with LMUL=mf8 (source EMUL=1/16, below minimum)

trap

1 sew bin + 1 lmul bin

spec: RESERVED_VILL_SET; V_supported_eew; vtype-lmul_fval; vzext_ill_eew_emul_rsv; vzext_vs_eew_emul

cp_ssstrictv_vzext_vf4_reserved

Confirm vzext.vf4 traps when source EEW < 8 or source EMUL < 1/8

Run vzext.vf4 with SEW=8 (EEW=2) or SEW=16 (EEW=4). Also run with LMUL=mf8 (EMUL=1/32) or LMUL=mf4 (EMUL=1/16)

trap

2 sew bins + 2 lmul bins

spec: EMUL_rsv; RESERVED_VILL_SET; Zve_eew; vzext_ill_eew_emul_rsv; vzext_vs_eew_emul

cp_ssstrictv_vzext_vf8_reserved

Confirm vzext.vf8 traps when source EEW < 8 or source EMUL < 1/8

Run vzext.vf8 with SEW=8 (EEW=1) or SEW=16 (EEW=2) or SEW=32 (EEW=4). Also run with LMUL=mf8 (EMUL=1/64) or LMUL=mf4 (EMUL=1/32) or LMUL=mf2 (EMUL=1/16)

trap

3 sew bins + 3 lmul bins

spec: EMUL_rsv; RESERVED_VILL_SET; epc_op_V_trap; vtype-vill_op; vzext_ill_eew_emul_rsv; vzext_vs_eew_emul

cp_ssstrictv_vcompress_vm0_reserved

Confirm vcompress traps when vm=0

Run a vcompress instruction with vm=0 (masked encoding)

trap

1 funct6 x funct3 x vm=0

vcompress_masked_rsv
vcompress_enc

spec: vcompress_enc; vcompress_masked_rsv

cp_ssstrictv_vsext_src_reserved

Confirm vsext.vfN instructions trap when source EEW or source EMUL is out of range

Run vsext.vf2/vf4/vf8 with SEW values where source EEW = SEW/N < 8, or with fractional LMUL values where source EMUL = LMUL/N < 1/8

trap

6 crosses: 3 variants x 2 conditions (bad EEW, bad EMUL)

spec: The source EEW is smaller than SEW and the source EMUL is correspondingly smaller than LMUL. If the source EEW is not a supported SEW or the source EMUL would be below the minimum legal LMUL the instruction encoding is reserved.
RESERVED_VILL_SET; V_supported_eew; vsext_ill_eew_emul_rsv; vsext_vs_eew_emul

cp_ssstrictv_ext_emul_lt1_overlap

Confirm vzext/vsext instructions trap when source EMUL < 1 and vs2 overlaps vd group

Run vzext/vsext.vf2 with LMUL=1, vf4 with LMUL={1,2}, vf8 with LMUL={1,2,4} where source EMUL < 1 and vs2 overlaps the destination register group

trap

6 crosses: vf2 at LMUL=1, vf4 at LMUL={1,2}, vf8 at LMUL={1,2,4} each with overlap

spec: EMUL; EMUL_SEW_LMUL_dep; vreg_overlap_rsv; vsext_ill_eew_emul_rsv; vsext_op; vsext_vs_eew_emul; vzext_ill_eew_emul_rsv; vzext_op; vzext_vs_eew_emul

cp_ssstrictv_widen_max_sew

Confirm all widening instructions trap when SEW equals ELEN so destination EEW = 2*SEW exceeds ELEN

Run a widening instruction with SEW = {all supported} and LMUL = {1, 2, 4}; the instruction should trap only when SEW = MAX_SEW (destination EEW = 2*SEW > ELEN), including widening reductions

trap

all supported SEW x 3 LMUL bins

spec: The destination EEW must be a supported element width. For widening operations destination EEW = 2*SEW; when SEW = ELEN this exceeds the maximum supported element width and the instruction encoding is reserved.
ELEN; V_fp_EEW_IEEE_nsupported_rsv; V_supported_eew; epc_op_V_trap; vfwredosum_op; vfwredusum_op; vstart_op_V_trap; vwop_vd_eew_emul; vwredsum_op; vwredsumu_op

cp_ssstrictv_vsetvli_x0_x0_reserved

Confirm vsetvl{i} with rs1=x0 rd=x0 traps when VLMAX would change or vill was set

Run vsetvli with rs1=x0 and rd=x0 when (1) vill=1 beforehand, or (2) new SEW/LMUL would change VLMAX

trap

3 crosses: vill=1 case, new SEW differs case, new LMUL differs case

When rs1=x0 and rd=x0, the instruction operates as if the current vector length in vl is used as the AVL, and the resulting value is written to vl, but not to a destination register. This form can only be used when VLMAX and hence vl is not actually changed by the new SEW/LMUL ratio. Use of the instruction with a new SEW/LMUL ratio that would result in a change of VLMAX is reserved. Use of the instruction is also reserved if vill was 1 beforehand. Implementations may set vill in either case.
spec: VLMAX; vset_op; vsetvl_op; vtype-vill_op; vtype_vset_rsv

cp_ssstrictv_vsetvl_x0_x0_reserved

Confirm vsetvl with rs1=x0 rd=x0 traps when VLMAX would change or vill was set

Run vsetvl with rs1=x0 and rd=x0 when (1) vill=1 beforehand, or (2) new SEW/LMUL in rs2 would change VLMAX

trap

3 crosses: vill=1 case, new SEW differs case, new LMUL differs case

When rs1=x0 and rd=x0, the instruction operates as if the current vector length in vl is used as the AVL, and the resulting value is written to vl, but not to a destination register. This form can only be used when VLMAX and hence vl is not actually changed by the new SEW/LMUL ratio. Use of the instruction with a new SEW/LMUL ratio that would result in a change of VLMAX is reserved. Use of the instruction is also reserved if vill was 1 beforehand.
spec: vsetvl_op; vtype-vill_op; vtype_vset_rsv

cp_ssstrictv_ls_seg_vd_overflow_emulgt1

Confirm segment load/store traps when register groups increment past v31 with LMUL > 1

Run a segment load/store with LMUL={2,4} and NFIELDS/vd combinations where vd + NFIELDS * LMUL > 32 (e.g., LMUL=2 NFIELDS=2 vd=30, LMUL=4 NFIELDS=2 vd=28)

trap

7 (lmul, nf, vd) overflow bins

spec: If the vector register numbers accessed by the segment load or store would increment past 31, then the instruction encoding is reserved.
EMUL; LMUL; NFIELDS; vector_ls_seg_rsv; vreg_count

cp_ssstrictv_vlmul_100_reserved

Confirm vsetvli/vsetivli with reserved vlmul=100 encoding sets vill

Run vsetvli or vsetivli requesting vlmul=3’b100 (reserved encoding) and verify vill is set to 1 afterward

vlmul = {100}: The use of vtype encodings with LMUL < SEWMIN/ELEN is reserved, but implementations can set vill if they do not support these configurations.

1 cross: vlmul_100_requested × vill_set_after

does not depend on csr state: Is this Ssstrict?
spec: LMUL; RESERVED_VILL_SET; vset_op; vtype-lmul_fval_rsv; vtype-vill_set

cp_ssstrictv_ls_idx_emul_gt8

Confirm indexed load/store traps when index EMUL > 8

Run an indexed load/store with SEW/LMUL/index-EEW combinations where (index_EEW / SEW) * LMUL > 8

trap

10 (vlmul, vsew, width) reserved tuples

spec: If the EMUL would be out of range (EMUL>8 or EMUL<1/8), the instruction encoding is reserved.
EEW_SEW_LMUL_dep; EMUL_SEW_LMUL_dep; EMUL_rsv; vector_ls_EMUL; vector_ls_EMUL_rsv; vector_ls_indexed_EMUL; vector_ls_indexed_op

cp_ssstrictv_ls_idx_emul_lt_f8

Confirm indexed load/store traps when index EMUL < 1/8

Run an indexed load/store with SEW/LMUL/index-EEW combinations where (index_EEW / SEW) * LMUL < 1/8

trap

12 (vlmul, vsew, width) reserved tuples (ifdef-guarded for fractional LMUL and SEW support)

spec: If the EMUL would be out of range (EMUL>8 or EMUL<1/8), the instruction encoding is reserved.
EEW_SEW_LMUL_dep; EMUL_SEW_LMUL_dep; EMUL_rsv; vector_ls_EMUL; vector_ls_EMUL_rsv; vector_ls_indexed_EMUL; vector_ls_indexed_op

cp_vtype_walking1s

Confirm all XLEN bits of rs2 are checked when running vsetvl instruction

Set rs1 nonzero, rs2 = (one hot [all XLEN versions]) and run vsetvl rd, rs1, rs2
Running 1 hot confirms that every single bit is checked in rs2 when running vsetvl for reserved configurations

vtype.vill becomes 1 when there is a 1 in XLEN:8, otherwise it depends on which configurations are supported

XLEN 1 hot bins

feature: yes
does not depend on csr state: Is this Ssstrict?
spec: RESERVED_VILL_SET; vsetvl_op; vtype-vill_set; vtype-vill_sz; vtype-vlmul_sz; vtype-vma_sz; vtype-vsew_rsv; vtype-vsew_sz; vtype-vta_sz; vtype_acc; vtype_sz

vmsof.m, vmsif.m, vmsbf.m, viota

cp_exceptionsv_vd_vs2_overlap

Confirm that vd vs2 overlap is reserved

Run instruction with vd = {v8} = vs2
We run with v8 because this ensures its a legal register for all lmuls and does not overlap with v0 in case mask is active

reserved

1

viota_vreg_constr

spec: vmsof.m, vmsif.m, vmsbf.m: The destination register cannot overlap the source register and, if masked, cannot overlap the mask register ('v0').
Any instruction encoding that violates the overlap constraints is reserved.
vmsbf_vreg_constr; vmsif_vreg_constr; vmsof_vreg_constr; vreg_overlap_rsv

cp_exceptionsv_vd_vs1_overlap

Confirm that vd vs1 overlap is reserved

Run instruction with vd = {v8} = vs1
We run with v8 because this ensures its a legal register for all lmuls and does not overlap with v0 in case mask is active

reserved

1

spec: vmsof.m, vmsif.m, vmsbf.m: The destination register cannot overlap the source register and, if masked, cannot overlap the mask register ('v0').
Any instruction encoding that violates the overlap constraints is reserved.
vmsbf_vreg_constr; vmsif_vreg_constr; vmsof_vreg_constr; vreg_overlap_rsv

cp_exceptionsv_vd_v0_overlap_mask_active

Confirm that vd v0 overlap is reserved when the mask is active

Run instruction with vd = {v0} and mask active vm={0}

reserved

1

does not depend on csr state: Again?
spec: vmsof.m, vmsif.m, vmsbf.m: The destination register cannot overlap the source register and, if masked, cannot overlap the mask register ('v0').
Any instruction encoding that violates the overlap constraints is reserved.
vmsbf_vreg_constr; vmsif_vreg_constr; vmsof_vreg_constr; vreg_overlap_rsv; vreg_vmask_rsv

cp_ssstrictv_vstart_ge_vlmax

Confirm vstart >= VLMAX traps on any vector instruction with valid vtype

Set vtype to a valid configuration (vill=0) and set vstart >= VLMAX, then execute a vector instruction

trap

1 cross bin (vstart >= VLMAX & vill=0 & trap)

does not depend on csr state: Exceptions Suite
spec: vstart_val_rsv; vstart_vtype_dep

Table 303. SsstrictV Normative Rules
Normative Rule Rule Text Coverpoints

emul_nfields_rsv

The EMUL setting must be such that EMUL * NFIELDS ≤ 8, otherwise the instruction encoding is reserved.

SsstrictV_vlseg2e8_v_cg/cp_ssstrictv_ls_seg_vd_overflow

emul_offgroup_rsv

Using other than the lowest-numbered vector register to specify a vector register group is a reserved encoding.

Out-of-Scope: this behavior is unspecified even under Ssstrict, which does not cover CSR-state-dependent reserved conditions

emul_rsv

The largest vector register group used by an instruction can not be greater than 8 vector registers (i.e., EMUL≤8), and if a vector instruction would require greater than 8 vector registers in a group, the instruction encoding is reserved. For example, a widening operation that produces a widened vector register group result when LMUL=8 is reserved as this would imply a result EMUL=16.

Out-of-Scope: reserved behavior that is not covered by Ssstrict

V_fp_eew_ieee_nsupported_rsv

If the EEW of a vector floating-point operand does not correspond to a supported IEEE floating-point type, the instruction encoding is reserved.

ExceptionsVf16_vfmv_f_s_cg/cp_vill

V_fp_eew_rsv

Vector instructions where any floating-point vector operand’s EEW is not a supported floating-point type width (which includes when FLEN < SEW) are reserved.

ExceptionsVf16_vfadd_vv_cg/cp_vill

V_inv_frm_rsv

Use of the frm field when it contains an invalid rounding mode by any vector floating-point instruction—​even those that do not depend on the rounding mode—​is reserved, irrespective of the values of vstart and vl.

Out-of-Scope: Ssstrict does not apply to CSR values

egs_ge_vlmax_rsv

Vector instructions with EGS > VLMAX are reserved.

Out-of-Scope: no Ssstrict-equivalent suite exists for the vector-crypto (Zvk*) extensions, and this reserved condition depends on CSR state, matching Ssstrict’s own encoding-only scope boundary

egs_vl_rsv

When an operand is a vector of element groups, the vl setting must correspond to an integer multiple of the element group size, with other values of vl reserved.

Out-of-Scope: no Ssstrict-equivalent suite exists for the vector-crypto (Zvk*) extensions, and this reserved condition depends on CSR state, matching Ssstrict’s own encoding-only scope boundary

vadc_vsbc_unmasked_rsv

Encodings corresponding to the unmasked versions (vm=1) are reserved.

{SsstrictV_vadc_vvm_cg,SsstrictV_vsbc_vvm_cg}/cp_ssstrictv_vadc_vsbc_vm1_reserved

vadc_vsbc_vd_v0_rsv

For VADC and VSBC, the instruction encoding is reserved if the destination vector register is v0.

SsstrictV_vadc_vim_cg/cp_ssstrictv_masking_vd_eq_v0

vcompress_masked_rsv

The equivalent masked instruction (vm=0) is reserved.

SsstrictV_vcompress_vm_cg/cp_ssstrictv_vcompress_vm0_reserved

vector_ls_eew_rsv

If the implementation does not support the EEW of the offset elements, the instruction is reserved.

ExceptionsVls_vloxei16_v_cg/cp_exceptionsv_index_eew16

vector_ls_emul_offgroup_rsv

The vector register groups must have legal register specifiers for the selected EMUL, otherwise the instruction encoding is reserved.

SsstrictV_vl8re8_v_cg/cp_ssstrictv_ls_wr_nreg8_vd_unaligned

vector_ls_emul_rsv

If the EMUL would be out of range (EMUL>8 or EMUL<1/8), the instruction encoding is reserved.

ExceptionsVls_vloxei16_v_cg/cp_exceptionsv_index_eew16

vector_ls_ins_rsv

Vector load/store encodings for unsupported EEW widths are reserved.

SsstrictV_vle8_v_cg/cp_ssstrictv_ls_eew_lt_sewmin

vector_ls_mew_rsv

The mew bit (inst[28]) when set is expected to be used to encode expanded memory sizes of 128 bits and above, but these encodings are currently reserved.

SsstrictV_vle8_v_cg/cp_ssstrictv_ls_mew_reserved

vector_ls_seg_indexed_vreg_rsv

For vector indexed segment loads, the destination vector register groups cannot overlap the source vector register group (specified by vs2), else the instruction encoding is reserved.

SsstrictV_vloxseg2ei8_v_cg/cp_ssstrictv_ls_seg_idx_vd_vs2_overlap

vector_ls_seg_rsv

If the vector register numbers accessed by the segment load or store would increment past 31, then the instruction encoding is reserved.

SsstrictV_vlseg2e8_v_cg/cp_ssstrictv_ls_seg_vd_overflow

vector_ls_seg_wholereg_nf_rsv

Only NFIELDS values of 1, 2, 4, 8 are supported, with other values reserved.

SsstrictV_vl1re8_v_cg/cp_ssstrictv_ls_wr_nf_not_pow2, SsstrictV_vs1r_v_cg/cp_ssstrictv_ls_wr_nf_not_pow2

vfmv-s-f_masked_rsv

The encodings corresponding to the masked versions (vm=0) of VFMV.F.S and VFMV.S.F are reserved.

SsstrictV_vfmv_s_f_cg/cp_ssstrictv_vfmv_fs_sf_vm0_reserved

vfmv_vs2_nv0_rsv

The instruction must have the vs2 field set to v0, with all other values for vs2 reserved.

SsstrictV_vfmv_v_f_cg/cp_ssstrictv_vfmv_vs2_not_v0_reserved

vid_vs2_nv0_rsv

The vs2 field of the instruction must be set to v0, otherwise the encoding is reserved.

SsstrictV_vid_v_cg/cp_ssstrictv_vid_vs2_not_v0_reserved

vmasklogical_masked_rsv

so there are no inactive elements, and the encodings with vm=0 are reserved.

SsstrictV_vmand_mm_cg/cp_ssstrictv_mask_logical_vm0_reserved, SsstrictV_vmnand_mm_cg/cp_ssstrictv_mask_logical_vm0_reserved, SsstrictV_vmor_mm_cg/cp_ssstrictv_mask_logical_vm0_reserved, SsstrictV_vmxor_mm_cg/cp_ssstrictv_mask_logical_vm0_reserved

vmv-nr-r_nreg_rsv

The value of NREG must be 1, 2, 4, or 8, and values of imm[4:0] other than 0, 1, 3, and 7 are reserved.

SsstrictV_vmv1r_v_cg/cp_ssstrictv_vmvnr_simm_reserved

vmv-nr-r_unaligned_rsv

encodings with other vector register numbers are reserved.

SsstrictV_vmv4r_v_cg/cp_ssstrictv_vmv4r_both_unaligned

vmv-s-x_vmv-x-s_masked_rsv

The encodings corresponding to the masked versions (vm=0) of VMV.X.S and VMV.S.X are reserved.

SsstrictV_vmv_s_x_cg/cp_ssstrictv_vmv_xs_sx_vm0_reserved

vmv_vs2_nv0_rsv

The first operand specifier (vs2) must contain v0, and any other vector register number in vs2 is reserved.

SsstrictV_vmv_v_v_cg/cp_ssstrictv_vmv_vs2_not_v0_reserved, SsstrictV_vmv_v_x_cg/cp_ssstrictv_vmv_vs2_not_v0_reserved, SsstrictV_vmv_v_i_cg/cp_ssstrictv_vmv_vs2_not_v0_reserved

vreg_offgroup_lmul2_rsv

Instructions specifying an LMUL=2 vector register group with an odd-numbered vector register are reserved.

Out-of-Scope: reserved behavior that depends on prior CSR state is unspecified and outside Ssstrict’s encoding-only methodology

vreg_offgroup_lmul4_rsv

instructions specifying an LMUL=4 vector register group using vector register numbers that are not multiples of four are reserved.

Out-of-Scope: reserved behavior that depends on prior CSR state is unspecified and outside Ssstrict’s encoding-only methodology

vreg_offgroup_lmul8_rsv

instructions specifying an LMUL=8 vector register group using register numbers that are not multiples of eight are reserved.

Out-of-Scope: reserved behavior that depends on prior CSR state is unspecified and outside Ssstrict’s encoding-only methodology

vreg_overlap_rsv

Any instruction encoding that violates the overlap constraints is reserved.

SsstrictV_vwadd_wv_cg/cp_ssstrictv_widening_source_overlap

vreg_source_eew_rsv

A vector register cannot be used to provide source operands with more than one EEW for a single instruction. A mask register source is considered to have EEW=1 for this constraint. An encoding that would result in the same vector register being read with two or more different EEWs, including when the vector register appears at different positions within two or more vector register groups, is reserved.

SsstrictV_vwadd_wv_cg/cp_ssstrictv_widening_source_overlap

vreg_vmask_rsv

The destination vector register group for a masked vector instruction cannot overlap the source mask register (v0), unless the destination vector register is being written with a mask value (e.g., compares) or the scalar result of a reduction. These instruction encodings are reserved.

SsstrictV_vadd_vv_cg/cp_ssstrictv_masking_vd_eq_v0

vsext_vzext_ill_eew_emul_rsv

If the source EEW is not a supported width, or source EMUL would be below the minimum legal LMUL, the instruction encoding is reserved.

ExceptionsVx_vsext_vf2_cg/cp_vill

vstart_val_rsv

The use of vstart values greater than the largest element index for the current vtype setting is reserved.

ExceptionsVx_vsaddu_vv_cg/cp_vstart_gt_vl

vtype_lmul_fval_rsv

The use of vtype encodings with LMUL < SEWMIN/min(ELEN, VLEN) is reserved, but implementations can set VILL if they do not support these configurations.

Sm_V_cg/cp_vtype_vill_set_vl_0

vtype_vset_rsv

Use of the instructions with a new SEW/LMUL ratio that would result in a change of VLMAX is reserved. Use of the instructions is also reserved if VILL was 1 beforehand.

Out-of-Scope: we cannot test reserved behavior that depends on prior vill state; outside Ssstrict’s encoding-only methodology

vclmul_sewn64_rsv

SEW is any value other than 64

Out-of-Scope: reserved because of CSR state (vtype.sew); no Ssstrict-equivalent suite exists for Zvbc to exercise this reserved SEW encoding

vclmulh_sewn64_rsv

SEW is any value other than 64

Out-of-Scope: reserved because of CSR state (vtype.sew); no Ssstrict-equivalent suite exists for Zvbc to exercise this reserved SEW encoding

veccrypto_sew_rsv

Some Vector Crypto instructions are only defined for a specific SEW. In such a case all other SEW values are reserved.

Out-of-Scope: reserved because of CSR state (vtype.sew); no Ssstrict-equivalent suite exists to exercise these reserved SEW encodings; see the per-instruction _sewn32_rsv/_sewn64_rsv rules in each extension’s own file

veccrypto_vl_vstart_rsv

Instructions that violate the vl or vstart requirements are reserved.

TODO: no Ssstrict-equivalent suite exists for the vector-crypto extensions to exercise vl/vstart values that violate the EGS constraint

vghsh-vv_sewn32_rsv

SEW is any value other than 32

Out-of-Scope: reserved because of CSR state (vtype.sew); Zvkg only generates SEW=32 tests and there is no Ssstrict-equivalent suite for vector-crypto

vgmul-vv_sewn32_rsv

SEW is any value other than 32

Out-of-Scope: reserved because of CSR state (vtype.sew); Zvkg only generates SEW=32 tests and there is no Ssstrict-equivalent suite for vector-crypto

vsha2chl-vv_Zvknha_sewn32_rsv

Zvknha: SEW is any value other than 32

Out-of-Scope: reserved because of CSR state (vtype.sew); no suite drives it to a reserved value under Zvknha and there is no Ssstrict-equivalent suite for vector-crypto

vsha2chl-vv_Zvknhb_sewn32or64_rsv

Zvknhb: SEW is any value other than 32 or 64

Out-of-Scope: reserved because of CSR state (vtype.sew); no suite drives it to a reserved value under Zvknhb and there is no Ssstrict-equivalent suite for vector-crypto

vsha2chl-vv_vdoverlapvs1vs2_rsv

The vd register group overlaps with either vs1 or vs2

TODO: this is an SsstrictV-style reserved-encoding test; no cmp_vd_vs1/cmp_vd_vs2-style register-aliasing coverpoint exists for this suite and no SsstrictV-equivalent suite exists for vector crypto

vsha2ms-vv_Zvknha_sewn32_rsv

Zvknha: SEW is any value other than 32

Out-of-Scope: reserved because of CSR state (vtype.sew); no suite drives it to a reserved value under Zvknha and there is no Ssstrict-equivalent suite for vector-crypto

vsha2ms-vv_Zvknhb_sewn32or64_rsv

Zvknhb: SEW is any value other than 32 or 64

Out-of-Scope: reserved because of CSR state (vtype.sew); no suite drives it to a reserved value under Zvknhb and there is no Ssstrict-equivalent suite for vector-crypto

vsha2ms-vv_vdoverlapvs1vs2_rsv

The vd register group overlaps with either vs1 or vs2

TODO: this is an SsstrictV-style reserved-encoding test; no cmp_vd_vs1/cmp_vd_vs2-style register-aliasing coverpoint exists for this suite and no SsstrictV-equivalent suite exists for vector crypto

vsm3c-vi_sewn32_rsv

SEW is any value other than 32

Out-of-Scope: reserved because of CSR state (vtype.sew); Zvksh only generates SEW=32 tests and there is no Ssstrict-equivalent suite for vector-crypto

vsm3c-vi_vdoverlapvs2_rsv

The vd register group overlaps with the vs2 register group

TODO: this is an SsstrictV-style reserved-encoding test; Zvksh_vsm3c_vi_cg has no vd/vs2 register-aliasing coverpoint and there is no Ssstrict-equivalent suite for vector-crypto

vsm3me-vv_sewn32_rsv

SEW is any value other than 32

Out-of-Scope: reserved because of CSR state (vtype.sew); Zvksh only generates SEW=32 tests and there is no Ssstrict-equivalent suite for vector-crypto

vsm3me-vv_vdoverlapvs2_rsv

The vd register group overlaps with the vs2 register group.

TODO: this is an SsstrictV-style reserved-encoding test; Zvksh_vsm3me_vv_cg has no vd/vs2 register-aliasing coverpoint (only vd/vs1 and vs1/vs2) and there is no Ssstrict-equivalent suite for vector-crypto

vsm4k-vi_sewn32_rsv

SEW is any value other than 32

Out-of-Scope: reserved because of CSR state (vtype.sew); Zvksed only generates SEW=32 tests and there is no Ssstrict-equivalent suite for vector-crypto

vsm4r-vs_vdoverlapvs2_rsv

Only for the *.VS form: the vd register group overlaps the vs2 register

TODO: this is an SsstrictV-style reserved-encoding test; Zvksed_vsm4r_vs_cg has no vd/vs2 register-aliasing coverpoint and there is no Ssstrict-equivalent suite for vector-crypto

vsm4r_sewn32_rsv

SEW is any value other than 32

Out-of-Scope: reserved because of CSR state (vtype.sew); Zvksed only generates SEW=32 tests and there is no Ssstrict-equivalent suite for vector-crypto

veccrypto_vsins_vdvs2overlap

For implementations with VLEN ≥ 128, vs2 refers to a single register. Thus, the vd register group must not overlap the vs2 register. However, in implementations where VLEN < 128, vs2 refers to a register group comprised of the number of registers needed to hold the 128-bit scalar element group. In this case, the vd register group must not overlap this vs2 register group.

TODO

UDB Parameters: None.

B.10.3. ExceptionsVx Vector Integer Exceptions

The vector exception tests exercise everything else that might cause exceptions aside from misalignment and reserved instructions.

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. Some tests always trap, such as access faults. Other tests may either succeed or trap depending on a parameter. For example, an implementation may trap on nonzero vstart values, or may execute them in hardware.

Table 304. ExceptionsVx Instruction Coverpoints
Instruction vadd.vv vadd.vx vadd.vi vwadd.vv vwadd.vx vwaddu.vv vwaddu.vx vwadd.wv vwadd.wx vwaddu.wv vwaddu.wx vsub.vv

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vsub.vx vwsub.vv vwsub.vx vwsubu.vv vwsubu.vx vwsub.wv vwsub.wx vwsubu.wv vwsubu.wx vrsub.vx vrsub.vi vzext.vf2

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vzext.vf4 vzext.vf8 vsext.vf2 vsext.vf4 vsext.vf8 vadc.vvm vadc.vxm vadc.vim vsbc.vvm vsbc.vxm vmadc.vvm vmadc.vxm

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vmadc.vim vmadc.vv vmadc.vx vmadc.vi vmsbc.vvm vmsbc.vxm vmsbc.vv vmsbc.vx vand.vv vand.vx vand.vi vor.vv

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vor.vx vor.vi vxor.vv vxor.vx vxor.vi vsll.vv vsll.vx vsll.vi vsrl.vv vsrl.vx vsrl.vi vnsrl.wv

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vnsrl.wx vnsrl.wi vsra.vv vsra.vx vsra.vi vnsra.wv vnsra.wx vnsra.wi vmseq.vv vmseq.vx vmseq.vi vmsne.vv

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vmsne.vx vmsne.vi vmslt.vv vmslt.vx vmsltu.vv vmsltu.vx vmsle.vv vmsle.vx vmsle.vi vmsleu.vv vmsleu.vx vmsleu.vi

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vmsgt.vx vmsgt.vi vmsgtu.vx vmsgtu.vi vmin.vv vmin.vx vminu.vv vminu.vx vmax.vv vmax.vx vmaxu.vv vmaxu.vx

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vmul.vv vmul.vx vmulh.vv vmulh.vx vmulhu.vv vmulhu.vx vmulhsu.vv vmulhsu.vx vwmul.vv vwmul.vx vwmulu.vv vwmulu.vx

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vwmulsu.vv vwmulsu.vx vdiv.vv vdiv.vx vdivu.vv vdivu.vx vrem.vv vrem.vx vremu.vv vremu.vx vmacc.vv vmacc.vx

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vnmsac.vv vnmsac.vx vmadd.vv vmadd.vx vnmsub.vv vnmsub.vx vwmacc.vv vwmacc.vx vwmaccu.vv vwmaccu.vx vwmaccsu.vv vwmaccsu.vx

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vwmaccus.vx vmerge.vvm vmerge.vxm vmerge.vim vmv.v.v vmv.v.x vmv.v.i vsadd.vv vsadd.vx vsadd.vi vsaddu.vv vsaddu.vx

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vsaddu.vi vssub.vv vssub.vx vssubu.vv vssubu.vx vaadd.vv vaadd.vx vaaddu.vv vaaddu.vx vasub.vv vasub.vx vasubu.vv

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vasubu.vx vsmul.vv vsmul.vx vssrl.vv vssrl.vx vssrl.vi vssra.vv vssra.vx vssra.vi vnclip.wv vnclip.wx vnclip.wi

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vnclipu.wv vnclipu.wx vnclipu.wi vredsum.vs vwredsum.vs vwredsumu.vs vredmax.vs vredmaxu.vs vredmin.vs vredminu.vs vredand.vs vredor.vs

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vredxor.vs vmand.mm vmnand.mm vmandn.mm vmxor.mm vmor.mm vmnor.mm vmorn.mm vmxnor.mm vcpop.m vfirst.m vmsbf.m

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vmsif.m vmsof.m viota.m vid.v vmv.x.s vmv.s.x vslideup.vx vslideup.vi vslidedown.vx vslidedown.vi vslide1up.vx vslide1down.vx

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vrgather.vv vrgather.vx vrgather.vi vrgatherei16.vv vcompress.vm vmv1r.v vmv2r.v vmv4r.v vmv8r.v

RV32

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

Table 305. ExceptionsVx Normative Rules
Normative Rule Rule Text Coverpoints

vstart_unmodified

vstart is not modified by vector instructions that raise illegal-instruction exceptions.

TODO: no coverpoint checks that vstart is unmodified after an illegal-instruction exception; cp_vstart only checks that the exception is raised

vstart_val_rsv

The use of vstart values greater than the largest element index for the current vtype setting is reserved.

ExceptionsVx_vsaddu_vv_cg/cp_vstart_gt_vl

vstart_vtype_dep

Implementations are permitted to raise illegal-instruction exceptions when attempting to execute a vector instruction with a value of vstart that the implementation can never produce when executing that same instruction with the same vtype setting.

Untestable: implementations are permitted, not required, to raise this exception, so no behavior can be asserted

UDB Parameters: None.

B.10.4. ExceptionsVf Vector Floating-Point Exceptions

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. They test operations that may either succeed or trap depending on a parameter.

Table 306. ExceptionsVf Instruction Coverpoints
Instruction vfadd.vv vfadd.vf vfwadd.vv vfwadd.vf vfwadd.wv vfwadd.wf vfsub.vv vfsub.vf vfwsub.vv vfwsub.vf vfwsub.wv vfwsub.wf

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

cp_mstatus_vs_off

x

x

x

x

x

x

x

x

x

x

x

x

cp_mstatus_fs_off

x

x

x

x

x

x

x

x

x

x

x

x

cp_vectorfp_mstatus_fs_state

x

x

x

x

x

x

x

x

x

x

x

x

cp_vectorfp_mstatus_fs_state_nonaffecting

x

x

x

x

x

x

x

x

x

x

x

x

cp_vectorfp_mstatus_fs_state_affecting_register

x

x

x

x

x

x

x

x

x

x

x

x

cp_vectorfp_mstatus_fs_state_affecting_csr

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vfrsub.vf vfmul.vv vfmul.vf vfwmul.vv vfwmul.vf vfdiv.vv vfdiv.vf vfrdiv.vf vfmacc.vv vfmacc.vf vfnmacc.vv vfnmacc.vf

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

cp_mstatus_vs_off

x

x

x

x

x

x

x

x

x

x

x

x

cp_mstatus_fs_off

x

x

x

x

x

x

x

x

x

x

x

x

cp_vectorfp_mstatus_fs_state

x

x

x

x

x

x

x

x

x

x

x

x

cp_vectorfp_mstatus_fs_state_nonaffecting

x

x

x

x

x

x

x

x

x

x

x

x

cp_vectorfp_mstatus_fs_state_affecting_register

x

x

x

x

x

x

x

x

x

x

x

x

cp_vectorfp_mstatus_fs_state_affecting_csr

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vfmsac.vv vfmsac.vf vfnmsac.vv vfnmsac.vf vfmadd.vv vfmadd.vf vfnmadd.vv vfnmadd.vf vfmsub.vv vfmsub.vf vfnmsub.vv vfnmsub.vf

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

cp_mstatus_vs_off

x

x

x

x

x

x

x

x

x

x

x

x

cp_mstatus_fs_off

x

x

x

x

x

x

x

x

x

x

x

x

cp_vectorfp_mstatus_fs_state

x

x

x

x

x

x

x

x

x

x

x

x

cp_vectorfp_mstatus_fs_state_nonaffecting

x

x

x

x

x

x

x

x

x

x

x

x

cp_vectorfp_mstatus_fs_state_affecting_register

x

x

x

x

x

x

x

x

x

x

x

x

cp_vectorfp_mstatus_fs_state_affecting_csr

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vfwmacc.vv vfwmacc.vf vfwnmacc.vv vfwnmacc.vf vfwmsac.vv vfwmsac.vf vfwnmsac.vv vfwnmsac.vf vfsqrt.v vfrsqrt7.v vfrec7.v vfmin.vv

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

cp_mstatus_vs_off

x

x

x

x

x

x

x

x

x

x

x

x

cp_mstatus_fs_off

x

x

x

x

x

x

x

x

x

x

x

x

cp_vectorfp_mstatus_fs_state

x

x

x

x

x

x

x

x

x

x

x

x

cp_vectorfp_mstatus_fs_state_nonaffecting

x

x

x

x

x

x

x

x

x

x

x

x

cp_vectorfp_mstatus_fs_state_affecting_register

x

x

x

x

x

x

x

x

x

x

x

x

cp_vectorfp_mstatus_fs_state_affecting_csr

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vfmin.vf vfmax.vv vfmax.vf vfsgnj.vv vfsgnj.vf vfsgnjn.vv vfsgnjn.vf vfsgnjx.vv vfsgnjx.vf vfredosum.vs vfwredosum.vs vfredusum.vs

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

cp_mstatus_vs_off

x

x

x

x

x

x

x

x

x

x

x

x

cp_mstatus_fs_off

x

x

x

x

x

x

x

x

x

x

x

x

cp_vectorfp_mstatus_fs_state

x

x

x

x

x

x

x

x

x

x

x

x

cp_vectorfp_mstatus_fs_state_nonaffecting

x

x

x

x

x

x

x

x

x

x

x

x

cp_vectorfp_mstatus_fs_state_affecting_register

x

x

x

x

x

x

x

x

x

x

x

x

cp_vectorfp_mstatus_fs_state_affecting_csr

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vfwredusum.vs vfredmax.vs vfredmin.vs vmfeq.vv vmfeq.vf vmfne.vv vmfne.vf vmflt.vv vmflt.vf vmfle.vv vmfle.vf vmfgt.vf

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

cp_mstatus_vs_off

x

x

x

x

x

x

x

x

x

x

x

x

cp_mstatus_fs_off

x

x

x

x

x

x

x

x

x

x

x

x

cp_vectorfp_mstatus_fs_state

x

x

x

x

x

x

x

x

x

x

x

x

cp_vectorfp_mstatus_fs_state_nonaffecting

x

x

x

x

x

x

x

x

x

x

x

x

cp_vectorfp_mstatus_fs_state_affecting_register

x

x

x

x

x

x

x

x

x

x

x

x

cp_vectorfp_mstatus_fs_state_affecting_csr

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vmfge.vf vfmerge.vfm vfmv.v.f vfmv.f.s vfmv.s.f vfslide1up.vf vfslide1down.vf vfcvt.xu.f.v vfwcvt.xu.f.v vfncvt.xu.f.w vfcvt.x.f.v vfwcvt.x.f.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

cp_mstatus_vs_off

x

x

x

x

x

x

x

x

x

x

x

x

cp_mstatus_fs_off

x

x

x

x

x

x

x

x

x

x

x

x

cp_vectorfp_mstatus_fs_state

x

x

x

x

x

x

x

x

x

x

x

x

cp_vectorfp_mstatus_fs_state_nonaffecting

x

x

x

x

x

x

x

x

x

x

x

x

cp_vectorfp_mstatus_fs_state_affecting_register

x

x

x

x

x

x

x

x

x

x

x

x

cp_vectorfp_mstatus_fs_state_affecting_csr

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vfncvt.x.f.w vfcvt.rtz.xu.f.v vfwcvt.rtz.xu.f.v vfncvt.rtz.xu.f.w vfcvt.rtz.x.f.v vfwcvt.rtz.x.f.v vfncvt.rtz.x.f.w vfcvt.f.xu.v vfwcvt.f.xu.v vfncvt.f.xu.w vfcvt.f.x.v vfwcvt.f.x.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

cp_mstatus_vs_off

x

x

x

x

x

x

x

x

x

x

x

x

cp_mstatus_fs_off

x

x

x

x

x

x

x

x

x

x

x

x

cp_vectorfp_mstatus_fs_state

x

x

x

x

x

x

x

x

x

x

x

x

cp_vectorfp_mstatus_fs_state_nonaffecting

x

x

x

x

x

x

x

x

x

x

x

x

cp_vectorfp_mstatus_fs_state_affecting_register

x

x

x

x

x

x

x

x

x

x

x

x

cp_vectorfp_mstatus_fs_state_affecting_csr

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vfncvt.f.x.w vfwcvt.f.f.v vfncvt.f.f.w vfncvt.rod.f.f.w vfclass.v

RV32

x

x

x

x

x

RV64

x

x

x

x

x

EFFEW16

x

x

x

x

EFFEW32

x

x

x

x

EFFEW64

x

cp_vill

x

x

x

x

x

cp_vstart

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

cp_mstatus_vs_off

x

x

x

x

x

cp_mstatus_fs_off

x

x

x

x

x

cp_vectorfp_mstatus_fs_state

x

x

x

x

x

cp_vectorfp_mstatus_fs_state_nonaffecting

x

x

x

x

x

cp_vectorfp_mstatus_fs_state_affecting_register

x

x

x

x

x

cp_vectorfp_mstatus_fs_state_affecting_csr

x

x

x

x

x

Table 307. ExceptionsVf Normative Rules
Normative Rule Rule Text Coverpoints

V_fp_eew_ieee_nsupported_rsv

If the EEW of a vector floating-point operand does not correspond to a supported IEEE floating-point type, the instruction encoding is reserved.

ExceptionsVf16_vfmv_f_s_cg/cp_vill

UDB Parameters: None.

B.10.5. ExceptionsVls Vector Load/Store Exceptions

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. They test operations that may either succeed or trap depending on a parameter.

Table 308. ExceptionsVls Instruction Coverpoints
Instruction vle8.v vle16.v vle32.v vle64.v vlseg2e8.v vlseg2e16.v vlseg2e32.v vlseg2e64.v vlseg3e8.v vlseg3e16.v vlseg3e32.v vlseg3e64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_LS

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_address_fault

x

x

x

x

x

x

x

x

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vlseg4e8.v vlseg4e16.v vlseg4e32.v vlseg4e64.v vlseg5e8.v vlseg5e16.v vlseg5e32.v vlseg5e64.v vlseg6e8.v vlseg6e16.v vlseg6e32.v vlseg6e64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_LS

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_address_fault

x

x

x

x

x

x

x

x

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vlseg7e8.v vlseg7e16.v vlseg7e32.v vlseg7e64.v vlseg8e8.v vlseg8e16.v vlseg8e32.v vlseg8e64.v vle8ff.v vle16ff.v vle32ff.v vle64ff.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_LS

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_ffLS

x

x

x

x

cp_exceptionsv_address_fault

x

x

x

x

x

x

x

x

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vlseg2e8ff.v vlseg2e16ff.v vlseg2e32ff.v vlseg2e64ff.v vlseg3e8ff.v vlseg3e16ff.v vlseg3e32ff.v vlseg3e64ff.v vlseg4e8ff.v vlseg4e16ff.v vlseg4e32ff.v vlseg4e64ff.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_LS

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_ffLS

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_address_fault

x

x

x

x

x

x

x

x

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vlseg5e8ff.v vlseg5e16ff.v vlseg5e32ff.v vlseg5e64ff.v vlseg6e8ff.v vlseg6e16ff.v vlseg6e32ff.v vlseg6e64ff.v vlseg7e8ff.v vlseg7e16ff.v vlseg7e32ff.v vlseg7e64ff.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_LS

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_ffLS

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_address_fault

x

x

x

x

x

x

x

x

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vlseg8e8ff.v vlseg8e16ff.v vlseg8e32ff.v vlseg8e64ff.v vlse8.v vlse16.v vlse32.v vlse64.v vlsseg2e8.v vlsseg2e16.v vlsseg2e32.v vlsseg2e64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_LS

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_ffLS

x

x

x

x

cp_exceptionsv_address_fault

x

x

x

x

x

x

x

x

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vlsseg3e8.v vlsseg3e16.v vlsseg3e32.v vlsseg3e64.v vlsseg4e8.v vlsseg4e16.v vlsseg4e32.v vlsseg4e64.v vlsseg5e8.v vlsseg5e16.v vlsseg5e32.v vlsseg5e64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_LS

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_address_fault

x

x

x

x

x

x

x

x

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vlsseg6e8.v vlsseg6e16.v vlsseg6e32.v vlsseg6e64.v vlsseg7e8.v vlsseg7e16.v vlsseg7e32.v vlsseg7e64.v vlsseg8e8.v vlsseg8e16.v vlsseg8e32.v vlsseg8e64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_LS

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_address_fault

x

x

x

x

x

x

x

x

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vluxei8.v vluxei16.v vluxei32.v vluxei64.v vluxseg2ei8.v vluxseg2ei16.v vluxseg2ei32.v vluxseg2ei64.v vluxseg3ei8.v vluxseg3ei16.v vluxseg3ei32.v vluxseg3ei64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_LS

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_address_fault

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_index_eew16

x

x

x

cp_exceptionsv_index_eew32

x

x

x

cp_exceptionsv_index_eew64

x

x

x

cp_exceptionsv_indexed

x

x

x

x

x

x

x

x

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vluxseg4ei8.v vluxseg4ei16.v vluxseg4ei32.v vluxseg4ei64.v vluxseg5ei8.v vluxseg5ei16.v vluxseg5ei32.v vluxseg5ei64.v vluxseg6ei8.v vluxseg6ei16.v vluxseg6ei32.v vluxseg6ei64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_LS

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_address_fault

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_index_eew16

x

x

x

cp_exceptionsv_index_eew32

x

x

x

cp_exceptionsv_index_eew64

x

x

x

cp_exceptionsv_indexed

x

x

x

x

x

x

x

x

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vluxseg7ei8.v vluxseg7ei16.v vluxseg7ei32.v vluxseg7ei64.v vluxseg8ei8.v vluxseg8ei16.v vluxseg8ei32.v vluxseg8ei64.v vloxei8.v vloxei16.v vloxei32.v vloxei64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_LS

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_address_fault

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_index_eew16

x

x

x

cp_exceptionsv_index_eew32

x

x

x

cp_exceptionsv_index_eew64

x

x

x

cp_exceptionsv_indexed

x

x

x

x

x

x

x

x

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vloxseg2ei8.v vloxseg2ei16.v vloxseg2ei32.v vloxseg2ei64.v vloxseg3ei8.v vloxseg3ei16.v vloxseg3ei32.v vloxseg3ei64.v vloxseg4ei8.v vloxseg4ei16.v vloxseg4ei32.v vloxseg4ei64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_LS

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_address_fault

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_index_eew16

x

x

x

cp_exceptionsv_index_eew32

x

x

x

cp_exceptionsv_index_eew64

x

x

x

cp_exceptionsv_indexed

x

x

x

x

x

x

x

x

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vloxseg5ei8.v vloxseg5ei16.v vloxseg5ei32.v vloxseg5ei64.v vloxseg6ei8.v vloxseg6ei16.v vloxseg6ei32.v vloxseg6ei64.v vloxseg7ei8.v vloxseg7ei16.v vloxseg7ei32.v vloxseg7ei64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_LS

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_address_fault

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_index_eew16

x

x

x

cp_exceptionsv_index_eew32

x

x

x

cp_exceptionsv_index_eew64

x

x

x

cp_exceptionsv_indexed

x

x

x

x

x

x

x

x

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vloxseg8ei8.v vloxseg8ei16.v vloxseg8ei32.v vloxseg8ei64.v vse8.v vse16.v vse32.v vse64.v vsseg2e8.v vsseg2e16.v vsseg2e32.v vsseg2e64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_LS

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_address_fault

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_index_eew16

x

cp_exceptionsv_index_eew32

x

cp_exceptionsv_index_eew64

x

cp_exceptionsv_indexed

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vsseg3e8.v vsseg3e16.v vsseg3e32.v vsseg3e64.v vsseg4e8.v vsseg4e16.v vsseg4e32.v vsseg4e64.v vsseg5e8.v vsseg5e16.v vsseg5e32.v vsseg5e64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_LS

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_address_fault

x

x

x

x

x

x

x

x

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vsseg6e8.v vsseg6e16.v vsseg6e32.v vsseg6e64.v vsseg7e8.v vsseg7e16.v vsseg7e32.v vsseg7e64.v vsseg8e8.v vsseg8e16.v vsseg8e32.v vsseg8e64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_LS

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_address_fault

x

x

x

x

x

x

x

x

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vsse8.v vsse16.v vsse32.v vsse64.v vssseg2e8.v vssseg2e16.v vssseg2e32.v vssseg2e64.v vssseg3e8.v vssseg3e16.v vssseg3e32.v vssseg3e64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_LS

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_address_fault

x

x

x

x

x

x

x

x

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vssseg4e8.v vssseg4e16.v vssseg4e32.v vssseg4e64.v vssseg5e8.v vssseg5e16.v vssseg5e32.v vssseg5e64.v vssseg6e8.v vssseg6e16.v vssseg6e32.v vssseg6e64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_LS

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_address_fault

x

x

x

x

x

x

x

x

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vssseg7e8.v vssseg7e16.v vssseg7e32.v vssseg7e64.v vssseg8e8.v vssseg8e16.v vssseg8e32.v vssseg8e64.v vsuxei8.v vsuxei16.v vsuxei32.v vsuxei64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_LS

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_address_fault

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_index_eew16

x

cp_exceptionsv_index_eew32

x

cp_exceptionsv_index_eew64

x

cp_exceptionsv_indexed

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vsuxseg2ei8.v vsuxseg2ei16.v vsuxseg2ei32.v vsuxseg2ei64.v vsuxseg3ei8.v vsuxseg3ei16.v vsuxseg3ei32.v vsuxseg3ei64.v vsuxseg4ei8.v vsuxseg4ei16.v vsuxseg4ei32.v vsuxseg4ei64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_LS

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_address_fault

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_index_eew16

x

x

x

cp_exceptionsv_index_eew32

x

x

x

cp_exceptionsv_index_eew64

x

x

x

cp_exceptionsv_indexed

x

x

x

x

x

x

x

x

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vsuxseg5ei8.v vsuxseg5ei16.v vsuxseg5ei32.v vsuxseg5ei64.v vsuxseg6ei8.v vsuxseg6ei16.v vsuxseg6ei32.v vsuxseg6ei64.v vsuxseg7ei8.v vsuxseg7ei16.v vsuxseg7ei32.v vsuxseg7ei64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_LS

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_address_fault

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_index_eew16

x

x

x

cp_exceptionsv_index_eew32

x

x

x

cp_exceptionsv_index_eew64

x

x

x

cp_exceptionsv_indexed

x

x

x

x

x

x

x

x

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vsuxseg8ei8.v vsuxseg8ei16.v vsuxseg8ei32.v vsuxseg8ei64.v vsoxei8.v vsoxei16.v vsoxei32.v vsoxei64.v vsoxseg2ei8.v vsoxseg2ei16.v vsoxseg2ei32.v vsoxseg2ei64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_LS

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_address_fault

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_index_eew16

x

x

x

cp_exceptionsv_index_eew32

x

x

x

cp_exceptionsv_index_eew64

x

x

x

cp_exceptionsv_indexed

x

x

x

x

x

x

x

x

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vsoxseg3ei8.v vsoxseg3ei16.v vsoxseg3ei32.v vsoxseg3ei64.v vsoxseg4ei8.v vsoxseg4ei16.v vsoxseg4ei32.v vsoxseg4ei64.v vsoxseg5ei8.v vsoxseg5ei16.v vsoxseg5ei32.v vsoxseg5ei64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_LS

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_address_fault

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_index_eew16

x

x

x

cp_exceptionsv_index_eew32

x

x

x

cp_exceptionsv_index_eew64

x

x

x

cp_exceptionsv_indexed

x

x

x

x

x

x

x

x

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vsoxseg6ei8.v vsoxseg6ei16.v vsoxseg6ei32.v vsoxseg6ei64.v vsoxseg7ei8.v vsoxseg7ei16.v vsoxseg7ei32.v vsoxseg7ei64.v vsoxseg8ei8.v vsoxseg8ei16.v vsoxseg8ei32.v vsoxseg8ei64.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_LS

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_address_fault

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_index_eew16

x

x

x

cp_exceptionsv_index_eew32

x

x

x

cp_exceptionsv_index_eew64

x

x

x

cp_exceptionsv_indexed

x

x

x

x

x

x

x

x

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vl1re8.v vl2re8.v vl4re8.v vl8re8.v vl1re16.v vl2re16.v vl4re16.v vl8re16.v vl1re32.v vl2re32.v vl4re32.v vl8re32.v

RV32

x

x

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_LS

x

x

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_address_fault

x

x

x

x

x

x

x

x

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

x

x

Instruction vl1re64.v vl2re64.v vl4re64.v vl8re64.v vs1r.v vs2r.v vs4r.v vs8r.v vsm.v vlm.v

RV32

x

x

x

x

x

x

x

x

x

x

RV64

x

x

x

x

x

x

x

x

x

x

EFFEW8

x

x

x

x

x

x

x

x

x

x

EFFEW16

x

x

x

x

x

x

x

x

x

x

EFFEW32

x

x

x

x

x

x

x

x

x

x

EFFEW64

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_LS

x

x

x

x

x

x

x

x

x

x

cp_exceptionsv_address_fault

x

x

x

x

x

x

x

x

x

x

cp_vill

x

x

x

x

x

x

x

x

x

x

cp_vstart

x

x

x

x

x

x

x

x

x

x

cp_vstart_gt_vl

x

x

x

x

x

x

x

x

x

x

Table 309. ExceptionsVls Normative Rules
Normative Rule Rule Text Coverpoints

vector_ls_vstart

All vector loads and stores may generate and accept a non-zero vstart value.

ExceptionsVls_vle8_v_cg/cp_vstart

vector_ls_stride_unordered_precise

For implementations with precise vector traps, exceptions on indexed-unordered stores must also be precise.

ExceptionsVls_vsoxei16_v_cg/cp_exceptionsv_address_fault

vector_ls_overwrite_past_trap

Load instructions may overwrite active destination vector register group elements past the element index at which the trap is reported.

ExceptionsVls_vle8_v_cg/cp_exceptionsv_address_fault

vector_ls_seg_vstart_dep

The vstart value is in units of whole segments.

ExceptionsVls_vlseg2e8_v_cg/cp_vstart

vector_ff_past_trap

Similarly, fault-only-first load instructions may update active destination elements past the element that causes trimming of the vector length (but not past the original vector length). The values of these spurious updates do not have to correspond to the values in memory at the addressed memory locations. Non-idempotent memory locations can only be accessed when it is known the corresponding element load operation will not be restarted due to a trap or vector-length trimming.

ExceptionsVls_vle8ff_v_cg/cp_exceptionsv_ffLS_first_elm_trap

vector_ls_seg_partial_access

If a trap occurs during access to a segment, it is implementation-defined whether a subset of the faulting segment’s accesses are performed before the trap is taken.

ExceptionsVls_vlseg2e8_v_cg/cp_exceptionsv_address_fault

vector_ls_seg_ff_unit_stride_op, vector_ff_seg_partial_access

vector_ls_seg_ff_unit_stride_op: For fault-only-first segment loads, if an exception is detected partway through accessing the zeroth segment, the trap is taken. If an exception is detected partway through accessing a subsequent segment, vl is reduced to the index of that segment. vector_ff_seg_partial_access: In both cases, it is implementation-defined whether a subset of the segment is loaded.

ExceptionsVls_vlseg2e8ff_v_cg/cp_exceptionsv_ffLS_first_elm_trap

vector_ls_seg_ff_overload

These instructions may overwrite destination vector register group elements past the point at which a trap is reported or past the point at which vector length is trimmed.

ExceptionsVls_vlseg2e8ff_v_cg/cp_exceptionsv_ffLS_first_elm_trap

vec_store_nonidempotent_no_update

Non-idempotent memory regions must not have been updated for indices equal to or greater than the element that caused a synchronous trap during a vector store instruction.

ExceptionsVls_vse8_v_cg/cp_exceptionsv_address_fault

UDB Parameters: None.

B.10.6. UV

User-mode access to vector CSRs.

Table 310. UV Coverpoints
Coverpoint Goal Feature Description Expectation

cp_vucsrwalk

CSR access

Set and clear each bit of each writable CSR to exercise bitfields: vxrm, vxsat, vcsr. vstart

cp_vucsraccess

CSR access

csr read, write all 1s, write all 0s, set all 1s, clear all 1s, write back initial value of each register: vxrm, vxsat, vcsr, vstart, vtype, vlenb, vl

vtype, vlenb, vl are read-only and will throw illegal instruction if written

See also Sm_V in Vector spreadsheet

Attempt these tests in user mode unless otherwise specified

UV Normative Rules

No normative rules found for this section.

UDB Parameters: None.

B.11. Miscellaneous RV23 Privileged Extensions

B.11.1. Sscofpmf Counter filtering

Table 311. Sscofpmf Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule

To test Sscofpf, the user must give values to the following RVMODEL macros. If any are undefined and SSCOFPMF_SUPPORTED, error.

RVMODEL_MHPMCOUNTER

Name of a hpmcounter CSR to test (e.g. mhpmcounter3)

RVMODEL_MHPMEVENT

Name of a event CSR to test (e.g. mhpmevent3)

RVMODEL_MHPMEVENT_VAL

Value to put in the event CSR to make it count.

RVMODEL_MHPMEVENT_CODE

Code that increments the event counter (shouldn’t trash certain registers), should be able to run in all privilege modes

These values need to be different in sail_macros.h to support how Sail will do this (github.com/riscv/sail-riscv/issues/1733)

Only one of the HPM counters is tested because the spec does not require multiple counters supported even when Zihpm is active.

Tests are performed in Sm/S/U for SscofpmfSm/S/U suites

Use T-SBI calls where necessary to access machine mode CSRs from lower privilege modes.

cp_xinh_inhibits_xmode

xINH bit inhibits counting in {M/S/U}-mode

For SscofpmfSm/S/U:
RVMODEL_MHPMEVENT[55:0] = RVMODEL_MHPMEVENT_VAL
RVMODEL_MHPMEVENT[62:58] = 32 combinations (exclude unsupported modes)
RVMODEL_MHPMEVENT[63] = 0 (OF = 0)
RVMODEL_MHPMCOUNTER = 0
Run RVMODEL_MHPMEVENT_CODE to try to count
Read RVMODEL_MHPMCOUNTER and check if nonzero
Note that these macros, counters, and events might be different between Sail and the DUT, so do not check values directly, only check if nonzero.

RVMODEL_HPMCOUNTER becomes nonzero iff xinh = 0

2^5 combinations
NOTE: Unable to test this matches Sail until Sail supports hpm counter incrementing.

mhpmevent_inh_op

cp_of_set_on_overflow

OF bit is set when hpmcounter
overflows

For SscofpmfSm/S/U:
RVMODEL_MHPMEVENT[55:0] = RVMODEL_MHPMEVENT_VAL
RVMODEL_MHPMEVENT[62:58] = {00000, 11100, 10000, 01000,00100}
(M/S/U guaranteed to exist)
RVMODEL_MHPMEVENT[63] = 0/1 (OF = 0/1)
sip (for S or for U if S_SUPPORTED) or mip = 0 (clear LCOFIE)
sip (for S or for U if S_SUPPORTED) or mie = 0 (disable interrupts)
RVMODEL_MHPMCOUNTER = all 1s (includes mhpmcounterh for RV32; needs #def to specify this name)
Run RVMODEL_MHPMEVENT_CODE to count at least twice
Read RVMODEL_MHPMEVENT[63] (OF)
Read RVMODEL_MHPMCOUNTER and check that it is not all 0s or all 1s
Wait for RVMODEL_INTERRUPT_LATENCY
Read sip.LCOFIP (for S or for U if S_SUPPORTED) or mip.LCOFIP

OF becomes 1
RVMODEL_MHPMCOUNTER should not be all 0s or all 1s
mip.LCOFIP should be 1 iff OF was initially 0

2 OF
NOTE: Unable to test this matches Sail until Sail supports hpm counter incrementing.

mhpmevent_of_op
mhpmevent_of_bit_set
hpmcounter_overflow
count_overflow_interrupt
lcofip_op

cp_overflow_hw_only

Counter overflow interrupt triggered by hardware
counter increments, not software writes

For SscofpmfSm/S/U:
RVMODEL_MHPMEVENT = 0
sip (for S or for U if S_SUPPORTED) or mip = 0 (clear LCOFIE)
sie (for S or for U if S_SUPPORTED) or mie = 0 (disable interrupts)
Write RVMODEL_MHPMCOUNTER = all 1s
Read RVMODEL_MHPMEVENT[63] (OF)
Write RVMODEL_MHPMCOUNTER = all 0s
Read RVMODEL_MHPMEVENT[63] (OF)

OF stays 0

2 modes

count_overflow_trigger

cp_lcofip_hw_only

counter overflow only results form hardware increments of counter registers.

For SscofpmfSm/S/U:
Set RVMODEL_MHPMCOUNTER[63] (OF)
Wait for RVMODEL_INTERRUPT_LATENCY
Read sip.LCOFIP (for S or for U if S_SUPPORTED) or mip.LCOFIP
Clear RVMODEL_MHPMCOUNTER[63] (OF)
Wait for RVMODEL_INTERRUPT_LATENCY
Read sip.LCOFIP (for S or for U if S_SUPPORTED) or mip.LCOFIP

mip.LCOFIP remains 0

1

lcofip_op

cp_scountovf_shadow

scountovf shadows OF bits of mhpmenvent3:31

For SscofpmfSm/S, if (S_SUPPORTED):
mcounteren = all 1s
Write patterns to mhpmevent3…​31.OF: all 0s, all 1s, walking 1s.
Read scountovf

scountovf should match 1s in OF fields

31

scountovf_op

cp_scountovf_mcounteren

scountovf masked by mcounteren

For SscofpmfSm/S, if (S_SUPPORTED):
Write 1s, even/odd checkerboard to all mhpmevent3…​31.OF
Write patterns to mcounteren: all 0s, all 1s, walking 1s
Read scountovf

In M-mode, scountovf = value written (except bits 2:0 are always 0)
in S-mode, scountovf =value written & mcounteren (except bits 2:0 are always 0)

3 OF * 31 mcounteren

scountovf_mmode_read_access
scountovf_smode_read_access

cp_sscofpmf_access

Access hpm CSRs

For SscofpmfSm/S:
Attempt to read, write 1s, write 0s, set, clear
if S_SUPPORTED: scountovf
if RV32: from M: mhpmeventh3…​31

scountovf should trap on write
Other accesses should succeed

5 accesses * 31 CSRs

scountovf_mmode_read_access
scountovf_smode_read_access
mhpmeventh_presence

cp_lcofi_m

Interrupt pending and enable

For SscofpmfSm:
mstatus.MIE = 1, mstatus.SIE = 1, mip.LCOFIP = {0/1} x mie.LCOFIE = {0/1}, mideleg.LCOFI = {0/1} from each of Sm mode

Trap to M mode if enabled and pending

2 pending * 2 enabled * 2 deleg

mip_lcofip_mie_lcofie_op
mip_lcofip_acc
sip_sie_Sscofpmf

cp_lcofi_sip_s

Interrupt from sip.LCOFIP

For SscofpmfS:
sstatus.SIE=1, mideleg.LCOFI = 1, sie.LCOFIE = {0/1}, sip.LCOFIP = {0/1} from S mode

Trap to S if enabled and pending

2 pending * 2 enabled

sip_sie_Sscofpmf

cp_lcofi_sip_u

Interrupt from sip.LCOFIP

For SscofpmfU:
If S_SUPPORTED, sip.LCOFIP = {0/1} x sie.LCOFIE = {0/1}
else mip.LCOFIP = {0/1} x mip.LCOFIP = {0/1}

Trap to S if S_SUPPORTED if enabled and pending
else trap to M if enabled and pending

2 pending * 2 enabled

sip_sie_Sscofpmf

cp_lcofip_priority_m
cp_lcofip_priority_s

Priority of LCOFI interrupt

xinh = 00000
For SscofpmfSm:
mstatus.MIE = 1
mie = all 0s.
mip = 1 in LCOFIP and {MEIP, MTIP, MSIP, none}
mie = all 1s
else for SscofpmfS:
sstatus.SIE = 1
sie = 0s
sip = 1 in LCOFIP and {SEIP, STIP, SSIP, none}
sie = all 1s

Highest priority interrupt fires. LCOFIP only fires if none of the others are pending because it is lowest priority.

7 interrupts

intr_m_mode_pri
sip_sie_priority_bit_order

Table 312. Sscofpmf Normative Rules
Normative Rule Rule Text Coverpoints

mhpmevent_inh_op

Each of the five xINH bits, when set, inhibit counting of events while in privilege mode x. All-zeroes for these bits results in counting of events in all modes.

SscofpmfSm_cg/cp_minh_inhibits_mmode, SscofpmfS_cg/cp_sinh_inhibits_smode, SscofpmfU_cg/cp_uinh_inhibits_umode

mhpmevent_of_op

The OF bit is set when the corresponding hpmcounter overflows, and remains set until written by software.

{SscofpmfSm_cg,SscofpmfS_cg,SscofpmfU_cg}/{cp_of_set_on_overflow}

mhpmevent_of_bit_set

Generation of a count-overflow-interrupt request by an hpmcounter sets the associated OF bit.

{SscofpmfSm_cg,SscofpmfS_cg,SscofpmfU_cg}/{cp_of_set_on_overflow}

hpmcounter_overflow

Since hpmcounter values are unsigned values, overflow is defined as unsigned overflow of the implemented counter bits.

{SscofpmfSm_cg,SscofpmfS_cg,SscofpmfU_cg}/{cp_of_set_on_overflow}

count_overflow_interrupt

If an hpmcounter overflows while the associated OF bit is zero, then a count overflow interrupt request is generated. If the OF bit is one, then no interrupt request is generated. Consequently the OF bit also functions as a count overflow interrupt disable for the associated hpmcounter.

{SscofpmfSm_cg,SscofpmfS_cg,SscofpmfU_cg}/{cp_of_set_on_overflow,cp_of_already_set}

count_overflow_trigger

Count overflow never results from writes to the mhpmcountern or mhpmeventn registers, only from hardware increments of counter registers.

{SscofpmfSm_cg,SscofpmfS_cg}/{cp_overflow_hw_only, cp_lcofip_hw_only}

scountovf_op

This extension adds the scountovf CSR, a 32-bit read-only register that contains shadow copies of the OF bits in the 29 mhpmevent CSRs (mhpmevent3 - mhpmevent31) - where scountovf bit X corresponds to `mhpmevent`X.

{SscofpmfSm_cg,SscofpmfS_cg}/{cp_scountovf_shadow}

scountovf_mmode_read_access

In M-mode, scountovf bit X is always readable.

SscofpmfSm_cg/cp_scountovf_mcounteren, SscofpmfSm_cg/cp_sscofpmf_access

scountovf_smode_read_access

In S/HS-mode, scountovf bit X is readable when mcounteren bit X is set, and otherwise reads as zero.

SscofpmfS_cg/cp_scountovf_mcounteren, SscofpmfS_cg/cp_sscofpmf_access

scountovf_smode_read_access_control

Read access to bit X is subject to the same mcounteren (or mcounteren and hcounteren) CSRs that mediate access to the hpmcounter CSRs by S-mode (or VS-mode).

SscofpmfS_cg/cp_scountovf_mcounteren

mhpmeventh_presence

The mhpmeventnh CSRs are provided only if the Sscofpmf extension is implemented.

SscofpmfSm_cg/cp_sscofpmf_access

mip_lcofip_mie_lcofie_op

If the Sscofpmf extension is implemented, bits mip.⁠LCOFIP and mie.⁠LCOFIE are the interrupt-pending and interrupt-enable bits for local-counter-overflow interrupts.

SscofpmfSm_cg/cp_lcofi_m

mip_lcofip_reflects_overflow

reflects the occurrence of a local counter-overflow overflow interrupt request resulting from any of the mhpmeventn.OF bits being set.

SscofpmfSm_cg/cp_lcofi_m

lcofip_op

When an OF bit is set, it eventually, but not necessarily immediately, sets the LCOFIP bit in the mip/sip registers.

SscofpmfSm_cg/cp_lcofi_m, SscofpmfS_cg/cp_lcofi_sip_s

mip_lcofip_acc

LCOFIP is read-write in mip

SscofpmfSm_cg/cp_lcofi_m

sip_sie_Sscofpmf

If the Sscofpmf extension is implemented, bits sip.LCOFIP and sie.LCOFIE are the interrupt-pending and interrupt-enable bits for local-counter-overflow interrupts. LCOFIP is read-write in sip and reflects the occurrence of a local counter-overflow overflow interrupt request resulting from any of the mhpmeventn.OF bits being set. If the Sscofpmf extension is not implemented, sip.LCOFIP and sie.LCOFIE are read-only zeros.

SscofpmfS_cg/cp_lcofi_sip_s, SscofpmfU_cg/cp_lcofi_sip_u

intr_m_mode_pri

Multiple simultaneous interrupts destined for M-mode are handled in the following decreasing priority order: MEI, MSI, MTI, SEI, SSI, STI, LCOFI.

SscofpmfSm_cg/cp_lcofip_priority_m

sip_sie_priority_bit_order

Multiple simultaneous interrupts destined for supervisor mode are handled in the following decreasing priority order: SEI, SSI, STI, LCOFI.

SscofpmfS_cg/cp_lcofip_priority_s

scountovf_vsmode_read_access

Similarly, in VS mode, scountovf bit X is readable when mcounteren bit X and hcounteren bit X are both set, and otherwise reads as zero.

UDB Parameters: None.

B.11.2. Ssstateen Supervisor State Enable

Table 313. Ssstateen Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule

cp_walking_ones

Bits are accessible

Write msstateen0-3[31:0] (first) and then sstateen0-3 with walking ones & walking zero, and read each back.

If msstateen = 0, read back 0. If mssstateen = 1, read back value written. Note that writing msstateen = 1s won’t actually set most of the bits to 1.

2 msstateen * 4 CSRs * 64 walking ones/zero

mstateen_rv64_csrs
sstateen_rv64_csrs
stateen_rv32_upper_bits_csrs
mstateen_bit_correspondence
stateen_warl_access
stateen_unimplemented_state_roz
stateen_reserved_roz
sstateen_ro1_bits
mstateen_bit_63_op
mstateen_bit_63_roz
sstateen0_enc_img

cp_csr_illegal_accesses

Test that each stateen CSR allows read/write access from its own and higher privilege modes and denies read/write access from lower privilege modes

In Mmode , write sstateen0-3 with all ones and read back.
In Umode , write sstateen0-3 with all ones and read back.
In S-mode, write msstateen0-3 and read back. Trap.
If RV32 also write and read msstateen0-3h from S-mode.

All accesses will be successful in Mmode.
Illegal instruction exceptions will raise in
Umode and S-mode.

2mode * 4CSRs * 1value * 2 R/W

stateen_op
stateen_illegal_state_access
sstateen_user_access_control

cp_envcfg

envcfg controls access to senvcfg

With mstateen0.ENVCFG = {0,1}, read and write sevncfg

Illegal instruction if 0, else successful

2 states x 2 accesses

mstateen0_envcfg_op

cp_fcsr_lower

fcsr controls access to fcsr when misa.F = 0

If Zfinx is supported:
with misa.F = 0 and sstateen0.fcsr, read and write fcsr, frm, fflags from U mode. Also try executing fadd.s, flw, fcvt.w.s, fcvt.s.w, fmv.x.w, fmv.w.x, fclass.s.

Illegal instruction if 0, else successful

2 states x 2 accesses

sstateen_user_access_control
stateen0_fcsr_op
stateen0_fcsr0_misa_f0_illegal_fpu_instr

cp_jvt

jvt controls access

If Zcmt is supported:
With sstaten0.JVT = {0,1}, read and write jvt from U mode

Illegal instruction if 0, else successful

2 states x 2 accesses

sstateen_user_access_control
stateen0_jvt_op

Note: All of these tests are performed in S-mode unless otherwise noted.

Note: mstateen0.SE0 must be 1 (else sstateen0 is inaccessible).

The same normative rules apply to Ssstateen as to Smstateen (see Table 355).

B.11.3. Ssu64xl 64-bit User Mode

RV64 only

Table 314. Ssu64xl Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule

cp_ssu64xl

UXLEN = 64 supported

With sstatus.UXL = 2, in U-mode, set bit 63 of a GPR and read back

bit 63 is set

1

sstatus_uxl
Ssu64xl_uxl_sstatus

Table 315. Ssu64xl Normative Rules
Normative Rule Rule Text Coverpoints

Ssu64xl_uxl_sstatus

If the Ssu64xl extension is implemented, then sstatus.UXL must be capable of holding the value 2 (i.e., UXLEN=64 must be supported).

Ssu64xl_cg/cp_ssu64xl

UDB Parameters: None.

B.11.4. Sscounterenw Writable Counter Enables

Table 316. Sscounterenw Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule

cp_scounteren_writable

Check scounteren bits are writable

In S-mode, write walking 1s and walking 0s to scounteren.

Match reference model

2*XLEN

Sscounterenw_hpmcounter_scounteren

Note that this overlaps tests in ZicntrS

Table 317. Sscounterenw Normative Rules
Normative Rule Rule Text Coverpoints

Sscounterenw_hpmcounter_scounteren

If the Sscounterenw extension is implemented, then for any hpmcounter that is not read-only zero, the corresponding bit in scounteren must be writable.

Sscounterenw_cg/cp_scounteren_writable

UDB Parameters: None.

B.11.5. Sstvecd Direct Trap Vector

Table 318. Sstvecd Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule

cp_stvec_mode

Check stvec.MODE can hold 0 and stvec.BASE can hold any valid address

In S-mode with virtual memory disabled, write stvec.MODE = direct and walking 1s to stvec.BASE.

Match reference model

2*XLEN-4

Sstvecd_stvec_mode_direct
Sstvecd_stvec_base_aligned_address

Table 319. Sstvecd Normative Rules
Normative Rule Rule Text Coverpoints

Sstvecd_stvec_mode_direct

If the Sstvecd extension is implemented, then stvec.MODE must be capable of holding the value 0 (Direct).

Sstvecd_cg/cp_stvec_mode, S_scsr_cg/cp_stvec_vaddr_walk1, S_scsr_cg/cp_stvec_vaddr_walk0

Sstvecd_stvec_base_aligned_address

Furthermore, when stvec.MODE=Direct, stvec.BASE must be capable of holding any valid four-byte-aligned address.

Sstvecd_cg/cp_stvec_mode, S_scsr_cg/cp_stvec_vaddr_walk1, S_scsr_cg/cp_stvec_vaddr_walk0, S_scsr_cg/cp_stvec_vaddr_pc, S_scsr_cg/cp_stvec_vaddr_scratch

UDB Parameters: None.

B.11.6. Sstvala Trap Address

Table 320. Sstvala Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule

All tests take place in S-mode with exceptions delegated to S-mode.

cp_stval_load_page_fault

stval is written with faulting VA

With VM enabled, cause load page fault.

fault, stval written with VA

1

Sstvala_stval_faulting_vaddr

cp_stval_store_page_fault

stval is written with faulting VA

With VM enabled, cause store page fault.

fault, stval written with VA

1

cp_stval_instr_page_fault

stval is written with faulting VA

With VM enabled, cause instruction page fault.

fault, stval written with VA

1

Sstvala_stval_faulting_vaddr

cp_load_access_fault

stval is written with faulting VA

load from an illegal address

fault, stval written with VA

1

Sstvala_stval_faulting_vaddr

cp_store_access_fault

stval is written with faulting VA

store to an illegal address

fault, stval written with VA

1

Sstvala_stval_faulting_vaddr

cp_instr_access_fault

stval is written with faulting VA

jump to an illegal address

fault, stval written with VA

1

Sstvala_stval_faulting_vaddr

cp_load_address_misaligned

stval is written with faulting VA if misaligned fault occurs

lw with misaligned address

succeed, or fault with stval containing address

Sstvala_stval_faulting_vaddr

cp_store_address_misaligned

stval is written with faulting VA if misaligned fault occurs

sw with misaligned address

succeed, or fault with stval containing address

Sstvala_stval_faulting_vaddr

cp_instr_adr_misaligned_jalr

stval is written with faulting VA if misaligned fault occurs

jalr with misaligned address

succeed, or fault with stval containing address

Sstvala_stval_faulting_vaddr

cp_illegal_instruction

stval is written with the illegal instruction

Execute 0xFFFFFFFF, 0x00000000

Illegal instruction fault with stval = 0xFFFFFFFF, 0x00000000

2

Sstvala_stval_faulting_instruction

Note: breakpoints tested in SstvalaSdtrig because they are generated with debug triggers

Table 321. Sstvala Normative Rules
Normative Rule Rule Text Coverpoints

Sstvala_stval_faulting_vaddr

If the Sstvala extension is implemented, then stval must be written with the faulting virtual address for load, store, and instruction page-fault, access-fault, and misaligned exceptions, and for breakpoint exceptions that are defined to write an address to stval, other than those caused by execution of the EBREAK or C.EBREAK instructions.

Sstvala_cg/{cp_load_access_fault, cp_load_address_misaligned}, Sstvala_cg/{cp_stval_load_page_fault, cp_stval_instr_page_fault}

Sstvala_stval_faulting_instruction

For virtual-instruction and illegal-instruction exceptions, stval must be written with the faulting instruction.

Sstvala_cg/cp_illegal_instruction

UDB Parameters: None.

B.11.7. Ssccptr Page Table Reads

Table 322. Ssccptr Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule

cp_ssccptr

Main memory supports HPTW read

With Sv active, access virtual memory with page table stored in main memory

Success

1

Ssccptr_memory_pte_reads

Note: this is already covered in Sv

Table 323. Ssccptr Normative Rules
Normative Rule Rule Text Coverpoints

Ssccptr_memory_pte_reads

If the Ssccptr extension is implemented, then main memory regions with both the cacheability and coherence PMAs must support hardware page-table reads.

Ssccptr_cg/cp_ssccptr

UDB Parameters: None.

B.11.8. Ss1p13 Supervisor Mode 1.13

Table 324. Ss1p13 Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule Notes

cp_sxlen_ge_uxlen

sxlen > uxlen

From S-mode, attempt to set sstatus.UXL = (1, 2)

Can’t write 2 unless SXL is also 2 (64 b)

2

mstatus_uxl_legal_vals_smode

cp_scause

scause accepts sofware-check and hardware error

Write scause = 18, 19, read back

Match ref model

2

NOTE : Already covered in cp_scause_write_exception

NOTE : Tests and coverage files are under the S.py and S_coverage.svh respectvely with the guard of `ifdef SS1P13_SUPPORTED

Table 325. Ss1p13 Normative Rules
Normative Rule Rule Text Coverpoints

mstatus_uxl_legal_vals_smode

If S-mode is implemented, the set of legal values that the UXL field may assume excludes those that would cause UXLEN to be greater than SXLEN.

Not tested: with SXLEN=64 the only excluded value is the reserved UXL=3, whose WARL result is implementation-defined

UDB Parameters: None.

B.11.9. Ssnpm Pointer Masking

Table 326. Ssnpm Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule Notes

A supervisor-level extension that provides pointer masking for the next lower privilege
mode (U-mode) by enabling senvcfg.PMM bits. Pointer masking applies for RV64 only.

todo: ADD UDB parameters of PMLEN7_SUPPORTED and PMLEN16_SUPPORTED

For all test entries in this sheet, the following address patterns are used to exercise pointer masking behavior:
Base addresses (A bits 63:48):
0x0000 unaffected by pointer masking
0x0001 bit 48 masked if PMLEN=16 but not 7
0x0100 bit 56 masked if PMLEN = 16 but not 7
0x0200 bit 57 masked if PMLEN = 16 or 7
0x8000 bit 63 masked if PMLEN = 16 or 7
0xFFFF bits 63:48 are masked if PMLEN = 16, only partially if PMLEN=7
0xFE00 bits 63:57 are masked if PMLEN = 16 or 7
0xFF00 bits 63:56 are masked if PMLEN=16, only partially if PMLEN=7
Masked address :
For PMLEN= 16 ( PMM=11)
Bare mode (PA): {0x0000} → upper bits forced to zero
Sv39 / Sv48/Sv57 (VA): {0x0000, 0xFFFF} → upper bits follow sign bit (XLEN-PMLEN-1 = 64-16-1 = 47 bit )
For PMLEN= 7 (PMM= 10):
Bare mode (PA): {0x00 / 7’b0} → upper bits forced to zero
Sv39 / Sv48Sv57 (VA): {7’b0, 0x7F} → upper bits follow sign bit ( XLEN-PMLEN-1 = 64 - 7 -1 = 56 bit )
All virtual A_masked addresses map to physical addresses with upper bits = 0x0000.
The lower bits of the address being tested point to a scratch memory location that can safely be read and written.
Virtual addresses with leading 0s are identity mapped to the same physical address.
Virtual addresses with leading 1s are mapped to another scratch memory location containing a different data value so that it can be distinguished whether the upper bits are handled correctly.

Why do we need a different page than scratch to map the VA with leading 1s?
A' = scratch page (upper bits = 0x0000), pre-loaded with value_old, identity-mapped with VA with leading 0s(VA == PA).
VAs with leading 1s are explicitly PTE-mapped to a separate page pre-loaded with value_different. This separation is necessary because if both VAs mapped to the same PA, a read would return value_old regardless of whether masking actually occurred; the page table itself would resolve both addresses to scratch, making it impossible to tell if the hardware masked the upper bits or simply followed the mapping.
With a separate page holding a distinct value, the outcome is unambiguous: returning value_old proves the upper bits were stripped and scratch was reached via masking; returning value_different proves the upper bits were used as-is and other different page was accessed instead.
NOTE : We will take sv tests as reference to setup PTE to map VA with leading ones to a dedicated physical region.

cp_pmlen_masking

Verify that upper PMLEN bits are ignored for every memory-accessing instruction when pointer masking is enabled

If pointer masking is enabled, addresses differing only in upper PMLEN bits access the same physical location.
Test Environment:
In S-mode set senvcfg.PMM={00 (PMLEN=0), 10(PMLEN=7), 11(PMLEN=16)}. Place known value_old in scratch memory.
Let A' = scratch (upper bits = 0x0000). For VA with upper bits = 1: mapped to a separate page from scratch.
Enable SUM bit so we can access user-space pages from S-mode
Switch to U-mode and execute the following loop:
For each PMM in {00, 10, 11} under SAT.MODES = { Bare, Sv39, Sv48, Sv57 } :
For each A_upper_bits in {0x0000, 0x0001, 0x0100, 0x0200, 0x8000, 0xFFFF, 0xFE00, 0xFF00}:
Set A = A' with upper bits replaced by A_upper_bits
For each read instruction: read directly from A, sigupd(value) + record any traps.
For each write instruction: write unique known value_new to A, then read back from scratch (A'), sigupd(value) + record any traps.
Instructions covered under this loop:
(LOAD/STORE): Reads: {lb/lbu, lh/lhu, lw/lwu, ld}. Writes: {sb, sh, sw, sd}.
(ATOMIC OPS): Each AMO is both a read and write, we will treat it as write: perform AMO at A, read back from scratch. If RV64A: {AMOSWAP.W/D, AMOADD.W/D, AMOXOR.W/D, AMOAND.W/D, AMOOR.W/D, AMOMIN.W/D, AMOMAX.W/D, AMOMINU.W/D, AMOMAXU.W/D}.
If Zacas: {AMOCAS.W/D/Q}.
If Zabha: {AMOSWAP.B/H, AMOADD.B/H, AMOXOR.B/H, AMOAND.B/H, AMOOR.B/H, AMOMIN.B/H, AMOMAX.B/H, AMOMINU.B/H, AMOMAXU.B/H}.
(FLOATING POINT OPS): Reads: { FLW (F), FLD (D), FLQ (Q) } . Writes: { FSW (F), FSD (D), FSQ (Q). }
(COMPRESSED OPS): If Zca , Reads: {C.LW, C.LD, C.LWSP, C.LDSP}. Writes: {C.SW, C.SD, C.SWSP, C.SDSP}.
If Zcd , Read: C.FLDSP. Write: C.FSDSP.
(CACHE MANAGEMENT OPS): If Zicboz: perform CBO.ZERO at A (write), read back from scratch using lw/ld.
If Zicbom: perform {CBO.CLEAN, CBO.FLUSH} at A (write), read back from scratch.
If CBIE enabled: perform CBO.INVAL at A, read back from scratch.
If Zicbop: perform {PREFETCH.R, PREFETCH.W, PREFETCH.I} at A, then do a normal load/store at Scratch to observe cache effect.
(VECTOR OPS): If ZVL32b/RVV 1.0, Reads: {vleXX.v, vlseXX.v, vluxeiXX.v, vloxeiXX.v, vlsegNfXX.v, vl1r.v, vleXXff.v} from A, sigupd. Writes: {vseXX.v, vsseXX.v, vsuxeiXX.v, vsoxeiXX.v, vssegNfXX.v, vs1r.v} to A, read back from scratch sigupd(value) + record any traps.

When PMM=10/11: all 8 A patterns whose upper bits fall within PMLEN resolve to scratch , reads return known value_old, write readbacks return known value_new. When PMM=00: masking disabled : only A=0x0000 resolves to scratch; all other patterns either access a different location (returning old/unrelated value) or cause a trap.

3 PMM × 8 address variants × 1 mode (U) × satp supported modes (Bare, Sv39, Sv48, Sv57) × [Base: 4r×4w] + [RV64A if implemented: 9 AMO variants × 2 widths] + [Zacas if implemented: 3] + [Zabha if implemented: 9 AMO variants × 2 widths] + [FP if implemented: per F/D/Q] + [Zca if implemented: 4r×4w regular + 4r×4w SP-relative] + [Zcd if implemented: 1r×1w SP-relative] + [RVV if implemented: vector load/store variants] + [Zicbom if implemented: CBO.CLEAN, CBO.FLUSH, CBO.INVAL] + [Zicboz if implemented: CBO.ZERO] + [Zicbop if implemented: PREFETCH.R, PREFETCH.W, PREFETCH.I]

senvcfg_pmm_ssnpm
senvcfg_pmm_enc
pm_ignore_upper_bits
pm_ignore_va
pm_ignore_pa
pm_apply_explicit
pm_deterministic_effect
pmlen_supported_values
pm_per_mode_control
pm_auto_apply_active_mode
pm_config_next_higher
pm_mode_only_dependency
pm_explicit_accesses
pm_cpu_only
ssnpm_definition
pm_rv64_only
pmlen_mode_depend

pm_all_priv_modes ("Such tools can be applied in all privilege modes (U, S, and M).") is no longer a tagged rule in the ISA manual.
UPDATED WITH CTP : pm_rv64_only, pmlen_supported_values, pmlen_mode_depend, pm_ignore_va, pm_ignore_pa

cp_pmlen_zicfiss_amo

Verify that upper PMLEN bits are ignored for the Zicfiss shadow stack AMO instructions when pointer masking is enabled

If pointer masking is enabled, SSAMOSWAP.W/D addresses differing only in upper PMLEN bits access the same shadow stack location.
SSAMOSWAP accesses memory only with shadow stacks enabled and an address in a shadow stack page, so Bare mode is not tested: there it always raises a store/AMO access fault.
Test Environment:
If Zicfiss: In S-mode set menvcfg.SSE=1 and senvcfg.SSE=1, and senvcfg.PMM={00 (PMLEN=0), 10(PMLEN=7), 11(PMLEN=16)}.
Let A' = ss_page (upper bits = 0x0000), identity-mapped as a user shadow stack page (pte.xwr = 010).
Switch to U-mode and execute the following loop:
For each PMM in {00, 10, 11} under SAT.MODES = { Sv39, Sv48, Sv57 } :
For each A_upper_bits in {0x0000, 0x0001, 0x0100, 0x0200, 0x8000, 0xFFFF, 0xFE00, 0xFF00}:
Set A = A' with upper bits replaced by A_upper_bits
Place known value_old in ss_page with SSAMOSWAP.D at A' (an ordinary store to a shadow stack page faults).
For each of {SSAMOSWAP.W, SSAMOSWAP.D}: swap unique known value_new at A, sigupd(rd), then read back from ss_page (A'), sigupd(value) + record any traps.

When PMM=10/11: all A patterns whose upper bits fall within PMLEN resolve to ss_page , rd returns known value_old, readback returns known value_new. When PMM=00: masking disabled : only A=0x0000 resolves to ss_page; all other patterns cause a store/AMO page fault, rd is unchanged and readback returns value_old.

3 PMM × 8 address variants × 1 mode (U) × satp supported modes (Sv39, Sv48, Sv57) × [Zicfiss if implemented: SSAMOSWAP.W, SSAMOSWAP.D]

pm_ignore_upper_bits
pm_apply_explicit
pm_ignore_va

cp_pmlen_zicfiss_ssp

Verify that upper PMLEN bits are ignored for the Zicfiss shadow stack push and pop instructions when pointer masking is enabled

SSPUSH and SSPOPCHK address memory through the ssp CSR instead of rs1. If pointer masking is enabled, ssp values differing only in upper PMLEN bits access the same shadow stack location.
Pushes and pops access memory only with shadow stacks enabled and an address in a shadow stack page, so Bare mode is not tested: there they always raise a store/AMO access fault.
Test Environment:
If Zicfiss: In S-mode set menvcfg.SSE=1 and senvcfg.SSE=1, and senvcfg.PMM={00 (PMLEN=0), 10(PMLEN=7), 11(PMLEN=16)}.
Let A' = ss_page (upper bits = 0x0000), identity-mapped as a user shadow stack page (pte.xwr = 010).
Switch to U-mode and execute the following loop:
For each PMM in {00, 10, 11} under SAT.MODES = { Sv39, Sv48, Sv57 } :
For each A_upper_bits in {0x0000, 0x0001, 0x0100, 0x0200, 0x8000, 0xFFFF, 0xFE00, 0xFF00}:
Set A = A' with upper bits replaced by A_upper_bits
Place known value_old in ss_page with SSAMOSWAP.D at A'.
For each push {SSPUSH x1, SSPUSH x5, C.SSPUSH x1 (if Zcmop)}: set ssp = A + 8 and link register = value_new, push, sigupd(ssp), then read back from ss_page (A'), sigupd(value) + record any traps.
For each pop {SSPOPCHK x1, SSPOPCHK x5, C.SSPOPCHK x5 (if Zcmop)}: set ssp = A and link register = value_old, pop, sigupd(ssp) + record any traps.

When PMM=10/11: all A patterns whose upper bits fall within PMLEN resolve to ss_page , a push writes value_new and leaves ssp = A, a pop matches value_old and leaves ssp = A + 8. When PMM=00: masking disabled : only A=0x0000 resolves to ss_page; all other patterns cause a store/AMO page fault, ssp is unchanged and readback returns value_old.

3 PMM × 8 ssp variants × 1 mode (U) × satp supported modes (Sv39, Sv48, Sv57) × [Zicfiss if implemented: SSPUSH x1, SSPUSH x5, SSPOPCHK x1, SSPOPCHK x5] + [Zcmop if implemented: C.SSPUSH x1, C.SSPOPCHK x5]

pm_ignore_upper_bits
pm_apply_explicit
pm_ignore_va

cp_pmm_mxr
cp_pmm_jalr

Verify pointer masking behavior across all combinations of PMM, MXR, address pairs, and VM modes using representative explicit load/store and implicit fetch accesses.

When MXR is in effect at the effective privilege mode where explicit memory
access is performed, pointer masking does not apply.
For implicit memory accesses such as page-table walks or instruction fetches, pointer masking does not apply.
Test Environment:
In S-mode set senvcfg.PMM={ 00 (PMLEN=0 ), 10(PMLEN=7), 11(PMLEN=16)}, sstatus.MXR = { 0, 1}.
Let A' = scratch (upper bits = 0x0000). For VA with upper bits = 1: mapped to a separate page from scratch.
Switch to U-mode and execute the following loop:
For each PMM in {00, 10, 11} under all satp. modes = { Bare , Sv39, Sv48, Sv57 } :
For each A_upper_bits in {0x0000, 0x0001, 0x0100, 0x0200, 0x8000, 0xFFFF, 0xFE00, 0xFF00}:
Set A = A' with upper bits replaced by A_upper_bits
For MXR Scenario : Perform sw to A and then read back using scratch (A') , signupd + record traps under satp.MODE ∈ {Bare, Sv39, Sv48, Sv57}.
For JALR : Place valid executable instructions at A' , execute jalr to A, sigupd result, record any traps. Since pointer masking never applies to instruction fetch, A is always sent raw to PMP/MMU regardless of PMM or MXR.

1- PMM=00: masking disabled; only A_upper_bits=0x0000 resolves to scratch; all other patterns access different location or cause trap.
2-- PMM=10/11, MXR=0: masking applied; write readbacks return known value_new for all A patterns whose upper bits fall within PMLEN.
3- PMM=10/11, MXR=1, in Sv39/Sv48/Sv57: MXR suppresses masking; A used raw, causing a trap or sw to location other than A'
4- PMM=10/11, MXR=1 in Bare: MXR suppresses masking even though MXR has no permission effect in bare mode.
5- jalr: no masking applied regardless of PMM or MXR; non-zero upper bits always sent raw resulting in fault.

3 PMM × 2 MXR × 8 A patterns 3 instructions (lw, sw, jalr) × 4 VM modes (Bare, Sv39, Sv48, Sv57) × 1 mode (U)

pm_mxr_exception
pm_not_apply_implicit

cp_pmlen_misaligned_word

Verify correct pointer masking behavior for misaligned memory accesses.

Test Environment:
In S-mode set senvcfg.PMM={ 10(PMLEN=7)}. Place known value_old at scratch+1 (naturally misaligned for word access).
Let A' = scratch+1 (upper bits = 0x0000). For VA with upper bits = 1: mapped to a separate page from scratch+1.
Switch to U-mode.
For each PMM in {00, 10, 11} under all satp. modes = { Bare , Sv39, Sv48, Sv57 } :
For each A_upper_bits in {0x0000, 0x0001, 0x0100, 0x0200, 0x8000, 0xFFFF, 0xFE00, 0xFF00}::
Set A = A' with upper bits replaced by A_upper_bits
For read (lw): read directly from A, sigupd(value), record any traps.
For write (sw): write unique known value_new to A, read back from scratch+1 (A'), sigupd(value), record any traps.

No trap. Masking applied to the misaligned address before access, A and A' resolve to the same physical location. Read returns known value_old. Write readback from A' returns known value_new. Misalignment does not interfere with pointer masking.

1 PMM × 2 address variants (upper 7 bits = 0/1) × 1 misaligned write (sw) × 1 misaligned read (lw) × 1 mode (U) ×

pm_misaligned_equivalence

cp_hardware_csr_writes_fault

Verify pointer masking is applied to hardware-written CSR address values.
Verify that stval contains the masked effective address when a fault occurs on a pointer-masked access.

When a fault occurs on an explicit memory access under pointer masking, the hardware-written stval reflects the masked effective address, not the raw tagged address.
Test Environment:
In S-mode set senvcfg.PMM={10(PMLEN=7), 11(PMLEN=16)}.
Set medeleg[12,13,15]=1 to delegate U-mode load/store/access faults to S-mode.
If RVMODEL_ACCESS_FAULT_ADDRESS is defined, use it as the base illegal address across all modes. Construct addresses by applying upper-16-bit patterns {0x0000, 0x0001, 0x0100, 0x0200, 0x8000, 0xFFFF, 0xFE00, 0xFF00} to this illegal base address.
Switch to U-mode.
Perform one lw and one sw to each constructed illegal address under satp.MODE={Bare, Sv39, Sv48, Sv57}.
In the S-mode trap handler, read stval and verify it contains the correctly masked effective address.

Fault is taken; stval written by hardware contains the masked effective address (upper PMLEN bits correctly zeroed in bare mode or sign-extended in VA modes), not the original unmasked address used by the program.

2 PMM × 8 address patterns × 1 lw × 1 sw × 1 mode (U) × satp supported modes (Bare, Sv39, Sv48, Sv57)

pm_csr_hw_apply
pm_no_trap_vector_mask

cp_pmm_uxl_clear

Verify that setting sstatus.UXL=01 (RV32) clears senvcfg.PMM bits

When sstatus.UXL is set to 01 (indicating U-mode is RV32), the pointer masking configuration bits in senvcfg.PMM must be cleared automatically by hardware.
Test Environment:
In S-mode, write senvcfg.PMM={10(PMLEN=7), 11(PMLEN=16)} and confirm the written value is retained by reading back senvcfg.PMM. Then set sstatus.UXL=01 (RV32). Read back senvcfg.PMM and verify it has been cleared to 00 (if UXL is writable).

When sstatus.UXL is set to 01: senvcfg.PMM is cleared to 00 regardless of its previously written value.

2 PMM values (10, 11) × 1 UXL × 1 mode (U)

pm_uxl_clear
pmlen_illegal_warl

Ssnpm provides pointer masking for U-mode via senvcfg.PMM. In this sheet , test plan is for the M-mode part of Ssnpm: M-mode accesses memory as U-mode via MPRV. - tests run in M-mode with mstatus.MPRV=1 and mstatus.MPP=U - The suite requires Ssnpm because senvcfg.PMM governs the access. mseccfg.PMM is swept only if Smmpm is supported, to show that it does not apply.

Table 327. Ssnpm Coverpoints (M-mode with MPRV)
Coverpoint Goal Feature Description Expectation Bins Normative Rule

cp_pm_mprv_mpp_u

Verify that senvcfg.PMM governs pointer masking when M-mode accesses memory as U-mode via MPRV.

MPRV affect pointer masking as well, causing the pointer masking settings of the effective privilege mode to be applied.
With MPP=U the effective privilege mode is U, so senvcfg.PMM applies and mseccfg.PMM does not.
Test Environment:
In M-mode set mstatus.MPRV=1 and mstatus.MPP=U
Set mstatus.SUM=1 so the setup code can access user-space pages.
Place known value_old in scratch. Let A' = scratch (upper bits = 0x0000).
Page tables configured for valid mappings under satp.MODE ∈ {Bare, Sv39}, with the data pages user-accessible.
For each mstatus.MXR in {0, 1}:
For each mseccfg.PMM in {00, 10, 11} if Smmpm supported:
For each senvcfg.PMM in {00, 10, 11}:
For each satp.MODE in {Bare, Sv39}:
For each A_upper_bits in {0x0000, 0x0001, 0x0200}:
Set A = A' with upper bits replaced by A_upper_bits
For read (lw): read directly from A in M-mode with MPRV=1, sigupd(value), record any traps.
For write (sw): write unique known value_new to A in M-mode with MPRV=1, read back from scratch (A'), sigupd(value), record any traps.

When senvcfg.PMM=10/11 and MXR=0: A patterns whose upper bits fall within PMLEN resolve to scratch, reads return known value_old, write readbacks return known value_new, regardless of mseccfg.PMM. When senvcfg.PMM=00 or MXR=1: masking disabled : only A=0x0000 resolves to scratch; all other patterns cause a trap.

2 MXR * 3 mseccfg.PMM * 3 senvcfg.PMM * 1 MPRV * 1 MPP (U) * 2 satp.MODE * 3 addresses * 2 instructions (lw, sw)

pm_mprv_spvp

Table 328. Ssnpm Normative Rules
Normative Rule Rule Text Coverpoints

senvcfg_pmm_ssnpm

If the Ssnpm extension is implemented, the PMM field enables or disables pointer masking (see ) for the next-lower privilege mode (U/VU), according to the values in . If Ssnpm is not implemented, PMM is read-only zero. The PMM field is read-only zero for RV32.

Ssnpm_cg/cp_pmlen_masking, S_scsr_cg/cp_scsrwalk/senvcfg

senvcfg_pmm_immediate

Changing senvcfg.PMM takes effect immediately, without the need to execute an SFENCE.VMA instruction.

TODO: change senvcfg.PMM, then access memory from U-mode with no intervening SFENCE.VMA

senvcfg_pmm_enc

Value|Description === 00|Pointer masking is disabled (PMLEN = 0)¶01|Reserved¶10|Pointer masking is enabled with PMLEN = XLEN - 57 (PMLEN = 7 on RV64)¶11|Pointer masking is enabled with PMLEN = XLEN - 48 (PMLEN = 16 on RV64) ===

Ssnpm_cg/cp_pmlen_masking, S_scsr_cg/cp_scsrwalk/senvcfg (the walk writes the reserved PMM=0b01)

UDB Parameters: None.

Table 329. Zpm Normative Rules
Normative Rule Rule Text Coverpoints

pm_ignore_upper_bits

RISC-V Pointer Masking (PM) is a feature that, when enabled, causes the CPU to ignore the upper bits of the effective address

{Smmpm_cg, SmnpmS_cg, SmnpmU_cg, Ssnpm_cg}/cp_pmlen_masking

pm_ignore_va

The ignore transformation differs depending on whether it applies to a virtual or physical address. For virtual addresses, it replaces the upper PMLEN bits with the sign extension of the PMLEN+1st bit.

{Smmpm_cg, SmnpmS_cg, SmnpmU_cg, Ssnpm_cg}/cp_pmlen_masking

pm_ignore_pa

When applied to a physical address, including guest-physical addresses (i.e., all cases except when the active satp register’s MODE field != Bare), the ignore transformation replaces the upper PMLEN bits with 0. This includes both the case of running in M-mode and running in other privilege modes with Bare address translation mode.

{Smmpm_cg, SmnpmS_cg, SmnpmU_cg, Ssnpm_cg}/cp_pmlen_masking

pm_apply_explicit

When pointer masking is enabled, the ignore transformation will be applied to every explicit memory access (e.g., loads/stores, atomics operations, and floating point loads/stores).

{Smmpm_cg, SmnpmS_cg, SmnpmU_cg, Ssnpm_cg}/cp_pmlen_masking

pm_not_apply_implicit

The transformation does not apply to implicit accesses such as page-table walks or instruction fetches.

{Smmpm_cg, SmnpmS_cg, SmnpmU_cg, Ssnpm_cg}/cp_pmm_jalr

pm_deterministic_effect

Pointer masking with the same value of PMLEN always has the same effect for the same type of address (virtual or physical).

{Smmpm_cg, SmnpmS_cg, SmnpmU_cg, Ssnpm_cg}/cp_pmlen_masking

pmlen_supported_values

The current standard only supports PMLEN=XLEN-48 (i.e., PMLEN=16 in RV64) and PMLEN=XLEN-57 (i.e., PMLEN=7 in RV64).

{Smmpm_cg, SmnpmS_cg, SmnpmU_cg, Ssnpm_cg}/cp_pmlen_masking

pmlen_future_reserved

A setting has been reserved to potentially support other values of PMLEN in future standards.

S_scsr_cg/cp_scsrwalk/senvcfg, Sm_mcsr_cg/cp_mcsrwalk_masked/{menvcfg, mseccfg}

pm_per_mode_control

Pointer masking is controlled separately for different privilege modes.

{Smmpm_cg, SmnpmS_cg, SmnpmU_cg, Ssnpm_cg}/cp_pmlen_masking

pm_auto_apply_active_mode

Different privilege modes may have different pointer masking settings active simultaneously and the hardware will automatically apply the pointer masking settings of the currently active privilege mode.

{Smmpm_cg, SmnpmS_cg, SmnpmU_cg, Ssnpm_cg}/cp_pmlen_masking

pm_config_next_higher

A privilege mode’s pointer masking setting is configured by bits in configuration registers of the next-higher privilege mode.

{Smmpm_cg, SmnpmS_cg, SmnpmU_cg, Ssnpm_cg}/cp_pmlen_masking

pm_mode_only_dependency

the pointer masking setting that is applied only depends on the active privilege mode, not on the address that is being masked.

{Smmpm_cg, SmnpmS_cg, SmnpmU_cg, Ssnpm_cg}/cp_pmlen_masking

pm_explicit_accesses

Unless otherwise specified, pointer masking applies to all explicit memory accesses.

{Smmpm_cg, SmnpmS_cg, SmnpmU_cg, Ssnpm_cg}/cp_pmlen_masking

pm_mprv_spvp

MPRV and SPVP affect pointer masking as well, causing the pointer masking settings of the effective privilege mode to be applied.

Smmpm_cg/cp_pm_mprv_mpp_m, SsnpmSm_cg/cp_pm_mprv_mpp_u, SmnpmSSm_cg/cp_pm_mprv_mpp_s, SmnpmUSm_cg/cp_pm_mprv_mpp_u

pm_mxr_exception

When MXR is in effect at the effective privilege mode where explicit memory access is performed, pointer masking does not apply.

{Smmpm_cg, SmnpmS_cg, Ssnpm_cg}/cp_pmm_mxr

pm_cpu_only

Pointer masking only applies to accesses generated by instructions on the CPU (including CPU extensions such as an FPU). E.g., it does not apply to accesses generated by page-table walks, the IOMMU, or devices.

{Smmpm_cg, SmnpmS_cg, SmnpmU_cg, Ssnpm_cg}/cp_pmlen_masking

pm_misaligned_equivalence

Misaligned accesses are supported, subject to the same limitations as in the absence of pointer masking. The behavior is identical to applying the pointer masking transformation to every constituent aligned memory access.

{Smmpm_cg, SmnpmS_cg, SmnpmU_cg, Ssnpm_cg}/cp_pmlen_misaligned_word

pm_no_csr_sw

No pointer masking operations are applied when software reads/writes to CSRs, including those meant to hold addresses.

{Smmpm_cg, SmnpmS_cg}/cp_pm_csr_software_access

pm_warl_unaffected

The implemented WARL width of CSRs is unaffected by pointer masking

{Smmpm_cg, SmnpmS_cg}/cp_pm_csr_software_access

pm_csr_hw_apply

pointer masking, when applicable, is applied for hardware writes to a CSR (e.g., when the hardware writes the transformed address to stval when taking an exception).

{Smmpm_cg, SmnpmS_cg, SmnpmU_cg, Ssnpm_cg}/cp_hardware_csr_writes_fault

pm_debug_trigger

Pointer masking is also applied, when applicable, to the memory access address when matching address triggers in debug.

pm_no_trap_vector_mask

on trap delivery (e.g., due to an exception or interrupt), pointer masking will not be applied to the address of the trap handler.

ssnpm_definition

A supervisor-level extension that provides pointer masking for the next lower privilege mode (U-mode), and for VS- and VU-modes if the H extension is present.

Ssnpm_cg/cp_pmlen_masking

smnpm_definition

A machine-level extension that provides pointer masking for the next lower privilege mode (S/HS if S-mode is implemented, or U-mode otherwise).

{SmnpmS_cg, SmnpmU_cg}/cp_pmlen_masking

smmpm_definition

A machine-level extension that provides pointer masking for M-mode.

Smmpm_cg/cp_pmlen_masking

pm_rv64_only

Pointer masking only applies to RV64.

{Smmpm_cg, SmnpmS_cg, SmnpmU_cg, Ssnpm_cg}/cp_pmlen_masking

pm_rv32_illegal

In RV32, trying to enable pointer masking will result in an illegal WARL write and not update the pointer masking configuration bits

Sm_mcsr_cg/cp_mcsrwalk_masked/{menvcfgh, mseccfgh}

pm_uxl_clear

Setting UXL/SXL to 1 will clear the corresponding pointer masking configuration bits.

Ssnpm_cg/cp_pmm_uxl_clear

pmlen_mode_depend

the supported values of PMLEN may depend on the effective privilege mode. The current standard only defines PMLEN=XLEN-48 and PMLEN=XLEN-57,

{Smmpm_cg, SmnpmS_cg, SmnpmU_cg, Ssnpm_cg}/cp_pmlen_masking

pmlen_illegal_warl

Trying to enable pointer masking in an unsupported scenario represents an illegal write to the corresponding pointer masking enable bit and follows WARL semantics.

Sm_mcsr_cg/cp_mcsrwalk_masked/{menvcfg, mseccfg, menvcfgh, mseccfgh}, S_scsr_cg/cp_scsrwalk/senvcfg

UDB Parameters: None.

B.11.10. Smnpm Pointer Masking

Smnpm is a machine level extension which enables pointer maksing for lower privilege level S mode (if implemented ) or otherwise U-mode via menvcfg. In this sheet , test plan is for S-mode implementation (SmnpmS) Similar to Ssnpm except: Run the same coverpoints as Ssnpm in S-mode except - MXR bit is sampled from mstatus csr - remove cp_pmm_uxl_clear - cp_pmlen_zicfiss_amo and cp_pmlen_zicfiss_ssp are exactly the same as Ssnpm except only menvcfg.SSE=1 is set (senvcfg.SSE controls U-mode and is not needed in S-mode), and the shadow stack page is a supervisor page.

Table 330. Smnpm Coverpoints (S mode)
Coverpoint Goal Feature Description Expectation Bins Normative Rule

- add the following cp_pm_csr_software_access_* coverpoints

cp_pm_csr_software_access

Ensure pointer masking is not applied to software CSR reads and writes

Pointer masking is not applied to software CSR reads and writes.
Test Environment:
In M-mode , set menvcfg.PMM={10(PMLEN=7),11(PMLEN=16)}
switch to S-mode;
Write XLEN test patterns with upper PMLEN bits set to RW CSRs {sepc, stvec, sscratch} using {csrrw}. Read back the same CSR using CSR read instructions then compare written and read values.

No masking applied; read-back value matches written value (subject to WARL constraints).
The implemented WARL width of CSRs is unaffected by pointer masking

2 PMM * 4 CSR ops * 1 mode (S) * 3 CSR * satp supported modes (Bare, Sv39, Sv48, Sv57)

pm_no_csr_sw
pm_warl_unaffected

Smnpm provides pointer masking for S-mode (if implemented) via menvcfg.PMM. In this sheet , test plan is for the M-mode part of SmnpmS: M-mode accesses memory as S-mode via MPRV. - tests run in M-mode with mstatus.MPRV=1 and mstatus.MPP=S - The suite requires Smnpm and S-mode because menvcfg.PMM governs the access. mseccfg.PMM is swept only if Smmpm is supported, to show that it does not apply.

Table 331. Smnpm Coverpoints (S mode, M-mode with MPRV)
Coverpoint Goal Feature Description Expectation Bins Normative Rule

cp_pm_mprv_mpp_s

Verify that menvcfg.PMM governs pointer masking when M-mode accesses memory as S-mode via MPRV.

MPRV affect pointer masking as well, causing the pointer masking settings of the effective privilege mode to be applied.
With MPP=S the effective privilege mode is S, so menvcfg.PMM applies and mseccfg.PMM does not.
Test Environment:
In M-mode set mstatus.MPRV=1 and mstatus.MPP=S
Set mstatus.SUM=1 so the setup code can access user-space pages.
Place known value_old in scratch. Let A' = scratch (upper bits = 0x0000).
Page tables configured for valid mappings under satp.MODE ∈ {Bare, Sv39}, with the data pages user-accessible.
For each mstatus.MXR in {0, 1}:
For each mseccfg.PMM in {00, 10, 11} if Smmpm supported:
For each menvcfg.PMM in {00, 10, 11}:
For each satp.MODE in {Bare, Sv39}:
For each A_upper_bits in {0x0000, 0x0001, 0x0200}:
Set A = A' with upper bits replaced by A_upper_bits
For read (lw): read directly from A in M-mode with MPRV=1, sigupd(value), record any traps.
For write (sw): write unique known value_new to A in M-mode with MPRV=1, read back from scratch (A'), sigupd(value), record any traps.

When menvcfg.PMM=10/11 and MXR=0: A patterns whose upper bits fall within PMLEN resolve to scratch, reads return known value_old, write readbacks return known value_new, regardless of mseccfg.PMM. When menvcfg.PMM=00 or MXR=1: masking disabled : only A=0x0000 resolves to scratch; all other patterns cause a trap.

2 MXR * 3 mseccfg.PMM * 3 menvcfg.PMM * 1 MPRV * 1 MPP (S) * 2 satp.MODE * 3 addresses * 2 instructions (lw, sw)

pm_mprv_spvp

Smnpm is a machine level extension which enables pointer maksing for lower privilege level S mode (if implemented ) or otherwise U-mode via menvcfg. In this sheet , test plan is for U-mode implementation (SmnpmU), i.e if S mode is not supported. Similar to Ssnpm except: If S-mode not supported, run the same coverpoints as Ssnpm in U-mode except the JALR cross is kept separate from MXR as it is read-only zero if S-mode is not supported , since implicit fetch must be verified as never masked regardless of whether S-mode (and hence MXR) is implemented. - all addresses are physical, Tests executed only in Bare mode . - For cp_hardware_csr_write_faults , traps are being handled in M mode and mtval will be checked. - drop cp_pmm_mxr because MXR is read-only 0 if S-mode is not supported - drop cp_pmlen_zicfiss_amo and cp_pmlen_zicfiss_ssp because Zicfiss cannot be activated if S-mode is not supported: SSAMOSWAP is illegal in U-mode, and SSPUSH and SSPOPCHK revert to their Zimop/Zcmop behavior and do not access memory.

Smnpm provides pointer masking for U-mode via menvcfg.PMM if S-mode is not supported. In this sheet , test plan is for the M-mode part of SmnpmU: M-mode accesses memory as U-mode via MPRV. Similar to SmnpmSSm except: - tests run in M-mode with mstatus.MPRV=1 and mstatus.MPP=U - all addresses are physical, Tests executed only in Bare mode . - MXR is not swept because it is read-only 0 if S-mode is not supported

Table 332. Smnpm Coverpoints (no S mode, M-mode with MPRV)
Coverpoint Goal Feature Description Expectation Bins Normative Rule

cp_pm_mprv_mpp_u

Verify that menvcfg.PMM governs pointer masking when M-mode accesses memory as U-mode via MPRV on a hart without S-mode.

MPRV affect pointer masking as well, causing the pointer masking settings of the effective privilege mode to be applied.
With MPP=U the effective privilege mode is U, so menvcfg.PMM applies and mseccfg.PMM does not.
Test Environment:
In M-mode set mstatus.MPRV=1 and mstatus.MPP=U
Place known value_old in scratch. Let A' = scratch (upper bits = 0x0000).
For each mseccfg.PMM in {00, 10, 11} if Smmpm supported:
For each menvcfg.PMM in {00, 10, 11}:
For each A_upper_bits in {0x0000, 0x0001, 0x0200}:
Set A = A' with upper bits replaced by A_upper_bits
For read (lw): read directly from A in M-mode with MPRV=1, sigupd(value), record any traps.
For write (sw): write unique known value_new to A in M-mode with MPRV=1, read back from scratch (A'), sigupd(value), record any traps.

When menvcfg.PMM=10/11: A patterns whose upper bits fall within PMLEN resolve to scratch, reads return known value_old, write readbacks return known value_new, regardless of mseccfg.PMM. When menvcfg.PMM=00: masking disabled : only A=0x0000 resolves to scratch; all other patterns cause a trap.

3 mseccfg.PMM * 3 menvcfg.PMM * 1 MPRV * 1 MPP (U) * 3 addresses * 2 instructions (lw, sw)

pm_mprv_spvp

See Table 328 for normative rules.

B.11.11. Smmpm Pointer Masking

Smmpm is a machine-level extension that provides pointer masking for M-mode. Exactly same coverpoints as Ssnpm except delete cp_pmm_uxl_clear, add the following, and run in M-mode: - all addresses are physical, all tests run in Bare/ M-mode . - drop cp_pmlen_zicfiss_amo and cp_pmlen_zicfiss_ssp because Zicfiss cannot be activated in M-mode: SSAMOSWAP always raises a store/AMO access fault, and SSPUSH and SSPOPCHK revert to their Zimop/Zcmop behavior and do not access memory. - MPRV is tested here only with MPP=M, where mseccfg.PMM governs. MPP=U and MPP=S are governed by senvcfg.PMM and menvcfg.PMM, so they are in the SsnpmSm, SmnpmSSm and SmnpmUSm suites. the JALR cross is kept separate from MXR and not guarded by S_SUPPORTED , since implicit fetch must be verified as never masked regardless of whether S-mode (and hence MXR) is implemented.

Table 333. Smmpm Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule

- For cp_hardware_csr_* , traps are being handled in M mode and mtval will be checked.

cp_pm_mprv_mpp_m

Verify that mseccfg.PMM governs pointer masking when M-mode accesses memory with MPRV=1 and MPP=M.

MPRV affect pointer masking as well, causing the pointer masking settings of the effective privilege mode to be applied.
With MPP=M the effective privilege mode stays M, so mseccfg.PMM applies. satp and MXR do not apply to M-mode accesses, so they are not swept.
Test Environment:
In M-mode set mstatus.MPRV=1 and mstatus.MPP=M
Place known value_old in scratch. Let A' = scratch (upper bits = 0x0000).
For each mseccfg.PMM in {00, 10, 11}:
For each A_upper_bits in {0x0000, 0x0001, 0x0200}:
Set A = A' with upper bits replaced by A_upper_bits
For read (lw): read directly from A in M-mode with MPRV=1, sigupd(value), record any traps.
For write (sw): write unique known value_new to A in M-mode with MPRV=1, read back from scratch (A'), sigupd(value), record any traps.

When mseccfg.PMM=10/11: A patterns whose upper bits fall within PMLEN resolve to scratch, reads return known value_old, write readbacks return known value_new. When mseccfg.PMM=00: masking disabled : only A=0x0000 resolves to scratch; all other patterns cause a trap.

3 mseccfg.PMM * 1 MPRV * 1 MPP (M) * 3 addresses * 2 instructions (lw, sw)

pm_mprv_spvp

cp_pm_csr_software_access

Ensure pointer masking is not applied to software CSR reads and writes

Pointer masking is not applied to software CSR reads and writes.
Test Environment:
In M-mode, set mseccfg.PMM={10(PMLEN=7),11(PMLEN=16)}.
Write XLEN test patterns with upper PMLEN bits set to RW CSRs {mepc, mscratch} , using {csrrw, csrrs, csrrc, csrrwi}. Read back the same CSR using CSR read instructions then compare written and read values.

No masking applied; read-back value matches written value (subject to WARL constraints).
The implemented WARL width of CSRs is unaffected by pointer masking

2 PMM * 4 (csrrw / csrrc / 4csrrs /csrrwi) * 1 mode (M ) * 3 csr

pm_no_csr_sw
pm_warl_unaffected

See Table 328 for normative rules.

B.11.12. Zicfilp Landing Pads

In Privileged section because it has both unpriv and privileged behaviors. The common coverpoints are defined once and re-executed by the ZicfilpU, ZicfilpSm and ZicfilpS suites in their privilege mode; each of those suites adds the coverpoints for its mode’s xPELP handling. ZicfilpH covers VS/VU-mode (see Table 298).

Table 334. Zicfilp Common Coverpoints
Coverpoint Goal Feature Description Expectation Bins ID Normative Rule

In this sheet:
Indirect_CT = { JALR, C.JR, C.JALR } (if C implemented)
link_reg = { x1, x5, x7 }
non_link_reg = all other GPRs
ELP = { NO_LP_EXPECTED, LP_EXPECTED }
This sheet serves as the common reference for all Zicfilp privilege-mode
specific sheets (M-mode, S-mode, U-mode). It contains the full specification
of all shared coverpoints with complete descriptions, expectations, bins,
and normative rules.
Zicfilp provides forward-edge control-flow integrity by requiring that
indirect control transfers target an LPAD instruction when LP_EXPECTED is set.
xLPE (Landing Pad Enable) is privilege-mode dependent:
If S-mode implemented:
M-mode ⇒ mseccfg.MLPE
S/HS ⇒ menvcfg.LPE
VS ⇒ henvcfg.LPE
U/VU ⇒ senvcfg.LPE
If S-mode not implemented:
M-mode ⇒ mseccfg.MLPE
U-mode ⇒ envcfg.LPE
General Test Environment:
- Zicsr implemented.
- No higher-priority exception injected unless explicitly stated.

cp_zicfilp_indirect_elp_state_update

Verify correct update of ELP state on execution of indirect control-transfer instructions based on rs1 category, privilege mode, and xLPE enable state.

Test Case: Execute Indirect_CT instructions in each supported privilege mode under the following configurations:
1. xLPE=1
2. xLPE=0
Execute instruction with rs1 ∈ all 31registers excluding x0
- indirect jump destination={LPAD, NON-LPAD }
- for JALR the destination rd=random

software check exception if applicable
.
.

31 rs1 registers ×
2 LPEs×
3 indirect_CT types x2 destinations

zicflip_lpad_expected


[norm:zicflip_indirect_branch_lpad]

cp_zicfilp_lpad_zero_label_bypass

Verify that LPAD with LPL=0 bypasses label comparison during landing pad validation.

Test Environment:
xLPE=1,
execute an indirect control transfer (Indirect_CT) using rs1 != {x1,x5,x7} so that ELP=LP_EXPECTED.
Target an LPAD instruction whose encoded LPL=0. Execute with arbitrary values in x7.

Indirect branch shall succeed without software-check exception. LPAD label comparison shall be bypassed when LPL=0.

N Indirect_CT types × N privilege modes × target_LPL_zero

zicflip_lpad_imm_enc

norm:zicflip_lpad_imm_enc

cp_zicfilp_lpad_valid_execution

Verify that a valid LPAD instruction satisfies landing pad validation when ELP=LP_EXPECTED.

Test Environment:
xLPE=1,
execute an indirect control transfer (Indirect_CT) using rs1 != {x1,x5,x7} so that ELP=LP_EXPECTED.
Then execute a properly aligned LPAD instruction at the target address under two conditions: (1) LPL=0, (2) LPL matches x7[31:12].

No software-check exception shall be raised. After LPAD retirement, ELP shall be set to NO_LP_EXPECTED.

2 (LPL={0,match}) × N Indirect_CT types × N privilege modes

zicflip_elp_lpad_expected

[norm:zicflip_elp_lpad_expected]

cp_zicfilp_lpad_missing_instruction_exception

Verify that execution of a non-LPAD instruction when ELP=LP_EXPECTED raises a software-check exception.

Test Environment:
xLPE=1,
execute an indirect control transfer (Indirect_CT) using rs1 != {x1,x5,x7} so that ELP=LP_EXPECTED.
At the target address, execute an instruction that is not LPAD.

A software-check exception (cause=18) shall be raised. xtval shall indicate landing pad fault (code=2). ELP shall remain LP_EXPECTED.

N Indirect_CT types × N privilege modes

zicflip_elp_lpad_expected

[norm:zicflip_elp_lpad_expected]

cp_zicfilp_lpad_label_mismatch

Verify software-check exception for LPAD label mismatch

xLPE=1,
execute an indirect control transfer (rs1 != {x1,x5,x7}) so that ELP=LP_EXPECTED.
Load x7 with a label using LUI, then execute LPAD with nonzero LPL that does not match x7[31:12].

Software-check exception (cause=18) shall be raised. xtval shall indicate "landing pad fault (code=2)".

Instruction type × rs1 category × ELP × N privilege modes

zicflip_elp_lpad_expected

cp_zicfilp_lpad_label_match_mismatch

Verify LPAD label matching and mismatching behavior

Test Environment:
- xLPE=1. Load a label (e.g. 0x12345) into x7[31:12], then execute an Indirect_CT with rs1 != {x1,x5,x7} so that ELP=LP_EXPECTED, to:
(1) an LPAD whose LPL matches x7[31:12],
(2) an LPAD whose nonzero LPL does not match x7[31:12],
(3) a non-LPAD instruction,
(4) an LPAD with nonzero LPL while x7[31:12]=0.

If expected landing pad label in x7 matches LPAD immediate label, no exception. Otherwise, software-check exception occurs.

4 scenarios x 3 Indirect_CT types (C.JR and C.JALR only with Zca) = 12

zicflip_lpad_label

[norm:zicflip_lpad_label]

cp_zicfilp_lpad_label_exception_delivery

Verify software-check exception delivery and correct privilege-mode handling on LPAD label mismatch

Test Environment:
- xLPE=1. Load x7[31:12] with a nonzero label, then execute an Indirect_CT with rs1 != {x1,x5,x7} so that ELP=LP_EXPECTED, to a 4-byte aligned LPAD whose nonzero LPL does not match x7[31:12].

Software-check exception (cause=18) delivered to the mode that takes the suite’s traps: M-mode for ZicfilpSm, S-mode for ZicfilpS, and S-mode for ZicfilpU (M-mode when S-mode is not implemented). xtval = landing pad fault (code=2). xPELP = LP_EXPECTED.

3 Indirect_CT types (C.JR and C.JALR only with Zca)

zicflip_lpad_enabled_exception
zicflip_lpad_label_exception
lpad_sw_exception
cfi_sstatus_spelp_op

[norm:zicflip_lpad_enabled_exception]
[norm:zicflip_lpad_label_exception]

[norm:cfi_sstatus_spelp_op]

cp_disabled_zicfilp

Verify behavior when Zicfilp is disabled

Test Environment:
but explicitly disabled at the tested privilege mode (xLPE=0),
execute LPAD instructions or indirect branches targeting LPAD.

No exception is raised; LPAD acts as a nop.

1 × N privilege modes

zicflip_lpad_enabled_instr_allowed

[norm:zicflip_lpad_enabled_instr_allowed]

cp_lpad_no_sw_exception_elp_clear_zicfilp

Verify that ELP updates to NO_LP_EXPECTED after executing a valid LPAD

Test Environment:
xLPE=1.
Execute an Indirect_CT (JALR, C.JR, C.JALR) with rs1 != {x1,x5,x7} so that ELP=LP_EXPECTED,
to a 4-byte aligned LPAD whose nonzero LPL matches x7[31:12].

No software-check exception is raised. ELP is updated to NO_LP_EXPECTED after LPAD execution

3 Indirect_CT types (C.JR and C.JALR only with Zca)

zicflip_lpad_sw_exception

[norm:zicflip_lpad_no_sw_exception]

cp_exception_priority_zicfilp

Verify the priority of exceptions

Test Environment:
xLPE=1.
(1) Execute an Indirect_CT with rs1 != {x1,x5,x7} targeting RVMODEL_ACCESS_FAULT_ADDRESS: the instruction access fault is taken, not the software-check exception, and xPELP records LP_EXPECTED.
(2) Target an illegal instruction: the software-check exception is taken, not an illegal-instruction exception.

Instruction access fault (cause=1) is taken in preference to the software-check exception, and the software-check exception is taken in preference to an illegal-instruction exception (cause=2).

N privilege modes x {instruction access fault at the target, illegal instruction at the target}

Zicfilp_forward_trap_async_exception
Zicfilp_exception_priority

[norm:Zicfilp_forward_trap_async_exception]
[norm:Zicfilp_exception_priority]

cp_lpad_alignment_exception_zicfilp

Verify that an LPAD that is not 4-byte aligned raises a software-check exception when ELP=LP_EXPECTED

Only when Zca is implemented.
Test Environment:
xLPE=1. Execute an Indirect_CT (JALR, C.JR, C.JALR) with rs1 != {x1,x5,x7} so that ELP=LP_EXPECTED,
to an LPAD with LPL=0 at pc[1:0]=2.
Without Zca such a target raises an instruction-address-misaligned exception first, which is why this case needs Zca.

Software-check exception (cause=18) with xtval = landing pad fault (code=2), even though LPL=0.

3 Indirect_CT types (Zca only)

Zicflip_elp_lpad_expected Zicflip_lpad_exception

[norm:Zicflip_elp_lpad_expected] [norm:Zicflip_lpad_exception]

cp_lpad_nop_no_lp_expected_zicfilp

Verify that LPAD is a no-op when ELP=NO_LP_EXPECTED, even with xLPE=1

Test Environment:
xLPE=1 and no Indirect_CT before the LPAD, so ELP=NO_LP_EXPECTED.
Load x7[31:12] with a nonzero label and execute sequentially:
(1) an LPAD whose nonzero LPL does not match x7[31:12],
(2) if Zca is implemented, an LPAD with LPL=0 at pc[1:0]=2.

No exception. Both LPADs execute as no-ops and ELP stays NO_LP_EXPECTED.

2 (LPL mismatch; pc[1:0]=2 only with Zca)

Zicflip_lpad_exception

[norm:Zicflip_lpad_exception]

The gray test are duplicates of other test and are excluded.

The yellow coverpoints are excluded because they apply to debug

cp_lpad_misaligned_address_exception_zicfilp

Verify exception for misaligned PC

Test Case
Execute indirect branch to set ELP=LP_EXPECTED, then execute LPAD at misaligned address (not 4-byte aligned)

Software-check exception raised (cause=18), xtval="landing pad fault (code=2)", ELP unchanged

Instruction type × rs1 category (non-link register) × ELP)xpriv mode

zicflip_elp_lpad_expected

[norm:zicflip_elp_lpad_expected]
Duplicate of cp_lpad_alignment_exception_zicfilp.

cp_elp_state_preservation_debug_zicfilp

Verify Debug Mode saves and
restores previous ELP via dcsr.PELP

Test Case
Execute indirect branch to set ELP=LP_EXPECTED,
enter Debug Mode using EBREAK instruction

Debug mode entered, dcsr.pelp stores previous ELP value,
after exiting debug mode, ELP restored correctly

Origin mode U ×
Debug entry × ELP state

dcsr-pelp_op

[norm:dcsr-pelp_op]
Should be added in Debug testplan when we will start writing Debug testplans

cp_pelp_debug_mode_zicflip

Verify ELP on Debug Mode entry

Test Case
Execute indirect branch in U-mode to set ELP=LP_EXPECTED, execute EBREAK to enter Debug Mode

dcsr.pelp = LP_EXPECTED and ELP set to NO_LP_EXPECTED

Debug entry × Initial ELP state

norm:Zicfilp_pelp_debug_mode

[norm:Zicfilp_pelp_debug_mode]
Should be added in Debug testplan when we will start writing Debug testplans

cp_pelp_debug_mode_r_zicflip

Verify ELP on resuming from Debug Mode

Test Case
Resume from Debug Mode with senvcfg.LPE=1
Test Case
Resume from Debug Mode with senvcfg.LPE=0

ELP restored from dcsr.pelp for 1
ELP set to NO_LP_EXPECTED for 0

Resume privilege × LPE disabled/enabled

norm:Zicfilp_pelp_debug_mode

[norm:Zicfilp_pelp_debug_mode]
Should be added in Debug testplan when we will start writing Debug testplans

ZicfilpU User-Mode Landing Pads

In this sheet, all Zicfilp tests from the Zicfilp_Common sheet are re-executed in User Mode (U-mode). Environment: - Zicfilp extension enabled, Zicsr enabled. - Landing Pad Enabled (LPE) controlled by: senvcfg.LPE when S-mode is implemented menvcfg.LPE when S-mode is not implemented - Tests execute in U-mode. Execution Notes: - All indirect branch instructions (JALR, C.JALR, C.JR) are exercised as in the Common sheet. - LPAD behavior, label matching, immediate encoding, and software-check exceptions are tested as per normative rules defined in the spec. - ELP state is observed via sstatus.SPELP when S-mode is implemented, because U-mode software-check exceptions are delegated to S-mode (medeleg[18]=1 in the ACT4 boot code). When S-mode is not implemented the trap is taken in M-mode and ELP is observed via mstatus.MPELP (RV64) or mstatush.MPELP (RV32). since U-mode traps are delivered to M-mode. - Trap entry and return coverpoints from the M-mode sheet are not repeated here as they are M-mode specific by spec. - All other assumptions, instruction types, and execution conditions are identical to the Zicfilp_Common sheet. Excluded (Debug testplan — separate file): - Excluded (Redundant — standard ISA traps already cover these):

ZicfilpSm Machine-Mode Landing Pads

In this sheet, all Zicfilp tests from the Zicfilp_Common sheet are executed in Machine Mode (M-mode). Environment: - Zicfilp extension enabled, Zicsr enabled. - Landing Pad Enabled (LPE) controlled by mseccfg.MLPE. - Tests execute in M-mode. Execution Notes: - All indirect branch instructions (JALR, C.JALR, C.JR) are exercised as in the Common sheet. - LPAD behavior, label matching, immediate encoding, and software-check exceptions are tested as per normative rules defined in the spec. - ELP state is observed via mstatus.MPELP (RV64) or mstatush.MPELP (RV32). - This sheet additionally covers M-mode specific trap entry and return coverpoints not present in other sheets: cp_elp_state_preservation_zicfilp cp_pelp_trap_entry_m_zicfilp cp_pelp_trap_entry_m_guarded_zicfilp cp_pelp_trap_return_m_zicfilp - All other assumptions, instruction types, and execution conditions are identical to the Zicfilp_Common sheet. Excluded (Debug testplan — separate file): - cp_elp_state_preservation_debug_zicfilp - cp_pelp_debug_mode_zicflip - cp_pelp_debug_mode_r_zicflip Excluded (Redundant — standard ISA traps already cover these): - cp_lpad_misaligned_address_exception_zicfilp - cp_lpad_alignment_exception_zicflip

Table 335. ZicfilpSm Coverpoints
Coverpoint Goal Feature Description Expectation Bins ID Normative Rule

cp_elp_state_preservation_zicfilp

Verify M-mode trap saves and restores previous ELP using MPELP

Test Environment:
xLPE=1 in the origin mode and medeleg=0. Execute an indirect branch in S- or U-mode (rs1 != {x1,x5,x7}) to a non-LPAD instruction: the software-check exception is taken in M-mode with ELP=LP_EXPECTED.
An ECALL cannot be used for the LP_EXPECTED case, because an ECALL at the target of an ELP-setting branch raises the software-check exception first. The ECALL back to M-mode covers the ELP=NO_LP_EXPECTED case.

Trap is delivered to M-mode. Previous ELP value (LP_EXPECTED) is saved in mstatus.MPELP. After executing MRET, ELP is restored to LP_EXPECTED in the returning privilege mode

Origin mode (U/S) × Trap target (M-mode) × ELP states

cfi_mstatus-mpelp_op

[norm:mstatus-mpelp_op]

cp_pelp_trap_entry_m_zicfilp

Verify xPELP and ELP on trap entry to M-mode

Test Environment:
mseccfg.MLPE=1. Execute an ECALL in M-mode with ELP=NO_LP_EXPECTED (no Indirect_CT before it), followed by a non-LPAD instruction.
The ELP=LP_EXPECTED case (software-check exception at a non-LPAD target) is covered by cp_zicfilp_lpad_label_exception_delivery.

On trap entry: mstatus.MPELP (mstatush.MPELP on RV32) = NO_LP_EXPECTED and ELP = NO_LP_EXPECTED. MRET therefore leaves ELP clear, so the non-LPAD instruction after the ECALL does not trap.

1 (ECALL in M-mode with ELP=NO_LP_EXPECTED)

Zicfilp_pelp_trap

[norm:Zicfilp_pelp_trap]

cp_pelp_trap_entry_m_guarded_zicfilp

Verify xPELP and ELP on trap entry from software-guarded branch

Test Environment:
mseccfg.MLPE=1. Execute an Indirect_CT through x1, x5 and x7 in M-mode to an ECALL.
No landing pad is required at the target, so the ECALL is taken instead of a software-check exception.

On trap entry: mstatus.MPELP = NO_LP_EXPECTED and ELP remains NO_LP_EXPECTED.

3 rs1 registers {x1,x5,x7} x 3 Indirect_CT types (JALR, plus C.JR and C.JALR when Zca is implemented) = 3 + 6

Zicfilp_pelp_trap

[norm:Zicfilp_pelp_trap]

cp_pelp_trap_return_m_zicfilp

Verify behavior of return from trap via MRET

Test Environment:
In M-mode set mstatus.MPP to M, S or U, set mstatus.MPELP (mstatush.MPELP on RV32) to 0 or 1, set mepc to a non-LPAD instruction, and execute MRET.
Sweep every combination of mseccfg.MLPE, menvcfg.LPE and senvcfg.LPE for each target mode.
After an MRET to M-mode, read MPELP back.

On MRET, ELP is set to MPELP if the xLPE of the mode being returned to is 1, otherwise NO_LP_EXPECTED. MPELP is set to NO_LP_EXPECTED. A software-check exception occurs only when MPELP=1 and the new mode’s xLPE=1. MPELP read back after an MRET to M-mode is 0.

3 target modes (M/S/U) x 8 (mseccfg.MLPE x menvcfg.LPE x senvcfg.LPE) x 2 MPELP = 48. Without S-mode: 2 target modes (M/U) x 4 (mseccfg.MLPE x menvcfg.LPE) x 2 = 16. M-mode only: 1 x 2 x 2 = 4.

Zicfilp_pelp_trap_return

[norm:Zicfilp_pelp_trap_return]

ZicfilpS Supervisor-Mode Landing Pads
Table 336. ZicfilpS Coverpoints
Coverpoint Goal Feature Description Expectation Bins ID Normative Rule

In this sheet, all Zicfilp tests from the Zicfilp_common_reference sheet are re-executed in Supervisor Mode (S-mode).
Environment:
- Zicfilp extension enabled, Zicsr enabled.
- Landing Pad Enabled (LPE) set according to privilege mode.
- Tests execute in S-mode.
Execution Notes:
- All indirect branch instructions (JALR, C.JALR, C.JR) are exercised as in the M/U-mode sheet.
- LPAD behavior, label matching, immediate encoding, and software-check exceptions are tested as per normative rules defined in the spec.
- Privilege-specific CSRs (SPELP, sstatus) are used for capturing and verifying ELP state in S-mode.
- Trap entry and return tests replicate M-mode tests but with S-mode as trap target.
- All other assumptions, instruction types, and execution conditions are identical to the original Zicfilp testplan.

cp_pelp_trap_entry_s_zicfilp

Verify xPELP and ELP on trap entry to S-mode

Test Environment:
menvcfg.LPE=1. Execute EBREAK in S-mode with ELP=NO_LP_EXPECTED (no Indirect_CT before it), followed by a non-LPAD instruction.
The breakpoint is delegated to S-mode; an S-mode ECALL is not delegated and reaches M-mode.
The ELP=LP_EXPECTED case (software-check exception at a non-LPAD target) is covered by cp_zicfilp_lpad_label_exception_delivery.

On trap entry: sstatus.SPELP = NO_LP_EXPECTED and ELP = NO_LP_EXPECTED. SRET therefore leaves ELP clear, so the non-LPAD instruction after the EBREAK does not trap.

1 (EBREAK in S-mode with ELP=NO_LP_EXPECTED)

Zicfilp_pelp_trap

[norm:Zicfilp_pelp_trap]

cp_pelp_trap_entry_s_guarded_zicfilp

Verify xPELP and ELP on trap entry to S-mode from a software-guarded branch

Test Environment: menvcfg.LPE=1. Execute Indirect_CT through x1, x5 and x7 to an EBREAK. No landing pad is required at the target, so the breakpoint is taken instead of a software-check exception.

On trap entry: sstatus.SPELP = NO_LP_EXPECTED and ELP remains NO_LP_EXPECTED.

3 rs1 registers {x1,x5,x7} x 3 Indirect_CT types (JALR, plus C.JR and C.JALR when Zca is implemented) = 3 + 6

Zicfilp_pelp_trap, zicflip_indirect_branch_lpad

[norm:Zicfilp_pelp_trap], [norm:zicflip_indirect_branch_lpad]

cp_elp_state_preservation_s_zicfilp

Verify S-mode trap saves and restores previous ELP using SPELP

Test Environment: senvcfg.LPE=1. Execute an indirect branch in U-mode (rs1 != {x1,x5,x7}) to a non-LPAD instruction; the software-check exception is delegated to S-mode. After SRET the next non-LPAD instruction raises a second software-check exception, which shows ELP was restored. Then ECALL from U-mode with ELP=NO_LP_EXPECTED.

Trap delivered to S-mode. Previous ELP saved in sstatus.SPELP. After SRET, ELP is restored to LP_EXPECTED in U-mode.

Origin mode (U) x trap target (S-mode) x 2 ELP states

Zicfilp_pelp_trap, cfi_sstatus_spelp_op

[norm:Zicfilp_pelp_trap], [norm:cfi_sstatus_spelp_op]

cp_pelp_trap_return_s_zicfilp

Verify behavior of return from trap via SRET

Test Environment: In S-mode set sstatus.SPP to S or U, set sstatus.SPELP to 0 or 1, set sepc to a non-LPAD instruction, and execute SRET. Sweep all four combinations of menvcfg.LPE and senvcfg.LPE for each target mode. After an SRET to S-mode, read SPELP back.

ELP is set to SPELP if the new mode xLPE is 1, otherwise NO_LP_EXPECTED. SPELP is set to NO_LP_EXPECTED. A software-check exception occurs only when SPELP=1 and xLPE=1. SPELP read back after an SRET to S-mode is 0.

2 target modes (S/U) x 4 (menvcfg.LPE x senvcfg.LPE) x 2 SPELP = 16

Zicfilp_pelp_trap_return

[norm:Zicfilp_pelp_trap_return]

Table 337. Zicfilp Normative Rules
Normative Rule Rule Text Coverpoints

mstatus_spelp_mpelp_op

The Zicfilp extension adds the SPELP and MPELP fields that hold the previous ELP, and are updated as specified in ZICFILP_FORWARD_TRAPS.

cfi_mstatus_spelp_op

To store the previous ELP state on trap delivery to S/HS-mode, an SPELP bit is provided in the mstatus CSR.

cfi_mstatus_mpelp_op

To store the previous ELP state on trap delivery to M-mode, an MPELP bit is provided in the mstatus CSR.

mstatus_spelp_mpelp_enc_lead_in

The x`PELP` fields are encoded as follows:

mstatus_spelp_mpelp_enc_list

0 - NO_LP_EXPECTED - no landing pad instruction expected. 1 - LP_EXPECTED - a landing pad instruction is expected.

sstatus_spelp

Access to the SPELP field, added by Zicfilp, accesses the homonymous fields of mstatus when V=0, and the homonymous fields of vsstatus when V=1.

senvcfg_lpe_Zicfilp

The Zicfilp extension adds the LPE field in senvcfg. When the LPE field is set to 1, the Zicfilp extension is enabled in VU/U-mode. When the LPE field is 0, the Zicfilp extension is not enabled in VU/U-mode and the following rules apply to VU/U-mode:

Zicfilp_forward_trap_async_interrupt

Asynchronous interrupts.

Zicfilp_forward_trap_async_exception

Synchronous exceptions with priority higher than that of a software-check exception with xtval set to landing pad fault (code=2) (See norm:exc_priority of Privileged Specification).

Zicfilp_exception_priority

The software-check exception caused by Zicfilp has higher priority than an illegal-instruction exception but lower priority than instruction access-fault.

lpad_sw_exception

The software-check exception due to the instruction not being an LPAD instruction when ELP is LP_EXPECTED or a software-check exception caused by the LPAD instruction itself leads to a trap being delivered to the same or to a higher privilege mode.

cfi_sstatus_spelp_op

The SPELP bit in mstatus can be accessed through the sstatus CSR.

vsstatus_spelp_exists

To store the previous ELP state on traps to VS-mode, a SPELP bit is defined in the vsstatus (VS-modes version of sstatus).

dcsr_pelp_op

To store the previous ELP state on transition to Debug Mode, a PELP bit is defined in the dcsr register.

Zicfilp_pelp_debug_mode

Upon entry into Debug Mode, the PELP bit in dcsr is updated with the ELP at the privilege level the hart was previously in, and the ELP is set to NO_LP_EXPECTED. When a hart resumes from Debug Mode, if the new privilege mode is y, then ELP is set to the value of PELP if yLPE (see ) is 1; otherwise, it is set to NO_LP_EXPECTED.

Zicfilp_pelp_trap

When a trap is taken into privilege mode x, the XPELP is set to ELP and ELP is set to NO_LP_EXPECTED.

Zicfilp_pelp_trap_return

An MRET or SRET instruction is used to return from a trap in M-mode or S-mode, respectively. When executing an XRET instruction, if the new privilege mode is y, then ELP is set to the value of XPELP if yLPE (see ) is 1; otherwise, it is set to NO_LP_EXPECTED; XPELP is set to NO_LP_EXPECTED.

stval_exception_info

On a trap caused by a software-check exception, the stval register holds the cause for the exception. The following encodings are defined:

TODO: Zicfilp and Zicfiss should both cause exceptions and read xtval

UDB Parameters: None.

B.11.13. Zicfiss Shadow Stack

In Privileged section because it has both unpriv and privileged behaviors. ZicfissU holds the instruction-behavior coverpoints, which ZicfissS and ZicfissH re-run in their own modes; ZicfissS and ZicfissSm add the supervisor and machine gating coverpoints. ZicfissH covers VS/VU-mode (see Table 299).

ZicfissU User-Mode Shadow Stack

General Test Environment (applies to every coverpoint on this sheet — do not repeat per row): - Zicfiss, Zicsr, Zimop, Zaamo implemented. - Zcmop implemented unless stated (required for C.SSPUSH / C.SSPOPCHK); gate compressed variants with ZCA_SUPPORTED. - S-mode implemented (Zicfiss in U-mode requires it). - Enable chain: menvcfg.SSE=1 and senvcfg.SSE=1 unless the coverpoint states otherwise. - Virtual memory ON (satp.MODE != Bare); shadow stack lives on a page with pte.xwr=010 (R=0,W=1,X=0). - All tests on this sheet execute in U-mode (BOOT_TO_UMODE). - ssp is XLEN-aligned unless the coverpoint states otherwise. No higher-priority exception injected unless stated. - SSPUSH/SSPOPCHK are architecturally defined only for x1 and x5 (C.SSPUSH x1, C.SSPOPCHK x5). - XLEN is NOT iterated inside a coverpoint: RV32 and RV64 are separate build configs.

Table 338. ZicfissU Coverpoints
Coverpoint Goal Feature Description Expectation Bins ID Normative Rule

cp_ssp_access_zicfiss

Verify ssp CSR address, width, access type, and read-only-zero low bits

Standard CSR access idiom on ssp (0x011): read original; write all-ones; write all-zeros; set all bits; clear all bits; write walking-ones; write walking-zeros; restore original. After each write, read back and check.
Bits [1:0] must read back zero regardless of what was written.

CSR address 0x011 decodes to ssp and is URW-accessible from U-mode.
Only XLEN low-order bits are retained; no high CSR exists (ssp is always XLEN wide).
ssp[1:0] read back as 0 after any write. All other writable bits update as written.
ssp[2] is ALSO read-only zero when UXLEN and SXLEN can never be 32, so the test sweeps ssp[2:0] and compares the read-back against the reference model rather than asserting a fixed value.

csr_op {csrrw, csrrs, csrrc, csrrwi, csrrsi, csrrci} x write_pattern {all1, all0, walking1, walking0} x ssp[2:0] readback (vs reference model)

ssp_op ssp_addr ssp_sz ssp-field_1_0

[norm:ssp_op] [norm:ssp_addr] [norm:ssp_sz] [norm:ssp-field_1_0]

cp_sspush_zicfiss

Verify shadow stack push: store to (ssp - XLEN/8), then decrement, for all three push encodings

For each of SSPUSH x1 (mop.rr.7), SSPUSH x5 (mop.rr.7), C.SSPUSH x1 (c.mop.1, requires Zcmop/ZCA_SUPPORTED):
set ssp to a writable XLEN-aligned SS page address, set the link register to a known value, execute the push, then read back ssp and the memory word at (ssp_old - XLEN/8).

No exception on valid execution.
ssp decremented by XLEN/8, and only if the store completed successfully.
Memory at (ssp_old - XLEN/8) holds the pushed link-register value.
Store width is implicitly XLEN and base is implicitly ssp.

instr {SSPUSH x1, SSPUSH x5, C.SSPUSH x1} x pushed_value {all0, all1, pattern} x ssp_delta {-XLEN/8}

ss_push sspush_c-sspush_instr sspush_c-sspush_decrement zicfiss_sspush_enc zicfiss_c-sspush_enc zicfiss_enc

[norm:ss_push] [norm:sspush_c-sspush_instr] [norm:sspush_c-sspush_decrement] [norm:zicfiss_sspush_enc] [norm:zicfiss_c-sspush_enc] [norm:zicfiss_enc]

cp_sspopchk_match_zicfiss

Verify successful shadow stack pop: XLEN load from ssp, value matches link register, ssp increments

For each of SSPOPCHK x1 (mop.r.28), SSPOPCHK x5 (mop.r.28), C.SSPOPCHK x5 (c.mop.5):
preload the SS memory at ssp with a known XLEN value, load the same value into the link register, execute the pop, then check the register, ssp, and that no trap was taken.

Value is loaded from the address in ssp with implicit base=ssp and implicit width=XLEN.
Loaded value matches the link register, so no software-check exception is raised.
ssp_new = ssp_old + XLEN/8, incremented only because the load completed and no software-check was raised.

instr {SSPOPCHK x1, SSPOPCHK x5, C.SSPOPCHK x5} x popped_value {all0, all1, pattern} x ssp_delta {+XLEN/8}

ss_pop sspopchk_shadow_return_pop sspopchk-c_load_op sspop_increment zicfiss_sspopchk_enc zicfiss_c-sspopchk_enc

[norm:ss_pop] [norm:sspopchk_shadow_return_pop] [norm:sspopchk-c_load_op] [norm:sspop_increment] [norm:zicfiss_sspopchk_enc] [norm:zicfiss_c-sspopchk_enc]

cp_sspopchk_mismatch_zicfiss

Verify software-check exception when the popped value does not match the link register

For each of SSPOPCHK x1, SSPOPCHK x5, C.SSPOPCHK x5: place value A on the shadow stack (directly, or via SSPUSH then corrupt the register, or via SSAMOSWAP to corrupt the memory copy), set the link register to B != A, execute the pop.
Vary how the mismatch is created so both the 'register corrupted' and 'shadow memory corrupted' directions are hit.
Edge cases: also mismatch in exactly one bit — bit 0 and bit XLEN-1 — so a comparator that ignores either end of the word is caught.

Software-check exception raised: cause=18, xtval = shadow stack fault (code=3).
ssp is NOT incremented — it holds its pre-instruction value at the trap.
Link register and shadow stack memory are unmodified.

instr {SSPOPCHK x1, SSPOPCHK x5, C.SSPOPCHK x5} x mismatch_source {reg_corrupted, mem_corrupted_via_ssamoswap} x mismatch_width {whole_word, bit0_only, bitXLEN-1_only} x {cause==18, xtval==3, ssp unchanged}

sspop_exception sspop_increment sspopchk_shadow_return_pop zicfiss_stack_compare

[norm:sspop_exception] [norm:sspop_increment] [norm:sspopchk_shadow_return_pop] [norm:zicfiss_stack_compare]

cp_sspopchk_fault_priority_zicfiss

Verify a load/store/AMO access-fault on the pop takes priority over the software-check exception

Point ssp at memory whose access will fault, and simultaneously set the link register so a value mismatch would also be detected. Execute SSPOPCHK.
An UNMAPPED page yields a store/AMO PAGE-fault (15). To get a store/AMO ACCESS-fault (7) the page must be mapped to RVMODEL_ACCESS_FAULT_ADDRESS, guarded by #ifdef.
PMP-denied regions can only be programmed from M-mode, so that variant lives on the ZicfissSm sheet as cp_sspopchk_fault_priority_pmp_zicfiss.

The memory fault is reported, not the software-check exception.
Unmapped page: store/AMO page-fault (cause=15). RVMODEL_ACCESS_FAULT_ADDRESS: store/AMO access-fault (cause=7). Either way the fault code is remapped to the store/AMO flavour.
ssp is unchanged.

fault_source {unmapped → cause 15, RVMODEL_ACCESS_FAULT_ADDRESS → cause 7} x mismatch_also_present {yes} x reported_cause {not 18}

sspop_exception

[norm:sspop_exception]

cp_ss_call_return_zicfiss

Verify the architectural non-leaf function prologue/epilogue round trip across nested call depth

Build a nested call chain of non-leaf functions. In each prologue: store the link register to the regular stack and SSPUSH it to the shadow stack. In each epilogue: load the link register from the regular stack, SSPOPCHK it against the shadow stack, then return. Exercise x1 and x5 as the link register and depth > 1 so ssp walks several slots.

Matched push/pop pairs at every depth: no exception, control returns correctly through the whole chain.
ssp returns to its original value once the outermost function returns.
A deliberately subverted return address on the regular stack is caught by the epilogue compare (software-check, cause=18, xtval=3).

link_reg {x1, x5} x return_addr {intact, subverted}. Call depth is exercised (1..3) but is not architecturally observable, so it is not a coverage axis.

zicfiss_link_reg_func_enter zicfiss_link_reg_func_return zicfiss_stack_compare

[norm:zicfiss_link_reg_func_enter] [norm:zicfiss_link_reg_func_return] [norm:zicfiss_stack_compare]

cp_ssrdp_zicfiss

Verify SSRDP moves ssp into rd, and reads 0 when Zicfiss is inactive

TC group 1: set ssp to a known value V, execute SSRDP rd, check rd == V.
TC group 2: SSPUSH x1, then SSRDP rd; check rd == ssp after the push (i.e. V - XLEN/8). Repeat after SSPOPCHK.
TC group 3: with the extension deactivated for this mode (xSSE=0), execute SSRDP rd.

TC1/TC2: rd holds the current ssp; no exception.
TC3: rd = 0. SSRDP is encoded in mop.r.28, so when Zicfiss is inactive it reverts to Zimop behaviour and writes 0 to rd — this is the documented way software detects whether Zicfiss is active. NO exception is raised.

ssp_value {known V, after push, after pop} x xSSE {1, 0} x rd result {ssp, 0}

ssrdp_read zicfiss_ssrdp_enc zicfiss_enc

[norm:ssrdp_read] [norm:zicfiss_ssrdp_enc] [norm:zicfiss_enc]

cp_ssamoswap_zicfiss

Verify SSAMOSWAP.W / SSAMOSWAP.D atomic swap semantics including RV64 sign-extension and narrow store

RV32: SSAMOSWAP.W rd, rs2, (rs1) on a 4-byte-aligned SS address.
RV64: SSAMOSWAP.D rd, rs2, (rs1) on an 8-byte-aligned SS address (full 64-bit swap).
RV64: SSAMOSWAP.W rd, rs2, (rs1) on a 4-byte-aligned SS address, with the loaded word’s MSB = 0 and MSB = 1, and with rs2 carrying non-zero bits in [63:32].
Ordering bits: exercise all four {aq, rl} combinations — 00, 01, 10, 11 — on both widths.
Register edges: rd = x0 and rd != x0; rs2 = x0 and rs2 != x0; and rd == rs1 (the address register is also the destination).

rd receives the value previously in memory; memory receives rs2. The pair is atomic.
RV64 SSAMOSWAP.W: rd is the SIGN-EXTENDED 32-bit loaded value (MSB=1 ⇒ upper 32 bits all ones), and only rs2[31:0] is stored — rs2[63:32] is ignored.
RV32 SSAMOSWAP.W: plain 32-bit swap. No exception on a valid aligned SS address.
aq/rl do not change the architectural result of a single-hart swap, but all four encodings must decode and execute.
rd = x0 discards the loaded value, the memory write still happens. rs2 = x0 stores zero. rd == rs1 must return the loaded value in rd after the address has been consumed.

instr {SSAMOSWAP.W, SSAMOSWAP.D} x xlen_config {RV32, RV64} x loaded_msb {0, 1} x rs2_upper {zero, nonzero} x {aq,rl} {00, 01, 10, 11} x reg_edge {rd=x0, rs2=x0, rd==rs1, all distinct non-x0}

rv32_ssamoswap-w_op rv64_ssamoswap-w_op zicfiss_atomic_swap

[norm:rv32_ssamoswap-w_op] [norm:rv64_ssamoswap-w_op] [norm:zicfiss_atomic_swap]

cp_ss_address_alignment_zicfiss

Verify alignment requirements for SSAMOSWAP (natural alignment) and for ssp (XLEN alignment)

Leg A — SSAMOSWAP: sweep the low 3 bits of the rs1 address across all 8 values for SSAMOSWAP.W (RV32/RV64) and SSAMOSWAP.D (RV64). Compare behaviour against the reference model.
Leg B — ssp: sweep the low 3 bits of ssp across all 8 values and execute SSPUSH x1, C.SSPUSH x1, SSPOPCHK x1, C.SSPOPCHK x5.

Leg A: naturally aligned (W: addr[1:0]==00; D: addr[2:0]==000) completes normally. Otherwise the same exception options as A-extension AMOs apply — reported cause must match the reference model.
Leg B: if ssp is not XLEN-aligned, SSPUSH/C.SSPUSH/SSPOPCHK/C.SSPOPCHK raise a store/AMO access-fault (cause=7). ssp and memory are unchanged.

leg {ssamoswap, ssp} x instr {SSAMOSWAP.W, SSAMOSWAP.D, SSPUSH x1, C.SSPUSH x1, SSPOPCHK x1, C.SSPOPCHK x5} x addr[2:0] {000..111}

ssamoswap_address ssp_xlen_aligned

[norm:ssamoswap_address] [norm:ssp_xlen_aligned]

cp_ss_instr_target_page_zicfiss

Verify the fault type an SS instruction takes for every class of target page / translation state

Cross every SS memory instruction against every class of target: SS page (xwr=010), read-only page (xwr=001), read-write page (xwr=011), execute page (xwr=100), unmapped page, and satp.MODE=Bare. Execute and capture the reported cause.
Sweep ALL EIGHT pte.xwr encodings (000, 001, 010, 011, 100, 101, 110, 111), not just the architecturally valid ones — 000 is a pointer rather than a leaf, and 110/111 are reserved.
Cross each with mstatus.MXR = 0 and 1, since MXR is exactly the bit that governs whether an R=0 page is readable and the SS page is R=0 by construction.
Cross each with the page’s U bit = 0 and 1.

[Threaded comment] Your version of Excel allows you to read this threaded comment; however, any edits to it will get removed if the file is opened in a newer version of Excel. Learn more: go.microsoft.com/fwlink/?linkid=870924 Comment: I thin xwr=110 should cause a store page fault, not access fault. SS page: succeeds.
Read-only page (xwr=001): store/AMO PAGE-fault, cause=15.
Any other non-SS, non-read-only page: store/AMO ACCESS-fault, cause=7.
Unmapped: store/AMO page-fault, cause=15. Non-idempotent memory: store/AMO access-fault, cause=7.
satp.MODE=Bare with effective privilege < M: store/AMO access-fault, cause=7.
In every faulting case the cause is remapped to the STORE/AMO flavour regardless of whether the instruction’s original access was a load or a store, and ssp is unchanged.
Reserved PTE encodings (e.g. xwr=110) are invalid to the page walker, so they raise a store/AMO PAGE-fault during translation rather than the access-fault that applies to valid non-SS encodings.
Reserved encodings (110, 111) and the non-leaf encoding (000) fail the walk itself, so they raise a store/AMO PAGE-fault during translation rather than the access-fault that applies to valid non-SS leaf encodings.
U=0 accessed from U-mode, and U=1 accessed from S-mode without SUM, fault on the permission check before any Zicfiss-specific rule applies.

instr {SSPUSH x1, SSPUSH x5, C.SSPUSH x1, SSPOPCHK x1, SSPOPCHK x5, C.SSPOPCHK x5, SSAMOSWAP.W, SSAMOSWAP.D} x pte.xwr {000..111} x MXR {0,1} x pte.U {0,1} x translation {Sv, satp.MODE=Bare} x cause {none, 7, 15}

ssmp_ss_page_illegeal_access ssmp_ss_read_only_page ss_fault_exception_code ssmp_ss_idempotent_memory satp_mode_bare

[norm:ssmp_ss_page_illegeal_access] [norm:ssmp_ss_read_only_page] [norm:ss_fault_exception_code] [norm:ssmp_ss_idempotent_memory] [norm:satp_mode_bare]

cp_ss_page_access_zicfiss

Verify which accessor types may touch an SS page and which fault

With a page mapped as an SS page (xwr=010), attempt access from every accessor class:
(a) SS store instructions: SSPUSH x1/x5, C.SSPUSH x1, SSAMOSWAP.W/.D
(b) ordinary stores: SB, SH, SW, SD
(c) ordinary AMOs: AMOSWAP, AMOADD, …​
(d) cache-block ops: CBO.ZERO, CBO.CLEAN, CBO.FLUSH, CBO.INVAL
(e) instruction fetch with PC in the SS page
(f) implicit access: place a page-table entry in the SS page and force a walk
(g) ordinary loads: LB, LH, LW, LD
Precondition for leg (d): menvcfg/senvcfg CBIE, CBCFE and CBZE must be enabled, otherwise the cache-block op traps on its own gating instead of on the SS page.
Leg (f) is best-effort: it is not established that a page-table walk through an SS page is reachable in this environment.
Additional accessor classes:
(h) LR/SC to the SS page (requires Zalrsc).
(i) AMOCAS to the SS page (requires Zacas).
(j) if V is implemented, vector loads and stores to the SS page, including strided and indexed accesses that BEGIN on a different page and run into the SS page.
Leg (g), the ordinary-load leg, is additionally crossed with mstatus.MXR = 0 and 1: the SS page is R=0, so MXR is what decides whether a plain load may read it.

(a) succeeds — these are the only instructions permitted to write an SS page.
(b),(c),(d) store/AMO access-fault (cause=7), NOT a page-fault.
(e),(f) access-fault appropriate to the access type (instruction access-fault for fetch).
(g) succeeds — the shadow stack is readable by any instruction that only loads.
(h),(i) store/AMO access-fault — LR/SC and AMOCAS are not in the set permitted to write an SS page.
(j) vector stores fault; vector loads follow the ordinary-load rule. An access that starts on an adjacent page must still fault on the element that lands in the SS page.
(g) the ordinary load succeeds for BOTH MXR values — the shadow stack is readable by any instruction that only loads, so this must not depend on MXR.

accessor {ss_store, ordinary_store, ordinary_amo, lr_sc, amocas, cbo, ifetch, implicit_walk, ordinary_load, vector_load, vector_store} x MXR {0,1} x result {ok, af}

ssmp_ss_page_access_fault ssmp_ss_cache_block_access_fault ssmp_ss_implicit_access_fault ssmp_ss_load

[norm:ssmp_ss_page_access_fault] [norm:ssmp_ss_cache_block_access_fault] [norm:ssmp_ss_implicit_access_fault] [norm:ssmp_ss_load]

cp_ssp_csr_gating_u_zicfiss

Verify ssp CSR accessibility from U-mode across the menvcfg.SSE / senvcfg.SSE enable chain

From U-mode, attempt both a read and a write of ssp for each reachable (menvcfg.SSE, senvcfg.SSE) combination: (1,1), (1,0) and (0,0). (0,1) is the same state as (0,0), because menvcfg.SSE=0 makes senvcfg.SSE read-only zero.
Also exercise the toggle direction: enable, use the shadow stack, then clear senvcfg.SSE and re-attempt the ssp access.

(menvcfg.SSE=1, senvcfg.SSE=1): access allowed, correct value read/written.
(menvcfg.SSE=0, *): illegal-instruction exception — menvcfg gating wins regardless of senvcfg.
(menvcfg.SSE=1, senvcfg.SSE=0): illegal-instruction exception.
Toggling SSE off does not corrupt shadow stack memory or the retained ssp value.
(menvcfg.SSE=0, senvcfg.SSE=1) is architecturally UNREACHABLE: menvcfg.SSE=0 forces senvcfg.SSE read-only zero. The test still attempts it and the coverpoint marks it illegal_bins, so an implementation that allows the combination is flagged.

menvcfg.SSE {0,1} x senvcfg.SSE {0,1} (m0s1 illegal/unreachable) x csr_op {read, write} x result {ok, illegal_instruction}

zicfiss_ssp_csr zicfiss_m_menvcfg_sse zicfiss_u_senvcfg_sse zicfiss_sse_access

[norm:zicfiss_ssp_csr] [norm:zicfiss_m_menvcfg_sse] [norm:zicfiss_u_senvcfg_sse] [norm:zicfiss_sse_access]

cp_ss_instr_inactive_zicfiss

Verify MOP-encoded SS instructions revert to Zimop/Zcmop no-op behaviour when Zicfiss is not active

SCOPE: the MOP-encoded instructions only — SSPUSH x1, SSPUSH x5, C.SSPUSH x1, SSPOPCHK x1, SSPOPCHK x5, C.SSPOPCHK x5, SSRDP. SSAMOSWAP is NOT in this set: it is AMO-encoded and traps instead (see cp_ssamoswap_sse_gating_zicfiss).
Deactivate from both directions: menvcfg.SSE=0 (32-bit revert to Zimop, 16-bit to Zcmop), and menvcfg.SSE=1 with senvcfg.SSE=0. Preload ssp and the shadow stack memory and check both after.
STRONG FORM: repeat every instruction with a HOSTILE ssp — misaligned, pointing at an unmapped page, and pointing at memory whose value would mismatch the link register. A no-op must remain a no-op in all three cases.
Sweep all four {menvcfg.SSE, senvcfg.SSE} combinations. Note (menvcfg=0, senvcfg=1) is unreachable because menvcfg.SSE=0 forces senvcfg.SSE read-only zero; it is attempted anyway.

NO exception is raised — these revert to their Zimop/Zcmop-defined behaviour, which writes 0 to rd and has no other architectural effect.
ssp unchanged. Shadow stack memory unchanged. SSRDP rd = 0.
This is the compatibility guarantee: a Zicfiss-built program still runs, just without backward-edge CFI.
The hostile-ssp variants are the real proof of the guarantee: an implementation that still performs the access and discards the result passes the benign case but fails these. No exception of any kind, no memory access, ssp unchanged, rd unchanged except SSRDP writing 0.

instr {SSPUSH x1, SSPUSH x5, C.SSPUSH x1, SSPOPCHK x1, SSPOPCHK x5, C.SSPOPCHK x5, SSRDP} x gate {menvcfg.SSE, senvcfg.SSE} = {00, 10, 11} x ssp_state {valid, misaligned, unmapped, value_mismatch} x {no trap, no memory access, ssp unchanged, rd==0 for SSRDP}

zicfiss_enc menvcfg_sse_op_lead-in menvcfg_sse_op_list senvcfg_sse_Zicfilp

[norm:zicfiss_enc] [norm:menvcfg_sse_op_lead-in] [norm:menvcfg_sse_op_list] [norm:senvcfg_sse_Zicfilp]

cp_ssamoswap_sse_gating_zicfiss

Verify SSAMOSWAP.W/D raises an illegal-instruction exception when the SSE enable chain is off (V=0)

SSAMOSWAP is encoded in the AMO major opcode, NOT in the Zimop/Zcmop MOP space, so it does not silently no-op when Zicfiss is deactivated — it traps. Execute SSAMOSWAP.W and SSAMOSWAP.D against a valid aligned SS address for:
(a) menvcfg.SSE=0, from S-mode and U-mode (any privilege mode less than M);
(b) menvcfg.SSE=1, senvcfg.SSE=0, from U-mode.
Positive control: both set — the instruction completes (see cp_ssamoswap_zicfiss).

(a) illegal-instruction exception in every privilege mode less than M.
(b) illegal-instruction exception in U-mode.
Memory, rd and ssp unchanged.
Contrast with cp_ss_instr_inactive_zicfiss: the MOP-encoded SS instructions no-op under exactly these conditions, while SSAMOSWAP traps.

instr {SSAMOSWAP.W, SSAMOSWAP.D} x gate {menvcfg.SSE=0, (menvcfg.SSE=1 & senvcfg.SSE=0)} x mode {S, U} x result {illegal_instruction}

menvcfg_sse_op_lead-in menvcfg_sse_op_list senvcfg_sse_Zicfilp

[norm:menvcfg_sse_op_lead-in] [norm:menvcfg_sse_op_list] [norm:senvcfg_sse_Zicfilp]

cp_ss_page_crossing_zicfiss

Verify shadow stack accesses that straddle a page boundary fault on the invalid side

SSPUSH decrements ssp BEFORE storing, so a push with ssp at the very bottom of a page writes into the PRECEDING page. SSPOPCHK reads at ssp and then increments, so it reads from the page ssp is already on.
Case A: ssp = base of a valid SS page, so ssp-XLEN/8 lies on a page that is NOT a valid shadow stack page (unmapped, or mapped with a non-SS encoding). Execute SSPUSH x1 / C.SSPUSH x1.
Case B: ssp points at a page that is NOT a valid shadow stack page while ssp-XLEN/8 IS on a valid SS page. Execute SSPUSH (should succeed, it writes to the valid side) and SSPOPCHK (should fault, it reads the invalid side).
Repeat both cases with the adjacent page unmapped, mapped read-only, and mapped read/write.

The fault is determined by the page actually accessed, not by the page ssp names.
Case A: SSPUSH faults on the preceding page — store/AMO access-fault (cause=7) for a non-SS valid encoding, store/AMO page-fault (cause=15) if unmapped or read-only. ssp is NOT decremented, since the decrement is conditional on the store completing.
Case B: SSPUSH succeeds and ssp is decremented onto the valid page; the subsequent SSPOPCHK reads the invalid side and faults, leaving ssp unchanged.
In every faulting case the cause carries the store/AMO flavour.

case {A: ssp at page base, B: ssp on invalid page} x instr {SSPUSH x1, C.SSPUSH x1, SSPOPCHK x1, C.SSPOPCHK x5} x adjacent_page {unmapped, read_only, read_write} x cause {none, 7, 15} x ssp {unchanged, decremented}

ss_push sspush_c-sspush_decrement sspop_increment ssmp_ss_page_illegeal_access ssmp_ss_read_only_page ss_fault_exception_code

[norm:ss_push] [norm:sspush_c-sspush_decrement] [norm:sspop_increment] [norm:ssmp_ss_page_illegeal_access] [norm:ssmp_ss_read_only_page] [norm:ss_fault_exception_code]

cp_ss_page_ad_bits_zicfiss

Verify PTE Accessed/Dirty bit handling on a shadow stack page, including the write/read asymmetry

Sweep all four {A, D} combinations on the shadow stack page’s leaf PTE and execute each SS instruction against it.
The write-vs-read asymmetry is the point: SSPUSH, C.SSPUSH and SSAMOSWAP write the page and so require D=1, while SSPOPCHK and C.SSPOPCHK only read and so do not.
If Svadu is implemented, repeat with hardware A/D updating enabled (menvcfg.ADUE=1).

A=0: every SS access faults, read or write, because the page has not been marked accessed.
D=0: SSPUSH / C.SSPUSH / SSAMOSWAP fault (they write); SSPOPCHK / C.SSPOPCHK succeed (they only read).
A=1, D=1: all SS instructions succeed.
Faults carry the store/AMO flavour per the SS fault-code remapping.
With Svadu implemented and ADUE=1 the hardware sets A and D itself, so NO fault occurs in any of the above combinations and the PTE is observed updated afterwards.

instr {SSPUSH x1, C.SSPUSH x1, SSAMOSWAP.W, SSAMOSWAP.D, SSPOPCHK x1, C.SSPOPCHK x5} x {A,D} {00, 01, 10, 11} x svadu {absent, ADUE=0, ADUE=1} x cause {none, 7, 15}

ss_fault_exception_code ssmp_ss_page_access_fault ssmp_ss_load

[norm:ss_fault_exception_code] [norm:ssmp_ss_page_access_fault] [norm:ssmp_ss_load]

cp_ss_non_idempotent_zicfiss

Verify SS instructions fault when the shadow stack page is non-idempotent (Svpbmt)

Requires Svpbmt. Map the shadow stack page with pte.PBMT = IO, which makes the memory non-idempotent, and execute each SS instruction that accesses memory against it.
Positive control: the same page mapped with PBMT = PMA (or NC) behaves normally.
Guard the whole coverpoint with #ifdef SVPBMT_SUPPORTED — without Svpbmt there is no portable way to identify a non-idempotent location, and the rule is then untestable rather than failing.

Every SS instruction that accesses non-idempotent memory raises a store/AMO access-fault (cause=7).
The reason is restartability: SSPOPCHK performs a load and then a comparison, and if the comparison faults and the handler restarts the instruction the load runs twice — which is unsafe on non-idempotent memory.
Positive control with PBMT=PMA: no fault.

instr {SSPUSH x1, C.SSPUSH x1, SSPOPCHK x1, C.SSPOPCHK x5, SSAMOSWAP.W, SSAMOSWAP.D} x pte.PBMT {PMA, NC, IO} x cause {none, 7}

ssmp_ss_idempotent_memory

[norm:ssmp_ss_idempotent_memory]

Folded into cp_ss_instr_inactive_zicfiss (gate sweep) and cp_ssamoswap_sse_gating_zicfiss (the trapping half). Other privilege modes are the corresponding rows on the ZicfissS / ZicfissSm / ZicfissH sheets.

Test all Zifiss instructions with each combination of {menvcfg.SSE/senvcfg.SSE} = 0, 1 in every priv mode. Check all state is unaffected if xSSE=0. Some throw illegal or virtual instructions

PROMOTED to its own coverpoint: cp_ss_page_crossing_zicfiss.

Test ssp pointing to the bottom of a page such that ssp-XLEN/8 is not on a valid shadow stack page, and also such that ssp is not on a valid shadow stack pages but ssp-XLEN/8 is valid.

Folded into cp_ss_instr_target_page_zicfiss: pte.xwr now sweeps all 8 encodings and is crossed with MXR = 0/1.

For cp_ss_instr_target_page_zicfiss, test all 8 XWR with MXR=0/1.

Folded into cp_ssamoswap_zicfiss: {aq,rl} = 00/01/10/11 added as a bin axis.

Exercise all 4 values of aq and rl in SSAMOSWP.

Folded into cp_ss_page_access_zicfiss as accessor leg (j), including strided/indexed accesses beginning on an adjacent page.

If V supported, try V accesses to SS page, including scattered loads and stores starting on a different page.

Folded into cp_ss_page_access_zicfiss as accessor legs (h) and (i). Needs Zalrsc and Zacas in the suite’s required_extensions.

LRSC and AMOCAS to SS page.

Folded into cp_ss_instr_target_page_zicfiss as a pte.U = 0/1 axis.

Test U bit of shadow stack page = 0/1

Folded into cp_ss_instr_inactive_zicfiss as the STRONG FORM: the same instructions repeated with a misaligned, unmapped, or mismatching ssp.

When xSSE, SSPUSH/SSPOPCHK must do no memory access and raise nothing even if ssp is misaligned, unmapped, or values mismatch.

PROMOTED to its own coverpoint: cp_ss_page_ad_bits_zicfiss, including the Svadu/ADUE variant.

Test all combinations of A and D bits on the SS page, that fault occurs if D=0 for SSPUSH/SSAMOSWAP but not SSPOPCHK, if A=0 for all accesses. If Svadu supported, check no faults.

PROMOTED to its own coverpoint: cp_ss_non_idempotent_zicfiss. This also restores [norm:ssmp_ss_idempotent_memory], which had been written off as untestable.

If Svpbmt is supported, test a page mapped to I/O that makes it non-idempotent and thus fault on SS instructions.

Folded into cp_ss_page_access_zicfiss: the ordinary-load leg (g) is now crossed with MXR = 0/1 and must succeed for both.

Test ordinary load from SS page succeeds even though R=0, for both MXR=0/1.

Folded into cp_ssamoswap_zicfiss as a register-edge axis: rd=x0, rs2=x0, rd==rs1, and all-distinct.

Consider testing SSAMOSWAP with rd, rs2 = x0/non x0 and rd==rs1 edges.

ZicfissS Supervisor-Mode Shadow Stack

General Test Environment (S/HS-mode execution): - Same base environment as ZicfissU, but tests execute in S/HS-mode. menvcfg.SSE alone gates S/HS; senvcfg.SSE does NOT gate S/HS. - The instruction-behaviour coverpoints (cp_sspush / cp_sspopchk_* / cp_ssamoswap / cp_ss_address_alignment / cp_ss_instr_target_page / cp_ss_page_access) are re-run unchanged from S-mode by reusing the ZicfissU generators with an S-mode boot; they are not duplicated as rows here. Only S-specific control behaviour is listed below.

Table 339. ZicfissS Coverpoints
Coverpoint Goal Feature Description Expectation Bins ID Normative Rule

cp_ssp_csr_gating_s_zicfiss

Verify ssp CSR accessibility from S/HS-mode depends only on menvcfg.SSE, not senvcfg.SSE

From S/HS-mode attempt ssp read and write for each combination of (menvcfg.SSE, senvcfg.SSE).
senvcfg.SSE is deliberately swept to prove it has no effect at S/HS level.

menvcfg.SSE=1: access allowed from S/HS for BOTH values of senvcfg.SSE — senvcfg.SSE gates U-mode only.
menvcfg.SSE=0: illegal-instruction exception.

menvcfg.SSE {0,1} x senvcfg.SSE {0,1} x csr_op {read, write} x result {ok, illegal_instruction}

zicfiss_sse_access zicfiss_ssp_csr zicfiss_m_menvcfg_sse

[norm:zicfiss_sse_access] [norm:zicfiss_ssp_csr] [norm:zicfiss_m_menvcfg_sse]

cp_ss_page_enc_zicfiss

Verify the pte.xwr=010 encoding is recognised as an SS page, and is reserved when SSE is off

With menvcfg.SSE=1 build a PTE with R=0, W=1, X=0 and use it as a shadow stack from S-mode and U-mode (SSPUSH then SSPOPCHK round trip, plus an ordinary load).
Repeat with menvcfg.SSE=0.

menvcfg.SSE=1: the page is a valid SS page. SS stores succeed, ordinary loads succeed, no exception.
menvcfg.SSE=0: the encoding is reserved, so the PTE is invalid and access raises a page-fault.

menvcfg.SSE {0,1} x mode {S, U} x access {ss_store, ordinary_load} x result {ok, page_fault}

ss_page_enc ssmp_menvcfg_sse

[norm:ss_page_enc] [norm:ssmp_menvcfg_sse]

cp_ss_page_perm_priority_zicfiss

Verify U, SUM and MXR permission checks on a shadow stack page, and that they outrank the SS access-fault rule

The shadow stack page is R=0 and may be U=0 or U=1, so the ordinary permission machinery and the Zicfiss-specific rules can both apply to the same access. This coverpoint establishes which wins.
Sweep, from S/HS-mode, the shadow stack page’s U bit = 0/1 against sstatus.SUM = 0/1 and sstatus.MXR = 0/1, for:
(a) every SS instruction that accesses memory (SSPUSH, C.SSPUSH, SSPOPCHK, C.SSPOPCHK, SSAMOSWAP.W/D);
(b) an ordinary load from the same page, which is permitted by the shadow stack rules but still subject to U/SUM/MXR;
(c) an ordinary store, which the shadow stack rules forbid regardless.
Include the case where the permission check and the SS rule would produce DIFFERENT causes, so the priority is observable rather than coincidental.

The U/SUM/MXR permission check is part of address translation and therefore resolves BEFORE any Zicfiss-specific rule. Where the two disagree, the translation fault is reported:
U=1, SUM=0, access from S-mode → page-fault from the U/SUM check, NOT the SS store/AMO access-fault, even for an instruction the SS rules would also have rejected.
U=0, access from S-mode → permitted by U/SUM; the SS rules then apply normally.
MXR governs whether the R=0 shadow stack page is readable by an ordinary load. Per [norm:ssmp_ss_load] the shadow stack is readable by any load-only instruction, so this must hold for BOTH MXR values — an implementation that requires MXR=1 to read an SS page is wrong.
SS instructions themselves are unaffected by MXR: their access is a store/AMO-flavoured access, not a load.

pte.U {0,1} x sstatus.SUM {0,1} x sstatus.MXR {0,1} x accessor {SS instr, ordinary load, ordinary store} x cause {none, page-fault from U/SUM, 7, 15} x priority {translation check wins}

ssmp_ss_load ssmp_ss_page_access_fault ssmp_ss_page_illegeal_access ss_fault_exception_code

[norm:ssmp_ss_load] [norm:ssmp_ss_page_access_fault] [norm:ssmp_ss_page_illegeal_access] [norm:ss_fault_exception_code]

cp_senvcfg_sse_rdonly0_s_zicfiss

Verify senvcfg.SSE reads back 0 from S-mode whenever menvcfg.SSE is 0

Direct observation of the read-only-zero rule from the mode that owns senvcfg, rather than inferring it from an ssp access.
From M-mode set menvcfg.SSE=0. Drop to S-mode and attempt to write senvcfg.SSE=1 using csrw, csrs and csrrw, reading the CSR back after each write.
Repeat the same sequence with menvcfg.SSE=1 as the positive control.
This is the S-mode counterpart of cp_envcfg_sse_rdonly0_zicfiss on the ZicfissSm sheet, which drives the same field from M-mode.

menvcfg.SSE=0: senvcfg.SSE reads back 0 after every write attempt. No exception is raised — SSE is a WARL field, so the write is discarded rather than rejected.
menvcfg.SSE=1: senvcfg.SSE is writable and reads back what was written.
This is what makes the (menvcfg.SSE=0, senvcfg.SSE=1) combination architecturally unreachable wherever it appears as a bin on this sheet or on ZicfissU.

menvcfg.SSE {0,1} x csr_op {csrw, csrs, csrrw} x written {0,1} x senvcfg.SSE readback {0 when menvcfg.SSE=0, written when menvcfg.SSE=1}

menvcfg_sse_rdonly0

[norm:menvcfg_sse_rdonly0]

(reused) ZicfissU instruction coverpoints, re-run from S-mode

Re-run the ZicfissU coverpoints with the hart booted in S-mode instead of U-mode

BOOKKEEPING ROW, not a new coverpoint. These 16 ZicfissU coverpoints are re-run unchanged with an S-mode boot; coverage is sampled into the S-mode covergroup via the priv_mode_s coverpoint:
cp_ssp_access_zicfiss
cp_sspush_zicfiss
cp_sspopchk_match_zicfiss
cp_sspopchk_mismatch_zicfiss
cp_sspopchk_fault_priority_zicfiss
cp_ss_call_return_zicfiss
cp_ssrdp_zicfiss
cp_ssamoswap_zicfiss
cp_ss_address_alignment_zicfiss
cp_ss_instr_target_page_zicfiss
cp_ss_page_access_zicfiss
cp_ss_instr_inactive_zicfiss
cp_ssamoswap_sse_gating_zicfiss
cp_ss_page_crossing_zicfiss
cp_ss_page_ad_bits_zicfiss
cp_ss_non_idempotent_zicfiss
Only cp_ssp_csr_gating_u_zicfiss is NOT re-run: senvcfg.SSE gates U-mode only, so S/HS has its own cp_ssp_csr_gating_s_zicfiss on this sheet.
Two S-mode differences apply to every re-run: the enable chain is menvcfg.SSE alone (senvcfg.SSE does not gate S/HS), and the identity map carries no PTE_U, so the S-mode trap handler can fetch and traps may be delegated normally.

Identical architectural results to the U-mode runs — SS instruction behaviour does not depend on S vs U, only the enable chain does.
The exceptions are the coverpoints whose expectation is itself mode-dependent: the gating rows, and cp_ss_page_perm_priority_zicfiss on this sheet, where SUM only exists at S-mode.

priv_mode {s} x (all bins of each reused coverpoint)

(inherits the ID list of each reused coverpoint)

(inherits the normative rules of each reused coverpoint)

PROMOTED to its own coverpoint: cp_ss_page_perm_priority_zicfiss, including the explicit priority claim that the translation-level U/SUM/MXR check resolves before any Zicfiss-specific rule.

Test U, SUM, MXR bits of shadow stack page, including that these have priority over the SS access fault rule.

PROMOTED to its own coverpoint: cp_senvcfg_sse_rdonly0_s_zicfiss — writes senvcfg.SSE from S-mode and reads back 0 while menvcfg.SSE=0. The M-mode counterpart is cp_envcfg_sse_rdonly0_zicfiss on ZicfissSm.

Write m0s1 to xenvcfg.SSE and read back and make sure s shows up 0.

ZicfissSm Machine-Mode Shadow Stack
Table 340. ZicfissSm Coverpoints
Coverpoint Goal Feature Description Expectation Bins ID Normative Rule

General Test Environment (M-mode control plane):
- Same base environment as ZicfissU. These coverpoints execute in M-mode or manipulate M-mode state (menvcfg) before dropping to a lower mode.
- Use of Zicfiss in M-mode is not supported; M-mode coverpoints here test the gating and the M-mode SSAMOSWAP fault.

cp_ssamoswap_mmode_fault_zicfiss

Verify SSAMOSWAP.W/.D always raises a store/AMO access-fault when the effective privilege mode is M

Execute SSAMOSWAP.W and SSAMOSWAP.D from M-mode against a valid, aligned, writable SS page. Repeat with menvcfg.SSE=1 and menvcfg.SSE=0, and with satp.MODE both Bare and non-Bare, to confirm the fault is unconditional.
Also exercise the effective-privilege path: M-mode with mstatus.MPRV=1 and MPP=U.

Store/AMO access-fault raised whenever the EFFECTIVE privilege mode is M, independent of menvcfg.SSE and satp.MODE.
Note MPRV: with mstatus.MPRV=1 and MPP < M the effective privilege mode is no longer M, so this rule does not apply and the access may succeed. MPRV is therefore left 0 here and is not a coverage axis.
Memory and rd are unchanged.

instr {SSAMOSWAP.W, SSAMOSWAP.D} x menvcfg.SSE {0,1} x satp.MODE {Bare, Sv}

ssmp_ssamoswap

[norm:ssmp_ssamoswap]

cp_menvcfg_sse_gating_zicfiss

Verify menvcfg.SSE is the top of the enable chain for both ssp CSR access and the SS page encoding

From M-mode set menvcfg.SSE=0, then:
(a) drop to S/HS-mode and attempt ssp CSR read and write;
(b) with a PTE encoded xwr=010, attempt access from S-mode and U-mode.
Repeat both with menvcfg.SSE=1 as the positive control.
Also confirm menvcfg.SSE is writable and reads back as written.
M-mode leg (explicit): read and write ssp from M-mode with menvcfg.SSE=0 and with menvcfg.SSE=1, using csrrw/csrrs/csrrc and the immediate forms.

menvcfg.SSE=0: ssp CSR access from any mode < M raises an illegal-instruction exception, regardless of senvcfg/henvcfg.
menvcfg.SSE=0: the xwr=010 PTE encoding remains RESERVED, so access raises a page-fault rather than being treated as an SS page.
menvcfg.SSE=1: ssp accessible from S/HS, and xwr=010 is recognised as an SS page.
From M-mode the ssp CSR is accessible for BOTH values of menvcfg.SSE. [norm:zicfiss_m_menvcfg_sse] is scoped to 'privilege mode less than M', so menvcfg.SSE does not gate M-mode itself. An implementation that raises illegal-instruction on ssp access from M when menvcfg.SSE=0 is wrong.
Note this is CSR accessibility only — use of the Zicfiss shadow stack in M-mode is not supported, and the SS instructions behave as MOPs there (cp_ss_instr_inactive_zicfiss).

mode {M, S/HS} x menvcfg.SSE {0,1} x csr_op {csrrw, csrrs, csrrc, csrrwi, csrrsi, csrrci} x target {ssp read, ssp write, pte_xwr_010_access} x result {ok at M always, ok at S iff menvcfg.SSE=1, illegal_instruction, page_fault}

zicfiss_m_menvcfg_sse zicfiss_ssp_csr ssmp_menvcfg_sse

[norm:zicfiss_m_menvcfg_sse] [norm:zicfiss_ssp_csr] [norm:ssmp_menvcfg_sse]

cp_envcfg_sse_rdonly0_zicfiss

Verify the SSE enable chain forces the lower-level SSE fields to read-only zero

Leg A: from M-mode set menvcfg.SSE=0, then attempt to write 1 to senvcfg.SSE (from S-mode) and to henvcfg.SSE (from HS-mode). Read both back.
Leg B: menvcfg.SSE=1, henvcfg.SSE=0, V=1. Attempt to write 1 to senvcfg.SSE and read back.
Positive control per leg: with the parent field set to 1 the child is writable and reads back 1.
The henvcfg leg (cp_envcfg_sse_rdonly0_henvcfg) is generated and compiled only with H_SUPPORTED, which ACT4 leaves undefined until Sail supports the hypervisor extension.

Leg A: with menvcfg.SSE=0, both henvcfg.SSE and senvcfg.SSE are read-only zero — the write is discarded and the field reads 0. No exception: these are WARL fields, not an illegal access.
Leg B: with henvcfg.SSE=0 and V=1, senvcfg.SSE is read-only zero.
This is what makes the (menvcfg.SSE=0, senvcfg.SSE=1) combination unreachable elsewhere.

parent {menvcfg.SSE, henvcfg.SSE} x child {senvcfg.SSE, henvcfg.SSE} x parent_val {0,1} x written {0,1} x readback {0, written}

menvcfg_sse_rdonly0 henvcfg_sse_op

[norm:menvcfg_sse_rdonly0] [norm:henvcfg_sse_op]

cp_ss_pmp_permissions_zicfiss

Verify PMP permission requirements for shadow stack instructions, and that a PMP fault outranks the software-check exception

Reprogram PMP entry 0 to cover the shadow stack page and entry 1 to grant RWX over all memory (the lowest matching entry wins), then drop to S-mode and execute each SS instruction against the page.
Leg A — permission matrix: sweep pmp0cfg R/W over {--, R-, -W, RW} and run SSPUSH, C.SSPUSH, SSPOPCHK, C.SSPOPCHK, SSAMOSWAP.W/D against each.
Leg B — priority: with PMP denying the page, set the link register so the value would ALSO mismatch, then execute SSPOPCHK. Both faults are live and only one may be reported.
Restore the boot-time allow-all PMP configuration afterwards.

Leg A: shadow stack instructions require PMP READ-WRITE permission on the accessed memory. Anything less raises a store/AMO access-fault (cause=7).
The asymmetry worth testing: SSPOPCHK and C.SSPOPCHK only READ, yet they still require PMP W. This is the opposite of the PTE dirty-bit behaviour, where SSPOPCHK does NOT require D (cp_ss_page_ad_bits_zicfiss on ZicfissU). An implementation that reuses its PTE logic for the PMP check will get exactly one of these two wrong.
Leg B: the PMP access-fault (cause=7) is reported, NOT the software-check exception (cause=18). ssp is unchanged.
SPEC NOTE: the PMP read-write requirement is stated in priv/cfi.adoc ("The PMP checks are extended to require read-write permission for memory accessed by shadow stack instructions") but carries NO norm: tag, so it cannot be referenced by ID. Raised as an upstream tagging gap.

instr {SSPUSH x1, C.SSPUSH x1, SSPOPCHK x1, C.SSPOPCHK x5, SSAMOSWAP.W, SSAMOSWAP.D} x pmp0cfg {--, R-, -W, RW} x mismatch_also_present {no, yes} x reported_cause {none, 7, not 18}

sspop_exception (PMP read-write requirement: priv/cfi.adoc, untagged)

[norm:sspop_exception]

cp_ss_satp_bare_zicfiss

Verify that SS instructions below M-mode raise a store/AMO access fault when satp.MODE=Bare

From M-mode set satp=0 (Bare), menvcfg.SSE=1 and senvcfg.SSE=1, and point ssp at the SS page. Drop to S-mode, then to U-mode, and in each execute every SS memory instruction: SSPUSH x1, SSPUSH x5, C.SSPUSH x1, SSPOPCHK x1, SSPOPCHK x5, C.SSPOPCHK x5, SSAMOSWAP.W, SSAMOSWAP.D.

Store/AMO access fault (cause=7) for every instruction, including SSPOPCHK, which only reads. ssp unchanged.

2 modes (S, U) x 8 instructions (SSAMOSWAP.D only on RV64) = 16 (14 on RV32)

satp_mode_bare

[norm:satp_mode_bare]

cp_ss_instr_inactive_zicfiss

Verify SS instructions act as MOPs, touching no memory and raising nothing, whenever Zicfiss is inactive

MOVED here from ZicfissU: setting up every inactive state requires M-mode writes to menvcfg/senvcfg, and at M-mode the behaviour is unconditional.
SCOPE: the MOP-encoded instructions — SSPUSH x1/x5, C.SSPUSH x1, SSPOPCHK x1/x5, C.SSPOPCHK x5, SSRDP. SSAMOSWAP is NOT in this set: it is AMO-encoded and traps instead (cp_ssamoswap_sse_gating_zicfiss on ZicfissU, and the M-mode case in cp_ssamoswap_mmode_fault_zicfiss on this sheet).
Leg A — M-mode, unconditional: use of Zicfiss in M-mode is not supported, so these instructions act as MOPs at M for BOTH values of menvcfg.SSE.
Leg B — lower modes, gated: drive the inactive states from M and execute in S/U — menvcfg.SSE=0, and menvcfg.SSE=1 with senvcfg.SSE=0.
STRONG FORM, applied to both legs: repeat every instruction with a HOSTILE ssp — misaligned, pointing at an unmapped page, and pointing at memory whose value would mismatch the link register.

No exception of ANY kind, and no memory access at all. ssp unchanged, shadow stack memory unchanged, rd unchanged except SSRDP which writes 0.
The hostile-ssp variants are what actually prove it: an implementation that still performs the access and discards the result passes the benign case and fails these. A misaligned or unmapped ssp must NOT fault, and a mismatching value must NOT raise a software check, because no access and no comparison should happen.
SSRDP reading 0 is the documented way software detects whether Zicfiss is active.

leg {M-mode unconditional, lower-mode gated} x instr {SSPUSH x1, SSPUSH x5, C.SSPUSH x1, SSPOPCHK x1, SSPOPCHK x5, C.SSPOPCHK x5, SSRDP} x gate {menvcfg.SSE, senvcfg.SSE} = {00, 10, 11} x ssp_state {valid, misaligned, unmapped, value_mismatch} x {no trap, no memory access, ssp unchanged, rd==0 for SSRDP}

zicfiss_enc menvcfg_sse_op_lead-in menvcfg_sse_op_list senvcfg_sse_Zicfilp

[norm:zicfiss_enc] [norm:menvcfg_sse_op_lead-in] [norm:menvcfg_sse_op_list] [norm:senvcfg_sse_Zicfilp]

Folded into cp_menvcfg_sse_gating_zicfiss: the M-mode leg is now explicit — ssp is accessible from M for BOTH menvcfg.SSE values, since [norm:zicfiss_m_menvcfg_sse] is scoped to privilege < M.

Verify access to ssp from M-mode with menvcfg.SSE=0/1

MOVED here from ZicfissU as cp_ss_instr_inactive_zicfiss, with an M-mode unconditional leg added and the hostile-ssp strong form applied to both legs.

SSPUSH/SSPOPCHK/SSRDP act as MOP (SSRDP → 0) and do not touch memory or raise exceptions even if ssp is misaligned or unmapped or the values mismatch

No separate suite needed — PMP can only be programmed from M-mode, so this sheet is already the right home. The existing PMP row is widened into cp_ss_pmp_permissions_zicfiss, sweeping pmp0cfg R/W and covering the SSPOPCHK-needs-W asymmetry as well as the fault-priority case.

Should we add a PMPZicfiss suite exercising PMP access to a shadow stack page, including that RW permission is needed for shadow stack instructions SSPOPCHK and SSPUSH.

Table 341. Zicfiss Normative Rules
Normative Rule Rule Text Coverpoints

senvcfg_sse_Zicfiss

The Zicfiss extension adds the SSE field in senvcfg. When the SSE field is set to 1, the Zicfiss extension is activated in VU/U-mode. When the SSE field is 0, the Zicfiss extension remains inactive in VU/U-mode, and the following rules apply:

Zicfiss_m_menvcfg_sse

If the privilege mode is less than M and menvcfg.⁠SSE is 0, an illegal-instruction exception is raised.

Zicfiss_ssp_csr

Attempts to access the ssp CSR may result in either an illegal-instruction exception or a virtual-instruction exception, contingent upon the state of the envcfg.⁠SSE fields. The conditions are specified as follows:

Zicfiss_u_senvcfg_sse

Otherwise, if in U-mode and senvcfg.⁠SSE is 0, an illegal-instruction exception is raised.

Zicfiss_vs_henvcfg_sse

Otherwise, if in VS-mode and henvcfg.⁠SSE is 0, a virtual-instruction exception is raised.

Zicfiss_vu_senvcfg_sse

Otherwise, if in VU-mode and senvcfg.⁠SSE is 0, a virtual-instruction exception is raised.

Zicfiss_sse_access

Otherwise, the access is allowed.

Zicfiss_smode_xsse

When S-mode is not implemented, then xSSE is 0.

ss_page_enc

The encoding R=0, W=1, and X=0, is defined to represent an SS page.

ssmp_menvcfg_sse

When menvcfg.⁠SSE=0, this encoding remains reserved.

ssmp_henvcfg_sse

Similarly, when V=1 and henvcfg.⁠SSE=0, this encoding remains reserved at VS and VU levels.

satp_mode_bare

If satp.⁠MODE (or vsatp.⁠MODE when V=1) is set to Bare and the effective privilege mode is less than M, shadow stack instructions raise a store/AMO access-fault exception.

ssmp_ssamoswap

When the effective privilege mode is M, memory access by an SSAMOSWAP.W or SSAMOSWAP.D instruction results in a store/AMO access-fault exception.

ssmp_ss_page_access_fault

Memory mapped as an SS page cannot be written to by instructions other than SSAMOSWAP.W, SSAMOSWAP.D, SSPUSH, and C.SSPUSH. Attempts will raise a store/AMO access-fault exception.

ssmp_ss_cache_block_access_fault

Access to a SS page using cache-block operation (CBO.*) instructions is not permitted. Such accesses will raise a store/AMO access-fault exception.

ssmp_ss_implicit_access_fault

Implicit accesses, including instruction fetches to an SS page, are not permitted. Such accesses will raise an access-fault exception appropriate to the access type.

ssmp_ss_load

However, the shadow stack is readable by all instructions that only load from memory.

ss_fault_exception_code

If a shadow stack (SS) instruction raises an access-fault, page-fault, or guest-page-fault exception that is supposed to indicate the original instruction type (load or store/AMO), then the reported exception cause is respectively a store/AMO access fault (code 7), a store/AMO page fault (code 15), or a store/AMO guest-page fault (code 23).

ssmp_ss_page_illegal_access

Should a shadow stack instruction access a page that is not designated as a shadow stack page and is not marked as read-only (pte.xwr=0b001), a store/AMO access-fault exception will be invoked.

ssmp_ss_read_only_page

Conversely, if the page being accessed by a shadow stack instruction is a read-only page, a store/AMO page-fault exception will be triggered.

ssp_xlen_aligned

If the virtual address in ssp is not XLEN aligned, then the SSPUSH, C.SSPUSH, SSPOPCHK and C.SSPOPCHK instructions cause a store/AMO access-fault exception.

ssmp_ss_idempotent_memory

If the memory referenced by SSPUSH, C.SSPUSH, SSPOPCHK, C.SSPOPCHK, SSAMOSWAP.W and SSAMOSWAP.D instructions is not idempotent, then the instructions cause a store/AMO access-fault exception.

active_g_stage_pte

When G-stage page tables are active, the shadow stack instructions that access memory require the G-stage page table to have read-write permission for the accessed memory; else a store/AMO guest-page-fault exception is raised.

UDB Parameters: None.

B.11.14. Zawrs Wait on Reservation Set

Waits until timer interrupt or timeout on a single hart that cannot modify the reservation set. Tests behave differently in different privilege modes, so a suite is defined for each.

covergroup Zawrs

Table 342. ZawrsSm Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule Notes

tests for single core

cp_wrs_sto_timeout

WRS.STO waits till timeout

cross lr instruction to set up reservation.
mstatus.TW = {0/1}
mstatus.MIE = 0
mie=all 0s to disable interrupts
Execute WRS.STO in M mode

no exception, next instruction executes normally after WRS.STO finish execution

2 bins

Zawrs_wrs-sto_stall_duration

cp_wrs_no_res

WRS behaves as nop when no reservation is established

mstatus.TW ={0/1}
mstatus.MIE = 0
mie=all 0s to disable interrupts
Clear all reservation with sc.w, then execute {WRS.STO, WRS.NTO} with no reservation created in M mode

WRS behaves as nop

2 x 2 bins

Zawrs_all_priv_modes

cp_wrs_resume

WRS follows the rules of WFI for resuming on interrupts

cross lr instruction to set up reservation.
mstatus.TW = {0/1}
mstatus.MIE = {0/1}
cross with mie.MTIE=1
Set up timer to interrupt soon
execute {WRS.NTO/WRS.STO} in M mode

WRS resumes when interrupt is pending, MIE should not affect result

2 x 2 x 2 bins

mtime_mtimecmp_rv64_wr
Zawrs_wrs-nto_stall_exec
Zawrs_stall_terminate
Zawrs_exec_resume_rules

LA(t0, zawrs_resume_trap_handler)
csrrw t0, mtvec, t0 # save old trap vector
1: wrs.nto # keep doing nto until timeout
if MIE=0 and mip.MTIP, exit with success
j 1b
zawrs_resume_trap_handler:
csrr t1, mcause
SIGUPD t1
csrw stvec, t0 # restore trap handler
done:

cp_wrs_no_mie

WRS does not stop when mie = 0 for pending interrupt

cross lr instruction to set up reservation
mstatus.MIE = 1
mie = all 0s
mstatus.TW = 0
mip.mtip = {MSIP + MEIP + MTIP}
execute WRS.STO in M mode

WRS does not stop when interrupt pending

1 bin

Can not be tested with single core: Zawrs_wrs-nto_stall_exec

covergroup Zawrs

Table 343. ZawrsS Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule Status Notes

tests for single core

cp_wrs_sto_timeout

WRS.STO waits till timeout

cross lr instruction to set up reservation.
mstatus.TW = {0/1}
mstatus.MIE = 0
mstatus.SIE = 0
mie=all zeros 0 to disable interrupts
Execute WRS.STO in S mode

no exception, next instruction executes normally after WRS.STO finish execution

2 bins

Zawrs_wrs-sto_stall_duration

cp_wrs_no_res

WRS behaves as nop when no reservation is established

mstatus.TW =0
mstatus.MIE = 0
mstatus.SIE = 0
mie=all 0s to disable interrupts
Clear all reservation with sc.w, then execute {WRS.STO, WRS.NTO} with no reservation created in S mode

WRS behaves as nop

2 bins

Zawrs_all_priv_modes

TW = 1 can not be tested because the DUT may trigger illegal instruction immediately, where SAIL allows the instruction to retire successfully

cp_wrs_resume

WRS follows the rules of WFI for resuming on interrupts

cross lr instruction to set up reservation.
mstatus.TW = 0
cross with mie.MTIE=1
(if SSTC supporrted use STIP, cross menvcfg.STCE = 1)
mstatus.MIE = {0/1}
mstatus.SIE = {0/1}
Set up timer to interrupt soon
execute {WRS.NTO/WRS.STO} in S mode

WRS resumes when interrupt is pending, MIE should not affect result, trap in all cases other than in S mode with SIE = 0 (still resumes)

2 x 2 x 2 bins

Zawrs_wrs-nto_stall_exec
Zawrs_stall_terminate
Zawrs_exec_resume_rules
LA(t0, zawrs_resume_trap_handler)
csrrw t0, stvec, t0 # save old trap vector
1: wrs.nto # keep doing nto until timeout
if in S mode version of test with SIE=0 and sip.STIP, exit with success
j 1b
zawrs_resume_trap_handler:
csrr t1, scause
SIGUPD t1
csrw stvec, t0 # restore trap handler
done:
* need to use mtvec and mcause if S not supported

cp_wrs_nto_timeout

WRS.NTO timeout when TW = 1

cross lr instruction to set up reservation.
mstatus.TW = 1
mstatus.MIE = 0
mstatus.SIE = 0
mie=all 0s to disable interrupts
execute WRS.NTO in S mode

WRS causes illegal instruction exception when timed out if TW = 1

1

Zawrs_stall_terminate
Zawrs_priv_illegal_instr_excp
will retire or timeout with illegal instruction
* need to use mtvec and mcause if S not supported
* make sure of delegation if S is supported (part of boot code)
#ifdef UDB_ZAWRS_NTO_IS_NOP
wrs.nto
#else
LA(t0, zawrs_trap_handler)
csrrw t0, stvec, t0 # save old trap vector
1: wrs.nto # keep doing nto until timeout
j 1b
zawrs_trap_handler:
csrr t1, scause
SIGUPD t1
csrw stvec, t0 # restore trap handler
done:
#endif
Sail: Zawrs.nto.is_nop, Zawrs.sto.is_nop

cp_wrs_nto_timeout_h

WRS.NTO timeout causing virtual instruction exception in H mode

#ifdef H_SUPPORTED
cross lr instruction to set up reservation
mstatus.MIE = 0
mstatus.SIE = 0
mie=all 0s to disable interrupts
mstatus.TW = {0/1},
hstatus.VTW = 1
execute WRS.NTO in VS/VU mode
hedeleg = 0s - do not delegate exception to VS mode

WRS causes virtual instruction exception when timed out if mstatus.tw = 0

2 x 2 bins

Zawrs_virtual_instr_excp
same as above, expect illegal instruction if TW=1 and virtual instruction if TW=0 and not NOP.

cp_wrs_no_mie

cross lr instruction to set up reservation
mstatus.MIE = 1
mstatus.SIE = 1
mie = all 0s
mstatus.TW = 1
mip.mtip = {SSIP + SEIP + STIP + MSIP + MEIP + MTIP}
execute WRS.NTO and WRS.STO in S mode

WRS does not stop when interrupt pending, WRS.NTO causes illegal instruction

2 bins

same as above

Can not be tested with single core:

Untested things:

norm

Since the timeout limit can be different across platforms, cannot test WRS.STO with a timer interrupt soon

Zawrs_wrs-nto_stall_exec

spec:

As implementations are free to implement WFI as a NOP, software must explicitly check for

any relevant pending but disabled interrupts in the code following an WFI, and should loop

back to the WFI if no suitable interrupt was detected. The mip or sip registers can be

interrogated to determine the presence of any interrupt in machine or supervisor mode

respectively.

covergroup Zawrs

Table 344. ZawrsU Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule Notes

tests for single core

cp_wrs_sto_timeout

WRS.STO waits till timeout

cross lr instruction to set up reservation.
mstatus.TW = {0/1}
mstatus.MIE = 0
mstatus.SIE = 0
mie=all zeros 0 to disable interrupts
Execute WRS.STO in U mode

no exception, next instruction executes normally after WRS.STO finish execution

2 bins

Zawrs_wrs-sto_stall_duration

cp_wrs_no_res

WRS behaves as nop when no reservation is established

mstatus.TW =0
mstatus.MIE = 0
mstatus.SIE = 0
mie=all 0s to disable interrupts
Clear all reservation with sc.w, then execute {WRS.STO, WRS.NTO} with no reservation created in U mode

WRS behaves as nop

2 bins

Zawrs_all_priv_modes

TW = 1 can not be tested because the DUT may trigger illegal instruction immediately, where SAIL allows the instruction to retire successfully

cp_wrs_resume

WRS follows the rules of WFI for resuming on interrupts

cross lr instruction to set up reservation.
mstatus.TW = 0
cross with mie.MTIE=1
(if SSTC supporrted use STIP, cross menvcfg.STCE = 1)
mstatus.MIE = {0/1}
(if S supported:mstatus.SIE = {0/1})
Set up timer to interrupt soon
execute {WRS.NTO/WRS.STO} in U mode

WRS resumes when interrupt is pending, MIE should not affect result, trap in all cases other than in S mode with SIE = 0 (still resumes)

2 x 2 x 2 bins

Zawrs_wrs-nto_stall_exec
Zawrs_stall_terminate
Zawrs_exec_resume_rules

cp_wrs_nto_timeout

WRS.NTO timeout when TW = 1

cross lr instruction to set up reservation.
mstatus.TW = 1
mstatus.MIE = 0
mstatus.SIE = 0
mie=all 0s to disable interrupts
execute WRS.NTO in U mode

WRS causes illegal instruction exception when timed out if TW = 1

1

Zawrs_stall_terminate
Zawrs_priv_illegal_instr_excp

cp_wrs_no_mie

cross lr instruction to set up reservation
mstatus.MIE = 1
mstatus.SIE = 1
mie = all 0s
mstatus.TW = 1
mip.mtip = {SSIP + SEIP + STIP + MSIP + MEIP + MTIP}
execute WRS.NTO and WRS.STO in U mode

WRS does not stop when interrupt pending, WRS.NTO causes illegal instruction

2 bins

Table 345. ZawrsSm Normative Rules
Normative Rule Rule Text Coverpoints

Zawrs_wrs-nto_stall_exec

The WRS.NTO and WRS.STO instructions cause the hart to temporarily stall execution in a low-power state as long as the reservation set is valid and no locally enabled interrupts at any privilege level are pending, regardless of the global interrupt enable at each privilege level.

ZawrsSm_cg/cp_wrs_resume, Not tested: a store from another hart needs a multi-hart configuration

Zawrs_wrs-sto_stall_duration

For WRS.STO the stall duration is bounded by an implementation defined short timeout.

ZawrsSm_cg/cp_wrs_sto_timeout

Zawrs_all_priv_modes

These instructions are available in all privilege modes.

ZawrsSm_cg/cp_wrs_no_res

Zawrs_stall_terminate

While stalled, an implementation is permitted to occasionally terminate the stall and complete execution for any reason.

ZawrsSm_cg/cp_wrs_resume

Zawrs_exec_resume_rules

WRS.NTO and WRS.STO instructions follow the rules of the WFI instruction for resuming execution on a locally enabled pending interrupt.

ZawrsSm_cg/cp_wrs_resume

UDB Parameters: None.

Table 346. ZawrsS Normative Rules
Normative Rule Rule Text Coverpoints

Zawrs_wrs-nto_stall_exec

The WRS.NTO and WRS.STO instructions cause the hart to temporarily stall execution in a low-power state as long as the reservation set is valid and no locally enabled interrupts at any privilege level are pending, regardless of the global interrupt enable at each privilege level.

ZawrsS_cg/cp_wrs_resume, Not tested: a store from another hart needs a multi-hart configuration

Zawrs_wrs-sto_stall_duration

For WRS.STO the stall duration is bounded by an implementation defined short timeout.

ZawrsS_cg/cp_wrs_sto_timeout

Zawrs_all_priv_modes

These instructions are available in all privilege modes.

ZawrsS_cg/cp_wrs_no_res

Zawrs_stall_terminate

While stalled, an implementation is permitted to occasionally terminate the stall and complete execution for any reason.

ZawrsS_cg/cp_wrs_{resume, nto_timeout}

Zawrs_exec_resume_rules

WRS.NTO and WRS.STO instructions follow the rules of the WFI instruction for resuming execution on a locally enabled pending interrupt.

ZawrsS_cg/cp_wrs_resume

Zawrs_priv_illegal_instr_excp

When the TW (timeout wait) bit in mstatus is set and WRS.NTO is executed in any privilege mode other than M-mode, and it does not complete within an implementation-specific bounded time limit, the WRS.NTO instruction will cause an illegal-instruction exception.

ZawrsS_cg/cp_wrs_nto_timeout

Zawrs_virtual_instr_excp

When executing in VS- or VU-mode, if the VTW bit is set in hstatus, the TW bit in mstatus is clear, and the WRS.NTO does not complete within an implementation-specific bounded time limit, the WRS.NTO instruction will cause a virtual-instruction exception.

ZawrsS_cg/cp_wrs_nto_timeout_h

UDB Parameters: None.

Table 347. ZawrsU Normative Rules
Normative Rule Rule Text Coverpoints

Zawrs_wrs-nto_stall_exec

The WRS.NTO and WRS.STO instructions cause the hart to temporarily stall execution in a low-power state as long as the reservation set is valid and no locally enabled interrupts at any privilege level are pending, regardless of the global interrupt enable at each privilege level.

ZawrsU_cg/cp_wrs_resume, Not tested: a store from another hart needs a multi-hart configuration

Zawrs_wrs-sto_stall_duration

For WRS.STO the stall duration is bounded by an implementation defined short timeout.

ZawrsU_cg/cp_wrs_sto_timeout

Zawrs_all_priv_modes

These instructions are available in all privilege modes.

ZawrsU_cg/cp_wrs_no_res

Zawrs_stall_terminate

While stalled, an implementation is permitted to occasionally terminate the stall and complete execution for any reason.

ZawrsU_cg/cp_wrs_{resume, nto_timeout}

Zawrs_exec_resume_rules

WRS.NTO and WRS.STO instructions follow the rules of the WFI instruction for resuming execution on a locally enabled pending interrupt.

ZawrsU_cg/cp_wrs_resume

Zawrs_priv_illegal_instr_excp

When the TW (timeout wait) bit in mstatus is set and WRS.NTO is executed in any privilege mode other than M-mode, and it does not complete within an implementation-specific bounded time limit, the WRS.NTO instruction will cause an illegal-instruction exception.

ZawrsU_cg/cp_wrs_nto_timeout

UDB Parameters: None.

These tests require support for MTI and/or STI interrupts. Note that these tests can have race conditions of timeouts, timer interrupts, and spontaneous resumption, and thus may be fussy on different implementations.

B.11.15. Zama16b Misaligned Atomics

Misaligned atomics are supported by the Misaligned Atomicity Granularity. They are also exercised via ExceptionsZaamo.

Table 348. Zama16b Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule

cp_zama16b_load

Misaligned accesses are atomic

For each op in {lw, lh, lhu, lb, lbu} + {ld, lwu for RV64} + {flw for F, fld for D on RV64, flh for Zfh}:
Pick base address as multiple of 16
Issue instruction with offsets of [0, 16-size]

No misaligned load fault

Up to 11 ops * 16 offsets

Misaligned loads, stores, and AMOs to main memory regions that do not cross a naturally aligned 16-byte boundary are atomic.

cp_zama16b_store

Misaligned accesses are atomic

For each op in {sw, sh, sb} + {sd for RV64} + {fsw for F, fsd for D on RV64, fsh for Zfh}:
Pick base address as multiple of 16
Issue instruction with offsets of [0, 16-size]

No misaligned store fault

Up to 9 ops * 16 offsets

Misaligned loads, stores, and AMOs to main memory regions that do not cross a naturally aligned 16-byte boundary are atomic.

cp_zama16b_amo

Misaligned accesses are atomic

For each op in {amoswap.w, amoadd.w, amoand.w, amoor.w, amoxor.w, amomax.w, amomaxu.w, amomin.w amominu.w} + {.d flavors for RV64} + {b and h flavors for Zabha} + {amocas.w, d, q if supported}:
Pick address as multiple of 16 + offset of [0, 16-size]
Issue instruction

No misaligned store/AMO fault

Up to 39 ops * 12 offsets

Misaligned loads, stores, and AMOs to main memory regions that do not cross a naturally aligned 16-byte boundary are atomic.

Note:

This test only checks for no misaligned fault. Multimaster testing will be required to verify atomicity.

The misaligned atomicity granule applies only to F/D/Q loads and stores of at most XLEN bits, so flq/fsq (and fld/fsd on RV32) are not tested.

Table 349. Zama16b Normative Rules
Normative Rule Rule Text Coverpoints

misaligned_atomicity_granule_size

The misaligned atomicity granule PMA, defined in sec:misaligned-atomicity-granule, optionally relaxes this alignment requirement. If present, the misaligned atomicity granule PMA specifies the size of a misaligned atomicity granule, a power-of-two number of bytes. The misaligned atomicity granule PMA applies only to AMOs defined in the Zaamo, Zabha, and Zacas extensions; loads and stores defined in the base ISAs; loads and stores of no more than XLEN bits defined in the F, D, and Q extensions; the load-acquire and store-release instructions defined in the Zalasr extension; and compressed encodings of the foregoing loads and stores. For an instruction in that set, if all accessed bytes lie within the same misaligned atomicity granule, the instruction will not raise an exception for reasons of address alignment, and the instruction will give rise to only one memory operation for the purposes of RVWMO—​i.e., it will execute atomically.

Zama16b_cg/{cp_zama16b_2byte, cp_zama16b_4byte, cp_zama16b_8byte}, atomicity OUT-OF-SCOPE for single hart

Zama16b_pma_mag_req

The Zama16b extension requires MAG16 support to main memory regions.

Zama16b_cg/{cp_zama16b_2byte, cp_zama16b_4byte, cp_zama16b_8byte}, atomicity OUT-OF-SCOPE for single hart

Zama16b_mag

If the Zama16b extension is implemented, then the misaligned atomicity granule in main memory regions with both the coherence and cacheability PMAs is 16 bytes.

Zama16b_cg/{cp_zama16b_2byte, cp_zama16b_4byte, cp_zama16b_8byte}, atomicity OUT-OF-SCOPE for single hart

pma_mag_def

The misaligned atomicity granule PMA provides constrained support for misaligned AMOs. This PMA, if present, specifies the size of a misaligned atomicity granule, a naturally aligned power-of-two number of bytes. Specific supported values for this PMA are represented by MAGNN, e.g., MAG16 indicates the misaligned atomicity granule is at least 16 bytes.

Descriptive spec text with no separately testable behavior

pma_mag_insts

The misaligned atomicity granule PMA applies only to AMOs defined in the Zaamo, Zabha, and Zacas extensions; loads and stores defined in the base ISAs; loads and stores of no more than XLEN bits defined in the F, D, and Q extensions; the load-acquire and store-release instructions defined in the Zalasr extension; and compressed encodings of the foregoing loads and stores.

Zama16b_cg/{cp_zama16b_1byte, cp_zama16b_2byte, cp_zama16b_4byte, cp_zama16b_8byte}, TODO: compressed loads and stores within a 16-byte granule

pma_mag_op_within

if all accessed bytes lie within the same misaligned atomicity granule, the instruction will not raise an exception for reasons of address alignment, and the instruction will give rise to only one memory operation for the purposes of RVWMO—​i.e., it will execute atomically.

Zama16b_cg/{cp_zama16b_2byte, cp_zama16b_4byte, cp_zama16b_8byte}, atomicity OUT-OF-SCOPE for single hart

pma_mag_op_ldst

For regular loads and stores that access such a region or for which not all accessed bytes lie within the same atomicity granule, then either an exception is raised, or the access proceeds but is not guaranteed to be atomic.

Zama16b_atomic_ops

Misaligned loads, stores and AMOs to those regions that do not cross a naturally aligned 16-byte boundary are atomic.

Zama16b_cg/{cp_zama16b_2byte, cp_zama16b_4byte, cp_zama16b_8byte}, atomicity OUT-OF-SCOPE for single hart

UDB Parameters: None.

B.11.16. Sdtrig Debug Triggers

Located here because it is part of RVA23 and can function without the rest of the Debug Specification. See Section C.1 for non-RVA23 debug extensions. The suite is divided into SdtrigSm, SdtrigS, and SdtrigU suites that are essentially identical, but are run on different privilege levels and thus produce different results for coverpoints such as reading debug registers or triggering in certain modes. SdtrigSm is listed in full; the SdtrigS and SdtrigU plans below list only how they differ, and they cover the same normative rules.

Assumptions: tests run in M-mode unless otherwise specified, udb configuration file describes supported triggers and features Only support ratified version 1.0 of the spec Implies tinfo must be implemented, Mscontext not tested Triggers are not assumed to be precise, so priority and timing not tested Hit is optional and not tested Only test action=0 of breakpoint exception because external debug and trace are not required Do not test trigger types 1 (SiFive legacy), 2 (Deprecated mcontrol), 7 (tmexttrig), 12-14 (custom) Reset Values not tested Unless otherwise specified, test mcontrol6 with tdata1.select=match=size=chain=0 tdata1.m/s/u/vs/vu = 1/0/0/0/0 tdata1.XSL = 1/1/1 tdata3 = 0 tcontrol.mte = 1 (if TCONTROL supported) mideleg = 0 medeleg = 0 mstatus.MIE = 1 if Smstateen/Ssstateen_SUPPORTED: mstateen0.context = 1, hstateen0.context = 1 optional context registers hold 0 if they exist

Table 350. SdtrigSm Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule Notes

Access

cp_csr_access_common

Access all Sdtrig CSRs common to all triggers
Accesses to trigger CSRs used by any of the implemented triggers must succeed
At least one trigger must be supported

For each of UDB_SDTRIG_NUM_TRIGGERS in tselect:
For i each type in {0-15}
tdata1.type = i
For x register in {tdata1,tdata2,tdata3,tinfo,tcontrol,hcontext,mcontext,scontext} if x_AVAILABLE:
csr read, write all 1s, write all 0s, set all 1s, clear all 1s, write back initial value of each register:

WARL
illegal instruction exception on CSR access if it is not implemented by any trigger

UDB_SDTRIG_NUM_TRIGGERS * 16 types * 9 regs * 6 accesses

Sdtrig_num_trigs_ge1
Sdtrig_csr_mode
Sdtrig_tdata1
Sdtrig_tdata2
Sdtrig_tdata3
Sdtrig_tinfo
Sdtrig_trigger_modes_1
Sdtrig_scontext_data
Sdtrig_mcontext_hcontext_data
Sdtrig_mcontrol6
Sdtrig_icount
Sdtrig_itrigger
Sdtrig_etrigger
Sdtrig_textra32
Sdtrig_textra64

comments on test results: No exceptions. Tcontrol, mscontext, hcontext not implemented on spike

Note: Use CSRW/CSRR to access registers in all modes

Native Triggers

cp_breakpoint_delegate

Breakpoints caused by triggers can be delegated

if S_SUPPORTED
medeleg[3] = {0/1}
cause a supported trigger to fire

Trap to M mode if medeleg[3] = 0, trap to S mode of medeleg[3] = 1, when in a mode < M

2 medeleg

Sdtrig_breakpoint_delegated

A Extension

Repeat for each of UDB_SDTRIG_NUM_TRIGGERS if UDB_SDTRIG_MCONTROL6_SUPPORTED[i]:
tselect = i

cp_lrsc_addr

lr instructions are loads
sc instructions are stores

if ZALRSC_SUPPORTED
tdata2 = {scratch/0}
tdata1.select = 0 (adr)
tdata1.XSL = {100/010/001}
if RV32:
Perform LR.W, SC.W 0x12345678 to scratch
if RV64:
Perform LR.D, SC.D 0x123456789ABCDEF0 to scratch

Breakpoint exception when mem access address matches tdata2 and
- sc is performed while Store = 1 or
- lr is performed while Load = 1

if RV32:
2 address * 3 XSL * 2 ops
if RV64:
2 address * 3 XSL * 4 ops

Sdtrig_Aext_lr_op
Sdtrig_Aext_sc_op

cp_lrsc_data

lr instructions are loads
sc instructions are stores

if ZALRSC_SUPPORTED
tdata1.select = 1 (data)
tdata1.XSL = {100/010/001}
if RV32:
tdata2 = {0x12345678/0}
Perform LR.W, SC.W 0x12345678 to scratch
if RV64:
tdata2 = {0x123456789ABCDEF0/0}
Perform LR.D, SC.D 0x123456789ABCDEF0 to scratch

Breakpoint exception when mem access data matches tdata2 and
- sc is performed while Store = 1 or
- lr is performed while Load = 1

if RV32:
2 address * 3 XSL * 2 ops
if RV64:
2 address * 3 XSL * 4 ops

Sdtrig_Aext_lr_op
Sdtrig_Aext_sc_op

cp_amo

Amo is a load for the read portion and a store for the write portion

if ZAAMO_SUPPORTED
tdata2 = {scratch/0}
tdata1.select = 0 (adr)
tdata1.XSL = {100/010/001}
Perform amoswap to scratch with rd != x0

Breakpoint exception if load or store are set and mem access data matches tdata2

2 address * 3 XSL

Sdtrig_AMO_read
Sdtrig_AMO_read_addr
Sdtrig_AMO_store
Sdtrig_AMO_store_addr

Notes:
UNSPECIFIED whether failing SC instructions are stores; do not test.
UNSPECIFIED whether amo’s match on data: do not test

Combined Accesses

Repeat for each of UDB_SDTRIG_NUM_TRIGGERS if UDB_SDTRIG_MCONTROL6_SUPPORTED[i]:
tselect = i

UDB_VECTOR_SEW

cp_vector_load_store

Accesses match as if it performed a load/store of size SEW

if ZVL32B_SUPPORTED
tdata2 = {scratch/0}
tdata1.size = {0/1/2/3/4/5/6}
tdata1.select = 0 (adr)
tdata1.XSL = 010
Vsetivli x0, 1, e{8/16/32/64}, m1, ta, ma
Perform v{l/s}e{8/16/32/64}.v to scratch

Breakpoint exception if the tdata2 matches a address in the vector store and tdata1.size = SEW or 0

2 address * 7 sizes * 4 SEW * 2 ops

Sdtrig_mult_mem_access

cp_vector_accesses

Accesses match as if happened individually

if ZVL32B_SUPPORTED
tdata2 = {scratch/scratch+8/0}
tdata1.select = 0 (adr)
tdata1.XSL = 010
Vsetivli x0, {1/9}, e{8/16/32/64}, m1, ta, ma
Perform v{l/s}e{8/16/32/64}.v to scratch

Breakpoint exception if the tdata2 = scratch
Breakpoint exception when tdata2 = scratch+8 and Vector elements = 9

3 address * 2 Vector Lengths * 4 SEW * 2 ops

Sdtrig_mult_mem_access

cp_vector_mask

Masked vector operations do not match

if ZVL32B_SUPPORTED
tdata2 = {scratch+8}
tdata1.select = 0 (adr)
tdata1.XSL = {010/001}
Vsetivli x0, 9, e{8/16/32/64}, m1, ta, mu
v0 = mask with the element at scratch+8 {active/inactive}
Perform v{l/s}e{8/16/32/64}.v to scratch, v0.t

Breakpoint exception when the element at tdata2 is active
No breakpoint exception when the element at tdata2 is masked off

2 mask states * 4 SEW * 2 ops

Sdtrig_mult_mem_access

cp_cm_pop_push

Accesses match as if happened individually

if ZCMP_SUPPORTED
if RV32:
tdata2 = {scratch/scratch + 8/scratch + 12/scratch + 16}
if RV64:
tdata2 = {scratch/scratch + 8/scratch + 16}
tdata1.select = 0 (adr)
tdata1.XSL = {100/010/001}
tdata1.size = {0,1,2,3,4,5,6}
sp = scratch+16
cm.push {ra, s0}, -16
cm.pop{ra, s0}, 16

Breakpoint exception if the tdata2 matches mem address, store/load = 1, tdata1.size = XLEN or 0

3 address * 3 XSL * 7 sizes * 2 ops

Sdtrig_mult_mem_access

Cache Operations

Repeat for each of UDB_SDTRIG_NUM_TRIGGERS if UDB_SDTRIG_MCONTROL6_SUPPORTED[i]:
tselect = i

For all: Sdtrig_caches_stores

cp_cache_zicbom

cbo.clean, cbo.flush, and cbo.inval match as if they are stores

if ZICBOM_SUPPORTED
tdata2 = {scratch/0}
tdata1.select ={0/1}
tdata1.size = {0/1/2/3/4/5/6}
tdata1.XSL = {100/010/001}
Perform CBO.{CLEAN/FLUSH/INVAL} to {scratch}

Breakpoint exception when tdata2 = scratch and store = 1 and size = 0 and select = 0

2 addrs * 2 selects * 7 sizes * 3 XSL * 3 ops

Sdtrig_caches_stores_1
Sdtrig_caches_stores_2
Sdtrig_caches_stores_3
Sdtrig_cache_compare
Sdtrig_cache_compare_opts
Sdtrig_cache_clears

cp_cache_zicboz

cbo.zero matches as if it is a store

if ZICBOZ_SUPPORTED
tdata2 = {scratch/0}
tdata1.select ={0/1}
tdata1.size = {0/1/2/3/4/5/6}
tdata1.XSL = {100/010/001}
Perform CBO.ZERO to scratch

Breakpoint exception when tdata2 = scratch and store = 1 and size = 0 and select = 0

2 addrs * 2 selects * 7 sizes * 3 XSL

Sdtrig_caches_stores_1
Sdtrig_caches_stores_2
Sdtrig_caches_stores_3
Sdtrig_cache_compare
Sdtrig_cache_compare_opts
Sdtrig_cbo_zero

cp_cache_zicbop

The prefetch instructions don’t match at all.

if ZICBOP_SUPPORTED
tdata2 = {scratch/0/PREFETCH.{i/r/w}}
tdata1.select ={0/1} (adr)
tdata1.size = 0
tdata1.XSL =111
Perform PREFETCH.{i/r/w} to scratch

No exceptions

5 values * 2 selects * 3 ops

Sdtrig_cache_hints
Sdtrig_prefetch

Address Matches

cp_tdata2_translate

tdata2 can hold valid addresses in all supported translation modes

For each of UDB_SDTRIG_NUM_TRIGGERS in tselect
Turn on Virtual memory
CSRW tdata2 = all 0’s
if sv57 supported:
CSRW tdata2 walking 0’s and 1’s bits 55:0
else if sv48 supported:
CSRW tdata2 walking 0’s and 1’s bits 46:0
else if sv39 supported:
CSRW tdata2 walking 0’s and 1’s bits 37:0
else if sv32 supported:
CSRW tdata2 walking 0’s and 1’s bits 31:0
else BARE and (PLEN < XLEN):
CSRW tdata2 walking 0’s and 1’s bits PLEN-1:0
CSRR tdata2 after each write

Read value matches written
Results are sign extended

SVMODE * 2

Sdtrig_tdata2_addr_sz1
Sdtrig_pmem
Sdtrig_vmem
Sdtrig_csr_tdata2_sz2

Trigger Module Registers

cp_tdata_write

Writes to one tdata register must not modify the contents of other tdata registers. Note: type 15 allow any supported value to be written to tdata2/3

For each of UDB_SDTRIG_NUM_TRIGGERS in tselect
tdata1.type = 15
For reg_x in {tdata1, tdata2, tdata3}:
Write all register = 0 (mask tdata1.type)
Read all registers
Write reg_x all 1’s
Read other 2 registers

No exceptions
Writing one tdata register does not change another

3

Sdtrig_tdata_write

coverpoint drafted: 9/10
coverpoint reviewed: 9/10

cp_csr_access

The Trigger Module registers, except scontext, and hcontext, are only accessible in machine and Debug Mode

each of UDB_SDTRIG_NUM_TRIGGERS in tselect:
For x register in {tdata1,tdata2,tdata3,tinfo} if x_AVAILABLE:
csr read, write all 1s write back initial value of each register
For x register in {tcontrol, hcontext,scontect,mcontext} if x_AVAILABLE:
csr read, write all 1s write back initial value of each register

No exceptions
All registers can be accessed from M-mode

NUM_TRIGGERS * 4 regs + 5 regs

Sdtrig_trigger_modes
Sdtrig_scontext_access

coverpoint drafted: 9/10
coverpoint reviewed: 9/10

cp_tselect_trigs

The set of triggers must start at 0 and be contiguous

For tselect = 0 to UDB_SDTRIG_NUM_TRIGGERS -1
CSRR tinfo
check tinfo.info != 1

No exceptions
tinfo.info != 1 for all trigger < NUM_TRIGGERS

NUM_TRIGGERS

Sdtrig_num_trigs_ge1
Sdtrig_tselect
Sdtrig_tselect_access

coverpoint drafted: 9/10
coverpoint reviewed: 9/10

cp_tdata1_mode_hardwired

Non supported mode bits are hardwired zero

For each of UDB_SDTRIG_NUM_TRIGGERS in tselect:
enable all priv bits (tdata1.m/s/u/vs/vu = 11111) with tdata1.type = 6
CSRR tdata1 and check value written to tdata1.m/s/u/vs/vu

Non-supported mode bits read back as zero after writing all-ones

NTRIGGERS

Sdtrig_tdata1_dmode_type_0
Sdtrig_tdata1_data

coverpoint drafted: 9/10
coverpoint reviewed: 9/10

cp_tinfo_read_only

Writing tinfo has no effect

For each of UDB_SDTRIG_NUM_TRIGGERS in tselect:
CSRR tinfo,
CSRW 0’s and 1’s to tinfo,
CSRR tinfo

Writing tinfo has no effect
Supported trigger types have bits enabled in tinfo.info

NTRIGGERS

Sdtrig_tinfo_support

coverpoint drafted: 9/10
coverpoint reviewed: 9/10

Trigger Control

cp_tcontrol_enable

tcontrol.mte enables debug triggers in M-mode

if UDB_TCONTROL_AVAILABLE
tcontrol.mte = {0/1}
For each of UDB_SDTRIG_NUM_TRIGGERS in tselect:
cause a supported trigger to fire

Breakpoint exception when mte = 1 and trigger fires in M-mode

2 mte

Sdtrig_tcontrol_mte_disabled
Sdtrig_tcontrol_mte_enabled

cp_tcontrol_mtrap

tcontrol.mte/mpte on trap into M-mode

if UDB_TCONTROL_AVAILABLE
tcontrol.mpte = {0/1}
tcontrol.mte = {0/1}
trap to M-moded (perform illegal instruction 0x0)
CSRR tcontrol

When M-mode trap taken, mpte is set to mte, mte is set = 0

2 mpte * 2 mte

Sdtrig_tcontrol_mpte
Sdtrig_tcontrol_mte

cp_tcontrol_mret

tcontrol.mte on mret

if UDB_TCONTROL_AVAILABLE
tcontrol.mpte = {0/1}
tcontrol.mte = {0/1}
perform mret
CSRR tcontrol

When mret is executed, mte is set to the value of mpte.

2 mpte * 2 mte

Sdtrig_tcontrol_mte_mret

Mcontrol

Deprecated and not tested.

Mcontrol6 tests: test fire and don’t fire for each scenario

Repeat for each of UDB_SDTRIG_NUM_TRIGGERS if UDB_SDTRIG_MCONTROL6_SUPPORTED[i]:
tselect = i
tdata1 = 0
write tdata2 and tdata3 as necessary
tdata3 = 0 unless otherwise specified (textra = 0, controls context matching)
tdata1.type = 6 (mcontrol6)
tdata1.dmode = 0 (M-mode accessible)
tdata1.action = 0 (breakpoint)
tdata1.uncertainen = 0 (exact match)
unless otherwise specified:
tdata1.m/s/u/vs/vu = (1 for current mode, e.g. 1 in m)
tdata1.select = 0 (adr)
tdata1.size = 0 (any)
tdata1.chain = 0 (disabled)
tdata1.match = 0 (equal)
Perform an instruction that causes trigger to fire/not fire

cp_mcontrol6_priv_mode

tdata2 = {scratch}
tdata1.select = 0 (adr)
tdata1.XSL= 010
tdata1.m = {0/1}
Perform SW 0x12345678 to scratch

Breakpoint exception on instruction if tdata1.m = 1

2 priv bits

Sdtrig_action0
Sdtrig_mcontrol6_access
Sdtrig_mcontrol6_m
Sdtrig_mcontrol6_s
Sdtrig_mcontrol6_u

comments on test results: Exceptions when m.1

cp_mcontrol6_execute_adr

tdata2 = {PC address of add x0, x1, x2/0}
tdata1.select = 0 (adr)
tdata1.XSL = 8 combinations
perform add x0, x1, x2

Breakpoint exception on PC of add x0, x1, x2 if tdata2 points to it and tdata1.execute = 1

2 values * 8 XSL

Sdtrig_mcontrol6_select_address
Sdtrig_mcontrol6_execute
Sdtrig_mcontrol6_store
Sdtrig_mcontrol6_load

comments on test results: Exceptions on triggers when execute = 1

cp_mcontrol6_load_store_adr

tdata2 = {scratch/scratch+8/0}
tdata1.select = 0 (adr)
tdata1.XSL = 8 combinations
perform {SW/ LW 0x12345678} to scratch + {0/8}

Breakpoint exception on LW if access address matches tdata2 and tdata1.load = 1
Breakpoint exception on SW if access address matches tdata2 and tdata1.store = 1

3 addresses * 8 XSL * 2 ops * 2 offsets

Sdtrig_mcontrol6_select_address
Sdtrig_mcontrol6_execute
Sdtrig_mcontrol6_store
Sdtrig_mcontrol6_load

comments on test results: Exceptions when XSL = 2 or 1 when tdata2 = scratch

cp_mcontrol6_execute_data

tdata2 = {addi x0, x1, 0 opcode (0x00008013)/0x2}
tdata1.select = 1 (data)
tdata1.XSL = 8 combinations
perform addi x0, x1, 0
(not nop, whose opcode also appears in the test environment’s own code; no instruction in the test encodes as 0x2)

Breakpoint exception on fetched instruction if tdata2 matches opcode and tdata1.execute = 1

2 values * 8 XSL

Sdtrig_mcontrol6_select_data
Sdtrig_mcontrol6_execute
Sdtrig_mcontrol6_store
Sdtrig_mcontrol6_load

comments on test results: Exceptions when tdata2 = 0x00008013, and execute = 1

cp_mcontrol6_load_store_data

tdata2 = {random value}
tdata1.select = 1 (data)
tdata1.XSL = 8 combinations
perform {SW/ LW random value} to scratch

Breakpoint exception on LW if access data matches tdata2 and tdata1.load = 1
Breakpoint exception on SW if access data matches tdata2 and tdata1.store = 1

8 XSL * 2 ops (tdata2 values not binned because the data a load reads is not visible to coverage)

Sdtrig_mcontrol6_select_data
Sdtrig_mcontrol6_execute
Sdtrig_mcontrol6_store
Sdtrig_mcontrol6_load

comments on test results: Exceptions when td2 = the stored value, and XSL = 1/2/3

cp_mcontrol6_execute_size

tdata2 = {addi x0, x1, 0 opcode/c.nop opcode}
tdata1.select = 1 (data)
tdata1.XSL = 111
tdata1.size = {0/1/2/3/4/5/6}
perform addi x0, x1, 0
if ZCA_SUPPORTED
perform c.nop

Breakpoint exception if the size of the instruction matches the trigger size in mcontrol6 and tdata1.execute = 1

2 values * 7 sizes * 2 ops

Sdtrig_mcontrol6_size_any
Sdtrig_mcontrol6_size_8bit
Sdtrig_mcontrol6_size_16bit
Sdtrig_mcontrol6_size_32bit
Sdtrig_mcontrol6_size_48bit
Sdtrig_mcontrol6_size_64bit
Sdtrig_mcontrol6_size_128bit

comments on test results: Exceptions when td2 = op, size = 0. Note: warls size to zero

cp_mcontrol6_load_store_size

tdata2 = {scratch/0}
tdata1.select = 0 (adr)
tdata1.XSL = 011
tdata1.size = {0/1/2/3/5}
perform {lb/lbu/lh/lhu/lw/sb/sh/sw} to scratch with a random value
if RV64 supported, also perform {lwu/ld/sd}
if F_SUPPORTED, also perform {flw/fsw}
if D_SUPPORTED, also perform {fld/fsd}
if ZFH_SUPPORTED, also perform {flh/fsh}
if Q_SUPPORTED, also perform {flq/fsq}
if ZCA_SUPPORTED, also perform c.{lw/sw/lwsp/swsp}
if ZCA_SUPPORTED and RV64, also perform c.{ld/sd/ldsp/sdsp}
if ZCB_SUPPORTED, also perform c.{lbu/lh/lhu/sb/sh}
if ZCF_SUPPORTED and RV32, also perform c.{flw/flwsp/fsw/fswsp}
if ZCD_SUPPORTED, also perform c.{fld/fldsp/fsd/fsdsp}

Breakpoint exception if the size of the memory access matches the trigger size in mcontrol6

2 values * 5 sizes * up to 36 instructions

Sdtrig_mcontrol6_size_any
Sdtrig_mcontrol6_size_8bit
Sdtrig_mcontrol6_size_16bit
Sdtrig_mcontrol6_size_32bit
Sdtrig_mcontrol6_size_64bit
Sdtrig_mcontrol6_size_128bit
Sdtrig_mcontrol6_size_support

Sizes 4 (48-bit) and 6 (128-bit) are not tested

cp_mcontrol6_match

Test boundaries for match conditions

tdata1.select = 1 (data)
tdata1.XSL= 010
tdata1.match = {0/2/3/8}
if RV32:
tdata2 = {0x12345678}
perform SW{0x0},{0x12345678-1} {0x12345678},{0x12345678+1},{0xFFFFFFFF} to scratch
if RV64:
tdata2 = {0x123456789ABCDEF0}
perform SD{0x0},{0x123456789ABCDEF0-1} {0x123456789ABCDEF0},{0x123456789ABCDEF0+1},{0xFFFFFFFFFFFFFFFF} to scratch

Breakpoint exception if the store data meets the condition set by tdata1.match

4 matches * 5 ops

Sdtrig_mcontrol6_match_equal
Sdtrig_mcontrol6_match_ge
Sdtrig_mcontrol6_match_lt
Sdtrig_mcontrol6_match_not_equal

cp_mcontrol6_match_napot

tdata1.select = 1 (data)
tdata1.XSL= 010
tdata1.match = {1/9}
if RV32:
tdata2 = 0xFFFFFFFF
for x in 1:min(UDB_SDTRIG_MASKMAX6, XLEN-1)-1 tdata2[x] = 0 (legal NAPOT sizes only)
perform SW{0x0}, {0x12345678}, {0xFFFFFFFF} to scratch
if RV64:
tdata2 = 0xFFFFFFFFFFFFFFFF
for x in 1:min(UDB_SDTRIG_MASKMAX6, XLEN-1)-1 tdata2[x] = 0 (legal NAPOT sizes only)
perform SD{0x0}, {0x123456789ABCDEF0},{0xFFFFFFFFFFFFFFFF} to scratch

Breakpoint exception if the store data meets the condition set by tdata1.match
If bits maskmax6-1:0 are written with all ones then bit maskmax6-1 will be set to 0

2 matches * (min(UDB_SDTRIG_MASKMAX6, XLEN-1)-1) values * 3 ops

Sdtrig_mcontrol6_match_napot
Sdtrig_mcontrol6_match_napot_mask
Sdtrig_mcontrol6_match_napot_legal
Sdtrig_mcontrol6_match_not_napot

cp_mcontrol6_match_mask

tdata1.select = 1 (data)
tdata1.XSL= 010
tdata1.match = {4/5/12/13}
tdata2[XLEN-1:XLEN/2] is the mask and tdata2[XLEN/2-1:0] the value
if RV32:
tdata2 = {0xF0F0_A0B0}
perform SW{0x0}, {0xF0F0_A0B0}, {0xFFFFFFFF},
low half {0x0000_A0B0}, {0x0000_A1B2}, {0x0000_F0F0}, {0x0001_A0B0},
high half {0xA0B0_0000}, {0xA1B2_0000}, {0xF0F0_0000}, {0xA0B0_0001} to scratch
if RV64:
tdata2 = {0xF0F0F0F0_A0B0C0D0}
perform SD{0x0}, {0xF0F0F0F0_A0B0C0D0}, {0xFFFFFFFFFFFFFFFF},
low half {0x00000000_A0B0C0D0}, {0x00000000_A1B2C3D4}, {0x00000000_F0F0F0F0}, {0x00000001_A0B0C0D0},
high half {0xA0B0C0D0_00000000}, {0xA1B2C3D4_00000000}, {0xF0F0F0F0_00000000}, {0xA0B0C0D0_00000001} to scratch
in each half: the value, differs only outside the mask, differs inside the mask, the value with the other half nonzero

Breakpoint exception if the store data meets the condition set by tdata1.match

4 matches * 11 values

Sdtrig_mcontrol6_match_mask_low
Sdtrig_mcontrol6_match_mask_high
Sdtrig_mcontrol6_match_not_mask_low
Sdtrig_mcontrol6_match_not_mask_high

MControl6 Chain

Repeat for each of UDB_SDTRIG_NUM_TRIGGERS if UDB_SDTRIG_MCONTROL6_SUPPORTED[i] and UDB_SDTRIG_MCONTROL6_SUPPORTED[i+1]:
tselect = i
write tdata2 and tdata3 as necessary
tdata3 = 0 unless otherwise specified (textra = 0, controls context matching)
tdata1.type = 6 (mcontrol6)
tdata1.dmode = 0 (M-mode accessible)
tdata1.action = 0 (breakpoint)
tdata1.uncertainen = 0 (exact match)
unless otherwise specified:
tdata1.m/s/u/vs/vu = (1 for current mode, e.g. 1 in m)
tdata1.select = 0 (adr)
tdata1.size = 0 (any)
tdata1.chain = 0 (disabled)
tdata1.match = 0 (equal)
Perform an instruction that causes trigger to fire/not fire

cp_mcontrol6_chain_adr

Trigger i (Tselect = i):
tdata1.select = 0 (address)
tdata1.chain = 1
tdata2 = {scratch}
Trigger i+1 (Tselect = i + 1):
tdata1.select = 1 (data)
tdata1.chain = 0
tdata2 = {0x12345678}
tdata1.XSL = 010
perform SW {0x012345678/0} to {scratch/scratch+8}

Breakpoint exception from final trigger in chain if all triggers match simultaneously

2 store values * 2 addresses

Sdtrig_mcontrol6_chain
Sdtrig_mcontrol6_chain_disabled
Sdtrig_mcontrol6_chain_enabled
Sdtrig_mcontrol6_chain_start

comments on test results: Be careful of order when setting up chain, enable chain last

Notes:

uncertain and uncertainen not tested because optional and unpredictable

vs, vu deferred to SdtrigH

hit not tested because optional and implementation-dependent

action other than 0 not tested until those features are supported (e.g. SdtrigSdext/SdtrigTrace)

Icount tests: test fire and don’t fire for each scenario

Repeat for each of UDB_SDTRIG_NUM_TRIGGERS if UDB_SDTRIG_ICOUNT_SUPPORTED[i]:
tselect = i
tdata1 = 0
tdata3 = 0 unless otherwise specified (textra = 0, controls context matching)
tdata1.type = 3 (icount)
tdata1.dmode = 0 (M-mode accessible)
tdata1.action = 0 (breakpoint)
unless otherwise specified:
tdata1.m/s/u/vs/vu = (1 for current mode, e.g. 1 in m)
Perform an instruction that causes trigger to fire/not fire

cp_icount_hardwired

if UDB_COUNT_HARDWIRED_1 = true:
tdata1.m/s/u/vs/vu = 11111
perform nop in machine mode
CSRR tdata1.m,s,u,vs,vu
CSRR tdata1.count,pending

breakpoint exception occurs,
m,s,u,vs,vu are cleared, pending is cleared

1

Sdtrig_icount_match_eq1

cp_icount_instr

tdata.pending = 0
tdata1.count = 9
tdata1.m = {0/1}
perform 9x nop in machine mode
CSRR tdata1
CSRR tval

Count decreases when the instruction retires after having been fetched in M-mode and tdata1.m = 1. Tval=0 after firing, pending=0 after firing.

2 priv bits

Sdtrig_icount_access
Sdtrig_icount_match1
Sdtrig_icount_match_gt1
Sdtrig_icount_pending
Sdtrig_icount_action0
Sdtrig_icount_m
Sdtrig_icount_pending_set
Sdtrig_icount_s
Sdtrig_icount_u

cp_icount_trap

tdata1.count = 1
perform illegal instruction trap in mmode, CSRR tdata1.count

Count decreases when a trap is taken from a privilege mode where the trigger is enabled

1

Sdtrig_icount_match2
Sdtrig_icount_multiple_match
Sdtrig_icount_match_non_reexecuted
Sdtrig_icount_all_traps_match

cp_icount_eq0

tdata1.pending = {0/1}
CSRW tdata1.count = 0
perform 9x nop in machine mode
CSRR tdata1.count

Count stays at 0 until explicitly written
Breakpoint exception occurs when tdata1.pending = 1

2 pending

Sdtrig_icount_count_zero

Itrigger tests: test fire and don’t fire for each scenario

Repeat for each of UDB_SDTRIG_NUM_TRIGGERS if UDB_SDTRIG_ITRIGGER_SUPPORTED[i]:
tselect = i
tdata1 = 0
tdata3 = 0 unless otherwise specified (textra = 0, controls context matching)
tdata1.type = 4 (itrigger)
tdata1.dmode = 0 (M-mode accessible)
tdata1.action = 0 (breakpoint)
unless otherwise specified:
tdata1.m/s/u/vs/vu = (1 for current mode, e.g. 1 in m)
Perform an interrupt that causes trigger to fire/not fire

cp_itrigger

for x in {1,3,5,7,9,11,13} if INTERRUPTx_SUPPORTED:
1- tdata1.m = {0/1},
mideleg[x] = 0 , medelg[3] = 0
trigger interrupt of code {x, timer interrupt} while executing in M-mode.
2- tdata1.s = {0/1}
mideleg[x] = {0/1} , medeleg[3] = {0}
trigger interrupt of code {x, timer interrupt} while executing in S-mode.
3- tdata1.u = {0/1}
mideleg[x] = {0/1} , medeleg[3] = {0}
trigger interrupt of code {x, timer interrupt} while executing in U-mode.
CSRR tval
If HIT_IMPLEMENTED: CSRR tdata1.hit.

Breakpoint exception when the interrupt matches the interrupt number enabled in tdata2 and the corresponding privilege-mode bit (tdata1.m/s/u) is set. The trigger shall not fire when the corresponding privilege-mode bit is cleared. tval shall be set to 0 on a trigger match, and if HIT_IMPLEMENTED, hit shall be 1. Trigger firing shall be suppressed where required by the implemented reentrancy solution.

7 interrupt codes * 2 priv bits* 2 interrupts

Sdtrig_itrigger_access
Sdtrig_itrigger_fire
Sdtrig_itrigger_enable_num
Sdtrig_itrigger_timing
Sdtrig_itrigger_action0
Sdtrig_itrigger_m
Sdtrig_itrigger_s
Sdtrig_itrigger_u

Etrigger tests: test fire and don’t fire for each scenario

Repeat for each of UDB_SDTRIG_NUM_TRIGGERS if UDB_SDTRIG_ETRIGGER_SUPPORTED[i]:
tselect = i
tdata1 = 0
tdata3 = 0 unless otherwise specified (textra, controls context matching)
tdata1.type = 5 (etrigger)
tdata1.dmode = 0 (M-mode accessible)
tdata1.action = 0 (breakpoint)
unless otherwise specified:
tdata1.m/s/u/vs/vu = (1 for current mode, e.g. 1 in m)

cp_etrigger

for x in {0-9/11/12/13/15/16/18} if EXCEPTIONx_SUPPORTED
tdata2[x] = 1
1- tdata1.m = {0/1},
perform exception of code {x, illegal instruction (0x11111111)} while executing in M-mode
2- tdata1.s = {0/1}
medeleg[x] = {0/1} , medeleg[3] = {0}
perform exception of code {x, illegal instruction (0x11111111)} while executing in S-mode.
3- tdata1.u = {0/1}
medeleg[x] = {0/1} , medeleg[3] = {0}
perform exception of code {x, illegal instruction (0x11111111)} while executing in U-mode
CSRR tval.
If HIT_IMPLEMENTED: CSRR tdata1.hit.

Breakpoint exception when the exception matches the exception number enabled in tdata2 and the corresponding privilege-mode bit (tdata1.m/s/u) is set. The trigger shall not fire when the corresponding privilege-mode bit is cleared. tval shall be set to 0 on a trigger match, and if HIT_IMPLEMENTED, hit shall be 1. Trigger firing shall be suppressed where required by the implemented reentrancy solution.

17 exception codes * 2 priv bits * 2 exceptions

Sdtrig_etrigger_access
Sdtrig_etrigger_config
Sdtrig_etrigger_timing
Sdtrig_etrigger_action0
Sdtrig_etrigger_m
Sdtrig_etrigger_s
Sdtrig_etrigger_u

Textra

Repeat for each of UDB_SDTRIG_NUM_TRIGGERS if UDB_TDATA3_EXISTS[i]:
tselect = i
tdata1 = 0
tdata1.dmode = 0 (M-mode accessible)
tdata1.action = 0 (breakpoint)
unless otherwise specified:
tdata3.mhselect = 0
tdata3.sselect = 0
tdata1.m/s/u/vs/vu = (1 for current mode, e.g. 1 in m)
other fields depending on trigger type should use the defaults defined in the sections above
Perform an instruction that causes trigger to fire/not fire

cp_textra_mcontext

only run tests if MCONTEXT_AVAILABLE:
repeat for each trigger type supported:
tdata3.mhselect = 4
if RV32:
mcontext[5:0] = 010101
tdata3.mhvalue = {010101/000000/111111}
if RV64:
mcontext[12:0] = 0x1AAA
tdata3.mhvalue = 0x{0000/0AAA/1AAA}
if ICOUNT_SUPPORTED:
tdata1.type = 3 (icount)
tdata1.count = 1
tdata2 = 0
perform nop in machine mode
if ITRIGGER_SUPPORTED:
tdata1.type = 4 (itrigger)
tdata2[5] = 1
perform supervisor timer interrupt
if ETRIGGER_SUPPORTED:
tdata1.type = 5 (etrigger)
tdata2[2] = 1
perform illegal instruction (execute 0x11111111)
if MCONTROL6_SUPPORTED
tdata1.type = 6 (mcontrol6)
tdata1.select = 1 (data)
tdata2 = {0x12345678}
perform SW {0x12345678}

Breakpoint exception if mhvalue equals mcontext

3 mhvalues * 4 trigger types

Sdtrig_mcontrol6_textra
Sdtrig_icount_textra
Sdtrig_itrigger_textra
Sdtrig_etrigger_textra
Sdtrig_textra32_access
Sdtrig_textra32_mhselect_ignore
Sdtrig_textra32_mhselect_mcontext
Sdtrig_textra32_mhselect_no_h
Sdtrig_textra32_sbytemask
Sdtrig_textra64_access

cp_textra_scontext

only run tests if SCONTEXT_AVAILABLE:
repeat for each trigger type supported:
tdata3.sselect = 1
if RV32:
scontext = {00001234}
tdata3.svalue = 0x{0000/0034/1200/1234}
tdata3.sbytemask = 4 combinations
if RV64:
scontext = {0x12345678}
tdata3.svalue = 0x{00000000/12345600/12340078/12005678/00345678/12345678}
tdata3.sbytemask = {0000/0001/0010/0100/1000/1111}
if ICOUNT_SUPPORTED:
tdata1.type = 3 (icount)
tdata1.count = 1
tdata2 = 0
perform nop in machine mode
if ITRIGGER_SUPPORTED:
tdata1.type = 4 (itrigger)
tdata2[5] = 1
perform supervisor timer interrupt
if ETRIGGER_SUPPORTED:
tdata1.type = 5 (etrigger)
tdata2[2] = 1
perform illegal instruction (execute 0x11111111)
if MCONTROL6_SUPPORTED
tdata1.type = 6 (mcontrol6)
tdata1.select = 1 (data)
tdata2 = {0x12345678}
perform SW {0x12345678}

Breakpoint exception when svalue equals scontext and mask ignores A’s

if RV32:
4 svalues * 4 masks * 4 trigger types
if RV64:
6 svalues * 6 masks * 4 trigger types

Sdtrig_mcontrol6_textra
Sdtrig_icount_textra
Sdtrig_itrigger_textra
Sdtrig_etrigger_textra
Sdtrig_textra32_access
Sdtrig_textra32_byte_mask_applies
Sdtrig_textra32_sselect_ignore
Sdtrig_textra32_sselect_scontext
Sdtrig_textra64_access
Sdtrig_textra64_byte_granular
Sdtrig_textra64_byte_mask_applies
Sdtrig_textra64_sbytemask

cp_textra_double_context

only run tests if MCONTEXT_AVAILABLE and SCONTEXT_AVAILABLE:
repeat for each trigger type supported:
tdata3.mhselect = {0/4}
tdata3.sselect = {0/1}
tdata3.sbytemask = 0
if RV32:
mcontext[5:0] = 111111
tdata3.mhvalue = {000000/111111}
if RV64:
mcontext[12:0] = 0x1FFF
tdata3.mhvalue = 0x{0000/1FFF}
if RV32:
scontext = 0x0000FFFF
tdata3.svalue = 0x{0000/FFFF}
if RV64:
scontext = 0xFFFFFFFF
tdata3.svalue = 0x{00000000/FFFFFFFF}
if ICOUNT_SUPPORTED:
tdata1.type = 3 (icount)
tdata1.count = 1
tdata2 = 0
perform nop in machine mode
if ITRIGGER_SUPPORTED:
tdata1.type = 4 (itrigger)
tdata2[5] = 1
perform supervisor timer interrupt
if ETRIGGER_SUPPORTED:
tdata1.type = 5 (etrigger)
tdata2[2] = 1
perform illegal instruction (execute 0x11111111)
if MCONTROL6_SUPPORTED
tdata1.type = 6 (mcontrol6)
tdata1.select = 1 (data)
tdata2 = {0x12345678}
perform SW {0x12345678}

Breakpoint exception when all enabled context numbers match

2 mhselect * 2 sselect * 2 mhvalue * 2 svalue

Sdtrig_textra32_mhselect_mcontext
Sdtrig_textra32_sselect_scontext

cp_textra_asid

only run tests if SCONTEXT_AVAILABLE:
repeat for each trigger type supported:
tdata3.sselect = 2
X = 2^UDB_ASID_WIDTH-2
CSRW satp.asid = X
if RV32:
tdata3.svalue = {0/X/0x1FE/ (X | 1 << 15) / FFFE}
if RV64:
tdata3.svalue = {0/X/0xFFFE/ (X | 1 << 31) / FFFFFFFE}
if ICOUNT_SUPPORTED:
tdata1.type = 3 (icount)
tdata1.count = 1
tdata2 = 0
perform nop in machine mode
if ITRIGGER_SUPPORTED:
tdata1.type = 4 (itrigger)
tdata2[5] = 1
perform supervisor timer interrupt
if ETRIGGER_SUPPORTED:
tdata1.type = 5 (etrigger)
tdata2[2] = 1
perform illegal instruction (execute 0x11111111)
if MCONTROL6_SUPPORTED
tdata1.type = 6 (mcontrol6)
tdata1.select = 1 (data)
tdata2 = {0x12345678}
perform SW {0x12345678}

Breakpoint exception if ASID in satp equals the lower ASIDMAX bits of svalue.

5 svalues * 4 trigger types

Sdtrig_mcontrol6_textra
Sdtrig_itrigger_textra
Sdtrig_etrigger_textra
Sdtrig_textra32_access
Sdtrig_textra32_sselect_asid1
Sdtrig_textra32_sselect_asid2
Sdtrig_textra32_sselect_asid3
Sdtrig_textra32_sselect_asid

cp_smode_fields_hardwired

For each of UDB_SDTRIG_NUM_TRIGGERS in tselect:
If TDATA3_EXISTS:
If S_SUPPORTED = false:
CSRW textra.svalue = 1
CSRW textra.sselect = 1
CSRR tdata3

svalue tied 0 if S-mode not supported
sselect tied 0 if S-mode not supported

1

Sdtrig_textra32_svalue_no_s
Sdtrig_textra32_sselect_no_s

Actions

Only action 0 (breakpoint) supported in this file (sufficient for RVA23). Eventually add SdtrigSdext with action 1, SdtrigEtrace for Trace 2-4, SdtrigExternal for 8-9

Table 351. SdtrigSm Normative Rules
Normative Rule Rule Text Coverpoints

Sdtrig_num_trigs_ge1

SdtrigSm_sdtrig_cg/cp_csr_access_common, SdtrigSm_csr_cg/cp_tselect_trigs

Sdtrig_unimp_csr_illegal

Implementation-specific behavior; not tested in this suite

Sdtrig_csr_mode

SdtrigSm_sdtrig_cg/cp_csr_access_common

Sdtrig_no_debug_fires

Requires Sdext external debug support; not implemented

Sdtrig_actions

Only action 0 (breakpoint) supported in this suite

Sdtrig_action0

SdtrigSm_mcontrol6_cg/cp_mcontrol6_priv_mode

Sdtrig_action1

Requires Sdext external debug support; not implemented

Sdtrig_action2

Trace action defined by the separate trace specification

Sdtrig_action3

Trace action defined by the separate trace specification

Sdtrig_action4

Trace action defined by the separate trace specification

Sdtrig_action5_rsv

Trace action defined by the separate trace specification

Sdtrig_action8_9

Requires tmexttrigger external trigger inputs; implementation specific

Sdtrig_action_rsv

Reserved encoding for future use; nothing to test

Sdtrig_priority

Trigger priority not tested; triggers assumed imprecise

Sdtrig_non_precise_priority

Trigger priority not tested; triggers assumed imprecise

Sdtrig_chain_priority

Trigger priority not tested; triggers assumed imprecise

Sdtrig_multiple_fires

Trigger priority not tested; triggers assumed imprecise

Sdtrig_tval

Trigger priority not tested; triggers assumed imprecise

Sdtrig_debug_breakpoint

Trigger priority not tested; triggers assumed imprecise

Sdtrig_simul_debug_breakpoint_fallback

Trigger priority not tested; triggers assumed imprecise

Sdtrig_hit_set_on_action0

Trigger priority not tested; triggers assumed imprecise

Sdtrig_independent_trigs

Trigger priority not tested; triggers assumed imprecise

Sdtrig_breakpoint_delegated

SdtrigSm_native_triggers_cg/cp_breakpoint_delegate

Sdtrig_Aext_lr_op

SdtrigSm_a_cg/cp_lrsc_addr, SdtrigSm_a_cg/cp_lrsc_data

Sdtrig_Aext_sc_op

SdtrigSm_a_cg/cp_lrsc_addr, SdtrigSm_a_cg/cp_lrsc_data

Sdtrig_Aext_sc_fail

Behavior is UNSPECIFIED by the specification; not tested

Sdtrig_AMO_read

SdtrigSm_a_cg/cp_amo

Sdtrig_AMO_read_addr

SdtrigSm_a_cg/cp_amo

Sdtrig_AMO_store

SdtrigSm_a_cg/cp_amo

Sdtrig_AMO_store_addr

SdtrigSm_a_cg/cp_amo

Sdtrig_AMO_store_match

Behavior is UNSPECIFIED by the specification; not tested

Sdtrig_load_zero_rd

Behavior is UNSPECIFIED by the specification; not tested

Sdtrig_mult_mem_access

SdtrigSm_combined_accesses_cg/cp_vector_load_store, SdtrigSm_combined_accesses_cg/cp_vector_accesses, SdtrigSm_combined_accesses_cg/cp_cm_pop_push

Sdtrig_caches_stores_1

SdtrigSm_cache_operations_cg/cp_cache_zicbom, SdtrigSm_cache_operations_cg/cp_cache_zicboz

Sdtrig_caches_stores_2

SdtrigSm_cache_operations_cg/cp_cache_zicbom, SdtrigSm_cache_operations_cg/cp_cache_zicboz

Sdtrig_caches_stores_3

SdtrigSm_cache_operations_cg/cp_cache_zicbom, SdtrigSm_cache_operations_cg/cp_cache_zicboz

Sdtrig_cache_compare

SdtrigSm_cache_operations_cg/cp_cache_zicbom, SdtrigSm_cache_operations_cg/cp_cache_zicboz

Sdtrig_cache_compare_opts

SdtrigSm_cache_operations_cg/cp_cache_zicbom, SdtrigSm_cache_operations_cg/cp_cache_zicboz

Sdtrig_cache_hints

SdtrigSm_cache_operations_cg/cp_cache_zicbop

Sdtrig_cache_clears

SdtrigSm_cache_operations_cg/cp_cache_zicbom

Sdtrig_cbo_zero

SdtrigSm_cache_operations_cg/cp_cache_zicboz

Sdtrig_prefetch

SdtrigSm_cache_operations_cg/cp_cache_zicbop

Sdtrig_tdata2_addr_sz1

SdtrigSm_address_matches_cg/cp_tdata2_translate

Sdtrig_pmem

SdtrigSm_address_matches_cg/cp_tdata2_translate

Sdtrig_vmem

SdtrigSm_address_matches_cg/cp_tdata2_translate

Sdtrig_csr_tdata2_sz2

SdtrigSm_address_matches_cg/cp_tdata2_translate

Sdtrig_csr_tdata2_invalid

WARL write-any-read-legal behavior not separately tested

Sdtrig_multistate_change

Descriptive spec text with no separately testable behavior

Sdtrig_tdata_warl

WARL write-any-read-legal behavior not separately tested

Sdtrig_tdata_write

SdtrigSm_csr_cg/cp_tdata_write

Sdtrig_disable_trig

Unpredictable behavior on this access; not tested

Sdtrig_unimplemented_register

Unpredictable behavior on this access; not tested

Sdtrig_trigger_modes

SdtrigSm_csr_cg/cp_csr_access

Sdtrig_xlen_handling

XLEN-dependent behavior not tested; single XLEN assumed

Sdtrig_fields

XLEN-dependent behavior not tested; single XLEN assumed

Sdtrig_fields_high

XLEN-dependent behavior not tested; single XLEN assumed

Sdtrig_xlen_modification

XLEN-dependent behavior not tested; single XLEN assumed

Sdtrig_tselect

SdtrigSm_csr_cg/cp_tselect_trigs

Sdtrig_tselect_access

SdtrigSm_csr_cg/cp_tselect_trigs

Sdtrig_tselect_warl

WARL write-any-read-legal behavior not separately tested

Sdtrig_tdata1

SdtrigSm_sdtrig_cg/cp_csr_access_common

Sdtrig_tdata1_reset

Reset values not tested in this suite

Sdtrig_tdata1_write0

WARL write-any-read-legal behavior not separately tested

Sdtrig_tdata1_multiple_types

WARL write-any-read-legal behavior not separately tested

Sdtrig_tdata1_type_disabled

Descriptive spec text with no separately testable behavior, WARL write-any-read-legal behavior not separately tested

Sdtrig_tdata1_type_rsv

Reserved encoding for future use; nothing to test

Sdtrig_tdata1_dmode_type_0

SdtrigSm_csr_cg/cp_tdata1_mode_hardwired

Sdtrig_tdata1_dmode_0

Requires Sdext external debug support; not implemented

Sdtrig_tdata1_dmode_1

Requires Sdext external debug support; not implemented

Sdtrig_tdata1_dmode_writable

Requires Sdext external debug support; not implemented

Sdtrig_tdata1_data

SdtrigSm_csr_cg/cp_tdata1_mode_hardwired

Sdtrig_tdata2

SdtrigSm_sdtrig_cg/cp_csr_access_common

Sdtrig_tdata2_reset

Descriptive spec text with no separately testable behavior

Sdtrig_tdata2_disabled

WARL write-any-read-legal behavior not separately tested

Sdtrig_tdata2_sign_extend

XLEN-dependent behavior not tested; single XLEN assumed

Sdtrig_tdata3

SdtrigSm_sdtrig_cg/cp_csr_access_common

Sdtrig_tdata3_reset

Descriptive spec text with no separately testable behavior

Sdtrig_tdata3_disabled

WARL write-any-read-legal behavior not separately tested

Sdtrig_tdata3_sign_extend

XLEN-dependent behavior not tested; single XLEN assumed

Sdtrig_tinfo

SdtrigSm_sdtrig_cg/cp_csr_access_common

Sdtrig_tinfo_reset

Reset values not tested in this suite

Sdtrig_tinfo_optional

Only ratified version 1.0 supported; version assumed

Sdtrig_tinfo_version

Only ratified version 1.0 supported; version assumed

Sdtrig_tinfo_version_0

Only ratified version 1.0 supported; version assumed

Sdtrig_tinfo_version_1

Only ratified version 1.0 supported; version assumed

Sdtrig_tinfo_support

SdtrigSm_csr_cg/cp_tinfo_read_only

Sdtrig_tinfo_no_trigger

WARL tselect; nonexistent-trigger reporting not tested

Sdtrig_trigger_modes_1

SdtrigSm_sdtrig_cg/cp_csr_access_common

Sdtrig_tcontrol_mpte

SdtrigSm_csr_cg/cp_tcontrol_mtrap

Sdtrig_tcontrol_mte_disabled

SdtrigSm_csr_cg/cp_tcontrol_enable

Sdtrig_tcontrol_mte_enabled

SdtrigSm_csr_cg/cp_tcontrol_enable

Sdtrig_tcontrol_mte

SdtrigSm_csr_cg/cp_tcontrol_mtrap

Sdtrig_tcontrol_mte_mret

SdtrigSm_csr_cg/cp_tcontrol_mret

Sdtrig_hcontext_implemented

Hypervisor extension not implemented, so not testable

Sdtrig_hcontext_access

Hypervisor extension not implemented, so not testable

Sdtrig_hcontext_smstateen

Hypervisor extension not implemented, so not testable

Sdtrig_hcontext

Hypervisor extension not implemented, so not testable

Sdtrig_scontext_access

SdtrigSm_csr_cg/cp_csr_access

Sdtrig_scontext_accessibility

State-enable accessibility tested in the Smstateen suite

Sdtrig_scontext_data

SdtrigSm_sdtrig_cg/cp_csr_access_common

Sdtrig_mcontext_implementation

Hypervisor extension not implemented, so not testable

Sdtrig_mcontext_access

SdtrigSm_csr_cg/cp_mcontext_smode

Sdtrig_mcontext_hcontext_data

SdtrigSm_sdtrig_cg/cp_csr_access_common

Sdtrig_mscontext

Optional register, not required by Sdtrig 1.0; not tested

Sdtrig_mscontext_access

Optional register, not required by Sdtrig 1.0; not tested

Sdtrig_mcontrol

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol_reset

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol_access

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol_maskmax

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol_sizehi

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol_hit

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol_select_address

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol_select_data

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol_timing_before

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol_timing_multi

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol_timing_after

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol_timing_overlap

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol_size_any

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol_size_8bit

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol_size_16bit

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol_size_32bit

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol_size_48bit

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol_size_64bit

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol_size_80bit

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol_size_96bit

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol_size_112bit

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol_size_128bit

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol_size_support

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol_chain_disabled

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol_chain_enabled

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol_chain_start

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol_chain_next

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol_chain_ignore

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol_match_equal

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol_match_napot

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol_match_ge

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol_match_lt

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol_match_mask_low

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol_match_mask_high

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol_match_not_equal

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol_match_not_napot

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol_match_not_mask_low

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol_match_not_mask_high

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol_match_rsv

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol_comparisons

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol_m

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol_s

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol_u

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol_execute

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol_store

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol_load

Deprecated mcontrol type 2 trigger; not implemented

Sdtrig_mcontrol6

SdtrigSm_sdtrig_cg/cp_csr_access_common

Sdtrig_mcontrol6_reset

Descriptive spec text with no separately testable behavior

Sdtrig_mcontrol6_access

SdtrigSm_mcontrol6_cg/cp_mcontrol6_priv_mode

Sdtrig_mcontrol6_dependence

Only ratified version 1.0 supported; version assumed

Sdtrig_mcontrol6_chain

SdtrigSm_mcontrol6_cg/cp_mcontrol6_chain_adr

Sdtrig_mcontrol6_breakpoint

Covered by Privileged-spec breakpoint and tval testing

Sdtrig_mcontrol6_faulting_address

Covered by Privileged-spec breakpoint and tval testing

Sdtrig_mcontrol6_chained_faulting

Covered by Privileged-spec breakpoint and tval testing

Sdtrig_mcontrol6_napot_range

NAPOT range support is optional; not required here

Sdtrig_mcontrol6_textra

SdtrigSm_textra_cg/cp_textra_mcontext, SdtrigSm_textra_cg/cp_textra_scontext, SdtrigSm_textra_cg/cp_textra_asid

Sdtrig_mcontrol6_uncertain

Optional WARL field (hit/uncertain bits); not tested

Sdtrig_mcontrol6_uncertain_0

Optional WARL field (hit/uncertain bits); not tested

Sdtrig_mcontrol6_uncertain_1

Optional WARL field (hit/uncertain bits); not tested

Sdtrig_mcontrol6_vs

Hypervisor extension not implemented, so not testable

Sdtrig_mcontrol6_vu

Hypervisor extension not implemented, so not testable

Sdtrig_mcontrol6_hit0

Optional WARL field (hit/uncertain bits); not tested

Sdtrig_mcontrol6_hit0_unimplemented

Optional WARL field (hit/uncertain bits); not tested

Sdtrig_mcontrol6_hit0_1

Optional WARL field (hit/uncertain bits); not tested

Sdtrig_mcontrol6_hit0_2

Optional WARL field (hit/uncertain bits); not tested

Sdtrig_mcontrol6_hit0_3

Optional WARL field (hit/uncertain bits); not tested

Sdtrig_mcontrol6_hit0_multiple_accesses

Optional WARL field (hit/uncertain bits); not tested

Sdtrig_mcontrol6_select_address

SdtrigSm_mcontrol6_cg/cp_mcontrol6_execute_adr, SdtrigSm_mcontrol6_cg/cp_mcontrol6_load_store_adr

Sdtrig_mcontrol6_select_data

SdtrigSm_mcontrol6_cg/cp_mcontrol6_execute_data, SdtrigSm_mcontrol6_cg/cp_mcontrol6_load_store_data

Sdtrig_mcontrol6_size_any

SdtrigSm_mcontrol6_cg/cp_mcontrol6_execute_size, SdtrigSm_mcontrol6_cg/cp_mcontrol6_load_store_size

Sdtrig_mcontrol6_size_8bit

SdtrigSm_mcontrol6_cg/cp_mcontrol6_load_store_size, SdtrigSm_mcontrol6_cg/cp_mcontrol6_execute_size

Sdtrig_mcontrol6_size_16bit

SdtrigSm_mcontrol6_cg/cp_mcontrol6_execute_size, SdtrigSm_mcontrol6_cg/cp_mcontrol6_load_store_size

Sdtrig_mcontrol6_size_32bit

SdtrigSm_mcontrol6_cg/cp_mcontrol6_execute_size, SdtrigSm_mcontrol6_cg/cp_mcontrol6_load_store_size

Sdtrig_mcontrol6_size_48bit

SdtrigSm_mcontrol6_cg/cp_mcontrol6_execute_size

Sdtrig_mcontrol6_size_64bit

SdtrigSm_mcontrol6_cg/cp_mcontrol6_execute_size, SdtrigSm_mcontrol6_cg/cp_mcontrol6_load_store_size

Sdtrig_mcontrol6_size_128bit

SdtrigSm_mcontrol6_cg/cp_mcontrol6_execute_size, SdtrigSm_mcontrol6_cg/cp_mcontrol6_load_store_size

Sdtrig_mcontrol6_size_support

SdtrigSm_mcontrol6_cg/cp_mcontrol6_load_store_size

Sdtrig_mcontrol6_chain_disabled

SdtrigSm_mcontrol6_cg/cp_mcontrol6_chain_adr

Sdtrig_mcontrol6_chain_enabled

SdtrigSm_mcontrol6_cg/cp_mcontrol6_chain_adr

Sdtrig_mcontrol6_chain_start

SdtrigSm_mcontrol6_cg/cp_mcontrol6_chain_adr

Sdtrig_mcontrol6_chain_next

Requires Debug Mode writes; needs Sdext support

Sdtrig_mcontrol6_chain_ignore

Requires Debug Mode writes; needs Sdext support

Sdtrig_mcontrol6_match_equal

SdtrigSm_mcontrol6_cg/cp_mcontrol6_match

Sdtrig_mcontrol6_match_napot

SdtrigSm_mcontrol6_cg/cp_mcontrol6_match_napot

Sdtrig_mcontrol6_match_napot_mask

SdtrigSm_mcontrol6_cg/cp_mcontrol6_match_napot

Sdtrig_mcontrol6_match_napot_legal

SdtrigSm_mcontrol6_cg/cp_mcontrol6_match_napot

Sdtrig_mcontrol6_match_ge

SdtrigSm_mcontrol6_cg/cp_mcontrol6_match

Sdtrig_mcontrol6_match_lt

SdtrigSm_mcontrol6_cg/cp_mcontrol6_match

Sdtrig_mcontrol6_match_mask_low

SdtrigSm_mcontrol6_cg/cp_mcontrol6_match_mask

Sdtrig_mcontrol6_match_mask_high

SdtrigSm_mcontrol6_cg/cp_mcontrol6_match_mask

Sdtrig_mcontrol6_match_not_equal

SdtrigSm_mcontrol6_cg/cp_mcontrol6_match

Sdtrig_mcontrol6_match_not_napot

SdtrigSm_mcontrol6_cg/cp_mcontrol6_match_napot

Sdtrig_mcontrol6_match_not_mask_low

SdtrigSm_mcontrol6_cg/cp_mcontrol6_match_mask

Sdtrig_mcontrol6_match_not_mask_high

SdtrigSm_mcontrol6_cg/cp_mcontrol6_match_mask

Sdtrig_mcontrol6_match_rsv

Reserved encoding for future use; nothing to test

Sdtrig_mcontrol6_comparisons

XLEN-dependent behavior not tested; single XLEN assumed

Sdtrig_mcontrol6_m

SdtrigSm_mcontrol6_cg/cp_mcontrol6_priv_mode

Sdtrig_mcontrol6_uncertainen_disabled

Optional WARL field (hit/uncertain bits); not tested

Sdtrig_mcontrol6_uncertainen_enabled

Optional WARL field (hit/uncertain bits); not tested

Sdtrig_mcontrol6_s

SdtrigSm_mcontrol6_cg/cp_mcontrol6_priv_mode

Sdtrig_mcontrol6_u

SdtrigSm_mcontrol6_cg/cp_mcontrol6_priv_mode

Sdtrig_mcontrol6_execute

SdtrigSm_mcontrol6_cg/cp_mcontrol6_execute_adr, SdtrigSm_mcontrol6_cg/cp_mcontrol6_execute_data, SdtrigSm_mcontrol6_cg/cp_mcontrol6_load_store_adr, SdtrigSm_mcontrol6_cg/cp_mcontrol6_load_store_data

Sdtrig_mcontrol6_store

SdtrigSm_mcontrol6_cg/cp_mcontrol6_load_store_adr, SdtrigSm_mcontrol6_cg/cp_mcontrol6_load_store_data, SdtrigSm_mcontrol6_cg/cp_mcontrol6_execute_adr, SdtrigSm_mcontrol6_cg/cp_mcontrol6_execute_data

Sdtrig_mcontrol6_load

SdtrigSm_mcontrol6_cg/cp_mcontrol6_load_store_adr, SdtrigSm_mcontrol6_cg/cp_mcontrol6_load_store_data, SdtrigSm_mcontrol6_cg/cp_mcontrol6_execute_adr, SdtrigSm_mcontrol6_cg/cp_mcontrol6_execute_data

Sdtrig_icount

SdtrigSm_sdtrig_cg/cp_csr_access_common

Sdtrig_icount_reset

Descriptive spec text with no separately testable behavior

Sdtrig_icount_access

SdtrigSm_icount_cg/cp_icount_instr

Sdtrig_icount_match1

SdtrigSm_icount_cg/cp_icount_instr

Sdtrig_icount_match2

SdtrigSm_icount_cg/cp_icount_trap

Sdtrig_icount_multiple_match

SdtrigSm_icount_cg/cp_icount_trap

Sdtrig_icount_match_non_reexecuted

SdtrigSm_icount_cg/cp_icount_trap

Sdtrig_icount_all_traps_match

SdtrigSm_icount_cg/cp_icount_trap

Sdtrig_icount_match_gt1

SdtrigSm_icount_cg/cp_icount_instr

Sdtrig_icount_match_eq1

SdtrigSm_icount_cg/cp_icount_hardwired

Sdtrig_icount_exception

WARL write-any-read-legal behavior not separately tested

Sdtrig_icount_count_zero

SdtrigSm_icount_cg/cp_icount_eq0

Sdtrig_icount_pending

SdtrigSm_icount_cg/cp_icount_instr

Sdtrig_icount_action0

SdtrigSm_icount_cg/cp_icount_instr

Sdtrig_icount_case

Descriptive spec text with no separately testable behavior

Sdtrig_icount_textra

SdtrigSm_textra_cg/cp_textra_mcontext, SdtrigSm_textra_cg/cp_textra_scontext

Sdtrig_icount_vs

Hypervisor extension not implemented, so not testable

Sdtrig_icount_vu

Hypervisor extension not implemented, so not testable

Sdtrig_icount_hit

Optional WARL field (hit/uncertain bits); not tested

Sdtrig_icount_m

SdtrigSm_icount_cg/cp_icount_instr

Sdtrig_icount_pending_set

SdtrigSm_icount_cg/cp_icount_instr

Sdtrig_icount_s

SdtrigSm_icount_cg/cp_icount_instr

Sdtrig_icount_u

SdtrigSm_icount_cg/cp_icount_instr

Sdtrig_itrigger

SdtrigSm_sdtrig_cg/cp_csr_access_common

Sdtrig_itrigger_reset

Descriptive spec text with no separately testable behavior

Sdtrig_itrigger_access

SdtrigSm_itrigger_cg/cp_itrigger

Sdtrig_itrigger_fire

SdtrigSm_itrigger_cg/cp_itrigger

Sdtrig_itrigger_enable_num

SdtrigSm_itrigger_cg/cp_itrigger

Sdtrig_itrigger_enable_nmi

Non-maskable interrupts not defined by the specifications

Sdtrig_itrigger_xlen32

XLEN-dependent behavior not tested; single XLEN assumed

Sdtrig_itrigger_timing

SdtrigSm_itrigger_cg/cp_itrigger

Sdtrig_itrigger_action0

SdtrigSm_itrigger_cg/cp_itrigger

Sdtrig_itrigger_textra

SdtrigSm_textra_cg/cp_textra_mcontext, SdtrigSm_textra_cg/cp_textra_scontext, SdtrigSm_textra_cg/cp_textra_asid

Sdtrig_itrigger_hit

Optional WARL field (hit/uncertain bits); not tested

Sdtrig_itrigger_vs

Hypervisor extension not implemented, so not testable

Sdtrig_itrigger_vu

Hypervisor extension not implemented, so not testable

Sdtrig_itrigger_nmi

Non-maskable interrupts not defined by the specifications

Sdtrig_itrigger_m

SdtrigSm_itrigger_cg/cp_itrigger

Sdtrig_itrigger_s

SdtrigSm_itrigger_cg/cp_itrigger

Sdtrig_itrigger_u

SdtrigSm_itrigger_cg/cp_itrigger

Sdtrig_etrigger

SdtrigSm_sdtrig_cg/cp_csr_access_common

Sdtrig_etrigger_reset

Descriptive spec text with no separately testable behavior

Sdtrig_etrigger_access

SdtrigSm_etrigger_cg/cp_etrigger

Sdtrig_etrigger_fire

Descriptive spec text with no separately testable behavior

Sdtrig_etrigger_config

SdtrigSm_etrigger_cg/cp_etrigger

Sdtrig_etrigger_xlen32

XLEN-dependent behavior not tested; single XLEN assumed

Sdtrig_etrigger_timing

SdtrigSm_etrigger_cg/cp_etrigger

Sdtrig_etrigger_action0

SdtrigSm_etrigger_cg/cp_etrigger

Sdtrig_etrigger_textra

SdtrigSm_textra_cg/cp_textra_mcontext, SdtrigSm_textra_cg/cp_textra_scontext, SdtrigSm_textra_cg/cp_textra_asid

Sdtrig_etrigger_hit

Optional WARL field (hit/uncertain bits); not tested

Sdtrig_etrigger_vs

Hypervisor extension not implemented, so not testable

Sdtrig_etrigger_vu

Hypervisor extension not implemented, so not testable

Sdtrig_etrigger_m

SdtrigSm_etrigger_cg/cp_etrigger

Sdtrig_etrigger_s

SdtrigSm_etrigger_cg/cp_etrigger

Sdtrig_etrigger_u

SdtrigSm_etrigger_cg/cp_etrigger

Sdtrig_tmexttrigger

External trigger inputs are implementation-specific and unspecified

Sdtrig_tmexttrigger_reset

External trigger inputs are implementation-specific and unspecified

Sdtrig_tmexttrigger_access

External trigger inputs are implementation-specific and unspecified

Sdtrig_tmexttrigger_fire

External trigger inputs are implementation-specific and unspecified

Sdtrig_tmexttrigger_inputs

External trigger inputs are implementation-specific and unspecified

Sdtrig_tmexttrigger_subset

External trigger inputs are implementation-specific and unspecified

Sdtrig_tmexttrigger_unsupported

External trigger inputs are implementation-specific and unspecified

Sdtrig_tmexttrigger_action0

External trigger inputs are implementation-specific and unspecified

Sdtrig_tmexttrigger_async

External trigger inputs are implementation-specific and unspecified

Sdtrig_tmexttrigger_prevented

External trigger inputs are implementation-specific and unspecified

Sdtrig_tmexttrigger_pending

External trigger inputs are implementation-specific and unspecified

Sdtrig_tmexttrigger_hit

External trigger inputs are implementation-specific and unspecified

Sdtrig_tmexttrigger_intctl

External trigger inputs are implementation-specific and unspecified

Sdtrig_tmexttrigger_select

External trigger inputs are implementation-specific and unspecified

Sdtrig_textra32

SdtrigSm_sdtrig_cg/cp_csr_access_common

Sdtrig_textra32_reset

Descriptive spec text with no separately testable behavior

Sdtrig_textra32_access

SdtrigSm_textra_cg/cp_textra_mcontext, SdtrigSm_textra_cg/cp_textra_scontext, SdtrigSm_textra_cg/cp_textra_asid

Sdtrig_textra32_dxlen64

Descriptive spec text with no separately testable behavior

Sdtrig_textra32_byte_granular

Descriptive spec text with no separately testable behavior

Sdtrig_textra32_byte_mask_applies

SdtrigSm_textra_cg/cp_textra_scontext

Sdtrig_textra32_filter_modes

SdtrigSm_textra_cg/cp_textra_mcontext_smode, SdtrigSm_textra_cg/cp_textra_scontext_smode

Sdtrig_textra32_mhselect_ignore

SdtrigSm_textra_cg/cp_textra_mcontext

Sdtrig_textra32_mhselect_mcontext

SdtrigSm_textra_cg/cp_textra_mcontext, SdtrigSm_textra_cg/cp_textra_double_context

Sdtrig_textra32_mhselect_mctx_sel

Hypervisor extension not implemented, so not testable

Sdtrig_textra32_mhselect_vmid_sel

Hypervisor extension not implemented, so not testable

Sdtrig_textra32_mhselect_rsv

Reserved encoding for future use; nothing to test

Sdtrig_textra32_mhselect_no_h

SdtrigSm_textra_cg/cp_textra_mcontext

Sdtrig_textra32_sbytemask

SdtrigSm_textra_cg/cp_textra_mcontext

Sdtrig_textra32_svalue_no_s

SdtrigSm_textra_cg/cp_smode_fields_hardwired

Sdtrig_textra32_sselect_ignore

SdtrigSm_textra_cg/cp_textra_scontext

Sdtrig_textra32_sselect_scontext

SdtrigSm_textra_cg/cp_textra_scontext, SdtrigSm_textra_cg/cp_textra_double_context

Sdtrig_textra32_sselect_asid1

SdtrigSm_textra_cg/cp_textra_asid

Sdtrig_textra32_sselect_asid2

SdtrigSm_textra_cg/cp_textra_asid

Sdtrig_textra32_sselect_asid3

SdtrigSm_textra_cg/cp_textra_asid

Sdtrig_textra32_sselect_no_s

SdtrigSm_textra_cg/cp_smode_fields_hardwired

Sdtrig_textra64

SdtrigSm_sdtrig_cg/cp_csr_access_common

Sdtrig_textra64_reset

Descriptive spec text with no separately testable behavior

Sdtrig_textra64_access

SdtrigSm_textra_cg/cp_textra_mcontext, SdtrigSm_textra_cg/cp_textra_scontext

Sdtrig_textra64_retain

XLEN-dependent behavior not tested; single XLEN assumed

Sdtrig_textra64_xlen32

XLEN-dependent behavior not tested; single XLEN assumed

Sdtrig_textra64_byte_granular

SdtrigSm_textra_cg/cp_textra_scontext

Sdtrig_textra64_byte_mask_applies

SdtrigSm_textra_cg/cp_textra_scontext

Sdtrig_textra64_sbytemask

SdtrigSm_textra_cg/cp_textra_scontext

UDB Parameters: None.

As of 7/24/26, Sdtrig is partially implemented. Only the mcontrol6 covergroup is fully developed. Coverpoints are incomplete and are in a draft PR. Sail does not yet support Sdtrig, so the tests are exercised by running whisper against spike. QEMU and Imperas do not yet match spike and some issues have been filed and are tracked here. Run with make whisper-rv64-max-spike-ref EXTENSIONS=SdtrigSm.

An initial set of parameters for Sdtrig is proposed for UDB.

Most Sdtrig features are optional, so defining what to test requires many parameters. UDB_SDTRIG_NUM_TRIGGERS define how many triggers exist. For each trigger, each type (mcontrol6, icount, itrigger, etrigger) is optionally supported. Many of the fields in tdata1 for each type are optional.

uncertainen and uncertain are vague and implementation-specific and is thus not tested. hit varies based on timing and is optional and difficult to check so is presently not tested. Only action=0 is tested because the others depend on Sdext or trace or implementation-specific external triggers. dmode is not tested in Sdtrig because it depends on Sdext. hcontext is not tested because it depends on Hypervisor. Non-maskable interrupts are not tested because they are not part of RVA23.

mcontrol has been replaced by mcontrol6. It is deprecated and not tested. mscontext is only for backward compatibility with Sdtrig 0.13 and is not tested.

SdtrigS

Unless otherwise specified, run tests in S-Mode, with tdata1.s = 1 mideleg.breakpoint = 1 Unless otherwise specified, use SBI Calls to access trigger CSRs All other assumptions are inherited from SdtrigSm Perform all tests defined in SdtrigSm Expectations provided below differ from those in SdtrigSm Note: cp_csr_access_common will trap on privileged registers.

SdtrigU

Unless otherwise specified, run tests in U-Mode, with tdata1.u = 1 mideleg.breakpoint = 1 Unless otherwise specified, use SBI Calls to access trigger CSRs All other assumptions are inherited from SdtrigSm Perform all tests defined in SdtrigSm Expectations provided below differ from those in SdtrigSm Note: cp_csr_access_common will trap on privileged registers.

B.12. Miscellaneous Non-RV23 Privileged Extensions

B.12.1. Sm1p13 Machine Mode 1.13

Table 352. Sm1p13 Coverpoints
Coverpoint Goal Feature Description Expectation Bins Notes

cp_medelegh

RV32 only:
Write all 1s to medelegh and read back.

Match ref model

1

Sm_mcsr_cg/cp_mcsr_access

cp_mxlen_ro

misa.MXL is read only

Write all U,S,M values of misa.MXL and read back

Read back M-mode

3

Note : Already covered in cp_misa_mxl
Sm_mcsr_cg/cp_misa_mxl

cp_misa_b
cp_misa_v

misa.B and misa.V are correct

read, set, and clear, readback misa.B and misa.V

5

Sm_mcsr_cg/{cp_misa_b, cp_misa.v}

cp_mcause

mcause accepts sofware-check and hardware error

Write mcause = 18, 19, read back

Match ref model

2

Note : Already covered in cp_mcause_write_exception/
Sm_mcause_cg/cp_mcause_write_exception

cp_msip

msip write is reflected in mip.MSIP

Write {all 1s, all 0s} to memory-mapped msip register if it exists. Read back. Wait and then read mip.MSIP.
RVMODEL_MSIP_ADDRESS is undefined if msip does not exist (such as when mip.MSIP is read-only zero).

Match ref model

2

Sm_mcsr_cg/cp_msip

Notes:

NOTE : It’s tests and coverage files are under the S.py and S_coverage.svh respectvely with the guard of `ifdef SM1P13_SUPPORTED

LCOFI tested in Sscofpmf test plan

VS-mode counter overflow tested in Shlcofideleg

Hints with MXLEN > XLEN not tested

Hardware errors tested with Smrnmi

Software-check exceptions tested with Zicfilp and Zicfiss

hedelegh tested with hypervisor

cp_misaligned_atomicity_granule_pma is tested with Zama16b

Table 353. Sm1p13 Normative Rules
Normative Rule Rule Text Coverpoints

medelegh_sz_acc_enc_xlen32

When XLEN=32, medelegh is a 32-bit read/write register that aliases bits 63:32 of medeleg.

Sm_mcsr_cg/cp_mcsr_access/medelegh

misa_mxl_op_isa

The MXL (Machine XLEN) field encodes the native base integer ISA width as shown in norm:misa_mxl_enc.

Sm_mcsr_cg/cp_misa_mxl

misa_mxl_op_nz

If misa is nonzero, the MXL field indicates the effective XLEN in M-mode, a constant termed MXLEN.

Sm_mcsr_cg/cp_misa_mxl

xlen_le_mxlen

XLEN is never greater than MXLEN, but XLEN might be smaller than MXLEN in less-privileged modes.

Sm_mcsr_cg/cp_misa_mxl

misa_mxl_acc

The MXL field is read-only.

Sm_mcsr_cg/cp_misa_mxl

misa_mxl_enc

MXL|XLEN === 1|32¶2|64¶3|Reserved ===

Sm_mcsr_cg/cp_misa_mxl

misa_extensions_enc_txt

The Extensions field encodes the presence of the standard extensions, with a single bit per letter of the alphabet (bit 0 encodes presence of extension A, bit 1 encodes presence of extension B, through to bit 25 which encodes Z).

Sm_mcsr_cg/{cp_misa_b, cp_misa_v}

misa_extensions_enc_tbl

Bit|Character|Description === 0|`A`|Atomic extension¶1|`B`|B extension¶2|`C`|Compressed extension¶3|`D`|Double-precision floating-point extension¶4|`E`|RV32E/64E base ISA¶5|`F`|Single-precision floating-point extension¶6|`G`|Reserved¶7|`H`|Hypervisor extension¶8|`I`|RV32I/64I base ISA¶9|`J`|Reserved¶10|`K`|Reserved¶11|`L`|Reserved¶12|`M`|Integer Multiply/Divide extension¶13|`N`|Tentatively reserved for User-Level Interrupts extension¶14|`O`|Reserved¶15|`P`|Tentatively reserved for Packed-SIMD extension¶16|`Q`|Quad-precision floating-point extension¶17|`R`|Reserved¶18|`S`|Supervisor mode implemented¶19|`T`|Reserved¶20|`U`|User mode implemented¶21|`V`|Vector extension¶22|`W`|Reserved¶23|`X`|Non-standard extensions implemented¶24|`Y`|Reserved¶25|`Z`|Reserved ===

Sm_mcsr_cg/{cp_misa_b, cp_misa_v}

misa_extensions_warl_op

The Extensions field is a WARL field that can contain writable bits where the implementation allows the supported ISA to be modified.

Sm_mcsr_cg/{cp_misa_b, cp_misa_v}

mcause_exccode_enc_img

Interrupt|Exception Code|Description === 1 1 1 1|0 1 2 3|Reserved Supervisor software interrupt Reserved Machine software interrupt¶1 1 1 1|4 5 6 7|Reserved Supervisor timer interrupt Reserved Machine timer interrupt¶1 1 1 1|8 9 10 11|Reserved Supervisor external interrupt Reserved Machine external interrupt¶1 1 1 1|12 13 14-15 ≥16|Reserved Counter-overflow interrupt Reserved Designated for platform use¶0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0|0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20-23 24-31 32-47 48-63 ≥64|Instruction address misaligned Instruction access fault Illegal instruction Breakpoint Load address misaligned Load access fault Store/AMO address misaligned Store/AMO access fault Environment call from U-mode Environment call from S-mode Reserved Environment call from M-mode Instruction page fault Load page fault Reserved Store/AMO page fault Double trap Reserved Software check Hardware error Reserved Designated for custom use Reserved Designated for custom use Reserved ===

Sm_mcause_cg/cp_mcause_write_exception

msip_sz_acc

A hart’s memory-mapped msip register is a 32-bit read/write register

Sm_mcsr_cg/cp_msip

msip_enc

bits 31&#8205;&#8211;&#8205;1 read as zero and bit 0 contains the MSIP bit.

Sm_mcsr_cg/cp_msip

mip_msip_rdonly

MSIP is read-only in mip, and is written by accesses to memory-mapped control registers, which are used to provide machine-level interprocessor interrupts.

Sm_mcsr_cg/cp_msip

msip_update_max_time

When the memory-mapped msip register changes, it is guaranteed to be reflected in mip.⁠MSIP eventually, but not necessarily immediately.

Sm_mcsr_cg/cp_msip

UDB Parameters: None.

B.12.2. Smstateen Machine State Enable

Table 354. Smstateen Coverpoints
Coverpoint Goal Feature Description Expectation Bins Normative Rule

cp_mstateen_reset_val

On reset all mstateen CSRs' bits are initialized to zeros.

As first test after reset, read mstateen0-3. For RV32, also read msstateen0-3h

0

4-8 CSRs

mstateen_zero_initialization

cp_walking_ones

Bits are accessible

Write mstateen0-3 with walking ones & walking zero, and read each back.
For RV32, also write msstateen0-3h.

Access successful

4-8 CSRs * 128-64 walking ones/zero

mstateen_rv64_csrs
sstateen_rv64_csrs
stateen_rv32_upper_bits_csrs
mstateen_bit_correspondence
stateen_warl_access
stateen_unimplemented_state_roz
stateen_reserved_roz
sstateen_ro1_bits
mstateen_bit_63_op
mstateen_bit_63_roz
mstateen0_enc_img
Ssqosid_Smstateen_srmcfg_requires_mstateen0

cp_csr_illegal_accesses

Each stateen CSR allows read/write access from its own and higher privilege modes and denies read/writeaccess from lower privilege modes

In Umode, write mstateen0-3 with all ones, and read it back.
For RV32, also write msstateen0-3h

Illegal instruction

4-8CSRs

stateen_op
stateen_illegal_state_access

cp_fcsr_ro_zero

Test if fcsr bit is read-only zero when misa.F=1

Write 1 to mstateen0.FCSR and read back

Expect 0 if misa.F = 1

1

mstateen0_fcsr_roz

cp_fcsr

fcsr controls access to fcsr when misa.F = 0

If Zfinx is supported:
with misa.F = 0 and mstateen0.fcsr, read and write fcsr

stateen0_fcsr_op

cp_jvt_access

jvt controls access

If Zcmt is supported:
With msstaten0.JVT = {0,1}, read and write jvt from the M, S if supported, else U

Always successful

stateen0_jvt_op

cp_envcfg

envcfg controls access to senvcfg

With mstateen0.envcfg = {0,1}, read and write sevncfg from M, S if supported, else U

Always successful

2 states x 2 accesses

mstateen0_envcfg_op

cp_csrind

csrind controls access

If Sscsrind supported:
With mstateen0.CSRIND = {0, 1}, read and write siselect. And with siselect having some value TBD, write and read sireg,
sireg2, sireg3, sireg4, sireg5, sireg6. M, S if supported, else U

Always successful

2 states x 2 accesses x 6 regs

mstateen0_csrind_op

cp_aia

aia controls access

If Ssaia supported:
With msstateen.AIA = {0,1}, read and write all state introduced by Ssaia. M, S if supported, else U

Always successful

2 states x 2 accesses x ? regs

mstateen0_aia_op

cp_imsic

ismic controls access

If IMSIC supported:
With msstateen.IMSIC = {0,1}, read and write all state introduced by IMSIC (stopei?). M, S if supported, else U

Always successful

2 states x 2 accesses x ? regs

mstateen0_imsic_op

cp_context

sdtrig controls access

If Sdtrig supported:
With msstateen.CONTEXT = {0,1}, read and write scontext form M, S if supported, else U

Always successful

2 states x 2 accesses

mstateen0_context_op

cp_p1p13

hedelegh controls access

If Sm1p13 and Hypervisor supported:
With msstateen.P1P13 = {0,1}, read and write hedelegh

Always successful

2 states x 2 accesses

mstateen0_p1p13_op

cp_srmcfg

srmcfg controls access

If Ssqosid supported:
With msstateen.SRMCFG = {0,1}, read and write srmcfg from M, S if supported, else U

Always successful

2 states x 2 accesses

mstateen0_srmcfg_op
Ssqosid_Smstateen_srmcfg_requires_mstateen0
Ssqosid_srmcfg_access_illegal_instruction

cp_ctr

ctr controls access

If Sctr supported:
With msstateen.CTR = {0,1}, read and write sctrl, sctrdepth, sctrstatus from M, S if supported, else U

Always successful

2 states x 2 accesses x 3 regs

mstateen_ctr1
mstateen_ctr0

cp_fcsr_lower

fcsr controls access to fcsr when misa.F = 0

If Zfinx is supported:
with misa.F = 0 and mstateen0.fcsr, read and write fcsr, frm, fflags from the next lower mode (S if supported, else U).
Also try executing fadd.s, flw, fcvt.w.s, fcvt.s.w, fmv.x.w, fmv.w.x, fclass.s. M, S if supported, else U

Illegal instruction if 0, else successful

stateen0_fcsr_op
stateen0_fcsr0_misa_f0_illegal_fpu_instr

cp_mstateen0_se0_controls_sstateen0

mstateen.SE0 controls access to sstateen0

For mstateen0.SE0 = {0,1} write and read back sstateen0.

Access fault if 0, success if 1.

2 SE0*2R/W

mstateen0_se0_op
mstateen_bit_63_op

Note: All of these tests are performed in M-mode unless otherwise noted.

Note: Smstateen implies U-mode (otherwise there is no need for this extension)

Table 355. Smstateen Normative Rules
Normative Rule Rule Text Coverpoints

mstateen_rv64_csrs

For RV64 harts, this extension adds four new 64-bit CSRs at machine level: mstateen0 (Machine State Enable 0), mstateen1, mstateen2, and mstateen3.

{Smstateen_cg,Ssstateen_cg}/{cp_walking_ones}

sstateen_rv64_csrs

If supervisor mode is implemented, another four CSRs are defined at supervisor level: sstateen0, sstateen1, sstateen2, and sstateen3.

{Smstateen_cg,Ssstateen_cg}/{cp_walking_ones}

hstateen_rv64_csrs

And if the hypervisor extension is implemented, another set of CSRs is added: hstateen0, hstateen1, hstateen2, and hstateen3.

stateen_rv32_upper_bits_csrs

For RV32, there are CSR addresses for accessing the upper 32 bits of corresponding machine-level and hypervisor CSRs: mstateen0h, mstateen1h, mstateen2h, mstateen3h, hstateen0h, hstateen1h, hstateen2h, and hstateen3h.

{Smstateen_cg,Ssstateen_cg}/{cp_walking_ones}

stateen_op

The stateen registers at each level control access to state at all less-privileged levels, but not at its own level.

{Smstateen_cg,Ssstateen_cg}/{cp_csr_illegal_accesses}

stateen_illegal_state_access

Just as with the counteren CSRs, when a stateen CSR prevents access to state by less-privileged levels, an attempt in one of those privilege modes to execute an instruction that would read or write the protected state raises an illegal-instruction exception, or, if executing in VS or VU mode and the circumstances for a virtual-instruction exception apply, raises a virtual-instruction exception instead of an illegal-instruction exception.

{Smstateen_cg,Ssstateen_cg}/{cp_csr_illegal_accesses}

stateen_implicit_state_update

When a stateen CSR prevents access to state for a privilege mode, attempting to execute in that privilege mode an instruction that implicitly updates the state without reading it may or may not raise an illegal-instruction or virtual-instruction exception.

Not tested: either behavior is permitted

sstateen_user_access_control

Each bit of a supervisor-level sstateen CSR controls user-level access (from U-mode or VU-mode) to an extension’s state.

Ssstateen_cg/{cp_jvt, cp_fcsr_lower}

mstateen_bit_correspondence

For every bit with a defined purpose in an sstateen CSR, the same bit is defined in the matching mstateen CSR to control access below machine level to the same state.

{Smstateen_cg,Ssstateen_cg}/{cp_walking_ones}

hstateen_encoding

With the hypervisor extension, the hstateen CSRs have identical encodings to the mstateen CSRs, except controlling accesses for a virtual machine (from VS and VU modes).

stateen_warl_access

Each standard-defined bit of a stateen CSR is WARL and may be read-only zero or one, subject to the following conditions.

{Smstateen_cg,Ssstateen_cg}/{cp_walking_ones}

stateen_unimplemented_state_roz

Bits in any stateen CSR that are defined to control state that a hart doesn’t implement are read-only zeros for that hart.

{Smstateen_cg,Ssstateen_cg}/{cp_walking_ones}

stateen_reserved_roz

Likewise, all reserved bits not yet given a defined meaning are also read-only zeros.

{Smstateen_cg,Ssstateen_cg}/{cp_walking_ones}

mstateen_lower_priv_roz

For every bit in an mstateen CSR that is zero (whether read-only zero or set to zero), the same bit appears as read-only zero in the matching hstateen and sstateen CSRs.

TODO: clear an mstateen0 bit (e.g. FCSR or JVT) and check that the matching sstateen0 bit reads zero

sstateen_vsmode_access_roz

For every bit in an hstateen CSR that is zero (whether read-only zero or set to zero), the same bit appears as read-only zero in sstateen when accessed in VS-mode.

sstateen_ro1_bits

A bit in a supervisor-level sstateen CSR cannot be read-only one unless the same bit is read-only one in the matching mstateen CSR and, if it exists, in the matching hstateen CSR.

{Smstateen_cg,Ssstateen_cg}/{cp_walking_ones}

hstateen_ro1_bits

A bit in an hstateen CSR cannot be read-only one unless the same bit is read-only one in the matching mstateen CSR.

mstateen_zero_initialization

On reset, all writable mstateen bits are initialized by the hardware to zeros.

TODO: record the writable mstateen bits before the boot code writes them

mstateen_bit_63_op

For each mstateen CSR, bit 63 is defined to control access to the matching sstateen and hstateen CSRs.

{Smstateen_cg,Ssstateen_cg}/{cp_walking_ones}

hstateen_bit_63_op

Likewise, bit 63 of each hstateen correspondingly controls access to the matching sstateen CSR.

mstateen_bit_63_roz

Bit 63 of each mstateen CSR may be read-only zero only if the hypervisor extension is not implemented and the matching supervisor-level sstateen CSR is all read-only zeros.

{Smstateen_cg,Ssstateen_cg}/{cp_walking_ones}

hstateen_bit_63_writable

Bit 63 of each hstateen CSR is always writable (not read-only).

mstateen0_enc_img

Smstateen_cg/cp_walking_ones

hstateen0_enc_img

TODO: walk hstateen0 in hypervisor tests

sstateen0_enc_img

Ssstateen_cg/cp_walking_ones

stateen0_c_op

The C bit controls access to any and all custom state.

Not tested: custom state is non-standard and not certified

stateen0_fcsr_op

The FCSR bit controls access to fcsr for the case when floating-point instructions operate on x registers instead of f registers as specified by the Zfinx and related extensions (Zdinx, etc.).

Smstateen_cg/{cp_fcsr, cp_fcsr_lower}, Ssstateen_cg/cp_fcsr_lower

mstateen0_fcsr_roz

Whenever misa.F = 1, FCSR bit of mstateen0 is read-only zero (and hence read-only zero in hstateen0 and sstateen0 too).

Smstateen_cg/cp_fcsr_ro_zero

stateen0_fcsr0_misa_f0_illegal_fpu_instr

For convenience, when the stateen CSRs are implemented and misa.F = 0, then if the FCSR bit of a controlling stateen0 CSR is zero, all floating-point instructions cause an illegal-instruction exception (or virtual-instruction exception, if relevant), as though they all access fcsr, regardless of whether they really do.

{Smstateen_cg,Ssstateen_cg}/{cp_fcsr_lower}

stateen0_jvt_op

The JVT bit controls access to the jvt CSR provided by the Zcmt extension.

Smstateen_cg/cp_jvt_access, Ssstateen_cg/cp_jvt

mstateen0_se0_op

The SE0 bit in mstateen0 controls access to the hstateen0, hstateen0h, and the sstateen0 CSRs.

Smstateen_cg/cp_mstateen0_se0_controls_sstateen0

hstateen0_se0_op

The SE0 bit in hstateen0 controls access to the sstateen0 CSR.

mstateen0_envcfg_op

The ENVCFG bit in mstateen0 controls access to the henvcfg, henvcfgh, and the senvcfg CSRs.

Smstateen_cg/cp_envcfg

hstateen0_envcfg_op

The ENVCFG bit in hstateen0 controls access to the senvcfg CSRs.

mstateen0_csrind_op

The CSRIND bit in mstateen0 controls access to the siselect, sireg*, vsiselect, and the vsireg* CSRs provided by the Sscsrind extensions.

TODO: mstateen0.CSRIND gating of siselect, sireg*, vsiselect, and vsireg*

hstateen0_csrind_op

The CSRIND bit in hstateen0 controls access to the siselect and the sireg*, (really vsiselect and vsireg*) CSRs provided by the Sscsrind extensions.

mstateen0_imsic_op

The IMSIC bit in mstateen0 controls access to the IMSIC state, including CSRs stopei and vstopei, provided by the Ssaia extension.

Smstateen_cg/cp_imsic

hstateen0_imsic_op

The IMSIC bit in hstateen0 controls access to the guest IMSIC state, including CSRs stopei (really vstopei), provided by the Ssaia extension.

mstateen0_aia_op

The AIA bit in mstateen0 controls access to all state introduced by the Ssaia extension and not controlled by either the CSRIND or the IMSIC bits.

Smstateen_cg/cp_aia

hstateen0_aia_op

The AIA bit in hstateen0 controls access to all state introduced by the Ssaia extension and not controlled by either the CSRIND or the IMSIC bits of hstateen0.

mstateen0_context_op

The CONTEXT bit in mstateen0 controls access to the scontext and hcontext CSRs provided by the Sdtrig extension.

Smstateen_cg/cp_context

hstateen0_context_op

The CONTEXT bit in hstateen0 controls access to the scontext CSR provided by the Sdtrig extension.

mstateen0_p1p13_op

The P1P13 bit in mstateen0 controls access to the hedelegh introduced by Privileged Specification Version 1.13.

Smstateen_cg/cp_p1p13

mstateen0_srmcfg_op

The SRMCFG bit in mstateen0 controls access to the srmcfg CSR introduced by the Ssqosid extension.

Smstateen_cg/cp_srmcfg

mstateen_ctr1

When mstateen0.CTR=1, accesses to CTR register state behave as described in CSRs and Entry Registers above, while SCTRCLR behaves as described in Supervisor CTR Clear Instruction.

Smstateen_cg/cp_ctr

mstateen_ctr0

When mstateen0.CTR=0 and the privilege mode is less privileged than M-mode, the following operations raise an illegal-instruction exception:

Smstateen_cg/cp_ctr

UDB Parameters: None.

B.12.3. Smcsrind Machine-Mode Indirect CSR Access

Smcsrind Coverpoints

No test plan yet.

Table 356. Smcsrind Normative Rules
Normative Rule Rule Text Coverpoints

miselect_op

The value of miselect determines which register is accessed upon read or write of each of the machine indirect alias CSRs (mireg*).

miselect_value_range

miselect value ranges are allocated to dependent extensions, which specify the register state accessible via each miregi register, for each miselect value.

miselect_warl

miselect is a WARL register.

miselect_min_sz

The miselect register implements at least enough bits to support all implemented miselect values (corresponding to the implemented extensions that utilize miselect/mireg* to indirectly access register state).

miselect_msb_op

Values of miselect with the most-significant bit set (bit XLEN - 1 = 1) are designated only for custom use, presumably for accessing custom registers through the alias CSRs. Values of miselect with the most-significant bit clear are designated only for standard use and are reserved until allocated to a standard architecture extension. If XLEN is changed, the most-significant bit of miselect moves to the new position, retaining its value from before.

mireg_access_on_legal_miselect

Attempts to access mireg* while miselect holds a number in an allocated and implemented range results in a specific behavior that, for each combination of miselect and miregi, is defined by the extension to which the miselect value is allocated.

siselect_min_range

The siselect register will support the value range 0..0xFFF at a minimum.

siselect_msb_op

Values of siselect with the most-significant bit set (bit XLEN - 1 = 1) are designated only for custom use, presumably for accessing custom registers through the alias CSRs. Values of siselect with the most-significant bit clear are designated only for standard use and are reserved until allocated to a standard architecture extension. If XLEN is changed, the most-significant bit of siselect moves to the new position, retaining its value from before.

sireg_access_on_illegal_siselect

The behavior upon accessing sireg* from M-mode or S-mode, while siselect holds a value that is not implemented at supervisor level, is UNSPECIFIED.

sireg_access_on_legal_siselect

Otherwise, attempts to access sireg* from M-mode or S-mode while siselect holds a number in a standard-defined and implemented range result in specific behavior that, for each combination of siselect and siregi, is defined by the extension to which the siselect value is allocated.

Sscsrind_smode_csrs_sz

Note that the widths of siselect and sireg* are always the current XLEN rather than SXLEN. Hence, for example, if MXLEN = 64 and SXLEN = 32, then these registers are 64 bits when the current privilege mode is M (running RV64 code) but 32 bits when the privilege mode is S (RV32 code).

vsiselect_min_range

The vsiselect register will support the value range 0..0xFFF at a minimum.

vsiselect_msb_op

Values of vsiselect with the most-significant bit set (bit XLEN - 1 = 1) are designated only for custom use, presumably for accessing custom registers through the alias CSRs. Values of vsiselect with the most-significant bit clear are designated only for standard use and are reserved until allocated to a standard architecture extension. If XLEN is changed, the most-significant bit of vsiselect moves to the new position, retaining its value from before.

Sscsrind_virtual_inst_fault

A virtual-instruction exception is raised for attempts from VS-mode or VU-mode to directly access vsiselect or vsireg*, or attempts from VU-mode to access siselect or sireg*.

vsireg_access_on_legal_vsiselect

Otherwise, while vsiselect holds a number in a standard-defined and implemented range, attempts to access vsireg* from a sufficiently privileged mode, or to access sireg* (really vsireg*) from VS-mode, result in specific behavior that, for each combination of vsiselect and vsiregi, is defined by the extension to which the vsiselect value is allocated.

Sscsrind_vsmode_csrs_sz

Like siselect and sireg*, the widths of vsiselect and vsireg* are always the current XLEN rather than VSXLEN. Hence, for example, if HSXLEN = 64 and VSXLEN = 32, then these registers are 64 bits when accessed by a hypervisor in HS-mode (running RV64 code) but 32 bits for a guest OS in VS-mode (RV32 code).

Sscsrind_csrs_access_control

If extension Smstateen is implemented together with Smcsrind, bit 60 of state-enable register mstateen0 controls access to siselect, sireg*, vsiselect, and vsireg*. When mstateen0[60]=0, an attempt to access one of these CSRs from a privilege mode less privileged than M-mode results in an illegal-instruction exception.

hypervisor_impl_csrs_access_control

If the hypervisor extension is implemented, the same bit is defined also in hypervisor CSR hstateen0, but controls access to only siselect and sireg* (really vsiselect and vsireg*), which is the state potentially accessible to a virtual machine executing in VS or VU-mode. When hstateen0[60]=0 and mstateen0[60]=1, all attempts from VS or VU-mode to access siselect or sireg* raise a virtual-instruction exception, not an illegal-instruction exception, regardless of the value of vsiselect or any other mstateen bit.

UDB Parameters: None.

B.12.4. Sscsrind Supervisor-Mode Indirect CSR Access

B.12.5. Smepmp Enhanced PMP

B.12.6. Smrnmi Machine-Mode Resumable Non-Maskable Interrupts

Smrnmi Coverpoints

No test plan yet.

Table 357. Smrnmi Normative Rules
Normative Rule Rule Text Coverpoints

mstatus_mdt_clr_mnret

When the Smdbltrp extension is implemented, the MNRET instruction, provided by the Smrnmi extension, sets the MDT bit to 0 if the new privilege mode is not M.

sstatus_sdt_clr_mnret

If the Ssdbltrp extension is also implemented, and the new privilege mode is U, VS, or VU, then sstatus.⁠SDT is also set to 0.

vsstatus_sdt_clr_mnret

Additionally, if it is VU, then vsstatus.⁠SDT is also set to 0.

TODO: MNRET to VU-mode with Smdbltrp, Ssdbltrp, and H

trap_unexp_rnmi

When the Smrnmi extension is implemented, a trap caused by an RNMI is not considered an unexpected trap irrespective of the state of the MDT bit.

trap_unexp_mnstatus_nmie_0

a trap that occurs when executing in M-mode with mnstatus.⁠NMIE set to 0 is an unexpected trap.

trap_unexp_hndl_lead_in

In the event of a unexpected trap, the handling is as follows:

trap_unexp_hndl_rnmi

When the Smrnmi extension is implemented and mnstatus.⁠NMIE is 1, the hart traps to the RNMI interrupt trap handler. To deliver this trap, the mnepc and mncause registers are written with the values that the unexpected trap would have written to the mepc and mcause registers respectively. The privilege mode information fields in the mnstatus register are written to indicate M-mode and its NMIE field is set to 0.

trap_unexp_hndl_no_rnmi

When the Smrnmi extension is not implemented, or if the Smrnmi extension is implemented and mnstatus.⁠NMIE is 0, the hart enters a critical-error state without updating any architectural state, including the pc. This state involves ceasing execution, disabling all interrupts (including NMIs), and asserting a critical-error signal to the platform.

mnepc_invalid_convert

Prior to writing mnepc, implementations may convert an invalid address into some other invalid address that mnepc is capable of holding.

mnstatus_nmie_rst

If the Smrnmi extension is implemented, the mnstatus.NMIE field is reset to 0.

TODO: record mnstatus.NMIE before the boot code sets it

UDB Parameters: None.

B.12.7. Ssrnmi Supervisor-Mode Resumable Non-Maskable Interrupts

B.12.8. Smcntrpmf Counter Privilege Mode Filtering

B.12.9. Smcdeleg Counter Delegation

Smcdeleg Coverpoints

No test plan yet.

Table 358. Smcdeleg Normative Rules
Normative Rule Rule Text Coverpoints

Smcdeleg_Ssccfg_tandem

For a RISC-V hardware platform, Smcdeleg and Ssccfg must always be implemented in tandem.

Smcdeleg_cde_en

When the Smcdeleg/Ssccfg extensions are enabled (menvcfg.CDE=1), it further allows M-mode to delegate select counters to S-mode.

menvcfg_cde_op

If the Smcdeleg extension is implemented, the CDE (Counter Delegation Enable) bit controls whether Zicntr and Zihpm counters can be delegated to S-mode. When CDE=1, the Smcdeleg extension is enabled, see smcdeleg. When CDE=0, the Smcdeleg and Ssccfg extensions appear to be not implemented.

TODO: Smcdeleg with menvcfg.CDE = 0 and 1

Ssccfg_illegal_sireg_cde0

attempts to access any sireg* when menvcfg.CDE = 0;

Ssccfg_illegal_sireg3_6

attempts to access sireg3 or sireg6;

Ssccfg_illegal_sireg4_5_xlen64

attempts to access sireg4 or sireg5 when XLEN = 64;

Ssccfg_illegal_sireg_not_delegated

attempts to access sireg* when siselect = 0x41, or when the counter selected by siselect is not delegated to S-mode (the corresponding bit in mcounteren = 0).

Ssccfg_missing_extension_illegal

If any extension upon which the underlying state depends is not implemented, an attempt from M or S mode to access the given state through sireg* raises an illegal-instruction exception.

Ssccfg_hyp_vs_or_vu_access_vsireg_illegal

If the hypervisor (H) extension is also implemented, then as specified by extensions Smcsrind/Sscsrind, a virtual-instruction exception is raised for attempts from VS-mode or VU-mode to directly access vsiselect or vsireg*, or attempts from VU-mode to access siselect or sireg*. Furthermore, while vsiselect holds a value in the range 0x40-0x5F:

Ssccfg_hyp_m_s_vsireg_illegal

An attempt to access any vsireg* from M or S mode raises an illegal-instruction exception.

Ssccfg_hyp_vs_access_sireg_conditional

An attempt from VS-mode to access any sireg* (really vsireg*) raises an illegal-instruction exception if menvcfg.CDE = 0, or a virtual-instruction exception if menvcfg.CDE = 1.

Ssccfg_scountinhibit_exists

Smcdeleg/Ssccfg defines a new scountinhibit register, a masked alias of mcountinhibit.

Ssccfg_scountinhibit_delegated_rw

For counters delegated to S-mode, the associated mcountinhibit bits can be accessed via scountinhibit

Ssccfg_scountinhibit_nondelegated_ro

For counters not delegated to S-mode, the associated bits in scountinhibit are read-only zero.

Ssccfg_illegal_scountinhibit_cde0

When menvcfg.CDE=0, attempts to access scountinhibit raise an illegal-instruction exception.

Ssccfg_illegal_scountinhibit_vs_vu

When Supervisor Counter Delegation is enabled, attempts to access scountinhibit from VS-mode or VU-mode raise a virtual-instruction exception.

Ssccfg_virtual_scountovf_vs_vu

For implementations that support Smcdeleg/Ssccfg, Sscofpmf, and the H extension, when menvcfg.CDE=1, attempts to read scountovf from VS-mode or VU-mode raise a virtual-instruction exception.

Ssccfg_lcofi_mvip_mvien

For implementations that support Smcdeleg, Sscofpmf, and Smaia, the local-counter-overflow interrupt (LCOFI) bit (bit 13) in each of CSRs mvip and mvien is implemented and writable.

Ssccfg_lcofi_hvip_hvien

For implementations that support Smcdeleg/Ssccfg, Sscofpmf, Smaia/Ssaia, and the H extension, the LCOFI bit (bit 13) in each of hvip and hvien is implemented and writable.

UDB Parameters: None.

B.12.10. Ssccfg Counter Delegation

B.12.12. Ssdbltrp Supervisor Double Traps

Ssdbltrp Coverpoints

No test plan yet.

Table 360. Ssdbltrp Normative Rules
Normative Rule Rule Text Coverpoints

sstatus_sdt

The S-mode-disable-trap (SDT) bit is a WARL field introduced by the Ssdbltrp extension to address double trap (See ) at privilege modes lower than M.

sstatus_sdt_sstatus_sie_overwrite

When the SDT bit is set to 1 by an explicit CSR write, the SIE (Supervisor Interrupt Enable) bit is cleared to 0. This clearing occurs regardless of the value written, if any, to the SIE bit by the same write. The SIE bit can only be set to 1 by an explicit CSR write if the SDT bit is being set to 0 by the same write or is already 0.

sstatus_sdt_trap

When a trap is to be taken into S-mode, if the SDT bit is currently 0, it is then set to 1, and the trap is delivered as expected.

sstatus_sdt_unexpected_trap

However, if SDT is already set to 1, then this is an unexpected trap.

TODO: take a trap into S-mode with sstatus.SDT=1

sstatus_sdt_double_trap

In the event of an unexpected trap, a double-trap exception trap is delivered into M-mode.

TODO: check that a trap into S-mode with SDT=1 is delivered to M-mode

sstatus_sdt_double_trap_regs

To deliver this trap, the hart writes registers, except mcause and mtval2, with the same information that the unexpected trap would have written if it was taken into M-mode.

TODO: check mepc, mtval, and mstatus after a double trap

sstatus_sdt_double_trap_mtval2

The mtval2 register is then set to what would be otherwise written into the mcause register by the unexpected trap.

TODO: with H, check that mtval2 holds the unexpected trap’s cause

sstatus_sdt_double_trap_mcause

The mcause register is set to 16, the double-trap exception code.

TODO: check mcause=16 after a double trap

sstatus_sdt_sret

An SRET instruction sets the SDT bit to 0.

menvcfg_dte_op

The Ssdbltrp extension adds the double-trap-enable (DTE) field in menvcfg. When menvcfg.DTE is zero, the implementation behaves as though Ssdbltrp is not implemented.

TODO: Ssdbltrp with menvcfg.DTE = 0 and 1

UDB Parameters: None.

B.12.13. Smctr Control Transfer Records

B.12.14. Ssqosid Quality-of-Service ID

Ssqosid Coverpoints

No test plan yet.

Table 361. Ssqosid Normative Rules
Normative Rule Rule Text Coverpoints

Ssqosid_srmcfg_introduced

To facilitate this, the QoS Identifiers extension (Ssqosid) introduces the srmcfg register, which configures a hart with two identifiers: a Resource Control ID (RCID) and a Monitoring Counter ID (MCID). These identifiers accompany each request issued by the hart to shared resource controllers.

Ssqosid_rcid_mcid_accompany_requests

The RCID and MCID accompany each request made by the hart to shared resource controllers. The RCID is used to determine the resource allocations (e.g., cache occupancy limits, memory bandwidth limits, etc.) to enforce. The MCID is used to identify a counter to monitor resource usage.

Ssqosid_srmcfg_register_size

The srmcfg register is an SXLEN-bit read/write register used to configure a Resource Control ID (RCID) and a Monitoring Counter ID (MCID). Both RCID and MCID are WARL fields.

Ssqosid_srmcfg_csr_applies_to_all_modes

The RCID and MCID configured in the srmcfg CSR apply to all privilege modes of software execution on that hart by default, but this behavior may be overridden by future extensions.

Ssqosid_Smstateen_srmcfg_requires_mstateen0

If extension Smstateen is implemented together with Ssqosid, then Ssqosid also requires the SRMCFG bit in mstateen0 to be implemented.

Smstateen_cg/{cp_walking_ones, cp_srmcfg}

Ssqosid_srmcfg_access_illegal_instruction

If mstateen0.SRMCFG is 0, attempts to access srmcfg in privilege modes less privileged than M-mode raise an illegal-instruction exception.

Smstateen_cg/cp_srmcfg

Ssqosid_srmcfg_access_virtual_instruction

If mstateen0.SRMCFG is 1 or if extension Smstateen is not implemented, attempts to access srmcfg when V=1 raise a virtual-instruction exception.

UDB Parameters: None.

TODO: This text is here to prevent Asciidoctor from rendering strangely after an empty table. Delete it when table is populated.

Appendix C: Non-ISA Test Plan

This chapter contains test plans for ratified RISC-V standards outside the Unprivileged and Privileged ISA specifications.

C.1. Debug

This section describes ISA and non-ISA debug-related extensions not required in RVA23.

External debug needs to be able to perform register I/O to the debug module, such as halting and resuming the core, sending abstract commands such as Access Register or Access Memory, or running code from the Program Buffer. This cannot be done from software running on the core because a program cannot halt and single step itself, so these tests will need additional testbench support. External debug is not in RVA23.

A suggested approach is to require all of DM, DTM, and Sdext supported together for systems with External Debug, and to have a testbench send JTAG commands via DTM to the DTM to exercise Debug Mode.

Note that Sdtrig is described in Section B.11.16.

C.1.1. DM Debug Module

C.1.2. DTM Debug Transport Module

C.1.3. Sdext Debug Extension

C.2. AIA Advanced Interrupt Architecture

This section describes AIA extension test plans.

C.2.1. Smaia Machine-Mode Advanced Interrupt Architecture

C.2.2. Ssaia Supervisor-Mode Advanced Interrupt Architecture

C.2.3. IMSIC Incoming MSI Controller

C.2.4. APLIC Advanced Platform-Level Interrupt Controller

C.3. I/O Memory Management Unit (IOMMU)

APLIC Coverpoints

This section describes IOMMU extension test plans.

C.3.1. IOMMU I/O Memory Management Unit

IOMMU Coverpoints

TODO: This text is here to prevent Asciidoctor from rendering strangely after an empty table. Delete it when table is populated.

Appendix D: UDB Parameters

Table 362 summarizes all of the UDB parameters that affect coverpoints in this testplan. Table 363 summarizes the UDB parameters that are not yet exercised.

Table 362. Used UDB Parameters
Parameter Dependent Coverpoints Defined By Description

ARCH_ID_VALUE

Sm_cg/cp_mcsr_access

Sm

The value of marchid The combination of mvendorid and marchid should uniquely identify the type of hart microarchitecture that is implemented.

COUNTINHIBIT_EN

Sm_cg/cp_inhibit

Sm

Indicates which hardware performance monitor counters can be disabled from mcountinhibit.

COUNTINHIBIT_EN[n] controls whether mcountinhibit.HPM<n> is writable. It does not depend on whether hpmcounter<n>/mhpmcounter<n> is read-only zero.

COUNTINHIBIT_EN[1] can never be true, since it corresponds to mcountinhibit.TM, which is always read-only-0.

HPM_COUNTER_EN

Zihpm_cg/cp_cntr_hpm

Sm

Whether each HPM counter is implemented in hardware.

HPM_COUNTER_EN[n] being false means hpmcounter<n>/mhpmcounter<n> and the corresponding mhpmevent<n> are not implemented and are hardwired read-only zero. (It does not mean the counter is implemented but currently stopped from counting; that is a separate, run-time concept controlled by mcountinhibit.)

There is one entry for each hpmcounter, indexed 0-31.

Indices 0-2 must be false: they are placeholders for the three counters (cycle/mcycle (CY), time ™, and instret/minstret (IR)) whose implementation this parameter does not control. These counters are associated with indexes 0, 1, and 2. The rest of the HPM counters logically follow at indexes 3-31. Index 3 in HPM_COUNTER_EN corresponds to mhpmcounter3. Index 31 in HPM_COUNTER_EN corresponds to mhpmcounter31.

IMP_ID_VALUE

Sm_cg/cp_mcsr_access

Sm

A unique encoding of the version of the processor implementation.

LRSC_FAIL_ON_NON_EXACT_LRSC

Zalrsc_cg/Zalrsc_sc_d_cg/cp_custom_sc_lr, Zalrsc_sc_w_cg/cp_custom_sc_addresses

Zalrsc

Whether or not a Store Conditional fails if its physical address and size do not exactly match the physical address and size of the last Load Reserved in program order (independent of whether or not the SC is in the current reservation set)

LRSC_FAIL_ON_VA_SYNONYM

Zalrsc_cg/Not tested because spec does not require any specific behavior

Zalrsc

Whether or not an sc.l/sc.d will fail if its VA does not match the VA of the prior lr.l/lr.d, even if the physical address of the SC and LR are the same

LRSC_MISALIGNED_BEHAVIOR

ExceptionsZalrsc_cg/cp_{load,store}_address_misaligned

Zalrsc

What to do when an LR/SC address is misaligned and MISALIGNED_AMO == false.

* 'always raise misaligned exception': self-explanatory * 'always raise access fault': self-explanatory * 'custom': Custom behavior; misaligned LR/SC may sometimes raise a misaligned exception and sometimes raise an access fault. Will lead to an 'unpredictable' call on any misaligned LR/SC access

LRSC_RESERVATION_STRATEGY

Zalrsc_cg/Zalrsc_sc_w_cg/cp_custom_sc_addresses

Zalrsc

Strategy used to handle reservation sets.

* "reserve naturally-aligned 64-byte region": Always reserve the 64-byte block containing the LR/SC address * "reserve naturally-aligned 128-byte region": Always reserve the 128-byte block containing the LR/SC address * "reserve exactly enough to cover the access": Always reserve exactly the LR/SC access, and no more * "custom": Custom behavior, leading to an 'unpredictable' call on any LR/SC

MARCHID_IMPLEMENTED

Sm_cg/cp_mcsr_access

Sm

* false: marchid is not implemented, and must be read-only-0 * true: marchid is implemented, and the value is determined by ARCH_ID_VALUE

MIMPID_IMPLEMENTED

Sm_cg/cp_mcsr_access

Sm

* false: mimpid is not implemented, and must be read-only-0 * true: mimpid is implemented, and the value is determined by IMP_ID_VALUE

MISALIGNED_LDST

ExceptionsSm_cg/cp_{load_address_misaligned, store_address_misaligned, cp_misaligned_priority_load, cp_misaligned_priority_store}, Misalign_cg/cp_misalign, Misalign_cg/cp_misalign_cross64_hword, Misalign_cg/cp_misalign_cross64_word, Misalign_cg/cp_misalign_cross64_double, MisalignD_cg/cp_misalign, MisalignD_cg/cp_misalign_cross64_double, MisalignF_cg/cp_misalign, MisalignF_cg/cp_misalign_cross64_word, MisalignZca_cg/cp_misalign, MisalignZca_cg/cp_misalign_cross64_word, MisalignZca_cg/cp_misalign_cross64_double

Sm

Does the implementation perform non-atomic misaligned loads and stores to main memory (does not affect misaligned support to device memory)? If not, the implementation always throws a misaligned exception.

MISALIGNED_LDST_EXCEPTION_PRIORITY

ExceptionsSm_cg/cp_misaligned_priority_load, cp_misaligned_priority_store

Sm

The relative priority of a load/store/AMO exception vs. load/store/AMO page-fault or access-fault exceptions.

May be one of:

[separator="!"] !=== ! low ! Misaligned load/store/AMO exceptions are always lower priority than load/store/AMO page-fault and access-fault exceptions. ! high ! Misaligned load/store/AMO exceptions are always higher priority than load/store/AMO page-fault and access-fault exceptions. !===

MISALIGNED_LDST_EXCEPTION_PRIORITY cannot be "high" when MISALIGNED_MAX_ATOMICITY_GRANULE_SIZE is non-zero, since the atomicity of an access cannot be determined in that case until after address translation.

MISA_CSR_IMPLEMENTED

Sm_cg/cp_mcsr_access

Sm

Options:

true:: The misa CSR returns a non-zero value.

false:: The misa CSR is read-only-0.

MTVAL_WIDTH

ExceptionsSm_cg/TODO

Sm

The number of implemented bits in the mtval CSR. This is the CSR that may be written when a trap is taken into M-mode with exception-specific information to assist software in handling the trap (e.g., address associated with exception).

Must be greater than or equal to max(PHYS_ADDR_WIDTH, VA_SIZE)

MTVEC_ACCESS

ExceptionsSm_cg/all exception coverpoints, InterruptsSm_cg/all exception coverpoints

Sm

Options:

ro:: mtvec is read-only.

rw:: mtvec is read-write, but may not accept all values.

MTVEC_BASE_ALIGNMENT_DIRECT

ExceptionsSm_cg/all exception coverpoints, InterruptsSm_cg/all exception coverpoints

Sm

Minimum alignment of the base pointer. Because mtvec excludes the two least-significant bits of the base, the minimum alignment cannot be less than 4.

MTVEC_BASE_ALIGNMENT_VECTORED

InterruptsSm_cg/all

Sm

Because mtvec excludes the two least-significant bits of the base, the minimum alignment cannot be less than 4.

MTVEC_ILLEGAL_WRITE_BEHAVIOR

ExceptionsSm_cg/all exception coverpoints, InterruptsSm_cg/all

Sm

Options:

retain:: When either mtvec.MODE or mtvec.BASE is illegal, mtvec will retain its current value

custom:: When either mtvec.MODE or mtvec.BASE is illegal, mtvec will obtain an unpredictable value

Other values may be added over time once other common behaviors are identified.

MTVEC_MODES

InterruptsSm_cg/TODO

Sm

Options:

0:: Direct; All traps set pc to mtvec.BASE 1:: Vectored; Asynchronous interrupts set pc to mtvec.BASE + 4 x cause.

If only one mode is given, mtvec.MODE is assumed to be read-only with that value. Otherwise, mtvec.MODE is read-write.

MXLEN

Sm_cg/all tests

Sm

XLEN in machine mode, specified in bits

REPORT_ENCODING_IN_MTVAL_ON_ILLEGAL_INSTRUCTION

ExceptionsSm_cg/cp_illegal_instruction

Sm

Options:

* true: mtval is written with the encoding of an instruction causing an IllegalInstruction exception * false: mtval is written with 0 when an instruction causes an IllegalInstruction exception.

REPORT_VA_IN_MTVAL_ON_BREAKPOINT

ExceptionsSm_cg/cp_breakpoint

Sm

Options:

* true: mtval is written with the virtual PC of an EBREAK instruction (same information as mepc). * false: mtval is written with 0 on an EBREAK instruction.

Regardless, mtval is always written with a virtual PC when an external breakpoint is generated

REPORT_VA_IN_MTVAL_ON_INSTRUCTION_ACCESS_FAULT

ExceptionsSm_cg/cp_instr_access_fault

Sm

Options:

* true: mtval is written with the virtual address of a fetch causing the access fault * false: mtval is written with 0 when a fetch causes an access fault

REPORT_VA_IN_MTVAL_ON_INSTRUCTION_MISALIGNED

ExceptionsSm_cg/cp_instr_adr_misaligned_branch, cp_instr_misaligned_jal, cp_instr_misaligned_jalr

Sm

Options:

* true: mtval is written with the virtual address of a trapping misaligned fetch * false: mtval is written with 0 when a misaligned fetch traps

REPORT_VA_IN_MTVAL_ON_LOAD_ACCESS_FAULT

ExceptionsSm_cg/cp_load_access_fault

Sm

Options:

* true: mtval is written with the virtual address of a load causing the access fault * false: mtval is written with 0 when a load causes an access fault

REPORT_VA_IN_MTVAL_ON_LOAD_MISALIGNED

ExceptionsSm_cg/cp_load_address_misaligned

Sm

Options:

* true: mtval is written with the virtual address of a trapping misaligned load. * false: mtval is written with 0 when a misaligned load traps.

REPORT_VA_IN_MTVAL_ON_STORE_AMO_ACCESS_FAULT

ExceptionsSm_cg/cp_store_access_fault

Sm

Options:

* true: mtval is written with the virtual address of a store or AMO causing the access fault * false: mtval is written with 0 when a store or AMO causes an access fault

REPORT_VA_IN_MTVAL_ON_STORE_AMO_MISALIGNED

ExceptionsSm_cg/cp_store_address_misaligned

Sm

Options:

* true: mtval is written with the virtual address of a trapping misaligned store or AMO. * false: mtval is written with 0 when a misaligned store or AMO traps.

STVEC_BASE_ALIGNMENT_VECTORED

InterruptsS_cg/all

S

Minimum alignment of the base pointer when stvec.MODE is Vectored. Because stvec excludes the two least-significant bits of the base, the minimum alignment cannot be less than 4 bytes.

STVEC_MODES

InterruptsS_cg/TODO

S

Options:

0:: Direct; All traps set pc to stvec.BASE 1:: Vectored; Asynchronous interrupts set pc to stvec.BASE + 4 x cause.

If only one mode is given, stvec.MODE is assumed to be read-only with that value. Otherwise, stvec.MODE is read-write.

TIME_CSR_IMPLEMENTED

Sm_cg/cp_mtime_write, Zicntr_cg/cp_cntr

Zicntr

Whether or not a real hardware time CSR exists. Implementations can either provide a real CSR or emulate access at M-mode.

Possible values:

true:: time/timeh exists, and accessing it will not cause an IllegalInstruction trap

false:: time/timeh does not exist. Accessing the CSR will cause an IllegalInstruction trap or enter an unpredictable state, depending on TRAP_ON_UNIMPLEMENTED_CSR. Privileged software may emulate the time CSR, or may pass the exception to a lower level.

TRAP_ON_EBREAK

ExceptionsSm_cg/cp_breakpoint

Sm

The spec states that implementations may handle EBREAKs transparently without raising a trap, in which case the EEI must provide a builtin.

TRAP_ON_ECALL_FROM_M

ExceptionsSm_cg/cp_ecall_m

Sm

The spec states that implementations may handle ECALLs transparently without raising a trap, in which case the EEI must provide a builtin.

VENDOR_ID_BANK

Sm_cg/cp_mcsr_access

Sm

Encodes the number of one-byte continuation codes in the Bank field of mvendorid.

iN JEDEC’s parlance, the bank number is one greater than the number of continuation codes; hence, the mvendorid Bank field encodes a value that is one less than the JEDEC bank number.

VENDOR_ID_OFFSET

Sm_cg/cp_mcsr_access

Sm

Encodes the final byte of a JEDEC manufactor ID, discarding the parity bit.

Table 363. Unused UDB Parameters
Parameter Defined By Description

ASID_WIDTH

S

Number of implemented ASID bits. Maximum is 16 for XLEN==64, and 9 for XLEN==32

CACHE_BLOCK_SIZE

Zicbom, Zicbop, Zicboz

The observable size of a cache block, in bytes. A cache block is a naturally aligned power-of-two (NAPOT) range of memory.

CONFIG_PTR_ADDRESS

Sm

The value returned from mconfigptr

DBG_HCONTEXT_WIDTH

Sdtrig

Specifies the size of HCONTEXT

DBG_SCONTEXT_WIDTH

Sdtrig

Specifies the size of SCONTEXT

DCSR_MPRVEN_TYPE

Sdtrig

Implementation of dcsr.MPRVEN is optional. It may be tied to either 0 or 1.

Behavior of the dcsr.MPRVEN bit: * 'read-only-0': tied to 0 * 'read-only-1': tied to 1 * 'rw': read-write

DCSR_STEPIE_TYPE

Sdtrig

Implementation of dcsr.STEPIE is optional. It may be tied to either 0 or 1.

Behavior of the dcsr.STEPIE bit: * 'read-only-0': tied to 0 * 'read-only-1': tied to 1 * 'rw': read-write

DCSR_STOPCOUNT_TYPE

Sdtrig

Implementation of dcsr.STOPCOUNT is optional. It may be tied to either 0 or 1.

Behavior of the dcsr.STOPCOUNT bit: * 'read-only-0': tied to 0 * 'read-only-1': tied to 1 * 'rw': read-write

DCSR_STOPTIME_TYPE

Sdtrig

Implementation of dcsr.STOPTIME is optional. It may be tied to either 0 or 1.

Behavior of the dcsr.STOPTIME bit: * 'read-only-0': tied to 0 * 'read-only-1': tied to 1 * 'rw': read-write

ELEN

Zvl32b

The maximum size in bits of a vector element that any operation can produce or consume.

FOLLOW_VTYPE_RESET_RECOMMENDATION

Zvl32b

It is recommended that at reset, vtype.vill is set, the remaining bits in vtype are zero, and vl is set to zero. If this parameter is set to true, this recommendation is followed. If it is false, at reset the respective fields will be UNDEFINED_LEGAL.

FORCE_UPGRADE_CBO_INVAL_TO_FLUSH

Zicbom

When true, an implementation prohibits setting menvcfg.CBIE == 11 such that all cbo.inval instructions either trap (when menvcfg.CBIE == '00') or flush (when menvcfg.CBIE == '01').

When false, an implementation allows a true INVAL operation for cbo.inval, and thus supports the setting menvcfg.CBIE == 11.

GSTAGE_MODE_BARE

H

Whether or not writing mode=Bare is supported in the hgatp register.

HCONTEXT_AVAILABLE

Sdtrig

Specifies if HCONTEXT is available

HCOUNTENABLE_EN

H

Indicates which counters can delegated via hcounteren

HCOUNTENABLE_EN[n] controls whether hcounteren.HPM<n> is writable. It does not depend on whether hpmcounter<n>/mhpmcounter<n> is read-only zero.

HCOUNTENABLE_EN[0:2] must all be false if Zicntr is not implemented. HCOUNTENABLE_EN[3:31] must all be false if Zihpm is not implemented.

HPM_COUNTER10_WIDTH

Sm

The number of bits of precision implemented by mhpmcounter10.

This parameter exists only when HPM_COUNTER_EN[10] is true. The privileged specification allows an HPM counter to have up to 64 bits of precision.

HPM_COUNTER11_WIDTH

Sm

The number of bits of precision implemented by mhpmcounter11.

This parameter exists only when HPM_COUNTER_EN[11] is true. The privileged specification allows an HPM counter to have up to 64 bits of precision.

HPM_COUNTER12_WIDTH

Sm

The number of bits of precision implemented by mhpmcounter12.

This parameter exists only when HPM_COUNTER_EN[12] is true. The privileged specification allows an HPM counter to have up to 64 bits of precision.

HPM_COUNTER13_WIDTH

Sm

The number of bits of precision implemented by mhpmcounter13.

This parameter exists only when HPM_COUNTER_EN[13] is true. The privileged specification allows an HPM counter to have up to 64 bits of precision.

HPM_COUNTER14_WIDTH

Sm

The number of bits of precision implemented by mhpmcounter14.

This parameter exists only when HPM_COUNTER_EN[14] is true. The privileged specification allows an HPM counter to have up to 64 bits of precision.

HPM_COUNTER15_WIDTH

Sm

The number of bits of precision implemented by mhpmcounter15.

This parameter exists only when HPM_COUNTER_EN[15] is true. The privileged specification allows an HPM counter to have up to 64 bits of precision.

HPM_COUNTER16_WIDTH

Sm

The number of bits of precision implemented by mhpmcounter16.

This parameter exists only when HPM_COUNTER_EN[16] is true. The privileged specification allows an HPM counter to have up to 64 bits of precision.

HPM_COUNTER17_WIDTH

Sm

The number of bits of precision implemented by mhpmcounter17.

This parameter exists only when HPM_COUNTER_EN[17] is true. The privileged specification allows an HPM counter to have up to 64 bits of precision.

HPM_COUNTER18_WIDTH

Sm

The number of bits of precision implemented by mhpmcounter18.

This parameter exists only when HPM_COUNTER_EN[18] is true. The privileged specification allows an HPM counter to have up to 64 bits of precision.

HPM_COUNTER19_WIDTH

Sm

The number of bits of precision implemented by mhpmcounter19.

This parameter exists only when HPM_COUNTER_EN[19] is true. The privileged specification allows an HPM counter to have up to 64 bits of precision.

HPM_COUNTER20_WIDTH

Sm

The number of bits of precision implemented by mhpmcounter20.

This parameter exists only when HPM_COUNTER_EN[20] is true. The privileged specification allows an HPM counter to have up to 64 bits of precision.

HPM_COUNTER21_WIDTH

Sm

The number of bits of precision implemented by mhpmcounter21.

This parameter exists only when HPM_COUNTER_EN[21] is true. The privileged specification allows an HPM counter to have up to 64 bits of precision.

HPM_COUNTER22_WIDTH

Sm

The number of bits of precision implemented by mhpmcounter22.

This parameter exists only when HPM_COUNTER_EN[22] is true. The privileged specification allows an HPM counter to have up to 64 bits of precision.

HPM_COUNTER23_WIDTH

Sm

The number of bits of precision implemented by mhpmcounter23.

This parameter exists only when HPM_COUNTER_EN[23] is true. The privileged specification allows an HPM counter to have up to 64 bits of precision.

HPM_COUNTER24_WIDTH

Sm

The number of bits of precision implemented by mhpmcounter24.

This parameter exists only when HPM_COUNTER_EN[24] is true. The privileged specification allows an HPM counter to have up to 64 bits of precision.

HPM_COUNTER25_WIDTH

Sm

The number of bits of precision implemented by mhpmcounter25.

This parameter exists only when HPM_COUNTER_EN[25] is true. The privileged specification allows an HPM counter to have up to 64 bits of precision.

HPM_COUNTER26_WIDTH

Sm

The number of bits of precision implemented by mhpmcounter26.

This parameter exists only when HPM_COUNTER_EN[26] is true. The privileged specification allows an HPM counter to have up to 64 bits of precision.

HPM_COUNTER27_WIDTH

Sm

The number of bits of precision implemented by mhpmcounter27.

This parameter exists only when HPM_COUNTER_EN[27] is true. The privileged specification allows an HPM counter to have up to 64 bits of precision.

HPM_COUNTER28_WIDTH

Sm

The number of bits of precision implemented by mhpmcounter28.

This parameter exists only when HPM_COUNTER_EN[28] is true. The privileged specification allows an HPM counter to have up to 64 bits of precision.

HPM_COUNTER29_WIDTH

Sm

The number of bits of precision implemented by mhpmcounter29.

This parameter exists only when HPM_COUNTER_EN[29] is true. The privileged specification allows an HPM counter to have up to 64 bits of precision.

HPM_COUNTER30_WIDTH

Sm

The number of bits of precision implemented by mhpmcounter30.

This parameter exists only when HPM_COUNTER_EN[30] is true. The privileged specification allows an HPM counter to have up to 64 bits of precision.

HPM_COUNTER31_WIDTH

Sm

The number of bits of precision implemented by mhpmcounter31.

This parameter exists only when HPM_COUNTER_EN[31] is true. The privileged specification allows an HPM counter to have up to 64 bits of precision.

HPM_COUNTER3_WIDTH

Sm

The number of bits of precision implemented by mhpmcounter3.

This parameter exists only when HPM_COUNTER_EN[3] is true. The privileged specification allows an HPM counter to have up to 64 bits of precision.

HPM_COUNTER4_WIDTH

Sm

The number of bits of precision implemented by mhpmcounter4.

This parameter exists only when HPM_COUNTER_EN[4] is true. The privileged specification allows an HPM counter to have up to 64 bits of precision.

HPM_COUNTER5_WIDTH

Sm

The number of bits of precision implemented by mhpmcounter5.

This parameter exists only when HPM_COUNTER_EN[5] is true. The privileged specification allows an HPM counter to have up to 64 bits of precision.

HPM_COUNTER6_WIDTH

Sm

The number of bits of precision implemented by mhpmcounter6.

This parameter exists only when HPM_COUNTER_EN[6] is true. The privileged specification allows an HPM counter to have up to 64 bits of precision.

HPM_COUNTER7_WIDTH

Sm

The number of bits of precision implemented by mhpmcounter7.

This parameter exists only when HPM_COUNTER_EN[7] is true. The privileged specification allows an HPM counter to have up to 64 bits of precision.

HPM_COUNTER8_WIDTH

Sm

The number of bits of precision implemented by mhpmcounter8.

This parameter exists only when HPM_COUNTER_EN[8] is true. The privileged specification allows an HPM counter to have up to 64 bits of precision.

HPM_COUNTER9_WIDTH

Sm

The number of bits of precision implemented by mhpmcounter9.

This parameter exists only when HPM_COUNTER_EN[9] is true. The privileged specification allows an HPM counter to have up to 64 bits of precision.

HPM_EVENTS

Sm

List of defined event numbers that can be written into mhpmeventN

HSTATEEN_AIA_TYPE

Ssaia, H, Ssstateen

Behavior of the hstateen0.AIA bit:

* 'rw': read-write * 'read-only-0': read-only, fixed to 0 * 'read-only-1': read-only, fixed to 1

HSTATEEN_CONTEXT_TYPE

Sdtrig, H, Ssstateen

Behavior of the hstateen0.CONTEXT bit:

* 'rw': read-write * 'read-only-0': read-only, fixed to 0 * 'read-only-1': read-only, fixed to 1

HSTATEEN_CSRIND_TYPE

Sscsrind, H, Ssstateen

Behavior of the hstateen0.CSRIND bit:

* 'rw': read-write * 'read-only-0': read-only, fixed to 0 * 'read-only-1': read-only, fixed to 1

HSTATEEN_ENVCFG_TYPE

Behavior of the hstateen0.ENVCFG bit:

* 'rw': read-write * 'read-only-0': read-only, fixed to 0 * 'read-only-1': read-only, fixed to 1

HSTATEEN_IMSIC_TYPE

Ssaia, H, Ssstateen

Behavior of the hstateen0.IMSIC bit:

* 'rw': read-write * 'read-only-0': read-only, fixed to 0 * 'read-only-1': read-only, fixed to 1

HSTATEEN_JVT_TYPE

Zcmt, H, Ssstateen

Behavior of the hstateen0.JVT bit:

* 'rw': read-write * 'read-only-0': read-only, fixed to 0 * 'read-only-1': read-only, fixed to 1

HW_MSTATUS_FS_DIRTY_UPDATE

F, Sm

Indicates when hardware will write to mstatus.FS

Values are: [separator="!"] !=== h! precise ! Hardware writes mstatus.FS to the Dirty (3) state precisely when F registers are modified h! imprecise ! Hardware writes mstatus.FS imprecisely. This will result in a call to unpredictable() on any attempt to read mstatus or write FP state. !===

HW_MSTATUS_VS_DIRTY_UPDATE

Zvl32b, Sm

Indicates when hardware will write to mstatus.VS

Values are: [separator="!"] !=== h! precise ! Hardware writes mstatus.VS to the Dirty (3) state precisely when V registers are modified h! imprecise ! Hardware writes mstatus.VS imprecisely. This will result in a call to unpredictable() on any attempt to read mstatus or write vector state. !===

IGNORE_INVALID_VSATP_MODE_WRITES_WHEN_V_EQ_ZERO

H

Whether writes from M-mode, U-mode, or S-mode to vsatp with an illegal mode setting are ignored (as they are with satp), or if they are treated as WARL, leading to undpredictable behavior.

IMPRECISE_VECTOR_TRAP_SETTABLE

Zvl32b

Some profiles may provide a privileged configuration bit that selects between precise and imprecise vector trap behavior, allowing flexibility in how traps and partial updates are reported.

JVT_BASE_MASK

Zcmt

Mask representing the implemented bits of jvt.BASE. Includes the implicitly-zero bits of jvt.BASE, so JVT_BASE_MASK[5:0] must always be 0.

JVT_BASE_TYPE

Zcmt

Type of the jvt.BASE CSR field. One of:

* mask: jvt.BASE contains one or more implemented bits, which are indicated by JVT_BASE_MASK. * custom: Custom behavior. Will cause hart to enter 'unpredictable' state on a write to jvt.BASE.

JVT_READ_ONLY

Zcmt

If Zcmt is implemented, JVT is implemented, but can contain a read-only value

LEGAL_VSTART

Zvl32b

Implementations may raise illegal-instruction exceptions for vector instructions that specify a vstart value the implementation can never produce under the same vtype configuration (e.g., due to restrictions on supported strides or alignments).

MCID_WIDTH

Ssqosid

Number of bits used for the Monitoring Counter ID field (MCID). Default is 12.

MCONTEXT_AVAILABLE

Sdtrig

Specifies if MCONTEXT is available

MCOUNTENABLE_EN

Sm

Indicates which counters can be delegated via mcounteren.

MCOUNTENABLE_EN[n] controls whether mcounteren.HPM<n> is writable. It does not depend on whether hpmcounter<n>/mhpmcounter<n> is read-only zero.

MCOUNTENABLE_EN[0:2] must all be false if Zicntr is not implemented. MCOUNTENABLE_EN[3:31] must all be false if Zihpm is not implemented.

MCOUNTINHIBIT_IMPLEMENTED

Sm

Options:

true:: The mcountinhibit CSR is implemented and can be accessed in M-mode.

false:: The mcountinhibit CSR is not implemented. Accessing the CSR will cause an IllegalInstruction trap or enter an unpredictable state, depending on TRAP_ON_UNIMPLEMENTED_CSR.

MCTRCTL_CORSWAPINH_IMPLEMENTED

Smctr

Whether or not mctrctl.CORSWAPINH is implemented.

When not implemented mctrctl.CORSWAPINH will be read-only-zero.

MCTRCTL_CUSTOM_IMPLEMENTED

Smctr

Whether or not mctrctl.CUSTOM is implemented.

When not implemented mctrctl.CUSTOM will be read-only-zero.

MCTRCTL_DIRCALLINH_IMPLEMENTED

Smctr

Whether or not mctrctl.DIRCALLINH is implemented.

When not implemented mctrctl.DIRCALLINH will be read-only-zero.

MCTRCTL_DIRJMPINH_IMPLEMENTED

Smctr

Whether or not mctrctl.DIRJMPINH is implemented.

When not implemented mctrctl.DIRJMPINH will be read-only-zero.

MCTRCTL_DIRLJMPINH_IMPLEMENTED

Smctr

Whether or not mctrctl.DIRLJMPINH is implemented.

When not implemented mctrctl.DIRLJMPINH will be read-only-zero.

MCTRCTL_EXCINH_IMPLEMENTED

Smctr

Whether or not mctrctl.EXCINH is implemented.

When not implemented mctrctl.EXCINH will be read-only-zero.

MCTRCTL_INDCALLINH_IMPLEMENTED

Smctr

Whether or not mctrctl.INDCALLINH is implemented.

When not implemented mctrctl.INDCALLINH will be read-only-zero.

MCTRCTL_INDJMPINH_IMPLEMENTED

Smctr

Whether or not mctrctl.INDJMPINH is implemented.

When not implemented mctrctl.INDJMPINH will be read-only-zero.

MCTRCTL_INDLJMPINH_IMPLEMENTED

Smctr

Whether or not mctrctl.INDLJMPINH is implemented.

When not implemented mctrctl.INDLJMPINH will be read-only-zero.

MCTRCTL_INTRINH_IMPLEMENTED

Smctr

Whether or not mctrctl.INTRINH is implemented.

When not implemented mctrctl.INTRINH will be read-only-zero.

MCTRCTL_MTE_IMPLEMENTED

Smctr

Whether or not mctrctl.MTE is implemented.

When not implemented mctrctl.MTE will be read-only-zero.

MCTRCTL_NTBREN_IMPLEMENTED

Smctr

Whether or not mctrctl.NTBREN is implemented.

When not implemented mctrctl.NTBREN will be read-only-zero.

MCTRCTL_RASEMU_IMPLEMENTED

Smctr

Whether or not mctrctl.RASEMU is implemented.

When not implemented mctrctl.RASEMU will be read-only-zero.

MCTRCTL_RETINH_IMPLEMENTED

Smctr

Whether or not mctrctl.RETINH is implemented.

When not implemented mctrctl.RETINH will be read-only-zero.

MCTRCTL_STE_IMPLEMENTED

Smctr

Whether or not mctrctl.STE is implemented.

When not implemented mctrctl.STE will be read-only-zero.

MCTRCTL_TKBRINH_IMPLEMENTED

Smctr

Whether or not mctrctl.TKBRINH is implemented.

When not implemented mctrctl.TKBRINH will be read-only-zero.

MCTRCTL_TRETINH_IMPLEMENTED

Smctr

Whether or not mctrctl.TRETINH is implemented.

When not implemented mctrctl.TRETINH will be read-only-zero.

MEI_INTR_IMPL

Zicsr, Sm

Whether or not machine-level external interrupts are implemented.

Possible values:

true:: Machine-level external interrupts are implemented. mie.MEIE and mideleg.MEI are writable.

false:: Machine-level external interrupts are not implemented. mie.MEIE and mideleg.MEI are read-only zero.

MISALIGNED_AMO

Zaamo

Whether or not the implementation supports misaligned atomics in main memory

MISALIGNED_MAX_ATOMICITY_GRANULE_SIZE

Sm

When MISALIGNED_MAX_ATOMICITY_GRANULE_SIZE is 0, the hart cannot atomically perform a misaligned load/store/AMO. When a power of two, the hart can atomically load/store/AMO a misaligned access that is fully contained in a MISALIGNED_MAX_ATOMICITY_GRANULE_SIZE-aligned region.

[NOTE] Even if the hart is capable of performing a misaligned load/store/AMO atomically, a misaligned exception may still occur if the access does not have the appropriate Misaligned Atomicity Granule PMA set.

MISALIGNED_SPLIT_STRATEGY

Sm

Options:

* sequential_bytes: The load/store appears to be broken into byte-sized accesses that processed sequentially from smallest address to largest address * custom: Something else. Will result in a call to unpredictable() in the execution

MSI_INTR_IMPL

Zicsr, Sm

Whether or not machine-level software interrupts are implemented.

Possible values:

true:: Machine-level software interrupts are implemented. mie.MSIE and mideleg.MSI are writable.

false:: Machine-level software interrupts are not implemented. mie.MSIE and mideleg.MSI are read-only zero.

MSTATEEN_AIA_TYPE

Ssaia

Behavior of the mstateen0.AIA bit:

* 'rw': read-write * 'read-only-0': read-only, fixed to 0 * 'read-only-1': read-only, fixed to 1

MSTATEEN_CONTEXT_TYPE

Sdtrig, Smstateen

Behavior of the mstateen0.CONTEXT bit:

* 'rw': read-write * 'read-only-0': read-only, fixed to 0 * 'read-only-1': read-only, fixed to 1

MSTATEEN_CSRIND_TYPE

Sscsrind, Smstateen

Behavior of the mstateen0.CSRIND bit:

* 'rw': read-write * 'read-only-0': read-only, fixed to 0 * 'read-only-1': read-only, fixed to 1

MSTATEEN_ENVCFG_TYPE

S, Smstateen

Behavior of the mstateen0.ENVCFG bit:

* 'rw': read-write * 'read-only-0': read-only, fixed to 0 * 'read-only-1': read-only, fixed to 1

MSTATEEN_IMSIC_TYPE

Ssaia

Behavior of the mstateen0.IMSIC bit:

* 'rw': read-write * 'read-only-0': read-only, fixed to 0 * 'read-only-1': read-only, fixed to 1

MSTATEEN_JVT_TYPE

Zcmt

Behavior of the mstateen0.JVT bit:

* 'rw': read-write * 'read-only-0': read-only, fixed to 0 * 'read-only-1': read-only, fixed to 1

MSTATUS_FS_LEGAL_VALUES

Sm, F, S

The set of values that mstatus.FS supports.

MSTATUS_VS_LEGAL_VALUES

Sm, Zvl32b, S

The set of values that mstatus.VS will accept from a software write.

MTI_INTR_IMPL

Zicsr, Sm

Whether or not machine-level timer interrupts are implemented.

Possible values:

true:: Machine-level timer interrupts are implemented. mie.MTIE, mideleg.MTI, and mtimecmp are writable.

false:: Machine-level timer interrupts are not implemented. mie.MTIE and mideleg.MTI are read-only zero. mtimecmp is optional and may be read-only zero.

MUTABLE_MISA_A

A, Sm

When the A extensions is supported, indicates whether or not the extension can be disabled in the misa.A bit.

MUTABLE_MISA_B

B, Sm

Indicates whether or not the B extension can be disabled with the misa.B bit.

MUTABLE_MISA_C

C, Sm

Indicates whether or not the C extension can be disabled with the misa.C bit.

MUTABLE_MISA_D

D, Sm

Indicates whether or not the D extension can be disabled with the misa.D bit.

MUTABLE_MISA_F

F, Sm

Indicates whether or not the F extension can be disabled with the misa.F bit.

MUTABLE_MISA_H

Sm, H

Indicates whether or not the H extension can be disabled with the misa.H bit.

MUTABLE_MISA_M

M, Sm

Indicates whether or not the M extension can be disabled with the misa.M bit.

MUTABLE_MISA_Q

Q, Sm

Indicates whether or not the Q extension can be disabled with the misa.Q bit.

MUTABLE_MISA_S

S, Sm

Indicates whether or not the S extension can be disabled with the misa.S bit.

MUTABLE_MISA_U

U, Sm

Indicates whether or not the U extension can be disabled with the misa.U bit.

MUTABLE_MISA_V

V, Sm

Indicates whether or not the V extension can be disabled with the misa.V bit.

M_MODE_ENDIANNESS

Sm

Options:

[separator="!"] !=== h! little ! M-mode data is always little endian h! big ! M-mode data is always big endian h! dynamic ! M-mode data can be either little or big endian, depending on the CSR field mstatus.MBE !===

NON_STANDARD_EXTENSION_IMPLEMENTED

Sm

If any non-standard extensions are implemented, this parameter must be true. This parameter is used as the reset value for misa.X.

NUM_EXTERNAL_GUEST_INTERRUPTS

H

Number of supported virtualized guest interrupts

Corresponds to the GEILEN parameter in the RVI specs

NUM_PMP_ENTRIES

Sm

Number of implemented PMP entries.

The architecture mandates that the number of implemented PMP registers must appear to be 0, 16, or 64, so NUM_PMP_ENTRIES must be one of those values. It directly determines which PMP registers exist: pmpaddr0-pmpaddr<N-1> and their corresponding pmpNcfg fields are implemented, and the rest are not. Accessing an unimplemented PMP register causes an IllegalInstruction when TRAP_ON_UNIMPLEMENTED_CSR is true.

[NOTE] pmpcfgN for an odd N never exists when XLEN == 64.

An implemented entry may still be read-only zero (but will never cause an exception). The number of entries that are actually usable is given by NUM_USABLE_PMP_ENTRIES.

NUM_USABLE_PMP_ENTRIES

Number of implemented PMP entries that are actually usable.

An implementation may implement PMP entries (NUM_PMP_ENTRIES) but hardwire some of them to zero (read-only zero). Such entries exist — their pmpaddrN/pmpNcfg registers are accessible and will not cause an exception from M-mode — but they cannot be configured to guard a region.

NUM_USABLE_PMP_ENTRIES gives the number of low-numbered entries that are writable/usable. Entries 0 through NUM_USABLE_PMP_ENTRIES-1 are usable; entries NUM_USABLE_PMP_ENTRIES through NUM_PMP_ENTRIES-1 are read-only zero.

Must be between 0 and NUM_PMP_ENTRIES, inclusive.

PHYS_ADDR_WIDTH

Sm

Implementation-defined size of the physical address space.

PMA_GRANULARITY

Sm

Generally, for systems with an MMU, should not be smaller than 12, as that would preclude caching PMA results in the TLB along with virtual memory translations

PMP_GRANULARITY

log2 of the smallest supported PMP region.

Generally, for systems with an MMU, should not be smaller than 12, as that would preclude caching PMP results in the TLB along with virtual memory translations

Note that PMP_GRANULARITY is equal to G+2 (not G) as described in the privileged architecture.

PMP_NA4_SUPPORTED

Whether or not the Naturally Aligned four-byte (NA4) PMP address matching mode is supported.

PMP_NAPOT_SUPPORTED

Whether or not the Naturally Aligned Power-Of-Two (NAPOT) PMP address matching mode is supported.

PMP_TOR_SUPPORTED

Whether or not the Top-of-Range (TOR) PMP address matching mode is supported.

PRECISE_SYNCHRONOUS_EXCEPTIONS

Sm

If false, any exception not otherwise mandated to precise (e.g., PMP violation) will cause execution to enter an unpredictable state.

RCID_WIDTH

Ssqosid

Number of bits used for the Resource Control ID field (RCID). Default is 12.

REPORT_CAUSE_IN_MTVAL_ON_LANDING_PAD_SOFTWARE_CHECK

Zicfilp

When true, mtval is written with the landing pad fault cause (code=2) when a SoftwareCheck exception is raised into M-mode due to a landing pad error.

When false, mtval is written with 0.

REPORT_CAUSE_IN_MTVAL_ON_SHADOW_STACK_SOFTWARE_CHECK

Zicfiss

When true, mtval is written with the shadow stack cause (code=3) when a SoftwareCheck exception is raised into M-mode due to a shadow stack pop check instruction.

When false, mtval is written with 0.

REPORT_CAUSE_IN_STVAL_ON_LANDING_PAD_SOFTWARE_CHECK

Zicfilp

When true, stval is written with the landing pad fault cause (code=2) when a SoftwareCheck exception is raised into S-mode due to a landing pad error.

When false, stval is written with 0.

REPORT_CAUSE_IN_STVAL_ON_SHADOW_STACK_SOFTWARE_CHECK

Zicfiss

When true, stval is written with the shadow stack cause (code=3) when a SoftwareCheck exception is raised into S-mode due to a shadow stack pop check instruction.

When false, stval is written with 0.

REPORT_CAUSE_IN_VSTVAL_ON_LANDING_PAD_SOFTWARE_CHECK

Zicfilp

When true, vstval is written with the landing pad fault cause (code=2) when a SoftwareCheck exception is raised into VS-mode due to a landing pad error.

When false, vstval is written with 0.

REPORT_CAUSE_IN_VSTVAL_ON_SHADOW_STACK_SOFTWARE_CHECK

Zicfiss

When true, vstval is written with the shadow stack cause (code=3) when a SoftwareCheck exception is raised into VS-mode due to a shadow stack pop check instruction.

When false, vstval is written with 0.

REPORT_ENCODING_IN_STVAL_ON_ILLEGAL_INSTRUCTION

S

When true, stval is written with the encoding of an instruction that causes an IllegalInstruction exception.

When false stval is written with 0 when an IllegalInstruction exception occurs.

REPORT_ENCODING_IN_VSTVAL_ON_ILLEGAL_INSTRUCTION

H

When true, vstval is written with the encoding of an instruction that causes an IllegalInstruction exception.

When false vstval is written with 0 when an IllegalInstruction exception occurs.

REPORT_ENCODING_IN_VSTVAL_ON_VIRTUAL_INSTRUCTION

H

When true, vstval is written with the encoding of an instruction that causes an VirualInstruction exception.

When false vstval is written with 0 when an VirtualInstruction exception occurs.

REPORT_GPA_IN_HTVAL_ON_GUEST_PAGE_FAULT

H

When true, htval is written with the Guest Physical Address, shifted right by 2, that caused a GuestPageFault exception.

When false, htval is written with 0 when a GuestPageFault exception occurs.

REPORT_GPA_IN_TVAL_ON_INSTRUCTION_GUEST_PAGE_FAULT

H

Whether or not GPA >> 2 is written into htval/mtval2 when an instruction guest page fault occurs.

If false, 0 will be written into htval/mtval2 on an instruction guest page fault.

REPORT_GPA_IN_TVAL_ON_INTERMEDIATE_GUEST_PAGE_FAULT

H

Whether or not GPA >> 2 is written into htval/mtval2 when a guest page fault occurs while walking a VS-mode page table.

If false, 0 will be written into htval/mtval2 on an intermediate guest page fault.

REPORT_GPA_IN_TVAL_ON_LOAD_GUEST_PAGE_FAULT

H

Whether or not GPA >> 2 is written into htval/mtval2 when a load guest page fault occurs.

If false, 0 will be written into htval/mtval2 on a load guest page fault.

REPORT_GPA_IN_TVAL_ON_STORE_AMO_GUEST_PAGE_FAULT

H

Whether or not GPA >> 2 is written into htval/mtval2 when a store/amo guest page fault occurs.

If false, 0 will be written into htval/mtval2 on a store/amo guest page fault.

REPORT_VA_IN_MTVAL_ON_INSTRUCTION_PAGE_FAULT

S

When true, mtval is written with the virtual PC of an instructino when fetch causes an InstructionPageFault.

WHen false, mtval is written with 0 when an instruction fetch causes an InstructionPageFault.

REPORT_VA_IN_MTVAL_ON_LOAD_PAGE_FAULT

S

When true, mtval is written with the virtual address of a load when it causes a LoadPageFault.

WHen false, mtval is written with 0 when a load causes a LoadPageFault.

REPORT_VA_IN_MTVAL_ON_STORE_AMO_PAGE_FAULT

S

When true, mtval is written with the virtual address of a store when it causes a StoreAmoPageFault.

WHen false, mtval is written with 0 when a store causes a StoreAmoPageFault.

REPORT_VA_IN_STVAL_ON_BREAKPOINT

S

When true, stval is written with the virtual PC of the EBREAK instruction (same information as mepc).

When false, stval is written with 0 on an EBREAK instruction.

Regardless, stval is always written with a virtual PC when an external breakpoint is generated

REPORT_VA_IN_STVAL_ON_INSTRUCTION_ACCESS_FAULT

S

When true, stval is written with the virtual PC of an instructino when fetch causes an InstructionAccessFault.

WHen false, stval is written with 0 when an instruction fetch causes an InstructionAccessFault.

REPORT_VA_IN_STVAL_ON_INSTRUCTION_MISALIGNED

S

When true, stval is written with the virtual PC when an instruction fetch is misaligned.

When false, stval is written with 0 when an instruction fetch is misaligned.

Note that when IALIGN=16 (i.e., when the C or one of the Zc* extensions are implemented), it is impossible to generate a misaligned fetch, and so this parameter has no effect.

REPORT_VA_IN_STVAL_ON_INSTRUCTION_PAGE_FAULT

S

When true, stval is written with the virtual PC of an instructino when fetch causes an InstructionPageFault.

WHen false, stval is written with 0 when an instruction fetch causes an InstructionPageFault.

REPORT_VA_IN_STVAL_ON_LOAD_ACCESS_FAULT

S

When true, stval is written with the virtual address of a load when it causes a LoadAccessFault.

WHen false, stval is written with 0 when a load causes a LoadAccessFault.

REPORT_VA_IN_STVAL_ON_LOAD_MISALIGNED

S

When true, stval is written with the virtual address of a load instruction when the address is misaligned and MISALIGNED_LDST is false.

When false, stval is written with 0 when a load address is misaligned and MISALIGNED_LDST is false.

REPORT_VA_IN_STVAL_ON_LOAD_PAGE_FAULT

S

When true, stval is written with the virtual address of a load when it causes a LoadPageFault.

WHen false, stval is written with 0 when a load causes a LoadPageFault.

REPORT_VA_IN_STVAL_ON_STORE_AMO_ACCESS_FAULT

S

When true, stval is written with the virtual address of a store when it causes a StoreAmoAccessFault.

WHen false, stval is written with 0 when a store causes a StoreAmoAccessFault.

REPORT_VA_IN_STVAL_ON_STORE_AMO_MISALIGNED

S

When true, stval is written with the virtual address of a store instruction when the address is misaligned and MISALIGNED_LDST is false.

When false, stval is written with 0 when a store address is misaligned and MISALIGNED_LDST is false.

REPORT_VA_IN_STVAL_ON_STORE_AMO_PAGE_FAULT

S

When true, stval is written with the virtual address of a store when it causes a StoreAmoPageFault.

WHen false, stval is written with 0 when a store causes a StoreAmoPageFault.

REPORT_VA_IN_VSTVAL_ON_BREAKPOINT

H

When true, vstval is written with the virtual PC of the EBREAK instruction (same information as mepc).

When false, vstval is written with 0 on an EBREAK instruction.

Regardless, vstval is always written with a virtual PC when an external breakpoint is generated.

REPORT_VA_IN_VSTVAL_ON_INSTRUCTION_ACCESS_FAULT

H

When true, vstval is written with the virtual PC of an instructino when fetch causes an InstructionAccessFault.

WHen false, vstval is written with 0 when an instruction fetch causes an InstructionAccessFault.

REPORT_VA_IN_VSTVAL_ON_INSTRUCTION_MISALIGNED

H

When true, vstval is written with the virtual PC when an instruction fetch is misaligned.

When false, vstval is written with 0 when an instruction fetch is misaligned.

Note that when IALIGN=16 (i.e., when the C or one of the Zc* extensions are implemented), it is impossible to generate a misaligned fetch, and so this parameter has no effect.

REPORT_VA_IN_VSTVAL_ON_INSTRUCTION_PAGE_FAULT

H

When true, vstval is written with the virtual PC of an instructino when fetch causes an InstructionPageFault.

WHen false, vstval is written with 0 when an instruction fetch causes an InstructionPageFault.

REPORT_VA_IN_VSTVAL_ON_LOAD_ACCESS_FAULT

H

When true, vstval is written with the virtual address of a load when it causes a LoadAccessFault.

WHen false, vstval is written with 0 when a load causes a LoadAccessFault.

REPORT_VA_IN_VSTVAL_ON_LOAD_MISALIGNED

H

When true, vstval is written with the virtual address of a load instruction when the address is misaligned and MISALIGNED_LDST is false.

When false, vstval is written with 0 when a load address is misaligned and MISALIGNED_LDST is false.

REPORT_VA_IN_VSTVAL_ON_LOAD_PAGE_FAULT

H

When true, vstval is written with the virtual address of a load when it causes a LoadPageFault.

WHen false, vstval is written with 0 when a load causes a LoadPageFault.

REPORT_VA_IN_VSTVAL_ON_STORE_AMO_ACCESS_FAULT

H

When true, vstval is written with the virtual address of a store when it causes a StoreAmoAccessFault.

WHen false, vstval is written with 0 when a store causes a StoreAmoAccessFault.

REPORT_VA_IN_VSTVAL_ON_STORE_AMO_MISALIGNED

H

When true, vstval is written with the virtual address of a store instruction when the address is misaligned and MISALIGNED_LDST is false.

When false, vstval is written with 0 when a store address is misaligned and MISALIGNED_LDST is false.

REPORT_VA_IN_VSTVAL_ON_STORE_AMO_PAGE_FAULT

H

When true, vstval is written with the virtual address of a store when it causes a StoreAmoPageFault.

WHen false, vstval is written with 0 when a store causes a StoreAmoPageFault.

RESERVED_VSET_X0X0_VILL_SET

Zvl32b

When rs1 = x0 and rd = x0, vset instructions act as if the current vector length in vl is used as the AVL. If vill is set or the configuration is reserved, implementations may set vill to indicate unsupported use of these encodings.

RESERVED_VSET_X0X0_VLMAX_CHANGE

Zvl32b

When rs1=x0 and rd=x0, the instructions operate as if the current vector length in vl is used as the AVL. Use of the vset instructions with a new SEW/LMUL ratio that would result in a change of VLMAX is reserved. Implementations may set vill in either case.

RVV_VL_WHEN_AVL_LT_DOUBLE_VLMAX

Zvl32b

The value assigned to VL when AVL < 2*VLMAX.

SATP_MODE_BARE

S

Whether or not satp.MODE == Bare is supported.

SCOUNTENABLE_EN

S

Indicates which counters can delegated via scounteren

SCOUNTENABLE_EN[n] controls whether scounteren.HPM<n> is writable. It does not depend on whether hpmcounter<n>/mhpmcounter<n> is read-only zero.

SCOUNTENABLE_EN[0:2] must all be false if Zicntr is not implemented. SCOUNTENABLE_EN[3:31] must all be false if Zihpm is not implemented.

SCTRDEPTH_DEPTH_LEGAL_VALUES

Smctr

The set of supported actual depths for the Control Transfer Records (CTR) buffer.

SEI_INTR_IMPL

Zicsr, S

Whether or not supervisor-level external interrupts are implemented.

Possible values:

true:: Supervisor-level external interrupts are implemented. mie.SEIE and mideleg.SEI are writable.

false:: Supervisor-level external interrupts are not implemented. mie.SEIE, mip.SEIP, and mideleg.SEI are read-only zero.

SEW_MIN

Zvl32b

Implementations must provide fractional LMUL settings that allow the narrowest supported element width (SEW) to occupy a fractional portion of a vector register relative to the widest supported SEW. In general, implementations must support LMUL >= SEW_MIN/ELEN, where SEW_MIN is the narrowest supported SEW and ELEN is the widest SEW.

SSI_INTR_IMPL

Zicsr, S

Whether or not supervisor-level software interrupts are implemented.

Possible values:

true:: Supervisor-level software interrupts are implemented. mie.SSIE and mideleg.SSI are writable.

false:: Supervisor-level software interrupts are not implemented. mie.SSIE, mip.SSIP, and mideleg.SSI are read-only zero.

SSTATEEN_JVT_TYPE

Zcmt, Ssstateen

Behavior of the sstateen0.JVT bit:

* 'rw': read-write * 'read-only-0': read-only, fixed to 0 * 'read-only-1': read-only, fixed to 1

STI_INTR_IMPL

Zicsr, S

Whether or not supervisor-level timer interrupts are implemented. If Sstc is implemented, then STI_INTR_IMPL must be true.

Possible values:

true:: Supervisor-level timer interrupts are implemented. mie.STIE and mideleg.STI are writable.

false:: Supervisor-level timer interrupts are not implemented. mie.STIE, mip.STIP, and mideleg.STI are read-only zero.

STVAL_WIDTH

S

The number of implemented bits in stval.

Must be greater than or equal to max(PHYS_ADDR_WIDTH, VA_SIZE)

SUPPORTED_PMLEN_SMMPM

Smmpm

The PMLEN values supported by the Smmpm pointer masking facility for M-mode, selected via the PMM field in mseccfg. PMLEN is the number of high-order bits of an address that are masked.

Options:

0:: PMLEN=0 (pointer masking is disabled) 7:: PMLEN=XLEN-57 (i.e., PMLEN=7 on RV64) 16:: PMLEN=XLEN-48 (i.e., PMLEN=16 on RV64)

The current standard only supports these values (zpm.adoc, tag norm:pmlen_supported_values). PMM=00 (pointer masking disabled, PMLEN=0) is mandatory and always available, so it is mandatory here.

SUPPORTED_PMLEN_SMNPM

Smnpm

The PMLEN values supported by the Smnpm pointer masking facility for the next privilege mode below M-mode (S/HS if S-mode is implemented, or U-mode otherwise), selected via the PMM field in menvcfg. PMLEN is the number of high-order bits of an address that are masked.

Options:

0:: PMLEN=0 (pointer masking is disabled) 7:: PMLEN=XLEN-57 (i.e., PMLEN=7 on RV64) 16:: PMLEN=XLEN-48 (i.e., PMLEN=16 on RV64)

The current standard only supports these values (zpm.adoc, tag norm:pmlen_supported_values). PMM=00 (pointer masking disabled, PMLEN=0) is mandatory and always available, so it is mandatory here.

SUPPORTED_PMLEN_SSNPM

Ssnpm

The PMLEN values supported by the Ssnpm pointer masking facility for the next privilege mode below S-mode (U-mode, and VS-/VU-modes if the H extension is present), selected via the PMM field in senvcfg. PMLEN is the number of high-order bits of an address that are masked.

Options:

0:: PMLEN=0 (pointer masking is disabled) 7:: PMLEN=XLEN-57 (i.e., PMLEN=7 on RV64) 16:: PMLEN=XLEN-48 (i.e., PMLEN=16 on RV64)

The current standard only supports these values (zpm.adoc, tag norm:pmlen_supported_values). PMM=00 (pointer masking disabled, PMLEN=0) is mandatory and always available, so it is mandatory here.

SUPPORT_FRACTIONAL_LMUL_BEYOND_REQUIRED

Zvl32b

For a given supported fractional LMUL setting, implementations must provide support for SEW settings covering the range from SEW_MIN up to LMUL * ELEN, inclusive. This ensures types narrower than the maximum SEW are supported when fractional LMULs are selected.

SV32X4_TRANSLATION

H

Whether or not Sv32x4 translation mode is supported.

SV32_VSMODE_TRANSLATION

H

Whether or not Sv32 translation is supported in first-stage (VS-stage) translation.

SV39X4_TRANSLATION

H

Whether or not Sv39x4 translation mode is supported.

SV39_VSMODE_TRANSLATION

H

Whether or not Sv39 translation is supported in first-stage (VS-stage) translation.

SV48X4_TRANSLATION

H

Whether or not Sv48x4 translation mode is supported.

SV48_VSMODE_TRANSLATION

H

Whether or not Sv48 translation is supported in first-stage (VS-stage) translation.

SV57X4_TRANSLATION

H

Whether or not Sv57x4 translation mode is supported.

SV57_VSMODE_TRANSLATION

H

Whether or not Sv57 translation is supported in first-stage (VS-stage) translation.

SXLEN

S

Set of XLENs supported in S-mode. Can be one of:

* [32]: SXLEN is always 32 * [64]: SXLEN is always 64 * [32, 64]: SXLEN can be changed (via mstatus.SXL) between 32 and 64

S_MODE_ENDIANNESS

S

Endianness of data in S-mode. Can be one of:

* little: S-mode data is always little endian * big: S-mode data is always big endian * dynamic: S-mode data can be either little or big endian, depending on the CSR field mstatus.SBE

TINST_VALUE_ON_BREAKPOINT

H

Value written into htinst/mtinst on a Breakpoint exception from VU/VS-mode.

Possible values: * "always zero": Always write the value zero * "custom": Write a custom value, which results in UNPREDICTABLE

TINST_VALUE_ON_FINAL_INSTRUCTION_GUEST_PAGE_FAULT

H

Value written into htinst/mtinst when there is an instruction guest-page fault on a final translation.

Possible values: * "always zero": Always write the value zero * "always pseudoinstruction": Always write the pseudoinstruction

TINST_VALUE_ON_FINAL_LOAD_GUEST_PAGE_FAULT

H

Value written into htinst/mtinst when there is a load guest-page fault on a final translation.

Possible values: * "always zero": Always write the value zero * "always pseudoinstruction": Always write the pseudoinstruction * "always transformed standard instruction": Always write the transformation of the standard instruction encoding * "custom": A custom value, which will cause an UNPREDICTABLE event.

TINST_VALUE_ON_FINAL_STORE_AMO_GUEST_PAGE_FAULT

H

Value written into htinst/mtinst when there is a store/AMO guest-page fault on a final translation.

Possible values: * "always zero": Always write the value zero * "always pseudoinstruction": Always write the pseudoinstruction * "always transformed standard instruction": Always write the transformation of the standard instruction encoding * "custom": A custom value, which will cause an UNPREDICTABLE event.

TINST_VALUE_ON_INSTRUCTION_ADDRESS_MISALIGNED

H

Value written into htinst/mtinst when there is an instruction address misaligned exception.

Possible values: * "always zero": Always write the value zero * "custom": Write a custom value, which results in UNPREDICTABLE

TINST_VALUE_ON_LOAD_ACCESS_FAULT

H

Value written into htinst/mtinst on an AccessFault exception from VU/VS-mode.

Possible values: * "always zero": Always write the value zero * "always transformed standard instruction": Always write a transformed standard instruction as defined by H * "custom": Write a custom value, which results in UNPREDICTABLE

TINST_VALUE_ON_LOAD_ADDRESS_MISALIGNED

H

Value written into htinst/mtinst on a LoadAddressMisaligned exception from VU/VS-mode.

Possible values: * "always zero": Always write the value zero * "always transformed standard instruction": Always write a transformed standard instruction as defined by H * "custom": Write a custom value, which results in UNPREDICTABLE

TINST_VALUE_ON_LOAD_PAGE_FAULT

H

Value written into htinst/mtinst on a LoadPageFault exception from VU/VS-mode.

Possible values: * "always zero": Always write the value zero * "always transformed standard instruction": Always write a transformed standard instruction as defined by H * "custom": Write a custom value, which results in UNPREDICTABLE

TINST_VALUE_ON_MCALL

H

Value written into htinst/mtinst on a MCall exception from VU/VS-mode.

Possible values: * "always zero": Always write the value zero * "custom": Write a custom value, which results in UNPREDICTABLE

TINST_VALUE_ON_SCALL

H

Value written into htinst/mtinst on a SCall exception from VU/VS-mode.

Possible values: * "always zero": Always write the value zero * "custom": Write a custom value, which results in UNPREDICTABLE

TINST_VALUE_ON_STORE_AMO_ACCESS_FAULT

H

Value written into htinst/mtinst on an AccessFault exception from VU/VS-mode.

Possible values: * "always zero": Always write the value zero * "always transformed standard instruction": Always write a transformed standard instruction as defined by H * "custom": Write a custom value, which results in UNPREDICTABLE

TINST_VALUE_ON_STORE_AMO_ADDRESS_MISALIGNED

H

Value written into htinst/mtinst on a StoreAmoAddressMisaligned exception from VU/VS-mode.

Possible values: * "always zero": Always write the value zero * "always transformed standard instruction": Always write a transformed standard instruction as defined by H * "custom": Write a custom value, which results in UNPREDICTABLE

TINST_VALUE_ON_STORE_AMO_PAGE_FAULT

H

Value written into htinst/mtinst on a StoreAmoPageFault exception from VU/VS-mode.

Possible values: * "always zero": Always write the value zero * "always transformed standard instruction": Always write a transformed standard instruction as defined by H * "custom": Write a custom value, which results in UNPREDICTABLE

TINST_VALUE_ON_UCALL

H

Value written into htinst/mtinst on a UCall exception from VU/VS-mode.

Possible values: * "always zero": Always write the value zero * "custom": Write a custom value, which results in UNPREDICTABLE

TINST_VALUE_ON_VIRTUAL_INSTRUCTION

H

Value written into htinst/mtinst on a VirtualInstruction exception from VU/VS-mode.

Possible values: * "always zero": Always write the value zero * "custom": Write a custom value, which results in UNPREDICTABLE

TINST_VALUE_ON_VSCALL

H

Value written into htinst/mtinst on a VSCall exception from VU/VS-mode.

Possible values: * "always zero": Always write the value zero * "custom": Write a custom value, which results in UNPREDICTABLE

TRAP_ON_ECALL_FROM_S

S

Whether or not an ECALL-from-S-mode causes a synchronous exception.

The spec states that implementations may handle ECALLs transparently without raising a trap, in which case the EEI must provide a builtin.

TRAP_ON_ECALL_FROM_U

U

Whether or not an ECALL-from-U-mode causes a synchronous exception.

The spec states that implementations may handle ECALLs transparently without raising a trap, in which case the EEI must provide a builtin.

TRAP_ON_ECALL_FROM_VS

H

Whether or not an ECALL-from-VS-mode causes a synchronous exception.

The spec states that implementations may handle ECALLs transparently without raising a trap, in which case the EEI must provide a builtin.

TRAP_ON_ILLEGAL_WLRL

Sm

Options:

* true: Writing an illegal value to a WLRL CSR field will cause an IllegalInstruction exception. * false: Writing an illegal value to a WLRL CSR field causes unpredictable behavior.

TRAP_ON_RESERVED_INSTRUCTION

Sm

Options:

* true: Fetching an unimplemented and/or undefined instruction from the standard/reserved opcode space will cause an IllegalInstruction exception. * false: Fetching an unimplemented and/or undefined instruction from the standard/reserved opcose space causes unpredictable behavior.

TRAP_ON_RESERVED_INSTRUCTION may be false while TRAP_ON_UNIMPLEMENTED_INSTRUCTION is true when a custom instruction is implemented in the standard/reserved opcode space.

TRAP_ON_SFENCE_VMA_WHEN_SATP_MODE_IS_READ_ONLY

S, Sv32, Sv39, Sv48, Sv57

For implementations that make satp.MODE read-only zero (always Bare, i.e., no virtual translation is implemented), attempts to execute an SFENCE.VMA instruction might raise an illegal-instruction exception.

TRAP_ON_SFENCE_VMA_WHEN_SATP_MODE_IS_READ_ONLY indicates whether or not that exception occurs.

TRAP_ON_SFENCE_VMA_WHEN_SATP_MODE_IS_READ_ONLY has no effect when some virtual translation mode is supported.

TRAP_ON_UNIMPLEMENTED_CSR

Sm

Options:

* true: Accessing an unimplemented CSR (via a Zicsr instruction) will cause an IllegalInstruction exception. * false: Accessing an unimplemented CSR (via a Zicsr instruction) will cause unpredictable behavior.

TRAP_ON_UNIMPLEMENTED_INSTRUCTION

Sm

Options:

* true: Fetching an unimplemented instruction will cause an IllegalInstruction exception. * false: Fetching an unimplemented instruction causes unpredictable behavior.

An unimplemented instruction is any instruction encoding that is not defined by the implementation. Custom instructions are considered implemented.

UXLEN

U

Set of XLENs supported in U-mode. When both 32 and 64 are supported, UXLEN can be changed, via mstatus.UXL, between 32 and 64.

U_MODE_ENDIANNESS

U

Endianness of data in U-mode. Can be one of:

* little: U-mode data is always little endian * big: U-mode data is always big endian * dynamic: U-mode data can be either little or big endian, depending on the CSR field mstatus.UBE

VECTOR_FF_NO_EXCEPTION_TRIM

Zvl32b

Implementations may process fewer than vl elements and reduce vl even when no exception occurs. However, if vstart == 0 and vl > 0, at least one element must be processed.

VECTOR_FF_SEG_EXCEPTION_PARTIAL_LOAD

Zvl32b

For fault-only-first segment loads, if an exception occurs partway through the zeroth segment, the trap is taken. If it occurs in a subsequent segment, vl may be reduced to the index of that segment. It is implementation-defined whether a partial subset of the segment is loaded before the trap.

VECTOR_FF_UPDATE_PAST_TRIM

Zvl32b

Fault-only-first (FF) load instructions may update active destination elements beyond the index that causes vector-length trimming, but not past the original vl. These spurious updates need not reflect the true memory contents; non-idempotent memory should only be accessed when the load is guaranteed not to be retried.

VECTOR_LOAD_PAST_TRAP

Zvl32b

Vector load instructions may overwrite active destination vector register group elements past the element index where a trap is reported; the behavior for elements beyond the trap index is implementation-defined.

VECTOR_LOAD_SEG_FF_OVERWRITE_ELEMENTS_AFTER_FAULT

Zvl32b

Fault-only-first segment load instructions may overwrite destination vector register group elements beyond the point where a trap is reported or where vl is trimmed; the exact values written may be implementation-defined.

VECTOR_LS_INDEX_MAX_EEW

Zvl32b

A profile may place an upper limit on the maximum supported index EEW used by vector load/store indexing. For example, some profiles may limit indexing to sizes no larger than XLEN or a fixed EEW value.

VECTOR_LS_MISALIGNED_LEGAL

Zvl32b

If an element accessed by a vector memory instruction is not naturally aligned to the size of the element, either the element is transferred successfully or an address misaligned exception is raised on that element. Support for misaligned vector memory accesses is independent of an implementation’s support for misaligned scalar memory accesses.

VECTOR_LS_SEG_PARTIAL_ACCESS

Zvl32b

If a trap occurs during access to a segment, it is implementation-defined whether some, all, or none of that segment’s element accesses are performed before the trap is taken.

VECTOR_LS_WHOLEREG_MISALIGNED_LEGAL

Zvl32b

Implementations may raise a misaligned address exception for whole-register loads/stores if the base address is not aligned to the maximum of the encoded EEW size (in bytes) or the implementation’s smallest supported SEW (in bytes).

VFREDUSUM_FINAL_NODE_ELEMENT_BEHAVIOR

Zvl32b

Implementations are permitted to insert an additional additive identity into the final reduction result, which may affect the final outcome when no active elements are present.

VFREDUSUM_INACTIVE_NODE_ELEMENT_BEHAVIOR

Zvl32b

A reduction node that receives an input derived solely from masked-off elements or elements beyond vl may either treat that input as the additive identity for the appropriate element width or copy the other input through unchanged to the node output.

VFREDUSUM_NAN

Zvl32b

The reduction tree structure must be deterministic for a given vtype and vl; as a consequence, implementations need not preserve NaN payloads when no elements are active. If no elements are active and the scalar input is NaN, implementations may canonicalize it (and raise an exception if it is a signaling NaN) or pass it through unchanged.

VFREDUSUM_NODE_ROUNDING_BEHAVIOR

Zvl32b

Each reduction operator computes an exact sum using an ideal scalar floating-point addition, then converts that result into a floating- point format with range and precision at least as large as the element SEW, rounding with the current dynamic rounding mode and raising exceptions as needed. Implementations may choose the exact range and precision per operator.

VILL_SET_ON_RESERVED_VTYPE

Zvl32b

Use of vtype encodings with LMUL < SEW_MIN/ELEN is reserved. Implementations may set the vill status bit to indicate such vtype encodings are unsupported, providing a software-visible indication of invalid vtype selections.

VLEN

Zvl32b

The number of bits in a single vector register.

VMID_WIDTH

H

Number of bits supported in hgatp.VMID (i.e., the supported width of a virtual machine ID).

VSEI_INTR_IMPL

Zicsr, H

Whether or not virtual supervisor-level external interrupts are implemented.

Possible values:

true:: Virtual supervisor-level external interrupts are implemented. mie.VSEIE and mideleg.VSEI are writable.

false:: Virtual supervisor-level external interrupts are not implemented. mie.VSEIE, mip.VSEIP, and mideleg.VSEI are read-only zero.

VSSI_INTR_IMPL

Zicsr, H

Whether or not virtual supervisor-level software interrupts are implemented.

Possible values:

true:: Virtual supervisor-level software interrupts are implemented. mie.VSSIE and mideleg.VSSI are writable.

false:: Virtual supervisor-level software interrupts are not implemented. mie.VSSIE, mip.VSSIP, and mideleg.VSSI are read-only zero.

VSSTAGE_MODE_BARE

H

Whether or not writing mode=Bare is supported in the vsatp register.

VSSTATUS_VS_EXISTS

Zvl32b

Some implementations provide a vsstatus.VS field even when the misa.V bit is clear. This parameter indicates whether vsstatus.VS exists independently of the misa.V setting.

VSTI_INTR_IMPL

Zicsr, H

Whether or not virtual supervisor-level timer interrupts are implemented. If Sstc is implemented, then VSTI_INTR_IMPL must be true.

Possible values:

true:: Virtual supervisor-level timer interrupts are implemented. mie.VSTIE and mdeleg.VSTI are writable.

false:: Virtual supervisor-level timer interrupts are not implemented. mie.VSTIE, mip.VSTIP, and and mdeleg.VSTI are read-only zero.

VSTVEC_MODES

H

Options:

0:: Direct; All traps set pc to vstvec.BASE 1:: Vectored; Asynchronous interrupts set pc to vstvec.BASE + 4 x cause.

If only one mode is given, vstvec.MODE is assumed to be read-only with that value. Otherwise, vstvec.MODE is read-write.

VSXLEN

H

Set of XLENs supported in VS-mode. Can be one of:

* [32]: VSXLEN is always 32 * [64]: VSXLEN is always 64 * [32, 64]: VSXLEN can be changed (via hstatus.VSXL) between 32 and 64

VS_MODE_ENDIANNESS

H

Endianness of data in VS-mode. Can be one of:

* little: VS-mode data is always little endian * big: VS-mode data is always big endian * dynamic: VS-mode data can be either little or big endian, depending on the CSR field hstatus.VSBE

VUXLEN

H

Set of XLENs supported in VU-mode. When both 32 and 64 are supported, VUXLEN can be changed via vsstatus.UXL.

VU_MODE_ENDIANNESS

H

Endianness of data in VU-mode. Can be one of:

* little: VU-mode data is always little endian * big: VU-mode data is always big endian * dynamic: VU-mode data can be either little or big endian, depending on the CSR field vsstatus.UBE

WFI_FINITE

Sm

Options:

* true: WFI resumes execution after waiting for a finite amount of time * false: WFI may continue waiting until another event causes execution to resume

WFI_U_MODE

Sm

Options:

* true: WFI can be executed in U mode * false: Executing WFI in U mode raises an illegal instruction exception

ZAWRS_NTO_IS_NOP

Zawrs

When true, WRS.NTO completes immediately, behaving as a no-op, rather than stalling the hart.

Appendix E: Examples

This appendix gives examples of coverpoints and tests consistent with the test plan. These examples are not the only way to satisfy the testplan.

E.1. Unprivileged example: add

Coverage is in I_coverage.svh:

Listing 2. add Covergroup
covergroup I_add_cg with function sample(ins_t ins);
    option.per_instance = 0;
    cp_asm_count : coverpoint ins.ins_str == "add"  iff (ins.trap == 0 )  {
        //Number of times instruction is executed
        bins count[]  = {1};
    }
    cp_rs1 : coverpoint ins.get_gpr_reg(ins.current.rs1)  iff (ins.trap == 0 )  {
        //RS1 register assignment
    }
    cp_rs2 : coverpoint ins.get_gpr_reg(ins.current.rs2)  iff (ins.trap == 0 )  {
        //RS2 register assignment
    }
    cp_rd : coverpoint ins.get_gpr_reg(ins.current.rd)  iff (ins.trap == 0 )  {
        //RD register assignment
    }
    cp_rs1_edges : coverpoint unsigned'(ins.current.rs1_val)  iff (ins.trap == 0 )  {
        `ifdef UDB_MXLEN_32
            bins zero     = {0};
            bins one      = {32'b00000000000000000000000000000001};
            bins two      = {32'b00000000000000000000000000000010};
            bins min      = {32'b10000000000000000000000000000000};
            bins minp1    = {32'b10000000000000000000000000000001};
            bins max      = {32'b01111111111111111111111111111111};
            bins maxm1    = {32'b01111111111111111111111111111110};
            bins ones     = {32'b11111111111111111111111111111111};
            bins onesm1   = {32'b11111111111111111111111111111110};
            bins walkodd  = {32'b10101010101010101010101010101010};
            bins walkeven = {32'b01010101010101010101010101010101};
            wildcard bins random = {32'b01???????????????????????????010};
        `else
            bins zero     = {0};
            bins one      = {64'b0000000000000000000000000000000000000000000000000000000000000001};
            bins two      = {64'b0000000000000000000000000000000000000000000000000000000000000010};
            bins min      = {64'b1000000000000000000000000000000000000000000000000000000000000000};
            bins minp1    = {64'b1000000000000000000000000000000000000000000000000000000000000001};
            bins Wmax     = {64'b0000000000000000000000000000000011111111111111111111111111111111};
            bins Wmaxm1   = {64'b0000000000000000000000000000000011111111111111111111111111111110};
            bins Wmaxp1   = {64'b0000000000000000000000000000000100000000000000000000000000000000};
            bins Wmaxp2   = {64'b0000000000000000000000000000000100000000000000000000000000000001};
            bins W80      = {64'b0000000000000000000000000000000010000000000000000000000000000000};
            bins W7F      = {64'b0000000000000000000000000000000001111111111111111111111111111111};
            bins max      = {64'b0111111111111111111111111111111111111111111111111111111111111111};
            bins maxm1    = {64'b0111111111111111111111111111111111111111111111111111111111111110};
            bins ones     = {64'b1111111111111111111111111111111111111111111111111111111111111111};
            bins onesm1   = {64'b1111111111111111111111111111111111111111111111111111111111111110};
            bins walkodd  = {64'b1010101010101010101010101010101010101010101010101010101010101010};
            bins walkeven = {64'b0101010101010101010101010101010101010101010101010101010101010101};
            wildcard bins random = {64'b01???????????????????????????????????????????????????????????010};
        `endif
    }
    cp_rs2_edges : coverpoint unsigned'(ins.current.rs2_val)  iff (ins.trap == 0 )  {
        `ifdef UDB_MXLEN_32
            bins zero  =    {0};
 ...
        `else
            bins zero  = {0};
            ...
        `endif
    }
    cr_rs1_rs2_edges : cross cp_rs1_edges,cp_rs2_edges  iff (ins.trap == 0 )  {
        //Cross coverage of RS1 edges and RS2 edges
    }
    cmp_rs1_rs2 : coverpoint ins.get_gpr_reg(ins.current.rs1)  iff (ins.current.rs1 == ins.current.rs2 & ins.trap == 0 )  {
        //Compare assignments of all registers
    }
    cmp_rd_rs1 : coverpoint ins.get_gpr_reg(ins.current.rd)  iff (ins.current.rd == ins.current.rs1 & ins.trap == 0 )  {
        //Compare assignments of all registers
    }
    cmp_rd_rs2 : coverpoint ins.get_gpr_reg(ins.current.rd)  iff (ins.current.rd == ins.current.rs2 & ins.trap == 0 )  {
        //Compare assignments of all registers
    }
    cmp_rd_rs1_rs2 : coverpoint ins.get_gpr_reg(ins.current.rd)  iff (ins.current.rd == ins.current.rs1 & ins.current.rd == ins.current.rs2 & ins.trap == 0 )  {
        //Compare assignments of all registers
    }
    cp_gpr_hazard_rw : coverpoint check_gpr_hazards(ins.hart, ins.issue)  iff (ins.trap == 0 )  {
        //GPR Hazard
        bins hazards[]  = {NO_HAZARD, RAW_HAZARD, WAW_HAZARD, WAR_HAZARD};
    }
endgroup

Corresponding RV32 tests are in tests/rv32/I/I-add.S. Observe how the directed tests align with the coverpoints and bins. Register numbers and values are randomized unless they are swept by the coverpoint. The RVTEST_SIGUPD macro compares the result against an expected signature produced by a reference model. When register 0 is used, it is loaded with a random value, but hardwired to 0, so the reference model will show that it behaves as 0.

Listing 3. add Tests
# Testcase cp_rs1 (Test source rs1 = x0)
li x0, 0xb4e96718 # initialize rs1
li x24, 0xeaa512b3 # initialize rs2
add x25, x0, x24 # perform operation
RVTEST_SIGUPD(x3, x25)

# Testcase cp_rs1 (Test source rs1 = x1)
li x1, 0x81c4ef2a # initialize rs1
li x6, 0x917cfa69 # initialize rs2
add x7, x1, x6 # perform operation
RVTEST_SIGUPD(x3, x7)

...

# Testcase cp_rs1 (Test source rs1 = x31)
mv x21, x31 # switch signature pointer register to avoid conflict with test
li x31, 0x1508dd4e # initialize rs1
li x14, 0x830d07b0 # initialize rs2
add x11, x31, x14 # perform operation
RVTEST_SIGUPD(x21, x11)


# Testcase cp_rd (Test destination rd = x0)
li x19, 0x1d01c852 # initialize rs1
li x9, 0x1bfbf146 # initialize rs2
add x0, x19, x9 # perform operation
RVTEST_SIGUPD(x20, x0)

# Testcase cp_rd (Test destination rd = x1)
li x26, 0x1e3aafcf # initialize rs1
li x19, 0x986da37b # initialize rs2
add x1, x26, x19 # perform operation
RVTEST_SIGUPD(x20, x1)

...

# Testcase cr_rs1_rs2_edges (Test source rs1 = 0x0 rs2 = 0x0)
li x15, 0x00000000 # initialize rs1
li x5, 0x00000000 # initialize rs2
add x11, x15, x5 # perform operation
RVTEST_SIGUPD(x10, x11)

# Testcase cr_rs1_rs2_edges (Test source rs1 = 0x0 rs2 = 0x1)
li x1, 0x00000000 # initialize rs1
li x31, 0x00000001 # initialize rs2
add x20, x1, x31 # perform operation
RVTEST_SIGUPD(x10, x20)

# Testcase cr_rs1_rs2_edges (Test source rs1 = 0x0 rs2 = 0x2)
li x27, 0x00000000 # initialize rs1
li x3, 0x00000002 # initialize rs2
add x11, x27, x3 # perform operation
RVTEST_SIGUPD(x10, x11)

# Testcase cr_rs1_rs2_edges (Test source rs1 = 0x0 rs2 = 0x80000000)
li x8, 0x00000000 # initialize rs1
li x5, 0x80000000 # initialize rs2
add x16, x8, x5 # perform operation
RVTEST_SIGUPD(x10, x16)

E.2. Test case example: cr_rs1_rs2_edges bin with rs1 = 0x0, rs2 = 0x80000000

# Testcase cr_rs1_rs2_edges (Test source rs1 = 0x0 rs2 = 0x80000000)
li x8, 0x00000000 # initialize rs1 in randomly selected register
li x5, 0x80000000 # initialize rs2 in randomly selected register
add x16, x8, x5 # perform operation, write randomly selected destination register
# load expected value of 0x800000000 into x20 from table pointed to by x10. Check x20 against x16 and report mismatch
RVTEST_SIGUPD(x10, x16, x20)

RVTEST_SIGUPD macro:

if (RVTEST_SELFCHECK) # check result against signature
    LREG x20, 0(x10)
    beq x16, x20, 1f
    ecall
    1f:
else # generate signature
    SREG x16, 0(x10)
    addi x10, x10, WORDSIZE
    nop

1. Extended RVVI adds signals for virtual memory verification, including physical and virtual instruction and data addresses, and I/D TLB entries.
2. Portions of riscvISACOV that depend on proprietary Synopsys code such as a disassembler have been replaced with open-source equivalents
3. cp_asm_count is an exception, just counting the number of times the instruction was executed
4. Certain instructions are omitted if not supported for a given SEW. For example, widening add vwadd.vv is not supported for SEW=64, and vrgatherei16.v is not supported for SEW=8.