Casting into an enum

I would assume the error appears because VCS doesn’t allow $cast(…) to anything other than class objects. I don’t mean any casts in your code, I mean casts in the UVM code. You’re defining an analysis port parameterized with a struct. Try changing to:


class command_s;
  byte unsigned A;
  byte unsigned B;
  operation_t op;
endclass

and using new(…) where required. The error might go away. Moreover, it might be that UVM requires classes to extend from uvm_object. If that’s the case, just add extends uvm_object to the class declaration.