Intel® High Level Design
Support for Intel® High Level Synthesis Compiler, DSP Builder, OneAPI for Intel® FPGAs, Intel® FPGA SDK for OpenCL™
674 Discussions

Intel HLS - dynamic scheduling

Mopplikus
Beginner
1,029 Views

Hello,

I've been messing with Intel HLS, but I'm struggling to see the performance benefits of dynamic scheduling. I've composed a test component which is meant to vary in performance according to the inputs I supply to it:

using namespace ihc;

typedef ihc::mm_host<int, ihc::dwidth<256>,
                          ihc::awidth<32>,
                          ihc::aspace<1>,
                          ihc::latency<1> > mem_1;
typedef ihc::mm_host<int, ihc::dwidth<256>,
                          ihc::awidth<32>,
                          ihc::aspace<4>,
                          ihc::latency<1> > mem_2;

component int if_loop_3(mem_1 &a, mem_2 &b, int n) {
	int i;
 	int dist;
	int sum = 1000;

	for (i=0; i<n; i++) {
		dist = a[i] - b[i];

		if (dist >= 0)
		{
			sum = (sum /dist);
	  	}
	}
	return sum;
}

In this instance, I am comparing best-case against worst-case, meaning the case where the if is never true against the one where it is always true, with an integer division as a long-latency event to make the difference clear.

However, when running the co-simulation with Intel HLS, in the report I always get the same latency, no matter if the test-bench supplies the best or worst case inputs to the component, suggesting that there is no dynamic scheduling taking place.

Is this correct? Do I need to specify to the compiler that it needs to use dynamic scheduling to optimize the runtime?

Thanks in advance. Also feel free to give me any suggestions concerning improving my code.

-Mopplikus

0 Kudos
3 Replies
BoonBengT_Intel
Moderator
1,003 Views

Hi @Mopplikus,


Thank you for posting in Intel community forum and hope all is well.

Noted on the interest in Intel HLS, there are best practices which will optimized your component.


From the code snippet shared, I would recommend to relook into the looping practices for HLS in the guide below which will helped the compiler to pipelines those loops better.

- https://www.intel.com/content/www/us/en/docs/programmable/683152/22-1/pro-edition-best-practices-guide.html


Mind if I asked which version of HLS are you using?

Hope that clarifies.


Best Wishes

BB


0 Kudos
BoonBengT_Intel
Moderator
946 Views

Hi @Mopplikus,


Greetings, just checking in to see if there is any further doubts in regards to this matter.

Hope your doubts have been clarified.


Best Wishes

BB


0 Kudos
BoonBengT_Intel
Moderator
909 Views

Hi @Mopplikus,


Greetings, as we do not receive any further clarification/updates on the matter, hence would assume challenge are overcome. Please login to ‘https://supporttickets.intel.com’, view details of the desire request, and post a feed/response within the next 15 days to allow me to continue to support you. After 15 days, this thread will be transitioned to community support. For new queries, please feel free to open a new thread and we will be right with you. Pleasure having you here.


Best Wishes

BB



0 Kudos
Reply