Index: trunk/platforms/tsar_generic_xbar/tsar_xbar_cluster/caba/source/include/tsar_xbar_cluster.h
===================================================================
--- trunk/platforms/tsar_generic_xbar/tsar_xbar_cluster/caba/source/include/tsar_xbar_cluster.h	(revision 624)
+++ trunk/platforms/tsar_generic_xbar/tsar_xbar_cluster/caba/source/include/tsar_xbar_cluster.h	(revision 706)
@@ -24,4 +24,5 @@
 #include "vci_xicu.h"
 #include "dspin_local_crossbar.h"
+#include "vci_local_crossbar.h"
 #include "vci_dspin_initiator_wrapper.h"
 #include "vci_dspin_target_wrapper.h"
@@ -36,5 +37,4 @@
 #include "vci_cc_vcache_wrapper.h"
 #include "vci_simhelper.h"
-#include "../../../../giet_vm/hard_config.h"
 
 namespace soclib { namespace caba {
@@ -63,5 +63,5 @@
     // interrupt signals
     sc_signal<bool>         signal_false;
-    sc_signal<bool>         signal_proc_it[8*IRQ_PER_PROCESSOR];
+    sc_signal<bool>         signal_proc_it[8 * 6]; // 6 = Number of IRQs in the MIPS
     sc_signal<bool>         signal_irq_mdma[8];
     sc_signal<bool>         signal_irq_mtty[23];
@@ -85,4 +85,7 @@
 
     // Direct VCI signals to VCI/DSPIN wrappers
+    VciSignals<vci_param_int>       signal_vci_g2l_d;
+    VciSignals<vci_param_int>       signal_vci_l2g_d;
+
     VciSignals<vci_param_int>       signal_vci_ini_proc[8];
     VciSignals<vci_param_int>       signal_vci_ini_mdma;
@@ -101,34 +104,4 @@
     VciSignals<vci_param_int>       signal_vci_tgt_simh;
 
-    // Direct DSPIN signals to local crossbars
-    DspinSignals<dspin_cmd_width>     signal_dspin_cmd_proc_i[8];
-    DspinSignals<dspin_rsp_width>     signal_dspin_rsp_proc_i[8];
-    DspinSignals<dspin_cmd_width>     signal_dspin_cmd_mdma_i;
-    DspinSignals<dspin_rsp_width>     signal_dspin_rsp_mdma_i;
-    DspinSignals<dspin_cmd_width>     signal_dspin_cmd_bdev_i;
-    DspinSignals<dspin_rsp_width>     signal_dspin_rsp_bdev_i;
-    DspinSignals<dspin_cmd_width>     signal_dspin_cmd_chbuf_i;
-    DspinSignals<dspin_rsp_width>     signal_dspin_rsp_chbuf_i;
-
-    DspinSignals<dspin_cmd_width>     signal_dspin_cmd_memc_t;
-    DspinSignals<dspin_rsp_width>     signal_dspin_rsp_memc_t;
-    DspinSignals<dspin_cmd_width>     signal_dspin_cmd_xicu_t;
-    DspinSignals<dspin_rsp_width>     signal_dspin_rsp_xicu_t;
-    DspinSignals<dspin_cmd_width>     signal_dspin_cmd_mdma_t;
-    DspinSignals<dspin_rsp_width>     signal_dspin_rsp_mdma_t;
-    DspinSignals<dspin_cmd_width>     signal_dspin_cmd_mtty_t;
-    DspinSignals<dspin_rsp_width>     signal_dspin_rsp_mtty_t;
-    DspinSignals<dspin_cmd_width>     signal_dspin_cmd_bdev_t;
-    DspinSignals<dspin_rsp_width>     signal_dspin_rsp_bdev_t;
-    DspinSignals<dspin_cmd_width>     signal_dspin_cmd_brom_t;
-    DspinSignals<dspin_rsp_width>     signal_dspin_rsp_brom_t;
-    DspinSignals<dspin_cmd_width>     signal_dspin_cmd_fbuf_t;
-    DspinSignals<dspin_rsp_width>     signal_dspin_rsp_fbuf_t;
-    DspinSignals<dspin_cmd_width>     signal_dspin_cmd_mnic_t;
-    DspinSignals<dspin_rsp_width>     signal_dspin_rsp_mnic_t;
-    DspinSignals<dspin_cmd_width>     signal_dspin_cmd_chbuf_t;
-    DspinSignals<dspin_rsp_width>     signal_dspin_rsp_chbuf_t;
-    DspinSignals<dspin_cmd_width>     signal_dspin_cmd_simh_t;
-    DspinSignals<dspin_rsp_width>     signal_dspin_rsp_simh_t;
 
     // Coherence DSPIN signals to local crossbar
@@ -150,7 +123,4 @@
                        GdbServer<Mips32ElIss> >*  proc[8];
 
-    VciDspinInitiatorWrapper<vci_param_int,
-                             dspin_cmd_width,
-                             dspin_rsp_width>*    wi_proc[8];
 
     VciMemCache<vci_param_int,
@@ -159,79 +129,32 @@
                 dspin_cmd_width>*                 memc;
 
+    VciXicu<vci_param_int>*                       xicu;
+
+    VciMultiDma<vci_param_int>*                   mdma;
+
+    VciSimpleRam<vci_param_ext>*                  xram;
+
+    VciSimpleRom<vci_param_int>*                  brom;
+
+    VciMultiTty<vci_param_int>*                   mtty;
+
+    VciSimhelper<vci_param_int>*                  simhelper;
+
+    VciFrameBuffer<vci_param_int>*                fbuf;
+
+    VciMultiNic<vci_param_int>*                  mnic;
+
+    VciChbufDma<vci_param_int>*                   chbuf;
+
+    VciBlockDeviceTsar<vci_param_int>*            bdev;
+
+    VciLocalCrossbar<vci_param_int>*              xbar_d;
+    VciDspinInitiatorWrapper<vci_param_int,
+                             dspin_cmd_width,
+                             dspin_rsp_width>*    wi_xbar_d;
     VciDspinTargetWrapper<vci_param_int,
                           dspin_cmd_width,
-                          dspin_rsp_width>*       wt_memc;
-
-    VciXicu<vci_param_int>*                       xicu;
-
-    VciDspinTargetWrapper<vci_param_int,
-                          dspin_cmd_width,
-                          dspin_rsp_width>*       wt_xicu;
-
-    VciMultiDma<vci_param_int>*                   mdma;
-
-    VciDspinInitiatorWrapper<vci_param_int,
-                             dspin_cmd_width,
-                             dspin_rsp_width>*    wi_mdma;
-
-    VciDspinTargetWrapper<vci_param_int,
-                          dspin_cmd_width,
-                          dspin_rsp_width>*       wt_mdma;
-
-    VciSimpleRam<vci_param_ext>*                  xram;
-
-    VciSimpleRom<vci_param_int>*                  brom;
-
-    VciDspinTargetWrapper<vci_param_int,
-                          dspin_cmd_width,
-                          dspin_rsp_width>*       wt_brom;
-
-    VciMultiTty<vci_param_int>*                   mtty;
-
-    VciDspinTargetWrapper<vci_param_int,
-                          dspin_cmd_width,
-                          dspin_rsp_width>*       wt_mtty;
-
-    VciSimhelper<vci_param_int>*                  simhelper;
-
-    VciDspinTargetWrapper<vci_param_int,
-                          dspin_cmd_width,
-                          dspin_rsp_width>*       wt_simhelper;
-
-
-    VciFrameBuffer<vci_param_int>*                fbuf;
-
-    VciDspinTargetWrapper<vci_param_int,
-                          dspin_cmd_width,
-                          dspin_rsp_width>*       wt_fbuf;
-
-    VciMultiNic<vci_param_int>*                   mnic;
-
-    VciDspinTargetWrapper<vci_param_int,
-                          dspin_cmd_width,
-                          dspin_rsp_width>*       wt_mnic;
-
-    VciChbufDma<vci_param_int>*                   chbuf;
-
-    VciDspinTargetWrapper<vci_param_int,
-                          dspin_cmd_width,
-                          dspin_rsp_width>*       wt_chbuf;
-
-    VciDspinInitiatorWrapper<vci_param_int,
-                          dspin_cmd_width,
-                          dspin_rsp_width>*       wi_chbuf;
-
-    VciBlockDeviceTsar<vci_param_int>*            bdev;
-
-    VciDspinInitiatorWrapper<vci_param_int,
-                             dspin_cmd_width,
-                             dspin_rsp_width>*    wi_bdev;
-
-    VciDspinTargetWrapper<vci_param_int,
-                          dspin_cmd_width,
-                          dspin_rsp_width>*       wt_bdev;
-
-    DspinLocalCrossbar<dspin_cmd_width>*          xbar_cmd_d;
-    DspinLocalCrossbar<dspin_rsp_width>*          xbar_rsp_d;
+                          dspin_rsp_width>*       wt_xbar_d;
+
     DspinLocalCrossbar<dspin_cmd_width>*          xbar_m2p_c;
     DspinLocalCrossbar<dspin_rsp_width>*          xbar_p2m_c;
@@ -269,4 +192,5 @@
                      size_t                             l1_d_ways,
                      size_t                             l1_d_sets,
+                     size_t                             irq_per_processor,
                      size_t                             xram_latency,  // external ram
                      bool                               io,            // I/O cluster
Index: trunk/platforms/tsar_generic_xbar/tsar_xbar_cluster/caba/source/src/tsar_xbar_cluster.cpp
===================================================================
--- trunk/platforms/tsar_generic_xbar/tsar_xbar_cluster/caba/source/src/tsar_xbar_cluster.cpp	(revision 624)
+++ trunk/platforms/tsar_generic_xbar/tsar_xbar_cluster/caba/source/src/tsar_xbar_cluster.cpp	(revision 706)
@@ -66,4 +66,5 @@
          size_t                             l1_d_ways,
          size_t                             l1_d_sets,
+         size_t                             irq_per_processor,
          size_t                             xram_latency,
          bool                               io,
@@ -77,5 +78,5 @@
          uint32_t                           nic_timeout,
          size_t                             chbufdma_channels,
-         const Loader                      &loader,
+         const Loader &                     loader,
          uint32_t                           frozen_cycles,
          uint32_t                           debug_start_cycle,
@@ -127,11 +128,4 @@
                       proc_debug_ok);
 
-        std::ostringstream swip;
-        swip << "wi_proc_" << x_id << "_" << y_id << "_" << p;
-        wi_proc[p] = new VciDspinInitiatorWrapper<vci_param_int,
-                                                  dspin_cmd_width,
-                                                  dspin_rsp_width>(
-                     swip.str().c_str(),
-                     x_width + y_width + l_width);
     }
 
