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_wr_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_wr_gray_cntr.vhd
46
-- /___/   /\    Date Last Modified : $Date: 2010/11/26 18:25:42 $
47
-- \   \  /  \   Date Created       : Mon May 2 2005
48
--  \___\/\___\
49
-- Device      : Spartan-3/3A/3A-DSP
50
-- Design Name : DDR2 SDRAM
51
-- Purpose     :
52
--*****************************************************************************
53
-- fifo_wr_addr gray counter with synchronous reset
54
-- Gray counter is used for FIFO address counter
55
 
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_wr_gray_cntr is
63
  port (
64
    clk      : in  std_logic;
65
    reset    : in  std_logic;
66
    cnt_en   : in  std_logic;
67
    wgc_gcnt : out std_logic_vector(3 downto 0)
68
    );
69
end DDR2_Ram_Core_wr_gray_cntr;
70
 
71
architecture arc of DDR2_Ram_Core_wr_gray_cntr is
72
 
73
  signal d_in   : std_logic_vector(3 downto 0);
74
  signal gc_int : std_logic_vector(3 downto 0);
75
 
76
begin
77
 
78
  wgc_gcnt <= gc_int(3 downto 0);
79
 
80
  process(gc_int)
81
  begin
82
    case gc_int is
83
      when "0000" => d_in <= "0001";    --0 > 1
84
      when "0001" => d_in <= "0011";    --1 > 3
85
      when "0010" => d_in <= "0110";    --2 > 6
86
      when "0011" => d_in <= "0010";    --3 > 2
87
      when "0100" => d_in <= "1100";    --4 > c
88
      when "0101" => d_in <= "0100";    --5 > 4
89
      when "0110" => d_in <= "0111";    --6 > 7
90
      when "0111" => d_in <= "0101";    --7 > 5
91
      when "1000" => d_in <= "0000";    --8 > 0
92
      when "1001" => d_in <= "1000";    --9 > 8
93
      when "1010" => d_in <= "1011";    --a > b
94
      when "1011" => d_in <= "1001";    --b > 9
95
      when "1100" => d_in <= "1101";    --c > d
96
      when "1101" => d_in <= "1111";    --d > f
97
      when "1110" => d_in <= "1010";    --e > a
98
      when "1111" => d_in <= "1110";    --f > e
99
      when others => d_in <= "0001";    --0 > 1
100
    end case;
101
  end process;
102
 
103
  bit0 : FDCE
104
    port map (
105
      Q   => gc_int(0),
106
      C   => clk,
107
      CE  => cnt_en,
108
      CLR => reset,
109
      D   => d_in(0)
110
      );
111
 
112
  bit1 : FDCE
113
    port map (
114
      Q   => gc_int(1),
115
      C   => clk,
116
      CE  => cnt_en,
117
      CLR => reset,
118
      D   => d_in(1)
119
      );
120
 
121
  bit2 : FDCE
122
    port map (
123
      Q   => gc_int(2),
124
      C   => clk,
125
      CE  => cnt_en,
126
      CLR => reset,
127
      D   => d_in(2)
128
      );
129
 
130
  bit3 : FDCE
131
    port map (
132
      Q   => gc_int(3),
133
      C   => clk,
134
      CE  => cnt_en,
135
      CLR => reset,
136
      D   => d_in(3)
137
      );
138
 
139
end arc;

powered by: WebSVN 2.1.0

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