Valid/ready: the rules and the waveforms
Valid/ready is the most widely used handshake. A transfer happens on every clock tick where both
valid and ready are high.
The rules
| # | Rule | Who must obey |
|---|---|---|
| 1 | Once valid is high, it stays high until a transfer happens. | producer |
| 2 | While valid is high and not yet accepted, data does not change. | producer |
| 3 | valid must not wait for ready (no combinational path ready → valid). | producer |
| 4 | ready may wait for valid, and may be high without valid. | consumer (a freedom, not a rule) |
| 5 | No X on valid; no X on data while valid. | producer |
// producer-side rules: assertions when verifying the producer,
// assumptions when verifying the consumer
a_valid_hold: assert property (valid && !ready |=> valid);
a_data_stable: assert property (valid && !ready |=> $stable(data));
a_valid_known: assert property (!$isunknown(valid));
a_data_known: assert property (valid |-> !$isunknown(data));
// consumer-side liveness (if the spec promises it): never stall forever
a_eventually_ready: assert property (valid |-> s_eventually ready);
// covers that show the environment is rich enough
c_stall: cover property (valid && !ready ##1 valid && !ready ##1 valid && ready);
c_back2back: cover property (valid && ready ##1 valid && ready);
c_ready_first: cover property (!valid && ready ##1 valid && ready);