Index: branches/RWT/modules/vci_mem_cache/caba/source/include/vci_mem_cache.h
===================================================================
--- branches/RWT/modules/vci_mem_cache/caba/source/include/vci_mem_cache.h	(revision 780)
+++ branches/RWT/modules/vci_mem_cache/caba/source/include/vci_mem_cache.h	(revision 783)
@@ -399,12 +399,12 @@
           //  b1 accÃšs table llsc type SW / other
           //  b2 WRITE/CAS/LL/SC
-          TYPE_READ_DATA_UNC          = 0x0,
-          TYPE_READ_DATA_MISS         = 0x1,
-          TYPE_READ_INS_UNC           = 0x2,
-          TYPE_READ_INS_MISS          = 0x3,
-          TYPE_WRITE                  = 0x4,
-          TYPE_CAS                    = 0x5,
-          TYPE_LL                     = 0x6,
-          TYPE_SC                     = 0x7
+          TYPE_READ_DATA_UNC   = 0x0,
+          TYPE_READ_DATA_MISS  = 0x1,
+          TYPE_READ_INS_UNC    = 0x2,
+          TYPE_READ_INS_MISS   = 0x3,
+          TYPE_WRITE           = 0x4,
+          TYPE_CAS             = 0x5,
+          TYPE_LL              = 0x6,
+          TYPE_SC              = 0x7
       };
 
@@ -412,171 +412,173 @@
       enum sc_status_type_e
       {
-          SC_SUCCESS  =   0x00000000,
-          SC_FAIL     =   0x00000001
+          SC_SUCCESS = 0x00000000,
+          SC_FAIL    = 0x00000001
       };
 
       // debug variables 
-      bool                 m_debug;
-      bool                 m_debug_previous_valid;
-      size_t               m_debug_previous_count;
-      bool                 m_debug_previous_dirty;
-      data_t *             m_debug_previous_data;
-      data_t *             m_debug_data;
+      bool     m_debug;
+      bool     m_debug_previous_valid;
+      size_t   m_debug_previous_count;
+      bool     m_debug_previous_dirty;
+      data_t * m_debug_previous_data;
+      data_t * m_debug_data;
 
       // instrumentation counters
