Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
std:channels [2022/07/17 06:37]
rajit created
std:channels [2022/07/17 07:07] (current)
rajit
Line 1: Line 1:
 ====== Namespace std::channel ====== ====== 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.
 +
 +<code act>
 +template<pint N>
 +defchan e1of <: chan(enum<N>) (std::data::d1of?!<N> d; bool!? e);
 +template<pint N>
 +defchan er1of <: chan(enum<N>) (std::data::d1of?!<N> d; bool!? e);
 +</code>
 +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. The ''er1of'' channel is sImilar to ''e1of<N>'', except the channel resets with the data value 0 on its output.
 +
 +<code act>
 +template<pint N>
 +defchan ev1of <: chan(enum<N>) (std::data::d1of?!<N> d; bool?! v;  bool!? e);
 +template<pint N>
 +defchan evr1of <: chan(enum<N>) (std::data::d1of?!<N> d; bool?! v;  bool!? e);
 +</code>
 +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. 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.
 +
 +<code act>
 +defchan e1of1 <: e1of<1> (bool?! r); 
 +</code> 
 +The ''.r'' field is included as the request, which is the same as the single data wire in the ''e1of'' channel.
 +
 +<code act>
 +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);
 +</code>
 +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.
 +
 +<code act>
 +template<pint M> defchan eMx1of2 <: chan(int<M>) (std::data::Mx1of2?!<M> d; bool!? e);
 +template<pint M> defchan erMx1of2 <: chan(int<M>) (std::data::Mx1of2?!<M> d; bool!? e);
 +</code>
 +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''.
 +
 +
 +<code act>
 +template<pint M> defchan bd <: chan(int<M>) (bool?! d[M]; bool?! r; bool!? a);
 +template<pint M> defchan rbd <: chan(int<M>) (bool?! d[M]; bool?! r; bool!? a);
 +</code>
 +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.
 +
 +<code act>
 +defchan ledr <: chan(bool) (bool?! data, rep; bool!? a);
 +</code>
 +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. 
 +
 +<code act>
 +defchan xledr <: chan(bool,bool) (bool?! data, rep; bool!? ackdata,ackrep);
 +</code>
 +This is a ledr-encoded exchange  channel, with one-bit data being sent in both directions.
 +
 +
 +
 +
 +
 +