-
Notifications
You must be signed in to change notification settings - Fork 1
/
Code_21 Time Consuming_phase multiple_component.sv
101 lines (75 loc) · 2.56 KB
/
Code_21 Time Consuming_phase multiple_component.sv
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
`include "uvm_macros.svh"
import uvm_pkg::*;
class driver extends uvm_driver;
`uvm_component_utils(driver)
function new(string path = "test", uvm_component parent = null);
super.new(path, parent);
endfunction
task reset_phase(uvm_phase phase);
phase.raise_objection(this);
`uvm_info("drv", "Driver Reset Started", UVM_NONE);
#100;
`uvm_info("drv", "Driver Reset Ended", UVM_NONE);
phase.drop_objection(this);
endtask
task main_phase(uvm_phase phase);
phase.raise_objection(this);
`uvm_info("drv", "Driver Main Phase Started", UVM_NONE);
#100;
`uvm_info("drv", "Driver Main Phase Ended", UVM_NONE);
phase.drop_objection(this);
endtask
endclass
///////////////////////////////////////////////////////////////
class monitor extends uvm_monitor;
`uvm_component_utils(monitor)
function new(string path = "monitor", uvm_component parent = null);
super.new(path, parent);
endfunction
task reset_phase(uvm_phase phase);
phase.raise_objection(this);
`uvm_info("mon", "Monitor Reset Started", UVM_NONE);
#300;
`uvm_info("mon", "Monitor Reset Ended", UVM_NONE);
phase.drop_objection(this);
endtask
task main_phase(uvm_phase phase);
phase.raise_objection(this);
`uvm_info("mon", "Monitor Main Phase Started", UVM_NONE);
#400;
`uvm_info("mon", "Monitor Main Phase Ended", UVM_NONE);
phase.drop_objection(this);
endtask
endclass
////////////////////////////////////////////////////////////////////////////////////
class env extends uvm_env;
`uvm_component_utils(env)
driver d;
monitor m;
function new(string path = "env", uvm_component parent = null);
super.new(path, parent);
endfunction
function void build_phase(uvm_phase phase);
super.build_phase(phase);
d = driver::type_id::create("d", this);
m = monitor::type_id::create("m", this);
endfunction
endclass
////////////////////////////////////////////////////////////////////////////////////////
class test extends uvm_test;
`uvm_component_utils(test)
env e;
function new(string path = "test", uvm_component parent = null);
super.new(path, parent);
endfunction
function void build_phase(uvm_phase phase);
super.build_phase(phase);
e = env::type_id::create("e", this);
endfunction
endclass
///////////////////////////////////////////////////////////////////////////
module tb;
initial begin
run_test("test");
end
endmodule