-      uint32_t     m_cpt_cycles;        // Counter of cycles
-
-      // Counters accessible in software (not yet but eventually)
-      uint32_t     m_cpt_reset_count;    // Last cycle at which counters have been reset
-      uint32_t     m_cpt_read_local;     // Number of local READ transactions
-      uint32_t     m_cpt_read_remote;    // number of remote READ transactions
-      uint32_t     m_cpt_read_cost;      // Number of (flits * distance) for READs
-
-      uint32_t     m_cpt_write_local;    // Number of local WRITE transactions
-      uint32_t     m_cpt_write_remote;   // number of remote WRITE transactions
-      uint32_t     m_cpt_write_flits_local;  // number of flits for local WRITEs
-      uint32_t     m_cpt_write_flits_remote; // number of flits for remote WRITEs
-      uint32_t     m_cpt_write_cost;     // Number of (flits * distance) for WRITEs
-      uint32_t     m_cpt_write_ncc_miss;   // Number of write on ncc line
-
-      uint32_t     m_cpt_ll_local;       // Number of local LL transactions
-      uint32_t     m_cpt_ll_remote;      // number of remote LL transactions
-      uint32_t     m_cpt_ll_cost;        // Number of (flits * distance) for LLs
-
-      uint32_t     m_cpt_sc_local;       // Number of local SC transactions
-      uint32_t     m_cpt_sc_remote;      // number of remote SC transactions
-      uint32_t     m_cpt_sc_cost;        // Number of (flits * distance) for SCs
-
-      uint32_t     m_cpt_cas_local;      // Number of local SC transactions
-      uint32_t     m_cpt_cas_remote;     // number of remote SC transactions
-      uint32_t     m_cpt_cas_cost;       // Number of (flits * distance) for SCs
-
-      uint32_t     m_cpt_update;         // Number of requests causing an UPDATE
-      uint32_t     m_cpt_update_local;   // Number of local UPDATE transactions
-      uint32_t     m_cpt_update_remote;  // Number of remote UPDATE transactions
-      uint32_t     m_cpt_update_cost;    // Number of (flits * distance) for UPDT
-
-      uint32_t     m_cpt_minval;         // Number of requests causing M_INV
-      uint32_t     m_cpt_minval_local;   // Number of local M_INV transactions
-      uint32_t     m_cpt_minval_remote;  // Number of remote M_INV transactions
-      uint32_t     m_cpt_minval_cost;    // Number of (flits * distance) for M_INV
-
-      uint32_t     m_cpt_binval;         // Number of BROADCAST INVAL
-
-      uint32_t     m_cpt_cleanup_local;  // Number of local CLEANUP transactions
-      uint32_t     m_cpt_cleanup_remote; // Number of remote CLEANUP transactions
-      uint32_t     m_cpt_cleanup_cost;   // Number of (flits * distance) for CLEANUPs
-
-      // Counters not accessible by software
-      uint32_t     m_cpt_read_miss;      // Number of MISS READ
-      uint32_t     m_cpt_write_miss;    // Number of MISS WRITE
-      uint32_t     m_cpt_write_dirty;   // Cumulated length for WRITE transactions
-      uint32_t     m_cpt_write_broadcast;// Number of BROADCAST INVAL because write
-
-      uint32_t     m_cpt_trt_rb;        // Read blocked by a hit in trt
-      uint32_t     m_cpt_trt_full;      // Transaction blocked due to a full trt
+      uint32_t m_cpt_cycles;        // Counter of cycles
+
+      // Counters accessible in software (not yet but eventually) and tagged
+      uint32_t m_cpt_reset_count;    // Last cycle at which counters have been reset
+      uint32_t m_cpt_read_local;     // Number of local READ transactions
+      uint32_t m_cpt_read_remote;    // number of remote READ transactions
+      uint32_t m_cpt_read_cost;      // Number of (flits * distance) for READs
+
+      uint32_t m_cpt_write_local;    // Number of local WRITE transactions
+      uint32_t m_cpt_write_remote;   // number of remote WRITE transactions
+      uint32_t m_cpt_write_flits_local;  // number of flits for local WRITEs
+      uint32_t m_cpt_write_flits_remote; // number of flits for remote WRITEs
+      uint32_t m_cpt_write_cost;     // Number of (flits * distance) for WRITEs
+      uint32_t m_cpt_write_ncc_miss;   // Number of write on ncc line
+
+      uint32_t m_cpt_ll_local;       // Number of local LL transactions
+      uint32_t m_cpt_ll_remote;      // number of remote LL transactions
+      uint32_t m_cpt_ll_cost;        // Number of (flits * distance) for LLs
+
+      uint32_t m_cpt_sc_local;       // Number of local SC transactions
+      uint32_t m_cpt_sc_remote;      // number of remote SC transactions
+      uint32_t m_cpt_sc_cost;        // Number of (flits * distance) for SCs
+
+      uint32_t m_cpt_cas_local;      // Number of local SC transactions
+      uint32_t m_cpt_cas_remote;     // number of remote SC transactions
+      uint32_t m_cpt_cas_cost;       // Number of (flits * distance) for SCs
+
+      uint32_t m_cpt_update;         // Number of requests causing an UPDATE
+      uint32_t m_cpt_update_local;   // Number of local UPDATE transactions
+      uint32_t m_cpt_update_remote;  // Number of remote UPDATE transactions
+      uint32_t m_cpt_update_cost;    // Number of (flits * distance) for UPDT
+
+      uint32_t m_cpt_minval;         // Number of requests causing M_INV
+      uint32_t m_cpt_minval_local;   // Number of local M_INV transactions
+      uint32_t m_cpt_minval_remote;  // Number of remote M_INV transactions
+      uint32_t m_cpt_minval_cost;    // Number of (flits * distance) for M_INV
+
+      uint32_t m_cpt_binval;         // Number of BROADCAST INVAL
+
+      uint32_t m_cpt_cleanup_local;  // Number of local CLEANUP transactions (all cleanup types)
+      uint32_t m_cpt_cleanup_remote; // Number of remote CLEANUP transactions (all cleanup types)
+      uint32_t m_cpt_cleanup_cost;   // Number of (flits * distance) for CLEANUPs (all types)
+
+      // Counters not accessible by software, but tagged
+      uint32_t m_cpt_read_miss;       // Number of MISS READ
+      uint32_t m_cpt_write_miss;      // Number of MISS WRITE
+      uint32_t m_cpt_write_dirty;     // Cumulated length for WRITE transactions
+      uint32_t m_cpt_write_broadcast; // Number of BROADCAST INVAL because write
+
+      uint32_t m_cpt_trt_rb;          // Read blocked by a hit in trt
+      uint32_t m_cpt_trt_full;        // Transaction blocked due to a full trt
+
+      uint32_t m_cpt_heap_unused;             // NB cycles HEAP LOCK unused
+      uint32_t m_cpt_heap_slot_available;     // NB HEAP slot available refresh at each cycles
+      uint32_t m_cpt_heap_min_slot_available; // NB HEAP : Min of slot available 
+
+      uint32_t m_cpt_ncc_to_cc_read;         // NB change from NCC to CC caused by a READ
+      uint32_t m_cpt_ncc_to_cc_write;        // NB change from NCC to CC caused by a WRITE
+
+      uint32_t m_cpt_cleanup_data_local;  // Number of local cleanups with data
+      uint32_t m_cpt_cleanup_data_remote; // Number of remote cleanups with data
+      uint32_t m_cpt_cleanup_data_cost;   // Cost for cleanups with data
+
+      uint32_t m_cpt_update_flits;  // Number of flits for UPDATEs
+      uint32_t m_cpt_inval_cost;    // Number of (flits * distance) for INVALs
+
+      uint32_t m_cpt_get;
+      uint32_t m_cpt_put;
+
+      // TODO: clean the following counters (not necessarily useful and well-implemented)
+      uint32_t m_cpt_read_fsm_dir_lock;        // wait DIR LOCK
+      uint32_t m_cpt_read_fsm_n_dir_lock;      // NB DIR LOCK
+      uint32_t m_cpt_write_fsm_dir_lock;       // wait DIR LOCK
+      uint32_t m_cpt_write_fsm_n_dir_lock;     // NB DIR LOCK
+      uint32_t m_cpt_xram_rsp_fsm_dir_lock;    // wait DIR LOCK
+      uint32_t m_cpt_xram_rsp_fsm_n_dir_lock;  // NB DIR LOCK
+      uint32_t m_cpt_cas_fsm_dir_lock;         // wait DIR LOCK
+      uint32_t m_cpt_cas_fsm_n_dir_lock;       // NB DIR LOCK
+      uint32_t m_cpt_cleanup_fsm_dir_lock;     // wait DIR LOCK
+      uint32_t m_cpt_cleanup_fsm_n_dir_lock;   // NB DIR LOCK
       