@@ -148,4 +142,5 @@
                      IntTab(cluster_id),                 // SRCID external space
                      IntTab(cluster_id, tgtid_memc),     // TGTID direct space
+                     //(cluster_id << l_width) + nb_procs, // CC_GLOBAL_ID
                      x_width,                            // Number of x bits in platform
                      y_width,                            // Number of y bits in platform
@@ -159,9 +154,4 @@
                      memc_debug_ok);
 
-    wt_memc = new VciDspinTargetWrapper<vci_param_int,
-                                        dspin_cmd_width,
-                                        dspin_rsp_width>(
-                     "wt_memc",
-                     x_width + y_width + l_width);
 
     /////////////////////////////////////////////////////////////////////////////
@@ -182,14 +172,9 @@
                      mtd,                               // mapping table
                      IntTab(cluster_id, tgtid_xicu),    // TGTID_D
-                     32,                                // number of timer IRQs
+                     nb_procs,                          // number of timer IRQs
                      32,                                // number of hard IRQs
                      32,                                // number of soft IRQs
-                     nb_procs*IRQ_PER_PROCESSOR);       // number of output IRQs
-
-    wt_xicu = new VciDspinTargetWrapper<vci_param_int,
-                                        dspin_cmd_width,
-                                        dspin_rsp_width>(
-                     "wt_xicu",
-                     x_width + y_width + l_width);
+                     nb_procs*irq_per_processor);                         // number of output IRQs
+
 
     /////////////////////////////////////////////////////////////////////////////
