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/BID_cnt.vhd,v $
00015 --* $Revision: 1.6.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 library unisim;
00033
00034 use unisim.vcomponents.all;
00035
00036
00037
00038
00039
00040 entity BID_cnt is
00041 port (
00042 BC : in ;
00043 BCR : in ;
00044 RESET : in ;
00045 BID : out (11 downto 0));
00046
00047
00048 attribute use_dsp48 : ;
00049
00050 attribute use_dsp48 of BID_cnt : entity is "yes";
00051
00052 end BID_cnt;
00053
00054
00055
00056
00057
00058 architecture BID_cnt_arc of BID_cnt is
00059
00060 ----------------------------- signals ------------------------------------
00061 signal bid_i : (11 downto 0) := (others => '0');
00062 signal bcr_i : := '0';
00063 signal bcr2_i : := '0';
00064 signal reset_i : := '0';
00065
00066 begin
00067
00068 BID <= bid_i;
00069
00070
00071 BID_reset : process(BC)
00072 begin
00073 if BC'event and BC = '1' then
00074 bcr_i <= BCR;
00075 bcr2_i <= bcr_i;
00076 end if;
00077 end process BID_reset;
00078
00079 reset_i <= (bcr_i and (not(bcr2_i))) or RESET;
00080
00081
00082 BID_cnt : process(BC)
00083 begin
00084 if BC'event and BC = '1' then
00085 if reset_i = '1' then
00086 bid_i <= (others => '0');
00087 else
00088 bid_i <= bid_i + 1;
00089 end if;
00090 end if;
00091 end process BID_cnt;
00092
00093 end BID_cnt_arc;
00094