-
Notifications
You must be signed in to change notification settings - Fork 5
/
TestBench1.v
114 lines (80 loc) · 2 KB
/
TestBench1.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
108
109
110
111
112
113
114
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 12/28/2020 07:01:35 AM
// Design Name:
// Module Name: TB
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module TB();
reg IRDY, FRAME, reset;
wire DEVSEL, TRDY, AD_direction;
reg [3:0] CBE;
reg [31:0] AD;
//wire [31:0] AD_out;
wire [31:0] AD_bus;
assign AD_bus = (AD_direction)? AD: 32'bz;
reg CLK;
always begin
#5 CLK = ~CLK;
end
TargetDevice TD(.AD(AD_bus), .CBE(CBE), .FRAME(FRAME), .clock(CLK), .IRDY(IRDY), .AD_direction(AD_direction),
.DEVSEL(DEVSEL), .TRDY(TRDY), .reset(reset));
initial begin
CLK=1;reset=0; FRAME = 1; AD=32'bz; CBE=4'bz; IRDY= 1;
#1
reset=1;
#1
reset=0;
#3 //neg 1
FRAME = 0; AD=3; CBE=4'b0111; IRDY= 1;
#10 //neg 2
FRAME = 0; AD=0; CBE=4'b1111; IRDY= 0;
#10 //neg 3
FRAME = 0; AD=0; CBE=4'b1111; IRDY= 0;
#10 //neg 4
FRAME = 0; AD=0; CBE=4'b1111; IRDY= 0;
#10 //neg 6
FRAME = 1; AD=0; CBE=4'b1111; IRDY= 0;
#10 //neg 7
FRAME = 1; AD=32'bz; CBE=4'b1111; IRDY= 1;
///////////////
#10 //neg 1
FRAME = 0; AD=3; CBE=4'b0111; IRDY= 1;
#10 //neg 2
FRAME = 0; AD=(1<<32)-1; CBE=4'b0010; IRDY= 0;
#10 //neg 3
FRAME = 0; AD=(1<<32)-1; CBE=4'b0010; IRDY= 0;
#10 //neg 4
FRAME = 0; AD=(1<<32)-1; CBE=4'b0100; IRDY= 0;
#10 //neg 6
FRAME = 1; AD=(1<<32)-1; CBE=4'b1000; IRDY= 0;
#10 //neg 7
FRAME = 1; AD=32'bz; CBE=4'b1111; IRDY= 1;
//read transaction
#10 //neg 8 (1)
FRAME = 0; AD = 3; CBE = 4'b0110; IRDY = 1;
#10 //neg 9 (2)
FRAME = 0; AD = 32'bz; CBE = 4'b1111; IRDY = 0;
#10 //neg 9 (3)
FRAME = 0; AD = 32'bz; CBE = 4'b1111; IRDY = 0;
#10 //neg 9 (4)
FRAME = 0; AD = 32'bz; CBE = 4'b1111; IRDY = 0;
#10 //neg 9 (7)
FRAME = 1; AD = 32'bz; CBE = 4'b1111; IRDY = 0;
#10 //neg 9 (8)
FRAME = 1; AD = 32'bz; CBE = 4'b1111; IRDY = 1;
end
endmodule