有没有办法在系统 verilog 中将字符串转换为枚举?
typedef enum {ABC1,ABC2,ABC3} abc;
program Test ;
abc x1;
string teststring;
initial
begin
teststring="ABC2";
x1=abc'(teststring); // Static cast doesn't work
$display("[%s][%0d]",teststring,x1);
end
endprogram