Hardware interview practice
$past and nonblocking assignment (NBA) sampling
After the first usable history sample, how should this property behave when d is known and stable around each posedge and q has no other drivers?
Starting point
Question code
always_ff @(posedge clk) q <= d;
assert property (@(posedge clk) q == $past(d));Choose one
Answer choices
- A. It should pass: sampled q reflects the prior edge's NBA update, matching prior sampled d
- B. It should fail every cycle because the assertion samples q after the current NBA
- C. It is a race and may pass or fail depending on process order
- D. It compares q with d from two edges earlier