-      uint32_t     m_cpt_read_fsm_dir_lock;        // wait DIR LOCK
-      uint32_t     m_cpt_read_fsm_n_dir_lock;      // NB DIR LOCK
-      uint32_t     m_cpt_write_fsm_dir_lock;       // wait DIR LOCK
-      uint32_t     m_cpt_write_fsm_n_dir_lock;     // NB DIR LOCK
-      uint32_t     m_cpt_xram_rsp_fsm_dir_lock;    // wait DIR LOCK
-      uint32_t     m_cpt_xram_rsp_fsm_n_dir_lock;  // NB DIR LOCK
-      uint32_t     m_cpt_cas_fsm_dir_lock;         // wait DIR LOCK
-      uint32_t     m_cpt_cas_fsm_n_dir_lock;       // NB DIR LOCK
-      uint32_t     m_cpt_cleanup_fsm_dir_lock;     // wait DIR LOCK
-      uint32_t     m_cpt_cleanup_fsm_n_dir_lock;   // NB DIR LOCK
+      uint32_t m_cpt_dir_unused;            // NB cycles DIR LOCK unused
+      uint32_t m_cpt_read_fsm_dir_used;     // NB cycles DIR LOCK used
+      uint32_t m_cpt_write_fsm_dir_used;    // NB cycles DIR LOCK used
+      uint32_t m_cpt_cas_fsm_dir_used;      // NB cycles DIR LOCK used
+      uint32_t m_cpt_xram_rsp_fsm_dir_used; // NB cycles DIR LOCK used
+      uint32_t m_cpt_cleanup_fsm_dir_used;  // NB cycles DIR LOCK used
+
+      uint32_t m_cpt_read_fsm_trt_lock;      // wait TRT LOCK
+      uint32_t m_cpt_write_fsm_trt_lock;     // wait TRT LOCK
+      uint32_t m_cpt_cas_fsm_trt_lock;       // wait TRT LOCK
+      uint32_t m_cpt_xram_rsp_fsm_trt_lock;  // wait TRT LOCK
+      uint32_t m_cpt_ixr_fsm_trt_lock;       // wait TRT LOCK
       
