Skip to content

Latest commit

 

History

History
164 lines (121 loc) · 7.94 KB

BUILD_USING_SDX_GUI.md

File metadata and controls

164 lines (121 loc) · 7.94 KB

CHaiDNN-v2

Analysis and Eval
Supported Layers Performance/Resource Utilization
Performance Eval
Design and Development
API Reference Quantization User Guide for CHaiDNN Model Zoo Running Inference on new Network
Creating SDx GUI Project Configurable Parameters Custom Platform Generation Software Layer Plugin
SDSoC Environment User Guide Hardware-Software Partitioning for Performance

Creating SDx GUI Project

To build CHaiDNN using the Xilinx® SDx Development Environment, perform the following steps.

  1. Launch the SDx development environment using the desktop icon or the Start menu. The Workspace Launcher dialog appears

  2. Click Browse to enter a workspace folder used to store your projects (you can use workspace folders to organize your work), then click OK to dismiss the Workspace Launcher dialog. The SDx development environment window opens with the Welcome tab visible when you create a new workspace. The Welcome tab can be closed by clicking the X icon or minimized if you do not wish to use it.

  3. Select File → New → Xilinx SDx Project from the SDx development environment menu bar. The New SDx Project dialog box opens.

  4. Select Application and Click Next.

  5. Specify the name of the project. For example CHaiDNN.

  6. Click Next. The Choose Hardware platform page appears.

  7. From the Choose Hardware platform page, select zcu102. Click Next. To use a custom platform, click on Add Custom Platform and give the path to custom platform and click OK. The System Configuration page appears.

  8. Use default settings and click Next.

  9. Select Empty Application and click Finish.

  10. From Project Explorer Pane, Right Click on the src directory under the created project and click Import. The Import wizard appears.

  11. Expand the General option and select File System. Click Next.

  12. Browse & Select the local copy of CHaiDNN Git repository. Click OK.

  13. Expand CHaiDNN and Select the software and the design directories. Click Finish.

  14. All the source files needed to build CHaiDNN, can be seen under src directory.

    📌 NOTE: The software/example folder contains example files. Using SDx GUI, only 1 of them can be built at once. Exclude other example files from the project except the one you wish to build.

  15. Right click on project and select C/C++ Build Settings. In the Configuration drop down menu, Select Release as an active configuration.

  16. In SDS++ Compiler add the following in the command

    sds++ -sds-hw XiConvolutionTop  <path to design>/conv/src/xi_convolution_top.cpp -clkid 1 -hls-tcl  <path to design>/conv/scripts/config_core.tcl -sds-end
    
    

    📌 NOTE: <path to design> is the path to the project's src/design folder.

    📌 NOTE: If custom platform is used as described in the document "CUSTOM PLATFORM GENERATION", then clkid must be set to 1.

  17. In Symbols, add symbols __SDSOC, __CONV_ENABLE__, __DSP48E2__, __SYNTHESIS__ , __POOL_ENABLE__ , __DECONV_ENABLE__.

    📌 NOTE: When building DietChai don't add __POOL_ENABLE__, __DECONV_ENABLE__.

  18. In Optimization set the Optimization Level to None (-O0).

  19. In Directories, add below paths

    <path to libraries>/opencv/arm64/include
    <path to libraries>/protobuf/arm64/include
    <path to libraries>/cblas/arm64/include
    <path to project>/src/design/conv/include
    <path to project>/src/design/conv/src
    <path to project>/src/design/pool/include
    <path to project>/src/design/pool/src
    <path to project>/src/design/deconv/include
    <path to project>/src/design/deconv/src
    

    📌 NOTE: <path to libraries> is the path to SD_Card directory in local CHaiDNN repository. <path to project> is the path to SDx project.

  20. In SDS++ Linker add the following in the command

    sds++ -xp param:compiler.skipTimingCheckAndFrequencyScaling=1 -xp "vivado_prop:run.impl_1.{STEPS.OPT_DESIGN.ARGS.MORE OPTIONS}={-directive Explore}"  -xp "vivado_prop:run.impl_1.{STEPS.PLACE_DESIGN.ARGS.MORE OPTIONS}={-directive Explore}" -xp "vivado_prop:run.impl_1.STEPS.PHYS_OPT_DESIGN.IS_ENABLED=1" -xp "vivado_prop:run.impl_1.{STEPS.PHYS_OPT_DESIGN.ARGS.MORE OPTIONS}={-directive Explore}" -xp "vivado_prop:run.impl_1.{STEPS.ROUTE_DESIGN.ARGS.MORE OPTIONS}={-directive Explore}" -xp "vivado_prop:run.synth_1.{STEPS.SYNTH_DESIGN.TCL.PRE}={<path to design>/src/conv/scripts/mcps.tcl}" -xp "vivado_prop:run.impl_1.{STEPS.PLACE_DESIGN.TCL.PRE}={<path to design>/src/conv/scripts/mcps.tcl}" -Wno-unused-label
    
  21. In SDS++ Linker, Select Libraries and add the following libs

    opencv_core;lzma;tiff;png16;z;jpeg;opencv_imgproc;opencv_imgcodecs;dl;rt;webp;protobuf;openblas
    
  22. Add library paths

    <path to libraries>/opencv/arm64/lib
    <path to libraries>/protobuf/arm64/lib
    <path to libraries>/cblas/arm64/lib
    

    📌 NOTE: Note: <path to libraries> is the path to SD_Card directory in local CHaiDNN repository.

  23. Save and apply changes. Close the settings window.

  24. Navigate to <project name>/src/software/init folder in Project Explorer Pane. Right click on xi_init.cpp and open the properties. In Optimization, change the Optimization Level to None (-O0).

  25. Apply changes and close the window.

  26. Open <project name>/src/design/scripts/mcps.tcl file and modify the path of xdc file as shown below.

    read_xdc <path to project>/src/design/conv/scripts/mcp_const.xdc

📌 NOTE: <path to project> is the path to SDx project.

  1. Select the Hardware functions.

    • Navigate to src/design/src/pool/src/pooling_layer_dp_2xio_top.cpp file using SDx explorer, right click on PoolTop and select Toggle HW/SW.

    • Navigate to src/design/src/deconv/src/xi_deconv_top.cpp file using SDx explorer, right click on XiDeconvTop and select Toggle HW/SW.

    📌 NOTE: When building DietChai don't map any function to HW. XiConvolutionTop will be mapped to HW by default.

  2. Open project.sdx file, change the Data motion network clock frequency (MHz) to 100.00 and change the Hardware Functions clock frequency (MHz) to 100.00.

  3. Build the project.

ℹ️ NOTE: Current CHaiDNN release only supports SDx GUI build on Linux machines.


Copyright© 2018 Xilinx