mirror of https://github.com/Qortal/Brooklyn
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
794 B
35 lines
794 B
`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
|
|
|