Ignore:
Timestamp:
Feb 16, 2009, 9:28:31 PM (15 years ago)
Author:
rosiere
Message:

1) Configuration : instance configuration file : regroup similar instance
2) Configuration : timing default = 0
3) Debug/Commit_unit : Add watch dog timer
4) Issue_queue : Test parameters : add test if type is optionnal
5) Cor_glue : Fix insert index
6) Free_list : remove bank_by_pop (else deadlock)
7) Update Free List : add register to source event

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_transition.cpp

    r108 r109  
    234234                      reg_EVENT_STATE [context] = EVENT_STATE_MISS_FLUSH_UFPT;
    235235                    }
     236                  reg_EVENT_SOURCE          [context] = EVENT_SOURCE_UFPT;
    236237
    237238                  // Flush UPFT
     
    506507
    507508              log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * BRANCH_COMPLETE[%d] - Accepted",i);
    508               log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * context    : %d",context);
    509               log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * depth      : %d",depth);
    510               log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * miss       : %d",miss);
     509              log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * context        : %d",context);
     510              log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * depth          : %d",depth);
     511              log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * miss           : %d",miss);
    511512             
    512513              if (miss)
     
    517518                 
    518519                  // Flush UPT
    519                   uint32_t top        = reg_UPT_TOP [context];
    520                   uint32_t new_update = ((top==0)?_param->_size_upt_queue[context]:top)-1;
    521 
    522                   log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * top        : %d",top);
    523                   log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * new_update : %d",new_update);
    524 
    525                   for (uint32_t j=(depth+1)%_param->_size_upt_queue[context];
    526                                 j!=top;
    527                                 j=(j+1)%_param->_size_upt_queue[context])
    528                     reg_UPDATE_PREDICTION_TABLE [context][j]._state = UPDATE_PREDICTION_STATE_EVENT;
     520                  uint32_t      top            = reg_UPT_TOP [context];
     521                  uint32_t      new_update     = ((top==0)?_param->_size_upt_queue[context]:top)-1;
     522
     523                  Taddress_t    address_src    = reg_UPDATE_PREDICTION_TABLE [context][depth]._address_src;
     524                  event_state_t event_state    = reg_EVENT_STATE [context];
     525                  bool          previous_event = ((event_state == EVENT_STATE_MISS_FLUSH_UFPT_AND_UPT ) or
     526                                                  (event_state == EVENT_STATE_MISS_FLUSH_UPT          ) or
     527                                                  (event_state == EVENT_STATE_EVENT_FLUSH_UFPT_AND_UPT) or
     528                                                  (event_state == EVENT_STATE_EVENT_FLUSH_UPT         ) or
     529                                                  ((event_state == EVENT_STATE_UPDATE_CONTEXT          ) and
     530                                                   (reg_EVENT_SOURCE [context] == EVENT_SOURCE_UPT)));
     531//                bool          update_ras     = (new_update != depth);
     532
     533                  log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * top            : %d",top);
     534                  log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * new_update     : %d",new_update);
     535//                log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * update_ras     : %d",update_ras);
     536                  log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * previous_event : %d",previous_event);
     537
     538                  if (reg_UPDATE_PREDICTION_TABLE [context][depth]._state == UPDATE_PREDICTION_STATE_WAIT_END)
     539                    {
     540                      for (uint32_t j=(depth+1)%_param->_size_upt_queue[context];
     541                           j!=top;
     542                           j=(j+1)%_param->_size_upt_queue[context])
     543                        reg_UPDATE_PREDICTION_TABLE [context][j]._state = UPDATE_PREDICTION_STATE_EVENT;
     544                     
    529545                 
    530                  
    531 //                reg_UPT_BOTTOM    [context];
    532                   reg_UPT_TOP       [context] = depth;
    533                   reg_UPT_TOP_EVENT [context] = top;
    534 
    535                   if (reg_UPT_BOTTOM [context] == reg_UPT_TOP [context])
    536                     reg_UPT_EMPTY [context] = true;
    537 
     546//                    reg_UPT_BOTTOM    [context];
     547                      reg_UPT_TOP       [context] = depth;
     548//                    reg_UPT_TOP_EVENT [context] = top;
     549
     550                      if (not previous_event)
     551                        {
     552                          reg_UPT_TOP_EVENT [context] = top;
     553                          reg_UPT_UPDATE    [context] = new_update;
     554                        }
     555                      else
     556                        {
     557                          // Have event. Top index this slot
     558                         
     559                          switch (reg_UPDATE_PREDICTION_TABLE [context][top]._state)
     560                            {
     561                            case UPDATE_PREDICTION_STATE_END_KO :
     562                              {
     563                                // Have already update predictor
     564                                reg_UPDATE_PREDICTION_TABLE [context][top]._state = UPDATE_PREDICTION_STATE_END;
     565                                break;
     566                              }
     567                            case UPDATE_PREDICTION_STATE_KO :
     568                              {
     569                                // Doesn't have update predictor
     570                                reg_UPDATE_PREDICTION_TABLE [context][top]._state = UPDATE_PREDICTION_STATE_EVENT;
     571                                break;
     572                              }
     573                            default :
     574                              {
    538575#ifdef DEBUG_TEST
    539                   if (reg_UPDATE_PREDICTION_TABLE [context][depth]._state != UPDATE_PREDICTION_STATE_WAIT_END)
    540                     throw ERRORMORPHEO(FUNCTION,_("Branch complete : invalid upt state."));
    541 #endif
    542                  
    543                   log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UPT  [%d][%d].state <- UPDATE_PREDICTION_STATE_KO (branch_complete, ifetch hit)",context,depth);
    544                   reg_UPDATE_PREDICTION_TABLE [context][depth]._state = UPDATE_PREDICTION_STATE_KO;
    545                  
    546                   Taddress_t    address_src         = reg_UPDATE_PREDICTION_TABLE [context][depth]._address_src;
    547                   event_state_t event_state         = reg_EVENT_STATE [context];
    548                   bool          previous_update_ras = ((event_state == EVENT_STATE_MISS_FLUSH_UFPT_AND_UPT ) or
    549                                                        (event_state == EVENT_STATE_MISS_FLUSH_UPT          ) or
    550                                                        (event_state == EVENT_STATE_EVENT_FLUSH_UFPT_AND_UPT) or
    551                                                        (event_state == EVENT_STATE_EVENT_FLUSH_UPT));
    552 //                   bool          update_ras          = (new_update != depth);
    553 
    554 //                   log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * update_ras : %d",update_ras);
    555                   log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * previous_update_ras : %d",previous_update_ras);
    556 
    557                   if (reg_UFPT_NB_NEED_UPDATE [context] > 0)
    558                     {
    559                       log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * EVENT [%d] <- EVENT_STATE_MISS_FLUSH_UFPT_AND_UPT (branch_complete - miss)",context);
    560                       reg_EVENT_STATE [context] = EVENT_STATE_MISS_FLUSH_UFPT_AND_UPT;
     576                                throw ERRORMORPHEO(FUNCTION,_("Branch complete : invalid upt state."));
     577#endif
     578                              }
     579                            }
     580                        }
     581                     
     582                      if (reg_UPT_BOTTOM [context] == reg_UPT_TOP [context])
     583                        reg_UPT_EMPTY [context] = true;
     584                     
     585                      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UPT  [%d][%d].state <- UPDATE_PREDICTION_STATE_KO (branch_complete, ifetch hit)",context,depth);
     586                      reg_UPDATE_PREDICTION_TABLE [context][depth]._state = UPDATE_PREDICTION_STATE_KO;
     587                     
     588                      if (reg_UFPT_NB_NEED_UPDATE [context] > 0)
     589                        {
     590                          log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * EVENT [%d] <- EVENT_STATE_MISS_FLUSH_UFPT_AND_UPT (branch_complete - miss)",context);
     591                          reg_EVENT_STATE [context] = EVENT_STATE_MISS_FLUSH_UFPT_AND_UPT;
     592                        }
     593                      else
     594                        {
     595//                        if (not previous_update_ras)
     596                          {
     597                            // have ras prediction ?
     598                            log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * EVENT [%d] <- EVENT_STATE_MISS_FLUSH_UPT (branch_complete - miss)",context);
     599                           
     600                            reg_EVENT_STATE [context] = EVENT_STATE_MISS_FLUSH_UPT;
     601                           
     602                          }
     603                        }
     604                      reg_EVENT_SOURCE          [context] = EVENT_SOURCE_UPT;
     605                     
     606                      // else no update
     607                     
     608                      reg_EVENT_DEPTH           [context] = depth;
     609                      reg_EVENT_ADDRESS_SRC     [context] = address_src; // delay_slot is compute in Context_State
     610                      reg_EVENT_ADDRESS_DEST_VAL[context] = good_take;
     611                      reg_EVENT_ADDRESS_DEST    [context] = good_addr;
    561612                    }
    562                   else
    563                     {
    564 //                       if (not previous_update_ras)
    565                         {
    566                           // have ras prediction ?
    567                           log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * EVENT [%d] <- EVENT_STATE_MISS_FLUSH_UPT (branch_complete - miss)",context);
    568 
    569                           reg_EVENT_STATE [context] = EVENT_STATE_MISS_FLUSH_UPT;
    570              
    571                         }
    572                     }
    573 
    574                   if (not previous_update_ras)
    575                     {
    576                       reg_UPT_UPDATE [context]  = new_update;
    577                     }
    578                   // else no update
    579 
    580                   reg_EVENT_DEPTH           [context] = depth;
    581                   reg_EVENT_ADDRESS_SRC     [context] = address_src; // delay_slot is compute in Context_State
    582                   reg_EVENT_ADDRESS_DEST_VAL[context] = good_take;
    583                   reg_EVENT_ADDRESS_DEST    [context] = good_addr;
    584                 }
     613                }
    585614              else
    586615                {
     
    901930        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_EVENT_UPT_PTR         : %d"  ,reg_EVENT_UPT_PTR         [i]);
    902931        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_EVENT_STATE           : %s"  ,toString(reg_EVENT_STATE [i]).c_str());
     932        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_EVENT_SOURCE          : %s"  ,toString(reg_EVENT_SOURCE[i]).c_str());
    903933        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_EVENT_DEPTH           : %d"  ,reg_EVENT_DEPTH           [i]);
    904934        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_EVENT_ADDRESS_SRC     : %.8x (%.8x)",reg_EVENT_ADDRESS_SRC     [i],reg_EVENT_ADDRESS_SRC     [i]<<2);
Note: See TracChangeset for help on using the changeset viewer.