Index: branches/reconfiguration/modules/dspin_router/caba/test/recovery_bcast_evaluation/dspin_broadcast_generator/caba/source/src/dspin_broadcast_generator.cpp
===================================================================
--- branches/reconfiguration/modules/dspin_router/caba/test/recovery_bcast_evaluation/dspin_broadcast_generator/caba/source/src/dspin_broadcast_generator.cpp	(revision 1009)
+++ branches/reconfiguration/modules/dspin_router/caba/test/recovery_bcast_evaluation/dspin_broadcast_generator/caba/source/src/dspin_broadcast_generator.cpp	(revision 1016)
@@ -1,24 +1,24 @@
 /* -*- c++ -*-
  * SOCLIB_LGPL_HEADER_BEGIN
- * 
+ *
  * This file is part of SoCLib, GNU LGPLv2.1.
- * 
+ *
  * SoCLib is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
  * by the Free Software Foundation; version 2.1 of the License.
- * 
+ *
  * SoCLib is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU Lesser General Public
  * License along with SoCLib; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  * 02110-1301 USA
- * 
+ *
  * SOCLIB_LGPL_HEADER_END
  *
- * Authors  : alain.greiner@lip6.fr 
+ * Authors  : alain.greiner@lip6.fr
  * Date     : july 2010
  * Copyright: UPMC - LIP6
@@ -44,9 +44,9 @@
                                      const size_t   x_size,
                                      const size_t   y_size,
-                                     const size_t   srcid,      // srcid for random 
+                                     const size_t   srcid,      // srcid for random
                                      const size_t   load,       // requested load * 1000
                                      const size_t   fifo_depth) // Fifo depth
            : BaseModule(name),
-           
+
            p_clk( "clk" ),
            p_resetn( "resetn" ),
@@ -58,5 +58,5 @@
 
            r_send_fsm( "r_send_fsm" ),
-           r_send_length( "r_send_length" ), 
+           r_send_length( "r_send_length" ),
            r_send_dest( "r_send_dest" ),
            r_send_date( "r_send_date" ),
@@ -69,5 +69,5 @@
 
            r_max_fill_status( "r_max_fill_status" ),
-           
+
            r_date_fifo( "r_date_fifo", fifo_depth ),
 
@@ -127,5 +127,5 @@
 
     /////////////////////////// CMD FSM
-    switch( r_send_fsm.read() ) 
+    switch( r_send_fsm.read() )
     {
         case SEND_IDLE:
@@ -141,5 +141,5 @@
         break;
         case SEND_BROADCAST:
-            if( p_out.read.read() ) 
+            if( p_out.read.read() )
             {
                 r_send_length = r_send_length.read() - 1;
@@ -164,5 +164,5 @@
             if (latency > r_receive_bc_max_latency.read())
                 r_receive_bc_max_latency = latency;
-            
+
             r_receive_fsm = RECEIVE_IDLE;
         }
@@ -178,5 +178,5 @@
     if (r_date_fifo.filled_status() > r_max_fill_status.read())
         r_max_fill_status.write(r_date_fifo.filled_status());
-    
+
 } // end transition
 
@@ -210,5 +210,5 @@
     p_out.eop   = eop;
     p_out.write = write;
-    
+
     p_in.read = true;
 
@@ -221,7 +221,7 @@
     const char* rsp_str[] = { "IDLE", "RECEIVE_BROADCAST" };
 
-    std::cout << "DSPIN_GENERATOR " << name() 
-              << " : send_fsm = " << cmd_str[r_send_fsm.read()] 
-              << " / recv_fsm = " << rsp_str[r_receive_fsm.read()] 
+    std::cout << "DSPIN_GENERATOR " << name()
+              << " : send_fsm = " << cmd_str[r_send_fsm.read()]
+              << " / recv_fsm = " << rsp_str[r_receive_fsm.read()]
               << " / fifo_content = " << r_date_fifo.filled_status() << std::endl;
 } // end print_trace
@@ -253,2 +253,4 @@
 // indent-tabs-mode: nil
 // End:
+
+// vim: ts=4 : sts=4 : sw=4 : et
Index: branches/reconfiguration/modules/dspin_router/caba/test/recovery_bcast_evaluation/soclib.conf
===================================================================
--- branches/reconfiguration/modules/dspin_router/caba/test/recovery_bcast_evaluation/soclib.conf	(revision 1009)
+++ branches/reconfiguration/modules/dspin_router/caba/test/recovery_bcast_evaluation/soclib.conf	(revision 1016)
@@ -1,7 +1,7 @@
 # append compilation flags
 cflags = config.default.toolchain.cflags
-#cflags.extend(['-ggdb'])
+# cflags.extend(['-ggdb'])
+# cflags.extend(['-DUNICAST'])
 config.default.toolchain.set("cflags", cflags)
-
 
 # append modules' description file paths
Index: branches/reconfiguration/modules/dspin_router/caba/test/recovery_bcast_evaluation/synthetic_dspin_network/caba/metadata/synthetic_dspin_network.sd
===================================================================
--- branches/reconfiguration/modules/dspin_router/caba/test/recovery_bcast_evaluation/synthetic_dspin_network/caba/metadata/synthetic_dspin_network.sd	(revision 1009)
+++ branches/reconfiguration/modules/dspin_router/caba/test/recovery_bcast_evaluation/synthetic_dspin_network/caba/metadata/synthetic_dspin_network.sd	(revision 1016)
@@ -18,4 +18,7 @@
            Uses('caba:dspin_broadcast_generator',
                 cmd_width=DSPIN_FLIT_WIDTH,
+                rsp_width=DSPIN_FLIT_WIDTH),
+           Uses('caba:dspin_packet_generator',
+                cmd_width=DSPIN_FLIT_WIDTH,
                 rsp_width=DSPIN_FLIT_WIDTH)
        ],
Index: branches/reconfiguration/modules/dspin_router/caba/test/recovery_bcast_evaluation/synthetic_dspin_network/caba/source/include/synthetic_dspin_network.h
===================================================================
--- branches/reconfiguration/modules/dspin_router/caba/test/recovery_bcast_evaluation/synthetic_dspin_network/caba/source/include/synthetic_dspin_network.h	(revision 1009)
+++ branches/reconfiguration/modules/dspin_router/caba/test/recovery_bcast_evaluation/synthetic_dspin_network/caba/source/include/synthetic_dspin_network.h	(revision 1016)
@@ -2,24 +2,24 @@
  *
  * SOCLIB_LGPL_HEADER_BEGIN
- * 
+ *
  * This file is part of SoCLib, GNU LGPLv2.1.
- * 
+ *
  * SoCLib is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
  * by the Free Software Foundation; version 2.1 of the License.
- * 
+ *
  * SoCLib is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU Lesser General Public
  * License along with SoCLib; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  * 02110-1301 USA
- * 
+ *
  * SOCLIB_LGPL_HEADER_END
  *
- * Authors  : Cesar Armando Fuguet Tortolero 
+ * Authors  : Cesar Armando Fuguet Tortolero
  * Date     : jul 2015
  * Copyright: UPMC - LIP6
@@ -32,5 +32,10 @@
 #include "caba_base_module.h"
 #include "dspin_router.h"
+
+#if UNICAST
+#include "dspin_packet_generator.h"
+#else
 #include "dspin_broadcast_generator.h"
+#endif
 
 namespace soclib {
@@ -47,6 +52,12 @@
     static const int DSPIN_GENERATOR_FIFO_DEPTH = 50;
 
+#if UNICAST
+    typedef DspinPacketGenerator<DSPIN_WIDTH, DSPIN_WIDTH>
+    DspinNetworkGenerator;
+#else
     typedef DspinBroadcastGenerator<DSPIN_WIDTH, DSPIN_WIDTH>
     DspinNetworkGenerator;
+#endif
+
     typedef DspinRouter<DSPIN_WIDTH>
     DspinNetworkRouter;
@@ -54,5 +65,5 @@
     DspinNetworkSignal;
 
-      
+
 public:
 
@@ -71,10 +82,10 @@
     void print_stats(const size_t x, const size_t y);
 
-      
+
 private:
 
     const size_t m_x_size;
     const size_t m_y_size;
-      
+
     DspinNetworkGenerator **dspinGenerator;
     DspinNetworkRouter **dspinRouter;
@@ -83,5 +94,5 @@
     DspinNetworkSignal ***sH;
     DspinNetworkSignal ***sV;
-      
+
     sc_core::sc_signal<uint32_t>** sConfigRouter;
 };                  // end class SyntheticDspinNetwork
Index: branches/reconfiguration/modules/dspin_router/caba/test/recovery_bcast_evaluation/synthetic_dspin_network/caba/source/src/synthetic_dspin_network.cpp
===================================================================
--- branches/reconfiguration/modules/dspin_router/caba/test/recovery_bcast_evaluation/synthetic_dspin_network/caba/source/src/synthetic_dspin_network.cpp	(revision 1009)
+++ branches/reconfiguration/modules/dspin_router/caba/test/recovery_bcast_evaluation/synthetic_dspin_network/caba/source/src/synthetic_dspin_network.cpp	(revision 1016)
@@ -2,24 +2,24 @@
  *
  * SOCLIB_LGPL_HEADER_BEGIN
- * 
+ *
  * This file is part of SoCLib, GNU LGPLv2.1.
- * 
+ *
  * SoCLib is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
  * by the Free Software Foundation; version 2.1 of the License.
- * 
+ *
  * SoCLib is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU Lesser General Public
  * License along with SoCLib; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  * 02110-1301 USA
- * 
+ *
  * SOCLIB_LGPL_HEADER_END
  *
- * Authors  : Cesar Armando Fuguet Tortolero 
+ * Authors  : Cesar Armando Fuguet Tortolero
  * Date     : jul 2015
  * Copyright: UPMC - LIP6
@@ -34,5 +34,5 @@
 namespace caba {
 using namespace soclib::common;
-    
+
 
 SyntheticDspinNetwork::SyntheticDspinNetwork(sc_module_name name,
@@ -58,4 +58,14 @@
             const int SRCID = (x << Y_WIDTH) | y;
             generator_name << "generator[" << x << "][" << y << "]";
+#if UNICAST
+            const size_t PACKET_LENGTH = 8;
+            new(&dspinGenerator[x][y])
+                DspinNetworkGenerator(generator_name.str().c_str(),
+                                      (size_t)SRCID,
+                                      PACKET_LENGTH,
+                                      load,
+                                      (size_t)DSPIN_GENERATOR_FIFO_DEPTH,
+                                      0 );
+#else
             new(&dspinGenerator[x][y])
                 DspinNetworkGenerator(generator_name.str().c_str(),
@@ -65,8 +75,9 @@
                                       load,
                                       DSPIN_GENERATOR_FIFO_DEPTH);
-	  
-        }
-    }
-      
+#endif
+
+        }
+    }
+
     // DSPIN router instantiation
     dspinRouter = (DspinNetworkRouter**)
@@ -74,5 +85,5 @@
 
     for (size_t x = 0; x < m_x_size; ++x) {
-      	dspinRouter[x] = (DspinNetworkRouter*)
+        dspinRouter[x] = (DspinNetworkRouter*)
             malloc(sizeof(DspinNetworkRouter) * m_y_size);
 
@@ -102,5 +113,5 @@
                                                    m_x_size, m_y_size);
 
-      
+
     // netlist
     for (size_t x = 0; x < m_x_size; ++x) {
@@ -133,5 +144,9 @@
     for (size_t x = 0; x < m_x_size; ++x) {
         for (size_t y = 0; y < m_y_size; ++y) {
+#if UNICAST
+            dspinGenerator[x][y].~DspinPacketGenerator();
+#else
             dspinGenerator[x][y].~DspinBroadcastGenerator();
+#endif
             dspinRouter[x][y].~DspinRouter();
         }
@@ -151,9 +166,11 @@
 
 
-static inline uint32_t configRouter(int bypass_mode,
-                                    int reallocation_dir,
+static inline uint32_t configRouter(int reallocation_dir,
+                                    int recovery_mode,
                                     int blackhole_pos)
 {
-    return (bypass_mode << 7) | (reallocation_dir << 4) | blackhole_pos;
+    return ((reallocation_dir & 0x7) << 5) |
+           ((recovery_mode & 0x1)    << 4) |
+           (blackhole_pos & 0xF);
 }
 
@@ -164,9 +181,9 @@
     for (size_t x = 0; x < m_x_size; ++x) {
         for (size_t y = 0; y < m_y_size; ++y) {
-            const uint32_t CONFIG_NONE = configRouter(0, REQ_NOP, BH_NONE);
+            const uint32_t CONFIG_NONE = configRouter(0, 0, NORMAL);
             sConfigRouter[x][y].write(CONFIG_NONE);
         }
     }
-      
+
 
     // initialize mesh's boundary signals
@@ -184,5 +201,5 @@
     }
 }                   // end reset()
-    
+
 
 void SyntheticDspinNetwork::set_faulty_router(const size_t faulty_x,
@@ -199,13 +216,13 @@
     // reconfigure the faulty router's contour
     if (faulty_y < (m_y_size - 1)) {
-        const uint32_t CONFIG_N = configRouter(1, REQ_SOUTH, BH_N);
+        const uint32_t CONFIG_N = configRouter(REQ_SOUTH, 1, N_OF_X);
         sConfigRouter[faulty_x][faulty_y + 1].write(CONFIG_N);
 
         if (faulty_x > 0) {
-            const uint32_t CONFIG_NW = configRouter(1, REQ_EAST, BH_NW);
+            const uint32_t CONFIG_NW = configRouter(REQ_EAST, 1, NW_OF_X);
             sConfigRouter[faulty_x - 1][faulty_y + 1].write(CONFIG_NW);
         }
         if (faulty_x < (m_x_size - 1)) {
-            const uint32_t CONFIG_NE = configRouter(1, REQ_WEST, BH_NE);
+            const uint32_t CONFIG_NE = configRouter(REQ_WEST, 1, NE_OF_X);
             sConfigRouter[faulty_x + 1][faulty_y + 1].write(CONFIG_NE);
         }
@@ -213,13 +230,13 @@
 
     if (faulty_y > 0) {
-        const uint32_t CONFIG_S = configRouter(1, REQ_NORTH, BH_S);
+        const uint32_t CONFIG_S = configRouter(REQ_NORTH, 1, S_OF_X);
         sConfigRouter[faulty_x][faulty_y - 1].write(CONFIG_S);
 
         if (faulty_x > 0) {
-            const uint32_t CONFIG_SW = configRouter(1, REQ_EAST, BH_SW);
+            const uint32_t CONFIG_SW = configRouter(REQ_EAST, 1, SW_OF_X);
             sConfigRouter[faulty_x - 1][faulty_y - 1].write(CONFIG_SW);
         }
         if (faulty_x < (m_x_size - 1)) {
-            const uint32_t CONFIG_SE = configRouter(1, REQ_WEST, BH_SE);
+            const uint32_t CONFIG_SE = configRouter(REQ_WEST, 1, SE_OF_X);
             sConfigRouter[faulty_x + 1][faulty_y - 1].write(CONFIG_SE);
         }
@@ -227,10 +244,10 @@
 
     if (faulty_x > 0) {
-        const uint32_t CONFIG_W = configRouter(1, REQ_EAST, BH_W);
+        const uint32_t CONFIG_W = configRouter(REQ_EAST, 1, W_OF_X);
         sConfigRouter[faulty_x - 1][faulty_y].write(CONFIG_W);
     }
 
     if (faulty_x < (m_x_size - 1)) {
-        const uint32_t CONFIG_E = configRouter(1, REQ_WEST, BH_E);
+        const uint32_t CONFIG_E = configRouter(REQ_WEST, 1, E_OF_X);
         sConfigRouter[faulty_x + 1][faulty_y].write(CONFIG_E);
     }
@@ -245,5 +262,5 @@
     dspinGenerator[x][y].print_stats();
 }
-    
+
 
 }                   // end namespace caba
@@ -256,2 +273,4 @@
 // indent-tabs-mode: nil
 // End:
+
+// vim: ts=4 : sts=4 : sw=4 : et
Index: branches/reconfiguration/modules/dspin_router/caba/test/recovery_bcast_evaluation/top.cpp
===================================================================
--- branches/reconfiguration/modules/dspin_router/caba/test/recovery_bcast_evaluation/top.cpp	(revision 1009)
+++ branches/reconfiguration/modules/dspin_router/caba/test/recovery_bcast_evaluation/top.cpp	(revision 1016)
@@ -73,13 +73,15 @@
             continue;
         }
-    
+
         std::cout << "   Arguments are (key, value) couples." << std::endl;
         std::cout << "   The order is not important." << std::endl;
         std::cout << "   Accepted arguments are :" << std::endl << std::endl;
-        std::cout << "     -L dspin generators' accepted load * 1000" << std::endl;
+        std::cout << "     -L generators' accepted load * 1000" << std::endl;
         std::cout << "     -X number of clusters per row" << std::endl;
         std::cout << "     -Y number of clusters per column" << std::endl;
         std::cout << "     -N simulation's cycles" << std::endl;
         std::cout << "     -F deactivate a router" << std::endl;
+
+        exit(1);
     }
 }                        // end parse_args()
@@ -137,5 +139,6 @@
         // deactivate a router in the center of the mesh and create its
         // recovery cycle-free contour
-        syntheticDspinNetwork.set_faulty_router(args.x_size / 2, args.y_size / 2);
+        syntheticDspinNetwork.set_faulty_router(args.x_size / 2,
+                                                args.y_size / 2);
     }
 
@@ -154,5 +157,5 @@
     }
 
-  
+
     return 0;
 }                   // end sc_main()
@@ -164,2 +167,4 @@
 // indent-tabs-mode: nil
 // End:
+
+// vim: ts=4 : sts=4 : sw=4 : et
