Creating SDSoC Platforms
TheSDx™IDE is used to assemble the hardware and software components into anSDSoC™platform. The design flow for generating a platform is shown below and is utilized in the platform creation example that follows.
Figure:Platform Generation Design Flow
In creating an SDx platform project, developers select settings for the platform, the system configurations, and the domains. Platforms can contain multiple system configurations and domains as iterated and defined through the SDx IDE. Platform settings for prebuilt data allow inclusion of a hardware bitstream or its automatic generation to save on hardware build time when creating software solutions that do not require or create hardware accelerators. System configuration settings are available to either generate the needed platform software components or reference prebuilt software components. The type of software component Exectuable and Linkable Format (ELF) files, Boot Image Format (BIF) files, and Flattened Image Tree (FIT) image files are listed below. Domain settings provide choices for processor selection, operating system, and the runtime environment.
- Zynq® UltraScale+™ MPSoC
- FSBL (ELF)
- PMU (ELF)
- BL31 (ELF)
- U-BOOT (ELF) - for Linux target
- LINUX image.ub (FIT) - for Linux target
- BOOT file components (BIF)
- Zynq®-7000 SoC
- FSBL (ELF)
- U-BOOT (ELF) - for Linux target
- LINUX image.ub (FIT) - for Linux target
- BOOT file components (BIF)
Once generated, the file system layout of an SDSoC platform is structured as shown in the following figure.
Figure:Directory Structure for a TypicalSDSoCPlatform
In general, only the platform provider can ensure that a platform is “correct” for use within theSDSoCenvironment. However, the folder
contains basic tests you should run, with instructions describing how to run them. These tests should build cleanly, and should be tested on the hardware platform.
A platform should provide tests for every custom interface so that users have examples of how to access these interfaces from application C/C++ code.
A platform may optionally include sample applications. By creating asamplessub-folder containing source files and adescription.jsonfile for each application, users can use theSDxIDE New Project wizard to select and build any of the provided sample applications. For additional information on application template creation, seeSample Applications.
Using an SDx Workspace
- Launch theSDx™IDE directly from the desktop icon or from the command line by one of the following methods:
- Using either of the following commands from the command prompt:
sdx
or
sdx -workspace
- Double-clicking theSDxicon to start the program.
- Launching from theStartmenu in the Windows operating system.
- Using either of the following commands from the command prompt:
- TheSDxIDE opens and prompts you to select a workspace, as shown in the following figure.
Figure:Specify the SDx Workspace
TheSDxworkspace is the folder that stores your projects, source files, and results while working in the tool. You can define separate workspaces for each project or have workspaces for different types of projects. The following instructions show you how to define a workspace for anSDSoCproject.
- Click theBrowsebutton to navigate to, and specify, the workspace, or type the appropriate path in theWorkspacefield.
- Select theUse this as the default and do not ask againcheck box to set the specified workspace as your default choice and eliminate this dialog box in subsequent uses ofSDx.
- ClickLaunch.
TIP:You can change the current workspace from within the SDxIDE by selecting .
You have now created anSDxworkspace and can populate the workspace with projects. Platform and application projects are created to describe theSDxtool flow for creating anSDSoCplatform.
- Application Project
- Platform Project
- Library Project
Creating an SDSoC Platform Project
- Platform Assembly with Prebuilt Files
- Building the Hardware
- Building the Software
Defining a Standalone Domain with Prebuilt Hardware and Software
After launching the SDx IDE, you can define a newSDSoCplatform by creating a Platform Project using either the Welcome screen or the SDx menubar by selecting . TheNew Platform Projectdialog opens and prompts you for a project name. Name the projectplatform_1
for this ZCU102 based example.
Figure:New Platform Project
ClickNextto advance to the next dialog and select the source of the hardware specification for the platform. You can choose to use a DSA or an existing platform as the source for the hardware component of the platform. Select DSA for this example.
Figure:Specify New Platform Source - DSA or Existing Platform
ClickNextto specify the DSA as theHardware Specification. Use the Browse button to locate the DSA for your project, or simply type the path to the DSA file in the field. TheSDxtool includes platforms and DSA files that you can use as the foundation for creating your ownSDSoCplatforms, or you can create the DSA for a new platform using the Vivado Design Suite. Refer toCreating the Platform Hardware Componentfor more information on creating the DSA. For this example, use the ZCU102 DSA located at
.
Figure:Platform Hardware Specification
Leave the Operating system and Processor settings asstandaloneandpsu_cortexa53_0.
ClickFinishto create the Platform project.
The platform configuration settings opens in the Editor Area of theSDxIDE. For this example, use the prebuilt hardware components and software components for the ZCU102 platform provided with theSDxtools at
. SelectUse existing pre-built dataon the platform configuration settings view and browse to or set thePrebuilt Datapath to
.
Figure:Platform Configuration Settings
Providing a platform with prebuilt data containing software files with port interface specifications and a bitstream allows developers to quickly compile and run software applications that do not invoke hardware accelerated functions.
Click onsysconfig1for the System Configuration settings view. SelectUse pre-built software componentsand browse to or set theBoot Directorypath to
. Browse to or set theBIF Fileto
.
Figure:System Configuration Settings
Click onstandalone on psu_cortexa53_0for the Domain settings view. Do not make any changes to the domain settings for this example, but note that this view is used to change settings for the board support package, the application linker script, and included libraries.
Figure:Domain Configuration Settings
At this point, set up references to all the files necessary to create a standalone platform for the ZCU102. Click onQuick Links - #3 Generate Platformto complete the platform generation process. After the platform is generated, buildSDxapplications targeting the platform.
Defining a Linux Domain with Prebuilt Hardware and Software
As an example of creating anSDSoCplatform for Linux applications, use the source files from the ZCU102 platform again and create a second platform,platform_2
in the same workspace asplatform_1
. Begin by creating a new platform project using the menu bar and use the same ZCU102 DSA as before at
. Selectlinuxfor theOperating systemandpsu_cortexa53for theProcessor.
Figure:Platform Hardware Specification
SelectUse existing pre-built dataon the platform configuration settings view and browse or set thePrebuilt Datapath to
.
Figure:Platform Configuration Settings
Selectlinux on psu_cortexa53to view the Linux domain settings and click on theClick herelink within the dialog'sThe linux domain is not configured. Click here to updateprompt.
Figure:Linux Domain Settings
In the domain configuration dialog, selectUse pre-built software componentsand browse to or set theBoot Directorypath to
. Browse to or set theBIF Fileto
.
Figure:Linux Boot and BIF Files
- Linux Image Directory
- Sysroot
image.ub
file from the ZCU102 platform is referenced through the specified
image
directory. Optionally, a sysroot is associated with a platform by providing a reference within this Domain settings dialog.
Platforms with a sysroot enables theSDxIDE to create Linux application projects with make files containing default sysroot options for specifying include paths, library paths, and other options.
In thelinux_domainview, browse to the Linux image at
.
Figure:Configured Linux Domain Settings
Thesysconfig1system configuration settings are automatically populated by the Linux domain settings entered for the Boot files directory and the BIF file are in place.
Figure:Linux System Configuration Settings
At this point, set up references to all the files necessary to create a Linux platform for the ZCU102. Click onQuick Links - #3 Generate Platformto complete the platform generation process. After the platform is generated, build theSDxapplications targeting the platform.
TheSDxProject ExplorerandAssistantviews after platform generation completes is shown below.
Figure:Generated Platforms
Defining an SDSoC Application Project for Platform Testing
TheSDxIDE provides compilation tools and example code templates for creating applications that run onSDSoCplatforms. Create example applications for the standalone (platform_1
) and Linux (platform_2
) platforms using theArray zero_copycode template provided with theSDxtools.
The Compilation log contains the commands issued to build the application and is useful for observing the sequence of actions taken during the build process. The Data Motion Network report lists the accelerated functions and how their arguments were mapped and connected to platform interfaces. The type of data mover used for each argument is also listed.
Reuse theSDxworkspace (sdx_workspace
) containing the standalone and Linux platforms created in the section above.
Create a newSDxApplication project using the menu bar and selecting . TheNew SDx Application Projectdialog opens and prompts you for a project name. Name the projectapp_standalone
for this ZCU102-based example.
Figure:New SDx Application Project
ClickNextto advance to thePlatformselection dialog. Selectplatform_1 [custom]
as this platform was configured for the standalone domain when it was created.
Figure:Application Platform Selection
ClickNextto advance to theSystem Configurationdialog. Leave the settings at their default values forSystem configuration:sysconfig1
,Runtime:C/C++
, andDomain:standalone on psu_cortexa53_0
. Recall that whenplatform_1
was created it was configured with a single system configuration containing a single standalone domain. If additional system configurations or domains are present in a platform an application can be customized to use them through thisSystem Configurationdialog.
Figure:Application System Configuration
ClickNextto advance to theTemplatesdialog and select theArray zero_copyexample as the code base for the application.
Figure:Application Template
ClickFinishto add the template code to theSDxapplication. TheEditor Areanow shows the application project settings including the functions that have been selected for hardware acceleration. TheProject ExplorerandAssistantviews are updated with the newapp_standalone
application.
Figure:Application Project Settings
Figure:Project Explorer View
Build theapp_standalone
application by expanding theapp_standalone [SDSoC]listing in theAssistantview, right-click onDebug [Hardware]and selectBuild.
Figure:Application Build Assistant View
After the application builds the Data Motion Network Report and Compilation Log are available through theAssistantview. The Compilation log contains the commands issued to build the application and is useful for observing the sequence of actions taken during the build process. The Data Motion Network report lists the accelerated functions and how their arguments were mapped and connected to platform interfaces. The type of data mover used for each argument is also listed.
A set of files for booting and running the application on target hardware is generated and accessible by right-clicking onSD Card Imageand selectingOpen > Open in Project Explorer,Open > Open in File Browser, orOpen > Open in Terminal. The files should be copied to a FAT32 formatted SD card and used to boot the target hardware, ZCU102 for this example, to test the generated platform by running application code.
platform_2
) generated earlier is similar to the standalone flow. The workspace is reused again to add another
SDxApplication project, named
app_linux
, and use the Linux system configuration offered in
platform_2
. The
Project Explorerand
Assistantviews after a successful build of the application are shown below. The contents of the
sd_carddirectory are used to boot and run the Linux application on target hardware.
Figure:Linux Application Project Explorer View
Figure:Linux Application Build Assistant View
Querying the Platform
> sds++ –sds-pf-list
This command lists the availableSDxplatforms by reading the platform folders in the current working directory, and reading the platforms in theSDxinstallation hierarchy. If you specify this command from a folder containing a custom platform it will read the platform found there.
> sds++ –sds-pf-info
This command displays the details of the specified platform.
> sds++ –sds-pf
sds++ -sds-pf-info zcu102
command:
Platform Information ==================== Name: zcu102 Device ------ Architecture: zynquplus Device: xczu9eg Package: ffvb1156 Speed grade: -2 System Clocks ------------- Clock ID Frequency ----------|------------ 1199.880127 0 74.992500 1 99.990000 2 149.985000 3 199.980000 4 299.970000 5 399.960000 6 599.940000 Platform: zcu102 (/platforms/zcu102) Description: A basic platform targeting the ZCU102 evaluation board, which includes 4GB of DDR4 for the Processing System, 512MB of DDR4 for the Programmable Logic, 2x64MB Quad-SPI Flash and an SDIO card interface. More information at https://www.xilinx.com/products/boards-and-kits/ek-u1-zcu102-g.html Available system configurations: a53_linux (a53_linux) a53_standalone (a53_standalone) r5_standalone (r5_standalone) System Ports Use the system port name in a sysport pragma, for example #pragma SDS data sysport(parameter_name:system_port_name) System Port Name (Vivado BD instance name, Vivado BD port name) ps_e_S_AXI_HPC0_FPD (ps_e, S_AXI_HPC0_FPD) ps_e_S_AXI_HPC1_FPD (ps_e, S_AXI_HPC1_FPD) ps_e_S_AXI_HP0_FPD (ps_e, S_AXI_HP0_FPD) ps_e_S_AXI_HP1_FPD (ps_e, S_AXI_HP1_FPD) ps_e_S_AXI_HP2_FPD (ps_e, S_AXI_HP2_FPD) ps_e_S_AXI_HP3_FPD (ps_e, S_AXI_HP3_FPD)
Refer to theSDx Command and Utility Reference Guidefor more information.