The lpm_ram_dq, lpm_ram_io, and lpm_rom to instantiate synchronous and asynchronous RAM and ROM. However, if you wish to enter cycle-shared dual port ram (csdpram), dual-port RAM (altdpram), single-Clock FIFO (scfifo), and dual-clock FIFO (dcfifo) functions, or if you wish create simulation models for any supported RAM or ROM function, you can use the Altera-provided genmem utility. Designs that instantiate genmem-generated synchronous and asynchronous RAM and ROM -- such as those used with FPGA Compiler or Design Compiler -- are supported for backward compatibility. Type genmem
at the DOS or UNIX prompt to display information on how to use this utility, as well as a list of the functions you can generate.
To instantiate an lpm_ram_dq, lpm_ram_io, or lpm_rom function:
| |
Follow the guidelines in Instantiating LPM Functions in Verilog HDL. |
To instantiate other RAM and ROM functions in Verilog HDL, follow these steps:
- Use the genmem utility to generate a memory model by typing the following command at a DOS or UNIX prompt:
genmem<memory type><memory size>-verilog
For example:
genmem scfifo 16x8 -verilog
- Create a Verilog HDL design that instantiates the <memory name>.v function. The genmem utility produces files with descriptive names that typically include both the memory type and the memory size (e.g., scfifo_16x8_d.v).

In MAX+PLUS II version 8.3 and lower, running genmemon a PC always creates files named as genmem.vhd, genmem.cmp, and genmem.v, regardless of the memory type and memory size values you specify.
- (Optional for RAM functions) Specify an initial memory content file:
- For ROM functions, you must specify the filename of an initial memory content file in the Intel hexadecimal format (.hex) or the
Altera® Memory Initialization File (.mif) format in the Parameter Statement, using theLPM_FILEparameter. The filename must be the same as the instance name; e.g., theu1instance name must be unique throughout the whole project, and must contain only valid Verilog HDL name characters. The initialization file must reside in the directory containing the project's design files. - For RAM functions, specifying a memory initialization file is optional. If you want to use it, you must specify it in the Parameter Statement as described above.
- For ROM functions, you must specify the filename of an initial memory content file in the Intel hexadecimal format (.hex) or the
| |
|
- Continue with the steps necessary to complete your Verilog HDL design, as described in Creating Verilog HDL Designs for Use with MAX+PLUS II Software.
Related Links:
- Go to FLEX 10K Devices, which is available on the web, for additional information.
Feedback
Did this information help you?
If no, please log onto mySupport to file a technical request or enhancement.
Altera does not warrant that this solution will work for the customer's intended purpose and disclaims all liability for use of or reliance on the solution.
