Index: soft/giet_vm/giet_xml/xml_parser.c
===================================================================
--- soft/giet_vm/giet_xml/xml_parser.c	(revision 645)
+++ soft/giet_vm/giet_xml/xml_parser.c	(revision 709)
@@ -11,5 +11,5 @@
 // 1) the multi-cluster/multi-processors hardware architecture description
 // 2) the various multi-threaded software applications
-// 3) the mapping directives bor both the tasks and the virtual segments.
+// 3) the mapping directives bor both the threads and the virtual segments.
 // The corresponding C structures are defined in the "mapping_info.h" file.
 ///////////////////////////////////////////////////////////////////////////////////////
@@ -31,5 +31,5 @@
 #define MAX_PSEGS      4096
 #define MAX_VSPACES    1024
-#define MAX_TASKS      4096
+#define MAX_THREADS      4096
 #define MAX_VSEGS      4096
 #define MAX_PROCS      1024
@@ -48,5 +48,5 @@
 mapping_vspace_t *   vspace[MAX_VSPACES];    // vspace array
 mapping_vseg_t *     vseg[MAX_VSEGS];        // vseg array
-mapping_task_t *     task[MAX_TASKS];        // task array
+mapping_thread_t *   thread[MAX_THREADS];      // thread array
 mapping_proc_t *     proc[MAX_PROCS];        // proc array
 mapping_irq_t *      irq[MAX_IRQS];          // irq array
@@ -72,6 +72,6 @@
 unsigned int vseg_loc_index = 0;
 
-unsigned int task_index = 0;
-unsigned int task_loc_index = 0;
+unsigned int thread_index = 0;
+unsigned int thread_loc_index = 0;
 
 
@@ -275,6 +275,6 @@
 
 
-//////////////////////////////////////
-void taskNode(xmlTextReaderPtr reader) 
+////////////////////////////////////////
+void threadNode(xmlTextReaderPtr reader) 
 {
     unsigned int ok;
@@ -285,15 +285,15 @@
     if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_END_ELEMENT) return;
 
-    if (task_index >= MAX_TASKS) 
-    {
-        printf("[XML ERROR] The number of tasks is larger than %d\n", MAX_TASKS);
-        exit(1);
-    }
-
-#if XML_PARSER_DEBUG
-printf("   task %d\n", task_loc_index);
-#endif
-
-    task[task_index] = (mapping_task_t *) malloc(sizeof(mapping_task_t));
+    if (thread_index >= MAX_THREADS) 
+    {
+        printf("[XML ERROR] The number of threads is larger than %d\n", MAX_THREADS);
+        exit(1);
+    }
+
+#if XML_PARSER_DEBUG
+printf("   thread %d\n", thread_loc_index);
+#endif
+
+    thread[thread_index] = (mapping_thread_t *) malloc(sizeof(mapping_thread_t));
 
     ////////// get name attribute
@@ -304,20 +304,27 @@
 printf("      name      = %s\n", str);
 #endif
-        strncpy( task[task_index]->name, str, 31 );
-    }
-    else 
-    {
-        printf("[XML ERROR] illegal or missing <name> attribute for task (%d,%d)\n", 
-                vspace_index, task_loc_index);
-        exit(1);
-    }
-
-    ///////// get trdid attribute (optional)
-    value = getIntValue(reader, "trdid", &ok);
-#if XML_PARSER_DEBUG
-printf("      trdid     = %d\n", value );
-#endif
-    if ( ok ) task[task_index]->trdid = value;
-    else      task[task_index]->trdid = task_loc_index;
+        strncpy( thread[thread_index]->name, str, 31 );
+    }
+    else 
+    {
+        printf("[XML ERROR] illegal or missing <name> for thread %d in vspace %d\n", 
+                thread_loc_index, vspace_index);
+        exit(1);
+    }
+
+    ///////// get is_main attribute
+    value = getIntValue(reader, "is_main", &ok);
+    if ( ok ) 
+    {
+#if XML_PARSER_DEBUG
+printf("      is_main   = %d\n", value );
+#endif
+        thread[thread_index]->is_main = value;
+    }
+    else
+    {
+        printf("[XML ERROR] illegal or missing <is_main> for thread %d in vspace %d\n", 
+                thread_loc_index, vspace_index);
+    }
 
     ///////// get x coordinate 
