Index: branches/reconfiguration/modules/dspin_router/caba/test/recovery_bcast_evaluation/Makefile
===================================================================
--- branches/reconfiguration/modules/dspin_router/caba/test/recovery_bcast_evaluation/Makefile	(revision 1009)
+++ branches/reconfiguration/modules/dspin_router/caba/test/recovery_bcast_evaluation/Makefile	(revision 1009)
@@ -0,0 +1,38 @@
+RM             := rm -f
+SOCLIB_CC      := soclib-cc
+SOCLIB_CC_MODE := -m release
+SOCLIB_CC_ARGS := -P -I.
+
+TAGS           := cscope.out
+TARGET         := simul.x
+
+objs           := $(wildcard *.o)
+objs           += $(wildcard $(TARGET))
+objs           := $(strip $(objs))
+
+extra_objs     += $(wildcard $(TAGS))
+extra_objs     := $(strip $(extra_objs))
+
+all: $(TARGET)
+tags: $(TAGS)
+
+.PHONY: $(TARGET)
+$(TARGET): top.desc top.cpp
+	$(SOCLIB_CC) $(SOCLIB_CC_MODE) $(SOCLIB_CC_ARGS) -p $< -o $@
+
+.PHONY: $(TAGS)
+$(TAGS): top.desc
+	$(SOCLIB_CC) -p $< --tags --tags-type=cscope --tags-output=$@
+
+.PHONY: clean
+clean:
+	$(SOCLIB_CC) $(SOCLIB_CC_MODE) -x -p top.desc -I.
+ifneq ($(objs),)
+	$(RM) $(objs)
+endif
+
+.PHONY: distclean
+distclean: clean
+ifneq ($(extra_objs),)
+	$(RM) $(extra_objs)
+endif
Index: branches/reconfiguration/modules/dspin_router/caba/test/recovery_bcast_evaluation/dspin_broadcast_generator/caba/metadata/dspin_broadcast_generator.sd
===================================================================
--- branches/reconfiguration/modules/dspin_router/caba/test/recovery_bcast_evaluation/dspin_broadcast_generator/caba/metadata/dspin_broadcast_generator.sd	(revision 1009)
+++ branches/reconfiguration/modules/dspin_router/caba/test/recovery_bcast_evaluation/dspin_broadcast_generator/caba/metadata/dspin_broadcast_generator.sd	(revision 1009)
@@ -0,0 +1,18 @@
+# -*- python -*-
+
+Module('caba:dspin_broadcast_generator',
+       classname = 'soclib::caba::DspinBroadcastGenerator',
+       tmpl_parameters = [ parameter.Int('cmd_width'), parameter.Int('rsp_width'), ],
+       header_files = ['../source/include/dspin_broadcast_generator.h',],
+       implementation_files = ['../source/src/dspin_broadcast_generator.cpp',],
+       ports = [
+           Port('caba:bit_in', 'p_resetn', auto = 'resetn'),
+           Port('caba:clock_in', 'p_clk', auto = 'clock'),
+           Port('caba:dspin_output', 'p_out', dspin_data_size = parameter.Reference('cmd_width')), 
+           Port('caba:dspin_input', 'p_in', dspin_data_size = parameter.Reference('rsp_width')),
+       ],
+       uses = [ 
+           Uses('caba:base_module'),
+           Uses('caba:generic_fifo'),
+       ],
+)
Index: branches/reconfiguration/modules/dspin_router/caba/test/recovery_bcast_evaluation/dspin_broadcast_generator/caba/source/include/dspin_broadcast_generator.h
===================================================================
--- branches/reconfiguration/modules/dspin_router/caba/test/recovery_bcast_evaluation/dspin_broadcast_generator/caba/source/include/dspin_broadcast_generator.h	(revision 1009)
+++ branches/reconfiguration/modules/dspin_router/caba/test/recovery_bcast_evaluation/dspin_broadcast_generator/caba/source/include/dspin_broadcast_generator.h	(revision 1009)
@@ -0,0 +1,168 @@
+/* -*- 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 
+ * Date     : august 2013
+ * Copyright: UPMC - LIP6
+ *
+ *
+ * Modified by: Cesar Armando Fuguet Tortolero
+ * Date       : jul 2015
+ */
+
+#ifndef DSPIN_BROADCAST_GENERATOR_H
+#define DSPIN_BROADCAST_GENERATOR_H
+
+#include <systemc>
+#include "caba_base_module.h"
+#include "dspin_interface.h"
+#include "generic_fifo.h"
+#include "alloc_elems.h"
+
+////////////////////////////////////////////////////////////////////////////
+// This component is a synthetic sender/receiver of DSPIN paquets. It
+// has two DSPIN ports, and behaves as both a packet generator
+// (controled by the SEND_FSM), and a packet analyser (controled by
+// the RECEIVE_FSM). The flit width can be different for send packets
+// and received packets. These flit widths are template parameters.
+//
+// - As a packet generator, it cand send broadcast packets. A first
+//   GENERATOR FSM post dated requests in a FIFO. The CMD FSM consume
+//   these dated requests as soon as the FIFO is not empty, and try to
+//   send broadcast DSPIN packets.
+//
+// - The number of flits is exactly two flits for a broadcast
+//   packet. The flit width cannot be less than 33 bits (including
+//   EOP).
+//
+// - The first flit is the header, and the second flit contains the
+//   sender absolute date. The constructor parameter (load) define the
+//   requested (offered) load.  The accepted load is computed as :
+//   (NB_PACKETS * LENGTH * MESH_SIZE / NB_CYCLES). NB_PACKETS *
+//   LENGTH equals the number of sent flits, and this is multiplied by
+//   MESH_SIZE because the broadcast flits are replicated once for
+//   each cluster in the mesh.
+//
+// - As a packet analyser, it computes the total number of received
+//   packets, and the total cumulated latency.
+//
+////////////////////////////////////////////////////////////////////////////
+// - first flit format in case of a broadcast packet :
+//  |EOP|  XMIN   |  XMAX   |  YMIN   |  YMAX   |-------------------|BC |
+//  | 0 |   5     |   5     |   5     |   5     | flit_width - 22   | 1 |
+//
+// - second flit format :
+//  |EOP|-----------------|         date                                |
+//  | * | flit_width - 33 |          32                                 |
+////////////////////////////////////////////////////////////////////////////
+// It has three constructors parameters :
+// - size_t length == number of flits
+// - size_t load == LOAD*1000
+////////////////////////////////////////////////////////////////////////////
+
+namespace soclib { namespace caba {
+
+// FSM states
+enum { 
+    SEND_IDLE,
+    SEND_BROADCAST,
+};
+
+enum {
+    RECEIVE_IDLE,
+    RECEIVE_BROADCAST,
+};
+
+template<int cmd_width, int rsp_width>
+class DspinBroadcastGenerator
+    : public soclib::caba::BaseModule
+{           
+
+protected:
+
+    SC_HAS_PROCESS(DspinBroadcastGenerator);
+
+public:
+
+    // ports
+    sc_core::sc_in<bool>                  p_clk;
+    sc_core::sc_in<bool>                  p_resetn;
+    soclib::caba::DspinInput<rsp_width>   p_in;
+    soclib::caba::DspinOutput<cmd_width>  p_out;
+
+    // constructor 
+    DspinBroadcastGenerator( sc_module_name  name,
+                             const size_t    x_size,        // # of columns in the mesh
+                             const size_t    y_size,        // # of rows in the mesh
+                             const size_t    srcid,         // source identifier
+                             const size_t    load,          // requested load * 1000
+                             const size_t    fifo_depth );  // fifo depth
+private:
+
+    //  registers 
+    sc_core::sc_signal<uint32_t>  r_cycles;                 // cycles counter (date)
+                                                            
+    sc_core::sc_signal<uint32_t>  r_fifo_posted;            // number of posted requests
+                                                            
+    sc_core::sc_signal<int>       r_send_fsm;               // SEND state
+    sc_core::sc_signal<size_t>    r_send_length;            // flit counter
+    sc_core::sc_signal<size_t>    r_send_dest;              // packet destination (x,y)
+    sc_core::sc_signal<uint32_t>  r_send_date;              // request date 
+    sc_core::sc_signal<uint32_t>  r_send_bc_packets;        // number of broadcast packets
+
+    sc_core::sc_signal<int>       r_receive_fsm;            // RECEIVE FSM state
+    sc_core::sc_signal<size_t>    r_receive_bc_packets;     // number of broadcast packets
+    sc_core::sc_signal<size_t>    r_receive_bc_latency;     // cumulated broadcast latency
+    sc_core::sc_signal<size_t>    r_receive_bc_max_latency; // max broadcast latency
+
+    sc_core::sc_signal<size_t>    r_max_fill_status;        // max fifo fill status
+    
+    // Fifo from GENERATOR FSM to SEND FSM
+    GenericFifo<uint64_t>         r_date_fifo;
+
+    // structural variables
+    const size_t                  m_x_size;                 // # of columns of the mesh
+    const size_t                  m_y_size;                 // # of rows of the mesh
+    const size_t                  m_load;                   // requested load
+    const size_t                  m_srcid;                  // seed for random
+
+    // methods 
+    void transition();
+    void genMoore();
+
+public:
+
+    void print_trace();
+    void print_stats();
+
+}; // end class DspinBroadcastGenerator
+    
+}} // end namespace
+
+#endif // end DSPIN_BROADCAST_GENERATOR_H
+
+// Local Variables:
+// tab-width: 4
+// c-basic-offset: 4
+// c-file-offsets:((innamespace . 0)(inline-open . 0))
+// indent-tabs-mode: nil
+// End:
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 1009)
@@ -0,0 +1,254 @@
+/* -*- 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 
+ * Date     : july 2010
+ * Copyright: UPMC - LIP6
+ *
+ * Modified by: Cesar Armando Fuguet Tortolero
+ * Date       : july 2015
+ */
+
+#include "../include/dspin_broadcast_generator.h"
+#include <cassert>
+
+namespace soclib { namespace caba {
+
+using namespace soclib::caba;
+using namespace soclib::common;
+
+#define tmpl(x) template<int cmd_width, int rsp_width> x \
+    DspinBroadcastGenerator<cmd_width, rsp_width>
+
+
+//////////////////////////////////////////////////////
+tmpl(/**/)::DspinBroadcastGenerator( sc_module_name name,
+                                     const size_t   x_size,
+                                     const size_t   y_size,
+                                     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" ),
+           p_in( "p_in" ),
+           p_out( "p_out" ),
+
+           r_cycles( "r_cycles" ),
+           r_fifo_posted( "r_fifo_posted" ),
+
+           r_send_fsm( "r_send_fsm" ),
+           r_send_length( "r_send_length" ), 
+           r_send_dest( "r_send_dest" ),
+           r_send_date( "r_send_date" ),
+           r_send_bc_packets( "r_send_bc_packets" ),
+
+           r_receive_fsm( "r_receive_fsm" ),
+           r_receive_bc_packets( "r_receive_bc_packets" ),
+           r_receive_bc_latency( "r_receive_bc_latency" ),
+           r_receive_bc_max_latency( "r_receive_bc_max_latency" ),
+
+           r_max_fill_status( "r_max_fill_status" ),
+           
+           r_date_fifo( "r_date_fifo", fifo_depth ),
+
+           m_x_size ( x_size ),
+           m_y_size ( y_size ),
+           m_load( load ),
+           m_srcid( srcid )
+{
+    assert( (load <= 1000 ) and
+    "DSPIN PACKET GENERATOR ERROR: The load should be between 0 and 1000" );
+
+    assert( (cmd_width >= 33) and
+    "DSPIN PACKET GENERATOR ERROR: CMD flit width smaller than 33 bits");
+
+    SC_METHOD (transition);
+    dont_initialize();
+    sensitive << p_clk.pos();
+
+    SC_METHOD (genMoore);
+    dont_initialize();
+    sensitive  << p_clk.neg();
+} //  end constructor
+
+////////////////////////
+tmpl(void)::transition()
+{
+    if ( not p_resetn.read() )
+    {
+        r_send_fsm               = SEND_IDLE;
+        r_receive_fsm            = RECEIVE_IDLE;
+        r_cycles                 = 0;
+        r_fifo_posted            = 0;
+        r_send_bc_packets        = 0;
+        r_receive_bc_packets     = 0;
+        r_receive_bc_latency     = 0;
+        r_receive_bc_max_latency = 0;
+        r_max_fill_status        = 0;
+        srandom( m_srcid + cmd_width );
+        return;
+    }
+
+    // default values
+    bool fifo_put = false;
+    bool fifo_get = false;
+
+    uint32_t alea = random();
+
+    /////////////////////////   GENERATOR FSM
+    const size_t nflits = r_fifo_posted.read() * m_x_size * m_y_size * 2;
+    size_t accepted_load = (nflits * 1000) / (r_cycles.read() + 1);
+
+    if( (accepted_load + (alea>>16 & 0xF)) < (m_load) )
+    {
+       fifo_put = true ;
+       if( r_date_fifo.wok() ) r_fifo_posted = r_fifo_posted.read() + 1;
+    }
+
+    /////////////////////////// CMD FSM
+    switch( r_send_fsm.read() ) 
+    {
+        case SEND_IDLE:
+            if ( r_date_fifo.rok() )
+            {
+                fifo_get = true;
+
+                r_send_length     = 2;
+                r_send_date       = r_date_fifo.read();
+                r_send_bc_packets = r_send_bc_packets.read() + 1;
+                r_send_fsm        = SEND_BROADCAST;
+            }
+        break;
+        case SEND_BROADCAST:
+            if( p_out.read.read() ) 
+            {
+                r_send_length = r_send_length.read() - 1;
+                if( r_send_length.read() == 1 )  r_send_fsm = SEND_IDLE;
+            }
+        break;
+    }  // end SEND FSM
+
+    //////////////////////////////  RECEIVE FSM
+    switch( r_receive_fsm.read() ) {
+    case RECEIVE_IDLE:
+        if ( p_in.write.read() ) {
+            assert (p_in.data.read() & sc_uint<rsp_width>(1));
+            r_receive_fsm = RECEIVE_BROADCAST;
+        }
+        break;
+    case RECEIVE_BROADCAST:
+        if ( p_in.write.read() ) {
+            uint32_t latency = r_cycles.read() - (uint32_t)p_in.data.read();
+            r_receive_bc_packets  = r_receive_bc_packets.read() + 1;
+            r_receive_bc_latency  = r_receive_bc_latency.read() + latency;
+            if (latency > r_receive_bc_max_latency.read())
+                r_receive_bc_max_latency = latency;
+            
+            r_receive_fsm = RECEIVE_IDLE;
+        }
+        break;
+    } // `end RECEIVE FSM
+
+    // increment date
+    r_cycles = r_cycles.read() + 1;
+
+    //  update fifos
+    r_date_fifo.update( fifo_get, fifo_put, r_cycles.read() );
+
+    if (r_date_fifo.filled_status() > r_max_fill_status.read())
+        r_max_fill_status.write(r_date_fifo.filled_status());
+    
+} // end transition
+
+//////////////////////
+tmpl(void)::genMoore()
+{
+    // p_out
+    sc_uint<cmd_width>  data;
+    bool                write;
+    bool                eop;
+
+    if ( r_send_fsm.read() == SEND_IDLE ) {
+        data  = 0;
+        eop   = false;
+        write = false;
+    }
+    else { // SEND_BROADCAST  (two flits)
+        write = true;
+        if ( r_send_length.read() == 2 ) { // first flit
+            data = sc_uint<cmd_width>(0x07C1F) << (cmd_width - 20) |
+                   sc_uint<cmd_width>(1);
+            eop  = false;
+        }
+        else {                             // second flit
+            data = (sc_uint<cmd_width>)r_send_date.read() |
+                   (sc_uint<cmd_width>(1)<<(cmd_width-1));
+            eop  = true;
+        }
+    }
+    p_out.data  = data;
+    p_out.eop   = eop;
+    p_out.write = write;
+    
+    p_in.read = true;
+
+} // end genMoore
+
+/////////////////////////
+tmpl(void)::print_trace()
+{
+    const char* cmd_str[] = { "IDLE", "SEND_BROADCAST" };
+    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()] 
+              << " / fifo_content = " << r_date_fifo.filled_status() << std::endl;
+} // end print_trace
+
+/////////////////////////
+tmpl(void)::print_stats()
+{
+    const size_t   nflits     = r_send_bc_packets.read() * m_x_size * m_y_size * 2;
+    const size_t   load       = (nflits * 1000) / r_cycles.read();
+    const uint32_t bc_latency = r_receive_bc_latency.read() / (r_receive_bc_packets.read() + 1);
+
+    std::cout << "DSPIN_GENERATOR " << name() << std::dec << std::endl
+              << " - broadcast sent packets     = " << r_send_bc_packets.read() << std::endl
+              << " - offered load               = " << m_load << std::endl
+              << " - accepted load              = " << load << std::endl
+              << " - fifo max fill status       = " << r_max_fill_status.read() << std::endl
+              << " - broadcast received packets = " << r_receive_bc_packets.read() << std::endl
+              << " - broadcast latency          = " << bc_latency << std::endl
+              << " - broadcast max latency      = " << r_receive_bc_max_latency.read() << std::endl;
+} // end print_stats
+
+
+}} // end namespaces
+
+// Local Variables:
+// tab-width: 4
+// c-basic-offset: 4
+// c-file-offsets:((innamespace . 0)(inline-open . 0))
+// indent-tabs-mode: nil
+// End:
Index: branches/reconfiguration/modules/dspin_router/caba/test/recovery_bcast_evaluation/scripts/parse_latency.awk
===================================================================
--- branches/reconfiguration/modules/dspin_router/caba/test/recovery_bcast_evaluation/scripts/parse_latency.awk	(revision 1009)
+++ branches/reconfiguration/modules/dspin_router/caba/test/recovery_bcast_evaluation/scripts/parse_latency.awk	(revision 1009)
@@ -0,0 +1,49 @@
+#!/usr/bin/env awk -f
+###############################################################################
+# @author : Cesar Armando Fuguet Tortolero
+# @date   : jul 2015
+# @desc   : parse the output of the broadcast synthetic platform to
+#           get statistics
+###############################################################################
+BEGIN {
+    FS="[ \t]*"
+    cluster=0
+
+    # the name of the output file can be given with awk arguments
+    # '-v statsname=<name>'
+    if (!statsname) {
+	statsname = "broadcast_stats.dat"
+    }
+}
+
+/DSPIN_GENERATOR/ {
+    name[cluster]=$2
+    FS=" *= *"
+}
+
+/[\t ]*-[\t ]*broadcast sent packets/ {
+    sent[cluster]=$2
+}
+
+/[\t ]*-[\t ]*fifo max fill status/ {
+    fill[cluster]=$2
+}
+
+/[\t ]*-[\t ]*broadcast latency/ {
+    latency[cluster]=$2
+}
+
+/[\t ]*-[\t ]*broadcast max latency/ {
+    max[cluster]=$2
+    cluster++
+    FS="[ \t]*"
+}
+
+END {
+    print "broadcast latency" > statsname
+    print "name\t\t\tmean\t\tmax\t\tfill\t\tsent" >> statsname
+    for (i = 0; i < cluster; i++) {
+	print name[i] "\t\t" latency[i] "\t\t" max[i] "\t\t" \
+	    fill[i] "\t\t" sent[i] >> statsname
+    }
+}
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 1009)
@@ -0,0 +1,14 @@
+# append compilation flags
+cflags = config.default.toolchain.cflags
+#cflags.extend(['-ggdb'])
+config.default.toolchain.set("cflags", cflags)
+
+
+# append modules' description file paths
+from os import environ
+from os.path import join
+tsarpath = environ['TSARPATH']
+config.addDescPath(join(tsarpath, "trunk/lib"))
+config.addDescPath(join(tsarpath, "trunk/modules"))
+config.addDescPath(join(tsarpath, "branches/reconfiguration/communication"))
+config.addDescPath(join(tsarpath, "branches/reconfiguration/modules"))
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 1009)
@@ -0,0 +1,22 @@
+# -*- python -*-
+
+DSPIN_FLIT_WIDTH = 39
+
+# DSPIN network parameters
+Module('caba:reconf:synthetic_dspin_network',
+       classname = 'soclib::caba::SyntheticDspinNetwork',
+       header_files = ['../source/include/synthetic_dspin_network.h'],
+       implementation_files = ['../source/src/synthetic_dspin_network.cpp'],
+       ports = [
+           Port('caba:bit_in', 'p_resetn', auto = 'resetn'),
+	   Port('caba:clock_in', 'p_clk', auto = 'clock'),
+       ],
+       uses = [
+           Uses('caba:base_module'),
+           Uses('caba:reconf:dspin_router',
+                flit_width=DSPIN_FLIT_WIDTH),
+           Uses('caba:dspin_broadcast_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 1009)
@@ -0,0 +1,100 @@
+/* -*- 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  : Cesar Armando Fuguet Tortolero 
+ * Date     : jul 2015
+ * Copyright: UPMC - LIP6
+ */
+#ifndef SYNTHETIC_DSPIN_NETWORK
+#define SYNTHETIC_DSPIN_NETWORK
+
+#include <systemc>
+#include <stdint.h>
+#include "caba_base_module.h"
+#include "dspin_router.h"
+#include "dspin_broadcast_generator.h"
+
+namespace soclib {
+namespace caba {
+
+
+class SyntheticDspinNetwork
+    : public soclib::caba::BaseModule
+{
+    static const int X_WIDTH = 4;
+    static const int Y_WIDTH = 4;
+    static const int DSPIN_WIDTH = 39;
+    static const int DSPIN_ROUTER_FIFO_DEPTH = 4;
+    static const int DSPIN_GENERATOR_FIFO_DEPTH = 50;
+
+    typedef DspinBroadcastGenerator<DSPIN_WIDTH, DSPIN_WIDTH>
+    DspinNetworkGenerator;
+    typedef DspinRouter<DSPIN_WIDTH>
+    DspinNetworkRouter;
+    typedef DspinSignals<DSPIN_WIDTH>
+    DspinNetworkSignal;
+
+      
+public:
+
+    sc_core::sc_in<bool> p_clk;
+    sc_core::sc_in<bool> p_resetn;
+
+    SyntheticDspinNetwork(sc_module_name name,
+                          const size_t x_size,
+                          const size_t y_size,
+                          const size_t load);
+
+    ~SyntheticDspinNetwork();
+
+    void reset();
+    void set_faulty_router(const size_t faulty_x, const size_t faulty_y);
+    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;
+
+    DspinNetworkSignal ***sL;
+    DspinNetworkSignal ***sH;
+    DspinNetworkSignal ***sV;
+      
+    sc_core::sc_signal<uint32_t>** sConfigRouter;
+};                  // end class SyntheticDspinNetwork
+
+
+}                   // end namespace caba
+}                   // end namespace soclib
+
+#endif              // end SYNTHETIC_DSPIN_NETWORK
+
+// Local Variables:
+// tab-width: 4
+// c-basic-offset: 4
+// c-file-offsets:((innamespace . 0)(inline-open . 0))
+// indent-tabs-mode: nil
+// End:
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 1009)
@@ -0,0 +1,257 @@
+/* -*- 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  : Cesar Armando Fuguet Tortolero 
+ * Date     : jul 2015
+ * Copyright: UPMC - LIP6
+ */
+#include <cassert>
+
+#include "synthetic_dspin_network.h"
+#include "dspin_router_config.h"
+#include "alloc_elems.h"
+
+namespace soclib {
+namespace caba {
+using namespace soclib::common;
+    
+
+SyntheticDspinNetwork::SyntheticDspinNetwork(sc_module_name name,
+                                             const size_t x_size,
+                                             const size_t y_size,
+                                             const size_t load)
+    : BaseModule(name),
+      p_clk("p_clk"),
+      p_resetn("p_resetn"),
+      m_x_size(x_size),
+      m_y_size(y_size)
+{
+    // DSPIN packet generator instantiation
+    dspinGenerator = (DspinNetworkGenerator**)
+        malloc(sizeof(DspinNetworkGenerator*) * m_x_size);
+
+    for (size_t x = 0; x < m_x_size; ++x) {
+        dspinGenerator[x] = (DspinNetworkGenerator*)
+            malloc(sizeof(DspinNetworkGenerator) * m_y_size);
+
+        for (size_t y = 0; y < m_y_size; ++y) {
+            std::ostringstream generator_name;
+            const int SRCID = (x << Y_WIDTH) | y;
+            generator_name << "generator[" << x << "][" << y << "]";
+            new(&dspinGenerator[x][y])
+                DspinNetworkGenerator(generator_name.str().c_str(),
+                                      m_x_size,
+                                      m_y_size,
+                                      SRCID,
+                                      load,
+                                      DSPIN_GENERATOR_FIFO_DEPTH);
+	  
+        }
+    }
+      
+    // DSPIN router instantiation
+    dspinRouter = (DspinNetworkRouter**)
+        malloc(sizeof(DspinNetworkRouter*) * m_x_size);
+
+    for (size_t x = 0; x < m_x_size; ++x) {
+      	dspinRouter[x] = (DspinNetworkRouter*)
+            malloc(sizeof(DspinNetworkRouter) * m_y_size);
+
+        for (size_t y = 0; y < m_y_size; ++y) {
+            std::ostringstream router_name;
+            const bool BROADCAST_SUPPORTED = true;
+            const bool CONFIGURATION_SUPPORTED = true;
+            router_name << "router[" << x << "][" << y << "]";
+            new(&dspinRouter[x][y])
+                DspinNetworkRouter(router_name.str().c_str(),
+                                   x, y,
+                                   X_WIDTH, Y_WIDTH,
+                                   DSPIN_ROUTER_FIFO_DEPTH,
+                                   DSPIN_ROUTER_FIFO_DEPTH,
+                                   BROADCAST_SUPPORTED,
+                                   CONFIGURATION_SUPPORTED);
+        }
+    }
+
+    // signals instantiation
+    sL = alloc_elems<DspinNetworkSignal>("sL", m_x_size, m_y_size, 2);
+    sH = alloc_elems<DspinNetworkSignal>("sH", m_x_size + 1, m_y_size, 2);
+    sV = alloc_elems<DspinNetworkSignal>("sV", m_x_size, m_y_size + 1, 2);
+
+    sConfigRouter =
+        alloc_elems<sc_core::sc_signal<uint32_t> >("sConfigRouter",
+                                                   m_x_size, m_y_size);
+
+      
+    // netlist
+    for (size_t x = 0; x < m_x_size; ++x) {
+        for (size_t y = 0; y < m_y_size; ++y) {
+            dspinRouter[x][y].p_clk(p_clk);
+            dspinRouter[x][y].p_resetn(p_resetn);
+            dspinRouter[x][y].p_in[DspinNetworkRouter::N](sV[x][y + 1][1]);
+            dspinRouter[x][y].p_out[DspinNetworkRouter::N](sV[x][y + 1][0]);
+            dspinRouter[x][y].p_in[DspinNetworkRouter::S](sV[x][y][0]);
+            dspinRouter[x][y].p_out[DspinNetworkRouter::S](sV[x][y][1]);
+            dspinRouter[x][y].p_in[DspinNetworkRouter::E](sH[x + 1][y][1]);
+            dspinRouter[x][y].p_out[DspinNetworkRouter::E](sH[x + 1][y][0]);
+            dspinRouter[x][y].p_in[DspinNetworkRouter::W](sH[x][y][0]);
+            dspinRouter[x][y].p_out[DspinNetworkRouter::W](sH[x][y][1]);
+            dspinRouter[x][y].p_in[DspinNetworkRouter::L](sL[x][y][0]);
+            dspinRouter[x][y].p_out[DspinNetworkRouter::L](sL[x][y][1]);
+            dspinRouter[x][y].bind_recovery_port(sConfigRouter[x][y]);
+
+            dspinGenerator[x][y].p_clk(p_clk);
+            dspinGenerator[x][y].p_resetn(p_resetn);
+            dspinGenerator[x][y].p_out(sL[x][y][0]);
+            dspinGenerator[x][y].p_in(sL[x][y][1]);
+        }
+    }
+}                   // end constructor()
+
+
+SyntheticDspinNetwork::~SyntheticDspinNetwork()
+{
+    for (size_t x = 0; x < m_x_size; ++x) {
+        for (size_t y = 0; y < m_y_size; ++y) {
+            dspinGenerator[x][y].~DspinBroadcastGenerator();
+            dspinRouter[x][y].~DspinRouter();
+        }
+        free(dspinGenerator[x]);
+        free(dspinRouter[x]);
+    }
+    free(dspinGenerator);
+    free(dspinRouter);
+
+    dealloc_elems<DspinNetworkSignal>(sL, m_x_size, m_y_size, 2);
+    dealloc_elems<DspinNetworkSignal>(sH, m_x_size + 1, m_y_size, 2);
+    dealloc_elems<DspinNetworkSignal>(sV, m_x_size, m_y_size + 1, 2);
+
+    dealloc_elems<sc_core::sc_signal<uint32_t> >(sConfigRouter,
+                                                 m_x_size, m_y_size);
+}
+
+
+static inline uint32_t configRouter(int bypass_mode,
+                                    int reallocation_dir,
+                                    int blackhole_pos)
+{
+    return (bypass_mode << 7) | (reallocation_dir << 4) | blackhole_pos;
+}
+
+
+void SyntheticDspinNetwork::reset()
+{
+    // initialize routers' configuration signals
+    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);
+            sConfigRouter[x][y].write(CONFIG_NONE);
+        }
+    }
+      
+
+    // initialize mesh's boundary signals
+    for (size_t x = 0; x < m_x_size; ++x) {
+        sV[x][0][0].write = false;
+        sV[x][0][1].read = true;
+        sV[x][m_y_size][0].read = true;
+        sV[x][m_y_size][1].write = false;
+    }
+    for (size_t y = 0; y < m_y_size; ++y) {
+        sH[0][y][0].write = false;
+        sH[0][y][1].read = true;
+        sH[m_x_size][y][0].read = true;
+        sH[m_x_size][y][1].write = false;
+    }
+}                   // end reset()
+    
+
+void SyntheticDspinNetwork::set_faulty_router(const size_t faulty_x,
+                                              const size_t faulty_y)
+{
+    assert(faulty_x < m_x_size);
+    assert(faulty_y < m_y_size);
+
+
+    // transform the faulty router in a black-hole
+    dspinRouter[faulty_x][faulty_y].set_disable_mask(0x1F);
+
+
+    // reconfigure the faulty router's contour
+    if (faulty_y < (m_y_size - 1)) {
+        const uint32_t CONFIG_N = configRouter(1, REQ_SOUTH, BH_N);
+        sConfigRouter[faulty_x][faulty_y + 1].write(CONFIG_N);
+
+        if (faulty_x > 0) {
+            const uint32_t CONFIG_NW = configRouter(1, REQ_EAST, BH_NW);
+            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);
+            sConfigRouter[faulty_x + 1][faulty_y + 1].write(CONFIG_NE);
+        }
+    }
+
+    if (faulty_y > 0) {
+        const uint32_t CONFIG_S = configRouter(1, REQ_NORTH, BH_S);
+        sConfigRouter[faulty_x][faulty_y - 1].write(CONFIG_S);
+
+        if (faulty_x > 0) {
+            const uint32_t CONFIG_SW = configRouter(1, REQ_EAST, BH_SW);
+            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);
+            sConfigRouter[faulty_x + 1][faulty_y - 1].write(CONFIG_SE);
+        }
+    }
+
+    if (faulty_x > 0) {
+        const uint32_t CONFIG_W = configRouter(1, REQ_EAST, BH_W);
+        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);
+        sConfigRouter[faulty_x + 1][faulty_y].write(CONFIG_E);
+    }
+}                   // end set_faulty_router()
+
+
+void SyntheticDspinNetwork::print_stats(const size_t x, const size_t y)
+{
+    assert(x < m_x_size);
+    assert(y < m_y_size);
+
+    dspinGenerator[x][y].print_stats();
+}
+    
+
+}                   // end namespace caba
+}                   // end namespace soclib
+
+// Local Variables:
+// tab-width: 4
+// c-basic-offset: 4
+// c-file-offsets:((innamespace . 0)(inline-open . 0))
+// indent-tabs-mode: nil
+// End:
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 1009)
@@ -0,0 +1,165 @@
+/* -*- 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  : Cesar Armando Fuguet Tortolero 
+ * Date     : jul 2015
+ * Copyright: UPMC - LIP6
+ */
+#include <systemc>
+#include <string>
+#include "synthetic_dspin_network.h"
+
+#if _OPENMP
+#include <omp.h>
+#endif
+
+struct Args
+{
+    size_t x_size;
+    size_t y_size;
+    size_t load;
+    size_t ncycles;
+    bool faulty;
+};
+
+
+////////////////////////////////
+// parse command line arguments
+////////////////////////////////
+void parse_args(Args *args, int argc, char **argv)
+{
+    for (int arg = 1; arg < argc; ++arg) {
+        if ((strcmp(argv[arg], "-L") == 0) && ((arg + 1) < argc)) {
+            args->load = strtol(argv[arg + 1], NULL, 0);
+            arg++;
+            continue;
+        }
+        if ((strcmp(argv[arg], "-X") == 0) && ((arg + 1) < argc)) {
+            args->x_size = strtol(argv[arg + 1], NULL, 0);
+            arg++;
+            continue;
+        }
+        if ((strcmp(argv[arg], "-Y") == 0) && ((arg + 1) < argc)) {
+            args->y_size = strtol(argv[arg + 1], NULL, 0);
+            arg++;
+            continue;
+        }
+        if ((strcmp(argv[arg], "-N") == 0) && ((arg + 1) < argc)) {
+            args->ncycles = strtol(argv[arg + 1], NULL, 0);
+            arg++;
+            continue;
+        }
+        if (strcmp(argv[arg], "-F") == 0) {
+            args->faulty = true;
+            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 << "     -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;
+    }
+}                        // end parse_args()
+
+
+int sc_main(int argc, char **argv)
+{
+    using namespace soclib::caba;
+
+#if _OPENMP
+    omp_set_dynamic(false);
+    omp_set_num_threads(1);
+#endif
+
+
+    ////////////////////////////////
+    // parse command line arguments
+    ////////////////////////////////
+    Args args = {
+        .x_size  = 5,
+        .y_size  = 5,
+        .load    = 10,
+        .ncycles = 100000,
+        .faulty  = false
+    };
+    parse_args(&args, argc, argv);
+
+
+    ////////////////////////////
+    // components instantiation
+    ////////////////////////////
+    sc_core::sc_clock signal_clk;
+    sc_core::sc_signal<bool> signal_resetn;
+    SyntheticDspinNetwork syntheticDspinNetwork("syntheticDspinNetwork",
+                                                args.x_size,
+                                                args.y_size,
+                                                args.load);
+
+
+    ///////////
+    // netlist
+    ///////////
+    syntheticDspinNetwork.p_clk(signal_clk);
+    syntheticDspinNetwork.p_resetn(signal_resetn);
+
+
+    ////////////////////
+    // start simulation
+    ////////////////////
+    sc_core::sc_start(sc_core::SC_ZERO_TIME);
+    signal_resetn.write(0);
+    syntheticDspinNetwork.reset();
+
+    if (args.faulty) {
+        // 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);
+    }
+
+    sc_core::sc_start(1, sc_core::SC_NS);
+    signal_resetn.write(1);
+    sc_core::sc_start(args.ncycles, sc_core::SC_NS);
+
+
+    ////////////////////
+    // print statistics
+    ////////////////////
+    for (size_t x = 0; x < args.x_size; ++x) {
+        for (size_t y = 0; y < args.y_size; ++y) {
+            syntheticDspinNetwork.print_stats(x, y);
+        }
+    }
+
+  
+    return 0;
+}                   // end sc_main()
+
+// Local Variables:
+// tab-width: 4
+// c-basic-offset: 4
+// c-file-offsets:((innamespace . 0)(inline-open . 0))
+// indent-tabs-mode: nil
+// End:
Index: branches/reconfiguration/modules/dspin_router/caba/test/recovery_bcast_evaluation/top.desc
===================================================================
--- branches/reconfiguration/modules/dspin_router/caba/test/recovery_bcast_evaluation/top.desc	(revision 1009)
+++ branches/reconfiguration/modules/dspin_router/caba/test/recovery_bcast_evaluation/top.desc	(revision 1009)
@@ -0,0 +1,9 @@
+# -*- python -*-
+
+todo = Platform(
+    'caba', 'top.cpp',
+    uses = [
+        Uses('caba:reconf:synthetic_dspin_network'),
+    ],
+)
+