@@ -204,15 +189,4 @@
                      nb_dmas);                            // number of IRQs
 
-    wt_mdma = new VciDspinTargetWrapper<vci_param_int,
-                                        dspin_cmd_width,
-                                        dspin_rsp_width>(
-                     "wt_mdma",
-                     x_width + y_width + l_width);
-
-    wi_mdma = new VciDspinInitiatorWrapper<vci_param_int,
-                                           dspin_cmd_width,
-                                           dspin_rsp_width>(
-                     "wi_mdma",
-                     x_width + y_width + l_width);
 
     /////////////////////////////////////////////////////////////////////////////
@@ -225,28 +199,27 @@
     }
 
-    xbar_cmd_d = new DspinLocalCrossbar<dspin_cmd_width>(
-                     "xbar_cmd_d",
-                     mtd,                          // mapping table
-                     x_id, y_id,                   // cluster coordinates
-                     x_width, y_width, l_width,
-                     nb_direct_initiators,         // number of local of sources
-                     nb_direct_targets,            // number of local dests 
-                     2, 2,                         // fifo depths  
-                     true,                         // CMD
-                     true,                         // use local routing table 
-                     false );                      // no broadcast
-
-    /////////////////////////////////////////////////////////////////////////////
-    xbar_rsp_d = new DspinLocalCrossbar<dspin_rsp_width>(
-                     "xbar_rsp_d",
-                     mtd,                          // mapping table
-                     x_id, y_id,                   // cluster coordinates
-                     x_width, y_width, l_width,
-                     nb_direct_targets,            // number of local sources
-                     nb_direct_initiators,         // number of local dests
-                     2, 2,                         // fifo depths  
-                     false,                        // RSP
-                     false,                        // don't use local routing table 
-                     false );                      // no broadcast
+    std::ostringstream sxbar;
+    sxbar << "xbar_" << x_id << "_" << y_id;
+    xbar_d = new VciLocalCrossbar<vci_param_int>(
+                     sxbar.str().c_str(),
+                     mtd,                             // mapping table
+                     //x_id, y_id,                    // cluster coordinates
+                     cluster_id,
+                     nb_direct_initiators,            // number of local of sources
+                     nb_direct_targets,               // number of local dests 
+                     tgtid_memc);                     // Default target
+
+    ////////////// vci_dspin wrappers 
+    std::ostringstream swtxbar;
+    swtxbar << "wt_xbar_" << x_id << "_" << y_id;
+    wt_xbar_d = new VciDspinTargetWrapper<vci_param_int, dspin_cmd_width, dspin_rsp_width>(
+                swtxbar.str().c_str(),
+                x_width + y_width + l_width );
+
+    std::ostringstream swixbar;
+    swixbar << "wi_xbar_" << x_id << "_" << y_id;
+    wi_xbar_d = new VciDspinInitiatorWrapper<vci_param_int, dspin_cmd_width, dspin_rsp_width>(
+                swixbar.str().c_str(),
+                x_width + y_width + l_width );
 
     /////////////////////////////////////////////////////////////////////////////
