compactRIO HotLink Receiver
This module is part of the crio_interface module.
The crio_hotlink_rx module is responsible for receiving data over a hotlink protocol. It processes incoming data in chunks and outputs synchronized data for multiple channels, handling errors in synchronization when marker bits are not received as expected. The module supports multiple CRIO channels, as specified by the CRIO_CHANNELS generic.
Generics
| Name | Description | Type | Default | 
|---|---|---|---|
| CRIO_CHANNELS | Sets the number of expected channels | integer | 1 | 
Ports
| Name | Description | Type | 
|---|---|---|
| clk_i | Input clock signal | std_logic | 
| rstn_i | Active-low synchronous reset | std_logic | 
| sync_o | Synchronization output signal | std_logic | 
| data_i | Input data bus (8 bits) | std_logic_vector(7 downto 0) | 
| data_new_i | New data flag (indicates when data is updated) | std_logic | 
| data_o | Output data array for hotlink (dependent on CRIO_CHANNELS) | array_hotlink_data_t(CRIO_CHANNELS - 1 downto 0)* | 
| data_new_o | New data flags for each channel | std_logic_vector(CRIO_CHANNELS - 1 downto 0) | 
*The array_hotlink_data_t type is defined in the global package Here
Implementation details
The crio_hotlink_rx architecture processes data using the following logic:
- Synchronization Process: - This looks for a marker bit (the MSB of data_i) to establish synchronization. If the marker bit is 1, synchronization is activated (sync_v = ‘1’), and chunks of data are expected to follow. - If synchronization is lost (marker bit is not received as expected), the module resets the synchronization status. 
- Data Processing: - Data is received in chunks of 7 bits (since the 8th bit is reserved for synchronization). These chunks are assembled into a full data packet stored in the buffer data_buf_v. - Once a full data packet is received (as determined by the HOTLINK_CHUNKS_c constant), it is output on the data_o port for the corresponding CRIO channel. - The data_new_o signal for that channel is set to 1, indicating that new data is available. 
- Channel Handling: - The module supports multiple CRIO channels as specified by the CRIO_CHANNELS generic. Data is processed sequentially for each channel, and the channel counter (ch_cnt_v) increments once data for a channel has been fully received. - If all channels have been processed, the counter resets to process the next set of data. 
- Reset Behavior: - When the reset signal (rstn_i = ‘0’) is active, all internal counters and buffers are cleared, and outputs (data_o and data_new_o) are reset to their default values. 
Constants
| Name | Description | Type | 
|---|---|---|
| HOTLINK_CHUNKS_c | Number of chunks required to fully receive one data packet (derived from HOTLINK_DATA_LENGTH / 7) | natural | 
Signal Descriptions
- chunks_cnt_v: Tracks the number of chunks received for the current data packet. 
- ch_cnt_v: Tracks the current CRIO channel being processed. 
- sync_v: Indicates whether the module is synchronized. 
- data_buf_v: Temporary buffer that accumulates received chunks to form a complete data packet.