On 10 Mar 2007, at 9:58:51 PM, lingwitt@xxxxxxxxxxxxx wrote:
Nested for loops don't seem to work in iverilog. it would seem that only the inner loop is updated.
Consider the following:
module TestMultiplier;
reg signed [7:0 ] x, y; wire signed [15:0] z;
initial begin $dumpvars;
for (x = -128; x < 128; x = x + 1) for (y = -128; y < 128; y = y + 1) #1 $display("%d * %d = %d", x, y, x*y); end
endmodule
Here x is always -128
Any help would be appreciated.
It works when x and y are integers:
module TestMultiplier;
integer x, y;
initial begin $dumpvars;
for (x = -128; x < 128; x = x + 1) for (y = -128; y < 128; y = y + 1) #1 $display("%d * %d = %d", x, y, x*y); end
endmodule
Seems to be a bug.
_______________________________________________ geda-user mailing list geda-user@xxxxxxxxxxxxxx http://www.seul.org/cgi-bin/mailman/listinfo/geda-user