cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
10,482 Views
Registered: ‎05-05-2009

How to replace DSP blocks for LUT in Expressions

 

I have realized that VIVADO HLS sometimes uses DSP blocks to instantiate Expressions, which are n-bit arithmetic circuits (fixed-point), commonly for, I suppose, loop control and memory addressing.

 

I need that Expressions be instantiated using LUTs instead of DSP blocks, so DSP blocks can be reserved for floating-point arithmetics.

 

I was trying to force VIVADO HLS to instantiate LUTs instead of DSP blocks using pragmas as ALLOCATION and RESOURCE with no success.

 

Any ideas?

 

 

Tags (4)
0 Kudos
4 Replies
Highlighted
Moderator
Moderator
10,471 Views
Registered: ‎04-17-2011

What is the expression and what is the RESOURCE directive you were tying?
Regards,
Debraj
----------------------------------------------------------------------------------------------
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.
----------------------------------------------------------------------------------------------
0 Kudos
Highlighted
Visitor
Visitor
10,453 Views
Registered: ‎05-05-2009

Dear Debraj,

Suppose I want to implement this particular version of a MAC operation,

#define M 42
#define N 21

 

void my_mac(float V[N][M], float Dv[M][N], float vDv[N])
{
     int32_t i;

     float acc;
     float accv[M+4];

 

     for (k=0; k<N; k++)
     {
          accv[0] = 0;
          accv[1] = 0;
          accv[2] = 0;

          for (i=0; i<M; i++)
          {   

#pragma HLS PIPELINE
#pragma HLS UNROLL skip_exit_check factor=2

          

               accv[i+3] = accv[i] + V[k][i] * Dv[i][k];
          }

          acc = accv[M] + accv[M+1] + accv[M+2];

          vDv[k] = 1 / acc;
     }
}

 

Without additional pragmas, this circuit allocates 13 DSP for Instance and 2 DSP for Expression (VIVADO HLS 2014.2).

I tryied the following directives with no success:

#pragma HLS RESOURCE variable=i core=AddSub
// When it comes to variable i, only allocate combinational adders and subtractors

#pragma HLS ALLOCATION instances=FAddSub_fulldsp limit=3 core
// Only allocate 3 floating-point adder or subtractor implemented using only DSP48s

#pragma HLS ALLOCATION instances=FCmp limit=0 core
// Do no allocate 1 floating-point comparator.

Any ideas? :-)

0 Kudos
Highlighted
Contributor
Contributor
9,305 Views
Registered: ‎05-27-2015

Hi rodralez, 

 

Did you manage to find a way for your problem. If yes, can you please share the solution?

 

Moreover, are you sure that the DSPs are used for expressions and not for multiplication between floats ?

 

Kind regards,

 

Abdul

0 Kudos
Highlighted
Moderator
Moderator
9,149 Views
Registered: ‎04-17-2011

Guys,
Check this thread to avoid using DSP for floating point operations. It would use LUT's & FF's instead.
http://forums.xilinx.com/t5/High-Level-Synthesis-HLS/Matrix-multiplication-without-using-DSP/td-p/629898
Regards,
Debraj
----------------------------------------------------------------------------------------------
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.
----------------------------------------------------------------------------------------------
0 Kudos