Handle the special cases of alert names in Matcha

Bug: 280115727
Change-Id: Ie9263a0b1b347715d1ea2cdeaf364c5945e4ea88
diff --git a/hw/dv/sv/cip_lib/cip_base_env_cfg.sv b/hw/dv/sv/cip_lib/cip_base_env_cfg.sv
index 9c152da..f014983 100644
--- a/hw/dv/sv/cip_lib/cip_base_env_cfg.sv
+++ b/hw/dv/sv/cip_lib/cip_base_env_cfg.sv
@@ -174,10 +174,22 @@
         // against the block's alert_test field names
         string alerts_q[$];
         string blk_name = sub_blks[i].get_name();
-        foreach (list_of_alerts[j]) begin
-          string alert_name = list_of_alerts[j];
-          if (alert_name.substr(0, blk_name.len() - 1) == blk_name) begin
-            alerts_q.push_back(alert_name.substr(blk_name.len() + 1, list_of_alerts[j].len() - 1));
+
+        // TODO(b/280115727): Handle the case where one block name is the
+        // substring of the other
+        // Handle the special cases of the alert names in Matcha
+        if (blk_name == "rv_timer_smc" ||
+            blk_name == "rv_timer_smc2" ||
+            blk_name == "rv_plic_smc") begin
+          alerts_q.push_back("fatal_fault");
+        end
+        else begin
+          foreach (list_of_alerts[j]) begin
+            string alert_name = list_of_alerts[j];
+            if (alert_name.substr(0, blk_name.len() - 1) == blk_name &&
+                alert_name.substr(blk_name.len() + 1, blk_name.len() + 3) != "smc") begin
+              alerts_q.push_back(alert_name.substr(blk_name.len() + 1, list_of_alerts[j].len() - 1));
+            end
           end
         end
         if (alerts_q.size() > 0) check_alert_configs_by_block(sub_blks[i], alerts_q);