Hello,
this is my first question and i"m just learning the language right now.
assume that i have in the program:
bit [7:0] data [16]
bit [15:0] str
I tried to make something like this, with the purpose of masking the data according to the str bits:
bit [127:0] mask_data
foreach (str[n]) begin
if(str[n] == 0)
mask_data[8n + 7 -: 8 ] = 8’b00000000
else
mask_data[8n + 7 -: 8] = data[n]
end
but the compilation cant be success because of the left side of the , which is not constant, and its a function of n.
do you have an idea what should i do in this situation, and how can i assign the data_mask with dependent on a variable?
thanks a lot
Yotam