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: 
582 Views
Registered: ‎10-19-2019

How to store my array data into BRAM or URAM in vivado HLS 2018.3?

Jump to solution

Hello,

 

I am working on vivado HLS c code implementation and trying to store my array data into BRAM and URAM memory. But i could not store my array data into  either BRAM or URAM by using directives.Here below are my understandings and some doubts.

1.When i pass an array as parameter from test bench(main function) to top level function, where this array data will store in default?

I observed that, in default LUT and FF are consuming for this array data.How can i change from LUT/FF to BRAM store.

2.BRAM in default, if i declare and use any array inside of top level function with some huge size then only i have observed there was BRAM consuming.

Example for above 1st point:

 

1.formal parameters consuming:

test bench:

int main()

{

int array[3]={1,2,3};

int out[3];

char a=2,b=4,c=5;

foo(in,a,b,c,out);

}

void foo(int in[3], char a, char b, char c, int out[3]) {

 int x,y;

 for(int i = 0; i < 3; i++) {

 x = in[i];

 y = a*x + b + c;

 out[i] = y;

 }

}

 

1.How can i store "in" array into bram or uram?

 

0 Kudos
1 Solution

Accepted Solutions
Xilinx Employee
Xilinx Employee
441 Views
Registered: ‎09-04-2017

Re: How to store my array data into BRAM or URAM in vivado HLS 2018.3?

Jump to solution

Hi,

   There is no directive to force URAM implementation through HLS for the interface.

what you can do is change the attribute in RTL. The default MEM_STYLE attribute is block

you can change it to "ultra" and run RTL synthesis

module top_top_b_m_axi_buffer
#(parameter
MEM_STYLE = "ultra",
DATA_WIDTH = 32,

Thanks,

Nithin

View solution in original post

0 Kudos
5 Replies
Xilinx Employee
Xilinx Employee
576 Views
Registered: ‎09-04-2017

Re: How to store my array data into BRAM or URAM in vivado HLS 2018.3?

Jump to solution

Hi,

   You are reading from "in" which is an array. HLS creates memory interface for this which means it's accessing data from memory which is outside this module.

If you want to store this, you can add an internal array and store into this array. and then use it. That way an internal memory will be created. Since the size is very small, just 3 elements, HLS may not create a memory, you can force it using directives

Thanks,

Nithin

470 Views
Registered: ‎10-19-2019

Re: How to store my array data into BRAM or URAM in vivado HLS 2018.3?

Jump to solution

Thank you for quick reply,

 

I understand, when i use internal array(inside function def) implicitly or explicitly i am able to store into BRAM but i 

want to store top level function argument "in" in BRAM not an internal array.

Solution:

I observed and found solution for this when i use m_axi interface for "in" array,then it is stored in BRAM instances.

Question?

1.I want to store top level function argument "in" or "out" in URAM, Which interface or directive need to use to store in URAM?

 

0 Kudos
Xilinx Employee
Xilinx Employee
442 Views
Registered: ‎09-04-2017

Re: How to store my array data into BRAM or URAM in vivado HLS 2018.3?

Jump to solution

Hi,

   There is no directive to force URAM implementation through HLS for the interface.

what you can do is change the attribute in RTL. The default MEM_STYLE attribute is block

you can change it to "ultra" and run RTL synthesis

module top_top_b_m_axi_buffer
#(parameter
MEM_STYLE = "ultra",
DATA_WIDTH = 32,

Thanks,

Nithin

View solution in original post

0 Kudos
Moderator
Moderator
374 Views
Registered: ‎05-31-2017

Re: How to store my array data into BRAM or URAM in vivado HLS 2018.3?

Jump to solution

Hi k.vamsikrishna@mobiveil.co.in ,

As I hope that your query has been answered and your issue is solved, can you please kindly mark the @nithink response which helped as a solution (click on "Accept as solution" button below the reply) ?

 

 

0 Kudos
258 Views
Registered: ‎10-19-2019

Re: How to store my array data into BRAM or URAM in vivado HLS 2018.3?

Jump to solution

Thanks for solution.

0 Kudos