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/rod/bcm_signal_delay.vhd,v $
00015 --* $Revision: 1.3.2.4 $ *
00016 --* $Name: dev $ *
00017 --* $Author: mniegl $ *
00018 --* $Date: 2008/11/03 17:57:48 $ *
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 entity bcm_signal_delay is
00034 port (
00035 CLK : in ;
00036 SCLR : in ;
00037 delay_setting : in (7 downto 0);
00038 data_input : in ;
00039 data_output : out
00040 );
00041
00042 attribute shreg_extract : ;
00043 attribute shreg_extract of bcm_signal_delay : entity is "yes";
00044
00045 end bcm_signal_delay;
00046
00047
00048 architecture bcm_signal_delay_arc of bcm_signal_delay is
00049
00050 signal shift_register_0 : := '0';
00051 signal shift_register_1 : (1 downto 0) := (others => '0');
00052 signal shift_register_2 : (3 downto 0) := (others => '0');
00053 signal shift_register_3 : (7 downto 0) := (others => '0');
00054 signal shift_register_4 : (15 downto 0) := (others => '0');
00055 signal shift_register_5 : (31 downto 0) := (others => '0');
00056 signal shift_register_6 : (63 downto 0) := (others => '0');
00057 signal shift_register_7 : (127 downto 0) := (others => '0');
00058 signal connection_0 : := '0';
00059 signal connection_1 : := '0';
00060 signal connection_2 : := '0';
00061 signal connection_3 : := '0';
00062 signal connection_4 : := '0';
00063 signal connection_5 : := '0';
00064 signal connection_6 : := '0';
00065
00066 begin
00067
00068
00069
00070 signal_delay : process (CLK, SCLR)
00071 begin
00072 if (SCLR = '1') then
00073 data_output <= '0';
00074 shift_register_0 <= '0';
00075 connection_0 <= '0';
00076 connection_1 <= '0';
00077 connection_2 <= '0';
00078 connection_3 <= '0';
00079 connection_4 <= '0';
00080 connection_5 <= '0';
00081 connection_6 <= '0';
00082 elsif (CLK'event and CLK = '1') then
00083 if (delay_setting(0) = '1') then
00084 shift_register_0 <= data_input;
00085 connection_0 <= shift_register_0;
00086 else
00087 connection_0 <= data_input;
00088 end if;
00089 if (delay_setting(1) = '1') then
00090 shift_register_1 <= connection_0 & shift_register_1(1);
00091 connection_1 <= shift_register_1(0);
00092 else
00093 connection_1 <= connection_0;
00094 end if;
00095 if (delay_setting(2) = '1') then
00096 shift_register_2 <= connection_1 & shift_register_2(3 downto 1);
00097 connection_2 <= shift_register_2(0);
00098 else
00099 connection_2 <= connection_1;
00100 end if;
00101 if (delay_setting(3) = '1') then
00102 shift_register_3 <= connection_2 & shift_register_3(7 downto 1);
00103 connection_3 <= shift_register_3(0);
00104 else
00105 connection_3 <= connection_2;
00106 end if;
00107 if (delay_setting(4) = '1') then
00108 shift_register_4 <= connection_3 & shift_register_4(15 downto 1);
00109 connection_4 <= shift_register_4(0);
00110 else
00111 connection_4 <= connection_3;
00112 end if;
00113 if (delay_setting(5) = '1') then
00114 shift_register_5 <= connection_4 & shift_register_5(31 downto 1);
00115 connection_5 <= shift_register_5(0);
00116 else
00117 connection_5 <= connection_4;
00118 end if;
00119 if (delay_setting(6) = '1') then
00120 shift_register_6 <= connection_5 & shift_register_6(63 downto 1);
00121 connection_6 <= shift_register_6(0);
00122 else
00123 connection_6 <= connection_5;
00124 end if;
00125 if (delay_setting(7) = '1') then
00126 shift_register_7 <= connection_6 & shift_register_7(127 downto 1);
00127 data_output <= shift_register_7(0);
00128 else
00129 data_output <= connection_6;
00130 end if;
00131 end if;
00132 end process;
00133
00134 end bcm_signal_delay_arc;
00135