WR Streamers provide the user with a FIFO-like interface over Ethernet (See figure below). WR Streamers comprises VHDL modules to ensure data communication as well statistics on transceiver performance.
Wr Streamers come included as of Release 4 of the
WRPC, instantiated inside the xwrc_board_common.vhd
module. They can be enabled by setting the @ g_fabric_iface@ generic
to
STREAMERS
.
Streamers principles of data transfer
-
Tx Streamer transfers data words that are of width (n * 16)
bits. The width is defined by generic
data_width
(ing_tx_streamer_params
andg_rx_streamer_params
) that must be identical for the Tx and Rx Streamer. -
Data words can be grouped in blocks of any size with upper
limit defined by
max_words_per_frame
(ing_tx_streamer_params
) , each block has independent sequence number and CRC. - A stream of data words arranged in one or more blocks is encapsulated into an Ethernet Frame. At transmission, the frame is timestamped and the timestamp included in the frame.
- Ethernet Frame is sent when one of the following is true:
- A complete block was written to the buffer of the Tx
Streamer, and the number of data words waiting for
transmission exceeds the number defined by generic
g_tx_threshold
(ing_tx_streamer_params
), - There are data words in the buffer of the Tx Streamer, and
the time elapsed from the latest write to Tx Streamer exceeded
timeout defined by generic
timeout
(ing_tx_streamer_params
), - The user asserts
tx_flush_i
to explicitly request transmission of the data that has been written to the buffer of the Tx Streamer.
- A complete block was written to the buffer of the Tx
Streamer, and the number of data words waiting for
transmission exceeds the number defined by generic
A simulation of the Tx and Rx streamer can be run in order to understand how some of these features work in practice.
Encapsulation of data words and blocks into Ethernet Frame
The number of data words grouped into blocks is specified by the
user who indicates the last data word. Inside the frame, each
block* ends with a CRC and an escape code (0xCAFE
).
The Streamer Frame consists of a transmission timestamp and a collection
of blocks, it is sent in the payload of an Ethernet Frame, as
depicted in the figure below.
Each block starts with an ID number
- the ID number of the block that immediately follows the Ethernet Header, is the sequence number of the frame
- the ID number of the subsequent blocks, is the inter-frame sequence number of the block*
WR streamers module
The xwr_streamers.vhd
module (located in modules/wr_streamers folder
of wr-cores)
provides a WR PTP Core -compatible communication. It is
meant to be a used as a building block in WR-based nodes.
Additionally to transmission and reception of data, it provides advanced
diagnostics and debugging capabilities that can be accessed via SNMP and
WB registers (via PCI or VME).
- It includes the following sub-modules:
- *TX streamer* (
xtx_streamer.vhd
) - Takes a series of data words and encapsulates them into Ethernet Frames to be transmitted over the WR fabric interface. - *RX streamer* (
xrx_streamer.vhd
) - Receives Ethernet frames via the WR fabric interface and decodes them into a series of data words . -
Statistics Streamer statistics
(
xrtx_streamers_stats.vhd
) - WB config and status register
(
wr_streamers_wb.vhd
)
- *TX streamer* (
xwr_streamers.vhd
module
Interface of the - Configuration
-
g_streamers_op_mode
- Indicates whether this module instantiates both TX and RX streamers (set toTX_AND_RX
) or only one
of them. An application that only receives or only transmits might want to useRX_ONLY
orTX_ONLY
mode in order to save resources. -
g_tx_streamer_params
- Tx streamer generics stored in one record: data_width, buffer_size, threshold, max_words_per_frame, timeout, escape_code_disable - they map into Transmit Streamer module generics described in detail in Transceiver configuration. -
g_rx_streamer_params
- Rx streamer generics stored in one record: data_width, buffer_size, escape_code_disable, expected_words_number - they map into Receive Streamer module generics described in detail in Transceiver configuration for details. -
g_stats_cnt_width
- Width of statistics counters: frame rx/tx/lost, block lost, counter of accumuted latency (minimum 15 bits, max 64). -
g_stats_acc_width
- Width of latency accumulator (max value 64) . -
g_slave_mode
- Specifies wishbone interface mode. -
g_slave_granularity
- Set wishbone address granularity.-
WR timing input - described in details here
here
- clk_ref_i
- tm_time_valid_i
- tm_tai_i
- tm_cycles_i
- link_ok_i
-
WR timing input - described in details here
here
- FIFO-like data interface - described in details here).
-
Input to Tx
** tx_dreq_o
** tx_data_i
** tx_valid_i
** tx_last_p1_i
** tx_flush_p1_i -
Output from Rx
** rx_dreq_i
** rx_data_o
** rx_valid_o
** rx_first_p1_o
** rx_last_p1_o- Interface for configuration and diagnostics
-
Direct network configuration using input signals organized in records (see details here):
** tx_streamer_cfg_i
** rx_streamer_cfg_i -
Wishbone-based access that can be used to overrite the Direct network configuration (i.e. tx_streamer_cfg_i and rx_streamer_cfg_i) and to read streamers statistics for diagnostics, it is located in the address-space of WR PTP Core (offset 0x20700), the WB memory map.
** wb_slave_i
** wb_slave_o -
32-bit array that is used by the WR PTP Core to read streamers statistics for diagnostics, WR PTP Core exposes these data via SNMP and shell interface (command diag)
** snmp_array_i
** snmp_array_o
Projects that use WR Streamers
Project Status
Date | Event |
15-03-2013 | Streamers developed for White Rabbit Core Hands-on Training by Tom. |
07-03-2016 | Tom's streamers included into wr-cores proposed_master and documented with a wiki page (now can be found here). |
31-03-2016 | Layout of streamer's frame modified slightly to make it backward compatible with the version used in B-train, wiki updated. |
24-05-2017 | Major update, part of wrpc-v4.0 and wrbtrain-v1.0 releases: added statistics, top xwr_streamers module, VLAN support, override of configuration via WB, wiki updated. |
6 July 2017