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
Files:
30 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Icache_Access/src/Icache_Access_genMealy_req.cpp

    r123 r124  
    2020  {
    2121    log_begin(Icache_Access,FUNCTION);
     22    log_function(Icache_Access,FUNCTION,_name.c_str());
    2223
    2324    Tcontrol_t icache_req_val [_param->_nb_icache_port];
     
    3334    for (uint32_t i=0; i<_param->_nb_icache_port; ++i)
    3435      {
     36//         log_printf(TRACE,Icache_Access,FUNCTION,"  * ICACHE_REQ [%d]",i);
     37
    3538#ifdef STATISTICS
    3639        _internal_ICACHE_REQ_NB_ACCESS         [i] = 0;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Icache_Access/src/Icache_Access_genMealy_rsp.cpp

    r123 r124  
    1919  void Icache_Access::genMealy_rsp (void)
    2020  {
    21     log_begin(Icache_Access,FUNCTION);
     21    log_begin(Icache_Access,FUNCTION);
     22    log_function(Icache_Access,FUNCTION,_name.c_str());
    2223
    2324    Tcontrol_t context_rsp_val [_param->_nb_front_end][_param->_max_nb_context];
     
    3031    for (uint32_t i=0; i<_param->_nb_icache_port; ++i)
    3132      {
     33        log_printf(TRACE,Icache_Access,FUNCTION,"  * ICACHE_RSP [%d]",i);
     34       
    3235        Tcontrol_t val = PORT_READ(in_ICACHE_RSP_VAL [i]);
    3336        Tcontrol_t ack;
    3437       
    3538        Tcontext_t thread_id = (_param->_have_port_icache_thread_id)?PORT_READ(in_ICACHE_RSP_THREAD_ID [i]):0;
     39
     40        log_printf(TRACE,Icache_Access,FUNCTION,"    * val            : %d",val);
     41        log_printf(TRACE,Icache_Access,FUNCTION,"    * thread_id      : %d",thread_id);
    3642
    3743#ifdef DEBUG_TEST
     
    4450            Tcontext_t front_end_id = _param->_translate_thread_to_context  [thread_id];
    4551            Tcontext_t context_id   = _param->_translate_thread_to_front_end[thread_id];
     52
     53            log_printf(TRACE,Icache_Access,FUNCTION,"    * front_end_id   : %d",front_end_id);
     54            log_printf(TRACE,Icache_Access,FUNCTION,"    * context_id     : %d",context_id  );
    4655           
    4756//          log_printf(TRACE,Icache_Access,FUNCTION,"thread_id     : %d",thread_id);
     
    8493    for (uint32_t i=0; i<_param->_nb_front_end; ++i)
    8594      for (uint32_t j=0; j<_param->_nb_context[i]; ++j)
    86         PORT_WRITE(out_CONTEXT_RSP_VAL [i][j], context_rsp_val [i][j]);
     95        {
     96          log_printf(TRACE,Icache_Access,FUNCTION,"  * CONTEXT_RSP_VAL [%d][%d] : %d",i,j,context_rsp_val [i][j]);
     97
     98          PORT_WRITE(out_CONTEXT_RSP_VAL [i][j], context_rsp_val [i][j]);
     99        }
    87100
    88101    log_end(Icache_Access,FUNCTION);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Load_store_unit.h

    r122 r124  
    1414#endif
    1515
    16 #include <iostream>
    1716#include "Common/include/ToString.h"
    1817#include "Common/include/Debug.h"
     
    3130#endif
    3231#include "Behavioural/include/Usage.h"
     32
     33#include <iostream>
     34#include <fstream>
    3335
    3436namespace morpheo {
     
    194196  private   : Tcontrol_t                      internal_DCACHE_REQ_VAL         ;
    195197  private   : Tselect_queue_t                 internal_DCACHE_REQ_SELECT_QUEUE;
    196 #endif
     198
     199#if defined(DEBUG) and defined(DEBUG_Load_store_unit) and (DEBUG_Load_store_unit == true)
     200  private   : std::ofstream                 * memory_log_file;
     201#endif
     202
     203#endif
     204
    197205
    198206    // -----[ methods ]---------------------------------------------------
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Parameters.h

    r104 r124  
    4343  public : uint32_t            _nb_general_register          ;
    4444  public : uint32_t            _nb_special_register          ;
     45  public : uint32_t            _nb_thread                    ;
     46  public : bool              * _num_thread_valid             ; //[nb_thread]
    4547
    4648//public : uint32_t            _size_address_store_queue             ;
     
    6668  public : Tdcache_address_t   _mask_address_msb                     ;
    6769  public : Tdcache_address_t   _mask_check_hit_byte                  ;
    68  
     70
    6971    //-----[ methods ]-----------------------------------------------------------
    7072  public : Parameters  (uint32_t            size_store_queue       ,
     
    8486                        uint32_t            nb_general_register    ,
    8587                        uint32_t            nb_special_register    ,
     88                        uint32_t            nb_thread              ,
     89                        bool              * num_thread_valid       , //[nb_thread]
    8690                        bool                is_toplevel=false);
    8791
  • 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

    r122 r124  
    99#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Load_store_unit.h"
    1010#include "Behavioural/include/Allocation.h"
     11#include "Common/include/Filename.h"
    1112
    1213namespace morpheo                    {
     
    177178#endif
    178179
     180#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        }
     198#endif
     199
    179200    log_printf(FUNC,Load_store_unit,FUNCTION,"End");
    180201  };
  • 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

    r122 r124  
    121121    delete    _component;
    122122
     123#if defined(DEBUG) and defined(DEBUG_Load_store_unit) and (DEBUG_Load_store_unit == true)
     124    for (uint32_t i=0; i<_param->_nb_thread; ++i)
     125      if (_param->_num_thread_valid [i])
     126        {
     127          memory_log_file [i].close();
     128        }
     129#endif
    123130
    124131    log_printf(FUNC,Load_store_unit,FUNCTION,"End");
  • 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

    r122 r124  
    88
    99#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Load_store_unit.h"
     10#include "Behavioural/include/Identification.h"
    1011
    1112namespace morpheo                    {
     
    950951                  _store_queue [reg_STORE_QUEUE_PTR_READ]._state = STORE_QUEUE_COMMIT;
    951952
     953#if defined(DEBUG) and defined(DEBUG_Load_store_unit) and (DEBUG_Load_store_unit == true)
     954                    {
     955                      // log file
     956                      Tcontext_t num_thread    = get_num_thread(_store_queue [reg_STORE_QUEUE_PTR_READ]._context_id   , _param->_size_context_id   ,
     957                                                                _store_queue [reg_STORE_QUEUE_PTR_READ]._front_end_id , _param->_size_front_end_id ,
     958                                                                _store_queue [reg_STORE_QUEUE_PTR_READ]._ooo_engine_id, _param->_size_ooo_engine_id);
     959
     960                      memory_log_file [num_thread]
     961                        << "[" << simulation_cycle() << "] "
     962                        << std::hex
     963                        << "@ 0x" << std::setfill('0') << std::setw(_param->_size_general_data/4) << _store_queue [reg_STORE_QUEUE_PTR_READ]._address << " -[ Write ]-> 0x" << std::setfill('0') << std::setw(_param->_size_general_data/4) << _store_queue [reg_STORE_QUEUE_PTR_READ]._wdata << " "
     964                        << std::dec
     965                        << "{" << toString(_store_queue [reg_STORE_QUEUE_PTR_READ]._operation) << "}";
     966                     
     967                      memory_log_file [num_thread] << std::endl;
     968                    }
     969#endif     
     970
     971
    952972                  break;
    953973                }
     
    11251145                _load_queue [packet_id]._rdata = data;
    11261146               
     1147#if defined(DEBUG) and defined(DEBUG_Load_store_unit) and (DEBUG_Load_store_unit == true)
     1148                {
     1149                  // log file
     1150                  Tcontext_t num_thread    = get_num_thread(_load_queue [packet_id]._context_id   , _param->_size_context_id   ,
     1151                                                            _load_queue [packet_id]._front_end_id , _param->_size_front_end_id ,
     1152                                                            _load_queue [packet_id]._ooo_engine_id, _param->_size_ooo_engine_id);
     1153                 
     1154                  memory_log_file [num_thread]
     1155                    << "[" << simulation_cycle() << "] "
     1156                    << std::hex
     1157                    << "@ 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 << " "
     1158                    << std::dec
     1159                    << "{" << toString(_load_queue [packet_id]._operation) << "}";
     1160                 
     1161                  memory_log_file [num_thread] << std::endl;
     1162                }
     1163#endif     
     1164
    11271165                if (error != DCACHE_ERROR_NONE)
    11281166                  {
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Parameters.cpp

    r117 r124  
    3636                          uint32_t            nb_general_register    ,
    3737                          uint32_t            nb_special_register    ,
     38                          uint32_t            nb_thread              ,
     39                          bool              * num_thread_valid       , //[nb_thread]
    3840                          bool                is_toplevel)
    3941  {
     
    5456    _nb_general_register                   = nb_general_register    ;
    5557    _nb_special_register                   = nb_special_register    ;
     58    _nb_thread                             = nb_thread              ;
     59    _num_thread_valid                      = num_thread_valid       ;
    5660   
    5761    _size_speculative_access_queue_ptr     = log2(size_speculative_access_queue);
     
    149153  {
    150154    log_printf(FUNC,Load_store_unit,FUNCTION,"Begin");
     155
    151156    log_printf(FUNC,Load_store_unit,FUNCTION,"End");
    152157  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Register_unit/src/Parameters.cpp

    r101 r124  
    115115           _nb_spr_port_read_by_bank ,
    116116           _nb_spr_port_write_by_bank,
    117            crossbar                  );
     117           crossbar                  ,
     118           "0" // SPR à la différence du GPR doit être initialisé à 0. (F, CY et OV = 0)
     119           );
    118120       
    119121        __param_spr_status [i] = new morpheo::behavioural::generic::registerfile::registerfile_monolithic  ::Parameters
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/src/Parameters.cpp

    r122 r124  
    444444              size_special_data                ,
    445445             _max_nb_special_register          ,
    446              _max_nb_general_register          );
     446             _max_nb_general_register          ,
     447             _nb_thread                        ,
     448             _num_thread_valid                 );
    447449      }
    448450
  • 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,
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/include/Commit_unit.h

    r123 r124  
    6363  public    : counter_t                     ** _stat_nb_inst_type                 ;//[nb_type]
    6464  public    : counter_t                     ** _stat_bank_nb_inst                 ;//[nb_bank]
     65
     66  public    : counter_t                     ** _stat_nb_cycle_state_no_event      ;//[nb_thread]     
     67  public    : counter_t                     ** _stat_nb_cycle_state_not_yet_event ;//[nb_thread]
     68  public    : counter_t                     ** _stat_nb_cycle_state_event         ;//[nb_thread]
     69  public    : counter_t                     ** _stat_nb_cycle_state_wait_end      ;//[nb_thread]
    6570#endif
    6671
     
    254259//private   : bool                         ** reg_EVENT_CAN_RESTART                ;//[nb_front_end][nb_context]
    255260  private   : uint32_t                     ** reg_EVENT_PACKET                     ;//[nb_front_end][nb_context]
     261  private   : uint32_t                     ** reg_EVENT_NB_INST                    ;//[nb_front_end][nb_context]
    256262  private   : bool                         ** reg_EVENT_LAST                       ;//[nb_front_end][nb_context]
    257263  private   : uint32_t                     ** reg_EVENT_LAST_NUM_BANK              ;//[nb_front_end][nb_context]
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/include/Types.h

    r123 r124  
    6767//    COMMIT_EVENT_STATE_WAIT_DECOD   ,
    6868      COMMIT_EVENT_STATE_WAIT_END     ,
    69       COMMIT_EVENT_STATE_END     
     69//    COMMIT_EVENT_STATE_END          
    7070    } Tcommit_event_state_t;
    7171
    72 #define commit_event_state_to_event_state(x) ((x==COMMIT_EVENT_STATE_EVENT)?EVENT_STATE_EVENT:((x==COMMIT_EVENT_STATE_WAIT_END)?EVENT_STATE_WAITEND:((x==COMMIT_EVENT_STATE_END)?EVENT_STATE_END:EVENT_STATE_NO_EVENT)))
     72#define commit_event_state_to_event_state(x) ((x==COMMIT_EVENT_STATE_EVENT)?EVENT_STATE_EVENT:((x==COMMIT_EVENT_STATE_WAIT_END)?EVENT_STATE_WAITEND:EVENT_STATE_NO_EVENT))
     73
     74// #define commit_event_state_to_event_state(x) ((x==COMMIT_EVENT_STATE_EVENT)?EVENT_STATE_EVENT:((x==COMMIT_EVENT_STATE_WAIT_END)?EVENT_STATE_WAITEND:((x==COMMIT_EVENT_STATE_END)?EVENT_STATE_END:EVENT_STATE_NO_EVENT)))
    7375// #define commit_event_state_to_event_state(x) ((x==COMMIT_EVENT_STATE_EVENT)?EVENT_STATE_EVENT:((x==COMMIT_EVENT_STATE_WAIT_DECOD)?EVENT_STATE_WAITEND:((x==COMMIT_EVENT_STATE_WAIT_END)?EVENT_STATE_WAITEND:((x==COMMIT_EVENT_STATE_END)?EVENT_STATE_END:EVENT_STATE_NO_EVENT))))
    7476
     
    116118  public  : Tspecial_data_t    flags                   ;
    117119  public  : Tcontrol_t         no_sequence             ;
    118   public  : Tcontrol_t         speculative             ;
     120//public  : Tcontrol_t         speculative             ;
    119121//public  : Tgeneral_data_t    data_commit             ; // branch's destination
    120122#ifdef DEBUG
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_allocation.cpp

    r123 r124  
    332332//  ALLOC2(reg_EVENT_CAN_RESTART    ,bool                 ,_param->_nb_front_end,_param->_nb_context [it1]);
    333333    ALLOC2(reg_EVENT_PACKET         ,uint32_t             ,_param->_nb_front_end,_param->_nb_context [it1]);
     334    ALLOC2(reg_EVENT_NB_INST        ,uint32_t             ,_param->_nb_front_end,_param->_nb_context [it1]);
    334335    ALLOC2(reg_EVENT_LAST           ,bool                 ,_param->_nb_front_end,_param->_nb_context [it1]);
    335336    ALLOC2(reg_EVENT_LAST_NUM_BANK  ,uint32_t             ,_param->_nb_front_end,_param->_nb_context [it1]);
     
    371372                                                   "",
    372373                                                   "log",
    373                                                    false,
    374                                                    log_with_pid,
     374                                                   _simulation_file_with_date,
     375                                                   _simulation_file_with_pid ,
    375376                                                   true);
    376 
    377           log_printf(TRACE,Commit_unit,FUNCTION,"KANE : %s",filename.c_str());
    378377         
    379378          instruction_log_file [i].open(filename.c_str() ,std::ios::out | std::ios::trunc);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_deallocation.cpp

    r123 r124  
    213213        DELETE2(reg_EVENT_NUM_BANK       ,_param->_nb_front_end,_param->_nb_context [it1]);
    214214        DELETE2(reg_EVENT_NUM_PTR        ,_param->_nb_front_end,_param->_nb_context [it1]);
    215 //         DELETE2(reg_EVENT_CAN_RESTART    ,_param->_nb_front_end,_param->_nb_context [it1]);
     215//      DELETE2(reg_EVENT_CAN_RESTART    ,_param->_nb_front_end,_param->_nb_context [it1]);
    216216        DELETE2(reg_EVENT_PACKET         ,_param->_nb_front_end,_param->_nb_context [it1]);
     217        DELETE2(reg_EVENT_NB_INST        ,_param->_nb_front_end,_param->_nb_context [it1]);
    217218        DELETE2(reg_EVENT_LAST           ,_param->_nb_front_end,_param->_nb_context [it1]);
    218219        DELETE2(reg_EVENT_LAST_NUM_BANK  ,_param->_nb_front_end,_param->_nb_context [it1]);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_genMealy_insert.cpp

    r123 r124  
    9595                  {
    9696                    log_printf(TRACE,Commit_unit,FUNCTION,"      * have instruction");
     97                    log_printf(TRACE,Commit_unit,FUNCTION,"      * num_bank  : %d",num_bank);
    9798                    log_printf(TRACE,Commit_unit,FUNCTION,"      * bank_full : %d",bank_full [num_bank]);
    9899                   
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_genMoore.cpp

    r123 r124  
    3232      uint32_t nb_scan_bank = 0; // last scan bank
    3333      bool     can_continue = true;
     34
     35      uint32_t event_nb_inst  [_param->_nb_front_end][_param->_max_nb_context];
     36      for (uint32_t i=0; i<_param->_nb_front_end; i++)
     37        for (uint32_t j=0; j<_param->_nb_context [i]; j++)
     38          event_nb_inst [i][j] = 0;
    3439
    3540      // for each reexecute_port
     
    5964                  // Read state
    6065                  entry_t    * entry = _rob [num_bank].front();
     66                  uint32_t     num_packet   = ((entry->ptr << _param->_shift_num_slot) | num_bank);
     67                  Tcontext_t   front_end_id = entry->front_end_id;
     68                  Tcontext_t   context_id   = entry->context_id  ;
     69
    6170                  rob_state_t  state = entry->state;
    6271                 
     
    7382                            );
    7483                 
    75                   can_continue &= ((state == ROB_STORE_OK          ) or
    76                                    (state == ROB_STORE_OK_WAIT_END ) or
    77                                    (state == ROB_END_OK_SPECULATIVE) or
    78                                    (state == ROB_END_OK            ) or
    79                                    (state == ROB_END               )
     84                  can_continue &= (((state == ROB_STORE_OK          ) or
     85                                    (state == ROB_STORE_OK_WAIT_END ) or
     86                                    (state == ROB_END_OK_SPECULATIVE) or
     87                                    (state == ROB_END_OK            ) or
     88                                    (state == ROB_END               )) and
     89                                   not ((reg_EVENT_STATE [front_end_id][context_id] == COMMIT_EVENT_STATE_NOT_YET_EVENT) and
     90                                        (reg_EVENT_PACKET[front_end_id][context_id] == num_packet)) and
     91                                   not ((reg_EVENT_NB_INST [front_end_id][context_id] > 0) and
     92                                        ((++event_nb_inst [front_end_id][context_id]) >= reg_EVENT_NB_INST [front_end_id][context_id]))
    8093                                   );
    8194
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_statistics_allocation.cpp

    r111 r124  
    2727                      param_statistics);
    2828
    29     _stat_nb_inst_insert                = new counter_t * [_param->_nb_rename_unit];
    30     _stat_nb_inst_retire                = new counter_t * [_param->_nb_rename_unit];
    31     _stat_nb_inst_retire_ok             = new counter_t * [_param->_nb_thread];
    32     _stat_nb_inst_retire_ko             = new counter_t * [_param->_nb_thread];
    33     _stat_nb_inst_type                  = new counter_t * [_param->_nb_type];
    34     _stat_bank_nb_inst                  = new counter_t * [_param->_nb_bank];
     29    _stat_nb_cycle_state_no_event      = new counter_t * [_param->_nb_thread];
     30    _stat_nb_cycle_state_not_yet_event = new counter_t * [_param->_nb_thread];
     31    _stat_nb_cycle_state_event         = new counter_t * [_param->_nb_thread];
     32    _stat_nb_cycle_state_wait_end      = new counter_t * [_param->_nb_thread];
     33
     34    {
     35      for (uint32_t i=0; i<_param->_nb_thread; i++)
     36        if (_param->_have_thread [i])
     37          {
     38            _stat_nb_cycle_state_no_event      [i] = _stat->create_variable("nb_cycle_state_no_event_"     +toString(i));
     39            _stat_nb_cycle_state_not_yet_event [i] = _stat->create_variable("nb_cycle_state_not_yet_event_"+toString(i));
     40            _stat_nb_cycle_state_event         [i] = _stat->create_variable("nb_cycle_state_event_"        +toString(i));
     41            _stat_nb_cycle_state_wait_end      [i] = _stat->create_variable("nb_cycle_state_wait_end_"     +toString(i));
     42           
     43            _stat->create_expr_percent("percent_state_no_event_"      +toString(i),"nb_cycle_state_no_event_"      +toString(i),"cycle",toString(_("Percent of cycle in state no_event        (context %d)"),i));
     44            _stat->create_expr_percent("percent_state_not_yet_event_" +toString(i),"nb_cycle_state_not_yet_event_" +toString(i),"cycle",toString(_("Percent of cycle in state not_yet_event   (context %d)"),i));
     45            _stat->create_expr_percent("percent_state_event_"         +toString(i),"nb_cycle_state_event_"         +toString(i),"cycle",toString(_("Percent of cycle in state event           (context %d)"),i));
     46            _stat->create_expr_percent("percent_state_wait_end_"      +toString(i),"nb_cycle_state_wait_end_"      +toString(i),"cycle",toString(_("Percent of cycle in state wait_end        (context %d)"),i));
     47          }
     48    }
     49
     50    _stat_nb_inst_insert         = new counter_t * [_param->_nb_rename_unit];
     51    _stat_nb_inst_retire         = new counter_t * [_param->_nb_rename_unit];
     52    _stat_nb_inst_retire_ok      = new counter_t * [_param->_nb_thread];
     53    _stat_nb_inst_retire_ko      = new counter_t * [_param->_nb_thread];
     54    _stat_nb_inst_type           = new counter_t * [_param->_nb_type];
     55    _stat_bank_nb_inst           = new counter_t * [_param->_nb_bank];
    3556   
    3657    {
     
    124145    }
    125146
    126 
    127147    _stat_nb_inst_commit = _stat->create_variable("nb_inst_commit");
    128148    _stat->create_expr_average_by_cycle("average_use_interface_commit","nb_inst_commit", "", _("Average instruction by cycle on commit interface"));
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_statistics_deallocation.cpp

    r110 r124  
    3333    delete [] _stat_nb_inst_type;
    3434    delete [] _stat_bank_nb_inst;
     35
     36    delete [] _stat_nb_cycle_state_no_event      ;
     37    delete [] _stat_nb_cycle_state_not_yet_event ;
     38    delete [] _stat_nb_cycle_state_event         ;
     39    delete [] _stat_nb_cycle_state_wait_end      ;
     40
    3541   
    3642    log_end(Commit_unit,FUNCTION);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_transition.cpp

    r123 r124  
    5454//            reg_EVENT_FLUSH           [i][j] = false;
    5555//            reg_EVENT_STOP            [i][j] = false;
     56              reg_EVENT_NB_INST         [i][j] = 0;
    5657              reg_EVENT_LAST            [i][j] = false;
    5758
     
    126127//                     break;
    127128//                   }
     129
     130//                 case COMMIT_EVENT_STATE_WAIT_END :
     131//                   {
     132//                     // Wait the flush of Re Order Buffer.
     133//                     // Test if the last element is retire
     134//                     if (reg_EVENT_LAST [i][j])
     135//                       reg_EVENT_STATE [i][j] = COMMIT_EVENT_STATE_END ;
     136                   
     137//                     break;
     138//                   }
     139//                 case COMMIT_EVENT_STATE_END      :
     140//                   {
     141//                     // Just one cycle
     142                   
     143//                     // flush of re order buffer is finish
     144//                     reg_EVENT_LAST  [i][j] = false;
     145
     146//                     if (not reg_EVENT_NEXT_STOP [i][j])
     147//                       reg_EVENT_STATE [i][j] = COMMIT_EVENT_STATE_NO_EVENT;
     148//                     else
     149//                       {
     150//                         reg_EVENT_NEXT_STOP [i][j] = false;
     151//                         reg_EVENT_PACKET [i][j] = reg_EVENT_NEXT_PACKET [i][j];
     152//                         reg_EVENT_STATE         [i][j] = COMMIT_EVENT_STATE_NOT_YET_EVENT;
     153// //                      reg_EVENT_STOP          [i][j] = true;
     154//                         reg_EVENT_LAST_NUM_BANK [i][j] = ((reg_NUM_BANK_TAIL==0)?_param->_nb_bank:reg_NUM_BANK_TAIL)-1;
     155//                         reg_EVENT_LAST_NUM_PTR  [i][j] = reg_NUM_PTR_TAIL;
     156//                       }
     157
     158//                     break;
     159//                   }
     160
     161
    128162                case COMMIT_EVENT_STATE_WAIT_END :
    129163                  {
     
    131165                    // Test if the last element is retire
    132166                    if (reg_EVENT_LAST [i][j])
    133                       reg_EVENT_STATE [i][j] = COMMIT_EVENT_STATE_END ;
    134                    
     167                      {
     168                        // flush of re order buffer is finish
     169                        reg_EVENT_LAST  [i][j] = false;
     170                       
     171                        if (not reg_EVENT_NEXT_STOP [i][j])
     172                          reg_EVENT_STATE [i][j] = COMMIT_EVENT_STATE_NO_EVENT;
     173                        else
     174                          {
     175                            reg_EVENT_STATE         [i][j] = COMMIT_EVENT_STATE_NOT_YET_EVENT;
     176
     177                            reg_EVENT_NEXT_STOP     [i][j] = false;
     178                            reg_EVENT_PACKET        [i][j] = reg_EVENT_NEXT_PACKET [i][j];
     179                            reg_EVENT_NB_INST       [i][j] = reg_NB_INST_COMMIT_ALL [i][j];
     180                          //reg_EVENT_STOP          [i][j] = true;
     181                            reg_EVENT_LAST_NUM_BANK [i][j] = ((reg_NUM_BANK_TAIL==0)?_param->_nb_bank:reg_NUM_BANK_TAIL)-1;
     182                            reg_EVENT_LAST_NUM_PTR  [i][j] = reg_NUM_PTR_TAIL;
     183                          }
     184                      }
    135185                    break;
    136186                  }
    137                 case COMMIT_EVENT_STATE_END      :
    138                   {
    139                     // Just one cycle
    140                    
    141                     // flush of re order buffer is finish
    142                     reg_EVENT_LAST  [i][j] = false;
    143 
    144                     if (not reg_EVENT_NEXT_STOP [i][j])
    145                       reg_EVENT_STATE [i][j] = COMMIT_EVENT_STATE_NO_EVENT;
    146                     else
    147                       {
    148                         reg_EVENT_NEXT_STOP [i][j] = false;
    149                         reg_EVENT_PACKET [i][j] = reg_EVENT_NEXT_PACKET [i][j];
    150                         reg_EVENT_STATE         [i][j] = COMMIT_EVENT_STATE_NOT_YET_EVENT;
    151 //                      reg_EVENT_STOP          [i][j] = true;
    152                         reg_EVENT_LAST_NUM_BANK [i][j] = ((reg_NUM_BANK_TAIL==0)?_param->_nb_bank:reg_NUM_BANK_TAIL)-1;
    153                         reg_EVENT_LAST_NUM_PTR  [i][j] = reg_NUM_PTR_TAIL;
    154                       }
    155 
    156                     break;
    157                   }
     187
    158188                  //case COMMIT_EVENT_STATE_NO_EVENT :
    159189                  //case COMMIT_EVENT_STATE_NOT_YET_EVENT :
     
    166196        // ===================================================================
    167197        {
     198//           for (uint32_t i=0; i<_param->_nb_rename_unit; i++)
     199//             for (uint32_t j=0; j<_param->_nb_inst_insert[i]; j++)
     200//               log_printf(TRACE,Commit_unit,FUNCTION,"  * INSERT_VAL        [%d][%d] : %d",i,j,PORT_READ(in_INSERT_VAL [i][j]));
     201             
    168202          // variable to count instruction insert
    169203          uint32_t nb_insert = 0;
    170 
     204         
    171205          for (uint32_t i=0; i<_param->_nb_bank; i++)
    172206            {
     
    241275                      entry->num_reg_re_phy_new      = PORT_READ(in_INSERT_NUM_REG_RE_PHY_NEW    [x][y]);
    242276                      entry->no_sequence             = type == TYPE_BRANCH;
    243                       entry->speculative             = true;
     277//                    entry->speculative             = true;
    244278#ifdef DEBUG       
    245279                      entry->address                 = PORT_READ(in_INSERT_ADDRESS               [x][y]);
     
    371405#endif
    372406
    373                     log_printf(TRACE,Commit_unit,FUNCTION,"    * num_bank   : %d",i);
     407                    log_printf(TRACE,Commit_unit,FUNCTION,"    * num_bank              : %d",i);
    374408
    375409                    // find the good entry !!!
    376410                    entry_t *       entry        = internal_BANK_COMMIT_ENTRY [i][j];
    377411
    378                     log_printf(TRACE,Commit_unit,FUNCTION,"    * ptr        : %d",entry->ptr);
     412                    log_printf(TRACE,Commit_unit,FUNCTION,"    * ptr                   : %d",entry->ptr);
    379413                                                 
    380414                  //Toperation_t    operation    = PORT_READ(in_COMMIT_OPERATION   [x]);
     
    437471                          }
    438472                      }
     473
     474                    log_printf(TRACE,Commit_unit,FUNCTION,"    * have_exception        : %d",have_exception       );
     475                    log_printf(TRACE,Commit_unit,FUNCTION,"    * have_miss_speculation : %d",have_miss_speculation);
     476
    439477                   
    440478                    // Next state depends of previous state
     
    509547                        bool flush = ((reg_EVENT_STATE [front_end_id][context_id] == COMMIT_EVENT_STATE_EVENT) or
    510548//                                    (reg_EVENT_STATE [front_end_id][context_id] == COMMIT_EVENT_STATE_WAIT_DECOD) or
    511                                       (reg_EVENT_STATE [front_end_id][context_id] == COMMIT_EVENT_STATE_WAIT_END) or
    512                                       (reg_EVENT_STATE [front_end_id][context_id] == COMMIT_EVENT_STATE_END)
     549                                      (reg_EVENT_STATE [front_end_id][context_id] == COMMIT_EVENT_STATE_WAIT_END)// or
     550//                                       (reg_EVENT_STATE [front_end_id][context_id] == COMMIT_EVENT_STATE_END)
    513551                                      );
    514552                       
    515553                        uint32_t packet = ((entry->ptr << _param->_shift_num_slot) | i);
    516554                        uint32_t _top   = ((_rob[ reg_NUM_BANK_HEAD].front()->ptr << _param->_shift_num_slot) | reg_NUM_BANK_HEAD);
     555
     556                        log_printf(TRACE,Commit_unit,FUNCTION,"    * flush                 : %d",flush);
     557                        log_printf(TRACE,Commit_unit,FUNCTION,"    * packet                : %d",packet);
    517558                           
    518559                        if (not flush)
     
    539580                                // have an error, stop issue instruction
    540581                                reg_EVENT_STATE         [front_end_id][context_id] = COMMIT_EVENT_STATE_NOT_YET_EVENT;
    541                                 //                      reg_EVENT_STOP          [front_end_id][context_id] = true;
     582
     583                                reg_EVENT_NB_INST       [front_end_id][context_id] = reg_NB_INST_COMMIT_ALL [front_end_id][context_id];
     584
     585                              //reg_EVENT_STOP          [front_end_id][context_id] = true;
    542586                               
    543587                                reg_EVENT_LAST_NUM_BANK [front_end_id][context_id] = ((reg_NUM_BANK_TAIL==0)?_param->_nb_bank:reg_NUM_BANK_TAIL)-1;
     
    549593                            bool find = true;
    550594
     595                            log_printf(TRACE,Commit_unit,FUNCTION,"    * reg_EVENT_NEXT_STOP   : %d",reg_EVENT_NEXT_STOP  [front_end_id][context_id]);
     596                            log_printf(TRACE,Commit_unit,FUNCTION,"    * reg_EVENT_NEXT_PACKET : %d",reg_EVENT_NEXT_PACKET[front_end_id][context_id]);
     597
    551598                            // already manage an event.
    552599                            if (reg_EVENT_NEXT_STOP [front_end_id][context_id])
     
    555602                                uint32_t _old = reg_EVENT_NEXT_PACKET [front_end_id][context_id];
    556603                                uint32_t _new = packet;
     604
     605                                log_printf(TRACE,Commit_unit,FUNCTION,"    * _top                  : %d",_top );
     606                                log_printf(TRACE,Commit_unit,FUNCTION,"    * _old (before)         : %d",_old );
     607                                log_printf(TRACE,Commit_unit,FUNCTION,"    * _new (before)         : %d",_new );
     608
    557609                                if (_old < _top) _old = _old+_param->_size_queue;
    558610                                if (_new < _top) _new = _new+_param->_size_queue;
    559611                                if (_new > _old) reg_EVENT_NEXT_PACKET [front_end_id][context_id] = packet;
    560                                 find = false;
     612                                else find = false;
     613
     614                                log_printf(TRACE,Commit_unit,FUNCTION,"    * _old (after)          : %d",_old );
     615                                log_printf(TRACE,Commit_unit,FUNCTION,"    * _new (after)          : %d",_new );
    561616                              }
    562617                            else
     
    565620                                uint32_t _old = ((reg_EVENT_LAST_NUM_PTR [front_end_id][context_id] << _param->_shift_num_slot) | reg_EVENT_LAST_NUM_BANK [front_end_id][context_id]);
    566621                                uint32_t _new = packet;
     622
     623                                log_printf(TRACE,Commit_unit,FUNCTION,"    * _top                  : %d",_top );
     624                                log_printf(TRACE,Commit_unit,FUNCTION,"    * _old (before)         : %d",_old );
     625                                log_printf(TRACE,Commit_unit,FUNCTION,"    * _new (before)         : %d",_new );
     626
    567627                                if (_old < _top) _old = _old+_param->_size_queue;
    568628                                if (_new < _top) _new = _new+_param->_size_queue;
    569629                                if (_new > _old) reg_EVENT_NEXT_PACKET [front_end_id][context_id] = packet;
    570                                 find = false;
     630                                else find = false;
     631
     632                                log_printf(TRACE,Commit_unit,FUNCTION,"    * _old (after)          : %d",_old );
     633                                log_printf(TRACE,Commit_unit,FUNCTION,"    * _new (after)          : %d",_new );
    571634                              }
     635
     636                            log_printf(TRACE,Commit_unit,FUNCTION,"    * find                  : %d",find);
    572637
    573638                            if (find)
     
    710775                    //   * need event
    711776                    //   * packet id = last packet id
    712                     if (((reg_EVENT_STATE         [front_end_id][context_id] != COMMIT_EVENT_STATE_NO_EVENT     ) and
    713                          (reg_EVENT_STATE         [front_end_id][context_id] != COMMIT_EVENT_STATE_NOT_YET_EVENT)) and
    714                         (reg_EVENT_LAST_NUM_BANK [front_end_id][context_id] == num_bank            ) and
    715                         (reg_EVENT_LAST_NUM_PTR  [front_end_id][context_id] == entry->ptr          ))
    716                       reg_EVENT_LAST [front_end_id][context_id] = true;
    717                    
     777//                     for (uint32_t x=0; x<_param->_nb_front_end; x++)
     778//                       for (uint32_t y=0; y<_param->_nb_context [x]; y++)
     779//                         if (((reg_EVENT_STATE         [x][y] != COMMIT_EVENT_STATE_NO_EVENT     ) and
     780//                              (reg_EVENT_STATE         [x][y] != COMMIT_EVENT_STATE_NOT_YET_EVENT)) and
     781//                             (reg_EVENT_LAST_NUM_BANK [x][y] == num_bank            ) and
     782//                             (reg_EVENT_LAST_NUM_PTR  [x][y] == entry->ptr          ))
     783//                           reg_EVENT_LAST [x][y] = true;
     784
     785
     786                    if (reg_EVENT_NB_INST [front_end_id][context_id] > 0)
     787                      {
     788                        reg_EVENT_NB_INST [front_end_id][context_id] --;
     789                        if (reg_EVENT_NB_INST [front_end_id][context_id] == 0)
     790                          reg_EVENT_LAST [front_end_id][context_id] = true;
     791                      }
     792
    718793                    // Update nb_inst
    719794                    reg_NB_INST_COMMIT_ALL [front_end_id][context_id] --;
     
    853928                      // In all case, stop instruction flow
    854929                      reg_EVENT_STATE         [entry->front_end_id][entry->context_id] = COMMIT_EVENT_STATE_NOT_YET_EVENT;
     930                      reg_EVENT_NB_INST       [entry->front_end_id][entry->context_id] = reg_NB_INST_COMMIT_ALL [entry->front_end_id][entry->context_id];
     931                               
    855932//                    reg_EVENT_STOP          [entry->front_end_id][entry->context_id] = true;
    856933
     
    918995
    919996        {
    920           bool EVENT_LAST [_param->_nb_front_end][_param->_max_nb_context];
     997          bool     can_continue   [_param->_nb_front_end][_param->_max_nb_context];
     998          uint32_t event_nb_inst  [_param->_nb_front_end][_param->_max_nb_context];
     999          bool     is_speculative [_param->_nb_front_end][_param->_max_nb_context];
    9211000          for (uint32_t i=0; i<_param->_nb_front_end; i++)
    9221001            for (uint32_t j=0; j<_param->_nb_context [i]; j++)
    923               EVENT_LAST [i][j] = reg_EVENT_LAST [i][j];
     1002              {
     1003                event_nb_inst [i][j] = 0;
     1004                is_speculative[i][j] = false;
     1005                can_continue  [i][j] = (((reg_EVENT_NB_INST [i][j] == 0) or
     1006                                         (    event_nb_inst [i][j] < reg_EVENT_NB_INST [i][j])) and
     1007                                        not reg_EVENT_LAST [i][j]);
     1008              }
    9241009
    9251010          // Read all instruction of all top bank
     
    9331018                  // Scan all instruction in windows and test if instruction is speculative
    9341019                  entry_t    * entry        = _rob [num_bank].front();
    935                  
     1020
     1021                  uint32_t     num_packet   = ((entry->ptr << _param->_shift_num_slot) | num_bank);
    9361022                  Tcontext_t   front_end_id = entry->front_end_id;
    9371023                  Tcontext_t   context_id   = entry->context_id  ;
     1024
     1025                  log_printf(TRACE,Commit_unit,FUNCTION,"  * HEAD              [%d] - %d",num_bank,num_packet);
     1026                  log_printf(TRACE,Commit_unit,FUNCTION,"    * front_end_id    : %d",front_end_id);
     1027                  log_printf(TRACE,Commit_unit,FUNCTION,"    * context_id      : %d",context_id);
     1028                  log_printf(TRACE,Commit_unit,FUNCTION,"    * EVENT_LAST      : %d",reg_EVENT_LAST    [front_end_id][context_id]);
     1029                  log_printf(TRACE,Commit_unit,FUNCTION,"    * EVENT_NB_INST   : %d",reg_EVENT_NB_INST [front_end_id][context_id]);
     1030                  log_printf(TRACE,Commit_unit,FUNCTION,"    * event_nb_inst   : %d",    event_nb_inst [front_end_id][context_id]);
    9381031                 
    9391032                  // scan while last event instruction is not retire
    940                   if (EVENT_LAST [front_end_id][context_id] == false)
     1033                  if (can_continue  [front_end_id][context_id])
    9411034                    {
    9421035                      // Read information
     
    9651058//                                                  (reg_EVENT_STATE [front_end_id][context_id] == COMMIT_EVENT_STATE_WAIT_DECOD) or
    9661059                                                    (reg_EVENT_STATE [front_end_id][context_id] == COMMIT_EVENT_STATE_WAIT_END));
    967                       bool         speculative   = entry->speculative and not (depth == depth_min);
    968                       Tcontrol_t   is_valid      = ((not speculative or
    969                                                      (speculative and (depth_full or // all is valid
    970                                                                        ((depth_min <= depth_max)? // test if depth is overflow
    971                                                                         ((depth >= depth_min) and (depth <=depth_max)):
    972                                                                         ((depth >= depth_min) or  (depth <=depth_max))))))
    973                                                     and not flush); // no event
    974                      
     1060                      bool         speculative   = is_speculative [front_end_id][context_id];
     1061
     1062//                       bool         speculative   = entry->speculative and not (depth == depth_min);
     1063//                       Tcontrol_t   is_valid      = ((not speculative or
     1064//                                                      (speculative and (depth_full or // all is valid
     1065//                                                                        ((depth_min <= depth_max)? // test if depth is overflow
     1066//                                                                         ((depth >= depth_min) and (depth <=depth_max)):
     1067//                                                                         ((depth >= depth_min) or  (depth <=depth_max))))))
     1068//                                                     and not flush); // no event
     1069
     1070                      Tcontrol_t   is_valid      = not flush;
     1071
     1072
    9751073                      //Tcontrol_t   is_valid      = ((depth == depth_min) and not flush);
    9761074                     
    977                       log_printf(TRACE,Commit_unit,FUNCTION,"  * HEAD              [%d] - %d",num_bank,((entry->ptr << _param->_shift_num_slot) | num_bank));
    9781075                     
    9791076                      log_printf(TRACE,Commit_unit,FUNCTION,"    * is_valid        : %d ((depth == depth_min) and not flush)",is_valid);
     
    9841081                      log_printf(TRACE,Commit_unit,FUNCTION,"    * speculative     : %d",speculative);
    9851082                      log_printf(TRACE,Commit_unit,FUNCTION,"    * flush           : %d",flush);
     1083                      log_printf(TRACE,Commit_unit,FUNCTION,"    * state (before)  : %s",toString(state).c_str());
     1084
     1085//                       //------------------------------------------------------
     1086//                       // Event ?
     1087//                       //------------------------------------------------------
     1088
     1089//                       if ((reg_EVENT_STATE  [front_end_id][context_id] == COMMIT_EVENT_STATE_NOT_YET_EVENT) and
     1090//                           (reg_EVENT_PACKET [front_end_id][context_id] == num_packet))
     1091//                         {
     1092//                           switch (state)
     1093//                             {
     1094//                             case ROB_END_BRANCH_MISS_SPECULATIVE : {state = ROB_END_BRANCH_MISS        ; break;}
     1095//                             case ROB_END_LOAD_MISS_SPECULATIVE   : {state = ROB_END_LOAD_MISS_UPDATE   ; break;}
     1096//                             case ROB_END_BRANCH_MISS             :
     1097//                             case ROB_END_LOAD_MISS               :
     1098//                             case ROB_END                         :
     1099//                               {break;}
     1100//                             default :
     1101//                               {
     1102//                                 throw ERRORMORPHEO(FUNCTION,toString(_("Head [%d] : invalid state (%s)"),num_packet,toString(state).c_str()));
     1103//                                 break;
     1104//                               }
     1105//                             }
     1106//                         }
    9861107                   
    9871108                      //------------------------------------------------------
     
    9971118                            case ROB_END_BRANCH_MISS             :
    9981119                            case ROB_END_BRANCH_MISS_SPECULATIVE : {state = ROB_END_MISS      ; break;}
     1120                            case ROB_END_LOAD_MISS               :
    9991121                            case ROB_END_LOAD_MISS_UPDATE        :
    1000                             case ROB_END_LOAD_MISS               :
    10011122                            case ROB_END_LOAD_MISS_SPECULATIVE   : {state = ROB_END_MISS      ; break;}
    10021123                            case ROB_STORE_OK                    : {state = ROB_STORE_KO      ; break;}
     
    10291150                            }
    10301151                        }
     1152
     1153                      //------------------------------------------------------
     1154                      // test if instruction is branch not finish
     1155                      //------------------------------------------------------
     1156                      switch (state)
     1157                        {
     1158                        case ROB_BRANCH_WAIT_END :
     1159                        case ROB_BRANCH_COMPLETE :
     1160                          {
     1161                            is_speculative [front_end_id][context_id] = true;
     1162                            break;
     1163                          }
     1164                        default : break;
     1165                        }
    10311166                     
    10321167                      //------------------------------------------------------
    10331168                      // test if instruction is not speculative
    10341169                      //------------------------------------------------------
    1035                       entry->speculative = speculative;
     1170//                       entry->speculative = speculative;
    10361171//                    if (entry->depth == depth_min)
    10371172                      // test if instruction is speculative (depth != depth_min)
     
    10641199                      // Write new state
    10651200                      entry->state = state;
    1066                      
    1067                       // Test if this instruction is the last of event
    1068                       if (((reg_EVENT_STATE         [front_end_id][context_id] != COMMIT_EVENT_STATE_NO_EVENT) and
    1069                            (reg_EVENT_STATE         [front_end_id][context_id] != COMMIT_EVENT_STATE_NOT_YET_EVENT)) and
    1070                           (reg_EVENT_LAST_NUM_BANK [front_end_id][context_id] == num_bank            ) and
    1071                           (reg_EVENT_LAST_NUM_PTR  [front_end_id][context_id] == entry->ptr          ))
    1072                         {
    1073                           log_printf(TRACE,Commit_unit,FUNCTION,"  * Stop Scan !!!");
     1201
     1202                      log_printf(TRACE,Commit_unit,FUNCTION,"    * state (after )  : %s",toString(state).c_str());
     1203                     
     1204//                    log_printf(TRACE,Commit_unit,FUNCTION,"  * Stop Scan !!!");
    10741205                         
    1075                           EVENT_LAST [front_end_id][context_id] = true;
    1076                         }
     1206                      event_nb_inst [front_end_id][context_id] ++;
     1207
     1208                      // stop if :
     1209                      //  * begin event
     1210                      //  * end event
     1211                      if (((reg_EVENT_STATE [front_end_id][context_id] == COMMIT_EVENT_STATE_NOT_YET_EVENT) and
     1212                           (reg_EVENT_PACKET[front_end_id][context_id] == num_packet)) or
     1213                          ((reg_EVENT_NB_INST [front_end_id][context_id] > 0) and
     1214                           (    event_nb_inst [front_end_id][context_id] >= reg_EVENT_NB_INST [front_end_id][context_id])))
     1215                        can_continue [front_end_id][context_id] = false;
    10771216                    }
    10781217                }
     
    10831222
    10841223#ifdef STATISTICS
    1085     for (uint32_t i=0; i<_param->_nb_bank; i++)
    1086       if (usage_is_set(_usage,USE_STATISTICS))
    1087         *(_stat_bank_nb_inst [i]) += _rob[i].size();
     1224    if (usage_is_set(_usage,USE_STATISTICS))
     1225      {
     1226        for (uint32_t i=0; i<_param->_nb_bank; i++)
     1227          *(_stat_bank_nb_inst [i]) += _rob[i].size();
     1228
     1229        for (uint32_t i=0; i<_param->_nb_front_end; i++)
     1230          for (uint32_t j=0; j<_param->_nb_context [i]; j++)
     1231            {
     1232              uint32_t num_thread = _param->_translate_num_context_to_num_thread [i][j];
     1233             
     1234              switch (reg_EVENT_STATE [i][j])
     1235                {
     1236                case COMMIT_EVENT_STATE_NO_EVENT      : (*_stat_nb_cycle_state_no_event      [num_thread])++; break;
     1237                case COMMIT_EVENT_STATE_NOT_YET_EVENT : (*_stat_nb_cycle_state_not_yet_event [num_thread])++; break;
     1238                case COMMIT_EVENT_STATE_EVENT         : (*_stat_nb_cycle_state_event         [num_thread])++; break;
     1239                case COMMIT_EVENT_STATE_WAIT_END      : (*_stat_nb_cycle_state_wait_end      [num_thread])++; break;
     1240                }
     1241            }
     1242      }
    10881243#endif
    10891244      }
     
    11091264//          log_printf(TRACE,Commit_unit,FUNCTION,"      * EVENT             : %d (bank %d, ptr %d)",((reg_EVENT_NUM_PTR [i][j] << _param->_shift_num_slot) | reg_EVENT_NUM_BANK [i][j]), reg_EVENT_NUM_BANK [i][j],reg_EVENT_NUM_PTR [i][j]);
    11101265//          log_printf(TRACE,Commit_unit,FUNCTION,"      * EVENT_CAN_RESTART : %d",reg_EVENT_CAN_RESTART [i][j]);
    1111             log_printf(TRACE,Commit_unit,FUNCTION,"      * EVENT_PACKET      : %d",reg_EVENT_PACKET[i][j]);
    1112             log_printf(TRACE,Commit_unit,FUNCTION,"      * EVENT_LAST        : %d",reg_EVENT_LAST [i][j]);
    1113             log_printf(TRACE,Commit_unit,FUNCTION,"      * EVENT_LAST        : %d (bank %d, ptr %d)",((reg_EVENT_LAST_NUM_PTR [i][j] << _param->_shift_num_slot) | reg_EVENT_LAST_NUM_BANK [i][j]), reg_EVENT_LAST_NUM_BANK [i][j],reg_EVENT_LAST_NUM_PTR [i][j]);
    1114             log_printf(TRACE,Commit_unit,FUNCTION,"      * EVENT_NEXT_STOP   : %d",reg_EVENT_NEXT_STOP  [i][j]);
    1115             log_printf(TRACE,Commit_unit,FUNCTION,"      * EVENT_NEXT_PACKET : %d",reg_EVENT_NEXT_PACKET[i][j]);
    1116             log_printf(TRACE,Commit_unit,FUNCTION,"      * NB_INST_ALL       : %d",reg_NB_INST_COMMIT_ALL[i][j]);
    1117             log_printf(TRACE,Commit_unit,FUNCTION,"      * NB_INST_MEM       : %d",reg_NB_INST_COMMIT_MEM[i][j]);
    1118             log_printf(TRACE,Commit_unit,FUNCTION,"      * PC_CURRENT        : %.8x (%.8x) - %d %d",reg_PC_CURRENT [i][j],reg_PC_CURRENT [i][j]<<2, reg_PC_CURRENT_IS_DS [i][j], reg_PC_CURRENT_IS_DS_TAKE [i][j]);
    1119             log_printf(TRACE,Commit_unit,FUNCTION,"      * PC_NEXT           : %.8x (%.8x)",reg_PC_NEXT [i][j],reg_PC_NEXT [i][j]<<2);
     1266            log_printf(TRACE,Commit_unit,FUNCTION,"      * EVENT_LAST        : %d - packet %d - ptr %d (bank %d, ptr %d)",reg_EVENT_LAST [i][j],reg_EVENT_PACKET[i][j],((reg_EVENT_LAST_NUM_PTR [i][j] << _param->_shift_num_slot) | reg_EVENT_LAST_NUM_BANK [i][j]), reg_EVENT_LAST_NUM_BANK [i][j],reg_EVENT_LAST_NUM_PTR [i][j]);
     1267            log_printf(TRACE,Commit_unit,FUNCTION,"      * EVENT_NEXT        : stop : %d - packet : %d",reg_EVENT_NEXT_STOP  [i][j],reg_EVENT_NEXT_PACKET[i][j]);
     1268            log_printf(TRACE,Commit_unit,FUNCTION,"      * NB_INST_ALL       : all : %d - mem : %d - event : %d",reg_NB_INST_COMMIT_ALL[i][j], reg_NB_INST_COMMIT_MEM[i][j],reg_EVENT_NB_INST[i][j]);
     1269            log_printf(TRACE,Commit_unit,FUNCTION,"      * PC                : %.8x (%.8x) - %d %d - %.8x (%.8x)",reg_PC_CURRENT [i][j],reg_PC_CURRENT [i][j]<<2, reg_PC_CURRENT_IS_DS [i][j], reg_PC_CURRENT_IS_DS_TAKE [i][j],reg_PC_NEXT [i][j],reg_PC_NEXT [i][j]<<2);
    11201270          }
    11211271
     
    11491299                  nb_write_re += ((*it)->write_re)?1:0;
    11501300
    1151                   log_printf(TRACE,Commit_unit,FUNCTION,"        [%.4d][%.4d] (%.4d) %.4d %.4d %.4d %.4d, %.3d %.3d, %.1d, %.1d %.4d, %.1d %.4d, %s",
     1301                  log_printf(TRACE,Commit_unit,FUNCTION,"        [%.4d][%.4d] %.4d %.4d %.4d %.4d, %.3d %.3d, %.1d, %.1d %.4d, %.1d %.4d, %s",
    11521302                             num_bank                       ,
    11531303                             (*it)->ptr                     ,
    1154                              (((*it)->ptr << _param->_shift_num_slot) | num_bank),
    11551304                             (*it)->front_end_id            ,
    11561305                             (*it)->context_id              ,
     
    11651314                             (*it)->load_queue_ptr_write    ,
    11661315                             toString((*it)->state).c_str() );
    1167                   log_printf(TRACE,Commit_unit,FUNCTION,"                     %.1d %.2d %.6d, %.1d %.2d %.6d, %.1d %.1d %.6d, %.1d %.2d %.6d %.6d, %.1d %.1d %.6d %.6d ",
     1316                  log_printf(TRACE,Commit_unit,FUNCTION,"              (%.4d) %.1d %.2d %.6d, %.1d %.2d %.6d, %.1d %.1d %.6d, %.1d %.2d %.6d %.6d, %.1d %.1d %.6d %.6d ",
     1317                             (((*it)->ptr << _param->_shift_num_slot) | num_bank),
    11681318                             (*it)->read_ra                 ,
    11691319                             (*it)->num_reg_ra_log          ,
     
    11841334                             (*it)->num_reg_re_phy_new      );
    11851335                 
    1186                   log_printf(TRACE,Commit_unit,FUNCTION,"                     %.2d %.2d %.1d %.1d %.1d - %.8x (%.8x) %.8x (%.8x)",
     1336                  log_printf(TRACE,Commit_unit,FUNCTION,"                     %.2d %.2d %.1d %.1d - %.8x (%.8x) %.8x (%.8x)",
    11871337                             (*it)->exception_use ,
    11881338                             (*it)->exception     ,
    11891339                             (*it)->flags         ,
    11901340                             (*it)->no_sequence   ,
    1191                              (*it)->speculative   ,
     1341//                              (*it)->speculative   ,
    11921342                             (*it)->address       ,
    11931343                             (*it)->address<<2    ,
     
    12451395        }
    12461396    }
     1397    {
     1398      uint32_t NB_INST [_param->_nb_front_end][_param->_max_nb_context];
     1399      for (uint32_t i=0; i<_param->_nb_front_end; i++)
     1400        for (uint32_t j=0; j<_param->_nb_context [i]; j++)
     1401          NB_INST [i][j] = 0; //reg_EVENT_NB_INST [i][j];
     1402
     1403      for (uint32_t i=0; i<_param->_nb_bank; ++i)
     1404        for (std::list<entry_t*>::iterator it=_rob[i].begin();
     1405             it!=_rob [i].end();
     1406             ++it)
     1407          NB_INST [(*it)->front_end_id][(*it)->context_id] ++;
     1408
     1409      for (uint32_t i=0; i<_param->_nb_front_end; i++)
     1410        for (uint32_t j=0; j<_param->_nb_context [i]; j++)
     1411          if (NB_INST [i][j] != reg_NB_INST_COMMIT_ALL [i][j])
     1412            throw ERRORMORPHEO(FUNCTION,toString(_("Context [%d][%d] have not the good nb_inst (%d in rob, %d in register).\n"),i,j,NB_INST[i][j], reg_NB_INST_COMMIT_ALL [i][j]));
     1413    }
    12471414#endif
    12481415
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Stat_List_unit/src/Parameters_msg_error.cpp

    r82 r124  
    4343      test.error(_("the number of physical special register must be a power of 2.\n"));
    4444
     45//     if (not is_multiple(_nb_general_register,_nb_bank))
     46//       test.error(_("nb_general_register must be a multiple of nb_bank.\n"));
     47//     if (not is_multiple(_nb_special_register,_nb_bank))
     48//       test.error(_("nb_special_register must be a multiple of nb_bank.\n"));
     49
    4550    if (not is_power2(_nb_bank))
    4651      test.error(_("the number of bank must be a power of 2.\n"));
Note: See TracChangeset for help on using the changeset viewer.