While writing the following macro, I am getting the compile error:
`define TEST1(out, in, sel) \ \
integer i; \ \
always_comb begin \ \
out = $bits(1'b0); \\
for(i=0; i<=$bits(sel); i=i+1) \\
out = out | ({$bits(out){sel[i]}} & in[i]); \\
end ;
Error-msg:
near "[": syntax error, unexpected '[', expecting ',' or '}'.