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/ddr2/cnt_ddr2_rd.vhd,v $
00015 --* $Revision: 1.8.2.3 $ *
00016 --* $Name: dev $ *
00017 --* $Author: mniegl $ *
00018 --* $Date: 2008/11/03 17:57:44 $ *
00019
00020
00021 --* *
00022 --**************************************************************
00023
00024 library ieee;
00025
00026 use ieee.std_logic_1164.all;
00027
00028 use ieee.std_logic_arith.all;
00029
00030 use ieee.std_logic_unsigned.all;
00031
00032 use ieee.numeric_std.all;
00033
00034
00035 entity cnt_ddr2_rd is
00036 port (
00037 RESET : in ;
00038 CLK : in ;
00039 EN : in ;
00040 DONE : out
00041 );
00042
00043
00044 attribute use_dsp48 : ;
00045
00046 attribute use_dsp48 of cnt_ddr2_rd : entity is "yes";
00047
00048 end cnt_ddr2_rd;
00049
00050
00051 architecture cnt_ddr2_rd_arc of cnt_ddr2_rd is
00052
00053 signal cnt : (23 downto 0) := (others => '0');
00054 signal done_i : := '0';
00055
00056 begin
00057
00058 DONE <= done_i;
00059
00060
00061 cnt_rds : process(CLK)
00062 begin
00063 if CLK'event and CLK = '1' then
00064 if RESET = '1' then
00065 cnt <= (others => '0');
00066 done_i <= '0';
00067 else
00068 if cnt = "111111111111111111111111" then
00069 done_i <= '1';
00070 cnt <= (others => '0');
00071 else
00072 done_i <= '0';
00073 end if;
00074 if (EN = '1' and done_i = '0') then
00075 cnt <= cnt + 1;
00076 else
00077 cnt <= cnt;
00078 end if;
00079 end if;
00080 end if;
00081 end process cnt_rds;
00082
00083 end cnt_ddr2_rd_arc;
00084