In this phase we will implement the configuration class. All the requirements of the testbench configurations will be declared inside this class. Virtual interfaces required by verification components driver and receiver for connecting to DUT are declared in this class. We will also declare 4 variables which will hold the port address of the DUT.
ovm_object does not have the simulation phases and can be used in get_config_object and set_config_object method. So we will implement the configuration class by extending ovm_object.
Configuration
1) Define configuration class by extending ovm_object
3) Declare 4 variables which holds the device port address.
bit [7:0] device0_add ;
bit [7:0] device1_add ;
bit [7:0] device2_add ;
bit [7:0] device3_add ;
4) ovm_object required to define the ovm_object::creat() method.
ovm_object::create method allocates a new object of the same type as this object and returns it via a base ovm_object handle.
In create method, we have to construct a new object of configuration class and update all the important fields and return it.
virtualfunction ovm_object create(string name="");
Configuration t = new();
In top module we will create an object of the above defined configuration class and update the interfaces so that all the verification components can access to physical interfaces in top module using configuration class object.
1) Declare a Configuration class object
Configuration cfg;
2) Construct the configuration object and update the interfaces.
/////////////////////////////////////////////////////
// Creat Configuration and Strart the run_test//
/////////////////////////////////////////////////////