Difference Between UVM_OBJECT and UVM_COMPONENT

In reply to sudheer:

Hi,
Here my two cents with the compilation of the differences.
Please correct me if i am wrong

  1. Uvm_object use uvm_object_param_util() instead of uvm_component_param_util() to declare the classes in the factory. This macro is normally done right after the beginning of the class.
  2. Uvm_objects doesn’t have build phase, components have it. All that is built in build phase exists from the start of the simulation until the end of simulation.
  3. UVM_OBJECTS doesn’t have phases at all, only the new/constructor function is defined for them
  4. Uvm_objects doesn’t have “parent” argument in the super.new(name) . Component have it super.new(name,parent). The same for create function. Objects do obj_t::type_id::create(“obj”); and components can do comp_t::type_id::create(“comp”,this); where this is obviously the parent of the created component.
  5. Uvm_objects are dynamic objects that once created with “new” and only exist for a specific time in the simulation. They are eliminated once the scope of the task where they were created finish. On the other side, components are semi-static classes that exist from the beginning of the simulation until the end of simulation. In other words, uvm_objects are transient, such as transactions that are created when needed and disappear when not used anymore.
  6. Uvm_components contains all methods the uvm_objects have. e.g. uvm_objects have clone/do_copy virtual methods, that can be used to clone/ do a deep copy of an object.
    A list of the methods can be found under uvm_object
    A list of the specific uvm_component methods uvm_component

I hope it helps.
Jonathan