In reply to saurabhchauhan:
Two problems arise over the fact that your my_config class is not derived from uvm_component. Both problem occur regardless of whether you try to use the commend line or config_db::set from your test.
The first is the path used to set the config value. Since it is not part of the component hierarchy, these config items exist at the top level, and are not part of m_env. The second is that the field macros apply settings only for fields in classes derived from uvm_component. You need to explicitly apply the settings.
what is the method to change the uvm_field_int() parameters based on a random value in the object, example pack or no pack based on a value of my_data1 (in the example above) to be UVM_NOPACK for example
It does not work. I had to do my own implementation of the pack with uvm_object_utils instead of uvm_object_utils_begin… It could be a tool issue! The do_pack function always works though but requires work. The `uvm_field_int should have worked too with just changing the flags but it did not do the job not sure why!,