Changeset 415 for soft/giet_vm/convol/convol.py
- Timestamp:
- Sep 29, 2014, 12:05:28 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/convol/convol.py
r401 r415 17 17 # - x_width : number of bits coding x coordinate 18 18 # - y_width : number of bits coding y coordinate 19 # - procs_max: number of processors per cluster19 # - nprocs : number of processors per cluster 20 20 #################################################################################### 21 21 … … 25 25 x_size = mapping.x_size 26 26 y_size = mapping.y_size 27 procs_max = mapping.procs_max27 nprocs = mapping.nprocs 28 28 x_width = mapping.x_width 29 29 y_width = mapping.y_width … … 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 37 38 ptab_base = 0x30000000 39 ptab_size = 0x00040000 # 256 Kbytes 36 data_size = 0x00010000 # 64 Kbytes (non replicated) 40 37 41 38 heap_base = 0x40000000 42 heap_size = 0x01000000 # max 16 Mbytes (for all clusters)39 heap_size = 0x01000000 # 16 Mbytes (per cluster) 43 40 44 41 stack_base = 0x50000000 45 stack_size = 0x0 2000000 # max 32 Mbytes (for all processors)42 stack_size = 0x00200000 # 2 Mbytes (per cluster) 46 43 47 44 # create Vspace … … 53 50 local = False ) 54 51 55 # code vsegs : local (one replicated vseg percluster)52 # code vsegs : local (one copy in each cluster) 56 53 for x in xrange (x_size): 57 54 for y in xrange (y_size): … … 63 60 local = True ) 64 61 65 # heap vsegs : non local (one communication buffer per cluster) 62 # stack vsegs : local (one stack per processor) 63 for x in xrange (x_size): 64 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 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 ) 72 73 # heap vsegs : distributed but non local (all heap vsegs can be accessed by all tasks) 66 74 for x in xrange (x_size): 67 75 for y in xrange (y_size): 68 76 cluster_id = (x * y_size) + y 69 size = heap_size / (x_size * y_size)77 size = heap_size 70 78 base = heap_base + (cluster_id * size) 71 79 mapping.addVseg( vspace, 'conv_heap_%d_%d' % (x,y), base, size, 72 80 'C_WU', vtype = 'BUFFER', x = x , y = y , pseg = 'RAM', 73 local = False ) 74 75 # stack vsegs : local (one stack per processor) 76 for x in xrange (x_size): 77 for y in xrange (y_size): 78 for p in xrange( procs_max ): 79 proc_id = (((x * y_size) + y) * procs_max) + p 80 size = stack_size / (x_size * y_size * procs_max) 81 base = stack_base + (proc_id * size) 82 mapping.addVseg( vspace, 'conv_stack_%d_%d_%d' % (x,y,p), base, size, 83 'C_WU', vtype = 'BUFFER', x = x , y = y , pseg = 'RAM', 84 local = True ) 85 86 # ptab vsegs : local (one ptab per cluster) 87 for x in xrange (x_size): 88 for y in xrange (y_size): 89 size = ptab_size 90 base = ptab_base 91 mapping.addVseg( vspace, 'conv_ptab_%d_%d' %(x,y), base , size, 92 'C_WU', vtype = 'PTAB', x = x , y = y , pseg = 'RAM', 93 align = 13, 94 local = True ) 81 local = False, big = True ) 95 82 96 83 # distributed tasks : one task per processor 97 84 for x in xrange (x_size): 98 85 for y in xrange (y_size): 99 for p in xrange( procs_max):100 trdid = (((x * y_size) + y) * procs_max) + p86 for p in xrange( nprocs ): 87 trdid = (((x * y_size) + y) * nprocs) + p 101 88 mapping.addTask( vspace, 'conv_%d_%d_%d' % (x,y,p), trdid, x, y, p, 102 89 'conv_stack_%d_%d_%d' % (x,y,p),
Note: See TracChangeset
for help on using the changeset viewer.