Changeset 383 for soft/giet_vm/transpose/transpose.py
- Timestamp:
- Aug 7, 2014, 12:27:17 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/transpose/transpose.py
r336 r383 31 31 # define vsegs base & size 32 32 code_base = 0x10000000 33 code_size = 0x00010000 # 64 Kbytes 33 code_size = 0x00010000 # 64 Kbytes (replicated in each cluster) 34 34 35 35 data_base = 0x20000000 36 data_size = 0x00010000 # 64 Kbytes 36 data_size = 0x00010000 # 64 Kbytes (non replicated) 37 37 38 38 ptab_base = 0x30000000 39 ptab_size = 0x00040000 # 256 Kbytes 39 ptab_size = 0x00040000 # 256 Kbytes (replicated in each cluster) 40 40 41 41 stack_base = 0x40000000 42 stack_size = 0x00 010000 # 64 Kbytes42 stack_size = 0x00100000 # 1 Mbytes (to be divided between all tasks) 43 43 44 44 heap_base = 0x50000000 45 heap_size = 0x00010000 # 64 Kbytes 45 heap_size = 0x00010000 # 64 Kbytes (to be shared by all tasks) 46 46 47 # create Vspace47 # create vspace 48 48 vspace = mapping.addVspace( name = 'transpose', startname = 'trsp_data' ) 49 49 50 # non replicated vsegs in cluster[0,0] 51 mapping.addVseg( vspace, 'trsp_code', code_base , code_size, 'CXWU', vtype = 'ELF', 52 x = 0, y = 0, pseg = 'RAM', binpath = 'build/transpose/transpose.elf' ) 50 # data vseg : shared (only in cluster[0,0]) 51 mapping.addVseg( vspace, 'trsp_data', data_base , data_size, 52 'C_WU', vtype = 'ELF', x = 0, y = 0, pseg = 'RAM', 53 binpath = 'build/transpose/transpose.elf', 54 local = False ) 53 55 54 mapping.addVseg( vspace, 'trsp_data', data_base , data_size, 'C_WU', vtype = 'ELF', 55 x = 0, y = 0, pseg = 'RAM', binpath = 'build/transpose/transpose.elf' ) 56 # code vsegs : local (one copy in each cluster) 57 for x in xrange (x_size): 58 for y in xrange (y_size): 59 mapping.addVseg( vspace, 'trsp_code_%d_%d' %(x,y), code_base , code_size, 60 'CXWU', vtype = 'ELF', x = x, y = y, pseg = 'RAM', 61 binpath = 'build/transpose/transpose.elf', 62 local = True ) 56 63 57 mapping.addVseg( vspace, 'trsp_ptab', ptab_base , ptab_size, 'C_WU', vtype = 'PTAB', 58 x = 0, y = 0, pseg = 'RAM', align = 13 ) 64 # ptab vsegs : local (one specific ptab per cluster) 65 for x in xrange (x_size): 66 for y in xrange (y_size): 67 mapping.addVseg( vspace, 'trsp_ptab_%d_%d' %(x,y), ptab_base , ptab_size, 68 'C_WU', vtype = 'PTAB', x = x, y = y, pseg = 'RAM', 69 align = 13, 70 local = True ) 59 71 60 # distributed vsegs: one stack per processor/task, one heap per cluster 61 for x_rep in xrange (x_size): 62 for y_rep in xrange (y_size): 63 cluster_offset = ((x_rep << y_width) + y_rep) << 20 # 1 Mbytes per cluster 64 mapping.addVseg( vspace, 'trsp_heap_%d_%d' % (x_rep, y_rep), 65 heap_base + cluster_offset, heap_size, 'C_WU', 66 vtype = 'BUFFER', x = x_rep, y = y_rep, pseg = 'RAM' ) 67 72 # stacks vsegs: local (one stack per processor, procs_max stacks per cluster) 73 for x in xrange (x_size): 74 for y in xrange (y_size): 68 75 for p in xrange( procs_max ): 69 proc_offset = cluster_offset + (p << 18) # 256 Kbytes per proc 70 mapping.addVseg( vspace, 'trsp_stack_%d_%d_%d' % (x_rep, y_rep, p), 71 stack_base + proc_offset, stack_size, 'C_WU', 72 vtype = 'BUFFER', x = x_rep, y = y_rep, pseg = 'RAM' ) 73 76 proc_id = (((x * y_size) + y) * procs_max) + p 77 size = stack_size / (x_size * y_size * procs_max) 78 base = stack_base + (proc_id * size) 79 mapping.addVseg( vspace, 'trsp_stack_%d_%d_%d' % (x,y,p), base, size, 80 'C_WU', vtype = 'BUFFER', x = x , y = y , pseg = 'RAM', 81 local = True ) 82 83 # heap vsegs: shared (all heap segments can be accessed by all tasks) 84 for x in xrange (x_size): 85 for y in xrange (y_size): 86 cluster_id = (x * y_size) + y 87 size = heap_size / (x_size * y_size) 88 base = heap_base + (cluster_id * size) 89 mapping.addVseg( vspace, 'trsp_heap_%d_%d' % (x,y), base, size, 90 'C_WU', vtype = 'BUFFER', x = x, y = y, pseg = 'RAM', 91 local = False ) 92 74 93 # distributed tasks / one task per processor 75 94 for x in xrange (x_size): 76 95 for y in xrange (y_size): 77 96 for p in xrange( procs_max ): 78 79 97 trdid = (((x * y_size) + y) * procs_max) + p 80 mapping.addTask( vspace, ' sort_%d_%d_%d' % (x,y,p), trdid, x, y, p,98 mapping.addTask( vspace, 'trsp_%d_%d_%d' % (x,y,p), trdid, x, y, p, 81 99 'trsp_stack_%d_%d_%d' % (x,y,p), 82 100 'trsp_heap_%d_%d' % (x,y), 0 )
Note: See TracChangeset
for help on using the changeset viewer.