I am confused about whether ready/valid handshaking is functionally equivalent to req/ack (2-way) handshaking? By being functionally equivalent, I mean that we can perform data transfers with ready/valid handshaking in all the cases in which we can do with req/ack (2-way) handshaking and vice versa? Are there any scenarios in which one scheme will work while the other will not?
As an extension to the same question, is req/ack (2-way) functionally equivalent to req/ack (4-way) handshaking? Mostly, I have found the difference to be in terms of hardware required and of course speed. Are there any scenarios in which we are bound to use req/ack (4-way) or req/ack (2-way) for that matter.
In summary, I want to build a connection between the three schemes -- where will one scheme fail and the other scheme will work.
The question is in the context of both synchronous and asynchronous designs
An old question but I'll answer anyway for the sake of future similar queries.
1. When are they used?
The 4-phased or 2-phased req/ack
protocols are necessary in the absence of clock, in asynchronous logic. The signals are responses to one another: both are responses in the 4-phased protocol, ack
is the only response in the 2-phased protocol.
The valid/ready
(or equivalent) protocol doesn't need the return to zero phases thanks to the synchronization on the rising edge of the clock, it can only be used in synchronous logic. Furthermore, only one phase is required since the valid
and ready
are not a response to each other on the current transfer, they are simply updated on the next cycle.
2. How do they compare?
All 3 protocols controls the transfer of data accurately, they can transmit back pressure too. So yes, they are functionally equivalent.
4-phased req/ack
signals switch twice as much, which is not great from a performance and power consumption point of view. But synchronous circuits have block buffers that may consume a lot when the fan-out is big, which have other consequences like EMI, the need of local capacitors and/or the use of spread spectrum techniques. It all depends on the scale of the circuit and the technology. In general though, it will be harder to maintain the same throughput with a protocol that needs to switch signals at twice the rate.
2-phased ack/req
provides the same functionality too but the implementation has its disadvantages, the logic to handle high/low may be more complex vs the natural 4-phased protocol. It requires XOR gates and a reference register to output transitions instead of states (changing polarity instead of indicating "I'm ready"). It requires XOR gates to detect if a change of state should occur.
From a performance point of view, it takes more resources and increases the critical path but reduces the number of phases. It's not clear whether the outcome will improve the performances, to check but it likely depends on the technology. One justification would be the transmission of the protocol over long or loaded lines of limited bandwidth, where it could be interesting to increase the rate over those lines at the expense of local gate area.
3. Are they interchangeable?
It is possible to interface two valid/ready
blocks with a req/ack
protocol in a synchronous circuit. However, in order to interface two req/ack
blocks with a valid/ready
protocol in an asynchronous circuit, you'd need a third synchronization signal for the notion of transfer cycle.
The question is moot in most cases because there is a penalty and no advantage. valid/ready
or equivalent will be used in synchronous circuits. In asynchronous circuits, you have to choose between 2-phased or 4-phased req/ack
.
It is possible to interface 2-phased and 4-phased req/ack
blocks with XOR and S/R latches in asynchronous circuits.
In summary
They are functionally equivalent when they are used in their respective synchronous / asynchronous implementations, but cannot always be used in the other domain (req/ack
can be used in synchronous domain but underperforms, valid/ready
cannot be used as such in asynchronous domain). Each implementation has a different impact on performance, power consumption and resource utilization.