1 ------------------------------------------------------------------------------- 3 -- Company : SLAC National Accelerator Laboratory 4 -- Created : 2016-04-19 5 -- Last update: 2016-05-04 6 ------------------------------------------------------------------------------- 7 -- Description: SRPv3 Package File 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;
27 --! @ingroup protocols_srp 29 -- constant SRP_AXIS_CONFIG_C : AxiStreamConfigType := ( 30 -- TSTRB_EN_C => false, 31 -- TDATA_BYTES_C => 4, 34 -- TKEEP_MODE_C => TKEEP_NORMAL_C, 36 -- TUSER_MODE_C => TUSER_FIRST_LAST_C); 60 spare => (others => '0'), 61 tid => (others => '0'), 62 addr => (others => '0'), 79 -- function srpHeader ( 80 -- opcode : in slv(1 downto 0); 82 -- reqSize : in natural := 0; 83 -- txnId : in slv(31 downto 0) := (others => '0'); 84 -- timeout : in slv(7 downto 0) := (others => '0')) 87 -- variable header : slv32Array(0 to 4); 89 -- header(0)(7 downto 0) := X"03"; -- Version 90 -- header(0)(9 downto 8) := opcode; -- Opcode 91 -- header(0)(23 downto 10) := (others => '0'); -- Reserved 92 -- header(0)(31 downto 24) := timeout; -- TimeoutCnt 93 -- header(1)(31 downto 0) := txnId; --TID 94 -- header(2) := resize(addr, 32); 95 -- header(3) := resize(addr(addr'high downto 32), 32); 96 -- header(4) := toSlv(reqSize, 32); 100 -- procedure srpSimWrite ( 101 -- signal clk : in sl; 102 -- signal master : out AxiStreamMasterType; 103 -- signal slave : in AxiStreamSlaveType; 105 -- data : in Slv32Array; 106 -- txnId : in slv(31 downto 0) := (others => '0'); 107 -- timeout : in slv(7 downto 0) := (others => '0'); 108 -- posted : in boolean := false) 110 -- variable txData : slv32array(0 to 4+data'length-1); 113 -- txData(0 to 4) := srpHeader(ite(posted, SRP_POSTED_WRITE_C, SRP_WRITE_C), addr, data'length*4-1, txnId, timeout); 114 -- txData(5 to txData'length-1) := data; 116 -- axiStreamSimSendFrame(SRP_AXIS_CONFIG_C, clk, master, slave, txData, "02", "00"); 118 -- -- Need to check response if non posted 122 -- procedure srpSimRead ( 123 -- signal clk : in sl; 124 -- signal master : out AxiStreamMasterType; 125 -- signal slave : in AxiStreamSlaveType; 127 -- data : inout Slv32Array; 128 -- txnId : in slv(31 downto 0) := (others => '0'); 129 -- timeout : in slv(7 downto 0) := (others => '0')) 131 -- variable txData : slv32array(0 to 4); 134 -- txData(0 to 4) := srpHeader(SRP_READ_C, addr, data'length*4-1, txnId, timeout); 135 -- axiStreamSimSendFrame(SRP_AXIS_CONFIG_C, clk, master, slave, txData, "02", "00"); 137 -- --axiStreamSimReceiveFrame(SRP_AXIS_CONFIG_C, clk, 141 end package body SrpV3Pkg;
slv( 31 downto 0) reqSize
slv( 1 downto 0) := "00" SRP_READ_C
SrpV3ReqType :=(request => '0',remVer =>( others => '0'),opCode =>( others => '0'),spare =>( others => '0'),tid =>( others => '0'),addr =>( others => '0'),reqSize =>( others => '0')) SRPV3_REQ_INIT_C
slv( 7 downto 0) respCode
slv( 7 downto 0) := x"03" SRP_VERSION_C
slv( 1 downto 0) := "01" SRP_WRITE_C
slv( 1 downto 0) := "11" SRP_NULL_C
SrpV3AckType :=(done => '0',respCode =>( others => '0')) SRPV3_ACK_INIT_C
slv( 1 downto 0) := "10" SRP_POSTED_WRITE_C