Index: trunk/modules/vci_cc_vcache_wrapper/caba/source/src/vci_cc_vcache_wrapper.cpp
===================================================================
--- trunk/modules/vci_cc_vcache_wrapper/caba/source/src/vci_cc_vcache_wrapper.cpp	(revision 1041)
+++ trunk/modules/vci_cc_vcache_wrapper/caba/source/src/vci_cc_vcache_wrapper.cpp	(revision 1047)
@@ -591,4 +591,19 @@
     }
 }
+
+/////////////////////////////////
+tmpl(void)::print_frozen_stats()
+/////////////////////////////////
+{
+    if ( m_cpt_frozen_events )
+    {
+        float run_cycles = (float)(m_cpt_total_cycles - m_cpt_frz_cycles);
+        std::cout << name() 
+                  << " : FROZEN EVENTS = " << m_cpt_frozen_events 
+                  << " / AVERAGE LENGTH = " << m_cpt_frozen_cost/(m_cpt_frozen_events*1000) 
+                  << " Kcycles / CPI = " << (float)m_cpt_total_cycles/run_cycles << std::endl;
+    }
+}
+
 
 /*
@@ -853,4 +868,6 @@
         m_cpt_total_cycles      = 0;
         m_cpt_stop_simulation   = 0;
+        m_cpt_frozen_events     = 0;
+        m_cpt_frozen_cost       = 0;
 
         m_cpt_data_miss         = 0;
@@ -865,9 +882,9 @@
         m_cost_ins_miss_frz     = 0;
 
-        m_cpt_imiss_transaction = 0;
-        m_cpt_dmiss_transaction = 0;
-        m_cpt_unc_transaction   = 0;
-        m_cpt_write_transaction = 0;
-        m_cpt_icache_unc_transaction = 0;
+        m_cpt_imiss_transaction       = 0;
+        m_cpt_dmiss_transaction       = 0;
+        m_cpt_unc_transaction         = 0;
+        m_cpt_write_transaction       = 0;
+        m_cpt_icache_unc_transaction  = 0;
 
         m_cost_imiss_transaction      = 0;
@@ -5080,19 +5097,26 @@
     } // end switch r_dcache_fsm
 
-    ///////////////// wbuf update ///////////////////////////////////////////////////////
+    ///////////////// wbuf update //////////////////////////////////////////////////////////
     r_wbuf.update();
 
-    ///////////////// llsc update ///////////////////////////////////////////////////////
+    ///////////////// llsc update //////////////////////////////////////////////////////////
     if (r_dcache_llsc_valid.read()) r_dcache_llsc_count = r_dcache_llsc_count.read() - 1;
     if (r_dcache_llsc_count.read() == 1) r_dcache_llsc_valid = false;
 
-    //////////////// test processor frozen //////////////////////////////////////////////
-    // The simulation exit if the number of consecutive frozen cycles
-    // is larger than the m_max_frozen_cycles (constructor parameter)
-    if ((m_ireq.valid and not m_irsp.valid) or (m_dreq.valid and not m_drsp.valid))
-    {
-        m_cpt_frz_cycles++;      // used for instrumentation
-        m_cpt_stop_simulation++; // used for debug
-        if (m_cpt_stop_simulation > m_max_frozen_cycles)
+    //////////////// test processor frozen /////////////////////////////////////////////////
+    // 1) The m_cpt_frz_cycles counter defining the total number of cache related frozen
+    //    cycles is incremented.
+    // 2) If the processor is continuously frozen for more than (m_max_frozen_cycles / 20),
+    //    a warning is issued, and the two m_cpt_frozen_events & m_cpt_frozen_cost counters 
+    //    are incremented to evaluate the frequency and cost of pahological transactions.
+    // 3) If the processor is continuously frozen for more than (m_max_frozen_cycles),
+    //    the simulation is stopped, with an error message.
+    ////////////////////////////////////////////////////////////////////////////////////////
+
+    if ((m_ireq.valid and not m_irsp.valid) or (m_dreq.valid and not m_drsp.valid))   // frozen
+    {
+        m_cpt_frz_cycles++;         // total number of frozen cycles
+        m_cpt_stop_simulation++;    // number of continuously frozen cycles
+        if ( m_cpt_stop_simulation > m_max_frozen_cycles )
         {
             std::cout << std::dec << "ERROR in CC_VCACHE_WRAPPER " << name() << std::endl
@@ -5105,6 +5129,14 @@
         }
     }
-    else
-    {
+    else   // processor not frozen
+    {
+        if ( m_cpt_stop_simulation > (m_max_frozen_cycles/20) )
+        {
+            m_cpt_frozen_events++;
+            m_cpt_frozen_cost += m_cpt_stop_simulation;
+            std::cout << std::dec << "WARNING : Proc " << name() 
+                      << " frozen from cycle " << (m_cpt_total_cycles - m_cpt_stop_simulation)
+                      << " for " << (m_cpt_stop_simulation / 1000) << " Kcyles" << std::endl; 
+        }
         m_cpt_stop_simulation = 0;
     }
