Index: soft/giet_vm/xml/xml_driver.c
===================================================================
--- soft/giet_vm/xml/xml_driver.c	(revision 181)
+++ soft/giet_vm/xml/xml_driver.c	(revision 189)
@@ -17,8 +17,7 @@
 #include  <mapping_info.h>
 
-/////////////////////////////////////////////////////
-void buildXml( mapping_header_t* header, FILE* fpout)
+//////////////////////////////////////////////////////
+void buildXml( mapping_header_t* header, FILE* fpout )
 {
-
     const char* vobj_type[] = 
     { 
@@ -30,5 +29,5 @@
         "LOCK",		// Spin-Lock
         "BUFFER",	// Any "no intialiasation needed" objects (stacks...)
-        "BARRIER"	// Barrier
+        "BARRIER",	// Barrier
     };
 
@@ -37,5 +36,5 @@
         "RAM",
         "ROM",
-        "PERI"
+        "PERI",
     };
 
@@ -43,18 +42,26 @@
     {
         "HARD",
-        "SOFT"
+        "SOFT",
     };
 
     const char* isr_type[] =
     {
+        "ISR_DEFAULT",
+        "ISR_SWITCH",
+        "ISR_TTY",
+        "ISR_DMA",
         "ISR_IOC",
-        "ISR_FBDMA",
-        "ISR_TTY"
-    };
-
-    const char* reg_type[] =
-    {
-        "STATUS",
-        "CONFIG"
+        "ISR_TIMER",
+    };
+
+    const char* periph_type[] =
+    {
+        "IOC",
+        "TTY",
+        "TIM",
+        "DMA",
+        "FBF",
+        "NIC",
+        "IOB",
     };
 
@@ -62,5 +69,5 @@
     {
         "TO_COPROC",
-        "FROM_COPROC"
+        "FROM_COPROC",
     };
 
@@ -81,5 +88,5 @@
       "CX_U", 
       "CXW_", 
-      "CXWU" 
+      "CXWU", 
     };
 
@@ -94,17 +101,17 @@
     unsigned int		coproc_id;
     unsigned int		port_id;
-    unsigned int		reg_id;
-
-    mapping_cluster_t*	    cluster;
-    mapping_pseg_t*	        pseg;
-    mapping_vspace_t*	    vspace;
-    mapping_vseg_t*	        vseg;
-    mapping_vobj_t*	        vobj;
-    mapping_task_t*	        task;
-    mapping_proc_t*	        proc;
-    mapping_irq_t*	        irq;	
-    mapping_coproc_t*       coproc;
-    mapping_coproc_port_t*	cp_port;
-    mapping_coproc_reg_t*   cp_reg;
+    unsigned int		periph_id;
+
+    mapping_cluster_t*	cluster;
+    mapping_pseg_t*	    pseg;
+    mapping_vspace_t*	vspace;
+    mapping_vseg_t*	    vseg;
+    mapping_vobj_t*	    vobj;
+    mapping_task_t*	    task;
+    mapping_proc_t*	    proc;
+    mapping_irq_t*	    irq;	
+    mapping_coproc_t*   coproc;
+    mapping_cp_port_t*	cp_port;
+    mapping_periph_t*	periph;
 
     // computes the base adresss for clusters array, 
@@ -147,5 +154,5 @@
                                   MAPPING_VSEG_SIZE*header->vsegs );
 
-    // computes the base address the array 
+    // computes the base address for procs array 
     proc    = (mapping_proc_t*)   ((char*)header +
                                   MAPPING_HEADER_SIZE +
@@ -157,67 +164,61 @@
                                   MAPPING_TASK_SIZE*header->tasks);
 
