In This phase, we will the usage of vmm atomic generator. In phase 4, using`vmm_atomic_gen macro we defined Packet_atomic_gen.
In Environment class, we will create an instance of Packet_atomic_gen, and connect it to the instance of Packet_channel, i.e gen2drvr_chan. The Packet_channel instance gen2drvr_chan will be used to connect the atomic generator to the driver instance. We will also configure the atomic generator to generate 10 instances of packet.
1) In Environment class, declare a Packet_atomic_gen instance.
Packet_atomic_gen atomic_gen;
2) Declare a Packet_channel instance.
Packet_channel gen2drvr_chan;
3) Construct the gen2drvr_chan in build() method.
gen2drvr_chan = new("gen2drvr","chan");
4) Construct the atomic_gen in build() method.
atomic_gen = new("atomic_gen",0,gen2drvr_chan);
5) Configure the atomic_gen to generate 10 instances.
atomic_gen.stop_after_n_insts = 10;
6) In start() method, start the atomic_gen.
atomic_gen.start_xactor();
7) In stop() method, call the stop_xactor() method of atomic_gen.
(S)Run the simulation vcs -sverilog -f filelist -R -ntb_opts rvm
(S)Log file report:
******************* Start of testcase **************** Normal[NOTE] on Environment() at 0: Created env object Normal[NOTE] on Environment() at 0: Start of gen_cfg() method Normal[NOTE] on Environment() at 0: End of gen_cfg() method Normal[NOTE] on Environment() at 0: Start of build() method Normal[NOTE] on Environment() at 0: End of build() method Normal[NOTE] on Environment() at 0: Start of reset_dut() method Normal[NOTE] on Environemnt() at 60: End of reset_dut() method Normal[NOTE] on Environemnt() at 60: Start of cfg_dut() method Normal[NOTE] on Environemnt() at 90: Port 0 Address 00 Normal[NOTE] on Environemnt() at 110: Port 1 Address 11 Normal[NOTE] on Environemnt() at 130: Port 2 Address 22 Normal[NOTE] on Environemnt() at 150: Port 3 Address 33 Normal[NOTE] on Environemnt() at 170: End of cfg_dut() method Normal[NOTE] on Environemnt() at 170: Start of start() method Normal[NOTE] on Environemnt() at 170: End of start() method Normal[NOTE] on Environemnt() at 170: Start of wait_for_end() method Normal[NOTE] on Environemnt() at 10170: End of wait_for_end() method Normal[NOTE] on Environemnt() at 10170: Start of stop() method Normal[NOTE] on Environemnt() at 10170: End of stop() method Normal[NOTE] on Environemnt() at 10170: Start of cleanup() method Normal[NOTE] on Environemnt() at 10170: End of cleanup() method Normal[NOTE] on Environemnt() at 10170: Start of report() method --------------------------------------------------------------------- Simulation PASSED on /./ (/./) at 10170 (0 warnings, 0 demoted errors & 0 demoted warnings) ---------------------------------------------------------------------
Normal[NOTE] on Environemnt() at 10170: End of report() method ******************** End of testcase *****************