aboutsummaryrefslogtreecommitdiff
path: root/rtl/src/pc_reg.v
blob: ac2ff50bb616cf462368afc4f4964b3c3ed7f8d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// pc reg:
// Stores current pc.

module pc_reg (
  input             clk, 
  input             rstn,

  input             we,
  input      [31:0] pc_in,

  output reg [31:0] pc
);

`include "include/consts.vh"

always @ (posedge clk or negedge rstn) begin
  if (!rstn)   pc <= PC_INITIAL;
  else if (we) pc <= pc_in;
end

endmodule