Ignore:
Timestamp:
Jul 15, 2009, 10:41:01 AM (15 years ago)
Author:
rosiere
Message:

1) valgrind fix
2) debug file on/off

Location:
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Functionnal_unit/src/Functionnal_unit_transition.cpp

    r128 r134  
    4848                  }
    4949              }
     50
     51        _execute_operation_out->_context_id    = 0; // not necessary
     52        _execute_operation_out->_front_end_id  = 0; // not necessary
     53        _execute_operation_out->_ooo_engine_id = 0; // not necessary
     54        _execute_operation_out->_packet_id     = 0; // not necessary
     55  //    _execute_operation_out->_operation     = 0; // not necessary
     56  //    _execute_operation_out->_type          = 0; // not necessary
     57        _execute_operation_out->_write_rd      = 0; // not necessary
     58        _execute_operation_out->_num_reg_rd    = 0; // not necessary
     59        _execute_operation_out->_data_rd       = 0; // not necessary
     60        _execute_operation_out->_write_re      = 0; // not necessary
     61        _execute_operation_out->_num_reg_re    = 0; // not necessary
     62        _execute_operation_out->_data_re       = 0; // not necessary
     63        _execute_operation_out->_exception     = 0; // not necessary
     64        _execute_operation_out->_no_sequence   = 0; // not necessary
     65        _execute_operation_out->_address       = 0; // not necessary
    5066      }
    5167    else
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Load_store_unit_allocation.cpp

    r124 r134  
    179179
    180180#if defined(DEBUG) and defined(DEBUG_Load_store_unit) and (DEBUG_Load_store_unit == true)
    181     directory_init ();
    182 
    183     memory_log_file = new std::ofstream [_param->_nb_thread];
    184     for (uint32_t i=0; i<_param->_nb_thread; ++i)
    185       if (_param->_num_thread_valid [i])
    186         {
    187          
    188           std::string filename = morpheo::filename(MORPHEO_LOG,
    189                                                    "Memory_access-thread_"+toString(i),
    190                                                    "",
    191                                                    "log",
    192                                                    _simulation_file_with_date,
    193                                                    _simulation_file_with_pid ,
    194                                                    true);
    195          
    196           memory_log_file [i].open(filename.c_str() ,std::ios::out | std::ios::trunc);
    197         }
     181    if (log_file_generate)
     182      {
     183        directory_init ();
     184       
     185        memory_log_file = new std::ofstream [_param->_nb_thread];
     186        for (uint32_t i=0; i<_param->_nb_thread; ++i)
     187          if (_param->_num_thread_valid [i])
     188            {
     189             
     190              std::string filename = morpheo::filename(MORPHEO_LOG,
     191                                                       "Memory_access-thread_"+toString(i),
     192                                                       "",
     193                                                       "log",
     194                                                       _simulation_file_with_date,
     195                                                       _simulation_file_with_pid ,
     196                                                       true);
     197             
     198              memory_log_file [i].open(filename.c_str() ,std::ios::out | std::ios::trunc);
     199            }
     200      }
    198201#endif
    199202
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Load_store_unit_deallocation.cpp

    r128 r134  
    122122
    123123#if defined(DEBUG) and defined(DEBUG_Load_store_unit) and (DEBUG_Load_store_unit == true)
    124     {
    125       for (uint32_t i=0; i<_param->_nb_thread; ++i)
    126         if (_param->_num_thread_valid [i])
    127           {
    128             memory_log_file [i].close();
    129           }
    130       delete [] memory_log_file;
    131     }
     124    if (log_file_generate)
     125      {
     126        for (uint32_t i=0; i<_param->_nb_thread; ++i)
     127          if (_param->_num_thread_valid [i])
     128            {
     129              memory_log_file [i].close();
     130            }
     131        delete [] memory_log_file;
     132      }
    132133#endif
    133134
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Load_store_unit_function_speculative_load_commit_transition.cpp

    r128 r134  
    999999
    10001000#if defined(DEBUG) and defined(DEBUG_Load_store_unit) and (DEBUG_Load_store_unit == true)
     1001                  if (log_file_generate)
    10011002                    {
    10021003                      // log file
     
    11931194               
    11941195#if defined(DEBUG) and defined(DEBUG_Load_store_unit) and (DEBUG_Load_store_unit == true)
    1195                 {
    1196                   // log file
    1197                   Tcontext_t num_thread    = get_num_thread(_load_queue [packet_id]._context_id   , _param->_size_context_id   ,
    1198                                                             _load_queue [packet_id]._front_end_id , _param->_size_front_end_id ,
    1199                                                             _load_queue [packet_id]._ooo_engine_id, _param->_size_ooo_engine_id);
    1200                  
    1201                   memory_log_file [num_thread]
    1202                     << "[" << simulation_cycle() << "] "
    1203                     << std::hex
    1204                     << "@ 0x" << std::setfill('0') << std::setw(_param->_size_general_data/4) << _load_queue [packet_id]._address << " -[ Read  ]-> 0x" << std::setfill('0') << std::setw(_param->_size_general_data/4) << _load_queue [packet_id]._rdata << " "
    1205                     << std::dec
    1206                     << "{" << toString(_load_queue [packet_id]._operation) << "}";
    1207                  
    1208                   memory_log_file [num_thread] << std::endl;
    1209                 }
     1196                if (log_file_generate)
     1197                  {
     1198                    // log file
     1199                    Tcontext_t num_thread    = get_num_thread(_load_queue [packet_id]._context_id   , _param->_size_context_id   ,
     1200                                                              _load_queue [packet_id]._front_end_id , _param->_size_front_end_id ,
     1201                                                              _load_queue [packet_id]._ooo_engine_id, _param->_size_ooo_engine_id);
     1202                   
     1203                    memory_log_file [num_thread]
     1204                      << "[" << simulation_cycle() << "] "
     1205                      << std::hex
     1206                      << "@ 0x" << std::setfill('0') << std::setw(_param->_size_general_data/4) << _load_queue [packet_id]._address << " -[ Read  ]-> 0x" << std::setfill('0') << std::setw(_param->_size_general_data/4) << _load_queue [packet_id]._rdata << " "
     1207                      << std::dec
     1208                      << "{" << toString(_load_queue [packet_id]._operation) << "}";
     1209                   
     1210                    memory_log_file [num_thread] << std::endl;
     1211                  }
    12101212#endif     
    12111213
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/Instruction/include/Types.h

    r88 r134  
    5555    Texception_t        _exception         ;
    5656    Tbranch_condition_t _branch_condition  ;
    57 //     Tcontrol_t          _branch_stack_write;
     57//  Tcontrol_t          _branch_stack_write;
    5858    Tcontrol_t          _branch_direction  ;
    5959    Tevent_type_t       _event_type        ;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod_genMealy.cpp

    r124 r134  
    101101                Tgeneral_data_t addr = PORT_READ(in_IFETCH_ADDRESS [x])+y;
    102102
    103                 _decod_instruction->_instruction      = PORT_READ(in_IFETCH_INSTRUCTION [x][y]);
    104                 _decod_instruction->_context_id       = x;
    105                 _decod_instruction->_address_previous = internal_CONTEXT_ADDRESS_PREVIOUS [x];
    106                 _decod_instruction->_address          = addr; //Compute the current address
    107                 _decod_instruction->_address_next     = addr+1;
    108                 _decod_instruction->_is_delay_slot    = internal_CONTEXT_IS_DELAY_SLOT [x];
     103                _decod_instruction->_instruction        = PORT_READ(in_IFETCH_INSTRUCTION [x][y]);
     104                _decod_instruction->_context_id         = x;
     105                _decod_instruction->_address_previous   = internal_CONTEXT_ADDRESS_PREVIOUS [x];
     106                _decod_instruction->_address            = addr; //Compute the current address
     107                _decod_instruction->_address_next       = addr+1;
     108                _decod_instruction->_is_delay_slot      = internal_CONTEXT_IS_DELAY_SLOT [x];
     109                _decod_instruction->_type               = 0; // not necessary
     110                _decod_instruction->_operation          = 0; // not necessary
     111                _decod_instruction->_no_execute         = 0; // not necessary
     112                _decod_instruction->_has_immediat       = 0; // not necessary
     113                _decod_instruction->_immediat           = 0; // not necessary
     114                _decod_instruction->_read_ra            = 0; // not necessary
     115                _decod_instruction->_num_reg_ra         = 0; // not necessary
     116                _decod_instruction->_read_rb            = 0; // not necessary
     117                _decod_instruction->_num_reg_rb         = 0; // not necessary
     118                _decod_instruction->_read_rc            = 0; // not necessary
     119                _decod_instruction->_num_reg_rc         = 0; // not necessary
     120                _decod_instruction->_write_rd           = 0; // not necessary
     121                _decod_instruction->_num_reg_rd         = 0; // not necessary
     122                _decod_instruction->_write_re           = 0; // not necessary
     123                _decod_instruction->_num_reg_re         = 0; // not necessary
     124                _decod_instruction->_exception_use      = EXCEPTION_USE_NONE; // not necessary
     125                _decod_instruction->_exception          = EXCEPTION_DECOD_NONE; // not necessary
     126                _decod_instruction->_branch_condition   = 0; // not necessary
     127//              _decod_instruction->_branch_stack_write = 0; // not necessary
     128                _decod_instruction->_branch_direction   = 0; // not necessary
     129                _decod_instruction->_event_type         = EVENT_TYPE_NONE; // not necessary
     130               
     131
    109132
    110133                // Test IFetch exception
     
    181204                // Branch predictor can accept : the depth is valid
    182205                log_printf(TRACE,Decod,FUNCTION,"      * context_depth_val      : %d",PORT_READ(in_CONTEXT_DEPTH_VAL [x]));
     206
    183207                decod_val   [i]    &= PORT_READ(in_CONTEXT_DEPTH_VAL [x]);
    184208                ifetch_ack  [x][y] &= PORT_READ(in_CONTEXT_DEPTH_VAL [x]);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_allocation.cpp

    r124 r134  
    248248
    249249#if defined(DEBUG) and defined(DEBUG_Update_Prediction_Table) and (DEBUG_Update_Prediction_Table == true)
    250     directory_init ();
    251 
    252     branchement_log_file = new std::ofstream [_param->_nb_thread];
    253     for (uint32_t i=0; i<_param->_nb_thread; ++i)
    254       if (_param->_have_thread [i])
    255         {
    256           std::string filename = morpheo::filename(MORPHEO_LOG,
    257                                                    "Branchement_prediction-thread_"+toString(i),
    258                                                    "",
    259                                                    "log",
    260                                                    _simulation_file_with_date,
    261                                                    _simulation_file_with_pid,
    262                                                    true);
    263          
    264           branchement_log_file [i] .open(filename.c_str() ,std::ios::out | std::ios::trunc);
    265         }
     250    if (log_file_generate)
     251      {
     252        directory_init ();
     253       
     254        branchement_log_file = new std::ofstream [_param->_nb_thread];
     255        for (uint32_t i=0; i<_param->_nb_thread; ++i)
     256          if (_param->_have_thread [i])
     257            {
     258              std::string filename = morpheo::filename(MORPHEO_LOG,
     259                                                       "Branchement_prediction-thread_"+toString(i),
     260                                                       "",
     261                                                       "log",
     262                                                       _simulation_file_with_date,
     263                                                       _simulation_file_with_pid,
     264                                                       true);
     265             
     266              branchement_log_file [i] .open(filename.c_str() ,std::ios::out | std::ios::trunc);
     267            }
     268      }
    266269#endif
    267270
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_deallocation.cpp

    r128 r134  
    172172
    173173#if defined(DEBUG) and defined(DEBUG_Update_Prediction_Table) and (DEBUG_Update_Prediction_Table == true)
    174     {
    175       for (uint32_t i=0; i<_param->_nb_thread; ++i)
    176         if (_param->_have_thread [i])
    177           {
    178             branchement_log_file [i].close();
    179           }
    180       delete [] branchement_log_file;
    181     }
     174    if (log_file_generate)
     175      {
     176        for (uint32_t i=0; i<_param->_nb_thread; ++i)
     177          if (_param->_have_thread [i])
     178            {
     179              branchement_log_file [i].close();
     180            }
     181        delete [] branchement_log_file;
     182      }
    182183#endif
    183184
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_transition.cpp

    r128 r134  
    149149                    {
    150150#if defined(DEBUG) and defined(DEBUG_Update_Prediction_Table) and (DEBUG_Update_Prediction_Table == true)
    151                       if (reg_UPDATE_PREDICTION_TABLE [i][bottom]._retire_ok)
    152                         {
    153                           uint32_t num_thread = _param->_translate_num_context_to_num_thread [i];
    154                           branchement_log_file [num_thread]
    155                             << std::hex
    156                             << "0x" << std::setfill('0') << std::setw(_param->_size_general_data/4) << reg_UPDATE_PREDICTION_TABLE [i][bottom]._address_src  << " "
    157                             << "0x" << std::setfill('0') << std::setw(_param->_size_general_data/4) << reg_UPDATE_PREDICTION_TABLE [i][bottom]._address_dest << " "
    158                             << std::dec
    159                             <<         reg_UPDATE_PREDICTION_TABLE [i][bottom]._good_take         << " - "
    160                             << "["  << simulation_cycle() << "] " << " "
    161                             <<         reg_UPDATE_PREDICTION_TABLE [i][bottom]._miss_prediction   << " "
    162                             <<         reg_UPDATE_PREDICTION_TABLE [i][bottom]._ifetch_prediction << " "
    163                             << "("  << toString(reg_UPDATE_PREDICTION_TABLE [i][bottom]._condition) << ")"
    164                             << std::endl;
    165                         }
     151                      if (log_file_generate)
     152                        if (reg_UPDATE_PREDICTION_TABLE [i][bottom]._retire_ok)
     153                          {
     154                            uint32_t num_thread = _param->_translate_num_context_to_num_thread [i];
     155                            branchement_log_file [num_thread]
     156                              << std::hex
     157                              << "0x" << std::setfill('0') << std::setw(_param->_size_general_data/4) << reg_UPDATE_PREDICTION_TABLE [i][bottom]._address_src  << " "
     158                              << "0x" << std::setfill('0') << std::setw(_param->_size_general_data/4) << reg_UPDATE_PREDICTION_TABLE [i][bottom]._address_dest << " "
     159                              << std::dec
     160                              <<         reg_UPDATE_PREDICTION_TABLE [i][bottom]._good_take         << " - "
     161                              << "["  << simulation_cycle() << "] " << " "
     162                              <<         reg_UPDATE_PREDICTION_TABLE [i][bottom]._miss_prediction   << " "
     163                              <<         reg_UPDATE_PREDICTION_TABLE [i][bottom]._ifetch_prediction << " "
     164                              << "("  << toString(reg_UPDATE_PREDICTION_TABLE [i][bottom]._condition) << ")"
     165                              << std::endl;
     166                          }
    166167#endif
    167168                     
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_allocation.cpp

    r127 r134  
    358358
    359359#if defined(DEBUG) and defined(DEBUG_Commit_unit) and (DEBUG_Commit_unit == true)
    360     directory_init ();
    361 
    362     instruction_log_file = new std::ofstream [_param->_nb_thread];
    363     for (uint32_t i=0; i<_param->_nb_thread; ++i)
    364       if (_param->_have_thread [i])
    365         {
    366          
    367           std::string filename = morpheo::filename(MORPHEO_LOG,
    368                                                    "Instruction_flow-thread_"+toString(i),
    369                                                    "",
    370                                                    "log",
    371                                                    _simulation_file_with_date,
    372                                                    _simulation_file_with_pid ,
    373                                                    true);
    374          
    375           instruction_log_file [i].open(filename.c_str() ,std::ios::out | std::ios::trunc);
    376         }
     360    if (log_file_generate)
     361      {
     362        directory_init ();
     363       
     364        instruction_log_file = new std::ofstream [_param->_nb_thread];
     365        for (uint32_t i=0; i<_param->_nb_thread; ++i)
     366          if (_param->_have_thread [i])
     367            {
     368             
     369              std::string filename = morpheo::filename(MORPHEO_LOG,
     370                                                       "Instruction_flow-thread_"+toString(i),
     371                                                       "",
     372                                                       "log",
     373                                                       _simulation_file_with_date,
     374                                                       _simulation_file_with_pid ,
     375                                                       true);
     376             
     377              instruction_log_file [i].open(filename.c_str() ,std::ios::out | std::ios::trunc);
     378            }
     379      }
    377380#endif
    378381
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_deallocation.cpp

    r128 r134  
    239239
    240240#if defined(DEBUG) and defined(DEBUG_Commit_unit) and (DEBUG_Commit_unit == true)
    241     {   
    242       for (uint32_t i=0; i<_param->_nb_thread; ++i)
    243         if (_param->_have_thread [i])
    244           {
    245             instruction_log_file [i].close();
    246           }
    247       delete [] instruction_log_file;
    248     }
     241    if (log_file_generate)
     242      {   
     243        for (uint32_t i=0; i<_param->_nb_thread; ++i)
     244          if (_param->_have_thread [i])
     245            {
     246              instruction_log_file [i].close();
     247            }
     248        delete [] instruction_log_file;
     249      }
    249250#endif
    250251
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_transition.cpp

    r128 r134  
    831831
    832832#if defined(DEBUG) and defined(DEBUG_Commit_unit) and (DEBUG_Commit_unit == true)
    833                     {
    834                       // log file
    835                       instruction_log_file [num_thread]
    836                         << "[" << simulation_cycle() << "] "
    837                         << std::hex
    838                         << (entry->address<<2) << " (" << (entry->address) << ") "
    839                         << std::dec
    840                         << "[" << entry->cycle_rob_in << ", " << entry->cycle_commit << "] "
    841                         << "{" << ((retire_ok)?"OK":"KO") << "} ";
    842                      
    843                       if ((type == TYPE_MEMORY) and  is_operation_memory_load(entry->operation))
    844                         instruction_log_file [num_thread] << std::hex << entry->load_data << std::dec;
    845                      
    846                       instruction_log_file [num_thread] << std::endl;
    847                     }
     833                    if (log_file_generate)
     834                      {
     835                        // log file
     836                        instruction_log_file [num_thread]
     837                          << "[" << simulation_cycle() << "] "
     838                          << std::hex
     839                          << (entry->address<<2) << " (" << (entry->address) << ") "
     840                          << std::dec
     841                          << "[" << entry->cycle_rob_in << ", " << entry->cycle_commit << "] "
     842                          << "{" << ((retire_ok)?"OK":"KO") << "} ";
     843                       
     844                        if ((type == TYPE_MEMORY) and  is_operation_memory_load(entry->operation))
     845                          instruction_log_file [num_thread] << std::hex << entry->load_data << std::dec;
     846                       
     847                        instruction_log_file [num_thread] << std::endl;
     848                      }
    848849#endif     
    849850
Note: See TracChangeset for help on using the changeset viewer.