-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathFIFO_Buffer_tb.v
More file actions
63 lines (53 loc) · 1.24 KB
/
FIFO_Buffer_tb.v
File metadata and controls
63 lines (53 loc) · 1.24 KB
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
`timescale 1ps/1ps
module FIFO_Buffer_tb
#( parameter DataWidth = 32)();
parameter BufferSize = 16;
reg clk, aclr;
reg Pop1, Pop2, Push;
reg [DataWidth-1:0] DataIn;
wire Empty, Full;
wire [BufferSize-1:0] ReadyM;
wire [DataWidth-1:0] DataOut1, DataOut2;
FIFO_Buffer #(.DataWidth(DataWidth))
dut (.clk(clk), .aclr(aclr), .Pop1(Pop1), .Pop2(Pop2), .Push(Push), .DataIn(DataIn),
.Empty(Empty), .Full(Full), .ReadyM(ReadyM), .DataOut1(DataOut1), .DataOut2(DataOut2));
initial begin
clk = 1;
aclr = 1;
DataIn = 0;
Push = 0;
Pop1 = 0;
Pop2 = 0;
#1
aclr = 0;
Push = 1;
Pop1 = 0;
Pop2 = 0;
#16
Push = 1;
Pop1 = 1;
Pop2 = 0;
#2
Push = 1;
Pop1 = 1;
Pop2 = 0;
#2
Push = 1;
Pop1 = 1;
Pop2 = 1;
#2
Push = 1;
Pop1 = 0;
Pop2 = 1;
#16
Push = 0;
Pop1 = 1;
Pop2 = 0;
#8
Push = 0;
Pop1 = 0;
Pop2 = 0;
end
always #1 clk = ~clk;
always #2 DataIn = DataIn + 1;
endmodule