Index: /soft/giet_vm/giet_xml/mapping_info.h
===================================================================
--- /soft/giet_vm/giet_xml/mapping_info.h	(revision 322)
+++ /soft/giet_vm/giet_xml/mapping_info.h	(revision 323)
@@ -124,6 +124,5 @@
     PERIPH_SUBTYPE_HBA       = 1,
     PERIPH_SUBTYPE_SPI       = 2,
-
-    PERIPH_SUBTYPE_MAX_VALUE = 3,
+    PERIPH_SUBTYPE_NONE      = 3,
 };
 
@@ -138,17 +137,15 @@
 typedef struct __attribute__((packed))  mapping_header_s 
 {
-    unsigned int signature;          // must contain MAPPING_SIGNATURE
+    unsigned int signature;          // must contain IN_MAPPING_SIGNATURE
     unsigned int x_size;             // actual number of clusters in a row
     unsigned int y_size;             // actual number of clusters in a column
     unsigned int x_width;            // number of bits to encode x coordinate 
     unsigned int y_width;            // number of bits to encode y coordinate 
-    unsigned int globals;            // number of vsegs mapped in all vspaces
-    unsigned int vspaces;            // number of virtual spaces
     unsigned int x_io;               // x coordinate for cluster_io_ext
     unsigned int y_io;               // y coordinate for cluster_io_ext
     unsigned int irq_per_proc;       // number of IRQ per processor
     unsigned int use_ram_disk;       // does not use IOC peripheral if non zero
-    unsigned int increment;          // vbase address increment (replicated peripherals)
-
+    unsigned int globals;            // total number of global vsegs
+    unsigned int vspaces;            // total number of virtual spaces
     unsigned int psegs;              // total number of physical segments (for all clusters)
     unsigned int vsegs;              // total number of virtual segments (for all vspaces)
@@ -172,14 +169,14 @@
 
     unsigned int    psegs;           // number of psegs in cluster
-    unsigned int    pseg_offset;     // index of first pseg in pseg set
+    unsigned int    pseg_offset;     // global index of first pseg in psegs set
 
     unsigned int    procs;           // number of processors in cluster
-    unsigned int    proc_offset;     // index of first proc in proc set
+    unsigned int    proc_offset;     // global index of first proc in procs set
  
     unsigned int    coprocs;         // number of coprocessors in cluster
-    unsigned int    coproc_offset;   // index of first coproc in coproc set
+    unsigned int    coproc_offset;   // global index of first coproc in coprocs set
 
     unsigned int    periphs;         // number of peripherals in cluster
-    unsigned int    periph_offset;   // index of first coproc in coproc set
+    unsigned int    periph_offset;   // global index of first coproc in periphs set
 } mapping_cluster_t;
 
@@ -189,11 +186,11 @@
 {
     char            name[32];        // virtual space name
-    unsigned int    start_offset;    // offset of the vobj containing start vector
+    unsigned int    start_vobj_id;   // global index for vobj containing start vector
     unsigned int    vsegs;           // number of vsegs in vspace
     unsigned int    vobjs;           // number of vobjs in vspace
     unsigned int    tasks;           // number of tasks in vspace
-    unsigned int    vseg_offset;     // index of first vseg in vspace 
-    unsigned int    vobj_offset;     // index of first vobjs in vspace
-    unsigned int    task_offset;     // index of first task in vspace
+    unsigned int    vseg_offset;     // global index of first vseg in vspace 
+    unsigned int    vobj_offset;     // global index of first vobj in vspace
+    unsigned int    task_offset;     // global index of first task in vspace
 } mapping_vspace_t;
 
@@ -209,5 +206,5 @@
     unsigned int    mode;            // C-X-W-U flags
     unsigned int    vobjs;           // number of vobjs in vseg
-    unsigned int    vobj_offset;     // index of first vobj in vseg
+    unsigned int    vobj_offset;     // global index of first vobj in vseg
     unsigned int    next_vseg;       // linked list of vsegs mapped on pseg
     char            mapped;          // mapped if non zero
@@ -225,5 +222,5 @@
     paddr_t         length;          // size (bytes)
     unsigned int    type;            // RAM / PERI
