CSR Bit Fields

RISC-V vcsr CSR Register

Address 0x00FPrivilege User/VectorAccess RW / XLENUser vector state CSRs

vcsr is an XLEN-bit read-write vector control and status CSR that accesses vxrm through bits 2:1 and vxsat through bit 0.

Field Map

Understand vcsr By Bit Fields

3 key fields
XLEN-1:3

Reserved

Reserved

Reserved bits.

Reserved (bits XLEN-1:3) — Reserved bits.

What This Field Controls

  • - Reserved bits.

Common Values

This field is better understood together with surrounding context than as a fixed memorized enumeration.

Open Official Manual
2:1

VXRM

RW

Vector fixed-point rounding mode; mirrors vxrm[1:0] in the separate vxrm CSR.

VXRM (bits 2:1) — Vector fixed-point rounding mode; mirrors vxrm[1:0] in the separate vxrm CSR.

What This Field Controls

  • - Vector fixed-point rounding mode; mirrors vxrm[1:0] in the separate vxrm CSR.

Common Values

0RNU

Round to nearest up (add 0.5 LSB).

1RNE

Round to nearest even.

2RDN

Round down; the rounding increment is zero.

3ROD

Round to odd; OR discarded bits into the least-significant bit (jam).

Open Official Manual
0

VXSAT

RW

Fixed-point accrued saturation flag; mirrors vxsat[0] in the separate vxsat CSR.

VXSAT (bit 0) — Fixed-point accrued saturation flag; mirrors vxsat[0] in the separate vxsat CSR.

What This Field Controls

  • - Fixed-point accrued saturation flag; mirrors vxsat[0] in the separate vxsat CSR.

Common Values

00

Does not indicate a fixed-point instruction saturated an output to fit its destination format.

11

Indicates at least one fixed-point instruction saturated an output to fit its destination format.

Open Official Manual
Official Basis & Search Notes

The low three vcsr bits mirror the vxrm rounding mode and vxsat accrued saturation flag.

Table 47 defines vcsr[2:1] as vxrm, vcsr[0] as vxsat, and XLEN-1:3 as reserved.
The separate vxrm and vxsat CSRs also access these fields.

What To Check First When Reading This CSR

  • - Accessing a vector CSR raises an illegal-instruction exception when mstatus.VS is Off.
  • - The low three bits of vcsr provide field access to the separate vxrm and vxsat CSRs.

Risk Checks Before Writing

  • - Only the low three bits defined by Table 47 have the meanings stated on this page; do not interpret reserved bits as other control fields.
  • - The vxrm and vxsat fields are also accessible at their separate CSR addresses.

Put It Back Into A Real Flow

1

Read or set the rounding mode through vcsr[2:1].

2

Read or set the accrued saturation flag through vcsr[0].

FAQ

Does vcsr duplicate vxrm and vxsat?

vcsr is an XLEN-bit read-write vector control and status CSR that accesses vxrm through bits 2:1 and vxsat through bit 0.