| CMSIS-SVD Version 1.2 CMSIS System View Description

- CMSIS
- CORE
- Driver
- DSP
- RTOS API
- Pack
- SVD

- Main Page
- Usage and Description
- Reference

Registers Level
SVD File Schema Levels

All registers of a peripheral are enclosed between the <registers> opening and closing tags.

The description of registers is the most essential part of the SVD description. The register's name, detailed description, and the address-offset relative to the peripheral base address are the mandatory elements. If the size, access, reset value, and reset mask have not been specified on the device or peripheral level, or if the default values need to be redefined locally, these fields become mandatory.

A register can represent a single value or can be subdivided into individual bit-fields of specific functionality and semantics. In schema-terms the fields section is optional, however, from a specification perspective, fields are mandatory when they are described in the device documentation.

The SVD specification supports the array-of-registers concept. The single register description gets duplicated automatically into an array. The size of the array is specified by the <dim> element. The register names can be composed by the register name and an index specific substring define in <dimIndex>. The <dimIncrement> specifies the address offset between two registers.

    <registers>

        <register derivedFrom=identifierType>

            <!-- dimElementGroup -->
            <dim>scaledNonNegativeInteger</dim>
            <dimIncrement>scaledNonNegativeInteger</dimIncrement>
            <dimIndex>xs:string</dimIndex>
            <!-- end of dimElementGroup -->

            <name>identifierType</name>

            <displayName>xs:string</displayName>

            <description>xs:string</description>

            <alternateGroup>xs:Name</alternateGroup>

            <addressOffset>scaledNonNegativeInteger</addressOffset>

            <!-- registerPropertiesGroup -->
            <size>scaledNonNegativeInteger</size>
            <access>accessType</access>
            <resetValue>scaledNonNegativeInteger</resetValue>
            <resetMask>scaledNonNegativeInteger</resetMask>
            <!-- end of registerPropertiesGroup -->

            <modifiedWriteValues>writeValueType</modifiedWriteValues>
            <writeConstraint>writeConstraintType</writeConstraint>
            <readAction>readActionType</readAction>

            <fields>
                ...
            </fields>

        </register>
        ...
        <register>
            ...
        </register>

    <registers>

Attribute Name | Description | Type | Occurrence
--- | --- | --- | ---
derivedFrom | Specifies the name of the register from which to inherit the data. Elements being specified underneath will override the inherited values. Remarks: When deriving a register, it is mandatory to specify at least the name, the description, and the addressOffset. | xs:Name | 0..1
Element Name | Description | Type | Occurrence
See dimElementGroup for details.
dim | The value defines the number of elements in an array of registers. | scaledNonNegativeInteger | 1..1
dimIncrement | If dim is specified, this element becomes mandatory. The element specifies the address increment in between two neighboring registers of the register array in the address map. | scaledNonNegativeInteger | 1..1
dimIndex | Specifies the substrings that replaces the %s placeholder within the register name. By default, the index is a decimal value starting with 0 for the first register. | dimIndexType | 0..1
name | Name string used to identify the register. Register names are required to be unique within the scope of a peripheral. | registerNameType | 1..1
displayName | When specified, the string is being used by a graphical frontend to visualize the register. Otherwise the name element is displayed. The displayName may contain special characters and white spaces. The place holder s can be used and is replaced by the dimIndex substring. | xs:string | 0..1
description | String describing the details of the register. | xs:string | 0..1
alternateGroup | Specifies a group name associated with all alternate register that have the same name. At the same time, it indicates that there is a register definition allocating the same absolute address in the address space. | xs:Name | 0..1
addressOffset | Value defining the address of the register relative to the baseAddress defined by the peripheral of the register. | scaledNonNegativeInteger | 1..1
See registerPropertiesGroup for details.
size | Defines the default bit-width of any register contained in the device (implicit inheritance). | scaledNonNegativeInteger | 0..1
access | Defines the default access rights for all registers. | accessType | 0..1
resetValue | Defines the default value for all registers at RESET. | scaledNonNegativeInteger | 0..1
resetMask | Identifies which register bits have a defined reset value. | scaledNonNegativeInteger | 0..1

modifiedWriteValues

Element to describe the manipulation of data written to a register. If not specified, the value written to the field is the value stored in the field. The other options define bitwise operations:

- oneToClear: write data bits of one shall clear (set to zero) the corresponding bit in the register.
- oneToSet: write data bits of one shall set (set to one) the corresponding bit in the register.
- oneToToggle: write data bits of one shall toggle (invert) the corresponding bit in the register.
- zeroToClear: write data bits of zero shall clear (set to zero) the corresponding bit in the register.
- zeroToSet: write data bits of zero shall set (set to one) the corresponding bit in the register.
- zeroToToggle: write data bits of zero shall toggle (invert) the corresponding bit in the register.
- clear: after a write operation all bits in the field are cleared (set to zero).
- set: after a write operation all bits in the field are set (set to one).
- modify: after a write operation all bit in the field may be modified (default).

modifiedWriteValuesType

0..1

writeConstraint | Three options exist to set write-constraints: | 0..1
1. writeAsRead | If TRUE, only the last read value can be written. | xs:boolean | 0..1
2. useEnumeratedValues | If TRUE, only the values listed in the enumeratedValues list are considered valid write values. | xs:boolean | 0..1
3. range | Consists of the following two elements: |  | 0..1
minimum | Specifies the smallest number to be written to the field. | scaledNonNegativeInteger | 1..1
maximum | Specifies the largest number to be written to the field. | scaledNonNegativeInteger | 1..1

readAction

If set, it specifies the side effect following a read operation. If not set, the register is not modified. The defined side effects are:

- clear: The register is cleared (set to zero) following a read operation.
- set: The register is set (set to ones) following a read operation.
- modify: The register is modified in some way after a read operation.
- modifyExternal: One or more dependent resources other than the current register are immediately affected by a read operation (it is recommended that the register description specifies these dependencies).

Debuggers are not expected to read this register location unless explicitly instructed by the user.

readActionType

0..1

fields | Next lower level of description (see Fields Level for details). Not all registers are further divided into fields, therefore, this level is optional. In case a register is subdivided into bit fields, it should be reflected in the description. The device header file can only contain bit access macros and bit-field structures if this information is contained in the description. |  | 0..1

# Example:

...
<register>
<name>TimerCtrl0</name>
<description>Timer Control Register</description>
<addressOffset>0x0</addressOffset>
<access>read-write</access>
<resetValue>0x00008001</resetValue>
<resetMask>0x0000ffff</resetMask>
<size>32</size>
<fields>
...
</fields>
</register>
<register derivedFrom="TimerCtrl0">
<name>TimerCtrl1</name>
<description>Derived Timer</description>
<addressOffset>0x4</addressOffset>
</register>
...