1 ------------------------------------------------------------------------------- 2 -- File : Jesd204bTx.vhd 3 -- Company : SLAC National Accelerator Laboratory 4 -- Created : 2015-04-14 5 ------------------------------------------------------------------------------- 6 -- Description: JESD204b multi-lane transmitter module 7 -- Transmitter JESD204b module. 8 -- Supports a subset of features from JESD204b standard. 9 -- Supports sub-class 1 deterministic latency. 10 -- Supports sub-class 0 non deterministic latency. 12 -- - Synchronization of LMFC to SYSREF 13 -- - Multi-lane operation (L_G: 1-32) 15 -- Warning: Scrambling support has not been tested on the TX module yet. 17 -- Note: extSampleDataArray_i should be little endian and not byte swapped 18 -- First sample in time: sampleData_i(15 downto 0) 19 -- Second sample in time: sampleData_i(31 downto 16) 20 ------------------------------------------------------------------------------- 21 -- This file is part of 'SLAC Firmware Standard Library'. 22 -- It is subject to the license terms in the LICENSE.txt file found in the 23 -- top-level directory of this distribution and at: 24 -- https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. 25 -- No part of 'SLAC Firmware Standard Library', including this file, 26 -- may be copied, modified, propagated, or distributed except according to 27 -- the terms contained in the LICENSE.txt file. 28 ------------------------------------------------------------------------------- 31 use ieee.std_logic_1164.
all;
32 use ieee.std_logic_arith.
all;
33 use ieee.std_logic_unsigned.
all;
43 --! @ingroup protocols_jesd204b 48 -- Register sample data at input and/or output 51 -- Number of bytes in a frame 53 -- Number of frames in a multi frame 55 -- Number of TX lanes (1 to 32) 56 L_G : positive range 1 to 32 := 2);
63 -- AXI-Lite Register Interface 69 -- Legacy Interface that we will remove in the future 78 -- SYSREF for subclass 1 fixed latency 81 -- Synchronization input combined from all receivers 84 -- External sample data input 87 -- GT is ready to transmit data after reset 91 -- Data and character inputs from GT (transceivers) 94 -- TX Configurable Driver Ports 112 -- Local Multi Frame Clock 115 -- Control and status from AxiLite 116 ------------------------------------------------------------ 118 signal s_enableTx : slv(L_G-1 downto 0);
119 signal s_replEnable : sl;
120 signal s_scrEnable : sl;
122 signal s_dataValid : slv(L_G-1 downto 0);
123 signal s_invertData : slv(L_G-1 downto 0);
125 -- JESD subclass selection (from AXI lite register) 126 signal s_subClass : sl;
127 -- User reset (from AXI lite register) 128 signal s_gtReset : sl;
129 signal s_clearErr : sl;
131 -- Test signal control 134 signal s_enableTestSig : sl;
136 signal s_posAmplitude : slv(F_G*8-1 downto 0);
137 signal s_negAmplitude : slv(F_G*8-1 downto 0);
139 -- Data out multiplexer 148 -- Sysref conditioning 149 signal s_sysrefSync : sl;
150 signal s_sysrefRe : sl;
151 signal s_sysrefD : sl;
155 signal s_invertSync : sl;
156 signal s_nSyncSync : sl;
160 signal s_testEn : slv(L_G-1 downto 0);
165 -- Legacy Interface that we will remove in the future 168 ---------------------- 169 -- Input data register 170 ---------------------- 172 GEN_LANE : for I in L_G-1 downto 0 generate 179 end generate GEN_LANE;
180 end generate GEN_REG_I;
184 end generate GEN_N_REG_I;
186 GEN_VALID : for I in L_G-1 downto 0 generate 187 s_dataValid(I) <= s_statusTxArr(I)(1);
188 end generate GEN_VALID;
193 --------------------- 194 -- AXI-Lite registers 195 --------------------- 229 -- TX Configurable Driver Ports 236 GEN_TEST : for I in L_G-1 downto 0 generate 238 -- Check the test pattern enable bit 239 s_testEn(I) <= s_dataValid(I) and s_enableTestSig;
253 type_i => s_sigTypeArr
(I
),
257 end generate GEN_TEST;
260 GEN_MUX : for I in L_G-1 downto 0 generate 262 -- Swap endian (the module is built to use big endian data but the interface is little endian) 263 s_extDataArraySwap(I) <= endianSwapSlv(s_regSampleDataIn(I), GT_WORD_SIZE_C);
265 -- Separate mux for separate lane 269 if (s_muxOutSelArr(I) = "000") then 271 elsif (s_muxOutSelArr(I) = "001") then 272 s_sampleDataArr(I) <= s_extDataArraySwap(I) after TPD_G;
273 elsif (s_muxOutSelArr(I) = "010") then 274 s_sampleDataArr(I) <= (others => '1') after TPD_G;
276 s_sampleDataArr(I) <= s_testDataArr(I) after TPD_G;
281 end generate GEN_MUX;
283 ----------------------------------------------------------- 284 -- SYSREF, SYNC, and LMFC 285 ----------------------------------------------------------- 287 -- Synchronize SYSREF input to devClk_i 303 -- Invert/or not nSync signal (control from axil) 306 -- Synchronize nSync input to devClk_i 322 -- Delay SYSREF input (for 1 to 32 c-c) 330 dly_i => s_sysrefDlyTx,
335 -- LMFC period generator aligned to SYSREF input 346 sysrefRe_o => s_sysrefRe,
-- Rising-edge of SYSREF OUT 349 ---------------------------- 350 -- Transmitter modules (L_G) 351 ---------------------------- 352 GEN_TX : for I in L_G-1 downto 0 generate 353 -- JESD Transmitter modules (one module per Lane) 363 enable_i => s_enableTx
(I
),
-- From AXI lite 366 inv_i => s_invertData
(I
),
-- From AXI lite 371 status_o => s_statusTxArr
(I
),
-- To AXI lite 380 GEN_LANE : for I in L_G-1 downto 0 generate 388 end generate GEN_LANE;
389 end generate GEN_REG_O;
393 end generate GEN_N_REG_O;
397 leds_o <= uOr(s_dataValid) & s_nSyncSync;
INPUT_REG_Gboolean := false
out loopbackslv( L_G- 1 downto 0)
array(natural range <> ) of slv(( GT_WORD_SIZE_C* 8)- 1 downto 0) sampleDataArray
array(natural range <> ) of AxiStreamSlaveType AxiStreamSlaveArray
out negAmplitude_oslv( F_G* 8- 1 downto 0)
array(natural range <> ) of slv( 2 downto 0) Slv3Array
in axilReadMasterAxiLiteReadMasterType
out txPreCursorSlv8Array( L_G- 1 downto 0)
positive := 16 PER_STEP_WIDTH_C
in rstsl :=not RST_POLARITY_G
array(natural range <> ) of slv(( TX_STAT_WIDTH_C)- 1 downto 0) txStatuRegisterArray
out txPreCursorSlv8Array( L_G- 1 downto 0)
AxiStreamMasterType :=(tValid => '0',tData =>( others => '0'),tStrb =>( others => '1'),tKeep =>( others => '1'),tLast => '0',tDest =>( others => '0'),tId =>( others => '0'),tUser =>( others => '0')) AXI_STREAM_MASTER_INIT_C
out loopbackslv( L_G- 1 downto 0)
BYPASS_SYNC_Gboolean := false
out axilWriteSlaveAxiLiteWriteSlaveType
in squarePeriod_islv( PER_STEP_WIDTH_C- 1 downto 0)
out sampleData_oslv( GT_WORD_SIZE_C* 8- 1 downto 0)
slv( GT_WORD_SIZE_C- 1 downto 0) dataK
in negAmplitude_islv( F_G* 8- 1 downto 0)
L_Gpositive range 1 to 32:= 2
out txEnableLslv( L_G- 1 downto 0)
out r_jesdGtTxArrjesdGtTxLaneTypeArray( L_G- 1 downto 0)
out sigTypeArr_oSlv2Array( L_G- 1 downto 0)
out gtTxReset_oslv( L_G- 1 downto 0)
out pulse_oslv( L_G- 1 downto 0)
out squarePeriod_oslv( PER_STEP_WIDTH_C- 1 downto 0)
in dly_islv( DLY_WIDTH_G- 1 downto 0)
array(natural range <> ) of jesdGtTxLaneType jesdGtTxLaneTypeArray
out axilReadSlaveAxiLiteReadSlaveType
out txPostCursorSlv8Array( L_G- 1 downto 0)
slv( 1 downto 0) := "10" AXI_RESP_SLVERR_C
out sysrefDlyTx_oslv( SYSRF_DLY_WIDTH_C- 1 downto 0)
in axilWriteMasterAxiLiteWriteMasterType := AXI_LITE_WRITE_MASTER_INIT_C
out status_oslv( TX_STAT_WIDTH_C- 1 downto 0)
L_Gpositive range 1 to 16:= 2
in type_islv( 1 downto 0)
out txPolarityslv( L_G- 1 downto 0)
in extSampleDataArray_isampleDataArray( L_G- 1 downto 0)
positive := 4 GT_WORD_SIZE_C
in txAxisMasterArr_iAxiStreamMasterArray( L_G- 1 downto 0) :=( others => AXI_STREAM_MASTER_INIT_C)
in axilReadMasterAxiLiteReadMasterType := AXI_LITE_READ_MASTER_INIT_C
in statusTxArr_itxStatuRegisterArray( L_G- 1 downto 0)
AXI_ERROR_RESP_Gslv( 1 downto 0) := AXI_RESP_SLVERR_C
array(natural range <> ) of AxiStreamMasterType AxiStreamMasterArray
out txDiffCtrlSlv8Array( L_G- 1 downto 0)
out invertData_oslv( L_G- 1 downto 0)
out txDiffCtrlSlv8Array( L_G- 1 downto 0)
in sampleData_islv(( GT_WORD_SIZE_C* 8)- 1 downto 0)
positive := 5 SYSRF_DLY_WIDTH_C
out txPolarityslv( L_G- 1 downto 0)
out txPostCursorSlv8Array( L_G- 1 downto 0)
AXI_ERROR_RESP_Gslv( 1 downto 0) := AXI_RESP_SLVERR_C
out r_jesdGtTxjesdGtTxLaneType
in axilWriteMasterAxiLiteWriteMasterType
in posAmplitude_islv( F_G* 8- 1 downto 0)
out txEnableslv( L_G- 1 downto 0)
out leds_oslv( 1 downto 0)
AxiStreamSlaveType :=(tReady => '1') AXI_STREAM_SLAVE_FORCE_C
RST_ASYNC_Gboolean := false
in gtTxReady_islv( L_G- 1 downto 0)
out axilWriteSlaveAxiLiteWriteSlaveType
in rampStep_islv( PER_STEP_WIDTH_C- 1 downto 0)
array(natural range <> ) of slv( 7 downto 0) Slv8Array
out posAmplitude_oslv( F_G* 8- 1 downto 0)
out txAxisSlaveArr_oAxiStreamSlaveArray( L_G- 1 downto 0)
out muxOutSelArr_oSlv3Array( L_G- 1 downto 0)
out rampStep_oslv( PER_STEP_WIDTH_C- 1 downto 0)
out axilReadSlaveAxiLiteReadSlaveType
OUTPUT_REG_Gboolean := false
array(natural range <> ) of slv( 1 downto 0) Slv2Array
out enableTx_oslv( L_G- 1 downto 0)