Visible to Intel only — GUID: GUID-86C792DD-2080-4F7E-AFEB-ABE01E989C5E
Visible to Intel only — GUID: GUID-86C792DD-2080-4F7E-AFEB-ABE01E989C5E
Host Pipes RTL Interfaces
This section provides a summary of interfacing with host pipes in your IP based on the choice of protocol.
Host pipes support Avalon® streaming and memory-mapped interfaces. Refer to the Intel® Avalon Interface Specifications for details about these protocols.
For Avalon® memory-mapped protocols, register addresses in the CRA are specified in the generated kernel header file in the project directory. Refer to Register Map Header File for further details on CRA agent registers.
protocol_name::avalon_streaming_uses_ready
This is the default protocol.
This protocol allows the sink to backpressure by deasserting the ready signal. The sink signifies that it is ready to consume data by asserting the ready signal. On the cycle where the sink asserts the ready signal, the source must wait for the ready_latency signal to cycle before responding with valid and data signals, where the property specifies the ready_latency in the host pipe declaration.
Host-to-Device Pipe
When the uses_valid property is set to false and the ready signal is asserted by the kernel and sampled by the host, the host must wait ready_latency cycles before the value on the data interface is sampled by the kernel and consumed.
When the uses_valid property is set to true and the ready signal is asserted by the kernel and sampled by the host, the host must wait ready_latency cycles before inserting the valid signal. The data interface is not sampled or consumed by the kernel until the valid signal is asserted.
Device-to-Host Pipe
When the uses_valid property is set to true and the host asserts the ready signal, the kernel replies with valid=1 and qualified data (if available) ready_latency cycles after the corresponding ready was first asserted.
When the uses_valid property is set to false and the host asserts the ready signal, the kernel replies with qualified data ready_latency cycles after the corresponding ready was first asserted.
protocol_name::avalon_streaming
With this choice of protocol, the ready signal is not exposed by the host pipe, and the sink cannot backpressure.
The valid signal qualifies data transfer from source to sink per cycle when the uses_valid property is set to true. When the uses_valid property is set to false, the source implicitly provides a valid output on every cycle, and the sink assumes a valid input on every cycle.
Host-to-Device Pipe
When the uses_valid property is set to false, the kernel samples and processes the value on the host pipe data interfaces on each cycle.
When the uses_valid property is set to true, the kernel samples and processes the value on the host pipe data interface on each cycle that the valid signal is asserted.
Device-to-Host Pipe
When the uses_valid property is set to false, the host must sample and process values on the host pipe data interface every clock cycle. Failure to do so causes the data to be dropped.
When the uses_valid property is set to true, the host must sample and process values on the host pipe data interface every clock cycle that the valid signal is asserted. Failure to do so causes the data to be dropped.
protocol_name::avalon_mm
This protocol can be specified on both device-to-host and host-to-device pipes.
Device-to-Host Pipe
The CRA agent contains a data register for each pipe of this type. An implicit ready signal is held high, meaning that the sink (host) cannot backpressure. The data register contains the latest element written by the kernel into the pipe.
You cannot specify the uses_valid property on device-to-host pipes.
Host-to-Device Pipe
When the uses_valid property is true, the CRA agent contains a valid register in addition to the data register. The host writes a 1 to the valid register to indicate that the value in the data register is qualified. When the kernel has consumed this data, the kernel automatically clears the value in the valid register. A cleared valid register signifies that the host is free to write a new value into the data register.
When the uses_valid property is false, the CRA agent contains only a data register for this type of pipe. The host can write data into the pipe via the data register in any cycle.
protocol_name::avalon_mm_uses_ready
This protocol is only available for device-to-host host pipes. The uses_valid property cannot be specified on these pipes.
Device-to-Host Pipe
The CRA agent contains a data register and ready register for this type of pipe. Writing a 1 to the ready register signifies that the data at the head of the pipe can be written into the data register. After the data register has been successfully written, the ready register is automatically cleared to 0. At this point, writing another 1 to the ready register signifies that the next data element in the pipe can be written to the data register.
Avalon Streaming Sideband Signals
Enable Avalon streaming sideband signal support by using the StreamingBeat struct provided by the pipes_ext.hpp header file. The StreamingBeat struct generates sideband signals only when used with a host pipe. Other types of pipes do not support sideband signals.
To use the StreamingBeatstruct, include the pipes_ext.hpp header file:
$INTELFPGAOCLSDKROOT/include/sycl/ext/intel/prototype/pipes_ext.hpp
Using the StreamingBeat struct with the uses_packets property set to true adds two additional 1-bit signals to the Avalon interface, start_of_packet (sop), and end_of_packet (eop).
Assert the sop signal when you send the first beat of the packet along with a valid signal assertion. Assert the eop signal when you send the last beat, along with a valid signal assertion. You can assert sop and eop signals in the same cycle for a single packet transfer transaction. The sop signal can also be asserted on the cycle immediately after the eop signal was asserted for the previous packet.
The third property for the StreamingBeatstruct signifies use_empty. When use_empty is set to true, it adds an empty signal that is bits long. The empty signal indicates the number of symbols that are empty during the eop cycle.
Empty symbols are always the last symbols in the data. That is, the symbols carried by low-order bits when first_symbol_in_high_order_bits is true, or the high-order bits if first_symbol_in_high_order_bits is set to false.
You must set use_empty for all packet interfaces that carry more than one symbol of data that have a variable length packet format.
The following example uses the StreamingBeatstruct with the uses_packets and use_empty properties both set to true. The size of the PipeData type is forced to a multiple of the kBitsPerSymbol value, which is passed to the associated host pipe declaration.
using PipeData = ac_int<kBitsPerSymbol * kSymbolsPerBeat, false>;
using StreamingBeatData = sycl::ext::intel::experimental::StreamingBeat<PipeData, true, true>;
When you define the host pipe, set the data type to the StreamingBeatData struct:
using H2DPipe = sycl::ext::intel::experimental::pipe<H2DPipeID, StreamingBeatData>;
The following code example instantiates a StreamingBeat struct and writes to the pipe (from the host):
bool sop = true;
bool eop = false;
int empty = 0;
PipeData data = ...
StreamingBeatData in_beat(data, sop, eop, empty);
H2DPipe::write(q, in_beat);
The following code example reads from the pipe and extracts the sideband signals (from device):
StreamingBeat in_beat = H2DPipe::read();
PipeData in_data = in_beat.data;
bool sop = in_beat.sop;
bool eop = in_beat.eop;
int empty = in_beat.empty;