Changeset 502 for soft/giet_vm/applications/sort/sort.py
- Timestamp:
- Feb 8, 2015, 9:20:45 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/applications/sort/sort.py
r434 r502 33 33 # define vsegs base & size 34 34 code_base = 0x10000000 35 code_size = 0x00 200000 # 2 Mbytes (replicated in each cluster)35 code_size = 0x00010000 # 64 Kbytes (replicated in each cluster) 36 36 37 37 data_base = 0x20000000 38 data_size = 0x00100000 # 1 Mbyte (non replicated) 39 40 args_base = 0x20100000 41 args_size = 0x00000004 # 4 bytes (non replicated) 38 data_size = 0x00010000 # 64 Kbyte (non replicated) 42 39 43 40 stack_base = 0x40000000 … … 54 51 'C_WU', vtype = 'ELF', x = 0, y = 0, pseg = 'RAM', 55 52 binpath = 'build/sort/sort.elf', 56 local = False, big = True ) 57 58 # args vseg : non local (only in cluster[0,0]) 59 mapping.addVseg( vspace, 'sort_args', args_base , args_size, 60 'C_WU', vtype = 'CONST', x = 0, y = 0, pseg = 'RAM', 61 init = ntasks, 62 local = False, big = True ) 53 local = False ) 63 54 64 55 # code vsegs : local (one copy per cluster) 65 56 for x in xrange (x_size): 66 57 for y in xrange (y_size): 67 mapping.addVseg( vspace, 'sort_code', code_base , code_size, 68 'CXWU', vtype = 'ELF', x = x, y = y, pseg = 'RAM', 69 binpath = 'build/sort/sort.elf', 70 local = True, big = True ) 58 cluster_id = (x * y_size) + y 59 if ( mapping.clusters[cluster_id].procs ): 60 61 mapping.addVseg( vspace, 'sort_code', code_base , code_size, 62 'CXWU', vtype = 'ELF', x = x, y = y, pseg = 'RAM', 63 binpath = 'build/sort/sort.elf', 64 local = True ) 71 65 72 66 # stacks vsegs : local (one stack per task) 73 67 for x in xrange (x_size): 74 68 for y in xrange (y_size): 75 for p in xrange (nprocs): 76 proc_id = (((x * y_size) + y) * nprocs) + p 77 size = stack_size / nprocs 78 base = stack_base + (proc_id * size) 79 mapping.addVseg( vspace, 'sort_stack_%d_%d_%d' % (x,y,p), base, size, 69 cluster_id = (x * y_size) + y 70 if ( mapping.clusters[cluster_id].procs ): 71 for p in xrange (nprocs): 72 proc_id = (((x * y_size) + y) * nprocs) + p 73 size = stack_size / nprocs 74 base = stack_base + (proc_id * size) 75 76 mapping.addVseg( vspace, 'sort_stack_%d_%d_%d' % (x,y,p), 77 base, size, 'C_WU', vtype = 'BUFFER', 78 x = x, y = y, pseg = 'RAM', 79 local = True, big = True ) 80 81 # heap vsegs : distributed but non local (all tasks can access all heap vsegs) 82 for x in xrange (x_size): 83 for y in xrange (y_size): 84 cluster_id = (x * y_size) + y 85 if ( mapping.clusters[cluster_id].procs ): 86 size = heap_size 87 base = heap_base + (cluster_id * size) 88 89 mapping.addVseg( vspace, 'sort_heap_%d_%d' % (x,y), base, size, 80 90 'C_WU', vtype = 'BUFFER', x = x, y = y, pseg = 'RAM', 81 local = True, big = True ) 82 83 # heap vsegs : distributed but non local (all tasks can access all heap vsegs) 84 cluster_id = (x * y_size) + y 85 size = heap_size 86 base = heap_base + (cluster_id * size) 87 mapping.addVseg( vspace, 'sort_heap_%d_%d' % (x,y), base, size, 88 'C_WU', vtype = 'BUFFER', x = x, y = y, pseg = 'RAM', 89 local = False, big = True ) 91 local = False, big = True ) 90 92 91 93 # distributed tasks / one task per processor 92 94 for x in xrange (x_size): 93 95 for y in xrange (y_size): 94 for p in xrange( nprocs ): 95 trdid = (((x * y_size) + y) * nprocs) + p 96 mapping.addTask( vspace, 'sort_%d_%d_%d' % (x,y,p), trdid, x, y, p, 97 'sort_stack_%d_%d_%d' % (x,y,p), 98 'sort_heap_%d_%d' % (x,y), 0 ) 96 cluster_id = (x * y_size) + y 97 if ( mapping.clusters[cluster_id].procs ): 98 for p in xrange( nprocs ): 99 trdid = (((x * y_size) + y) * nprocs) + p 100 101 mapping.addTask( vspace, 'sort_%d_%d_%d' % (x,y,p), 102 trdid, x, y, p, 103 'sort_stack_%d_%d_%d' % (x,y,p), 104 'sort_heap_%d_%d' % (x,y), 0 ) 99 105 100 106 # extend mapping name
Note: See TracChangeset
for help on using the changeset viewer.