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 |
To build CHaiDNN
using the Xilinx® SDx Development Environment, perform the following steps.
-
Launch the SDx development environment using the desktop icon or the Start menu. The Workspace Launcher dialog appears
-
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.
-
Select File → New → Xilinx SDx Project from the SDx development environment menu bar. The New SDx Project dialog box opens.
-
Select Application and Click Next.
-
Specify the name of the project. For example
CHaiDNN
. -
Click Next. The Choose Hardware platform page appears.
-
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. -
Use default settings and click Next.
-
Select Empty Application and click Finish.
-
From Project Explorer Pane, Right Click on the
src
directory under the created project and click Import. The Import wizard appears. -
Expand the
General
option and select File System. Click Next. -
Browse & Select the local copy of
CHaiDNN
Git repository. Click OK. -
Expand
CHaiDNN
and Select thesoftware
and thedesign
directories. Click Finish. -
All the source files needed to build
CHaiDNN
, can be seen undersrc
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. -
Right click on project and select C/C++ Build Settings. In the Configuration drop down menu, Select Release as an active configuration.
-
In
SDS++ Compiler
add the following in thecommand
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'ssrc/design
folder.📌 NOTE: If custom platform is used as described in the document "CUSTOM PLATFORM GENERATION", then
clkid
must be set to 1. -
In
Symbols
, add symbols__SDSOC
,__CONV_ENABLE__
,__DSP48E2__
,__SYNTHESIS__
,__POOL_ENABLE__
,__DECONV_ENABLE__
.📌 NOTE: When building
DietChai
don't add__POOL_ENABLE__
,__DECONV_ENABLE__
. -
In
Optimization
set the Optimization Level to None (-O0). -
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 toSD_Card
directory in localCHaiDNN
repository.<path to project>
is the path to SDx project. -
In
SDS++ Linker
add the following in thecommand
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
-
In
SDS++ Linker
, SelectLibraries
and add the following libsopencv_core;lzma;tiff;png16;z;jpeg;opencv_imgproc;opencv_imgcodecs;dl;rt;webp;protobuf;openblas
-
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 toSD_Card
directory in localCHaiDNN
repository. -
Save and apply changes. Close the settings window.
-
Navigate to
<project name>/src/software/init
folder inProject Explorer
Pane. Right click onxi_init.cpp
and open the properties. In Optimization, change theOptimization Level
to None (-O0). -
Apply changes and close the window.
-
Open
<project name>/src/design/scripts/mcps.tcl
file and modify the path ofxdc
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.
-
Select the Hardware functions.
-
Navigate to
src/design/src/pool/src/pooling_layer_dp_2xio_top.cpp
file using SDx explorer, right click onPoolTop
and select Toggle HW/SW. -
Navigate to
src/design/src/deconv/src/xi_deconv_top.cpp
file using SDx explorer, right click onXiDeconvTop
and select Toggle HW/SW.
📌 NOTE: When building
DietChai
don't map any function to HW.XiConvolutionTop
will be mapped to HW by default. -
-
Open
project.sdx
file, change theData motion network clock frequency (MHz)
to 100.00 and change theHardware Functions clock frequency (MHz)
to 100.00. -
Build the project.
ℹ️ NOTE: Current CHaiDNN release only supports SDx GUI build on Linux machines.
Copyright© 2018 Xilinx