-
Notifications
You must be signed in to change notification settings - Fork 1
/
ID_EX_reg.v
executable file
·54 lines (49 loc) · 1.68 KB
/
ID_EX_reg.v
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
module ID_EX(input clk,
input reset,
input [1:0] WB_input,
input [2:0] M_input,
input [3:0] EX_input,
input [31:0] RdData1_in,
input [31:0] RdData2_in,
input [31:0] sign_ext_in,
input [4:0] Inst_25_to_21_in,
input [4:0] Inst_20_to_16_in,
input [4:0] Inst_15_to_11_in,
input [5:0] Inst_5_to_0_in,
output reg[1:0] WB_output,
output reg[2:0] M_output,
output reg[3:0] EX_output,
output reg[31:0] RdData1_out,
output reg[31:0] RdData2_out,
output reg[31:0] sign_ext_out,
output reg[4:0] Inst_25_to_21_out,
output reg[4:0] Inst_20_to_16_out,
output reg[4:0] Inst_15_to_11_out,
output reg[5:0] Inst_5_to_0_out);
always@ (posedge reset) begin
WB_output = 0;
M_output = 0;
EX_output = 0;
RdData1_out = 0;
RdData2_out = 0;
sign_ext_out = 0;
Inst_15_to_11_out = 0;
Inst_20_to_16_out = 0;
Inst_25_to_21_out = 0;
Inst_5_to_0_out = 0;
end
always@ (posedge clk) begin
if(reset == 0)begin
WB_output <= WB_input;
M_output <= M_input;
EX_output <= EX_input;
RdData1_out <= RdData1_in;
RdData2_out <= RdData2_in;
sign_ext_out <= sign_ext_in;
Inst_15_to_11_out <= Inst_15_to_11_in;
Inst_20_to_16_out <= Inst_20_to_16_in;
Inst_25_to_21_out <= Inst_25_to_21_in;
Inst_5_to_0_out <= Inst_5_to_0_in;
end
end
endmodule