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
Explorer
Explorer
4,094 Views
Registered: ‎08-26-2014

How to implement variables as Flip-Flops?

Jump to solution

Hello,

 

I am writing a code which uses very small fixed-point arrays (max. 4-by-4). I have read that HLS automatically implement arrays in BRAMs. The problem is that I need this code to be executed as fast as possible. Therefore, I would like these arrays, which some are inputs, some other outputs, and others just inside variables, to be implemented as Flip-Flops (what a hardware designer would do indeed).

 

How can I tell HLS that? Is there a directive to do so? I couldn't find one.

 

I have tried declaring the all the variables as static, which HLS interprets that I want them as distributed RAM (LUTRAM), but this is even slower than BRAM blocks.

 

Thanks,

 

Cerilet

0 Kudos
1 Solution

Accepted Solutions
Participant jehandad
Participant
7,237 Views
Registered: ‎06-08-2016

Re: How to implement variables as Flip-Flops?

Jump to solution

Hi,

 

For your variable use the following directive

 

#pragma HLS ARRAY_PARTITION variable=<your variable name> complete dim=1

and then again for dim=2 to completely partition your variable.

 

That way your variable would be implemented as registers and not RAM.

4 Replies
Participant jehandad
Participant
7,238 Views
Registered: ‎06-08-2016

Re: How to implement variables as Flip-Flops?

Jump to solution

Hi,

 

For your variable use the following directive

 

#pragma HLS ARRAY_PARTITION variable=<your variable name> complete dim=1

and then again for dim=2 to completely partition your variable.

 

That way your variable would be implemented as registers and not RAM.

Teacher muzaffer
Teacher
4,069 Views
Registered: ‎03-31-2012

Re: How to implement variables as Flip-Flops?

Jump to solution
you can fully partition an array to make them implemented as registers (DFFs etc.).
- 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.
Scholar u4223374
Scholar
4,047 Views
Registered: ‎04-26-2015

Re: How to implement variables as Flip-Flops?

Jump to solution

@jehandad

 

You can just use dim=0 to partition every dimension in the array, rather than having one pragma for each dimension.

Participant jehandad
Participant
4,036 Views
Registered: ‎06-08-2016

Re: How to implement variables as Flip-Flops?

Jump to solution

Dint knew that, thanks 

0 Kudos