Changeset 502 for soft/giet_vm/applications/convol/convol.py
- Timestamp:
- Feb 8, 2015, 9:20:45 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/applications/convol/convol.py
r457 r502 12 12 # This include both the mapping of virtual segments on the clusters, 13 13 # and the mapping of tasks on processors. 14 # There is one task per processor. 15 # The mapping of virtual segments is the following: 16 # - There is one shared data vseg in cluster[0][0] 17 # - The code vsegs are replicated on all clusters containing processors. 18 # - There is one heap vseg per cluster containing processors. 19 # - The stacks vsegs are distibuted on all clusters containing processors. 14 20 # This mapping uses 5 platform parameters, (obtained from the "mapping" argument) 15 # - x_size : number of clusters in a row16 # - y_size : number of clusters in a column17 # - x_width : number of bits coding x coordinate18 # - y_width : number of bits coding y coordinate19 # - nprocs : number of processors per cluster21 # - x_size : number of clusters in a row 22 # - y_size : number of clusters in a column 23 # - x_width : number of bits coding x coordinate 24 # - y_width : number of bits coding y coordinate 25 # - nprocs : number of processors per cluster 20 26 #################################################################################### 21 27 … … 46 52 47 53 # data vseg in cluster[0,0] : non local 48 mapping.addVseg( vspace, 'conv_data', data_base , data_size, 'C_WU', vtype = 'ELF', 49 x = 0, y = 0, pseg = 'RAM', binpath = 'build/convol/convol.elf', 54 mapping.addVseg( vspace, 'conv_data', data_base , data_size, 55 'C_WU', vtype = 'ELF', x = 0, y = 0, pseg = 'RAM', 56 binpath = 'build/convol/convol.elf', 50 57 local = False ) 51 58 … … 53 60 for x in xrange (x_size): 54 61 for y in xrange (y_size): 55 size = code_size 56 base = code_base 57 mapping.addVseg( vspace, 'conv_code_%d_%d' % (x,y), base, size, 58 'CXWU', vtype = 'ELF', x = x , y = y , pseg = 'RAM', 59 binpath = 'build/convol/convol.elf', 60 local = True ) 62 cluster_id = (x * y_size) + y 63 if ( mapping.clusters[cluster_id].procs ): 64 size = code_size 65 base = code_base 66 67 mapping.addVseg( vspace, 'conv_code_%d_%d' % (x,y), base, size, 68 'CXWU', vtype = 'ELF', x = x , y = y , pseg = 'RAM', 69 binpath = 'build/convol/convol.elf', 70 local = True ) 61 71 62 72 # stack vsegs : local (one stack per processor) 63 73 for x in xrange (x_size): 64 74 for y in xrange (y_size): 65 for p in xrange( nprocs ): 66 proc_id = (((x * y_size) + y) * nprocs) + p 67 size = (stack_size / nprocs) & 0xFFFFF000 68 base = stack_base + (proc_id * size) 69 mapping.addVseg( vspace, 'conv_stack_%d_%d_%d' % (x,y,p), base, size, 70 'C_WU', vtype = 'BUFFER', x = x , y = y , pseg = 'RAM', 71 local = True, big = True ) 75 cluster_id = (x * y_size) + y 76 if ( mapping.clusters[cluster_id].procs ): 77 for p in xrange( nprocs ): 78 proc_id = (((x * y_size) + y) * nprocs) + p 79 size = (stack_size / nprocs) & 0xFFFFF000 80 base = stack_base + (proc_id * size) 81 82 mapping.addVseg( vspace, 'conv_stack_%d_%d_%d' % (x,y,p), 83 base, size, 'C_WU', vtype = 'BUFFER', 84 x = x , y = y , pseg = 'RAM', 85 local = True, big = True ) 72 86 73 # heap vsegs : distributed but non local (a ll heap vsegs can be accessed by all tasks)87 # heap vsegs : distributed but non local (any heap can be accessed by any task) 74 88 for x in xrange (x_size): 75 89 for y in xrange (y_size): 76 90 cluster_id = (x * y_size) + y 77 size = heap_size 78 base = heap_base + (cluster_id * size) 79 mapping.addVseg( vspace, 'conv_heap_%d_%d' % (x,y), base, size, 80 'C_WU', vtype = 'BUFFER', x = x , y = y , pseg = 'RAM', 81 local = False, big = True ) 91 if ( mapping.clusters[cluster_id].procs ): 92 size = heap_size 93 base = heap_base + (cluster_id * size) 94 95 mapping.addVseg( vspace, 'conv_heap_%d_%d' % (x,y), base, size, 96 'C_WU', vtype = 'BUFFER', x = x , y = y , pseg = 'RAM', 97 local = False, big = True ) 82 98 83 99 # distributed tasks : one task per processor 84 100 for x in xrange (x_size): 85 101 for y in xrange (y_size): 86 for p in xrange( nprocs ): 87 trdid = (((x * y_size) + y) * nprocs) + p 88 mapping.addTask( vspace, 'conv_%d_%d_%d' % (x,y,p), trdid, x, y, p, 89 'conv_stack_%d_%d_%d' % (x,y,p), 90 'conv_heap_%d_%d' % (x,y), 0 ) 102 cluster_id = (x * y_size) + y 103 if ( mapping.clusters[cluster_id].procs ): 104 for p in xrange( nprocs ): 105 trdid = (((x * y_size) + y) * nprocs) + p 106 107 mapping.addTask( vspace, 'conv_%d_%d_%d' % (x,y,p), 108 trdid, x, y, p, 109 'conv_stack_%d_%d_%d' % (x,y,p), 110 'conv_heap_%d_%d' % (x,y), 0 ) 91 111 92 112 # extend mapping name … … 95 115 return vspace # useful for test 96 116 97 ################################ test ################################################ ######117 ################################ test ################################################ 98 118 99 119 if __name__ == '__main__':
Note: See TracChangeset
for help on using the changeset viewer.