For Figure 10,
1) Why 'stop' signal from receiver is fed back to 'valid' signal for sender using OR gate ?
2) Why 'valid' signal from sender is fed back to 'stop' signal for receiver using AND gate ?
3) Why the AND gates on top of VS and VS' cells depend on 'valid' signal from sender while the AND gate on top of the first version does not ?
You must remember, each red and grey box is a clocked register which delays the signal by a clock before is passes through. Those registers are clocked by the individual signals being sent by the vertical wire leaving each yellow 'VS' box directly into the huge red and grey boxes. Yes, those tiny colored red and grey boxes are part of their master huge red and grey box at the top right in figure 10.
1) Where do you see that? The valid signal in unidirectional from the sender. Now, the valid is ored with the stop after it has traversed a red and grey register, meaning, if those 2 buffer registers are full and the sender should not be sending any more data until the stop it's anded with from the receiver has been releases meaning the receiver is reading the buffers. Though the poor design of this is the lag involved with restarting that elastic chain once it has stopped. In my FIFO code, it would be the equivalent to this line #71:
fifo_full = fifo_full_r && !(shift_out && zero_latency) ;
What's being said here if all the fifo words are full, and there is no 'shift_out' from the receiver, the fifo_full / IE 'stop' sent to sender will be seen by the receiver. But if the FIFO has all 3 words full and the receiver is simultaneously shifting data out, the sender wont see the fifo_full / IE 'stop' condition, without any delay. (Remember, with my FIFO, the receiver's 'stop' output is inverted feeding the FIFO' 'shift_out' control. IE, stop=1, no shifting out, stop=0, shift out).
2) read my point #1.
3) remember, those are going through a red and grey register before the result is passed on to the other side. Those registers are clocked by the individual signal being sent by the vertical wire leaving each yellow 'VS' box directly into the huge red and grey boxes.
This is something like the shift I used in V2.0 of my FIFO to keep track of how much of the buffers were full with how much data. IE:
if (reset) begin
.......
fifo_position <= 8'b11100001; // The fifo empty location
end else begin
if ( shift_in_protect && ~shift_out_protect ) fifo_position[7:0] <= {fifo_position[6:0],fifo_position[7]}; // Rotate the FIFO position left
else if ( ~shift_in_protect && shift_out_protect ) fifo_position[7:0] <= {fifo_position[0],fifo_position[7:1]}; // Rotate the FIFO position right
This shifts left and right a bit pattern where I would tap the appropriate fifo_position[ # ] to generate the full/empty flags. IE stop to sender. My original Version 1.0 and final version 3.1 said it much better with a counter which just kept track of the number of registers difference between the in and out:
if ( shift_in && ~shift_out ) fifo_size <= fifo_size + 1'b1; // Calculate the number of words stored in the FIFO
else if ( ~shift_in && shift_out ) fifo_size <= fifo_size - 1'b1;
In this case, the receiver's 'stop' output would be inverted and tied to the FIFO's shift_out. The fifo's fifo_full output would be generated based on the quantity of the fifo_size and the total numbers of memory words the FIFO has.