Index: trunk/platforms/tsar_generic_xbar/top.cpp
===================================================================
--- trunk/platforms/tsar_generic_xbar/top.cpp	(revision 779)
+++ trunk/platforms/tsar_generic_xbar/top.cpp	(revision 836)
@@ -397,5 +397,5 @@
 #else
             size_t x = debug_memc_id >> Y_WIDTH;
-            size_t y = debug_memc_id & ((1<<Y_WIDTH)-1);
+            size_t y = debug_memc_id & ((1 << Y_WIDTH) - 1);
 
             assert( (x <= X_SIZE) and (y <= Y_SIZE) &&
@@ -411,6 +411,6 @@
 #else
             size_t cluster_xy = debug_proc_id / NB_PROCS_MAX ;
-            size_t x          = cluster_xy >> Y_WIDTH;
-            size_t y          = cluster_xy & ((1<<Y_WIDTH)-1);
+            size_t x = cluster_xy >> Y_WIDTH;
+            size_t y = cluster_xy & ((1 << Y_WIDTH) - 1);
 
             assert( (x <= X_SIZE) and (y <= Y_SIZE) &&
@@ -635,5 +635,5 @@
          sc_uint<vci_address_width> offset;
          offset = (sc_uint<vci_address_width>)cluster(x,y) 
-                   << (vci_address_width-x_width-y_width);
+                   << (vci_address_width - x_width - y_width);
 
          std::ostringstream sh;
@@ -699,5 +699,5 @@
                    dspin_rsp_width,
                    vci_param_int,
-                   vci_param_ext>*          clusters[X_SIZE][Y_SIZE];
+                   vci_param_ext> * clusters[X_SIZE][Y_SIZE];
 
 #if USE_OPENMP
@@ -769,6 +769,6 @@
                 frozen_cycles,
                 debug_from,
-                debug_ok and (cluster(x,y) == debug_memc_id),
-                debug_ok and (cluster(x,y) == debug_proc_id)
+                debug_ok,
+                debug_ok
             );
 
@@ -880,4 +880,26 @@
 
 
+#ifdef WT_IDL
+    std::list<VciCcVCacheWrapper<vci_param_int,
+        dspin_cmd_width,
+        dspin_rsp_width,
+        GdbServer<Mips32ElIss> > * > l1_caches;
+
+   for (size_t x = 0; x < X_SIZE; x++) {
+      for (size_t y = 0; y < Y_SIZE; y++) {
+         for (int proc = 0; proc < NB_PROCS_MAX; proc++) {
+            l1_caches.push_back(clusters[x][y]->proc[proc]);
+         }
+      }
+   }
+
+   for (size_t x = 0; x < X_SIZE; x++) {
+      for (size_t y = 0; y < Y_SIZE; y++) {
+         clusters[x][y]->memc->set_vcache_list(l1_caches);
+      }
+   }
+#endif
+
+
 //#define SC_TRACE
 #ifdef SC_TRACE
@@ -943,10 +965,10 @@
                signal_dspin_false_cmd_out[x][y][a][k].read  = true;
             }
-             for (size_t k = 0; k < 2; k++){
-                signal_dspin_false_rsp_in [x][y][a][k].write = false;
-                signal_dspin_false_rsp_in [x][y][a][k].read  = true;
-                signal_dspin_false_rsp_out[x][y][a][k].write = false;
-                signal_dspin_false_rsp_out[x][y][a][k].read  = true;
-             }
+            for (size_t k = 0; k < 2; k++){
+               signal_dspin_false_rsp_in [x][y][a][k].write = false;
+               signal_dspin_false_rsp_in [x][y][a][k].read  = true;
+               signal_dspin_false_rsp_out[x][y][a][k].write = false;
+               signal_dspin_false_rsp_out[x][y][a][k].read  = true;
+            }
          }
       }
