Platform Sample Designs

An SDSoC platform can include sample applications that demonstrate its use. The SDx IDE looks for a file called samples/template.xmlfor information on where the sample application source files reside within the platform. The template file for the zc702_axis_ioplatform 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.

  1. Launch Xilinx SDx and provide a path to your workspace such as/myplatforms/.
  2. Create a new project by selectingFile>New>Xilinx SDx Project.
  3. Specify a project name in the Create New SDx Project page such asmy_zc702_axis_io, and clickNext.
  4. In the Choose Hardware Platform page clickAdd Custom Platform.

  5. Navigate to the folder containing the platform/samples/platforms/zc702_axis_io.
  6. The platform will show up in the Choose Hardware Platform Page. Selectzc702_axis_io (custom)and clickNext.

  7. On the Choose Software Platform and Target CPU, keep the defaultLinux SMP (Zynq 7000)for System Configuration and clickNext.
  8. To test the platform with one of the sample applications, in the Templates page, selectUnpacketized AXI4-Stream to DDRand clickFinish. 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.
  9. Open upmain.cpp. Key points to observe are:
    • The ways in which buffers are allocated usingsds_allocto 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); }
  10. 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.
  11. 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#