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

// Limits coverage collection only to the *_reg_top module and the TL interface
// of the DUT.
+moduletree *_reg_top
+node tb.dut tl_*

// Disable collection is some modules that are instantiated inside the reg_top module but verified
// by a different mechanism (prims that are verified by FPV) or are just DV constructs where
// coverage doesn't matter.
-module prim_cdc_rand_delay  // DV construct.
-module prim_onehot_check              // FPV verified
-moduletree prim_secded_inv_64_57_dec  // FPV verified
-moduletree prim_secded_inv_39_32_dec  // FPV verified
-moduletree prim_secded_inv_64_57_enc  // FPV verified
-moduletree prim_secded_inv_39_32_enc  // FPV verified

// The DV environment binds in some modules to add CSR and Tilelink assertions. Make sure that we
// collect assertion coverage for these modules (since that's the whole point!) but don't collect
// any other sort of coverage.
-moduletree *csr_assert_fpv
-moduletree tlul_assert

begin assert
  // Enable assertion coverage for bound-in assertion modules (we
  // disabled all coverage earlier in the file)
  +moduletree *csr_assert_fpv
  +moduletree tlul_assert
end

// Remove everything else from toggle coverage except:
// - `prim_alert_sender`: the `alert_test` task under `cip_base_vseq` drives `alert_test_i` and
// verifies `alert_rx/tx` handshake in each IP.
begin tgl
  -tree tb
  +module prim_alert_sender
  +module prim_secded_inv_64_57_dec
  +module prim_secded_inv_39_32_dec
end
