Platform Sample Designs
An SDSoC platform can include sample applications that demonstrate its use. The SDx IDE looks for a file called
samples/template.xml
for information on where the sample application source files reside within the platform. The template file for the
zc702_axis_io
platform lists several test applications, each of which is of specific interest.
To use a platform in the SDx IDE, you must add it to the platform repository for the Eclipse workspace as described in the following steps.
- Launch Xilinx SDx and provide a path to your workspace such as
/myplatforms/ . - Create a new project by selecting .
- Specify a project name in the Create New SDx Project page such asmy_zc702_axis_io, and clickNext.
- In the Choose Hardware Platform page clickAdd Custom Platform.
- Navigate to the folder containing the platform
/samples/platforms/zc702_axis_io . - The platform will show up in the Choose Hardware Platform Page. Selectzc702_axis_io (custom)and clickNext.
- On the Choose Software Platform and Target CPU, keep the defaultLinux SMP (Zynq 7000)for System Configuration and clickNext.
- To test the platform with one of the sample applications, in the Templates page, select
Unpacketized AXI4-Stream to DDR
and clickFinish. Thes2mm_data_copy
function is pre-selected for hardware. The program data flow withins2mm_data_copy_wrapper
creates a direct signal path from the platform input to a hardware function calleds2mm_data_copy
that then pushes the data to memory as azero_copy
datamover. That is, thes2mm_data_copy
function acts as a custom DMA. The main program allocates four buffers, invokess2mm_data_copy_wrapper
, and then checks the written buffers to ensure that data values are sequential, i.e., the data is written bubble-free. For simplicity, this program does not reset the counter, so the initial value depends upon how much time elapses between board power-up and invoking the program. - Open upmain.cpp. Key points to observe are:
- The ways in which buffers are allocated using
sds_alloc
to guarantee physically contiguous allocation required for the zero_copy datamover.unsigned *bufs[NUM_BUFFERS]; bool error = false; for(int i=0; i
- The way that the platform functions are invoked to read from platform input.
void copy_data_wrapper(unsigned int *buf) void s2mm_data_copy_wrapper(unsigned *buf) { unsigned rbuf0[1]; pf_read_stream(rbuf0); s2mm_data_copy(rbuf0,buf); }
- The ways in which buffers are allocated using
- Build the application by clicking on the Build icon in the toolbar. When the build completes, theDebugfolder contains ansd_cardfolder with the boot image and application ELF.
- After the build finishes, copy the contents of thesd_carddirectory onto an SD card, boot, and runmy_zc702_axis_io.elf.
sh-4.3# cd /mnt sh-4.3# ./my_zc702_axis_io.elf TEST PASSED! sh-4.3#