I want to hold off an assertion until the first occurrence of a sync byte, then execute the assertion every byte thereafter. I thought that a local variable would be the ideal way to do this - but no! Every permutation I tried either fired intermittently (only when byte matched sync byte) or failed to compile. Some examples:
property data_parity_prop (clk, rst, d, available, parity);
bit flag = 0;
@(posedge clk) disable iff (rst !== 1)
((d == SYNC_DATA), flag = 1) || flag |-> ^d ^ available ^ parity;
endproperty
FAILED TO COMPILE - Syntax error
property data_parity_prop (clk, rst, d, available, parity);
@(posedge clk) disable iff (rst !== 1)
((d == SYNC_DATA), flag = 1) || flag |-> ^d ^ available ^ parity;
endproperty
FAILED TO COMPILE - flag not declared
bit flag;
property data_parity_prop (clk, rst, d, available, parity);
@(posedge clk) disable iff (rst !== 1)
((d == SYNC_DATA), flag = 1) || flag |-> ^d ^ available ^ parity;
endproperty
FAILED TO COMPILE - Can’t assign to variables other than local ones
I also tried putting flag in the sequence and passing it to the property and a bunch of other variants without success. Please help save what little hair I have left and tell me what I’m doing wrong. Thanks!