1 ------------------------------------------------------------------------------- 2 -- File : DeviceDna7Series.vhd 3 -- Company : SLAC National Accelerator Laboratory 4 -- Created : 2013-09-25 5 -- Last update: 2016-12-06 6 ------------------------------------------------------------------------------- 7 -- Description: Wrapper for the 7 Series DNA_PORT 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;
29 --! @ingroup xilinx_7Series_general 47 constant DNA_SHIFT_LENGTH_C : := 64;
49 type StateType is (READ_S, SHIFT_S, DONE_S);
51 type RegType is record 53 bitCount : range 0 to DNA_SHIFT_LENGTH_C-1;
60 constant REG_INIT_C : RegType := ( 68 signal r : RegType := REG_INIT_C;
76 signal locClkInv : sl;
77 signal locClkInvR : sl;
81 locClk <= slowClk
when(USE_SLOWCLK_G)
else divClk;
83 locClkInv <=
not locClk;
88 SIM_DEVICE =>
"7SERIES") 95 DNA_CLK_INV_BUFR : BUFR
98 SIM_DEVICE =>
"7SERIES") 106 RstSync_Inst :
entity work.
RstSync 115 comb :
process (dnaDout, locRst, r)
is 116 variable v : RegType;
118 -- Latch the current value 121 -- Reset the strobing signals 127 ---------------------------------------------------------------------- 129 -- Check the read strobe status 130 if r.dnaRead = '0' then 131 -- Strobe the read of the DNA port 136 ---------------------------------------------------------------------- 138 -- Shift the data out 140 -- Check the shift strobe status 141 if r.dnaShift = '1' then 144 -- Increment the counter 145 v.bitCount := r.bitCount + 1;
146 -- Check the counter value 147 if (r.bitCount = DNA_SHIFT_LENGTH_C-1) then 152 ---------------------------------------------------------------------- 156 ---------------------------------------------------------------------- 164 -- Register the variable for next clock cycle 169 sync :
process (locClkInvR)
is 171 if (rising_edge(locClkInvR)) then 172 r <= rin after TPD_G;
176 DNA_PORT_I : DNA_PORT
202 dataIn => r.dnaValue
(63 downto 8),
USE_SLOWCLK_Gboolean := false
BUFR_CLK_DIV_Gstring := "8"
in dataInslv( WIDTH_G- 1 downto 0)
SIM_DNA_VALUE_Gbit_vector := X"000000000000000"
out dnaValueslv( 55 downto 0)
out dataOutslv( WIDTH_G- 1 downto 0)