Skip to content

Commit 5b0a461

Browse files
[SYCL][DOC] Create spec for Pipe Properties extension (#9027)
Pipe properties support was added in this PR: #7468 (sycl/ext/intel/experimental/pipe_properties.hpp). This is the accompanying spec. --------- Co-authored-by: Steffen Larsen <steffen.larsen@intel.com>
1 parent 6029e49 commit 5b0a461

File tree

5 files changed

+291
-82
lines changed

5 files changed

+291
-82
lines changed
Lines changed: 274 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,274 @@
1+
= sycl_ext_intel_data_flow_pipes_properties
2+
3+
:source-highlighter: coderay
4+
:coderay-linenums-mode: table
5+
6+
// This section needs to be after the document title.
7+
:doctype: book
8+
:toc2:
9+
:toc: left
10+
:encoding: utf-8
11+
:lang: en
12+
:dpcpp: pass:[DPC++]
13+
:blank: pass:[ +]
14+
15+
// Set the default source code type in this document to C++,
16+
// for syntax highlighting purposes. This is needed because
17+
// docbook uses c++ and html5 uses cpp.
18+
:language: {basebackend@docbook:c++:cpp}
19+
20+
// This is necessary for asciidoc, but not for asciidoctor
21+
:cpp: C++
22+
23+
NOTE: Khronos(R) is a registered trademark and SYCL(TM) and SPIR(TM) are
24+
trademarks of The Khronos Group Inc. OpenCL(TM) is a trademark of Apple Inc.
25+
used by permission by Khronos.
26+
27+
NOTE: This document is better viewed when rendered as html with asciidoctor.
28+
GitHub does not render image icons.
29+
30+
This document describes an extension that adds compile-time constant properties
31+
to pipes.
32+
33+
== Notice
34+
35+
Copyright (c) 2022-2023 Intel Corporation. All rights reserved.
36+
37+
== Status
38+
39+
This is an experimental extension specification, intended to provide early
40+
access to features and gather community feedback. Interfaces defined in this
41+
specification are implemented in {dpcpp}, but they are not finalized and may
42+
change incompatibly in future versions of {dpcpp} without prior notice.
43+
*Shipping software products should not rely on APIs defined in this
44+
specification.*
45+
46+
== Version
47+
48+
Built On: {docdate} +
49+
Revision: A
50+
51+
== Contact
52+
53+
Robert Ho, Intel (robert 'dot' ho 'at' intel 'dot' com)
54+
55+
== Contributors
56+
57+
Bo Lei, Intel +
58+
Marco Jacques, Intel +
59+
Joe Garvey, Intel +
60+
Aditi Kumaraswamy, Intel +
61+
Robert Ho, Intel +
62+
Sherry Yuan, Intel +
63+
Peter Colberg, Intel +
64+
Zibai Wang, Intel
65+
66+
== Dependencies
67+
68+
This extension is written against the SYCL 2020 specification, Revision 6 and
69+
the following extensions:
70+
71+
- link:../supported/sycl_ext_intel_dataflow_pipes.asciidoc[SYCL_INTEL_data_flow_pipes]
72+
- link:../experimental/sycl_ext_oneapi_properties.asciidoc[sycl_ext_oneapi_properties]
73+
74+
== Overview
75+
76+
This extension introduces properties that establish differences in the
77+
implementation of `sycl::ext::intel::experimental::pipe`. These properties are FPGA specific. An example
78+
of the syntax can be seen below.
79+
80+
[source,c++]
81+
----
82+
using pipe = pipe<class some_pipe, int, min_capacity, decltype(properties{uses_valid<true>})>;
83+
----
84+
85+
== Feature test macro
86+
87+
This extension provides a feature-test macro as described in the core SYCL
88+
specification section 6.3.3 "Feature test macros". Therefore, an implementation
89+
supporting this extension must predefine the macro
90+
`SYCL_EXT_INTEL_FPGA_PIPE_PROPERTIES` to one of the values defined in the table
91+
below. Applications can test for the existence of this macro to determine if
92+
the implementation supports this feature, or applications can test the macro's
93+
value to determine which of the extension's APIs the implementation supports.
94+
95+
[%header,cols="1,5"]
96+
|===
97+
|Value |Description
98+
|1 |Initial extension version. Base features are supported.
99+
|===
100+
101+
=== Pipe properties
102+
103+
Below is a list of compile-time-constant properties which `pipe` supports.
104+
105+
```c++
106+
namespace sycl::ext::intel::experimental {
107+
108+
struct ready_latency_key {
109+
template <int Latency>
110+
using value_t = oneapi::experimental::property_value<
111+
ready_latency_key, std::integral_constant<int, Latency>>;
112+
};
113+
114+
struct bits_per_symbol_key {
115+
template <int Bits>
116+
using value_t =
117+
oneapi::experimental::property_value<bits_per_symbol_key,
118+
std::integral_constant<int, Bits>>;
119+
};
120+
121+
struct uses_valid_key {
122+
template <bool Valid>
123+
using value_t =
124+
oneapi::experimental::property_value<uses_valid_key,
125+
std::bool_constant<Valid>>;
126+
};
127+
128+
struct first_symbol_in_high_order_bits_key {
129+
template <bool HighOrder>
130+
using value_t =
131+
oneapi::experimental::property_value<first_symbol_in_high_order_bits_key,
132+
std::bool_constant<HighOrder>>;
133+
};
134+
135+
enum class protocol_name : /* unspecified */ {
136+
avalon_streaming = 0,
137+
avalon_streaming_uses_ready = 1,
138+
avalon_mm = 2,
139+
avalon_mm_uses_ready = 3
140+
};
141+
142+
struct protocol_key {
143+
template <protocol_name Protocol>
144+
using value_t = oneapi::experimental::property_value<
145+
protocol_key, std::integral_constant<protocol_name, Protocol>>;
146+
};
147+
148+
template <int Latency>
149+
inline constexpr ready_latency_key::value_t<Latency> ready_latency;
150+
151+
template <int Bits>
152+
inline constexpr bits_per_symbol_key::value_t<Bits> bits_per_symbol;
153+
154+
template <bool Valid>
155+
inline constexpr uses_valid_key::value_t<Valid> uses_valid;
156+
157+
template <bool HighOrder>
158+
inline constexpr first_symbol_in_high_order_bits_key::value_t<HighOrder>
159+
first_symbol_in_high_order_bits;
160+
161+
template <protocol_name Protocol>
162+
inline constexpr protocol_key::value_t<Protocol> protocol;
163+
164+
} // namespace sycl::ext::intel::experimental
165+
```
166+
167+
--
168+
[options="header"]
169+
|====
170+
| Property | Description
171+
172+
|`ready_latency`
173+
| Valid values: Non-negative integer value.
174+
175+
Default value: 0
176+
177+
The number of cycles between when the ready signal is deasserted and when the
178+
pipe can no longer accept new inputs.
179+
180+
This property is not guaranteed to be respected if the pipe is an inter-kernel
181+
pipe. The compiler is allowed to optimize the pipe if both sides are visible.
182+
183+
|`bits_per_symbol`
184+
| Valid values: A positive integer value that evenly divides by the data type size.
185+
186+
Default value: 8
187+
188+
Describes how the data is broken into symbols on the data bus.
189+
190+
Data is broken down according to how you set the `first_symbol_in_high_order_bits`
191+
property. By default, data is broken down in little endian order.
192+
193+
This property is not guaranteed to be respected if the pipe is an inter-kernel
194+
pipe. The compiler is allowed to optimize the pipe if both sides are visible.
195+
196+
|`uses_valid`
197+
| Valid values: `true` or `false`
198+
199+
Default value: `true`
200+
201+
Controls whether a valid signal is present on the pipe interface. If `false`, the
202+
upstream source must provide valid data on every cycle that ready is asserted.
203+
204+
This is equivalent to changing the pipe read calls to a non-blocking call and assuming that
205+
success is always true.
206+
207+
If set to `false`, the `min_capacity` pipe class template parameter and `ready_latency`
208+
property must be 0.
209+
210+
This property is not guaranteed to be respected if the pipe is an inter-kernel
211+
pipe. The compiler is allowed to optimize the pipe if both sides are visible.
212+
213+
|`first_symbol_in_high_order_bits`
214+
| Valid values: true or false
215+
216+
Default value: false
217+
218+
Specifies whether the data symbols in the pipe are in big-endian
219+
order.
220+
221+
This property is not guaranteed to be respected if the pipe is an inter-kernel
222+
pipe. The compiler is allowed to optimize the pipe if both sides are visible.
223+
224+
|`protocol`
225+
| Specifies the protocol for the pipe interface. Currently, the protocols supported
226+
are: *avalon_streaming*, *avalon_streaming_uses_ready*, *avalon_mm*, and *avalon_mm_uses_ready*.
227+
228+
*avalon_streaming*
229+
230+
Provide an Avalon streaming interface as described in https://www.intel.com/content/www/us/en/docs/programmable/683091/22-3/introduction-to-the-interface-specifications.html[Intel® Avalon Interface Specifications].
231+
232+
With this choice of protocol, no ready signal is exposed by the host pipe, and the sink cannot backpressure.
233+
234+
*avalon_streaming_uses_ready*
235+
236+
Provide an Avalon streaming interface as described in https://www.intel.com/content/www/us/en/docs/programmable/683091/22-3/introduction-to-the-interface-specifications.html[Intel® Avalon Interface Specifications].
237+
238+
This protocol allows the sink to backpressure by deasserting the ready signal asserted. The sink signifies that it is ready to consume data by asserting the ready signal.
239+
240+
*avalon_mm*
241+
242+
Provide an Avalon memory mapped interface as described in https://www.intel.com/content/www/us/en/docs/programmable/683091/22-3/introduction-to-the-interface-specifications.html[Intel® Avalon Interface Specifications].
243+
244+
With this protocol, an implicit ready signal is held high, and the sink cannot backpressure.
245+
246+
*avalon_mm_uses_ready*
247+
248+
Provide an Avalon memory mapped interface as described in https://www.intel.com/content/www/us/en/docs/programmable/683091/22-3/introduction-to-the-interface-specifications.html[Intel® Avalon Interface Specifications].
249+
250+
With this protocol, an additional memory mapped location is created to hold the ready signal. You must set the `uses_valid` property to `true`.
251+
252+
The default protocol is *avalon_streaming_uses_ready*
253+
|====
254+
--
255+
256+
== Revision History
257+
258+
[cols="5,15,15,70"]
259+
[grid="rows"]
260+
[options="header"]
261+
|========================================
262+
|Rev|Date|Author|Changes
263+
|1|2022-03-18|Peter Colberg|*Initial public working draft*
264+
|2|2023-04-06|Robert Ho|Removal of unused properties, update protocols
265+
|========================================
266+
267+
//************************************************************************
268+
//Other formatting suggestions:
269+
//
270+
//* Use *bold* text for host APIs, or [source] syntax highlighting.
271+
//* Use +mono+ text for device APIs, or [source] syntax highlighting.
272+
//* Use +mono+ text for extension names, types, or enum values.
273+
//* Use _italics_ for parameters.
274+
//************************************************************************

0 commit comments

Comments
 (0)