Hi,
I am trying to read a enum from a file, but i dont see that is being driven from Sequence to driver and in the print statements. The example has read.txt which has 2 enum’s and reading it from seq_a. Appreciate the help.
Hi,
I am trying to read a enum from a file, but i dont see that is being driven from Sequence to driver and in the print statements. The example has read.txt which has 2 enum’s and reading it from seq_a. Appreciate the help.
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:
`uvm_sequence_utils is deprecated. Use
`uvm_object_utils instead