Index: /soft/giet_vm/giet_boot/boot.c
===================================================================
--- /soft/giet_vm/giet_boot/boot.c	(revision 308)
+++ /soft/giet_vm/giet_boot/boot.c	(revision 309)
@@ -31,5 +31,5 @@
 //    - The structure of the various multi-threaded software applications:
 //      number of tasks, communication channels.
-//    - The mapping: placement of virtual objects (vobj) in the virtual segments (vseg),
+//    - The mapping: grouping of virtual objects (vobj) in the virtual segments (vseg),
 //      placement of virtual segments (vseg) in the physical segments (pseg), placement 
 //      of software tasks on the processors, 
@@ -857,13 +857,18 @@
 
 #if BOOT_DEBUG_PT
-mapping_vseg_t* curr;
-mapping_pseg_t* pseg = _get_pseg_base(header);
-unsigned int    pseg_id;
+mapping_vseg_t*    curr;
+mapping_pseg_t*    pseg    = _get_pseg_base(header);
+mapping_cluster_t* cluster = _get_cluster_base(header);
+unsigned int       pseg_id;
 for( pseg_id = 0 ; pseg_id < header->psegs ; pseg_id++ )
 {
+    unsigned int cluster_id = pseg[pseg_id].clusterid;
     _puts("\n[BOOT DEBUG] ****** vsegs mapped on pseg ");
     _puts( pseg[pseg_id].name );
-    _putd( pseg[pseg_id].clusterid);
-    _puts(" ******\n");
+    _puts(" in cluster[");
+    _putd( cluster[cluster_id].x );
+    _puts(",");
+    _putd( cluster[cluster_id].y );
+    _puts("] ******\n");
     for( curr = (mapping_vseg_t*)pseg[pseg_id].next_vseg ;
          curr != 0 ;
@@ -951,4 +956,15 @@
                 case VOBJ_TYPE_MWMR:    // storage capacity is (vobj.length/4 - 5) words
                 {
+#if BOOT_DEBUG_VOBJS
+_puts("MWMR    : ");
+_puts(vobj[vobj_id].name);
+_puts(" / vaddr = ");
+_putx(vobj[vobj_id].vaddr);
+_puts(" / paddr = ");
+_putl(vobj[vobj_id].paddr);
+_puts(" / length = ");
+_putx(vobj[vobj_id].length);
+_puts("\n");
+#endif
                     mwmr_channel_t* mwmr = (mwmr_channel_t *) (vobj[vobj_id].vaddr);
                     mwmr->ptw = 0;
@@ -959,7 +975,5 @@
                     mwmr->lock = 0;
 #if BOOT_DEBUG_VOBJS
-_puts("MWMR    : ");
-_puts(vobj[vobj_id].name);
-_puts(" / depth = ");
+_puts("          fifo depth = ");
 _putd(mwmr->depth);
 _puts(" / width = ");
@@ -974,4 +988,8 @@
 _puts("ELF     : ");
 _puts(vobj[vobj_id].name);
+_puts(" / vaddr = ");
+_putx(vobj[vobj_id].vaddr);
+_puts(" / paddr = ");
+_putl(vobj[vobj_id].paddr);
 _puts(" / length = ");
 _putx(vobj[vobj_id].length);
@@ -983,6 +1001,10 @@
                 {
 #if BOOT_DEBUG_VOBJS
-_puts("BLOB     : ");
+_puts("BLOB    : ");
 _puts(vobj[vobj_id].name);
+_puts(" / vaddr = ");
+_putx(vobj[vobj_id].vaddr);
+_puts(" / paddr = ");
+_putl(vobj[vobj_id].paddr);
 _puts(" / length = ");
 _putx(vobj[vobj_id].length);
@@ -993,11 +1015,20 @@
                 case VOBJ_TYPE_BARRIER:    // init is the number of participants
                 {
+#if BOOT_DEBUG_VOBJS
+_puts("BARRIER : ");
+_puts(vobj[vobj_id].name);
+_puts(" / vaddr = ");
+_putx(vobj[vobj_id].vaddr);
+_puts(" / paddr = ");
+_putl(vobj[vobj_id].paddr);
+_puts(" / length = ");
+_putx(vobj[vobj_id].length);
+_puts("\n");
+#endif
                     giet_barrier_t* barrier = (giet_barrier_t *) (vobj[vobj_id].vaddr);
                     barrier->count = vobj[vobj_id].init;
                     barrier->init = vobj[vobj_id].init;
 #if BOOT_DEBUG_VOBJS
-_puts("BARRIER : ");
-_puts(vobj[vobj_id].name);
-_puts(" / init_value = ");
+_puts("          init_value = ");
 _putd(barrier->init);
 _puts("\n");
@@ -1007,18 +1038,9 @@
                 case VOBJ_TYPE_LOCK:    // init value is "not taken"
                 {
-                    unsigned int* lock = (unsigned int *) (vobj[vobj_id].vaddr);
-                    *lock = 0;
 #if BOOT_DEBUG_VOBJS
 _puts("LOCK    : ");
 _puts(vobj[vobj_id].name);
-_puts("\n");
-#endif
-                    break;
-                }
-                case VOBJ_TYPE_BUFFER:    // nothing to initialise
-                {
-#if BOOT_DEBUG_VOBJS
-_puts("BUFFER  : ");
-_puts(vobj[vobj_id].name);
+_puts(" / vaddr = ");
+_putx(vobj[vobj_id].vaddr);
 _puts(" / paddr = ");
 _putl(vobj[vobj_id].paddr);
@@ -1027,11 +1049,25 @@
 _puts("\n");
 #endif
+                    unsigned int* lock = (unsigned int *) (vobj[vobj_id].vaddr);
+                    *lock = 0;
                     break;
                 }
+                case VOBJ_TYPE_BUFFER:    // nothing to initialise
+                {
+#if BOOT_DEBUG_VOBJS
+_puts("BUFFER  : ");
+_puts(vobj[vobj_id].name);
+_puts(" / vaddr = ");
+_putx(vobj[vobj_id].vaddr);
+_puts(" / paddr = ");
+_putl(vobj[vobj_id].paddr);
+_puts(" / length = ");
+_putx(vobj[vobj_id].length);
+_puts("\n");
+#endif
+                    break;
+                }
                 case VOBJ_TYPE_MEMSPACE:
                 {
-                    giet_memspace_t* memspace = (giet_memspace_t *) vobj[vobj_id].vaddr;
-                    memspace->buffer = (void *) vobj[vobj_id].vaddr + 8;
-                    memspace->size = vobj[vobj_id].length - 8;
 #if BOOT_DEBUG_VOBJS
 _puts("MEMSPACE  : ");
@@ -1039,7 +1075,15 @@
 _puts(" / vaddr = ");
 _putx(vobj[vobj_id].vaddr);
+_puts(" / paddr = ");
+_putl(vobj[vobj_id].paddr);
 _puts(" / length = ");
 _putx(vobj[vobj_id].length);
-_puts(" / buffer = ");
+_puts("\n");
+#endif
+                    giet_memspace_t* memspace = (giet_memspace_t *) vobj[vobj_id].vaddr;
+                    memspace->buffer = (void *) vobj[vobj_id].vaddr + 8;
+                    memspace->size = vobj[vobj_id].length - 8;
+#if BOOT_DEBUG_VOBJS
+_puts("          buffer vbase = ");
 _putx((unsigned int)memspace->buffer);
 _puts(" / size = ");
@@ -1051,24 +1095,38 @@
                 case VOBJ_TYPE_PTAB:    // nothing to initialize
                 {
-                    ptab_found = 1;
 #if BOOT_DEBUG_VOBJS
 _puts("PTAB    : ");
 _puts(vobj[vobj_id].name);
+_puts(" / vaddr = ");
+_putx(vobj[vobj_id].vaddr);
+_puts(" / paddr = ");
+_putl(vobj[vobj_id].paddr);
 _puts(" / length = ");
 _putx(vobj[vobj_id].length);
 _puts("\n");
 #endif
+                    ptab_found = 1;
                     break;
                 }
                 case VOBJ_TYPE_CONST:
                 {
-                    unsigned int* addr = (unsigned int *) vobj[vobj_id].vaddr;
-                    *addr = vobj[vobj_id].init;
 #if BOOT_DEBUG_VOBJS
 _puts("CONST   : ");
 _puts(vobj[vobj_id].name);
-_puts(" / Paddr :");
+_puts(" / vaddr = ");
+_putx(vobj[vobj_id].vaddr);
+_puts(" / paddr = ");
 _putl(vobj[vobj_id].paddr);
+_puts(" / length = ");
+_putx(vobj[vobj_id].length);
 _puts(" / init = ");
+_putx(vobj[vobj_id].init);
+_puts("\n");
+#endif
+                    unsigned int* addr = (unsigned int *) vobj[vobj_id].vaddr;
+                    *addr = vobj[vobj_id].init;
+
+#if BOOT_DEBUG_VOBJS
+_puts("          init = ");
 _putx(*addr);
 _puts("\n");
@@ -1213,5 +1271,5 @@
         if ( cluster[cluster_id].procs > 0 )
         {
-            // get scheduler array virtual base address and length 
+            // get scheduler array virtual base address and length from mapping
             unsigned int        sched_vbase;   // schedulers segment virtual base address
             unsigned int        sched_length;  // schedulers segment length
@@ -1303,5 +1361,5 @@
 
            
-            // loop on irqs for actual HWI / PTI / WTI vectors initialisation      
+            // loop on irqs in ICU for actual HWI / PTI / WTI vectors initialisation      
             for ( irq_id = periph[periph_id].irq_offset ;
                   irq_id < periph[periph_id].irq_offset + periph[periph_id].irqs ;
@@ -1309,23 +1367,4 @@
             {
                 unsigned int lpid    = irq[irq_id].dstid;
-                unsigned int dstx    = irq[irq_id].dstx;
-                unsigned int dsty    = irq[irq_id].dsty;
-                if ( (dstx != x) || (dsty != y) )
-                {
-                    _puts("\n[BOOT ERROR] Bad IRQ cluster coordinates in cluster[");
-                    _putd( x );
-                    _puts(",");
-                    _putd( y );
-                    _puts("]\n - dstx  = ");
-                    _putd( dstx );
-                    _puts("\n - dsty  = ");
-                    _putd( dsty );
-                    _puts("\n - x     = ");
-                    _putd( x );
-                    _puts("\n - y     = ");
-                    _putd( y );
-                    _puts("\n");
-                    _exit();
-                }
                 if ( lpid >= cluster[cluster_id].procs )
                 {
@@ -1392,9 +1431,5 @@
 _puts(" in vspace ");
 _puts( vspace[vspace_id].name );
-_puts(" running on cluster[");
-_putd( x );
-_puts(",");
-_putd( y );
-_puts("]\n");
+_puts("\n");
 #endif
             // compute gpid (global processor index) and scheduler base address
@@ -1562,9 +1597,9 @@
 _putd( task_id );
 _puts(" allocated to processor[");
-_putd( x )
+_putd( x );
 _puts(",");
-_putd( y )
+_putd( y );
 _puts(",");
-_putd( lpid )
+_putd( lpid );
 _puts("]\n  - ctx[LTID]   = ");
 _putd( psched->context[ltid][CTX_LTID_ID] );
@@ -1970,5 +2005,5 @@
                     }
 #if BOOT_DEBUG_PERI
-_puts("- IOC / channels = ");
+_puts("- IOC : channels = ");
 _putd(channels);
 _puts("\n");
@@ -1983,5 +2018,5 @@
                     }
 #if BOOT_DEBUG_PERI
-_puts("- CMA / channels = ");
+_puts("- CMA : channels = ");
 _putd(channels);
 _puts("\n");
@@ -1996,5 +2031,5 @@
                     }
 #if BOOT_DEBUG_PERI
-_puts("- NIC / channels = ");
+_puts("- NIC : channels = ");
 _putd(channels);
 _puts("\n");
@@ -2006,5 +2041,5 @@
                     // nothing to do
 #if BOOT_DEBUG_PERI
-_puts("- TTY / channels = ");
+_puts("- TTY : channels = ");
 _putd(channels);
 _puts("\n");
@@ -2018,5 +2053,5 @@
 
 #if BOOT_DEBUG_PERI
-_puts("- IOB / channels = ");
+_puts("- IOB : channels = ");
 _putd(channels);
 _puts(" / XICU_BASE = ");
@@ -2033,5 +2068,4 @@
                         // TODO
                         // get the iommu page table physical address
-                        // define IPI address mapping the IOC interrupt 
                         // set IOMMU page table address
                         // pseg_base[IOB_IOMMU_PTPR] = ptab_pbase;    
@@ -2045,9 +2079,11 @@
                           
 #if BOOT_DEBUG_PERI
-_puts("- PIC / channels = ");
+_puts("- PIC : channels = ");
 _putd(channels);
-_puts("\n");
-#endif
-                    // scan all HWI IRQs defined in mapping for PIC component,
+_puts(" at cycle ");
+_putd(_get_proctime());
+_puts("\n");
+#endif
+                    // scan all IRQs defined in mapping for PIC component,
                     // and initialises addresses for WTI IRQs
                     for ( channel_id = periph[periph_id].irq_offset ;
@@ -2055,14 +2091,14 @@
                           channel_id++ )
                     {
-                        unsigned int hwi_id  = irq[channel_id].srcid;  // HWI index in PIC
-                        unsigned int wti_id  = irq[channel_id].dstid;  // WTI index in XCU
-                        unsigned int x       = irq[channel_id].dstx;   // XCU X coordinate
-                        unsigned int y       = irq[channel_id].dsty;   // XCU Y coordinate
-                        unsigned int cluster = (x<<Y_WIDTH) + y;       // XCU cluster
+                        unsigned int hwi_id     = irq[channel_id].srcid;  // HWI index in PIC
+                        unsigned int wti_id     = irq[channel_id].dstid;  // WTI index in XCU
+                        unsigned int x          = irq[channel_id].dstx;   // XCU X coordinate
+                        unsigned int y          = irq[channel_id].dsty;   // XCU Y coordinate
+                        unsigned int cluster_xy = (x<<Y_WIDTH) + y;       // XCU cluster
                         unsigned int vaddr;
 
                         _xcu_get_wti_address( wti_id, &vaddr );
 
-                        _pic_init( hwi_id, vaddr, cluster ); 
+                        _pic_init( hwi_id, vaddr, cluster_xy ); 
 #if BOOT_DEBUG_PERI
 _puts("    hwi_index = ");
