-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTB_Forwarding.v
62 lines (49 loc) · 1.1 KB
/
TB_Forwarding.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
54
55
56
57
58
59
60
61
62
`include "Defines.v"
module TB_Forwarding();
reg en_forwarding;
reg WB_wb_en, MEM_wb_en;
reg [`REG_ADDRESS_LEN - 1:0] MEM_dst, WB_dst, ID_src1, ID_src2;
wire [1:0] sel_src1, sel_src2;
wire ignore_hazard;
Formarding forw(
.en_forwarding(en_forwarding),
.WB_wb_en(WB_wb_en),
.MEM_wb_en(MEM_wb_en),
.MEM_dst(MEM_dst),
.WB_dst(WB_dst),
.ID_src1(ID_src1),
.ID_src2(ID_src2),
.sel_src1(sel_src1),
.sel_src2(sel_src2),
.ignore_hazard(ignore_hazard)
);
initial begin
#250
en_forwarding = 1'b1;
MEM_wb_en = 1'b1;
MEM_dst = 4'd2;
ID_src1 = 4'd2;
#100
ID_src1 = 4'd1;
#100
ID_src2 = 4'd2;
#500
MEM_wb_en = 1'b0;
WB_wb_en = 1'b1;
WB_dst = 4'd2;
MEM_dst = 4'd2;
ID_src1 = 4'd2;
#100
ID_src1 = 4'd1;
#100
ID_src2 = 4'd2;
#500
MEM_wb_en = 1'b1;
WB_wb_en = 1'b1;
WB_dst = 4'd3;
MEM_dst = 4'd3;
ID_src2 = 4'd3;
#100
ID_src2 = 4'd1;
end
endmodule