Index: /branches/reconfiguration/modules/dspin_router/caba/source/src/dspin_router.cpp
===================================================================
--- /branches/reconfiguration/modules/dspin_router/caba/source/src/dspin_router.cpp	(revision 996)
+++ /branches/reconfiguration/modules/dspin_router/caba/source/src/dspin_router.cpp	(revision 997)
@@ -36,6 +36,6 @@
     //
     //  - In case of a broacast
-    //  |  XMIN   |  XMAX   |  YMIN   |  YMAX   |-------------------|BC |
-    //  |   5     |   5     |   5     |   5     | flit_width - 22   | 1 |
+    //  |  XMIN   |  XMAX   |  YMIN   |  YMAX   |----------------|SP|BC |
+    //  |   5     |   5     |   5     |   5     | flit_width - 21| 1| 1 |
     ///////////////////////////////////////////////////////////////////////////
 
@@ -356,6 +356,7 @@
         const size_t ymax = (data >> (flit_width - 20)) & 0x1F;
         const int    bh   = blackhole_position();
+
         int  sel = REQ_NOP;
-        bool ew  = ((data & 0x2) != 0);
+        bool special = ((data & 0x2) != 0);
 
         switch(source) {
@@ -389,5 +390,5 @@
             }
             else if ( step == 4 ) {
-                if ( (bh == BH_SE) && (ew || (lx == 1)) ) {
+                if ( (bh == BH_SE) && (!special || (lx == 1))) {
                     sel = REQ_WEST;
                     break;
@@ -430,5 +431,5 @@
                     break;
                 }
-                if ( (bh == BH_S) && !ew ) {
+                if ( (bh == BH_S) && special ) {
                     sel = REQ_NOP;
                     break;
@@ -472,35 +473,18 @@
         const int bh = blackhole_position();
         sc_uint<flit_width> header = r_fifo_in[source].read().data;
-        sc_uint<flit_width> mask = 0x2;
+        sc_uint<flit_width> special = 0x2;
         switch (source) {
+            case REQ_NORTH:
+                if ( (bh == BH_NW) || (bh == BH_NE) ) {
+                    header |= special;
+                }
+                break;
+
+            /* Make sure that broadcast transactions do not enter the DSPIN
+             * network with the special bit set. This can arrive if an initiator
+             * or a local interconnect uses the broadcast header reserved bits
+             * internally and don't reset them */
             case REQ_LOCAL:
-                if ( bh != BH_NONE ) {
-                    header |= mask;
-                }
-                break;
-            case REQ_EAST:
-                if ( (bh == BH_NE) || (bh == BH_E) ) {
-                    header |= mask;
-                }
-                break;
-            case REQ_WEST:
-                if ( (bh == BH_NW) || (bh == BH_W) || (bh == BH_SW) ) {
-                    header |= mask;
-                }
-                break;
-
-            /* Make sure that the EW bit is not set when it shouldn't.
-             * This can arrive if an initiator or a local interconnect uses
-             * the broadcast header reserved bits internally and don't reset
-             * them */
-            case REQ_NORTH:
-                if ( (bh == BH_NW) || (bh == BH_N) || (bh == BH_NE) ) {
-                    header &= ~mask;
-                }
-                break;
-            case REQ_SOUTH:
-                if ( (bh == BH_SW) || (bh == BH_S) || (bh == BH_SE) ) {
-                    header &= ~mask;
-                }
+                header &= ~special;
                 break;
         }
Index: /branches/reconfiguration/modules/dspin_router/caba/test/synthetic_test/broadcast_check.sh
===================================================================
--- /branches/reconfiguration/modules/dspin_router/caba/test/synthetic_test/broadcast_check.sh	(revision 996)
+++ /branches/reconfiguration/modules/dspin_router/caba/test/synthetic_test/broadcast_check.sh	(revision 997)
@@ -10,4 +10,6 @@
 	last=0
 	failure=0
+	min=99999999
+	max=0
 }
 #   Parse coordinates of routers
@@ -36,16 +38,10 @@
 	}
 	else {
-		# store the number of received packets of a router that actually
-		# received packets.
-		if (last == 0) {
-			last=$6
+		# store the min and max number of received packets
+		if ($6 < min) {
+			min=$6;
 		}
-		# test if the error is too important. The error is defined as
-		# difference between the number of packets received by different
-		# routers.
-		error=last - $6
-		if ((error > 20) || (error < -20)) {
-			failure=1
-			exit;
+		if ($6 > max) {
+			max=$6;
 		}
 	}
@@ -54,18 +50,26 @@
 #   Validate the file
 END {
-	# an error was too important
-	if (failure == 1) {
-		exit 1
-	}
-
 	# it should be only two routers that do not receive the broadcast:
 	# the source and the faulty router.
-	if (zero != 2) {
+	if (zero > 2) {
+		print "error: some routers did not received broadcasts\n";
 		exit 1;
 	}
 
-	# test if the error is too important
-	error=last - sent
-	if ((error > 20) || (error < -20)) {
+	if (max > sent) {
+		print "error: at least a router received a number of broadcast greater"
+		print "than the number of broadcast sent\n";
+		exit 1;
+	}
+
+	if (zero == 1) {
+		print "error: the broadcast source received broadcasts\n";
+		exit 1;
+	}
+
+	error=sent - min
+	if (error > 20) {
+		print "error: the number of broadcast received by a router is inferior "
+		print "to the error threshold\n";
 		exit 1;
 	}
Index: /branches/reconfiguration/modules/dspin_router/caba/test/synthetic_test/run_broadcast_check.sh
===================================================================
--- /branches/reconfiguration/modules/dspin_router/caba/test/synthetic_test/run_broadcast_check.sh	(revision 996)
+++ /branches/reconfiguration/modules/dspin_router/caba/test/synthetic_test/run_broadcast_check.sh	(revision 997)
@@ -1,5 +1,5 @@
 #!/usr/bin/env sh
 LOGDIR=logs
-COMMON="-X 5 -Y 5 -N 3000"
+COMMON="-X 5 -Y 5 -N 10000"
 
 mkdir -p $LOGDIR
