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 | |
Srikrishna Iyer | 607c404 | 2019-10-23 17:48:05 -0700 | [diff] [blame] | 5 | /** |
| 6 | * Covergoups that are dependent on run-time parameters that may be available |
| 7 | * only in build_phase can be defined here |
| 8 | * Covergroups may also be wrapped inside helper classes if needed. |
| 9 | */ |
| 10 | |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 11 | % if is_cip: |
| 12 | class ${name}_env_cov extends cip_base_env_cov #(.CFG_T(${name}_env_cfg)); |
| 13 | % else: |
| 14 | class ${name}_env_cov extends dv_base_env_cov #(.CFG_T(${name}_env_cfg)); |
| 15 | % endif |
| 16 | `uvm_component_utils(${name}_env_cov) |
| 17 | |
| 18 | // the base class provides the following handles for use: |
| 19 | // ${name}_env_cfg: cfg |
| 20 | |
| 21 | // covergroups |
Srikrishna Iyer | 607c404 | 2019-10-23 17:48:05 -0700 | [diff] [blame] | 22 | // [add covergroups here] |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 23 | |
| 24 | function new(string name, uvm_component parent); |
| 25 | super.new(name, parent); |
Srikrishna Iyer | 607c404 | 2019-10-23 17:48:05 -0700 | [diff] [blame] | 26 | // [instantiate covergroups here] |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 27 | endfunction : new |
| 28 | |
Srikrishna Iyer | 607c404 | 2019-10-23 17:48:05 -0700 | [diff] [blame] | 29 | virtual function void build_phase(uvm_phase phase); |
| 30 | super.build_phase(phase); |
| 31 | // [or instantiate covergroups here] |
| 32 | % if is_cip: |
| 33 | // Please instantiate sticky_intr_cov array of objects for all interrupts that are sticky |
| 34 | // See cip_base_env_cov for details |
| 35 | % endif |
| 36 | endfunction |
| 37 | |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 38 | endclass |