Ignore:
Timestamp:
Feb 19, 2009, 5:31:47 PM (15 years ago)
Author:
rosiere
Message:

1) OOO_egine : add stat to depiste low perf source
2) Commit : add stat
3) LSU_Pointer : retire - always ack (else combinatory loop). insert - max nb_inst_memory
4) TopLevel? : add debug_idle_time to stop combinatory loop.
5) Issue_queue : add reexecute_queue, new implementation (routage after issue_queue)
6) Decod / Predictor : add "can_continue"

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_transition.cpp

    r109 r110  
    88
    99#include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/include/Commit_unit.h"
     10#include "Behavioural/include/Simulation.h"
    1011
    1112namespace morpheo                    {
     
    114115                {
    115116                  log_printf(TRACE,Commit_unit,FUNCTION,"  * INSERT            [%d][%d]",x,y);
    116 
    117 #ifdef STATISTICS
    118                   if (usage_is_set(_usage,USE_STATISTICS))
    119                     (*_stat_nb_inst_insert [x]) ++;
    120 #endif
    121117
    122118                  // get information
     
    219215                        }
    220216                    }
     217
     218#ifdef STATISTICS
     219                  if (usage_is_set(_usage,USE_STATISTICS))
     220                    (*_stat_nb_inst_insert [x]) ++;
     221#endif
    221222
    222223                  // Push in rob
     
    346347        // ===================================================================
    347348        for (uint32_t i=0; i<_param->_nb_bank; i++)
    348           if (internal_BANK_RETIRE_VAL [i])
    349             {
    350               uint32_t x = internal_BANK_RETIRE_NUM_RENAME_UNIT [i];
    351               uint32_t y = internal_BANK_RETIRE_NUM_INST        [i];
    352 
    353               log_printf(TRACE,Commit_unit,FUNCTION,"  * RETIRE            [%d][%d]",x,y);
    354 
     349          {
     350            uint32_t num_bank = (internal_BANK_RETIRE_HEAD+i)%_param->_nb_bank;
     351           
     352            if (internal_BANK_RETIRE_VAL [num_bank])
     353              {
     354                uint32_t x = internal_BANK_RETIRE_NUM_RENAME_UNIT [num_bank];
     355                uint32_t y = internal_BANK_RETIRE_NUM_INST        [num_bank];
     356               
     357                log_printf(TRACE,Commit_unit,FUNCTION,"  * RETIRE            [%d][%d]",x,y);
     358               
    355359#ifdef DEBUG_TEST
    356               if (not PORT_READ(in_RETIRE_ACK [x][y]))
    357                 throw ERRORMORPHEO(FUNCTION,_("Retire : retire_ack must be set.\n"));
    358 #endif
    359 
    360               entry_t *  entry        =  _rob [i].front();
    361               rob_state_t state = entry->state;
    362              
    363 #ifdef STATISTICS
    364               if (usage_is_set(_usage,USE_STATISTICS))
    365                 {
    366                   if (state == ROB_END_OK)
    367                     (*_stat_nb_inst_retire_ok [x]) ++;
    368                   else
    369                     (*_stat_nb_inst_retire_ko [x]) ++;
    370                 }
    371 #endif
    372 
    373               Tcontext_t front_end_id = entry->front_end_id;
    374               Tcontext_t context_id   = entry->context_id  ;
    375               Ttype_t    type         = entry->type        ;
    376 
    377               if ((state == ROB_END_OK         ) or
    378 //                (state == ROB_END_KO         ) or
    379                   (state == ROB_END_BRANCH_MISS) or
    380                   (state == ROB_END_LOAD_MISS  )//  or
    381 //                (state == ROB_END_MISS       ) or
    382 //                (state == ROB_END_EXCEPTION  )
    383                   )
    384                 {
    385 //                reg_PC_PREVIOUS           [front_end_id][context_id] = reg_PC_CURRENT [front_end_id][context_id];
    386                   reg_PC_CURRENT            [front_end_id][context_id] = reg_PC_NEXT    [front_end_id][context_id];
    387                   reg_PC_CURRENT_IS_DS      [front_end_id][context_id] = entry->type == TYPE_BRANCH;
    388                   reg_PC_CURRENT_IS_DS_TAKE [front_end_id][context_id] = entry->no_sequence;
    389                   reg_PC_NEXT               [front_end_id][context_id] = (entry->no_sequence)?(entry->address_next):(reg_PC_CURRENT [front_end_id][context_id]+1);
     360                if (not PORT_READ(in_RETIRE_ACK [x][y]))
     361                  throw ERRORMORPHEO(FUNCTION,_("Retire : retire_ack must be set.\n"));
     362#endif
     363               
     364                entry_t *  entry        =  _rob [num_bank].front();
     365                rob_state_t state = entry->state;
     366               
     367                Tcontext_t front_end_id = entry->front_end_id;
     368                Tcontext_t context_id   = entry->context_id  ;
     369                uint32_t   num_thread   = _param->_translate_num_context_to_num_thread [front_end_id][context_id];
     370                Ttype_t    type         = entry->type        ;
     371                bool       retire_ok    = false;
     372
     373                log_printf(TRACE,Commit_unit,FUNCTION,"    * front_end_id : %d",front_end_id );
     374                log_printf(TRACE,Commit_unit,FUNCTION,"    * context_id   : %d",context_id   );
     375                log_printf(TRACE,Commit_unit,FUNCTION,"    * num_thread   : %d",num_thread   );
     376                log_printf(TRACE,Commit_unit,FUNCTION,"    * type         : %s",toString(type).c_str());
     377                log_printf(TRACE,Commit_unit,FUNCTION,"    * state        : %s",toString(state).c_str());
     378
     379                if ((state == ROB_END_OK         ) or
     380//                  (state == ROB_END_KO         ) or
     381                    (state == ROB_END_BRANCH_MISS) or
     382                    (state == ROB_END_LOAD_MISS  )//  or
     383//                  (state == ROB_END_MISS       ) or
     384//                  (state == ROB_END_EXCEPTION  )
     385                    )
     386                  {
     387                    log_printf(TRACE,Commit_unit,FUNCTION,"    * retire_ok");
     388
     389                    retire_ok = true;
     390
     391//                  reg_PC_PREVIOUS           [front_end_id][context_id] = reg_PC_CURRENT [front_end_id][context_id];
     392                    reg_PC_CURRENT            [front_end_id][context_id] = reg_PC_NEXT    [front_end_id][context_id];
     393                    reg_PC_CURRENT_IS_DS      [front_end_id][context_id] = entry->type == TYPE_BRANCH;
     394                    reg_PC_CURRENT_IS_DS_TAKE [front_end_id][context_id] = entry->no_sequence;
     395                    reg_PC_NEXT               [front_end_id][context_id] = (entry->no_sequence)?(entry->address_next):(reg_PC_CURRENT [front_end_id][context_id]+1);
    390396
    391397//                   if (entry->address_next != reg_PC_NEXT [front_end_id][context_id])
    392398//                     throw ERRORMORPHEO(FUNCTION,toString(_("Retire : Instruction's address_next (%.8x) is different of commit_unit's address_next (%.8x)"),entry->address_next,reg_PC_NEXT [front_end_id][context_id]));
    393                 }
    394 
    395               if ((state == ROB_END_BRANCH_MISS) or
    396                   (state == ROB_END_LOAD_MISS))
    397                 {
    398                   reg_EVENT_STATE [front_end_id][context_id] = EVENT_STATE_EVENT;
    399                   reg_EVENT_FLUSH [front_end_id][context_id] = true;
    400                 }
    401              
    402               // Update nb_inst
    403               reg_NB_INST_COMMIT_ALL [front_end_id][context_id] --;
    404               if (type == TYPE_MEMORY)
    405                 reg_NB_INST_COMMIT_MEM [front_end_id][context_id] --;
    406 
    407               reg_NUM_BANK_HEAD = (reg_NUM_BANK_HEAD+1)%_param->_nb_bank;
    408              
    409               _rob [i].pop_front();
    410               delete entry;
    411 
    412               // Transaction on retire interface : reset watch dog timer.
    413               _nb_cycle_idle [front_end_id][context_id] = 0;
    414             }
     399                  }
     400               
     401                if ((state == ROB_END_BRANCH_MISS) or
     402                    (state == ROB_END_LOAD_MISS))
     403                  {
     404                    reg_EVENT_STATE [front_end_id][context_id] = EVENT_STATE_EVENT;
     405                    reg_EVENT_FLUSH [front_end_id][context_id] = true;
     406                  }
     407               
     408                // Update nb_inst
     409                reg_NB_INST_COMMIT_ALL [front_end_id][context_id] --;
     410                if (type == TYPE_MEMORY)
     411                  reg_NB_INST_COMMIT_MEM [front_end_id][context_id] --;
     412               
     413                reg_NUM_BANK_HEAD = (reg_NUM_BANK_HEAD+1)%_param->_nb_bank;
     414               
     415                _rob [num_bank].pop_front();
     416                delete entry;
     417               
     418                // Transaction on retire interface : reset watch dog timer.
     419                _nb_cycle_idle [front_end_id][context_id] = 0;
     420
     421                // Increase stop condition
     422                if (retire_ok)
     423                  _simulation_nb_instruction_commited [num_thread] ++;
     424
     425#ifdef STATISTICS
     426                if (usage_is_set(_usage,USE_STATISTICS))
     427                  {
     428                    (*_stat_nb_inst_retire [x]) ++;
     429                   
     430                    if (retire_ok)
     431                      {
     432                        (*_stat_nb_inst_retire_ok [num_thread]) ++;
     433                        (*_stat_nb_inst_type      [type]      ) ++;
     434                      }
     435                    else
     436                      (*_stat_nb_inst_retire_ko [num_thread]) ++;
     437                  }
     438#endif
     439              }
     440          }
    415441
    416442        // ===================================================================
     
    652678        for (uint32_t j=0; j<_param->_nb_context [i]; j++)
    653679          {
    654             log_printf(TRACE,Commit_unit,FUNCTION,"    * [%d][%d]",i,j);
     680            log_printf(TRACE,Commit_unit,FUNCTION,"    * [%d][%d] - %d",i,j,_param->_translate_num_context_to_num_thread [i][j]);
    655681            log_printf(TRACE,Commit_unit,FUNCTION,"      * EVENT_STATE  : %s",toString(reg_EVENT_STATE [i][j]).c_str());
    656682            log_printf(TRACE,Commit_unit,FUNCTION,"      * EVENT_FLUSH  : %d",reg_EVENT_FLUSH [i][j]);
     
    667693          log_printf(TRACE,Commit_unit,FUNCTION,"      * Bank [%d] size : %d, ptr : %d",num_bank,(int)_rob[num_bank].size(), reg_BANK_PTR [i]);
    668694         
    669           uint32_t x=0;
    670695          for (std::list<entry_t*>::iterator it=_rob[num_bank].begin();
    671696               it!=_rob[num_bank].end();
    672697               it++)
    673698            {
    674               log_printf(TRACE,Commit_unit,FUNCTION,"        [%.4d] %.4d %.4d %.4d %.4d, %.3d %.3d, %.1d, %.1d %.4d, %.1d %.4d, %s - %d",
    675                          x,
     699              log_printf(TRACE,Commit_unit,FUNCTION,"        [%.4d][%.4d] (%.4d) %.4d %.4d %.4d %.4d, %.3d %.3d, %.1d, %.1d %.4d, %.1d %.4d, %s",
     700                         num_bank                       ,
     701                         (*it)->ptr                     ,
     702                         ((num_bank << _param->_shift_num_bank) | (*it)->ptr),
    676703                         (*it)->front_end_id            ,
    677704                         (*it)->context_id              ,
     
    685712                         (*it)->use_load_queue          ,
    686713                         (*it)->load_queue_ptr_write    ,
    687                          toString((*it)->state).c_str() ,
    688                          (*it)->ptr                     );
    689               log_printf(TRACE,Commit_unit,FUNCTION,"               %.1d %.2d %.6d, %.1d %.2d %.6d, %.1d %.1d %.6d, %.1d %.2d %.6d %.6d, %.1d %.1d %.6d %.6d ",
     714                         toString((*it)->state).c_str() );
     715              log_printf(TRACE,Commit_unit,FUNCTION,"                     %.1d %.2d %.6d, %.1d %.2d %.6d, %.1d %.1d %.6d, %.1d %.2d %.6d %.6d, %.1d %.1d %.6d %.6d ",
    690716                         (*it)->read_ra                 ,
    691717                         (*it)->num_reg_ra_log          ,
     
    706732                         (*it)->num_reg_re_phy_new      );
    707733             
    708               log_printf(TRACE,Commit_unit,FUNCTION,"               %.2d %.2d %.1d %.1d %.1d - %.8x (%.8x) %.8x (%.8x)",
     734              log_printf(TRACE,Commit_unit,FUNCTION,"                     %.2d %.2d %.1d %.1d %.1d - %.8x (%.8x) %.8x (%.8x)",
    709735                         (*it)->exception_use ,
    710736                         (*it)->exception     ,
     
    717743                         (*it)->address_next<<2
    718744                         );
    719              
    720               x++;
    721745            }
    722746        }
     
    772796    for (uint32_t i=0; i<_param->_nb_front_end; i++)
    773797      for (uint32_t j=0; j<_param->_nb_context [i]; j++)
    774         if (_nb_cycle_idle [i][j] >= debug_cycle_idle)
    775           throw ERRORMORPHEO(FUNCTION,toString(_("Context [%d][%d] is idle since %.0f cycles.\n"),i,j,_nb_cycle_idle [i][j]));
     798        if (_nb_cycle_idle [i][j] >= debug_idle_cycle)
     799          throw ERRORMORPHEO(FUNCTION,toString(_("Thread [%d] is idle since %.0f cycles.\n"),_param->_translate_num_context_to_num_thread[i][j],_nb_cycle_idle [i][j]));
    776800
    777801    log_end(Commit_unit,FUNCTION);
Note: See TracChangeset for help on using the changeset viewer.