Changeset 735 for soft


Ignore:
Timestamp:
Dec 3, 2015, 4:38:59 PM (8 years ago)
Author:
alain
Message:

Introduce two new arguments "cluster_xy" and "coproc_type"
in the system calls related to hardware coprocessors.

Location:
soft/giet_vm/giet_libs
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_libs/mwmr_channel.c

    r731 r735  
    1111#include "stdint.h"
    1212#include "user_lock.h"
     13
     14// macro to use a shared TTY
     15#define PRINTF(...)    lock_acquire( &tty_lock ); \
     16                       giet_tty_printf(__VA_ARGS__);  \
     17                       lock_release( &tty_lock );
     18extern user_lock_t tty_lock;
    1319
    1420//////////////////////////////////////
     
    251257#endif
    252258
    253     uint32_t n;
    254     uint32_t spaces; // number of empty slots (in words)
    255     uint32_t nwords; // requested transfer length (in words)
    256     uint32_t depth;  // channel depth (in words)
    257     uint32_t width;  // channel width (in words)
    258     uint32_t sts;    // channel sts
    259     uint32_t ptw;    // channel ptw
     259    uint32_t          n;
     260    uint32_t          spaces; // number of empty slots (in words)
     261    uint32_t          nwords; // requested transfer length (in words)
     262    uint32_t          depth;  // channel depth (in words)
     263    uint32_t          width;  // channel width (in words)
     264    volatile uint32_t sts;    // channel status
     265    volatile uint32_t ptw;    // channel ptw
    260266
    261267    if (items == 0)  return;
     
    292298
    293299            lock_release( &mwmr->lock );
     300
    294301            return;
    295302        }
     
    341348
    342349    uint32_t n;
    343     uint32_t nwords; // requested transfer length (in words)
    344     uint32_t depth;  // channel depth (in words)
    345     uint32_t width;  // channel width (in words)
    346     uint32_t sts;    // channel sts
    347     uint32_t ptr;    // channel ptr
     350    uint32_t          nwords; // requested transfer length (in words)
     351    uint32_t          depth;  // channel depth (in words)
     352    uint32_t          width;  // channel width (in words)
     353    volatile uint32_t sts;    // channel status
     354    volatile uint32_t ptr;    // channel ptr
    348355
    349356    if (items == 0) return;
     
    379386
    380387            lock_release( &mwmr->lock );
     388
    381389            return;
    382390        }
  • soft/giet_vm/giet_libs/stdio.c

    r722 r735  
    178178
    179179///////////////////////////////////////////////////
    180 void giet_coproc_alloc( unsigned int   coproc_type,
     180void giet_coproc_alloc( unsigned int   cluster_xy,
     181                        unsigned int   coproc_type,
    181182                        unsigned int*  coproc_info )
    182183{
    183184    if ( sys_call( SYSCALL_COPROC_ALLOC,
     185                   cluster_xy,
    184186                   coproc_type,
    185187                   (unsigned int)coproc_info,
    186                    0, 0 ) ) 
     188                   0 ) ) 
    187189        giet_pthread_exit("error in giet_coproc_alloc()");
    188190}
    189191
    190 /////////////////////////////////////////////////////////
    191 void giet_coproc_release( unsigned int coproc_reg_index )
     192//////////////////////////////////////////////////
     193void giet_coproc_release( unsigned int cluster_xy,
     194                          unsigned int coproc_type )
    192195{
    193196    if ( sys_call( SYSCALL_COPROC_RELEASE,
    194                    coproc_reg_index,
    195                    0, 0, 0 ) ) 
     197                   cluster_xy,
     198                   coproc_type,
     199                   0 , 0 ) ) 
    196200        giet_pthread_exit("error in giet_coproc_release()");
    197201}
    198202
    199203//////////////////////////////////////////////////////////////////
    200 void giet_coproc_channel_init( unsigned int            channel,
     204void giet_coproc_channel_init( unsigned int            cluster_xy,
     205                               unsigned int            coproc_type,
     206                               unsigned int            channel,
    201207                               giet_coproc_channel_t*  desc )
    202208{
    203209    if ( sys_call( SYSCALL_COPROC_CHANNEL_INIT,
     210                   cluster_xy,
     211                   coproc_type,
    204212                   channel,
    205                    (unsigned int)desc,
    206                    0, 0 ) )
     213                   (unsigned int)desc ) )
    207214        giet_pthread_exit("error in giet_coproc_channel_init()");
    208215}
    209216
    210 /////////////////////////////////////////////////////
    211 void giet_coproc_run( unsigned int coproc_reg_index )
     217//////////////////////////////////////////////
     218void giet_coproc_run( unsigned int cluster_xy,
     219                      unsigned int coproc_type )
    212220{
    213221    if ( sys_call( SYSCALL_COPROC_RUN,
    214                    coproc_reg_index,
    215                    0, 0, 0 ) )
     222                   cluster_xy,
     223                   coproc_type,
     224                   0 , 0 ) )
    216225        giet_pthread_exit("error in giet_coproc_run()");
    217226}
    218227
    219 ////////////////////////////
    220 void giet_coproc_completed()
     228////////////////////////////////////////////////////
     229void giet_coproc_completed( unsigned int cluster_xy,
     230                            unsigned int coproc_type )
    221231{
    222232    if ( sys_call( SYSCALL_COPROC_COMPLETED,
    223                    0, 0, 0, 0 ) )
     233                   cluster_xy,
     234                   coproc_type,
     235                   0 , 0 ) )
    224236        giet_pthread_exit("error in giet_coproc_completed");
    225237}
  • soft/giet_vm/giet_libs/stdio.h

    r722 r735  
    244244    unsigned int  buffer_size;     // memory buffer size
    245245    unsigned int  buffer_vaddr;    // memory buffer virtual address
    246     unsigned int  mwmr_vaddr;      // MWMR descriptor virtual address
    247     unsigned int  lock_vaddr;      // lock for MWMR virtual address
     246    unsigned int  status_vaddr;    // MWMR status virtual address (12 bytes)
     247    unsigned int  lock_vaddr;      // MWMR lock virtual address (64 bytes)
    248248} giet_coproc_channel_t;
    249249
    250 extern void giet_coproc_alloc( unsigned int   coproc_type,
     250extern void giet_coproc_alloc( unsigned int   cluster_xy,
     251                               unsigned int   coproc_type,
    251252                               unsigned int*  coproc_info );
    252253
    253 extern void giet_coproc_release( unsigned int coproc_reg_index );
    254 
    255 extern void giet_coproc_channel_init( unsigned int            channel,
     254extern void giet_coproc_release( unsigned int cluster_xy,
     255                                 unsigned int coproc_type );
     256
     257extern void giet_coproc_channel_init( unsigned int            cluster_xy,
     258                                      unsigned int            coproc_type,
     259                                      unsigned int            channel,
    256260                                      giet_coproc_channel_t*  desc );
    257261
    258 extern void giet_coproc_run( unsigned int coproc_reg_index );
    259 
    260 extern void giet_coproc_completed();
     262extern void giet_coproc_run( unsigned int cluster_xy,
     263                             unsigned int coproc_type );
     264
     265extern void giet_coproc_completed( unsigned int cluster_xy,
     266                                   unsigned int coproc_type );
    261267
    262268//////////////////////////////////////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.