1 ------------------------------------------------------------------------------- 3 -- Company : SLAC National Accelerator Laboratory 4 -- Created : 2009-05-27 5 -- Last update: 2017-03-28 6 ------------------------------------------------------------------------------- 8 -- AXI-Lite block to manage the PGP interface. 10 -- Address map (offset from base): 12 -- Bits 0 = Count Reset 18 -- Bits 1:0 = Loop Back 20 -- Bits 7:0 = Sideband data to transmit 21 -- Bits 8 = Sideband data enable 23 -- Bits 0 = Auto Status Send Enable (PPI) 25 -- Bits 0 = Disable Flow Control 27 -- Bits 0 = Rx Phy Ready 28 -- Bits 1 = Tx Phy Ready 29 -- Bits 2 = Local Link Ready 30 -- Bits 3 = Remote Link Ready 31 -- Bits 4 = Transmit Ready 32 -- Bits 9:8 = Receive Link Polarity 33 -- Bits 15:12 = Remote Pause Status 34 -- Bits 19:16 = Local Pause Status 35 -- Bits 23:20 = Remote Overflow Status 36 -- Bits 27:24 = Local Overflow Status 38 -- Bits 7:0 = Remote Link Data 40 -- Bits ?:0 = Cell Error Count 42 -- Bits ?:0 = Link Down Count 44 -- Bits ?:0 = Link Error Count 46 -- Bits ?:0 = Remote Overflow VC 0 Count 48 -- Bits ?:0 = Remote Overflow VC 1 Count 50 -- Bits ?:0 = Remote Overflow VC 2 Count 52 -- Bits ?:0 = Remote Overflow VC 3 Count 54 -- Bits ?:0 = Receive Frame Error Count 56 -- Bits ?:0 = Receive Frame Count 58 -- Bits ?:0 = Local Overflow VC 0 Count 60 -- Bits ?:0 = Local Overflow VC 1 Count 62 -- Bits ?:0 = Local Overflow VC 2 Count 64 -- Bits ?:0 = Local Overflow VC 3 Count 66 -- Bits ?:0 = Transmit Frame Error Count 68 -- Bits ?:0 = Transmit Frame Count 70 -- Bits 31:0 = Receive Clock Frequency 72 -- Bits 31:0 = Transmit Clock Frequency 74 -- Bits 7:0 = Last OpCode Transmitted 76 -- Bits 7:0 = Last OpCode Received 78 -- Bits ?:0 = OpCode Transmit count 80 -- Bits ?:0 = OpCode Received count 83 -- Bits 31:24 = Rx Link Down Count 84 -- Bits 23:16 = Rx Frame Error Count 85 -- Bits 15:8 = Rx Cell Error Count 87 -- Bits 5 = Remote Link Ready 88 -- Bits 4 = Local Link Ready 89 -- Bits 3:0 = Remote Overflow Status 90 ------------------------------------------------------------------------------- 91 -- This file is part of 'SLAC Firmware Standard Library'. 92 -- It is subject to the license terms in the LICENSE.txt file found in the 93 -- top-level directory of this distribution and at: 94 -- https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. 95 -- No part of 'SLAC Firmware Standard Library', including this file, 96 -- may be copied, modified, propagated, or distributed except according to 97 -- the terms contained in the LICENSE.txt file. 98 ------------------------------------------------------------------------------- 103 use IEEE.STD_LOGIC_UNSIGNED.
ALL;
110 --! @ingroup protocols_pgp_pgp2b_core 116 WRITE_EN_G : := false;
-- Set to false when on remote end of a link 123 -- TX PGP Interface (pgpTxClk) 128 locTxIn :
in Pgp2bTxInType := PGP2B_TX_IN_INIT_C;
130 -- RX PGP Interface (pgpRxClk) 135 locRxIn :
in Pgp2bRxInType := PGP2B_RX_IN_INIT_C;
137 -- Status Bus (axilClk domain) 141 -- AXI-Lite Register Interface (axilClk domain) 181 locData : slv(
7 downto 0);
194 locData => (others=>'0'),
230 locOverflow : slv(
3 downto 0);
231 locOverflow0Cnt : slv(ERROR_CNT_WIDTH_G-1
downto 0);
232 locOverflow1Cnt : slv(ERROR_CNT_WIDTH_G-1
downto 0);
233 locOverflow2Cnt : slv(ERROR_CNT_WIDTH_G-1
downto 0);
234 locOverflow3Cnt : slv(ERROR_CNT_WIDTH_G-1
downto 0);
235 locPause : slv(
3 downto 0);
248 --------------------------------------- 250 --------------------------------------- 266 wr_en => pgpRxOut.opCodeEn,
267 din => pgpRxOut.opCode,
271 dout => rxStatusSync.rxOpCodeLast
290 din => pgpRxOut.remLinkData,
294 dout => rxStatusSync.remLinkData
302 -- Errror counters and non counted values 317 statusIn
(0) => pgpRxOut.phyRxReady,
318 statusIn
(1) => pgpRxOut.linkReady,
319 statusIn
(3 downto 2) => pgpRxOut.linkPolarity,
320 statusIn
(4) => pgpRxOut.remLinkReady,
321 statusIn
(8 downto 5) => pgpRxOut.remOverflow,
322 statusIn
(12 downto 9) => pgpRxOut.remPause,
323 statusIn
(13) => pgpRxOut.cellError,
324 statusIn
(14) => pgpRxOut.linkDown,
325 statusIn
(15) => pgpRxOut.linkError,
326 statusIn
(16) => pgpRxOut.frameRxErr,
327 statusIn
(17) => pgpRxOut.opCodeEn,
387 statusIn
(0) => pgpRxOut.frameRx,
412 freqOut => rxStatusSync.rxClkFreq,
423 --------------------------------------- 425 --------------------------------------- 441 wr_en => locTxIn.opCodeEn,
442 din => locTxIn.opCode,
446 dout => txStatusSync.txOpCodeLast
449 -- Errror counters and non counted values 464 statusIn
(0) => pgpTxOut.phyTxReady,
465 statusIn
(1) => pgpTxOut.linkReady,
466 statusIn
(5 downto 2) => pgpTxOut.locOverflow,
467 statusIn
(9 downto 6) => pgpTxOut.locPause,
468 statusIn
(10) => pgpTxOut.frameTxErr,
469 statusIn
(11) => locTxIn.opCodeEn,
485 txStatusSync.locOverFlow <= txErrorOut(5 downto 2);
511 statusIn
(0) => pgpTxOut.frameTx,
536 freqOut => txStatusSync.txClkFreq,
546 ------------------------------------- 548 ------------------------------------- 566 din
(8) => r.locDataEn,
567 din
(7 downto 0) => r.locData,
576 -- Sync flow cntl disable 594 locTxDataEn <= r.locDataEn;
595 locTxData <= r.locData;
599 U_TxFlushSync:
entity work.
RstSync 619 ------------------------------------- 621 ------------------------------------- 624 U_RxFlushSync:
entity work.
RstSync 637 U_ResetRxSync:
entity work.
RstSync 655 ------------------------------------ 657 ------------------------------------ 679 -- Decode address and perform write 707 -- Decode address and assign read data 792 -- Next register assignment 802 --------------------------------------- 804 --------------------------------------- 807 U_StatusWord :
process ( rxStatusSync )
begin 820 end architecture structure;
out axilWriteSlaveAxiLiteWriteSlaveType
slv( ERROR_CNT_WIDTH_G- 1 downto 0) locOverflow0Cnt
AxiLiteWriteSlaveType axilWriteSlave
slv( 7 downto 0) locTxData
slv( 17 downto 0) rxErrorIrqEn
in locTxInPgp2bTxInType := PGP2B_TX_IN_INIT_C
slv( 31 downto 0) txClkFreq
USE_DSP48_Gstring := "no"
ERROR_CNT_WIDTH_Gnatural range 1 to 32:= 4
AxiLiteReadSlaveType axilReadSlave
in pgpRxOutPgp2bRxOutType
SlVectorArray ( 11 downto 0, ERROR_CNT_WIDTH_G- 1 downto 0) txErrorCntOut
in rstsl :=not RST_POLARITY_G
out axilReadSlaveAxiLiteReadSlaveType
in dinslv( DATA_WIDTH_G- 1 downto 0)
slv( 3 downto 0) locPause
REF_CLK_FREQ_Greal := 200.0E+6
slv( 7 downto 0) remLinkData
COMMON_RX_CLK_Gboolean := false
ADDR_WIDTH_Ginteger range 2 to 48:= 4
array(natural range <> ,natural range <> ) of sl SlVectorArray
slv( ERROR_CNT_WIDTH_G- 1 downto 0) cellErrorCount
slv( 3 downto 0) locOverflow
in locRxInPgp2bRxInType := PGP2B_RX_IN_INIT_C
slv( 2 downto 0) loopBack
slv( ERROR_CNT_WIDTH_G- 1 downto 0) locOverflow2Cnt
slv( 17 downto 0) rxErrorOut
BRAM_EN_Gboolean := false
slv( STATUS_CNT_WIDTH_G- 1 downto 0) frameCount
COMMON_CLK_Gboolean := false
in axilReadMasterAxiLiteReadMasterType
slv( ERROR_CNT_WIDTH_G- 1 downto 0) frameErrCount
out cntOutSlVectorArray ( WIDTH_G- 1 downto 0, CNT_WIDTH_G- 1 downto 0)
CNT_WIDTH_Gpositive := 32
USE_DSP48_Gstring := "no"
out doutslv( DATA_WIDTH_G- 1 downto 0)
AxiLiteStatusType axiStatus
slv( ERROR_CNT_WIDTH_G- 1 downto 0) locOverflow3Cnt
slv( 7 downto 0) rxOpCodeLast
slv( ERROR_CNT_WIDTH_G- 1 downto 0) linkErrorCount
AXI_ERROR_RESP_Gslv( 1 downto 0) := AXI_RESP_DECERR_C
RELEASE_DELAY_Gpositive := 3
CNT_WIDTH_Gpositive := 32
ALTERA_RAM_Gstring := "M9K"
slv( ERROR_CNT_WIDTH_G- 1 downto 0) locOverflow1Cnt
RELEASE_DELAY_Ginteger range 3 to positive'high:= 3
slv( 1 downto 0) := "11" AXI_RESP_DECERR_C
SlVectorArray ( 0 downto 0, STATUS_CNT_WIDTH_G- 1 downto 0) txStatusCntOut
out freqOutslv( CNT_WIDTH_G- 1 downto 0)
SlVectorArray ( 17 downto 0, ERROR_CNT_WIDTH_G- 1 downto 0) rxErrorCntOut
RegType :=(flush => '0',resetRx => '0',countReset => '0',loopBack =>( others => '0'),flowCntlDis => '0',autoStatus => '0',locData =>( others => '0'),locDataEn => '0',axilWriteSlave => AXI_LITE_WRITE_SLAVE_INIT_C,axilReadSlave => AXI_LITE_READ_SLAVE_INIT_C) REG_INIT_C
in rollOverEnInslv( WIDTH_G- 1 downto 0) :=( others => '0')
in irqEnInslv( WIDTH_G- 1 downto 0) :=( others => '0')
TxStatusType txstatusSync
ALTERA_SYN_Gboolean := false
in pgpTxOutPgp2bTxOutType
slv( ERROR_CNT_WIDTH_G- 1 downto 0) linkDownCount
slv( ERROR_CNT_WIDTH_G- 1 downto 0) remOverflow3Cnt
REFRESH_RATE_Greal := 1.0E+3
AxiLiteReadSlaveType :=(arready => '0',rdata =>( others => '0'),rresp =>( others => '0'),rvalid => '0') AXI_LITE_READ_SLAVE_INIT_C
SYNC_STAGES_Ginteger range 3 to ( 2** 24):= 3
slv( 3 downto 0) remPause
RxStatusType rxstatusSync
slv( 11 downto 0) txErrorOut
CNT_RST_EDGE_Gboolean := true
WRITE_EN_Gboolean := false
SlVectorArray ( 0 downto 0, STATUS_CNT_WIDTH_G- 1 downto 0) rxStatusCntOut
RST_ASYNC_Gboolean := false
slv( 31 downto 0) rxClkFreq
slv( 1 downto 0) linkPolarity
slv( 3 downto 0) remOverflow
COMMON_TX_CLK_Gboolean := false
slv( ERROR_CNT_WIDTH_G- 1 downto 0) remOverflow0Cnt
AXI_CLK_FREQ_Greal := 125.0E+6
slv( 2 downto 0) loopback
STATUS_CNT_WIDTH_Gnatural range 1 to 32:= 32
slv( ERROR_CNT_WIDTH_G- 1 downto 0) rxOpCodeCount
out statusOutslv( WIDTH_G- 1 downto 0)
out statusWordslv( 63 downto 0)
AxiLiteWriteSlaveType :=(awready => '0',wready => '0',bresp =>( others => '0'),bvalid => '0') AXI_LITE_WRITE_SLAVE_INIT_C
integer := ite( STATUS_CNT_WIDTH_G> 7, 7, STATUS_CNT_WIDTH_G- 1) STATUS_OUT_TOP_C
slv( 7 downto 0) txOpCodeLast
CLK_LOWER_LIMIT_Greal := 159.0E+6
in axilWriteMasterAxiLiteWriteMasterType
DATA_WIDTH_Ginteger range 1 to ( 2** 24):= 16
slv( ERROR_CNT_WIDTH_G- 1 downto 0) remOverflow2Cnt
CLK_UPPER_LIMIT_Greal := 161.0E+6
slv( ERROR_CNT_WIDTH_G- 1 downto 0) remOverflow1Cnt
slv( ERROR_CNT_WIDTH_G- 1 downto 0) txOpCodeCount