Here is the list of PL kernel 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 PL kernels. 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
.
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)
- Instantiating Classes to Send or Receive Data
-
hls_input_stream(name, datatype) hls_output_stream(name, datatype)
- 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 (1) or false (0)
-
- 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
Note: Data size is specified in bytes -
- 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