This is a simple SystemVerilog question that I am having a surprisingly difficult time finding the answer for.
In this kind of bit array initialization syntax, is the b[0] part assigned to a’s most significant bit, or the least significant bit?
bit a[7:0];
bit b[7:0] = 8'hff;
bit c[7:0] = 8'h00;
a = {b[0], c[6:0]};
So does a[0] == 1 or a[7] == 1?
The reason you’ve found it hard to find an answer is because the result is dependent on how you’ve declared things.
You’ve declared
ato be[7:0]. Therefore the bits inaare arranged like this:You then assign
{b[0], c[6:0}toa:A[7] == 1If you’d declared
ato be[0:7]the result would have been:A[0] == 1