Pack_bytes padding issue

Hi,

i am trying to pack the object into byte array using pack_bytes().
while displaying the packed array i am getting the zero padding at the end of the byte.
{issue: Instead of 1 i am getting 8}
please find the code in the link below:

Thanks in advance

In reply to Mechanic:

The UVM Standard is not saying the last byte is filled with leading ‘0’. pack_bytes is starting with the most left entry. If the last data is not a complete byte it starts most left and fills the remaining places with ‘0’. This results in 8 instead of 1. See my example I wr wr as a 2 bit value. Then the last byte ‘0100’ which results in 4.

See here: