OpenCores
URL https://opencores.org/ocsvn/uart16750/uart16750/trunk

Subversion Repositories uart16750

[/] [uart16750/] [trunk/] [rtl/] [vhdl/] [slib_fifo_cyclone2.vhd] - Blame information for rev 17

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 hasw
--
2
-- FIFO (using Altera scfifo for Cyclone II)
3
--
4
-- Author:   Sebastian Witt
5
-- Date:     07.03.2008
6
-- Version:  1.0
7
--
8
 
9
LIBRARY ieee;
10
USE ieee.std_logic_1164.all;
11
 
12
LIBRARY altera_mf;
13
USE altera_mf.all;
14
 
15
entity slib_fifo is
16
    generic (
17
        WIDTH       : integer := 8;                             -- FIFO width
18
        SIZE_E      : integer := 6                              -- FIFO size (2^SIZE_E)
19
    );
20
    port (
21
        CLK         : in std_logic;                             -- Clock
22
        RST         : in std_logic;                             -- Reset
23
        CLEAR       : in std_logic;                             -- Clear FIFO
24
        WRITE       : in std_logic;                             -- Write to FIFO
25
        READ        : in std_logic;                             -- Read from FIFO
26
        D           : in std_logic_vector(WIDTH-1 downto 0);    -- FIFO input
27
        Q           : out std_logic_vector(WIDTH-1 downto 0);   -- FIFO output
28
        EMPTY       : out std_logic;                            -- FIFO is empty
29
        FULL        : out std_logic;                            -- FIFO is full
30
        USAGE       : out std_logic_vector(SIZE_E-1 downto 0)   -- FIFO usage
31
    );
32
end slib_fifo;
33
 
34
architecture altera of slib_fifo is
35
    COMPONENT scfifo
36
        GENERIC (
37
                add_ram_output_register         : STRING;
38
                intended_device_family          : STRING;
39
                lpm_numwords                : NATURAL;
40
                lpm_showahead                   : STRING;
41
                lpm_type                            : STRING;
42
                lpm_width                           : NATURAL;
43
                lpm_widthu                          : NATURAL;
44
                overflow_checking                   : STRING;
45
                underflow_checking                  : STRING;
46
                use_eab                         : STRING
47
        );
48
        PORT (
49
                        usedw   : OUT STD_LOGIC_VECTOR (SIZE_E-1 DOWNTO 0);
50
                        rdreq   : IN STD_LOGIC ;
51
                        sclr    : IN STD_LOGIC ;
52
                        empty   : OUT STD_LOGIC ;
53
                        clock   : IN STD_LOGIC ;
54
                        q           : OUT STD_LOGIC_VECTOR (WIDTH-1 DOWNTO 0);
55
                        wrreq   : IN STD_LOGIC ;
56
                        data    : IN STD_LOGIC_VECTOR (WIDTH-1 DOWNTO 0);
57
                        full    : OUT STD_LOGIC
58
        );
59
        END COMPONENT;
60
 
61
begin
62
    scfifo_component : scfifo
63
        GENERIC MAP (
64
                add_ram_output_register => "OFF",
65
                intended_device_family => "Cyclone II",
66
                lpm_numwords => 2**SIZE_E,
67
                lpm_showahead => "ON",
68
                lpm_type => "scfifo",
69
                lpm_width => WIDTH,
70
                lpm_widthu => SIZE_E,
71
                overflow_checking => "ON",
72
                underflow_checking => "ON",
73
                use_eab => "ON"
74
        )
75
        PORT MAP (
76
                rdreq => READ,
77
                sclr  => CLEAR,
78
                clock => CLK,
79
                wrreq => WRITE,
80
                data  => D,
81
                usedw => USAGE,
82
                empty => EMPTY,
83
                q     => Q,
84
                full  => FULL
85
        );
86
end altera;
87
 
88
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.