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

Subversion Repositories ddr2_sdram

[/] [ddr2_sdram/] [trunk/] [ipcore_dir/] [DDR2_Ram_Core/] [user_design/] [rtl/] [DDR2_Ram_Core_rd_gray_cntr.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 john_fpga
--*****************************************************************************
2
-- DISCLAIMER OF LIABILITY
3
--
4
-- This file contains proprietary and confidential information of
5
-- Xilinx, Inc. ("Xilinx"), that is distributed under a license
6
-- from Xilinx, and may be used, copied and/or disclosed only
7
-- pursuant to the terms of a valid license agreement with Xilinx.
8
--
9
-- XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION
10
-- ("MATERIALS") "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
11
-- EXPRESSED, IMPLIED, OR STATUTORY, INCLUDING WITHOUT
12
-- LIMITATION, ANY WARRANTY WITH RESPECT TO NONINFRINGEMENT,
13
-- MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE. Xilinx
14
-- does not warrant that functions included in the Materials will
15
-- meet the requirements of Licensee, or that the operation of the
16
-- Materials will be uninterrupted or error-free, or that defects
17
-- in the Materials will be corrected. Furthermore, Xilinx does
18
-- not warrant or make any representations regarding use, or the
19
-- results of the use, of the Materials in terms of correctness,
20
-- accuracy, reliability or otherwise.
21
--
22
-- Xilinx products are not designed or intended to be fail-safe,
23
-- or for use in any application requiring fail-safe performance,
24
-- such as life-support or safety devices or systems, Class III
25
-- medical devices, nuclear facilities, applications related to
26
-- the deployment of airbags, or any other applications that could
27
-- lead to death, personal injury or severe property or
28
-- environmental damage (individually and collectively, "critical
29
-- applications"). Customer assumes the sole risk and liability
30
-- of any use of Xilinx products in critical applications,
31
-- subject only to applicable laws and regulations governing
32
-- limitations on product liability.
33
--
34
-- Copyright 2005, 2006, 2007 Xilinx, Inc.
35
-- All rights reserved.
36
--
37
-- This disclaimer and copyright notice must be retained as part
38
-- of this file at all times.
39
--*****************************************************************************
40
--   ____  ____
41
--  /   /\/   /
42
-- /___/  \  /   Vendor             : Xilinx
43
-- \   \   \/    Version            : 3.6.1
44
--  \   \        Application        : MIG
45
--  /   /        Filename           : DDR2_Ram_Core_rd_gray_cntr.vhd
46
-- /___/   /\    Date Last Modified : $Date: 2010/11/26 18:25:42 $
47
-- \   \  /  \   Date Created       : Mon May 2 2005
48
--  \___\/\___\
49
--
50
-- Device      : Spartan-3/3A/3A-DSP
51
-- Design Name : DDR2 SDRAM
52
-- Purpose     : This module generates read address for the FIFOs.
53
--*****************************************************************************
54
 
55
-- fifo_rd_addr gray counter with synchronous reset
56
library ieee;
57
library UNISIM;
58
use ieee.std_logic_1164.all;
59
use ieee.std_logic_arith.all;
60
use UNISIM.VCOMPONENTS.all;
61
 
62
entity DDR2_Ram_Core_rd_gray_cntr is
63
  port (
64
    clk90    : in  std_logic;
65
    reset90  : in  std_logic;
66
    cnt_en   : in  std_logic;
67
    rgc_gcnt : out std_logic_vector(3 downto 0)
68
    );
69
end DDR2_Ram_Core_rd_gray_cntr;
70
 
71
architecture arc of DDR2_Ram_Core_rd_gray_cntr is
72
 
73
  signal gc_int  : std_logic_vector(3 downto 0);
74
  signal d_in    : std_logic_vector(3 downto 0);
75
  signal reset90_r : std_logic;
76
 
77
begin
78
 
79
  rgc_gcnt    <= gc_int(3 downto 0);
80
 
81
  process(clk90)
82
  begin
83
    if(clk90'event and clk90 = '1') then
84
      reset90_r <= reset90;
85
    end if;
86
  end process;
87
 
88
  process(gc_int)
89
  begin
90
    case gc_int is
91
      when "0000" => d_in <= "0001";    --0 > 1
92
      when "0001" => d_in <= "0011";    --1 > 3
93
      when "0010" => d_in <= "0110";    --2 > 6
94
      when "0011" => d_in <= "0010";    --3 > 2
95
      when "0100" => d_in <= "1100";    --4 > c
96
      when "0101" => d_in <= "0100";    --5 > 4
97
      when "0110" => d_in <= "0111";    --6 > 7
98
      when "0111" => d_in <= "0101";    --7 > 5
99
      when "1000" => d_in <= "0000";    --8 > 0
100
      when "1001" => d_in <= "1000";    --9 > 8
101
      when "1010" => d_in <= "1011";    --10 > b
102
      when "1011" => d_in <= "1001";    --11 > 9
103
      when "1100" => d_in <= "1101";    --12 > d
104
      when "1101" => d_in <= "1111";    --13 > f
105
      when "1110" => d_in <= "1010";    --14 > a
106
      when "1111" => d_in <= "1110";    --15 > e
107
      when others => d_in <= "0001";    --0 > 1
108
    end case;
109
  end process;
110
 
111
  bit0 : FDRE
112
    port map (
113
      Q  => gc_int(0),
114
      C  => clk90,
115
      CE => cnt_en,
116
      D  => d_in(0),
117
      R  => reset90_r
118
      );
119
 
120
  bit1 : FDRE
121
    port map (
122
      Q  => gc_int(1),
123
      C  => clk90,
124
      CE => cnt_en,
125
      D  => d_in(1),
126
      R  => reset90_r
127
      );
128
 
129
  bit2 : FDRE
130
    port map (
131
      Q  => gc_int(2),
132
      C  => clk90,
133
      CE => cnt_en,
134
      D  => d_in(2),
135
      R  => reset90_r
136
      );
137
 
138
  bit3 : FDRE
139
    port map (
140
      Q  => gc_int(3),
141
      C  => clk90,
142
      CE => cnt_en,
143
      D    => d_in(3),
144
      R  => reset90_r
145
      );
146
 
147
end arc;

powered by: WebSVN 2.1.0

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