Index: /trunk/modules/vci_mem_cache/caba/source/src/vci_mem_cache.cpp
===================================================================
--- /trunk/modules/vci_mem_cache/caba/source/src/vci_mem_cache.cpp	(revision 508)
+++ /trunk/modules/vci_mem_cache/caba/source/src/vci_mem_cache.cpp	(revision 509)
@@ -546,5 +546,5 @@
 
     /////////////////////////////////////////////////////
-    tmpl(void) ::cache_monitor(addr_t addr)
+    tmpl(void)::cache_monitor(addr_t addr)
     /////////////////////////////////////////////////////
     {
@@ -614,9 +614,10 @@
     /////////////////////////////////////////////////////
     {
-        uint8_t self_x_srcid = m_cc_global_id >> (14 - m_xwidth);
-        uint8_t self_y_srcid = ((m_cc_global_id << m_xwidth) >> (14 - m_ywidth));
-
-        uint8_t x_srcid = req_srcid >> (14 - m_xwidth);
-        uint8_t y_srcid = ((req_srcid << m_xwidth) >> (14 - m_ywidth));
+        const uint32_t srcid_width = vci_param_int::S;
+        uint8_t self_x_srcid = m_cc_global_id >> (srcid_width - m_xwidth);
+        uint8_t self_y_srcid = (m_cc_global_id >> (srcid_width - m_ywidth)) & ((1 << m_xwidth) - 1);
+
+        uint8_t x_srcid = req_srcid >> (srcid_width - m_xwidth);
+        uint8_t y_srcid = (req_srcid >> (srcid_width - m_ywidth - m_xwidth)) & ((1 << m_xwidth) - 1);
         return abs(self_x_srcid - x_srcid) + abs(self_y_srcid - y_srcid);
     }
@@ -665,104 +666,107 @@
         std::cout << "**********************************" << std::dec << std::endl;
         if (activity_counters) {
-            std::cout << "   ----------------------------------" << std::dec << std::endl;
-            std::cout << "   ---     Activity Counters      ---" << std::dec << std::endl;
-            std::cout << "   ----------------------------------" << std::dec << std::endl;
+            std::cout << "----------------------------------" << std::dec << std::endl;
+            std::cout << "---     Activity Counters      ---" << std::dec << std::endl;
+            std::cout << "----------------------------------" << std::dec << std::endl;
             std::cout
-                << "   - NUMBER OF CYCLES          = " << m_cpt_cycles << std::endl
+                << "[001] NUMBER OF CYCLES          = " << m_cpt_cycles << std::endl
                 << std::endl
-                << "   - LOCAL READ                = " << m_cpt_read_local << std::endl
-                << "   - REMOTE READ               = " << m_cpt_read_remote << std::endl
-                << "   - READ COST (FLITS * DIST)  = " << m_cpt_read_cost << std::endl
+                << "[002] LOCAL READ                = " << m_cpt_read_local << std::endl
+                << "[003] REMOTE READ               = " << m_cpt_read_remote << std::endl
+                << "[004] READ COST (FLITS * DIST)  = " << m_cpt_read_cost << std::endl
                 << std::endl
-                << "   - LOCAL WRITE               = " << m_cpt_write_local << std::endl
-                << "   - REMOTE WRITE              = " << m_cpt_write_remote << std::endl
-                << "   - WRITE FLITS LOCAL         = " << m_cpt_write_flits_local << std::endl
-                << "   - WRITE FLITS REMOTE        = " << m_cpt_write_flits_remote << std::endl
-                << "   - WRITE COST (FLITS * DIST) = " << m_cpt_write_cost << std::endl
+                << "[005] LOCAL WRITE               = " << m_cpt_write_local << std::endl
+                << "[006] REMOTE WRITE              = " << m_cpt_write_remote << std::endl
+                << "[007] WRITE FLITS LOCAL         = " << m_cpt_write_flits_local << std::endl
+                << "[008] WRITE FLITS REMOTE        = " << m_cpt_write_flits_remote << std::endl
+                << "[009] WRITE COST (FLITS * DIST) = " << m_cpt_write_cost << std::endl
                 << std::endl
-                << "   - LOCAL LL                  = " << m_cpt_ll_local << std::endl
-                << "   - REMOTE LL                 = " << m_cpt_ll_remote << std::endl
-                << "   - LL COST (FLITS * DIST)    = " << m_cpt_ll_cost << std::endl
+                << "[010] LOCAL LL                  = " << m_cpt_ll_local << std::endl
+                << "[011] REMOTE LL                 = " << m_cpt_ll_remote << std::endl
+                << "[012] LL COST (FLITS * DIST)    = " << m_cpt_ll_cost << std::endl
                 << std::endl
-                << "   - LOCAL SC                  = " << m_cpt_sc_local << std::endl
-                << "   - REMOTE SC                 = " << m_cpt_sc_remote << std::endl
-                << "   - SC COST (FLITS * DIST)    = " << m_cpt_sc_cost << std::endl
+                << "[013] LOCAL SC                  = " << m_cpt_sc_local << std::endl
+                << "[014] REMOTE SC                 = " << m_cpt_sc_remote << std::endl
+                << "[015] SC COST (FLITS * DIST)    = " << m_cpt_sc_cost << std::endl
                 << std::endl
-                << "   - LOCAL CAS                 = " << m_cpt_cas_local << std::endl
-                << "   - REMOTE CAS                = " << m_cpt_cas_remote << std::endl
-                << "   - CAS COST (FLITS * DIST)   = " << m_cpt_cas_cost << std::endl
+                << "[016] LOCAL CAS                 = " << m_cpt_cas_local << std::endl
+                << "[017] REMOTE CAS                = " << m_cpt_cas_remote << std::endl
+                << "[018] CAS COST (FLITS * DIST)   = " << m_cpt_cas_cost << std::endl
                 << std::endl
-                << "   - REQUESTS TRIG. UPDATE     = " << m_cpt_update << std::endl
-                << "   - LOCAL UPDATE              = " << m_cpt_update_local << std::endl
-                << "   - REMOTE UPDATE             = " << m_cpt_update_remote << std::endl
-                << "   - UPDT COST (FLITS * DIST)  = " << m_cpt_update_cost << std::endl
+                << "[019] REQUESTS TRIG. UPDATE     = " << m_cpt_update << std::endl
+                << "[020] LOCAL UPDATE              = " << m_cpt_update_local << std::endl
+                << "[021] REMOTE UPDATE             = " << m_cpt_update_remote << std::endl
+                << "[022] UPDT COST (FLITS * DIST)  = " << m_cpt_update_cost << std::endl
                 << std::endl
-                << "   - REQUESTS TRIG. M_INV      = " << m_cpt_m_inval << std::endl
-                << "   - LOCAL M_INV               = " << m_cpt_m_inval_local << std::endl
-                << "   - REMOTE M_INV              = " << m_cpt_m_inval_remote << std::endl
-                << "   - M_INV COST (FLITS * DIST) = " << m_cpt_m_inval_cost << std::endl
+                << "[023] REQUESTS TRIG. M_INV      = " << m_cpt_m_inval << std::endl
+                << "[024] LOCAL M_INV               = " << m_cpt_m_inval_local << std::endl
+                << "[025] REMOTE M_INV              = " << m_cpt_m_inval_remote << std::endl
+                << "[026] M_INV COST (FLITS * DIST) = " << m_cpt_m_inval_cost << std::endl
                 << std::endl
-                << "   - BROADCAT INVAL            = " << m_cpt_br_inval << std::endl
+                << "[027] BROADCAT INVAL            = " << m_cpt_br_inval << std::endl
                 << std::endl
-                << "   - LOCAL CLEANUP             = " << m_cpt_cleanup_local << std::endl
-                << "   - REMOTE CLEANUP            = " << m_cpt_cleanup_remote << std::endl
-                << "   - CLNUP COST (FLITS * DIST) = " << m_cpt_cleanup_cost << std::endl
+                << "[028] LOCAL CLEANUP             = " << m_cpt_cleanup_local << std::endl
+                << "[029] REMOTE CLEANUP            = " << m_cpt_cleanup_remote << std::endl
+                << "[030] CLNUP COST (FLITS * DIST) = " << m_cpt_cleanup_cost << std::endl
                 << std::endl
                 << std::endl
-                << "   - READ MISS                 = " << m_cpt_read_miss << std::endl
-                << "   - WRITE MISS                = " << m_cpt_write_miss << std::endl
-                << "   - WRITE DIRTY               = " << m_cpt_write_dirty << std::endl
-                << "   - RD BLOCKED BY HIT IN TRT  = " << m_cpt_trt_rb << std::endl
-                << "   - TRANS BLOCKED BY FULL TRT = " << m_cpt_trt_full << std::endl
-                << "   - PUT                       = " << m_cpt_put << std::endl
-                << "   - GET                       = " << m_cpt_get << std::endl;
+                << "[031] READ MISS                 = " << m_cpt_read_miss << std::endl
+                << "[032] WRITE MISS                = " << m_cpt_write_miss << std::endl
+                << "[033] WRITE DIRTY               = " << m_cpt_write_dirty << std::endl
+                << "[034] RD BLOCKED BY HIT IN TRT  = " << m_cpt_trt_rb << std::endl
+                << "[035] TRANS BLOCKED BY FULL TRT = " << m_cpt_trt_full << std::endl
+                << "[036] PUT (UNIMPLEMENTED)       = " << m_cpt_put << std::endl
+                << "[037] GET (UNIMPLEMENTED)       = " << m_cpt_get << std::endl
+                << std::endl;
         }
 
         if (stats) {
-            std::cout << "   ----------------------------------" << std::dec << std::endl;
-            std::cout << "   ---      Calculated Stats      ---" << std::dec << std::endl;
-            std::cout << "   ----------------------------------" << std::dec << std::endl;
+            std::cout << "----------------------------------" << std::dec << std::endl;
+            std::cout << "---      Calculated Stats      ---" << std::dec << std::endl;
+            std::cout << "----------------------------------" << std::dec << std::endl;
             std::cout
-                << "   - READ TOTAL            = " << m_cpt_read_local + m_cpt_read_remote << std::endl
-                << "   - READ RATE             = " << (double) (m_cpt_read_local + m_cpt_read_remote) / m_cpt_cycles << std::endl
-                << "   - LOCAL READ RATE       = " << (double) m_cpt_read_local / m_cpt_cycles << std::endl
-                << "   - REMOTE READ RATE      = " << (double) m_cpt_read_remote / m_cpt_cycles << std::endl
-                << "   - READ MISS RATE        = " << (double) m_cpt_read_miss / (m_cpt_read_local + m_cpt_read_remote) << std::endl
+                << "[100] READ TOTAL            = " << m_cpt_read_local + m_cpt_read_remote << std::endl
+                << "[101] READ RATE             = " << (double) (m_cpt_read_local + m_cpt_read_remote) / m_cpt_cycles << std::endl
+                << "[102] LOCAL READ RATE       = " << (double) m_cpt_read_local / m_cpt_cycles << std::endl
+                << "[103] REMOTE READ RATE      = " << (double) m_cpt_read_remote / m_cpt_cycles << std::endl
+                << "[104] READ MISS RATE        = " << (double) m_cpt_read_miss / (m_cpt_read_local + m_cpt_read_remote) << std::endl
                 << std::endl
-                << "   - WRITE TOTAL           = " << m_cpt_write_local + m_cpt_write_remote << std::endl
-                << "   - WRITE RATE            = " << (double) (m_cpt_write_local + m_cpt_write_remote) / m_cpt_cycles << std::endl
-                << "   - LOCAL WRITE RATE      = " << (double) m_cpt_write_local / m_cpt_cycles << std::endl
-                << "   - REMOTE WRITE RATE     = " << (double) m_cpt_write_remote / m_cpt_cycles << std::endl
-                << "   - WRITE MISS RATE       = " << (double) m_cpt_write_miss / (m_cpt_write_local + m_cpt_write_remote) << std::endl
-                << "   - WRITE BURST TOTAL     = " << m_cpt_write_flits_local + m_cpt_write_flits_remote << std::endl
-                << "   - WRITE BURST AVERAGE   = " << (double) (m_cpt_write_flits_local + m_cpt_write_flits_remote) / (m_cpt_write_local + m_cpt_write_remote) << std::endl
-                << "   - LOCAL WRITE BURST AV. = " << (double) m_cpt_write_flits_local / (m_cpt_write_local + m_cpt_write_remote) << std::endl
-                << "   - REMOTE WRITE BURST AV = " << (double) m_cpt_write_flits_remote / (m_cpt_write_local + m_cpt_write_remote) << std::endl
+                << "[105] WRITE TOTAL           = " << m_cpt_write_local + m_cpt_write_remote << std::endl
+                << "[106] WRITE RATE            = " << (double) (m_cpt_write_local + m_cpt_write_remote) / m_cpt_cycles << std::endl
+                << "[107] LOCAL WRITE RATE      = " << (double) m_cpt_write_local / m_cpt_cycles << std::endl
+                << "[108] REMOTE WRITE RATE     = " << (double) m_cpt_write_remote / m_cpt_cycles << std::endl
+                << "[109] WRITE MISS RATE       = " << (double) m_cpt_write_miss / (m_cpt_write_local + m_cpt_write_remote) << std::endl
+                << "[110] WRITE BURST TOTAL     = " << m_cpt_write_flits_local + m_cpt_write_flits_remote << std::endl
+                << "[111] WRITE BURST AVERAGE   = " << (double) (m_cpt_write_flits_local + m_cpt_write_flits_remote) / (m_cpt_write_local + m_cpt_write_remote) << std::endl
+                << "[112] LOCAL WRITE BURST AV. = " << (double) m_cpt_write_flits_local / (m_cpt_write_local + m_cpt_write_remote) << std::endl
+                << "[113] REMOTE WRITE BURST AV = " << (double) m_cpt_write_flits_remote / (m_cpt_write_local + m_cpt_write_remote) << std::endl
                 << std::endl
-                << "   - UPDATE RATE                = " << (double) m_cpt_update / m_cpt_cycles << std::endl
-                << "   - AV. UPDATE PER UP REQ      = " << (double) (m_cpt_update_local + m_cpt_update_remote) / m_cpt_update << std::endl
-                << "   - AV. LOC UPDT PER UP REQ    = " << (double) m_cpt_update_local / m_cpt_update << std::endl
-                << "   - AV. REMOTE UPDT PER UP REQ = " << (double) m_cpt_update_remote / m_cpt_update << std::endl
+                << "[114] UPDATE RATE                = " << (double) m_cpt_update / m_cpt_cycles << std::endl
+                << "[115] AV. UPDATE PER UP REQ      = " << (double) (m_cpt_update_local + m_cpt_update_remote) / m_cpt_update << std::endl
+                << "[116] AV. LOC UPDT PER UP REQ    = " << (double) m_cpt_update_local / m_cpt_update << std::endl
+                << "[117] AV. REMOTE UPDT PER UP REQ = " << (double) m_cpt_update_remote / m_cpt_update << std::endl
                 << std::endl
-                << "   - INVAL MULTICAST RATE  = " << (double) m_cpt_m_inval / m_cpt_cycles << std::endl
-                << "   - AVE. INVAL PER M_INV  = " << (double) (m_cpt_m_inval_local + m_cpt_m_inval_remote) / m_cpt_m_inval << std::endl
-                << "   - AV. LOC INV PER M_INV = " << (double) m_cpt_m_inval_local / m_cpt_m_inval << std::endl
-                << "   - AV. REM INV PER M_INV = " << (double) m_cpt_m_inval_remote / m_cpt_m_inval << std::endl
+                << "[118] INVAL MULTICAST RATE  = " << (double) m_cpt_m_inval / m_cpt_cycles << std::endl
+                << "[119] AVE. INVAL PER M_INV  = " << (double) (m_cpt_m_inval_local + m_cpt_m_inval_remote) / m_cpt_m_inval << std::endl
+                << "[120] AV. LOC INV PER M_INV = " << (double) m_cpt_m_inval_local / m_cpt_m_inval << std::endl
+                << "[121] AV. REM INV PER M_INV = " << (double) m_cpt_m_inval_remote / m_cpt_m_inval << std::endl
                 << std::endl
-                << "   - INVAL BROADCAST RATE  = " << (double) m_cpt_br_inval / m_cpt_cycles << std::endl
-                << "   - WRITE DIRTY RATE      = " << (double) m_cpt_write_dirty / m_cpt_cycles << std::endl
+                << "[122] INVAL BROADCAST RATE  = " << (double) m_cpt_br_inval / m_cpt_cycles << std::endl
+                << "[123] WRITE DIRTY RATE      = " << (double) m_cpt_write_dirty / m_cpt_cycles << std::endl
                 << std::endl
-                << "   - CLEANUP RATE          = " << (double) (m_cpt_cleanup_local + m_cpt_cleanup_remote) / m_cpt_cycles << std::endl
-                << "   - LOCAL CLEANUP RATE    = " << (double) m_cpt_cleanup_local / m_cpt_cycles << std::endl
-                << "   - REMOTE CLEANUP RATE   = " << (double) m_cpt_cleanup_remote / m_cpt_cycles << std::endl
-                << "   - LL RATE               = " << (double) (m_cpt_ll_local + m_cpt_ll_remote) / m_cpt_cycles << std::endl
-                << "   - LOCAL LL RATE         = " << (double) m_cpt_ll_local / m_cpt_cycles << std::endl
-                << "   - REMOTE LL RATE        = " << (double) m_cpt_ll_remote / m_cpt_cycles << std::endl
-                << "   - SC RATE               = " << (double) (m_cpt_sc_local + m_cpt_sc_remote) / m_cpt_cycles << std::endl
-                << "   - LOCAL SC RATE         = " << (double) m_cpt_sc_local / m_cpt_cycles << std::endl
-                << "   - REMOTE SC RATE        = " << (double) m_cpt_sc_remote / m_cpt_cycles << std::endl
-                << "   - CAS RATE              = " << (double) (m_cpt_cas_local + m_cpt_cas_remote) / m_cpt_cycles << std::endl
-                << "   - LOCAL CAS RATE        = " << (double) m_cpt_cas_local / m_cpt_cycles << std::endl
-                << "   - REMOTE CAS RATE       = " << (double) m_cpt_cas_remote / m_cpt_cycles << std::endl;
+                << "[124] CLEANUP RATE          = " << (double) (m_cpt_cleanup_local + m_cpt_cleanup_remote) / m_cpt_cycles << std::endl
+                << "[125] LOCAL CLEANUP RATE    = " << (double) m_cpt_cleanup_local / m_cpt_cycles << std::endl
+                << "[126] REMOTE CLEANUP RATE   = " << (double) m_cpt_cleanup_remote / m_cpt_cycles << std::endl
+                << "[127] LL RATE               = " << (double) (m_cpt_ll_local + m_cpt_ll_remote) / m_cpt_cycles << std::endl
+                << "[128] LOCAL LL RATE         = " << (double) m_cpt_ll_local / m_cpt_cycles << std::endl
+                << "[129] REMOTE LL RATE        = " << (double) m_cpt_ll_remote / m_cpt_cycles << std::endl
+                << "[130] SC RATE               = " << (double) (m_cpt_sc_local + m_cpt_sc_remote) / m_cpt_cycles << std::endl
+                << "[131] LOCAL SC RATE         = " << (double) m_cpt_sc_local / m_cpt_cycles << std::endl
+                << "[132] REMOTE SC RATE        = " << (double) m_cpt_sc_remote / m_cpt_cycles << std::endl
+                << "[133] CAS RATE              = " << (double) (m_cpt_cas_local + m_cpt_cas_remote) / m_cpt_cycles << std::endl
+                << "[134] LOCAL CAS RATE        = " << (double) m_cpt_cas_local / m_cpt_cycles << std::endl
+                << "[135] REMOTE CAS RATE       = " << (double) m_cpt_cas_remote / m_cpt_cycles << std::endl
+                << std::endl
+                << std::endl;
         }
     }
