1 ------------------------------------------------------------------------------- 2 -- File : AxiVersion.vhd 3 -- Company : SLAC National Accelerator Laboratory 4 -- Created : 2013-05-20 5 -- Last update: 2017-02-15 6 ------------------------------------------------------------------------------- 7 -- Description: Creates AXI accessible registers containing configuration 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;
54 -- Optional: Master Reset 56 -- Optional: FPGA Reloading Interface 61 -- Optional: Serial Number outputs 65 -- Optional: user values 67 -- Optional: DS2411 interface 74 constant TIMEOUT_1HZ_C : := (getTimeRatio(1.
0, CLK_PERIOD_G) -1);
75 constant COUNTER_ZERO_C : slv(31 downto 0) := X"00000000";
80 type RegType is record 82 timer : range 0 to TIMEOUT_1HZ_C;
83 scratchPad : slv(31 downto 0);
84 counter : slv(31 downto 0);
94 constant REG_INIT_C : RegType := ( 97 scratchPad => (others => '0'), 98 counter => (others => '0'), 107 signal r : RegType := REG_INIT_C;
108 signal rin : RegType;
110 signal dnaValue : slv(127 downto 0) := (others => '0');
111 signal fdValue : slv(63 downto 0) := (others => '0');
112 signal masterRstDet : sl := '0';
113 signal asyncRst : sl := '0';
115 attribute rom_style : ;
116 attribute rom_style of BUILD_STRING_ROM_C : constant is "distributed";
117 attribute rom_extract : ;
118 attribute rom_extract of BUILD_STRING_ROM_C : constant is "TRUE";
119 attribute syn_keep : ;
120 attribute syn_keep of BUILD_STRING_ROM_C : constant is "TRUE";
140 end generate GEN_DEVICE_DNA;
152 end generate GEN_DS2411;
155 Iprog_1 :
entity work.
Iprog 165 start => r.fpgaReload,
171 variable v : RegType;
174 -- Latch the current value 180 --------------------------------- 181 -- First Stage Boot Loader (FSBL) 182 --------------------------------- 183 -- Check if timer enabled 185 v.counter := v.counter + 1;
188 -- Check for reload condition 193 ------------------------ 194 -- AXI-Lite Transactions 195 ------------------------ 197 -- Determine the transaction type 200 axiSlaveRegisterR(axilEp, x"000", 0, BUILD_INFO_C.fwVersion);
201 axiSlaveRegister(axilEp, x"004", 0, v.scratchPad);
202 axiSlaveRegisterR(axilEp, x"008", 0, r.upTimeCnt);
204 axiSlaveRegister(axilEp, x"100", 0, v.haltReload);
205 axiSlaveRegister(axilEp, x"104", 0, v.fpgaReload);
207 axiSlaveRegister(axilEp, x"10C", 0, v.masterReset);
209 axiSlaveRegisterR(axilEp, x"300", 0, fdValue);
210 axiSlaveRegisterR(axilEp, x"400", userValues);
213 -- axiSlaveRegisterR(axilEp, x"600", 0, BUILD_INFO_C.gitHash);-- axiSlaveRegisterR() Broken, only first 32-bit show up in software 214 axiSlaveRegisterR(axilEp, x"600", 0, BUILD_INFO_C.gitHash(31 downto 0));
215 axiSlaveRegisterR(axilEp, x"604", 0, BUILD_INFO_C.gitHash(63 downto 32));
216 axiSlaveRegisterR(axilEp, x"608", 0, BUILD_INFO_C.gitHash(95 downto 64));
217 axiSlaveRegisterR(axilEp, x"60C", 0, BUILD_INFO_C.gitHash(127 downto 96));
218 axiSlaveRegisterR(axilEp, x"610", 0, BUILD_INFO_C.gitHash(159 downto 128));
220 axiSlaveRegisterR(axilEp, x"700", 0, dnaValue);
221 axiSlaveRegisterR(axilEp, x"800", BUILD_STRING_ROM_C);
225 --------------------------------- 227 --------------------------------- 228 if r.timer = TIMEOUT_1HZ_C then 232 v.timer := r.timer + 1;
242 -- Register the variable for next clock cycle 257 if (rising_edge(axiClk)) then 258 r <= rin after TPD_G;
262 asyncRst <= axiRst or masterRstDet;
264 U_RstSync :
entity work.
RstSync 272 end architecture rtl;
XIL_DEVICE_Gstring := "7SERIES"
array(natural range <> ) of slv( 31 downto 0) Slv32Array
out upTimeCntslv( 31 downto 0)
SIM_DNA_VALUE_Gslv := X"000000000000000000000000"
USE_SLOWCLK_Gboolean := false
slv( 2239 downto 0) BuildInfoType
in bootAddressslv( 31 downto 0) := X"00000000"
in axiWriteMasterAxiLiteWriteMasterType
out dnaValueOutslv( 127 downto 0)
CLK_PERIOD_Greal := 6.4E-9
slv( 159 downto 0) gitHash
SIM_DNA_VALUE_Gslv := X"000000000000000000000000"
out axiWriteSlaveAxiLiteWriteSlaveType
DEVICE_ID_Gslv( 31 downto 0) :=( others => '0')
slv( 1 downto 0) := "11" AXI_RESP_DECERR_C
AUTO_RELOAD_ADDR_Gslv( 31 downto 0) :=( others => '0')
in userValuesSlv32Array( 0 to 63) :=( others => X"00000000")
out axiReadSlaveAxiLiteReadSlaveType
EN_ICAP_Gboolean := false
AUTO_RELOAD_EN_Gboolean := false
EN_DS2411_Gboolean := false
AxiLiteReadSlaveType :=(arready => '0',rdata =>( others => '0'),rresp =>( others => '0'),rvalid => '0') AXI_LITE_READ_SLAVE_INIT_C
out dnaValueslv( 127 downto 0)
BUFR_CLK_DIV_Gpositive := 8
USE_SLOWCLK_Gboolean := false
CLK_PERIOD_Greal := 8.0E-9
BUFR_CLK_DIV_Gpositive := 8
EN_DEVICE_DNA_Gboolean := false
AXI_ERROR_RESP_Gslv( 1 downto 0) := AXI_RESP_DECERR_C
AUTO_RELOAD_TIME_Greal range 0.0 to 30.0:= 10.0
USE_SLOWCLK_Gboolean := false
out fdValueOutslv( 63 downto 0)
XIL_DEVICE_Gstring := "7SERIES"
out fdValueslv( 63 downto 0)
in axiReadMasterAxiLiteReadMasterType
BUFR_CLK_DIV_Gpositive := 8
AxiLiteWriteSlaveType :=(awready => '0',wready => '0',bresp =>( others => '0'),bvalid => '0') AXI_LITE_WRITE_SLAVE_INIT_C
out fpgaReloadAddrslv( 31 downto 0)
XIL_DEVICE_Gstring := "7SERIES"
slv( 31 downto 0) fwVersion
Slv32Array( 0 to 63) buildString
BUILD_INFO_GBuildInfoType