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

Legend:

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