Hardware Function Options

Hardware function options provide a means to consolidate sdscc options within a Makefile to simplify command line calls and make minimal modifications to a pre-existing Makefile. 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 sdscc ${SDSFLAGS} or sds++ ${SDSFLAGS}. Thus the original Makefile for an application can be converted to an sdscc/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} $< 

-sds-hw function_name file [[-files file_list] [-hls-tcl hls_tcl_directives_file] [-clkid <n>] [-mno-lint]] –sds-end

An sdscc command line may include zero or more –sds-hw blocks, and 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 AuvizCV 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>

Set the accelerator clock ID to <n>, where <n> has one of the values listed in the table below. (You can use the command sdscc –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 sdscc –sds-pf-list to list available platforms and settings.

Platform Value of <n>
zc702 0 – 166 MHz
1 – 142 MHz
2 – 100 MHz
3 – 200 MHz
zc706 0 – 166 MHz
1 – 142 MHz
2 – 100 MHz
3 – 200 MHz
zed and microzed 0 – 166 MHz
1 – 142 MHz
2 – 100 MHz
3 – 200 MHz
zybo 0 – 25 MHz
1 – 100 MHz
2 – 125 MHz
3 – 50 MHz
zcu102_es1 0 – 100 MHz
1 – 150 MHz
2 – 200 MHz
3 – 300 MHz
zcu102_es2 0 – 100 MHz
1 – 150 MHz
2 – 200 MHz
3 – 300 MHz

-files file_list

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 AuvizCV library, the -files option specifies the path to the source file containing the function template definition, for example au_canny.hpp.

-hls-tcl hls_tcl_directives_file

When using the Vivado® HLS tool to synthesize the hardware accelerator, source the specified Tcl file containing HLS directives. During HLS synthesis, sdscc creates a run.tcl file used to drive the Vivado HLS tool and 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.

-mno-lint

Suppress the static analysis of hardware accelerator source files. This linting process checks for potential errors or issues in the source file. This option should only be used if the analysis prevents generation of the hardware accelerator and you are certain that you can continue.

-shared-aximm

Share AXIMM ports instead of enabling multiple ports.