source: PROJECT_CORE_MPI/CORE_MPI/BRANCHES/v1.00/FIfo_mem.vhd @ 74

Last change on this file since 74 was 15, checked in by rolagamo, 12 years ago
File size: 2.4 KB
Line 
1----------------------------------------------------------------------------------
2-- Company:
3-- Engineer:
4--
5-- Create Date:    04:35:05 10/15/2012
6-- Design Name:
7-- Module Name:    FIfo_mem - Behavioral
8-- Project Name:
9-- Target Devices:
10-- Tool versions:
11-- Description:
12--
13-- Dependencies:
14--
15-- Revision:
16-- Revision 0.01 - File Created
17-- Additional Comments:
18--
19----------------------------------------------------------------------------------
20
21
22library IEEE; 
23use IEEE.std_logic_1164.all; 
24use IEEE.std_logic_unsigned.all; 
25entity FIFO is 
26 generic (N: integer := 6; -- number of address bits for 2**N address locations
27M: integer := 8);  -- number of data bits to/from FIFO
28 port (CLK, PUSH, POP, INIT: in std_logic; 
29  DIN: in std_logic_vector(N-1 downto 0); 
30DOUT: out std_logic_vector(N-1 downto 0); 
31  FULL, EMPTY, NOPUSH, NOPOP: out std_logic; 
32  clk: IN std_logic;
33       
34        rd_en: IN std_logic;
35        srst: IN std_logic;
36        wr_en: IN std_logic;
37       
38        empty: OUT std_logic;
39        full: OUT std_logic);
40end entity FIFO; 
41architecture TOP_HIER of FIFO is 
42signal WE: std_logic; 
43signal A: std_logic_vector(N-1 downto 0); 
44signal  PUSH, POP, INIT:  std_logic; 
45 
46signal NOPUSH, NOPOP:  std_logic;
47
48component FIFO_LOGIC is 
49 generic (N: integer); -- number of address bits
50 port (CLK, PUSH, POP, INIT: in std_logic; 
51  ADD: out std_logic_vector(N-1 downto 0); 
52  FULL, EMPTY, WE, NOPUSH, NOPOP: buffer std_logic); 
53end component FIFO_LOGIC; 
54
55COMPONENT RAM_256
56        PORT(
57                clka : IN std_logic;
58                clkb : IN std_logic;
59                wea : IN std_logic;
60                ena : IN std_logic;
61                enb : IN std_logic;
62                addra : IN std_logic_vector(Word-1 downto 0);
63                addrb : IN std_logic_vector(Word-1 downto 0);
64                dia : IN std_logic_vector(Word-1 downto 0);         
65                dob : OUT std_logic_vector(Word-1 downto 0)
66                );
67END COMPONENT;
68begin 
69-- example of component instantiation using positional notation
70FL: FIFO_LOGIC generic map (N) 
71 port map (CLK, PUSH, POP, INIT, A, FULL, EMPTY, WE, NOPUSH, NOPOP); 
72Push<=wr_en;
73pop<=rd_en;
74nopush<=nopush;
75nopop<=nopop;
76init<=srst;
77-- example of component instantiation using keyword notation
78--R: RAM generic map (W => N, K => M)
79-- port map (DIN => DIN, ADDR => A, WR => WE, DOUT => DOUT);
80R: RAM_256 PORT MAP(
81                clka => clk,
82                clkb => clk,
83                wea => we,
84                ena => '1',
85                enb => '1',
86                addra => A,
87                addrb => A,
88                dia => din,
89                dob => dout
90        );
91end architecture TOP_HIER;
Note: See TracBrowser for help on using the repository browser.