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_agent.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_agent.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: Agent for data_input
14
//=============================================================================
15
 
16
`ifndef DATA_INPUT_AGENT_SV
17
`define DATA_INPUT_AGENT_SV
18
 
19
// You can insert code here by setting agent_inc_before_class in file data_input.tpl
20
 
21
class data_input_agent extends uvm_agent;
22
 
23
  `uvm_component_utils(data_input_agent)
24
 
25
  uvm_analysis_port #(input_tx) analysis_port;
26
 
27
  data_input_config       m_config;
28
  data_input_sequencer_t  m_sequencer;
29
  data_input_driver       m_driver;
30
  data_input_monitor      m_monitor;
31
 
32
  local int m_is_active = -1;
33
 
34
  extern function new(string name, uvm_component parent);
35
 
36
  // You can remove build/connect_phase and get_is_active by setting agent_generate_methods_inside_class = no in file data_input.tpl
37
 
38
  extern function void build_phase(uvm_phase phase);
39
  extern function void connect_phase(uvm_phase phase);
40
  extern function uvm_active_passive_enum get_is_active();
41
 
42
  // You can insert code here by setting agent_inc_inside_class in file data_input.tpl
43
 
44
endclass : data_input_agent
45
 
46
 
47
function  data_input_agent::new(string name, uvm_component parent);
48
  super.new(name, parent);
49
  analysis_port = new("analysis_port", this);
50
endfunction : new
51
 
52
 
53
// You can remove build/connect_phase and get_is_active by setting agent_generate_methods_after_class = no in file data_input.tpl
54
 
55
function void data_input_agent::build_phase(uvm_phase phase);
56
 
57
  // You can insert code here by setting agent_prepend_to_build_phase in file data_input.tpl
58
 
59
  if (!uvm_config_db #(data_input_config)::get(this, "", "config", m_config))
60
    `uvm_error(get_type_name(), "data_input config not found")
61
 
62
  m_monitor     = data_input_monitor    ::type_id::create("m_monitor", this);
63
 
64
  if (get_is_active() == UVM_ACTIVE)
65
  begin
66
    m_driver    = data_input_driver     ::type_id::create("m_driver", this);
67
    m_sequencer = data_input_sequencer_t::type_id::create("m_sequencer", this);
68
  end
69
 
70
  // You can insert code here by setting agent_append_to_build_phase in file data_input.tpl
71
 
72
endfunction : build_phase
73
 
74
 
75
function void data_input_agent::connect_phase(uvm_phase phase);
76
  if (m_config.vif == null)
77
    `uvm_warning(get_type_name(), "data_input virtual interface is not set!")
78
 
79
  m_monitor.vif = m_config.vif;
80
  m_monitor.analysis_port.connect(analysis_port);
81
 
82
  if (get_is_active() == UVM_ACTIVE)
83
  begin
84
    m_driver.seq_item_port.connect(m_sequencer.seq_item_export);
85
    m_driver.vif = m_config.vif;
86
  end
87
 
88
  // You can insert code here by setting agent_append_to_connect_phase in file data_input.tpl
89
 
90
endfunction : connect_phase
91
 
92
 
93
function uvm_active_passive_enum data_input_agent::get_is_active();
94
  if (m_is_active == -1)
95
  begin
96
    if (uvm_config_db#(uvm_bitstream_t)::get(this, "", "is_active", m_is_active))
97
    begin
98
      if (m_is_active != m_config.is_active)
99
        `uvm_warning(get_type_name(), "is_active field in config_db conflicts with config object")
100
    end
101
    else
102
      m_is_active = m_config.is_active;
103
  end
104
  return uvm_active_passive_enum'(m_is_active);
105
endfunction : get_is_active
106
 
107
 
108
// You can insert code here by setting agent_inc_after_class in file data_input.tpl
109
 
110
`endif // DATA_INPUT_AGENT_SV
111
 

powered by: WebSVN 2.1.0

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