Index: /branches/reconfiguration/modules/dspin_router/caba/test/common.mk
===================================================================
--- /branches/reconfiguration/modules/dspin_router/caba/test/common.mk	(revision 941)
+++ /branches/reconfiguration/modules/dspin_router/caba/test/common.mk	(revision 942)
@@ -17,5 +17,5 @@
               -fomit-frame-pointer         \
               -march=mips32                \
-              -Os                          \
+              -Og                          \
               -ggdb                        \
 #             -msoft-float                 \
Index: /branches/reconfiguration/modules/dspin_router/caba/test/simple_recovery_routing_test/main.c
===================================================================
--- /branches/reconfiguration/modules/dspin_router/caba/test/simple_recovery_routing_test/main.c	(revision 941)
+++ /branches/reconfiguration/modules/dspin_router/caba/test/simple_recovery_routing_test/main.c	(revision 942)
@@ -30,43 +30,43 @@
      */
     printf("router(0, 2): configuring as NW\n");
-    assert(xcu_get_config(0, 2, 0) == BH_NONE);
-    xcu_set_config(0, 2, 0, BH_NW);    /* configure NW */
+    assert(xcu_get_register(0, 2, XICU_CFG_REG, 0) == BH_NONE);
+    xcu_set_register(0, 2, XICU_CFG_REG, 0, BH_NW);    /* configure NW */
 
     printf("router(0, 1): configuring as W\n");
-    assert(xcu_get_config(0, 1, 0) == BH_NONE);
-    xcu_set_config(0, 1, 0, BH_W);     /* configure W */
+    assert(xcu_get_register(0, 1, XICU_CFG_REG, 0) == BH_NONE);
+    xcu_set_register(0, 1, XICU_CFG_REG, 0, BH_W);     /* configure W */
 
     printf("router(0, 0): configuring as SW\n");
-    assert(xcu_get_config(0, 0, 0) == BH_NONE);
-    xcu_set_config(0, 0, 0, BH_SW);    /* configure SW */
+    assert(xcu_get_register(0, 0, XICU_CFG_REG, 0) == BH_NONE);
+    xcu_set_register(0, 0, XICU_CFG_REG, 0, BH_SW);    /* configure SW */
 
     printf("router(1, 2): configuring as N\n");
-    assert(xcu_get_config(1, 2, 0) == BH_NONE);
-    xcu_set_config(1, 2, 0, BH_N);     /* configure N */
+    assert(xcu_get_register(1, 2, XICU_CFG_REG, 0) == BH_NONE);
+    xcu_set_register(1, 2, XICU_CFG_REG, 0, BH_N);     /* configure N */
 
     printf("router(2, 2): configuring as NE\n");
-    assert(xcu_get_config(2, 2, 0) == BH_NONE);
-    xcu_set_config(2, 2, 0, BH_NE);    /* configure NE */
+    assert(xcu_get_register(2, 2, XICU_CFG_REG, 0) == BH_NONE);
+    xcu_set_register(2, 2, XICU_CFG_REG, 0, BH_NE);    /* configure NE */
 
     printf("router(2, 1): configuring as E\n");
-    assert(xcu_get_config(2, 1, 0) == BH_NONE);
-    xcu_set_config(2, 1, 0, BH_E);     /* configure E */
+    assert(xcu_get_register(2, 1, XICU_CFG_REG, 0) == BH_NONE);
+    xcu_set_register(2, 1, XICU_CFG_REG, 0, BH_E);     /* configure E */
 
     printf("router(2, 0): configuring as SE\n");
-    assert(xcu_get_config(2, 0, 0) == BH_NONE);
-    xcu_set_config(2, 0, 0, BH_SE);    /* configure SE */
+    assert(xcu_get_register(2, 0, XICU_CFG_REG, 0) == BH_NONE);
+    xcu_set_register(2, 0, XICU_CFG_REG, 0, BH_SE);    /* configure SE */
 
     printf("router(1, 0): configuring as S\n");
