Importing Register Definitions ============================== .. inheritance-diagram:: avl_ral._ral.RAL :parts: 1 `SystemRDL `_ ------------------------------------------- AVL-RAL is based on `systemrdl `_. As such AVL-RAL can import register block definitions from the native systemrdl file format. The `systemrdl-compiler `_ library is used under-the-hood, which has a complete implementation of the standard. SystemRDL register definition files are identified by the .ral file extension. .. code-block:: python # Create AVL-RAL component self.ral = avl_ral.RAL("ral", self) # Import register block definitions self.ral.load_definition("./myregisters.ral") `IP-XACT `_ ------------------------------------------------------------------------------------------------ AVL-RAL can also import from `IP-XACT `_ XML file format. These are identified by the .xml file extension. The `peakrdl-ipxact `_ library is used for this purpose. .. code-block:: python # Create AVL-RAL component self.ral = avl_ral.RAL("ral", self) # Import reister block definitions self.ral.load_definition("./myregisters.xml") Visualizing ----------- AVL-RAL has added helpful string representations for address maps, registers and fields to help the user. .. code-block:: python print(self.ral) Results in: .. code-block:: bash AddrMap: simple_block Register: STATUS Address : 0xx00000000 Access Width : 32 Register Width : 32 Shared : False Field: READY Bits : [0:0] Reset : 0 Value : 0 SW Access : R HW Access : W Current Value : 0x0 Field: ERROR_CODE Bits : [7:4] Reset : 0 Value : 0 SW Access : R HW Access : W Current Value : 0x0 Field: INT_PEND Bits : [31:31] Reset : 0 Value : 0 SW Access : R HW Access : W Current Value : 0x0 Register: CONFIG Address : 0xx00000004 Access Width : 32 Register Width : 32 Shared : False Field: EN Bits : [0:0] Reset : 0 Value : 0 SW Access : RW HW Access : R Current Value : 0x1 Field: PARAM0 Bits : [15:8] Reset : 0 Value : 0 SW Access : RW HW Access : R Current Value : 0x55 Field: PARAM1 Bits : [31:16] Reset : 0 Value : 0 SW Access : RW HW Access : R Current Value : 0xbabe If back-door accesses have been enabled the print will contain the current values.