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/] [backend_fifos_0/] [MIG_rd_wr_addr_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_wr_addr_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 block RAM based FIFO to store the user address
18
--              and the command information.
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_wr_addr_fifo_0 is
29
  port(
30
    clk0           : in  std_logic;
31
    clk90          : in  std_logic;
32
    rst            : in  std_logic;
33
    app_af_addr    : in  std_logic_vector(35 downto 0);
34
    app_af_wren    : in  std_logic;
35
    ctrl_af_rden   : in  std_logic;
36
    af_addr        : out std_logic_vector(35 downto 0);
37
    af_empty       : out std_logic;
38
    af_almost_full : out std_logic
39
    );
40
end MIG_rd_wr_addr_fifo_0;
41
 
42
architecture arch of MIG_rd_wr_addr_fifo_0 is
43
 
44
  signal fifo_input_write_addr  : std_logic_vector(35 downto 0);
45
  signal fifo_output_write_addr : std_logic_vector(35 downto 0);
46
  signal compare_value_r        : std_logic_vector(35 downto 0);
47
  signal app_af_addr_r          : std_logic_vector(35 downto 0);
48
  signal fifo_input_addr_r      : std_logic_vector(35 downto 0);
49
  signal af_en_r                : std_logic;
50
  signal af_en_2r               : std_logic;
51
  signal compare_result         : std_logic;
52
  signal clk270                 : std_logic;
53
  signal af_al_full_0           : std_logic;
54
  signal af_al_full_180         : std_logic;
55
  signal af_al_full_90          : std_logic;
56
  signal af_en_2r_270           : std_logic;
57
  signal fifo_input_270         : std_logic_vector(35 downto 0);
58
  signal rst_r                  : std_logic;
59
 
60
begin
61
 
62
  fifo_input_write_addr <= compare_result & app_af_addr_r(34 downto 0);
63
  af_addr               <= fifo_output_write_addr;
64
  compare_result <= '0' when (compare_value_r((NO_OF_CS + BANK_ADDRESS +
65
                                               ROW_ADDRESS + COL_AP_WIDTH- 1)
66
                                              downto COL_AP_WIDTH)
67
                              = fifo_input_write_addr((NO_OF_CS + BANK_ADDRESS +
68
                                                       ROW_ADDRESS + COL_AP_WIDTH- 1)
69
                                                      downto COL_AP_WIDTH))
70
                    else '1';
71
 
72
  clk270 <= not clk90;
73
 
74
  process(clk0)
75
  begin
76
    if(clk0'event and clk0 = '1') then
77
      rst_r <= rst;
78
    end if;
79
  end process;
80
 
81
  process(clk0)
82
  begin
83
    if(clk0'event and clk0 = '1') then
84
      if(rst_r = '1') then
85
        compare_value_r   <= (others => '0');
86
        app_af_addr_r     <= (others => '0');
87
        fifo_input_addr_r <= (others => '0');
88
        af_en_r           <= '0';
89
        af_en_2r          <= '0';
90
      else
91
        if(af_en_r = '1') then
92
          compare_value_r <= fifo_input_write_addr;
93
        end if;
94
        app_af_addr_r     <= app_af_addr;
95
        fifo_input_addr_r <= fifo_input_write_addr;
96
        af_en_r           <= app_af_wren;
97
        af_en_2r          <= af_en_r;
98
      end if;
99
    end if;
100
  end process;
101
 
102
-- A fix for FIFO16 according to answer record #22462
103
 
104
  process(clk270)
105
  begin
106
    if (clk270'event and clk270 = '1') then
107
      af_en_2r_270   <= af_en_2r;
108
      fifo_input_270 <= fifo_input_addr_r;
109
    end if;
110
  end process;
111
 
112
-- 3 Filp-flops logic is implemented at output to avoid the timimg errors
113
 
114
  process(clk0)
115
  begin
116
    if (clk0'event and clk0 = '0') then
117
      af_al_full_180 <= af_al_full_0;
118
    end if;
119
  end process;
120
 
121
  process(clk90)
122
  begin
123
    if (clk90'event and clk90 = '1') then
124
      af_al_full_90 <= af_al_full_180;
125
    end if;
126
  end process;
127
 
128
  process(clk0)
129
  begin
130
    if (clk0'event and clk0 = '1') then
131
      af_almost_full <= af_al_full_90;
132
    end if;
133
  end process;
134
 
135
-- Read/Write Address FIFO
136
 
137
  af_fifo16 : FIFO16
138
    generic map (
139
      ALMOST_FULL_OFFSET      => X"00F",
140
      ALMOST_EMPTY_OFFSET     => X"007",
141
      DATA_WIDTH              => 36,
142
      FIRST_WORD_FALL_THROUGH => true
143
      )
144
 
145
    port map (
146
      ALMOSTEMPTY => open,
147
      ALMOSTFULL  => af_al_full_0,
148
      DO          => fifo_output_write_addr(31 downto 0),
149
      DOP         => fifo_output_write_addr(35 downto 32),
150
      EMPTY       => af_empty,
151
      FULL        => open,
152
      RDCOUNT     => open,
153
      RDERR       => open,
154
      WRCOUNT     => open,
155
      WRERR       => open,
156
      DI          => fifo_input_270(31 downto 0),
157
      DIP         => fifo_input_270(35 downto 32),
158
      RDCLK       => clk0,
159
      RDEN        => ctrl_af_rden,
160
      RST         => rst_r,
161
      WRCLK       => clk270,
162
      WREN        => af_en_2r_270
163
      );
164
 
165
end arch;

powered by: WebSVN 2.1.0

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