This example implements a cycle-shared FIFO with 256 8-bit words. The size of the FIFO is defined with the parameters LPM_WIDTH and LPM_WIDTHAD. This example uses an Include Statement (shown in blue text) to import the contents of the Include File containing the Function Prototype for the csfifo function. An Instance Declaration (shown in red text) implements an instance of the function.
If you are using this function in a FLEX 10K design, MAX+PLUS II will implement the FIFO in embedded array blocks (EABs).
For more information on using this example in your project, go to:- How to Use AHDL Examples
- Graphic Editor: Cycle-Shared FIFO (csfifo)
- MAX+PLUS II Help
fifo.tdf
INCLUDE "csfifo.inc";
SUBDESIGN fifo
(
dataf[7..0] : INPUT;
qf[7..0] : OUTPUT;
wreq : INPUT;
rreq : INPUT;
clk : INPUT;
clk2 : INPUT;
clr : INPUT;
threshlevel[7..0] : INPUT;
empty : OUTPUT;
full : OUTPUT;
threshold : OUTPUT;
)
VARIABLE
vxififo : csfifo
WITH (LPM_WIDTH = 8, LPM_NUMWORDS = 256);
BEGIN
-- Input definition for VXI FIFO
vxififo.clock = clk;
vxififo.clockx2 = clk2;
vxififo.clr = clr;
vxififo.data[7..0] = dataf[7..0];
vxififo.threshlevel[7..0] = threshlevel[7..0];
vxififo.wreq = wreq;
vxififo.rreq = rreq;
qf[7..0] = vxififo.q[7..0];
threshold = vxififo.threshold;
empty = vxififo.empty;
full = vxififo.full;
END;
Design Examples Disclaimer
These design examples may only be used within Altera Corporation devices and remain the property of Altera. They are being provided on an “as-is” basis and as an accommodation; therefore, all warranties, representations, or guarantees of any kind (whether express, implied, or statutory) including, without limitation, warranties of merchantability, non-infringement, or fitness for a particular purpose, are specifically disclaimed. Altera expressly does not recommend, suggest, or require that these examples be used in combination with any other product not provided by Altera.
