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 836)
+++ trunk/platforms/tsar_generic_xbar/tsar_xbar_cluster/caba/source/include/tsar_xbar_cluster.h	(revision 885)
@@ -27,5 +27,5 @@
 #include "vci_dspin_initiator_wrapper.h"
 #include "vci_dspin_target_wrapper.h"
-#include "virtual_dspin_router.h"
+#include "dspin_router.h"
 #include "vci_multi_tty.h"
 #include "vci_multi_nic.h"
@@ -56,8 +56,19 @@
     sc_in<bool>                                     p_clk;
     sc_in<bool>                                     p_resetn;
-    soclib::caba::DspinOutput<dspin_cmd_width>      **p_cmd_out;
-    soclib::caba::DspinInput<dspin_cmd_width>       **p_cmd_in;
-    soclib::caba::DspinOutput<dspin_rsp_width>      **p_rsp_out;
-    soclib::caba::DspinInput<dspin_rsp_width>       **p_rsp_in;
+
+    soclib::caba::DspinOutput<dspin_cmd_width>      *p_cmd_out;
+    soclib::caba::DspinInput<dspin_cmd_width>       *p_cmd_in;
+
+    soclib::caba::DspinOutput<dspin_rsp_width>      *p_rsp_out;
+    soclib::caba::DspinInput<dspin_rsp_width>       *p_rsp_in;
+
+    soclib::caba::DspinOutput<dspin_cmd_width>      *p_m2p_out;
+    soclib::caba::DspinInput<dspin_cmd_width>       *p_m2p_in;
+
+    soclib::caba::DspinOutput<dspin_rsp_width>      *p_p2m_out;
+    soclib::caba::DspinInput<dspin_rsp_width>       *p_p2m_in;
+
+    soclib::caba::DspinOutput<dspin_cmd_width>      *p_cla_out;
+    soclib::caba::DspinInput<dspin_cmd_width>       *p_cla_in;
 
     // interrupt signals
@@ -143,5 +154,5 @@
     VciFrameBuffer<vci_param_int>*                fbuf;
 
-    VciMultiNic<vci_param_int>*                  mnic;
+    VciMultiNic<vci_param_int>*                   mnic;
 
     VciChbufDma<vci_param_int>*                   chbuf;
@@ -161,6 +172,9 @@
     DspinLocalCrossbar<dspin_cmd_width>*          xbar_clack_c;
 
-    VirtualDspinRouter<dspin_cmd_width>*          router_cmd;
-    VirtualDspinRouter<dspin_rsp_width>*          router_rsp;
+    DspinRouter<dspin_cmd_width>*                 router_cmd;
+    DspinRouter<dspin_rsp_width>*                 router_rsp;
+    DspinRouter<dspin_cmd_width>*                 router_m2p;
+    DspinRouter<dspin_rsp_width>*                 router_p2m;
+    DspinRouter<dspin_cmd_width>*                 router_cla;
 
     TsarXbarCluster( sc_module_name                     insname,
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 836)
+++ trunk/platforms/tsar_generic_xbar/tsar_xbar_cluster/caba/source/src/tsar_xbar_cluster.cpp	(revision 885)
@@ -91,9 +91,22 @@
     n_procs = nb_procs;
 
-    // Vectors of ports definition
-    p_cmd_in  = alloc_elems<DspinInput<dspin_cmd_width> >  ("p_cmd_in",  4, 3);
-    p_cmd_out = alloc_elems<DspinOutput<dspin_cmd_width> > ("p_cmd_out", 4, 3);
-    p_rsp_in  = alloc_elems<DspinInput<dspin_rsp_width> >  ("p_rsp_in",  4, 2);
-    p_rsp_out = alloc_elems<DspinOutput<dspin_rsp_width> > ("p_rsp_out", 4, 2);
+    /////////////////////////////////////////////////////////////////////////////
+    // Vectors of ports definition and allocation
+    /////////////////////////////////////////////////////////////////////////////
+
+    p_cmd_in  = alloc_elems<DspinInput<dspin_cmd_width> >  ("p_cmd_in",  4);
+    p_cmd_out = alloc_elems<DspinOutput<dspin_cmd_width> > ("p_cmd_out", 4);
+
+    p_rsp_in  = alloc_elems<DspinInput<dspin_rsp_width> >  ("p_rsp_in",  4);
+    p_rsp_out = alloc_elems<DspinOutput<dspin_rsp_width> > ("p_rsp_out", 4);
+
+    p_m2p_in  = alloc_elems<DspinInput<dspin_cmd_width> >  ("p_m2p_in",  4);
+    p_m2p_out = alloc_elems<DspinOutput<dspin_cmd_width> > ("p_m2p_out", 4);
+
+    p_p2m_in  = alloc_elems<DspinInput<dspin_rsp_width> >  ("p_p2m_in",  4);
+    p_p2m_out = alloc_elems<DspinOutput<dspin_rsp_width> > ("p_p2m_out", 4);
+
+    p_cla_in  = alloc_elems<DspinInput<dspin_cmd_width> >  ("p_cla_in",  4);
+    p_cla_out = alloc_elems<DspinOutput<dspin_cmd_width> > ("p_cla_out", 4);
 
     /////////////////////////////////////////////////////////////////////////////
