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_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_genMoore.cpp

    r122 r123  
    2424    log_function(Commit_unit,FUNCTION,_name.c_str());
    2525
     26    if (PORT_READ(in_NRESET))
     27      {
    2628    // ===================================================================
    2729    // =====[ REEXECUTE ]=================================================
     
    105107
    106108          internal_REEXECUTE_VAL      [i] = val;
    107           PORT_WRITE(out_REEXECUTE_VAL[i], internal_REEXECUTE_VAL [i]);
    108109        }
    109110    }
     
    148149
    149150                  // don't complete a branch when rob manage an present event
    150                   if ((reg_EVENT_STATE [front_end_id][context_id] == COMMIT_EVENT_STATE_NO_EVENT) and
     151                  if (((reg_EVENT_STATE [front_end_id][context_id] == COMMIT_EVENT_STATE_NO_EVENT) or
     152                       (reg_EVENT_STATE [front_end_id][context_id] == COMMIT_EVENT_STATE_NOT_YET_EVENT)) and
    151153                      (state == ROB_BRANCH_COMPLETE))
    152154                    {
     
    154156
    155157                      // test if have a future event (stop is set)
    156                       log_printf(TRACE,Commit_unit,FUNCTION,"      * reg_EVENT_STOP   : %d",reg_EVENT_STOP [front_end_id][context_id]);
    157 
    158                       if (reg_EVENT_STOP [front_end_id][context_id])
     158//                       log_printf(TRACE,Commit_unit,FUNCTION,"      * reg_EVENT_STOP   : %d",reg_EVENT_STOP [front_end_id][context_id]);
     159
     160                      if (reg_EVENT_STATE [front_end_id][context_id] == COMMIT_EVENT_STATE_NOT_YET_EVENT)
    159161                        {
    160162                          // Have future event, can complete the branch if the event is most speculative than this branchement
     
    204206
    205207          internal_BRANCH_COMPLETE_VAL [i] = val;
    206           PORT_WRITE(out_BRANCH_COMPLETE_VAL [i], internal_BRANCH_COMPLETE_VAL [i]);
    207208        }
    208209    }
     
    275276        }
    276277     
    277       PORT_WRITE(out_UPDATE_VAL, internal_UPDATE_VAL);
    278 
    279278      log_printf(TRACE,Commit_unit,FUNCTION,"  * UPDATE (end)");
    280279    }
     
    283282    // =====[ NB_INST ]===================================================
    284283    // ===================================================================
    285     for (uint32_t i=0; i<_param->_nb_front_end; i++)
    286       for (uint32_t j=0; j<_param->_nb_context [i]; j++)
    287         {
    288           PORT_WRITE(out_NB_INST_COMMIT_ALL [i][j], reg_NB_INST_COMMIT_ALL [i][j]);
    289           PORT_WRITE(out_NB_INST_COMMIT_MEM [i][j], reg_NB_INST_COMMIT_MEM [i][j]);
    290         }
     284    {
     285#ifdef DEBUG_TEST
     286      bool empty = true;
     287#endif
     288      for (uint32_t i=0; i<_param->_nb_front_end; i++)
     289        for (uint32_t j=0; j<_param->_nb_context [i]; j++)
     290          {
     291#ifdef DEBUG_TEST
     292            empty &= (reg_NB_INST_COMMIT_ALL [i][j] == 0);
     293#endif
     294            PORT_WRITE(out_NB_INST_COMMIT_ALL [i][j], reg_NB_INST_COMMIT_ALL [i][j]);
     295            PORT_WRITE(out_NB_INST_COMMIT_MEM [i][j], reg_NB_INST_COMMIT_MEM [i][j]);
     296          }
     297#ifdef DEBUG_TEST
     298      PORT_WRITE(out_INFO_ROB_EMPTY,empty);
     299#endif
     300    }
     301
    291302
    292303    // ===================================================================
     
    296307      for (uint32_t j=0; j<_param->_nb_context [i]; j++)
    297308        {
    298 //        bool flush = reg_EVENT_FLUSH [i][j];
    299           bool flush = (((reg_EVENT_STATE [i][j] == COMMIT_EVENT_STATE_EVENT) or
    300                          (reg_EVENT_STATE [i][j] == COMMIT_EVENT_STATE_WAIT_DECOD)) and
    301                         not reg_EVENT_CAN_RESTART[i][j]);
     309//           bool flush = (((reg_EVENT_STATE [i][j] == COMMIT_EVENT_STATE_EVENT) or
     310//                          (reg_EVENT_STATE [i][j] == COMMIT_EVENT_STATE_WAIT_DECOD)) and
     311//                         not reg_EVENT_CAN_RESTART[i][j]);
    302312
    303313          PORT_WRITE(out_RETIRE_EVENT_STATE [i][j], commit_event_state_to_event_state(reg_EVENT_STATE[i][j]));
    304           PORT_WRITE(out_RETIRE_EVENT_FLUSH [i][j], flush);
    305           PORT_WRITE(out_RETIRE_EVENT_STOP  [i][j], reg_EVENT_STOP [i][j]);
     314//        PORT_WRITE(out_RETIRE_EVENT_FLUSH [i][j], flush);
     315//        PORT_WRITE(out_RETIRE_EVENT_STOP  [i][j], reg_EVENT_STOP [i][j]);
     316          PORT_WRITE(out_RETIRE_EVENT_STOP  [i][j], ((reg_EVENT_STATE [i][j] == COMMIT_EVENT_STATE_NOT_YET_EVENT) or
     317                                                     reg_EVENT_NEXT_STOP [i][j]));
    306318        }
    307 
     319      }
     320    else
     321      {
     322        for (uint32_t i=0; i<_param->_nb_inst_reexecute; ++i)
     323          {
     324            internal_REEXECUTE_VAL      [i] = 0;
     325//             internal_REEXECUTE_NUM_BANK [i] = num_bank;
     326          }
     327
     328        for (uint32_t i=0; i<_param->_nb_inst_branch_complete; i++)
     329          {
     330            internal_BRANCH_COMPLETE_VAL [i] = 0;
     331//             internal_BRANCH_COMPLETE_NUM_BANK           [i] = num_bank;
     332          }
     333
     334        internal_UPDATE_VAL = 0;
     335//       internal_UPDATE_NUM_BANK = reg_NUM_BANK_HEAD;
     336
     337
     338        for (uint32_t i=0; i<_param->_nb_front_end; i++)
     339          for (uint32_t j=0; j<_param->_nb_context [i]; j++)
     340            {
     341              PORT_WRITE(out_RETIRE_EVENT_STATE [i][j], commit_event_state_to_event_state(COMMIT_EVENT_STATE_NO_EVENT));
     342//            PORT_WRITE(out_RETIRE_EVENT_FLUSH [i][j], flush);
     343//            PORT_WRITE(out_RETIRE_EVENT_STOP  [i][j], reg_EVENT_STOP [i][j]);
     344              PORT_WRITE(out_RETIRE_EVENT_STOP  [i][j], true);
     345            }
     346      }
     347
     348      for (uint32_t i=0; i<_param->_nb_inst_reexecute; ++i)
     349        PORT_WRITE(out_REEXECUTE_VAL[i], internal_REEXECUTE_VAL [i]);
     350      for (uint32_t i=0; i<_param->_nb_inst_branch_complete; i++)
     351        PORT_WRITE(out_BRANCH_COMPLETE_VAL [i], internal_BRANCH_COMPLETE_VAL [i]);
     352      PORT_WRITE(out_UPDATE_VAL, internal_UPDATE_VAL);
     353       
    308354    log_end(Commit_unit,FUNCTION);
    309355  };
Note: See TracChangeset for help on using the changeset viewer.