Ignore:
Timestamp:
Jun 17, 2009, 2:11:25 PM (15 years ago)
Author:
rosiere
Message:

1) Add test and configuration
2) Fix Bug
3) Add log file in load store unit
4) Fix Bug in environment

Location:
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/src/Context_State_transition.cpp

    r123 r124  
    2020#define MANAGE_EVENT MANAGE_EVENT_NO_WAIT
    2121
     22#define PRIORITY_MISS_LOAD   3
     23#define PRIORITY_MISS_BRANCH 2
     24#define PRIORITY_EXCEPTION   1
     25#define PRIORITY_NONE        0
     26
    2227#define get_priority(x) \
    2328  (((state == CONTEXT_STATE_KO_MISS_LOAD_ADDR                  ) or  \
     
    2530    (state == CONTEXT_STATE_KO_MISS_LOAD_AND_BRANCH_ADDR       ) or  \
    2631    (state == CONTEXT_STATE_KO_MISS_LOAD_AND_BRANCH_WAITEND    ) or  \
    27     (state == CONTEXT_STATE_KO_MISS_LOAD_AND_BRANCH_WAIT_UPDATE))?3: \
     32    (state == CONTEXT_STATE_KO_MISS_LOAD_AND_BRANCH_WAIT_UPDATE))?PRIORITY_MISS_LOAD: \
    2833  (((state == CONTEXT_STATE_KO_MISS_BRANCH_ADDR                ) or  \
    2934    (state == CONTEXT_STATE_KO_MISS_BRANCH_WAITEND             ) or  \
    30     (state == CONTEXT_STATE_KO_MISS_BRANCH_WAIT_UPDATE         ))?2: \
    31    ((state == EVENT_TYPE_EXCEPTION)?1:                           \
     35    (state == CONTEXT_STATE_KO_MISS_BRANCH_WAIT_UPDATE         ))?PRIORITY_MISS_BRANCH: \
     36   ((state == EVENT_TYPE_EXCEPTION)?PRIORITY_EXCEPTION:                           \
    3237    0)))
    3338
     
    299304              // priority : miss_load > miss_branch > excep > spr/sync
    300305              uint8_t    priority0  = get_priority(state);
    301               uint8_t    priority1  = 2; // miss
     306              uint8_t    priority1  = PRIORITY_MISS_BRANCH; // miss
    302307
    303308              // is_valid = can modify local information
     
    306311              bool       is_valid   = ((state == CONTEXT_STATE_OK) or
    307312                                       (state == CONTEXT_STATE_KO_MISS_BRANCH_WAIT_UPDATE) or
    308                                        (state == CONTEXT_STATE_KO_MISS_LOAD_AND_BRANCH_WAIT_UPDATE) or
     313//                                     (state == CONTEXT_STATE_KO_MISS_LOAD_AND_BRANCH_WAIT_UPDATE) or
    309314                                       (depth1< depth0) or
    310315                                       ((depth1==depth0) and (priority1>=priority0))); // >= because another branch can be a miss prediction with same depth
     316
     317              bool       is_invalid = priority0 == PRIORITY_MISS_LOAD;
    311318
    312319#ifdef DEBUG_TEST
     
    327334              log_printf(TRACE,Context_State,FUNCTION,"  * is_valid    : %d",is_valid  );
    328335
    329               if (is_valid)
     336              if (is_valid and not is_invalid)
    330337                {
    331338//                reg_STATE                  [i] =  CONTEXT_STATE_KO_MISS_BRANCH_ADDR;
     
    333340                  if (state == CONTEXT_STATE_KO_MISS_LOAD_AND_BRANCH_WAIT_UPDATE)
    334341                    {
     342// #if (MANAGE_EVENT == MANAGE_EVENT_NO_WAIT)
     343//                       reg_STATE                  [i] =  CONTEXT_STATE_KO_MISS_LOAD_AND_BRANCH_ADDR;
     344// #else
    335345                      reg_STATE                  [i] =  CONTEXT_STATE_KO_MISS_LOAD_AND_BRANCH_WAITEND;
     346// #endif
    336347                    }
    337348                  else
     
    346357                        reg_STATE                [i] =  CONTEXT_STATE_KO_MISS_BRANCH_ADDR;
    347358                      else
    348                         reg_STATE                [i] =  CONTEXT_STATE_KO_MISS_BRANCH_WAITEND;
     359                        {
     360// #if (MANAGE_EVENT == MANAGE_EVENT_NO_WAIT)
     361//                           reg_STATE                [i] =  CONTEXT_STATE_KO_MISS_BRANCH_ADDR;
     362// #else
     363                          reg_STATE                [i] =  CONTEXT_STATE_KO_MISS_BRANCH_WAITEND;
     364// #endif
     365                        }
    349366
    350367                      reg_EVENT_ADDRESS          [i] = PORT_READ(in_BRANCH_EVENT_ADDRESS_SRC  [i])+1; // address delay slot
     
    386403              // priority : miss_load > miss_branch > excep > spr/sync
    387404              uint8_t    priority0  = get_priority(state);
    388               uint8_t    priority1  = 2; // miss
     405              uint8_t    priority1  = PRIORITY_MISS_BRANCH; // miss
    389406
    390407              // is_valid = can modify local information
     
    440457              // miss_load > miss_branch > excep > spr/sync
    441458              uint8_t    priority0  = get_priority(state);
    442               uint8_t    priority1  = (state == EVENT_TYPE_EXCEPTION)?1:0;
     459              uint8_t    priority1  = (state == EVENT_TYPE_EXCEPTION)?PRIORITY_EXCEPTION:PRIORITY_NONE;
    443460
    444461              // is_valid = can modify local information
     
    623640                        case CONTEXT_STATE_KO_MISS_LOAD_AND_BRANCH_WAITEND :
    624641                          {
     642// #if (MANAGE_EVENT == MANAGE_EVENT_NO_WAIT)
     643//                             state_next = CONTEXT_STATE_KO_MISS_LOAD_AND_BRANCH_ADDR;
     644// #else
    625645                            state_next = CONTEXT_STATE_KO_MISS_LOAD_AND_BRANCH_WAITEND;
     646// #endif
    626647                            break;
    627648                          }
    628649                        default :
    629650                          {
     651// #if (MANAGE_EVENT == MANAGE_EVENT_NO_WAIT)
     652//                             state_next = CONTEXT_STATE_KO_MISS_LOAD_ADDR;
     653// #else
    630654                            state_next = CONTEXT_STATE_KO_MISS_LOAD_WAITEND;
     655// #endif
    631656                            break;
    632657                          }
     
    688713              throw ERRORMORPHEO(FUNCTION,toString(_("Context[%d], Have an interruption, Not yet supported (Comming Soon).\n"),i));
    689714          }
     715
     716
     717#if (MANAGE_EVENT == MANAGE_EVENT_NO_WAIT)
     718        for (uint32_t i=0; i<_param->_nb_context; i++)
     719          switch (reg_STATE [i])
     720            {
     721            case CONTEXT_STATE_KO_MISS_BRANCH_WAITEND          : reg_STATE [i] = CONTEXT_STATE_KO_MISS_BRANCH_ADDR         ; break;
     722            case CONTEXT_STATE_KO_MISS_LOAD_WAITEND            : reg_STATE [i] = CONTEXT_STATE_KO_MISS_LOAD_ADDR           ; break;
     723            case CONTEXT_STATE_KO_MISS_LOAD_AND_BRANCH_WAITEND : reg_STATE [i] = CONTEXT_STATE_KO_MISS_LOAD_AND_BRANCH_ADDR; break;
     724            default : break;
     725            }
     726#endif
    690727      }
    691728
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod_genMealy.cpp

    r123 r124  
    4747    Tcontrol_t have_decod_branch [_param->_nb_context];
    4848
     49    Tcontext_t      CONTEXT_EVENT_CONTEXT_ID    = 0;
     50    Tdepth_t        CONTEXT_EVENT_DEPTH         = 0;
     51    Tevent_type_t   CONTEXT_EVENT_TYPE          = 0;
     52    Tcontrol_t      CONTEXT_EVENT_IS_DELAY_SLOT = 0;
     53    Tgeneral_data_t CONTEXT_EVENT_ADDRESS       = 0;
     54    Tgeneral_data_t CONTEXT_EVENT_ADDRESS_EPCR  = 0;
     55
    4956    for (uint32_t i=0; i<_param->_nb_context; i++)
    5057      {
     
    6774        log_printf(TRACE,Decod,FUNCTION,"  * DECOD [%d]",i);   
    6875
     76        bool ifetch_val = false;
    6977        while ((it != select->end())    and  // have a no scanned "slot_in" ?
    70                (decod_val [i] == false) and  // have not a previous selected entry?
     78//             (decod_val [i] == false) and  // have not a previous selected entry?
     79               (ifetch_val    == false) and  // not find ifetch instruction valid
    7180               (context_event_val == false)) // Have not a context_event (spr_access, exception, ...)
    7281          {
     
    8695                log_printf(TRACE,Decod,FUNCTION,"      * decod_ack              : %d",PORT_READ(in_DECOD_ACK [i]));
    8796
     97                ifetch_val        = true;
    8898                decod_val  [i]    = true;                        // fetch_val and decod_enable
    8999                ifetch_ack [x][y] = PORT_READ(in_DECOD_ACK [i]); // fetch_val and decod_enable and decod_ack
     
    189199                    ifetch_ack  [x][y] &= not have_decod_branch [x] and PORT_READ(in_PREDICT_ACK [i]);// predict_ack and fetch_val and decod_enable and decod_ack
    190200               
    191                     if (_param->_have_port_context_id)
    192                     PORT_WRITE(out_PREDICT_CONTEXT_ID                  [i],x);
    193                     PORT_WRITE(out_PREDICT_MATCH_INST_IFETCH_PTR       [i],y == ((_param->_have_port_inst_ifetch_ptr)?PORT_READ(in_IFETCH_INST_IFETCH_PTR [x]):0));
    194                     PORT_WRITE(out_PREDICT_BRANCH_STATE                [i],PORT_READ(in_IFETCH_BRANCH_STATE                [x]));
    195                     if (_param->_have_port_depth)
    196                     PORT_WRITE(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID [i],PORT_READ(in_IFETCH_BRANCH_UPDATE_PREDICTION_ID [x]));
    197                     PORT_WRITE(out_PREDICT_BRANCH_CONDITION            [i],_decod_instruction->_branch_condition  );
    198 //                  PORT_WRITE(out_PREDICT_BRANCH_STACK_WRITE          [i],_decod_instruction->_branch_stack_write);
    199                     PORT_WRITE(out_PREDICT_BRANCH_DIRECTION            [i],_decod_instruction->_branch_direction  );
    200                     PORT_WRITE(out_PREDICT_ADDRESS_SRC                 [i],_decod_instruction->_address           );
    201                     PORT_WRITE(out_PREDICT_ADDRESS_DEST                [i],_decod_instruction->_address_next      );
    202                
    203201                    // can continue is set if direction is "not take" (also, continue is sequential order)
    204202
     
    209207                    log_printf(TRACE,Decod,FUNCTION,"      * predict_can_continue   : %d",PORT_READ(in_PREDICT_CAN_CONTINUE [i]));
    210208                  }
     209
     210                if (_param->_have_port_context_id)
     211                PORT_WRITE(out_PREDICT_CONTEXT_ID                  [i],x);
     212                PORT_WRITE(out_PREDICT_MATCH_INST_IFETCH_PTR       [i],y == ((_param->_have_port_inst_ifetch_ptr)?PORT_READ(in_IFETCH_INST_IFETCH_PTR [x]):0));
     213                PORT_WRITE(out_PREDICT_BRANCH_STATE                [i],PORT_READ(in_IFETCH_BRANCH_STATE                [x]));
     214                if (_param->_have_port_depth)
     215                PORT_WRITE(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID [i],PORT_READ(in_IFETCH_BRANCH_UPDATE_PREDICTION_ID [x]));
     216                PORT_WRITE(out_PREDICT_BRANCH_CONDITION            [i],_decod_instruction->_branch_condition  );
     217//              PORT_WRITE(out_PREDICT_BRANCH_STACK_WRITE          [i],_decod_instruction->_branch_stack_write);
     218                PORT_WRITE(out_PREDICT_BRANCH_DIRECTION            [i],_decod_instruction->_branch_direction  );
     219                PORT_WRITE(out_PREDICT_ADDRESS_SRC                 [i],_decod_instruction->_address           );
     220                PORT_WRITE(out_PREDICT_ADDRESS_DEST                [i],_decod_instruction->_address_next      );
    211221
    212222                Tevent_type_t event_type = _decod_instruction->_event_type;
     
    223233                    ifetch_ack  [x][y] &= PORT_READ(in_CONTEXT_EVENT_ACK);// context_event_ack and fetch_val and decod_enable and decod_ack
    224234
    225                     if (_param->_have_port_context_id)
    226                     PORT_WRITE(out_CONTEXT_EVENT_CONTEXT_ID   , x);
    227                     if (_param->_have_port_depth)
    228                     PORT_WRITE(out_CONTEXT_EVENT_DEPTH        , depth);
    229                     PORT_WRITE(out_CONTEXT_EVENT_TYPE         , _decod_instruction->_event_type    );
    230                     PORT_WRITE(out_CONTEXT_EVENT_IS_DELAY_SLOT, _decod_instruction->_is_delay_slot );
    231                     PORT_WRITE(out_CONTEXT_EVENT_ADDRESS      , _decod_instruction->_address       );
    232                     PORT_WRITE(out_CONTEXT_EVENT_ADDRESS_EPCR , _decod_instruction->_address_next  );
     235                    CONTEXT_EVENT_CONTEXT_ID    = x;
     236                    CONTEXT_EVENT_DEPTH         = depth;
     237                    CONTEXT_EVENT_TYPE          = _decod_instruction->_event_type;
     238                    CONTEXT_EVENT_IS_DELAY_SLOT = _decod_instruction->_is_delay_slot;
     239                    CONTEXT_EVENT_ADDRESS       = _decod_instruction->_address;
     240                    CONTEXT_EVENT_ADDRESS_EPCR  = _decod_instruction->_address_next ;
     241               
    233242                  }
    234243
     
    263272          }
    264273      }
     274
    265275    //-----------------------------------
    266276    // Write output
     
    272282
    273283    PORT_WRITE(out_CONTEXT_EVENT_VAL, context_event_val);
     284    if (_param->_have_port_context_id)
     285    PORT_WRITE(out_CONTEXT_EVENT_CONTEXT_ID   , CONTEXT_EVENT_CONTEXT_ID   );
     286    if (_param->_have_port_depth)
     287    PORT_WRITE(out_CONTEXT_EVENT_DEPTH        , CONTEXT_EVENT_DEPTH        );
     288    PORT_WRITE(out_CONTEXT_EVENT_TYPE         , CONTEXT_EVENT_TYPE         );
     289    PORT_WRITE(out_CONTEXT_EVENT_IS_DELAY_SLOT, CONTEXT_EVENT_IS_DELAY_SLOT);
     290    PORT_WRITE(out_CONTEXT_EVENT_ADDRESS      , CONTEXT_EVENT_ADDRESS      );
     291    PORT_WRITE(out_CONTEXT_EVENT_ADDRESS_EPCR , CONTEXT_EVENT_ADDRESS_EPCR );
    274292
    275293    for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Decod_queue_function_multi_fifo_genMealy_decod_out.cpp

    r123 r124  
    5353            log_printf(TRACE,Decod_queue,FUNCTION,_("  * Queue is not empty, slot [%d] is valid."),i);
    5454           
    55             Tcontext_t context         = reg_QUEUE[num_bank].front()->_context_id    [0];
     55            Tcontext_t context  = reg_QUEUE[num_bank].front()->_context_id [0];
    5656
    5757            log_printf(TRACE,Decod_queue,FUNCTION,"      * context      : %d",context);
     
    100100               
    101101                internal_DECOD_OUT_VAL [i] = 1; // in all case, val is set (entry is not empty, and instruction is valid)
    102                
     102
    103103                if (is_valid)
    104104                  {
    105105                    val                    [i] = 1;
    106106                    internal_DECOD_OUT_ACK [i] = PORT_READ(in_DECOD_OUT_ACK [i]);
    107                
    108107                  }
    109108                else
     
    124123                      }
    125124                  }
     125
     126                log_printf(TRACE,Decod_queue,FUNCTION,"      * decod_out_ack: %d (%d)",internal_DECOD_OUT_ACK [i],PORT_READ(in_DECOD_OUT_ACK [i]));
    126127              }
    127128          }
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Decod_queue_function_multi_fifo_transition.cpp

    r123 r124  
    117117        //--------------------------------------------------------------------
    118118        {
     119          bool can_continue = true; // in_order
     120
    119121          for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
    120             if (internal_DECOD_OUT_VAL [i] and internal_DECOD_OUT_ACK[i])
     122            if (can_continue and (internal_DECOD_OUT_VAL [i] and internal_DECOD_OUT_ACK[i]))
    121123              {
    122124                log_printf(TRACE,Decod_queue,FUNCTION,_("  * DECOD_OUT [%d]"),i);
     
    139141                reg_NB_INST_EVENT [context] --;
    140142              }
     143            else
     144              can_continue = false;
    141145        }
    142146
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/src/Parameters.cpp

    r115 r124  
    7272                             
    7373    log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * _size_history             : %d",_size_history  );
    74     log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * _bht_history_mask         : 0x%x",_bht_history_mask  );
    75     log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * _bht_history_shift        : %d",_bht_history_shift );
    76     log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * _pht_history_mask         : 0x%x",_pht_history_mask  );
    77     log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * _pht_history_shift        : %d",_pht_history_shift );
     74    log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * _bht_history_mask         : 0x%llx",_bht_history_mask  );
     75    log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * _bht_history_shift        : %lld",_bht_history_shift );
     76    log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * _pht_history_mask         : 0x%llx",_pht_history_mask  );
     77    log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * _pht_history_shift        : %lld",_pht_history_shift );
    7878
    7979    _bht_init_take           = static_cast<Thistory_t>(-1)&_bht_history_mask;
     
    8282    _pht_init_ntake          = _pht_init_take-1;           // size = 4 : 0111/2
    8383
    84     log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * _bht_init_take            : 0x%x",_bht_init_take );
    85     log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * _bht_init_ntake           : 0x%x",_bht_init_ntake);
    86     log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * _pht_init_take            : 0x%x",_pht_init_take );
    87     log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * _pht_init_ntake           : 0x%x",_pht_init_ntake);
     84    log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * _bht_init_take            : 0x%llx",_bht_init_take );
     85    log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * _bht_init_ntake           : 0x%llx",_bht_init_ntake);
     86    log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * _pht_init_take            : 0x%llx",_pht_init_take );
     87    log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * _pht_init_ntake           : 0x%llx",_pht_init_ntake);
    8888   
    8989    if (_have_bht)
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_genMealy_predict.cpp

    r123 r124  
    4242          Taddress_t address     = PORT_READ(in_PREDICT_ADDRESS   [i]);
    4343          Thistory_t history     = 0;
    44           Tcontrol_t direction;
     44          Tcontrol_t direction   = 0;
    4545
    4646          log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * address          : 0x%.8x",address);
     
    5858              pht_bht_history = bht_history;
    5959
    60               log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * bht_history      : 0x%x",bht_history);
    61               log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * bht_num_reg      : %d",bht_num_reg);
     60              log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * bht_history      : 0x%llx",bht_history);
     61              log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * bht_num_reg      : %lld",bht_num_reg);
    6262
    6363              history   = (bht_history << _param->_bht_history_shift )&_param->_bht_history_mask ;
     
    7373              Thistory_t pht_num_reg = (pht_bht_history xor ((address&_param->_pht_address_share_mask)<<_param->_pht_address_share_shift));
    7474
    75               log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * bht_history      : 0x%x",pht_bht_history);
    76               log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * pht_num_reg      : %d",pht_num_reg);
    77               log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * pht_num_bank     : %d",pht_num_bank);
     75              log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * bht_history      : 0x%llx",pht_bht_history);
     76              log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * pht_num_reg      : %lld",pht_num_reg);
     77              log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * pht_num_bank     : %lld",pht_num_bank);
    7878
    7979              Thistory_t pht_history = reg_PHT [pht_num_bank][pht_num_reg];
    8080             
    81               log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * pht_history      : 0x%x",pht_history);
     81              log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * pht_history      : 0x%llx",pht_history);
    8282             
    8383              history  |= (pht_history << _param->_pht_history_shift )&_param->_pht_history_mask;
     
    9292
    9393          log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * direction        : %d",direction);
    94           log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * history          : 0x%x",history);
     94          log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * history          : 0x%llx",history);
    9595
    9696          PORT_WRITE(out_PREDICT_DIRECTION [i],direction);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_transition.cpp

    r119 r124  
    5252                      {
    5353                        Thistory_t bht_num_reg = internal_PREDICT_BHT_NUM_REG [i];
    54                         log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * bht_num_reg      : %d",bht_num_reg);
     54                        log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * bht_num_reg      : %lld",bht_num_reg);
    5555
    5656// #ifdef DEBUG_TEST
     
    5959
    6060                        Thistory_t bht_history = reg_BHT[bht_num_reg];
    61                         log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * bht_history (old): %x",bht_history);
     61                        log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * bht_history (old): %llx",bht_history);
    6262
    6363                       
    6464                        bht_history = ((bht_history<<1) | direction)&_param->_bht_history_mask ;
    65                         log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * bht_history (new): %x",bht_history);
     65                        log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * bht_history (new): %llx",bht_history);
    6666                        reg_BHT [bht_num_reg] = bht_history;
    6767                      }
     
    7171                        Thistory_t pht_num_reg = internal_PREDICT_PHT_NUM_REG  [i];
    7272                        Thistory_t pht_num_bank= internal_PREDICT_PHT_NUM_BANK [i];
    73                         log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * pht_num_reg      : %d",pht_num_reg);
    74                         log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * pht_num_bank     : %d",pht_num_bank);
     73                        log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * pht_num_reg      : %lld",pht_num_reg);
     74                        log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * pht_num_bank     : %lld",pht_num_bank);
    7575
    7676                        Thistory_t pht_history = reg_PHT [pht_num_bank][pht_num_reg];
    77                         log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * pht_history (old): %x",pht_history);
     77                        log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * pht_history (old): %llx",pht_history);
    7878                       
    7979                        // PHT : saturation counter
    8080                        pht_history = (direction==1)?((pht_history<_param->_pht_counter_max)?(pht_history+1):(pht_history)):((pht_history>0)?(pht_history-1):(pht_history));
    8181                       
    82                         log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * pht_history (new): %x",pht_history);
     82                        log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * pht_history (new): %llx",pht_history);
    8383                       
    8484                        reg_PHT [pht_num_bank][pht_num_reg] = pht_history;
     
    9595            {
    9696              log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * UPDATE [%d]",i);
     97              if (_param->_update_on_prediction)
    9798              log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * miss             : %d",PORT_READ(in_UPDATE_MISS [i]));
    9899              log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"  * update_on_predict: %d",_param->_update_on_prediction);
     
    125126                      Thistory_t bht_num_reg = address & _param->_bht_address_mask;
    126127                     
    127                       log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"    * bht_history (old): %x",bht_history);
    128                       log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"    * bht_num_reg      : %x",bht_num_reg);
     128                      log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"    * bht_history (old): %llx",bht_history);
     129                      log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"    * bht_num_reg      : %llx",bht_num_reg);
    129130                     
    130131                      // BHT : shift register
     
    139140                       
    140141                      pht_bht_history = bht_history;
    141                       log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"    * bht_history (new): %x",bht_history);
     142                      log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"    * bht_history (new): %llx",bht_history);
    142143
    143144// #ifdef DEBUG_TEST
     
    156157                      Thistory_t pht_num_reg = pht_bht_history xor ((address&_param->_pht_address_share_mask)<<_param->_pht_address_share_shift);
    157158                     
    158                       log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"    * bht_history (old): %x",pht_bht_history);
    159                       log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"    * pht_history (old): %x",pht_history);
    160                       log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"    * pht_num_reg      : %x",pht_num_reg);
    161                       log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"    * pht_num_bank     : %x",pht_num_bank);
     159                      log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"    * bht_history (old): %llx",pht_bht_history);
     160                      log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"    * pht_history (old): %llx",pht_history);
     161                      log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"    * pht_num_reg      : %llx",pht_num_reg);
     162                      log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"    * pht_num_bank     : %llx",pht_num_bank);
    162163                     
    163164                      // PHT : saturation counter
     
    171172                        }
    172173                     
    173                       log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"    * pht_history (new): %x",pht_history);
     174                      log_printf(TRACE,Two_Level_Branch_Predictor,FUNCTION,"    * pht_history (new): %llx",pht_history);
    174175                     
    175176                      reg_PHT [pht_num_bank][pht_num_reg] = pht_history;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table.cpp

    r123 r124  
    141141          }
    142142       
    143 # ifdef SYSTEMCASS_SPECIFIC
    144         // List dependency information
    145         for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
    146           {
    147             if (_param->_have_port_context_id)
    148             (*(out_DECOD_ACK                  [i])) (*(in_DECOD_CONTEXT_ID  [i]));
    149           }
    150 # endif   
     143// # ifdef SYSTEMCASS_SPECIFIC
     144//      // List dependency information
     145//      for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
     146//        {
     147//          if (_param->_have_port_context_id)
     148//          (*(out_DECOD_ACK                  [i])) (*(in_DECOD_CONTEXT_ID  [i]));
     149//        }
     150// # endif   
    151151
    152152        log_printf(INFO,Update_Prediction_Table,FUNCTION,"Method - genMealy_branch_complete");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_allocation.cpp

    r122 r124  
    258258                                                   "",
    259259                                                   "log",
    260                                                    false,
    261                                                    log_with_pid,
     260                                                   _simulation_file_with_date,
     261                                                   _simulation_file_with_pid,
    262262                                                   true);
    263263         
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_transition.cpp

    r123 r124  
    120120                          branchement_log_file [num_thread]
    121121                            << std::hex
    122                             << "0x" << reg_UPDATE_PREDICTION_TABLE [i][bottom]._address_src       << " "
    123                             << "0x" << reg_UPDATE_PREDICTION_TABLE [i][bottom]._address_dest      << " "
     122                            << "0x" << std::setfill('0') << std::setw(_param->_size_general_data/4) << reg_UPDATE_PREDICTION_TABLE [i][bottom]._address_src  << " "
     123                            << "0x" << std::setfill('0') << std::setw(_param->_size_general_data/4) << reg_UPDATE_PREDICTION_TABLE [i][bottom]._address_dest << " "
    124124                            << std::dec
    125125                            <<         reg_UPDATE_PREDICTION_TABLE [i][bottom]._good_take         << " - "
     
    127127                            <<         reg_UPDATE_PREDICTION_TABLE [i][bottom]._miss_prediction   << " "
    128128                            <<         reg_UPDATE_PREDICTION_TABLE [i][bottom]._ifetch_prediction << " "
    129                             << "("  << (uint32_t)reg_UPDATE_PREDICTION_TABLE [i][bottom]._condition        << ")"
     129                            << "("  << toString(reg_UPDATE_PREDICTION_TABLE [i][bottom]._condition) << ")"
    130130                            << std::endl;
    131131                        }
     
    671671                        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * top_state           : %s",toString(top_state).c_str());
    672672                       
    673                         bool              previous_ufpt_event = (reg_UFPT_EVENT_STATE [i] == UFPT_EVENT_STATE_KO_FLUSH);
     673                        bool              previous_ufpt_event = (reg_UFPT_EVENT_STATE [context] == UFPT_EVENT_STATE_KO_FLUSH);
    674674                       
    675675                       
     
    11661166        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_UFPT_NB_UPDATE      : %d",reg_UFPT_NB_UPDATE      [i]);
    11671167        for (uint32_t j=0; j<_param->_size_ufpt_queue[i]; j++)
    1168           log_printf(TRACE,Update_Prediction_Table,FUNCTION,"        [%d] %.4d, %.8x (%.8x) %.8x (%.8x), %.1d   %.1d, %.8d %.8x (%.8x) %.4d - %s",
     1168          {
     1169          log_printf(TRACE,Update_Prediction_Table,FUNCTION,"        [%d] %.4d, %.8x (%.8x) %.8x (%.8x), %.1d   %.1d, %.8lld %.8x (%.8x) %.4d - %s",
    11691170                     j,
    11701171                     reg_UPDATE_FETCH_PREDICTION_TABLE [i][j]._condition,
     
    11811182                     toString(reg_UPDATE_FETCH_PREDICTION_TABLE [i][j]._state).c_str()
    11821183                     );
     1184          }
    11831185
    11841186        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * Dump UPT [%d] (Update_Prediction_Table)",i);
     
    11891191        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_UPT_EMPTY           : %d",reg_UPT_EMPTY          [i]);
    11901192        for (uint32_t j=0; j<_param->_size_upt_queue[i]; j++)
    1191           log_printf(TRACE,Update_Prediction_Table,FUNCTION,"        [%d] %.4d, %.8x (%.8x) %.8x (%.8x), %.1d %.1d %.1d, %.8d %.8x (%.8x) %.4d - %s",
     1193          log_printf(TRACE,Update_Prediction_Table,FUNCTION,"        [%d] %.4d, %.8x (%.8x) %.8x (%.8x), %.1d %.1d %.1d, %.8lld %.8x (%.8x) %.4d - %s",
    11921194                     j,
    11931195                     reg_UPDATE_PREDICTION_TABLE [i][j]._condition,
Note: See TracChangeset for help on using the changeset viewer.