@@ -174,5 +187,5 @@
                      32,                                // number of hard IRQs
                      32,                                // number of soft IRQs
-                     nb_procs*irq_per_processor);                         // number of output IRQs
+                     nb_procs * irq_per_processor);     // number of output IRQs
 
 
@@ -262,17 +275,47 @@
 
     /////////////////////////////////////////////////////////////////////////////
-    router_cmd = new VirtualDspinRouter<dspin_cmd_width>(
-                     "router_cmd",
+    std::ostringstream s_router_cmd;
+    s_router_cmd << "router_cmd_" << x_id << "_" << y_id;
+    router_cmd = new DspinRouter<dspin_cmd_width>(
+                     s_router_cmd.str().c_str(),
                      x_id,y_id,                    // coordinate in the mesh
                      x_width, y_width,             // x & y fields width
-                     3,                            // nb virtual channels
                      4,4);                         // input & output fifo depths
 
     /////////////////////////////////////////////////////////////////////////////
-    router_rsp = new VirtualDspinRouter<dspin_rsp_width>(
-                     "router_rsp",
+    std::ostringstream s_router_rsp;
+    s_router_rsp << "router_rsp_" << x_id << "_" << y_id;
+    router_rsp = new DspinRouter<dspin_rsp_width>(
+                     s_router_rsp.str().c_str(),
                      x_id,y_id,                    // coordinates in mesh
                      x_width, y_width,             // x & y fields width
-                     2,                            // nb virtual channels
+                     4,4);                         // input & output fifo depths
+
+    /////////////////////////////////////////////////////////////////////////////
+    std::ostringstream s_router_m2p;
+    s_router_m2p << "router_m2p_" << x_id << "_" << y_id;
+    router_m2p = new DspinRouter<dspin_cmd_width>(
+                     s_router_m2p.str().c_str(),
+                     x_id,y_id,                    // coordinate in the mesh
+                     x_width, y_width,             // x & y fields width
+                     4,4,                          // input & output fifo depths
+                     true);                        // broadcast supported
+
+    /////////////////////////////////////////////////////////////////////////////
+    std::ostringstream s_router_p2m;
+    s_router_p2m << "router_p2m_" << x_id << "_" << y_id;
+    router_p2m = new DspinRouter<dspin_rsp_width>(
+                     s_router_p2m.str().c_str(),
+                     x_id,y_id,                    // coordinates in mesh
+                     x_width, y_width,             // x & y fields width
+                     4,4);                         // input & output fifo depths
+
+    /////////////////////////////////////////////////////////////////////////////
+    std::ostringstream s_router_cla;
+    s_router_cla << "router_cla_" << x_id << "_" << y_id;
+    router_cla = new DspinRouter<dspin_cmd_width>(
+                     s_router_cla.str().c_str(),
+                     x_id,y_id,                    // coordinate in the mesh
+                     x_width, y_width,             // x & y fields width
                      4,4);                         // input & output fifo depths
 
@@ -350,39 +393,51 @@
     ////////////////////////////////////
 
-    //////////////////////// CMD ROUTER and RSP ROUTER
-    router_cmd->p_clk                        (this->p_clk);
-    router_cmd->p_resetn                     (this->p_resetn);
-    router_rsp->p_clk                        (this->p_clk);
-    router_rsp->p_resetn                     (this->p_resetn);
-
-    for (int i = 0; i < 4; i++)
-    {
-        for (int k = 0; k < 3; k++)
-        {
-            router_cmd->p_out[i][k]          (this->p_cmd_out[i][k]);
-            router_cmd->p_in[i][k]           (this->p_cmd_in[i][k]);
-        }
-
-        for (int k = 0; k < 2; k++)
-        {
-            router_rsp->p_out[i][k]          (this->p_rsp_out[i][k]);
-            router_rsp->p_in[i][k]           (this->p_rsp_in[i][k]);
-        }
-    }
-
-    router_cmd->p_out[4][0]                  (signal_dspin_cmd_g2l_d);
-    router_cmd->p_out[4][1]                  (signal_dspin_m2p_g2l_c);
-    router_cmd->p_out[4][2]                  (signal_dspin_clack_g2l_c);
-    router_cmd->p_in[4][0]                   (signal_dspin_cmd_l2g_d);
-    router_cmd->p_in[4][1]                   (signal_dspin_m2p_l2g_c);
-    router_cmd->p_in[4][2]                   (signal_dspin_clack_l2g_c);
-
-    router_rsp->p_out[4][0]                  (signal_dspin_rsp_g2l_d);
-    router_rsp->p_out[4][1]                  (signal_dspin_p2m_g2l_c);
-    router_rsp->p_in[4][0]                   (signal_dspin_rsp_l2g_d);
-    router_rsp->p_in[4][1]                   (signal_dspin_p2m_l2g_c);
-
-
-    std::cout << "  - CMD & RSP routers connected" << std::endl;
+    //////////////////////// ROUTERS
+    router_cmd->p_clk                      (this->p_clk);
+    router_cmd->p_resetn                   (this->p_resetn);
+    router_rsp->p_clk                      (this->p_clk);
+    router_rsp->p_resetn                   (this->p_resetn);
+    router_m2p->p_clk                      (this->p_clk);
+    router_m2p->p_resetn                   (this->p_resetn);
+    router_p2m->p_clk                      (this->p_clk);
+    router_p2m->p_resetn                   (this->p_resetn);
+    router_cla->p_clk                      (this->p_clk);
+    router_cla->p_resetn                   (this->p_resetn);
+
+    // loop on N/S/E/W ports
+    for (size_t i = 0; i < 4; i++)
+    {
+        router_cmd->p_out[i]               (this->p_cmd_out[i]);
+        router_cmd->p_in[i]                (this->p_cmd_in[i]);
+
+        router_rsp->p_out[i]               (this->p_rsp_out[i]);
+        router_rsp->p_in[i]                (this->p_rsp_in[i]);
+
+        router_m2p->p_out[i]               (this->p_m2p_out[i]);
+        router_m2p->p_in[i]                (this->p_m2p_in[i]);
+
+        router_p2m->p_out[i]               (this->p_p2m_out[i]);
+        router_p2m->p_in[i]                (this->p_p2m_in[i]);
+
+        router_cla->p_out[i]               (this->p_cla_out[i]);
+        router_cla->p_in[i]                (this->p_cla_in[i]);
+    }
+
+    router_cmd->p_out[4]                   (signal_dspin_cmd_g2l_d);
+    router_cmd->p_in[4]                    (signal_dspin_cmd_l2g_d);
+
+    router_rsp->p_out[4]                   (signal_dspin_rsp_g2l_d);
+    router_rsp->p_in[4]                    (signal_dspin_rsp_l2g_d);
+
+    router_m2p->p_out[4]                   (signal_dspin_m2p_g2l_c);
+    router_m2p->p_in[4]                    (signal_dspin_m2p_l2g_c);
+
+    router_p2m->p_out[4]                   (signal_dspin_p2m_g2l_c);
+    router_p2m->p_in[4]                    (signal_dspin_p2m_l2g_c);
+
+    router_cla->p_out[4]                   (signal_dspin_clack_g2l_c);
+    router_cla->p_in[4]                    (signal_dspin_clack_l2g_c);
+
+    std::cout << "  - routers connected" << std::endl;
 
     wi_xbar_d->p_clk                         (this->p_clk);
@@ -633,8 +688,18 @@
                                                  vci_param_ext>::~TsarXbarCluster() {
 
-    dealloc_elems<DspinInput<dspin_cmd_width> > (p_cmd_in, 4, 3);
-    dealloc_elems<DspinOutput<dspin_cmd_width> >(p_cmd_out, 4, 3);
-    dealloc_elems<DspinInput<dspin_rsp_width> > (p_rsp_in, 4, 2);
-    dealloc_elems<DspinOutput<dspin_rsp_width> >(p_rsp_out, 4, 2);
+    dealloc_elems<DspinInput<dspin_cmd_width> > (p_cmd_in, 4);
+    dealloc_elems<DspinOutput<dspin_cmd_width> >(p_cmd_out, 4);
+
+    dealloc_elems<DspinInput<dspin_rsp_width> > (p_rsp_in, 4);
+    dealloc_elems<DspinOutput<dspin_rsp_width> >(p_rsp_out, 4);
+
+    dealloc_elems<DspinInput<dspin_cmd_width> > (p_m2p_in, 4);
+    dealloc_elems<DspinOutput<dspin_cmd_width> >(p_m2p_out, 4);
+
+    dealloc_elems<DspinInput<dspin_rsp_width> > (p_p2m_in, 4);
+    dealloc_elems<DspinOutput<dspin_rsp_width> >(p_p2m_out, 4);
+
+    dealloc_elems<DspinInput<dspin_cmd_width> > (p_cla_in, 4);
+    dealloc_elems<DspinOutput<dspin_cmd_width> >(p_cla_out, 4);
 
     for (size_t p = 0; p < n_procs; p++)
@@ -701,7 +766,4 @@
 
 }                        
-                                    
-
-
 
 }}
