Hi,
I am seeing Dynamic cast failure in UVM TB. I have a enum of type bit and when i cast it with logic signal in interface dynamic cast fails. If it change it to bit in interface again it works. Any idea why ?
Error-[STASKE_DCF] Dynamic cast failed
ahb_mmonitor.svh, 87
Dynamic cast using ‘$cast’ failed. The source expression is not yielding a
valid value for the destination variable.
// Assignment in Interface
logic [1:0] HTRANS;
A bit is a two-state signal, while a logic is a four-state signal. If you attempt to cast a logic vector which contains an ‘x’ or ‘z’ to a two-state signal, you will get a casting error.