diff options
author | Joshua Yun <jjyun4@illinois.edu> | 2023-08-28 14:42:23 -0500 |
---|---|---|
committer | Joshua Yun <jjyun4@illinois.edu> | 2023-08-28 14:42:23 -0500 |
commit | c1fa3c36da28e9e947f6279329c47777f31fe7a2 (patch) | |
tree | bd321c8e33200427b23bffe96c7c1bae90d8a044 /verilog/pc.v | |
parent | d069ea63cce08c0f5c8d7da7f8ab05115bd8d856 (diff) | |
download | riscv-processor-inorder-master.tar.gz |
Diffstat (limited to 'verilog/pc.v')
-rw-r--r-- | verilog/pc.v | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/verilog/pc.v b/verilog/pc.v new file mode 100644 index 0000000..a7c6b6d --- /dev/null +++ b/verilog/pc.v @@ -0,0 +1,20 @@ +`default_nettype none +`timescale 1ns/1ps + +module pc +( + input wire we, clk, rst, + input wire [31:0] pc_new, + output reg [31:0] pc +); + +always @ (posedge clk or posedge rst) begin + if (rst) begin + pc <= 0; + end + else if (we) begin + pc <= pc_new; + end +end + +endmodule |