Skip to main content

CSR description

v0.2
Auto-generated

This page is generated from csr_schema.json by the schema doc generator. To update this page, edit the schema file and run bin/chore gen schema-docs.

A CSR register specification

Schema Structure

This schema requires all of the following:

  • (Complex type)
  • (Complex type)

Definitions

csr_field — Field in a CSR register

Field in a CSR register

PropertyTypeRequiredDescription
descriptionstring | Array<conditional_text>Function of the field
cert_normative_rulesArchitecturally visible behaviors requiring validation by certification tests
affectedByOne of: string | Array<string>Extension(s) that affect the definition of the field beyond the extension (or base) the field is originally defined in
definedByA condition (YAML structure or IDL function). See the conditions reference for details.Where this field is defined: indicates that the field is only present if the extension(s) are implemented. If definedBy is not given, defaults to the definedBy field of the parent CSR
aliasOne of: CSR field | CSR field | Array<One of: CSR field | CSR field>When specified, indicates that this field aliases (a portion of) another CSR field
type_astobject
type()stringFunction that returns a configuration-dependent type. The return value should be a CsrFieldType enum, and must be compile-time-known.
typeRO | RO-H | RW | RW-R | RW-H | RW-RHType of the field. One of: * RO: Read-only immutable * RO-H: Read-only, updated by hardware * RW: Read-write, not updated by hardware * RW-R: Read-write, but values are restricted. sw_write(value) must be provided * RW-H: Read-write, with hardware updates * RW-RH: Read-write, with hardware updates, but values are restricted. sw_write(value) must be provided
sw_write_astobject
sw_write(csr_value)stringFunction implementing custom write behavior for the CSR. Given a 'value', return either the value to be written in the field or false if the write would be illegal. 'value' is the value of the entire CSR, which is sometimes needed to detect illegal writes
reset_value_astobject
reset_value()stringConfiguration-dependent value of the state after reset. Can be UNDEFINED_LEGAL for the generic architecture spec, but must have an integer value for the implementation spec.
reset_valueOne of: integer | string (const: UNDEFINED_LEGAL)Value of the state after reset. Can be UNDEFINED_LEGAL for the generic architecture spec, but must have an integer value for the implementation spec
location_rv64Location of a field in a registerLocation of the field within the CSR register when the effective XLEN of the current mode is 64
location_rv32Location of a field in a registerLocation of the field within the CSR register when the effective XLEN of the current mode is 32
locationLocation of a field in a registerLocation of the field within the CSR register
long_namestringOne line description of the CSR field
namestringName of the field. Optional because it is implied by the object key of the CSR object holding the field

Schema Information

PropertyValue
Versionv0.2
JSON Schema VersionDraft 07