-    unsigned int    clusterid;       // linear index in array of clusters
+    unsigned int    clusterid;       // global index in clusters set
     unsigned int    next_vseg;       // linked list of vsegs mapped on pseg
 } mapping_pseg_t;
@@ -234,9 +231,9 @@
 {
     char            name[32];        // task name (unique in vspace)
-    unsigned int    clusterid;       // linear index in array of clusters
+    unsigned int    clusterid;       // global index in clusters set
     unsigned int    proclocid;       // processor local index (inside cluster)
     unsigned int    trdid;           // thread index in vspace
-    unsigned int    stack_vobjid;    // stack vobj index in vspace
-    unsigned int    heap_vobjid;     // heap vobj index in vspace
+    unsigned int    stack_vobj_id;   // global index for vobj containing stack
+    unsigned int    heap_vobj_id;    // global index for vobj containing heap
     unsigned int    startid;         // index in start_vector 
     unsigned int    use_tty;         // TTY channel required (global)
@@ -272,8 +269,8 @@
 typedef struct __attribute__((packed))  mapping_coproc_s 
 {
-    char            name[32];        // coprocessor name
+    char            name[32];        // coprocessor name (probablement inutile AG)
     unsigned int    psegid;          // global pseg index 
     unsigned int    ports;           // number of MWMR ports used by coprocessor
-    unsigned int    port_offset;     // index of first MWMR port used by coprocessor
+    unsigned int    port_offset;     // global index of first MWMR port 
 } mapping_coproc_t;
 
@@ -283,6 +280,6 @@
 {
     unsigned int    direction;       // TO_COPROC == 0 / FROM_COPROC == 1
-    unsigned int    vspaceid;        // index of the vspace containing the MWMR channel
-    unsigned int    mwmr_vobjid;     // local index of the vobj containing the MWMR channel
+    unsigned int    vspaceid;        // index of the vspace containing MWMR channel
+    unsigned int    mwmr_vobj_id;    // global index of vobj containing MWMR channel
 } mapping_cp_port_t;
 
@@ -295,6 +292,7 @@
     unsigned int    psegid;          // pseg index in cluster
     unsigned int    channels;        // number of channels
-    unsigned int    irqs;            // number of input IRQs (for ICU, XCU or PIC)
-    unsigned int    irq_offset;      // index of first IRQ (can be HWI/PTI/WTI)
+    unsigned int    arg;             // argument depending on peripheral type
+    unsigned int    irqs;            // number of input IRQs (for XCU or PIC)
+    unsigned int    irq_offset;      // index of first IRQ 
 } mapping_periph_t;
 
@@ -304,10 +302,9 @@
 {
     unsigned int    srctype;         // source IRQ type (HWI / WTI / PTI)
-    unsigned int    srcid;           // source IRQ index (for ICU/PIC component)
+    unsigned int    srcid;           // source IRQ index (for XCU/PIC component)
     unsigned int    isr;             // ISR type (defined in irq_handler.h)
-    unsigned int    channel;         // channel index (for multi-channels peripherals)
-    unsigned int    dstx;            // x coordinate of destination cluster
-    unsigned int    dsty;            // y coordinate of destination cluster
-    unsigned int    dstid;           // destination IRQ index (can be PROC or ICU)
+    unsigned int    channel;         // channel index (for multi-channels ISR)
+    unsigned int    dest_xy;         // destination cluster (set by GIET_VM)
+    unsigned int    dest_id;         // destination port (set by GIET_VM)
 } mapping_irq_t; 
 
Index: /soft/giet_vm/giet_xml/xml_driver.c
===================================================================
--- /soft/giet_vm/giet_xml/xml_driver.c	(revision 322)
+++ /soft/giet_vm/giet_xml/xml_driver.c	(revision 323)
@@ -65,4 +65,7 @@
         "ISR_NIC_TX",
         "ISR_CMA",
+        "ISR_MMC",
+        "ISR_DMA",
+        "ISR_SPI",
     };
 
@@ -92,4 +95,5 @@
         "HBA",
         "SPI",
+        "NONE",
     };
 
