[dv/alert_handler] A few improvement on alert tb

1. The local_alert_en and local_alert_class have wrong bit number.
2. Remove the unused varaible
3. Remove ping_corner_case vseq

Signed-off-by: Cindy Chen <chencindy@opentitan.org>
diff --git a/hw/ip/alert_handler/dv/env/alert_handler_env.core b/hw/ip/alert_handler/dv/env/alert_handler_env.core
index 6738dc4..7810828 100644
--- a/hw/ip/alert_handler/dv/env/alert_handler_env.core
+++ b/hw/ip/alert_handler/dv/env/alert_handler_env.core
@@ -26,7 +26,6 @@
       - seq_lib/alert_handler_esc_alert_accum_vseq.sv: {is_include_file: true}
       - seq_lib/alert_handler_sig_int_fail_vseq.sv: {is_include_file: true}
       - seq_lib/alert_handler_entropy_vseq.sv: {is_include_file: true}
-      - seq_lib/alert_handler_ping_corner_cases_vseq.sv: {is_include_file: true}
       - seq_lib/alert_handler_stress_all_vseq.sv: {is_include_file: true}
     file_type: systemVerilogSource
 
diff --git a/hw/ip/alert_handler/dv/env/seq_lib/alert_handler_ping_corner_cases_vseq.sv b/hw/ip/alert_handler/dv/env/seq_lib/alert_handler_ping_corner_cases_vseq.sv
deleted file mode 100644
index 015dad9..0000000
--- a/hw/ip/alert_handler/dv/env/seq_lib/alert_handler_ping_corner_cases_vseq.sv
+++ /dev/null
@@ -1,108 +0,0 @@
-// Copyright lowRISC contributors.
-// Licensed under the Apache License, Version 2.0, see LICENSE for details.
-// SPDX-License-Identifier: Apache-2.0
-
-// this sequence test corner cases for alert or escalation pings:
-// 1). ping integrity fail or timeout
-// 2). ping interrupted by a reset signal
-// 3). escalation ping interrupted by real escalation signal (this could happen because escalation
-//     ping and real escalation share the same esc_p/n signals)
-
-class alert_handler_ping_corner_cases_vseq extends alert_handler_entropy_vseq;
-  `uvm_object_utils(alert_handler_ping_corner_cases_vseq)
-
-  `uvm_object_new
-
-  rand uint num_ping_trans;
-
-  constraint num_ping_trans_c {
-    num_ping_trans inside {[50:100]};
-  }
-
-  // always enable clr_en to hit the case when escalation ping interrupted by real esc sig
-  constraint clr_and_lock_en_c {
-    clr_en      == '1;
-    lock_bit_en == 0;
-  }
-
-  constraint esc_accum_thresh_c {
-    foreach (accum_thresh[i]) {accum_thresh[i] == 0};
-  }
-
-  constraint sig_int_c {
-    esc_int_err == '1;
-    esc_standalone_int_err dist {0 :/ 9, [1:'1] :/ 1};
-  }
-
-  constraint ping_fail_c {
-    alert_ping_timeout == '1;
-    esc_ping_timeout   == '1;
-  }
-
-  constraint ping_timeout_cyc_c {
-    ping_timeout_cyc inside {[1:MAX_PING_TIMEOUT_CYCLE]};
-  }
-
-  // disable interrupt timeout
-  constraint esc_intr_timeout_c {
-    foreach (intr_timeout_cyc[i]) {intr_timeout_cyc[i] == 0;}
-  }
-
-  virtual task pre_start();
-    super.pre_start();
-    num_ping_trans.rand_mode(0);
-    do_alert_handler_init = 1;
-    do_standalone_alert_handler_init = 0;
-    do_clear_all_interrupts = 0;
-    // disable alert/esc build-in coverage, because this test forced original design variable
-    for (int i = 0; i < NUM_ALERTS; i++) cfg.alert_host_cfg[i].en_cov = 0;
-    for (int i = 0; i < NUM_ESCS; i++)   cfg.esc_device_cfg[i].en_cov = 0;
-  endtask
-
-  virtual task body();
-    trigger_non_blocking_seqs();
-    `uvm_info(`gfn, $sformatf("num_trans=%0d", num_trans), UVM_LOW)
-    for (int trans = 1; trans <= num_ping_trans; trans++) begin
-      int ping_index;
-      `uvm_info(`gfn, $sformatf("start ping_seq %0d/%0d", trans, num_ping_trans), UVM_LOW)
-      `DV_CHECK_MEMBER_RANDOMIZE_FATAL(num_trans)
-      fork begin
-        fork
-          begin : run_normal_sequence
-            run_smoke_seq();
-          end
-          begin : wait_for_ping
-            wait_alert_esc_ping(ping_index);
-            `uvm_info(`gfn, $sformatf("ping %0d triggered", ping_index), UVM_MEDIUM);
-          end
-        join_any
-        csr_utils_pkg::wait_no_outstanding_access();
-        disable fork;
-        if (ping_index > 0) run_ping_interrupt_seqs(ping_index);
-      end
-      join
-    end
-  endtask : body
-
-  // if a ping signal is detected, this task will randomly react in these three ways:
-  // 1). Interrupt the ping with a reset
-  // 2). Interrupt the ping with real alerts
-  // 3). Do nothing, wait until ping is done
-  virtual task run_ping_interrupt_seqs(int ping_index);
-    randcase
-      1: begin
-        `uvm_info(`gfn, "apply hard reset", UVM_MEDIUM)
-        cfg.clk_rst_vif.wait_clks($urandom_range(0, 4));
-        dut_init("HARD");
-      end
-      40: begin
-        `uvm_info(`gfn, "insert alerts", UVM_MEDIUM)
-        drive_alert('1, 0);
-      end
-      10: begin
-        `uvm_info(`gfn, "do nothing", UVM_MEDIUM)
-      end
-    endcase
-  endtask
-
-endclass : alert_handler_ping_corner_cases_vseq
diff --git a/hw/ip/alert_handler/dv/env/seq_lib/alert_handler_smoke_vseq.sv b/hw/ip/alert_handler/dv/env/seq_lib/alert_handler_smoke_vseq.sv
index 2013d9b..c1aea42 100644
--- a/hw/ip/alert_handler/dv/env/seq_lib/alert_handler_smoke_vseq.sv
+++ b/hw/ip/alert_handler/dv/env/seq_lib/alert_handler_smoke_vseq.sv
@@ -16,8 +16,8 @@
   rand bit [NUM_ALERTS-1:0]                              alert_en;
   rand bit [NUM_ALERTS-1:0]                              alert_ping_timeout;
   rand bit [NUM_ALERT_CLASSES-1:0][NUM_ALERTS-1:0]       alert_class_map;
-  rand bit [NUM_ALERT_CLASSES-1:0][NUM_LOCAL_ALERTS-1:0] local_alert_en;
-  rand bit [NUM_LOCAL_ALERTS-1:0]                        local_alert_class_map;
+  rand bit [NUM_LOCAL_ALERTS-1:0]                        local_alert_en;
+  rand bit [NUM_ALERT_CLASSES-1:0][NUM_LOCAL_ALERTS-1:0] local_alert_class_map;
   rand bit [NUM_ESCS-1:0]                                esc_int_err;
   rand bit [NUM_ESCS-1:0]                                esc_standalone_int_err;
   rand bit [NUM_ESCS-1:0]                                esc_ping_timeout;
@@ -33,7 +33,6 @@
 
   int max_wait_phases_cyc = MIN_CYCLE_PER_PHASE * NUM_ESC_PHASES;
   int max_intr_timeout_cyc;
-  bit do_standalone_alert_handler_init = 1;
 
   uvm_verbosity verbosity = UVM_LOW;
 
@@ -111,17 +110,15 @@
       `DV_CHECK_RANDOMIZE_FATAL(this)
 
       `uvm_info(`gfn,
-          $sformatf("start seq %0d/%0d: intr_en=%0b, alert=%0b, alert_en=%0b, alert_class=%0b",
-          i, num_trans, intr_en, alert_trigger, alert_en, alert_class_map), verbosity)
+          $sformatf("start seq %0d/%0d: intr_en=%0b, alert=%0b, alert_en=%0b, loc_alert_en=%0b",
+          i, num_trans, intr_en, alert_trigger, alert_en, local_alert_en), verbosity)
 
       // write initial settings (enable and mapping csrs)
-      if (do_standalone_alert_handler_init) begin
-        alert_handler_init(.intr_en(intr_en),
-                           .alert_en(alert_en),
-                           .alert_class(alert_class_map),
-                           .loc_alert_en(local_alert_en),
-                           .loc_alert_class(local_alert_class_map));
-      end
+      alert_handler_init(.intr_en(intr_en),
+                         .alert_en(alert_en),
+                         .alert_class(alert_class_map),
+                         .loc_alert_en(local_alert_en),
+                         .loc_alert_class(local_alert_class_map));
 
       // write class_ctrl and clren_reg
       alert_handler_rand_wr_class_ctrl(lock_bit_en);
@@ -163,7 +160,7 @@
       end
       // only check interrupt when no esc_int_err, otherwise clear interrupt might happen the
       // same cycle as interrupt triggered by esc_int_err
-      if (esc_int_err == 0) check_alert_interrupts();
+      if ((esc_int_err == 0) && (esc_ping_timeout == 0)) check_alert_interrupts();
 
       // if ping timeout enabled, wait for ping timeout done before checking escalation phases
       if ((esc_int_err | alert_ping_timeout) > 0) cfg.clk_rst_vif.wait_clks(MAX_PING_TIMEOUT_CYCLE);
diff --git a/hw/ip/alert_handler/dv/env/seq_lib/alert_handler_vseq_list.sv b/hw/ip/alert_handler/dv/env/seq_lib/alert_handler_vseq_list.sv
index 48b546e..cede15e 100644
--- a/hw/ip/alert_handler/dv/env/seq_lib/alert_handler_vseq_list.sv
+++ b/hw/ip/alert_handler/dv/env/seq_lib/alert_handler_vseq_list.sv
@@ -11,5 +11,4 @@
 `include "alert_handler_esc_alert_accum_vseq.sv"
 `include "alert_handler_sig_int_fail_vseq.sv"
 `include "alert_handler_entropy_vseq.sv"
-`include "alert_handler_ping_corner_cases_vseq.sv"
 `include "alert_handler_stress_all_vseq.sv"