-    assert(xcu_get_config(1, 0, 0) == BH_NONE);
-    xcu_set_config(1, 0, 0, BH_S);     /* configure S */
+    assert(xcu_get_register(1, 0, XICU_CFG_REG, 0) == BH_NONE);
+    xcu_set_register(1, 0, XICU_CFG_REG, 0, BH_S);     /* configure S */
 
-    assert(xcu_get_config(0, 2, 0) == BH_NW);
-    assert(xcu_get_config(0, 1, 0) == BH_W);
-    assert(xcu_get_config(0, 0, 0) == BH_SW);
-    assert(xcu_get_config(1, 2, 0) == BH_N);
-    assert(xcu_get_config(2, 2, 0) == BH_NE);
-    assert(xcu_get_config(2, 1, 0) == BH_E);
-    assert(xcu_get_config(2, 0, 0) == BH_SE);
-    assert(xcu_get_config(1, 0, 0) == BH_S);
+    assert(xcu_get_register(0, 2, XICU_CFG_REG, 0) == BH_NW);
+    assert(xcu_get_register(0, 1, XICU_CFG_REG, 0) == BH_W);
+    assert(xcu_get_register(0, 0, XICU_CFG_REG, 0) == BH_SW);
+    assert(xcu_get_register(1, 2, XICU_CFG_REG, 0) == BH_N);
+    assert(xcu_get_register(2, 2, XICU_CFG_REG, 0) == BH_NE);
+    assert(xcu_get_register(2, 1, XICU_CFG_REG, 0) == BH_E);
+    assert(xcu_get_register(2, 0, XICU_CFG_REG, 0) == BH_SE);
+    assert(xcu_get_register(1, 0, XICU_CFG_REG, 0) == BH_S);
 
 #if 0
@@ -78,5 +78,5 @@
      * between them.
      */
-    assert(xcu_get_config(1, 1, 0) == BH_NONE);
+    assert(xcu_get_register(1, 1, XICU_CFG_REG, 0) == BH_NONE);
 #endif
 
Index: /branches/reconfiguration/modules/dspin_router/caba/test/simple_recovery_routing_test/test.sh
===================================================================
--- /branches/reconfiguration/modules/dspin_router/caba/test/simple_recovery_routing_test/test.sh	(revision 941)
+++ /branches/reconfiguration/modules/dspin_router/caba/test/simple_recovery_routing_test/test.sh	(revision 942)
@@ -13,5 +13,5 @@
 PLATFORM=../../../../../platforms/tsar_generic_iob
 SIMULATOR=$PLATFORM/simul.x
-$SIMULATOR -DSOFT $SOFT -DISK /dev/null -FAULTY_ROUTER 0 1 1 2> /dev/null >> output/log
+$SIMULATOR -DSOFT $SOFT -DISK /dev/null -FAULTY_ROUTER 0 1 1 > output/log 2>&1
 soclib-cleanup-terms &> /dev/null
 mv term0 output/term
Index: /branches/reconfiguration/modules/dspin_router/caba/test/simple_segment_recovery_test/main.c
===================================================================
--- /branches/reconfiguration/modules/dspin_router/caba/test/simple_segment_recovery_test/main.c	(revision 941)
+++ /branches/reconfiguration/modules/dspin_router/caba/test/simple_segment_recovery_test/main.c	(revision 942)
@@ -25,44 +25,54 @@
     /* configure the routers around the blackhole (1, 1) to define a cycle-free
      * contour */
+    uint32_t val;
+
     printf("router(0, 2): configuring as NW\n");
-    assert(xcu_get_config(0, 2, 0) == BH_NONE);
-    xcu_set_config(0, 2, 0, (REQ_SOUTH << 4) | BH_NW);     /* configure NW */
+    assert(xcu_get_register(0, 2, XICU_CFG_REG, 0) == BH_NONE);
+    val = (REQ_SOUTH << 4) | BH_NW;
+    xcu_set_register(0, 2, XICU_CFG_REG, 0, val);     /* configure NW */
 
     printf("router(0, 1): configuring as W\n");
