In reply to blipton:
When declaring packed array dimensions, the range(size) comes before(left) the variable name and the unpacked dimension range comes after(right) of the variable name. When making a reference to the array, all the selected dimensions are on the right of the variable name.
When you declare adcData as
logic [ 31 : 0 ] adcData  ; // 3 ADCs, each with 16 Channels and 32 bits wide
You need to know the ordering to select the proper index. adcData
is selecting the 32-bit packed data for the 1st
ADC and the 3rd
channel. And adcData
would be selecting an array of 16 channels of the 1st
However if you declared it as
logic [ 31 : 0 ] adcData  ; // 16 Channels, each with 3 ADCs and 32 bits wide
is now selecting the 32-bit packed data for the 1st
channel and the 3rd
ADC. And adcData
would be selecting an array of 3 ADCs of the 1st
For your simple statements where you are always selecting a single packed array of 32-bits, the order that you declare the dimensions does not matter. It start to become more significant when you take slices of the array or need to stream the array reformatting the layout (i.e. an array of 192 bytes).