cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
aripod
Explorer
Explorer
1,025 Views
Registered: ‎04-18-2017

Cannot accelerate functions to HW with ff.h

Jump to solution

Hello,

 

I have a custom platform like the one shown in UG1236 with a clock wizard, four processor system resets and a concat for interrupts.

 

I managed to create the custom platform and accelerate the function shown below:

 

#include <stdio.h>
#include "xil_io.h"
#include "ff.h"

#define ROWS		256
#define COLS		256
#define SIZE_ARR 	ROWS*COLS

#pragma SDS data mem_attribute(input:PHYSICAL_CONTIGUOUS, output:PHYSICAL_CONTIGUOUS)
#pragma SDS data copy(input[O:SIZE_ARR], output[0:SIZE_ARR])
#pragma SDS data data_mover(input:AXIDMA_SIMPLE, output:AXIDMA_SIMPLE)
#pragma SDS data access_pattern(input:SEQUENTIAL, output:SEQUENTIAL)
void Passthrough(u32 input[SIZE_ARR], u32 output[SIZE_ARR])
{

	for(int i=0; i<COLS*ROWS; i++)
	{
#pragma HLS PIPELINE II=1
		output[i] = input[i];
	}
}

int main(void)
{
	u32 inStreamData[SIZE_ARR]={0};
	u32 outStreamData[SIZE_ARR]={0};

	// Process data
	Passthrough(inStreamData, outStreamData);

	return 0;
}

The issue comes when I add the #include "ff.h". I get the following error:

 

20:06:55 **** Incremental Build of configuration Debug for project testApp ****
make pre-build main-build 
sdsoc_make_clean Debug
 
Building file: ../src/main.cpp
Invoking: SDS++ Compiler
sds++ -Wall -O0 -g -I"../src" -c -fmessage-length=0 -MT"src/main.o" -MMD -MP -MF"src/main.d" -MT"src/main.o" -o "src/main.o" "../src/main.cpp" -sds-hw Passthrough main.cpp  -clkid 0 -sds-end -sds-sys-config standalone -sds-proc standalone -sds-pf "C:\tulipp_sdCard\workspace\tulipp_7z30\export\tulipp_7z30"
Processing -sds-hw block for Passthrough
Create data motion intermediate representation

C:\tulipp_sdCard\workspace\testApp\Debug>C:\SdSoC\SDx\2017.4\llvm-clang\win64\llvm\bin\clang.exe -I../src -Wall -g -fmessage-length=0 -MMD -MP -D __SDSCC__ -target arm-none-eabi -mcpu=cortex-a9 -mfpu=vfpv3 -O0 -g -I C:/SdSoC/SDx/2017.4/target/aarch32-none/include -D HLS_NO_XIL_FPO_LIB -I C:/SdSoC/Vivado/2017.4/include -IC:/SdSoC/SDK/2017.4/gnu/aarch32/nt/gcc-arm-none-eabi/arm-none-eabi/include/c++/6.2.1 -IC:/SdSoC/SDK/2017.4/gnu/aarch32/nt/gcc-arm-none-eabi/arm-none-eabi/include/c++/6.2.1/arm-none-eabi -IC:/SdSoC/SDK/2017.4/gnu/aarch32/nt/gcc-arm-none-eabi/arm-none-eabi/include/c++/6.2.1/backward -IC:/SdSoC/SDK/2017.4/gnu/aarch32/nt/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/6.2.1/include -IC:/SdSoC/SDK/2017.4/gnu/aarch32/nt/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/6.2.1/include-fixed -IC:/SdSoC/SDK/2017.4/gnu/aarch32/nt/gcc-arm-none-eabi/arm-none-eabi/include -IC:/SdSoC/SDK/2017.4/gnu/aarch32/nt/gcc-arm-none-eabi/arm-none-eabi/libc/usr/include -std=c++11 -emit-llvm -S C:/tulipp_sdCard/workspace/testApp/src/main.cpp -o C:/tulipp_sdCard/workspace/testApp/Debug/_sds/.llvm/src/main.s 

C:\tulipp_sdCard\workspace\testApp\Debug>exit /b 0 
Performing accelerator source linting for Passthrough
Performing pragma generation

