-
Notifications
You must be signed in to change notification settings - Fork 0
/
EXMEM_reg.v
53 lines (50 loc) · 1.36 KB
/
EXMEM_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
53
module EXMEM_reg(
clk,
reset,
iResult,
iControlSignal,
iDatabusB,
iRegAddress,
iPC_plus_4,
oResult,
oControlSignal,
oDatabusB,
oRegAddress,
oPC_plus_4
);
input clk, reset;
input [31:0] iResult;
input [31:0] iControlSignal;
input [31:0] iDatabusB;
input [4:0] iRegAddress;
input [31:0] iPC_plus_4;
output reg [31:0] oResult;
output reg [31:0] oControlSignal;
output reg [31:0] oDatabusB;
output reg [4:0] oRegAddress;
output reg [31:0] oPC_plus_4;
initial begin
oResult = 32'h00000000;
oControlSignal = 32'h00000000;
oDatabusB = 32'h00000000;
oRegAddress = 5'b0;
oPC_plus_4 = 32'h00000000;
end
always@(posedge clk or posedge reset) begin
if(reset) begin
oResult <= 32'b0;
oControlSignal <= 32'b0;
oDatabusB <= 32'b0;
oRegAddress <= 5'b0;
oPC_plus_4 <= 32'h80000000;
end
else
begin
oResult <= iResult;
oControlSignal <= iControlSignal;
oDatabusB <= iDatabusB;
oRegAddress <= iRegAddress;
oPC_plus_4 <= iPC_plus_4;
end
end
endmodule