FVO — Formal Verification Online
Lesson 14.2 · Handshakes and Credit-Based Flow Control

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.

012345678xferwaitwaitxferxferclkvalidreadydataD0D1D2
D0 waits one tick and transfers at tick 2. D1 is stalled at ticks 3–4 and transfers at 5. D2 transfers at once because ready was already high. ready at tick 7 without valid is allowed.

The rules

#RuleWho must obey
1Once valid is high, it stays high until a transfer happens.producer
2While valid is high and not yet accepted, data does not change.producer
3valid must not wait for ready (no combinational path ready → valid).producer
4ready may wait for valid, and may be high without valid.consumer (a freedom, not a rule)
5No X on valid; no X on data while valid.producer
valid/ready checker
// 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);

A classic bug: dropping valid on a stall

012345FAILclkvalidreadydataD0D1
At tick 2 valid is high and ready low, so valid must still be high at tick 3. The producer withdrew the data — D0 is lost. a_valid_hold fails at tick 3.

Discussion

No comments yet.

Was this page helpful?

Tip: select any text on the page before clicking Report and it will be quoted in your report.