Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
16612 Discussions

Unused addresses in embedded memory block ? are they lost ?

Altera_Forum
Honored Contributor II
1,346 Views

Hello ! 

 

I could not find the answer of this question in documentation :  

 

If I need to implement many FIFOs, 32 bits width, 128 bits depth. 

I am using stratix III FPGAs. 

An embedded M9K block is used by quartus and a configuration is chosen : 256*32. 

 

But, in this situation only the first 128 addresses of the memory block are used. 

 

What about addresses from 128 to 256 ? Could they be used by another instance ? Is it done automatically during synthesis or fitting ? 

 

The example above is quite precise, but my question is very general about the ability of quartus software to allocate unused memory spaces. 

 

Thank you in advance. 

Cecile
0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
519 Views

You do have to be aware of the memory types in an FPGA to be able to allocate them optimally. The memories generally have true dual-ports, where you can read or write to one side, and read or write to the other in parallel, or simple dual-port, where you can write to one side and read from the other. FIFOs can be implemented using either type, with the latter being the most obvious choice. When you have dual-clocked FIFOs, the write-side and the read-side use different clocks. 

 

If you configure the FIFO depth such that it does not use all the memory, then because the independent read and write ports are already used, you cannot implement another FIFO. This means that the unused memory cannot be accessed ... the only option is to make your FIFO deeper so that it can use the memory, or make it shallower, so that a different memory type is used. 

 

Cheers, 

Dave
0 Kudos
Altera_Forum
Honored Contributor II
519 Views

Hello, 

 

thank you for your answer. As I said before, the FIFO example is just an illustration. I am interested in this issue for every possible usage of the memory blocks. 

 

Correct if I am wrong : whatever the type of memory block, and whatever the block configuration (simple port memory / dual port memory / FIFO /...), if do not use the entire block, addresses left are lost ? 

 

There is not any optimization option that can allocate free space to other instances ? even with restrictions ? 

 

Thank you for your answer. 

Cecile
0 Kudos
Altera_Forum
Honored Contributor II
519 Views

 

--- Quote Start ---  

 

thank you for your answer. As I said before, the FIFO example is just an illustration. I am interested in this issue for every possible usage of the memory blocks. 

 

Correct if I am wrong : whatever the type of memory block, and whatever the block configuration (simple port memory / dual port memory / FIFO /...), if do not use the entire block, addresses left are lost ? 

 

There is not any optimization option that can allocate free space to other instances ? even with restrictions ? 

 

--- Quote End ---  

Once the memory access ports are used, unused addresses are lost. So, an 'optimal' implementation is to size the FIFOs/Memory/whatever to first use only the memory required, and then adjust the size to use all the memory in a memory block allocated (if the 'extra' memory will help). 

 

Cheers, 

Dave
0 Kudos
Altera_Forum
Honored Contributor II
519 Views

Hello, 

 

I am very sorry to insist : I have just found a post on a similar subject, where dsl said that  

I wanted to ask him with private message, but I am too new to the forum to send PM. 

He said :  

Any memory block has to be made up of entire M9K blocks - even though the system build will show the actual memory cells used (not overly useful). 

the one exception is that is will use the second port to let two users share the same m9k block - provided the access modes allow it." 

 

So, if i understand well, when a M9k or M144k is partially used as a single port memory, quartus can fit another instance to the memory left, which is accessible with the second port ? 

 

Where can this be configured ?  

Thank you for your answer. 

Cecile
0 Kudos
Altera_Forum
Honored Contributor II
519 Views

Ive never seen quartus do that automatically. I would think you would have to do that youself by instantiating the rams via the megawizard (or manually) and then connecting them as you say.  

 

But this is all about sorting out optimal utilisation yourself.  

 

What quartus can do though is group together memories that share the same address bus. Then it will pack them into the same physical M9k.
0 Kudos
Reply