Index: /soft/giet_vm/giet_drivers/xcu_driver.c
===================================================================
--- /soft/giet_vm/giet_drivers/xcu_driver.c	(revision 280)
+++ /soft/giet_vm/giet_drivers/xcu_driver.c	(revision 281)
@@ -54,11 +54,12 @@
 ////////////////////////////////////////////////////////////////////////////////
 //     _xcu_set_mask()
-// This function set the mask register for the XICU channel identified 
-// by the cluster index and the processor index. 
+// This function set the mask register for the XICU channel identified by the
+// cluster index and the processor index multiplied by the number of IRQ per
+// processor.
 // All '1' bits are set / all '0' bits are not modified.
 // Returns 0 if success, > 0 if error.
 ////////////////////////////////////////////////////////////////////////////////
 unsigned int _xcu_set_mask( unsigned int cluster_xy, 
-                            unsigned int proc_id,
+                            unsigned int irq_index,
                             unsigned int value,
                             unsigned int irq_type ) 
@@ -67,7 +68,7 @@
     unsigned int x = cluster_xy >> Y_WIDTH;
     unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1);
-    if (x >= X_SIZE)             return 1; 
-    if (y >= Y_SIZE)             return 1; 
-    if (proc_id >= NB_PROCS_MAX) return 1; 
+    if (x >= X_SIZE)                                     return 1; 
+    if (y >= Y_SIZE)                                     return 1; 
+    if (irq_index >= (NB_PROCS_MAX * IRQ_PER_PROCESSOR)) return 1; 
 
 #if USE_XICU
@@ -80,5 +81,5 @@
     else if (irq_type == IRQ_TYPE_SWI) func = XICU_MSK_WTI_ENABLE;
     else                               func = XICU_MSK_HWI_ENABLE;
-    xcu_address[XICU_REG(func,proc_id)] = value;
+    xcu_address[XICU_REG(func,irq_index)] = value;
     return 0;
 #else
@@ -96,9 +97,10 @@
 // - active PTI (Timer Interrupt), or
 // - active SWI (Software Interrupt).
-// The ICU channel is identified by the cluster index and the processor index.
+// The ICU channel is identified by the cluster index and the processor index
+// multiplied by the number of IRQ per processor.
 // Returns 0 if success, > 0 if error.
 ////////////////////////////////////////////////////////////////////////////////
 unsigned int _xcu_get_index( unsigned int cluster_xy, 
-                             unsigned int proc_id, 
+                             unsigned int irq_index, 
                              unsigned int * buffer) 
 {
@@ -106,7 +108,7 @@
     unsigned int x = cluster_xy >> Y_WIDTH;
     unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1);
-    if (x >= X_SIZE)             return 1; 
-    if (y >= Y_SIZE)             return 1; 
-    if (proc_id >= NB_PROCS_MAX) return 1; 
+    if (x >= X_SIZE)                                     return 1; 
+    if (y >= Y_SIZE)                                     return 1; 
+    if (irq_index >= (NB_PROCS_MAX * IRQ_PER_PROCESSOR)) return 1; 
 
 #if USE_XICU
@@ -115,5 +117,5 @@
         (cluster_xy * (unsigned int)&vseg_cluster_increment));
 
-    unsigned int prio = xcu_address[XICU_REG(XICU_PRIO, proc_id)];
+    unsigned int prio = xcu_address[XICU_REG(XICU_PRIO,irq_index)];
     unsigned int pti_ok = (prio & 0x00000001);
     unsigned int hwi_ok = (prio & 0x00000002);
@@ -140,8 +142,10 @@
 // It writes the "wdata" value in the mailbox defined by the cluster index
 // and the processor index.