@@ -300,6 +304,6 @@
                  port_id++) 
             {
-                unsigned int vobj_id = cp_port[port_id].mwmr_vobjid + vspace[cp_port[port_id].vspaceid].vobj_offset; 
-                fprintf(fpout, "             <port direction=\"%s\"",  port_direction[cp_port[port_id].direction]);
+                unsigned int vobj_id = cp_port[port_id].mwmr_vobj_id; 
+                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);
@@ -320,19 +324,9 @@
 
             fprintf(fpout, " psegname=\"%s\"", pseg[periph[periph_id].psegid].name);
-            fprintf(fpout, " channels=\"%d\" >\n",  periph[periph_id].channels);
-            if ( periph[periph_id].type == PERIPH_TYPE_PIC )
-            {
-                for (irq_id = periph[periph_id].irq_offset; 
-                     irq_id < periph[periph_id].irq_offset + periph[periph_id].irqs;
-                     irq_id++) 
-                {
-                    fprintf(fpout, "                <irq srcid=\"%d\" ", irq[irq_id].srcid);
-                    fprintf(fpout, " dstx=\"%d\"", irq[irq_id].dstx);
-                    fprintf(fpout, " dsty=\"%d\"", irq[irq_id].dsty);
-                    fprintf(fpout, " dstid=\"%d\" />\n", irq[irq_id].dstid);
-                }
-            }
-            if ( (periph[periph_id].type == PERIPH_TYPE_XCU ) ||
-                 (periph[periph_id].type == PERIPH_TYPE_ICU ) )
+            fprintf(fpout, " channels=\"%d\"",  periph[periph_id].channels);
+            fprintf(fpout, " arg=\"%d\" >\n",  periph[periph_id].arg);
+            if ( (periph[periph_id].type == PERIPH_TYPE_PIC) ||
+                 (periph[periph_id].type == PERIPH_TYPE_XCU) ||
+                 (periph[periph_id].type == PERIPH_TYPE_ICU) )
             {
                 for (irq_id = periph[periph_id].irq_offset; 
@@ -343,6 +337,5 @@
                     fprintf(fpout, " srcid=\"%d\"", irq[irq_id].srcid);
                     fprintf(fpout, " isr=\"%s\"", isr_type[irq[irq_id].isr]);
-                    fprintf(fpout, " channel=\"%d\"", irq[irq_id].channel);
-                    fprintf(fpout, " dstid=\"%d\" />\n", irq[irq_id].dstid);
+                    fprintf(fpout, " channel=\"%d\" />\n", irq[irq_id].channel);
                 }
             }