@@ -328,6 +335,6 @@
     if ( !(ok && (x < header->x_size)) ) 
     {
-        printf("[XML ERROR] illegal or missing < x > attribute for task (%d,%d)\n",
-                vspace_index, task_loc_index);
+        printf("[XML ERROR] illegal or missing < x > for thread %d in vspace %d)\n",
+                thread_loc_index, vspace_index);
         exit(1);
     }  
@@ -340,6 +347,6 @@
     if ( !(ok && (y < header->y_size)) ) 
     {
-        printf("[XML ERROR] illegal or missing < y > attribute for task (%d,%d)\n",
-                vspace_index, task_loc_index);
+        printf("[XML ERROR] illegal or missing < y > for thread %d in vspace %d)\n",
+                thread_loc_index, vspace_index);
         exit(1);
     }  
@@ -352,10 +359,10 @@
     if( index >= 0 )
     {
-        task[task_index]->clusterid = index;
+        thread[thread_index]->clusterid = index;
     }
     else
     {
-        printf("[XML ERROR] <clusterid> not found for task (%d,%d)\n",
-                vspace_index, task_loc_index);
+        printf("[XML ERROR] <clusterid> not found for thread %d in vspace %d)\n",
+                thread_loc_index, vspace_index);
         exit(1);
     }
@@ -368,16 +375,16 @@
 printf("      proclocid = %x\n", value);
 #endif
-        if (value >= cluster[task[task_index]->clusterid]->procs) 
-        {
-            printf("[XML ERROR] <proclocid> too large for task (%d,%d)\n",
-                    vspace_index, task_loc_index);
+        if (value >= cluster[thread[thread_index]->clusterid]->procs) 
+        {
+            printf("[XML ERROR] <proclocid> too large for thread %d in vspace %d\n",
+                    thread_loc_index, vspace_index);
             exit(1);
         }
-        task[task_index]->proclocid = value;
+        thread[thread_index]->proclocid = value;
     }  
     else 
     {
-        printf("[XML ERROR] illegal or missing <p> attribute for task (%d,%d)\n", 
-                vspace_index, task_loc_index);
+        printf("[XML ERROR] illegal or missing < p > for thread %d in vspace %d)\n",
+                thread_loc_index, vspace_index);
         exit(1);
     }
@@ -396,10 +403,10 @@
 printf("      stack_id  = %d\n", index);
 #endif
-            task[task_index]->stack_vseg_id = index;
+            thread[thread_index]->stack_vseg_id = index;
         }
         else 
         {
-            printf("[XML ERROR] illegal or missing <stackname> for task (%d,%d)\n", 
-                    vspace_index, task_loc_index);
+            printf("[XML ERROR] illegal or missing <stackname> for thread %d in vspace %d)\n",
+                    thread_loc_index, vspace_index);
             exit(1);
         }
@@ -407,6 +414,6 @@
     else 
     {
-        printf("[XML ERROR] illegal or missing <stackname> for task (%d,%d)\n", 
-                vspace_index, task_loc_index);
+        printf("[XML ERROR] illegal or missing <stackname> for thread %d in vspace %d)\n",
+                thread_loc_index, vspace_index);
         exit(1);
     }
@@ -425,10 +432,10 @@
 printf("      heap_id   = %d\n", index );
 #endif
-            task[task_index]->heap_vseg_id = index;
+            thread[thread_index]->heap_vseg_id = index;
         }
         else 
         {
-            printf("[XML ERROR] illegal or missing <heapname> for task (%d,%d)\n", 
-                   vspace_index, task_loc_index);
+            printf("[XML ERROR] illegal or missing <heapname> for thread %d in vspace %d)\n", 
+                   thread_loc_index, vspace_index);
             exit(1);
         }
@@ -436,5 +443,5 @@
     else 
     {
-        task[task_index]->heap_vseg_id = -1;
+        thread[thread_index]->heap_vseg_id = -1;
     }
 
@@ -446,16 +453,16 @@
 printf("      startid   = %x\n", value);
 #endif
