Getting Started with Examples

AllXilinx®SDx™environments are provided with example designs. These examples can:

  • Be a useful learning tool for both theSDxIDE and compilation flows such as makefile flows.
  • Help you quickly get started in creating a new application project.
  • Demonstrate useful coding styles.
  • Highlight important optimization techniques.

Every platform provided within theSDxenvironment contains sample designs to get you started, and are accessible through the project creation flow as described inCreating an Application Project. Furthermore, each of these designs, which are found in/samplesprovides a makefile so you can build, emulate, and run the code working entirely on the command line if you prefer.

Many example designs and tutorials can be downloaded from theXilinxGitHubrepository. Theexample design repositorycontains the latest examples to get you started with application optimization targetingXilinxPCIe®FPGA acceleration boards. All examples are ready to be compiled and executed onSDAccel™supported boards and accelerated cloud service partners.

In addition, thetutorial repositoryprovides step-by-step instructions on a range of topics including building an application, emulation, along with advanced topics such as mixing C++ and RTL kernels, and optimizing host code.

Installing Examples

Select a template for new projects when working through theNew SDx Projectwizard. You can also load template projects from within an existing project, by selectingXilinx>SDx Examples.

Figure:SDAccelExamples – Empty



The left side of the dialog box showsSDAccel™Examples, and has a download command for each category. The right side of the dialog box shows the directory to where the examples downloaded and the URL from where the examples are downloaded. Customizing the location of the download directory is accomplished using the directions in theUsing Local Copiessection.

ClickDownloadnext toSDAccelExamples to download the examples and populate the dialog box. The examples are downloaded as shown in the following figure.

Figure:SDAccelExamples – Populated



The command menu at the bottom left of the SDxExamples dialog box provides two commands to manage the repository of examples:
Refresh
Refreshes the list of downloaded examples to download any updates from the GitHubrepository.
Reset
Deletes the downloaded examples from the .Xilinxfolder.
Note:Corporate firewalls can restrict outbound connections. Specific proxy settings might be necessary.

Using Local Copies

While you must download the examples to add Templates when you create new projects, theSDxIDE always downloads the examples into your local.Xilinx/SDx/folder:

  • On Linux:~/.Xilinx/SDx/

The download directory cannot be changed from theSDxExamples dialog box. You might want to download the example files to a different location from the.Xilinxfolder. To perform this, use thegitcommand from a command shell to specify a new destination folder for the downloaded examples:

git clone https://github.com/Xilinx/SDAccel_Examples /examples

When you clone the examples using thegitcommand as shown above, you can use the example files as a resource for application and kernel code to use in your own projects. However, many of the files use include statements to include other example files that are managed in the makefiles of the various examples. These include files are automatically populated into thesrcfolder of a project when the Template is added through the NewSDxProject wizard. To make the files local, locate the files and manually make them local to your project.

You can find the needed files by searching for the file from the location of the cloned repository. For example, you can run the following command from theexamplesfolder to find thexcl2.hppfile needed for thevaddexample:

find -name xcl2.hpp