RIFFA‎ > ‎RIFFA 2.0‎ > ‎

Hardware Interface

The RIFFA 2.0 channel has two sets of signals, one for receiving data (RX) and one for sending data (TX). This version has simplified the interface to use a minimal handshake and receive/send data using a FIFO with first word fall through semantics (valid+read interface). The clocks used for receiving and sending can be asynchronous from each other and from the PCIe interface (RIFFA clock). The table below describes the ports. The input/output designations are from your user core's perspective (i.e. the core(s) you write and connect to the RIFFA 2.0 channel).

 Name I/O Description
 CHNL_RX_CLK O  Provide the clock signal to read data from the incoming FIFO.
 CHNL_RX I  Goes high to signal incoming data. Will remain high until all incoming data is written to the FIFO.
 CHNL_RX_ACK O  Must be pulsed high for at least 1 cycle to acknowledge the incoming data transaction.
 CHNL_RX_LAST I  High indicates this is the last receive transaction in a sequence.
 CHNL_RX_LEN[31:0] I  Length of receive transaction in 4 byte words.
 CHNL_RX_OFF[30:0] I  Offset in 4 byte words indicating where to start storing received data (if applicable in design).
 CHNL_RX_DATA[DWIDTH-1:0] I  Receive data.
 CHNL_RX_DATA_VALID I  High if the data on CHNL_RX_DATA is valid.
 CHNL_RX_DATA_REN O  When high and CHNL_RX_DATA_VALID is high, consumes the data currently available on CHNL_RX_DATA.
 CHNL_TX_CLK O  Provide the clock signal to write data to the outgoing FIFO.
 CHNL_TX O  Set high to signal a transaction. Keep high until all outgoing data is written to the FIFO.
 CHNL_TX_ACK I  Will be pulsed high for at least 1 cycle to acknowledge the transaction.
 CHNL_TX_LAST O  High indicates this is the last send transaction in a sequence.
 CHNL_TX_LEN[31:0] O  Length of send transaction in 4 byte words.
 CHNL_TX_OFF[30:0] O  Offset in 4 byte words indicating where to start storing sent data in the PC thread's receive buffer. 
 CHNL_TX_DATA[DWIDTH-1:0] O  Send data.
 CHNL_TX_DATA_VALID O  Set high when the data on CHNL_TX_DATA valid. Update when CHNL_TX_DATA is consumed.
 CHNL_TX_DATA_REN I  When high and CHNL_TX_DATA_VALID is high, consumes the data currently available on CHNL_TX_DATA.
The value of DWIDTH will be either 32, 64, or 128.

Below is a timing diagram for receiving data. 

RX Timing Diagram

The timing diagram shows the RIFFA channel receiving a data transfer of 16 (4 byte) words (64 bytes). When CHNL_RX is high, CHNL_RX_LAST, CHNL_RX_LEN, and CHNL_RX_OFF will all be valid. In this example, CHNL_RX_LAST is high, indicating to the user core that there are no other transactions following this one and that the user core can start processing the received data as soon as the transaction completes. CHNL_RX_LAST may be set low if multiple transactions will be initiated before the user core should start processing received data. Of course, the user core will always need to read the data as it arrives, even if CHNL_RX_LAST is low.

In the example CHNL_RX_OFF is 0. However, if the PC specified a value for offset when it initiated the send, that value would be present on the CHNL_RX_OFF signal. The 31 least significant bits of the 32 bit integer specified by the PC thread are transmitted (due to packing constraints). The CHNL_RX_OFF signal is meant to be used in situations where data is transferred in multiple sends and the user core needs to know where to write the data (if, for example it is writing to BRAM or DRAM).

The user core must pulse the CHNL_RX_ACK signal high for at least one cycle to acknowledge the receive transaction. The RIFFA channel will not recognize that the transaction has been received until it receives a CHNL_RX_ACK pulse. Note that data on CHNL_RX_DATA may begin to arrive before CHNL_RX_ACK is pulsed, but the FIFO will never overflow. The combination of CHNL_RX_DATA_VALID high and CHNL_RX_DATA_REN high consumes the data on CHNL_RX_DATA. New data will be provided until the FIFO is drained. Note that the FIFO may drain completely before all the data has been received. The CHNL_RX signal will remain high until all data for the transaction has been received into the FIFO. Note that CHNL_RX may go low while CHNL_RX_DATA_VALID is still high. That means there is still data in the FIFO to be read by the user core. Attempting to read (asserting CHNL_RX_DATA_REN high) while CHNL_RX_DATA_VALID is low, will have no affect on the FIFO. The user core may want to count the number of words received and compare against the value provided by CHNL_RX_LEN to keep track of how much data is expected. 

In the event of a transmission error, the amount of data received may be less than the amount expected (advertised on CHNL_RX_LEN). It is the user core's responsibility to detect this discrepancy if important to the user core. 

TX Timing Diagram

The diagram above shows the RIFFA channel sending a data transfer of 16 (4 byte) words (64 bytes). It's nearly symmetric to the receive example. The user core sets CHNL_TX high and asserts values for CHNL_TX_LAST, CHNL_TX_LEN, and CHNL_TX_OFF for the duration CHNL_TX is high. CHNL_TX must remain high until all data has been consumed. RIFFA will expect to read CHNL_TX_LEN words from the user core. Any more data provided may be consumed, but will be discarded. The user core can provide less than CHNL_TX_LEN words and drop CHNL_TX at any point. Dropping CHNL_TX indicates the end of the transaction. Whatever data was consumed before CHNL_TX was dropped will be sent and reported as received to the software thread.

As with the receive interface, setting CHNL_TX_LAST high will signal to the PC thread to not wait for additional transactions (after this one). Setting CHNL_TX_OFF will cause the transferred data to be written into the PC thread's buffer starting CHNL_TX_OFF 4 bytes words from the beginning. This can be useful when sending multiple transactions and needing to order them in the PC thread's receive buffer. CHNL_TX_LEN defines the length of the transaction in 4 byte words.

As the CHNL_TX_DATA bus can be 32 bits, 64 bits, or 128 bits wide, it may be that the number of 32 bit words the user core wants to transfer is not an even multiple of the bus width. In this case, CHNL_TX_DATA_VALID must be high on the last cycle CHNL_TX_DATA has at least 1 word to send. The channel will only send as many words as is specified by CHNL_TX_LEN. So any additional data consumed, past the last word, will be discarded.

Shortly after CHNL_TX goes high, the RIFFA channel will pulse high the CHNL_TX_ACK and begin to consume the CHNL_TX_DATA bus. The combination of CHNL_TX_DATA_VALID high and CHNL_TX_DATA_REN high will consume the data currently on CHNL_TX_DATA. New data can be consumed every cycle. After all the data is consumed, CHNL_TX can be dropped. Keeping CHNL_TX_DATA_VALID high while CHNL_TX_DATA_REN is low will have no effect.