Index: soft/giet_vm/giet_drivers/hba_driver.c
===================================================================
--- soft/giet_vm/giet_drivers/hba_driver.c	(revision 657)
+++ soft/giet_vm/giet_drivers/hba_driver.c	(revision 709)
@@ -46,5 +46,5 @@
 sqt_lock_t          _hba_allocator_lock  __attribute__((aligned(64)));
 
-// state of each slot (allocated to a task or not)
+// state of each slot (allocated to a thread or not)
 // access must be protected by the allocator_lock in descheduling mode
 __attribute__((section(".kdata")))
@@ -56,7 +56,7 @@
 unsigned int        _hba_active_cmd[32]; 
 
-// global index of the task, for each entry in the command list
-__attribute__((section(".kdata")))
-unsigned int        _hba_gtid[32];
+// global index of the thread, for each entry in the command list
+__attribute__((section(".kdata")))
+unsigned int        _hba_trid[32];
 
 // status of HBA commands
@@ -97,5 +97,5 @@
 
 ///////////////////////////////////////////////////////////////////////////////
-// This blocking fonction allocates a free command index to the task. 
+// This blocking fonction allocates a free command index to the thread. 
 // The hba_allocator_lock is not used in boot mode.
 // It returns the allocated command index (between 0 and 31)
@@ -132,5 +132,5 @@
 ///////////////////////////////////////////////////////////////////////////////
 // This function releases the command index in the hba_allocated_cmd table.
-// There is no need to take the lock because only the task which owns the 
+// There is no need to take the lock because only the thread which owns the 
 // command can release it.
 // return 0 if success, -1 if error
@@ -281,6 +281,6 @@
 
     /////////////////////////////////////////////////////////////////
-    // in descheduling mode, we deschedule the task
-    // and use an interrupt to reschedule the task.
+    // in descheduling mode, we deschedule the thread
+    // and use an interrupt to reschedule the thread.
     // We need a critical section, because we must set the NORUN bit
 	// before to launch the transfer, and we don't want to be 
@@ -297,11 +297,11 @@
 #endif
         unsigned int save_sr;
-        unsigned int ltid = _get_current_task_id();
+        unsigned int ltid = _get_thread_ltid();
 
         // activates HBA interrupts 
         _hba_set_register( HBA_PXIE , 0x00000001 ); 
 
-        // set _hba_gtid[cmd_id] 
-        _hba_gtid[cmd_id] = (procid<<16) + ltid;
+        // set _hba_trid[cmd_id] 
+        _hba_trid[cmd_id] = (x<<24) + (y<<16) + (p<<8) + ltid;
 
         // enters critical section
@@ -310,5 +310,5 @@
         // Set NORUN_MASK_IOC bit 
         static_scheduler_t* psched  = (static_scheduler_t*)_schedulers[x][y][p];
-        unsigned int*       ptr     = &psched->context[ltid][CTX_NORUN_ID];
+        unsigned int*       ptr     = &psched->context[ltid].slot[CTX_NORUN_ID];
         _atomic_or( ptr , NORUN_MASK_IOC );
       
@@ -319,10 +319,10 @@
         _hba_active_cmd[cmd_id] = 1;
 
-        // deschedule task
+        // deschedule thread
         _ctx_switch();                      
 
 #if GIET_DEBUG_IOC
 if (_get_proctime() > GIET_DEBUG_IOC)
-_printf("\n[DEBUG HBA] _hba_access() : task %d on P[%d,%d,%d] resume at cycle %d\n",
+_printf("\n[DEBUG HBA] _hba_access() : thread %d on P[%d,%d,%d] resume at cycle %d\n",
         ltid , x , y , p , _get_proctime() );
 #endif
@@ -438,18 +438,16 @@
             _hba_active_cmd[cmd_id] = 0;
 
-            // identify waiting task 
-            unsigned int procid  = _hba_gtid[cmd_id]>>16;
-            unsigned int ltid    = _hba_gtid[cmd_id] & 0xFFFF;
-            unsigned int cluster = procid >> P_WIDTH;
-            unsigned int x       = cluster >> Y_WIDTH;
-            unsigned int y       = cluster & ((1<<Y_WIDTH)-1);
-            unsigned int p       = procid & ((1<<P_WIDTH)-1);
+            // identify waiting thread 
+            unsigned int x       = (_hba_trid[cmd_id]>>24) & 0xFF;
+            unsigned int y       = (_hba_trid[cmd_id]>>16) & 0xFF;
+            unsigned int p       = (_hba_trid[cmd_id]>> 8) & 0xFF;
+            unsigned int ltid    = (_hba_trid[cmd_id]    ) & 0xFF;
  
             // Reset NORUN_MASK_IOC bit 
             static_scheduler_t* psched  = (static_scheduler_t*)_schedulers[x][y][p];
-            _atomic_and( &psched->context[ltid][CTX_NORUN_ID] , ~NORUN_MASK_IOC );
-
-            // send a WAKUP WTI to processor running the waiting task 
-            _xcu_send_wti( cluster , 
+            _atomic_and( &psched->context[ltid].slot[CTX_NORUN_ID] , ~NORUN_MASK_IOC );
+
+            // send a WAKUP WTI to processor running the waiting thread 
+            _xcu_send_wti( (x<<Y_WIDTH) + y,
                            p , 
                            0 );          // don't force context switch
@@ -458,5 +456,5 @@
 if (_get_proctime() > GIET_DEBUG_IOC)
 _printf("\n[DEBUG HBA] _hba_isr() : command %d completed at cycle %d\n"
-        "  resume task %d running on P[%d,%d,%d]\n",
+        "  resume thread %d running on P[%d,%d,%d]\n",
         cmd_id , _get_proctime() ,
         ltid , x , y , p );
