Index: soft/giet_vm/giet_drivers/sdc_driver.c
===================================================================
--- soft/giet_vm/giet_drivers/sdc_driver.c	(revision 657)
+++ soft/giet_vm/giet_drivers/sdc_driver.c	(revision 709)
@@ -32,7 +32,7 @@
 ///////////////////////////////////////////////////////////////////////////////////
 
-// global index ot the task, for each entry in the command list
-__attribute__((section(".kdata")))
-unsigned int     _ahci_gtid[32];
+// global index ot the thread, for each entry in the command list
+__attribute__((section(".kdata")))
+unsigned int     _ahci_trdid[32];
 
 // status of the command, for each entry in the command list
@@ -406,6 +406,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 
@@ -422,11 +422,11 @@
 #endif
         unsigned int save_sr;
-        unsigned int ltid = _get_current_task_id();
+        unsigned int ltid = _get_thread_ltid();
 
         // activates interrupt 
         _sdc_set_register( AHCI_PXIE , 0x00000001 ); 
 
-        // set _ahci_gtid[ptw] 
-        _ahci_gtid[ptw] = (procid<<16) + ltid;
+        // set _ahci_trdid[ptw] 
+        _ahci_trdid[ptw] = (x<<24) + (y<<16) + (p<<8) + ltid;
 
         // enters critical section
@@ -435,5 +435,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 );
         
@@ -441,10 +441,10 @@
         _sdc_set_register( AHCI_PXCI, (1<<ptw) );
 
-        // deschedule task
+        // deschedule thread
         _ctx_switch();                      
 
 #if GIET_DEBUG_IOC
 if (_get_proctime() > GIET_DEBUG_IOC)
-_printf("\n[DEBUG SDC] _sdc_access() : task %d on P[%d,%d,%d] resume at cycle %d\n",
+_printf("\n[DEBUG SDC] _sdc_access() : thread %d on P[%d,%d,%d] resume at cycle %d\n",
         ltid , x , y , p , _get_proctime() );
 #endif
@@ -497,18 +497,16 @@
             _sdc_set_register( AHCI_PXIS , 0 );
  
-            // identify waiting task 
-            unsigned int procid  = _ahci_gtid[cmd_id]>>16;
-            unsigned int ltid    = _ahci_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       = (_ahci_trdid[cmd_id]>>24) & 0xFF;
+            unsigned int y       = (_ahci_trdid[cmd_id]>>16) & 0xFF;
+            unsigned int p       = (_ahci_trdid[cmd_id]>> 8) & 0xFF;
+            unsigned int ltid    = (_ahci_trdid[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
@@ -517,5 +515,5 @@
 if (_get_proctime() > GIET_DEBUG_IOC)
 _printf("\n[DEBUG SDC] _sdc_isr() : command %d completed at cycle %d\n"
-        "  resume task %d running on P[%d,%d,%d] / status = %x\n",
+        "  resume thread %d running on P[%d,%d,%d] / status = %x\n",
         cmd_id , _get_proctime() ,
         ltid , x , y , p , _ahci_status[cmd_id] );
