Changeset 825 for soft/giet_vm/applications/classif/classif.py
- Timestamp:
- Jan 5, 2017, 9:46:21 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/applications/classif/classif.py
r720 r825 12 12 # The mapping of threads on processors is the following: 13 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. 14 # - one "analyse" thread per processor, 17 15 # The mapping of virtual segments is the following: 18 16 # - There is one shared data vseg in cluster[0][0] … … 26 24 # - y_width : number of bits for y field 27 25 # - nprocs : number of processors per cluster 28 #29 # WARNING: The target architecture cannot contain less30 # than 3 processors per cluster.31 26 ################################################################################## 32 27 … … 40 35 y_width = mapping.y_width 41 36 42 assert (nprocs >= 3) and (nprocs <= 8)43 44 37 # define vsegs base & size 45 38 code_base = 0x10000000 … … 49 42 data_size = 0x00010000 # 64 Kbytes (non replicated) 50 43 51 heap_base = 0x3000000052 heap_size = 0x00200000 # 2M bytes (per cluster)44 stack_base = 0x30000000 45 stack_size = 0x00010000 # 64 Kbytes (per thread) 53 46 54 stack_base = 0x4000000055 stack_size = 0x00010000 # 64 Kbytes (per thread)47 heap_base = 0x40000000 48 heap_size = 0x00200000 # 2 Mbytes (per cluster) 56 49 57 50 # create vspace 58 51 vspace = mapping.addVspace( name = 'classif', 59 52 startname = 'classif_data', 60 active = False )53 active = True ) 61 54 62 55 # data vseg : shared / cluster[0][0] … … 65 58 binpath = 'bin/classif/appli.elf', 66 59 local = False ) 67 68 # heap vsegs : shared (one per cluster)69 for x in xrange (x_size):70 for y in xrange (y_size):71 cluster_id = (x * y_size) + y72 if ( mapping.clusters[cluster_id].procs ):73 size = heap_size74 base = heap_base + (cluster_id * size)75 76 mapping.addVseg( vspace, 'classif_heap_%d_%d' %(x,y), base , size,77 'C_WU', vtype = 'HEAP', x = x, y = y, pseg = 'RAM',78 local = False, big = True )79 60 80 61 # code vsegs : local (one copy per cluster) … … 110 91 local = True ) 111 92 93 # heap vsegs : distributed but non local (any heap can be accessed by any thread) 94 for x in xrange (x_size): 95 for y in xrange (y_size): 96 cluster_id = (x * y_size) + y 97 if ( mapping.clusters[cluster_id].procs ): 98 base = heap_base + (cluster_id * heap_size) 99 100 mapping.addVseg( vspace, 'classif_heap_%d_%d' % (x,y), base, heap_size, 101 'C_WU' , vtype = 'HEAP' , x = x , y = y , pseg = 'RAM', 102 local = False, big = True ) 103 112 104 # distributed threads / one thread per processor 113 105 # ... plus main on P[0][0][0] 114 mapping.addThread( vspace, 'main', True, 0, 0, 1, 115 'main_stack', 116 'classif_heap_0_0', 106 mapping.addThread( vspace, 'main', True, 0, 0, 0, 107 'main_stack', '' , 117 108 0 ) # index in start_vector 118 109 … … 122 113 if ( mapping.clusters[cluster_id].procs ): 123 114 for p in xrange( nprocs ): 124 if ( p== 0 ): # thread load 125 start_index = 3 126 thread_name = 'load_%d_%d_%d' %(x,y,p) 127 elif ( p== 1 ): # thread store 128 start_index = 2 129 thread_name = 'stor_%d_%d_%d' %(x,y,p) 130 else : # thread analyse 131 start_index = 1 132 thread_name = 'anal_%d_%d_%d' % (x,y,p) 115 start_index = 1 116 thread_name = 'analyse_%d_%d_%d' % (x,y,p) 133 117 134 118 mapping.addThread( vspace, thread_name, False , x, y, p, 135 'classif_stack_%d_%d_%d' % (x,y,p), 119 'classif_stack_%d_%d_%d' % (x,y,p), 136 120 'classif_heap_%d_%d' % (x,y), 137 start_index )121 1 ) # index in start_vector 138 122 139 123 # extend mapping name
Note: See TracChangeset
for help on using the changeset viewer.