How to use different print styles for parent and child uvm objects when using print/sprint uvm_object methods?

Hi all,

I have an uvm_object which has as property a queue of childs uvm_objects.

I would like to print it using object print method but with a different uvm_printer style for parent and childs. In particular I want to use
table style for parent and line style for childs.

In the following an example code.


class status_obj extends uvm_object;
    string   tag;
    bit      status;

    `uvm_object_utils_begin(status_obj)
        `uvm_field_string(tag, UVM_DEFAULT)
        `uvm_field_int(status, UVM_DEFAULT)
    `uvm_object_utils_end
	
     function new(string name = "status_obj");
     ...
endclass
    
class global_status_obj extends uvm_object;
    status_obj status_queue[$];
	
    `uvm_object_utils_begin(global_status_obj)
        `uvm_field_queue_object(status_queue, UVM_DEFAULT)
    `uvm_object_utils_end
	
    function new(string name = "global_status_obj");
    ...
endclass

Can anyone help me with this?

Thanks in advance

Kind Regards

We strongly recommend avoiding the uvm_field_* macros. See the paper reference here and look at the section on using do_print() to build your own print formatting functionality.