PDA

View Full Version : array of enum type



ankit1
02-05-2008, 05:33 AM
Hi All,

can anybody tell me if I want to use ovm macro for array of enum type?
In code 1 I can use `ovm_field_enum for hsize.
but in code 2 I can't use `ovm_field_enum for hsize.

************************************************** *******************
code 1:
************************************************** *******************
rand transfer_size_e hsize;

`ovm_object_utils_begin(packet)
`ovm_field_enum (transfer_size_e, hsize, OVM_ALL_ON)
`ovm_object_utils_end
************************************************** ***********************
************************************************** *******************
code 2:
************************************************** *******************
rand transfer_size_e hsize [ ];

`ovm_object_utils_begin(packet)
`ovm_field_enum (transfer_size_e, hsize, OVM_ALL_ON)
`ovm_object_utils_end
************************************************** ***********************

hansv
02-06-2008, 11:11 PM
I don't see
`ovm_field_array_enum(...) in the reference manual or the source code. This may be an oversight - I'll let others comment on that.

For code 2, try
`ovm_field_array_int(hsize, OVM_ALL_ON) which may still work based on the integral type underlying the enumerated type transfer_size_e (default is int).