ELEC50010-IAC-CW/rtl/mips_cpu_pc.v
Aadi Desai f2f8e05010 PC logic updated
PC now has a delay into instr_mem to match MIPS32 spec and pc resets/initialises to MIPS32 reset vector
2020-12-02 17:23:28 +00:00

25 lines
356 B
Verilog

module pc(
input logic clk,
input logic rst,
input logic[31:0] pc_in,
output logic[31:0] pc_out
);
reg[31:0] pc_curr;
initial begin
pc_curr = 32'hBFC00000;
end : initial
always_comb begin
if (rst) begin
pc_curr = 32'hBFC00000;
end
pc_out = pc_curr;
end
always_ff @(posedge clk) begin
pc_curr <= pc_in;
end
endmodule : pc