**One of the annoying things of system verilog paramteter array is that only unpacked arrays are supported. So the override becomes cumbersome. Is there a better way to do the following:
The compiler doesn’t like the way I override the MASK. I am not sure what I am doing wrong here by creating the list for override. If NUM_DATA is large then is there an easier way to create the MASK for the override.
In reply to noel:
I am not sure what you mean by “only unpacked arrays are supported”. Parameters can be declared with any data type. Your parameter DATA_MASK is an unpacked array of a packed array.
Your problem is not with the override, but the way you declared localparam DATA_MASK. You declared localparam DATA_MASK without an explicit data type, and it is supposed to pick up the data type from the RHS of the assignment. But you have an assignment pattern on the RHS which requires a data type context from the LHS, which does not exist. The way you declared parameter DATA_MASK is correct. You just need to declare localparam DATA_MASK the same way
Thanks Dave. My mistake. What I meant was can I do the following (and this is for code that needs to be synthesized):
In the module data_array
parameter logic [(NUM_DATA-1):0][DATA_WIDTH-1):0] DATA_MASK = '{'1} // its a packed array here
In module instance
localparam logic [NUM_DATA-1:0] [DATA_WIDTH-1:0] DATA_MASK = '{32’hDEAD_BEEF, 32’hFFFF_FFFF, 32’hAAAA_AAAA};
So if I need to have all 1’s then I could say '1 and in the instance does the override have to be a list or can I just say '1. I was trying to see if the number are large like 100 then listing each would be tedious.