input [31:0] write_data; input [4:0] write_reg; reg [31:0] registers [31:0]; always @(*) assign registers[write_reg] = write_data;
You need to synchronously assign to registers. Because the synthesizer parses it and routes to a physical register (i.e. flip-flop)
always @(posedge clk) my_reg = my_data;