Ignore:
Timestamp:
Oct 1, 2015, 4:20:46 PM (9 years ago)
Author:
alain
Message:

Major release: Change the task model to implement the POSIX threads API.

  • The shell "exec" and "kill" commands can be used to activate/de-activate the applications.
  • The "pause", "resume", and "context" commands can be used to stop, restart, a single thtead or to display the thread context.

This version has been tested on the following multi-threaded applications,
that have been modified to use the POSIX threads:

  • classif
  • convol
  • transpose
  • gameoflife
  • raycast
File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_drivers/mwr_driver.c

    r668 r709  
    7474unsigned int   _coproc_error[X_SIZE*Y_SIZE];
    7575
    76 // descheduled task gtid (for MODE_DMA_IRQ)
    77 __attribute__((section(".kdata")))
    78 unsigned int   _coproc_gtid[X_SIZE*Y_SIZE];
     76// descheduled thread trdid (for MODE_DMA_IRQ)
     77__attribute__((section(".kdata")))
     78unsigned int   _coproc_trdid[X_SIZE*Y_SIZE];
    7979
    8080/////////////////////////////////////////////////////////////////////////////
     
    205205    _coproc_error[cluster_id]  = error;
    206206
    207     // identify task waiting on coprocessor completion
    208     // this task can run in a remote cluster
    209     unsigned int r_gtid    = _coproc_gtid[cluster_id];
    210     unsigned int r_procid  = r_gtid>>16;
    211     unsigned int r_ltid    = r_gtid & 0xFFFF;
    212     unsigned int r_cluster = r_procid >> P_WIDTH;
    213     unsigned int r_x       = r_cluster >> Y_WIDTH;
    214     unsigned int r_y       = r_cluster & ((1<<Y_WIDTH)-1);
    215     unsigned int r_p       = r_procid & ((1<<P_WIDTH)-1);
     207    // identify thread waiting on coprocessor completion (can run in a remote cluster)
     208    unsigned int r_x       = (_coproc_trdid[cluster_id]>>24) & 0xFF;
     209    unsigned int r_y       = (_coproc_trdid[cluster_id]>>16) & 0xFF;
     210    unsigned int r_p       = (_coproc_trdid[cluster_id]>> 8) & 0xFF;
     211    unsigned int r_ltid    = (_coproc_trdid[cluster_id]    ) & 0xFF;
    216212
    217213    // Reset NORUN_MASK_IOC bit
    218214    static_scheduler_t* psched  = (static_scheduler_t*)_schedulers[r_x][r_y][r_p];
    219     unsigned int*       ptr     = &psched->context[r_ltid][CTX_NORUN_ID];
     215    unsigned int*       ptr     = &psched->context[r_ltid].slot[CTX_NORUN_ID];
    220216    _atomic_and( ptr , ~NORUN_MASK_COPROC );
    221217
    222     // send a WAKUP WTI to processor running the sleeping task
    223     _xcu_send_wti( r_cluster,   
     218    // send a WAKUP WTI to processor running the sleeping thread
     219    _xcu_send_wti( (r_x<<Y_WIDTH) + r_y,
    224220                   r_p,
    225221                   0 );          // don't force context switch
     
    228224unsigned int p          = gpid & ((1<<P_WIDTH)-1);
    229225_printf("\n[GIET DEBUG COPROC] P[%d,%d,%d] executes _mwr_isr() at cycle %d\n"
    230         "  for task %d running on P[%d,%d,%d] / error = %d\n",
     226        "  for thread %d running on P[%d,%d,%d] / error = %d\n",
    231227        x , y , p , _get_proctime() , r_ltid , r_x , r_y , r_p , error );
    232228#endif
Note: See TracChangeset for help on using the changeset viewer.