Generated by EASE/HDL for peterj on Mon Jul 02 10:55:24 2007

Documentation for architecture MGTEVB/MakeMSE/a0

Contents Side Data Generated HDL

VHDL Contents

    1  -- EASE/HDL begin --------------------------------------------------------------
    2  -- 
    3  -- Architecture 'a0' of entity 'MakeMSE'.
    4  -- 
    5  --------------------------------------------------------------------------------
    6  -- 
    7  -- Copy of the interface declaration:
    8  -- 
    9  --   port(
   10  --     Clk       : in     std_logic;
   11  --     EBMGTtest : in     std_logic;
   12  --     LD        : in     std_logic_vector(31 downto 0);
   13  --     MSE       : out    std_logic_vector(31 downto 0);
   14  --     MatchBOT  : in     std_logic;
   15  --     MatchEOT  : in     std_logic;
   16  --     Reg2Ad    : in     std_logic_vector(31 downto 0);
   17  --     Rst_n     : in     std_logic;
   18  --     TTCeb     : in     std_logic_vector(23 downto 0);
   19  --     Valid     : in     std_logic);
   20  -- 
   21  -- EASE/HDL end ----------------------------------------------------------------
   22  
   23  architecture a0 of MakeMSE is
   24  
   25    signal TDCParEr   : std_logic;
   26    signal GOLParEr   : std_logic;
   27  
   28  begin
   29  
   30    TDCParEr <= '1' when (LD(31 downto 28) = Reg2Ad(31 downto 28)) else '0';
   31    GOLParEr <= '1' when (LD(31 downto 28) = Reg2Ad(15 downto 12)) else '0';
   32  
   33    prError:
   34    process (Clk, Rst_n)
   35      variable dats    : std_logic_vector(31 downto 0);
   36      variable TDCecnt : std_logic_vector(11 downto 0);
   37      variable TDCbcnt : std_logic_vector(11 downto 0);
   38    begin
   39      if (Rst_n = '0') then
   40        dats := (others => '0');
   41      elsif (rising_edge(Clk)) then
   42        if (Valid = '1') then
   43          if (MatchBOT = '1') then
   44            TDCecnt := LD(23 downto 12);          -- ECNT eventcount
   45            TDCbcnt := LD(11 downto  0);          -- BCNT bunchcount
   46            if (TDCecnt /= TTCeb(23 downto 12)) then
   47              dats(1) := '1';                     -- set error flag
   48            end if;
   49            if (TDCbcnt /= TTCeb(11 downto  0)) then
   50              dats(0) := '1';                     -- set error flag
   51            end if;
   52          elsif (MatchEOT = '1') then
   53            TDCecnt := LD(23 downto 12);          -- ECNT eventcount
   54            if (TDCecnt /= TTCeb(23 downto 12)) then
   55              dats(1) := '1';                     -- set error flag
   56            end if;
   57          end if;
   58          if (TDCParEr = '1') then
   59            dats(3)  := '1';                      -- set error flag
   60            dats(16) := '1';                      -- set error type TDCParError
   61          end if;
   62          if (GOLParEr = '1') then
   63            dats(3)  := '1';                      -- set error flag
   64            dats(17) := '1';                      -- set error type GOLParError
   65          end if;
   66        else
   67          dats := (others => '0');
   68        end if;
   69        dats(20) := EBMGTtest;           -- set error when EBMGTtest mode (noTTC)
   70      end if;
   71      MSE <= dats;
   72    end process prError;
   73  
   74  end architecture a0 ; -- of MakeMSE
   75  
   76