Changeset 708 for soft/giet_vm/applications/classif
- Timestamp:
- Oct 1, 2015, 4:09:25 PM (9 years ago)
- Location:
- soft/giet_vm/applications/classif
- Files:
-
- 1 added
- 1 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/applications/classif/Makefile
r589 r708 2 2 APP_NAME = classif 3 3 4 OBJS= main.o4 OBJS= classif.o 5 5 6 6 LIBS= -L../../build/libs -luser -
soft/giet_vm/applications/classif/classif.py
r610 r708 10 10 # This file describes the mapping of the multi-threaded "classif" 11 11 # application on a multi-clusters, multi-processors architecture. 12 # The mapping of tasks on processors is the following: 13 # - one "load" task per cluster containing processors, 14 # - one "store" task per cluster containing processors, 15 # - (nprocs-2) "analyse" task per cluster containing processors. 12 # The mapping of threads on processors is the following: 13 # - the "main" on cluster[0][0] 14 # - one "load" thread per cluster containing processors, 15 # - one "store" thread per cluster containing processors, 16 # - (nprocs-2) "analyse" thread per cluster containing processors. 16 17 # The mapping of virtual segments is the following: 17 18 # - There is one shared data vseg in cluster[0][0] … … 39 40 y_width = mapping.y_width 40 41 41 assert (nprocs >= 3) 42 assert (nprocs >= 3) and (nprocs <= 8) 42 43 43 44 # define vsegs base & size 44 code_base = 0x10000000 45 code_size = 0x00010000 # 64 Kbytes ( replicated in eachcluster)45 code_base = 0x10000000 46 code_size = 0x00010000 # 64 Kbytes (per cluster) 46 47 47 48 data_base = 0x20000000 48 data_size = 0x00010000 # 64 Kbytes 49 data_size = 0x00010000 # 64 Kbytes (non replicated) 49 50 50 51 heap_base = 0x30000000 51 heap_size = 0x00 040000 # 256 Kbytes (per cluster)52 heap_size = 0x00200000 # 2M bytes (per cluster) 52 53 53 54 stack_base = 0x40000000 54 stack_size = 0x00 200000 # 2 Mbytes (per cluster)55 stack_size = 0x00010000 # 64 Kbytes (per thread) 55 56 56 57 # create vspace 57 vspace = mapping.addVspace( name = 'classif', startname = 'classif_data' )58 vspace = mapping.addVspace( name = 'classif', startname = 'classif_data', active = False ) 58 59 59 60 # data vseg : shared / cluster[0][0] … … 73 74 mapping.addVseg( vspace, 'classif_heap_%d_%d' %(x,y), base , size, 74 75 'C_WU', vtype = 'HEAP', x = x, y = y, pseg = 'RAM', 75 local = False )76 local = False, big = True ) 76 77 77 # code vsegs : local (one copy in eachcluster)78 # code vsegs : local (one copy per cluster) 78 79 for x in xrange (x_size): 79 80 for y in xrange (y_size): … … 88 89 89 90 # stacks vsegs: local (one stack per processor => nprocs stacks per cluster) 91 # ... plus main_stack in cluster[0][0] 92 mapping.addVseg( vspace, 'main_stack', 93 stack_base, stack_size, 'C_WU', vtype = 'BUFFER', 94 x = 0 , y = 0 , pseg = 'RAM', 95 local = True ) 96 90 97 for x in xrange (x_size): 91 98 for y in xrange (y_size): … … 94 101 for p in xrange( nprocs ): 95 102 proc_id = (((x * y_size) + y) * nprocs) + p 96 size = (stack_size / nprocs) & 0xFFFFF000 97 base = stack_base + (proc_id * size) 103 base = stack_base + (proc_id * stack_size) + stack_size 98 104 99 105 mapping.addVseg( vspace, 'classif_stack_%d_%d_%d' % (x,y,p), 100 base, s ize, 'C_WU', vtype = 'BUFFER',106 base, stack_size, 'C_WU', vtype = 'BUFFER', 101 107 x = x , y = y , pseg = 'RAM', 102 local = True , big = True)108 local = True ) 103 109 104 # distributed tasks / one task per processor 110 # distributed threads / one thread per processor 111 # ... plus main on P[0][0][0] 112 mapping.addThread( vspace, 'main', True, 0, 0, 1, 113 'main_stack', 114 'classif_heap_0_0', 115 0 ) # index in start_vector 116 105 117 for x in xrange (x_size): 106 118 for y in xrange (y_size): … … 108 120 if ( mapping.clusters[cluster_id].procs ): 109 121 for p in xrange( nprocs ): 110 trdid = (((x * y_size) + y) * nprocs) + p 111 if ( p== 0 ): # task load 112 task_index = 2 113 task_name = 'load_%d_%d_%d' %(x,y,p) 114 elif ( p== 1 ): # task store 115 task_index = 1 116 task_name = 'store_%d_%d_%d' %(x,y,p) 117 else : # task analyse 118 task_index = 0 119 task_name = 'analyse_%d_%d_%d' % (x,y,p) 122 if ( p== 0 ): # thread load 123 start_index = 3 124 thread_name = 'load_%d_%d_%d' %(x,y,p) 125 elif ( p== 1 ): # thread store 126 start_index = 2 127 thread_name = 'store_%d_%d_%d' %(x,y,p) 128 else : # thread analyse 129 start_index = 1 130 thread_name = 'analyse_%d_%d_%d' % (x,y,p) 120 131 121 mapping.addT ask( vspace, task_name, trdid, x, y, p,122 'classif_stack_%d_%d_%d' % (x,y,p),123 'classif_heap_%d_%d' % (x,y),124 task_index )132 mapping.addThread( vspace, thread_name, False , x, y, p, 133 'classif_stack_%d_%d_%d' % (x,y,p), 134 'classif_heap_%d_%d' % (x,y), 135 start_index ) # index in start_vector 125 136 126 137 # extend mapping name
Note: See TracChangeset
for help on using the changeset viewer.