OpenCores
URL https://opencores.org/ocsvn/lpffir/lpffir/trunk

Subversion Repositories lpffir

[/] [lpffir/] [trunk/] [uvm/] [lpffir_uvm/] [generated_tb/] [tb/] [data_input/] [sv/] [data_input_coverage.sv] - Blame information for rev 11

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 11 vladimirar
// You can insert code here by setting file_header_inc in file common.tpl
2
 
3
//=============================================================================
4
// Project  : generated_tb
5
//
6
// File Name: data_input_coverage.sv
7
//
8
//
9
// Version:   1.0
10
//
11
// Code created by Easier UVM Code Generator version 2016-04-18-EP on Sat Apr 27 13:59:59 2019
12
//=============================================================================
13
// Description: Coverage for agent data_input
14
//=============================================================================
15
 
16
`ifndef DATA_INPUT_COVERAGE_SV
17
`define DATA_INPUT_COVERAGE_SV
18
 
19
// You can insert code here by setting agent_cover_inc_before_class in file data_input.tpl
20
 
21
class data_input_coverage extends uvm_subscriber #(input_tx);
22
 
23
  `uvm_component_utils(data_input_coverage)
24
 
25
  data_input_config m_config;
26
  bit               m_is_covered;
27
  input_tx          m_item;
28
 
29
  // Start of inlined include file generated_tb/tb/include/data_input_cover_inc.sv
30
  covergroup m_cov;
31
    option.per_instance = 1;
32
 
33
    cp_data: coverpoint m_item.data {
34
      bins data_values[] = {[0:127]};
35
    }
36
  endgroup
37
  // End of inlined include file
38
 
39
  // You can remove new, write, and report_phase by setting agent_cover_generate_methods_inside_class = no in file data_input.tpl
40
 
41
  extern function new(string name, uvm_component parent);
42
  extern function void write(input input_tx t);
43
  extern function void build_phase(uvm_phase phase);
44
  extern function void report_phase(uvm_phase phase);
45
 
46
  // You can insert code here by setting agent_cover_inc_inside_class in file data_input.tpl
47
 
48
endclass : data_input_coverage
49
 
50
 
51
// You can remove new, write, and report_phase by setting agent_cover_generate_methods_after_class = no in file data_input.tpl
52
 
53
function data_input_coverage::new(string name, uvm_component parent);
54
  super.new(name, parent);
55
  m_is_covered = 0;
56
  m_cov = new();
57
endfunction : new
58
 
59
 
60
function void data_input_coverage::write(input input_tx t);
61
  m_item = t;
62
  if (m_config.coverage_enable)
63
  begin
64
    m_cov.sample();
65
    // Check coverage - could use m_cov.option.goal instead of 100 if your simulator supports it
66
    if (m_cov.get_inst_coverage() >= 100) m_is_covered = 1;
67
  end
68
endfunction : write
69
 
70
 
71
function void data_input_coverage::build_phase(uvm_phase phase);
72
  if (!uvm_config_db #(data_input_config)::get(this, "", "config", m_config))
73
    `uvm_error(get_type_name(), "data_input config not found")
74
endfunction : build_phase
75
 
76
 
77
function void data_input_coverage::report_phase(uvm_phase phase);
78
  if (m_config.coverage_enable)
79
    `uvm_info(get_type_name(), $sformatf("Coverage score = %3.1f%%", m_cov.get_inst_coverage()), UVM_MEDIUM)
80
  else
81
    `uvm_info(get_type_name(), "Coverage disabled for this agent", UVM_MEDIUM)
82
endfunction : report_phase
83
 
84
 
85
// You can insert code here by setting agent_cover_inc_after_class in file data_input.tpl
86
 
87
`endif // DATA_INPUT_COVERAGE_SV
88
 

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.