English | 日本語
This tutorial demonstrates how to use the emulation feature in the SDx IDE. Running your application on SDSoC emulator is a good way to gain visibility of data transfers with a debugger. You will be able to see issues such as a system hang, and can then inspect associated data transfers in the simulation waveform view, which gives you access to singals on the hardware blocks associated with the data transfer.
First, you target your design to the desired OS and platform and run emulation on the program. In this tutorial you are debugging applications running on an accelerated system.
📌 NOTE You can complete this tutorial even if you do not have a ZC702 board. When creating the SDx project, select your board and one of the available applications, even if the suggested template Emulation application is not found.
Step 1: Creating a Project to Run Emulation
Create a new SDx project (lab8
) for the ZC702 platform and Linux OS using the design template for Emulation Example. To create the project in the SDx IDE:
-
Launch the SDx IDE.
-
Select File > New > SDx Project.
-
In the Project Type page, Application Project is selected by default. Click Next.
-
Specify the name of the project (for example,
lab8
) in the Project name field. Click Next. -
From the Platform list select zc702. Click Next.
-
From the System Configuration drop-down list, select Linux. Click Next.
-
From the list of application templates, select Emulation Example and click Finish.
-
Click on the tab labeled lab8 to select the SDx Project Settings (if the tab is not visible, double click the
project.sdx
file in the Project Explorer). In the HW functions panel observe that the mmult_accel function is marked as a hardware function when the project was created. -
If the hardware functions were removed or not marked, you would click on the Add HW Functions icon to invoke the dialog box to specify hardware functions.
-
In the SDx Project Settings, from the pull-down menu for the Active build configuration, select Debug, from the pull-down menu for Target, select Emulation. For the Emulation model there are two options: Debug and Optimized. Select the Debug option to enable capture of debug information. For faster emulation without debug information, select the Optimized pull-down menu option. For this lab, use the default option of Debug.
-
When you select the Target as Emulation, the Generate SD card image is greyed out.
-
With the Generate emulation model option selected, build the application by clicking on the build symbol.
Step 2: Starting the Emulator
-
From the menu select Xilinx > Start/Stop Emulator.
-
The Emulation dialog box appears. Select the appropriate Project and Configuration.
-
Select whether or not you want to show the waveform. Showing the waveform initiates a Vivado tools session with the simulation window open where you can view the waveform of the different signals within your design. Not showing the waveform results in faster emulation. Check the Show the Waveform option.
-
Click Start. This is equivalent to turning a board on.
-
Add the signals that need to be viewed in the Waveform viewer. This can be done by selecting the appropriate functions in the Scope window in Vivado, right-clicking and selecting Add to Wave Window. The signals within that function are then added to the waveform viewer.
-
Click on the Run All or Run for button to start the programmable logic simulation after selecting your signals.
Step 3: Running the Application
The emulator will take a few seconds to start. To begin emulation:
-
In the SDx IDE, right-click on
lab8
and from the context menu that appears, select Debug As > Launch on Emulator (SDx Application Debugger). -
The Confirm Perspective Switch dialog box appears. Click Yes to switch perspective.
-
After the perspective is switched to Debug, you can debug your code just like you would while running on actual hardware.
-
Click on the Resume icon in the toolbar to execute the code.
-
Look at the state of different signals in the waveform viewer of the Vivado Xsim simulator.
After completing this tutorial, you should be able to do the following:
- Use the SDx IDE to download and run your application in emulation mode.
- Optionally step through your source code in the SDx IDE (debug mode) and observe various registers and memories.
Copyright© 2019 Xilinx