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: 
Highlighted
Observer y.lee0320
Observer
309 Views
Registered: ‎01-02-2019

Prevent a loop in function from unrolled

Jump to solution

Hi,

In xilinx website, I found the following description about loop unroll, is there any way to avoid the unroll for a loop with full-partitioned array ?   The unroll consumes a lot of resource in my design.

Thanks in advance.

 

 

TIP: When the use of pragmas like DATA_PACK, ARRAY_PARTITION, or ARRAY_RESHAPE, let more data be accessed in a single clock cycle, Vivado HLS automatically unrolls any loops consuming this data, if doing so improves the throughput. The loop can be fully or partially unrolled to create enough hardware to consume the additional data in a single clock cycle. This feature is controlled using the config_unroll command. See config_unroll in the Vivado Design Suite User Guide: High-Level Synthesis (UG902) for more information.

0 Kudos
1 Solution

Accepted Solutions
Xilinx Employee
Xilinx Employee
272 Views
Registered: ‎09-05-2018

Re: Prevent a loop in function from unrolled

Jump to solution

Hey @y.lee0320 ,

HLS only automatically unrolls loops as stated in your tip if you have added config_unroll to your configuration settings. You may have to remove this option from your configuration settings.

The other possibility is that you have a PIPELINE directive above this loop in your code. That would force the lower level loops to unroll as well.

Nicholas Moellers

Xilinx Worldwide Technical Support
4 Replies
Xilinx Employee
Xilinx Employee
296 Views
Registered: ‎06-04-2018

Re: Prevent a loop in function from unrolled

Jump to solution

Hi @y.lee0320 ,

As we have option of partial unrolling with factor = x

#pragma HLS UNROLL factor=1

Can you try providing factor=1 in your case to see if the  unrolling happens only 1 level(means no unrolling done).

Regards,
Vishnu
----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------

Xilinx Employee
Xilinx Employee
273 Views
Registered: ‎09-05-2018

Re: Prevent a loop in function from unrolled

Jump to solution

Hey @y.lee0320 ,

HLS only automatically unrolls loops as stated in your tip if you have added config_unroll to your configuration settings. You may have to remove this option from your configuration settings.

The other possibility is that you have a PIPELINE directive above this loop in your code. That would force the lower level loops to unroll as well.

Nicholas Moellers

Xilinx Worldwide Technical Support
Scholar u4223374
Scholar
250 Views
Registered: ‎04-26-2015

Re: Prevent a loop in function from unrolled

Jump to solution

@y.lee0320  Anything with a fully partitioned array tends to occupy a lot of resources in HLS. If the loop is unrolled then you end up with lots of copies of the loop hardware. If the loop isn't unrolled then HLS has to build a massive multiplexer to get access to the data. A better approach might be to check whether you can avoid partitioning the array, or turn it into a shift register.

0 Kudos
Observer y.lee0320
Observer
216 Views
Registered: ‎01-02-2019

Re: Prevent a loop in function from unrolled

Jump to solution

Yes, I tried the unroll factor directive, it's no use. I think the main reason is because I have a PIPELINE II=1 directive above this loop. The only way to avoid unroll is to relieve the II to above 2.

0 Kudos