Changeset 741 for soft/giet_vm/applications/mjpeg/mjpeg.py
- Timestamp:
- Dec 10, 2015, 12:16:18 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/applications/mjpeg/mjpeg.py
r736 r741 12 12 # 13 13 # The mapping of threads on processors is the following: 14 # - the "main" thread, on P[0,0,0] launches all others threads and exit. 15 # - the "tg" thread is only running on P[0,0,0]. 14 # - the "main" thread is running on P[0,0,0]. 16 15 # - the "demux", "iqzz", "idct", "vld", and "libu" threads, implementing 17 16 # a block-level pipe-line, are replicated in all clusters. … … 83 82 84 83 # stacks vsegs: local (one stack per thread => 5 stacks per cluster) 85 # ... plus main_stack and tg_stackin cluster[0][0]84 # ... plus main_stack in cluster[0][0] 86 85 base = stack_base 87 86 mapping.addVseg( vspace, 'mjpeg_main_stack', … … 92 91 base += stack_size 93 92 94 mapping.addVseg( vspace, 'mjpeg_tg_stack',95 base , stack_size, 'C_WU', vtype = 'BUFFER',96 x = 0 , y = 0 , pseg = 'RAM',97 local = True )98 99 base += stack_size100 101 93 for x in xrange (x_size): 102 94 for y in xrange (y_size): … … 139 131 140 132 # threads mapping: demux, vld, iqzz, idct, libu replicated in all clusters 141 # main & tg aremapped in cluster[0,0]133 # main mapped in cluster[0,0] 142 134 mapping.addThread( vspace, 'main', True, 0, 0, 0, 143 135 'mjpeg_main_stack', … … 145 137 0 ) # index in start_vector 146 138 147 if ( nprocs == 1 ): 148 p_tg = 0 149 p_demux = 0 150 p_vld = 0 151 p_iqzz = 0 152 p_idct = 0 153 p_libu = 0 154 elif ( nprocs == 2 ): 155 p_tg = 0 156 p_demux = 1 157 p_vld = 1 158 p_iqzz = 1 159 p_idct = 1 160 p_libu = 1 161 elif ( nprocs == 3 ): 162 p_tg = 0 163 p_demux = 1 164 p_vld = 2 165 p_iqzz = 1 166 p_idct = 1 167 p_libu = 1 168 elif ( nprocs == 4 ): 169 p_tg = 0 170 p_demux = 1 171 p_vld = 3 172 p_iqzz = 2 173 p_idct = 3 174 p_libu = 2 139 if ( x==0 and y==0 ): # tasks mapping in cluster[0,0] 140 if ( nprocs == 1 ): 141 p_demux = 0 142 p_vld = 0 143 p_iqzz = 0 144 p_idct = 0 145 p_libu = 0 146 elif ( nprocs == 2 ): 147 p_demux = 1 148 p_vld = 1 149 p_iqzz = 1 150 p_idct = 1 151 p_libu = 1 152 elif ( nprocs == 3 ): 153 p_demux = 1 154 p_vld = 2 155 p_iqzz = 1 156 p_idct = 1 157 p_libu = 1 158 elif ( nprocs == 4 ): 159 p_demux = 1 160 p_vld = 2 161 p_iqzz = 1 162 p_idct = 3 163 p_libu = 1 164 else: # tasks mapping in other clusters 165 if ( nprocs == 1 ): 166 p_demux = 0 167 p_vld = 0 168 p_iqzz = 0 169 p_idct = 0 170 p_libu = 0 171 elif ( nprocs == 2 ): 172 p_demux = 0 173 p_vld = 1 174 p_iqzz = 0 175 p_idct = 0 176 p_libu = 0 177 elif ( nprocs == 3 ): 178 p_demux = 0 179 p_vld = 1 180 p_iqzz = 0 181 p_idct = 2 182 p_libu = 1 183 elif ( nprocs == 4 ): 184 p_demux = 0 185 p_vld = 1 186 p_iqzz = 2 187 p_idct = 3 188 p_libu = 2 189 175 190 176 mapping.addThread( vspace, 'tg', False, 0, 0, p_tg,177 'mjpeg_tg_stack',178 'mjpeg_heap_0_0',179 1 ) # index in start_vector180 181 191 for x in xrange (x_size): 182 192 for y in xrange (y_size): … … 186 196 'mjpeg_demux_stack_%d_%d' % (x,y), 187 197 'mjpeg_heap_%d_%d' % (x,y), 188 2) # start_index198 1 ) # start_index 189 199 190 200 mapping.addThread( vspace, 'vld_%d_%d' % (x,y), False , x, y, p_vld, 191 201 'mjpeg_vld_stack_%d_%d' % (x,y), 192 202 'mjpeg_heap_%d_%d' % (x,y), 193 3) # start_index203 2 ) # start_index 194 204 195 205 mapping.addThread( vspace, 'iqzz_%d_%d' % (x,y), False , x, y, p_iqzz, 196 206 'mjpeg_iqzz_stack_%d_%d' % (x,y), 197 207 'mjpeg_heap_%d_%d' % (x,y), 198 4) # start_index208 3 ) # start_index 199 209 200 210 mapping.addThread( vspace, 'idct_%d_%d' % (x,y), False , x, y, p_idct, 201 211 'mjpeg_idct_stack_%d_%d' % (x,y), 202 212 'mjpeg_heap_%d_%d' % (x,y), 203 5) # start_index213 4 ) # start_index 204 214 205 215 mapping.addThread( vspace, 'libu_%d_%d' % (x,y), False , x, y, p_libu, 206 216 'mjpeg_libu_stack_%d_%d' % (x,y), 207 217 'mjpeg_heap_%d_%d' % (x,y), 208 6) # start_index218 5 ) # start_index 209 219 210 220 # extend mapping name
Note: See TracChangeset
for help on using the changeset viewer.