+// Giet-VM supports at most NB_PROCS_MAX mailboxes:
+// (0 <= wti_index <= NB_PROCS_MAX-1)
 // Returns 0 if success, > 0 if error.
 ////////////////////////////////////////////////////////////////////////////////
 unsigned int _xcu_send_ipi( unsigned int cluster_xy,
-                            unsigned int proc_id,
+                            unsigned int wti_index,
                             unsigned int wdata )
 { 
@@ -149,7 +153,7 @@
     unsigned int x = cluster_xy >> Y_WIDTH;
     unsigned int y = cluster_xy & ((1<<Y_WIDTH)-1);
-    if (x >= X_SIZE)             return 1; 
-    if (y >= Y_SIZE)             return 1; 
-    if (proc_id >= NB_PROCS_MAX) return 1; 
+    if (x >= X_SIZE)               return 1; 
+    if (y >= Y_SIZE)               return 1; 
+    if (wti_index >= NB_PROCS_MAX) return 1; 
 
 #if USE_XICU
@@ -158,5 +162,5 @@
         (cluster_xy * (unsigned int)&vseg_cluster_increment));
 
-    xcu_address[XICU_REG(XICU_WTI_REG, proc_id)] = wdata;
+    xcu_address[XICU_REG(XICU_WTI_REG,wti_index)] = wdata;
     return 0; 
 #else
Index: /soft/giet_vm/giet_drivers/xcu_driver.h
===================================================================
--- /soft/giet_vm/giet_drivers/xcu_driver.h	(revision 280)
+++ /soft/giet_vm/giet_drivers/xcu_driver.h	(revision 281)
@@ -45,28 +45,28 @@
 
 extern unsigned int _xcu_get_index( unsigned int cluster_xy, 
-                                    unsigned int proc_id, 
+                                    unsigned int irq_index, 
                                     unsigned int * buffer );
 
 extern unsigned int _xcu_set_mask( unsigned int cluster_xy,
-                                   unsigned int proc_id,
+                                   unsigned int irq_index,
                                    unsigned int mask, 
                                    unsigned int is_timer );
 
 extern unsigned int _xcu_send_ipi( unsigned int cluster_xy,
-                                   unsigned int proc_id,
+                                   unsigned int wti_index,
                                    unsigned int wdata );
 
 extern unsigned int _xcu_timer_start( unsigned int cluster_xy, 
-                                      unsigned int proc_id,
+                                      unsigned int pti_index,
                                       unsigned int period ); 
 
 extern unsigned int _xcu_timer_stop( unsigned int cluster_xy, 
-                                     unsigned int proc_id ); 
+                                     unsigned int pti_index ); 
 
 extern unsigned int _xcu_timer_reset_irq( unsigned int cluster_xy, 
-                                          unsigned int proc_id );
+                                          unsigned int pti_index );
 
 extern unsigned int _xcu_timer_reset_cpt( unsigned int cluster_xy, 
-                                          unsigned int proc_id ); 
+                                          unsigned int pti_index ); 
 
 ///////////////////////////////////////////////////////////////////////////////////
Index: /soft/giet_vm/giet_kernel/irq_handler.c
===================================================================
--- /soft/giet_vm/giet_kernel/irq_handler.c	(revision 280)
+++ /soft/giet_vm/giet_kernel/irq_handler.c	(revision 281)
@@ -21,5 +21,5 @@
 #include <ioc_driver.h>
 #include <dma_driver.h>
-#include<mapping_info.h>
+#include <mapping_info.h>
 #include <utils.h>
 
@@ -59,8 +59,10 @@
     // get the highest priority active IRQ index 
 
+    unsigned int icu_out_index = local_id * IRQ_PER_PROCESSOR;
+
 #if USE_XICU
-    ko = _xcu_get_index( cluster_id, local_id, &irq_id );
+    ko = _xcu_get_index( cluster_id, icu_out_index, &irq_id );
 #else
-    ko = _icu_get_index( cluster_id, local_id, &irq_id );
+    ko = _icu_get_index( cluster_id, icu_out_index, &irq_id );
 #endif
 
