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.
<template location="aximm" name="Unpacketized AXI4-Stream to DDR"
description="Shows how to copy unpacketized AXI-Stream data directly to DDR.">
<supports>
<and>
<or>
<os name="Linux"/>
<os name="Standalone"/>
</or>
</and>
</supports>
<accelerator name="s2mm_data_copy" location="main.cpp"/>
</template>
<template location="stream" name="Packetize an AXI4-Stream"
description="Shows how to packetize an unpacketized AXI4-Stream.">
<supports>
<and>
<or>
<os name="Linux"/>
<os name="Standalone"/>
</or>
</and>
</supports>
<accelerator name="packetize" location="packetize.cpp"/>
<accelerator name="minmax" location="minmax.cpp"/>
</template>
<template location="pull_packet" name="Lossless data capture from AXI4-Stream to DDR"
description="Illustrates a technique to enable lossless data capture from a free-running input source.">
<supports>
<and>
<or>
<os name="Linux"/>
<os name="Standalone"/>
</or>
</and>
</supports>
<accelerator name="PullPacket" location="main.cpp"/>
</template>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 <path_to_tutorial>/myplatforms/.
- Create a new project by selecting .
- Specify a project name in the Create New SDx Project page such as my_zc702_axis_io, and click Next.
- In the Choose Hardware Platform page click Add Custom
Platform.

- Navigate to the folder containing the platform <sdx_root>/samples/platforms/zc702_axis_io.
- The platform will show up in the Choose Hardware Platform Page. Select
zc702_axis_io (custom) and click
Next.

- On the Choose Software Platform and Target CPU, keep the default Linux SMP (Zynq 7000) for System Configuration and click Next.
- To test the platform with one of the sample applications, in the Templates page,
select
Unpacketized AXI4-Stream to DDRand click Finish. Thes2mm_data_copyfunction is pre-selected for hardware. The program data flow withins2mm_data_copy_wrappercreates a direct signal path from the platform input to a hardware function calleds2mm_data_copythat then pushes the data to memory as azero_copydatamover. That is, thes2mm_data_copyfunction 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 up main.cpp. Key points to observe are:
- The ways in which buffers are allocated using
sds_allocto guarantee physically contiguous allocation required for the zero_copy datamover.unsigned *bufs[NUM_BUFFERS]; bool error = false; for(int i=0; i<NUM_BUFFERS; i++) { bufs[i] = (unsigned*) sds_alloc(BUF_SIZE * sizeof(unsigned)); } // Flush the platform FIFO of start-up garbage s2mm_data_copy_wrapper(bufs[0]); for(int i=0; i<NUM_BUFFERS; i++) { s2mm_data_copy_wrapper(bufs[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, the Debug folder contains an sd_card folder with the boot image and application ELF.
- After the build finishes, copy the contents of the sd_card directory onto an SD card, boot, and run my_zc702_axis_io.elf.
sh-4.3# cd /mnt
sh-4.3# ./my_zc702_axis_io.elf
TEST PASSED!
sh-4.3#