There are 4 signals req,ack,data and data_wait. when req is sent, we receive ack,after that data will be sent. when data_wait is LOW ,data is sampled and when HIGH, data will not be sampled how to write assertion for this condition?
I have been asked to write the above one in asseertion and can you help me in it.
and also I have one doubt:
proprty clk_test;
a&b-> if() ---->why we cannot write if condition after the enabling conditions?
Other than “when req is active, ack should eventually become active”, the rest of your requirements are not clear. What does it mean to send data and how would we know when it is sampled?
What are you trying to achieve with an if condition? An action block may be what you want.
In reply to raghunalla:
Other than “when req is active, ack should eventually become active”, the rest of your requirements are not clear. What does it mean to send data and how would we know when it is sampled?
What are you trying to achieve with an if condition? An action block may be what you want.
sampling in the sense the data should not be zero.
when data_wait=LOW the data should not be equal to zero and when data_wait is HIGH the data should either zero or unknown.
In reply to raghunalla:
Write multiple small assertions
// There are 4 signals req,ack,data and data_wait.
// when req is sent, we receive ack,
// after that data will be sent.
// when data_wait is LOW ,data is sampled and
// when HIGH, data will not be sampled how to write assertion for this condition?
// when data_wait=LOW the data should not be equal to zero and
// when data_wait is HIGH the data should either zero or unknown.
ap_req_ack: assert property(@(posedge clk) $rose(req) |-> ack[->1]);
ap_ack2data: assert property(@(posedge clk) $rose(ack) |->
data_wait==1[->1] ##1 data_wait==0[->1]);
ap_datawait1: assert property((data_wait==1 |-> data==0 || data=='X));
ap_datawait0: assert property((data_wait==0 |-> data!=0 && data!='X));