blob: e41135860769910db61f73816fa40762349bfc7b [file] [log] [blame]
lowRISC Contributors802543a2019-08-31 12:12:56 +01001// Copyright lowRISC contributors.
2// Licensed under the Apache License, Version 2.0, see LICENSE for details.
3// SPDX-License-Identifier: Apache-2.0
4
5class ${name}_agent extends dv_base_agent #(
Srikrishna Iyer627f7822020-01-15 21:39:29 -08006 .CFG_T (${name}_agent_cfg),
7 .DRIVER_T (${name}_driver),
lowRISC Contributors802543a2019-08-31 12:12:56 +01008% if has_separate_host_device_driver:
Srikrishna Iyer627f7822020-01-15 21:39:29 -08009 .HOST_DRIVER_T (${name}_host_driver),
10 .DEVICE_DRIVER_T(${name}_device_driver),
lowRISC Contributors802543a2019-08-31 12:12:56 +010011% endif
Srikrishna Iyer627f7822020-01-15 21:39:29 -080012 .SEQUENCER_T (${name}_sequencer),
13 .MONITOR_T (${name}_monitor),
14 .COV_T (${name}_agent_cov)
15);
lowRISC Contributors802543a2019-08-31 12:12:56 +010016
17 `uvm_component_utils(${name}_agent)
18
19 `uvm_component_new
20
21 function void build_phase(uvm_phase phase);
22 super.build_phase(phase);
23 // get ${name}_if handle
Srikrishna Iyer627f7822020-01-15 21:39:29 -080024 if (!uvm_config_db#(virtual ${name}_if)::get(this, "", "vif", cfg.vif)) begin
lowRISC Contributors802543a2019-08-31 12:12:56 +010025 `uvm_fatal(`gfn, "failed to get ${name}_if handle from uvm_config_db")
Srikrishna Iyer627f7822020-01-15 21:39:29 -080026 end
lowRISC Contributors802543a2019-08-31 12:12:56 +010027 endfunction
28
29endclass