on-internet
← Community

How do I fix this foreach loop variable syntax error?

Stack Overflow ·

I am trying to use foreach in SystemVerilog. What I am doing wrong here? `define size 3:0 //variable module tb; reg [7:0] temp; initial begin temp = 8'd25; $display("%d", temp[`size]); foreach ((temp[`size])[i]) $display("%d", temp[i]); (temp[`size])[i] = 1'b0; end endmodule

Comments

Sign in or sign up to comment and upvote.

No comments yet.