1 ------------------------------------------------------------------------------- 2 -- File : Pgp2bRxCell.vhd 3 -- Company : SLAC National Accelerator Laboratory 4 -- Created : 2009-05-27 5 -- Last update: 2017-03-28 6 ------------------------------------------------------------------------------- 8 -- Cell Receive interface module for the Pretty Good Protocol core. 9 ------------------------------------------------------------------------------- 10 -- This file is part of 'SLAC Firmware Standard Library'. 11 -- It is subject to the license terms in the LICENSE.txt file found in the 12 -- top-level directory of this distribution and at: 13 -- https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. 14 -- No part of 'SLAC Firmware Standard Library', including this file, 15 -- may be copied, modified, propagated, or distributed except according to 16 -- the terms contained in the LICENSE.txt file. 17 ------------------------------------------------------------------------------- 20 use ieee.std_logic_1164.
all;
21 use ieee.std_logic_arith.
all;
22 use ieee.std_logic_unsigned.
all;
27 --! @ingroup protocols_pgp_pgp2b_core 37 -- System clock, reset & control 48 -- Cell Error, one pulse per error 51 -- Interface to PHY Logic 60 -- Common Frame Receive Interface For All VCs 66 -- Frame Receive Interface, VC 0 71 -- Frame Receive Interface, VC 1 76 -- Frame Receive Interface, VC 2 81 -- Frame Receive Interface, VC 3 86 -- Receive CRC Interface 90 crcRxOut : in slv(31 downto 0) -- Receive calculated CRC value 96 -- Define architecture 185 -- Delay stages to line up data with CRC calculation 239 -- Shift when not paused 306 -- CRC Enable & partial flag 319 -- CRC Data Output, SOC field overwritten with zeros 323 crcRxIn(i*16+7 downto i*16) <= (others=>'0');
332 -- Output to CRC engine 337 -- Choose tap positions in delay chain 339 -- Serial number compare position, detSOC - 1 343 -- SOC detect position, 348 -- EOC detect position, depends on lane count 349 -- detSOC - 4 when 1 lane, detSOC - 3 when multiple lanes 355 -- Detect current VC, check cell serial number 370 -- Link is down, init counts 392 -- Compare current count, store current count for future increment 451 -- Receive cell tracking 471 -- Cell error edge generation 489 -- Count size of each cell received 498 -- Link is down. Terminate transmission for any active VCs 501 -- Enabled every 4 clocks to ensure proper spacing between generated EOFs 518 -- Clear cell control signals 544 -- Do we output data and mark in frame? 546 -- Yes if already in frame 552 -- Do we mark output as SOF? 553 -- Yes if SOF is seen and we are not already in frame 558 -- Do we mark serial error flag? 559 -- Yes if SOF is set and we are already in frame 560 -- Yes if serial number error and we are in frame 565 -- Mark out of cell after EOC 571 -- Clear frame state if EOF 581 -- End of cell, check for short cell case 597 -- Cell might be too long 616 -- Do we output data and mark in frame? 618 -- Yes if already in frame 635 -- Data abort is enabled 665 -- Pipeline is enabled 708 -- Update buffer status on successfull cell reception 721 -- Link is not ready, force buffer states to bad 732 -- Update buffer status
slv( 5 downto 0) vc0Serial
slv( 5 downto 0) vc1Serial
slv( RX_LANE_CNT_G* 16- 1 downto 0) dly1Data
EN_SHORT_CELLS_Ginteger := 1
slv( RX_LANE_CNT_G* 16- 1 downto 0) dly0Data
slv( RX_LANE_CNT_G* 16- 1 downto 0) compData
PAYLOAD_CNT_TOP_Ginteger := 7
slv( 3 downto 0) vcInFrame
slv( 5 downto 0) vc2Serial
in cellRxDataslv( RX_LANE_CNT_G* 16- 1 downto 0)
slv( RX_LANE_CNT_G* 16- 1 downto 0) outData
slv( RX_LANE_CNT_G* 16- 1 downto 0) dly2Data
slv( RX_LANE_CNT_G* 16- 1 downto 0) dly7Data
out vcFrameRxDataslv( RX_LANE_CNT_G* 16- 1 downto 0)
out crcRxInslv( RX_LANE_CNT_G* 16- 1 downto 0)
slv( RX_LANE_CNT_G* 16- 1 downto 0) dly3Data
slv( RX_LANE_CNT_G* 16- 1 downto 0) dly6Data
RX_LANE_CNT_Ginteger range 1 to 2:= 1
slv( RX_LANE_CNT_G* 16- 1 downto 0) dly5Data
slv( 4 downto 0) linkDownCnt
slv( RX_LANE_CNT_G* 16- 1 downto 0) dly4Data
in crcRxOutslv( 31 downto 0)
slv( 5 downto 0) vc3Serial
slv( PAYLOAD_CNT_TOP_G downto 0) inCellCnt