Modelling delay through a mailbox

In reply to eoghaino:

Based on the different result posted by you, looks like the issue with get_lookup_request task.

mailbox store/carry/copy the handle of the object, not the entire data pointed by that handle.

Look like get_lookup_request modified the data of handle before it used by the lookup_driver.
so create new handle/object for every request.


      task get_lookup_request();
         forever begin
            @(negedge lkup_slave_if.slave.clk);
            if(lkup_slave_if.slave.ready === 1'b1 && lkup_slave_if.slave.valid === 1'b1) begin
               
               //create new object 
               lkup_req_trans = new();

               this.lkup_req_trans.key = this.lkup_slave_if.slave.key;
               $display("Time %t, Got Lookup Request %h", $realtime, lkup_req_trans.key);
               this.lkup_mbx.put(this.lkup_req_trans);
            end
         end
      endtask