-        task[task_index]->startid = value;
+        thread[thread_index]->startid = value;
     }  
     else 
     {
-        printf("[XML ERROR] illegal or missing <startid> attribute for task (%d,%d)\n", 
-                vspace_index, task_loc_index);
-        exit(1);
-    }
-
-    task_index++;
-    task_loc_index++;
-} // end taskNode()
+        printf("[XML ERROR] illegal or missing <startid> for thread %d in vspace %d\n", 
+                thread_loc_index, vspace_index);
+        exit(1);
+    }
+
+    thread_index++;
+    thread_loc_index++;
+} // end threadNode()
 
 
@@ -698,6 +705,6 @@
     unsigned int ok;
 
-    vseg_loc_index = 0;
-    task_loc_index = 0;
+    vseg_loc_index   = 0;
+    thread_loc_index = 0;
 
     if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_END_ELEMENT) return;
@@ -727,11 +734,11 @@
     else    vspace[vspace_index]->active = 0;
     
-    ////////// set vseg_offset and task_offset attributes
+    ////////// set vseg_offset and thread_offset attributes
     vspace[vspace_index]->vseg_offset = vseg_index;
-    vspace[vspace_index]->task_offset = task_index;
-
-    ////////// initialise vsegs and tasks attributes
+    vspace[vspace_index]->thread_offset = thread_index;
+
+    ////////// initialise vsegs and threads attributes
     vspace[vspace_index]->vsegs = 0;
-    vspace[vspace_index]->tasks = 0;
+    vspace[vspace_index]->threads = 0;
 
     ////////// get startname attribute
@@ -754,8 +761,8 @@
             vspace[vspace_index]->vsegs += 1;
         }
-        else if (strcmp(tag, "task") == 0) 
-        {
-            taskNode(reader);
-            vspace[vspace_index]->tasks += 1;
+        else if (strcmp(tag, "thread") == 0) 
+        {
+            threadNode(reader);
+            vspace[vspace_index]->threads += 1;
         }
         else if (strcmp(tag, "#text")    == 0) { }
@@ -777,10 +784,10 @@
 
 #if XML_PARSER_DEBUG
-printf("      vsegs       = %d\n", vspace[vspace_index]->vsegs );
-printf("      tasks       = %d\n", vspace[vspace_index]->tasks );
-printf("      vseg_offset = %d\n", vspace[vspace_index]->vseg_offset );
-printf("      task_offset = %d\n", vspace[vspace_index]->task_offset );
-printf("      start_id    = %d\n", vspace[vspace_index]->start_vseg_id );
-printf("      active      = %x\n", vspace[vspace_index]->active );
+printf("      vsegs         = %d\n", vspace[vspace_index]->vsegs );
+printf("      threads       = %d\n", vspace[vspace_index]->threads );
+printf("      vseg_offset   = %d\n", vspace[vspace_index]->vseg_offset );
+printf("      thread_offset = %d\n", vspace[vspace_index]->thread_offset );
+printf("      start_id      = %d\n", vspace[vspace_index]->start_vseg_id );
+printf("      active        = %x\n", vspace[vspace_index]->active );
 printf("  end vspace %d\n\n", vspace_index);
 #endif
@@ -1488,5 +1495,5 @@
         {
             header->vsegs = vseg_index;
-            header->tasks = task_index;
+            header->threads = thread_index;
             return;
         }
@@ -1668,5 +1675,5 @@
     header->psegs     = 0;
     header->vsegs     = 0;
-    header->tasks     = 0;
+    header->threads   = 0;
     header->procs     = 0;
     header->irqs      = 0;
@@ -1765,5 +1772,5 @@
 printf("psegs     = %d\n", header->psegs);
 printf("vsegs     = %d\n", header->vsegs);
-printf("tasks     = %d\n", header->tasks);
+printf("threads   = %d\n", header->threads);
 printf("procs     = %d\n", header->procs);
 printf("irqs      = %d\n", header->irqs);
@@ -1787,6 +1794,6 @@
     // write vsegs
     BuildTable(fdout, "vseg", vseg_index, sizeof(mapping_vseg_t), (char **) vseg);
-    // write tasks array
-    BuildTable(fdout, "task", task_index, sizeof(mapping_task_t), (char **) task);
+    // write threads array
+    BuildTable(fdout, "thread", thread_index, sizeof(mapping_thread_t), (char **) thread);
     //building procs array
     BuildTable(fdout, "proc", proc_index, sizeof(mapping_proc_t), (char **) proc);
