Setting a string/int inside uvm_object using UVM command line processor method

class top_env extends uvm_env;

     // ------------------------
     // UVM Component Utility macro
     // ------------------------
        `uvm_component_utils_begin(top_env)
         `uvm_field_object(cfg, UVM_ALL_ON)
        `uvm_component_utils_end

     // ------------------------
     // SOC System Configuration
     // ------------------------
        configuration_obj cfg;
.......
endclass: top_env

class configuration_obj extends uvm_object;

   `uvm_object_utils_begin (configuration_obj)
     `uvm_field_string(temp_name, UVM_ALL_ON)
   `uvm_object_utils_end

   string temp_name;

   /** Constructor */
   function new (string name = "configuration_obj");
     super.new(name);
   endfunction

 endclass: configuration_obj

In the above code I want to set the value of temp_name string using command line processor method. Is there any way I can set this value? I tried the following methods but nothing is helping me.

+uvm_set_config_string=uvm_test_top.top_uvm_env.cfg,temp_name,SAURABH
+uvm_set_config_string=uvm_test_top.top_uvm_env..*,temp_name,SAURABH
+uvm_set_config_string=uvm_test_top.top_uvm_env.*,temp_name,SAURABH

Thanks,
Saurabh

In reply to saurabh.sa27:

The string type in your config object is called name and not temp_name.

In reply to chr_sue:

I did a typo while typing the code here. Thanks for pointing the mistake.

In reply to saurabh.sa27:

But the mistake is still there?

In reply to chr_sue:

I made mistake while pasting code here. I checked my local code it doesn’t have the typo.
Still looking for the solution.

-Saurabh

In reply to saurabh.sa27:

You have to provide a string from the commandline like this:

+uvm_set_config_string=uvm_test_top.top_uvm_env.\*,temp_name, "SAURABH"

In reply to chr_sue:

In reply to saurabh.sa27:
You have to provide a string from the commandline like this:

+uvm_set_config_string=uvm_test_top.top_uvm_env.\*,temp_name, "SAURABH"

@chr_sue, I don’t think it will work, the commandline uvm_set_config_string need the arguments:


+uvm_set_config_string=<comp>,<field>,<value>

The first argument needs to be uvm_component, can’t be an uvm_object.

Since the “cfg” class in top_env class is an object, then I don’t think we can use +uvm_set_config_string to set value to cfg directly.