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/div/busy.vhd,v $
00015 --* $Revision: 1.5.2.3 $ *
00016 --* $Name: dev $ *
00017 --* $Author: mniegl $ *
00018 --* $Date: 2008/11/03 17:57:45 $ *
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
00033
00034 entity busy is
00035 generic (
00036 DEAD : range 0 to 30 := 10
00037 );
00038 port (
00039 CLK : in ;
00040 RES : in ;
00041 EN : in ;
00042 TRIG_IN : in ;
00043 TRIG_OUT : out
00044 );
00045 end busy;
00046
00047
00048
00049 architecture busy_arc of busy is
00050
00051 signal cnt : (4 downto 0) := (others => '0');
00052 signal trig_i : := '0';
00053
00054
00055 component edge
00056 port(
00057 CLK : in ;
00058 A : in ;
00059 PULSE : out
00060 );
00061 end component;
00062
00063 begin
00064
00065
00066 mask_trig : process(CLK)
00067 begin
00068 if CLK'event and CLK = '1' then
00069 if RES = '1' then
00070 cnt <= (others => '0');
00071 else
00072 if TRIG_IN = '1' then
00073 if cnt = DEAD-1 then
00074 trig_i <= '1';
00075 cnt <= (others => '0');
00076 else
00077 cnt <= cnt + 1;
00078 trig_i <= '0';
00079 end if;
00080 else
00081 cnt <= cnt;
00082 end if;
00083 end if;
00084 end if;
00085 end process mask_trig;
00086
00087
00088 make_edge : edge
00089 port map
00090 (
00091 CLK => CLK ,
00092 A => trig_i ,
00093 PULSE => TRIG_OUT
00094 );
00095
00096 end busy_arc;
00097