Go to the documentation of this file. 1 ------------------------------------------------------------------------------- 2 -- File : HeaderReg.vhd 3 -- Company : SLAC National Accelerator Laboratory 4 -- Created : 2015-08-09 5 -- Last update: 2016-01-27 6 ------------------------------------------------------------------------------- 7 -- Description: Combines and decodes the header values from input parameters headerValues_i 8 -- Header is selected by xxxHeadSt_i and addressed by addr_i 9 -- Outputs the addressed headerData_o and headerLength_o values with 1 Clock Cycle delay 10 -- Outputs (oth=>'0')If no header is addressed 11 ------------------------------------------------------------------------------- 12 -- This file is part of 'SLAC Firmware Standard Library'. 13 -- It is subject to the license terms in the LICENSE.txt file found in the 14 -- top-level directory of this distribution and at: 15 -- https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. 16 -- No part of 'SLAC Firmware Standard Library', including this file, 17 -- may be copied, modified, propagated, or distributed except according to 18 -- the terms contained in the LICENSE.txt file. 19 ------------------------------------------------------------------------------- 22 use ieee.std_logic_1164.
all;
23 use ieee.std_logic_unsigned.
all;
24 use ieee.std_logic_arith.
all;
31 --! @ingroup protocols_rssi 47 -- Header control inputs (must hold values while reading header) 53 --eackHeadSt_i : in sl; 55 -- Ack sequence number valid 59 txSeqN_i : in slv(7 downto 0);
-- Sequence number of the current packet 60 rxAckN_i : in slv(7 downto 0);
-- Acknowledgment number of the recived packet handelled by receiver 62 -- Negotiated or from GENERICS 65 -- Out of order sequence numbers from received EACK packet 66 --eackSeqnArr_i : in Slv16Array(0 to integer(ceil(real(MAX_OUT_OF_SEQUENCE_G)/2.0))-1); 67 --eackN_i : in natural; 78 type RegType is record 82 -- Registered header parameters (so they don't change during the checksum calculation) 84 txSeqN : slv(7 downto 0);
85 rxAckN : slv(7 downto 0);
89 constant REG_INIT_C : RegType := ( 90 headerData => (others =>'0'), 94 txSeqN => (others =>'0'), 95 rxAckN => (others =>'0') 98 signal r : RegType := REG_INIT_C;
105 -- Convert address to integer 106 addrInt <= conv_integer(addr_i);
112 variable v : RegType;
137 x"00" & x"00";
-- Place for checksum 140 v.headerData := (others=> '0');
150 x"00" & x"00" & -- Reserved 151 x"00" & x"00";
-- Place for checksum 154 v.headerData := (others=> '0');
163 x"00" & x"00" & -- Reserved 164 x"00" & x"00";
-- Place for checksum 168 v.headerData := (others=> '0');
176 x"00" & x"00" & -- Reserved 177 x"00" & x"00";
-- Place for checksum 181 v.headerData := (others=> '0');
191 x"00" & x"00" & -- Reserved 192 x"00" & x"00";
-- Place for checksum 196 v.headerData := (others=> '0');
198 -- elsif (eackHeadSt_i = '1') then 201 -- v.headerData := "01100000" & toSlv(EACK_HEADER_SIZE_G+r.eackN, 8); 203 -- v.headerData := txSeqN_i & r.rxAckN; 204 -- when 16#02# to (2+MAX_OUT_OF_ORDER_G-1) => 205 -- v.headerData := r.eackSeqnArr(addrInt-2); 207 -- v.headerData := (others=> '0'); 210 -- Register parameters when out of headers 216 v.headerData := (others=> '0');
220 if (rst_i = '1') then 225 ----------------------------------------------------------- 228 seq :
process (
clk_i)
is 230 if (rising_edge(clk_i)) then 231 r <= rin after TPD_G;
234 --------------------------------------------------------------------- 238 --------------------------------------------------------------------- 239 end architecture rtl;