-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_fifo_full.sv
More file actions
65 lines (45 loc) · 1.14 KB
/
Copy pathtest_fifo_full.sv
File metadata and controls
65 lines (45 loc) · 1.14 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
class test_fifo_full extends transaction;
static bit count_n;
function pre_randomize();
r_en.rand_mode(0);
w_en.rand_mode(0);
r_en = 0;
w_en = 1;
endfunction
// function post_randomize();
// if(empty!=1) begin
// w_en=0;
// r_en=1;
// rst_n=1;
// $display("write");
// end
// if(count_n!=DEPTH) begin
// w_en=1;
// r_en=0;
// rst_n=1;
// count_n++;
// $display("write");
// end
// endfunction
endclass
program test(fifo_interface f_int);//.fifo_testBench
timeunit 1ns;
timeprecision 1ns;
test_fifo_full rt;
env environment;
initial begin
rt=new();
rt.count_n=0;
environment=new(35, f_int);
$cast(environment.gen.t,rt);
environment.run();
// if(rt.count_n==rt.DEPTH) begin
// if(rt.full==1 && rt.empty==0) begin
// $display("FIFO_FULL Test passed");
// end
// else begin
// $display("FIFO_FULL Test passed");
// end
// end
end
endprogram