Streamers principles of data transfer
-
Tx Streamer transfers data words that are of width (n * 16)
bits where the upper limit of the word size is the size of Ethernet
frame payload (minus overhead for WR Streamers header/CRC) . The
width is defined by generic
data_width
(ing_tx_streamer_params
andg_rx_streamer_params
) that must be identical for the Tx Streamer of the sending node and Rx Streamer of the receiving node (i.e. the the parameters can be different on the same node). For example, the data word width in the BTrain-over-WhiteRabbit project is 208 bits while the data width in the streamers-on-spec_trigger-distribution example is 80 buts. -
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*