UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Explorer
Explorer
1,273 Views
Registered: ‎03-29-2017

How to set :pragma HLS clock

Hi,

 

I want to make my program to run faster. So i need to apply clock period to all functions in the design. What is procedure to follow ?

 

I have followed UG902 but i am not clear. Please explain me with examples.

0 Kudos
6 Replies
Xilinx Employee
Xilinx Employee
1,267 Views
Registered: ‎08-01-2008

Re: How to set :pragma HLS clock

For C and C++ designs, only a single clock is supported. For SystemC designs, multiple named clocks can be created and applied to different SC_MODULEs using the set_directive_clock command

 

For the C/C++ designs, if you connect the slow clock domain to the VHLS IP the tools should introduce the necessary circuits for clock rate conversion in the axi interconnect. .

Thanks and Regards
Balkrishan
--------------------------------------------------------------------------------------------
Please mark the post as an answer "Accept as solution" in case it helped resolve your query.
Give kudos in case a post in case it guided to the solution.
0 Kudos
Explorer
Explorer
1,257 Views
Registered: ‎03-29-2017

Re: How to set :pragma HLS clock

Shall i use below syntax directly into C code

 

#pragma HLS clock domain=slow_clock.

 

How can i add the pragma directives into C codes. I am beginner to HLS please explain me step by step. It will be usable to me.

 

 

Thanks.

 

0 Kudos
Xilinx Employee
Xilinx Employee
1,255 Views
Registered: ‎08-01-2008

Re: How to set :pragma HLS clock

yes you can find examples here
https://www.xilinx.com/html_docs/xilinx2017_2/sdaccel_doc/topics/pragmas/ref-pragma_HLS_clock.html
Thanks and Regards
Balkrishan
--------------------------------------------------------------------------------------------
Please mark the post as an answer "Accept as solution" in case it helped resolve your query.
Give kudos in case a post in case it guided to the solution.
0 Kudos
Explorer
Explorer
1,246 Views
Registered: ‎03-29-2017

Re: How to set :pragma HLS clock

Yes, i seen already.

 

I have program in C codes

 

Whether i need to give these commands in TCL window,

 

create_clock -period 15 fast_clk

create_clock -period 60 slow_clk

 

or else i need to give, pragma command inside the function of C codes.

 

 

 

 

0 Kudos
Xilinx Employee
Xilinx Employee
1,232 Views
Registered: ‎08-01-2008

Re: How to set :pragma HLS clock

both the places . you need to give pragma inside the c function and in tcl

create_clock -period 15 fast_clk
create_clock -period 60 slow_clk
Thanks and Regards
Balkrishan
--------------------------------------------------------------------------------------------
Please mark the post as an answer "Accept as solution" in case it helped resolve your query.
Give kudos in case a post in case it guided to the solution.
0 Kudos
Moderator
Moderator
1,210 Views
Registered: ‎06-24-2015

Re: How to set :pragma HLS clock

@thaus_015

 

The create_clock will be useful only if you are using SystemC.

If you are using C/C++, you can speed up the modules by using PIPELINE/LATENCY directives on those particular modules.

Refer this link for syntax of PIPELINE/LATENCY pragmas: https://www.xilinx.com/support/documentation/sw_manuals/xilinx2017_3/ug902-vivado-high-level-synthesis.pdf

You can also apply the directives by right-clicking the function in the Directive window on the right and clicking "Insert Directive".

Thanks,
Nupur
--------------------------------------------------------------------------------------------
Google your question before posting. If someone's post answers your question, mark the post as answer with "Accept as solution". If you see a particularly good and informative post, consider giving it Kudos (click on the 'thumbs-up' button).
0 Kudos