Index: soft/giet_vm/apps/router/main.c
===================================================================
--- soft/giet_vm/apps/router/main.c	(revision 160)
+++ soft/giet_vm/apps/router/main.c	(revision 165)
@@ -1,4 +1,4 @@
 #include "stdio.h"
-#include "srl.h"
+#include "mwmr_channel.h"
 
 #define NMAX 200
@@ -10,19 +10,18 @@
     unsigned int 	n;
     unsigned int 	buf;
-    srl_mwmr_t	    mwmr;
+    mwmr_channel_t*	mwmr;
 
-    srl_log_printf( TRACE, "*** Starting task producer on processor %d", procid() );
-    srl_log_printf( TRACE, " at cycle %d ***\n\n", proctime() );
+    giet_tty_printf( "*** Starting task producer on processor %d", giet_procid() );
+    giet_tty_printf( " at cycle %d ***\n\n", giet_proctime() );
 
-    if( vobj_get_vbase( "router" , "mwmr_in", MWMR, (unsigned int*)&mwmr ) )
+    if( giet_vobj_get_vbase( "router" , 
+                             "mwmr_in", 
+                             VOBJ_TYPE_MWMR, 
+                             (void*)&mwmr ) )
     {
-        srl_log_printf( NONE, "\n[ERROR] in producer task :\n");
-        srl_log_printf( NONE, "          undefined <mwmr_in> channel: %d\n", mwmr);
-        srl_log_printf( TRACE, "*** &mwmr_in = %x\n\n", (unsigned int)mwmr );
-        exit();
-    }
-    else
-    {
-        srl_log_printf( TRACE, "*** &mwmr_in = %x\n\n", (unsigned int)mwmr );
+        giet_tty_printf( "\n[ERROR] in producer task :\n");
+        giet_tty_printf( "          undefined <mwmr_in> channel: %d\n", mwmr);
+        giet_tty_printf( "*** &mwmr_in = %x\n\n", (unsigned int)mwmr );
+        giet_exit();
     }
 
@@ -31,10 +30,10 @@
     { 
         buf = n;
-        srl_mwmr_write( mwmr, &buf , 1 );
-        srl_log_printf( TRACE, "transmitted value : %d\n", buf);
+        mwmr_write( mwmr, &buf , 1 );
+        giet_tty_printf( "transmitted value : %d\n", buf);
     }
 
-    srl_log_printf( TRACE, "\n*** Completing producer task at cycle %d ***\n", proctime());
-    exit();
+    giet_tty_printf( "\n*** Completing producer task at cycle %d ***\n", giet_proctime());
+    giet_exit();
 
 } // end producer()
@@ -45,18 +44,17 @@
     unsigned int 	n;
     unsigned int 	buf[5];
-    srl_mwmr_t	mwmr;
+    mwmr_channel_t*	mwmr;
 
-    srl_log_printf( TRACE, "*** Starting task consumer on processor %d", procid() );
-    srl_log_printf( TRACE, " at cycle %d ***\n\n", proctime() );
+    giet_tty_printf( "*** Starting task consumer on processor %d", giet_procid() );
+    giet_tty_printf( " at cycle %d ***\n\n", giet_proctime() );
 
-    if ( vobj_get_vbase( "router" , "mwmr_out", MWMR, (unsigned int*)&mwmr ) )
+    if ( giet_vobj_get_vbase( "router" , 
+                              "mwmr_out", 
+                              VOBJ_TYPE_MWMR, 
+                              (void*)&mwmr ) )
     {
-        srl_log_printf( NONE, "\n[ERROR] in consumer task :\n");
-        srl_log_printf( NONE, "          undefined <mwmr_out> channel\n");
-        exit();
-    }
-    else
-    {
-        srl_log_printf( TRACE, "*** &mwmr_out = %x\n\n", (unsigned int)mwmr );
+        giet_tty_printf( "\n[ERROR] in consumer task :\n");
+        giet_tty_printf( "          undefined <mwmr_out> channel\n");
+        giet_exit();
     }
 