Index: /soft/giet_vm/giet_kernel/kernel_init.c
===================================================================
--- /soft/giet_vm/giet_kernel/kernel_init.c	(revision 280)
+++ /soft/giet_vm/giet_kernel/kernel_init.c	(revision 281)
@@ -261,5 +261,5 @@
 #endif
 
-    // GIET-VM consraint : only one IRQ type per irq_id 
+    // GIET-VM constraint : only one IRQ type per irq_id 
     if ( hwi_mask & swi_mask & pti_mask )
     {
@@ -268,10 +268,15 @@
     }
 
+
+    // The ICU output index is computed as the local processor id multiplied by
+    // the number of ICU outputs connected to each processor.
+    int icu_out_index = local_pid * IRQ_PER_PROCESSOR; 
+
 #if USE_XICU
-    _xcu_set_mask(cluster_xy, local_pid, hwi_mask, IRQ_TYPE_HWI); // set HWI_MASK
-    _xcu_set_mask(cluster_xy, local_pid, swi_mask, IRQ_TYPE_SWI); // set SWI_MASK
-    _xcu_set_mask(cluster_xy, local_pid, pti_mask, IRQ_TYPE_PTI); // set PTI_MASK
+    _xcu_set_mask(cluster_xy, icu_out_index, hwi_mask, IRQ_TYPE_HWI); // set HWI_MASK
+    _xcu_set_mask(cluster_xy, icu_out_index, swi_mask, IRQ_TYPE_SWI); // set SWI_MASK
+    _xcu_set_mask(cluster_xy, icu_out_index, pti_mask, IRQ_TYPE_PTI); // set PTI_MASK
 #else
-    _icu_set_mask(cluster_xy, local_pid, (hwi_mask | pti_mask | swi_mask) );   
+    _icu_set_mask(cluster_xy, icu_out_index, (hwi_mask | pti_mask | swi_mask) );   
 #endif
 
Index: /soft/giet_vm/giet_xml/xml_parser.c
===================================================================
--- /soft/giet_vm/giet_xml/xml_parser.c	(revision 280)
+++ /soft/giet_vm/giet_xml/xml_parser.c	(revision 281)
@@ -115,4 +115,5 @@
 unsigned int dma_channels     = 0; // max number of DMA channels (per cluster)
 
+unsigned int icu_channels     = 0; // total number of IRQ per processor
 unsigned int tty_channels     = 0; // total number of terminals in TTY 
 unsigned int hba_channels     = 0; // total number of channels  in HBA
@@ -122,5 +123,5 @@
 unsigned int use_iob          = 0; // using IOB component
 unsigned int use_xcu          = 0; // using XCU (not ICU)
-unsigned int use_hba          = 0; // using XCU (not IOC)
+unsigned int use_hba          = 0; // using HBA
 
 
@@ -1442,4 +1443,16 @@
             if (found_icu || use_xcu)  error = 1; 
             found_icu = 1;
+
+            if (icu_channels > 0) 
+            {
+                assert( (periph[periph_index]->channels == icu_channels) &&
+                        "[XML ERROR] the number of interruptions per processor "
+                        "from the ICU (icu channels) must be the same on all "
+                        "clusters");
+            }
+            else
+            {
+                icu_channels = periph[periph_index]->channels;
+            }
         }
         //////////////////////////////////
@@ -1466,14 +1479,26 @@
         {
             periph[periph_index]->type = PERIPH_TYPE_XCU;
-            if (found_icu || found_timer)  error = 1; 
+            if (found_xcu || found_icu || found_timer)  error = 1; 
             found_xcu    = 1;
             found_timer  = 1;
             tim_channels = 32; 
             use_xcu      = 1;
+
+            if (icu_channels > 0) 
+            {
+                assert( (periph[periph_index]->channels == icu_channels) &&
+                        "[XML ERROR] the number of interruptions per processor "
+                        "from the ICU (icu channels) must be the same on all "
+                        "clusters");
+            }
+            else
+            {
+                icu_channels = periph[periph_index]->channels;
+            }
         }
         else 
         {
-            printf("[XML ERROR] illegal <type> for peripheral %d in cluster %d\n",
-                    periph_loc_index, cluster_index);
+            printf("[XML ERROR] illegal <type>: %s for peripheral %d in cluster %d\n",
+                    str, periph_loc_index, cluster_index);
             exit(1);
         }
