Changeset 803


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

tsar_generic_leti: 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 files
Location:
trunk/platforms/tsar_generic_leti
Files:
4 edited

Legend:

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

    r797 r803  
    11#!/usr/bin/env python
    22
     3from math import log, ceil
    34from mapping import *
    45
    56###############################################################################
    6 #   file   : arch.py  (for the tsar_generic_iob architecture)
     7#   file   : arch.py  (for the tsar_generic_leti architecture)
    78#   date   : may 2014
    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_leti" platform.
    1112#  This includes both the hardware architecture (clusters, processors,
    1213#  peripherals, physical space segmentation) and the mapping of all kernel
    13 #  objects (global vsegs).  This platform includes 6 external peripherals,
    14 #  accessible through two IO_Bridge components located in cluster [0,0] and
    15 #  cluster [x_size-1, y_size-1].  Available peripherals are: TTY, BDV, FBF,
    16 #  ROM, NIC, CMA.
     14#  objects (global vsegs).
    1715#
    1816#  The "constructor" parameters are:
     
    4947    x_width           = 4
    5048    y_width           = 4
     49    p_width           = int(ceil(log(nb_procs, 2)))
    5150    paddr_width       = 40
    5251    irq_per_proc      = 4
     
    5453    peri_increment    = 0x10000
    5554    reset_address     = 0x00000000
    56     distributed_ptabs = True
     55    distributed_ptabs = False
    5756
    5857    ### parameters checking
    5958
    60     assert( nb_procs <= 4 )
     59    assert( nb_procs <= (1 << p_width) )
    6160
    6261    assert( (x_size == 1) or (x_size == 2) or (x_size == 4)
     
    7170            ((x_io == x_size-1) and (y_io == y_size-1)) )
    7271
    73     platform_name  = 'tsar_iob_%d_%d_%d' % ( x_size, y_size, nb_procs )
     72    platform_name  = 'tsar_leti_%d_%d_%d' % ( x_size, y_size, nb_procs )
    7473
    7574    ### define physical segments
     
    107106    rdk_size  = 0x02000000                 # 32 Mbytes
    108107
     108    ### define  preloader vseg base address and size
     109
     110    preloader_vbase      = 0x00000000      # ident
     111    preloader_size       = 0x00010000      # 64 Kbytes
     112
    109113    ### define  bootloader vsegs base addresses and sizes
    110114
    111     boot_mapping_vbase   = 0x00000000      # ident
     115    boot_mapping_vbase   = 0x00010000      # ident
    112116    boot_mapping_size    = 0x00080000      # 512 Kbytes
    113117
    114     boot_code_vbase      = 0x00080000      # ident
     118    boot_code_vbase      = 0x00090000      # ident
    115119    boot_code_size       = 0x00040000      # 256 Kbytes
    116120
    117     boot_data_vbase      = 0x000C0000      # ident
     121    boot_data_vbase      = 0x000D0000      # ident
    118122    boot_data_size       = 0x00080000      # 512 Kbytes
    119123
    120     boot_stack_vbase     = 0x00140000      # ident
     124    boot_stack_vbase     = 0x00150000      # ident
    121125    boot_stack_size      = 0x00050000      # 320 Kbytes
    122126
     
    135139    kernel_init_size     = 0x00010000      # 64 Kbytes
    136140
    137     kernel_sched_vbase   = 0xF0000000            # distributed in all clusters
     141    kernel_sched_vbase   = 0x80060000            # distributed in all clusters
    138142    kernel_sched_size    = 0x2000 * nb_procs     # 8 kbytes per processor
    139143
     
    146150                       x_width        = x_width,
    147151                       y_width        = y_width,
     152                       p_width        = p_width,
    148153                       paddr_width    = paddr_width,
    149154                       coherence      = True,
     
    218223                mapping.addProc( x, y, p )
    219224
     225    ### global vseg for preloader
     226
     227    mapping.addGlobal( 'seg_preloader', preloader_vbase, preloader_size, '__W_',
     228                       vtype = 'BUFFER', x = 0, y = 0, pseg = 'RAM',
     229                       identity = True )
     230
    220231    ### global vseg for ram disk
    221232
    222     mapping.addGlobal( 'seg_rdk', rdk_base, rdk_size, '__W_',
    223                        vtype = 'BUFFER', x = 0, y = 0, pseg = 'RAM',
    224                        identity = True )
     233    if use_ramdisk:
     234        mapping.addGlobal( 'seg_rdk', rdk_base, rdk_size, '__W_',
     235                           vtype = 'BUFFER', x = 0, y = 0, pseg = 'RAM',
     236                           identity = True )
    225237
    226238    ### global vsegs for external peripherals / identity mapping
  • trunk/platforms/tsar_generic_leti/top.cpp

    r796 r803  
    272272            trace_proc_ok = true;
    273273            trace_proc_id = (size_t) strtol(argv[n + 1], NULL, 0);
    274             size_t cluster_xy = trace_proc_id / NB_PROCS_MAX ;
     274            size_t cluster_xy = trace_proc_id >> P_WIDTH ;
    275275            size_t x          = cluster_xy >> Y_WIDTH;
    276276            size_t y          = cluster_xy & ((1<<Y_WIDTH)-1);
    277             size_t l          = trace_proc_id % NB_PROCS_MAX ;
     277            size_t l          = trace_proc_id & ((1<<P_WIDTH)-1) ;
    278278
    279279            assert( (x < X_SIZE) and (y < Y_SIZE) and (l < NB_PROCS_MAX) and
     
    324324            "Illegal Y_SIZE parameter" );
    325325
     326    assert( (P_WIDTH <= 2) and
     327            "P_WIDTH parameter cannot be larger than 2" );
     328
    326329    assert( (NB_PROCS_MAX <= 4) and
    327330            "Illegal NB_PROCS_MAX parameter" );
     
    664667                Y_WIDTH,
    665668                vci_srcid_width - X_WIDTH - Y_WIDTH,   // l_id width,
     669                P_WIDTH,
    666670                MEMC_TGTID,
    667671                XICU_TGTID,
     
    11771181            if ( trace_proc_ok )
    11781182            {
    1179                 l = trace_proc_id % NB_PROCS_MAX ;
    1180                 x = (trace_proc_id / NB_PROCS_MAX) >> Y_WIDTH ;
    1181                 y = (trace_proc_id / NB_PROCS_MAX) & ((1<<Y_WIDTH) - 1);
     1183                l = trace_proc_id & ((1<<P_WIDTH)-1) ;
     1184                x = (trace_proc_id >> P_WIDTH) >> Y_WIDTH ;
     1185                y = (trace_proc_id >> P_WIDTH) & ((1<<Y_WIDTH) - 1);
    11821186
    11831187                std::ostringstream proc_signame;
  • trunk/platforms/tsar_generic_leti/tsar_leti_cluster/caba/source/include/tsar_leti_cluster.h

    r692 r803  
    166166                     size_t                             y_width,       // y field bits
    167167                     size_t                             l_width,       // l field bits
     168                     size_t                             p_width,       // p field bits
    168169                     size_t                             tgtid_memc,
    169170                     size_t                             tgtid_xicu,
  • trunk/platforms/tsar_generic_leti/tsar_leti_cluster/caba/source/src/tsar_leti_cluster.cpp

    r732 r803  
    3232         size_t                             y_width,
    3333         size_t                             l_width,
     34         size_t                             p_width,
    3435         size_t                             tgtid_memc,
    3536         size_t                             tgtid_xicu,
     
    8788    for (size_t p = 0; p < nb_procs; p++)
    8889    {
    89         uint32_t global_proc_id  = cluster_xy * nb_procs + p;
     90        uint32_t global_proc_id  = (cluster_xy << p_width) + p;
    9091        uint32_t global_cc_id    = (cluster_xy << l_width) + p;
    9192        bool     trace_ok        = trace_proc_ok and (trace_proc_id == global_proc_id);
Note: See TracChangeset for help on using the changeset viewer.