I wanted to write an assertion that data_input which is one bit should match rx_data[0]th bit at posedge and rx_data[1]th at negedge , but when the rx_data changes the assertion fails ? I am not getting why it is checking the previous data and getting failed , at the rising edge or failing edge of rx_data as the data is correctly received?
Can you please let me know
@(posedge clk) if the the sampled(data_valid) then
at the next (negedge clk) (the sampled(di_a) == the sampled(rx_data[1])
// sampling is at eh negedge clk
Then at the next (posedge clk) ##0 (the sampled(di) == the sampled(rx_data[0]))
The issue you have is that you have a posedge clocking event
followed by |=> @(negedge clk). This behaves in the same manner as
@(posedge clk) (data_valid) |-> @(negedge clk) ##0 (di_a == rx_data[1])
// In this case, because you have clocking eventat different times,
// the |-> behaves the same as |=>
The |=> or the |-> operators synchronize the last expression of the antecedent clocked with the antecedent clock and the first elements of the consequent property being evaluated clocked with the consequent clock. The synchronization is the same as the one used with ##1 (for the |=>) and ##0 (for the |->) operators.
Multiclocked sequences are built by concatenating singly clocked subsequences using the single delay concatenation operator ##1 or the zero-delay concatenation operator ##0. The single delay indicated by ##1 is understood to be from the end point of the first sequence, which occurs at a tick of the first clock, to the nearest strictly subsequent tick of the second clock, where the second sequence begins. The zero delay indicated by ##0 is understood to be from the end point of the first sequence, which occurs at a tick of the first clock, to the nearest possibly overlapping tick of the second clock, where the second sequence b.