aboutsummaryrefslogtreecommitdiff
path: root/src/pc_reg.v
blob: 91bf85f5a66eac8640d20ef780b902d4c2939d7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
module pc_reg (
  input clk, 
  input rstn,

  input we,
  input [31:0] pc_in,

  output reg [31:0] pc
);

parameter PC_INITIAL = 32'h0001_0000;

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

endmodule