%Error: t/t_genvar_for_bad.v:22: Genvar not legal in non-generate for (IEEE 1800-2017 27.4): 't.i' : ... Suggest move for loop upwards to generate-level scope. for (i=0; i