@@ -1481,6 +1506,6 @@
         if (error) 
         {
-            printf("[XML ERROR] illegal <type> for peripheral %d in cluster %d\n",
-                    periph_loc_index, cluster_index);
+            printf("[XML ERROR] illegal <type>: %s for peripheral %d in cluster %d\n",
+                    str, periph_loc_index, cluster_index);
             exit(1);
         }
@@ -2509,5 +2534,5 @@
     sprintf(prol, "/* Generated from file %s.xml */\n\n",header->name);
 
-    char * ifdef  = "#ifndef _HARD_CONFIG_H\n#define _HARDD_CONFIG_H\n\n";
+    char * ifdef  = "#ifndef _HARD_CONFIG_H\n#define _HARD_CONFIG_H\n\n";
     char * epil   = "\n#endif //_HARD_CONFIG_H";
 
@@ -2542,4 +2567,8 @@
     def_int_write(fdout, "USE_IOB           ", use_iob);
     def_int_write(fdout, "USE_HBA           ", use_hba);
+
+    file_write(fdout, "\n");
+
+    def_int_write(fdout, "IRQ_PER_PROCESSOR ", icu_channels);
 
     file_write(fdout, epil);
Index: /soft/giet_vm/mappings/4c_1p_four.xml
===================================================================
--- /soft/giet_vm/mappings/4c_1p_four.xml	(revision 280)
+++ /soft/giet_vm/mappings/4c_1p_four.xml	(revision 281)
@@ -13,5 +13,5 @@
 *** The physical address cluster increment is 0x10000000000 / NB_CLUSTERS
 
-*** This first section describes an instance of the "tsar_generic_iob" architecture
+*** This first section describes an instance of the "tsar_generic_xbar" architecture
 *** with 4 clusters, 1 processor per cluster and 40 bits physical address.
 
@@ -50,5 +50,5 @@
 
             <periph type = "DMA"  psegname = "PSEG_DMA"  channels = "1"  /> 
-            <periph type = "XCU"  psegname = "PSEG_XCU"  channels = "1"  />
+            <periph type = "XCU"  psegname = "PSEG_XCU"  channels = "6"  />
             <periph type = "MMC"  psegname = "PSEG_MMC"  channels = "1"  />
             <periph type = "IOC"  psegname = "PSEG_IOC"  channels = "1"  /> 
@@ -73,5 +73,5 @@
 
             <periph type = "DMA"  psegname = "PSEG_DMA"  channels = "1" />
-            <periph type = "XCU"  psegname = "PSEG_XCU"  channels = "1" />
+            <periph type = "XCU"  psegname = "PSEG_XCU"  channels = "6" />
             <periph type = "MMC"  psegname = "PSEG_MMC"  channels = "1" />
         </cluster>
@@ -89,5 +89,5 @@
 
             <periph type = "DMA"  psegname = "PSEG_DMA"  channels = "1" />
-            <periph type = "XCU"  psegname = "PSEG_XCU"  channels = "1" />
+            <periph type = "XCU"  psegname = "PSEG_XCU"  channels = "6" />
             <periph type = "MMC"  psegname = "PSEG_MMC"  channels = "1" />
         </cluster>
@@ -105,5 +105,5 @@
 
             <periph type = "DMA"  psegname = "PSEG_DMA"  channels = "1" />
-            <periph type = "XCU"  psegname = "PSEG_XCU"  channels = "1" />
+            <periph type = "XCU"  psegname = "PSEG_XCU"  channels = "6" />
             <periph type = "MMC"  psegname = "PSEG_MMC"  channels = "1" />
         </cluster>
