Importer
Importing OpenTitan hjson definitions can occur at any point alongside normal SystemRDL
file compilation. When an OpenTitana hjson file is imported, the register description is
loaded into the SystemRDL register model as if it were an addrmap
component
declaration. Once imported, the OpenTitan hjson contents can be used as-is, or
referenced from another RDL file.
Since the target register used internally uses SystemRDL semantics, the import operation does a ‘best effort’ attempt to faithfully map the concepts described in OpenTitan hjson into SystemRDL objects.
Some of the properties in OpenTitan hjson do not exist in SystemRDL, and vice versa. In those cases a warning is printed during conversion and/or a sane conversion value is assumed.
Field swaccess and hwaccess fields
SystemRDL supports more sw and hw access properties than OpenTitan format. OpenTitan uses swaccess string property to describe the effect of software access to a field, to get the wanted behaviour in SystemRDL it is neccessary to use sw, onread, onwrite properties additionally. The table is shown next.
OT SW |
Desc |
RDL sw |
RDL onwrite |
RDL onread |
Comment |
---|---|---|---|---|---|
none |
No access |
na |
Invalid in SystemRDL |
||
ro |
Read Only |
r |
|||
rc |
Read Only, reading clears |
r |
rclr |
||
rw |
Read/Write |
rw |
|||
r0w1c |
Read zero, Write with 1 clears |
rw |
woclr |
Read zero does not map to RDL |
|
rw1s |
Read, Write with 1 sets |
rw |
woset |
||
rw1c |
Read, Write with 1 clears |
rw |
woset |
||
rw0c |
Read, Write with 0 clears |
rw |
wzc |
||
wo |
Write Only |
w |
hwaccess |
Desc |
hw |
---|---|---|
none |
No access |
na |
hro |
Read Only |
r |
hrw |
Read/Write |
rw |
hwo |
Write Only |
w |
API
Limitations
Unfortunately, not all OpenTitan hjson concepts are able to be faithfully translated into SystemRDL. The warning is supposed to be printed whenever such property is encountered in OpenTitan hjson.