EmbDev.net

Forum: FPGA, VHDL & Verilog HOW TO USE FPGA RAM BLOCKS ?


Author: Kenzo K. (id91)
Posted on:

Rate this post
0 useful
not useful
Hi every one.

I'm using altera MAX10M08SAU169C8G FPGA.
My design code has already used 80% of logic cell available in the FPGA 
(total logic cells 8064).

Is anybody know how to use RAM blocks, instead of logic cell registers?
Otherwise how can put some logic elements in FPGA RAM block?

Thanks.

Author: Lothar M. (lkmiller) (Moderator)
Posted on:

Rate this post
0 useful
not useful
Kenzo K. wrote:
> Is anybody know how to use RAM blocks, instead of logic cell registers?
1. Usually in the synthesizers users guide you can find hints how to 
write HDL code to infer RAM blocks.
2. You also can infer RAM blocks manually. Then you get a less portable 
design, but you have more control over the implementation.

Kenzo K. wrote:
> My design code has already used 80% of logic cell available in the FPGA
And why do you expect to turn down this value by using RAM blocks?

: Edited by Moderator
Author: Kenzo K. (id91)
Posted on:

Rate this post
0 useful
not useful
> And why do you expect to turn down this value by using RAM blocks?

Because I would like to implement an algorithm in my FPGA that also 
consumed a lot of logic cells .
So I am wondering if it is possible to put some logic cells in RAM 
blocks.

In quartus tool it said  to Use the MegaWizard Plug-In Manager (Tools 
menu) or appropriately coded Hardware Description Language to implement 
a function in a RAM block. But I am not sure if it is the good approach.

Author: Kenzo K. (id91)
Posted on:

Rate this post
0 useful
not useful
Is there any option in quartus II to do that.?

Thanks.

Author: Lothar M. (lkmiller) (Moderator)
Posted on:

Rate this post
0 useful
not useful
Kenzo K. wrote:
> Use the MegaWizard Plug-In Manager (Tools menu) or appropriately coded
> Hardware Description Language to implement a function in a RAM block.
> But I am not sure if it is the good approach.
You have only those two. You must choose one of them.
I would try the second first. Then it's more easy to simulate the 
design.

: Edited by Moderator
Author: P. K. (pek)
Posted on:

Rate this post
0 useful
not useful
I had the same issue on a Max10 device recently, too. Even if running 
out of logic cells, Quartus refused to implement the inferred memory in 
block ram saying it was to small and will not infer RAM blocks.

So you have force the tool to use block memory when inferring only small 
memories. I did the following:

  attribute ramstyle          : string;
  attribute ramstyle of RamxD : signal is "M9K";

I know that "M9K" is not very portable, may be "M-RAM" should do, but I 
didn't test this so far.

See:
http://quartushelp.altera.com/15.0/mergedProjects/...

: Edited by User
Author: Svenska (Guest)
Posted on:

Rate this post
0 useful
not useful
Generally, inferring block memories depends on the toolchain. A good 
reference is available at 
https://danstrother.com/2010/09/11/inferring-rams-in-fpgas/.

There is no universal way, sadly.

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [vhdl]VHDL code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.