1 -------------------------------------------------------------------------------     2 -- File       : Iprog7SeriesCore.vhd     3 -- Company    : SLAC National Accelerator Laboratory     4 -- Created    : 2015-09-09     5 -- Last update: 2015-09-10     6 -------------------------------------------------------------------------------     7 -- Description: Wrapper for Xilinx 7-Series IPROG CMD     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;
    26  --! @ingroup xilinx_7Series_general    32       -- Can be asynchronous if SYNC_RELOAD_G=false    50    function selectMapBitSwapping (input : 
slv) 
return slv is    53       variable output : slv(0 to 31);
    57             output((8*i)+j) := input((8*i)+(7-j));
    61    end function selectMapBitSwapping;
    63    type StateType is (IDLE_S, REQ_S, PROG_S);
    65    type RegType is record    70       cnt        : slv(3 downto 0);
    71       configData : slv(
31 downto 0);
    74    constant REG_INIT_C : RegType := (    79       cnt        => (others => '0'),    80       configData => (
others => '0'));
    82    signal r   : RegType := REG_INIT_C;
    85    signal icapReloadAddr : slv(31 downto 0);
    86    signal icapReload     : sl;
    90    -- Synchronize reload addr to icap clk   103    -- Capture edge of start on icapClk   115       variable v : RegType;
   123             v.cnt := (others => '0');
   124             if (icapReload = '1') then   134             -- Wait to be granted access to the ICAP   146                   v.configData := selectMapBitSwapping(X"AA995566");
   149                   v.configData := selectMapBitSwapping(X"20000000");
   151                   --Type 1 Write 1 Words to WBSTAR   152                   v.configData := selectMapBitSwapping(X"30020001");
   154                   --Warm Boot Start Address (Load the Desired Address)   155                   v.configData := selectMapBitSwapping(bitReverse(icapReloadAddr));
   157                   --Type 1 Write 1 Words to CMD   158                   v.configData := selectMapBitSwapping(X"30008001");
   161                   v.configData := selectMapBitSwapping(X"0000000F");
   164                   v.configData := selectMapBitSwapping(X"20000000");
   180       icapI   <= r.configData;
   188          r <= rin after TPD_G;
   192 end architecture rtl;
 
BYPASS_SYNC_Gboolean  :=   false
 
in dataInslv(   WIDTH_G- 1 downto  0)  
 
out icapIslv( 31 downto  0)  
 
in reloadAddrslv( 31 downto  0)  := X"00000000"
 
SYNC_RELOAD_Gboolean  :=   true
 
in rstsl  :=not    RST_POLARITY_G
 
out dataOutslv(   WIDTH_G- 1 downto  0)  
 
in rstsl  :=not    RST_POLARITY_G