Hardware Function Options

Hardware function options provide a means to consolidate sdscc/sds++ options within a Makefile to simplify command line calls and make minimal modifications to a pre-existing Makefile.

The -sds-hw and -sds-end options are used in pairs:
  • The -sds-hw option begins the description of a single function being moved into hardware.
  • -sds-end option terminates the list of configuration details for that function.
For the next function moved into hardware, there is another pair with -sds-hw as the start of the configuration and -sds-end as the terminator.
The Makefile fragment below illustrates the use of –sds-hw blocks to collect all options in the SDSFLAGS Makefile variable and to replace an original definition of CC with sds++ ${SDSFLAGS}. Thus the original Makefile for an application can be converted to an sds++ compiler Makefile with minimal changes.
APPSOURCES = add.cpp main.cpp
EXECUTABLE = add.elf
 
CROSS_COMPILE = arm-xilinx-linux-gnueabi-
AR = ${CROSS_COMPILE}ar
LD = ${CROSS_COMPILE}ld
#CC = ${CROSS_COMPILE}g++
PLATFORM = zc702
SDSFLAGS = -sds-pf ${PLATFORM} \
           -sds-hw add add.cpp -clkid 1 -sds-end \
           -dmclkid 2
CC = sds++ ${SDSFLAGS} 

INCDIRS = -I..
LDDIRS =
LDLIBS =
CFLAGS = -Wall -g -c ${INCDIRS}
LDFLAGS = -g ${LDDIRS} ${LDLIBS}
 
SOURCES := $(patsubst %,../%,$(APPSOURCES))
OBJECTS := $(APPSOURCES:.cpp=.o)
 
.PHONY: all
 
all: ${EXECUTABLE}
 
${EXECUTABLE}: ${OBJECTS}
 ${CC} ${OBJECTS} -o $@ ${LDFLAGS}
 
%.o: ../%.cpp
 ${CC} ${CFLAGS} $< 
Table 1. Hardware Function Options
Option Valid Values Description
-sds-hw function_name source_file N/A An sds++ command line can include zero or more –sds-hw blocks. Each block is associated with a top-level hardware function specified as the first argument and its containing source file specified as the second argument. If the file name associated with an -sds-hw block matches the source file to be compiled, the options are applied. Options outside of –sds-hw blocks are applied where applicable.

When using the xfOpenCV library, the function_name is the template function instantiation enclosed in double quotes, for example "auCanny<1080,1920,0,0,3,2,1,1,1>", and the file is the source file containing the template function instantiation, for example au_canny_tb.cpp.

-clkid <n> <n> has one of the values listed in the Clock ID Values by Platform table.

Set the accelerator clock ID to <n>, where <n> has one of the values listed in the Clock ID Values by Platform table. (You can use the command sds++ –sds-pf-info platform_name to display the information about a platform.) If the clkid option is not specified, the default value for the platform is used. Use the command sds++ –sds-pf-list to list available platforms and settings.

-files file_list file_list is a list of one or more files required to compile the current top-level function into hardware using Vivado® HLS. Specify a comma-separated list (without white space) of one or more files required to compile the current top-level function into hardware using Vivado HLS. If any of these files contain source code that is not used by HLS but is required to produce the application executable, they must be compiled separately to create object files (.o), and linked with other object files during the link phase.

When using the xfOpenCV library, the -files option specifies the path to the source file containing the function template definition, for example au_canny.hpp.

-hls-target boolean_value boolean_value is 0|1

When set to 1, in Vivado HLS add_files commands, insert -target and Arm GNU toolchain include options in addition to -m32 or -m64 options.

When set to 0, insert -m32 or -m64 options.

Use this option if the default behavior results in target dependent compilation errors.

When specified outside of -sds-hw/-sds-end blocks, the option applies to all hardware functions.

-hls-target-flags "target_options" "target_options" are options in the Vivado HLS add_files command. Specify a list of target options to use in place of automatically inserted options in the Vivado HLS add_files command, for example -m32 or -m64. The options must be enclosed in quotes so they will not be interpreted as compiler options.
-hls-tcl hls_tcl_directives_file N/A When using the Vivado HLS tool to synthesize the hardware accelerator, source the specified Tcl file containing HLS directives. During HLS synthesis, sds++ creates a run.tcl file used to drive the Vivado HLS tool. In this Tcl file, the following commands are inserted:
# synthesis directives
create_clock -period <clock_period>
set_clock_uncertainty 27.0%
config_rtl -reset_level low
source <sdsoc_generated_tcl_directives_file>
# end synthesis directives

If the –hls-tcl option is used, the user-defined Tcl file is sourced after the synthesis directives generated by the SDSoC environment.

-shared-aximm N/A Share AXIMM ports instead of enabling multiple ports.
-sds-end N/A Specify the end of the -sds-hw options for the specified function_name.

Clock ID Values by Platform

For a list of clock ID values by platform, see Clock ID Values by Platform.