Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Community Forums
- :
- Forums
- :
- Software Development and Acceleration
- :
- HLS
- :
- Re: How to parallel 4 different independent functi...

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Highlighted

nanson

Explorer

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

03-30-2020 07:26 AM

492 Views

Registered:
08-31-2017

Hi, dear HLS elites,

I'm using HLS to explore how to implement the following parallel architecture.

The top module input is a[2] and the output is d[4]. The fun_A, fun_B, fun_C, and fun_D are different and independent functions and I would like to have the 4 functions to run in parallel.

Firstly, I studied the description of the dataflow in the UG902. However, it appears the architecture I considered has no consumer between func_A to func_D. Thus, I think it doesn't meet the requirement of dataflow as I know.

Thus, I need you advice on how to implement the parallel architecture for the code.

void top (a[2],d[4]) { //assume a[2] and d[4] are partitioned completely

func_A(a,d[0]); // input is a[2] and output is d[0]

func_B(a,d[1]);

func_C(a,d[2]);

func_D(a,d[3]);

}

Thank you very much.

1 Solution

Accepted Solutions

Highlighted

nithink

Xilinx Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

03-30-2020 12:16 PM

397 Views

Registered:
09-04-2017

@nanson Apply INLINE off on function_1, function_2 and function_3

Then look at the Analysis view

#pragma HLS INLINE off

HLS schedules these in parallel

Thanks,

Nithin

8 Replies

Highlighted
##

Jump to solution

A8738

Visitor

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

03-30-2020 07:50 AM

481 Views

Registered:
03-30-2020

Re: How to parallel 4 different independent functions with the same inputs ?

Hi @nanson ,

I don't think those functions will run in parallel as they use the same input (reading from one array). HLS can't share an array between two functions that are supposed to be run in parallel so if you have functions which are reading from one array then the tool will run them sequentially.

Highlighted
##

Jump to solution

nanson

Explorer

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

03-30-2020 08:23 AM

470 Views

Registered:
08-31-2017

Re: How to parallel 4 different independent functions with the same inputs ?

@A8738 Thank you.

Provided that the a[2] is partitioned as registers completely and thus they are broadcasted to these downstream 4 functions. If that's the case, does HLS still have a problem to parallelize these 4 functions?

Highlighted
##

Jump to solution

nithink

Xilinx Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

03-30-2020 08:27 AM

466 Views

Registered:
09-04-2017

Re: How to parallel 4 different independent functions with the same inputs ?

@nanson If they are completely partitioned, HLS should be able to run them in parallel.

Are you seeing HLS not scheduling that way?

Thanks,

Nithin

Highlighted
##

Jump to solution

nanson

Explorer

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

03-30-2020 09:14 AM

450 Views

Registered:
08-31-2017

Re: How to parallel 4 different independent functions with the same inputs ?

I don't try yet. I'm conducting an experiment without any HLS constraints and let you know if it works as you said.

Thank you.

Highlighted
##

Jump to solution

nanson

Explorer

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

03-30-2020 10:05 AM

442 Views

Registered:
08-31-2017

Re: How to parallel 4 different independent functions with the same inputs ?

I tried two cases. The first one is input a[2] with complete partition directive and the second one is to use 3 different inputs explicitly. However, all cannot be implemented as parallel functions. All implementation is in serial.

Thus, I need your help in how to enable parallel functions running in the case. Attached please find the testcase for your information. Thank you.

Highlighted
##

Jump to solution

nanson

Explorer

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

03-30-2020 12:02 PM

402 Views

Registered:
08-31-2017

Re: How to parallel 4 different independent functions with the same inputs ?

I also tried the following case which uses independent output variables but HLS still implements sequentially.

void linear ( float in_data1[2],

float in_data2[2],

float in_data3[2],

float& HN_OUT_0,

float& HN_OUT_1,

float& HN_OUT_2

)

{

HN_OUT_0=function_1(in_data1);

HN_OUT_1=function_2(in_data2);

HN_OUT_2=function_3(in_data3);

}// end of linear_core

Highlighted

nithink

Xilinx Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

03-30-2020 12:16 PM

398 Views

Registered:
09-04-2017

@nanson Apply INLINE off on function_1, function_2 and function_3

Then look at the Analysis view

#pragma HLS INLINE off

HLS schedules these in parallel

Thanks,

Nithin

Highlighted
##

Jump to solution

nanson

Explorer

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

03-30-2020 12:40 PM

383 Views

Registered:
08-31-2017

Re: How to parallel 4 different independent functions with the same inputs ?

@nithinkThank you. It works now.

To sum up, the way to parallel 4 different independent functions with the same inputs work by doing the trick with applying "HLS pragma INLINE off" on each function separately.

p.s. The input and output of the code below share the same array with completely array partition.

void linear ( float in_data1[2],

//float in_data2[2],

//float in_data3[2],

float HN_OUT[3]

//float& HN_OUT_1,

//float& HN_OUT_2

)

{

HN_OUT[0]=function_1(in_data1);

HN_OUT[1]=function_2(in_data1);

HN_OUT[2]=function_3(in_data1);