Brooklyn/arch/arm/mm/MEM_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

36 lines
794 B
Verilog

`include "settings.h"
module MEM_Reg
(
input clk,
input rst,
input [`REG_FILE_DEPTH-1:0] dst,
input [`WORD_WIDTH-1:0] ALU_res,
input [`WORD_WIDTH-1:0] mem,
input mem_read, WB_en,
output reg [`REG_FILE_DEPTH-1:0] dst_out,
output reg [`WORD_WIDTH-1:0] ALU_res_out,
output reg [`WORD_WIDTH-1:0] mem_out,
output reg mem_read_out, WB_en_out
);
always @(posedge clk, posedge rst) begin
if(rst) begin
dst_out <= 0;
ALU_res_out <= 0;
mem_out <= 0;
mem_read_out <= 0;
WB_en_out <= 0;
end
else begin
dst_out <= dst;
ALU_res_out <= ALU_res;
mem_out <= mem;
mem_read_out <= mem_read;
WB_en_out <= WB_en;
end
end
endmodule