3
0
mirror of https://github.com/Qortal/Brooklyn.git synced 2025-02-12 02:05:54 +00:00
Brooklyn/arch/arm/mm/IF_Reg.v

34 lines
708 B
Coq
Raw Normal View History

2022-04-02 18:08:56 +05:00
`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