1 ------------------------------------------------------------------------------- 2 -- File : SsiPrbsRateGen.vhd 3 -- Company : SLAC National Accelerator Laboratory 4 -- Created : 2017-04-28 5 ------------------------------------------------------------------------------- 7 ------------------------------------------------------------------------------- 8 -- This file is part of 'SLAC Firmware Standard Library'. 9 -- It is subject to the license terms in the LICENSE.txt file found in the 10 -- top-level directory of this distribution and at: 11 -- https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. 12 -- No part of 'SLAC Firmware Standard Library', including this file, 13 -- may be copied, modified, propagated, or distributed except according to 14 -- the terms contained in the LICENSE.txt file. 15 ------------------------------------------------------------------------------- 18 use ieee.std_logic_1164.
all;
19 use ieee.std_logic_unsigned.
all;
20 use ieee.std_logic_arith.
all;
28 --! @ingroup protocols_ssi 31 -- General Configurations 34 -- PRBS TX FIFO Configurations 42 -- AXI Stream Configurations 46 -- Master Port (mAxisClk) 59 type RegType is record 63 packetLength : slv(31 downto 0);
64 genPeriod : slv(31 downto 0);
67 genMissed : slv(31 downto 0);
68 genCount : slv(31 downto 0);
69 frameCount : slv(31 downto 0);
73 constant REG_INIT_C : RegType := ( 77 packetLength => (others=>'0'), 78 genPeriod => (others=>'0'), 81 genMissed => (others=>'0'), 82 genCount => (others=>'0'), 83 frameCount => (others=>'0'), 86 signal r : RegType := REG_INIT_C;
91 signal frameRate : slv(31 downto 0);
92 signal frameRateMax : slv(31 downto 0);
93 signal frameRateMin : slv(31 downto 0);
94 signal bandwidth : slv(63 downto 0);
95 signal bandwidthMax : slv(63 downto 0);
96 signal bandwidthMin : slv(63 downto 0);
149 frameRate, frameRateMax, frameRateMin,
150 bandwidth, bandwidthMax, bandwidthMin,
151 iAxisMaster, iAxisSlave )
is 152 variable v : RegType;
153 variable axilEp : AxiLiteEndPointType;
156 -- Latch the current value 160 --v.statReset := '0'; 164 -- Start transaction block 168 axiSlaveRegister(axilEp, x"000", 0, v.statReset);
169 axiSlaveRegister(axilEp, x"004", 0, v.packetLength);
170 axiSlaveRegister(axilEp, x"008", 0, v.genPeriod);
171 axiSlaveRegister(axilEp, x"00C", 0, v.genEnable);
172 axiSlaveRegister(axilEp, x"00C", 1, v.genOne);
174 axiSlaveRegisterR(axilEp, x"010", 0, r.genMissed);
175 axiSlaveRegisterR(axilEp, x"014", 0, frameRate);
176 axiSlaveRegisterR(axilEp, x"018", 0, frameRateMax);
177 axiSlaveRegisterR(axilEp, x"01C", 0, frameRateMin);
178 axiSlaveRegisterR(axilEp, x"020", 0, bandwidth(31 downto 0));
179 axiSlaveRegisterR(axilEp, x"024", 0, bandwidth(63 downto 32));
180 axiSlaveRegisterR(axilEp, x"028", 0, bandwidthMax(31 downto 0));
181 axiSlaveRegisterR(axilEp, x"02C", 0, bandwidthMax(63 downto 32));
182 axiSlaveRegisterR(axilEp, x"030", 0, bandwidthMin(31 downto 0));
183 axiSlaveRegisterR(axilEp, x"034", 0, bandwidthMin(63 downto 32));
185 axiSlaveRegisterR(axilEp, x"040", 0, r.frameCount);
187 -- End transaction block 191 if r.genEnable = '0' then 192 v.genCount := (others=>'0');
195 v.genCount := r.genCount + 1;
197 if r.genOne = '1' then 200 elsif r.genCount = r.genPeriod then 201 v.genCount := (others=>'0');
206 v.genMissed := r.genMissed + 1;
208 v.frameCount := r.frameCount + 1;
213 if r.statReset = '1' then 214 v.genMissed := (others=>'0');
222 -- Register the variable for next clock cycle 234 r <= rin after TPD_G;
VALID_THOLD_Ginteger range 0 to ( 2** 24):= 1
COMMON_CLK_Gboolean := false
in axisSlaveAxiStreamSlaveType
out bandwidthMaxslv( 63 downto 0)
AXIS_CONFIG_GAxiStreamConfigType := AXI_STREAM_CONFIG_INIT_C
VALID_THOLD_Ginteger range 0 to ( 2** 24):= 1
CASCADE_SIZE_Gnatural range 1 to ( 2** 24):= 1
MASTER_AXI_STREAM_CONFIG_GAxiStreamConfigType := ssiAxiStreamConfig( 16, TKEEP_COMP_C)
in mAxisSlaveAxiStreamSlaveType
AXIS_CLK_FREQ_Greal := 156.25E+6
out bandwidthMinslv( 63 downto 0)
out frameRateslv( 31 downto 0)
VALID_BURST_MODE_Gboolean := false
USE_BUILT_IN_Gboolean := false
VALID_BURST_MODE_Gboolean := false
FIFO_ADDR_WIDTH_Gnatural range 4 to 48:= 9
AXIS_CONFIG_GAxiStreamConfigType := AXI_STREAM_CONFIG_INIT_C
GEN_SYNC_FIFO_Gboolean := false
USE_BUILT_IN_Gboolean := false
slv( 1 downto 0) := "10" AXI_RESP_SLVERR_C
in axilWriteMasterAxiLiteWriteMasterType
out frameRateMaxslv( 31 downto 0)
in mAxisSlaveAxiStreamSlaveType
in packetLengthslv( 31 downto 0) := X"FFFFFFFF"
out axilReadSlaveAxiLiteReadSlaveType
out bandwidthslv( 63 downto 0)
AxiLiteReadSlaveType :=(arready => '0',rdata =>( others => '0'),rresp =>( others => '0'),rvalid => '0') AXI_LITE_READ_SLAVE_INIT_C
AXIS_CLK_FREQ_Greal := 156.25E+6
CASCADE_SIZE_Gnatural range 1 to ( 2** 24):= 1
AxiStreamConfigType :=(TSTRB_EN_C => false,TDATA_BYTES_C => 16,TDEST_BITS_C => 4,TID_BITS_C => 0,TKEEP_MODE_C => TKEEP_NORMAL_C,TUSER_BITS_C => 4,TUSER_MODE_C => TUSER_NORMAL_C) AXI_STREAM_CONFIG_INIT_C
out mAxisMasterAxiStreamMasterType
FIFO_ADDR_WIDTH_Gnatural range 4 to 48:= 9
slv( 1 downto 0) := "00" AXI_RESP_OK_C
in axisMasterAxiStreamMasterType
XIL_DEVICE_Gstring := "7SERIES"
out axilWriteSlaveAxiLiteWriteSlaveType
out frameRateMinslv( 31 downto 0)
XIL_DEVICE_Gstring := "7SERIES"
AXI_ERROR_RESP_Gslv( 1 downto 0) := AXI_RESP_SLVERR_C
AxiLiteWriteSlaveType :=(awready => '0',wready => '0',bresp =>( others => '0'),bvalid => '0') AXI_LITE_WRITE_SLAVE_INIT_C
in axilReadMasterAxiLiteReadMasterType
out mAxisMasterAxiStreamMasterType