Ignore:
Timestamp:
Dec 10, 2015, 12:16:18 PM (8 years ago)
Author:
alain
Message:

Remove the TG thread: The mjpeg strem dispatch is
directly done by the main thread.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/applications/mjpeg/mjpeg.py

    r736 r741  
    1212#
    1313#  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].
    1615#    - the "demux", "iqzz", "idct", "vld", and "libu" threads, implementing
    1716#      a block-level pipe-line, are replicated in all clusters.
     
    8382
    8483    # stacks vsegs: local (one stack per thread => 5 stacks per cluster)
    85     # ... plus main_stack and tg_stack in cluster[0][0]
     84    # ... plus main_stack in cluster[0][0]
    8685    base = stack_base
    8786    mapping.addVseg( vspace, 'mjpeg_main_stack',
     
    9291    base += stack_size
    9392
    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_size
    100 
    10193    for x in xrange (x_size):
    10294        for y in xrange (y_size):
     
    139131
    140132    # threads mapping: demux, vld, iqzz, idct, libu replicated in all clusters
    141     # main & tg are mapped in cluster[0,0]
     133    # main mapped in cluster[0,0]
    142134    mapping.addThread( vspace, 'main', True, 0, 0, 0,
    143135                       'mjpeg_main_stack',
     
    145137                       0 )                      # index in start_vector
    146138
    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
    175190   
    176     mapping.addThread( vspace, 'tg', False, 0, 0, p_tg,
    177                        'mjpeg_tg_stack',
    178                        'mjpeg_heap_0_0',
    179                        1 )                      # index in start_vector
    180 
    181191    for x in xrange (x_size):
    182192        for y in xrange (y_size):
     
    186196                                   'mjpeg_demux_stack_%d_%d' % (x,y),
    187197                                   'mjpeg_heap_%d_%d' % (x,y),
    188                                    2 )   # start_index 
     198                                   1 )   # start_index 
    189199
    190200                mapping.addThread( vspace, 'vld_%d_%d' % (x,y), False , x, y, p_vld,
    191201                                   'mjpeg_vld_stack_%d_%d' % (x,y),
    192202                                   'mjpeg_heap_%d_%d' % (x,y),
    193                                    3 )   # start_index 
     203                                   2 )   # start_index 
    194204
    195205                mapping.addThread( vspace, 'iqzz_%d_%d' % (x,y), False , x, y, p_iqzz,
    196206                                   'mjpeg_iqzz_stack_%d_%d' % (x,y),
    197207                                   'mjpeg_heap_%d_%d' % (x,y),
    198                                    4 )   # start_index 
     208                                   3 )   # start_index 
    199209
    200210                mapping.addThread( vspace, 'idct_%d_%d' % (x,y), False , x, y, p_idct,
    201211                                   'mjpeg_idct_stack_%d_%d' % (x,y),
    202212                                   'mjpeg_heap_%d_%d' % (x,y),
    203                                    5 )   # start_index 
     213                                   4 )   # start_index 
    204214
    205215                mapping.addThread( vspace, 'libu_%d_%d' % (x,y), False , x, y, p_libu,
    206216                                   'mjpeg_libu_stack_%d_%d' % (x,y),
    207217                                   'mjpeg_heap_%d_%d' % (x,y),
    208                                    6 )   # start_index 
     218                                   5 )   # start_index 
    209219
    210220    # extend mapping name
Note: See TracChangeset for help on using the changeset viewer.