-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtb_async_fifo.v
More file actions
107 lines (56 loc) · 1.31 KB
/
tb_async_fifo.v
File metadata and controls
107 lines (56 loc) · 1.31 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
//-----------------------------------------------
//
// Testbench for the asynchronous fifo module
//
// Created by: Shreyank Amartya
// Date: 01/22/2014
//
// Proficient Design LLC.
//
//
//----------------------------------------------
module tb_async_fifo;
parameter DSIZE = 8;
parameter ASIZE = 3;
parameter ALMOST_FULL_SIZE = 5;
parameter ALMOST_EMPTY_SIZE = 3;
//wr interface
// output wfull,
// output w_almost_full,
// input [DSIZE-1:0] wdata,
// input winc, wclk, wrst_n,
//rd interface
// output [DSIZE-1:0] rdata,
// output rempty,
// output r_almost_empty,
// input rinc, rclk, rrst_n
reg [DSIZE-1:0] write_data;
reg write_increment, write_clk, wrst_n;
reg read_increment, read_clk, rrst_n;
wire wfull;
wire w_almost_full;
wire [DSIZE-1:0] read_data;
wire rempty;
wire r_almost_empty;
// Initialize FIFO
initial
begin
end
// Read and Write Clcoks
// Case: Read clock is slower than write clock
always @*
begin
#2 write_clk = ~write_clk;
#3 read_clk = ~read_clk;
end
// Always block to write data into FIFO
always @(posedge write_clk)
begin
end
//Always block to read data from FIFO
always @(posedge read_clk)
begin
end
// Instantiate a fifo module
small_async_fifo F1();
endmodule