lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 1 | // Copyright lowRISC contributors. |
| 2 | // Licensed under the Apache License, Version 2.0, see LICENSE for details. |
| 3 | // SPDX-License-Identifier: Apache-2.0 |
| 4 | |
| 5 | class ${name}_agent extends dv_base_agent #( |
Srikrishna Iyer | 627f782 | 2020-01-15 21:39:29 -0800 | [diff] [blame] | 6 | .CFG_T (${name}_agent_cfg), |
| 7 | .DRIVER_T (${name}_driver), |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 8 | % if has_separate_host_device_driver: |
Srikrishna Iyer | 627f782 | 2020-01-15 21:39:29 -0800 | [diff] [blame] | 9 | .HOST_DRIVER_T (${name}_host_driver), |
| 10 | .DEVICE_DRIVER_T(${name}_device_driver), |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 11 | % endif |
Srikrishna Iyer | 627f782 | 2020-01-15 21:39:29 -0800 | [diff] [blame] | 12 | .SEQUENCER_T (${name}_sequencer), |
| 13 | .MONITOR_T (${name}_monitor), |
| 14 | .COV_T (${name}_agent_cov) |
| 15 | ); |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 16 | |
| 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 Iyer | 627f782 | 2020-01-15 21:39:29 -0800 | [diff] [blame] | 24 | if (!uvm_config_db#(virtual ${name}_if)::get(this, "", "vif", cfg.vif)) begin |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 25 | `uvm_fatal(`gfn, "failed to get ${name}_if handle from uvm_config_db") |
Srikrishna Iyer | 627f782 | 2020-01-15 21:39:29 -0800 | [diff] [blame] | 26 | end |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 27 | endfunction |
| 28 | |
| 29 | endclass |