CSR Bit Fields

RISC-V vl CSR Register

Address 0xC20Privilege User/VectorAccess RO / XLENUser vector state CSRs

vl is an XLEN-bit read-only CSR that holds the number of elements for which a vector instruction updates results.

Field Map

Understand vl By Bit Fields

1 key fields
XLEN-1:0

VL

RO

Number of elements for which a vector instruction updates results. It can only be updated by vset{i}vl{i} instructions and fault-only-first vector-load variants.

VL (bits XLEN-1:0) — Number of elements for which a vector instruction updates results. It can only be updated by vset{i}vl{i} instructions and fault-only-first vector-load variants.

What This Field Controls

  • - Number of elements for which a vector instruction updates results. It can only be updated by vset{i}vl{i} instructions and fault-only-first vector-load variants.

Common Values

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

Official Basis & Search Notes

vl holds the current number of elements for which a vector instruction updates results.

vl is an XLEN-bit read-only CSR, updated only by vset{i}vl{i} and fault-only-first vector-load variants.
vset{i}vl{i} sets vl from AVL and vtype.

What To Check First When Reading This CSR

  • - Accessing a vector CSR raises an illegal-instruction exception when mstatus.VS is Off.
  • - The number of implemented vl bits depends on the implementation’s maximum vector length of the smallest supported type.

Risk Checks Before Writing

  • - vl is a read-only CSR; software cannot directly modify it with a CSR write.
  • - Use vset{i}vl{i}, or the applicable fault-only-first-load semantics, to update vl.

Put It Back Into A Real Flow

1

Use vset{i}vl{i} to set vtype and vl and receive the new vl in a general-purpose register.

2

Read vl to learn the current number of elements for which results are updated.

FAQ

Which operations can update vl?

vl is an XLEN-bit read-only CSR that holds the number of elements for which a vector instruction updates results.