cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Explorer
Explorer
4,510 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
Highlighted
Participant
Participant
7,653 Views
Registered: ‎06-08-2016

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.

View solution in original post

4 Replies
Highlighted
Participant
Participant
7,654 Views
Registered: ‎06-08-2016

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.

View solution in original post

Highlighted
Teacher
Teacher
4,485 Views
Registered: ‎03-31-2012
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.
Highlighted
Advisor
Advisor
4,463 Views
Registered: ‎04-26-2015

@jehandad

 

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

Highlighted
Participant
Participant
4,452 Views
Registered: ‎06-08-2016

Dint knew that, thanks 

0 Kudos