Index: branches/fault_tolerance/module/internal_component/vci_cc_vcache_wrapper/caba/source/include/vci_cc_vcache_wrapper.h
===================================================================
--- branches/fault_tolerance/module/internal_component/vci_cc_vcache_wrapper/caba/source/include/vci_cc_vcache_wrapper.h	(revision 661)
+++ branches/fault_tolerance/module/internal_component/vci_cc_vcache_wrapper/caba/source/include/vci_cc_vcache_wrapper.h	(revision 684)
@@ -339,5 +339,7 @@
     bool                                m_debug_previous_i_hit;
     bool                                m_debug_previous_d_hit;
-    bool                                m_debug_activated;
+    bool                                m_debug_icache_fsm;
+    bool                                m_debug_dcache_fsm;
+    bool                                m_debug_cmd_fsm;
 
     ///////////////////////////////
Index: branches/fault_tolerance/module/internal_component/vci_cc_vcache_wrapper/caba/source/src/vci_cc_vcache_wrapper.cpp
===================================================================
--- branches/fault_tolerance/module/internal_component/vci_cc_vcache_wrapper/caba/source/src/vci_cc_vcache_wrapper.cpp	(revision 661)
+++ branches/fault_tolerance/module/internal_component/vci_cc_vcache_wrapper/caba/source/src/vci_cc_vcache_wrapper.cpp	(revision 684)
@@ -815,5 +815,7 @@
         m_debug_previous_i_hit     = false;
         m_debug_previous_d_hit     = false;
-        m_debug_activated          = false;
+        m_debug_icache_fsm	       = false;
+        m_debug_dcache_fsm	       = false;
+        m_debug_cmd_fsm 	       = false;
 
         // activity counters
@@ -956,5 +958,10 @@
     m_cpt_total_cycles++;
 
-    m_debug_activated = (m_cpt_total_cycles > m_debug_start_cycle) and m_debug_ok;
+    m_debug_icache_fsm = m_debug_icache_fsm ||
+        ((m_cpt_total_cycles > m_debug_start_cycle) and m_debug_ok);
+    m_debug_dcache_fsm = m_debug_dcache_fsm ||
+        ((m_cpt_total_cycles > m_debug_start_cycle) and m_debug_ok);
+    m_debug_cmd_fsm = m_debug_cmd_fsm ||
+        ((m_cpt_total_cycles > m_debug_start_cycle) and m_debug_ok);
 
     /////////////////////////////////////////////////////////////////////
@@ -1228,5 +1235,5 @@
                     r_icache_fsm      = ICACHE_MISS_SELECT;
 #if DEBUG_ICACHE
-if ( m_debug_activated )
+if ( m_debug_icache_fsm )
 std::cout << "  <PROC " << name() << " ICACHE_IDLE> READ MISS in icache" 
           << " : PADDR = " << std::hex << paddr << std::endl;
@@ -1250,5 +1257,5 @@
                     r_icache_fsm       = ICACHE_IDLE;
 #if DEBUG_ICACHE
-if ( m_debug_activated )
+if ( m_debug_icache_fsm )
 std::cout << "  <PROC " << name() << " ICACHE_IDLE> READ HIT in icache" 
           << " : PADDR = " << std::hex << paddr << std::endl;
@@ -1262,5 +1269,5 @@
 
 #if DEBUG_ICACHE
