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

Subversion Repositories lpffir

[/] [lpffir/] [trunk/] [uvm/] [rca_uvm/] [generated_tb/] [tb/] [rca/] [sv/] [rca_agent.sv] - Blame information for rev 5

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 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: rca_agent.sv
7
//
8
//
9
// Version:   1.0
10
//
11
// Code created by Easier UVM Code Generator version 2016-04-18-EP on Tue Mar 19 21:50:30 2019
12
//=============================================================================
13
// Description: Agent for rca
14
//=============================================================================
15
 
16
`ifndef RCA_AGENT_SV
17
`define RCA_AGENT_SV
18
 
19
// You can insert code here by setting agent_inc_before_class in file rca.tpl
20
 
21
class rca_agent extends uvm_agent;
22
 
23
  `uvm_component_utils(rca_agent)
24
 
25
  uvm_analysis_port #(trans) analysis_port;
26
 
27
  rca_config       m_config;
28
  rca_sequencer_t  m_sequencer;
29
  rca_driver       m_driver;
30
  rca_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 rca.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 rca.tpl
43
 
44
endclass : rca_agent
45
 
46
 
47
function  rca_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 rca.tpl
54
 
55
function void rca_agent::build_phase(uvm_phase phase);
56
 
57
  // You can insert code here by setting agent_prepend_to_build_phase in file rca.tpl
58
 
59
  if (!uvm_config_db #(rca_config)::get(this, "", "config", m_config))
60
    `uvm_error(get_type_name(), "rca config not found")
61
 
62
  m_monitor     = rca_monitor    ::type_id::create("m_monitor", this);
63
 
64
  if (get_is_active() == UVM_ACTIVE)
65
  begin
66
    m_driver    = rca_driver     ::type_id::create("m_driver", this);
67
    m_sequencer = rca_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 rca.tpl
71
 
72
endfunction : build_phase
73
 
74
 
75
function void rca_agent::connect_phase(uvm_phase phase);
76
  if (m_config.vif == null)
77
    `uvm_warning(get_type_name(), "rca 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 rca.tpl
89
 
90
endfunction : connect_phase
91
 
92
 
93
function uvm_active_passive_enum rca_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 rca.tpl
109
 
110
`endif // RCA_AGENT_SV
111
 

powered by: WebSVN 2.1.0

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