General description, General description –3 – Altera RAM Initializer User Manual

Page 9

Advertising
background image

Altera Corporation

Confidential—Internal Use Only

1–3

May 2008

RAM Initializer (ALTMEM_INIT) Megafunction User Guide

About this Megafunction

General
Description

The main function of the ALTMEM_INIT megafunction is to copy the
content of a ROM into the RAM of a HardCopy device. The RAM can be
initialized in two modes—the internal-ROM or external-ROM mode. For
both modes, initialization begins when you assert the init signal.

In the internal-ROM mode, the RAM is initialized with the content of the
ROM in the ALTMEM_INIT megafunction. This mode uses only the
INIT_FILE

parameter and does not require any connection to the

datain[]

and rom_address[] ports.

In the external-ROM mode, the RAM is initialized from either an on-chip
or off-chip ROM. The datain[] and rom_address[] ports of the
megafunction must be connected to the external ROM. The initialization
process can be automated with a fixed latency by using the
ROM_READ_LATENCY

parameter, or configured with a variable latency by

using the PORT_ROM_DATA_READY parameter and the
rom_data_ready

control signal.

For the initialization of a RAM from an external ROM with fixed latency,
set the ROM_READ_LATENCY parameter to the number of delay cycles
incurred after the ALTMEM_INIT megafunction initiates a read from the
ROM. For example, if the ROM has both its input and output ports
registered, you can set the clock latency to 2 clock cyles. A fixed latency is
usually used for an external on-chip ROM where you can identify the
number of delay cycles.

For an off-chip ROM, you may not be able to identify the latency, or the
latency may vary for different ROMs. In such cases of variable latency,
you can use the PORT_ROM_DATA_READY parameter and the
rom_data_ready

signal to control when to read data into the

megafunction.

The ALTMEM_INIT megafunction can also initialize a RAM without a
ROM, but the RAM content can only be set to all zeros. For such an
initialization, you do not need to use the INIT_FILE parameter or any
ROM ports.

The init_busy signal of the ALTMEM_INIT megafunction reflects the
initialization status. You can use this signal as an active-low signal to
enable the subsequent processes or as an indicator to show that memory
initialization is complete.

Advertising