3
0
mirror of https://github.com/Qortal/Brooklyn.git synced 2025-02-15 19:55:53 +00:00
Brooklyn/arch/arm/mm/IF_Reg.v
Scare Crowe d2ebfd0519 QortalOS Titan 5.60.12
Screw the description like that inbred T3Q
2022-03-05 21:17:59 +05:00

34 lines
708 B
Verilog

`include "settings.h"
module IF_Reg
(
input clk,
input rst,
input freeze,
input flush,
input [`WORD_WIDTH-1:0] pc_in,
input [`WORD_WIDTH-1:0] instruction_in,
output reg [`WORD_WIDTH-1:0] pc,
output reg [`WORD_WIDTH-1:0] instruction
);
always @(posedge clk or posedge rst) begin
if(rst) begin
pc <= 0;
instruction <= 0;
end
else if(flush) begin
pc <= 0;
instruction <= 0;
end
else if(~freeze) begin
pc <= pc_in;
instruction <= instruction_in;
end
else begin
pc <= pc;
instruction <= instruction;
end
end
endmodule