-      uint32_t     m_cpt_dir_unused;            // NB cycles DIR LOCK unused
-      uint32_t     m_cpt_read_fsm_dir_used;     // NB cycles DIR LOCK used
-      uint32_t     m_cpt_write_fsm_dir_used;    // NB cycles DIR LOCK used
-      uint32_t     m_cpt_cas_fsm_dir_used;      // NB cycles DIR LOCK used
-      uint32_t     m_cpt_xram_rsp_fsm_dir_used; // NB cycles DIR LOCK used
-      uint32_t     m_cpt_cleanup_fsm_dir_used;  // NB cycles DIR LOCK used
-
-      uint32_t     m_cpt_read_fsm_trt_lock;      // wait TRT LOCK
-      uint32_t     m_cpt_write_fsm_trt_lock;     // wait TRT LOCK
-      uint32_t     m_cpt_cas_fsm_trt_lock;       // wait TRT LOCK
-      uint32_t     m_cpt_xram_rsp_fsm_trt_lock;  // wait TRT LOCK
-      uint32_t     m_cpt_ixr_fsm_trt_lock;       // wait TRT LOCK
+      uint32_t m_cpt_read_fsm_n_trt_lock;      // NB TRT LOCK
+      uint32_t m_cpt_write_fsm_n_trt_lock;     // NB TRT LOCK
+      uint32_t m_cpt_cas_fsm_n_trt_lock;       // NB TRT LOCK
+      uint32_t m_cpt_xram_rsp_fsm_n_trt_lock;  // NB TRT LOCK
+      uint32_t m_cpt_ixr_fsm_n_trt_lock;       // NB TRT LOCK
+
+      uint32_t m_cpt_read_fsm_trt_used;      // NB cycles TRT LOCK used
+      uint32_t m_cpt_write_fsm_trt_used;     // NB cycles TRT LOCK used
+      uint32_t m_cpt_cas_fsm_trt_used;       // NB cycles TRT LOCK used
+      uint32_t m_cpt_xram_rsp_fsm_trt_used;  // NB cycles TRT LOCK used
+      uint32_t m_cpt_ixr_fsm_trt_used;       // NB cycles TRT LOCK used
       
-      uint32_t     m_cpt_read_fsm_n_trt_lock;      // NB TRT LOCK
-      uint32_t     m_cpt_write_fsm_n_trt_lock;     // NB TRT LOCK
-      uint32_t     m_cpt_cas_fsm_n_trt_lock;       // NB TRT LOCK
-      uint32_t     m_cpt_xram_rsp_fsm_n_trt_lock;  // NB TRT LOCK
-      uint32_t     m_cpt_ixr_fsm_n_trt_lock;       // NB TRT LOCK
-
-      uint32_t     m_cpt_read_fsm_trt_used;      // NB cycles TRT LOCK used
-      uint32_t     m_cpt_write_fsm_trt_used;     // NB cycles TRT LOCK used
-      uint32_t     m_cpt_cas_fsm_trt_used;       // NB cycles TRT LOCK used
-      uint32_t     m_cpt_xram_rsp_fsm_trt_used;  // NB cycles TRT LOCK used
-      uint32_t     m_cpt_ixr_fsm_trt_used;       // NB cycles TRT LOCK used
+      uint32_t m_cpt_trt_unused;            // NB cycles TRT LOCK unused
+
+      uint32_t m_cpt_write_fsm_upt_lock;     // wait UPT LOCK
+      uint32_t m_cpt_xram_rsp_fsm_upt_lock;  // wait UPT LOCK
+      uint32_t m_cpt_multi_ack_fsm_upt_lock; // wait UPT LOCK
+      uint32_t m_cpt_cleanup_fsm_ivt_lock;   // wait UPT LOCK
+      uint32_t m_cpt_cas_fsm_upt_lock;       // wait UPT LOCK
       
