hello,
I would like to know if it is possible to know the type of variable?
I wrote the following parametrize function and want to know what is the variable type in case of failure:
class paramerized_functions_class #(type enum_type = event_type_e);
// this function casts string to enumerated variable
static function enum_type string2enum_cast (string str);
enum_type e = e.first();
// go trough the enums and check if str is equal to the enum name
do begin
if (e.name() == str)
return e;
e=e.next();
end while (e != e.last()); // stop when the last enumerated value is reached
//if reached here, no match was found and casting failed
`**uvm_fatal("CAST", $sformatf("string to enum casting failed, %s is not of type %S", str, ??? ));**
endfunction : string2enum_cast
endclass : paramerized_functions_class
thanks, Kobi.