I'm stuck on a problem I encountered with a use of the streaming operator to unpack into a dynamic array. Rather than write procedural code, I thought I could use it actually with some amount of success. Here is what the code more or less looks like:
uvm_pack_bitstream_t bit_vector;
bit bit_array[];
...
bit_vector = packer.get_packed_bits();
{<<{bit_array with [0 +: packer.count]}} = bit_vector;
myfunc(bit_array);
Yes, I'm trying to use "unadvertised" features of the UVM packer here. This has worked in many cases, but there is one case that led to the following:
# ** Fatal: Width do not match. Stream larger than variable.
I thought maybe the packer count was too large compared to the bits returned from the packer, but similar scenarios had executed previously in the simulation without error.
BTW, this is the only thing reported in the error, which is followed by the file and line number where it occurred (i.e. the streaming operator above).
So, any ideas or insight as to what is going on here?
TIA