chisel-bootcamp
chisel-bootcamp copied to clipboard
2.6: `DecoupledGcd` example is not decoupled on the output side and tests fail to catch it
The example ignores the ready signal on the output side.
expectDequeueSeq fails to catch the problem because it consumes the data as soon as it is available. It tests the correctness of the data, but not whether the interface can handle backpressure.
BTW, by pure chance it is able to handle a single cycle or ready being false because the handshake takes an additional cycle after busy is set to false.
The bits remains valid because it is initially set to DontCare except for when it is assigned to (xInitial, yInitial, x). Chisel is free to just connect bits to (xInitial, yInitial, x) and it does, making the data valid for that additional cycle.