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

Subversion Repositories the_wizardry_project

[/] [the_wizardry_project/] [trunk/] [Wizardry/] [VHDL/] [Wizardry Top Level/] [Memory Design/] [MIG_top_00/] [MIG_user_interface_0/] [MIG_rd_data_0/] [MIG_rd_data_fifo_0/] [MIG_rd_data_fifo_0.vhd] - Blame information for rev 24

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 24 mcwaccent
-------------------------------------------------------------------------------
2
-- Copyright (c) 2005-2007 Xilinx, Inc.
3
-- This design is confidential and proprietary of Xilinx, All Rights Reserved.
4
-------------------------------------------------------------------------------
5
--   ____  ____
6
--  /   /\/   /
7
-- /___/  \  /   Vendor             : Xilinx
8
-- \   \   \/    Version            : $Name: i+IP+131489 $
9
--  \   \        Application        : MIG
10
--  /   /        Filename           : MIG_rd_data_fifo_0.vhd
11
-- /___/   /\    Date Last Modified : $Date: 2007/09/21 15:23:24 $
12
-- \   \  /  \   Date Created       : Mon May 2 2005
13
--  \___\/\___\
14
--
15
-- Device      : Virtex-4
16
-- Design Name : DDR SDRAM
17
-- Description: Instantiates the distributed RAM which stores the read data
18
--              from the memory.
19
-------------------------------------------------------------------------------
20
 
21
library ieee;
22
use ieee.std_logic_1164.all;
23
use ieee.std_logic_unsigned.all;
24
use work.MIG_parameters_0.all;
25
library UNISIM;
26
use UNISIM.vcomponents.all;
27
 
28
entity MIG_rd_data_fifo_0 is
29
  port(
30
    clk                  : in  std_logic;
31
    reset                : in  std_logic;
32
    read_en_delayed_rise : in  std_logic;
33
    read_en_delayed_fall : in  std_logic;
34
    first_rising         : in  std_logic;
35
    read_data_rise       : in  std_logic_vector(MEMORY_WIDTH - 1 downto 0);
36
    read_data_fall       : in  std_logic_vector(MEMORY_WIDTH - 1 downto 0);
37
    fifo_rd_enable       : in  std_logic;
38
    read_data_fifo_rise  : out std_logic_vector(MEMORY_WIDTH - 1 downto 0);
39
    read_data_fifo_fall  : out std_logic_vector(MEMORY_WIDTH - 1 downto 0);
40
    read_data_valid      : out std_logic
41
    );
42
end MIG_rd_data_fifo_0;
43
 
44
architecture arch of MIG_rd_data_fifo_0 is
45
 
46
  component MIG_RAM_D_0
47
    port(
48
      dpo       : out std_logic_vector(MEMORY_WIDTH - 1 downto 0);
49
      a0        : in std_logic;
50
      a1        : in std_logic;
51
      a2        : in std_logic;
52
      a3        : in std_logic;
53
      d         : in std_logic_vector(MEMORY_WIDTH - 1 downto 0);
54
      dpra0     : in std_logic;
55
      dpra1     : in std_logic;
56
      dpra2     : in std_logic;
57
      dpra3     : in std_logic;
58
      wclk      : in std_logic;
59
      we        : in std_logic
60
      );
61
  end component;
62
 
63
  signal fifos_data_out1 : std_logic_vector((MEMORY_WIDTH*2 - 1) downto 0);
64
  signal fifo_rd_addr    : std_logic_vector(3 downto 0);
65
  signal rise0_wr_addr   : std_logic_vector(3 downto 0);
66
  signal fall0_wr_addr   : std_logic_vector(3 downto 0);
67
  signal fifo_rd_en      : std_logic;
68
  signal fifo_rd_en_r1   : std_logic;
69
  signal fifo_rd_en_r2   : std_logic;
70
  signal rise_fifo_data  : std_logic_vector((MEMORY_WIDTH - 1) downto 0);
71
  signal fall_fifo_data  : std_logic_vector((MEMORY_WIDTH - 1) downto 0);
72
  signal rise_fifo_out   : std_logic_vector((MEMORY_WIDTH - 1) downto 0);
73
  signal fall_fifo_out   : std_logic_vector((MEMORY_WIDTH - 1) downto 0);
74
  signal rst_r           : std_logic;
75
 
76
begin
77
 
78
  read_data_valid     <= fifo_rd_en_r2;
79
  read_data_fifo_fall <= fifos_data_out1(MEMORY_WIDTH - 1 downto 0);
80
  read_data_fifo_rise <= fifos_data_out1((MEMORY_WIDTH*2 - 1) downto MEMORY_WIDTH);
81
 
82
-- Read Pointer and fifo data output sequencing
83
 
84
-- Read Enable generation for fifos based on write enable
85
 
86
 
87
  process( clk)
88
  begin
