-
Notifications
You must be signed in to change notification settings - Fork 1
/
id_ex.v
46 lines (42 loc) · 1.3 KB
/
id_ex.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
`include "defines.v"
module id_ex(input wire clk,
input wire rst,
input wire [`AluOpBus] id_aluop,
input wire [`AluSelBus] id_alusel,
input wire [`RegBus] id_reg1,
input wire [`RegBus] id_reg2,
input wire [`RegAddrBus] id_wd,
input wire id_wreg,
input wire [`RegBus] id_link_address,
input wire [`RegBus] id_inst,
output reg [`AluOpBus] ex_aluop,
output reg [`AluSelBus] ex_alusel,
output reg [`RegBus] ex_reg1,
output reg [`RegBus] ex_reg2,
output reg [`RegAddrBus] ex_wd,
output reg ex_wreg,
output reg [`RegBus] ex_link_address,
output reg [`RegBus] ex_inst);
always @(posedge clk) begin
if (rst == `RstEnable) begin
ex_aluop <= `EXE_NOP_OP;
ex_alusel <= `EXE_RES_NOP;
ex_reg1 <= `ZeroWord;
ex_reg2 <= `ZeroWord;
ex_wd <= `NOPRegAddr;
ex_wreg <= `WriteDisable;
ex_link_address <= `ZeroWord;
ex_inst <= `ZeroWord;
end
else begin
ex_aluop <= id_aluop;
ex_alusel <= id_alusel;
ex_reg1 <= id_reg1;
ex_reg2 <= id_reg2;
ex_wd <= id_wd;
ex_wreg <= id_wreg;
ex_link_address <= id_link_address;
ex_inst <= id_inst;
end
end
endmodule