Code Browser Pages:
| //////////////////////////////////////////////// ////s~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~s//// ////s www.testbench.in s//// ////s s//// ////s VMM Tutorial s//// ////s s//// ////s gopi@testbench.in s//// ////s~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~s//// //////////////////////////////////////////////// class Driver_callbacks extends vmm_xactor_callbacks; virtual task pre_send(); endtask virtual task post_send(); endtask endclass class Driver extends vmm_xactor; function new(); super.new("Driver","class"); endfunction virtual task main(); super.main(); forever begin `vmm_callback(Driver_callbacks,pre_send()); $display(" Driver: Started Driving the packet ...... 0",$time); // Logic to drive the packet goes hear // lets consider that it takes 40 timeunits to drive a packet. #40; $display(" Driver: Finished Driving the packet ...... 0",$time); `vmm_callback(Driver_callbacks,post_send()); end endtask endclass |