|
Parameterized single-clock FIFO megafunction. The lpm_fifo+
function uses mega RAMs or M4K or M512 memory blocks in Stratix and Stratix GX devices, M4K memory blocks in Cyclone devices, Embedded System Blocks (ESB) in APEX 20K, APEX II, ARM®-based Excalibur, and Mercury devices, Embedded Array Blocks (EAB) in ACEX® 1K and FLEX 10KE devices, or DFFE
primitives or latch arrays in FLEX® 6000, MAX® 3000, and MAX 7000 devices or if the USE_EAB
parameter is set to "OFF"
. If you need extra features, you may use the scfifo
megafunction. Altera® strongly recommends using synchronous rather than asynchronous RAM functions.
If you select lpm_fifo+
in the MegaWizard® Plug-In Manager (Tools menu), the MegaWizard Plug-In Manager instantiates the scfifo
megafunction for single-clock FIFO functions, or the dcfifo
megafunction for dual-clock FIFO functions.
The Quartus® II Compiler automatically implements suitable portions of this function in mega RAMs or M4K or M512 memory blocks in Stratix and Stratix GX devices, in M4K memory blocks in Cyclone devices, in ESBs in APEX 20K, APEX II, ARM-based Excalibur, and Mercury devices, and in EABs in ACEX 1K and FLEX 10KE devices. The Compiler automatically implements this function in logic cells in FLEX 6000, MAX 3000, and MAX 7000 devices. |
Altera also recommends instantiating this function as described in Using the MegaWizard Plug-In Manager.
The lpm_fifo+ function must contain at least one word before it is able to read a word and must have at least one unused word before it is able to write a word. |
This topic contains the following information:
FUNCTION lpm_fifo (data[(LPM_WIDTH)-1..0], wrreq, rdreq, clock, aclr, sclr) WITH (LPM_WIDTH, LPM_NUMWORDS, LPM_WIDTHU, LPM_SHOWAHEAD, UNDERFLOW_CHECKING, OVERFLOW_CHECKING, ALLOW_RWCYCLE_WHEN_FULL, USE_EAB) RETURNS (q[(LPM_WIDTH)-1..0], empty, full, usedw[LPM_WIDTHU-1..0]
COMPONENT LPM_FIFO GENERIC (LPM_WIDTH: POSITIVE; LPM_WIDTHU: POSITIVE := 1; LPM_NUMWORDS: POSITIVE; LPM_SHOWAHEAD: STRING := "OFF"; LPM_TYPE: STRING:= "LPM_FIFO"; LPM_HINT: STRING := "UNUSED"); PORT (data: IN STD_LOGIC_VECTOR(LPM_WIDTH-1 DOWNTO 0); clock, wrreq, rdreq: IN STD_LOGIC; aclr, sclr: IN STD_LOGIC := '0'; full, empty: OUT STD_LOGIC; usedw: OUT STD_LOGIC_VECTOR(LPM_WIDTHU-1 DOWNTO 0); q: OUT STD_LOGIC_VECTOR(LPM_WIDTH-1 DOWNTO 0)); END COMPONENT;
LIBRARY lpm; USE lpm.lpm_components.all;
INPUT PORTS
Port Name | Required | Description | Comments |
---|---|---|---|
data[] |
Yes | Data input to the lpm_fifo . |
Input port LPM_WIDTH wide. |
wrreq |
Yes | Write request control. The data[]
port is written to the lpm_fifo . |
Writing is disabled if full = 1. |
rdreq |
Yes | Read request control. The oldest data in the
lpm_fifo goes to the q[] port. |
Reading is disabled if empty = 1. |
clock |
Yes | Positive-edge-triggered clock. | |
aclr |
No | Asynchronous clear. Resets the lpm_fifo
to empty. |
The output data is not affected by the data in the aclr port. |
sclr |
No | Synchronous clear. Resets the lpm_fifo
to empty. |
OUTPUT PORTS
Port Name | Required | Description | Comments |
---|---|---|---|
q[] |
Yes | Data output from the lpm_fifo . |
Output port LPM_WIDTH wide. |
full |
No | Indicates that the lpm_fifo is full
and disables the wrreq port. |
Asserted when usedw[] = LPM_NUMWORDS . |
empty |
No | Indicates that the lpm_fifo is empty
and disables the rdreq port. |
Asserted when usedw[] = 0. |
usedw[] |
No | The number of words that are currently in the
lpm_fifo . |
Output port with width [LPM_WIDTHU-1..0] .
If the value of LPM_NUMWORDS is a power of 2, you can use the
full output as an extra bit and append it to usedw[] .
Example |
Parameter | Type | Required | Description | ||
---|---|---|---|---|---|
LPM_WIDTH |
Integer | Yes | Width of data[] and q[]
ports. |
||
LPM_NUMWORDS |
Integer | Yes | Depth of the lpm_fifo . Number of
words stored in memory, which is usually a power of 2. |
||
LPM_WIDTHU |
Integer | Yes | Required value is CEIL(LOG2(LPM_NUMWORDS)) .
Width of the usedw[] port. |
||
LPM_SHOWAHEAD |
String | No | Allows the data to appear immediately on q[]
without asserting rdreq explicitly when set to "ON" .
Values are "ON" or "OFF" (the
default is "OFF" ). |
||
OVERFLOW_CHECKING |
String | No |
Altera-specific parameter.
Disables the overflow-checking logic when set to
|
||
UNDERFLOW_CHECKING |
String | No |
Altera-specific parameter.
Disables the underflow-checking logic when set to
|
||
ALLOW_RWCYCLE_WHEN_FULL |
String | No | Altera-specific
parameter. Allows combined read/write cycles to an already full lpm_fifo ,
so that it remains full. Values are "ON" or "OFF"
(the default is "OFF" ). This parameter is used only
when the OVERFLOW_CHECKING parameter is set to "ON" . |
||
USE_EAB |
String | No | Altera-specific
parameter. Values are "ON" , "OFF" ,
and "UNUSED" .
Setting the USE_EAB parameter to "OFF"
prevents the Quartus II software from using ESBs to implement the logic in APEX 20K, APEX II, ARM-based Excalibur, and Mercury devices, or EABs in ACEX 1K and FLEX 10KE devices;
it can use only flipflops or latches. (The "ON" setting
is not useful in memory functions: the Quartus II software automatically implements memory
functions in ESBs or EABs by default.) This parameter is not available for simulation with other EDA simulators and for FLEX 6000, MAX 3000, MAX 7000, Stratix, and Stratix GX devices. |
||
LPM_HINT |
String | No | Allows you to specify Altera-specific
parameters in VHDL Design Files (.vhd).
The default is "UNUSED" . This parameter is not available for FLEX 6000 devices. |
||
LPM_TYPE |
String | No | Identifies the library of parameterized modules (LPM) entity name in VHDL Design Files. |
The lpm_fifo
function represents memory with synchronous inputs and/or outputs.
Synchronous Memory Operations | ||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
The following table summarizes the resource usage for an lpm_fifo
megafunction used to implement an 8-bit-wide FIFO buffer. A depth of 8 words is used for the FLEX 6000, MAX 3000, and MAX 7000 device families. A depth of 256 words is used for all other device families.
Design Goals | Design Results | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
|
This topic prints best in Landscape orientation. |
- PLDWorld - |
|
Created by chm2web html help conversion utility. |