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

Modifycation of uvm_object internals

$
0
0

Hi,
I would like to ask UVM familiar users/professionals to get an opinion on the following issue:

I am trying to modify uvm_object's internal fields during a run_phase of my testcase (or it could be
end_of_elaboration_phase or start_of_simulation_phase, important - environment is already built up).
Would you consider it like "this is something that should be working"?

- let's assume the object "ga_config" is agent configuration

- for simplicity there is only 1 data field "monitor_enable" in it

class ga_config extends uvm_object;

  // Variable: monitor_enable
  uvm_active_passive_enum monitor_enable = UVM_PASSIVE;

  function new (string name = "unnamed-ga_cfg");
    super.new(name);
    this.name = name;
  endfunction

  `uvm_object_utils_begin(ga_config)
    `uvm_field_enum  (uvm_active_passive_enum, monitor_enable, UVM_DEFAULT)
  `uvm_object_utils_end

endclass : ga_config

- "ga_cfg" is a name registered into uvm database in TB environment (in build phase)

  ga_cfg = ga_config::type_id::create("ga_cfg");
  uvm_config_db#(ga_config)::set(this, "ga_env0*", "ga_cfg", ga_cfg);


- "ga_cfg" is sourced from uvm database in agent monitor (in build phase)
 

class ga_monitor extends uvm_monitor;

  ga_config cfg;

...

  function void build_phase (uvm_phase phase);

   ...

  uvm_config_db#(ga_config)::get(this, "", "ga_cfg", cfg);

   ...

  endfunction

  …

endclass

 

  i.e I am expecting here to create a pointer to object "ga_cfg"


- NOW in testcase for example end_of_elaboration_phase I WANT TO MODIFY "monitor_enable" field
 

class my_testcase extends uvm_test;

...

  function void end_of_elaboration_phase (uvm_phase phase);

  uvm_config_db#(uvm_active_passive_enum)::set(this, "tb_env0.ga_env0.ga2.monitor.cfg", "monitor_enable", UVM_ACTIVE);

  endfunction

  …

endclass

 

  Note: assume the path "tb_env0.ga_env0.ga2.monitor.cfg" is something you can extract from
  hierarchy report (print_topology).


Unfortunately this latest command doesn't have desired effect. I’d expect to see monitor_enable value set to UVM_ACTIVE,

but I still see UVM_PASSIVE. Can anybody explain why?

 

I have seen some comments regarding issues w/ uvm_object hierarchy and UVM 1.1. Is it related to what I am trying to describe here?

Thanks Josef


Viewing all articles
Browse latest Browse all 756

Trending Articles