Index: branches/v5/platforms/tsar_generic_xbar/top.cpp
===================================================================
--- branches/v5/platforms/tsar_generic_xbar/top.cpp	(revision 448)
+++ branches/v5/platforms/tsar_generic_xbar/top.cpp	(revision 466)
@@ -350,7 +350,4 @@
             "The NB_NIC_CHANNELS parameter must be smaller than 9" );
 
-    assert( (vci_address_width == vci_address_width) and
-            "address widths must be equal on internal & external networks" );
-
     assert( (vci_address_width == 40) and
             "VCI address width must be 40 bits" );
@@ -498,43 +495,31 @@
    // Horizontal inter-clusters DSPIN signals
    DspinSignals<dspin_cmd_width>*** signal_dspin_h_cmd_inc =
-      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_cmd_inc", XMAX-1, YMAX, 2);
+      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_cmd_inc", XMAX-1, YMAX, 3);
    DspinSignals<dspin_cmd_width>*** signal_dspin_h_cmd_dec =
-      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_cmd_dec", XMAX-1, YMAX, 2);
+      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_cmd_dec", XMAX-1, YMAX, 3);
    DspinSignals<dspin_rsp_width>*** signal_dspin_h_rsp_inc =
       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_h_rsp_inc", XMAX-1, YMAX, 2);
    DspinSignals<dspin_rsp_width>*** signal_dspin_h_rsp_dec =
       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_h_rsp_dec", XMAX-1, YMAX, 2);
-   DspinSignals<dspin_cmd_width>**  signal_dspin_h_clack_inc =
-      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_clack_inc", XMAX-1, YMAX);
-   DspinSignals<dspin_cmd_width>**  signal_dspin_h_clack_dec =
-      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_clack_dec", XMAX-1, YMAX);
 
    // Vertical inter-clusters DSPIN signals
    DspinSignals<dspin_cmd_width>*** signal_dspin_v_cmd_inc =
-      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_cmd_inc", XMAX, YMAX-1, 2);
+      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_cmd_inc", XMAX, YMAX-1, 3);
    DspinSignals<dspin_cmd_width>*** signal_dspin_v_cmd_dec =
-      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_cmd_dec", XMAX, YMAX-1, 2);
+      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_cmd_dec", XMAX, YMAX-1, 3);
    DspinSignals<dspin_rsp_width>*** signal_dspin_v_rsp_inc =
       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_v_rsp_inc", XMAX, YMAX-1, 2);
    DspinSignals<dspin_rsp_width>*** signal_dspin_v_rsp_dec =
       alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_v_rsp_dec", XMAX, YMAX-1, 2);
-   DspinSignals<dspin_cmd_width>**  signal_dspin_v_clack_inc =
-      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_clack_inc", XMAX, YMAX-1);
-   DspinSignals<dspin_cmd_width>**  signal_dspin_v_clack_dec =
-      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_clack_dec", XMAX, YMAX-1);
 
    // Mesh boundaries DSPIN signals
    DspinSignals<dspin_cmd_width>**** signal_dspin_false_cmd_in =
-      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_false_cmd_in", XMAX, YMAX, 2, 4);
+      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_false_cmd_in" , XMAX, YMAX, 4, 3);
    DspinSignals<dspin_cmd_width>**** signal_dspin_false_cmd_out =
-      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_false_cmd_out", XMAX, YMAX, 2, 4);
+      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_false_cmd_out", XMAX, YMAX, 4, 3);
    DspinSignals<dspin_rsp_width>**** signal_dspin_false_rsp_in =
-      alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_false_rsp_in", XMAX, YMAX, 2, 4);
+      alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_false_rsp_in" , XMAX, YMAX, 4, 2);
    DspinSignals<dspin_rsp_width>**** signal_dspin_false_rsp_out =
