Coverage sample if request came on same address with-in 10ns

Hi,

I have 2 agents in Testbench, and both have different transaction class and I have 64-bit address field. Now I want to write coverage such that if any one agent has requested write/read operation on address 64’h1000 and with-in 10ns other agent initiate write/read operation on same address(64’h1000) then my coverage bins should be hit.

Here both agent can send write request and read request, I want to such case as well that if agent 1 initiate write request on any address and agent 2 initiate read request on same address with in 10ns then my coverage bins should hit.

example,



bit [63:0] addr;
agent_1 agt1;
agent_2 agt2;

// bins example,
coverpoint mix_request addr;
{
  bins same_addr1 = {agt1.addr == 64h1000 && agt1.write && agt2.addr == 64'h1000 && agt2.write} iff (/*if both agent request write/read operation with-in 10ns*/); // not sure how to sample this condition
  bins same_addr2 = {agt1.addr == 64h2000 && agt1.write && agt2.addr == 64'h2000 && agt2.read} iff (/*if both agent request write/read operation with-in 10ns*/);
  bins same_addr3 = {agt1.addr == 64h3000 && agt1.read && agt2.addr == 64'h3000 && agt2.write} iff (/*if both agent request write/read operation with-in 10ns*/);
}

Here I also want to cover all the address range, as I have 64-bit address field I cannot write bins for each address.

Thanks,
J_M

In reply to J_M:

Covergroups need some auxiliary code to help capture temporal relationships. You’ll need to capture timestamps in your transaction classes, then compare the timestamps and addresses between the two agent’s transactions. When your requirements are satisfied, you can trigger a covergroup sample.

But you need to be more specific about how to “cover all the address range” as a 64-bit range is not practical.