00001 --**************************************************************
00002 --* *
00003 --* The source code for the ATLAS BCM "AAA" FPGA is made *
00004 --* available via the GNU General Public License (GPL) *
00005 --* unless otherwise stated below. *
00006 --* *
00007 --* In case of problems/questions/bug reports etc. please *
00008 --* contact michael.niegl@cern.ch *
00009 --* *
00010 --**************************************************************
00011
00012 --**************************************************************
00013 --* *
00014 --* $Source: /local/reps/bcmfpga/bcm_aaa/bcm_aaa/ddr/mem_interface_top_tap_logic_0.vhd,v $ *
00015 --* $Revision: 1.3.2.3 $ *
00016 --* $Name: dev $ *
00017 --* $Author: mniegl $ *
00018 --* $Date: 2008/11/03 17:57:44 $ *
00019 --* *
00020 --**************************************************************
00021 -------------------------------------------------------------------------------
00022 -- Copyright (c) 2005 Xilinx, Inc.
00023 -- This design is confidential and proprietary of Xilinx, All Rights Reserved.
00024 -------------------------------------------------------------------------------
00025 -- ____ ____
00026 -- / /\/ /
00027 -- /___/ \ / Vendor: Xilinx
00028 -- \ \ \/ Version: 1.6
00029 -- \ \ Application : MIG
00030 -- / / Filename: mem_interface_top_tap_logic_0.vhd
00031 -- /___/ /\ Date Last Modified: Wed Jun 1 2005
00032 -- \ \ / \Date Created: Mon May 2 2005
00033 -- \___\/\___\
00034 -- Device: Virtex-4
00035 -- Design Name: DDR1_SDRAM
00036 -- Description: Instantiates the tap_cntrl and the data_tap_inc modules. Used for
00037 -- calibration of the memory data with the FPGA clock.
00038 -------------------------------------------------------------------------------
00039
00040
00041 library ieee;
00042
00043 use ieee.std_logic_1164.all;
00044
00045 library unisim;
00046
00047 use unisim.vcomponents.all;
00048 use work.mem_interface_top_parameters_0.all;
00049
00050 entity mem_interface_top_tap_logic_0 is
00051 port( CLK : in ;
00052 CAL_CLK : in ;
00053 RESET0 : in ;
00054 RESET_CAL_CLK : in ;
00055 idelay_ctrl_rdy : in ;
00056 CTRL_DUMMYREAD_START : in ;
00057 dqs_delayed : in ((data_strobe_width-1) downto 0);
00058 SEL_DONE : out ;
00059 data_idelay_inc : out ((ReadEnable-1) downto 0);
00060 data_idelay_ce : out ((ReadEnable-1) downto 0);
00061 data_idelay_rst : out ((ReadEnable-1) downto 0);
00062 dqs_idelay_inc : out ((ReadEnable-1) downto 0);
00063 dqs_idelay_ce : out ((ReadEnable-1) downto 0);
00064 dqs_idelay_rst : out ((ReadEnable-1) downto 0)
00065 );
00066 end mem_interface_top_tap_logic_0;
00067
00068 architecture arch of mem_interface_top_tap_logic_0 is
00069
00070 component mem_interface_top_tap_ctrl
00071 port( CLK : in ;
00072 RESET : in ;
00073 RDY_STATUS : in ;
00074 DQS : in ;
00075 CTRL_DUMMYREAD_START : in ;
00076 DLYINC : out ;
00077 DLYCE : out ;
00078 DLYRST : out ;
00079 SEL_DONE : out ;
00080 VALID_DATA_TAP_COUNT : out ;
00081 DATA_TAP_COUNT : out (5 downto 0)
00082 );
00083 end component;
00084
00085 component mem_interface_top_data_tap_inc
00086 port(
00087 CLK : in ;
00088 RESET : in ;
00089 DATA_DLYINC : out ;
00090 DATA_DLYCE : out ;
00091 DATA_DLYRST : out ;
00092 DATA_TAP_SEL_DONE : out ;
00093 DQS_sel_done : in ;
00094 VALID_DATA_TAP_COUNT : in ;
00095 DATA_TAP_COUNT : in (5 downto 0)
00096 );
00097 end component;
00098
00099 signal data_tap_select : ((ReadEnable-1) downto 0);
00100 signal dqs_tap_sel_done : ((ReadEnable-1) downto 0);
00101 signal valid_tap_count : ((ReadEnable-1) downto 0);
00102 signal data_tap_inc_done : ;
00103 signal tap_sel_done : ;
00104
00105 signal data_tap_count0 : (5 downto 0);
00106
00107
00108 begin
00109
00110 -- For controller to stop dummy reads
00111 SEL_DONE <= tap_sel_done;
00112
00113
00114
00115 process(CLK)
00116 begin
00117 if(CLK'event and CLK = '1') then
00118 if (RESET0 = '1') then
00119 data_tap_inc_done <= '0';
00120 tap_sel_done <= '0';
00121 else
00122 data_tap_inc_done <= data_tap_select(0) ; --(&data_tap_select(`ReadEnable-1:0));
00123 tap_sel_done <= data_tap_inc_done;
00124
00125 end if;
00126 end if;
00127 end process;
00128
00129 --****************************************************************************************************
00130 -- tap_ctrl instances for DDR_DQS strobes
00131 --****************************************************************************************************
00132
00133
00134 tap_ctrl_0: mem_interface_top_tap_ctrl port map
00135 ( CLK => CAL_CLK,
00136 RESET => RESET_CAL_CLK,
00137 RDY_STATUS => idelay_ctrl_rdy ,
00138 DQS => dqs_delayed(3),
00139 CTRL_DUMMYREAD_START => CTRL_DUMMYREAD_START,
00140 DLYINC => dqs_idelay_inc(0),
00141 DLYCE => dqs_idelay_ce(0),
00142 DLYRST => dqs_idelay_rst(0),
00143 SEL_DONE => dqs_tap_sel_done(0),
00144 VALID_DATA_TAP_COUNT => valid_tap_count(0),
00145 DATA_TAP_COUNT => data_tap_count0(5 downto 0)
00146 );
00147
00148
00149 --****************************************************************************************************
00150 -- instances of data_tap_inc for each dqs and associated tap_ctrl
00151 --****************************************************************************************************
00152
00153
00154 data_tap_inc_0: mem_interface_top_data_tap_inc port map
00155 (
00156 CLK => CAL_CLK,
00157 RESET => RESET_CAL_CLK,
00158 DATA_DLYINC => data_idelay_inc(0),
00159 DATA_DLYCE => data_idelay_ce(0),
00160 DATA_DLYRST => data_idelay_rst(0),
00161 DATA_TAP_SEL_DONE => data_tap_select(0),
00162 DQS_sel_done => dqs_tap_sel_done(0),
00163 VALID_DATA_TAP_COUNT => valid_tap_count(0),
00164 DATA_TAP_COUNT => data_tap_count0(5 downto 0)
00165 );
00166
00167
00168 end arch;