Difficulty: Easy · Puzzle 1 of 6 · Topic: Implication Puzzles
Statement: on req, gnt should be high in the same sampled cycle. Timeline (all other samples are 0): C30 req=1 gnt=1, C31 gnt=0. Evaluate both properties.
property p_overlap;
@(posedge clk) req |-> gnt;
endproperty
property p_nonoverlap;
@(posedge clk) req |=> gnt;
endpropertyCompare consequent sampling cycle for |-> vs |=>.
1) For p_overlap, gnt is checked at C30 and is 1, so overlap passes.
2) For p_nonoverlap, gnt is checked at C31 and is 0, so non-overlap fails (reported at C31).
3) Same waveform yields different outcomes purely from implication operator choice.Answer: PASS for p_overlap, FAIL for p_nonoverlap - |-> checks same cycle, |=> checks next cycle.
Checked by running the code in Verilator 5; the printed output supports the answer above. Same waveform: |-> checks gnt at C30 and passes, |=> checks C31 and fails.
This is the most common interview slip: people remember arrows visually, but not their sampling offsets. |=> is exactly |-> ##1, so the failure shows up one cycle after the request.
If gnt were high at both C30 and C31, what would each property report? Model answer: both PASS. p_overlap looks only at C30 and p_nonoverlap looks only at C31, and gnt is high in both cycles.
I would sample gnt at the right cycle for each operator. The overlapped arrow checks gnt at C30, where it is high, so that property passes. The non-overlapped arrow checks at C31, where gnt is low, so that one fails at C31. The trap is mixing up the offsets; the non-overlapped arrow is just the overlapped one with a one cycle delay, so I would confirm which timing the spec says.