commit 3fb0e424315c665d5d40b29553d3e62fb23e96d3 Author: YunMao <13325803302@126.com> Date: Tue Mar 19 19:22:45 2019 +0800 pc_ori 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