
Altera Corporation
 33
Storage Functions
lpm_rom
Parameterized Read-Only Memory
The 
lpm_rom
 function can be used as either 
synchronous or asynchronous read-only 
memory.
Ports
Parameters
Name
Type
Required
Description
address[]
Input
Input
Yes
No
Address input to the memory. This port is 
LPM_WIDTHAD
 wide.
Clock for input registers. The 
address[]
 port is synchronous (registered) when 
the 
inclock
 port is connected, and is asynchronous (unregistered) when the 
inclock
 port is not connected.
Clock for output registers. The addressed memory content 
q[]
 response is 
synchronous when the outclock port is connected, and is asynchronous when it 
is not connected.
Memory enable input. High = data output on 
q[]
, Low = high-impedance 
outputs.
Memory output. This port is 
LPM_WIDTH
 wide.
inclock
outclock
Input
No
memenab
Input
No
q[]
Output
Yes
Name
Required
Value
Description
LPM_ADDRESS_CONTROL
No
"REGISTERED"
"UNREGISTERED"
"<filename>"
Controls whether the 
address[]
 port is registered. The 
default value is 
"REGISTERED"
.
Name of the MIF or Hex File containing ROM initialization 
data ("<filename>").
In general, this value should be (but is not required to be) 
2
LPM_WIDTHAD
–1
 < 
LPM_NUMWORDS
≤
 2
LPM_WIDTHAD
. The 
default value is 2
LPM_WIDTHAD
.
Controls whether the 
q[]
 port is registered. The default 
value is 
"REGISTERED"
.
Width of the 
q[]
 port.
Width of the 
address[]
 port. 
LPM_WIDTHAD
 should be 
(but is not required to be) equal to log
2
(
LPM_NUMWORDS
). If 
LPM_WIDTHAD
 is too small, some memory locations will 
not be addressable. If it is too large, the addresses that are 
too high will return undefined logic levels.
LPM_FILE
Yes
LPM_NUMWORDS
No
Integer > 0
LPM_OUTDATA
No
"REGISTERED"
"UNREGISTERED"
Integer > 0
Integer > 0
LPM_WIDTH
Yes
Yes
LPM_WIDTHAD
LPM_ROM
address[]
inclock
outclock
memenab
LPM_ADDRESS_CONTROL=
LPM_FILE=
LPM_NUMWORDS=
LPM_OUTDATA="UNREGISTERED"
LPM_WIDTH=
LPM_WIDTHAD=
q[]