-      alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_false_rsp_out", XMAX, YMAX, 2, 4);
-   DspinSignals<dspin_cmd_width>***  signal_dspin_false_clack_in =
-      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_false_clack_in", XMAX, YMAX, 4);
-   DspinSignals<dspin_cmd_width>***  signal_dspin_false_clack_out =
-      alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_false_clack_out", XMAX, YMAX, 4);
+      alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_false_rsp_out", XMAX, YMAX, 4, 2);
 
 
@@ -655,18 +640,17 @@
       for (size_t x = 0; x < (XMAX-1); x++){
          for (size_t y = 0; y < YMAX; y++){
+            for (size_t k = 0; k < 3; k++){
+               clusters[x][y]->p_cmd_out[EAST][k]      (signal_dspin_h_cmd_inc[x][y][k]);
+               clusters[x+1][y]->p_cmd_in[WEST][k]     (signal_dspin_h_cmd_inc[x][y][k]);
+               clusters[x][y]->p_cmd_in[EAST][k]       (signal_dspin_h_cmd_dec[x][y][k]);
+               clusters[x+1][y]->p_cmd_out[WEST][k]    (signal_dspin_h_cmd_dec[x][y][k]);
+            }
+
             for (size_t k = 0; k < 2; k++){
-               clusters[x][y]->p_cmd_out[k][EAST]      (signal_dspin_h_cmd_inc[x][y][k]);
-               clusters[x+1][y]->p_cmd_in[k][WEST]     (signal_dspin_h_cmd_inc[x][y][k]);
-               clusters[x][y]->p_cmd_in[k][EAST]       (signal_dspin_h_cmd_dec[x][y][k]);
-               clusters[x+1][y]->p_cmd_out[k][WEST]    (signal_dspin_h_cmd_dec[x][y][k]);
-               clusters[x][y]->p_rsp_out[k][EAST]      (signal_dspin_h_rsp_inc[x][y][k]);
-               clusters[x+1][y]->p_rsp_in[k][WEST]     (signal_dspin_h_rsp_inc[x][y][k]);
-               clusters[x][y]->p_rsp_in[k][EAST]       (signal_dspin_h_rsp_dec[x][y][k]);
-               clusters[x+1][y]->p_rsp_out[k][WEST]    (signal_dspin_h_rsp_dec[x][y][k]);
+               clusters[x][y]->p_rsp_out[EAST][k]      (signal_dspin_h_rsp_inc[x][y][k]);
+               clusters[x+1][y]->p_rsp_in[WEST][k]     (signal_dspin_h_rsp_inc[x][y][k]);
+               clusters[x][y]->p_rsp_in[EAST][k]       (signal_dspin_h_rsp_dec[x][y][k]);
+               clusters[x+1][y]->p_rsp_out[WEST][k]    (signal_dspin_h_rsp_dec[x][y][k]);
             }
-            clusters[x][y]->p_clack_out[EAST]      (signal_dspin_h_clack_inc[x][y]);
-            clusters[x+1][y]->p_clack_in[WEST]     (signal_dspin_h_clack_inc[x][y]);
-            clusters[x][y]->p_clack_in[EAST]       (signal_dspin_h_clack_dec[x][y]);
-            clusters[x+1][y]->p_clack_out[WEST]    (signal_dspin_h_clack_dec[x][y]);
          }
       }
@@ -678,18 +662,17 @@
       for (size_t y = 0; y < (YMAX-1); y++){
          for (size_t x = 0; x < XMAX; x++){
+            for (size_t k = 0; k < 3; k++){
+               clusters[x][y]->p_cmd_out[NORTH][k]     (signal_dspin_v_cmd_inc[x][y][k]);
+               clusters[x][y+1]->p_cmd_in[SOUTH][k]    (signal_dspin_v_cmd_inc[x][y][k]);
+               clusters[x][y]->p_cmd_in[NORTH][k]      (signal_dspin_v_cmd_dec[x][y][k]);
+               clusters[x][y+1]->p_cmd_out[SOUTH][k]   (signal_dspin_v_cmd_dec[x][y][k]);
+            }
+
             for (size_t k = 0; k < 2; k++){
-               clusters[x][y]->p_cmd_out[k][NORTH]     (signal_dspin_v_cmd_inc[x][y][k]);
-               clusters[x][y+1]->p_cmd_in[k][SOUTH]    (signal_dspin_v_cmd_inc[x][y][k]);
-               clusters[x][y]->p_cmd_in[k][NORTH]      (signal_dspin_v_cmd_dec[x][y][k]);
-               clusters[x][y+1]->p_cmd_out[k][SOUTH]   (signal_dspin_v_cmd_dec[x][y][k]);
-               clusters[x][y]->p_rsp_out[k][NORTH]     (signal_dspin_v_rsp_inc[x][y][k]);
-               clusters[x][y+1]->p_rsp_in[k][SOUTH]    (signal_dspin_v_rsp_inc[x][y][k]);
-               clusters[x][y]->p_rsp_in[k][NORTH]      (signal_dspin_v_rsp_dec[x][y][k]);
-               clusters[x][y+1]->p_rsp_out[k][SOUTH]   (signal_dspin_v_rsp_dec[x][y][k]);
+               clusters[x][y]->p_rsp_out[NORTH][k]     (signal_dspin_v_rsp_inc[x][y][k]);
+               clusters[x][y+1]->p_rsp_in[SOUTH][k]    (signal_dspin_v_rsp_inc[x][y][k]);
+               clusters[x][y]->p_rsp_in[NORTH][k]      (signal_dspin_v_rsp_dec[x][y][k]);
+               clusters[x][y+1]->p_rsp_out[SOUTH][k]   (signal_dspin_v_rsp_dec[x][y][k]);
             }
-            clusters[x][y]->p_clack_out[NORTH]     (signal_dspin_v_clack_inc[x][y]);
-            clusters[x][y+1]->p_clack_in[SOUTH]    (signal_dspin_v_clack_inc[x][y]);
-            clusters[x][y]->p_clack_in[NORTH]      (signal_dspin_v_clack_dec[x][y]);
-            clusters[x][y+1]->p_clack_out[SOUTH]   (signal_dspin_v_clack_dec[x][y]);
          }
       }
