Changeset 607


Ignore:
Timestamp:
Dec 19, 2013, 9:39:53 AM (11 years ago)
Author:
alain
Message:

Introducing support for cluster index fixed format.

Location:
trunk/platforms/tsar_generic_iob
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/platforms/tsar_generic_iob/Makefile

    r450 r607  
    44clean:
    55        soclib-cc -x -p top.desc -I.
    6         rm -rf *.o *.x tty*
     6        rm -rf *.o *.x tty* term*
     7
  • trunk/platforms/tsar_generic_iob/top.cpp

    r584 r607  
    1818// The internal physical address space is 40 bits.
    1919//
    20 // It contains a 2D mesh of XMAX*YMAX clusters, and 3 networks:
     20// It contains a 2D mesh of XMAX*YMAX clusters, and the cluster index
     21// is encoded on 8 bits (X_WIDTH = 4 / Y_WIDTH = 4) whatever the mesh size.
     22//
     23// It contains 3 networks:
    2124//
    2225// 1) the INT network supports Read/Write transactions
     
    182185//////////////////////i/////////////////////////////////////
    183186
    184 #define XMAX                  CLUSTER_X
    185 #define YMAX                  CLUSTER_Y
     187#define XMAX                  X_SIZE
     188#define YMAX                  Y_SIZE
    186189
    187190#define XRAM_LATENCY          0
     
    200203
    201204#define BDEV_SECTOR_SIZE      512
    202 #define BDEV_IMAGE_NAME       "giet_vm/display/images.raw"
     205#define BDEV_IMAGE_NAME       "../../../giet_vm/hdd/virt_hdd.dmg"
    203206
    204207#define NIC_RX_NAME           "giet_vm/nic/rx_packets.txt"
     
    211214#define WEST                  3
    212215
    213 #define cluster(x,y)   ((y) + YMAX*(x))
     216#define cluster(x,y)   ((y) + (x<<4))
    214217
    215218////////////////////////////////////////////////////////////
     
    217220//////////////////////i/////////////////////////////////////
    218221
    219 #define BOOT_SOFT_NAME        "giet_vm/soft.elf"
     222#define BOOT_SOFT_NAME        "../../softs/tsar_boot/preloader.elf"
    220223
    221224////////////////////////////////////////////////////////////
     
    363366   size_t   cluster_iob1     = cluster(XMAX-1,YMAX-1);     // cluster containing IOB1
    364367   size_t   block_size       = BDEV_SECTOR_SIZE;           // disk block size
    365 
     368   size_t   x_width          = 4;                          // at most 256 clusters
     369   size_t   y_width          = 4;                          // at most 256 clusters
     370
     371   assert( (X_WIDTH == 4) and (Y_WIDTH == 4) and
     372   "ERROR: we must have X_WIDTH == Y_WIDTH == 4");
     373 
    366374   ////////////// command line arguments //////////////////////
    367375   if (argc > 1)
     
    389397         {
    390398            debug_memc_id = atoi(argv[n+1]);
    391             assert( (debug_memc_id < (XMAX*YMAX) ) &&
    392                    "debug_memc_id larger than XMAX * YMAX" );
     399            size_t x = debug_memc_id >> 4;
     400            size_t y = debug_memc_id & 0xF;
     401            if( (x>=XMAX) || (y>=YMAX) )
     402            {
     403                std::cout << "PROCID parameter does'nt fit XMAX/YMAX" << std::endl;
     404                exit(0);
     405            }
    393406         }
    394407         else if ((strcmp(argv[n],"-IOB") == 0) && (n+1<argc) )
     
    398411         else if ((strcmp(argv[n],"-PROCID") == 0) && (n+1<argc) )
    399412         {
    400             debug_proc_id = atoi(argv[n+1]);
    401             assert( (debug_proc_id < (XMAX * YMAX * NB_PROCS_MAX) ) &&
    402                    "debug_proc_id larger than XMAX * YMAX * NB_PROCS" );
     413            debug_proc_id     = atoi(argv[n+1]);
     414            size_t cluster_xy = debug_proc_id / NB_PROCS_MAX ;
     415            size_t x          = cluster_xy >> 4;
     416            size_t y          = cluster_xy & 0xF;
     417            if( (x>=XMAX) || (y>=YMAX) )
     418            {
     419                std::cout << "PROCID parameter does'nt fit XMAX/YMAX" << std::endl;
     420                exit(0);
     421            }
    403422         }
    404423         else if ((strcmp(argv[n], "-THREADS") == 0) && ((n+1) < argc))
     
    436455
    437456   // checking hardware parameters
    438    assert( ( (XMAX == 1) or (XMAX == 2) or (XMAX == 4) or
    439              (XMAX == 8) or (XMAX == 16) ) and
    440            "The XMAX parameter must be 1, 2, 4, 8 or 16" );
    441 
    442    assert( ( (YMAX == 1) or (YMAX == 2) or (YMAX == 4) or
    443              (YMAX == 8) or (YMAX == 16) ) and
    444            "The YMAX parameter must be 1, 2, 4, 8 or 16" );
    445 
    446    assert( ( (NB_PROCS_MAX == 1) or (NB_PROCS_MAX == 2) or (NB_PROCS_MAX == 4) ) and
    447            "The NB_PROCS_MAX parameter must be 1, 2, 4" );
    448 
    449    assert( (NB_DMA_CHANNELS == 4) and
    450            "The NB_DMA_CHANNELS parameter must be 4" );
     457   assert( (XMAX <= 16) and
     458           "The XMAX parameter cannot be larger than 16" );
     459
     460   assert( (YMAX <= 16) and
     461           "The YMAX parameter cannot be larger than 16" );
     462
     463   assert( (NB_PROCS_MAX <= 8) and
     464           "The NB_PROCS_MAX parameter cannot be larger than 8" );
     465
     466   assert( (NB_DMA_CHANNELS <= 4) and
     467           "The NB_DMA_CHANNELS parameter cannot be larger than 4" );
    451468
    452469   assert( (NB_TTY_CHANNELS < 16) and
     
    498515                                   vci_trdid_width,
    499516                                   vci_wrplen_width> vci_param_ext;
    500 
    501    // Define parameters depending on mesh size
    502    size_t   x_width;
    503    size_t   y_width;
    504 
    505    if      (XMAX == 1) x_width = 0;
    506    else if (XMAX == 2) x_width = 1;
    507    else if (XMAX <= 4) x_width = 2;
    508    else if (XMAX <= 8) x_width = 3;
    509    else                x_width = 4;
    510 
    511    if      (YMAX == 1) y_width = 0;
    512    else if (YMAX == 2) y_width = 1;
    513    else if (YMAX <= 4) y_width = 2;
    514    else if (YMAX <= 8) y_width = 3;
    515    else                y_width = 4;
    516517
    517518   /////////////////////////////////////////////////////////////////////
     
    13941395    for (size_t n = 1; n < ncycles; n++)
    13951396    {
    1396         // Monitor a specific address for L1 and/or L2 caches
     1397        // Monitor a specific address for one L1 cache
    13971398        // clusters[1][1]->proc[0]->cache_monitor(0x50090ULL);
    1398         // clusters[0][0]->memc->cache_monitor(   0x50090ULL);
     1399
     1400        // Monitor a specific address for one L2 cache
     1401        // clusters[0][0]->memc->cache_monitor( 0x170000ULL);
     1402
     1403        // Monitor a specific address for one XRAM
     1404        // if (n == 3000000) clusters[0][0]->xram->start_monitor( 0x170000ULL , 64);
    13991405
    14001406        if (debug_ok and (n > debug_from) and (n % debug_period == 0))
     
    14031409            std::cout << " ************************************************" << std::endl;
    14041410
    1405          
    1406             // trace proc[debug_proc_id] ... or several procs
    1407 //          for( debug_proc_id = 0 ; debug_proc_id < 2 ; debug_proc_id++ )
    1408 
    1409             if ( debug_proc_id < XMAX*YMAX*NB_PROCS_MAX )
     1411            // trace proc[debug_proc_id]
     1412            if ( debug_proc_id != 0xFFFFFFFF )
    14101413            {
    1411                 size_t l = debug_proc_id % NB_PROCS_MAX ;
    1412                 size_t y = (debug_proc_id / NB_PROCS_MAX) % YMAX ;
    1413                 size_t x = debug_proc_id / (YMAX * NB_PROCS_MAX) ;
     1414                size_t l          = debug_proc_id % NB_PROCS_MAX ;
     1415                size_t cluster_xy = debug_proc_id / NB_PROCS_MAX ;
     1416                size_t x          = cluster_xy >> 4;
     1417                size_t y          = cluster_xy & 0xF;
    14141418
    14151419                clusters[x][y]->proc[l]->print_trace(1);
     
    14251429                clusters[x][y]->signal_int_vci_tgt_xicu.print_trace(xicu_signame.str());
    14261430
    1427                 if( clusters[x][y]->signal_proc_it[0].read() )
     1431                if( clusters[x][y]->signal_proc_it[l].read() )
    14281432                    std::cout << "### IRQ_PROC_" << std::dec
    1429                               << x << "_" << y << " ACTIVE" << std::endl;
    1430                
    1431 //              std::ostringstream p2m_signame;
    1432 //              p2m_signame << "[SIG]PROC_" << x << "_" << y << "_" << l << " P2M" ;
    1433 //              clusters[x][y]->signal_int_dspin_p2m_proc[l].print_trace(p2m_signame.str());
    1434 
    1435 //              std::ostringstream m2p_signame;
    1436 //              m2p_signame << "[SIG]PROC_" << x << "_" << y << "_" << l << " M2P" ;
    1437 //              clusters[x][y]->signal_int_dspin_m2p_proc[l].print_trace(m2p_signame.str());
    1438 
    1439 //              std::ostringstream p_cmd_signame;
    1440 //              p_cmd_signame << "[SIG]PROC_" << x << "_" << y << "_" << l << " CMD" ;
    1441 //              clusters[x][y]->signal_int_dspin_cmd_proc_i[l].print_trace(p_cmd_signame.str());
    1442 
    1443 //              std::ostringstream p_rsp_signame;
    1444 //              p_rsp_signame << "[SIG]PROC_" << x << "_" << y << "_" << l << " RSP" ;
    1445 //              clusters[x][y]->signal_int_dspin_rsp_proc_i[l].print_trace(p_rsp_signame.str());
    1446 
     1433                              << x << "_" << y << "_" << l << " ACTIVE" << std::endl;
    14471434            }   
    14481435
    1449             // trace INT_CMD_D xbar and router in 1_0
    1450 //          clusters[1][0]->int_xbar_cmd_d->print_trace();
    1451 //          clusters[1][0]->int_xbar_rsp_d->print_trace();
    1452 
    1453 //          clusters[1][0]->signal_int_dspin_cmd_l2g_d.print_trace("[SIG] INT_CMD_L2G_D_1_0");
    1454 //          clusters[1][0]->signal_int_dspin_rsp_g2l_d.print_trace("[SIG] INT_RSP_G2L_D_1_0");
    1455 
    1456 //          clusters[1][0]->int_router_cmd->print_trace(0);
    1457 //          clusters[1][0]->int_router_rsp->print_trace(0);
    1458 
    1459             // trace INT_CMD_D xbar and router in 0_0
     1436            // trace INT network
    14601437//          clusters[0][0]->int_xbar_cmd_d->print_trace();
    14611438//          clusters[0][0]->int_xbar_rsp_d->print_trace();
    14621439
    1463 //          clusters[0][0]->signal_int_dspin_cmd_g2l_d.print_trace("[SIG] INT_CMD_G2L_D_0_0");
    1464 //          clusters[0][0]->signal_int_dspin_rsp_l2g_d.print_trace("[SIG] INT_RSP_L2G_D_0_0");
    1465          
     1440//          clusters[0][0]->signal_int_dspin_cmd_l2g_d.print_trace("[SIG] INT_CMD_L2G_D_0_0");
     1441//          clusters[0][0]->signal_int_dspin_rsp_g2l_d.print_trace("[SIG] INT_RSP_G2L_D_0_0");
     1442
    14661443//          clusters[0][0]->int_router_cmd->print_trace(0);
    14671444//          clusters[0][0]->int_router_rsp->print_trace(0);
    14681445
    1469             // trace memc[debug_memc_id] and xram[debug_memc_id]
    1470             if ( debug_memc_id < XMAX*YMAX )
     1446            // trace INT_CMD_D xbar and router in cluster 0_1
     1447//          clusters[0][1]->int_router_cmd->print_trace(0);
     1448//          clusters[0][1]->int_router_rsp->print_trace(0);
     1449 
     1450//          clusters[0][1]->signal_int_dspin_cmd_g2l_d.print_trace("[SIG] INT_CMD_G2L_D_0_0");
     1451//          clusters[0][1]->signal_int_dspin_rsp_l2g_d.print_trace("[SIG] INT_RSP_L2G_D_0_0");
     1452         
     1453//          clusters[0][1]->int_xbar_cmd_d->print_trace();
     1454//          clusters[0][1]->int_xbar_rsp_d->print_trace();
     1455
     1456            // trace memc[debug_memc_id]
     1457            if ( debug_memc_id != 0xFFFFFFFF )
    14711458            {
    1472                 size_t x = debug_memc_id / YMAX;
    1473                 size_t y = debug_memc_id % YMAX;
     1459                size_t x = debug_memc_id >> 4;
     1460                size_t y = debug_memc_id & 0xF;
     1461           
    14741462                clusters[x][y]->memc->print_trace(0);
    14751463                std::ostringstream smemc_tgt;
     
    15081496//              signal_dspin_rsp_iob0_loopback.print_trace("[SIG]IOB0_RSP_LOOPBACK");
    15091497
    1510 //              cdma->print_trace();
    1511 //              signal_vci_tgt_cdma.print_trace("[SIG]IOX_CDMA_TGT");
    1512 //              signal_vci_ini_cdma.print_trace("[SIG]IOX_CDMA_INI");
    1513 
    1514                 brom->print_trace();
    1515                 signal_vci_tgt_brom.print_trace("[SIG]IOX_BROM_TGT");
     1498                cdma->print_trace();
     1499                signal_vci_tgt_cdma.print_trace("[SIG]IOX_CDMA_TGT");
     1500                signal_vci_ini_cdma.print_trace("[SIG]IOX_CDMA_INI");
     1501
     1502//              brom->print_trace();
     1503//              signal_vci_tgt_brom.print_trace("[SIG]IOX_BROM_TGT");
    15161504
    15171505//              mtty->print_trace();
    15181506//              signal_vci_tgt_mtty.print_trace("[SIG]IOX_MTTY_TGT");
    15191507
    1520                 bdev->print_trace();
    1521                 signal_vci_tgt_bdev.print_trace("[SIG]IOX_BDEV_TGT");
    1522                 signal_vci_ini_bdev.print_trace("[SIG]IOX_BDEV_INI");
     1508//              bdev->print_trace();
     1509//              signal_vci_tgt_bdev.print_trace("[SIG]IOX_BDEV_TGT");
     1510//              signal_vci_ini_bdev.print_trace("[SIG]IOX_BDEV_INI");
    15231511
    15241512//              fbuf->print_trace();
  • trunk/platforms/tsar_generic_iob/tsar_iob_cluster/caba/source/include/tsar_iob_cluster.h

    r550 r607  
    7878        sc_signal<bool>                               signal_proc_it[8];
    7979        sc_signal<bool>                               signal_irq_mdma[8];
     80        sc_signal<bool>                               signal_irq_memc;
    8081       
    8182        // INT network DSPIN signals between DSPIN routers and DSPIN local_crossbars
  • trunk/platforms/tsar_generic_iob/tsar_iob_cluster/caba/source/src/tsar_iob_cluster.cpp

    r599 r607  
    8484    assert( (x_id < xmax) and (y_id < ymax) and "Illegal cluster coordinates");
    8585
    86     size_t cluster_id = x_id * ymax + y_id;
    87 
    88     size_t cluster_iob0 = 0;                 // South-West cluster
    89     size_t cluster_iob1 = xmax*ymax-1;       // North-East cluster
     86    size_t cluster_id = (x_id<<4) + y_id;
     87
     88    size_t cluster_iob0 = 0;                            // South-West cluster
     89    size_t cluster_iob1 = ((xmax-1)<<4) + ymax-1;       // North-East cluster
    9090
    9191    // Vectors of DSPIN ports for inter-cluster communications
     
    621621    memc->p_dspin_m2p                            (signal_int_dspin_m2p_memc);
    622622    memc->p_dspin_clack                          (signal_int_dspin_clack_memc);
     623    memc->p_irq                                  (signal_irq_memc);
    623624
    624625    // wrapper to INT network
Note: See TracChangeset for help on using the changeset viewer.