Index: soft/giet_vm/Makefile
===================================================================
--- soft/giet_vm/Makefile	(revision 203)
+++ soft/giet_vm/Makefile	(revision 204)
@@ -4,4 +4,6 @@
 LD=mipsel-unknown-elf-ld
 DU=mipsel-unknown-elf-objdump
+
+MAP_XML      = 1c_4p_four.xml
 
 SYS_OBJS     = build/sys/vm_handler.o \
@@ -57,5 +59,5 @@
 
 ### mapping compilation
-map.bin: 1c_4p_four.xml
+map.bin: $(MAP_XML)
 	$(MAKE) -C xml
 	xml/xml2bin $< $@
Index: soft/giet_vm/boot/boot_init.c
===================================================================
--- soft/giet_vm/boot/boot_init.c	(revision 203)
+++ soft/giet_vm/boot/boot_init.c	(revision 204)
@@ -286,5 +286,6 @@
 void boot_puts(const char *buffer) 
 {
-    unsigned int* tty_address = (unsigned int*)&seg_tty_base;
+    unsigned int* tty_address = (unsigned int*)( (unsigned)&seg_tty_base +
+                                     (CLUSTER_IO_ID * (unsigned)CLUSTER_SIZE) );
     unsigned int n;
 
@@ -297,8 +298,8 @@
 } 
 ////////////////////////////////////////////////////////////////////////////
-// boot_putw() 
+// boot_putx() 
 // (it uses TTY0)
 ////////////////////////////////////////////////////////////////////////////
-void boot_putw(unsigned int val)
+void boot_putx(unsigned int val)
 {
     static const char   HexaTab[] = "0123456789ABCDEF";
@@ -316,4 +317,32 @@
     }
     boot_puts(buf);
+}
+////////////////////////////////////////////////////////////////////////////
+// boot_putd() 
+// (it uses TTY0)
+////////////////////////////////////////////////////////////////////////////
+void boot_putd(unsigned int val)
+{
+    static const char   DecTab[] = "0123456789";
+    char                buf[11];
+    unsigned int        i;
+    unsigned int        first;
+
+    buf[10] = 0;
+
+    for ( i = 0 ; i < 10 ; i++ )
+    {
+        if ((val != 0) || (i == 0))
+        {
+            buf[9-i] = DecTab[val % 10];
+            first    = 9-i;
+        }
+        else
+        {
+            break;
+        }
+        val /= 10;
+    }
+    boot_puts( &buf[first] );
 }
 
@@ -495,5 +524,5 @@
     {
         boot_puts("Unfound page table for vspace ");
-        boot_putw(vspace_id);
+        boot_putd(vspace_id);
         boot_puts("\n");
         boot_exit();
@@ -530,6 +559,9 @@
     if ( ( *pt_flags & PTE_V) != 0 )    // page already mapped
     {
-        boot_puts("\n[BOOT ERROR] in boot_add_pte() function\n");
-        boot_puts("page already mapped\n");
+        boot_puts("\n[BOOT ERROR] double mapping in vspace ");
+        boot_putd( vspace_id );
+        boot_puts(" for vpn = ");
+        boot_putx( vpn );
+        boot_puts("\n");
         boot_exit();
     }
@@ -579,9 +611,9 @@
 boot_puts( vseg[vseg_id].name );
 boot_puts(" : flags = ");
-boot_putw( flags );
+boot_putx( flags );
 boot_puts(" / npages = ");
-boot_putw( npages );
+boot_putd( npages );
 boot_puts(" / pbase = ");
-boot_putw( vseg[vseg_id].pbase );
+boot_putx( vseg[vseg_id].pbase );
 boot_puts("\n");
 #endif        
@@ -615,9 +647,9 @@
 boot_puts( vseg[vseg_id].name );
 boot_puts(" / flags = ");
-boot_putw( flags );
+boot_putx( flags );
 boot_puts(" / npages = ");
-boot_putw( npages );
+boot_putd( npages );
 boot_puts(" / pbase = ");
-boot_putw( vseg[vseg_id].pbase );
+boot_putx( vseg[vseg_id].pbase );
 boot_puts("\n");
 #endif        
@@ -720,5 +752,5 @@
                 boot_puts( "\n[BOOT ERROR] in boot_vseg_map() function, " );
                 boot_puts("PTAB too small, minumum size is: ");
-                boot_putw( PT1_SIZE + PT2_SIZE);
+                boot_putx( PT1_SIZE + PT2_SIZE);
                 boot_exit();
             }
@@ -750,14 +782,14 @@
         boot_puts("\n"); 
         boot_puts("vseg pbase = ");
-        boot_putw( vseg->pbase ); 
+        boot_putx( vseg->pbase ); 
         boot_puts("\n"); 
         boot_puts("vseg length = ");
-        boot_putw( vseg->length ); 
+        boot_putx( vseg->length ); 
         boot_puts("\n"); 
         boot_puts("pseg pbase = ");
-        boot_putw( pseg->base ); 
+        boot_putx( pseg->base ); 
         boot_puts("\n"); 
         boot_puts("pseg length = ");
-        boot_putw( pseg->length ); 
+        boot_putx( pseg->length ); 
         boot_puts("\n"); 
         boot_exit();
@@ -771,9 +803,9 @@
 boot_puts( vseg->name );
 boot_puts(" : len = ");
-boot_putw( vseg->length );
+boot_putx( vseg->length );
 boot_puts(" / vbase = ");
-boot_putw( vseg->vbase );
+boot_putx( vseg->vbase );
 boot_puts(" / pbase = ");
-boot_putw( vseg->pbase );
+boot_putx( vseg->pbase );
 boot_puts("\n");
 #endif  
