From 3fb0e424315c665d5d40b29553d3e62fb23e96d3 Mon Sep 17 00:00:00 2001 From: YunMao <13325803302@126.com> Date: Tue, 19 Mar 2019 19:22:45 +0800 Subject: [PATCH] pc_ori --- Src/Core/pc_reg.v | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Src/Core/pc_reg.v diff --git a/Src/Core/pc_reg.v b/Src/Core/pc_reg.v new file mode 100644 index 0000000..46c86d5 --- /dev/null +++ b/Src/Core/pc_reg.v @@ -0,0 +1,24 @@ +`include "defines.v" + +module pc_reg(input wire clk, + input wire rst, + output reg[`InstAddrBus] pc, + output reg ce); + + always @ (posedge clk) begin + if (ce == `ChipDisable) begin + pc <= 32'h00000000; + end else begin + pc <= pc + 4'h4; + end + end + + always @ (posedge clk) begin + if (rst == `RstEnable) begin + ce <= `ChipDisable; + end else begin + ce <= `ChipEnable; + end + end + +endmodule