Entity: RssiRxFsm
- File: RssiRxFsm.vhd
Diagram
Description
Title : RSSI Protocol: https://confluence.slac.stanford.edu/x/1IyfD -----------------------------------------------------------------------------s
Company : SLAC National Accelerator Laboratory
Description: Receiver FSM Receiver has the following functionality: Transport side FSM. Receive check and save segments to RX buffer. - WAIT_SOF Waits for Transport side SOF, - CHECK Determines the segment type and checks: ACK, NULL, DATA, or RST segment 1. Validates checksum (when valid), 2. Header length (number of bytes), 3. Sequence number (Only current seqN or lastSeqN+1 allowed) 4. Acknowledgment number (Valid range is lastAckN to lastAckN + txWindowSize) - CHECK_SYN Toggles through SYN header addresses and saves the RSSI parameters Checks the following: 1. Validates checksum (when valid), 2. Validates Ack number if the ack is sent with the SYN segment - DATA Receives the payload part of the DATA segment - VALID Checks if next valid SEQn is received. If yes: 1. increment the in order SEQn 2. save seqN, type, and occupied to the window buffer at current rxBufferAddr 3. increment rxBufferAddr - DROP Just report dropped packet and got back to WAIT_SOF Receiver side FSM. Send data to App side. - CHECK_BUFFER and DATA Send the data frame to the Application when the data at the next txSegmentAddr is ready. - SENT Release the windowbuffer at txBufferAddr. Increment txBufferAddr.
Register the received SeqN for acknowledgment.
This file is part of 'SLAC Firmware Standard Library'. It is subject to the license terms in the LICENSE.txt file found in the top-level directory of this distribution and at: https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. No part of 'SLAC Firmware Standard Library', including this file, may be copied, modified, propagated, or distributed except according to
the terms contained in the LICENSE.txt file.
Generics
Generic name | Type | Value | Description |
---|---|---|---|
TPD_G | time | 1 ns | |
WINDOW_ADDR_SIZE_G | positive | 7 | 2^WINDOW_ADDR_SIZE_G = Number of segments |
HEADER_CHKSUM_EN_G | boolean | true | |
SEGMENT_ADDR_SIZE_G | positive | 3 | 2^SEGMENT_ADDR_SIZE_G = Number of 64 bit wide data words |
Ports
Port name | Direction | Type | Description |
---|---|---|---|
clk_i | in | sl | |
rst_i | in | sl | |
rxBuffBusy_o | out | sl | RX Buffer Full |
connActive_i | in | sl | Connection FSM indicating active connection |
rxWindowSize_i | in | integer range 1 to 2 ** (WINDOW_ADDR_SIZE_G) | Window size different for Rx and Tx |
rxBufferSize_i | in | integer range 1 to 2 ** (SEGMENT_ADDR_SIZE_G) | |
txWindowSize_i | in | integer range 1 to 2 ** (WINDOW_ADDR_SIZE_G) | |
lastAckN_i | in | slv(7 downto 0) | Last acknowledged Sequence number connected to TX module |
rxSeqN_o | out | slv(7 downto 0) | Current received seqN |
rxAckN_o | out | slv(7 downto 0) | Current received ackN |
rxLastSeqN_o | out | slv(7 downto 0) | Last seqN received and sent to application (this is the ackN transmitted) |
rxValidSeg_o | out | sl | Valid Segment received (1 c-c) |
rxDropSeg_o | out | sl | Segment dropped (1 c-c) |
rxFlags_o | out | flagsType | Last segment received flags (active until next segment is received) |
rxParam_o | out | RssiParamType | Parameters received from peer SYN packet |
chksumValid_i | in | sl | Checksum control |
chksumOk_i | in | sl | |
chksumEnable_o | out | sl | |
chksumStrobe_o | out | sl | |
chksumLength_o | out | positive | |
wrBuffWe_o | out | sl | Buffer write |
wrBuffAddr_o | out | slv( (SEGMENT_ADDR_SIZE_G+WINDOW_ADDR_SIZE_G)-1 downto 0) | |
wrBuffData_o | out | slv(RSSI_WORD_WIDTH_C*8-1 downto 0) | |
rdBuffAddr_o | out | slv( (SEGMENT_ADDR_SIZE_G+WINDOW_ADDR_SIZE_G)-1 downto 0) | Buffer read |
rdBuffData_i | in | slv(RSSI_WORD_WIDTH_C*8-1 downto 0) | |
tspSsiMaster_i | in | SsiMasterType | SSI Transport side interface IN |
tspSsiSlave_o | out | SsiSlaveType | |
appSsiMaster_o | out | SsiMasterType | SSI Application side interface OUT |
appSsiSlave_i | in | SsiSlaveType |
Signals
Name | Type | Description |
---|---|---|
r | RegType | |
rin | RegType | |
s_chksumOk | sl |
Constants
Name | Type | Value | Description |
---|---|---|---|
SSI_MASTER_INIT_C | SsiMasterType | axis2SsiMaster(RSSI_AXIS_CONFIG_C, AXI_STREAM_MASTER_INIT_C) |
|
SSI_SLAVE_NOTRDY_C | SsiSlaveType | axis2SsiSlave(RSSI_AXIS_CONFIG_C, AXI_STREAM_SLAVE_INIT_C, AXI_STREAM_CTRL_UNUSED_C) |
|
SSI_SLAVE_RDY_C | SsiSlaveType | axis2SsiSlave(RSSI_AXIS_CONFIG_C, AXI_STREAM_SLAVE_FORCE_C, AXI_STREAM_CTRL_UNUSED_C) |
|
REG_INIT_C | RegType | ( -- Rx buffer window windowArray => (0 to 2 ** WINDOW_ADDR_SIZE_G-1 => WINDOW_INIT_C), pending => (others => '0'), -- Transport side FSM (Receive and check segments) ----------------------------------------------------------- inorderSeqN => (others => '0'), -- Next expected seqN rxHeaderAddr => (others => '0'), rxSegmentAddr => (others => '0'), rxBufferAddr => (others => '0'), -- segmentWe => '0', -- Packet flags rxF => (others => ('0')), -- Received RSSI parameters rxParam => RSSI_PARAM_INIT_C, rxHeadLen => (others => '0'), -- Received seqN rxSeqN => (others => '0'), -- Received seqN rxAckN => (others => '0'), -- Received ackN -- chkEn => '0', chkStb => '0', chkLen => 1, -- segValid => '0', segDrop => '0', -- headerData => (others => '0'), -- SSI tspSsiMaster => SSI_MASTER_INIT_C, tspSsiSlave => SSI_SLAVE_NOTRDY_C, -- Transport side state tspState => WAIT_SOF_S, -- Application side FSM (Send segments when received next in odrer received) ----------------------------------------------------------- txBufferAddr => (others => '0'), txSegmentAddr => (others => '0'), rxLastSeqN => (others => '0'), -- SSI appSsiMaster => SSI_MASTER_INIT_C, appSsiSlave => SSI_SLAVE_NOTRDY_C, -- Application side state appState => CHECK_BUFFER_S ) |
Types
Name | Type | Description |
---|---|---|
tspStateType | ( WAIT_SOF_S, CHECK_S, SYN_CHECK_S, VALID_S, DROP_S, DATA_S ) |
|
AppStateType | ( CHECK_BUFFER_S, DATA_S, SENT_S ) |
|
RegType |
Processes
- comb: ( r, rst_i, chksumValid_i, s_chksumOk, rxWindowSize_i, lastAckN_i, rxBufferSize_i,
txWindowSize_i, tspSsiMaster_i, connActive_i, rdBuffData_i, appSsiSlave_i )
Description
- seq: ( clk_i )