Environment class.
Virtual interface declaration.
Defining Environment class constructor.
Defining required methods for execution . Currently these methods will not be implemented in this phase.
All the above are done in Environment .sv file.
We will write a testcase using the above define environment class in testcase.sv file.
Environment Class:
The class is a base class used to implement verification environments.
Environment class is extension on vmm_env class. The testbench simulation needs some systematic flow like reset, initialize etc. vmm_env base class has methods formalize the simulation steps. All methods are declared as virtual methods.
We will not implement all the vmm_env virtual methods in this phase but will we print messages from these methods to understand the simulation execution.
Testcase contains the instance of the environment class and has access to all the public declaration of environment class. This testcase Creates a Environment object and calls the run() method which are defined in the environment class. Run() method runs all the simulation methods which are defined in environment class.
Verification environment contains the declarations of the virtual interfaces. These virtual interfaces are pointed to the physical interfaces which are declared in the top module.
Constructor method should be declared with virtual interface as arguments, so that when the object is created, in the testcase can pass the interfaces in to environment class.
Connecting the virtual interfaces of Environment class to the physical interfaces of top module.
(S)Run the simulation: vcs -sverilog -f filelist -R -ntb_opts rvm
(S)Log report after the simulation:
******************* 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 Environment() at 0: End of reset_dut() method Normal[NOTE] on Environment() at 0: Start of cfg_dut() method Normal[NOTE] on Environment() at 0: End of cfg_dut() method Normal[NOTE] on Environment() at 0: Start of start() method Normal[NOTE] on Environment() at 0: End of start() method Normal[NOTE] on Environment() at 0: Start of wait_for_end() method Normal[NOTE] on Environment() at 0: End of wait_for_end() method Normal[NOTE] on Environment() at 0: Start of stop() method Normal[NOTE] on Environment() at 0: End of stop() method Normal[NOTE] on Environment() at 0: Start of cleanup() method Normal[NOTE] on Environment() at 0: End of cleanup() method Normal[NOTE] on Environment() at 0: Start of report() method --------------------------------------------------------------------- Simulation PASSED on /./ (/./) at 0 (0 warnings, 0 demoted errors & 0 demoted warnings) ---------------------------------------------------------------------
Normal[NOTE] on Environment() at 0: End of report() method ******************** End of testcase *****************