@@ -795,5 +827,5 @@
     {
         boot_puts("\n[BOOT ERROR] Illegal mapping signature: ");
-        boot_putw(header->signature);
+        boot_putx(header->signature);
         boot_puts("\n");
         boot_exit();
@@ -805,7 +837,7 @@
         boot_puts("\n[BOOT ERROR] Incoherent NB_CLUSTERS");
         boot_puts("\n             - In giet_config,  value = ");
-        boot_putw ( NB_CLUSTERS );
+        boot_putd ( NB_CLUSTERS );
         boot_puts("\n             - In mapping_info, value = ");
-        boot_putw ( header->clusters );
+        boot_putd ( header->clusters );
         boot_puts("\n");
         boot_exit();
@@ -823,5 +855,4 @@
     unsigned int periph_id;
     unsigned int cluster_id;
-    unsigned int channels;
     unsigned int tty_found = 0;
     unsigned int nic_found = 0;
@@ -832,7 +863,7 @@
         {
             boot_puts("\n[BOOT ERROR] too much processors in cluster ");
-            boot_putw( cluster_id );
+            boot_putd( cluster_id );
             boot_puts(" : procs = ");
-            boot_putw ( cluster[cluster_id].procs );
+            boot_putd ( cluster[cluster_id].procs );
             boot_puts("\n");
             boot_exit();
@@ -854,7 +885,7 @@
                 {
                     boot_puts("\n[BOOT ERROR] Wrong NB_TTYS in cluster ");
-                    boot_putw( cluster_id );
+                    boot_putd( cluster_id );
                     boot_puts(" : ttys = ");
-                    boot_putw ( periph[periph_id].channels );
+                    boot_putd ( periph[periph_id].channels );
                     boot_puts("\n");
                     boot_exit();
@@ -873,7 +904,7 @@
                 {
                     boot_puts("\n[BOOT ERROR] Wrong NB_NICS in cluster ");
-                    boot_putw( cluster_id );
+                    boot_putd( cluster_id );
                     boot_puts(" : nics = ");
-                    boot_putw ( periph[periph_id].channels );
+                    boot_putd ( periph[periph_id].channels );
                     boot_puts("\n");
                     boot_exit();
@@ -887,7 +918,7 @@
                 {
                     boot_puts("\n[BOOT ERROR] Too much user timers in cluster ");
-                    boot_putw( cluster_id );
+                    boot_putd( cluster_id );
                     boot_puts(" : timers = ");
-                    boot_putw ( periph[periph_id].channels );
+                    boot_putd ( periph[periph_id].channels );
                     boot_puts("\n");
                     boot_exit();
@@ -900,7 +931,7 @@
                 {
                     boot_puts("\n[BOOT ERROR] Too much DMA channels in cluster ");
-                    boot_putw( cluster_id );
+                    boot_putd( cluster_id );
                     boot_puts(" : channels = ");
-                    boot_putw ( periph[periph_id].channels );
+                    boot_putd ( periph[periph_id].channels );
                     boot_puts("\n");
                     boot_exit();
@@ -937,5 +968,5 @@
         {
             boot_puts("\n[BOOT ERROR] The number of processors in cluster ");
-            boot_putw( cluster_id );
+            boot_putd( cluster_id );
             boot_puts(" is larger than NB_PROCS_MAX \n");
             boot_exit();
@@ -959,9 +990,9 @@
 #if BOOT_DEBUG_PT
 boot_puts("cluster ");
-boot_putw(cluster_id);
+boot_putd(cluster_id);
 boot_puts(" / pseg ");
 boot_puts(pseg[pseg_id].name);
 boot_puts(" : next_base = ");
-boot_putw(pseg[pseg_id].next_base);
+boot_putx(pseg[pseg_id].next_base);
 boot_puts("\n");
 #endif
@@ -1028,7 +1059,7 @@
 #if BOOT_DEBUG_PT
 boot_puts("\n>>> page table physical address = ");
-boot_putw((unsigned int)boot_ptabs_paddr[vspace_id]);
+boot_putx((unsigned int)boot_ptabs_paddr[vspace_id]);
 boot_puts(", page table number of PT2 = ");
-boot_putw((unsigned int)boot_max_pt2[vspace_id]);
+boot_putd((unsigned int)boot_max_pt2[vspace_id]);
 boot_puts("\n");
 #endif
@@ -1082,7 +1113,7 @@
 boot_puts( vobj[vobj_id].name);
 boot_puts(" / depth = ");
-boot_putw( mwmr->depth );
+boot_putd( mwmr->depth );
 boot_puts(" / width = ");
-boot_putw( mwmr->width );
+boot_putd( mwmr->width );
 boot_puts("\n");
 #endif
@@ -1095,5 +1126,5 @@
 boot_puts( vobj[vobj_id].name);
 boot_puts(" / length = ");
-boot_putw( vobj[vobj_id].length ); 
+boot_putx( vobj[vobj_id].length ); 
 boot_puts("\n");
 #endif
@@ -1106,5 +1137,5 @@
 boot_puts( vobj[vobj_id].name);
 boot_puts(" / length = ");
-boot_putw( vobj[vobj_id].length ); 
+boot_putx( vobj[vobj_id].length ); 
 boot_puts("\n");
 #endif
@@ -1120,5 +1151,5 @@
 boot_puts( vobj[vobj_id].name);
 boot_puts(" / init_value = ");
-boot_putw( barrier->init );
+boot_putd( barrier->init );
 boot_puts("\n");
 #endif
@@ -1142,5 +1173,5 @@
 boot_puts( vobj[vobj_id].name);
 boot_puts(" / length = ");
-boot_putw( vobj[vobj_id].length ); 
+boot_putx( vobj[vobj_id].length ); 
 boot_puts("\n");
 #endif
@@ -1154,5 +1185,5 @@
 boot_puts( vobj[vobj_id].name);
 boot_puts(" / length = ");
-boot_putw( vobj[vobj_id].length ); 
+boot_putx( vobj[vobj_id].length ); 
 boot_puts("\n");
 #endif
@@ -1173,5 +1204,5 @@
         {
             boot_puts("\n[INIT ERROR] Missing PTAB for vspace ");
-            boot_putw( vspace_id );
+            boot_putd( vspace_id );
             boot_exit();
         }
@@ -1185,5 +1216,4 @@
     volatile unsigned int *cbase = (unsigned int*) coproc;
     
-
     cbase[MWMR_CONFIG_FIFO_WAY] = way ;
     cbase[MWMR_CONFIG_FIFO_NO] = no ;
@@ -1222,5 +1252,5 @@
 #if BOOT_DEBUG_PERI
 boot_puts("\n[BOOT DEBUG] ****** peripheral initialisation in cluster "); 
-boot_putw( cluster_id );
+boot_putd( cluster_id );
 boot_puts(" ******\n");
 #endif
@@ -1245,5 +1275,5 @@
 #if BOOT_DEBUG_PERI
 boot_puts("- IOC initialised : ");
-boot_putw( channels );
+boot_putd( channels );
 boot_puts(" channels\n");
 #endif
@@ -1261,5 +1291,5 @@
 #if BOOT_DEBUG_PERI
 boot_puts("- DMA initialised : ");
-boot_putw( channels );
+boot_putd( channels );
 boot_puts(" channels\n");
 #endif
@@ -1276,5 +1306,5 @@
 #if BOOT_DEBUG_PERI
 boot_puts("- NIC initialised : ");
-boot_putw( channels );
+boot_putd( channels );
 boot_puts(" channels\n");
 #endif
@@ -1298,5 +1328,5 @@
 #if BOOT_DEBUG_PERI
 boot_puts("- IOB initialised : ");
-boot_putw( channels );
+boot_putd( channels );
 boot_puts(" channels\n");
 #endif
@@ -1304,5 +1334,5 @@
 
         } // end for periphs
-/*
+
         for ( coproc_id = cluster[cluster_id].coproc_offset ;
               coproc_id < cluster[cluster_id].coproc_offset + cluster[cluster_id].coprocs ;
@@ -1315,7 +1345,7 @@
 #if BOOT_DEBUG_PERI
 boot_puts("[BOOT] mwmr coproc initialisation of ");
-boot_putw((unsigned int) coproc[coproc_id].name);
+boot_putx((unsigned int) coproc[coproc_id].name);
 boot_puts(", nb ports");
-boot_putw((unsigned int)coproc[coproc_id].ports);
+boot_putd((unsigned int)coproc[coproc_id].ports);
 boot_puts("\n");
 #endif
@@ -1356,5 +1386,5 @@
             }
         } // end for coprocs
-*/
+
     } // end for clusters
 } // end boot_peripherals_init()
@@ -1417,5 +1447,5 @@
 #if BOOT_DEBUG_SCHED
 boot_puts("\n[BOOT DEBUG] Initialise schedulers / IT vector in cluster ");
-boot_putw( cluster_id );
+boot_putd( cluster_id );
 boot_puts("\n");
 #endif
@@ -1440,5 +1470,5 @@
         {
             boot_puts("\n[BOOT ERROR] Missing RAM pseg in cluster ");
-            boot_putw( cluster_id );
+            boot_putd( cluster_id );
             boot_puts("\n");
             boot_exit();
@@ -1459,7 +1489,7 @@
 #if BOOT_DEBUG_SCHED
 boot_puts("\nProc ");
-boot_putw( proc_id );
+boot_putd( proc_id );
 boot_puts(" : scheduler pbase = ");
-boot_putw( pseg_pbase + (proc_id<<12) );
+boot_putx( pseg_pbase + (proc_id<<12) );
 boot_puts("\n");
 #endif
@@ -1488,11 +1518,11 @@
 #if BOOT_DEBUG_SCHED
 boot_puts("- IRQ : icu = ");
-boot_putw( icu_id );
+boot_putd( icu_id );
 boot_puts(" / type = ");
-boot_putw( type );
+boot_putd( type );
 boot_puts(" / isr = ");
-boot_putw( isr_id );
+boot_putd( isr_id );
 boot_puts(" / channel = ");
-boot_putw( channel );
+boot_putd( channel );
 boot_puts("\n");
 #endif
@@ -1627,7 +1657,7 @@
             {
                 boot_puts("\n[BOOT ERROR] : ");
-                boot_putw( ltid );
+                boot_putd( ltid );
                 boot_puts(" tasks allocated to processor ");
-                boot_putw( gpid );
+                boot_putd( gpid );
                 boot_puts(" / max is 15\n");
                 boot_exit();
@@ -1659,51 +1689,51 @@
 boot_puts( task[task_id].name );
 boot_puts(" allocated to processor ");
-boot_putw( gpid );
+boot_putd( gpid );
 boot_puts("  - ctx[LTID]   = ");
-boot_putw( ltid );
+boot_putd( ltid );
 boot_puts("\n");
 
 boot_puts("  - ctx[SR]     = ");
-boot_putw( ctx_sr );
+boot_putx( ctx_sr );
 boot_puts("\n");
 
 boot_puts("  - ctx[SR]     = ");
-boot_putw( ctx_sp );
+boot_putx( ctx_sp );
 boot_puts("\n");
 
 boot_puts("  - ctx[RA]     = ");
-boot_putw( ctx_ra );
+boot_putx( ctx_ra );
 boot_puts("\n");
 
 boot_puts("  - ctx[EPC]    = ");
-boot_putw( ctx_epc );
+boot_putx( ctx_epc );
 boot_puts("\n");
 
 boot_puts("  - ctx[PTPR]   = ");
-boot_putw( ctx_ptpr );
+boot_putx( ctx_ptpr );
 boot_puts("\n");
 
 boot_puts("  - ctx[TTY]    = ");
-boot_putw( ctx_tty );
+boot_putd( ctx_tty );
 boot_puts("\n");
 
 boot_puts("  - ctx[NIC]    = ");
-boot_putw( ctx_nic );
+boot_putd( ctx_nic );
 boot_puts("\n");
 
 boot_puts("  - ctx[TIMER]  = ");
-boot_putw( ctx_timer );
+boot_putd( ctx_timer );
 boot_puts("\n");
 
 boot_puts("  - ctx[FBDMA]  = ");
-boot_putw( ctx_fbdma );
+boot_putd( ctx_fbdma );
 boot_puts("\n");
 
 boot_puts("  - ctx[PTAB]   = ");
-boot_putw( ctx_ptab );
+boot_putx( ctx_ptab );
 boot_puts("\n");
 
 boot_puts("  - ctx[VSID]   = ");
-boot_putw( vspace_id );
+boot_putd( vspace_id );
 boot_puts("\n");
 
@@ -1732,5 +1762,5 @@
 
     boot_puts("\n[BOOT] Mapping check completed at cycle ");
-    boot_putw( boot_proctime() );
+    boot_putd( boot_proctime() );
     boot_puts("\n");
 
@@ -1739,5 +1769,5 @@
 
     boot_puts("\n[BOOT] Pseg allocators initialisation completed at cycle ");
-    boot_putw( boot_proctime() );
+    boot_putd( boot_proctime() );
     boot_puts("\n");
 
@@ -1746,5 +1776,5 @@
 
     boot_puts("\n[BOOT] Page Tables initialisation completed at cycle ");
-    boot_putw( boot_proctime() );
+    boot_putd( boot_proctime() );
     boot_puts("\n");
 
@@ -1753,5 +1783,5 @@
 
     boot_puts("\n[BOOT] Vobjs initialisation completed at cycle : ");
-    boot_putw( boot_proctime() );
+    boot_putd( boot_proctime() );
     boot_puts("\n");
 
@@ -1760,5 +1790,5 @@
 
     boot_puts("\n[BOOT] Peripherals initialisation completed at cycle ");
-    boot_putw( boot_proctime() );
+    boot_putd( boot_proctime() );
     boot_puts("\n");
 
@@ -1768,5 +1798,5 @@
 
     boot_puts("\n[BOOT] MMU activation completed at cycle ");
-    boot_putw( boot_proctime() );
+    boot_putd( boot_proctime() );
     boot_puts("\n");
 
@@ -1775,5 +1805,5 @@
 
     boot_puts("\n[BOOT] Schedulers initialisation completed at cycle ");
-    boot_putw( boot_proctime() );
+    boot_putd( boot_proctime() );
     boot_puts("\n");
 
Index: soft/giet_vm/boot/reset.S
===================================================================
--- soft/giet_vm/boot/reset.S	(revision 203)
+++ soft/giet_vm/boot/reset.S	(revision 204)
@@ -65,5 +65,5 @@
     nop
     mfc0	a0,	CP0_TIME
-	jal		boot_putw
+	jal		boot_putx
 	nop
     la		a0,	boot_lf_string
@@ -76,5 +76,5 @@
     mfc0	k0,	CP0_PROCID
     andi	a0,	k0,	0xFFF
-	jal		boot_putw
+	jal		boot_putx
     nop
     la		a0,	boot_lf_string
@@ -86,5 +86,5 @@
     nop
     mfc0	a0,	CP0_EPC
-	jal		boot_putw
+	jal		boot_putx
     nop
     la		a0,	boot_lf_string
@@ -96,5 +96,5 @@
     nop
     mfc0	a0,	CP0_CR
-	jal		boot_putw
+	jal		boot_putx
     nop
     la		a0,	boot_lf_string
@@ -106,5 +106,5 @@
     nop
     mfc0	a0,	CP0_SR
-	jal		boot_putw
+	jal		boot_putx
     nop
     la		a0,	boot_lf_string
@@ -116,5 +116,5 @@
     nop
     mfc0	a0,	CP0_BVAR
-	jal		boot_putw
+	jal		boot_putx
     nop
     la		a0,	boot_lf_string
Index: soft/giet_vm/giet_config.h
===================================================================
--- soft/giet_vm/giet_config.h	(revision 203)
+++ soft/giet_vm/giet_config.h	(revision 204)
@@ -12,11 +12,11 @@
 /* Debug parameters */
 
-#define BOOT_DEBUG_PERI     0       /* display peripherals initialisation on TTY0 */
-#define BOOT_DEBUG_PT		0	    /* display page tables initialisation on TTY0 */
-#define BOOT_DEBUG_VOBJS	0		/* display vobjs initialisation on TTY0 */
-#define BOOT_DEBUG_SCHED 	0		/* display schedulers initialisation on TTY0 */
+#define BOOT_DEBUG_PERI     0			/* trace peripherals initialisation on TTY0 */
+#define BOOT_DEBUG_PT		0			/* trace page tables initialisation on TTY0 */
+#define BOOT_DEBUG_VOBJS	0			/* trace vobjs initialisation on TTY0 */
+#define BOOT_DEBUG_SCHED 	0			/* trace schedulers initialisation on TTY0 */
 
-#define GIET_DEBUG_INIT		0		/* display parallel kernel initialisation on TTY0 */
-#define GIET_DEBUG_SWITCH	0	    /* display context switchs on TTY0 */
+#define GIET_DEBUG_INIT		0			/* trace parallel kernel initialisation on TTY0 */
+#define GIET_DEBUG_SWITCH	0			/* trace context switchs on TTY0 */
 
 
@@ -25,19 +25,21 @@
 /* hardware parameters */
 
-#define NB_CLUSTERS 		1	    /* number of clusters */
-#define CLUSTER_SPAN		0	    /* address increment between clusters */
-#define NB_PROCS_MAX	    4	    /* max number of processors per cluster */
-#define NB_TIMERS_MAX		0 	    /* max number of user timers per cluster */
-#define NB_DMAS_MAX			1	    /* max number of DMA channels per cluster*/
-#define NB_TTYS				8	    /* total number of TTY channels */
-#define NB_IOCS				0	    /* total number of IOC channels */
-#define NB_NICS				0	    /* total number of NIC channels */
+#define NB_CLUSTERS 		1			/* number of clusters */
+#define CLUSTER_SIZE		0x40000000	/* address increment between clusters */
+#define CLUSTER_IO_ID       0			/* cluster containing non replicated peripherals */
+	
+#define NB_PROCS_MAX	    4			/* max number of processors per cluster */
+#define NB_TIMERS_MAX		0			/* max number of user timers per cluster */
+#define NB_DMAS_MAX			1			/* max number of DMA channels per cluster*/
+#define NB_TTYS				8			/* total number of TTY channels */
+#define NB_IOCS				0			/* total number of IOC channels */
+#define NB_NICS				0			/* total number of NIC channels */
 
 /* software parameters */
 
-#define GIET_NB_VSPACE_MAX	4	    /* max number of virtual spaces */
-#define GIET_TICK_VALUE	    0x4000  /* context switch period (number of cycles) */
-#define GIET_IOMMU_ACTIVE   0		/* The IOMMU vspace is defined */
-#define GIET_USE_XICU       1		/* Use the XICU interrupt controler */
+#define GIET_NB_VSPACE_MAX	4			/* max number of virtual spaces */
+#define GIET_TICK_VALUE	    0x4000		/* context switch period (number of cycles) */
+#define GIET_IOMMU_ACTIVE   0			/* The IOMMU vspace is defined */
+#define GIET_USE_XICU       1			/* Use the XICU interrupt controler */
 
 #endif
Index: soft/giet_vm/libs/stdio.c
===================================================================
--- soft/giet_vm/libs/stdio.c	(revision 203)
+++ soft/giet_vm/libs/stdio.c	(revision 204)
@@ -21,6 +21,4 @@
 #define SYSCALL_GCD_WRITE       0x06
 #define SYSCALL_GCD_READ        0x07
-#define SYSCALL_TTY_READ_IRQ    0x0A
-#define SYSCALL_TTY_WRITE_IRQ   0x0B
 #define SYSCALL_CTX_SWITCH      0x0D
 #define SYSCALL_EXIT            0x0E
@@ -165,25 +163,4 @@
                     0,0);
 }
-
-////////////////////////////////////////////////////////////////////////////////////
-// giet_tty_getc_no_irq()
-////////////////////////////////////////////////////////////////////////////////////
-// This blocking function fetches a single ascii character from a terminal.
-// The terminal index must be defined in the task context in the boot phase.
-// It doesn't use the IRQ_GET interrupt, and the associated kernel buffer.
-// - Returns necessarily 0 when completed.
-////////////////////////////////////////////////////////////////////////////////////
-unsigned int giet_tty_getc_no_irq(char *byte)
-{
-    unsigned int ret = 0;
-    while (ret == 0)
-    {
-        ret = sys_call(SYSCALL_TTY_READ,
-                       (unsigned int)byte,
-                       1,
-                       0,0);
-    }
-    return 0;
-}
 ////////////////////////////////////////////////////////////////////////////////////
 // giet_tty_getc()
@@ -199,5 +176,5 @@
     while (ret == 0)
     {
-        ret = sys_call(SYSCALL_TTY_READ_IRQ,
+        ret = sys_call(SYSCALL_TTY_READ,
                        (unsigned int)byte,
                        1,
@@ -231,5 +208,5 @@
     {
         do {
-            ret = sys_call(SYSCALL_TTY_READ_IRQ,
+            ret = sys_call(SYSCALL_TTY_READ,
                            (unsigned int)(&byte),
                            1,
@@ -283,5 +260,5 @@
     {
         do {
-            ret = sys_call(SYSCALL_TTY_READ_IRQ,
+            ret = sys_call(SYSCALL_TTY_READ,
                            (unsigned int)(&byte),
                            1,
Index: soft/giet_vm/sys/drivers.c
===================================================================
--- soft/giet_vm/sys/drivers.c	(revision 203)
+++ soft/giet_vm/sys/drivers.c	(revision 204)
@@ -17,4 +17,6 @@
 //
 // The following global parameters must be defined in the giet_config.h file:
+// - CLUSTER_IO_ID
+// - CLUSTER_SIZE
 // - NB_CLUSTERS   
 // - NB_PROCS_MAX  
@@ -23,5 +25,5 @@
 // - NB_TTYS    
 //
-// The following virtual base addresses must be defined in the sys.ld file:
+// The following virtual base addresses must be defined in the giet.ld file:
 // - seg_icu_base
 // - seg_tim_base
@@ -31,4 +33,7 @@
 // - seg_fbf_base
 // - seg_ioc_base
+// As some peripherals can be replicated in the clusters (ICU, TIMER, DMA)
+// These addresses must be completed by an offset depending on the cluster index
+//    full_base_address = seg_***_base + cluster_id * CLUSTER_SIZE
 ///////////////////////////////////////////////////////////////////////////////////
 
@@ -54,6 +59,6 @@
 #endif
 
-#if !defined(CLUSTER_SPAN) 
-# error: You must define CLUSTER_SPAN in 'giet_config.h' file
+#if !defined(CLUSTER_SIZE) 
+# error: You must define CLUSTER_SIZE in 'giet_config.h' file
 #endif
 
@@ -132,11 +137,11 @@
 
 #if GIET_USE_XICU
-    unsigned int* timer_address = (unsigned int*)&seg_icu_base +
-                                  (cluster_id * CLUSTER_SPAN);
+    unsigned int* timer_address = (unsigned int*)((char*)&seg_icu_base +
+                                  (cluster_id * CLUSTER_SIZE) );
 
     timer_address[XICU_REG(XICU_PTI_PER, local_id)] = period;
 #else
-    unsigned int* timer_address = (unsigned int*)&seg_tim_base + 
-                                  (cluster_id * CLUSTER_SPAN);
+    unsigned int* timer_address = (unsigned int*)((char*)&seg_tim_base + 
+                                  (cluster_id * CLUSTER_SIZE) );
 
     timer_address[local_id * TIMER_SPAN + TIMER_PERIOD] = period;
@@ -160,11 +165,11 @@
 
 #if GIET_USE_XICU
-    unsigned int* timer_address = (unsigned int*)&seg_icu_base +
-                                  (cluster_id * CLUSTER_SPAN);
+    unsigned int* timer_address = (unsigned int*)((char*)&seg_icu_base +
+                                  (cluster_id * CLUSTER_SIZE) );
 
     timer_address[XICU_REG(XICU_PTI_PER, local_id)] = 0;
 #else
-    unsigned int* timer_address = (unsigned int*)&seg_tim_base + 
-                                  (cluster_id * CLUSTER_SPAN);
+    unsigned int* timer_address = (unsigned int*)((char*)&seg_tim_base + 
+                                  (cluster_id * CLUSTER_SIZE) );
 
     timer_address[local_id * TIMER_SPAN + TIMER_MODE] = 0;
@@ -176,5 +181,5 @@
 //     _timer_reset_irq()
 // This function acknowlegge a timer interrupt in the vci_timer (or vci_xicu) 
-// component by writing in the proper register the period value.
+// component by reading/writing in the proper register.
 // It can be used by both the isr_switch() for a "system" timer, 
 // or by the _isr_timer() for an "user" timer.
@@ -189,11 +194,12 @@
 
 #if GIET_USE_XICU
-    unsigned int* timer_address = (unsigned int*)&seg_icu_base +
-                                  (cluster_id * CLUSTER_SPAN);
+    unsigned int* timer_address = (unsigned int*)((char*)&seg_icu_base +
+                                  (cluster_id * (unsigned)CLUSTER_SIZE) );
 
     unsigned int bloup = timer_address[XICU_REG(XICU_PTI_ACK, local_id)];
+    bloup++;	// to avoid a warning 
 #else
-    unsigned int* timer_address = (unsigned int*)&seg_tim_base + 
-                                  (cluster_id * CLUSTER_SPAN);
+    unsigned int* timer_address = (unsigned int*)((char*)&seg_tim_base + 
+                                  (cluster_id * CLUSTER_SIZE) );
 
     timer_address[local_id * TIMER_SPAN + TIMER_RESETIRQ] = 0;
@@ -258,28 +264,31 @@
     }
 
-    unsigned int*	tty_address = (unsigned int*)&seg_tty_base + tty_id*TTY_SPAN;
+    unsigned int*	tty_address = (unsigned int*)( (char*)&seg_tty_base + 
+                                  (CLUSTER_IO_ID * (unsigned)CLUSTER_SIZE) ); 
 
     for (nwritten = 0; nwritten < length; nwritten++)
     {
         // check tty's status 
-        if ((tty_address[TTY_STATUS] & 0x2) == 0x2)
+        if ((tty_address[tty_id*TTY_SPAN + TTY_STATUS] & 0x2) == 0x2)
             break;
         else
             // write character 
-            tty_address[TTY_WRITE] = (unsigned int)buffer[nwritten];
+            tty_address[tty_id*TTY_SPAN + TTY_WRITE] = (unsigned int)buffer[nwritten];
     }
     return nwritten;
 }
 //////////////////////////////////////////////////////////////////////////////
-//      _tty_read_irq()
+//      _tty_read()
 // This non-blocking function uses the TTY_GET_IRQ[tty_id] interrupt and 
 // the associated kernel buffer, that has been written by the ISR.
+// It get the TTY terminal index from the context of the current task.
 // It fetches one single character from the _tty_get_buf[tty_id] kernel
 // buffer, writes this character to the user buffer, and resets the
 // _tty_get_full[tty_id] buffer.
+// The length argument is not used.
 // Returns 0 if the kernel buffer is empty, 1 if the buffer is full.
 //////////////////////////////////////////////////////////////////////////////
-unsigned int _tty_read_irq( char			*buffer, 
-                            unsigned int	length)
+unsigned int _tty_read( char			*buffer, 
+                        unsigned int	length)
 {
     unsigned int task_id  = _get_current_task_id();
@@ -304,33 +313,22 @@
 } 
 ////////////////////////////////////////////////////////////////////////////////
-//     _tty_read()
-// This non-blocking function fetches one character directly from the TTY_READ 
-// register of the TTY controler, and writes this character to the user buffer.
-// It doesn't use the TTY_GET_IRQ interrupt and the associated kernel buffer.
-// Returns 0 if the register is empty, 1 if the register is full.
-////////////////////////////////////////////////////////////////////////////////
-unsigned int _tty_read( char			*buffer, 
-                        unsigned int	length)
-{
-    unsigned int task_id  = _get_current_task_id();
-    unsigned int tty_id   = _get_context_slot(task_id, CTX_TTY_ID);
-
-    if ( tty_id >= NB_TTYS )
-    {
-        _tty_error( task_id );
-        return 0;
-    }
-
-    unsigned int*	tty_address = (unsigned int*)&seg_tty_base + tty_id*TTY_SPAN;
-
-    if ((tty_address[TTY_STATUS] & 0x1) != 0x1) 
-    {
-        return 0;
-    }
-    else
-    {
-        *buffer = (char)tty_address[TTY_READ];
-        return 1;
-    }
+//     _tty_get_char()
+// This function is used by the _isr_tty to read a character in the TTY
+// terminal defined by the tty_id argument. The character is stored
+// in requested buffer, and the IRQ is acknowledged.
+// Returns 0 if success, 1 if tty_id too large. 
+////////////////////////////////////////////////////////////////////////////////
+unsigned int _tty_get_char( unsigned int	tty_id,
+                            char*           buffer )
+{
+    // checking argument
+    if ( tty_id >= NB_TTYS ) return 1;
+
+    // compute terminal base address 
+    unsigned int *tty_address = (unsigned int*)( (char*)&seg_tty_base + 
+                                (CLUSTER_IO_ID * (unsigned)CLUSTER_SIZE) );
+
+    *buffer = (unsigned char)tty_address[tty_id*TTY_SPAN + TTY_READ];
+    return 0;
 }
 
@@ -359,6 +357,6 @@
     if ( proc_id    >= NB_PROCS_MAX )   return 1;
 
-    unsigned int* icu_address = (unsigned int*)&seg_icu_base + 
-                                (cluster_id * CLUSTER_SPAN);
+    unsigned int* icu_address = (unsigned int*)( (char*)&seg_icu_base + 
+                                (cluster_id * (unsigned)CLUSTER_SIZE) );
 #if GIET_USE_XICU
     if ( is_timer ) icu_address[XICU_REG(XICU_MSK_PTI_ENABLE, proc_id)] = value;
@@ -385,6 +383,6 @@
     if ( proc_id    >= NB_PROCS_MAX )   return 1;
 
-    unsigned int* icu_address = (unsigned int*)&seg_icu_base + 
-                                (cluster_id * CLUSTER_SPAN);
+    unsigned int* icu_address = (unsigned int*)( (char*)&seg_icu_base + 
+                                (cluster_id * (unsigned)CLUSTER_SIZE) );
 #if GIET_USE_XICU
     unsigned int prio   = icu_address[XICU_REG(XICU_PRIO, proc_id)];
@@ -422,11 +420,10 @@
                          unsigned int value)
 {
-    volatile unsigned int *gcd_address;
-
     // parameters checking
     if (register_index >= GCD_END)
         return 1;
 
-    gcd_address = (unsigned int*)&seg_gcd_base;
+    unsigned int* gcd_address = (unsigned int*)( (char*)&seg_gcd_base +
+                                (CLUSTER_IO_ID * (unsigned)CLUSTER_SIZE) );
 
     gcd_address[register_index] = value; // write word
@@ -441,11 +438,10 @@
                         unsigned int *buffer)
 {
-    volatile unsigned int *gcd_address;
-
     // parameters checking 
     if (register_index >= GCD_END)
         return 1;
 
-    gcd_address = (unsigned int*)&seg_gcd_base;
+    unsigned int* gcd_address = (unsigned int*)( (char*)&seg_gcd_base +
+                                (CLUSTER_IO_ID * (unsigned)CLUSTER_SIZE) );
 
     *buffer = gcd_address[register_index]; // read word
@@ -538,5 +534,7 @@
     if ( (unsigned int)user_vaddr & 0x3 ) return 1;
 
-    unsigned int*	ioc_address = (unsigned int*)&seg_ioc_base;
+    unsigned int*	ioc_address = (unsigned int*)( (char*)&seg_ioc_base +
+                                  (CLUSTER_IO_ID * (unsigned)CLUSTER_SIZE) );
+
     unsigned int	block_size   = ioc_address[BLOCK_DEVICE_BLOCK_SIZE];
     unsigned int	length       = count*block_size;
@@ -630,5 +628,6 @@
     if ( GIET_IOMMU_ACTIVE )
     {
-        unsigned int* iob_address = (unsigned int*)&seg_iob_base;
+        unsigned int* iob_address = (unsigned int*)( (char*)&seg_iob_base +
+                                    (CLUSTER_IO_ID * (unsigned)CLUSTER_SIZE) );
 
         for ( ix2 = 0 ; ix2 < _ioc_iommu_npages ; ix2++ )
@@ -687,4 +686,18 @@
                         (unsigned int)buffer,
                         count );
+}
+///////////////////////////////////////////////////////////////////////////////
+//     _ioc_get_status()
+// This function returns the transfert status, and acknowledge the IRQ.
+// Returns 0 if success, > 0 if error.
+///////////////////////////////////////////////////////////////////////////////
+unsigned int _ioc_get_status(unsigned int* status)
+{
+    // get IOC base address
+    unsigned int* ioc_address = (unsigned int*)( (char*)&seg_ioc_base +
+                                (CLUSTER_IO_ID * (unsigned)CLUSTER_SIZE) );
+
+    *status = ioc_address[BLOCK_DEVICE_STATUS]; // read status & reset IRQ 
+    return 0;
 }
 
@@ -718,4 +731,40 @@
 in_unckdata unsigned int            _dma_iommu_npages[NB_DMAS_MAX * NB_CLUSTERS];
 #endif
+
+//////////////////////////////////////////////////////////////////////////////////
+// _dma_reset_irq()
+//////////////////////////////////////////////////////////////////////////////////
+unsigned int _dma_reset_irq( unsigned int	cluster_id,
+                             unsigned int	local_id )
+{
+    // parameters checking 
+    if ( cluster_id >= NB_CLUSTERS ) return 1;
+    if ( local_id >= NB_DMAS_MAX )   return 1;
+
+    // compute DMA base address
+    unsigned int*	dma_address = (unsigned int*)( (char*)&seg_dma_base + 
+                                  (cluster_id * (unsigned)CLUSTER_SIZE) );
+
+    dma_address[local_id*DMA_SPAN + DMA_RESET] = 0;			
+    return 0;
+}
+//////////////////////////////////////////////////////////////////////////////////
+// _dma_get_status()
+//////////////////////////////////////////////////////////////////////////////////
+unsigned int _dma_get_status( unsigned int	cluster_id,
+                              unsigned int	local_id,
+                              unsigned int* status )
+{
+    // parameters checking 
+    if ( cluster_id >= NB_CLUSTERS ) return 1;
+    if ( local_id >= NB_DMAS_MAX )   return 1;
+
+    // compute DMA base address
+    unsigned int*	dma_address = (unsigned int*)( (char*)&seg_dma_base + 
+                                  (cluster_id * (unsigned)CLUSTER_SIZE) );
+    
+    *status = dma_address[local_id*DMA_SPAN + DMA_LEN];
+    return 0;
+}
 
 //////////////////////////////////////////////////////////////////////////////////
@@ -819,8 +868,8 @@
     unsigned int    cluster_id = dma_id / NB_DMAS_MAX;
     unsigned int    loc_id     = dma_id % NB_DMAS_MAX;
-    unsigned int*	dma_base   = (unsigned int*)&seg_dma_base +
-                                 (cluster_id * CLUSTER_SPAN) + 
-                                 (loc_id * DMA_SPAN);
-
+
+    unsigned int*	dma_base   = (unsigned int*)( (char*)&seg_dma_base +
+                                 (cluster_id * (unsigned)CLUSTER_SIZE) );
+ 
     // check user buffer address and length alignment
     if ( (user_vaddr & 0x3) || (length & 0x3) )
@@ -930,4 +979,5 @@
 
 */
+
     // invalidate data cache in case of memory write
     if ( to_user ) _dcache_buf_invalidate( (void*)user_vaddr, length );
@@ -939,13 +989,13 @@
     if ( to_user )
     {
-        dma_base[DMA_SRC] = (unsigned int)fb_pbase;
-        dma_base[DMA_DST] = (unsigned int)user_pbase;
+        dma_base[loc_id*DMA_SPAN + DMA_SRC] = (unsigned int)fb_pbase;
+        dma_base[loc_id*DMA_SPAN + DMA_DST] = (unsigned int)user_pbase;
     }
     else
     {
-        dma_base[DMA_SRC] = (unsigned int)user_pbase;
-        dma_base[DMA_DST] = (unsigned int)fb_pbase;
-    }
-    dma_base[DMA_LEN] = (unsigned int)length;
+        dma_base[loc_id*DMA_SPAN + DMA_SRC] = (unsigned int)user_pbase;
+        dma_base[loc_id*DMA_SPAN + DMA_DST] = (unsigned int)fb_pbase;
+    }
+    dma_base[loc_id*DMA_SPAN + DMA_LEN] = (unsigned int)length;
     
     return 0;
@@ -1011,5 +1061,7 @@
     if ( GIET_IOMMU_ACTIVE )
     {
-        unsigned int* iob_address = (unsigned int*)&seg_iob_base;
+        unsigned int* iob_address = (unsigned int*)( (char*)&seg_iob_base +
+                                    (CLUSTER_IO_ID * (unsigned)CLUSTER_SIZE) );
+
         unsigned int  ix1         = _dma_iommu_ix1 + dma_id;
         unsigned int  ix2;
Index: soft/giet_vm/sys/drivers.h
===================================================================
--- soft/giet_vm/sys/drivers.h	(revision 203)
+++ soft/giet_vm/sys/drivers.h	(revision 204)
@@ -40,6 +40,6 @@
                             unsigned int	length);
 
-unsigned int _tty_read_irq( char*			buffer, 
-                            unsigned int	length);
+unsigned int _tty_get_char( unsigned int	tty_id,
+                            char*			buffer); 
 
 ///////////////////////////////////////////////////////////////////////////////////
@@ -77,4 +77,6 @@
 unsigned int _ioc_completed();
 
+unsigned int _ioc_get_status( unsigned int* status);
+
 ///////////////////////////////////////////////////////////////////////////////////
 // Multi DMA variables			(vci_multi_dma)
@@ -86,4 +88,11 @@
 extern unsigned int				_dma_iommu_ix1;
 extern unsigned int				_dma_iommu_npages[];
+
+unsigned int _dma_reset_irq( unsigned int	cluster_id,
+                             unsigned int	local_id );
+
+unsigned int _dma_get_status( unsigned int	cluster_id,
+                              unsigned int	local_id,
+                              unsigned int*	status );
 
 ///////////////////////////////////////////////////////////////////////////////////
Index: soft/giet_vm/sys/irq_handler.c
===================================================================
--- soft/giet_vm/sys/irq_handler.c	(revision 203)
+++ soft/giet_vm/sys/irq_handler.c	(revision 204)
@@ -92,16 +92,23 @@
     // compute cluster_id and loc_id
     unsigned int cluster_id = channel_id / NB_DMAS_MAX;
-    unsigned int loc_id     = channel_id % NB_DMAS_MAX;
-
-    // compute DMA channel address
-    unsigned int*	dma_address = (unsigned int*)&seg_dma_base + 
-                                  (loc_id * DMA_SPAN) +
-                                  (cluster_id * CLUSTER_SPAN);
+    unsigned int local_id   = channel_id % NB_DMAS_MAX;
 
     // save DMA channel status  
-    _dma_status[channel_id] = dma_address[DMA_LEN];
-
-    // reset DMA channel
-    dma_address[DMA_RESET] = 0;			
+    if ( _dma_get_status(cluster_id, local_id, &_dma_status[channel_id]) )
+    {
+        _get_lock(&_tty_put_lock);
+        _puts("[GIET ERROR] illegal DMA channel detected by _isr_dma\n");
+        _release_lock(&_tty_put_lock);
+        return;
+    }
+
+    // reset DMA channel irq
+    if ( _dma_reset_irq(cluster_id, local_id) )
+    {
+        _get_lock(&_tty_put_lock);
+        _puts("[GIET ERROR] illegal DMA channel detected by _isr_dma\n");
+        _release_lock(&_tty_put_lock);
+        return;
+    }
 
     // release DMA channel 
@@ -117,8 +124,15 @@
 void _isr_ioc()
 {
-    unsigned int* ioc_address = (unsigned int*)&seg_ioc_base;
-
-    _ioc_status = ioc_address[BLOCK_DEVICE_STATUS]; // save status & reset IRQ 
-    _ioc_done   = 1;                                // signals completion 
+     // save status & reset IRQ 
+    if ( _ioc_get_status( &_ioc_status ) )
+    {
+        _get_lock(&_tty_put_lock);
+        _puts("[GIET ERROR] bad access to IOC status detected by _isr_ioc\n");
+        _release_lock(&_tty_put_lock);
+        return;
+    }
+
+    // signals completion 
+    _ioc_done   = 1; 
 }
 
@@ -148,8 +162,15 @@
         _puts("[GIET ERROR] Strange... User timer ISR for a system timer\n");
         _release_lock(&_tty_put_lock);
+        return;
     }
 
     // aknowledge IRQ 
-    _timer_reset_irq( cluster_id, local_id );
+    if ( _timer_reset_irq( cluster_id, local_id ) )
+    {
+        _get_lock(&_tty_put_lock);
+        _puts("[GIET ERROR] illegal timer index detected by _isr_timer\n");
+        _release_lock(&_tty_put_lock);
+        return;
+    }
 
 #if NB_TIMERS_MAX
@@ -172,6 +193,6 @@
 // This ISR handles the IRQs generated by the multi_tty controler,
 // signaling that a character is available.
-// There is one single multi_tty component controling all TTYs, and the tty_id 
-// argument is the global TTY index.
+// There is one single multi_tty component controling all TTYs, 
+// and the tty_id // argument is the global TTY index.
 // There is one communication buffer _tty_buf[tty_id] per terminal.
 // The sychronisation variable _tty_full[tty_id], is set by the ISR,
@@ -181,9 +202,12 @@
 void _isr_tty(unsigned int tty_id)
 {
-    // compute terminal base address 
-    unsigned int *tty_address = (unsigned int*)&seg_tty_base + (tty_id * TTY_SPAN);
-
     // save character and reset IRQ 
-    _tty_get_buf[tty_id] = (unsigned char)tty_address[TTY_READ];
+    if ( _tty_get_char( tty_id, &_tty_get_buf[tty_id] ) )
+    {
+        _get_lock(&_tty_put_lock);
+        _puts("[GIET ERROR] illegal tty index detected by _isr_tty\n");
+        _release_lock(&_tty_put_lock);
+        return;
+    }
 
     // signals character available 
@@ -207,5 +231,11 @@
 
     // acknowledge IRQ
-    _timer_reset_irq( cluster_id, local_id ); 
+    if ( _timer_reset_irq( cluster_id, local_id ) ) 
+    {
+        _get_lock(&_tty_put_lock);
+        _puts("[GIET ERROR] illegal proc index detected by _isr_switch\n");
+        _release_lock(&_tty_put_lock);
+        return;
+    }
 
     // performs the context switch
Index: soft/giet_vm/sys/sys_handler.c
===================================================================
--- soft/giet_vm/sys/sys_handler.c	(revision 203)
+++ soft/giet_vm/sys/sys_handler.c	(revision 204)
@@ -32,5 +32,5 @@
     &_sys_ukn,          /* 0x08 */
     &_sys_ukn,          /* 0x09 */
-    &_tty_read_irq,     /* 0x0A */
+    &_sys_ukn,          /* 0x0A */
     &_sys_ukn,          /* 0x0B */
     &_sys_ukn,          /* 0x0C */
Index: soft/giet_vm/xml/xml_driver.c
===================================================================
--- soft/giet_vm/xml/xml_driver.c	(revision 203)
+++ soft/giet_vm/xml/xml_driver.c	(revision 204)
@@ -218,9 +218,8 @@
     fprintf( fpout, "<?xml version = \"1.0\"?>\n\n");
 
-    fprintf( fpout, "<mapping_info signature = \"0x%x\"\n", header->signature);
-    fprintf( fpout, "              name      = \"%s\"\n", header->name);
-    fprintf( fpout, "              clusters  = \"%d\"\n", header->clusters);
-    fprintf( fpout, "              vspaces   = \"%d\"\n", header->vspaces);
-    fprintf( fpout, "              globals   = \"%d\" >\n\n", header->globals);
+    fprintf( fpout, "<mapping_info signature = \"0x%x\" ", header->signature);
+    fprintf( fpout, " name = \"%s\" ", header->name);
+    fprintf( fpout, " clusters = \"%d\" ", header->clusters);
+    fprintf( fpout, " vspaces = \"%d\" >\n\n", header->vspaces);
 
     ///////////////////// clusters ///////////////////////////////////////////////
@@ -231,11 +230,11 @@
         fprintf( fpout, "        <cluster index  = \"%d\" >\n",   cluster_id);
         for ( pseg_id = cluster[cluster_id].pseg_offset ; 
-                pseg_id < cluster[cluster_id].pseg_offset + cluster[cluster_id].psegs ; 
-                    pseg_id++ )
-        {
-            fprintf( fpout, "                 <pseg    name   = \"%s\"\n",        pseg[pseg_id].name);
-            fprintf( fpout, "                          type   = \"%s\"\n",  pseg_type[pseg[pseg_id].type]);
-            fprintf( fpout, "                          base   = \"0x%x\"\n",      pseg[pseg_id].base);
-            fprintf( fpout, "                          length = \"0x%x\" />\n",   pseg[pseg_id].length);
+              pseg_id < cluster[cluster_id].pseg_offset + cluster[cluster_id].psegs ; 
+              pseg_id++ )
+        {
+            fprintf( fpout, "            <pseg name = \"%s\" ", pseg[pseg_id].name);
+            fprintf( fpout, " type = \"%s\" ", pseg_type[pseg[pseg_id].type]);
+            fprintf( fpout, " base = \"0x%x\" ", pseg[pseg_id].base);
+            fprintf( fpout, " length = \"0x%x\" />\n",   pseg[pseg_id].length);
         }
 
@@ -243,16 +242,18 @@
 
         for ( proc_id = cluster[cluster_id].proc_offset ; 
-                proc_id < cluster[cluster_id].proc_offset + cluster[cluster_id].procs ;
-                    proc_id++ )
-        {
-            fprintf( fpout, "                   <proc index   = \"%d\" >\n",       proc_id);
-            for ( irq_id = proc[proc_id].irq_offset ; irq_id < proc[proc_id].irq_offset + proc[proc_id].irqs ; irq_id++ )
+              proc_id < cluster[cluster_id].proc_offset + cluster[cluster_id].procs ;
+              proc_id++ )
+        {
+            fprintf( fpout, "            <proc index = \"%d\" >\n", proc_id);
+            for ( irq_id = proc[proc_id].irq_offset ; 
+                  irq_id < proc[proc_id].irq_offset + proc[proc_id].irqs ; 
+                  irq_id++ )
             {
-                fprintf( fpout, "                         <irq    type    = \"%s\"\n",  irq_type[irq[irq_id].type]);
-                fprintf( fpout, "                                 icuid   = \"0x%x\"\n",      irq[irq_id].icuid);
-                fprintf( fpout, "                                 isr     = \"%s\"\n",  isr_type[irq[irq_id].isr]);
-                fprintf( fpout, "                                 channel = \"0x%x\" />\n",   irq[irq_id].channel);
+                fprintf( fpout, "                <irq type = \"%s\" ", irq_type[irq[irq_id].type]);
+                fprintf( fpout, " icuid = \"0x%x\" ", irq[irq_id].icuid);
+                fprintf( fpout, " isr = \"%s\" ", isr_type[irq[irq_id].isr]);
+                fprintf( fpout, " channel = \"0x%x\" />\n", irq[irq_id].channel);
             }
-            fprintf( fpout, "                   </proc>\n" );
+            fprintf( fpout, "            </proc>\n" );
         }
 
@@ -261,17 +262,19 @@
 
         for ( coproc_id = cluster[cluster_id].coproc_offset ; 
-                coproc_id < cluster[cluster_id].coproc_offset + cluster[cluster_id].coprocs ;
-                    coproc_id++ )
-        {
-            fprintf( fpout, "                   <coproc name       = \"%s\"\n",       coproc[coproc_id].name);
-            fprintf( fpout, "                           psegname   = \"%s\" >\n",       pseg[coproc[coproc_id].psegid].name);
-            for ( port_id = coproc[coproc_id].port_offset ; port_id < coproc[coproc_id].port_offset + coproc[coproc_id].ports ; port_id++ )
+              coproc_id < cluster[cluster_id].coproc_offset + cluster[cluster_id].coprocs ;
+              coproc_id++ )
+        {
+            fprintf( fpout, "            <coproc name = \"%s\" ", coproc[coproc_id].name);
+            fprintf( fpout, " psegname = \"%s\" >\n", pseg[coproc[coproc_id].psegid].name);
+            for ( port_id = coproc[coproc_id].port_offset ; 
+                  port_id < coproc[coproc_id].port_offset + coproc[coproc_id].ports ; 
+                  port_id++ )
             {
                 unsigned int vobj_id = cp_port[port_id].vobjlocid + vspace[cp_port[port_id].vspaceid].vobj_offset; 
-                fprintf( fpout, "                           <port   direction    = \"%s\"\n",  port_direction[ cp_port[port_id].direction]);
-                fprintf( fpout, "                                   vspacename   = \"%s\"\n",  vspace[cp_port[port_id].vspaceid].name);
-                fprintf( fpout, "                                   vobjname     = \"%s\" />\n",  vobj[vobj_id].name);
+                fprintf( fpout, "             <port direction = \"%s\" ",  port_direction[ cp_port[port_id].direction]);
+                fprintf( fpout, " vspacename = \"%s\" ", vspace[cp_port[port_id].vspaceid].name);
+                fprintf( fpout, " vobjname = \"%s\" />\n",  vobj[vobj_id].name);
             }
-            fprintf( fpout, "                   </coproc>\n" );
+            fprintf( fpout, "            </coproc>\n" );
         }
 
@@ -279,10 +282,10 @@
 
         for ( periph_id = cluster[cluster_id].periph_offset ; 
-                periph_id < cluster[cluster_id].periph_offset + cluster[cluster_id].periphs ;
-                    periph_id++ )
-        {
-            fprintf( fpout, "                   <periph type       = \"%s\"\n",     periph_type[periph[periph_id].type]);
-            fprintf( fpout, "                           psegname   = \"%s\"\n",     pseg[periph[periph_id].psegid].name);
-            fprintf( fpout, "                           channels   = \"%d\" />\n",  periph[periph_id].channels);
+              periph_id < cluster[cluster_id].periph_offset + cluster[cluster_id].periphs ;
+              periph_id++ )
+        {
+            fprintf( fpout, "            <periph type = \"%s\" ", periph_type[periph[periph_id].type]);
+            fprintf( fpout, " psegname = \"%s\" ", pseg[periph[periph_id].psegid].name);
+            fprintf( fpout, " channels = \"%d\" />\n",  periph[periph_id].channels);
         }
         fprintf( fpout, "        </cluster>\n" );
@@ -297,20 +300,20 @@
         unsigned int pseg_id = vseg[vseg_id].psegid; 
 
-        fprintf( fpout, "        <vseg    name      = \"%s\"\n",      vseg[vseg_id].name);
-        fprintf( fpout, "                 vbase     = \"0x%x\"\n",    vseg[vseg_id].vbase);
-        fprintf( fpout, "                 mode      = \"%s\"\n", mode_str[vseg[vseg_id].mode]);
-        fprintf( fpout, "                 clusterid = \"%d\"\n",      pseg[pseg_id].cluster);
-        fprintf( fpout, "                 psegname  = \"%s\"\n",      pseg[pseg_id].name);
-        fprintf( fpout, "                 ident     = \"%d\" >\n",    vseg[vseg_id].ident);
+        fprintf( fpout, "        <vseg name = \"%s\" ", vseg[vseg_id].name);
+        fprintf( fpout, "vbase = \"0x%x\" ", vseg[vseg_id].vbase);
+        fprintf( fpout, "mode  = \"%s\" ", mode_str[vseg[vseg_id].mode]);
+        fprintf( fpout, "clusterid = \"%d\" ", pseg[pseg_id].cluster);
+        fprintf( fpout, "psegname = \"%s\" ", pseg[pseg_id].name);
+        fprintf( fpout, "ident = \"%d\" >\n", vseg[vseg_id].ident);
         for ( vobj_id = vseg[vseg_id].vobj_offset;
               vobj_id < (vseg[vseg_id].vobj_offset + vseg[vseg_id].vobjs); 
               vobj_id++ )
         {
-            fprintf( fpout, "                 <vobj name     = \"%s\"\n",    vobj[vobj_id].name);
-            fprintf( fpout, "                       type     = \"%s\"\n",    vobj_type[vobj[vobj_id].type]);
-            fprintf( fpout, "                       length   = \"0x%x\"\n",  vobj[vobj_id].length);
-            fprintf( fpout, "                       align    = \"%d\"\n",    vobj[vobj_id].align);
-            fprintf( fpout, "                       init     = \"%d\" \n",   vobj[vobj_id].init);
-            fprintf( fpout, "                       binpath  = \"%s\" />\n", vobj[vobj_id].binpath);
+            fprintf( fpout, "            <vobj name = \"%s\" ", vobj[vobj_id].name);
+            fprintf( fpout, "type = \"%s\" ", vobj_type[vobj[vobj_id].type]);
+            fprintf( fpout, "length = \"0x%x\" ", vobj[vobj_id].length);
+            fprintf( fpout, "align = \"%d\" ", vobj[vobj_id].align);
+            fprintf( fpout, "init = \"%d\" ", vobj[vobj_id].init);
+            fprintf( fpout, "binpath = \"%s\" />\n", vobj[vobj_id].binpath);
         }
         fprintf( fpout, "        </vseg>\n");
@@ -324,18 +327,19 @@
     {
         unsigned int func_id = vspace[vspace_id].vobj_offset + vspace[vspace_id].start_offset; 
-        fprintf( fpout, "        <vspace  name      = \"%s\"\n",     vspace[vspace_id].name); 
-        fprintf( fpout, "                 startname = \"%s\" >\n\n", vobj[func_id].name); 
+        fprintf( fpout, "        <vspace name = \"%s\" ", vspace[vspace_id].name); 
+        fprintf( fpout, " startname = \"%s\" >\n", vobj[func_id].name); 
 
         for ( vseg_id = vspace[vspace_id].vseg_offset ;
-              vseg_id < (vspace[vspace_id].vseg_offset + vspace[vspace_id].vsegs) ; vseg_id++ )
+              vseg_id < (vspace[vspace_id].vseg_offset + vspace[vspace_id].vsegs) ; 
+              vseg_id++ )
         {
             unsigned int pseg_id = vseg[vseg_id].psegid; 
 
-            fprintf( fpout, "                 <vseg name      = \"%s\"\n",      vseg[vseg_id].name);
-            fprintf( fpout, "                       vbase     = \"0x%x\"\n",    vseg[vseg_id].vbase);
-            fprintf( fpout, "                       mode      = \"%s\"\n", mode_str[vseg[vseg_id].mode]);
-            fprintf( fpout, "                       clusterid = \"%d\"\n",      pseg[pseg_id].cluster);
-            fprintf( fpout, "                       psegname  = \"%s\"\n",      pseg[pseg_id].name);
-            fprintf( fpout, "                       ident     = \"%d\" >\n",    vseg[vseg_id].ident);
+            fprintf( fpout, "            <vseg name = \"%s\" ", vseg[vseg_id].name);
+            fprintf( fpout, "vbase = \"0x%x\" ", vseg[vseg_id].vbase);
+            fprintf( fpout, "mode  = \"%s\" ", mode_str[vseg[vseg_id].mode]);
+            fprintf( fpout, "clusterid = \"%d\" ", pseg[pseg_id].cluster);
+            fprintf( fpout, "psegname = \"%s\" ", pseg[pseg_id].name);
+            fprintf( fpout, "ident = \"%d\" >\n", vseg[vseg_id].ident);
 
             for ( vobj_id = vseg[vseg_id].vobj_offset ;
@@ -343,12 +347,12 @@
                   vobj_id++ )
             {
-                fprintf( fpout, "                       <vobj name     = \"%s\"\n",    vobj[vobj_id].name);
-                fprintf( fpout, "                             type     = \"%s\" \n",   vobj_type[vobj[vobj_id].type]);
-                fprintf( fpout, "                             length   = \"0x%x\" \n", vobj[vobj_id].length);
-                fprintf( fpout, "                             align    = \"%d\" \n",   vobj[vobj_id].align);
-                fprintf( fpout, "                             init     = \"%d\" \n",   vobj[vobj_id].init);
-                fprintf( fpout, "                             binpath  = \"%s\" />\n", vobj[vobj_id].binpath);
+                fprintf( fpout, "             <vobj name = \"%s\" ", vobj[vobj_id].name);
+                fprintf( fpout, "type = \"%s\" ", vobj_type[vobj[vobj_id].type]);
+                fprintf( fpout, "length = \"0x%x\" ", vobj[vobj_id].length);
+                fprintf( fpout, "align = \"%d\" ", vobj[vobj_id].align);
+                fprintf( fpout, "init = \"%d\" ", vobj[vobj_id].init);
+                fprintf( fpout, "binpath = \"%s\" />\n", vobj[vobj_id].binpath);
             }
-            fprintf( fpout, "                 </vseg>\n");
+            fprintf( fpout, "            </vseg>\n\n");
         }
         for ( task_id = vspace[vspace_id].task_offset ;
@@ -358,13 +362,13 @@
             unsigned int vobj_id = task[task_id].vobjlocid + vspace[vspace_id].vobj_offset; 
 
-            fprintf( fpout, "                 <task name      = \"%s\"\n",      task[task_id].name);
-            fprintf( fpout, "                       clusterid = \"%d\"\n",      task[task_id].clusterid);
-            fprintf( fpout, "                       proclocid = \"%d\"\n",      task[task_id].proclocid);
-            fprintf( fpout, "                       stackname = \"%s\"\n",      vobj[vobj_id].name);
-            fprintf( fpout, "                       startid   = \"%d\"\n",      task[task_id].startid);
-            fprintf( fpout, "                       usetty    = \"%d\"\n",      task[task_id].use_tty);
-            fprintf( fpout, "                       usenic    = \"%d\"\n",      task[task_id].use_nic);
-            fprintf( fpout, "                       usetimer  = \"%d\"\n",      task[task_id].use_timer);
-            fprintf( fpout, "                       usefbma   = \"%d\" />\n\n", task[task_id].use_fbdma);
+            fprintf( fpout, "            <task name = \"%s\" ", task[task_id].name);
+            fprintf( fpout, "clusterid = \"%d\" ", task[task_id].clusterid);
+            fprintf( fpout, "proclocid = \"%d\" ", task[task_id].proclocid);
+            fprintf( fpout, "stackname = \"%s\" ", vobj[vobj_id].name);
+            fprintf( fpout, "startid = \"%d\" ", task[task_id].startid);
+            fprintf( fpout, "usetty = \"%d\" ", task[task_id].use_tty);
+            fprintf( fpout, "usenic = \"%d\" ", task[task_id].use_nic);
+            fprintf( fpout, "usetimer = \"%d\" ", task[task_id].use_timer);
+            fprintf( fpout, "usefbma = \"%d\" />\n", task[task_id].use_fbdma);
         }
         fprintf( fpout, "        </vspace>\n\n");
Index: soft/giet_vm/xml/xml_parser.c
===================================================================
--- soft/giet_vm/xml/xml_parser.c	(revision 203)
+++ soft/giet_vm/xml/xml_parser.c	(revision 204)
@@ -1565,18 +1565,10 @@
         else if ( strcmp(tag, "globalset") == 0 ) 
         {
-            // checking source file consistency
-            if ( vseg_index != header->globals )
-            {
-                printf("[XML ERROR] Wrong number of global vsegs\n");
-                exit(1);
-            }
-            else
-            {
 #if XML_PARSER_DEBUG
 printf("  end global set\n\n");
 #endif
-                vseg_loc_index = 0;
-                return;
-            }
+            header->globals = vseg_index;
+            vseg_loc_index = 0;
+            return;
         }
         else 
@@ -1703,24 +1695,4 @@
     }
 
-    ////////// get globals attribute
-    value = getIntValue(reader, "globals", &ok);
-    if ( ok )
-    {
-        if ( value >= MAX_VSEGS )
-        {
-            printf("[XML ERROR] The number of globals is larger than %d\n", MAX_VSEGS);
-            exit(1);
-        }
-#if XML_PARSER_DEBUG
-printf("  globals = %d\n", value);
-#endif
-	header->globals  = value;
-    }
-    else
-    {
-        printf("[XML ERROR] illegal or missing <globals> attribute in mapping_info_header\n");
-        exit(1);
-    }
-
     //////// initialise non replicated peripherals cluster_id
     header->tty_clusterid = 0xFFFFFFFF;
