1 -------------------------------------------------------------------------------     3 -- Company    : SLAC National Accelerator Laboratory     4 -- Created    : 2013-04-30     5 -- Last update: 2013-09-25     6 -------------------------------------------------------------------------------     7 -- Description: Example Arbiter Module     8 -------------------------------------------------------------------------------     9 -- This file is part of 'SLAC Firmware Standard Library'.    10 -- It is subject to the license terms in the LICENSE.txt file found in the     11 -- top-level directory of this distribution and at:     12 --    https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html.     13 -- No part of 'SLAC Firmware Standard Library', including this file,     14 -- may be copied, modified, propagated, or distributed except according to     15 -- the terms contained in the LICENSE.txt file.    16 -------------------------------------------------------------------------------    19 use ieee.std_logic_1164.
all;
    20 use ieee.std_logic_arith.
all;
    21 use ieee.std_logic_unsigned.
all;
    27  --! @ingroup base_general    46    constant SELECTED_SIZE_C :  := bitSize(REQ_SIZE_G-1);
    48    type RegType is record    49       lastSelected : slv(SELECTED_SIZE_C-1 downto 0);
    54    constant REG_RESET_C : RegType :=    55       (lastSelected => (others => '0'), valid => '0', ack => (others => '0'));
    57    signal r   : RegType := REG_RESET_C;
    62    comb : 
process (r, 
req, 
rst) 
is    67       if (req(conv_integer(r.lastSelected)) = '0' or r.valid = '0') then    68          arbitrate(req, r.lastSelected, v.lastSelected, v.valid, v.ack);
    82    seq : 
process (
clk, 
rst) 
is    84       if (rising_edge(clk)) then    88          r <= REG_RESET_C after TPD_G;
 in rstsl  :=not    RST_POLARITY_G
 
out selectedslv(   bitSize(   REQ_SIZE_G- 1)- 1 downto  0)  
 
out ackslv(   REQ_SIZE_G- 1 downto  0)  
 
RST_ASYNC_Gboolean  :=   false
 
in reqslv(   REQ_SIZE_G- 1 downto  0)