-
Notifications
You must be signed in to change notification settings - Fork 4
/
coverage.sv
38 lines (28 loc) · 839 Bytes
/
coverage.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
class coverage extends uvm_component;
`uvm_component_utils(coverage)
transaction_in req;
uvm_analysis_imp#(transaction_in, coverage) req_port;
int n_tr = 0;
event end_of_simulation;
// covergroup cg();
// //add your covergroup
// endgroup : cg
function new(string name = "coverage", uvm_component parent= null);
super.new(name, parent);
req_port = new("req_port", this);
req = new;
// cg = new;
endfunction
function void build_phase(uvm_phase phase);
super.build_phase (phase);
endfunction
task main_phase(uvm_phase phase);
// phase.raise_objection(this);
endtask: main_phase
function void write(transaction_in t);
req.copy(t);
// cg.sample();
// if($get_coverage() == 100)
// running_phase.drop_objection(this);
endfunction: write
endclass : coverage