XRT Python Bindings

Pybind11 module for XRT

class pyxrt.bo

Represents a buffer object

address(self: pyxrt.bo) → int

Return the device physical address of the buffer object

class flags

Buffer object creation flags

Members:

normal

cacheable

device_only

host_only

p2p

svm

name
map(self: pyxrt.bo) → memoryview

Create a byte accessible memory view of the buffer object

read(self: pyxrt.bo, arg0: int, arg1: int) → numpy.ndarray[numpy.int8]

Read from the buffer object requested number of bytes starting from specified offset

size(self: pyxrt.bo) → int

Return the size of the buffer object

sync(self: pyxrt.bo, arg0: pyxrt.xclBOSyncDirection, arg1: int, arg2: int) → None

Synchronize (DMA or cache flush/invalidation) the buffer in the requested direction

write(self: pyxrt.bo, arg0: buffer, arg1: int) → None

Write the provided data into the buffer object starting at specified offset

class pyxrt.device

Abstraction of an acceleration device

get_info(self: pyxrt.device, arg0: pyxrt.xrt_info_device) → str

Obtain the device properties and sensor information

get_xclbin_uuid(self: pyxrt.device) → pyxrt.uuid

Return the UUID object representing the xclbin loaded on the device

load_xclbin(*args, **kwargs)

Overloaded function.

  1. load_xclbin(self: pyxrt.device, arg0: str) -> pyxrt.uuid

Load an xclbin given the path to the device

  1. load_xclbin(self: pyxrt.device, arg0: xrt::xclbin) -> pyxrt.uuid

Load the xclbin to the device

class pyxrt.ert_cmd_state

Kernel execution status

Members:

ERT_CMD_STATE_NEW

ERT_CMD_STATE_QUEUED

ERT_CMD_STATE_COMPLETED

ERT_CMD_STATE_ERROR

ERT_CMD_STATE_ABORT

ERT_CMD_STATE_SUBMITTED

ERT_CMD_STATE_TIMEOUT

ERT_CMD_STATE_NORESPONSE

ERT_CMD_STATE_SKERROR

ERT_CMD_STATE_SKCRASHED

name
class pyxrt.kernel

Represents a set of instances matching a specified name

class cu_access_mode

Compute unit access mode

Members:

exclusive

shared

none

name
group_id(self: pyxrt.kernel, arg0: int) → int

Get the memory bank group id of an kernel argument

class pyxrt.run

Represents one execution of a kernel

add_callback(self: pyxrt.run, arg0: pyxrt.ert_cmd_state, arg1: std::function<void (void const*, ert_cmd_state, void*)>, arg2: capsule) → None

Add a callback function for run state

set_arg(*args, **kwargs)

Overloaded function.

  1. set_arg(self: pyxrt.run, arg0: int, arg1: xrt::bo) -> None

Set a specific kernel global argument for a run

  1. set_arg(self: pyxrt.run, arg0: int, arg1: int) -> None

Set a specific kernel scalar argument for this run

start(self: pyxrt.run) → None

Start one execution of a run

state(self: pyxrt.run) → pyxrt.ert_cmd_state

Check the current state of a run object

wait(*args, **kwargs)

Overloaded function.

  1. wait(self: pyxrt.run) -> pyxrt.ert_cmd_state

Wait for the run to complete

  1. wait(self: pyxrt.run, arg0: int) -> pyxrt.ert_cmd_state

Wait for the specified milliseconds for the run to complete

class pyxrt.uuid

XRT UUID object to identify a compiled xclbin binary

to_string(self: pyxrt.uuid) → str

Convert XRT UUID object to string

class pyxrt.xclBOSyncDirection

DMA flags used with DMA API

Members:

XCL_BO_SYNC_BO_TO_DEVICE

XCL_BO_SYNC_BO_FROM_DEVICE

XCL_BO_SYNC_BO_GMIO_TO_AIE

XCL_BO_SYNC_BO_AIE_TO_GMIO

name
class pyxrt.xclbin

Represents an xclbin and provides APIs to access meta data

get_ips(self: pyxrt.xclbin) → pyxrt.xclbinip_vector
get_kernels(self: pyxrt.xclbin) → List[pyxrt.xclbin.xclbinkernel]

Get list of kernels from xclbin

get_mems(self: pyxrt.xclbin) → List[pyxrt.xclbin.xclbinmem]

Get list of memory objects

get_uuid(self: pyxrt.xclbin) → pyxrt.uuid

Get the uuid of the xclbin

get_xsa_name(self: pyxrt.xclbin) → str

Get Xilinx Support Archive (XSA) name of xclbin

class xclbinkernel

Represents a kernel in an xclbin

get_name(self: pyxrt.xclbin.xclbinkernel) → str

Get kernel name

get_num_args(self: pyxrt.xclbin.xclbinkernel) → int

Number of arguments

class xclbinmem

Represents a physical device memory bank

get_base_address(self: pyxrt.xclbin.xclbinmem) → int

Get the base address of the memory bank

get_index(self: pyxrt.xclbin.xclbinmem) → int

Get the index of the memory

get_size_kb(self: pyxrt.xclbin.xclbinmem) → int

Get the size of the memory in KB

get_tag(self: pyxrt.xclbin.xclbinmem) → str

Get tag name

get_used(self: pyxrt.xclbin.xclbinmem) → bool

Get used status of the memory

class pyxrt.xrt_info_device

Device feature and sensor information

Members:

bdf

interface_uuid

kdma

max_clock_frequency_mhz

m2m

name

nodma

offline

electrical

thermal

mechanical

memory

platform

pcie_info

host

dynamic_regions

vmr