-      uint32_t     m_cpt_trt_unused;            // NB cycles TRT LOCK unused
-
-      uint32_t     m_cpt_write_fsm_upt_lock;     // wait UPT LOCK
-      uint32_t     m_cpt_xram_rsp_fsm_upt_lock;  // wait UPT LOCK
-      uint32_t     m_cpt_multi_ack_fsm_upt_lock; // wait UPT LOCK
-      uint32_t     m_cpt_cleanup_fsm_ivt_lock;   // wait UPT LOCK
-      uint32_t     m_cpt_cas_fsm_upt_lock;       // wait UPT LOCK
+      uint32_t m_cpt_write_fsm_n_upt_lock;     // NB UPT LOCK
+      uint32_t m_cpt_xram_rsp_fsm_n_upt_lock;  // NB UPT LOCK
+      uint32_t m_cpt_multi_ack_fsm_n_upt_lock; // NB UPT LOCK
+      uint32_t m_cpt_cleanup_fsm_n_upt_lock;   // NB UPT LOCK
+      uint32_t m_cpt_cas_fsm_n_upt_lock;       // NB UPT LOCK
       
-      uint32_t     m_cpt_write_fsm_n_upt_lock;     // NB UPT LOCK
-      uint32_t     m_cpt_xram_rsp_fsm_n_upt_lock;  // NB UPT LOCK
-      uint32_t     m_cpt_multi_ack_fsm_n_upt_lock; // NB UPT LOCK
-      uint32_t     m_cpt_cleanup_fsm_n_upt_lock;   // NB UPT LOCK
-      uint32_t     m_cpt_cas_fsm_n_upt_lock;       // NB UPT LOCK
+      uint32_t m_cpt_write_fsm_upt_used;     // NB cycles UPT LOCK used
+      uint32_t m_cpt_xram_rsp_fsm_upt_used;  // NB cycles UPT LOCK used
+      uint32_t m_cpt_multi_ack_fsm_upt_used; // NB cycles UPT LOCK used
+      uint32_t m_cpt_cleanup_fsm_ivt_used;   // NB cycles UPT LOCK used
+      uint32_t m_cpt_cas_fsm_upt_used;       // NB cycles UPT LOCK used
       
-      uint32_t     m_cpt_write_fsm_upt_used;     // NB cycles UPT LOCK used
-      uint32_t     m_cpt_xram_rsp_fsm_upt_used;  // NB cycles UPT LOCK used
-      uint32_t     m_cpt_multi_ack_fsm_upt_used; // NB cycles UPT LOCK used
-      uint32_t     m_cpt_cleanup_fsm_ivt_used;   // NB cycles UPT LOCK used
-      uint32_t     m_cpt_cas_fsm_upt_used;       // NB cycles UPT LOCK used
+      uint32_t m_cpt_ivt_unused;            // NB cycles UPT LOCK unused
+      uint32_t m_cpt_upt_unused;            // NB cycles UPT LOCK unused
+
+      uint32_t m_cpt_read_fsm_heap_lock;     // wait HEAP LOCK
+      uint32_t m_cpt_write_fsm_heap_lock;    // wait HEAP LOCK
+      uint32_t m_cpt_cas_fsm_heap_lock;      // wait HEAP LOCK
+      uint32_t m_cpt_cleanup_fsm_heap_lock;  // wait HEAP LOCK
+      uint32_t m_cpt_xram_rsp_fsm_heap_lock; // wait HEAP LOCK
       
