Ignore:
Timestamp:
Jan 5, 2017, 9:46:21 PM (7 years ago)
Author:
alain
Message:

1) introduce a new classif application, using the vci_master_nic network controler.
2) use the HEAP type in the python file for heap vsegs in all applications.

File:
1 edited

Legend:

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

    r720 r825  
    1212#  The mapping of threads on processors is the following:
    1313#    - the "main" on cluster[0][0] 
    14 #    - one "load" thread per cluster containing processors,
    15 #    - one "store" thread per cluster containing processors,
    16 #    - (nprocs-2) "analyse" thread per cluster containing processors.
     14#    - one "analyse" thread per processor,
    1715#  The mapping of virtual segments is the following:
    1816#    - There is one shared data vseg in cluster[0][0]
     
    2624#    - y_width   : number of bits for y field
    2725#    - nprocs    : number of processors per cluster
    28 #
    29 #  WARNING: The target architecture cannot contain less
    30 #           than 3 processors per cluster.
    3126##################################################################################
    3227
     
    4035    y_width   = mapping.y_width
    4136
    42     assert (nprocs >= 3) and (nprocs <= 8)
    43 
    4437    # define vsegs base & size
    4538    code_base  = 0x10000000     
     
    4942    data_size  = 0x00010000     # 64 Kbytes (non replicated)
    5043
    51     heap_base  = 0x30000000
    52     heap_size  = 0x00200000     # 2M bytes (per cluster)     
     44    stack_base = 0x30000000
     45    stack_size = 0x00010000     # 64 Kbytes (per thread)
    5346
    54     stack_base = 0x40000000
    55     stack_size = 0x00010000     # 64 Kbytes (per thread)
     47    heap_base  = 0x40000000   
     48    heap_size  = 0x00200000     # 2 Mbytes (per cluster)
    5649
    5750    # create vspace
    5851    vspace = mapping.addVspace( name = 'classif',
    5952                                startname = 'classif_data',
    60                                 active = False )
     53                                active = True )
    6154   
    6255    # data vseg : shared / cluster[0][0]
     
    6558                     binpath = 'bin/classif/appli.elf',
    6659                     local = False )
    67 
    68     # heap vsegs : shared (one per cluster)
    69     for x in xrange (x_size):
    70         for y in xrange (y_size):
    71             cluster_id = (x * y_size) + y
    72             if ( mapping.clusters[cluster_id].procs ):
    73                 size  = heap_size
    74                 base  = heap_base + (cluster_id * size)
    75 
    76                 mapping.addVseg( vspace, 'classif_heap_%d_%d' %(x,y), base , size,
    77                                  'C_WU', vtype = 'HEAP', x = x, y = y, pseg = 'RAM',
    78                                  local = False, big = True )
    7960
    8061    # code vsegs : local (one copy per cluster)
     
    11091                                     local = True )
    11192
     93    # heap vsegs : distributed but non local (any heap can be accessed by any thread)
     94    for x in xrange (x_size):
     95        for y in xrange (y_size):
     96            cluster_id = (x * y_size) + y
     97            if ( mapping.clusters[cluster_id].procs ):
     98                base       = heap_base + (cluster_id * heap_size)
     99
     100                mapping.addVseg( vspace, 'classif_heap_%d_%d' % (x,y), base, heap_size,
     101                                 'C_WU' , vtype = 'HEAP' , x = x , y = y , pseg = 'RAM',
     102                                 local = False, big = True )
     103
    112104    # distributed threads / one thread per processor
    113105    # ... plus main on P[0][0][0]
    114     mapping.addThread( vspace, 'main', True, 0, 0, 1,
    115                        'main_stack',
    116                        'classif_heap_0_0',
     106    mapping.addThread( vspace, 'main', True, 0, 0, 0,
     107                       'main_stack', '' ,
    117108                       0 )                      # index in start_vector
    118109
     
    122113            if ( mapping.clusters[cluster_id].procs ):
    123114                for p in xrange( nprocs ):
    124                     if  ( p== 0 ):                              # thread load
    125                         start_index = 3
    126                         thread_name = 'load_%d_%d_%d' %(x,y,p)           
    127                     elif  ( p== 1 ):                            # thread store
    128                         start_index = 2
    129                         thread_name = 'stor_%d_%d_%d' %(x,y,p)           
    130                     else :                                      # thread analyse
    131                         start_index = 1
    132                         thread_name = 'anal_%d_%d_%d' % (x,y,p)
     115                    start_index = 1
     116                    thread_name = 'analyse_%d_%d_%d' % (x,y,p)
    133117
    134118                    mapping.addThread( vspace, thread_name, False , x, y, p,
    135                                        'classif_stack_%d_%d_%d' % (x,y,p), 
     119                                       'classif_stack_%d_%d_%d' % (x,y,p),
    136120                                       'classif_heap_%d_%d' % (x,y),
    137                                        start_index ) 
     121                                        1 )      # index in start_vector
    138122
    139123    # extend mapping name
Note: See TracChangeset for help on using the changeset viewer.