C:\tulipp_sdCard\workspace\testApp\Debug>C:\SdSoC\SDx\2017.4\llvm-clang\win64\llvm\bin\clang.exe -E -IC:/tulipp_sdCard/workspace/testApp/src -Wall -g -fmessage-length=0 -MMD -MP -D __SDSCC__ -m32 -D HLS_NO_XIL_FPO_LIB -I C:/SdSoC/SDx/2017.4/target/aarch32-none/include -IC:/tulipp_sdCard/workspace/testApp/src -D __SDSVHLS__ -target arm-none-eabi -mcpu=cortex-a9 -mfpu=vfpv3 -O0 -g -w -I C:/SdSoC/SDx/2017.4/target/aarch32-none/include -D HLS_NO_XIL_FPO_LIB -I C:/SdSoC/Vivado/2017.4/include -IC:/SdSoC/SDK/2017.4/gnu/aarch32/nt/gcc-arm-none-eabi/arm-none-eabi/include/c++/6.2.1 -IC:/SdSoC/SDK/2017.4/gnu/aarch32/nt/gcc-arm-none-eabi/arm-none-eabi/include/c++/6.2.1/arm-none-eabi -IC:/SdSoC/SDK/2017.4/gnu/aarch32/nt/gcc-arm-none-eabi/arm-none-eabi/include/c++/6.2.1/backward -IC:/SdSoC/SDK/2017.4/gnu/aarch32/nt/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/6.2.1/include -IC:/SdSoC/SDK/2017.4/gnu/aarch32/nt/gcc-arm-none-eabi/lib/gcc/arm-none-eabi/6.2.1/include-fixed -IC:/SdSoC/SDK/2017.4/gnu/aarch32/nt/gcc-arm-none-eabi/arm-none-eabi/include -IC:/SdSoC/SDK/2017.4/gnu/aarch32/nt/gcc-arm-none-eabi/arm-none-eabi/libc/usr/include -std=c++11 C:/tulipp_sdCard/workspace/testApp/src/main.cpp -o C:/tulipp_sdCard/workspace/testApp/Debug/_sds/vhls/main_pp.cpp 

C:\tulipp_sdCard\workspace\testApp\Debug>exit /b 0 
INFO: [PragmaGen 83-3231] Successfully generated tcl script: C:/tulipp_sdCard/workspace/testApp/Debug/_sds/vhls/Passthrough.tcl
Moving function Passthrough to Programmable Logic
ERROR: [SdsCompiler 83-5031] Problem detected in Vivado HLS run - unable to find solution implementation directory for Passthrough C:/tulipp_sdCard/workspace/testApp/Debug/_sds/vhls/Passthrough/solution/impl/ip. For possible causes, review C:/tulipp_sdCard/workspace/testApp/Debug/_sds/vhls/Passthrough/solution/solution.log or C:/tulipp_sdCard/workspace/testApp/Debug/_sds/vhls/Passthrough_vivado_hls.log.
C:/tulipp_sdCard/workspace/testApp/Debug/_sds/vhls/Passthrough_vivado_hls.log (last 20 lines):
INFO: [HLS 200-10] Creating and opening project 'C:/tulipp_sdCard/workspace/testApp/Debug/_sds/vhls/Passthrough'.
INFO: [HLS 200-10] Adding design file 'C:/tulipp_sdCard/workspace/testApp/src/main.cpp' to the project
INFO: [HLS 200-10] Creating and opening solution 'C:/tulipp_sdCard/workspace/testApp/Debug/_sds/vhls/Passthrough/solution'.
INFO: [HLS 200-10] Cleaning up the solution database.
INFO: [HLS 200-10] Setting target device to ' xc7z030sbg485-1 '
INFO: [SYN 201-201] Setting up clock 'default' with a period of 10ns.
INFO: [SYN 201-201] Setting up clock 'default' with an uncertainty of 2.7ns.
INFO: [HLS 200-10] Analyzing design file 'C:/tulipp_sdCard/workspace/testApp/src/main.cpp' ...
Source processing failed.
    while executing
"source C:/tulipp_sdCard/workspace/testApp/Debug/_sds/vhls/Passthrough_run.tcl"
    invoked from within
"hls::main C:/tulipp_sdCard/workspace/testApp/Debug/_sds/vhls/Passthrough_run.tcl -l Passthrough_vivado_hls.log"
    ("uplevel" body line 1)
    invoked from within
"uplevel 1 hls::main {*}$args"
    (procedure "hls_proc" line 5)
    invoked from within
"hls_proc $argv"
INFO: [Common 17-206] Exiting vivado_hls at Wed Aug 29 20:07:17 2018...
sds++ log file saved as C:/tulipp_sdCard/workspace/testApp/Debug/_sds/reports/sds_main.log
ERROR: [SdsCompiler 83-5004] Build failed

make: *** [src/main.o] Error 1

20:07:17 Build Finished (took 22s.304ms)

In the bsp in SDK I have chosen xilfs. That is why I don't have problems including it. The complete code to read from the SD card (not shown here) works if I do not accelerate the Passthrough function.

 

Why do I get this function if I include the ff.h function and move Passthrough to HW?

 

Thanks for the help.

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
aripod
Explorer
Explorer
995 Views
Registered: ‎04-18-2017

The problem is not with the ff.h function. The issue is that the function to be accelerated has to be on a separate file, not in the main.cpp. Therefore, I moved the function to a separate .cpp file and everything worked.

View solution in original post

0 Kudos
1 Reply
aripod
Explorer
Explorer
996 Views
Registered: ‎04-18-2017

The problem is not with the ff.h function. The issue is that the function to be accelerated has to be on a separate file, not in the main.cpp. Therefore, I moved the function to a separate .cpp file and everything worked.

View solution in original post

0 Kudos