2020-12-02 17:23:28 +00:00
|
|
|
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;
|
2020-12-07 21:46:01 +00:00
|
|
|
end // initial
|
2020-12-02 17:23:28 +00:00
|
|
|
|
|
|
|
always_comb begin
|
|
|
|
if (rst) begin
|
|
|
|
pc_curr = 32'hBFC00000;
|
2020-12-07 21:46:01 +00:00
|
|
|
end else begin
|
|
|
|
pc_curr = pc_in;
|
2020-11-30 12:08:58 +00:00
|
|
|
end
|
2020-12-07 21:46:01 +00:00
|
|
|
|
2020-12-02 17:23:28 +00:00
|
|
|
end
|
2020-11-30 12:08:58 +00:00
|
|
|
|
2020-12-02 17:23:28 +00:00
|
|
|
always_ff @(posedge clk) begin
|
2020-12-07 21:46:01 +00:00
|
|
|
pc_out <= pc_curr;
|
2020-12-02 17:23:28 +00:00
|
|
|
end
|
2020-11-30 12:08:58 +00:00
|
|
|
|
2020-12-07 21:46:01 +00:00
|
|
|
endmodule // pc
|