@@ -64,14 +62,14 @@
     for(n = 0 ; n < NMAX ; n = n+5 ) 
     { 
-        srl_mwmr_read( mwmr, buf , 5 );
-        srl_log_printf( TRACE, "received token %d / value = %d\n", n  , buf[0]);
-        srl_log_printf( TRACE, "received token %d / value = %d\n", n+1, buf[1]);
-        srl_log_printf( TRACE, "received token %d / value = %d\n", n+2, buf[2]);
-        srl_log_printf( TRACE, "received token %d / value = %d\n", n+3, buf[3]);
-        srl_log_printf( TRACE, "received token %d / value = %d\n", n+4, buf[4]);
+        mwmr_read( mwmr, buf , 5 );
+        giet_tty_printf( "received token %d / value = %d\n", n  , buf[0]);
+        giet_tty_printf( "received token %d / value = %d\n", n+1, buf[1]);
+        giet_tty_printf( "received token %d / value = %d\n", n+2, buf[2]);
+        giet_tty_printf( "received token %d / value = %d\n", n+3, buf[3]);
+        giet_tty_printf( "received token %d / value = %d\n", n+4, buf[4]);
     }
 
-    srl_log_printf( TRACE, "\n*** Completing consumer task at cycle %d ***\n", proctime());
-    exit();
+    giet_tty_printf( "\n*** Completing consumer task at cycle %d ***\n", giet_proctime());
+    giet_exit();
 
 } // end consumer()
@@ -83,31 +81,29 @@
     unsigned int 	x;
     unsigned int	tempo;
-    srl_mwmr_t  	mwmr_in ;
-    srl_mwmr_t	    mwmr_out ;
+    mwmr_channel_t*	mwmr_in ;
+    mwmr_channel_t* mwmr_out ;
 
     
-    srl_log_printf( TRACE, "*** Starting task router on processor %d at cycle %d ***\n\n", 
-                procid(), proctime() );
+    giet_tty_printf( "*** Starting task router on processor %d", giet_procid() ); 
+    giet_tty_printf( " at cycle %d ***\n\n", giet_proctime() );
 
-    if ( vobj_get_vbase( "router" , "mwmr_out", MWMR, (unsigned int*)&mwmr_out ) )
+    if ( giet_vobj_get_vbase( "router" , 
+                              "mwmr_out", 
+                              VOBJ_TYPE_MWMR, 
+                              (void*)&mwmr_out ) )
     {
-        srl_log( NONE, "\n[ERROR] in router task :\n");
-        srl_log( NONE, "          undefined <mwmr_in> channel\n");
-        exit();
-    }
-    else
-    {
-        srl_log_printf( TRACE, "*** &mwmr_out = %x\n\n", (unsigned int)mwmr_out );
+        giet_tty_printf( "\n[ERROR] in router task :\n");
+        giet_tty_printf( "          undefined <mwmr_in> channel\n");
+        giet_exit();
     }
 
-    if (  vobj_get_vbase( "router" , "mwmr_in", MWMR, (unsigned int*)&mwmr_in ) )
+    if (  giet_vobj_get_vbase( "router" , 
+                               "mwmr_in", 
+                               VOBJ_TYPE_MWMR, 
+                               (void*)&mwmr_in ) )
     {
-        srl_log( NONE, "\n[ERROR] in router task :\n");
-        srl_log( NONE, "          undefined <mwmr_out> channel\n");
-        exit();
-    }
-    else
-    {
-        srl_log_printf( TRACE, "*** &mwmr_in = %x\n\n", (unsigned int)mwmr_out );
+        giet_tty_printf( "\n[ERROR] in router task :\n");
+        giet_tty_printf( "          undefined <mwmr_out> channel\n");
+        giet_exit();
     }
 
@@ -115,10 +111,10 @@
     while(1)
     {
-        srl_mwmr_read( mwmr_in , buf , 2 );
-        tempo = rand() >> 6;
+        mwmr_read( mwmr_in , buf , 2 );
+        tempo = giet_rand() >> 6;
         for ( x = 0 ; x < tempo ; x++ ) asm volatile ("");
-        srl_log_printf( TRACE, "token value : %d / temporisation = %d\n", buf[0], tempo);
-        srl_log_printf( TRACE, "token value : %d / temporisation = %d\n", buf[1], tempo);
-        srl_mwmr_write( mwmr_out, buf , 2 );
+        giet_tty_printf( "token value : %d / temporisation = %d\n", buf[0], tempo);
+        giet_tty_printf( "token value : %d / temporisation = %d\n", buf[1], tempo);
+        mwmr_write( mwmr_out, buf , 2 );
     }
 }
