Altera_Forum
Honored Contributor
16 years agopleez,, URGENT!! about loops in verilog?
Hey all;
I'm trien to write a loop in verilog to initialize all the entries in an array of 128 to a value of zero, and I'm having the following error: procedural continuous assignment to register is not supported ==================================== here is my code :: ==================================== // Instruction Memory module imem(clk, reset, wr_enable,fetch_enable, mem_out, address, mem_in); input clk; input reset; input wr_enable; input fetch_enable; // this will control startin or stopin running stored commands input [4:0] address; output [31:0]mem_out; input [31:0]mem_in; reg [31 :0]mem_out; reg [31 :0]array_reg[127:0]; //can save 128 instruction integer i; initial while(i< 128) begin assign i = i+1; mem_out[i]<= 32'hfffff; end always @(posedge clk) begin if(fetch_enable) begin if (reset) begin mem_out <= 32'd0; end else if(!wr_enable) begin mem_out <= array_reg[address]; end else array_reg[address] <= mem_in; end end endmodule =================================== thaanks in advance :)