In reply to rag123:
You cannot convert a string to an enum label directly. Fortunately the UVM has a utility helper class uvm_enum_wrapper that you can use.
string instc_str;
...
count_items = $fscanf(file_handle,"%s",instc_str);
if (count_items && !uvm_enum_wrapper#(inst_e)::from_name(instc_str,instc) )
`uvm_error("bad_enum",instc_str)
A couple of other notes about your example:
- You should `include "uvm_macros.svh", not `uvm_pkg.sv. Most tools already compile the UVM package for you (and EDAPlayground takes advantage of that)—you are compiling it as an extra step.
- `uvm_sequence_utils is deprecated. Use `uvm_object_utils instead