1 ------------------------------------------------------------------------------- 2 -- File : StreamPatternTester.vhd 3 -- Company : SLAC National Accelerator Laboratory 4 -- Created : 05/27/2016 5 -- Last update: 05/27/2016 6 ------------------------------------------------------------------------------- 7 -- Description: Test which compares the data stream to selected pattern 8 -- Designed for the automated delay alignment of the fast LVDS lines 9 -- of ADCs with single or multiple serial data lanes 10 ------------------------------------------------------------------------------- 11 -- This file is part of 'SLAC Firmware Standard Library'. 12 -- It is subject to the license terms in the LICENSE.txt file found in the 13 -- top-level directory of this distribution and at: 14 -- https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. 15 -- No part of 'SLAC Firmware Standard Library', including this file, 16 -- may be copied, modified, propagated, or distributed except according to 17 -- the terms contained in the LICENSE.txt file. 18 ------------------------------------------------------------------------------- 22 use ieee.std_logic_1164.
all;
30 --! @ingroup devices_AnalogDevices_ad9249 37 -- Master system clock 41 -- ADC data stream inputs 50 end StreamPatternTester;
53 -- Define architecture 56 ------------------------------------------------------------------------------------------------- 58 ------------------------------------------------------------------------------------------------- 95 ------------------------------------------------------------------------------------------------- 97 ------------------------------------------------------------------------------------------------- 106 axiSlaveRegister (axilEp, X"00" & "00", 0, v.testChannel);
107 axiSlaveRegister (axilEp, X"01" & "00", 0, v.testDataMask);
108 axiSlaveRegister (axilEp, X"02" & "00", 0, v.testPattern);
109 axiSlaveRegister (axilEp, X"03" & "00", 0, v.testSamples);
110 axiSlaveRegister (axilEp, X"04" & "00", 0, v.testTimeout);
111 axiSlaveRegister (axilEp, X"05" & "00", 0, v.testRequest);
112 axiSlaveRegisterR(axilEp, X"06" & "00", 0, testPassed);
113 axiSlaveRegisterR(axilEp, X"07" & "00", 0, testFailed);
127 axilSeq :
process (
clk)
is 129 if (rising_edge(clk)) then 134 ------------------------------------------------------------------------------------------------- 136 ------------------------------------------------------------------------------------------------- 140 maskGen: for i in 0 to 31 generate 142 end generate maskGen;
149 -- test samples counter 150 if rising_edge(clk) then 158 -- comparison passed counter 159 if rising_edge(clk) then 168 if rising_edge(clk) then AxiLiteReadSlaveType axilReadSlave
slv( 31 downto 0) testSamples
out axilReadSlaveAxiLiteReadSlaveType
std_logic_vector( 31 downto 0) dataMux
unsigned( 31 downto 0) timeoutCnt
in axilWriteMasterAxiLiteWriteMasterType
out axilWriteSlaveAxiLiteWriteSlaveType
NUM_CHANNELS_Ginteger range 1 to 31:= 8
slv( 31 downto 0) testPattern
slv( 1 downto 0) := "11" AXI_RESP_DECERR_C
in adcStreamsAxiStreamMasterArray( NUM_CHANNELS_G- 1 downto 0)
slv( 31 downto 0) testDataMask
AxiLiteReadSlaveType :=(arready => '0',rdata =>( others => '0'),rresp =>( others => '0'),rvalid => '0') AXI_LITE_READ_SLAVE_INIT_C
array(natural range <> ) of AxiStreamMasterType AxiStreamMasterArray
AxilRegType :=(axilWriteSlave => AXI_LITE_WRITE_SLAVE_INIT_C,axilReadSlave => AXI_LITE_READ_SLAVE_INIT_C,testChannel =>( others => '0'),testPattern =>( others => '0'),testDataMask =>( others => '0'),testSamples =>( others => '0'),testTimeout =>( others => '0'),testRequest => '0') AXIL_REG_INIT_C
slv( 31 downto 0) testChannel
slv( 31 downto 0) testTimeout
AxiLiteWriteSlaveType axilWriteSlave
unsigned( 31 downto 0) passCnt
AxiLiteWriteSlaveType :=(awready => '0',wready => '0',bresp =>( others => '0'),bvalid => '0') AXI_LITE_WRITE_SLAVE_INIT_C
in axilReadMasterAxiLiteReadMasterType
AxilRegType := AXIL_REG_INIT_C axilR
unsigned( 31 downto 0) testCnt