-    assert(xcu_get_config(0, 1, 0) == BH_NONE);
-    xcu_set_config(0, 1, 0, (REQ_LOCAL << 4) | BH_W);      /* configure W */
+    assert(xcu_get_register(0, 1, XICU_CFG_REG, 0) == BH_NONE);
+    val = (REQ_LOCAL << 4) | BH_W;
+    xcu_set_register(0, 1, XICU_CFG_REG, 0, val);     /* configure W */
 
     printf("router(0, 0): configuring as SW\n");
-    assert(xcu_get_config(0, 0, 0) == BH_NONE);
-    xcu_set_config(0, 0, 0, (REQ_NORTH << 4) | BH_SW);     /* configure SW */
+    assert(xcu_get_register(0, 0, XICU_CFG_REG, 0) == BH_NONE);
+    val = (REQ_NORTH << 4) | BH_SW;
+    xcu_set_register(0, 0, XICU_CFG_REG, 0, val);     /* configure SW */
 
     printf("router(1, 2): configuring as N\n");
-    assert(xcu_get_config(1, 2, 0) == BH_NONE);
-    xcu_set_config(1, 2, 0, (REQ_WEST << 4) | BH_N);       /* configure N */
+    assert(xcu_get_register(1, 2, XICU_CFG_REG, 0) == BH_NONE);
+    val = (REQ_WEST << 4) | BH_N;
+    xcu_set_register(1, 2, XICU_CFG_REG, 0, val);     /* configure N */
 
     printf("router(2, 2): configuring as NE\n");
-    assert(xcu_get_config(2, 2, 0) == BH_NONE);
-    xcu_set_config(2, 2, 0, (REQ_WEST << 4) | BH_NE);      /* configure NE */
+    assert(xcu_get_register(2, 2, XICU_CFG_REG, 0) == BH_NONE);
+    val = (REQ_WEST << 4) | BH_NE;
+    xcu_set_register(2, 2, XICU_CFG_REG, 0, val);     /* configure NE */
 
     printf("router(2, 1): configuring as E\n");
-    assert(xcu_get_config(2, 1, 0) == BH_NONE);
-    xcu_set_config(2, 1, 0, (REQ_SOUTH << 4) | BH_E);      /* configure E */
+    assert(xcu_get_register(2, 1, XICU_CFG_REG, 0) == BH_NONE);
+    val = (REQ_SOUTH << 4) | BH_E;
+    xcu_set_register(2, 1, XICU_CFG_REG, 0, val);     /* configure E */
 
     printf("router(2, 0): configuring as SE\n");
-    assert(xcu_get_config(2, 0, 0) == BH_NONE);
-    xcu_set_config(2, 0, 0, (REQ_WEST << 4) | BH_SE);      /* configure SE */
+    assert(xcu_get_register(2, 0, XICU_CFG_REG, 0) == BH_NONE);
+    val = (REQ_WEST << 4) | BH_SE;
+    xcu_set_register(2, 0, XICU_CFG_REG, 0, val);     /* configure SE */
 
     printf("router(1, 0): configuring as S\n");
-    assert(xcu_get_config(1, 0, 0) == BH_NONE);
-    xcu_set_config(1, 0, 0, (REQ_WEST << 4) | BH_S);       /* configure S */
+    assert(xcu_get_register(1, 0, XICU_CFG_REG, 0) == BH_NONE);
+    val = (REQ_WEST << 4) | BH_S;
+    xcu_set_register(1, 0, XICU_CFG_REG, 0, val);     /* configure S */
 
