.. rst-class:: break_before Software Drivers ================ Alongside the hardware, the XiBIF Python package also provides a suite of modules to help you interface with and configure the FPGA. XiBIF Connection ---------------- The `XibifConnection` class from the `xibif-connection` package allows you to connect to a XiBIF board and exchange data. The `xibif-connection` package is automatically installed when you install `xibif`. .. code-block:: python from xibif_connection.api import XibifConnection board = XibifConnection(BOARD_IP, BOARD_UUID) board.connect() The UUID is used to ensure that you connect to the correct hardware. Ask us how we know! You then have access to many useful functions such as: * read (registers) * write (registers) * read_stream * write_stream * flush_stream * read_axi * write_axi The `XibifConnection` class serves as a low-level interface to the board. It translates the human-friendly data types into bytes to be transmitted over a socket. Register Driver --------------- This class is dynamically created from the register configuration file. The register driver takes a reference to a `XibifConnection` in the constructor and then lets you interface with the registers and even the fields directly. Using a register class you can do the following: .. code-block:: python board = XibifConnection(BOARD_IP, BOARD_UUID) board.connect() regs = RegMap(board) # the register map uses the XibifConnection as an interface regs.my_register = 1 # set a register value val = regs.my_register # read a register value assert(val == 1) regs.my_register_bf.my_field_1 = 0 # set a single field value regs.my_register = 0 # set the entire register value .. note:: Pay attention to the ``_bf`` suffix of the register name when you want to access the register.