-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcoverage.sv
38 lines (28 loc) · 805 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 min_tr;
int n_tr = 0;
event end_of_simulation;
function new(string name = "coverage", uvm_component parent= null);
super.new(name, parent);
req_port = new("req_port", this);
req=new;
min_tr = 10000;
endfunction
function void build_phase(uvm_phase phase);
super.build_phase (phase);
endfunction
task run_phase(uvm_phase phase);
phase.raise_objection(this);
@(end_of_simulation);
phase.drop_objection(this);
endtask: run_phase
function void write(transaction_in t);
n_tr = n_tr + 1;
if(n_tr >= min_tr)begin
->end_of_simulation;
end
endfunction: write
endclass : coverage