Added initialisation blocks for PC and GPR's

This commit is contained in:
riley committed 2026-10-16 11:33:45 +11:00
1 parent 12ae58ad86
commit 0ea3e0fa12
2 files changed
+7 -1

No files matched your search

+5
View File
@@ -8,6 +8,11 @@ module instruction_counter #(parameter width=5)(
); );
logic [2**width-1:0] pc; logic [2**width-1:0] pc;
initial begin
pc = {(2**width){1'b0}};
end
always_ff @(posedge clk) begin always_ff @(posedge clk) begin
if (we) begin if (we) begin
pc <= W; pc <= W;
+2 -1
View File
@@ -12,7 +12,8 @@ module register_file #(parameter width=5, parameter nregs=5)(
logic [2**width-1:0] regs[2**nregs]; logic [2**width-1:0] regs[2**nregs];
initial begin initial begin
regs[0] = {(2**width){1'b0}}; for (integer N = 0; N < (2**nregs); ++N)
regs[N] = 32'd0;
end end
always_ff @(posedge clk) begin always_ff @(posedge clk) begin