pynq.pl_server.server Module

The pynq.pl_server.server module manages all the device servers. The top-level PL server class manages multiple device servers, while each device server serves a unique communication socket for a programmable device. On embedded system, usually there is only one device per board; hence only one device server is managed by the PL server. The device client class eases the access to the device servers for users.

class pynq.pl_server.server.DeviceClient(tag, key=b'xilinx')[source]

Bases: object

Class to access the PL server

The properties of the class access the most recent version from the PL server and are read-only. All updating of the PL server is performed by methods.

static accessible(tag)[source]

The getter for the attribute bitfile_name.

Returns:The absolute path of the bitstream currently on PL.
Return type:str

Clear the device tree dictionary.

This should be used when downloading the full bitstream, where all the dtbo are cleared from the system.


Clear all the dictionaries stored in PL.

This method will clear all the related dictionaries, including IP dictionary, GPIO dictionary, etc.


Client connects to the PL server and receives the attributes.

This method should not be used by the users directly. To check open pipes in the system, use lsof | grep <address> and kill -9 <pid> to manually delete them.

  • address (str) – The filename on the file system.
  • key (bytes) – The authentication key of connection.

Return type:



The getter for the attribute devicetree_dict

Returns:The dictionary containing the device tree blobs.
Return type:dict

The getter for the attribute gpio_dict.

Returns:The dictionary storing the PS GPIO pins.
Return type:dict

The getter for the attribute hierarchy_dict

Returns:The dictionary containing the hierarchies in the design
Return type:dict

Insert device tree segment.

For device tree segments associated with full / partial bitstreams, users can provide the relative or absolute paths of the dtbo files.

Parameters:abs_dtbo (str) – The absolute path to the device tree segment.

The getter for the attribute interrupt_controllers.

Returns:The dictionary storing interrupt controller information.
Return type:dict

The getter for the attribute interrupt_pins.

Returns:The dictionary storing the interrupt endpoint information.
Return type:dict

The getter for the attribute ip_dict.

Returns:The dictionary storing addressable IP instances; can be empty.
Return type:dict
load_ip_data(ip_name, data)[source]

This method writes data to the addressable IP.


The data is assumed to be in binary format (.bin). The data name will be stored as a state information in the IP dictionary.

  • ip_name (str) – The name of the addressable IP.
  • data (str) – The absolute path of the data to be loaded.
  • zero (bool) – Zero out the address of the IP not covered by data

Return type:



The getter for the attribute mem_dict

Returns:The dictionary containing the memory spaces in the design
Return type:dict

Remove device tree segment for the overlay.

Parameters:abs_dtbo (str) – The absolute path to the device tree segment.
reset(parser=None, timestamp=None, bitfile_name=None)[source]

Reset all the dictionaries.

This method must be called after a bitstream download. 1. In case there is a hwh file, this method will reset the states of the IP, GPIO, and interrupt dictionaries . 2. In case there is no hwh file, this method will simply clear the state information stored for all dictionaries.

An existing parser given as the input can significantly reduce the reset time, since the PL can reset based on the information provided by the parser.

Parameters:parser (HWH) – A parser object to speed up the reset process.

The getter for the attribute timestamp.

Returns:Bitstream download timestamp.
Return type:str
update_partial_region(hier, parser)[source]

Merge the parser information from partial region.

Combine the currently PL information and the partial HWH file parsing results.

  • hier (str) – The name of the hierarchical block as the partial region.
  • parser (HWH) – A parser object for the partial region.
class pynq.pl_server.server.DeviceServer(tag, key=b'xilinx')[source]

Bases: object

Class to provide an instance of the PL server


Clear the state information for a given dictionary.

Parameters:dict_in (obj) – Input dictionary to be cleared.