summaryrefslogtreecommitdiff
path: root/verilog/pc.v
diff options
context:
space:
mode:
authorJoshua Yun <jjyun4@illinois.edu>2023-08-28 14:42:23 -0500
committerJoshua Yun <jjyun4@illinois.edu>2023-08-28 14:42:23 -0500
commitc1fa3c36da28e9e947f6279329c47777f31fe7a2 (patch)
treebd321c8e33200427b23bffe96c7c1bae90d8a044 /verilog/pc.v
parentd069ea63cce08c0f5c8d7da7f8ab05115bd8d856 (diff)
downloadriscv-processor-inorder-master.tar.gz
Added new riscv processor design into git repoHEADmaster
Diffstat (limited to 'verilog/pc.v')
-rw-r--r--verilog/pc.v20
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