1 ------------------------------------------------------------------------------- 2 -- File : IprogUltraScale.vhd 3 -- Company : SLAC National Accelerator Laboratory 4 -- Created : 2015-06-18 5 -- Last update: 2016-04-13 6 ------------------------------------------------------------------------------- 7 -- Description: Uses the ICAP primitive to internally 8 -- toggle the PROG_B via IPROG command 9 ------------------------------------------------------------------------------- 10 -- This file is part of 'SLAC Firmware Standard Library'. 11 -- It is subject to the license terms in the LICENSE.txt file found in the 12 -- top-level directory of this distribution and at: 13 -- https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. 14 -- No part of 'SLAC Firmware Standard Library', including this file, 15 -- may be copied, modified, propagated, or distributed except according to 16 -- the terms contained in the LICENSE.txt file. 17 ------------------------------------------------------------------------------- 20 use ieee.std_logic_1164.
all;
21 use ieee.std_logic_arith.
all;
22 use ieee.std_logic_unsigned.
all;
30 --! @ingroup xilinx_UltraScale_general 47 function selectMapBitSwapping (input :
slv)
return slv is 50 variable output : slv(0 to 31);
54 output((8*i)+j) := input((8*i)+(7-j));
58 end function selectMapBitSwapping;
60 type StateType is (IDLE_S, PROG_S);
62 type RegType is record 67 cnt : slv(3 downto 0);
68 configData : slv(
31 downto 0);
72 constant REG_INIT_C : RegType := ( 77 cnt => (others => '0'), 78 configData => (
others => '0'),
81 signal r : RegType := REG_INIT_C;
85 signal icape2Clk : sl;
86 signal icape2Rst : sl;
87 signal startEdge : sl;
94 BUFGCE_DIV_Inst : BUFGCE_DIV
103 RstSync_Inst :
entity work.
RstSync 123 DEVICE_ID => X"03628093",
-- Specifies the pre-programmed Device ID value to be used for simulation purposes 124 ICAP_AUTO_SWITCH =>
"DISABLE",
-- Enable switch ICAP using sync word 125 SIM_CFG_FILE_NAME =>
"NONE") -- Specifies the Raw Bitstream (RBT) file to be parsed by the simulation model 127 AVAIL => rdy,
-- 1-bit output: Availability status of ICAP 128 O =>
open,
-- 32-bit output: Configuration data output bus 129 PRDONE =>
open,
-- 1-bit output: Indicates completion of Partial Reconfiguration 130 PRERROR =>
open,
-- 1-bit output: Indicates Error during Partial Reconfiguration 131 CLK => icape2Clk,
-- 1-bit input: Clock input 132 CSIB => r.csl,
-- 1-bit input: Active-Low ICAP enable 133 I => r.configData,
-- 32-bit input: Configuration data input bus 134 RDWRB => r.rnw
);
-- 1-bit input: Read/Write Select input 136 comb :
process (
bootAddress, icape2Rst, r, rdy, startEdge)
is 137 variable v : RegType;
147 v.cnt := (others => '0');
149 if (startEdge = '1') then 161 v.configData := selectMapBitSwapping(X"AA995566");
164 v.configData := selectMapBitSwapping(X"20000000");
166 --Type 1 Write 1 Words to WBSTAR 167 v.configData := selectMapBitSwapping(X"30020001");
169 --Warm Boot Start Address (Load the Desired Address) 170 v.configData := selectMapBitSwapping(bitReverse(r.bootAddress));
172 --Type 1 Write 1 Words to CMD 173 v.configData := selectMapBitSwapping(X"30008001");
176 v.configData := selectMapBitSwapping(X"0000000F");
179 v.configData := selectMapBitSwapping(X"20000000");
184 -- Check for interrupt 185 if (r.rdy = '1') and (rdy = '0') then 186 -- Reset the IPROG procedure 189 v.cnt := (others => '0');
194 if (icape2Rst = '1') then 202 seq :
process (icape2Clk)
is 204 if (rising_edge(icape2Clk)) then 205 r <= rin after TPD_G;
USE_SLOWCLK_Gboolean := false
in rstsl :=not RST_POLARITY_G
BUFR_CLK_DIV_Gnatural := 8
in bootAddressslv( 31 downto 0) := X"00000000"