cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
lmaxeniro
Explorer
Explorer
685 Views
Registered: ‎09-09-2019

How to get HW clock cycle by using HLS (C/C++ kernel)

Jump to solution

Hello,

we can capture or calculate the full clock cycle consumed by a specific task or a specific module in an RTL kernel design.

My question is, is there any API library for C/C++ that can be used, so I can do the similar thing in a C/C++ kernel (HLS way)?

Please give some hint/documentation / or example project if available.

Greate thanks! 

 

0 Kudos
1 Solution

Accepted Solutions
lmaxeniro
Explorer
Explorer
647 Views
Registered: ‎09-09-2019

@nithink 

I know there are clk frequency will be reported in c-synthesis report.

What I means is: suppose I have a specific task algorithm block (for exp, a 1024 byte vector adder) and I want to know how many clock cycles will be consumed by this block, from the data input and the data output --can that be done? Will c-synthesis provide that kinds of report?

View solution in original post

0 Kudos
3 Replies
nithink
Xilinx Employee
Xilinx Employee
669 Views
Registered: ‎09-04-2017

@lmaxeniro   when you run c-synthesis, HLS will report out the frequency that is achievable. You should get a rough estimate from that

Thanks,

Nithin

0 Kudos
lmaxeniro
Explorer
Explorer
648 Views
Registered: ‎09-09-2019

@nithink 

I know there are clk frequency will be reported in c-synthesis report.

What I means is: suppose I have a specific task algorithm block (for exp, a 1024 byte vector adder) and I want to know how many clock cycles will be consumed by this block, from the data input and the data output --can that be done? Will c-synthesis provide that kinds of report?

View solution in original post

0 Kudos
nithink
Xilinx Employee
Xilinx Employee
609 Views
Registered: ‎09-04-2017

@lmaxeniro   If the task is not inlined, HLS will report out the frequency for each of the subfunction.

So what you can do is, turn off inlining on the functions that you want to observe the period.

Below i have a simple example, where i have turned off inlining on sub functions, when you run through HLS, we can see the reports for these.

void sub1(int a, int b, int &c)
{
#pragma HLS inline off
 c = a + b;
}

void sub2(int a, int b, int &c)
{
#pragma HLS inline off
 c = a - b;
}

void top(int a, int b, int a1,int b1, int &c)
{

int o1,o2;
sub1 (a,b,o1);
sub1 (a1,b1,o2);
sub2 (o1,o2,c);
}