[prim_esc_rxtx/rv_core_ibex] Add default values and NMI synchronization

Signed-off-by: Michael Schaffner <msf@opentitan.org>
diff --git a/hw/ip/prim/rtl/prim_esc_pkg.sv b/hw/ip/prim/rtl/prim_esc_pkg.sv
index 8cd9c4e..df3529e 100644
--- a/hw/ip/prim/rtl/prim_esc_pkg.sv
+++ b/hw/ip/prim/rtl/prim_esc_pkg.sv
@@ -9,6 +9,8 @@
     logic esc_n;
   } esc_tx_t;
 
+  parameter esc_tx_t ESC_TX_DEFAULT = 2'b01;
+
   typedef struct packed {
     logic resp_p;
     logic resp_n;
diff --git a/hw/ip/rv_core_ibex/rtl/rv_core_ibex.sv b/hw/ip/rv_core_ibex/rtl/rv_core_ibex.sv
index ff018f2..8ae2087 100644
--- a/hw/ip/rv_core_ibex/rtl/rv_core_ibex.sv
+++ b/hw/ip/rv_core_ibex/rtl/rv_core_ibex.sv
@@ -32,6 +32,9 @@
   // Clock and Reset
   input  logic        clk_i,
   input  logic        rst_ni,
+  // Clock domain for escalation receiver
+  input  logic        clk_esc_i,
+  input  logic        rst_esc_ni,
 
   input  logic        test_en_i,     // enable all clock gates for testing
 
@@ -131,15 +134,26 @@
 
   // Escalation receiver that converts differential
   // protocol into single ended signal.
-  logic irq_nm;
-  prim_esc_receiver i_prim_esc_receiver (
-    .clk_i,
-    .rst_ni,
-    .esc_en_o ( irq_nm   ),
+  logic esc_irq_nm;
+  prim_esc_receiver u_prim_esc_receiver (
+    .clk_i    ( clk_esc_i  ),
+    .rst_ni   ( rst_esc_ni ),
+    .esc_en_o ( esc_irq_nm ),
     .esc_rx_o,
     .esc_tx_i
   );
 
+  // Synchronize to fast Ibex clock domain.
+  logic irq_nm;
+  prim_flop_2sync #(
+    .Width(1)
+  ) u_prim_flop_2sync (
+    .clk_i,
+    .rst_ni,
+    .d_i(esc_irq_nm),
+    .q_o(irq_nm)
+  );
+
   // Alert outputs
   // TODO - Wire these up once driven
   logic alert_minor, alert_major;
diff --git a/hw/top_earlgrey/data/top_earlgrey.sv.tpl b/hw/top_earlgrey/data/top_earlgrey.sv.tpl
index 4be628a..4c78b3e 100644
--- a/hw/top_earlgrey/data/top_earlgrey.sv.tpl
+++ b/hw/top_earlgrey/data/top_earlgrey.sv.tpl
@@ -240,6 +240,8 @@
     .irq_timer_i          (intr_rv_timer_timer_expired_0_0),
     .irq_external_i       (irq_plic),
     // escalation input from alert handler (NMI)
+    // TODO: need to put the escalation receiver
+    // into the alert handler clock domain.
     .esc_tx_i             (esc_tx[0]),
     .esc_rx_o             (esc_rx[0]),
     // debug interface
diff --git a/hw/top_earlgrey/rtl/autogen/top_earlgrey.sv b/hw/top_earlgrey/rtl/autogen/top_earlgrey.sv
index 85dfb1a..533afcd 100644
--- a/hw/top_earlgrey/rtl/autogen/top_earlgrey.sv
+++ b/hw/top_earlgrey/rtl/autogen/top_earlgrey.sv
@@ -447,6 +447,8 @@
     .irq_timer_i          (intr_rv_timer_timer_expired_0_0),
     .irq_external_i       (irq_plic),
     // escalation input from alert handler (NMI)
+    // TODO: need to put the escalation receiver
+    // into the alert handler clock domain.
     .esc_tx_i             (esc_tx[0]),
     .esc_rx_o             (esc_rx[0]),
     // debug interface