Tracing a Linux Project

You can learn how to create a new project, configure the project to enable the SDx trace feature, build the project, run the application on the board, and view the trace data.
  1. Create a new project.
    1. SelectFile>New>Xilinx SDx Project.
    2. In the New Project wizard, name the projectmmult_linux_traceand clickNext.
    3. Selectzc702as the Hardware Platform. ClickNext.
    4. For System configuration selectLinux.
    5. ClickNext.
    6. SelectMatrix Multiplication Data Sizeas the template for this project and clickFinish.
    7. In the Project Explorer, expand the various folders by clicking on the triangle, then open themmult.cppfile under thesrcfolder.


    8. Change the number of tests symbolNUM_TESTSfrom256to10, then save and close the file.


    9. In the SDx Project Settings (in themmult_linux_tracetab), notice that themmult_accelin the HW Functions section of the project overview is already marked for implementation in hardware.
  2. Configure the project to enable the Trace feature in the SDx IDE.
    1. In the Project Overview window, click the checkbox forEnable Event Tracingunder the Options section.
  3. Build the project.
    1. Click theBuildbutton to start building the project. (This will take a while.)
    Important:The build process might take approximately 30 to 45 minutes to complete. Instead of building the project you can save time and instead use the pre-built project. (To minimize disk usage in the SDx installation, the imported project might contain fewer files than a project you build, but it includes the files required to complete the tutorial.) To import a pre-built project: select File>Importand then select General>Existing Projects into Workspaceand click Next. Click Select archive fileand browse to find the lab7b_mmult_trace_linux.zipfile provided in the project files folder ( /SDSoC/2017.1/docs/labs/lab7b_mmult_trace_linux.zip). Click Open. Click Finish. In the Project Explorer, double-click the project.sdxfile to open the SDx Project Settings. Uncheck the Generate bitstreamoption.
    After all the hardware functions are implemented in the Vivado HLS, and after the Vivado IP Integrator design is created, you will see Inserted # hardware monitor coresdisplayed in the console. This message validates that the trace feature is enabled for your design and tells you how many hardware monitor cores have been inserted automatically for you.

  4. Run the application on the board.
    1. When the build is finished, copy the files in thesd_carddirectory onto an SD card and insert into the SD card socket on the board.
    2. Connect an Ethernet cable to the board (connected to your network, or directly to the PC).
    3. Connect the USB/UART port to the PC and open a serial console by clicking the + button on the SDx Terminal tab.
    4. Connect the USB/JTAG port to the PC and boot Linux on the board.
    5. Check the IP address of the zc702 board by looking at the SDx Terminal log.

    6. From theTarget Connectionsview, set up theLinux TCF Agentin the same manner as inUsing the Performance Estimation Flow With Linux.
    7. Right-click on the project in the Project Explorer and selectRun As>Trace Application (SDSoC Debugger).
      Note:Be sure not to select Debug As, because it will enable breakpoints. If your program breakpoints during execution, the timing will not be accurate (because the software will stop, the hardware will continue running, and the trace timer used for timestamping will continue to run).

      When you click on theTrace Application (SDSoC Debugger)option, the GUI downloads the ELF over the Ethernet TCF Agent connection, starts the application, and then begins collecting the trace data produced until the application exits. After the application finishes (or any error in collecting the trace data occurs) the trace data collected is displayed.

      Note:The application must exit successfully for trace data to be collected successfully. If the application does not exit normally (i.e., hangs in hardware or software, or the Linux kernel crashes), the trace data might not be collected correctly.
  5. View the trace data.
    1. After the application exits, all trace data is collected and displayed.