-      uint32_t     m_cpt_ivt_unused;            // NB cycles UPT LOCK unused
-      uint32_t     m_cpt_upt_unused;            // NB cycles UPT LOCK unused
-
-      uint32_t     m_cpt_read_fsm_heap_lock;     // wait HEAP LOCK
-      uint32_t     m_cpt_write_fsm_heap_lock;    // wait HEAP LOCK
-      uint32_t     m_cpt_cas_fsm_heap_lock;      // wait HEAP LOCK
-      uint32_t     m_cpt_cleanup_fsm_heap_lock;  // wait HEAP LOCK
-      uint32_t     m_cpt_xram_rsp_fsm_heap_lock; // wait HEAP LOCK
+      uint32_t m_cpt_read_fsm_n_heap_lock;     // NB HEAP LOCK
+      uint32_t m_cpt_write_fsm_n_heap_lock;    // NB HEAP LOCK
+      uint32_t m_cpt_cas_fsm_n_heap_lock;      // NB HEAP LOCK
+      uint32_t m_cpt_cleanup_fsm_n_heap_lock;  // NB HEAP LOCK
+      uint32_t m_cpt_xram_rsp_fsm_n_heap_lock; // NB HEAP LOCK
       
-      uint32_t     m_cpt_read_fsm_n_heap_lock;     // NB HEAP LOCK
-      uint32_t     m_cpt_write_fsm_n_heap_lock;    // NB HEAP LOCK
-      uint32_t     m_cpt_cas_fsm_n_heap_lock;      // NB HEAP LOCK
-      uint32_t     m_cpt_cleanup_fsm_n_heap_lock;  // NB HEAP LOCK
-      uint32_t     m_cpt_xram_rsp_fsm_n_heap_lock; // NB HEAP LOCK
+      uint32_t m_cpt_read_fsm_heap_used;     // NB cycles HEAP LOCK used
+      uint32_t m_cpt_write_fsm_heap_used;    // NB cycles HEAP LOCK used
+      uint32_t m_cpt_cas_fsm_heap_used;      // NB cycles HEAP LOCK used
+      uint32_t m_cpt_cleanup_fsm_heap_used;  // NB cycles HEAP LOCK used
+      uint32_t m_cpt_xram_rsp_fsm_heap_used; // NB cycles HEAP LOCK used
       
-      uint32_t     m_cpt_read_fsm_heap_used;     // NB cycles HEAP LOCK used
-      uint32_t     m_cpt_write_fsm_heap_used;    // NB cycles HEAP LOCK used
-      uint32_t     m_cpt_cas_fsm_heap_used;      // NB cycles HEAP LOCK used
-      uint32_t     m_cpt_cleanup_fsm_heap_used;  // NB cycles HEAP LOCK used
-      uint32_t     m_cpt_xram_rsp_fsm_heap_used; // NB cycles HEAP LOCK used
-      
-      uint32_t     m_cpt_heap_unused;             // NB cycles HEAP LOCK unused
-      uint32_t     m_cpt_heap_slot_available;     // NB HEAP slot available refresh at each cycles
-      uint32_t     m_cpt_heap_min_slot_available; // NB HEAP : Min of slot available 
-
-      //RWT
-      uint32_t     m_cpt_cleanup_data;   
-      uint32_t     m_cpt_ncc_to_cc_read;         // NB change from NCC to CC caused by a READ
-      uint32_t     m_cpt_ncc_to_cc_write;        // NB change from NCC to CC caused by a WRITE
-
-      uint32_t     m_cpt_read_data_unc;
-      uint32_t     m_cpt_read_data_miss_CC;
-      uint32_t     m_cpt_read_ins_unc;
-      uint32_t     m_cpt_read_ins_miss;
-      uint32_t     m_cpt_read_ll_CC;
-      uint32_t     m_cpt_read_data_miss_NCC;
-      uint32_t     m_cpt_read_ll_NCC;
-      uint32_t     m_cpt_read_WTF;
-
-      uint32_t     m_cpt_update_flits;  // Number of flits for UPDATEs
-      uint32_t     m_cpt_inval_cost;    // Number of (flits * distance) for INVALs
-
-      uint32_t     m_cpt_get;
-      uint32_t     m_cpt_put;
-
-      size_t       m_prev_count;
+      uint32_t m_cpt_read_data_unc;
+      uint32_t m_cpt_read_data_miss_CC;
+      uint32_t m_cpt_read_ins_unc;
+      uint32_t m_cpt_read_ins_miss;
+      uint32_t m_cpt_read_ll_CC;
+      uint32_t m_cpt_read_data_miss_NCC;
+      uint32_t m_cpt_read_ll_NCC;
+
+      size_t   m_prev_count;
 
       protected:
