hello everone,
i want to know how we can get coverage from assertion(which command we should use for runtime and compile time)?
In reply to prashu:
That is going to be tools specific, so you need to look in your tools reference manual.
In reply to prashu:
Hi Prashu,
I’m not sure how it works with Compile time, (Will wait for experts to respond to that)
but here is a part of the solution you requested for, (run-time) coverage with assertions,
here is my code snippet for I2C assertions with coverage,
module con_assertion( i2c_if_i intf)
sequence I2Cstart;
@(posedge intf.SCL) !intf.SDA
@(negedge intf.SCL) intf.SDA;
endsequence: I2Cstart
sequence ReceiveAddr;
logic[6:0] temp=0;
int i=0;
@(posedge intf.SCL)
(1, temp[i]= intf.SDA,i++,cgADDR = temp)[*7]
@(posedge intf.SCL)
(1, cgRD_WR = intf.SDA)
@(posedge intf.SCL)
(1, cgACK = intf.SDA, cg.sample());
endsequence: ReceiveAddr
sequence ReceiveData;
logic[7:0] temp=0;
int i=0;
@(posedge intf.SCL)
(1, temp[i]= intf.SDA,i++)[*8]
@(posedge intf.SCL)
(1, cgACK = intf.SDA, cg.sample());
endsequence: ReceiveData
sequence I2Cstart;
@(posedge intf.SCL) intf.SDA
@(negedge intf.SCL) !intf.SDA;
endsequence: I2Cstart
property I2C
I2Cstart |-> ReceiveAddr |-> ReceiveData [0:10] |-> I2Cstop
endproperty: I2C
covergroup: cg
coverpoint cgDATA;
coverpoint cgADDR;
coverpoint cgRD_WR;
coverpoint cgACK;
endgroup: cg
endmodule: con_assertion
Thank you for your time, any kind of suggestions/corrections are welcome!!
Gooday!