Host Memory Test

This host memory design explains how direct host memory access can be done by the kernel.

KEY CONCEPTS: host memory, address translation unit

KEYWORDS: XCL_MEM_EXT_HOST_ONLY, HOST[0]

This design is created to validate direct host memory access from kernel using host memory.

The host allocates a buffer into specific host-only buffer using XCL_MEM_EXT_HOST_ONLY. The cl_mem_ext_ptr object needs to be used in cases where memory assignment is done by user explicitly:

cl_mem_ext_ptr_t input_buffer_ext;
input_buffer_ext.flags = XCL_MEM_EXT_HOST_ONLY;
input_buffer_ext.obj = nullptr;
input_buffer_ext.param = 0;

OCL_CHECK(err, input_buffer[i] = new cl::Buffer(context, CL_MEM_READ_WRITE | CL_MEM_EXT_PTR_XILINX, vector_size_bytes,
                                          &input_buffer_ext, &err));

Using the sp option in the platform_hostmemory.cfg file, AXI-Master Port is connected to the Slave-Bridge IP:

sp=hostmemory_1.input:HOST[0]
sp=hostmemory_1.output:HOST[0]

EXCLUDED PLATFORMS

Platforms containing following strings in their names are not supported for this example :

zc
vck
aws-vu9p-f1
2019
2018
_u2_
_u25_
u30
u50lv
u50_gen3x4

DESIGN FILES

Application code is located in the src directory. Accelerator binary files will be compiled to the xclbin directory. The xclbin directory is required by the Makefile and its contents will be filled during compilation. A listing of all the files in this example is shown below

src/host.cpp
src/hostmemory.cpp

Access these files in the github repo by clicking here.

COMMAND LINE ARGUMENTS

Once the environment has been configured, the application can be executed by

./hostmemory.exe platform_test_path