Ignore:
Timestamp:
Jun 8, 2009, 10:43:30 PM (15 years ago)
Author:
rosiere
Message:

1) Fix performance
2) add auto generation to SPECINT2000
3) add reset in genMoore and genMealy

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

    r122 r123  
    545545                        }
    546546                     
     547                      // Test if freeing the branch with no accurate ?
     548                      if ((reg_UPDATE_PREDICTION_TABLE [context][depth]._is_accurate == false) and not ko)
     549                        reg_IS_ACCURATE [context] = true;
     550
    547551                      // Update pointer
    548552                      //  * if update RAS : update pointer is decreaste until it equal at top pointer
     
    577581                                }
    578582                             
    579                               reg_UPT_EVENT_STATE [context] = upt_event_state;
    580583                            }
    581584                          else
     
    593596                        }
    594597                     
    595                       // Test if freeing the branch with no accurate ?
    596                       if ((reg_UPDATE_PREDICTION_TABLE [context][depth]._is_accurate == false) and not ko)
    597                         reg_IS_ACCURATE [context] = true;
     598                      // special case :
     599                      if ((upt_event_state == UPT_EVENT_STATE_KO_COMMIT_WAIT_END_UPDATE) and
     600                          (reg_UPT_UPDATE [context] == reg_EVENT_UPT_PTR [context]))
     601                        {
     602                          reg_UPT_TOP     [context] = reg_UPT_TOP_EVENT [context];
     603                          reg_UPT_UPDATE  [context] = reg_UPT_TOP_EVENT [context];
     604                          reg_IS_ACCURATE [context] = true;
     605
     606                          upt_event_state = UPT_EVENT_STATE_OK;
     607                        }
     608
     609                      reg_UPT_EVENT_STATE [context] = upt_event_state;
    598610
    599611                      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_UPT_UPDATE (after ) : %d",reg_UPT_UPDATE[context]);
     
    654666                       
    655667                        Taddress_t        address_src         = reg_UPDATE_PREDICTION_TABLE [context][depth]._address_src;
    656                         upt_state_t       event_top           = reg_UPDATE_PREDICTION_TABLE [context][top]._state;
     668                        upt_state_t       top_state           = reg_UPDATE_PREDICTION_TABLE [context][top]._state;
    657669                       
    658670                        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * upt_event_state     : %s",toString(upt_event_state).c_str());
    659                         log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * event_top           : %s",toString(event_top).c_str());
     671                        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * top_state           : %s",toString(top_state).c_str());
    660672                       
    661673                        bool              previous_ufpt_event = (reg_UFPT_EVENT_STATE [i] == UFPT_EVENT_STATE_KO_FLUSH);
     
    667679                                                                 or (upt_event_state == UPT_EVENT_STATE_KO_EVENT_WAIT_UFPT)
    668680                                                                 or (upt_event_state == UPT_EVENT_STATE_KO_EVENT_FLUSH_UPT)
    669                                                                  or (event_top       == UPDATE_PREDICTION_STATE_END_KO    )
    670                                                                  or (event_top       == UPDATE_PREDICTION_STATE_KO        )
     681                                                                 or (upt_event_state == UPT_EVENT_STATE_KO_COMMIT_WAIT_END_UPDATE)
     682                                                                 or (top_state       == UPDATE_PREDICTION_STATE_END_KO    )
     683                                                                 or (top_state       == UPDATE_PREDICTION_STATE_KO        )
    671684                                                                 );
    672685                       
     
    706719                                reg_UPDATE_PREDICTION_TABLE [context][top]._retire_ok = false;
    707720                               
    708                                 switch (event_top)
     721                                switch (top_state)
    709722                                  {
    710723                                  case UPDATE_PREDICTION_STATE_END_KO :
     724                                  case UPDATE_PREDICTION_STATE_END    :
    711725                                    {
    712726                                      // Have already update predictor
     
    867881                      case UPT_EVENT_STATE_KO_COMMIT_WAIT_END_EVENT :
    868882                        {
    869                           Tdepth_t depth = reg_EVENT_UPT_PTR [i];
     883                          Tdepth_t depth  = reg_EVENT_UPT_PTR [i];
     884                          Tdepth_t update = reg_UPT_UPDATE    [i];
    870885                         
    871886                          log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * depth : %d",depth);
     
    878893                            }
    879894
    880                             reg_UPT_TOP    [i] = reg_UPT_TOP_EVENT [i];
    881                             reg_UPT_UPDATE [i] = reg_UPT_TOP_EVENT [i];
    882 
    883                           // break; continue
     895                          // Special case : branch_complete a speculative branch and the context_state signal the end of this event before the complete of previous branch
     896                          if (depth != update)
     897                            {
     898                              log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * EVENT [%d] <- EVENT_STATE_COMMIT_WAIT_END_UPDATE (event)",i);
     899                              upt_event_state = UPT_EVENT_STATE_KO_COMMIT_WAIT_END_UPDATE;
     900
     901                              break; // stop here
     902                             }
     903
     904                          reg_UPT_TOP    [i] = reg_UPT_TOP_EVENT [i];
     905                          reg_UPT_UPDATE [i] = reg_UPT_TOP_EVENT [i];
     906
     907//                             break; continue
    884908                        }
    885909                      case UPT_EVENT_STATE_KO_DECODE_WAIT_END_EVENT :
     
    906930                    // Flush UPFT
    907931                    flush_UFPT [i] = true;
     932
     933                    if (upt_event_state == UPT_EVENT_STATE_KO_COMMIT_WAIT_END_UPDATE)
     934                      {
     935                        reg_UPT_TOP     [i] = reg_UPT_TOP_EVENT [i];
     936                        reg_UPT_UPDATE  [i] = reg_UPT_TOP_EVENT [i];
     937                        reg_IS_ACCURATE [i] = true;
     938                       
     939                        upt_event_state = UPT_EVENT_STATE_OK;
     940                      }
    908941                   
    909942                    // Flush UPT
     
    9781011                    reg_EVENT_UPT_PTR         [i] = top;
    9791012                    reg_EVENT_UPT_FULL        [i] = (not empty and (bottom == reg_UPT_TOP [i]));
     1013//                  reg_EVENT_DEPTH           [i] = PORT_READ(in_EVENT_DEPTH [i]);//(top+1)%_param->_size_upt_queue[i];
    9801014                    reg_EVENT_DEPTH           [i] = top;
     1015
    9811016//                  reg_EVENT_ADDRESS_SRC     [i] = address_src; // delay_slot is compute in I_State
    9821017//                  reg_EVENT_ADDRESS_DEST_VAL[i] = good_take;
Note: See TracChangeset for help on using the changeset viewer.