Ignore:
Timestamp:
May 1, 2008, 6:48:45 PM (16 years ago)
Author:
rosiere
Message:
  • support locale (now must "just" translate)
  • update all component with new test format
  • update all component with usage
  • New component : decod queue and prediction_unit
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

    r81 r82  
    3131            reg_BOTTOM             [i] = 0;
    3232            reg_NB_ELT             [i] = 0;
     33            reg_NB_ELT_UPDATE      [i] = 0;
    3334            reg_NB_ELT_NEED_UPDATE [i] = 0;
    3435            for (uint32_t j=0; j<_param->_size_queue[i]; j++)
     
    7475          if (PORT_READ(in_DECOD_VAL[i]) and internal_DECOD_ACK [i])
    7576            {
    76               Tcontext_t context = (_param->_have_port_context_id)?PORT_READ(in_DECOD_CONTEXT_ID [i]):0;
    77               Tcontrol_t miss    = PORT_READ(in_DECOD_MISS_PREDICTION [i]);
     77              Tcontext_t context     = (_param->_have_port_context_id)?PORT_READ(in_DECOD_CONTEXT_ID [i]):0;
     78              Tcontrol_t miss_ifetch = PORT_READ(in_DECOD_MISS_IFETCH [i]);
     79              Tcontrol_t miss_decod  = PORT_READ(in_DECOD_MISS_DECOD  [i]);
    7880
    7981              log_printf(TRACE,Update_Prediction_Table,FUNCTION,"DECOD[%d] - Accepted",i);
    80               log_printf(TRACE,Update_Prediction_Table,FUNCTION," * context : %d",context);
    81               log_printf(TRACE,Update_Prediction_Table,FUNCTION," * miss    : %d",miss);
    82               log_printf(TRACE,Update_Prediction_Table,FUNCTION," * nb_elt  : %d",reg_NB_ELT[context]);
     82              log_printf(TRACE,Update_Prediction_Table,FUNCTION," * context     : %d",context);
     83              log_printf(TRACE,Update_Prediction_Table,FUNCTION," * miss_ifetch : %d",miss_ifetch);
     84              log_printf(TRACE,Update_Prediction_Table,FUNCTION," * miss_decod  : %d",miss_decod);
     85              log_printf(TRACE,Update_Prediction_Table,FUNCTION," * nb_elt      : %d",reg_NB_ELT[context]);
    8386             
    8487              // Test if miss ifetch
    8588              //   miss ifetch = decod a branch and the predict unit have not predict this branch ... gloup :P
    86               if (miss)
     89              if (miss_ifetch or miss_decod)
    8790                {
    88                   Tdepth_t depth = (_param->_have_port_depth)?PORT_READ(in_DECOD_UPDATE_PREDICTION_ID [i]):0;
     91                  Tdepth_t depth = (_param->_have_port_max_depth)?PORT_READ(in_DECOD_UPDATE_PREDICTION_ID [i]):0;
    8992                  Tdepth_t top   = reg_TOP [context];
    9093
     
    127130                        }
    128131                    }
     132                  reg_UPDATE_PREDICTION_TABLE [context][depth]._state = UPDATE_PREDICTION_STATE_EVENT; // rewrite
    129133
    130134                  reg_TOP                [context] = (depth+1)%_param->_size_queue [context];
     
    135139                {
    136140                  // Normal case : branch is previous predicated, change state of branch
    137                   Tdepth_t depth = (_param->_have_port_depth)?PORT_READ(in_DECOD_UPDATE_PREDICTION_ID [i]):0;
     141                  Tdepth_t depth = (_param->_have_port_max_depth)?PORT_READ(in_DECOD_UPDATE_PREDICTION_ID [i]):0;
    138142
    139143                  reg_UPDATE_PREDICTION_TABLE [context][depth]._state = UPDATE_PREDICTION_STATE_WAITEND;
     
    148152            {
    149153              Tcontext_t context = (_param->_have_port_context_id)?PORT_READ(in_BRANCH_COMPLETE_CONTEXT_ID [i]):0;
    150               Tdepth_t   depth   = (_param->_have_port_depth     )?PORT_READ(in_BRANCH_COMPLETE_DEPTH      [i]):0;
     154              Tdepth_t   depth   = (_param->_have_port_max_depth     )?PORT_READ(in_BRANCH_COMPLETE_DEPTH      [i]):0;
    151155
    152156              log_printf(TRACE,Update_Prediction_Table,FUNCTION,"BRANCH_COMPLETE[%d] - Accepted",i);
     
    158162                {
    159163                  // Miss case
    160                   reg_UPDATE_PREDICTION_TABLE [context][depth]._state = UPDATE_PREDICTION_STATE_KO;
     164                  reg_UPDATE_PREDICTION_TABLE [context][depth]._state = UPDATE_PREDICTION_STATE_EVENT;
    161165
    162166                  // Another prediction (prediction with depth higer)
     
    231235
    232236        // ===================================================================
     237        // =====[ BRANCH_EVENT ]==============================================
     238        // ===================================================================
     239        for (uint32_t i=0; i<_param->_nb_context; i++)
     240          if (internal_BRANCH_EVENT_VAL [i] and PORT_READ(in_BRANCH_EVENT_ACK [i]))
     241          {
     242            Tdepth_t depth = internal_BRANCH_EVENT_DEPTH [i];
     243           
     244            reg_UPDATE_PREDICTION_TABLE [i][depth]._state = UPDATE_PREDICTION_STATE_KO;
     245          }
     246
     247        // ===================================================================
    233248        // =====[ GARBAGE COLLECTOR ]=========================================
    234249        // ===================================================================
     
    253268      }
    254269
    255 // #if (DEBUG >= DEBUG_TRACE)
     270#if (DEBUG >= DEBUG_TRACE)
    256271    log_printf(TRACE,Update_Prediction_Table,FUNCTION,"Dump Update_Prediction_Table");
    257272    log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * reg_UPDATE_PRIORITY      : %d",reg_UPDATE_PRIORITY);
    258273    for (uint32_t i=0; i<_param->_nb_context; i++)
    259274      {
    260         log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * Update_Prediction_Table [%d]",i);
     275        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * Update_Prediction_Table   [%d]",i);
    261276        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_TOP                : %d",reg_TOP                [i]);
    262277        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_BOTTOM             : %d",reg_BOTTOM             [i]);
     
    266281          log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      [%d] %s %x",j,toString(reg_UPDATE_PREDICTION_TABLE [i][j]._state).c_str(),reg_UPDATE_PREDICTION_TABLE [i][j]._address_src);
    267282      }
    268 // #endif
     283#endif
    269284
    270285
Note: See TracChangeset for help on using the changeset viewer.