Changeset 802 for trunk


Ignore:
Timestamp:
Sep 12, 2014, 3:10:04 PM (10 years ago)
Author:
cfuguet
Message:

tsar_generic_iob: Using the new P_WIDTH constant from hard_config.h

  • This constant is used in the clusters to compute the procesor id which now is: (((x << Y_WIDTH) + y) << P_WIDTH) + lpid
  • Introducing the p_width constant in the arch.py and non_distributed_arch.py files
Location:
trunk/platforms/tsar_generic_iob
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/platforms/tsar_generic_iob/arch.py

    r770 r802  
    11#!/usr/bin/env python
    22
     3from math import log, ceil
    34from mapping import *
    45
     
    89#   author : Alain Greiner
    910#######################################################################################
    10 #  This file contains a mapping generator for the "tsar_generic_iob" platform. 
     11#  This file contains a mapping generator for the "tsar_generic_iob" platform.
    1112#  This includes both the hardware architecture (clusters, processors, peripherals,
    1213#  physical space segmentation) and the mapping of all kernel objects (global vsegs).
     
    4243
    4344    nb_ttys           = 1
    44     nb_nics           = 2 
     45    nb_nics           = 2
    4546    fbf_width         = 128
    4647    x_io              = 0
     
    4849    x_width           = 4
    4950    y_width           = 4
     51    p_width           = int(ceil(log(nb_procs, 2)))
    5052    paddr_width       = 40
    5153    irq_per_proc      = 4
     
    5355    peri_increment    = 0x10000
    5456    distributed_ptabs = True
    55                  
     57
    5658    ### parameters checking
    5759
    58     assert( nb_procs <= 4 )
    59 
    60     assert( (x_size == 1) or (x_size == 2) or (x_size == 4) 
     60    assert( nb_procs <= (1 << p_width) )
     61
     62    assert( (x_size == 1) or (x_size == 2) or (x_size == 4)
    6163             or (x_size == 8) or (x_size == 16) )
    6264
    63     assert( (y_size == 1) or (y_size == 2) or (y_size == 4) 
     65    assert( (y_size == 1) or (y_size == 2) or (y_size == 4)
    6466             or (y_size == 8) or (y_size == 16) )
    6567
     
    7072
    7173    platform_name  = 'tsar_iob_%d_%d_%d' % ( x_size, y_size, nb_procs )
    72    
     74
    7375    ### define physical segments
    7476
     
    7678    ram_size = 0x4000000                   # 64 Mbytes
    7779
    78     xcu_base = 0x00B0000000 
    79     xcu_size = 0x1000                      # 4 Kbytes 
     80    xcu_base = 0x00B0000000
     81    xcu_size = 0x1000                      # 4 Kbytes
    8082
    8183    dma_base = 0x00B1000000
    8284    dma_size = 0x1000 * nb_procs           # 4 Kbytes * nb_procs
    8385
    84     mmc_base = 0x00B2000000 
     86    mmc_base = 0x00B2000000
    8587    mmc_size = 0x1000                      # 4 Kbytes
    8688
     
    117119
    118120    boot_code_vbase      = 0x00080000      # ident
    119     boot_code_size       = 0x00040000      # 256 Kbytes 
    120  
     121    boot_code_size       = 0x00040000      # 256 Kbytes
     122
    121123    boot_data_vbase      = 0x000C0000      # ident
    122124    boot_data_size       = 0x00080000      # 512 Kbytes
     
    127129    ### define kernel vsegs base addresses and sizes
    128130
    129     kernel_code_vbase    = 0x80000000           
     131    kernel_code_vbase    = 0x80000000
    130132    kernel_code_size     = 0x00020000      # 128 Kbytes
    131133
     
    144146    ### create mapping
    145147
    146     mapping = Mapping( name           = platform_name,
    147                        x_size         = x_size,       
    148                        y_size         = y_size,       
    149                        procs_max      = nb_procs,     
    150                        x_width        = x_width,       
    151                        y_width        = y_width,       
    152                        paddr_width    = paddr_width,   
    153                        coherence      = True,         
    154                        irq_per_proc   = irq_per_proc, 
    155                        use_ramdisk    = use_ramdisk, 
    156                        x_io           = x_io,         
     148    mapping = Mapping( name           = platform_name,
     149                       x_size         = x_size,
     150                       y_size         = y_size,
     151                       procs_max      = nb_procs,
     152                       x_width        = x_width,
     153                       y_width        = y_width,
     154                       p_width        = p_width,
     155                       paddr_width    = paddr_width,
     156                       coherence      = True,
     157                       irq_per_proc   = irq_per_proc,
     158                       use_ramdisk    = use_ramdisk,
     159                       x_io           = x_io,
    157160                       y_io           = y_io,
    158                        peri_increment = peri_increment, 
    159                        ram_base       = ram_base, 
    160                        ram_size       = ram_size )         
     161                       peri_increment = peri_increment,
     162                       ram_base       = ram_base,
     163                       ram_size       = ram_size )
    161164
    162165    ###  external peripherals (accessible in cluster[0,0] only for this mapping)
     
    168171    tty = mapping.addPeriph( 'TTY', base = tty_base, size = tty_size, ptype = 'TTY', channels = nb_ttys )
    169172
    170     nic = mapping.addPeriph( 'NIC', base = nic_base, size = nic_size, ptype = 'NIC', channels = nb_nics ) 
     173    nic = mapping.addPeriph( 'NIC', base = nic_base, size = nic_size, ptype = 'NIC', channels = nb_nics )
    171174
    172175    cma = mapping.addPeriph( 'CMA', base = cma_base, size = cma_size, ptype = 'CMA', channels = 2*nb_nics )
     
    193196    mapping.addIrq( pic, index = 9, isrtype = 'ISR_TTY_RX', channel = 0 )
    194197
    195     ### hardware components replicated in all clusters   
     198    ### hardware components replicated in all clusters
    196199
    197200    for x in xrange( x_size ):
     
    202205            ram = mapping.addRam( 'RAM', base = ram_base + offset, size = ram_size )
    203206
    204             mmc = mapping.addPeriph( 'MMC', base = mmc_base + offset, size = mmc_size, 
     207            mmc = mapping.addPeriph( 'MMC', base = mmc_base + offset, size = mmc_size,
    205208                                     ptype = 'MMC' )
    206209
    207             dma = mapping.addPeriph( 'DMA', base = dma_base + offset, size = dma_size, 
    208                                      ptype = 'DMA', channels = nb_procs ) 
    209 
    210             xcu = mapping.addPeriph( 'XCU', base = xcu_base + offset, size = xcu_size, 
     210            dma = mapping.addPeriph( 'DMA', base = dma_base + offset, size = dma_size,
     211                                     ptype = 'DMA', channels = nb_procs )
     212
     213            xcu = mapping.addPeriph( 'XCU', base = xcu_base + offset, size = xcu_size,
    211214                                     ptype = 'XCU', channels = nb_procs * irq_per_proc, arg = 16 )
    212215
     
    223226                mapping.addProc( x, y, p )
    224227
    225     ### global vsegs for boot_loader / identity mapping 
     228    ### global vsegs for boot_loader / identity mapping
    226229
    227230    mapping.addGlobal( 'seg_boot_mapping', boot_mapping_vbase, boot_mapping_size,
     
    241244                       identity = True )
    242245
    243     ### the code global vsegs for kernel can be replicated in all clusters 
     246    ### the code global vsegs for kernel can be replicated in all clusters
    244247    ### if the page tables are distributed in all clusters.
    245248
     
    267270    ### shared global vsegs for kernel
    268271
    269     mapping.addGlobal( 'seg_kernel_data', kernel_data_vbase, kernel_data_size, 
    270                        'C_W_', vtype = 'ELF', x = 0, y = 0, pseg = 'RAM', 
     272    mapping.addGlobal( 'seg_kernel_data', kernel_data_vbase, kernel_data_size,
     273                       'C_W_', vtype = 'ELF', x = 0, y = 0, pseg = 'RAM',
    271274                       binpath = 'build/kernel/kernel.elf', local = False )
    272275
    273276    mapping.addGlobal( 'seg_kernel_uncdata', kernel_uncdata_vbase, kernel_uncdata_size,
    274                        '__W_', vtype = 'ELF', x = 0, y = 0, pseg = 'RAM', 
     277                       '__W_', vtype = 'ELF', x = 0, y = 0, pseg = 'RAM',
    275278                       binpath = 'build/kernel/kernel.elf', local = False )
    276279
    277280    ### global vsegs for external peripherals / identity mapping
    278281
    279     mapping.addGlobal( 'seg_iob', iob_base, iob_size, '__W_', 
    280                        vtype = 'PERI', x = 0, y = 0, pseg = 'IOB', 
    281                        identity = True )
    282 
    283     mapping.addGlobal( 'seg_bdv', bdv_base, bdv_size, '__W_', 
     282    mapping.addGlobal( 'seg_iob', iob_base, iob_size, '__W_',
     283                       vtype = 'PERI', x = 0, y = 0, pseg = 'IOB',
     284                       identity = True )
     285
     286    mapping.addGlobal( 'seg_bdv', bdv_base, bdv_size, '__W_',
    284287                       vtype = 'PERI', x = 0, y = 0, pseg = 'BDV',
    285288                       identity = True )
    286289
    287     mapping.addGlobal( 'seg_tty', tty_base, tty_size, '__W_', 
     290    mapping.addGlobal( 'seg_tty', tty_base, tty_size, '__W_',
    288291                       vtype = 'PERI', x = 0, y = 0, pseg = 'TTY',
    289292                       identity = True )
    290293
    291     mapping.addGlobal( 'seg_nic', nic_base, nic_size, '__W_', 
     294    mapping.addGlobal( 'seg_nic', nic_base, nic_size, '__W_',
    292295                       vtype = 'PERI', x = 0, y = 0, pseg = 'NIC',
    293296                       identity = True )
    294297
    295     mapping.addGlobal( 'seg_cma', cma_base, cma_size, '__W_', 
     298    mapping.addGlobal( 'seg_cma', cma_base, cma_size, '__W_',
    296299                       vtype = 'PERI', x = 0, y = 0, pseg = 'CMA',
    297300                       identity = True )
    298301
    299     mapping.addGlobal( 'seg_fbf', fbf_base, fbf_size, '__W_', 
     302    mapping.addGlobal( 'seg_fbf', fbf_base, fbf_size, '__W_',
    300303                       vtype = 'PERI', x = 0, y = 0, pseg = 'FBF',
    301304                       identity = True )
    302305
    303     mapping.addGlobal( 'seg_pic', pic_base, pic_size, '__W_', 
     306    mapping.addGlobal( 'seg_pic', pic_base, pic_size, '__W_',
    304307                       vtype = 'PERI', x = 0, y = 0, pseg = 'PIC',
    305308                       identity = True )
    306309
    307     mapping.addGlobal( 'seg_rom', rom_base, rom_size, 'CXW_', 
     310    mapping.addGlobal( 'seg_rom', rom_base, rom_size, 'CXW_',
    308311                       vtype = 'PERI', x = 0, y = 0, pseg = 'ROM',
    309312                       identity = True )
    310313
    311     ### global vsegs for internal peripherals, and for schedulers 
     314    ### global vsegs for internal peripherals, and for schedulers
    312315    ### name is indexed by (x,y) / vbase address is incremented by (cluster_xy * peri_increment)
    313316
     
    346349
    347350#   print mapping.giet_vsegs()
    348                      
     351
    349352
    350353# Local Variables:
  • trunk/platforms/tsar_generic_iob/non_distributed_arch.py

    r730 r802  
    11#!/usr/bin/env python
    22
     3from math import log, ceil
    34from mapping import *
    45
     
    89#   author : Alain Greiner
    910#######################################################################################
    10 #  This file contains a mapping generator for the "tsar_generic_iob" platform. 
     11#  This file contains a mapping generator for the "tsar_generic_iob" platform.
    1112#  This includes both the hardware architecture (clusters, processors, peripherals,
    1213#  physical space segmentation) and the mapping of all kernel objects (global vsegs).
     
    4243
    4344    nb_ttys        = 1
    44     nb_nics        = 2 
     45    nb_nics        = 2
    4546    fbf_width      = 1024
    4647    x_io           = 0
    4748    y_io           = 0
     49    p_width        = int(ceil(log(nb_procs, 2)))
    4850    x_width        = 4
    4951    y_width        = 4
     
    5254    use_ramdisk    = False
    5355    peri_increment = 0x10000
    54                  
     56
    5557    ### parameters checking
    5658
    57     assert( nb_procs <= 4 )
    58 
    59     assert( (x_size == 1) or (x_size == 2) or (x_size == 4) 
     59    assert( nb_procs <= (1 << p_width) )
     60
     61    assert( (x_size == 1) or (x_size == 2) or (x_size == 4)
    6062             or (y_size == 8) or (x_size == 16) )
    6163
    62     assert( (y_size == 1) or (y_size == 2) or (y_size == 4) 
     64    assert( (y_size == 1) or (y_size == 2) or (y_size == 4)
    6365             or (y_size == 8) or (y_size == 16) )
    6466
     
    6971
    7072    platform_name  = 'tsar_iob_%d_%d_%d' % ( x_size, y_size, nb_procs )
    71    
     73
    7274    ### define physical segments
    7375
     
    7577    ram_size = 0x4000000                   # 64 Mbytes
    7678
    77     xcu_base = 0x00B0000000 
    78     xcu_size = 0x1000                      # 4 Kbytes 
     79    xcu_base = 0x00B0000000
     80    xcu_size = 0x1000                      # 4 Kbytes
    7981
    8082    dma_base = 0x00B1000000
    8183    dma_size = 0x1000 * nb_procs           # 4 Kbytes * nb_procs
    8284
    83     mmc_base = 0x00B2000000 
     85    mmc_base = 0x00B2000000
    8486    mmc_size = 0x1000                      # 4 Kbytes
    8587
     
    116118
    117119    boot_code_vbase      = 0x00010000      # ident
    118     boot_code_size       = 0x00020000      # 128 Kbytes 
    119  
     120    boot_code_size       = 0x00020000      # 128 Kbytes
     121
    120122    boot_data_vbase      = 0x00030000      # ident
    121123    boot_data_size       = 0x00010000      # 64 Kbytes
     
    129131    ### define kernel vsegs base addresses
    130132
    131     kernel_code_vbase    = 0x80000000           
     133    kernel_code_vbase    = 0x80000000
    132134    kernel_code_size     = 0x00020000      # 128 Kbytes
    133135
     
    146148    ### create mapping
    147149
    148     mapping = Mapping( name           = platform_name,
    149                        x_size         = x_size,       
    150                        y_size         = y_size,       
    151                        procs_max      = nb_procs,     
    152                        x_width        = x_width,       
    153                        y_width        = y_width,       
    154                        paddr_width    = paddr_width,   
    155                        coherence      = True,         
    156                        irq_per_proc   = irq_per_proc, 
    157                        use_ramdisk    = use_ramdisk, 
    158                        x_io           = x_io,         
     150    mapping = Mapping( name           = platform_name,
     151                       x_size         = x_size,
     152                       y_size         = y_size,
     153                       procs_max      = nb_procs,
     154                       x_width        = x_width,
     155                       y_width        = y_width,
     156                       p_width        = p_width,
     157                       paddr_width    = paddr_width,
     158                       coherence      = True,
     159                       irq_per_proc   = irq_per_proc,
     160                       use_ramdisk    = use_ramdisk,
     161                       x_io           = x_io,
    159162                       y_io           = y_io,
    160                        peri_increment = peri_increment )         
     163                       peri_increment = peri_increment )
    161164
    162165    ###  external peripherals (accessible in cluster[0,0] only for this mapping)
     
    168171    tty = mapping.addPeriph( 'TTY', base = tty_base, size = tty_size, ptype = 'TTY', channels = nb_ttys )
    169172
    170     nic = mapping.addPeriph( 'NIC', base = nic_base, size = nic_size, ptype = 'NIC', channels = nb_nics ) 
     173    nic = mapping.addPeriph( 'NIC', base = nic_base, size = nic_size, ptype = 'NIC', channels = nb_nics )
    171174
    172175    cma = mapping.addPeriph( 'CMA', base = cma_base, size = cma_size, ptype = 'CMA', channels = 2*nb_nics )
     
    193196    mapping.addIrq( pic, index = 9, isrtype = 'ISR_TTY_RX', channel = 0 )
    194197
    195     ### hardware components replicated in all clusters   
     198    ### hardware components replicated in all clusters
    196199
    197200    for x in xrange( x_size ):
     
    202205            ram = mapping.addRam( 'RAM', base = ram_base + offset, size = ram_size )
    203206
    204             mmc = mapping.addPeriph( 'MMC', base = mmc_base + offset, size = mmc_size, 
     207            mmc = mapping.addPeriph( 'MMC', base = mmc_base + offset, size = mmc_size,
    205208                                     ptype = 'MMC' )
    206209
    207             dma = mapping.addPeriph( 'DMA', base = dma_base + offset, size = dma_size, 
    208                                      ptype = 'DMA', channels = nb_procs ) 
    209 
    210             xcu = mapping.addPeriph( 'XCU', base = xcu_base + offset, size = xcu_size, 
     210            dma = mapping.addPeriph( 'DMA', base = dma_base + offset, size = dma_size,
     211                                     ptype = 'DMA', channels = nb_procs )
     212
     213            xcu = mapping.addPeriph( 'XCU', base = xcu_base + offset, size = xcu_size,
    211214                                     ptype = 'XCU', channels = nb_procs * irq_per_proc, arg = 16 )
    212215
     
    220223    ### global vsegs for boot_loader / identity mapping
    221224
    222     mapping.addGlobal( 'seg_boot_mapping'  , boot_mapping_vbase  , boot_mapping_size  , 'C_W_', 
     225    mapping.addGlobal( 'seg_boot_mapping'  , boot_mapping_vbase  , boot_mapping_size  , 'C_W_',
    223226                       vtype = 'BLOB'  , x = 0, y = 0, pseg = 'RAM', identity = True )
    224227
    225     mapping.addGlobal( 'seg_boot_code'     , boot_code_vbase     , boot_code_size     , 'CXW_', 
     228    mapping.addGlobal( 'seg_boot_code'     , boot_code_vbase     , boot_code_size     , 'CXW_',
    226229                       vtype = 'BUFFER', x = 0, y = 0, pseg = 'RAM', identity = True )
    227230
    228     mapping.addGlobal( 'seg_boot_data'     , boot_data_vbase     , boot_data_size     , 'C_W_', 
     231    mapping.addGlobal( 'seg_boot_data'     , boot_data_vbase     , boot_data_size     , 'C_W_',
    229232                       vtype = 'BUFFER', x = 0, y = 0, pseg = 'RAM', identity = True )
    230233
    231     mapping.addGlobal( 'seg_boot_buffer'   , boot_buffer_vbase   , boot_buffer_size   , 'C_W_', 
     234    mapping.addGlobal( 'seg_boot_buffer'   , boot_buffer_vbase   , boot_buffer_size   , 'C_W_',
    232235                       vtype = 'BUFFER', x = 0, y = 0, pseg = 'RAM', identity = True )
    233236
    234     mapping.addGlobal( 'seg_boot_stack'    , boot_stack_vbase    , boot_stack_size    , 'C_W_', 
     237    mapping.addGlobal( 'seg_boot_stack'    , boot_stack_vbase    , boot_stack_size    , 'C_W_',
    235238                       vtype = 'BUFFER', x = 0, y = 0, pseg = 'RAM', identity = True )
    236239
    237     ### global vsegs for kernel   
    238 
    239     mapping.addGlobal( 'seg_kernel_code'   , kernel_code_vbase   , kernel_code_size   , 'CXW_', 
     240    ### global vsegs for kernel
     241
     242    mapping.addGlobal( 'seg_kernel_code'   , kernel_code_vbase   , kernel_code_size   , 'CXW_',
    240243                       vtype = 'ELF'   , x = 0, y = 0, pseg = 'RAM', binpath = 'build/kernel/kernel.elf' )
    241244
    242     mapping.addGlobal( 'seg_kernel_data'   , kernel_data_vbase   , kernel_data_size   , 'C_W_', 
     245    mapping.addGlobal( 'seg_kernel_data'   , kernel_data_vbase   , kernel_data_size   , 'C_W_',
    243246                       vtype = 'ELF'   , x = 0, y = 0, pseg = 'RAM', binpath = 'build/kernel/kernel.elf' )
    244247
    245     mapping.addGlobal( 'seg_kernel_uncdata', kernel_uncdata_vbase, kernel_uncdata_size, '__W_', 
     248    mapping.addGlobal( 'seg_kernel_uncdata', kernel_uncdata_vbase, kernel_uncdata_size, '__W_',
    246249                       vtype = 'ELF'   , x = 0, y = 0, pseg = 'RAM', binpath = 'build/kernel/kernel.elf' )
    247250
    248     mapping.addGlobal( 'seg_kernel_init'   , kernel_init_vbase   , kernel_init_size   , 'CXW_', 
     251    mapping.addGlobal( 'seg_kernel_init'   , kernel_init_vbase   , kernel_init_size   , 'CXW_',
    249252                       vtype = 'ELF'   , x = 0, y = 0, pseg = 'RAM', binpath = 'build/kernel/kernel.elf' )
    250253
    251254    ### global vsegs for external peripherals / identity mapping
    252255
    253     mapping.addGlobal( 'seg_iob', iob_base, iob_size, '__W_', 
     256    mapping.addGlobal( 'seg_iob', iob_base, iob_size, '__W_',
    254257                       vtype = 'PERI', x = 0, y = 0, pseg = 'IOB', identity = True )
    255258
    256     mapping.addGlobal( 'seg_bdv', bdv_base, bdv_size, '__W_', 
     259    mapping.addGlobal( 'seg_bdv', bdv_base, bdv_size, '__W_',
    257260                       vtype = 'PERI', x = 0, y = 0, pseg = 'BDV', identity = True )
    258261
    259     mapping.addGlobal( 'seg_tty', tty_base, tty_size, '__W_', 
     262    mapping.addGlobal( 'seg_tty', tty_base, tty_size, '__W_',
    260263                       vtype = 'PERI', x = 0, y = 0, pseg = 'TTY', identity = True )
    261264
    262     mapping.addGlobal( 'seg_nic', nic_base, nic_size, '__W_', 
     265    mapping.addGlobal( 'seg_nic', nic_base, nic_size, '__W_',
    263266                       vtype = 'PERI', x = 0, y = 0, pseg = 'NIC', identity = True )
    264267
    265     mapping.addGlobal( 'seg_cma', cma_base, cma_size, '__W_', 
     268    mapping.addGlobal( 'seg_cma', cma_base, cma_size, '__W_',
    266269                       vtype = 'PERI', x = 0, y = 0, pseg = 'CMA', identity = True )
    267270
    268     mapping.addGlobal( 'seg_fbf', fbf_base, fbf_size, '__W_', 
     271    mapping.addGlobal( 'seg_fbf', fbf_base, fbf_size, '__W_',
    269272                       vtype = 'PERI', x = 0, y = 0, pseg = 'FBF', identity = True )
    270273
    271     mapping.addGlobal( 'seg_pic', pic_base, pic_size, '__W_', 
     274    mapping.addGlobal( 'seg_pic', pic_base, pic_size, '__W_',
    272275                       vtype = 'PERI', x = 0, y = 0, pseg = 'PIC', identity = True )
    273276
    274     mapping.addGlobal( 'seg_rom', rom_base, rom_size, 'CXW_', 
     277    mapping.addGlobal( 'seg_rom', rom_base, rom_size, 'CXW_',
    275278                       vtype = 'PERI', x = 0, y = 0, pseg = 'ROM', identity = True )
    276279
    277     ### Global vsegs for replicated peripherals, and for schedulers 
     280    ### Global vsegs for replicated peripherals, and for schedulers
    278281    ### name is indexed by (x,y), base address is incremented by (cluster_xy * peri_increment)
    279282
     
    303306if __name__ == '__main__':
    304307
    305     mapping = genmap( x_size    = 2,
    306                       y_size    = 2,
    307                       nb_procs  = 2,
    308                       nb_ttys   = 1,
    309                       nb_nics   = 2,
    310                       fbf_width = 128,
    311                       x_io      = 0,
    312                       y_io      = 0 )
     308    mapping = arch( x_size    = 2,
     309                    y_size    = 2,
     310                    nb_procs  = 2 )
    313311
    314312#   print mapping.netbsd_dts()
     
    317315
    318316#   print mapping.giet_vsegs()
    319                      
     317
    320318
    321319# Local Variables:
  • trunk/platforms/tsar_generic_iob/top.cpp

    r765 r802  
    186186//////////////////////i/////////////////////////////////////
    187187
    188 #include "../../../giet_vm/hard_config.h"
     188#include "hard_config.h"
    189189
    190190////////////////////////////////////////////////////////////
     
    336336   size_t   cluster_iob0     = cluster(0,0);               // cluster containing IOB0
    337337   size_t   cluster_iob1     = cluster(XMAX-1,YMAX-1);     // cluster containing IOB1
    338    size_t   x_width          = 4;                          // at most 256 clusters
    339    size_t   y_width          = 4;                          // at most 256 clusters
     338   size_t   x_width          = X_WIDTH;                    // # of bits for x
     339   size_t   y_width          = Y_WIDTH;                    // # of bits for y
     340   size_t   p_width          = P_WIDTH;                    // # of bits for lpid
    340341
    341342#if USING_OPENMP
     
    347348   assert( (X_WIDTH == 4) and (Y_WIDTH == 4) and
    348349   "ERROR: we must have X_WIDTH == Y_WIDTH == 4");
     350
     351   assert( P_WIDTH <= 3 and
     352   "ERROR: we must have P_WIDTH <= 3");
    349353
    350354   ////////////// command line arguments //////////////////////
     
    399403         {
    400404            debug_proc_id     = atoi(argv[n+1]);
    401             size_t cluster_xy = debug_proc_id / NB_PROCS_MAX ;
     405            size_t cluster_xy = debug_proc_id >> P_WIDTH ;
    402406            size_t x          = cluster_xy >> 4;
    403407            size_t y          = cluster_xy & 0xF;
     
    444448           "The YMAX parameter cannot be larger than 16" );
    445449
    446    assert( (NB_PROCS_MAX <= 8) and
    447            "The NB_PROCS_MAX parameter cannot be larger than 8" );
     450   assert( (NB_PROCS_MAX <= (1 << P_WIDTH)) and
     451           "NB_PROCS_MAX parameter cannot be larger than 2^P_WIDTH" );
    448452
    449453   assert( (NB_DMA_CHANNELS <= 4) and
     
    459463             << " - XMAX            = " << XMAX << std::endl
    460464             << " - YMAX            = " << YMAX << std::endl
    461              << " - NB_PROCS_MAX    = " << NB_PROCS_MAX <<  std::endl
     465             << " - NB_PROCS_MAX    = " << NB_PROCS_MAX << std::endl
    462466             << " - NB_TTY_CHANNELS = " << NB_TTY_CHANNELS <<  std::endl
    463467             << " - NB_DMA_CHANNELS = " << NB_DMA_CHANNELS <<  std::endl
     
    602606                               IntTab( cluster(x,y), INT_IOBX_INI_ID ) );
    603607
    604          for ( size_t p = 0 ; p < NB_PROCS_MAX ; p++ )
     608         for ( size_t p = 0 ; p < NB_PROCS_MAX; p++ )
    605609         maptab_int.srcid_map( IntTab( cluster(x,y), PROC_LOCAL_SRCID+p ),
    606610                               IntTab( cluster(x,y), INT_PROC_INI_ID+p ) );
     
    10381042                y_width,
    10391043                vci_srcid_width - x_width - y_width,            // l_id width,
     1044                p_width,
    10401045
    10411046                INT_MEMC_TGT_ID,
     
    14381443            if ( debug_proc_id != 0xFFFFFFFF )
    14391444            {
    1440                 size_t l          = debug_proc_id % NB_PROCS_MAX ;
    1441                 size_t cluster_xy = debug_proc_id / NB_PROCS_MAX ;
     1445                size_t l          = debug_proc_id & ((1<<P_WIDTH)-1) ;
     1446                size_t cluster_xy = debug_proc_id >> P_WIDTH ;
    14421447                size_t x          = cluster_xy >> 4;
    14431448                size_t y          = cluster_xy & 0xF;
     
    14601465                // local interrupts in cluster(x,y)
    14611466                if( clusters[x][y]->signal_irq_memc.read() )
    1462                 std::cout << "### IRQ_MMC_" << std::dec << x << "_" << y 
     1467                std::cout << "### IRQ_MMC_" << std::dec << x << "_" << y
    14631468                          << " ACTIVE" << std::endl;
    14641469
     
    14661471                {
    14671472                    if( clusters[x][y]->signal_irq_mdma[c].read() )
    1468                     std::cout << "### IRQ_DMA_" << std::dec << x << "_" << y << "_" << c 
     1473                    std::cout << "### IRQ_DMA_" << std::dec << x << "_" << y << "_" << c
    14691474                              << " ACTIVE" << std::endl;
    14701475                }
    1471  
     1476
    14721477                for ( size_t c = 0 ; c < NB_PROCS_MAX ; c++ )
    14731478                {
    14741479                    if( clusters[x][y]->signal_proc_it[c].read() )
    1475                     std::cout << "### IRQ_PROC_" << std::dec << x << "_" << y << "_" << c 
     1480                    std::cout << "### IRQ_PROC_" << std::dec << x << "_" << y << "_" << c
    14761481                              << " ACTIVE" << std::endl;
    14771482                }
  • trunk/platforms/tsar_generic_iob/tsar_iob_cluster/caba/source/include/tsar_iob_cluster.h

    r739 r802  
    201201                    size_t                             y_width,       // y field  bits
    202202                    size_t                             l_width,       // l field  bits
     203                    size_t                             p_width,       // p field  bits
    203204
    204205                    size_t                             int_memc_tgt_id,
  • trunk/platforms/tsar_generic_iob/tsar_iob_cluster/caba/source/src/tsar_iob_cluster.cpp

    r739 r802  
    11//////////////////////////////////////////////////////////////////////////////
    22// File: tsar_iob_cluster.cpp
    3 // Author: Alain Greiner 
     3// Author: Alain Greiner
    44// Copyright: UPMC/LIP6
    55// Date : april 2013
     
    1010// - 1 vci_io_bridge (connected to the 3 networks.
    1111// - 3 vci_dspin_wrapper for the IOB.
    12 // - 2 dspin_local_crossbar for commands and responses. 
     12// - 2 dspin_local_crossbar for commands and responses.
    1313//////////////////////////////////////////////////////////////////////////////
    1414
     
    4040
    4141                    const soclib::common::MappingTable &mt_int,
    42                     const soclib::common::MappingTable &mt_ram, 
    43                     const soclib::common::MappingTable &mt_iox, 
     42                    const soclib::common::MappingTable &mt_ram,
     43                    const soclib::common::MappingTable &mt_iox,
    4444
    4545                    size_t                             x_width,
    4646                    size_t                             y_width,
    4747                    size_t                             l_width,
     48                    size_t                             p_width,
    4849
    4950                    size_t                             int_memc_tgt_id, // local index
     
    103104    {
    104105        p_vci_iob_iox_ini = new soclib::caba::VciInitiator<vci_param_ext>;
    105         p_vci_iob_iox_tgt = new soclib::caba::VciTarget<vci_param_ext>; 
     106        p_vci_iob_iox_tgt = new soclib::caba::VciTarget<vci_param_ext>;
    106107    }
    107108
     
    112113    ////////////  PROCS
    113114    for (size_t p = 0; p < nb_procs; p++)
    114     { 
     115    {
    115116        std::ostringstream s_proc;
    116117        s_proc << "proc_" << x_id << "_" << y_id << "_" << p;
     
    120121                                         GdbServer<Mips32ElIss> >(
    121122                      s_proc.str().c_str(),
    122                       cluster_id*nb_procs + p,        // GLOBAL PROC_ID
     123                      (cluster_id << p_width) + p,    // GLOBAL PROC_ID
    123124                      mt_int,                         // Mapping Table INT network
    124125                      IntTab(cluster_id,p),           // SRCID
     
    139140    }
    140141
    141     ///////////  MEMC   
     142    ///////////  MEMC
    142143    std::ostringstream s_memc;
    143144    s_memc << "memc_" << x_id << "_" << y_id;
     
    204205                     cluster_id,                   // cluster id
    205206                     nb_direct_initiators,         // number of local initiators
    206                      nb_direct_targets,            // number of local targets 
     207                     nb_direct_targets,            // number of local targets
    207208                     0 );                          // default target
    208209
     
    234235                     x_width, y_width, l_width,    // several dests
    235236                     1,                            // number of local sources
    236                      nb_procs,                     // number of local dests 
    237                      2, 2,                         // fifo depths 
     237                     nb_procs,                     // number of local dests
     238                     2, 2,                         // fifo depths
    238239                     true,                         // pseudo CMD
    239240                     false,                        // no routing table
     
    249250                     nb_procs,                     // number of local sources
    250251                     1,                            // number of local dests
    251                      2, 2,                         // fifo depths 
     252                     2, 2,                         // fifo depths
    252253                     false,                        // pseudo RSP
    253254                     false,                        // no routing table
    254                      false );                      // no broacast 
     255                     false );                      // no broacast
    255256
    256257    std::ostringstream s_int_xbar_clack_c;
     
    262263                     x_width, y_width, l_width,
    263264                     1,                            // number of local sources
    264                      nb_procs,                     // number of local targets 
     265                     nb_procs,                     // number of local targets
    265266                     1, 1,                         // fifo depths
    266267                     true,                         // CMD
     
    330331        ///////////  IO_BRIDGE
    331332        std::ostringstream s_iob;
    332         s_iob << "iob_" << x_id << "_" << y_id;   
     333        s_iob << "iob_" << x_id << "_" << y_id;
    333334        iob = new VciIoBridge<vci_param_int,
    334                               vci_param_ext>( 
     335                              vci_param_ext>(
    335336                     s_iob.str().c_str(),
    336337                     mt_ram,                                // EXT network maptab
     
    346347                     debug_start_cycle,
    347348                     iob_debug_ok );
    348        
     349
    349350        std::ostringstream s_iob_ram_wi;
    350         s_iob_ram_wi << "iob_ram_wi_" << x_id << "_" << y_id;   
     351        s_iob_ram_wi << "iob_ram_wi_" << x_id << "_" << y_id;
    351352        iob_ram_wi = new VciDspinInitiatorWrapper<vci_param_ext,
    352353                                                  dspin_ram_cmd_width,
     
    388389    // on coherence network : local srcid[proc] in [0...nb_procs-1]
    389390    //                      : local srcid[memc] = nb_procs
    390  
     391
    391392    //////////////////////// internal CMD & RSP routers
    392393    int_router_cmd->p_clk                        (this->p_clk);
     
    417418    int_router_cmd->p_in[4][1]                   (signal_int_dspin_m2p_l2g_c);
    418419    int_router_cmd->p_in[4][2]                   (signal_int_dspin_clack_l2g_c);
    419    
     420
    420421    int_router_rsp->p_out[4][0]                  (signal_int_dspin_rsp_g2l_d);
    421422    int_router_rsp->p_out[4][1]                  (signal_int_dspin_p2m_g2l_c);
     
    453454    int_wt_gate_d->p_dspin_cmd                   (signal_int_dspin_cmd_g2l_d);
    454455    int_wt_gate_d->p_dspin_rsp                   (signal_int_dspin_rsp_l2g_d);
    455    
     456
    456457    ////////////////////// M2P DSPIN local crossbar coherence
    457458    int_xbar_m2p_c->p_clk                        (this->p_clk);
     
    460461    int_xbar_m2p_c->p_global_in                  (signal_int_dspin_m2p_g2l_c);
    461462    int_xbar_m2p_c->p_local_in[0]                (signal_int_dspin_m2p_memc);
    462     for (size_t p = 0; p < nb_procs; p++) 
     463    for (size_t p = 0; p < nb_procs; p++)
    463464        int_xbar_m2p_c->p_local_out[p]           (signal_int_dspin_m2p_proc[p]);
    464465
     
    469470    int_xbar_p2m_c->p_global_in                  (signal_int_dspin_p2m_g2l_c);
    470471    int_xbar_p2m_c->p_local_out[0]               (signal_int_dspin_p2m_memc);
    471     for (size_t p = 0; p < nb_procs; p++) 
     472    for (size_t p = 0; p < nb_procs; p++)
    472473        int_xbar_p2m_c->p_local_in[p]            (signal_int_dspin_p2m_proc[p]);
    473474
     
    511512        else if ( i <= nb_dmas ) xicu->p_hwi[i]  (signal_irq_mdma[i-1]);
    512513        else                     xicu->p_hwi[i]  (signal_false);
    513     }                     
     514    }
    514515
    515516    ///////////////////////////////////// MEMC
     
    576577       ram_router_rsp->p_out[4]                  (signal_ram_dspin_rsp_memc_i);
    577578    }
    578    
    579     ///////////////////////// IOB exists only in cluster_iob0 & cluster_iob1. 
     579
     580    ///////////////////////// IOB exists only in cluster_iob0 & cluster_iob1.
    580581    if ( is_io )
    581582    {
Note: See TracChangeset for help on using the changeset viewer.