@@ -315,10 +288,4 @@
                      loader);
 
-        wt_brom = new VciDspinTargetWrapper<vci_param_int,
-                                            dspin_cmd_width,
-                                            dspin_rsp_width>(
-                     "wt_brom",
-                     x_width + y_width + l_width);
-
         /////////////////////////////////////////////
         fbuf = new VciFrameBuffer<vci_param_int>(
@@ -327,10 +294,4 @@
                      mtd,
                      xfb, yfb);
-
-        wt_fbuf = new VciDspinTargetWrapper<vci_param_int,
-                                            dspin_cmd_width,
-                                            dspin_rsp_width>(
-                     "wt_fbuf",
-                     x_width + y_width + l_width);
 
         /////////////////////////////////////////////
@@ -343,16 +304,4 @@
                      block_size,
                      64);            // burst size
-
-        wt_bdev = new VciDspinTargetWrapper<vci_param_int,
-                                            dspin_cmd_width,
-                                            dspin_rsp_width>(
-                     "wt_bdev",
-                     x_width + y_width + l_width);
-
-        wi_bdev = new VciDspinInitiatorWrapper<vci_param_int,
-                                               dspin_cmd_width,
-                                               dspin_rsp_width>(
-                     "wi_bdev",
-                     x_width + y_width + l_width);
 
         int mac = 0xBEEF0000;
@@ -367,9 +316,5 @@
                      nic_tx_name);
 
-        wt_mnic = new VciDspinTargetWrapper<vci_param_int,
-                                           dspin_cmd_width,
-                                           dspin_rsp_width>(
-                    "wt_mnic",
-                    x_width + y_width + l_width);
+
 
         /////////////////////////////////////////////
@@ -382,16 +327,4 @@
                      chbufdma_channels); 
 
-        wt_chbuf = new VciDspinTargetWrapper<vci_param_int,
-                                            dspin_cmd_width,
-                                            dspin_rsp_width>(
-                     "wt_chbuf",
-                     x_width + y_width + l_width);
-
-        wi_chbuf = new VciDspinInitiatorWrapper<vci_param_int,
-                                            dspin_cmd_width,
-                                            dspin_rsp_width>(
-                     "wi_chbuf",
-                     x_width + y_width + l_width);
-
         /////////////////////////////////////////////
         std::vector<std::string> vect_names;
@@ -408,20 +341,8 @@
                      vect_names);
 
-        wt_mtty = new VciDspinTargetWrapper<vci_param_int,
-                                            dspin_cmd_width,
-                                            dspin_rsp_width>(
-                     "wt_mtty",
-                     x_width + y_width + l_width);
-
         simhelper = new VciSimhelper<vci_param_int>(
                      "sim_helper",
                      IntTab(cluster_id, tgtid_simh),
                      mtd);
