5.5.3 Conditional formatting

In some cases, the formatting of a variable might depend on the value of one or more bits in that variable or in another variable.

This can be expressed with the map statement:


The variable is replaced with either the default or any of the specified formats. It is replaced with the format that is defined for a specific numeric value (key) if the variable has this numeric value. If the variable has a value that is not listed in the mapping, then it is replaced with the default. default and all specified formats might in turn contain map statements and variable references. default and the formats might contain literal = characters.

For example, this statement prints either a 10-bit index or a 20-bit address in the status register, depending on bit[31] in the status register:

Non-ConfidentialPDF file icon PDF version101196_0100_03_en
Copyright © 2018, 2019 Arm Limited or its affiliates. All rights reserved.