Changeset 141 for trunk/IPs


Ignore:
Timestamp:
Aug 2, 2010, 8:56:05 PM (14 years ago)
Author:
rosiere
Message:

Add statistics in stage IFETCH, DECODE and COMMIT (insert, retire and commit)

Location:
trunk/IPs/systemC/processor/Morpheo/Behavioural
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/include/Decod.h

    r139 r141  
    5656#ifdef STATISTICS
    5757  public    : Stat                           * _stat;
    58   public    : counter_t                      * _stat_sum_inst_decod;
     58  public    : counters_t                     * _stat_nb_inst_decod;
    5959#endif
    6060
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod_statistics_allocation.cpp

    r110 r141  
    2828                      param_statistics);
    2929
    30     _stat_sum_inst_decod = _stat->create_variable("sum_inst_decod");
    31    
    32    
    33     _stat->create_expr_average_by_cycle ("average_nb_inst_decod","sum_inst_decod","","Average of decod instruction by cycle");
    34     _stat->create_expr_percent          ("percent_nb_inst_decod","average_nb_inst_decod", toString(_param->_nb_inst_decod), "Percent of decod instruction by cycle");
     30    _stat_nb_inst_decod = _stat->create_counters("nb_inst_decod",_param->_nb_inst_decod,"",
     31                                                 _("Cycle number with %d decoded instruction(s)."),
     32                                                 _("Percent of cycle number with %d decoded instruction(s)."),
     33                                                 _("Average of decoded instructions.")
     34                                                 );
    3535 
    3636    log_printf(FUNC,Decod,FUNCTION,"End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod_transition.cpp

    r139 r141  
    5353#ifdef STATISTICS
    5454        if (usage_is_set(_usage,USE_STATISTICS))
    55           for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
    56             if (internal_DECOD_VAL [i] and PORT_READ(in_DECOD_ACK[i]))
    57               (*_stat_sum_inst_decod) ++;
     55          {
     56            uint32_t stat_nb_inst_decod = 0;
     57            for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
     58              if (internal_DECOD_VAL [i] and PORT_READ(in_DECOD_ACK[i]))
     59                stat_nb_inst_decod ++;
     60            (*_stat_nb_inst_decod) += stat_nb_inst_decod;
     61          }
    5862#endif
    5963      }
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/include/Ifetch_queue.h

    r136 r141  
    5555  private   : counter_t                      * _sum_use_queue_error_wait_rsp;
    5656
    57   private   : counter_t                      * _sum_inst_enable;
    5857  private   : counter_t                      * _sum_transaction_address;
    5958
    60   private   : counter_t                      * _average_occupation_bundle;
     59  private   : counters_t                     * _stat_nb_inst_fetch;
     60   
    6161#endif
    6262
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/src/Ifetch_queue_function_full_assoc_transition.cpp

    r136 r141  
    5151        // =====[ ADDRESS ]==========================================
    5252        // ==========================================================
     53#ifdef STATISTICS
     54        uint32_t stat_nb_inst_fetch=0;
     55#endif
     56
    5357        if (PORT_READ(in_ADDRESS_VAL) and internal_ADDRESS_ACK)
    5458          {
     
    7074                Tcontrol_t enable = PORT_READ(in_ADDRESS_INSTRUCTION_ENABLE [i]);
    7175#ifdef STATISTICS
    72                 if (usage_is_set(_usage,USE_STATISTICS))
    73                   (*_sum_inst_enable) += enable;
     76                stat_nb_inst_fetch+=enable;
    7477#endif
    7578                _queue[reg_PTR_WRITE]->_instruction_enable [i]      = enable;
     
    8386            reg_PTR_WRITE = (reg_PTR_WRITE+1)%_param->_size_queue;
    8487          }
     88
     89#ifdef STATISTICS
     90        if (usage_is_set(_usage,USE_STATISTICS))
     91          (*_stat_nb_inst_fetch)+=stat_nb_inst_fetch;
     92#endif
     93
    8594
    8695        // ==========================================================
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/src/Ifetch_queue_function_no_assoc_transition.cpp

    r136 r141  
    5151        // =====[ ADDRESS ]==========================================
    5252        // ==========================================================
     53#ifdef STATISTICS
     54        uint32_t stat_nb_inst_fetch=0;
     55#endif
     56
    5357        if (PORT_READ(in_ADDRESS_VAL) and internal_ADDRESS_ACK)
    5458          {
     
    7074                Tcontrol_t enable = PORT_READ(in_ADDRESS_INSTRUCTION_ENABLE [i]);
    7175#ifdef STATISTICS
    72                 if (usage_is_set(_usage,USE_STATISTICS))
    73                   (*_sum_inst_enable) += enable;
     76                 stat_nb_inst_fetch += enable;
    7477#endif
    7578                _queue[reg_PTR_WRITE]->_instruction_enable [i]      = enable;
     
    8386            reg_PTR_WRITE = (reg_PTR_WRITE+1)%_param->_size_queue;
    8487          }
     88#ifdef STATISTICS
     89        if (usage_is_set(_usage,USE_STATISTICS))
     90          (*_stat_nb_inst_fetch) += stat_nb_inst_fetch;
     91#endif
    8592
    8693        // ==========================================================
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/src/Ifetch_queue_statistics_allocation.cpp

    r110 r141  
    3434    _sum_use_queue_have_rsp       = _stat->create_variable("sum_use_queue_have_rsp");
    3535    _sum_use_queue_error_wait_rsp = _stat->create_variable("sum_use_queue_error_wait_rsp");
    36     _sum_inst_enable              = _stat->create_variable("sum_inst_enable");
    3736
    38     _average_occupation_bundle    = _stat->create_counter ("average_occupation_bundle", "", "Occupation average of instruction's bundle.");
    39 
    40     _stat->create_expr                 ("average_occupation_bundle" ,"/ sum_inst_enable sum_transaction_address");
    41     _stat->create_expr_percent         ("percent_occupation_bundle" ,"average_occupation_bundle", toString(_param->_nb_instruction),"Percent of instruction's bundle occupation.");
    4237    _stat->create_expr                 ("sum_use_queue"             ,"+ + sum_use_queue_wait_rsp sum_use_queue_have_rsp sum_use_queue_error_wait_rsp");
    4338    _stat->create_expr_average_by_cycle("average_use_queue"               ,"sum_use_queue"               ,"","Average occupation of ifetch queue");
     
    4843
    4944    _stat->create_expr_average         ("average_miss_icache"             ,"+ sum_use_queue_wait_rsp sum_use_queue_error_wait_rsp", "sum_transaction_address", "", "Average Miss Instruction Cache");
     45
     46    _stat_nb_inst_fetch     = _stat->create_counters("nb_inst_fetch",_param->_nb_instruction,"",
     47                                                     _("Number bundle with %d instruction(s)."),
     48                                                     _("Percent of bundle with %d instruction(s)."),
     49                                                     _("Average instruction in a bundle.")
     50                                                     );
    5051
    5152    log_printf(FUNC,Ifetch_queue,FUNCTION,"End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/include/Commit_unit.h

    r139 r141  
    5555#ifdef STATISTICS
    5656  public    : Stat                           * _stat;
    57   public    : counter_t                     ** _stat_nb_inst_insert               ;//[nb_rename_unit]
    58   public    : counter_t                     ** _stat_nb_inst_retire               ;//[nb_rename_unit]
    59   public    : counter_t                      * _stat_nb_inst_commit               ;
     57
     58  public    : counters_t                    ** _stat_nb_inst_insert               ;//[nb_rename_unit]
     59  public    : counters_t                    ** _stat_nb_inst_retire               ;//[nb_rename_unit]
     60  public    : counters_t                    ** _stat_nb_inst_commit               ;//[nb_rename_unit]
     61
    6062  public    : counter_t                      * _stat_nb_inst_commit_conflit_access;
    6163  public    : counter_t                     ** _stat_nb_inst_retire_ok            ;//[nb_thread]
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_statistics_allocation.cpp

    r137 r141  
    4848    }
    4949
    50     _stat_nb_inst_insert         = new counter_t * [_param->_nb_rename_unit];
    51     _stat_nb_inst_retire         = new counter_t * [_param->_nb_rename_unit];
    5250    _stat_nb_inst_retire_ok      = new counter_t * [_param->_nb_thread];
    5351    _stat_nb_inst_retire_ko      = new counter_t * [_param->_nb_thread];
     
    5553    _stat_nb_inst_type           = new counter_t * [_param->_nb_type];
    5654    _stat_bank_nb_inst           = new counter_t * [_param->_nb_bank];
    57 
    58     {
    59       std::string sum_nb_inst_insert    = "0";
    60       std::string sum_nb_inst_retire    = "0";
    61 
    62       for (uint32_t i=0; i<_param->_nb_rename_unit; i++)
    63         {
    64           _stat_nb_inst_insert    [i] = _stat->create_variable("nb_inst_insert_"   +toString(i));
    65           _stat_nb_inst_retire    [i] = _stat->create_variable("nb_inst_retire_"   +toString(i));
    66          
    67           _stat->create_expr_average_by_cycle("average_use_interface_insert_"+toString(i), "nb_inst_insert_"+toString(i), "", toString(_("Average instruction by cycle on insert interface (rename_unit %d)"),i));
    68           _stat->create_expr_average_by_cycle("average_use_interface_retire_"+toString(i), "nb_inst_retire_"+toString(i), "", toString(_("Average instruction by cycle on retire interface (rename_unit %d)"),i));
    69           _stat->create_expr_percent         ("percent_use_interface_insert_"+toString(i) , "average_use_interface_insert_"+toString(i), toString(_param->_nb_inst_insert [i]), toString(_("Percent usage of insert interface (rename_unit %d)"),i));
    70           _stat->create_expr_percent         ("percent_use_interface_retire_"+toString(i) , "average_use_interface_retire_"+toString(i), toString(_param->_nb_inst_retire [i]), toString(_("Percent usage of retire interface (rename_unit %d)"),i));
    71 
    72           sum_nb_inst_insert    = "+ nb_inst_insert_"+   toString(i) + " " +sum_nb_inst_insert;
    73           sum_nb_inst_retire    = "+ nb_inst_retire_"+   toString(i) + " " +sum_nb_inst_retire;
    74         }
    75 
    76       _stat->create_expr_average_by_cycle("average_inst_insert"   , sum_nb_inst_insert   , "", _("Average instruction insert by cycle"));
    77       _stat->create_expr_average_by_cycle("average_inst_retire"   , sum_nb_inst_retire   , "", _("Average instruction retire by cycle"));
    78     }
    7955
    8056    {
     
    163139        }
    164140    }
    165 
    166     _stat_nb_inst_commit = _stat->create_variable("nb_inst_commit");
    167     _stat->create_expr_average_by_cycle("average_use_interface_commit","nb_inst_commit", "", _("Average instruction by cycle on commit interface"));
    168     _stat->create_expr_percent         ("percent_use_interface_commit", "average_use_interface_commit", toString(_param->_nb_inst_commit), _("Percent usage of commit interface"));
    169 
    170     _stat_nb_inst_commit_conflit_access = _stat->create_variable("nb_inst_commit_conflit_access");
    171     _stat->create_expr_average_by_cycle("average_use_interface_commit_conflit_access","nb_inst_commit_conflit_access", "", _("Average access conflit by cycle on commit interface"));
    172     _stat->create_expr_percent         ("percent_use_interface_commit_conflit_access","average_use_interface_commit_conflit_access", "average_use_interface_commit", _("Percent access conflit on commit interface"));
    173141
    174142    // bank/queue occupation
     
    192160    }
    193161
     162    _stat_nb_inst_insert         = new counters_t * [_param->_nb_rename_unit];
     163    _stat_nb_inst_retire         = new counters_t * [_param->_nb_rename_unit];
     164    _stat_nb_inst_commit         = new counters_t * [_param->_nb_rename_unit];
     165
     166    std::string average_nb_inst_commit = "0";
     167   
     168    for (uint32_t i=0; i<_param->_nb_rename_unit; i++)
     169      {
     170        _stat_nb_inst_insert [i] = _stat->create_counters("nb_inst_insert_"+toString(i),_param->_nb_inst_insert[i],"",
     171                                                             _("Cycle number with %d instruction(s) included ")+toString(_("(rename_unit %d)."),i),
     172                                                             _("Percent of cycle number with %d instruction(s) included ")+toString(_("(rename_unit %d)."),i),
     173                                                             _("Average of instruction(s) included ")+toString(_("(rename_unit %d)."),i)
     174                                                             );
     175       
     176        _stat_nb_inst_retire [i] = _stat->create_counters("nb_inst_retire_"+toString(i),_param->_nb_inst_retire[i],"",
     177                                                             _("Cycle number with %d instruction(s) removed ")+toString(_("(rename_unit %d)."),i),
     178                                                             _("Percent of cycle number with %d instruction(s) removed ")+toString(_("(rename_unit %d)."),i),
     179                                                             _("Average of instruction(s) removed ")+toString(_("(rename_unit %d)."),i)
     180                                                             );
     181       
     182        _stat_nb_inst_commit [i] = _stat->create_counters("nb_inst_commit_"+toString(i),_param->_nb_inst_commit,"",
     183                                                             _("Cycle number with %d instruction(s) commited ")+toString(_("(rename_unit %d)."),i),
     184                                                             _("Percent of cycle number with %d instruction(s) commited ")+toString(_("(rename_unit %d)."),i),
     185                                                             _("Average of instruction(s) commited "+toString(_("(rename_unit %d)."),i))
     186                                                             );
     187
     188        average_nb_inst_commit = "+ average_nb_inst_commit_"+toString(i) + " " + average_nb_inst_commit;
     189      }
     190
     191    _stat_nb_inst_commit_conflit_access = _stat->create_variable("nb_inst_commit_conflit_access");
     192    _stat->create_expr_average_by_cycle("average_use_interface_commit_conflit_access","nb_inst_commit_conflit_access", "", _("Average access conflit by cycle on commit interface"));
     193    _stat->create_expr_percent         ("percent_use_interface_commit_conflit_access","average_use_interface_commit_conflit_access", average_nb_inst_commit, _("Percent access conflit on commit interface"));
    194194
    195195    log_end(Commit_unit,FUNCTION);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_statistics_deallocation.cpp

    r137 r141  
    2727    delete _stat;
    2828
    29     delete [] _stat_nb_inst_insert;
    30     delete [] _stat_nb_inst_retire;
    3129    delete [] _stat_nb_inst_retire_ok;
    3230    delete [] _stat_nb_inst_retire_ko;
     
    4038    delete [] _stat_nb_cycle_state_wait_end      ;
    4139
    42    
     40    delete [] _stat_nb_inst_insert;
     41    delete [] _stat_nb_inst_retire;
     42    delete [] _stat_nb_inst_commit;
     43       
    4344    log_end(Commit_unit,FUNCTION);
    4445  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_transition.cpp

    r139 r141  
    8989    else
    9090      {
     91#ifdef STATISTICS
     92        uint32_t stat_nb_inst_insert [_param->_nb_rename_unit];
     93        uint32_t stat_nb_inst_retire [_param->_nb_rename_unit];
     94        uint32_t stat_nb_inst_commit [_param->_nb_rename_unit];
     95       
     96        if (usage_is_set(_usage,USE_STATISTICS))
     97          for (uint32_t i=0; i<_param->_nb_rename_unit; ++i)
     98            {
     99              stat_nb_inst_insert [i] = 0;
     100              stat_nb_inst_retire [i] = 0;
     101              stat_nb_inst_commit [i] = 0;
     102            }
     103#endif
     104
    91105        // Increase number idle cycle
    92106        for (uint32_t i=0; i<_param->_nb_front_end; i++)
     
    354368#ifdef STATISTICS
    355369                      if (usage_is_set(_usage,USE_STATISTICS))
    356                         (*_stat_nb_inst_insert [x]) ++;
     370                        stat_nb_inst_insert [x] ++;
    357371#endif
    358372                   
     
    433447                  {
    434448                    log_printf(TRACE,Commit_unit,FUNCTION,"  * COMMIT            [%d]",x);
     449                    log_printf(TRACE,Commit_unit,FUNCTION,"    * num_bank              : %d",i);
     450
     451                    // find the good entry !!!
     452                    entry_t *       entry        = internal_BANK_COMMIT_ENTRY [i][j];
    435453
    436454#ifdef STATISTICS
    437455                    if (usage_is_set(_usage,USE_STATISTICS))
    438                       (*_stat_nb_inst_commit) ++;
     456                      stat_nb_inst_commit [entry->rename_unit_id] ++;
    439457#endif
    440 
    441                     log_printf(TRACE,Commit_unit,FUNCTION,"    * num_bank              : %d",i);
    442 
    443                     // find the good entry !!!
    444                     entry_t *       entry        = internal_BANK_COMMIT_ENTRY [i][j];
    445458
    446459                    log_printf(TRACE,Commit_unit,FUNCTION,"    * ptr                   : %d",entry->ptr);
     
    720733#ifdef STATISTICS
    721734                if (usage_is_set(_usage,USE_STATISTICS))
    722                   (*_stat_nb_inst_retire [x]) ++;
     735                  stat_nb_inst_retire [x] ++;
    723736#endif
    724737               
     
    12901303                }
    12911304            }
     1305
     1306        for (uint32_t i=0; i<_param->_nb_rename_unit; ++i)
     1307          {
     1308            (*_stat_nb_inst_insert [i]) += stat_nb_inst_insert [i];
     1309            (*_stat_nb_inst_retire [i]) += stat_nb_inst_retire [i];
     1310            (*_stat_nb_inst_commit [i]) += stat_nb_inst_commit [i];
     1311          }
    12921312      }
    12931313#endif
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_statistics_declaration.cpp

    r138 r141  
    2323    if (_param->_nb_port_read>0)
    2424    _stat_port_read         = _stat->create_counters("port_read",_param->_nb_port_read,"",
    25                                                      _("Usage of read port %d."),
    26                                                      _("Percent of usage read port %d."),
    27                                                      _("Average of usage read port.")
     25                                                     _("Cycle number cycle with %d read(s)."),
     26                                                     _("Percent of cycle number cycle with %d read(s)."),
     27                                                     _("Average of read per cycle.")
    2828                                                     );
    2929
    3030    if (_param->_nb_port_write>0)
    3131    _stat_port_write        = _stat->create_counters("port_write",_param->_nb_port_write,"",
    32                                                      _("Usage of write port %d."),
    33                                                      _("Percent of usage write port %d."),
    34                                                      _("Average of usage write port.")
     32                                                     _("Cycle number cycle with %d write(s)."),
     33                                                     _("Percent of cycle number cycle with %d write(s)."),
     34                                                     _("Average of write per cycle.")
    3535                                                     );
    3636    if (_param->_nb_port_read_write>0)
    3737    _stat_port_read_write   = _stat->create_counters("port_read_write",_param->_nb_port_read_write,"",
    38                                                      _("Usage of read_write port."),
    39                                                      _("Percent of usage read_write port %d."),
    40                                                      _("Average of usage read_write port.")
     38                                                     _("Cycle number cycle with %d read_write(s)."),
     39                                                     _("Percent of cycle number cycle with %d read_write(s)."),
     40                                                     _("Average of read_write per cycle.")
    4141                                                     );
    4242
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Operation.h

    r88 r141  
    1212namespace behavioural {
    1313
    14 #define neg(size,data)             (~(data)+1)
    15 #define sign(size,data)            ((data)>>(size-1))
    16 #define unsigned(size,data)        (data)
    17 #define signed(size,data)          ((sign(size,data)==0)?(data):neg(size,data))
    18 #define ovf(size,op1, op2, res)    ((sign(size,op1) == sign(size,op2))?(sign(size,op1) xor sign(size,res)):0)
    19 #define carry(size,op1, op2, res)  (((res)<(op1)) or ((res)<(op2)))
    20 #define set_flag(data,flag,is_set) (((is_set)==1)?((data)|(flag)):((data)&~(flag)))
    21 #define get_flag(data,flag)        (((data)&(flag))!=0)
    22 #define concatenation_bool(a,b)    (((a)<<1) | (b))
     14#  define neg(     size,data)           (~(data)+1)
     15#  define sign(    size,data)           ((data)>>(size-1))
     16#  define unsigned(size,data)           (data)
     17#  define signed(  size,data)           ((sign(size,data)==0)?(data):neg(size,data))
     18//#define ovf(     size,op1, op2, c_in) ((op2^(op1+op2+c_in))&~(op1^op2))>>(size-1);
     19#  define ovf(     size,op1, op2, res)  ((sign(size,op1) == sign(size,op2))?(sign(size,op1) xor sign(size,res)):0)
     20#  define carry(   size,op1, op2, res)  (((res)<(op1)) or ((res)<(op2)))
     21#  define set_flag(data,flag,is_set)    (((is_set)==1)?((data)|(flag)):((data)&~(flag)))
     22#  define get_flag(data,flag)           (((data)&(flag))!=0)
     23#  define concatenation_bool(a,b)       (((a)<<1) | (b))
    2324
    2425}; // end namespace behavioural
Note: See TracChangeset for help on using the changeset viewer.