-
-        wt_simhelper = new VciDspinTargetWrapper<vci_param_int,
-                                                 dspin_cmd_width,
-                                                 dspin_rsp_width>(
-                     "wt_simhelper",
-                     x_width + y_width + l_width);
     }
 
@@ -466,65 +387,50 @@
     std::cout << "  - CMD & RSP routers connected" << std::endl;
 
-    ///////////////////// CMD DSPIN  local crossbar direct
-    xbar_cmd_d->p_clk                            (this->p_clk);
-    xbar_cmd_d->p_resetn                         (this->p_resetn);
-    xbar_cmd_d->p_global_out                     (signal_dspin_cmd_l2g_d);
-    xbar_cmd_d->p_global_in                      (signal_dspin_cmd_g2l_d);
-
-    xbar_cmd_d->p_local_out[tgtid_memc]          (signal_dspin_cmd_memc_t);
-    xbar_cmd_d->p_local_out[tgtid_xicu]          (signal_dspin_cmd_xicu_t);
-    xbar_cmd_d->p_local_out[tgtid_mdma]          (signal_dspin_cmd_mdma_t);
-
-    xbar_cmd_d->p_local_in[nb_procs]             (signal_dspin_cmd_mdma_i);
+    wi_xbar_d->p_clk                         (this->p_clk);
+    wi_xbar_d->p_resetn                      (this->p_resetn);
+    wi_xbar_d->p_vci                         (signal_vci_l2g_d);
+    wi_xbar_d->p_dspin_cmd                   (signal_dspin_cmd_l2g_d);
+    wi_xbar_d->p_dspin_rsp                   (signal_dspin_rsp_g2l_d);
+
+    std::cout << "  - Wrapper Ini VCI2DSPIN Direct connected" << std::endl;
+
+    wt_xbar_d->p_clk                         (this->p_clk);
+    wt_xbar_d->p_resetn                      (this->p_resetn);
+    wt_xbar_d->p_vci                         (signal_vci_g2l_d);
+    wt_xbar_d->p_dspin_cmd                   (signal_dspin_cmd_g2l_d);
+    wt_xbar_d->p_dspin_rsp                   (signal_dspin_rsp_l2g_d);
+
+    std::cout << "  - Wrapper Tgt VCI2DSPIN Direct connected" << std::endl;
+
+    ///////////////////// CMD VCI  local crossbar direct
+    xbar_d->p_clk                            (this->p_clk);
+    xbar_d->p_resetn                         (this->p_resetn);
+    xbar_d->p_target_to_up                   (signal_vci_g2l_d);
+    xbar_d->p_initiator_to_up                (signal_vci_l2g_d);
+
+    xbar_d->p_to_target[tgtid_memc]          (signal_vci_tgt_memc);
+    xbar_d->p_to_target[tgtid_xicu]          (signal_vci_tgt_xicu);
+    xbar_d->p_to_target[tgtid_mdma]          (signal_vci_tgt_mdma);
+
+    xbar_d->p_to_initiator[nb_procs]         (signal_vci_ini_mdma);
 
     for (size_t p = 0; p < nb_procs; p++)
