====== 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 defchan e1of <: chan(enum) (std::data::d1of?! d; bool!? e); template defchan er1of <: chan(enum) (std::data::d1of?! d; bool!? e); The ''e1of'' 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. The ''er1of'' channel is sImilar to ''e1of'', except the channel resets with the data value 0 on its output. template defchan ev1of <: chan(enum) (std::data::d1of?! d; bool?! v; bool!? e); template defchan evr1of <: chan(enum) (std::data::d1of?! d; bool?! v; bool!? e); This channel is similar to the ''e1of'' 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. The ''evr'' variant resets with a zero data value on its output. The following short-cuts are also available for commonly used channels. These are mostly provided for compatibility with older versions of ACT. defchan e1of1 <: e1of<1> (bool?! r); The ''.r'' field is included as the request, which is the same as the single data wire in the ''e1of'' channel. defchan e1of2 <: e1of<2> (bool?! t, f); defchan er1of2 <: e1of<2> (bool?! t, f); defchan ev1of2 <: e1of<2> (bool?! t, f); defchan erv1of2 <: e1of<2> (bool?! t, f); The ''.t'' and ''.f'' fields are connected to the appropriate data wires. The namespace also includes definitions for the same channel names but starting with ''a'' instead of ''e''. These correspond to channels that use the standard acknowledge signal instead of the inverted acknowledge (enable) signal. template defchan eMx1of2 <: chan(int) (std::data::Mx1of2?! d; bool!? e); template defchan erMx1of2 <: chan(int) (std::data::Mx1of2?! d; bool!? e); This defines a standard M-bit data channel with an inverted acknowledge. The ''er'' variant resets with a zero data value on its output. Channel definitions with acknowledges also exist, and they follow the standard naming convention starting with ''a'' rather than ''e''. template defchan bd <: chan(int) (bool?! d[M]; bool?! r; bool!? a); template defchan rbd <: chan(int) (bool?! d[M]; bool?! r; bool!? a); This is an M-bit bundled-data channel, with the ''.r'' field for the request and the ''.a'' field for the acknowledge. The channel name beginning with ''r'' corresponds to a bundled-data channel that resets with data on its output. Channels ''ts_bd'' and ''ts_rbd'' have the same bundled-data port interface, but instead use transition signalling (two-phase communication) rather than four-phase protocols. defchan ledr <: chan(bool) (bool?! data, rep; bool!? a); This channel represents the level-encoded two-phase protocol (four state encoding), with the ''.data'' field corresponding to the value of the data, and ''.rep'' (repeat) toggling when the data is unchanged. defchan xledr <: chan(bool,bool) (bool?! data, rep; bool!? ackdata,ackrep); This is a ledr-encoded exchange channel, with one-bit data being sent in both directions.