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/extend_test.vhd,v $
00015 --* $Revision: 1.7.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 use ieee.numeric_std.all;
00033
00034
00035
00036
00037
00038 entity extend_test is
00039 generic (
00040 LEN : range 0 to 63 := 2
00041 );
00042 port (
00043 CLK : in ;
00044 RES : in ;
00045 ENDM : out ;
00046 A : in ;
00047 Y : out
00048 );
00049 end extend_test;
00050
00051
00052
00053 architecture extend_test_arc of extend_test is
00054
00055 signal cn : (5 downto 0) := "000000";
00056 signal enab : := '0';
00057
00058 begin
00059
00060 Y <= enab;
00061
00062
00063 extend : process(CLK)
00064 begin
00065 if(CLK'event and CLK = '1') then
00066 if RES = '1' then
00067 cn <= (others => '0');
00068 ENDM <= '0';
00069 else
00070 ENDM <= '0';
00071 if enab = '1' then
00072 if cn = LEN then
00073 cn <= (others => '0');
00074 enab <= '0';
00075 ENDM <= '1';
00076 else
00077 cn <= cn + 1;
00078 end if;
00079 else
00080 cn <= cn;
00081 end if;
00082 if A = '1' then
00083 enab <= '1';
00084 end if;
00085 end if;
00086 end if;
00087 end process extend;
00088
00089 end extend_test_arc;
00090