@@ -700,22 +683,19 @@
    for (size_t y = 0; y < YMAX; y++)
    {
+      for (size_t k = 0; k < 3; k++)
+      {
+         clusters[0][y]->p_cmd_in[WEST][k]        (signal_dspin_false_cmd_in[0][y][WEST][k]);
+         clusters[0][y]->p_cmd_out[WEST][k]       (signal_dspin_false_cmd_out[0][y][WEST][k]);
+         clusters[XMAX-1][y]->p_cmd_in[EAST][k]   (signal_dspin_false_cmd_in[XMAX-1][y][EAST][k]);
+         clusters[XMAX-1][y]->p_cmd_out[EAST][k]  (signal_dspin_false_cmd_out[XMAX-1][y][EAST][k]);
+      }
+
       for (size_t k = 0; k < 2; k++)
       {
-         clusters[0][y]->p_cmd_in[k][WEST]        (signal_dspin_false_cmd_in[0][y][k][WEST]);
-         clusters[0][y]->p_cmd_out[k][WEST]       (signal_dspin_false_cmd_out[0][y][k][WEST]);
-         clusters[0][y]->p_rsp_in[k][WEST]        (signal_dspin_false_rsp_in[0][y][k][WEST]);
-         clusters[0][y]->p_rsp_out[k][WEST]       (signal_dspin_false_rsp_out[0][y][k][WEST]);
-
-         clusters[XMAX-1][y]->p_cmd_in[k][EAST]   (signal_dspin_false_cmd_in[XMAX-1][y][k][EAST]);
-         clusters[XMAX-1][y]->p_cmd_out[k][EAST]  (signal_dspin_false_cmd_out[XMAX-1][y][k][EAST]);
-         clusters[XMAX-1][y]->p_rsp_in[k][EAST]   (signal_dspin_false_rsp_in[XMAX-1][y][k][EAST]);
-         clusters[XMAX-1][y]->p_rsp_out[k][EAST]  (signal_dspin_false_rsp_out[XMAX-1][y][k][EAST]);
-      }
-
-      clusters[0][y]->p_clack_in[WEST]       (signal_dspin_false_clack_in[0][y][WEST]);
-      clusters[0][y]->p_clack_out[WEST]      (signal_dspin_false_clack_out[0][y][WEST]);
-
-      clusters[XMAX-1][y]->p_clack_in[EAST]  (signal_dspin_false_clack_in[XMAX-1][y][EAST]);
-      clusters[XMAX-1][y]->p_clack_out[EAST] (signal_dspin_false_clack_out[XMAX-1][y][EAST]);
+         clusters[0][y]->p_rsp_in[WEST][k]        (signal_dspin_false_rsp_in[0][y][WEST][k]);
+         clusters[0][y]->p_rsp_out[WEST][k]       (signal_dspin_false_rsp_out[0][y][WEST][k]);
+         clusters[XMAX-1][y]->p_rsp_in[EAST][k]   (signal_dspin_false_rsp_in[XMAX-1][y][EAST][k]);
+         clusters[XMAX-1][y]->p_rsp_out[EAST][k]  (signal_dspin_false_rsp_out[XMAX-1][y][EAST][k]);
+      }
    }
 
