This is an old revision of the document!
Namespace std::channel
This contains standard names for commonly used asynchronous channels. A channel has two ends: the sender and receiver. In the wire-level handshake protocol, the end that initiates the communication is referred to an the active end of the channel; the other end is passive. If the sender initiates the communication, then the channel is referred to as a push-type channel; if the receiver initiates the communication, the channel is referred to as a pull-type channel.
In the standard channel definitions, the channels are push-type unless otherwise specified.
template<pint N> defchan e1of <: chan(enum<N>) (std::data::d1of?!<N> d; bool!? e);
The e1of<N>
channel sends a one-of-N encoded data value using the .d
field, and the receiver responds with an enable (inverted acknowledge) using the .e
field. This uses a four-phase handshake protocol. The channel resets to an initial state without any data on its output.
template<pint N> defchan er1of <: chan(enum<N>) (std::data::d1of?!<N> d; bool!? e);
SImilar to e1of<N>
, except the channel resets with the data value 0 on its output.
template<pint N> defchan ev1of <: chan(enum<N>) (std::data::d1of?!<N> d; bool?! v; bool!? e);
This channel is similar to the e1of<N>
channel, except that the .v
(for data valid) field is also included in the interface. This is used to avoid replicating validity checks at the sender and receiver.