-if ( m_debug_activated )
+if ( m_debug_icache_fsm )
 {
     std::cout << "  <PROC " << name()
@@ -1608,5 +1615,5 @@
 
 #if DEBUG_ICACHE
-if ( m_debug_activated )
+if ( m_debug_icache_fsm )
 {
     std::cout << "  <PROC " << name()
@@ -1633,5 +1640,5 @@
                             CACHE_SLOT_STATE_ZOMBI);
 #if DEBUG_ICACHE
-if ( m_debug_activated )
+if ( m_debug_icache_fsm )
 {
     std::cout << "  <PROC " << name()
@@ -1708,5 +1715,5 @@
                             r_vci_rsp_fifo_icache.read() );
 #if DEBUG_ICACHE
-if ( m_debug_activated )
+if ( m_debug_icache_fsm )
 {
     std::cout << "  <PROC " << name()
@@ -1786,5 +1793,5 @@
                                         CACHE_SLOT_STATE_ZOMBI );
 #if DEBUG_ICACHE
-if ( m_debug_activated )
+if ( m_debug_icache_fsm )
 {
     std::cout << "  <PROC " << name()
@@ -1810,5 +1817,5 @@
                                     CACHE_SLOT_STATE_VALID );
 #if DEBUG_ICACHE
-if ( m_debug_activated )
+if ( m_debug_icache_fsm )
 {
     std::cout << "  <PROC " << name()
@@ -1905,5 +1912,5 @@
 
 #if DEBUG_ICACHE
-if ( m_debug_activated )
+if ( m_debug_icache_fsm )
 {
     std::cout << "  <PROC " << name()
@@ -1946,5 +1953,5 @@
             }
 #if DEBUG_ICACHE
-if ( m_debug_activated )
+if ( m_debug_icache_fsm )
 {
     std::cout << "  <PROC " << name()
@@ -2032,5 +2039,5 @@
 
 #if DEBUG_ICACHE
-if ( m_debug_activated )
+if ( m_debug_icache_fsm )
 {
 std::cout << "  <PROC " << name()
@@ -2072,5 +2079,5 @@
 
 #if DEBUG_ICACHE
-if ( m_debug_activated )
+if ( m_debug_icache_fsm )
 {
     std::cout << "  <PROC " << name()
@@ -2333,5 +2340,5 @@
 
 #if DEBUG_DCACHE
-if ( m_debug_activated )
+if ( m_debug_dcache_fsm )
 std::cout << "  <PROC " << name() << " DCACHE_IDLE>"
           << " Cache update in P1 stage" << std::dec
@@ -2631,4 +2638,12 @@
                     break;
 
+                    case iss_t::XTN_DEBUG_MASK:     // debug mask
+                        m_debug_dcache_fsm = ((m_dreq.wdata & 0x1) != 0);
+                        m_debug_icache_fsm = ((m_dreq.wdata & 0x2) != 0);
+                        m_debug_cmd_fsm = ((m_dreq.wdata & 0x4) != 0);
+                        m_drsp.valid = true;
+                        r_dcache_fsm = DCACHE_IDLE;
+                        break;
+
                     default:
                         r_mmu_detr   = MMU_WRITE_UNDEFINED_XTN;
@@ -2688,5 +2703,5 @@
                             m_drsp.rdata = 0;
 #if DEBUG_DCACHE
-if ( m_debug_activated )
+if ( m_debug_dcache_fsm )
 std::cout << "  <PROC " << name() << " DCACHE_IDLE>"
           << " HIT in dtlb, but privilege violation" << std::endl;
@@ -2704,5 +2719,5 @@
                             m_drsp.rdata = 0;
 #if DEBUG_DCACHE
-if ( m_debug_activated )
+if ( m_debug_dcache_fsm )
 std::cout << "  <PROC " << name() << " DCACHE_IDLE>"
           << " HIT in dtlb, but writable violation" << std::endl;
@@ -2745,5 +2760,5 @@
                                 r_dcache_fsm          = DCACHE_MISS_SELECT;
 #if DEBUG_DCACHE
-if ( m_debug_activated )
+if ( m_debug_dcache_fsm )
 std::cout << "  <PROC " << name() << " DCACHE_IDLE>"
           << " READ MISS in dcache" 
@@ -2756,5 +2771,5 @@
                                 r_dcache_fsm   = DCACHE_IDLE;
 #if DEBUG_DCACHE
-if ( m_debug_activated )
+if ( m_debug_dcache_fsm )
 std::cout << "  <PROC " << name() << " DCACHE_IDLE>"
           << " Pending cleanup, stalled until cleanup acknowledge"
@@ -2772,5 +2787,5 @@
                                 m_drsp.rdata   = cache_rdata;
 #if DEBUG_DCACHE
-if ( m_debug_activated )
+if ( m_debug_dcache_fsm )
 std::cout << "  <PROC " << name() << " DCACHE_IDLE>"
           << " READ HIT in dcache" 
@@ -2787,5 +2802,5 @@
                             r_dcache_fsm            = DCACHE_UNC_WAIT;
 #if DEBUG_DCACHE
-if ( m_debug_activated )
+if ( m_debug_dcache_fsm )
 std::cout << "  <PROC " << name() << " DCACHE_IDLE>"
           << " READ UNCACHEABLE in dcache" 
@@ -2985,5 +3000,5 @@
 
 #if DEBUG_DCACHE
-if ( m_debug_activated )
+if ( m_debug_dcache_fsm )
 {
     if ( r_dcache_tlb_ins.read() )
@@ -3055,5 +3070,5 @@
 
 #if DEBUG_DCACHE
-if ( m_debug_activated )
+if ( m_debug_dcache_fsm )
 {
     std::cout << "  <PROC " << name() 
@@ -3092,5 +3107,5 @@
 
 #if DEBUG_DCACHE
-if ( m_debug_activated )
+if ( m_debug_dcache_fsm )
 {
     std::cout << "  <PROC " << name() 
@@ -3114,5 +3129,5 @@
 
 #if DEBUG_DCACHE
-if ( m_debug_activated )
+if ( m_debug_dcache_fsm )
 {
     std::cout << "  <PROC " << name() 
@@ -3141,5 +3156,5 @@
 
 #if DEBUG_DCACHE
-if ( m_debug_activated )
+if ( m_debug_dcache_fsm )
 {
     std::cout << "  <PROC " << name() 
@@ -3182,5 +3197,5 @@
 
 #if DEBUG_DCACHE
-if ( m_debug_activated )
+if ( m_debug_dcache_fsm )
 {
     if ( r_dcache_tlb_ins.read() )
@@ -3254,5 +3269,5 @@
 
 #if DEBUG_DCACHE
-if ( m_debug_activated )
+if ( m_debug_dcache_fsm )
 {
     std::cout << "  <PROC " << name() 
@@ -3278,5 +3293,5 @@
 
 #if DEBUG_DCACHE
-if ( m_debug_activated )
+if ( m_debug_dcache_fsm )
 {
     std::cout << "  <PROC " << name() 
@@ -3295,5 +3310,5 @@
 
 #if DEBUG_DCACHE
-if ( m_debug_activated )
+if ( m_debug_dcache_fsm )
 {
     std::cout << "  <PROC " << name() 
@@ -3363,5 +3378,5 @@
 
 #if DEBUG_DCACHE
-if ( m_debug_activated )
+if ( m_debug_dcache_fsm )
 {
     std::cout << "  <PROC " << name()
@@ -3383,5 +3398,5 @@
 
 #if DEBUG_DCACHE
-if ( m_debug_activated )
+if ( m_debug_dcache_fsm )
 {
     std::cout << "  <PROC " << name() 
@@ -3399,5 +3414,5 @@
 
 #if DEBUG_DCACHE
-if ( m_debug_activated )
+if ( m_debug_dcache_fsm )
 {
     std::cout << "  <PROC " << name() 
@@ -3416,5 +3431,5 @@
 
 #if DEBUG_DCACHE
-if ( m_debug_activated )
+if ( m_debug_dcache_fsm )
 {
     std::cout << "  <PROC " << name()
@@ -3454,5 +3469,5 @@
 
 #if DEBUG_DCACHE
-if ( m_debug_activated )
+if ( m_debug_dcache_fsm )
 {
     if ( r_dcache_tlb_ins.read() )
@@ -3530,5 +3545,5 @@
 
 #if DEBUG_DCACHE
-if ( m_debug_activated )
+if ( m_debug_dcache_fsm )
 {
     std::cout << "  <PROC " << name()
@@ -3554,5 +3569,5 @@
 
 #if DEBUG_DCACHE
-if ( m_debug_activated )
+if ( m_debug_dcache_fsm )
 {
     std::cout << "  <PROC " << name()
@@ -3572,5 +3587,5 @@
 
 #if DEBUG_DCACHE
-if ( m_debug_activated )
+if ( m_debug_dcache_fsm )
 {
     std::cout << "  <PROC " << name()
@@ -3585,5 +3600,5 @@
     {
 #if DEBUG_DCACHE
-if ( m_debug_activated )
+if ( m_debug_dcache_fsm )
 {
     std::cout << "  <PROC " << name()
@@ -3638,5 +3653,5 @@
         {
 #if DEBUG_DCACHE
-if ( m_debug_activated )
+if ( m_debug_dcache_fsm )
 {
     std::cout << "  <PROC " << name()
@@ -3653,5 +3668,5 @@
     {
 #if DEBUG_DCACHE
-if ( m_debug_activated )
+if ( m_debug_dcache_fsm )
 {
     std::cout << "  <PROC " << name()
@@ -3925,5 +3940,5 @@
 
 #if DEBUG_DCACHE
-if ( m_debug_activated )
+if ( m_debug_dcache_fsm )
 {
     std::cout << "  <PROC " << name()
@@ -3968,5 +3983,5 @@
 
 #if DEBUG_DCACHE
-if ( m_debug_activated )
+if ( m_debug_dcache_fsm )
 {
     std::cout << "  <PROC " << name()
@@ -4028,5 +4043,5 @@
 
 #if DEBUG_DCACHE
-if ( m_debug_activated )
+if ( m_debug_dcache_fsm )
 {
     std::cout << "  <PROC " << name()
@@ -4124,5 +4139,5 @@
 
 #if DEBUG_DCACHE
-if ( m_debug_activated )
+if ( m_debug_dcache_fsm )
 {
     std::cout << "  <PROC " << name()
@@ -4154,5 +4169,5 @@
                             CACHE_SLOT_STATE_ZOMBI );
 #if DEBUG_DCACHE
-if ( m_debug_activated )
+if ( m_debug_dcache_fsm )
 {
     std::cout << "  <PROC " << name()
@@ -4299,5 +4314,5 @@
                                 r_vci_rsp_fifo_dcache.read() );
 #if DEBUG_DCACHE
-if ( m_debug_activated )
+if ( m_debug_dcache_fsm )
 {
     std::cout << "  <PROC " << name()
@@ -4377,5 +4392,5 @@
                                         CACHE_SLOT_STATE_ZOMBI );
 #if DEBUG_DCACHE
-if ( m_debug_activated )
+if ( m_debug_dcache_fsm )
 std::cout << "  <PROC " << name()
           << " DCACHE_MISS_DIR_UPDT> Switch slot to ZOMBI state"
@@ -4400,5 +4415,5 @@
 
 #if DEBUG_DCACHE
-if ( m_debug_activated )
+if ( m_debug_dcache_fsm )
 std::cout << "  <PROC " << name()
           << " DCACHE_MISS_DIR_UPDT> Switch slot to VALID state"
@@ -4605,5 +4620,5 @@
 
 #if DEBUG_DCACHE
-if ( m_debug_activated )
+if ( m_debug_dcache_fsm )
 {
     std::cout << "  <PROC " << name()
@@ -4653,5 +4668,5 @@
 
 #if DEBUG_DCACHE
-if ( m_debug_activated )
+if ( m_debug_dcache_fsm )
 {
     std::cout << "  <PROC " << name()
@@ -4701,5 +4716,5 @@
 
 #if DEBUG_DCACHE
-if ( m_debug_activated )
+if ( m_debug_dcache_fsm )
 {
     std::cout << "  <PROC " << name()
@@ -4744,5 +4759,5 @@
 
 #if DEBUG_DCACHE
-if ( m_debug_activated )
+if ( m_debug_dcache_fsm )
 {
     std::cout << "  <PROC " << name()
@@ -4805,5 +4820,5 @@
 
 #if DEBUG_DCACHE
-if ( m_debug_activated )
+if ( m_debug_dcache_fsm )
 {
     std::cout << "  <PROC " << name()
@@ -4842,5 +4857,5 @@
 
 #if DEBUG_DCACHE
-if ( m_debug_activated )
+if ( m_debug_dcache_fsm )
 {
     std::cout << "  <PROC " << name()
@@ -4868,5 +4883,5 @@
 
 #if DEBUG_DCACHE
-if ( m_debug_activated )
+if ( m_debug_dcache_fsm )
 {
     std::cout << "  <PROC " << name()
@@ -4904,5 +4919,5 @@
 
 #if DEBUG_DCACHE
-if ( m_debug_activated )
+if ( m_debug_dcache_fsm )
 {
     std::cout << "  <PROC " << name()
@@ -4933,5 +4948,5 @@
 
 #if DEBUG_DCACHE
-if ( m_debug_activated )
+if ( m_debug_dcache_fsm )
 {
     std::cout << "  <PROC " << name()
@@ -4994,5 +5009,5 @@
 
 #if DEBUG_DCACHE
-if ( m_debug_activated and ok )
+if ( m_debug_dcache_fsm and ok )
 {
     std::cout << "  <PROC " << name()
@@ -5010,5 +5025,5 @@
 
 #if DEBUG_DCACHE
-if ( m_debug_activated and ok )
+if ( m_debug_dcache_fsm and ok )
 std::cout << "  <PROC " << name() << " DCACHE_INVAL_TLB_SCAN>"
           << " Invalidate DTLB entry" << std::hex
@@ -5215,5 +5230,5 @@
 
 #if DEBUG_CMD
-if ( m_debug_activated )
+if ( m_debug_cmd_fsm )
 {
 std::cout << "  <PROC " << name() << " CMD_IDLE>"
