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

MegaWizard Dual Port RAM

Altera_Forum
Honored Contributor II
1,407 Views

I need to create a 544 by 32 dual port, in the MegaWizard once I've defined the width as 32 bits I can only select 512 or 1024 words which correspond to using 4 or 8 M4Ks.  

Is there a way of forcing it to use just 5 M4Ks rather than 8 or would I need to generate a 512 by 32 dual port and then a 128 by 32 dual port and link them up myself? 

 

Thanks 

Ben
0 Kudos
8 Replies
Altera_Forum
Honored Contributor II
527 Views

Dont you mean a 512x32 and a 32x32? 

 

The wizard only allows this because with n address lines, you get 2^n depth. With your odd 544 values, what would happen if the address given was 545? 

 

Anyhow, if you want anything more complicated that 2^n locations you will have to link together multiple memories and then do the address decoding yourself to turn the write-enable on for the appropriate memory. This will probably give you a lower fmax than if you were to just use a 2^n memory.
0 Kudos
Altera_Forum
Honored Contributor II
527 Views

The only reason I said 128x32 is that would be 1 whole M4K so whether you call it 32x32 or 128x32 it will use the same memory. 

 

I understand why it only seems to allow 2^n depths but as I'm running out of memory I don't want to waste 3 M4Ks on each dual port. If an invalid address was presented to the memory then it wouldn't matter what the q output was, it would be up to me to make sure that didn't happen or at least to make sure that if I did then I didn't rely on the q output being in a particular state.
0 Kudos
Altera_Forum
Honored Contributor II
527 Views

In don't understand the problem. You can enter 544 words memory size in MegaWizard, and yes it's using less RAM blocks than a 1024 words memory. 

 

Best regards, 

Frank
0 Kudos
Altera_Forum
Honored Contributor II
527 Views

There is a maximum depth attribute in the megawizard, which basically says to build the base memories to that maximum depth. And you can directly type a number in for number of words. So you would type in 544 words, and have a maximum depth of 128, so that it will build the memory out of M4Ks configured with a maximum depth of 128, i.e. 128x32. There will be some extra logic on the outside to mux the outputs together.

0 Kudos
Altera_Forum
Honored Contributor II
527 Views

How do I do that?  

I've selected RAM: 2-PORT for a Cyclone II. then on the 1st page called General I chosen 1 read port and 1 write port and the memory size as a number of words. Then on the 2nd page called Widths/Blk Type I've set the port width to 32 bits and memory block type to M4K. At the top right there is pull down menu for how many 32-bit words I want and I only get 2^n options though I can type in 544 but that still uses 8 M4K rather than 5.
0 Kudos
Altera_Forum
Honored Contributor II
527 Views

Type in 544. The default behavior is to configure the RAMs as deep as necessary, since that is the fastest implementation and uses the least amount of external logic, but that wastes memory blocks for your design. At the bottom of that page should be a Maximum Depth attribute. Type in 128.

0 Kudos
Altera_Forum
Honored Contributor II
527 Views

Thanks a lot, I've got it now.

0 Kudos
Altera_Forum
Honored Contributor II
527 Views

The said "pull down menu" control is a Windows combobox, and it allows to type in a value, unless explicitely disabled by the programmer. So an obvious procedure is simply try to enter a value, as said. It's the same procedure when selecting a non- standard character size in Microsoft Word.

0 Kudos
Reply