pynq.pl_server.xrt_device Module

The pynq.pl_server.xrt_device module extends the device class to work with Xilinx Run Time (XRT) enabled devices.

class pynq.pl_server.xrt_device.ErtWaitHandle(bo, future, device)[source]

Bases: object

WaitHandle specific to ERT-scheduled accelerators

done

True is the accelerator has finished

wait()[source]

Wait for the Execution to be completed

wait_async()[source]

Coroutine to wait for the execution to be completed

This function requires that XrtDevice.set_event_loop is called before the accelerator execution is started

class pynq.pl_server.xrt_device.ExecBo(bo, ptr, device, length)[source]

Bases: object

Execution Buffer Object

Wraps an execution buffer used by XRT to schedule the execution of accelerators. Usually used in conjunction with the ERT packet format exposed in the XRT ert_binding python module.

as_packet(ptype)[source]

Get a packet representation of the buffer object

Parameters:ptype (ctypes struct) – The type to cast the buffer to
class pynq.pl_server.xrt_device.XrtDevice(index)[source]

Bases: pynq.pl_server.device.Device

allocate_bo(size, idx)[source]
buffer_read(bo, bo_offset, buf, buf_offset=0, count=-1)[source]
buffer_write(bo, bo_offset, buf, buf_offset=0, count=-1)[source]
close()[source]
default_memory
download(bitstream, parser=None)[source]
execute_bo(bo)[source]
execute_bo_with_waitlist(bo, waitlist)[source]
flush(bo, offset, ptr, size)[source]
free_bitstream()[source]
get_bitfile_metadata(bitfile_name)[source]
get_device_address(bo)[source]
get_exec_bo(size=1024)[source]
get_memory(desc)[source]
get_memory_by_idx(idx)[source]
get_usage()[source]
invalidate(bo, offset, ptr, size)[source]
map_bo(bo)[source]
name
read_registers(address, length)[source]
return_exec_bo(bo)[source]
sensors
set_event_loop(loop)[source]
write_registers(address, data)[source]
class pynq.pl_server.xrt_device.XrtMemory(device, desc)[source]

Bases: object

Class representing a memory bank in a card

Memory banks can be both external DDR banks and internal buffers. XrtMemory instances for the same bank are interchangeable and can be compared and used as dictionary keys.

allocate(shape, dtype)[source]

Create a new buffer in the memory bank

Parameters:
  • shape (tuple(int)) – Shape of the array
  • dtype (np.dtype) – Data type of the array
mem_used
num_buffers
class pynq.pl_server.xrt_device.XrtStream(device, desc)[source]

Bases: object

XRT Streming Connection

Encapsulates the IP connected to a stream. Note that the _ip attributes will only be populated if the corresponding device driver has been instantiated.

source

Source of the streaming connection as ip_name.port

Type:str
sink

Sink of the streaming connection as ip_name.port

Type:str
monitors

Monitor connections of the stream as a list of ip_name.port

Type:[str]
source_ip

Source IP driver instance for the stream

Type:pynq.overlay.DefaultIP
sink_ip

Sink IP driver instance for the stream

Type:pynq.overlay.DefaultIP
monitor_ips

list of driver instances for IP monitoring the stream

Type:[pynq.overlay.DefaultIP]
class pynq.pl_server.xrt_device.XrtUUID(val)[source]

Bases: object

class pynq.pl_server.xrt_device.xclDeviceUsage[source]

Bases: _ctypes.Structure

c2h

Structure/Union member

ddrBOAllocated

Structure/Union member

ddrMemUsed

Structure/Union member

dma_channel_cnt

Structure/Union member

h2c

Structure/Union member

memSize

Structure/Union member

mm_channel_cnt

Structure/Union member

totalContents

Structure/Union member

xclbinId

Structure/Union member