-        xbar_cmd_d->p_local_in[p]                (signal_dspin_cmd_proc_i[p]);
+        xbar_d->p_to_initiator[p]            (signal_vci_ini_proc[p]);
 
     if (io)
     {
-        xbar_cmd_d->p_local_out[tgtid_mtty]      (signal_dspin_cmd_mtty_t);
-        xbar_cmd_d->p_local_out[tgtid_brom]      (signal_dspin_cmd_brom_t);
-        xbar_cmd_d->p_local_out[tgtid_bdev]      (signal_dspin_cmd_bdev_t);
-        xbar_cmd_d->p_local_out[tgtid_fbuf]      (signal_dspin_cmd_fbuf_t);
-        xbar_cmd_d->p_local_out[tgtid_mnic]      (signal_dspin_cmd_mnic_t);
-        xbar_cmd_d->p_local_out[tgtid_chbuf]     (signal_dspin_cmd_chbuf_t);
-        xbar_cmd_d->p_local_out[tgtid_simh]      (signal_dspin_cmd_simh_t);
-
-        xbar_cmd_d->p_local_in[nb_procs + 1]     (signal_dspin_cmd_bdev_i);
-        xbar_cmd_d->p_local_in[nb_procs + 2]     (signal_dspin_cmd_chbuf_i);
-    }
-
-    std::cout << "  - Command Direct crossbar connected" << std::endl;
-
-    //////////////////////// RSP DSPIN  local crossbar direct
-    xbar_rsp_d->p_clk                            (this->p_clk);
-    xbar_rsp_d->p_resetn                         (this->p_resetn);
-    xbar_rsp_d->p_global_out                     (signal_dspin_rsp_l2g_d);
-    xbar_rsp_d->p_global_in                      (signal_dspin_rsp_g2l_d);
-
-    xbar_rsp_d->p_local_in[tgtid_memc]           (signal_dspin_rsp_memc_t);
-    xbar_rsp_d->p_local_in[tgtid_xicu]           (signal_dspin_rsp_xicu_t);
-    xbar_rsp_d->p_local_in[tgtid_mdma]           (signal_dspin_rsp_mdma_t);
-
-    xbar_rsp_d->p_local_out[nb_procs]            (signal_dspin_rsp_mdma_i);
-
-    for (size_t p = 0; p < nb_procs; p++)
-        xbar_rsp_d->p_local_out[p]               (signal_dspin_rsp_proc_i[p]);
-
-    if (io)
-    {
-        xbar_rsp_d->p_local_in[tgtid_mtty]       (signal_dspin_rsp_mtty_t);
-        xbar_rsp_d->p_local_in[tgtid_brom]       (signal_dspin_rsp_brom_t);
-        xbar_rsp_d->p_local_in[tgtid_bdev]       (signal_dspin_rsp_bdev_t);
-        xbar_rsp_d->p_local_in[tgtid_fbuf]       (signal_dspin_rsp_fbuf_t);
-        xbar_rsp_d->p_local_in[tgtid_mnic]       (signal_dspin_rsp_mnic_t);
-        xbar_rsp_d->p_local_in[tgtid_chbuf]      (signal_dspin_rsp_chbuf_t);
-        xbar_rsp_d->p_local_in[tgtid_simh]       (signal_dspin_rsp_simh_t);
-
-        xbar_rsp_d->p_local_out[nb_procs + 1]    (signal_dspin_rsp_bdev_i);
-        xbar_rsp_d->p_local_out[nb_procs + 2]    (signal_dspin_rsp_chbuf_i);
-    }
-
-    std::cout << "  - Response Direct crossbar connected" << std::endl;
+        xbar_d->p_to_target[tgtid_mtty]      (signal_vci_tgt_mtty);
+        xbar_d->p_to_target[tgtid_brom]      (signal_vci_tgt_brom);
+        xbar_d->p_to_target[tgtid_bdev]      (signal_vci_tgt_bdev);
+        xbar_d->p_to_target[tgtid_fbuf]      (signal_vci_tgt_fbuf);
+        xbar_d->p_to_target[tgtid_mnic]      (signal_vci_tgt_mnic);
+        xbar_d->p_to_target[tgtid_chbuf]     (signal_vci_tgt_chbuf);
+        xbar_d->p_to_target[tgtid_simh]      (signal_vci_tgt_simh);
+
+        xbar_d->p_to_initiator[nb_procs + 1] (signal_vci_ini_bdev);
+        xbar_d->p_to_initiator[nb_procs + 2] (signal_vci_ini_chbuf);
+    }
+
+    std::cout << "  - Direct crossbar connected" << std::endl;
 
     ////////////////////// M2P DSPIN local crossbar coherence
@@ -572,18 +478,13 @@
         proc[p]->p_dspin_clack              (signal_dspin_clack_proc[p]);
 
-        for ( size_t i = 0 ; i < IRQ_PER_PROCESSOR ; i++)
-        {
-            proc[p]->p_irq[i]               (signal_proc_it[p*IRQ_PER_PROCESSOR+i]);
-        }
-        for ( size_t j = IRQ_PER_PROCESSOR ; j < 6 ; j++)
+        for ( size_t i = 0; i < irq_per_processor; i++)
+        {
+            proc[p]->p_irq[i]               (signal_proc_it[p*irq_per_processor + i]);
+        }
+        for ( size_t j = irq_per_processor; j < 6; j++) // 6 = number of irqs in the MIPS
         {
             proc[p]->p_irq[j]               (signal_false);
         }
 
-        wi_proc[p]->p_clk                   (this->p_clk);
-        wi_proc[p]->p_resetn                (this->p_resetn);
-        wi_proc[p]->p_dspin_cmd             (signal_dspin_cmd_proc_i[p]);
-        wi_proc[p]->p_dspin_rsp             (signal_dspin_rsp_proc_i[p]);
-        wi_proc[p]->p_vci                   (signal_vci_ini_proc[p]);
     }
 