-    assert((xcu_get_config(0, 2, 0) & 0xF) == BH_NW);
-    assert((xcu_get_config(0, 1, 0) & 0xF) == BH_W);
-    assert((xcu_get_config(0, 0, 0) & 0xF) == BH_SW);
-    assert((xcu_get_config(1, 2, 0) & 0xF) == BH_N);
-    assert((xcu_get_config(2, 2, 0) & 0xF) == BH_NE);
-    assert((xcu_get_config(2, 1, 0) & 0xF) == BH_E);
-    assert((xcu_get_config(2, 0, 0) & 0xF) == BH_SE);
-    assert((xcu_get_config(1, 0, 0) & 0xF) == BH_S);
+    assert((xcu_get_register(0, 2, XICU_CFG_REG, 0) & 0xF) == BH_NW);
+    assert((xcu_get_register(0, 1, XICU_CFG_REG, 0) & 0xF) == BH_W);
+    assert((xcu_get_register(0, 0, XICU_CFG_REG, 0) & 0xF) == BH_SW);
+    assert((xcu_get_register(1, 2, XICU_CFG_REG, 0) & 0xF) == BH_N);
+    assert((xcu_get_register(2, 2, XICU_CFG_REG, 0) & 0xF) == BH_NE);
+    assert((xcu_get_register(2, 1, XICU_CFG_REG, 0) & 0xF) == BH_E);
+    assert((xcu_get_register(2, 0, XICU_CFG_REG, 0) & 0xF) == BH_SE);
+    assert((xcu_get_register(1, 0, XICU_CFG_REG, 0) & 0xF) == BH_S);
 
     /* Test the recovered segment that has been migrated to the EAST cluster */
Index: /branches/reconfiguration/modules/dspin_router/caba/test/simple_segment_recovery_test/test.sh
===================================================================
--- /branches/reconfiguration/modules/dspin_router/caba/test/simple_segment_recovery_test/test.sh	(revision 941)
+++ /branches/reconfiguration/modules/dspin_router/caba/test/simple_segment_recovery_test/test.sh	(revision 942)
@@ -13,5 +13,5 @@
 PLATFORM=../../../../../platforms/tsar_generic_iob
 SIMULATOR=$PLATFORM/simul.x
-$SIMULATOR -DSOFT $SOFT -DISK /dev/null -FAULTY_ROUTER 0 1 1 2> /dev/null >> output/log
+$SIMULATOR -DSOFT $SOFT -DISK /dev/null -FAULTY_ROUTER 0 1 1 > output/log 2>&1
 soclib-cleanup-terms &> /dev/null
 mv term0 output/term
Index: /branches/reconfiguration/softs/drivers/xcu.c
===================================================================
--- /branches/reconfiguration/softs/drivers/xcu.c	(revision 941)
+++ /branches/reconfiguration/softs/drivers/xcu.c	(revision 942)
@@ -5,5 +5,4 @@
  */
 #include <xcu.h>
-#include <soclib/xicu.h>
 #include <io.h>
 #include <hard_config.h>
@@ -12,12 +11,12 @@
 #define XCUREG(func,idx) (SEG_XCU_BASE + (XICU_REG((func),(idx)) << 2))
 
-void xcu_set_config(int x, int y, int idx, uint32_t val)
+void xcu_set_register(int x, int y, int func, int idx, uint32_t val)
 {
-    iowrite32(CLUSTER_BASE(x,y) | XCUREG(XICU_CFG_REG, idx), val);
+    iowrite32(CLUSTER_BASE(x,y) | XCUREG(func, idx), val);
 }
 
-uint32_t xcu_get_config(int x, int y, int idx)
+uint32_t xcu_get_register(int x, int y, int func, int idx)
 {
-    return ioread32(CLUSTER_BASE(x,y) | XCUREG(XICU_CFG_REG, idx));
+    return ioread32(CLUSTER_BASE(x,y) | XCUREG(func, idx));
 }
 
Index: /branches/reconfiguration/softs/drivers/xcu.h
===================================================================
--- /branches/reconfiguration/softs/drivers/xcu.h	(revision 941)
+++ /branches/reconfiguration/softs/drivers/xcu.h	(revision 942)
@@ -7,8 +7,9 @@
 #define XCU_H
 
+#include <soclib/xicu.h>
 #include <stdint.h>
 
-void xcu_set_config(int x, int y, int idx, uint32_t val);
-uint32_t xcu_get_config(int x, int y, int idx);
+void xcu_set_register(int x, int y, int func, int idx, uint32_t val);
+uint32_t xcu_get_register(int x, int y, int func, int idx);
 
 #endif
