Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17268 Discussions

Dual ports - infer or megawizard advantages/disadvantages

Altera_Forum
Honored Contributor II
2,229 Views

Hi all, elementary question perhaps but is there any advantage in instantiating a dual port RAM (or any memory type buffer for that matter) using the IP Catalog/Megafunction Wizard rather than inferring? I suppose the same question could be asked for lots of different functions.  

 

The reason I ask is because what I have done in past projects (rightly or wrongly) is to write a re-usable parameterized module which internally hijacks a megawizard generated module and replaces any fixed numbers with appropriate parameters. This is a bit of a strange way to do it in retrospect (but it works well) and also I had to add parameters to specify RAM type such as M9K or M512 (for Stratix III). Now I am working on a new project with Arria V and some of those settings don't make sense, so I thought why did I ever do it this way? i.e. why not infer and let Quartus work out how to implement the functionality. 

 

I apologize in advance if this question comes up all the time, but I suppose it's always good to hear other views on these things. 

 

Thanks, 

D
0 Kudos
6 Replies
Altera_Forum
Honored Contributor II
741 Views

Generally to ensure compatibility, I would use the IP Catalog and Megafunction.

0 Kudos
Altera_Forum
Honored Contributor II
741 Views

I generally use VHDL only and let Quartus infer megafunctions to have multivendor compatibility

0 Kudos
Altera_Forum
Honored Contributor II
741 Views

Inference is usually prefered, as it allows portability into Xilinx devices. You can use attributes on infered ram to force the ram type to M9k/MLAB etc.  

There are some things that cannot be infered, like write-before-read mode.  

 

Have you read the coding style guidelines from the Quartus handbook - there is a whole section of templates to infer different styles of RAM
0 Kudos
Altera_Forum
Honored Contributor II
741 Views

Yes I have read the coding guidelines thanks. I think the portability issue is very relevant, more so for us now than a few years ago as it happens. My own opinion is that yes, inference would be better in this regard or at the very least have some form of portability layer to shield the important bits of IP from reliance on specific hardware if at all possible - that's kind of the approach I have taken until very recently.

0 Kudos
Altera_Forum
Honored Contributor II
741 Views

The way I have seen it done before - have a library that infers ram in the way that each vendor requires the code to be written to infer the ram, ensuring the interface is identical. Then you simply instantitate the memory and just include the appropriate library for the vendor you are currently using.

0 Kudos
Altera_Forum
Honored Contributor II
741 Views

See also code template in Quartus

0 Kudos
Reply