How do you initialize a register file? If I have the following register array:
logic [7:0] regs [7:0];
I can initialize one register in the array:
always_ff @(posedge clk) begin
if (!resetn) begin
regs[0] <= 8'b0;
end
end
But how do I do that for the whole array? Also, does it matter if I swap the indices after the variable name when declaring the array?
logic [7:0] regs [0:7];