-    // computes the base address the array 
-    irq    = (mapping_irq_t*)   ((char*)header +
-                                  MAPPING_HEADER_SIZE +
-                                  MAPPING_CLUSTER_SIZE*header->clusters +
-                                  MAPPING_PSEG_SIZE*header->psegs +
-                                  MAPPING_VSPACE_SIZE*header->vspaces +
-                                  MAPPING_VOBJ_SIZE*header->vobjs +
-                                  MAPPING_VSEG_SIZE*header->vsegs+
-                                  MAPPING_TASK_SIZE*header->tasks+
-                                  MAPPING_PROC_SIZE*header->procs
-                                    );
-
-    // computes the base address the array 
-    coproc    = (mapping_coproc_t*)   ((char*)header +
-                                  MAPPING_HEADER_SIZE +
-                                  MAPPING_CLUSTER_SIZE*header->clusters +
-                                  MAPPING_PSEG_SIZE*header->psegs +
-                                  MAPPING_VSPACE_SIZE*header->vspaces +
-                                  MAPPING_VOBJ_SIZE*header->vobjs +
-                                  MAPPING_VSEG_SIZE*header->vsegs+
-                                  MAPPING_TASK_SIZE*header->tasks+
-                                  MAPPING_PROC_SIZE*header->procs+
-                                  MAPPING_IRQ_SIZE*header->irqs
-                                    );
-
-    // computes the base address the array 
-    cp_port    = (mapping_coproc_port_t*)   ((char*)header +
-                                  MAPPING_HEADER_SIZE +
-                                  MAPPING_CLUSTER_SIZE*header->clusters +
-                                  MAPPING_PSEG_SIZE*header->psegs +
-                                  MAPPING_VSPACE_SIZE*header->vspaces +
-                                  MAPPING_VOBJ_SIZE*header->vobjs +
-                                  MAPPING_VSEG_SIZE*header->vsegs+
-                                  MAPPING_TASK_SIZE*header->tasks+
-                                  MAPPING_PROC_SIZE*header->procs+
-                                  MAPPING_IRQ_SIZE*header->irqs+
-                                  MAPPING_COPROC_SIZE*header->coprocs
-                                    );
-
-    // computes the base address the array 
-    cp_reg    = (mapping_coproc_reg_t*)   ((char*)header +
-                                  MAPPING_HEADER_SIZE +
-                                  MAPPING_CLUSTER_SIZE*header->clusters +
-                                  MAPPING_PSEG_SIZE*header->psegs +
-                                  MAPPING_VSPACE_SIZE*header->vspaces +
-                                  MAPPING_VOBJ_SIZE*header->vobjs +
-                                  MAPPING_VSEG_SIZE*header->vsegs+
-                                  MAPPING_TASK_SIZE*header->tasks+
-                                  MAPPING_PROC_SIZE*header->procs+
-                                  MAPPING_IRQ_SIZE*header->irqs+
-                                  MAPPING_COPROC_SIZE*header->coprocs+
-                                  MAPPING_CP_PORT_SIZE*header->cp_ports
-                                    );
+    // computes the base address for irqs array 
+    irq    = (mapping_irq_t*)    ((char*)header +
+                                  MAPPING_HEADER_SIZE +
+                                  MAPPING_CLUSTER_SIZE*header->clusters +
+                                  MAPPING_PSEG_SIZE*header->psegs +
+                                  MAPPING_VSPACE_SIZE*header->vspaces +
+                                  MAPPING_VOBJ_SIZE*header->vobjs +
+                                  MAPPING_VSEG_SIZE*header->vsegs +
+                                  MAPPING_TASK_SIZE*header->tasks +
+                                  MAPPING_PROC_SIZE*header->procs);
+
+    // computes the base address for coprocs array 
+    coproc = (mapping_coproc_t*)  ((char*)header +
+                                  MAPPING_HEADER_SIZE +
+                                  MAPPING_CLUSTER_SIZE*header->clusters +
+                                  MAPPING_PSEG_SIZE*header->psegs +
+                                  MAPPING_VSPACE_SIZE*header->vspaces +
+                                  MAPPING_VOBJ_SIZE*header->vobjs +
+                                  MAPPING_VSEG_SIZE*header->vsegs +
+                                  MAPPING_TASK_SIZE*header->tasks +
+                                  MAPPING_PROC_SIZE*header->procs +
+                                  MAPPING_IRQ_SIZE*header->irqs);
+
+    // computes the base address for cp_ports array 
+    cp_port = (mapping_cp_port_t*)((char*)header +
+                                  MAPPING_HEADER_SIZE +
+                                  MAPPING_CLUSTER_SIZE*header->clusters +
+                                  MAPPING_PSEG_SIZE*header->psegs +
+                                  MAPPING_VSPACE_SIZE*header->vspaces +
+                                  MAPPING_VOBJ_SIZE*header->vobjs +
+                                  MAPPING_VSEG_SIZE*header->vsegs +
+                                  MAPPING_TASK_SIZE*header->tasks +
+                                  MAPPING_PROC_SIZE*header->procs +
+                                  MAPPING_IRQ_SIZE*header->irqs +
+                                  MAPPING_COPROC_SIZE*header->coprocs);
+
+    // computes the base address for periphs array 
+    periph = (mapping_periph_t*)  ((char*)header +
+                                  MAPPING_HEADER_SIZE +
+                                  MAPPING_CLUSTER_SIZE*header->clusters +
+                                  MAPPING_PSEG_SIZE*header->psegs +
+                                  MAPPING_VSPACE_SIZE*header->vspaces +
+                                  MAPPING_VOBJ_SIZE*header->vobjs +
+                                  MAPPING_VSEG_SIZE*header->vsegs +
+                                  MAPPING_TASK_SIZE*header->tasks +
+                                  MAPPING_PROC_SIZE*header->procs +
+                                  MAPPING_IRQ_SIZE*header->irqs +
+                                  MAPPING_COPROC_SIZE*header->coprocs +
+                                  MAPPING_CP_PORT_SIZE*header->cp_ports);
+
+    ///////////////////////// header /////////////////////////////////////////////
 
     fprintf( fpout, "<?xml version = \"1.0\"?>\n\n");
