-
Notifications
You must be signed in to change notification settings - Fork 1
/
Code_23 Drain_Time Single_Component.sv
46 lines (37 loc) · 1.18 KB
/
Code_23 Drain_Time Single_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
`include "uvm_macros.svh"
import uvm_pkg::*;
/////Default Timeout = 9200sec
class comp extends uvm_component;
`uvm_component_utils(comp)
function new(string path = "comp", uvm_component parent = null);
super.new(path, parent);
endfunction
task reset_phase(uvm_phase phase);
phase.raise_objection(this);
`uvm_info("comp","Reset Started", UVM_NONE);
#10;
`uvm_info("comp","Reset Completed", UVM_NONE);
phase.drop_objection(this);
endtask
task main_phase(uvm_phase phase);
phase.phase_done.set_drain_time(this,200);
phase.raise_objection(this);
`uvm_info("mon", " Main Phase Started", UVM_NONE);
#100;
`uvm_info("mon", " Main Phase Ended", UVM_NONE);
phase.drop_objection(this);
endtask
task post_main_phase(uvm_phase phase);
`uvm_info("mon", " Post-Main Phase Started", UVM_NONE);
endtask
function void build_phase(uvm_phase phase);
super.build_phase(phase);
endfunction
endclass
///////////////////////////////////////////////////////////////////////////
module tb;
initial begin
// uvm_top.set_timeout(100ns, 0);
run_test("comp");
end
endmodule