Line 1, is quite a dangerous assignment, as it “quietly” removes Xs and Zs in the original 4 state variable
without any warning. So $isunknown() check has to be used before this assignment.
The only question what would you do if $isunknown() returns true… Assigning da to 0 is one solution,
but that is equivalent to assigning a bit vector of 48 zeros to da. I would even suggest a $fatal() if
Xs and Zs are found.
But the problem I am experiencing with $isunknown() us explained below:
line 0: if($isunknown(packer.unpack_field_int($bits(da)))) begin
line 1: `uvm_fatal()
line 2: end
line 3: else begin
line 4: da = packer.unpack_field_int($bits(da));
line 5: end
In the above logic, I need to use two lines for unpacking based on the value of $isunknown(), that actually doesn’t unpack correctly as in the line 0, unpacking is already done but it did not store the value of da. I don’t know what I can do to solve this.