PPK
1
Hi,
I was observed that, in my testbench, inside env setting enum value as shown below::
enum{MON_UNSPECIFIED, MON_CONTROLLER, MON_TARGET} mode;
mode=MON_TARGET;
uvm_config_db#(uvm_bitstream_t)::set(this, "arf_agent.*", "mon_mode", mode);
inside arf_agent monitor, it is shown below::
mode mon_mode = MON_UNSPECIFIED;
when I print the mon_mode, it is printing the MON_TARGET.
But here there is no uvm_config_db#()::get()method.
Is it possible to get the value which is set in the config_db, without using get() method?
dave_59
2
In reply to PPK:
Are you using the field automation macros `uvm_field_*?
PPK
3
In reply to dave_59:
Hi Dave Rich,
yes, inside monitor, its shown below:
`uvm_field_enum (mode, mon_mode, UVM_ALL_ON)
But what is the relation between config_db methods and the field automation macros?
dave_59
4
In reply to PPK:
Along with their poor performance, this is one of the many reasons we recommend not using the field macros.
When using the field macros in a class derived from uvm_component, its build_phase calls apply_config_settings.
You can prevent this from happening by not using the field macros, or not calling super.build_phase in your component’s build_phase.
The field macros do make it quick and easy to get compare and print functionality in transactions, but I rarely see that needed in components.