-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEXMEM.sv
More file actions
56 lines (55 loc) · 1.26 KB
/
EXMEM.sv
File metadata and controls
56 lines (55 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
module EXMEM (
input logic [31:0] ALU,
input logic [6:0] opcode,
input logic cond,
input logic [31:0] instr,
input logic [4:0] reg_dst,
input logic clk,
input logic [31:0] reg2,
input logic mem_write,
input logic alu_write,
input logic [1:0] cmd_type,
output logic [31:0] ALU_output,
output logic [31:0] instr_o,
output logic [6:0] opcode_o,
output logic cond_o,
output logic [4:0] reg_dst_o,
output logic [31:0] reg2_o,
output logic mem_write_o,
output logic alu_write_o,
output logic [1:0] cmd_type_o
);
reg [31:0] ALU_output_tmp;
reg [6:0] opcode_tmp;
reg cond_tmp;
reg [31:0] instr_tmp;
reg [4:0] reg_dst_tmp;
reg [31:0] reg2_tmp;
reg mem_write_tmp;
reg alu_write_tmp;
reg [1:0] cmd_type_tmp;
always_comb
begin
ALU_output_tmp = ALU;
opcode_tmp = opcode;
cond_tmp = cond;
instr_tmp = instr;
reg_dst_tmp = reg_dst;
reg2_tmp = reg2;
mem_write_tmp = mem_write;
alu_write_tmp = alu_write;
cmd_type_tmp = cmd_type ;
end
always_ff @(posedge clk)
begin
ALU_output <= ALU_output_tmp ;
opcode_o <= opcode_tmp ;
cond_o <= cond_tmp ;
instr_o <= instr_tmp ;
reg_dst_o <= reg_dst_tmp;
reg2_o <= reg2_tmp ;
mem_write_o <= mem_write_tmp;
alu_write_o <= alu_write_tmp;
cmd_type_o <= cmd_type_tmp;
end
endmodule