Index: branches/reconfiguration/platforms/tsar_generic_iob/top.cpp
===================================================================
--- branches/reconfiguration/platforms/tsar_generic_iob/top.cpp	(revision 974)
+++ branches/reconfiguration/platforms/tsar_generic_iob/top.cpp	(revision 986)
@@ -1069,10 +1069,10 @@
 
    // Clusters
-   TsarIobCluster<vci_param_int,
-                  vci_param_ext,
-                  dspin_int_cmd_width,
-                  dspin_int_rsp_width,
-                  dspin_ram_cmd_width,
-                  dspin_ram_rsp_width>* clusters[X_SIZE][Y_SIZE];
+   typedef TsarIobCluster<
+      vci_param_int, vci_param_ext,
+      dspin_int_cmd_width, dspin_int_rsp_width,
+      dspin_ram_cmd_width, dspin_ram_rsp_width> TsarCluster;
+
+   TsarCluster* clusters[X_SIZE][Y_SIZE];
 
 #if USE_OPENMP
@@ -1107,11 +1107,5 @@
             std::ostringstream sc;
             sc << "cluster_" << x << "_" << y;
-            clusters[x][y] = new TsarIobCluster<vci_param_int,
-                                                vci_param_ext,
-                                                dspin_int_cmd_width,
-                                                dspin_int_rsp_width,
-                                                dspin_ram_cmd_width,
-                                                dspin_ram_rsp_width>
-            (
+            clusters[x][y] = new TsarCluster (
                 sc.str().c_str(),
                 NB_PROCS_MAX,
@@ -1555,5 +1549,5 @@
    }
 
-#if USE_NIC == 0
+#if !USE_NIC
    for (int i = 0; i < NB_NIC_CHANNELS; i++)
    {
@@ -1577,5 +1571,5 @@
 
    // cycles between stats
-   const size_t stats_period = 300000;
+   const size_t stats_period = 500000;
    const size_t simul_period = debug_ok ? debug_period : stats_period;
 
@@ -1600,13 +1594,4 @@
       }
 
-      // Monitor a specific address for one L1 cache
-      // clusters[1][1]->proc[0]->cache_monitor(0x50090ULL);
-
-      // Monitor a specific address for one L2 cache
-      // clusters[0][0]->memc->cache_monitor( 0x170000ULL);
-
-      // Monitor a specific address for one XRAM
-      // if (n == 3000000) clusters[0][0]->xram->start_monitor( 0x170000ULL , 64);
-
       if (debug_ok and (n > debug_from) and (n % debug_period == 0))
       {
@@ -1614,15 +1599,4 @@
          std::cout << " ************************************************" << std::endl;
 
-#if 0
-         for (int x = 0; x < X_SIZE; ++x)
-         {
-            for (int y = 0; y < Y_SIZE; ++y)
-            {
-               clusters[x][y]->int_router_cmd[0]->print_trace();
-               clusters[x][y]->int_router_rsp[0]->print_trace();
-            }
-         }
-#endif
-
          // trace proc[debug_proc_id]
          if ( debug_proc_id != 0xFFFFFFFF )
@@ -1633,20 +1607,17 @@
             size_t y          = cluster_xy & ((1 << Y_WIDTH) - 1);
 
-            clusters[x][y]->proc[l]->print_trace(1);
+            TsarCluster *c = clusters[x][y];
+
+            c->proc[l]->print_trace(1);
             std::ostringstream proc_signame;
             proc_signame << "[SIG]PROC_" << x << "_" << y << "_" << l ;
-            clusters[x][y]->signal_int_vci_ini_proc[l].print_trace(proc_signame.str());
-
-            clusters[x][y]->xicu->print_trace(l);
+            c->signal_int_vci_ini_proc[l].print_trace(proc_signame.str());
+
+            c->xicu->print_trace(l);
             std::ostringstream xicu_signame;
             xicu_signame << "[SIG]XICU_" << x << "_" << y;
-            clusters[x][y]->signal_int_vci_tgt_xicu.print_trace(xicu_signame.str());
-
-            //              clusters[x][y]->mdma->print_trace();
-            //              std::ostringstream mdma_signame;
-            //              mdma_signame << "[SIG]MDMA_" << x << "_" << y;
-            //              clusters[x][y]->signal_int_vci_tgt_mdma.print_trace(mdma_signame.str());
-
-            if( clusters[x][y]->signal_proc_it[l].read() )
+            c->signal_int_vci_tgt_xicu.print_trace(xicu_signame.str());
+
+            if( c->signal_proc_it[l].read() )
                std::cout << "### IRQ_PROC_" << std::dec
                   << x << "_" << y << "_" << l << " ACTIVE" << std::endl;
@@ -1659,16 +1630,18 @@
             size_t y = debug_memc_id & ((1 << Y_WIDTH) - 1);
 
-            clusters[x][y]->memc->print_trace(0);
+            TsarCluster *c = clusters[x][y];
+
+            c->memc->print_trace(0);
             std::ostringstream smemc_tgt;
             smemc_tgt << "[SIG]MEMC_TGT_" << x << "_" << y;
-            clusters[x][y]->signal_int_vci_tgt_memc.print_trace(smemc_tgt.str());
+            c->signal_int_vci_tgt_memc.print_trace(smemc_tgt.str());
             std::ostringstream smemc_ini;
             smemc_ini << "[SIG]MEMC_INI_" << x << "_" << y;
-            clusters[x][y]->signal_ram_vci_ini_memc.print_trace(smemc_ini.str());
-
-            clusters[x][y]->xram->print_trace();
+            c->signal_ram_vci_ini_memc.print_trace(smemc_ini.str());
+
+            c->xram->print_trace();
             std::ostringstream sxram_tgt;
             sxram_tgt << "[SIG]XRAM_TGT_" << x << "_" << y;
-            clusters[x][y]->signal_ram_vci_tgt_xram.print_trace(sxram_tgt.str());
+            c->signal_ram_vci_tgt_xram.print_trace(sxram_tgt.str());
          }
 
@@ -1680,11 +1653,13 @@
             size_t y = debug_xram_id & ((1 << Y_WIDTH) - 1);
 
-            clusters[x][y]->xram->print_trace();
+            TsarCluster *c = clusters[x][y];
+
+            c->xram->print_trace();
             std::ostringstream sxram_tgt;
             sxram_tgt << "[SIG]XRAM_TGT_" << x << "_" << y;
-            clusters[x][y]->signal_ram_vci_tgt_xram.print_trace(sxram_tgt.str());
-
-            clusters[x][y]->ram_router_cmd->print_trace();
-            clusters[x][y]->ram_router_rsp->print_trace();
+            c->signal_ram_vci_tgt_xram.print_trace(sxram_tgt.str());
+
+            c->ram_router_cmd->print_trace();
+            c->ram_router_rsp->print_trace();
          }
 
