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_data_path_0/] [MIG_tap_logic/] [MIG_data_tap_inc.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_data_tap_inc.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: The tap logic for calibration of the memory data with respect
18
--              to FPGA clock is provided here. According to the edge detection
19
--              or not the taps in the IDELAY element of the Virtex4 devices
20
--              are either increased or decreased.
21
-------------------------------------------------------------------------------
22
 
23
library ieee;
24
use ieee.std_logic_1164.all;
25
use ieee.std_logic_unsigned.all;
26
library UNISIM;
27
use UNISIM.vcomponents.all;
28
 
29
entity MIG_data_tap_inc is
30
  port(
31
    clk                  : in  std_logic;
32
    reset                : in  std_logic;
33
    data_dlyinc          : out std_logic;
34
    data_dlyce           : out std_logic;
35
    data_dlyrst          : out std_logic;
36
    data_tap_sel_done    : out std_logic;
37
    dqs_sel_done         : in  std_logic;
38
    valid_data_tap_count : in  std_logic;
39
    data_tap_count       : in  std_logic_vector(5 downto 0)
40
    );
41
end MIG_data_tap_inc;
42
 
43
architecture arch of MIG_data_tap_inc is
44
 
45
  signal data_dlyinc_clk0       : std_logic;
46
  signal data_dlyce_clk0        : std_logic;
47
  signal data_dlyrst_clk0       : std_logic;
48
  signal data_tap_inc_counter   : std_logic_vector(5 downto 0) := "000000";
49
  signal data_tap_sel_clk       : std_logic;
50
  signal data_tap_sel_r1        : std_logic;
51
  signal dqs_sel_done_r         : std_logic;
52
  signal valid_data_tap_count_r : std_logic;
53
  signal rst_r                  : std_logic;
54
 
55
begin
56
 
57
  data_tap_sel_done <= data_tap_sel_r1;
58
  data_dlyinc       <= data_dlyinc_clk0;
59
  data_dlyce        <= data_dlyce_clk0;
60
  data_dlyrst       <= data_dlyrst_clk0;
61
 
62
 
63
  process(clk)
64
  begin
65
    if(clk'event and clk = '1') then
66
      rst_r <= reset;
67
    end if;
68
  end process;
69
 
70
  process(clk)
71
  begin
72
    if(clk'event and clk = '1') then
73
      if(rst_r = '1') then
74
        data_tap_sel_clk <= '0';
75
      elsif(data_tap_inc_counter = "000001") then
76
        data_tap_sel_clk <= '1';
77
      end if;
78
    end if;
79
  end process;
80
 
81
  process(clk)
82
  begin
83
    if(clk'event and clk = '1') then
84
      if(rst_r = '1') then
85
        data_tap_sel_r1 <= '0';
86
      else
87
        data_tap_sel_r1 <= data_tap_sel_clk;
88
      end if;
89
    end if;
90
  end process;
91
 
92
  process(clk)
93
  begin
94
    if(clk'event and clk = '1') then
95
      if(rst_r = '1') then
96
        dqs_sel_done_r <= '0';
97
      elsif(dqs_sel_done = '1') then
98
        dqs_sel_done_r <= '1';
99
      end if;
100
    end if;
101
  end process;
102
 
103
  process(clk)
104
  begin
105
    if(clk'event and clk = '1') then
106
      if(rst_r = '1') then
107
        valid_data_tap_count_r <= '0';
108
      else
109
        valid_data_tap_count_r <= valid_data_tap_count;
110
      end if;
111
    end if;
112
  end process;
113
 
114
  process(clk)
115
  begin
116
    if(clk'event and clk = '1') then
117
      if(rst_r = '1' or dqs_sel_done_r = '0') then
118
        data_dlyinc_clk0     <= '0';
119
        data_dlyce_clk0      <= '0';
120
        data_dlyrst_clk0     <= '1';
121
        data_tap_inc_counter <= "000000";
122
      elsif(valid_data_tap_count_r = '1') then
123
        data_dlyinc_clk0     <= '0';
124
        data_dlyce_clk0      <= '0';
125
        data_dlyrst_clk0     <= '0';
126
        data_tap_inc_counter <= data_tap_count;
127
      elsif(data_tap_inc_counter /= "000000") then  -- Data IDELAY incremented
128
        data_dlyinc_clk0     <= '1';
129
        data_dlyce_clk0      <= '1';
130
        data_dlyrst_clk0     <= '0';
131
        data_tap_inc_counter <= data_tap_inc_counter - '1';
132
      else                              -- Data IDELAY no change mode
133
        data_dlyinc_clk0     <= '0';
134
        data_dlyce_clk0      <= '0';
135
        data_dlyrst_clk0     <= '0';
136
        data_tap_inc_counter <= "000000";
137
      end if;
138
    end if;
139
  end process;
140
 
141
end arch;

powered by: WebSVN 2.1.0

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