// Copyright lowRISC contributors (OpenTitan project).
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

// Include our common coverage CCF.
include_ccf ${dv_root}/tools/xcelium/common.ccf

// Only collect code coverage on the *_reg_top instance.
deselect_coverage -betfs -module ${DUT_TOP}...
select_coverage -befs -module *_reg_top...
deselect_coverage -betfs -module prim_onehot_check...
deselect_coverage -betfs -module prim_secded_inv_64_57_dec...
deselect_coverage -betfs -module prim_secded_inv_39_32_dec...
deselect_coverage -betfs -module prim_secded_inv_64_57_enc...
deselect_coverage -betfs -module prim_secded_inv_39_32_enc...

// Black-box DV CDC module.
deselect_coverage -betfs -module prim_cdc_rand_delay

// csr_assert_fpv is an auto-generated csr read assertion module. So only assertion coverage is
// meaningful to collect.
deselect_coverage -betf -module *csr_assert_fpv...
select_coverage -assert -module *csr_assert_fpv

// Only enable assertion coverage
deselect_coverage -betf -module *tlul_assert...
select_coverage -assert -module *tlul_assert

// Include toggle coverage on `prim_alert_sender` because the `alert_test` task under
// `cip_base_vseq` drives `alert_test_i` and verifies `alert_rx/tx` handshake in each IP.
select_coverage -toggle -module prim_alert_sender
select_coverage -toggle -module prim_secded_inv_64_57_dec
select_coverage -toggle -module prim_secded_inv_39_32_dec

// TODO: The intent below is to only enable coverage on the DUT's TL interfaces (tests using this
// ccf file are meant to fully exercise the TL interfaces, but they do not verify the rest of the
// functionality of the block). We enable coverage on all DUT ports but exclude ports that do not
// contain tl_i or tl_o in the port name using a separate excludefile that supports regexes.
select_coverage -toggle -module ${DUT_TOP}
set_toggle_excludefile ${dv_root}/tools/xcelium/cover_reg_top_toggle_excl
