Platform Sample Applications
Overview
A platform can optionally include sample applications to demonstrate the usage of the platform. The sample applications must be defined in a file namedtemplate.xml
found in thesamples
directory of a platform. Here is an example for thezc702_axis_io
sample platform found in the
XML element is required as a container for all application templates defined in the template file:
element
Each application template is defined inside aelement, and there can be multiple
tags defined within the
element. Theelement can have multiple attributes as shown in the following table:
Attribute | Description |
---|---|
location | Relative path to the template application |
name | Application name displayed in the SDSoC environment |
description | Application description displayed in the SDSoC environment |
element can also contain multiple nested elements that define different aspects of the application.
element
The
element defines an Operating System match for the selected SDx platform. The
elements must be enclosed in
and
elements to define a boolean function.
The following example defines an application that can be selected when either of Linux, Standalone or FreeRTOS are selected as an Operating System:
element
The
element defines the set of paths relative to the application that are to be passed to the compiler using -I flags. Each
element has alocation
attribute.
-I"../src/myinclude" -I"../src/dir/include"
to the compiler:
element
The
element defines the set of paths relative to the application that are to be passed to the linker using -L flags. Each
element has alocation
attribute.
-L"../src/mylibrary" -L"../src/dir/lib"
to the linker:
element
The
element defines the set of libraries that are to be passed to the linker -l flags. Each
element has aname
attribute.
-lmylib2 -lmylib2
to the linker:
element
The
element defines a set of directories and files to be excluded from being copied when SDx creates the new project.
The following example will result in SDx not making a copy of directoriesMyDir
andMyOtherDir
when creating the new project. It will also not make a copy of filesMyFile.txt
andMyOtherFile.txt
. This allows you to have files or directories in the application directory that are not needed to build the application.
element
The optional
element defines application project settings for the system when creating a new project. Thedmclkid
attribute defines the data motion clock ID. If the
element is not specified, the data motion clock uses the default clock ID.
The following example will result in SDx setting the data motion clock ID to2
instead of the default clock ID when creating the new project.
element
The optional
element defines application project settings for a function targeted for hardware when creating a new project. Thename
attribute defines the name of the function and thelocation
attribute defines the path to the source file containing the function (the path is relative to the folder in the platform containing the application source files). Thename
andlocation
are required attributes of the
element. The optional attributeclkid
specifies the accelerator clock to use instead of the default. The optional sub-element
specifies thename
of a source file (path relative to the folder in the platform containing application source files) containing code called by the accelerator and the accelerator is found in a different file. The SDx environment normally infers
information for an application and this sub-element does not need to be specified unless the default behavior needs to be overridden.
The following example will result in SDx specifying two functions to move to hardwarefunc1
andfunc2
when creating the new project.
element
The optional
element defines application project settings for the compiler when creating a new project. TheinferredOptions
attribute defines compiler options required to build the application and appears in the SDx Environment C/C++ Build Settings dialog as compiler Inferred Options under Software Platform.
The following example will result in SDSoC adding the compiler option-D MYAPPMACRO
when creating the new project.
element
The optional
element defines application project settings for the linker when creating a new project. TheinferredOptions
attribute defines linker options required to build the application and appears in the SDx Environment C/C++ Build Settings dialog as linker Miscellaneous options.
The following example will result in SDx adding the linker option-poll-mode 1
when creating the new project.