-
Notifications
You must be signed in to change notification settings - Fork 1
/
GFAU_tb_ting.v
107 lines (98 loc) · 2.72 KB
/
GFAU_tb_ting.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
`timescale 1ns/10ps
`define CYCLE 10
`define HCYCLE 5
//`define SDFFILE "GFAU_syn.sdf"
module GFAU_tb;
localparam SIZE = 32;
reg i_rst, i_clk;
reg [SIZE - 1 : 0] in_0, in_1, prime;
reg [1 : 0] operation_select;
reg done_from_control;
wire [SIZE - 1 : 0] result;
wire done_to_control;
wire done_add, done_sub, done_mult, done_div;
wire [SIZE - 1 : 0] mult_out, div_out;
GFAU GFAU_test(
i_clk,
i_rst,
in_0,
in_1,
prime,
operation_select,
done_from_control,
result,
done_to_control,
done_add,
done_sub,
done_mult,
done_div
);
/* `ifdef SDF
initial $sdf_annotate(`SDFFILE, test);
`endif*/
initial begin
$fsdbDumpfile("GFAU_test_IC_lab.fsdb");
$fsdbDumpvars;
end
initial begin
i_rst = 0;
i_clk = 1;
in_0 = 86;
in_1 = 53;
prime = 97;
#(`CYCLE);
i_rst = 1;
#(`CYCLE);
i_rst = 0;
#(`CYCLE);
operation_select = 0;
done_from_control = 1;
#(`CYCLE);
#(`CYCLE);
#(`CYCLE);
#(`CYCLE);
#(`CYCLE);
#(`CYCLE);
#(`CYCLE);
#(`CYCLE);
#(`CYCLE);
#(`CYCLE);
#(`CYCLE);
/*if (u_out == 1 && v_out == 0) begin
$display(" ***************************************************** ");
$display(" ** ** /|__/|");
$display(" ** Congratulations !! ** / O,O \\");
$display(" ** ** /_____ \\");
$display(" ** All test results are right !! ** /^ ^ ^ \\ |");
$display(" ** ** |^ ^ ^ ^ |w|");
$display(" ***************************************************** \\m___m__|_|");
$display("\n");
$display("============================================================================");
end
else begin
$display ("FAIL!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
end*/
#(`CYCLE);
#(`CYCLE);
#(`CYCLE);
#(`CYCLE);
#(`CYCLE);
//i_rst = 1;
#(`CYCLE);
i_rst = 0;
#(`CYCLE);
#(`CYCLE);
#(`CYCLE);
#(`CYCLE);
#(`CYCLE);
#(`CYCLE);
#(`CYCLE);
#(`CYCLE);
#(`CYCLE);
#(`CYCLE);
#(`CYCLE);
#(`CYCLE * 100);
$finish;
end
always #(`CYCLE*0.5) i_clk = ~i_clk;
endmodule