Skip to main content

Import and export IP-XACT XML to/from the systemrdl-compiler register model

Project description

build Coverage Status PyPI - Python Version

PeakRDL-ipxact

This package implements IP-XACT import and export for the PeakRDL toolchain

  • Export: Convert compiled SystemRDL input into IP-XACT XML
  • Import: Read an IP-XACT file and import it into the systemrdl-compiler namespace

Installing

Install from PyPi using pip:

python3 -m pip install peakrdl-ipxact

Exporter Usage

Pass the elaborated output of the SystemRDL Compiler to the exporter.

import sys
from systemrdl import RDLCompiler, RDLCompileError
from peakrdl.ipxact import IPXACTExporter

rdlc = RDLCompiler()

try:
    rdlc.compile_file("path/to/my.rdl")
    root = rdlc.elaborate()
except RDLCompileError:
    sys.exit(1)

exporter = IPXACTExporter()

exporter.export(root, "path/to/output.xml")

Importer Usage

When an IP-XACT file is imported, the register description is loaded into the SystemRDL register model as if it was an addrmap component declaration. Once imported, the IP-XACT contents can be used as-is, or referenced from another RDL file.

Import can occur at any point alongside normal RDL file compilation.

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)

Reference

IPXACTExporter(**kwargs)

Constructor for the IP-XACT exporter class

Optional Parameters

  • vendor
    • Vendor url string. Defaults to "example.org"
  • library
    • library name string. Defaults to "mylibrary"
  • version
    • Version string. Defaults to "1.0"
  • standard
    • IP-XACT Standard to use. Currently supports:
      • peakrdl.ipxact.Standard.IEEE_1685_2009
      • peakrdl.ipxact.Standard.IEEE_1685_2014
    • Defaults to IEEE Std 1685-2014
  • xml_indent
    • String to use for each indent level. Defaults to 2 spaces.
  • xml_newline
    • String to use for line breaks. Defaults to newline.

IPXACTExporter.export(node, path)

Perform the export!

Parameters

  • node
    • Top-level node to export. Can be the top-level RootNode or any internal AddrmapNode.
  • path
    • Output file.

IPXACTImporter(compiler)

Constructor for the IP-XACT importer class

  • compiler
    • Reference to RDLCompiler instance to bind the importer to

IPXACTImporter.import_file(path)

Perform the import!

  • path
    • Input IP-XACT file.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

peakrdl-ipxact-2.1.1.tar.gz (27.0 kB view details)

Uploaded Source

File details

Details for the file peakrdl-ipxact-2.1.1.tar.gz.

File metadata

  • Download URL: peakrdl-ipxact-2.1.1.tar.gz
  • Upload date:
  • Size: 27.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.2.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for peakrdl-ipxact-2.1.1.tar.gz
Algorithm Hash digest
SHA256 e36d383ea1f2eecfb43cc5a91afa76772f7c9c0ff49b2fdfae703dc95fcbc64d
MD5 67dfbb2919e06d44fb607af940b06ec4
BLAKE2b-256 91b4bde42ce7b7815d40cc11a9f29bc58968f9da51a57a93226d4ad854bae4bd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page