89
    if(clk'event and clk = '1') then
90
      rst_r <= reset;
91
    end if;
92
  end process;
93
 
94
  process ( clk)
95
  begin
96
    if(clk'event and clk = '1') then
97
      if (rst_r = '1') then
98
        fifo_rd_en             <= '0';
99
        fifo_rd_en_r1          <= '0';
100
        fifo_rd_en_r2          <= '0';
101
      else
102
        fifo_rd_en             <= fifo_rd_enable;
103
        fifo_rd_en_r1          <= fifo_rd_en;
104
        fifo_rd_en_r2          <= fifo_rd_en_r1;
105
      end if;
106
    end if;
107
  end process;
108
 
109
-- Write Pointer increment for FIFOs
110
 
111
  process ( clk)
112
  begin
113
    if(clk'event and clk = '1') then
114
      if (rst_r = '1') then
115
        rise0_wr_addr <= "0000";
116
      elsif (read_en_delayed_rise = '1') then
117
        rise0_wr_addr <= rise0_wr_addr + '1';
118
      end if;
119
    end if;
120
  end process;
121
 
122
  process ( clk)
123
  begin
124
    if(clk'event and clk = '1') then
125
      if (rst_r = '1') then
126
        fall0_wr_addr <= "0000";
127
      elsif (read_en_delayed_fall = '1') then
128
        fall0_wr_addr <= fall0_wr_addr + '1';
129
      end if;
130
    end if;
131
  end process;
132
 
133
--********** FIFO Data Output Sequencing ***********
134
 
135
  process ( clk)
136
  begin
137
    if(clk'event and clk = '1') then
138
      if (rst_r = '1') then
139
        rise_fifo_data <= (others => '0');
140
        fall_fifo_data <= (others => '0');
141
        fifo_rd_addr   <= "0000";
142
      elsif (fifo_rd_en = '1') then
143
        rise_fifo_data(MEMORY_WIDTH - 1 downto 0) <= rise_fifo_out(MEMORY_WIDTH - 1 downto 0);
144
        fall_fifo_data(MEMORY_WIDTH - 1 downto 0) <= fall_fifo_out(MEMORY_WIDTH - 1 downto 0);
145
        fifo_rd_addr(3 downto 0)    <= fifo_rd_addr(3 downto 0) + '1';
146
      end if;
147
    end if;
148
  end process;
149
 
150
  process ( clk)
151
  begin
152
if(clk'event and clk = '1') then
153
     if (rst_r = '1') then
154
       fifos_data_out1((MEMORY_WIDTH*2 - 1) downto 0) <= (others => '0');
155
     elsif (fifo_rd_en_r1 = '1') then
156
         if (first_rising = '1') then
157
           fifos_data_out1((MEMORY_WIDTH*2 - 1) downto 0) <= fall_fifo_data((MEMORY_WIDTH - 1) downto 0)
158
                                                            & rise_fifo_data((MEMORY_WIDTH - 1) downto 0);
159
         else
160
           fifos_data_out1((MEMORY_WIDTH*2 - 1) downto 0) <= rise_fifo_data((MEMORY_WIDTH - 1) downto 0)
161
                                                            & fall_fifo_data((MEMORY_WIDTH - 1) downto 0);
162
         end if;
163
      end if;
164
 end if;
165
end process;
166
 
167
--******************************************************************************
168
-- Distributed RAM 4 bit wide FIFO instantiations (2 FIFOs per strobe, rising
169
-- edge data fifo and falling edge data fifo)
170
--******************************************************************************
171
-- FIFOs associated with DQS(0)
172
 
173
ram_rise0: MIG_RAM_D_0 port map
174
            (
175
              dpo   => rise_fifo_out(MEMORY_WIDTH - 1 downto 0),
176
              a0    => rise0_wr_addr(0),
177
              a1    => rise0_wr_addr(1),
178
              a2    => rise0_wr_addr(2),
179
              a3    => rise0_wr_addr(3),
180
              d     => read_data_rise(MEMORY_WIDTH - 1 downto 0),
181
              dpra0 => fifo_rd_addr(0),
182
              dpra1 => fifo_rd_addr(1),
183
              dpra2 => fifo_rd_addr(2),
184
              dpra3 => fifo_rd_addr(3),
185
              wclk  => clk,
186
              we    => read_en_delayed_rise
187
            );
188
 
189
ram_fall0: MIG_RAM_D_0 port map
190
            (
191
              dpo   => fall_fifo_out(MEMORY_WIDTH - 1 downto 0),
192
              a0    => fall0_wr_addr(0),
193
              a1    => fall0_wr_addr(1),
194
              a2    => fall0_wr_addr(2),
195
              a3    => fall0_wr_addr(3),
196
              d     => read_data_fall(MEMORY_WIDTH - 1 downto 0),
197
              dpra0 => fifo_rd_addr(0),
198
              dpra1 => fifo_rd_addr(1),
199
              dpra2 => fifo_rd_addr(2),
200
              dpra3 => fifo_rd_addr(3),
201
              wclk  => clk,
202
              we    => read_en_delayed_fall
203
            );
204
 
205
end arch;

powered by: WebSVN 2.1.0

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