Page 1 of 1

Direct connection between accelerated function

Posted: Tue Jul 18, 2017 9:37 am
by Boitumelo_Ruf
Hi everyone,

how do I tell SDSoC to directly connect two accelerated functions with a temporary buffer as data exchange instead of writing the intermediate data to DDR?

\Boitumelo

Re: Direct connection between accelerated function

Posted: Tue Jul 18, 2017 10:44 am
by Mustapha_Bouhali
Sharing some thoughts,

I asked about this before. Without SDSoC, the method is to use an RTL generated by HLS of your function in with your platform. If you have the functions already in HDL that's even much easier.

I'm not sure about SDSoC but it would be helpful if you buffer the data also with the AXI ACP port that goes to the cache of the PS i.e. major change in the platform.

Re: Direct connection between accelerated function

Posted: Tue Jul 18, 2017 10:55 am
by Timoteo
Hi,

That's a good question.

I'm not a C developer (for now!), but I understand by concept that you should optimize your code in order to get the maximum performance in your application with SDSoC.

About your question, remember that SDSoC is based on HLS, and the way your functions in C are translated to the PL, in order to take as much performance as possible from it, is optimizing your code pipelining the processes executed in your code. Intercommunication between accelerated functions is at the end reduced to AXI communication between blocks instantiated by SDSoC, (whether AXI memory map, DMA transfers, etc). The understanding of how to tell SDSoC how to do that especifically, my bet is that is reduced to pragmas in your code, commands that, through the HLS libraries will make a difference when your functions are instantiated in the hardware platform.

To understand much better how HLS works, (i've never used HLS), and how to optimize your code understanding HLS as part of this game, have a look to the SDSoC Environment document. Chapter 6: https://www.xilinx.com/support/documentation/sw_manuals/xilinx2015_2/ug1027-intro-to-sdsoc.pdf From page 40, it talks about Hardware Function Interface Details.

Further than this, I'm afraid I can't say much more, it's out of my knowledge. I suggest you ask Xilinx directly if its documentation doesn't give you the proper answer. (either Xilinx, or other Tulipp developers that worked with HLS already!)

Timoteo

Re: Direct connection between accelerated function

Posted: Tue Jul 25, 2017 12:28 pm
by Lester_Kalms
There is an example of how to stream efficiently between functions in the:
https://github.com/tulipp-eu/tulipp-too ... ng-Library

I can give a small example of how to stream between 2 functions in 1 accelerator, since it is more efficient than building 2 accelerators and stream between them.

#pragma SDS data copy(input[O:PIXELS], output[0:PIXELS])
#pragma SDS data data_mover(input:AXIDMA_SIMPLE, output:AXIDMA_SIMPLE)
#pragma SDS data access_pattern(input:SEQUENTIAL, output:SEQUENTIAL)

void func0(int *input, int *output) {

static int buffer[PIXELS];
#pragma HLS STREAM variable = buffer depth = 512

#pragma HLS DATAFLOW
func1 (input, buffer);
func2(buffer, output);
}

Re: Direct connection between accelerated function

Posted: Fri Jul 28, 2017 12:05 pm
by Boitumelo_Ruf
Thanks :D

Lester_Kalms wrote:There is an example of how to stream efficiently between functions in the:
https://github.com/tulipp-eu/tulipp-too ... ng-Library

... stream between 2 functions in 1 accelerator, since it is more efficient than building 2 accelerators and stream between them.

}

Note to myself: Accelerate func0! ;)