@@ -396,7 +389,7 @@
     for (vspace_id = 0; vspace_id < header->vspaces; vspace_id++) 
     {
-        unsigned int func_id = vspace[vspace_id].vobj_offset + vspace[vspace_id].start_offset; 
+        unsigned int vobj_id = vspace[vspace_id].start_vobj_id;
         fprintf(fpout, "        <vspace name = \"%s\" ", vspace[vspace_id].name); 
-        fprintf(fpout, " startname = \"%s\" >\n", vobj[func_id].name); 
+        fprintf(fpout, " startname = \"%s\" >\n", vobj[vobj_id].name); 
 
         //////////////////// vsegs //////////////////////////////////////////////
@@ -444,7 +437,7 @@
              task_id++) 
         {
-            unsigned int stack_vobj_id = task[task_id].stack_vobjid + vspace[vspace_id].vobj_offset; 
-            unsigned int heap_vobj_id = task[task_id].heap_vobjid + vspace[vspace_id].vobj_offset; 
-            unsigned int cluster_id   = task[task_id].clusterid;
+            unsigned int stack_vobj_id = task[task_id].stack_vobj_id; 
+            unsigned int heap_vobj_id  = task[task_id].heap_vobj_id; 
+            unsigned int cluster_id    = task[task_id].clusterid;
 
             fprintf(fpout, "            <task name=\"%s\"", task[task_id].name);
Index: /soft/giet_vm/giet_xml/xml_parser.c
===================================================================
--- /soft/giet_vm/giet_xml/xml_parser.c	(revision 322)
+++ /soft/giet_vm/giet_xml/xml_parser.c	(revision 323)
@@ -294,5 +294,5 @@
 // 
 // - For replicated peripherals the virtual base address must be:
-//   vbase = seg_type_base & 0XFF000000 + (cluster_xy * increment) & 0x00FF0000
+//   vbase = seg_type_base & 0XFF000000 + (cluster_xy * 0x00010000) & 0x00FF0000
 //
 // - For non-replicated peripherals, the cluster index must be cluster_io.
@@ -307,6 +307,7 @@
     unsigned int type;         // peripheral type 
 
-    unsigned int type_mask    = 0xFF000000;
-    unsigned int cluster_mask = 0x00FF0000;
+    unsigned int type_mask      = 0xFF000000;
+    unsigned int cluster_mask   = 0x00FF0000;
+    unsigned int vseg_increment = 0x00010000;
 
 #if XML_PARSER_DEBUG
@@ -348,5 +349,5 @@
 
                         if( (vseg[vseg_id]->vbase & cluster_mask) != 
-                            (header->increment * cluster_xy) )
+                            (vseg_increment * cluster_xy) )
                         {
                             printf("[XML ERROR] All replicated peripherals "
@@ -444,6 +445,6 @@
 }
 
-///////////////////////////////////////////////////////////////////////////////////
-int getVobjLocId(unsigned int vspace_id, char * vobj_name, unsigned int vspace_max) 
+////////////////////////////////////////////////////////////////////////////////
+int getVobjId(unsigned int vspace_id, char * vobj_name, unsigned int vspace_max) 
 {
     unsigned int vobj_id;
@@ -453,5 +454,5 @@
     for (vobj_id = vobj_min; vobj_id < vobj_max; vobj_id++) 
     {
-        if (strcmp(vobj[vobj_id]->name, vobj_name) == 0) return (vobj_id - vobj_min);
+        if (strcmp(vobj[vobj_id]->name, vobj_name) == 0) return vobj_id;
     }
     return -1;
@@ -649,12 +650,12 @@
     if (ok) 
     {
-        int index = getVobjLocId(vspace_index, str , vobj_loc_index);
+        int index = getVobjId(vspace_index, str , vobj_loc_index);
         if (index >= 0) 
         {
 #if XML_PARSER_DEBUG
 printf("      stackname = %s\n", str);
-printf("      stackid   = %d\n", index);
-#endif
-            task[task_index]->stack_vobjid = index;
+printf("      stack_id  = %d\n", index);
+#endif
+            task[task_index]->stack_vobj_id = index;
         }
         else 
@@ -676,12 +677,12 @@
     if (ok) 
     {
-        int index = getVobjLocId(vspace_index, str, vobj_loc_index);
+        int index = getVobjId(vspace_index, str, vobj_loc_index);
         if (index >= 0) 
         {
 #if XML_PARSER_DEBUG
 printf("      heapname  = %s\n", str);
-printf("      heapid    = %d\n", index);
-#endif
-            task[task_index]->heap_vobjid = index;
+printf("      heap_id   = %d\n", index );
+#endif
+            task[task_index]->heap_vobj_id = index;
         }
         else 
@@ -694,5 +695,5 @@
     else 
     {
-        task[task_index]->heap_vobjid = -1;
+        task[task_index]->heap_vobj_id = -1;
     }
 
@@ -1129,5 +1130,6 @@
     ////////// get startname attribute
     str = getStringValue(reader, "startname", &ok);
-    if (ok) {
+    if (ok) 
+    {
         //used after parsing the vobjs
     }
@@ -1162,5 +1164,5 @@
 
             // get index of the vobj containing the start vector
-            int index = getVobjLocId(vspace_index, str , vobj_loc_index);
+            int index = getVobjId(vspace_index, str , vobj_loc_index);
             if (index == -1) 
             {
@@ -1171,17 +1173,19 @@
             else 
             {
-                vspace[vspace_index]->start_offset = index;
+                vspace[vspace_index]->start_vobj_id = index;
 #if XML_PARSER_DEBUG
                 printf("      startname = %s\n", str);
-                printf("      startid   = %d\n", index);
+                printf("      start_id  = %d\n", index);
                 printf("  end vspace %d\n\n", vspace_index);
 #endif
             }
 
-            // checking startid values for all tasks in vspace
+            // checking for all tasks that the startid 
+            // is smaller than the number of tasks in vspace
             int task_id;
             int task_min = vspace[vspace_index]->task_offset;
             int task_max = task_min + vspace[vspace_index]->tasks; 
-            for (task_id = task_min; task_id < task_max; task_id++) {
+            for (task_id = task_min; task_id < task_max; task_id++) 
+            {
                 if (task[task_id]->startid >= vspace[vspace_index]->tasks) 
                 {
@@ -1212,8 +1216,4 @@
     char * str;
 
-    unsigned int is_pic = (periph[periph_index]->type == PERIPH_TYPE_PIC);
-    unsigned int is_icu = (periph[periph_index]->type == PERIPH_TYPE_ICU) ||
-                          (periph[periph_index]->type == PERIPH_TYPE_XCU);
-
     if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_END_ELEMENT) return;
 
@@ -1251,64 +1251,60 @@
     }
 
-    ///////// get srctype attribute ... if ICU or XCU
-    if ( is_icu )
-    {
-        str = getStringValue(reader, "srctype", &ok);
-        if (ok) 
-        {
+    ///////// get srctype attribute 
+    str = getStringValue(reader, "srctype", &ok);
+    if (ok) 
+    {
 #if XML_PARSER_DEBUG
 printf("        srctype = %s\n", str);
 #endif
-            if      ( strcmp(str, "HWI") == 0 ) irq[irq_index]->srctype = IRQ_TYPE_HWI;
-            else if ( strcmp(str, "WTI") == 0 ) irq[irq_index]->srctype = IRQ_TYPE_WTI;
-            else if ( strcmp(str, "PTI") == 0 ) irq[irq_index]->srctype = IRQ_TYPE_PTI;
-            else    
-            {
-                printf("[XML ERROR] illegal IRQ <srctype> for periph %d in cluster %d\n",
-                       cluster_index, periph_loc_index);
-                exit(1);
-            }
-        }
-        else 
-        {
-            printf("[XML ERROR] missing IRQ <srctype> for periph %d in cluster %d\n",
+        if      ( strcmp(str, "HWI") == 0 ) irq[irq_index]->srctype = IRQ_TYPE_HWI;
+        else if ( strcmp(str, "WTI") == 0 ) irq[irq_index]->srctype = IRQ_TYPE_WTI;
+        else if ( strcmp(str, "PTI") == 0 ) irq[irq_index]->srctype = IRQ_TYPE_PTI;
+        else    
+        {
+            printf("[XML ERROR] illegal IRQ <srctype> for periph %d in cluster %d\n",
                    cluster_index, periph_loc_index);
             exit(1);
         }
     }
-
-    ///////// get isr attribute ... if ICU or XCU
-    if ( is_icu )
-    {
-        str = getStringValue(reader, "isr", &ok);
-        if (ok) 
-        {
+    else 
+    {
+        printf("[XML ERROR] missing IRQ <srctype> for periph %d in cluster %d\n",
+               cluster_index, periph_loc_index);
+        exit(1);
+    }
+
+    ///////// get isr attribute 
+    str = getStringValue(reader, "isr", &ok);
+    if (ok) 
+    {
 #if XML_PARSER_DEBUG
 printf("        isr     = %s\n", str);
 #endif
-            if      (strcmp(str, "ISR_TICK"   ) == 0)  irq[irq_index]->isr = ISR_TICK;
-            else if (strcmp(str, "ISR_BDV"    ) == 0)  irq[irq_index]->isr = ISR_BDV;
-            else if (strcmp(str, "ISR_CMA"    ) == 0)  irq[irq_index]->isr = ISR_CMA;
-            else if (strcmp(str, "ISR_TTY_RX" ) == 0)  irq[irq_index]->isr = ISR_TTY_RX;
-            else if (strcmp(str, "ISR_TTY_TX" ) == 0)  irq[irq_index]->isr = ISR_TTY_TX;
-            else if (strcmp(str, "ISR_TIMER"  ) == 0)  irq[irq_index]->isr = ISR_TIMER;
-            else if (strcmp(str, "ISR_WAKUP"  ) == 0)  irq[irq_index]->isr = ISR_WAKUP;
-            else if (strcmp(str, "ISR_NIC_RX" ) == 0)  irq[irq_index]->isr = ISR_NIC_RX;
-            else if (strcmp(str, "ISR_NIC_TX" ) == 0)  irq[irq_index]->isr = ISR_NIC_TX;
-            else if (strcmp(str, "ISR_MMC"    ) == 0)  irq[irq_index]->isr = ISR_MMC;
-            else if (strcmp(str, "ISR_DEFAULT") == 0)  irq[irq_index]->isr = ISR_DEFAULT;
-            else 
-            {
-                printf("[XML ERROR] illegal IRQ <isr> for periph %d in cluster %d\n",
-                       periph_loc_index, cluster_index );
-                exit(1);
-            }
-        }  
+        if      (strcmp(str, "ISR_TICK"   ) == 0)  irq[irq_index]->isr = ISR_TICK;
+        else if (strcmp(str, "ISR_BDV"    ) == 0)  irq[irq_index]->isr = ISR_BDV;
+        else if (strcmp(str, "ISR_CMA"    ) == 0)  irq[irq_index]->isr = ISR_CMA;
+        else if (strcmp(str, "ISR_TTY_RX" ) == 0)  irq[irq_index]->isr = ISR_TTY_RX;
+        else if (strcmp(str, "ISR_TTY_TX" ) == 0)  irq[irq_index]->isr = ISR_TTY_TX;
+        else if (strcmp(str, "ISR_TIMER"  ) == 0)  irq[irq_index]->isr = ISR_TIMER;
+        else if (strcmp(str, "ISR_WAKUP"  ) == 0)  irq[irq_index]->isr = ISR_WAKUP;
+        else if (strcmp(str, "ISR_NIC_RX" ) == 0)  irq[irq_index]->isr = ISR_NIC_RX;
+        else if (strcmp(str, "ISR_NIC_TX" ) == 0)  irq[irq_index]->isr = ISR_NIC_TX;
+        else if (strcmp(str, "ISR_MMC"    ) == 0)  irq[irq_index]->isr = ISR_MMC;
+        else if (strcmp(str, "ISR_DMA"    ) == 0)  irq[irq_index]->isr = ISR_DMA;
+        else if (strcmp(str, "ISR_SPI"    ) == 0)  irq[irq_index]->isr = ISR_SPI;
+        else if (strcmp(str, "ISR_DEFAULT") == 0)  irq[irq_index]->isr = ISR_DEFAULT;
         else 
         {
-            printf("[XML ERROR] missing IRQ <isr> for periph %d in cluster %d\n",
-                    cluster_index, periph_loc_index);
+            printf("[XML ERROR] illegal IRQ <isr> for periph %d in cluster %d\n",
+                   periph_loc_index, cluster_index );
             exit(1);
         }
+    }  
+    else 
+    {
+        printf("[XML ERROR] missing IRQ <isr> for periph %d in cluster %d\n",
+                cluster_index, periph_loc_index);
+        exit(1);
     }
 
@@ -1325,84 +1321,4 @@
     {
         irq[irq_index]->channel = 0;
-    }
-
-    ///////// get dstx attribute ... if PIC
-    if ( is_pic )
-    {
-        value = getIntValue(reader, "dstx", &ok);
-        if (ok) 
-        {
-#if XML_PARSER_DEBUG
-printf("        dstx    = %d\n", value);
-#endif
-
-            if ( value < header->x_size )
-            {
-                irq[irq_index]->dstx = value;
-            }
-            else
-            {
-                printf("[XML ERROR] IRQ <dstx> too large for periph %d in cluster %d\n",
-                       cluster_index, periph_loc_index);
-                exit(1);
-            }
-        }
-        else 
-        {
-            printf("[XML ERROR] missing IRQ <dstx> for periph %d in cluster %d\n",
-                   cluster_index, periph_loc_index);
-            exit(1);
-        }
-    }
-
-    ///////// get dsty attribute ... if PIC
-    if ( is_pic )
-    {
-        value = getIntValue(reader, "dsty", &ok);
-        if (ok) 
-        {
-#if XML_PARSER_DEBUG
-printf("        dsty    = %d\n", value);
-#endif
-
-            if ( value < header->y_size )
-            {
-                irq[irq_index]->dsty = value;
-            }
-            else
-            {
-                printf("[XML ERROR] IRQ <dsty> too large for periph %d in cluster %d\n",
-                       cluster_index, periph_loc_index);
-                exit(1);
-            }
-        }
-        else 
-        {
-            printf("[XML ERROR] missing IRQ <dsty> for periph %d in cluster %d\n",
-                    cluster_index, periph_loc_index);
-            exit(1);
-        }
-    }
-
-    ///////// get dstid attribute
-    value = getIntValue(reader, "dstid", &ok);
-    if (ok) 
-    {
-#if XML_PARSER_DEBUG
-printf("        dstid   = %d\n", value);
-#endif
-        irq[irq_index]->dstid = value;
-        if (value >= 32) 
-        {
-            printf("[XML ERROR] IRQ <dstid> too large for periph %d in cluster %d\n",
-                    cluster_index, periph_loc_index);
-            exit(1);
-        }
-    }
-    else 
-    {
-        printf("[XML ERROR] missing IRQ <dstid> for periph %d in cluster %d\n",
-                cluster_index, periph_loc_index);
-        exit(1);
     }
 
@@ -1535,4 +1451,18 @@
     {
         periph[periph_index]->channels = 1;
+    }
+
+    ///////// get arg attribute (optionnal : 0 if missing)
+    value = getIntValue(reader, "arg", &ok);
+    if (ok) 
+    {
+#if XML_PARSER_DEBUG
+printf("      arg         = %d\n", value);
+#endif
+        periph[periph_index]->arg = value;
+    }
+    else 
+    {
+        periph[periph_index]->arg = 1;
     }
 
@@ -2473,5 +2403,4 @@
 
     ///////// set other header fields 
-    header->increment = 0x10000;
     header->globals   = 0;
     header->vspaces   = 0;
@@ -2619,14 +2548,16 @@
 
 
-///////////////////////////////////////////////////////////////////////
-// this function set the value the vobj_id fiels of all cp_ports
-///////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////
+// this function set the values of vspace_id and vobj_id fields for all cp_ports
+///////////////////////////////////////////////////////////////////////////////////
 void prepareBuild() 
 {
     unsigned int i;
-    //asign for all cp_ports the correct vspaceid and vobjid
-    for (i = 0; i < cp_port_index; i++) {
+    
+    for (i = 0; i < cp_port_index; i++) 
+    {
         int vspace_id = getVspaceId(cp_port_vobj_ref[i]->vspace_name);
-        if (vspace_id < 0) {
+        if (vspace_id < 0) 
+        {
             printf("[XML ERROR] illegal  <vspacename> for cp_port %d,\n", i);
             exit(1);
@@ -2634,6 +2565,9 @@
         cp_port[i]->vspaceid = vspace_id;
 
-        int vobj_id = getVobjLocId(vspace_id, cp_port_vobj_ref[i]->vobj_name, vspace[vspace_id]->vobjs);
-        if (vobj_id >= 0) {
+        int vobj_id = getVobjId( vspace_id, 
+                                 cp_port_vobj_ref[i]->vobj_name, 
+                                 vspace[vspace_id]->vobjs );
+        if (vobj_id >= 0) 
+        {
 
 #if XML_PARSER_DEBUG
@@ -2643,11 +2577,12 @@
             printf("      vobj_index   = %d\n", vobj_id);
 #endif
-            cp_port[i]->mwmr_vobjid = vobj_id;
-
-            assert((vobj[ vspace[vspace_id]->vobj_offset + vobj_id]->type == VOBJ_TYPE_MWMR)
-                    && "coproc ports have to refer to a vobj of type MWMR");
-        }
-        else {
-            printf("[XML ERROR] illegal  <vobjname> for cp_port %d,\n", i);
+            cp_port[i]->mwmr_vobj_id = vobj_id;
+
+            assert((vobj[vspace[vspace_id]->vobj_offset + vobj_id]->type == VOBJ_TYPE_MWMR)
+                    && "coproc ports must refer a vobj of type MWMR");
+        }
+        else 
+        {
+            printf("[XML ERROR]  <vobjname> not found for cp_port %d,\n", i);
             exit(1);
         }
@@ -2925,5 +2860,5 @@
     file_write(fdout, "\n");
 
-    ld_write(fdout, "vseg_cluster_increment  ",   header->increment);
+    ld_write(fdout, "vseg_cluster_increment  ",   0x00010000);
 
     close(fdout);
