compactRIO HotLink Transmitter ============================== This module is part of the :doc:`crio_interface ` module. The `crio_hotlink_tx` module is responsible for transmitting data using the hotlink protocol to a compactRIO carrier. It packages data from multiple cRIO channels into smaller chunks and sends them in a sequential manner inserting the appropriate synchronization bit. The module supports test modes for verifying functionality and accommodates different numbers of channels, which are set by the `CRIO_CHANNELS` generic. Generics -------- .. list-table:: :widths: 15 35 30 15 :header-rows: 1 * - Name - Description - Type - Default * - CRIO_CHANNELS - Sets the number of supported channels - integer - 1 Ports ----- .. list-table:: :widths: 15 35 30 :header-rows: 1 * - Name - Description - Type * - clk_i - Input clock signal - std_logic * - rstn_i - Active-low synchronous reset - std_logic * - en_i - Enable signal for data transmission - std_logic * - channels_i - Input that specifies the number of active channel (up to CRIO_CHANNELS) - std_logic_vector(clog2(CRIO_CHANNELS) - 1 downto 0) * - test_mode_i - Test mode signal to enable the generation of test patterns - std_logic * - data_i - Input data array for each channel (dependent on `CRIO_CHANNELS`) - array_hotlink_data_t(CRIO_CHANNELS - 1 downto 0) * - sent_o - Output flags indicating data transmission completion for each channel - std_logic_vector(CRIO_CHANNELS - 1 downto 0) * - data_o - Output data bus (8 bits), where the MSB is used as a marker for synchronization - std_logic_vector(7 downto 0) Implementation details ---------------------- The `crio_hotlink_tx` architecture handles data transmission through the following processes: 1. **Data Packaging and Transmission**: - The data is processed in chunks of 7 bits, with the 8th bit reserved as a synchronization marker. - The `data_o` output bus sends these chunks sequentially, with the MSB (`data_o(7)`) set to `1` when the first chunk of the first channel is transmitted. - The data from each channel is output, chunk by chunk, based on the value of the `chunks_cnt_v` counter, which increments until the entire data packet has been transmitted. 2. **Channel Handling**: - The module supports multiple CRIO channels as defined by the `CRIO_CHANNELS` generic. It transmits data for one channel at a time, controlled by the `ch_cnt_v` counter, which cycles through the channels. - Once data transmission for a channel is complete, the corresponding `sent_o` bit is set to `1`, indicating that the data for that channel has been sent. The `ch_cnt_v` counter then moves to the next channel. 3. **Test Mode**: - If `test_mode_i` is asserted (`'1'`), the module generates a test pattern rather than using input data. The test pattern is a triangular wave. 4. **Reset Behavior**: - When `rstn_i = '0'`, the module resets all internal counters and buffers. The `sent_o` flags and the `data_o` output bus are cleared. Constants ~~~~~~~~~ .. list-table:: :widths: 15 35 30 :header-rows: 1 * - Name - Description - Type * - HOTLINK_CHUNKS_c - Number of chunks required to fully transmit one data packet (derived from `HOTLINK_DATA_LENGTH / 7`) - natural Signal Descriptions ~~~~~~~~~~~~~~~~~~~ - `chunks_cnt_v`: Tracks the number of chunks that have been transmitted for the current data packet. - `ch_cnt_v`: Tracks the current CRIO channel being processed for transmission. - `sent_s`: Indicates if data for a channel has been transmitted. - `sent_old_s`: Used to store the previous state of the `sent_s` signal to detect edges. - `test_pattern_s`: Holds the test pattern data to be transmitted when `test_mode_i` is active.