Changeset 708 for soft/giet_vm/applications/coproc
- Timestamp:
- Oct 1, 2015, 4:09:25 PM (9 years ago)
- Location:
- soft/giet_vm/applications/coproc
- Files:
-
- 2 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/applications/coproc/Makefile
r589 r708 1 2 CC = mipsel-unknown-elf-gcc 3 AS = mipsel-unknown-elf-as 4 LD = mipsel-unknown-elf-ld 5 DU = mipsel-unknown-elf-objdump 6 AR = mipsel-unknown-elf-ar 1 7 2 8 APP_NAME = coproc 3 9 4 OBJS= main.o10 OBJS= coproc.o 5 11 6 12 LIBS= -L../../build/libs -luser -
soft/giet_vm/applications/coproc/coproc.c
r707 r708 1 1 /////////////////////////////////////////////////////////////////////////////////////// 2 // file : main.c (for coproc application)2 // file : coproc.c 3 3 // date : avril 2015 4 4 // author : Alain Greiner 5 5 /////////////////////////////////////////////////////////////////////////////////////// 6 6 // This file describes the single thread "coproc" application. 7 // It uses the embedded GCD (Greater Common Divider) coprocessor to make8 // t he 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. 9 9 // The vectors size is defined by the VECTOR_SIZE parameter. 10 10 /////////////////////////////////////////////////////////////////////////////////////// … … 18 18 #define DMA_MODE MODE_DMA_IRQ 19 19 20 #define VERBOSE120 #define VERBOSE 1 21 21 22 22 // Memory buffers for coprocessor … … 59 59 unsigned int nb_config = (coproc_info>>16) & 0xFF; 60 60 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" ); 66 66 67 if ( VERBOSE ) 67 #if VERBOSE 68 68 giet_tty_printf("\n*** get GCD coprocessor at cycle %d\n", giet_proctime() ); 69 #endif 69 70 70 71 //////////////////////// initializes channel for OPA … … 89 90 giet_coproc_channel_init( 2 , &res_desc ); 90 91 91 if ( VERBOSE ) 92 #if VERBOSE 92 93 giet_tty_printf("\n*** channels initialized at cycle %d\n", giet_proctime() ); 94 #endif 93 95 94 96 /////////////////////// starts communication channels 95 97 giet_coproc_run( 0 ); 96 98 97 if ( VERBOSE ) 99 #if VERBOSE 98 100 giet_tty_printf("\n*** start GCD coprocessor at cycle %d\n", giet_proctime() ); 101 #endif 99 102 100 103 /////////////////////// wait coprocessor completion … … 104 107 } 105 108 106 if ( VERBOSE ) 109 #if VERBOSE 107 110 giet_tty_printf("\n*** GCD computation completed at cycle %d\n", giet_proctime() ); 111 #endif 108 112 109 113 // display result … … 117 121 giet_coproc_release( 0 ); 118 122 119 giet_ exit("completed");123 giet_pthread_exit("completed"); 120 124 121 125 } // end main -
soft/giet_vm/applications/coproc/coproc.py
r610 r708 33 33 x = 0 34 34 y = 0 35 p = 035 p = 1 36 36 37 37 assert( (x < x_size) and (y < y_size) ) … … 50 50 51 51 # create vspace 52 vspace = mapping.addVspace( name = 'coproc', startname = 'coproc_data' )52 vspace = mapping.addVspace( name = 'coproc', startname = 'coproc_data', active = False ) 53 53 54 54 # data vseg in cluster[x,y] … … 69 69 local = False, big = True ) 70 70 71 # one task on processor[x,y,0] 72 mapping.addTask( vspace, 'coproc', 0 , x , y , 0 , 73 'coproc_stack' , '' , 0 ) 71 # one thread on processor[x,y,p] 72 mapping.addThread( vspace, 73 'coproc', 74 True, # is_main 75 x, y, p, 76 'coproc_stack', 77 '', # no heap 78 0 ) # start_id 74 79 75 80 # extend mapping name
Note: See TracChangeset
for help on using the changeset viewer.