@@ -723,22 +703,19 @@
    for (size_t x = 0; x < XMAX; x++)
    {
+      for (size_t k = 0; k < 3; k++)
+      {
+         clusters[x][0]->p_cmd_in[SOUTH][k]       (signal_dspin_false_cmd_in[x][0][SOUTH][k]);
+         clusters[x][0]->p_cmd_out[SOUTH][k]      (signal_dspin_false_cmd_out[x][0][SOUTH][k]);
+         clusters[x][YMAX-1]->p_cmd_in[NORTH][k]  (signal_dspin_false_cmd_in[x][YMAX-1][NORTH][k]);
+         clusters[x][YMAX-1]->p_cmd_out[NORTH][k] (signal_dspin_false_cmd_out[x][YMAX-1][NORTH][k]);
+      }
+
       for (size_t k = 0; k < 2; k++)
       {
-         clusters[x][0]->p_cmd_in[k][SOUTH]       (signal_dspin_false_cmd_in[x][0][k][SOUTH]);
-         clusters[x][0]->p_cmd_out[k][SOUTH]      (signal_dspin_false_cmd_out[x][0][k][SOUTH]);
-         clusters[x][0]->p_rsp_in[k][SOUTH]       (signal_dspin_false_rsp_in[x][0][k][SOUTH]);
-         clusters[x][0]->p_rsp_out[k][SOUTH]      (signal_dspin_false_rsp_out[x][0][k][SOUTH]);
-
-         clusters[x][YMAX-1]->p_cmd_in[k][NORTH]  (signal_dspin_false_cmd_in[x][YMAX-1][k][NORTH]);
-         clusters[x][YMAX-1]->p_cmd_out[k][NORTH] (signal_dspin_false_cmd_out[x][YMAX-1][k][NORTH]);
-         clusters[x][YMAX-1]->p_rsp_in[k][NORTH]  (signal_dspin_false_rsp_in[x][YMAX-1][k][NORTH]);
-         clusters[x][YMAX-1]->p_rsp_out[k][NORTH] (signal_dspin_false_rsp_out[x][YMAX-1][k][NORTH]);
-      }
-
-      clusters[x][0]->p_clack_in[SOUTH]       (signal_dspin_false_clack_in[x][0][SOUTH]);
-      clusters[x][0]->p_clack_out[SOUTH]      (signal_dspin_false_clack_out[x][0][SOUTH]);
-
-      clusters[x][YMAX-1]->p_clack_in[NORTH]  (signal_dspin_false_clack_in[x][YMAX-1][NORTH]);
-      clusters[x][YMAX-1]->p_clack_out[NORTH] (signal_dspin_false_clack_out[x][YMAX-1][NORTH]);
+         clusters[x][0]->p_rsp_in[SOUTH][k]       (signal_dspin_false_rsp_in[x][0][SOUTH][k]);
+         clusters[x][0]->p_rsp_out[SOUTH][k]      (signal_dspin_false_rsp_out[x][0][SOUTH][k]);
+         clusters[x][YMAX-1]->p_rsp_in[NORTH][k]  (signal_dspin_false_rsp_in[x][YMAX-1][NORTH][k]);
+         clusters[x][YMAX-1]->p_rsp_out[NORTH][k] (signal_dspin_false_rsp_out[x][YMAX-1][NORTH][k]);
+      }
    }
    std::cout << "North, South, West, East connections established" << std::endl;
@@ -756,27 +733,18 @@
    for (size_t x = 0; x < XMAX ; x++){
       for (size_t y = 0; y < YMAX ; y++){
-         for (size_t k = 0; k < 2; k++){
-            for (size_t a = 0; a < 4; a++){
-               signal_dspin_false_cmd_in [x][y][k][a].write = false;
-               signal_dspin_false_cmd_in [x][y][k][a].read  = true;
-               signal_dspin_false_cmd_out[x][y][k][a].write = false;
-               signal_dspin_false_cmd_out[x][y][k][a].read  = true;
-
-               signal_dspin_false_rsp_in [x][y][k][a].write = false;
-               signal_dspin_false_rsp_in [x][y][k][a].read  = true;
-               signal_dspin_false_rsp_out[x][y][k][a].write = false;
-               signal_dspin_false_rsp_out[x][y][k][a].read  = true;
+         for (size_t a = 0; a < 4; a++){
+            for (size_t k = 0; k < 3; k++){
+               signal_dspin_false_cmd_in [x][y][a][k].write = false;
+               signal_dspin_false_cmd_in [x][y][a][k].read  = true;
+               signal_dspin_false_cmd_out[x][y][a][k].write = false;
+               signal_dspin_false_cmd_out[x][y][a][k].read  = true;
             }
-         }
-      }
-   }
-   // clack network boundaries signals
-   for (size_t x = 0; x < XMAX ; x++){
-      for (size_t y = 0; y < YMAX ; y++){
-         for (size_t k = 0; k < 4; k++){
-            signal_dspin_false_clack_in [x][y][k].write = false;
-            signal_dspin_false_clack_in [x][y][k].read  = true;
-            signal_dspin_false_clack_out[x][y][k].write = false;
-            signal_dspin_false_clack_out[x][y][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;
+            }
          }
       }
