How to register associative array of enum with enum key in UVM factory?

Hello,

I have an associative array of enum with another enum as a key to associative array. Currently UVM doesn’t have field macro to register this in the UVM factory.

I am getting below warning if I use “`uvm_field_aa_int_enumkey”

======================================================================
`uvm_field_aa_int_enumkey(e_cmd_type, scen_dist, UVM_ALL_ON)
|
ncelab: *W,ENUMERR (./testbench.sv,37|69): This assignment is a violation of SystemVerilog strong typing rules for enumeration datatypes.

Is there anyway I can avoid this warning?

Link to edaplayground code. : Associative array of enums - EDA Playground

Thanks.

In reply to jaykshah_1989:

You can avoid this by not using the UVM field macros. They are extremely inefficient and it is better to code the underlying structures yourself.

In reply to cgales:

Hi Cgales,

Thanks for the response.

Since the macro “`uvm_field_aa_enum_enumkey” is not available in the UVM package we defined it in our local environment and did an explicit cast to the enum type to fix this.

Thanks,
Jay