@@ -1692,15 +1667,24 @@
          if ( debug_iob )
          {
-            clusters[0][0]->iob->print_trace();
-            clusters[X_SIZE-1][Y_SIZE-1]->iob->print_trace();
-            //              clusters[0][0]->signal_int_vci_tgt_iobx.print_trace( "[SIG]IOB0_INT_TGT");
-            //              clusters[0][0]->signal_int_vci_ini_iobx.print_trace( "[SIG]IOB0_INT_INI");
-            //              clusters[0][0]->signal_ram_vci_ini_iobx.print_trace( "[SIG]IOB0_RAM_INI");
-
+            TsarCluster* c;
+
+            c = clusters[0][0];
+            c->iob->print_trace();
+            c->signal_int_vci_tgt_iobx.print_trace("[SIG]IOB0_INT_TGT");
+            c->signal_int_vci_ini_iobx.print_trace("[SIG]IOB0_INT_INI");
+            c->signal_ram_vci_ini_iobx.print_trace("[SIG]IOB0_RAM_INI");
             signal_vci_ini_iob0.print_trace("[SIG]IOB0_IOX_INI");
             signal_vci_tgt_iob0.print_trace("[SIG]IOB0_IOX_TGT");
 
-            // mtty->print_trace();
-            // signal_vci_tgt_mtty.print_trace("[SIG]IOX_MTTY_TGT");
+            c = clusters[X_SIZE-1][Y_SIZE-1];
+            c->iob->print_trace();
+            c->signal_int_vci_tgt_iobx.print_trace("[SIG]IOB1_INT_TGT");
+            c->signal_int_vci_ini_iobx.print_trace("[SIG]IOB1_INT_INI");
+            c->signal_ram_vci_ini_iobx.print_trace("[SIG]IOB1_RAM_INI");
+            signal_vci_ini_iob1.print_trace("[SIG]IOB1_IOX_INI");
+            signal_vci_tgt_iob1.print_trace("[SIG]IOB1_IOX_TGT");
+
+            mtty->print_trace();
+            signal_vci_tgt_mtty.print_trace("[SIG]IOX_MTTY_TGT");
 
             bdev->print_trace();
@@ -1708,29 +1692,21 @@
             signal_vci_ini_bdev.print_trace("[SIG]BDEV_INI");
 
-            // mnic->print_trace();
-            // signal_vci_tgt_mnic.print_trace("[SIG]MNIC_TGT");
-
-            // cdma->print_trace();
-            // signal_vci_tgt_cdma.print_trace("[SIG]IOX_CDMA_TGT");
-            // signal_vci_ini_cdma.print_trace("[SIG]IOX_CDMA_INI");
-
-            // fbuf->print_trace();
-            // signal_vci_tgt_fbuf.print_trace("[SIG]FBUF");
-
             iopi->print_trace();
             signal_vci_ini_iopi.print_trace("[SIG]IOPI_INI");
             signal_vci_tgt_iopi.print_trace("[SIG]IOPI_TGT");
 
-            signal_vci_tgt_simh.print_trace("[SIG]SIMH_TGT");
-
-            iox_network->print_trace();
-
             // interrupts
-            if (signal_irq_bdev)       std::cout << "### IRQ_BDEV ACTIVE"       << std::endl;
-            if (signal_irq_mtty_rx[0]) std::cout << "### IRQ_MTTY ACTIVE"       << std::endl;
-            if (signal_irq_mnic_rx[0]) std::cout << "### IRQ_MNIC_RX[0] ACTIVE" << std::endl;
-            if (signal_irq_mnic_rx[1]) std::cout << "### IRQ_MNIC_RX[1] ACTIVE" << std::endl;
-            if (signal_irq_mnic_tx[0]) std::cout << "### IRQ_MNIC_TX[0] ACTIVE" << std::endl;
-            if (signal_irq_mnic_tx[1]) std::cout << "### IRQ_MNIC_TX[1] ACTIVE" << std::endl;
+            if (signal_irq_bdev)
+               std::cout << "### IRQ_BDEV ACTIVE" << std::endl;
+            if (signal_irq_mtty_rx[0])
+               std::cout << "### IRQ_MTTY ACTIVE" << std::endl;
+
+#if USE_NIC
+            for ( size_t i=0 ; i<NB_NIC_CHANNELS ; ++i )
+               if (signal_irq_mnic_rx[i])
+                  std::cout << "### IRQ_MNIC_RX[" << i << "] ACTIVE" << std::endl;
+               if (signal_irq_mnic_tx[i])
+                  std::cout << "### IRQ_MNIC_TX[" << i << "] ACTIVE" << std::endl;
+#endif
          }
       }