@@ -968,8 +990,4 @@
       for (int64_t n = 1; n < ncycles && !stop_called; n++)
       {
-         // Monitor a specific address for L1 & L2 caches
-         //clusters[0][0]->proc[0]->cache_monitor(0x800002c000ULL);
-         //clusters[1][0]->memc->copies_monitor(0x800002C000ULL);
-
          if ((n % max_cycles) == 0)
          {
@@ -1012,62 +1030,41 @@
          {
             std::cout << "****************** cycle " << std::dec << n ;
-            std::cout << " ************************************************" << std::endl;
-
-            // trace proc[debug_proc_id]
-            size_t l = debug_proc_id % NB_PROCS_MAX ;
-            size_t y = (debug_proc_id / NB_PROCS_MAX) % Y_SIZE ;
-            size_t x = debug_proc_id / (Y_SIZE * NB_PROCS_MAX) ;
-
-            std::ostringstream proc_signame;
-            proc_signame << "[SIG]PROC_" << x << "_" << y << "_" << l ;
-            std::ostringstream p2m_signame;
-            p2m_signame << "[SIG]PROC_" << x << "_" << y << "_" << l << " P2M" ;
-            std::ostringstream m2p_signame;
-            m2p_signame << "[SIG]PROC_" << x << "_" << y << "_" << l << " M2P" ;
-
-            //clusters[x][y]->signal_vci_ini_proc[l].print_trace(proc_signame.str());
-            //clusters[x][y]->signal_dspin_p2m_proc[l].print_trace(p2m_signame.str());
-            //clusters[x][y]->signal_dspin_m2p_proc[l].print_trace(m2p_signame.str());
-
-            //clusters[x][y]->signal_dspin_cmd_l2g_d.print_trace("[SIG]L2G CMD");
-            //clusters[x][y]->signal_dspin_cmd_g2l_d.print_trace("[SIG]G2L CMD");
-            //clusters[x][y]->signal_dspin_rsp_l2g_d.print_trace("[SIG]L2G RSP");
-            //clusters[x][y]->signal_dspin_rsp_g2l_d.print_trace("[SIG]G2L RSP");
-
-            // trace memc[debug_memc_id]
-            x = debug_memc_id / Y_SIZE;
-            y = debug_memc_id % Y_SIZE;
-
-            std::ostringstream smemc;
-            smemc << "[SIG]MEMC_" << x << "_" << y;
-            std::ostringstream sxram;
-            sxram << "[SIG]XRAM_" << x << "_" << y;
-            std::ostringstream sm2p;
-            sm2p << "[SIG]MEMC_" << x << "_" << y << " M2P" ;
-            std::ostringstream sp2m;
-            sp2m << "[SIG]MEMC_" << x << "_" << y << " P2M" ;
-
-            //clusters[x][y]->memc->print_trace();
-            //clusters[x][y]->signal_vci_tgt_memc.print_trace(smemc.str());
-            //clusters[x][y]->signal_vci_xram.print_trace(sxram.str());
-            //clusters[x][y]->signal_dspin_p2m_memc.print_trace(sp2m.str());
-            //clusters[x][y]->signal_dspin_m2p_memc.print_trace(sm2p.str());
-
-            // trace replicated peripherals
-            //clusters[1][1]->mdma->print_trace();
-            //clusters[1][1]->signal_vci_tgt_mdma.print_trace("[SIG]MDMA_TGT_1_1");
-            //clusters[1][1]->signal_vci_ini_mdma.print_trace("[SIG]MDMA_INI_1_1");
-
-
-            // trace external peripherals
-            //size_t io_x   = cluster_io_id / Y_SIZE;
-            //size_t io_y   = cluster_io_id % Y_SIZE;
-
-            //clusters[io_x][io_y]->brom->print_trace();
-            //clusters[io_x][io_y]->signal_vci_tgt_brom.print_trace("[SIG]BROM");
-
-            //clusters[io_x][io_y]->bdev->print_trace();
-            //clusters[io_x][io_y]->signal_vci_tgt_bdev.print_trace("[SIG]BDEV_TGT");
-            //clusters[io_x][io_y]->signal_vci_ini_bdev.print_trace("[SIG]BDEV_INI");
+            std::cout << "************************************************" << std::endl;
+
+            for (size_t x = 0; x < X_SIZE ; x++){
+               for (size_t y = 0; y < Y_SIZE ; y++){
+                  for (int proc = 0; proc < NB_PROCS_MAX; proc++) {
+
+                     clusters[x][y]->proc[proc]->print_trace();
+                     
+                     std::ostringstream proc_signame;
+                     proc_signame << "[SIG]PROC_" << x << "_" << y << "_" << proc ;
+                     std::ostringstream p2m_signame;
+                     p2m_signame << "[SIG]PROC_" << x << "_" << y << "_" << proc << " P2M";
+                     std::ostringstream m2p_signame;
+                     m2p_signame << "[SIG]PROC_" << x << "_" << y << "_" << proc << " M2P";
+
+                     clusters[x][y]->signal_vci_ini_proc[proc].print_trace(proc_signame.str());
+                     clusters[x][y]->signal_dspin_p2m_proc[proc].print_trace(p2m_signame.str());
+                     clusters[x][y]->signal_dspin_m2p_proc[proc].print_trace(m2p_signame.str());
+                  }
+
+                  clusters[x][y]->memc->print_trace();
+
+                  std::ostringstream smemc;
+                  smemc << "[SIG]MEMC_" << x << "_" << y;
+                  std::ostringstream sxram;
+                  sxram << "[SIG]XRAM_" << x << "_" << y;
+                  std::ostringstream sm2p;
+                  sm2p << "[SIG]MEMC_" << x << "_" << y << " M2P";
+                  std::ostringstream sp2m;
+                  sp2m << "[SIG]MEMC_" << x << "_" << y << " P2M";
+
+                  clusters[x][y]->signal_vci_tgt_memc.print_trace(smemc.str());
+                  clusters[x][y]->signal_vci_xram.print_trace(sxram.str());
+                  clusters[x][y]->signal_dspin_p2m_memc.print_trace(sp2m.str());
+                  clusters[x][y]->signal_dspin_m2p_memc.print_trace(sm2p.str());
+               }
+            }
          }
 