@@ -594,8 +495,7 @@
     xicu->p_resetn                     (this->p_resetn);
     xicu->p_vci                        (signal_vci_tgt_xicu);
-
-    for (size_t i = 0; i < nb_procs*IRQ_PER_PROCESSOR; i++)
-    {
-        xicu->p_irq[i]                       (signal_proc_it[i]);
+    for (size_t p = 0; p < nb_procs * irq_per_processor; p++)
+    {
+        xicu->p_irq[p]                 (signal_proc_it[p]);
     }
     for (size_t i = 0; i < 32; i++)
@@ -620,11 +520,4 @@
         }
     }
-
-    // wrapper XICU
-    wt_xicu->p_clk                     (this->p_clk);
-    wt_xicu->p_resetn                  (this->p_resetn);
-    wt_xicu->p_dspin_cmd               (signal_dspin_cmd_xicu_t);
-    wt_xicu->p_dspin_rsp               (signal_dspin_rsp_xicu_t);
-    wt_xicu->p_vci                     (signal_vci_tgt_xicu);
 
     std::cout << "  - XICU connected" << std::endl;
@@ -640,11 +533,4 @@
     memc->p_dspin_clack                (signal_dspin_clack_memc);
 
-    // wrapper MEMC
-    wt_memc->p_clk                     (this->p_clk);
-    wt_memc->p_resetn                  (this->p_resetn);
-    wt_memc->p_dspin_cmd               (signal_dspin_cmd_memc_t);
-    wt_memc->p_dspin_rsp               (signal_dspin_rsp_memc_t);
-    wt_memc->p_vci                     (signal_vci_tgt_memc);
-
     std::cout << "  - MEMC connected" << std::endl;
 
@@ -664,18 +550,4 @@
         mdma->p_irq[i]                 (signal_irq_mdma[i]);
 
-    // wrapper tgt MDMA
-    wt_mdma->p_clk                     (this->p_clk);
-    wt_mdma->p_resetn                  (this->p_resetn);
-    wt_mdma->p_dspin_cmd               (signal_dspin_cmd_mdma_t);
-    wt_mdma->p_dspin_rsp               (signal_dspin_rsp_mdma_t);
-    wt_mdma->p_vci                     (signal_vci_tgt_mdma);
-
-    // wrapper ini MDMA
-    wi_mdma->p_clk                     (this->p_clk);
-    wi_mdma->p_resetn                  (this->p_resetn);
-    wi_mdma->p_dspin_cmd               (signal_dspin_cmd_mdma_i);
-    wi_mdma->p_dspin_rsp               (signal_dspin_rsp_mdma_i);
-    wi_mdma->p_vci                     (signal_vci_ini_mdma);
-
     std::cout << "  - MDMA connected" << std::endl;
 
@@ -691,18 +563,4 @@
         bdev->p_vci_initiator          (signal_vci_ini_bdev);
 
-        // wrapper tgt BDEV
-        wt_bdev->p_clk                 (this->p_clk);
-        wt_bdev->p_resetn              (this->p_resetn);
-        wt_bdev->p_dspin_cmd           (signal_dspin_cmd_bdev_t);
-        wt_bdev->p_dspin_rsp           (signal_dspin_rsp_bdev_t);
-        wt_bdev->p_vci                 (signal_vci_tgt_bdev);
-
-        // wrapper ini BDEV
-        wi_bdev->p_clk                 (this->p_clk);
-        wi_bdev->p_resetn              (this->p_resetn);
-        wi_bdev->p_dspin_cmd           (signal_dspin_cmd_bdev_i);
-        wi_bdev->p_dspin_rsp           (signal_dspin_rsp_bdev_i);
-        wi_bdev->p_vci                 (signal_vci_ini_bdev);
-
         std::cout << "  - BDEV connected" << std::endl;
 
@@ -711,11 +569,4 @@
         fbuf->p_resetn                 (this->p_resetn);
         fbuf->p_vci                    (signal_vci_tgt_fbuf);
-
-        // wrapper tgt FBUF
-        wt_fbuf->p_clk                 (this->p_clk);
-        wt_fbuf->p_resetn              (this->p_resetn);
-        wt_fbuf->p_dspin_cmd           (signal_dspin_cmd_fbuf_t);
-        wt_fbuf->p_dspin_rsp           (signal_dspin_rsp_fbuf_t);
-        wt_fbuf->p_vci                 (signal_vci_tgt_fbuf);
 
         std::cout << "  - FBUF connected" << std::endl;
