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

Adapt the following application to the POSIX threads API

  • convol
  • classif
  • raycast
  • coproc
  • display
  • gameoflife
  • transpose
  • shell
File:
1 moved

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/applications/coproc/coproc.c

    r707 r708  
    11///////////////////////////////////////////////////////////////////////////////////////
    2 //  file   : main.c  (for coproc application)
     2//  file   : coproc.c
    33//  date   : avril 2015
    44//  author : Alain Greiner
    55///////////////////////////////////////////////////////////////////////////////////////
    66//  This file describes the single thread "coproc" application.
    7 //  It uses the embedded GCD (Greater Common Divider) coprocessor to make
    8 //  the GCD computation between two vectors of 32 bits integers.
     7//  It uses the GCD (Greater Common Divider) hardware coprocessor
     8//  to make the GCD computation between two vectors of 32 bits integers.
    99//  The vectors size is defined by the VECTOR_SIZE parameter.
    1010///////////////////////////////////////////////////////////////////////////////////////
     
    1818#define  DMA_MODE    MODE_DMA_IRQ
    1919
    20 #define VERBOSE      1
     20#define  VERBOSE     1
    2121
    2222// Memory buffers for coprocessor
     
    5959    unsigned int nb_config      = (coproc_info>>16) & 0xFF;
    6060    unsigned int nb_status      = (coproc_info>>24) & 0xFF;
    61     giet_assert( ((nb_to_coproc   == 2) &&
    62                   (nb_from_coproc == 1) &&
    63                   (nb_config      == 1) &&
    64                   (nb_status      == 0) ) ,
    65                   "wrong GCD coprocessor interface" );
     61    giet_pthread_assert( ((nb_to_coproc   == 2) &&
     62                         (nb_from_coproc == 1) &&
     63                         (nb_config      == 1) &&
     64                         (nb_status      == 0) ) ,
     65                         "wrong GCD coprocessor interface" );
    6666
    67 if ( VERBOSE )
     67#if  VERBOSE
    6868giet_tty_printf("\n*** get GCD coprocessor at cycle %d\n", giet_proctime() );
     69#endif
    6970
    7071    //////////////////////// initializes channel for OPA
     
    8990    giet_coproc_channel_init( 2 , &res_desc );
    9091   
    91 if ( VERBOSE )
     92#if  VERBOSE
    9293giet_tty_printf("\n*** channels initialized at cycle %d\n", giet_proctime() );
     94#endif
    9395
    9496    /////////////////////// starts communication channels
    9597    giet_coproc_run( 0 );
    9698
    97 if ( VERBOSE )
     99#if  VERBOSE
    98100giet_tty_printf("\n*** start GCD coprocessor at cycle %d\n", giet_proctime() );
     101#endif
    99102
    100103    /////////////////////// wait coprocessor completion
     
    104107    }
    105108
    106 if ( VERBOSE )
     109#if  VERBOSE
    107110giet_tty_printf("\n*** GCD computation completed at cycle %d\n", giet_proctime() );
     111#endif
    108112
    109113    // display result
     
    117121    giet_coproc_release( 0 );
    118122
    119     giet_exit("completed");
     123    giet_pthread_exit("completed");
    120124
    121125} // end main
Note: See TracChangeset for help on using the changeset viewer.