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