diff options
author | Flavian Kaufmann <flavian@flaviankaufmann.ch> | 2024-05-12 21:27:41 +0200 |
---|---|---|
committer | Flavian Kaufmann <flavian@flaviankaufmann.ch> | 2024-05-12 21:27:41 +0200 |
commit | deb7d0a6fc76d5250c238d479cf97d4755abef01 (patch) | |
tree | 395c266ff4757e83e151d1286d6d2388e63d9a9c /src/pc_reg.v | |
parent | 008059fbe4e960a10bb4c444013129e0aaa02818 (diff) | |
download | riscv_cpu-deb7d0a6fc76d5250c238d479cf97d4755abef01.tar.gz riscv_cpu-deb7d0a6fc76d5250c238d479cf97d4755abef01.zip |
refactoring
Diffstat (limited to 'src/pc_reg.v')
-rw-r--r-- | src/pc_reg.v | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/pc_reg.v b/src/pc_reg.v new file mode 100644 index 0000000..9d7600b --- /dev/null +++ b/src/pc_reg.v @@ -0,0 +1,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 |