Changeset 415


Ignore:
Timestamp:
Sep 29, 2014, 12:05:28 PM (10 years ago)
Author:
alain
Message:

Using BPP (Big Physical Page) for idistributed stacks and heaps.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/convol/convol.py

    r401 r415  
    1717#  - x_width   : number of bits coding x coordinate
    1818#  - y_width   : number of bits coding y coordinate
    19 #  - procs_max : number of processors per cluster
     19#  - nprocs : number of processors per cluster
    2020####################################################################################
    2121
     
    2525    x_size    = mapping.x_size
    2626    y_size    = mapping.y_size
    27     procs_max = mapping.procs_max
     27    nprocs    = mapping.nprocs
    2828    x_width   = mapping.x_width
    2929    y_width   = mapping.y_width
     
    3131    # define vsegs base & size
    3232    code_base  = 0x10000000
    33     code_size  = 0x00010000     # 64 Kbytes
     33    code_size  = 0x00010000     # 64 Kbytes (replicated in each cluster)
    3434   
    3535    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)
    4037
    4138    heap_base  = 0x40000000     
    42     heap_size  = 0x01000000     # max 16 Mbytes (for all clusters)
     39    heap_size  = 0x01000000     # 16 Mbytes (per cluster)
    4340
    4441    stack_base = 0x50000000     
    45     stack_size = 0x02000000     # max 32 Mbytes (for all processors)
     42    stack_size = 0x00200000     # 2 Mbytes (per cluster)
    4643
    4744    # create Vspace
     
    5350                     local = False )
    5451
    55     # code vsegs : local (one replicated vseg per cluster)
     52    # code vsegs : local (one copy in each cluster)
    5653    for x in xrange (x_size):
    5754        for y in xrange (y_size):
     
    6360                             local = True )
    6461
    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)
    6674    for x in xrange (x_size):
    6775        for y in xrange (y_size):
    6876            cluster_id = (x * y_size) + y
    69             size       = heap_size / (x_size * y_size)
     77            size       = heap_size
    7078            base       = heap_base + (cluster_id * size)
    7179            mapping.addVseg( vspace, 'conv_heap_%d_%d' % (x,y), base, size,
    7280                             '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 )
    9582
    9683    # distributed tasks : one task per processor
    9784    for x in xrange (x_size):
    9885        for y in xrange (y_size):
    99             for p in xrange( procs_max ):
    100                 trdid = (((x * y_size) + y) * procs_max) + p
     86            for p in xrange( nprocs ):
     87                trdid = (((x * y_size) + y) * nprocs) + p
    10188                mapping.addTask( vspace, 'conv_%d_%d_%d' % (x,y,p), trdid, x, y, p,
    10289                                 'conv_stack_%d_%d_%d' % (x,y,p),
Note: See TracChangeset for help on using the changeset viewer.