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
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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                }
Note: See TracChangeset for help on using the changeset viewer.