cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
565 Views
Registered: ‎05-17-2019

Sequential access in BRAM

Jump to solution

Hello,

I have a problem when synthesizing the following code with HLS:

void fix(double PORT_A[SIZE]){
	#pragma HLS INTERFACE bram port=PORT_A
        
        double x1,x2;
	
        x1=PORT_A[0];
	x2=PORT_A[1];

	PORT_A[2]=x1+x2;
}

Basically, after the synthesis, besides the port I've defined as interface (PORT_A), HSL instantiates another BRAM port B.

By looking in the analysis perspective I've noticed that the following operations

x1=PORT_A[0];
x2=PORT_A[1];

are performed in parallel at the same cycle (and this force the synthesis to put a second BRAM).

Is there a way to tell HLS to serialize the two operations?

Thanks

 

 

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Advisor
Advisor
497 Views
Registered: ‎04-26-2015

From UG902:

 

When using an ap_memory interface, specify the array targets using the RESOURCE
directive. If no target is specified for the arrays, Vivado HLS determines whether to use a
single or dual-port RAM interface.

 

In this case, it looks like HLS has decided that a dual-port interface makes sense. You need to tell it that it's only a single-port RAM using the RESOURCE pragma.

View solution in original post

2 Replies
Highlighted
Advisor
Advisor
498 Views
Registered: ‎04-26-2015

From UG902:

 

When using an ap_memory interface, specify the array targets using the RESOURCE
directive. If no target is specified for the arrays, Vivado HLS determines whether to use a
single or dual-port RAM interface.

 

In this case, it looks like HLS has decided that a dual-port interface makes sense. You need to tell it that it's only a single-port RAM using the RESOURCE pragma.

View solution in original post

Highlighted
Visitor
Visitor
473 Views
Registered: ‎05-17-2019

YES! This is the solution!

Putting this pragma saved me:

#pragma HLS RESOURCE variable=INOUT_PORT core=RAM_1P_BRAM

 

Many thanks for the support.

0 Kudos