2

システム verilog で文字列を enum にキャストする方法はありますか?

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
4

1 に答える 1