-
-    ///////////////////////// header /////////////////////////////////////////////
 
     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, "              ttys      = \"%d\"\n", header->ttys);
-    fprintf( fpout, "              fbs       = \"%d\"\n", header->fbs);
     fprintf( fpout, "              vspaces   = \"%d\"\n", header->vspaces);
     fprintf( fpout, "              globals   = \"%d\" >\n\n", header->globals);
@@ -238,4 +239,7 @@
             fprintf( fpout, "                          length = \"0x%x\" />\n",   pseg[pseg_id].length);
         }
+
+    ///////////////////// processors /////////////////////////////////////////////
+
         for ( proc_id = cluster[cluster_id].proc_offset ; 
                 proc_id < cluster[cluster_id].proc_offset + cluster[cluster_id].procs ;
@@ -253,4 +257,7 @@
         }
 
+
+    ///////////////////// coprocessors ///////////////////////////////////////////
+
         for ( coproc_id = cluster[cluster_id].coproc_offset ; 
                 coproc_id < cluster[cluster_id].coproc_offset + cluster[cluster_id].coprocs ;
@@ -266,15 +273,16 @@
                 fprintf( fpout, "                                   vobjname     = \"%s\" />\n",  vobj[vobj_id].name);
             }
-            for ( reg_id = coproc[coproc_id].reg_offset ; 
-                    reg_id < coproc[coproc_id].reg_offset+coproc[coproc_id].regs ;
-                        reg_id++ )
-            {
-                fprintf( fpout, "                           <reg    name        = \"%s\"\n",        cp_reg[reg_id].name);
-                fprintf( fpout, "                                   type        = \"%s\"\n",        reg_type[cp_reg[reg_id].type]);
-                fprintf( fpout, "                                   value       = \"0x%x\"\n",      cp_reg[reg_id].value);
-                fprintf( fpout, "                                   channel     = \"0x%x\"\n",      cp_reg[reg_id].channel_id);
-                fprintf( fpout, "                                   index       = \"0x%x\" />\n",   cp_reg[reg_id].loc_id);
-            }
             fprintf( fpout, "                   </coproc>\n" );
+        }
+
+    ///////////////////// periphs  ///////////////////////////////////////////////
+
+        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);
         }
         fprintf( fpout, "        </cluster>\n" );
@@ -356,5 +364,7 @@
             fprintf( fpout, "                       startid   = \"%d\"\n",      task[task_id].startid);
             fprintf( fpout, "                       usetty    = \"%d\"\n",      task[task_id].use_tty);
-            fprintf( fpout, "                       usefb     = \"%d\" />\n\n", task[task_id].use_fb);
+            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, "        </vspace>\n\n");
