//// Push the packet in to mailbox for scoreboard /////
$display(" %0d : Driver : Finished Driving the packet with length %0d",$time,length);
end else begin $display (" %0d Driver : ** Randomization failed. **",$time);
////// Increment the error count in randomization fails ////////
end end endtask : start
Now we will take the instance of the driver in the environment class.
1) Declare a mailbox "drvr2sb" which will be used to connect the scoreboard and driver.
2) Declare a driver object "drvr".
3) In build method, construct the mail box.
drvr2sb = new();
4) In build method, construct the driver object. Pass the input_intf and "drvr2sb" mail box.
5) To start sending the packets to the DUT, call the start method of "drvr" in the start method of Environment class.