Here is the list of AI Engine specific APIs and their usage in integrating the
traffic generators. With the MATLAB API you can create the traffic
generator code to generate data to pass into or collect data from your AI Engine graph. Use the
following API to instantiate objects to send and receive data. You can provide any
datatype vector/list to send_data
or receive_data
.
- Instantiating Classes to Send or Receive Data
-
You need to set the MATLAB library path to use the APIs:
vivado = getenv("XILINX_VIVADO"); libPath = fullfile(vivado, "/data/emulation/matlab/xtlm_ipc"); addpath(libPath)
aie_input_plio(name, datatype) aie_output_plio(name, datatype)
Parameters:
- name: A string value that should match a PLIO name from the graph
- datatype: A string with the supported values
[ "int8", "uint8","int16", "uint16","int32", "uint32","int64", "uint64","float", "bfloat16"]
- send_data()
-
send_data(data, tlast) creates a non-blocking call to send data
RETURNS nothing
Parameters:
-
data
: list of specified datatype for the object -
tlast
: boolean value, can be true or false
-
- receive_data()
-
receive_data() creates a blocking call to receive data
RETURNS a list of specified datatype
Note: The datatype must be specified during object instantiation - receive_data_with_size()
-
receive_data_with_size(data_size) creates a blocking call to receive a specified amount of data
RETURNS a list of specified datatype
Parameters:
-
data_size
: integer value indicating the amount of data in bytes to receive
-
- receive_data_on_tlast()
-
receive_data_on_tlast() creates a blocking call returning data after receiving tlast packet
RETURNS list of specified data type
Note: The data type must be specified during object instantiation