Importing IP-XACT definitions can occur at any point alongside normal SystemRDL file compilation. When an IP-XACT file is imported, the register description is loaded into the SystemRDL register model as if it were an addrmap
component declaration. Once imported, the IP-XACT 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 IP-XACT into SystemRDL objects.
The importer will automatically detect the IP-XACT standard used and will attempt to translate as much of the document into the SystemRDL object model as possible.
- IP-XACT
- Resulting SystemRDL
4
Components- <memoryMap>
A named
addrmap
definition is created.The definition's type name is defined by the concatenation of the parent component's <name> and memoryMap's <name>.
For example:
ComponentName__MemoryMapName
The named definition is imported into the root SystemRDL namespace.
- <addressBlock>
If the addressBlock's <usage> tag specifies "memory", then a named
mem
component is declared. Otherwise, a namedaddrmap
is declared.The definition's type name is defined by the concatenation of the enclosing component's <name>, the parent memoryMap's <name> and the addressBlock's <name>.
For example:
ComponentName__MemoryMapName__AddressBlockName
The named definition is imported into the root SystemRDL namespace.
The definition is also instantiated in the
addrmap
created by the parent memoryMap. The instance name is simply the addressBlock's <name>.
- <registerFile>
regfile
component that is anonymously declared and instantiated in its parent.
- <register>
reg
component that is anonymously declared and instantiated in its parent.
- <field>
field
component that is anonymously declared and instantiated in its parent reg.
4
Fields- <enumeratedValues>
- Creates an
enum
definition that is assigned to the parent field'sencode
property.
- <access>
sw
property.If a <field> does not explicitly define <access>, it may inherit it from the enclosing <register> or <addressBlock>'s <access> tag
- <testable>
donttest
property.
- <readAction>
onread
property.
- <modifiedWriteValue>
onwrite
property.
2
Other- <displayName>
name
property.
- <description>
desc
property.
- <isPresent>
ispresent
property.
Some of IP-XACTs semantics are slightly more permissive than SystemRDL. Since the importer must translate concepts to conform with SystemRDL rules, some transformations may be performed:
- IP-XACT's rules for <name> identifiers allows for colon (:), dash (-) and dot (.) characters. The importer will automatically sanitize IP-XACT names so that they conform to SystemRDL semantics by replacing these additional characters with underscores (_)
- IP-XACT allows registers to be any arbitrary bit width, but SystemRDL requires the
regwidth
property to be at least 8, and a power of 2. The importedregwidth
may be padded up as necessary. - IP-XACT allows a register to contain multiple fields with the same name. If this is detected, the importer will uniquify the instance names based on the fields' bit ranges.
- Any empty register model nodes are discarded. This can be due to a register not containing any fields, or register file or address map structures not containing any child components.
The IP-XACT standard allows a document to capture memory remap states that describe which subsets of an address space is visible from a particular bus interface or operational state. (See IP-XACT's <memoryRemap> elements)
Since SystemRDL is designed to only capture a monolithic snapshot of an address space, it may be necessary to provide a remap_state
parameter to the importer in order to show otherwise hidden <addressBlock> elements.
peakrdl_ipxact.IPXACTImporter
Below is a simple example of how to import an IP-XACT definition into the register model.
import sys
from systemrdl import RDLCompiler, RDLCompileError
from peakrdl_ipxact import IPXACTImporter
rdlc = RDLCompiler()
ipxact = IPXACTImporter(rdlc)
try:
ipxact.import_file("path/to/my_ipxact.xml")
rdlc.compile_file("path/to/my.rdl")
root = rdlc.elaborate()
except RDLCompileError:
sys.exit(1)