Implementing CAM, RAM & ROM (AHDL)

The Quartus® Prime software and AHDL support several library of parameterized modules (LPM) functions and other megafunctions that allow you to implement RAM and ROM in Altera devices. The generic, scalable nature of each of these functions ensures that you can use them to implement any supported type of RAM or ROM.

Note: Altera recommends that you either use Altera-provided megafunctions to implement RAM or ROM, or use the IP Catalog to edit Altera-provided RAM or ROM megafunctions. You should not create a megafunction to implement memory or edit the text file for an Altera-provided megafunction.

You can use the following megafunctions to implement RAM and ROM in the Quartus® Prime software:

Name

Description

lpm_ram_dq

Synchronous or asynchronous memory with separate input and output ports

lpm_ram_io

Synchronous or asynchronous memory with a single I/O port

lpm_rom

Synchronous or asynchronous read-only memory

altsyncram

True dual-port memory

lpm_ram_dp

Dual-port memory

In these logic functions, parameters are used to determine the input and output data widths; the number of data words stored in memory; whether data inputs, address inputs, control inputs, and outputs are registered or unregistered; whether an initial memory content file should be included for a RAM block; and so on. You must declare parameter names and values for an instance of a RAM or ROM logic function using a WITH clause, as described in Using Altera-Provided Parameterized Functions.