@@ -730,11 +581,4 @@
             mnic->p_tx_irq[i]          (signal_irq_mnic_tx[i]);
         }
-
-        // wrapper tgt MNIC
-        wt_mnic->p_clk                 (this->p_clk);
-        wt_mnic->p_resetn              (this->p_resetn);
-        wt_mnic->p_dspin_cmd           (signal_dspin_cmd_mnic_t);
-        wt_mnic->p_dspin_rsp           (signal_dspin_rsp_mnic_t);
-        wt_mnic->p_vci                 (signal_vci_tgt_mnic);
 
         std::cout << "  - MNIC connected" << std::endl;
@@ -750,18 +594,4 @@
         }
 
-        // wrapper tgt CHBUF
-        wt_chbuf->p_clk                 (this->p_clk);
-        wt_chbuf->p_resetn              (this->p_resetn);
-        wt_chbuf->p_dspin_cmd           (signal_dspin_cmd_chbuf_t);
-        wt_chbuf->p_dspin_rsp           (signal_dspin_rsp_chbuf_t);
-        wt_chbuf->p_vci                 (signal_vci_tgt_chbuf);
-
-        // wrapper ini CHBUF
-        wi_chbuf->p_clk                 (this->p_clk);
-        wi_chbuf->p_resetn              (this->p_resetn);
-        wi_chbuf->p_dspin_cmd           (signal_dspin_cmd_chbuf_i);
-        wi_chbuf->p_dspin_rsp           (signal_dspin_rsp_chbuf_i);
-        wi_chbuf->p_vci                 (signal_vci_ini_chbuf);
-
         std::cout << "  - CHBUF connected" << std::endl;
 
@@ -770,11 +600,4 @@
         brom->p_resetn                 (this->p_resetn);
         brom->p_vci                    (signal_vci_tgt_brom);
-
-        // wrapper tgt BROM
-        wt_brom->p_clk                 (this->p_clk);
-        wt_brom->p_resetn              (this->p_resetn);
-        wt_brom->p_dspin_cmd           (signal_dspin_cmd_brom_t);
-        wt_brom->p_dspin_rsp           (signal_dspin_rsp_brom_t);
-        wt_brom->p_vci                 (signal_vci_tgt_brom);
 
         std::cout << "  - BROM connected" << std::endl;
@@ -789,10 +612,5 @@
         }
 
-        // wrapper tgt MTTY
-        wt_mtty->p_clk                 (this->p_clk);
-        wt_mtty->p_resetn              (this->p_resetn);
-        wt_mtty->p_dspin_cmd           (signal_dspin_cmd_mtty_t);
-        wt_mtty->p_dspin_rsp           (signal_dspin_rsp_mtty_t);
-        wt_mtty->p_vci                 (signal_vci_tgt_mtty);
+        std::cout << "  - MTTY connected" << std::endl;
 
 
@@ -802,12 +620,5 @@
         simhelper->p_vci               (signal_vci_tgt_simh);
         
-        // wrapper tgt Sim Helper
-        wt_simhelper->p_clk            (this->p_clk);
-        wt_simhelper->p_resetn         (this->p_resetn);
-        wt_simhelper->p_dspin_cmd      (signal_dspin_cmd_simh_t);
-        wt_simhelper->p_dspin_rsp      (signal_dspin_rsp_simh_t);
-        wt_simhelper->p_vci            (signal_vci_tgt_simh);
-
-        std::cout << "  - MTTY connected" << std::endl;
+        std::cout << "  - SIMH connected" << std::endl;
    }
 } // end constructor
@@ -831,17 +642,13 @@
     {
         delete proc[p];
-        delete wi_proc[p];
     }
 
     delete memc;
-    delete wt_memc;
     delete xram;
     delete xicu;
-    delete wt_xicu;
     delete mdma;
-    delete wt_mdma;
-    delete wi_mdma;
-    delete xbar_cmd_d;
-    delete xbar_rsp_d;
+    delete xbar_d;
+    delete wt_xbar_d;
+    delete wi_xbar_d;
     delete xbar_m2p_c;
     delete xbar_p2m_c;
@@ -852,19 +659,10 @@
     {
         delete brom;
-        delete wt_brom;
         delete fbuf;
-        delete wt_fbuf;
         delete bdev;
-        delete wt_bdev;
-        delete wi_bdev;
         delete mnic;
-        delete wt_mnic;
         delete chbuf;
-        delete wt_chbuf;
-        delete wi_chbuf;
         delete mtty;
-        delete wt_mtty;
         delete simhelper;
-        delete wt_simhelper;
     }
 }
