In this phase we will write a constraint random testcase.
Lets verify the DUT by sending large packets of length above 200.
1) In testcase file, define a small_packet class.
This calls is inherited from the packet class and data.size() field is constraint to generate the packet with size greater than 200.
class small_packet extends packet;
constraint small_c { data.size > 200 ; }
endclass
2) In program block, create an object of the small_packet class.
Then call the build method of env.
small_packet spkt;
3) Pass the object of the small_packet to the packet handle which is in driver.
env.drvr.gpkt = spkt;
Then call the reset(),cfg_dut(),start(),wait_for_end() and report() methods as in the run method.