Changeset 589 for soft/giet_vm/applications/convol
- Timestamp:
- Jul 8, 2015, 3:57:15 PM (9 years ago)
- Location:
- soft/giet_vm/applications/convol
- Files:
-
- 1 added
- 1 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/applications/convol/convol.py
r502 r589 4 4 5 5 ###################################################################################### 6 # file : convol.py (for the convol application)6 # file : convol.py 7 7 # date : may 2014 8 8 # author : Alain Greiner … … 27 27 28 28 ###################### 29 def convol( mapping ):29 def extend( mapping ): 30 30 31 31 x_size = mapping.x_size … … 54 54 mapping.addVseg( vspace, 'conv_data', data_base , data_size, 55 55 'C_WU', vtype = 'ELF', x = 0, y = 0, pseg = 'RAM', 56 binpath = 'build/convol/ convol.elf',56 binpath = 'build/convol/appli.elf', 57 57 local = False ) 58 58 … … 67 67 mapping.addVseg( vspace, 'conv_code_%d_%d' % (x,y), base, size, 68 68 'CXWU', vtype = 'ELF', x = x , y = y , pseg = 'RAM', 69 binpath = 'build/convol/ convol.elf',69 binpath = 'build/convol/appli.elf', 70 70 local = True ) 71 71 … … 119 119 if __name__ == '__main__': 120 120 121 vspace = convol( Mapping( 'test', 2, 2, 4 ) )121 vspace = extend( Mapping( 'test', 2, 2, 4 ) ) 122 122 print vspace.xml() 123 123 -
soft/giet_vm/applications/convol/main.c
r502 r589 39 39 #define FRAME_SIZE (NB_PIXELS * PIXEL_SIZE) 40 40 41 #define SEEK_SET 0 42 41 43 #define TA(c,l,p) (A[c][((NP) * (l)) + (p)]) 42 44 #define TB(c,p,l) (B[c][((NL) * (p)) + (l)]) … … 125 127 unsigned int ntasks = nclusters * nprocs; // number of tasks 126 128 unsigned int frame_size = FRAME_SIZE; // total size (bytes) 127 unsigned int nblocks = frame_size / 512; // number of blocks/frame128 129 129 130 unsigned int lines_per_task = NL / ntasks; // lines per task … … 166 167 { 167 168 giet_shr_printf("\n[CONVOL] task[0,0,0] starts barrier init at cycle %d\n" 168 "- CLUSTERS = %d\n"169 "- PROCS = %d\n"170 "- TASKS = %d\n"171 "- BLOCKS= %d\n",172 giet_proctime(), nclusters, nprocs, ntasks, nblocks);169 "- CLUSTERS = %d\n" 170 "- PROCS = %d\n" 171 "- TASKS = %d\n" 172 "- LINES/TASK = %d\n", 173 giet_proctime(), nclusters, nprocs, ntasks, lines_per_task ); 173 174 #if USE_SQT_BARRIER 174 175 sqt_barrier_init( &barrier, x_size , y_size , nprocs ); … … 182 183 barrier_init_ok = 1; 183 184 } 184 else 185 else 185 186 { 186 187 while ( barrier_init_ok == 0 ); … … 250 251 /////////////////////////////////////////////////////////////////////////// 251 252 // task[0,0,0] open the file containing image, and load it from disk 252 // to all A[c] buffers ( nblocks/ nclusters loaded in each cluster).253 // to all A[c] buffers (frame_size / nclusters loaded in each cluster). 253 254 // Other tasks are waiting on the init_ok condition. 254 255 ////////////////////////////////////////////////////////////////////////// … … 256 257 { 257 258 // open file 258 file = giet_fat_open( "misc/philips_image.raw", 0 );259 file = giet_fat_open( "misc/philips_image.raw" , 0 ); 259 260 if ( file < 0 ) giet_exit( "[CONVOL ERROR] task[0,0,0] cannot open" 260 261 " file misc/philips_image.raw" ); … … 268 269 "for cluster %d at cycle %d\n", c, giet_proctime() ); 269 270 271 giet_fat_lseek( file, 272 (frame_size/nclusters)*c, 273 SEEK_SET ); 274 270 275 giet_fat_read( file, 271 276 A[c], 272 nblocks/nclusters, 273 (nblocks/nclusters)*c ); 277 frame_size/nclusters ); 274 278 275 279 giet_shr_printf( "\n[CONVOL] task[0,0,0] completes load "
Note: See TracChangeset
for help on using the changeset viewer.