CSR Bit Fields

RISC-V vlenb CSR Register

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

vlenb at 0xC22 is a Vector register length bytes CSR: read-only byte length of one architectural vector register.

Bit Overview
bit 3 = only bit 3; bits 12..11 = bits 12 down to 11
MSBLSB
Field Map

Understand vlenb By Bit Fields

1 key fields
XLEN-1:0

VLENB

RO

Vector register length in bytes, equal to VLEN/8.

VLENB (bits XLEN-1:0) — Vector register length in bytes, equal to VLEN/8.

What This Field Controls

  • - Vector register length in bytes, equal to VLEN/8.

Common Values

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

Official Basis & Search Notes

vlenb is a RO CSR in user vector state csrs at 0xC22. Check privilege and implemented extensions before interpreting its bit fields.

vlenb address, lowest access privilege, and access class are checked against the official CSR table: 0xC22, User/Vector, RO.
vlenb belongs to vector-extension state; it has the corresponding software meaning only when the relevant vector extension is implemented.
This is a read-only CSR; do not write it. Ignore reserved or WPRI field values on reads, and preserve unchanged fields when writing writable CSRs.

What To Check First When Reading This CSR

  • - First confirm that the current hart implements vlenb; unimplemented or insufficiently privileged accesses raise an illegal-instruction exception.
  • - Use address 0xC22 and the lowest access privilege (User/Vector) to decide whether software may read it directly.
  • - Do not assume fixed values for reserved, WARL, or WLRL bits; interpret the value according to the specification and implementation.

Risk Checks Before Writing

  • - vlenb is a read-only CSR; writes raise an illegal-instruction exception or are disallowed by the implementation.

Put It Back Into A Real Flow

1

Read vlenb to obtain hardware or runtime state.

2

Interpret the returned value according to the field descriptions and do not attempt to write it back.

3

If reading fails at the current privilege level, handle the illegal-instruction exception path.

FAQ

Can vlenb be accessed from any privilege level?

Do not decide from the CSR name alone. The official CSR address encoding and tables define the lowest access privilege; this entry records vlenb as User/Vector. Access with insufficient privilege or to an unimplemented CSR raises an illegal-instruction exception.

What is easiest to miss when using vlenb?

vlenb is read-only. Treat it as an observation point, do not try to write it, and do not depend on fixed values for reserved or WPRI fields.