How to debug set_config_int?

Hi,

Any suggestions on how to best debug problems with set_config_int(). I created a new env and am trying to set a config bit in a driver, but it’s not getting set. I checked for typos, the path is correct, and the bit in question is defined in the `ovm_field_int macro.

Here are some snippets of code

class axi_master_driver extends ovm_driver #(axi_burst);

    // Config for read/write driver enabled. Some masters may only drive read
    //  or write channels. Default to enabled(1) for each.
    bit read_master_enable  = 1;
    bit write_master_enable = 1;
 
    // OVM Macros
    `ovm_component_utils_begin(axi_master_driver)
        `ovm_field_int(read_master_enable, OVM_ALL_ON)
        `ovm_field_int(write_master_enable, OVM_ALL_ON)
    `ovm_component_utils_end
class axi_master_agent extends ovm_agent;

    ovm_active_passive_enum is_active = OVM_ACTIVE;

    // Declarations for agent sub-components
    axi_monitor           monitor;
    axi_master_driver     driver;
    axi_master_sequencer  sequencer;
  
    // OVM Macros
    `ovm_component_utils_begin(axi_master_agent)
        `ovm_field_int(is_active, OVM_ALL_ON)
    `ovm_component_utils_end

    // Constructor
    function new(string name, ovm_component parent);
        super.new(name,parent);
    endfunction
   
    // OVM build()
    virtual function void build();
        super.build();
        monitor = axi_monitor::type_id::create("monitor",this);
        if (is_active == OVM_ACTIVE) begin
            // Build the sequencer and driver.
            sequencer = axi_master_sequencer::type_id::create("sequencer",this);
            driver = axi_master_driver::type_id::create("driver",this);
        end
    endfunction : build
// Top-Level Verification Environment  
class top_env extends ovm_env;

    axi_master_agent    axi_wr_master;

    function void build();

        super.build();

        set_config_int("axi_wr_master.sequencer", "count", 0);
        set_config_int("axi_wr_master.driver", "read_master_enable", 0);
        axi_wr_master = axi_master_agent::type_id::create("axi_wr_master", this);
        axi_wr_master.build();

        end

-Doug

Hi Doug,

You can use print_config_settings to debug problems with set_config_. In your case, I would put print_config_settings in build() of axi_master_driver. If the path is correct, other common “errors” that result in set_config not working are: 1/ the field was not registered (with `ovm_field_*), or 2/ super.build() was not called in build().

For more info on how print_config_setting works, please see the OVM_Reference.pdf document.

Phu,

Indeed, the problem was that I was not calling super.build() in the build() implementation in my driver.

Thanks for your help…
-Doug

I would like to share my mistake also, it is kind of stupid mistake, but it really took me a half day to debug it.

class producer extends uvm_component;

int size = 0;
task run;
void’(get_config_int(“size”,size));
endtask
endclass

class env extends uvm_component;

producer p;
function void build ();
super.build();
p = producer::type_id::create(“producer”,this); → instead of P i mistyped as PRODUCER
endfunction
endclass

class test1 extends uvm_test;

env env_;
function void build ();
super.build();
set_config_int( “env_.p”, “size”, 2);
env_ = env::type_id::create(“env_”, this);
endfunction

endclass