Quantcast
Channel: UVM Forums RSS Feed
Viewing all articles
Browse latest Browse all 756

Trouble setting object using config_db

$
0
0

I'm having trouble using the config_db mechanism to set a property in a uvm component that is an object.

 

Using the same flow/mechanisms for an integer property seems to work fine but the setting of a property defined using uvm_field_object doesn't work.

 

The essence of the code is extracted below.

 

Any ideas?

 

Thanks.

 

Walker

 

 

 

  // my_foo_struct_t is class that extends foo_struct_t class
  my_foo_struct_t foo_struct;

  virtual function void build_phase(uvm_phase phase);

    super.build_phase(phase);

    chip = chip_t::type_id::create("c", this);

    foo_struct = new();

    // Set the foo_struct property in any sub-component to this component's foo_struct
    // foo_struct is a uvm_field_object in one component type
    // This doesn't work
    uvm_config_db#(foo_struct_t)::set(this, "*", "foo_struct", foo_struct);

    // Set the foo property in any sub-component
    // foo is a uvm_field_int in several component types
    // This does work
    uvm_config_db#(int)::set(this, "*", "foo", 33);

  endfunction : build_phase

 


Viewing all articles
Browse latest Browse all 756

Trending Articles