Changeset 122 for trunk/IPs/systemC


Ignore:
Timestamp:
Jun 3, 2009, 10:15:51 AM (15 years ago)
Author:
rosiere
Message:

Modif for performance :
1) Load Store Unit : store send request to valid exeception
2) Commit_unit : retire can bypass store
3) Commit_unit : add stat to manage store instruction
4) Load Store Unit and Load Store Pointer Manager : add store_queue_ptr_read
5) Fix lot of bug

Location:
trunk/IPs/systemC
Files:
2 added
119 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/Environment/Common/include/Debug.h

    r117 r122  
    33
    44#define DEBUG_true        true
    5 #define DEBUG_ENVIRONMENT true
    6 #define DEBUG_CACHE       true
    7 #define DEBUG_DATA        true
    8 #define DEBUG_ENDIANNESS  true
    9 #define DEBUG_QUEUE       true
    10 #define DEBUG_RAMLOCK     true
    11 #define DEBUG_SIM2OS      true
    12 #define DEBUG_TTY         true
     5#define DEBUG_ENVIRONMENT false
     6#define DEBUG_CACHE       false
     7#define DEBUG_DATA        false
     8#define DEBUG_ENDIANNESS  false
     9#define DEBUG_QUEUE       false
     10#define DEBUG_RAMLOCK     false
     11#define DEBUG_SIM2OS      false
     12#define DEBUG_TTY         false
    1313
    1414#define MSG_ENVIRONMENT "[ENVIRONMENT]"
     
    1717  do                                                                    \
    1818    {                                                                   \
    19       fprintf(stdout,str);                                              \
    20     }                                                                   \
     19      if (DEBUG_ ## component == true )                                 \
     20        {                                                               \
     21          fprintf(stdout,str);                                          \
     22        }                                                               \
     23    }                                                                   \
    2124  while(0)
    2225
  • trunk/IPs/systemC/Environment/Data/src/loadexec.c

    r117 r122  
    102102  bfd      *exec;
    103103  static   int x;
    104   int      i;
    105104  raminfo  ringo;
    106105
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Core_Glue/include/Core_Glue.h

    r120 r122  
    121121  public    : SC_IN (Toperation_t      )  ***  in_ISSUE_OOO_ENGINE_OPERATION                ;//[nb_ooo_engine][nb_inst_issue]
    122122  public    : SC_IN (Tlsq_ptr_t        )  ***  in_ISSUE_OOO_ENGINE_STORE_QUEUE_PTR_WRITE    ;//[nb_ooo_engine][nb_inst_issue]
     123  public    : SC_IN (Tlsq_ptr_t        )  ***  in_ISSUE_OOO_ENGINE_STORE_QUEUE_PTR_READ     ;//[nb_ooo_engine][nb_inst_issue]
     124  public    : SC_IN (Tcontrol_t        )  ***  in_ISSUE_OOO_ENGINE_STORE_QUEUE_EMPTY        ;//[nb_ooo_engine][nb_inst_issue]
    123125  public    : SC_IN (Tlsq_ptr_t        )  ***  in_ISSUE_OOO_ENGINE_LOAD_QUEUE_PTR_WRITE     ;//[nb_ooo_engine][nb_inst_issue]
    124126  public    : SC_IN (Tcontrol_t        )  ***  in_ISSUE_OOO_ENGINE_HAS_IMMEDIAT             ;//[nb_ooo_engine][nb_inst_issue]
     
    144146  public    : SC_OUT(Ttype_t           )  *** out_ISSUE_EXECUTE_LOOP_TYPE                   ;//[nb_execute_loop][nb_read_unit]
    145147  public    : SC_OUT(Tlsq_ptr_t        )  *** out_ISSUE_EXECUTE_LOOP_STORE_QUEUE_PTR_WRITE  ;//[nb_execute_loop][nb_read_unit]
     148  public    : SC_OUT(Tlsq_ptr_t        )  *** out_ISSUE_EXECUTE_LOOP_STORE_QUEUE_PTR_READ   ;//[nb_execute_loop][nb_read_unit]
     149  public    : SC_OUT(Tcontrol_t        )  *** out_ISSUE_EXECUTE_LOOP_STORE_QUEUE_EMPTY      ;//[nb_execute_loop][nb_read_unit]
    146150  public    : SC_OUT(Tlsq_ptr_t        )  *** out_ISSUE_EXECUTE_LOOP_LOAD_QUEUE_PTR_WRITE   ;//[nb_execute_loop][nb_read_unit]
    147151  public    : SC_OUT(Tcontrol_t        )  *** out_ISSUE_EXECUTE_LOOP_HAS_IMMEDIAT           ;//[nb_execute_loop][nb_read_unit]
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Core_Glue/src/Core_Glue.cpp

    r120 r122  
    168168                        << (*(in_ISSUE_OOO_ENGINE_OPERATION             [i][j]))
    169169                        << (*(in_ISSUE_OOO_ENGINE_STORE_QUEUE_PTR_WRITE [i][j]))
     170                        << (*(in_ISSUE_OOO_ENGINE_STORE_QUEUE_PTR_READ  [i][j]))
     171                        << (*(in_ISSUE_OOO_ENGINE_STORE_QUEUE_EMPTY     [i][j]))
    170172                        << (*(in_ISSUE_OOO_ENGINE_HAS_IMMEDIAT          [i][j]))
    171173                        << (*(in_ISSUE_OOO_ENGINE_IMMEDIAT              [i][j]))
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Core_Glue/src/Core_Glue_allocation.cpp

    r120 r122  
    143143      _ALLOC2_SIGNAL_IN ( in_ISSUE_OOO_ENGINE_OPERATION                ,"OPERATION"            ,Toperation_t      ,_param->_size_operation       ,_param->_nb_ooo_engine,_param->_nb_inst_issue_queue[it1]);
    144144      _ALLOC2_SIGNAL_IN ( in_ISSUE_OOO_ENGINE_STORE_QUEUE_PTR_WRITE    ,"STORE_QUEUE_PTR_WRITE",Tlsq_ptr_t        ,_param->_size_store_queue_ptr ,_param->_nb_ooo_engine,_param->_nb_inst_issue_queue[it1]);
     145      _ALLOC2_SIGNAL_IN ( in_ISSUE_OOO_ENGINE_STORE_QUEUE_PTR_READ     ,"STORE_QUEUE_PTR_READ" ,Tlsq_ptr_t        ,_param->_size_store_queue_ptr ,_param->_nb_ooo_engine,_param->_nb_inst_issue_queue[it1]);
     146      _ALLOC2_SIGNAL_IN ( in_ISSUE_OOO_ENGINE_STORE_QUEUE_EMPTY        ,"STORE_QUEUE_EMPTY"    ,Tcontrol_t        ,1                             ,_param->_nb_ooo_engine,_param->_nb_inst_issue_queue[it1]);
    145147      _ALLOC2_SIGNAL_IN ( in_ISSUE_OOO_ENGINE_LOAD_QUEUE_PTR_WRITE     ,"LOAD_QUEUE_PTR_WRITE" ,Tlsq_ptr_t        ,_param->_size_load_queue_ptr  ,_param->_nb_ooo_engine,_param->_nb_inst_issue_queue[it1]);
    146148      _ALLOC2_SIGNAL_IN ( in_ISSUE_OOO_ENGINE_HAS_IMMEDIAT             ,"HAS_IMMEDIAT"         ,Tcontrol_t        ,1                             ,_param->_nb_ooo_engine,_param->_nb_inst_issue_queue[it1]);
     
    172174      _ALLOC2_SIGNAL_OUT(out_ISSUE_EXECUTE_LOOP_TYPE                   ,"TYPE"                 ,Ttype_t           ,_param->_size_type            ,_param->_nb_execute_loop,_param->_nb_read_unit[it1]);
    173175      _ALLOC2_SIGNAL_OUT(out_ISSUE_EXECUTE_LOOP_STORE_QUEUE_PTR_WRITE  ,"STORE_QUEUE_PTR_WRITE",Tlsq_ptr_t        ,_param->_size_store_queue_ptr ,_param->_nb_execute_loop,_param->_nb_read_unit[it1]);
     176      _ALLOC2_SIGNAL_OUT(out_ISSUE_EXECUTE_LOOP_STORE_QUEUE_PTR_READ   ,"STORE_QUEUE_PTR_READ" ,Tlsq_ptr_t        ,_param->_size_store_queue_ptr ,_param->_nb_execute_loop,_param->_nb_read_unit[it1]);
     177      _ALLOC2_SIGNAL_OUT(out_ISSUE_EXECUTE_LOOP_STORE_QUEUE_EMPTY      ,"STORE_QUEUE_EMPTY"    ,Tcontrol_t        ,1                             ,_param->_nb_execute_loop,_param->_nb_read_unit[it1]);
    174178      _ALLOC2_SIGNAL_OUT(out_ISSUE_EXECUTE_LOOP_LOAD_QUEUE_PTR_WRITE   ,"LOAD_QUEUE_PTR_WRITE" ,Tlsq_ptr_t        ,_param->_size_load_queue_ptr  ,_param->_nb_execute_loop,_param->_nb_read_unit[it1]);
    175179      _ALLOC2_SIGNAL_OUT(out_ISSUE_EXECUTE_LOOP_HAS_IMMEDIAT           ,"HAS_IMMEDIAT"         ,Tcontrol_t        ,1                             ,_param->_nb_execute_loop,_param->_nb_read_unit[it1]);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Core_Glue/src/Core_Glue_deallocation.cpp

    r120 r122  
    7878        DELETE2_SIGNAL( in_ISSUE_OOO_ENGINE_OPERATION                ,_param->_nb_ooo_engine,_param->_nb_inst_issue_queue[it1],_param->_size_operation);
    7979        DELETE2_SIGNAL( in_ISSUE_OOO_ENGINE_STORE_QUEUE_PTR_WRITE    ,_param->_nb_ooo_engine,_param->_nb_inst_issue_queue[it1],_param->_size_store_queue_ptr);
     80        DELETE2_SIGNAL( in_ISSUE_OOO_ENGINE_STORE_QUEUE_PTR_READ     ,_param->_nb_ooo_engine,_param->_nb_inst_issue_queue[it1],_param->_size_store_queue_ptr);
     81        DELETE2_SIGNAL( in_ISSUE_OOO_ENGINE_STORE_QUEUE_EMPTY        ,_param->_nb_ooo_engine,_param->_nb_inst_issue_queue[it1],1);
    8082        DELETE2_SIGNAL( in_ISSUE_OOO_ENGINE_LOAD_QUEUE_PTR_WRITE     ,_param->_nb_ooo_engine,_param->_nb_inst_issue_queue[it1],_param->_size_load_queue_ptr);
    8183        DELETE2_SIGNAL( in_ISSUE_OOO_ENGINE_HAS_IMMEDIAT             ,_param->_nb_ooo_engine,_param->_nb_inst_issue_queue[it1],1);
     
    101103        DELETE2_SIGNAL(out_ISSUE_EXECUTE_LOOP_TYPE                   ,_param->_nb_execute_loop,_param->_nb_read_unit[it1],_param->_size_type);
    102104        DELETE2_SIGNAL(out_ISSUE_EXECUTE_LOOP_STORE_QUEUE_PTR_WRITE  ,_param->_nb_execute_loop,_param->_nb_read_unit[it1],_param->_size_store_queue_ptr);
     105        DELETE2_SIGNAL(out_ISSUE_EXECUTE_LOOP_STORE_QUEUE_PTR_READ   ,_param->_nb_execute_loop,_param->_nb_read_unit[it1],_param->_size_store_queue_ptr);
     106        DELETE2_SIGNAL(out_ISSUE_EXECUTE_LOOP_STORE_QUEUE_EMPTY      ,_param->_nb_execute_loop,_param->_nb_read_unit[it1],1);
    103107        DELETE2_SIGNAL(out_ISSUE_EXECUTE_LOOP_LOAD_QUEUE_PTR_WRITE   ,_param->_nb_execute_loop,_param->_nb_read_unit[it1],_param->_size_load_queue_ptr);
    104108        DELETE2_SIGNAL(out_ISSUE_EXECUTE_LOOP_HAS_IMMEDIAT           ,_param->_nb_execute_loop,_param->_nb_read_unit[it1],1);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Core_Glue/src/Core_Glue_genMealy_issue.cpp

    r120 r122  
    194194                                PORT_WRITE(out_ISSUE_EXECUTE_LOOP_TYPE                  [num_execute_loop][num_read_unit],type);
    195195                                PORT_WRITE(out_ISSUE_EXECUTE_LOOP_STORE_QUEUE_PTR_WRITE [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_STORE_QUEUE_PTR_WRITE [num_ooo_engine][num_inst_issue_queue]));
     196                                PORT_WRITE(out_ISSUE_EXECUTE_LOOP_STORE_QUEUE_PTR_READ  [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_STORE_QUEUE_PTR_READ  [num_ooo_engine][num_inst_issue_queue]));
     197                                PORT_WRITE(out_ISSUE_EXECUTE_LOOP_STORE_QUEUE_EMPTY     [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_STORE_QUEUE_EMPTY     [num_ooo_engine][num_inst_issue_queue]));
    196198                                if (_param->_have_port_load_queue_ptr)
    197199                                PORT_WRITE(out_ISSUE_EXECUTE_LOOP_LOAD_QUEUE_PTR_WRITE  [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_LOAD_QUEUE_PTR_WRITE  [num_ooo_engine][num_inst_issue_queue]));
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Functionnal_unit/include/Functionnal_unit.h

    r118 r122  
    8585  public    : SC_IN (Ttype_t           )    *  in_EXECUTE_IN_TYPE           ;
    8686  public    : SC_IN (Tlsq_ptr_t        )    *  in_EXECUTE_IN_STORE_QUEUE_PTR_WRITE;
     87  public    : SC_IN (Tlsq_ptr_t        )    *  in_EXECUTE_IN_STORE_QUEUE_PTR_READ ;
     88  public    : SC_IN (Tcontrol_t        )    *  in_EXECUTE_IN_STORE_QUEUE_EMPTY    ;
    8789  public    : SC_IN (Tlsq_ptr_t        )    *  in_EXECUTE_IN_LOAD_QUEUE_PTR_WRITE;
    8890  public    : SC_IN (Tcontrol_t        )    *  in_EXECUTE_IN_HAS_IMMEDIAT   ;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Functionnal_unit/src/Functionnal_unit_allocation.cpp

    r118 r122  
    6363      ALLOC0_SIGNAL_IN ( in_EXECUTE_IN_TYPE                  ,"type"                 ,Ttype_t           , _param->_size_type         );
    6464      ALLOC0_SIGNAL_IN ( in_EXECUTE_IN_STORE_QUEUE_PTR_WRITE ,"store_queue_ptr_write",Tlsq_ptr_t        ,_param->_size_store_queue_ptr);
     65      ALLOC0_SIGNAL_IN ( in_EXECUTE_IN_STORE_QUEUE_PTR_READ  ,"store_queue_ptr_read" ,Tlsq_ptr_t        ,_param->_size_store_queue_ptr);
     66      ALLOC0_SIGNAL_IN ( in_EXECUTE_IN_STORE_QUEUE_EMPTY     ,"store_queue_empty"    ,Tcontrol_t        , 1);
    6567      ALLOC0_SIGNAL_IN ( in_EXECUTE_IN_LOAD_QUEUE_PTR_WRITE  ,"load_queue_ptr_write" ,Tlsq_ptr_t        ,_param->_size_load_queue_ptr);
    6668      ALLOC0_SIGNAL_IN ( in_EXECUTE_IN_HAS_IMMEDIAT          ,"has_immediat"         ,Tcontrol_t        , 1);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Functionnal_unit/src/Functionnal_unit_deallocation.cpp

    r118 r122  
    3939        DELETE0_SIGNAL( in_EXECUTE_IN_TYPE                  , _param->_size_type         );
    4040        DELETE0_SIGNAL( in_EXECUTE_IN_STORE_QUEUE_PTR_WRITE ,_param->_size_store_queue_ptr);
     41        DELETE0_SIGNAL( in_EXECUTE_IN_STORE_QUEUE_PTR_READ  ,_param->_size_store_queue_ptr);
     42        DELETE0_SIGNAL( in_EXECUTE_IN_STORE_QUEUE_EMPTY     , 1);
    4143        DELETE0_SIGNAL( in_EXECUTE_IN_LOAD_QUEUE_PTR_WRITE  ,_param->_size_load_queue_ptr);
    4244        DELETE0_SIGNAL( in_EXECUTE_IN_HAS_IMMEDIAT          , 1);
  • 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

    r117 r122  
    103103  public    : SC_IN (Ttype_t           )   **  in_MEMORY_IN_TYPE                 ;//[nb_inst_memory]
    104104  public    : SC_IN (Tlsq_ptr_t        )   **  in_MEMORY_IN_STORE_QUEUE_PTR_WRITE;//[nb_inst_memory]
     105  public    : SC_IN (Tlsq_ptr_t        )   **  in_MEMORY_IN_STORE_QUEUE_PTR_READ ;//[nb_inst_memory]
     106  public    : SC_IN (Tcontrol_t        )   **  in_MEMORY_IN_STORE_QUEUE_EMPTY    ;//[nb_inst_memory]
    105107  public    : SC_IN (Tlsq_ptr_t        )   **  in_MEMORY_IN_LOAD_QUEUE_PTR_WRITE ;//[nb_inst_memory]
    106108  public    : SC_IN (Tcontrol_t        )   **  in_MEMORY_IN_HAS_IMMEDIAT         ;//[nb_inst_memory]
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Types.h

    r119 r122  
    7373//public    : Tgeneral_address_t   _num_reg_rd          ;
    7474  public    : Texception_t         _exception           ;
     75  public    : bool                 _send_commit         ;
    7576
    7677    friend std::ostream & operator << (std::ostream& os, const Tstore_queue_entry_t & x)
     
    112113  public    : Tlsq_ptr_t                         _load_queue_ptr_write ;
    113114  public    : Tlsq_ptr_t                         _store_queue_ptr_write;
     115  public    : Tlsq_ptr_t                         _store_queue_ptr_read ;
     116  public    : Tcontrol_t                         _store_queue_empty    ;
    114117  public    : Tdcache_address_t                  _address              ;
    115118  public    : Tcontrol_t                         _write_rd             ;
     
    123126                << "   * context, front_end, ooo_engine_id : " << toString(x._context_id) << " - " << toString(x._front_end_id) << " - " << toString(x._ooo_engine_id) << std::endl
    124127                << "   * operation                         : " << toString(x._operation) << std::endl
    125                 << "   * load, store ptr_write             : " << toString(x._load_queue_ptr_write) << " - " << toString(x._store_queue_ptr_write) << std::endl
     128                << "   * load, store ptr_(write/read) empty: " << toString(x._load_queue_ptr_write) << " - " << toString(x._store_queue_ptr_write) << " - " << toString(x._store_queue_ptr_read) << " - " << toString(x._store_queue_empty) << std::endl
    126129                << "   * exception                         : " << toString(x._exception) << std::endl
    127130                << std::hex
     
    166169  public    : Toperation_t         _operation        ;
    167170  public    : Tlsq_ptr_t           _store_queue_ptr_write;
     171  public    : Tlsq_ptr_t           _store_queue_ptr_read ;
     172  public    : Tcontrol_t           _store_queue_empty    ;
    168173  public    : Tdcache_address_t    _address          ;
    169174  public    : Tdcache_address_t    _check_hit_byte   ;
     
    183188                << "   * context, front_end, ooo_engine_id : " << toString(x._context_id) << " - " << toString(x._front_end_id) << " - " << toString(x._ooo_engine_id) << std::endl
    184189                << "   * operation                         : " << toString(x._operation) << std::endl
    185                 << "   * store_queue_ptr_write             : " << toString(x._store_queue_ptr_write) << std::endl
     190                << "   * store_queue ptr_(write,read) empty: " << toString(x._store_queue_ptr_write) << " - " << toString(x._store_queue_ptr_read) << " - " << toString(x._store_queue_empty) <<std::endl
    186191                << "   * exception                         : " << toString(x._exception) << std::endl
    187192                << "   * check_hit, check_hit_byte         : " << toString(x._check_hit) << " - " << toString(x._check_hit_byte) << std::endl
  • 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

    r117 r122  
    6565      ALLOC1_SIGNAL_IN ( in_MEMORY_IN_TYPE                 ,"type"                 ,Ttype_t           ,_param->_size_type                 );
    6666      ALLOC1_SIGNAL_IN ( in_MEMORY_IN_STORE_QUEUE_PTR_WRITE,"store_queue_ptr_write",Tlsq_ptr_t        ,_param->_size_store_queue_ptr      );
     67      ALLOC1_SIGNAL_IN ( in_MEMORY_IN_STORE_QUEUE_PTR_READ ,"store_queue_ptr_read" ,Tlsq_ptr_t        ,_param->_size_store_queue_ptr      );
     68      ALLOC1_SIGNAL_IN ( in_MEMORY_IN_STORE_QUEUE_EMPTY    ,"store_queue_empty"    ,Tcontrol_t        ,1);
    6769      ALLOC1_SIGNAL_IN ( in_MEMORY_IN_LOAD_QUEUE_PTR_WRITE ,"load_queue_ptr_write" ,Tlsq_ptr_t        ,_param->_size_load_queue_ptr       );
    6870      ALLOC1_SIGNAL_IN ( in_MEMORY_IN_HAS_IMMEDIAT         ,"has_immediat"         ,Tcontrol_t        ,1                                  );
  • 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

    r117 r122  
    4545    DELETE1_SIGNAL( in_MEMORY_IN_TYPE                 ,_param->_nb_inst_memory,_param->_size_type                 );
    4646    DELETE1_SIGNAL( in_MEMORY_IN_STORE_QUEUE_PTR_WRITE,_param->_nb_inst_memory,_param->_size_store_queue_ptr      );
     47    DELETE1_SIGNAL( in_MEMORY_IN_STORE_QUEUE_PTR_READ ,_param->_nb_inst_memory,_param->_size_store_queue_ptr      );
     48    DELETE1_SIGNAL( in_MEMORY_IN_STORE_QUEUE_EMPTY    ,_param->_nb_inst_memory,1);
    4749    DELETE1_SIGNAL( in_MEMORY_IN_LOAD_QUEUE_PTR_WRITE ,_param->_nb_inst_memory,_param->_size_load_queue_ptr       );
    4850    DELETE1_SIGNAL( in_MEMORY_IN_HAS_IMMEDIAT         ,_param->_nb_inst_memory,1                                  );
  • 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_genMoore.cpp

    r117 r122  
    3939//  Tspecial_address_t memory_out_num_reg_re    = 0;
    4040//  Tspecial_data_t    memory_out_data_re       = 0;
     41    Tcontrol_t         memory_out_no_sequence   = 0;
    4142    Texception_t       memory_out_exception     = 0;
    4243
     
    9899      {
    99100        log_printf(TRACE,Load_store_unit,FUNCTION,"    * Store queue");
    100         // Can retire an store instruction if :
    101         //  * state is commit
    102         //  * none load must check this store
    103         if ((_store_queue [reg_STORE_QUEUE_PTR_READ]._state == STORE_QUEUE_COMMIT) and
    104             (reg_STORE_QUEUE_NB_CHECK [reg_STORE_QUEUE_PTR_READ] == 0))
    105           {
    106             log_printf(TRACE,Load_store_unit,FUNCTION,"    * find : %d",reg_STORE_QUEUE_PTR_READ);
    107 
    108             internal_MEMORY_OUT_VAL          = 1;
    109             internal_MEMORY_OUT_SELECT_QUEUE = SELECT_STORE_QUEUE;
    110            
    111             memory_out_context_id    = _store_queue [reg_STORE_QUEUE_PTR_READ]._context_id;
    112             memory_out_front_end_id  = _store_queue [reg_STORE_QUEUE_PTR_READ]._front_end_id;
    113             memory_out_ooo_engine_id = _store_queue [reg_STORE_QUEUE_PTR_READ]._ooo_engine_id;
    114             memory_out_packet_id     = _store_queue [reg_STORE_QUEUE_PTR_READ]._packet_id ;
    115 //          memory_out_write_rd         
    116 //          memory_out_num_reg_rd       
    117             memory_out_data_rd       = _store_queue [reg_STORE_QUEUE_PTR_READ]._address; // to the exception
    118             memory_out_exception     = _store_queue [reg_STORE_QUEUE_PTR_READ]._exception;
    119           }
    120       }
     101
     102        for (uint32_t i=0; i<_param->_size_store_queue; ++i)
     103          {
     104            internal_MEMORY_OUT_PTR = (reg_STORE_QUEUE_PTR_READ+i)%_param->_size_store_queue;
     105            // Can retire an store instruction if :
     106            //  * state is commit
     107            //  * none load must check this store
     108
     109
     110            bool val_head = ((i==0) and
     111                             (_store_queue [internal_MEMORY_OUT_PTR]._state       == STORE_QUEUE_COMMIT) and
     112                             (_store_queue [internal_MEMORY_OUT_PTR]._send_commit == true) and
     113                             (reg_STORE_QUEUE_NB_CHECK [internal_MEMORY_OUT_PTR] == 0)
     114                             );
     115
     116            bool val_commit = ((_store_queue [internal_MEMORY_OUT_PTR]._state       != STORE_QUEUE_EMPTY) and
     117                               (_store_queue [internal_MEMORY_OUT_PTR]._send_commit == false));
     118
     119            if (val_head or val_commit)
     120              {
     121                log_printf(TRACE,Load_store_unit,FUNCTION,"    * find : %d",internal_MEMORY_OUT_PTR);
     122               
     123                internal_MEMORY_OUT_VAL          = 1;
     124                internal_MEMORY_OUT_SELECT_QUEUE = SELECT_STORE_QUEUE;
     125               
     126                memory_out_context_id    = _store_queue [internal_MEMORY_OUT_PTR]._context_id;
     127                memory_out_front_end_id  = _store_queue [internal_MEMORY_OUT_PTR]._front_end_id;
     128                memory_out_ooo_engine_id = _store_queue [internal_MEMORY_OUT_PTR]._ooo_engine_id;
     129                memory_out_packet_id     = _store_queue [internal_MEMORY_OUT_PTR]._packet_id ;
     130//              memory_out_write_rd     
     131//              memory_out_num_reg_rd   
     132                memory_out_data_rd       = _store_queue [internal_MEMORY_OUT_PTR]._address; // to the exception
     133                memory_out_exception     = _store_queue [internal_MEMORY_OUT_PTR]._exception;
     134                memory_out_no_sequence   = val_commit;
     135                break; // find an entry
     136              }
     137
     138          }
     139      }
     140
    121141    // write output
    122142    PORT_WRITE(out_MEMORY_OUT_VAL          [0], internal_MEMORY_OUT_VAL);
     
    142162    PORT_WRITE(out_MEMORY_OUT_DATA_RE      [0], 0);
    143163    PORT_WRITE(out_MEMORY_OUT_EXCEPTION    [0], memory_out_exception    );
    144     PORT_WRITE(out_MEMORY_OUT_NO_SEQUENCE  [0], 0);
     164    PORT_WRITE(out_MEMORY_OUT_NO_SEQUENCE  [0], memory_out_no_sequence  );// hack
     165#ifdef DEBUG
     166    PORT_WRITE(out_MEMORY_OUT_ADDRESS      [0], memory_out_data_rd);
     167#else
    145168    PORT_WRITE(out_MEMORY_OUT_ADDRESS      [0], 0);
     169#endif
    146170
    147171    // ~~~~~[ Interface "dache_req" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • 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

    r119 r122  
    275275                  // =======================
    276276                 
    277                   log_printf(TRACE,Load_store_unit,FUNCTION,"    * store_queue [%d]",reg_STORE_QUEUE_PTR_READ);
     277                  log_printf(TRACE,Load_store_unit,FUNCTION,"    * store_queue [%d]",internal_MEMORY_OUT_PTR);
    278278           
    279279                  // Entry flush and increase the read pointer
    280                   _store_queue [reg_STORE_QUEUE_PTR_READ]._state = STORE_QUEUE_EMPTY;
    281                  
    282                   reg_STORE_QUEUE_PTR_READ = (reg_STORE_QUEUE_PTR_READ+1)%_param->_size_store_queue;
     280                  if (_store_queue [internal_MEMORY_OUT_PTR]._send_commit)
     281                    {
     282                      _store_queue [internal_MEMORY_OUT_PTR]._state = STORE_QUEUE_EMPTY;
     283                      reg_STORE_QUEUE_PTR_READ = (reg_STORE_QUEUE_PTR_READ+1)%_param->_size_store_queue;
     284                    }
     285                  else
     286                    _store_queue [internal_MEMORY_OUT_PTR]._send_commit = true;
    283287
    284288                  break;
     
    339343          {
    340344            // Get an index from load queue
    341             uint32_t index_load = (i + reg_LOAD_QUEUE_CHECK_PRIORITY)%_param->_size_load_queue;
     345            uint32_t index_load_queue = (i + reg_LOAD_QUEUE_CHECK_PRIORITY)%_param->_size_load_queue;
    342346
    343347            // Test if this load must ckecked store queue
    344             if (((_load_queue[index_load]._state == LOAD_QUEUE_WAIT_CHECK) or
    345                  (_load_queue[index_load]._state == LOAD_QUEUE_COMMIT_CHECK) or
    346                  (_load_queue[index_load]._state == LOAD_QUEUE_CHECK)) and
    347                 is_operation_memory_load(_load_queue[index_load]._operation))
     348            if (((_load_queue[index_load_queue]._state == LOAD_QUEUE_WAIT_CHECK) or
     349                 (_load_queue[index_load_queue]._state == LOAD_QUEUE_COMMIT_CHECK) or
     350                 (_load_queue[index_load_queue]._state == LOAD_QUEUE_CHECK)) and
     351                is_operation_memory_load(_load_queue[index_load_queue]._operation))
    348352              {
    349                 log_printf(TRACE,Load_store_unit,FUNCTION,"    * Find a load : %d",index_load);
     353                log_printf(TRACE,Load_store_unit,FUNCTION,"    * Find a load : %d",index_load_queue);
    350354
    351355                nb_check++; // use one port
    352356
    353357                // find a entry that it need a check
    354                 Tlsq_ptr_t index_store     = _load_queue[index_load]._store_queue_ptr_write;
    355 //              Tlsq_ptr_t index_store_old = index_store;
     358                Tlsq_ptr_t store_queue_ptr_write = _load_queue[index_load_queue]._store_queue_ptr_write;
     359                Tlsq_ptr_t store_queue_ptr_read  = _load_queue[index_load_queue]._store_queue_ptr_read ;
     360                Tlsq_ptr_t store_queue_empty     = _load_queue[index_load_queue]._store_queue_empty    ;
     361//              Tlsq_ptr_t store_queue_ptr_write_old = store_queue_ptr_write;
    356362
    357363                // Init variable
     
    365371                //  * when a store is out of store queue, also it was in head of re order buffer. Also, they are none previous load.
    366372
    367                 log_printf(TRACE,Load_store_unit,FUNCTION,"    * index_store : %d",index_store);
    368                 log_printf(TRACE,Load_store_unit,FUNCTION,"    * ptr_read    : %d",reg_STORE_QUEUE_PTR_READ);
    369 
    370                 if (index_store == reg_STORE_QUEUE_PTR_READ)
     373                log_printf(TRACE,Load_store_unit,FUNCTION,"    * store_queue_ptr_write    : %d",store_queue_ptr_write);
     374                log_printf(TRACE,Load_store_unit,FUNCTION,"    * store_queue_ptr_read     : %d",store_queue_ptr_read );
     375//              log_printf(TRACE,Load_store_unit,FUNCTION,"    * store_queue_empty        : %d",store_queue_empty );
     376                log_printf(TRACE,Load_store_unit,FUNCTION,"    * reg_STORE_QUEUE_PTR_READ : %d",reg_STORE_QUEUE_PTR_READ);
     377
     378                if ((store_queue_ptr_write ==     store_queue_ptr_read) or
     379                    (store_queue_ptr_write == reg_STORE_QUEUE_PTR_READ))
     380//              if (store_queue_empty)
    371381                  {
    372                     log_printf(TRACE,Load_store_unit,FUNCTION,"      * index_store == reg_STORE_QUEUE_PTR_READ");
     382                    log_printf(TRACE,Load_store_unit,FUNCTION,"      * store_queue_ptr_write == store_queue_ptr_read");
    373383                    end_check    = true;
    374384                    change_state = true;
     
    376386                else
    377387                  {
    378                     log_printf(TRACE,Load_store_unit,FUNCTION,"      * index_store != reg_STORE_QUEUE_PTR_READ");
    379 
    380                     index_store = (index_store-1)%(_param->_size_store_queue); // store_queue_ptr_write target the next slot to write, also the slot is not significatif when the load is renaming
    381 
    382                     log_printf(TRACE,Load_store_unit,FUNCTION,"      * index_store : %d",index_store);
     388                    log_printf(TRACE,Load_store_unit,FUNCTION,"      * store_queue_ptr_write != store_queue_ptr_read");
     389
     390                    store_queue_ptr_write = (store_queue_ptr_write-1)%(_param->_size_store_queue); // store_queue_ptr_write target the next slot to write, also the slot is not significatif when the load is renaming
     391
     392                    log_printf(TRACE,Load_store_unit,FUNCTION,"      * store_queue_ptr_write : %d",store_queue_ptr_write);
    383393                   
    384394                    // switch on store_queue state
    385                     switch (_store_queue[index_store]._state)
     395                    switch (_store_queue[store_queue_ptr_write]._state)
    386396                      {
    387397                      case STORE_QUEUE_VALID_NO_SPECULATIVE :
     
    397407                          // Test thread id
    398408                          if (_param->_have_port_context_id)
    399                             test_thread_id &= (_load_queue[index_load]._context_id    == _store_queue[index_store]._context_id);
     409                            test_thread_id &= (_load_queue[index_load_queue]._context_id    == _store_queue[store_queue_ptr_write]._context_id);
    400410                          if (_param->_have_port_front_end_id)
    401                             test_thread_id &= (_load_queue[index_load]._front_end_id  == _store_queue[index_store]._front_end_id);
     411                            test_thread_id &= (_load_queue[index_load_queue]._front_end_id  == _store_queue[store_queue_ptr_write]._front_end_id);
    402412                          if (_param->_have_port_ooo_engine_id)
    403                             test_thread_id &= (_load_queue[index_load]._ooo_engine_id == _store_queue[index_store]._ooo_engine_id);
     413                            test_thread_id &= (_load_queue[index_load_queue]._ooo_engine_id == _store_queue[store_queue_ptr_write]._ooo_engine_id);
    404414                         
    405415                          if (test_thread_id)
     
    408418
    409419                              log_printf(TRACE,Load_store_unit,FUNCTION,"        * load and store is the same thread.");
    410                               Tdcache_address_t load_addr  = _load_queue [index_load ]._address;
    411                               Tdcache_address_t store_addr = _store_queue[index_store]._address;
     420                              Tdcache_address_t load_addr  = _load_queue [index_load_queue ]._address;
     421                              Tdcache_address_t store_addr = _store_queue[store_queue_ptr_write]._address;
    412422                             
    413423                              log_printf(TRACE,Load_store_unit,FUNCTION,"          * load_addr                     : %.8x.",load_addr );
     
    435445                                  bool is_big_endian = true;
    436446
    437                                   Tgeneral_data_t   load_data      = _load_queue [index_load ]._rdata  ;
    438                                   Tgeneral_data_t   store_data     = _store_queue[index_store]._wdata  ;
    439                                   Tdcache_address_t check_hit_byte = _load_queue [index_load ]._check_hit_byte;
    440                                   Tcontrol_t        check_hit      = _load_queue [index_load ]._check_hit;
    441                                   uint32_t          load_size_access  = memory_size(_load_queue [index_load ]._operation)>>3;
    442                                   uint32_t          store_size_access = memory_size(_store_queue[index_store]._operation)>>3;
     447                                  Tgeneral_data_t   load_data      = _load_queue [index_load_queue ]._rdata  ;
     448                                  Tgeneral_data_t   store_data     = _store_queue[store_queue_ptr_write]._wdata  ;
     449                                  Tdcache_address_t check_hit_byte = _load_queue [index_load_queue ]._check_hit_byte;
     450                                  Tcontrol_t        check_hit      = _load_queue [index_load_queue ]._check_hit;
     451                                  uint32_t          load_size_access  = memory_size(_load_queue [index_load_queue ]._operation)>>3;
     452                                  uint32_t          store_size_access = memory_size(_store_queue[store_queue_ptr_write]._operation)>>3;
    443453
    444454                                  log_printf(TRACE,Load_store_unit,FUNCTION,"            * is_big_endian           : %d",is_big_endian);
     
    464474                                    }
    465475
    466                                   uint32_t store_nb_byte     = (1<<memory_access(_store_queue[index_store]._operation));
     476                                  uint32_t store_nb_byte     = (1<<memory_access(_store_queue[store_queue_ptr_write]._operation));
    467477
    468478                                  // Take interval to the store
     
    473483                                  log_printf(TRACE,Load_store_unit,FUNCTION,"            * store_num_byte_max      : %d",store_num_byte_max);
    474484
    475 //                                   uint32_t load_nb_byte      = (1<<memory_access(_load_queue[index_load]._operation));
     485//                                   uint32_t load_nb_byte      = (1<<memory_access(_load_queue[index_load_queue]._operation));
    476486
    477487//                                uint32_t load_num_byte_min = (load_addr & _param->_mask_address_lsb);
     
    517527
    518528//                                           // store duplicate = all store access can be see as full size_data store
    519 // //                                           uint32_t load_nb_byte = (1<<memory_access(_load_queue [index_load ]._operation));
     529// //                                           uint32_t load_nb_byte = (1<<memory_access(_load_queue [index_load_queue ]._operation));
    520530
    521531// //                                           int32_t diff = ((_param->_size_general_data>>3)+load_nb_byte-2*load_nb_byte*((num_store_byte/load_nb_byte)+1));
     
    597607                                    }
    598608
    599                                   _load_queue[index_load]._rdata          = load_data;
    600                                   _load_queue[index_load]._check_hit_byte = check_hit_byte;
    601                                   _load_queue[index_load]._check_hit      = check_hit;
     609                                  _load_queue[index_load_queue]._rdata          = load_data;
     610                                  _load_queue[index_load_queue]._check_hit_byte = check_hit_byte;
     611                                  _load_queue[index_load_queue]._check_hit      = check_hit;
    602612
    603613                                  log_printf(TRACE,Load_store_unit,FUNCTION,"            * load_data  (after) : 0x%.8x",load_data);
     
    609619                                  log_printf(TRACE,Load_store_unit,FUNCTION,"            * mask_check_hit_byte: %x",_param->_mask_check_hit_byte);
    610620                                  // The check is finish if all bit is set
    611                                   end_check = (_load_queue[index_load]._check_hit_byte == _param->_mask_check_hit_byte);
     621                                  end_check = (_load_queue[index_load_queue]._check_hit_byte == _param->_mask_check_hit_byte);
    612622
    613623                                }
     
    629639                  {
    630640                    log_printf(TRACE,Load_store_unit,FUNCTION,"              * next");
    631                     log_printf(TRACE,Load_store_unit,FUNCTION,"                * new store_queue_ptr_write : %d",index_store);
     641                    log_printf(TRACE,Load_store_unit,FUNCTION,"                * new store_queue_ptr_write : %d",store_queue_ptr_write);
    632642
    633643                    log_printf(TRACE,Load_store_unit,FUNCTION,"              * update reg_STORE_QUEUE_NB_CHECK");
    634644#ifdef DEBUG
    635                     if (reg_STORE_QUEUE_NB_CHECK [index_store] == 0)
     645                    if (reg_STORE_QUEUE_NB_CHECK [store_queue_ptr_write] == 0)
    636646                      throw ERRORMORPHEO(FUNCTION,_("reg_STORE_QUEUE_NB_CHECK must be > 0\n"));
    637647#endif
    638                     reg_STORE_QUEUE_NB_CHECK [index_store] --;
    639 
    640 //                  if (_load_queue[index_load]._store_queue_ptr_write == 0)
    641 //                    _load_queue[index_load]._store_queue_ptr_write = _param->_size_store_queue-1;
     648
     649                    reg_STORE_QUEUE_NB_CHECK [store_queue_ptr_write] --;
     650
     651                    log_printf(TRACE,Load_store_unit,FUNCTION,"              * reg_STORE_QUEUE_NB_CHECK 1 [%d] <- %d", store_queue_ptr_write,reg_STORE_QUEUE_NB_CHECK [store_queue_ptr_write]);
     652
     653                    if ((store_queue_ptr_write ==     store_queue_ptr_read) or
     654                        (store_queue_ptr_write == reg_STORE_QUEUE_PTR_READ))
     655                      {
     656//                      store_queue_empty = true;
     657                        end_check         = true;
     658                        change_state      = true;
     659                      }
     660
     661//                  if (_load_queue[index_load_queue]._store_queue_ptr_write == 0)
     662//                    _load_queue[index_load_queue]._store_queue_ptr_write = _param->_size_store_queue-1;
    642663//                  else
    643 //                    _load_queue[index_load]._store_queue_ptr_write --;
    644                     _load_queue[index_load]._store_queue_ptr_write = index_store; // because the index store have be decrease
    645 
    646                     // FIXME : peut n'est pas obliger de faire cette comparaison. Au prochain cycle on le détectera que les pointeur sont égaux. Ceci évitera d'avoir deux comparateurs avec le registre "reg_STORE_QUEUE_PTR_READ"
    647                     if (index_store == reg_STORE_QUEUE_PTR_READ)
    648                       {
    649                         end_check    = true;
    650                         change_state = true;
    651                       }
     664//                    _load_queue[index_load_queue]._store_queue_ptr_write --;
     665                    _load_queue[index_load_queue]._store_queue_ptr_write = store_queue_ptr_write; // because the index store have be decrease
     666                    _load_queue[index_load_queue]._store_queue_empty     = store_queue_empty; // because the index store have be decrease
     667
     668                    // FIXME : peut n'est pas obliger de faire cette comparaison. Au prochain cycle on le détectera que les pointeur sont égaux. Ceci évitera d'avoir deux comparateurs avec le registre "store_queue_ptr_read"
    652669                  }
    653670
     
    657674                    log_printf(TRACE,Load_store_unit,FUNCTION,"              * end_check : %d",end_check);
    658675
    659                     log_printf(TRACE,Load_store_unit,FUNCTION,"                * state old : %s",toString(_load_queue[index_load]._state).c_str());
    660 
    661                     switch (_load_queue[index_load]._state)
     676                    log_printf(TRACE,Load_store_unit,FUNCTION,"                * state old : %s",toString(_load_queue[index_load_queue]._state).c_str());
     677
     678                    switch (_load_queue[index_load_queue]._state)
    662679                      {
    663680                      case LOAD_QUEUE_WAIT_CHECK   :
    664681                        {
    665682                          if (end_check)
    666                             _load_queue[index_load]._state = LOAD_QUEUE_WAIT  ;
     683                            _load_queue[index_load_queue]._state = LOAD_QUEUE_WAIT  ;
    667684                          break;
    668685                        }
     
    670687                        {
    671688                          if (end_check)
    672                             _load_queue[index_load]._state = LOAD_QUEUE_COMMIT;
     689                            _load_queue[index_load_queue]._state = LOAD_QUEUE_COMMIT;
    673690                          else
    674                             _load_queue[index_load]._state = LOAD_QUEUE_CHECK; // No commit : check hit and no end
     691                            _load_queue[index_load_queue]._state = LOAD_QUEUE_CHECK; // No commit : check hit and no end
    675692                          break;
    676693                        }
     
    678695                        {
    679696                          if (end_check)
    680                             _load_queue[index_load]._state     = LOAD_QUEUE_COMMIT;
     697                            _load_queue[index_load_queue]._state     = LOAD_QUEUE_COMMIT;
    681698
    682699                          // check find a bypass. A speculative load have been committed : report a speculation miss.
    683                           if ((_load_queue[index_load]._check_hit != 0) and
    684                               (_load_queue[index_load]._write_rd  == 0) // is commit
     700                          if ((_load_queue[index_load_queue]._check_hit != 0) and
     701                              (_load_queue[index_load_queue]._write_rd  == 0) // is commit
    685702                              )
    686703                            {
    687                               _load_queue[index_load]._exception = EXCEPTION_MEMORY_MISS_SPECULATION;
    688                               _load_queue[index_load]._write_rd  = 1; // write the good result
     704                              _load_queue[index_load_queue]._exception = EXCEPTION_MEMORY_MISS_SPECULATION;
     705                              _load_queue[index_load_queue]._write_rd  = 1; // write the good result
    689706
    690707#ifdef STATISTICS
     
    698715                      default : break;
    699716                      }
    700                     log_printf(TRACE,Load_store_unit,FUNCTION,"                * state new : %s",toString(_load_queue[index_load]._state).c_str());
    701                     log_printf(TRACE,Load_store_unit,FUNCTION,"                * exception : %d",_load_queue[index_load]._exception);
    702 
    703                     if (end_check)
     717                    log_printf(TRACE,Load_store_unit,FUNCTION,"                * state new : %s",toString(_load_queue[index_load_queue]._state).c_str());
     718                    log_printf(TRACE,Load_store_unit,FUNCTION,"                * exception : %d",_load_queue[index_load_queue]._exception);
     719
     720                    if (end_check//  and not store_queue_empty
     721                        )
    704722                      {
    705723                        log_printf(TRACE,Load_store_unit,FUNCTION,"                * end check, decrease all nb_check");
    706724                       
    707                         uint32_t i=index_store;
    708                         while (i!=reg_STORE_QUEUE_PTR_READ)
     725                        uint32_t i=store_queue_ptr_write;
     726                        while (i!=store_queue_ptr_read)
    709727                          {
    710728                            i=((i==0)?_param->_size_store_queue:i)-1;
     
    714732                              throw ERRORMORPHEO(FUNCTION,_("reg_STORE_QUEUE_NB_CHECK must be > 0\n"));
    715733#endif
    716                            
     734                           
    717735                            reg_STORE_QUEUE_NB_CHECK [i] --;
     736
     737                            log_printf(TRACE,Load_store_unit,FUNCTION,"              * reg_STORE_QUEUE_NB_CHECK 2 [%d] <- %d", i,reg_STORE_QUEUE_NB_CHECK [i]);
     738
    718739                            //i=(i+1)%_param->_size_store_queue;
    719740                          }
     741                       
     742                        _load_queue[index_load_queue]._store_queue_empty = true; // end of check
    720743                      }
    721744                  }
     
    856879                    _store_queue [index]._load_queue_ptr_write = (not _param->_have_port_load_queue_ptr)?0:PORT_READ(in_MEMORY_IN_LOAD_QUEUE_PTR_WRITE[internal_MEMORY_IN_PORT]);
    857880                    _store_queue [index]._address              = address;
     881                    _store_queue [index]._send_commit          = false;
    858882
    859883                    // reordering data
     
    895919                _speculative_access_queue [index]._load_queue_ptr_write = (not _param->_have_port_load_queue_ptr)?0:PORT_READ(in_MEMORY_IN_LOAD_QUEUE_PTR_WRITE[internal_MEMORY_IN_PORT]);
    896920                _speculative_access_queue [index]._store_queue_ptr_write= PORT_READ(in_MEMORY_IN_STORE_QUEUE_PTR_WRITE[internal_MEMORY_IN_PORT]);
     921                _speculative_access_queue [index]._store_queue_ptr_read = PORT_READ(in_MEMORY_IN_STORE_QUEUE_PTR_READ [internal_MEMORY_IN_PORT]);
     922                _speculative_access_queue [index]._store_queue_empty    = PORT_READ(in_MEMORY_IN_STORE_QUEUE_EMPTY    [internal_MEMORY_IN_PORT]);
    897923                _speculative_access_queue [index]._address              = address;
    898924                // NOTE : is operation is a load, then they are a result and must write in the register file
     
    954980            bool         have_exception = (exception != EXCEPTION_MEMORY_NONE);
    955981            bool         need_check= false;
     982            Tlsq_ptr_t        store_queue_ptr_write = _speculative_access_queue [internal_SPECULATIVE_ACCESS_QUEUE_PTR_READ]._store_queue_ptr_write;
     983            Tlsq_ptr_t        store_queue_ptr_read  = _speculative_access_queue [internal_SPECULATIVE_ACCESS_QUEUE_PTR_READ]._store_queue_ptr_read ;
     984            Tcontrol_t        store_queue_empty     = _speculative_access_queue [internal_SPECULATIVE_ACCESS_QUEUE_PTR_READ]._store_queue_empty    ;
    956985           
    957986            if (have_exception)
     
    962991                  {
    963992                    // load and synchronisation
    964                     if (must_check(operation))
     993                    if (must_check(operation) and not store_queue_empty)
    965994                      {
    966995                        // load
    967996                        need_check = true;
     997                       
    968998                        _load_queue [ptr_write]._state = LOAD_QUEUE_WAIT_CHECK;
    969999                      }
     
    9841014            Tdcache_address_t address_lsb    = (address & _param->_mask_address_lsb);
    9851015            Tdcache_address_t check_hit_byte = gen_mask_not<Tdcache_address_t>(address_lsb+(memory_size(operation)>>3)-1,address_lsb) & _param->_mask_check_hit_byte;
    986             Tlsq_ptr_t        store_queue_ptr_write = _speculative_access_queue [internal_SPECULATIVE_ACCESS_QUEUE_PTR_READ]._store_queue_ptr_write;
    9871016
    9881017            log_printf(TRACE,Load_store_unit,FUNCTION,"    * address                 : 0x%.8x", address);
     
    9981027            _load_queue [ptr_write]._operation             = operation;
    9991028            _load_queue [ptr_write]._store_queue_ptr_write = store_queue_ptr_write;
     1029            _load_queue [ptr_write]._store_queue_ptr_read  = store_queue_ptr_read ;
     1030            _load_queue [ptr_write]._store_queue_empty     = store_queue_empty    ;
    10001031            _load_queue [ptr_write]._address               = address;
    10011032            _load_queue [ptr_write]._check_hit_byte        = check_hit_byte;
     
    10231054
    10241055            // Only load need check
    1025             if (need_check)
     1056            if (need_check//  and not store_queue_empty
     1057                )
    10261058//             if (is_operation_memory_load(_load_queue [ptr_write]._operation))
    10271059              {
    10281060                log_printf(TRACE,Load_store_unit,FUNCTION,"    * update nb_check");
    10291061                log_printf(TRACE,Load_store_unit,FUNCTION,"      *     store_queue_ptr_write : %d",store_queue_ptr_write);
     1062                log_printf(TRACE,Load_store_unit,FUNCTION,"      *     store_queue_ptr_read  : %d",store_queue_ptr_read );
     1063                log_printf(TRACE,Load_store_unit,FUNCTION,"      *     store_queue_empty     : %d",store_queue_empty    );
    10301064                log_printf(TRACE,Load_store_unit,FUNCTION,"      * reg_STORE_QUEUE_PTR_READ  : %d",reg_STORE_QUEUE_PTR_READ);
    10311065               
    10321066                uint32_t i=store_queue_ptr_write;
    1033                 while (i!=reg_STORE_QUEUE_PTR_READ)
     1067                while (i!=store_queue_ptr_read)
    10341068                  {
    10351069                    i=((i==0)?_param->_size_store_queue:i)-1;
     
    10381072                   
    10391073                    reg_STORE_QUEUE_NB_CHECK [i] ++;
     1074
     1075                    log_printf(TRACE,Load_store_unit,FUNCTION,"              * reg_STORE_QUEUE_NB_CHECK 3 [%d] <- %d", i,reg_STORE_QUEUE_NB_CHECK [i]);
    10401076                  }
    10411077              }
     
    10971133
    10981134                   
    1099                     uint32_t i=_load_queue[packet_id]._store_queue_ptr_write;
    1100                     while (i!=reg_STORE_QUEUE_PTR_READ)
    1101                       {
    1102                         i=((i==0)?_param->_size_store_queue:i)-1;
    1103                        
     1135                    log_printf(TRACE,Load_store_unit,FUNCTION,"      * store_queue_ptr_write : %d", _load_queue[packet_id]._store_queue_ptr_write);
     1136                    log_printf(TRACE,Load_store_unit,FUNCTION,"      * store_queue_ptr_read  : %d", _load_queue[packet_id]._store_queue_ptr_read );
     1137                    log_printf(TRACE,Load_store_unit,FUNCTION,"      * store_queue_empty     : %d", _load_queue[packet_id]._store_queue_empty    );
     1138
     1139                    if (not _load_queue[packet_id]._store_queue_empty)
     1140                      {
     1141                        uint32_t i=_load_queue[packet_id]._store_queue_ptr_write;
     1142                       
     1143                        while (i!=_load_queue[packet_id]._store_queue_ptr_read)
     1144                          {
     1145                            i=((i==0)?_param->_size_store_queue:i)-1;
     1146                           
    11041147#ifdef DEBUG
    1105                         if (reg_STORE_QUEUE_NB_CHECK [i] == 0)
    1106                           throw ERRORMORPHEO(FUNCTION,_("reg_STORE_QUEUE_NB_CHECK must be > 0\n"));
     1148                            if (reg_STORE_QUEUE_NB_CHECK [i] == 0)
     1149                              throw ERRORMORPHEO(FUNCTION,_("reg_STORE_QUEUE_NB_CHECK must be > 0\n"));
    11071150#endif
    1108                        
    1109                         reg_STORE_QUEUE_NB_CHECK [i] --;
    1110                         //i=(i+1)%_param->_size_store_queue;
    1111                       }
     1151                           
     1152                            reg_STORE_QUEUE_NB_CHECK [i] --;
     1153
     1154                            log_printf(TRACE,Load_store_unit,FUNCTION,"              * reg_STORE_QUEUE_NB_CHECK 4 [%d] <- %d", i,reg_STORE_QUEUE_NB_CHECK [i]);
     1155
     1156                            //i=(i+1)%_param->_size_store_queue;
     1157                          }
     1158                        _load_queue[packet_id]._store_queue_empty = true; // end of check
     1159
     1160                      }
    11121161                  }
    11131162                else
     
    11501199            uint32_t j = (reg_STORE_QUEUE_PTR_READ+i)%_param->_size_store_queue;
    11511200
    1152             log_printf(TRACE,Load_store_unit,FUNCTION,"    [%.4d] %.4d %.4d %.4d, %.4d, %.4d, %.4d, %.8x %.8x, %.2d, %.2d %s",
     1201            log_printf(TRACE,Load_store_unit,FUNCTION,"    [%.4d] %.4d %.4d %.4d, %.4d, %.4d, %.4d, %.8x %.8x, %.2d %.1d, %.2d %s",
    11531202                       j,
    11541203                       _store_queue[j]._context_id          ,
     
    11631212                     //_store_queue[j]._num_reg_rd          ,
    11641213                       _store_queue[j]._exception           ,
     1214                       _store_queue[j]._send_commit         ,
    11651215                       reg_STORE_QUEUE_NB_CHECK  [j]        ,
    11661216                       toString(_store_queue[j]._state).c_str());
     
    11741224            uint32_t j = (*_speculative_access_queue_control)[i];
    11751225
    1176             log_printf(TRACE,Load_store_unit,FUNCTION,"    [%.4d] %.4d %.4d %.4d, %.4d, %.4d, %.4d %.4d, %.8x, %.1d %.4d, %.2d, %s",
     1226            log_printf(TRACE,Load_store_unit,FUNCTION,"    [%.4d] %.4d %.4d %.4d, %.4d, %.4d, %.4d %.4d %.4d %.1d, %.8x, %.1d %.4d, %.2d, %s",
    11771227                       j,
    11781228                       _speculative_access_queue[j]._context_id          ,
     
    11831233                       _speculative_access_queue[j]._load_queue_ptr_write,
    11841234                       _speculative_access_queue[j]._store_queue_ptr_write,
     1235                       _speculative_access_queue[j]._store_queue_ptr_read ,
     1236                       _speculative_access_queue[j]._store_queue_empty    ,
    11851237                       _speculative_access_queue[j]._address             ,
    11861238                       _speculative_access_queue[j]._write_rd            ,
     
    11981250            uint32_t j = i;
    11991251
    1200             log_printf(TRACE,Load_store_unit,FUNCTION,"    [%.4d] %.4d %.4d %.4d, %.4d, %.4d, %.4d, %.8x %.1x %.1d %.2d %.1d %.2d, %.8x, %.1d %.4d, %.2d, %s",
     1252            log_printf(TRACE,Load_store_unit,FUNCTION,"    [%.4d] %.4d %.4d %.4d, %.4d, %.4d, %.4d %.4d %.1d, %.8x %.1x %.1d %.2d %.1d %.2d, %.8x, %.1d %.4d, %.2d, %s",
    12011253                       j,
    12021254                       _load_queue[j]._context_id          ,
     
    12061258                       _load_queue[j]._operation           ,
    12071259                       _load_queue[j]._store_queue_ptr_write,
     1260                       _load_queue[j]._store_queue_ptr_read ,
     1261                       _load_queue[j]._store_queue_empty    ,
    12081262                       _load_queue[j]._address             ,
    12091263                       _load_queue[j]._check_hit_byte      ,
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Read_queue/include/Read_queue.h

    r88 r122  
    7373  public    : SC_IN (Ttype_t           )    *  in_READ_QUEUE_IN_TYPE                 ;
    7474  public    : SC_IN (Tlsq_ptr_t        )    *  in_READ_QUEUE_IN_STORE_QUEUE_PTR_WRITE;
     75  public    : SC_IN (Tlsq_ptr_t        )    *  in_READ_QUEUE_IN_STORE_QUEUE_PTR_READ ;
     76  public    : SC_IN (Tcontrol_t        )    *  in_READ_QUEUE_IN_STORE_QUEUE_EMPTY    ;
    7577  public    : SC_IN (Tlsq_ptr_t        )    *  in_READ_QUEUE_IN_LOAD_QUEUE_PTR_WRITE ;
    7678  public    : SC_IN (Tcontrol_t        )    *  in_READ_QUEUE_IN_HAS_IMMEDIAT         ;
     
    98100  public    : SC_OUT(Ttype_t           )    * out_READ_QUEUE_OUT_TYPE                 ;
    99101  public    : SC_OUT(Tlsq_ptr_t        )    * out_READ_QUEUE_OUT_STORE_QUEUE_PTR_WRITE;
     102  public    : SC_OUT(Tlsq_ptr_t        )    * out_READ_QUEUE_OUT_STORE_QUEUE_PTR_READ ;
     103  public    : SC_OUT(Tcontrol_t        )    * out_READ_QUEUE_OUT_STORE_QUEUE_EMPTY    ;
    100104  public    : SC_OUT(Tlsq_ptr_t        )    * out_READ_QUEUE_OUT_LOAD_QUEUE_PTR_WRITE ;
    101105  public    : SC_OUT(Tcontrol_t        )    * out_READ_QUEUE_OUT_HAS_IMMEDIAT         ;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Read_queue/include/Types.h

    r117 r122  
    2929  public    : Ttype_t            _type         ;
    3030  public    : Tlsq_ptr_t         _store_queue_ptr_write;
     31  public    : Tlsq_ptr_t         _store_queue_ptr_read ;
     32  public    : Tcontrol_t         _store_queue_empty    ;
    3133  public    : Tlsq_ptr_t         _load_queue_ptr_write;
    3234  public    : Tcontrol_t         _has_immediat ;
     
    5355                    << " * _type                  : " << toString(x._type         ) << std::endl
    5456                    << " * _store_queue_ptr_write : " << toString(x._store_queue_ptr_write) << std::endl
     57                    << " * _store_queue_ptr_read  : " << toString(x._store_queue_ptr_read ) << std::endl
     58                    << " * _store_queue_empty     : " << toString(x._store_queue_empty    ) << std::endl
    5559                    << " * _load_queue_ptr_write  : " << toString(x._load_queue_ptr_write ) << std::endl
    5660                    << " * _has_immediat          : " << toString(x._has_immediat ) << std::endl
     
    8185  public    : Ttype_t            _type         ;
    8286  public    : Tlsq_ptr_t         _store_queue_ptr_write;
     87  public    : Tlsq_ptr_t         _store_queue_ptr_read ;
     88  public    : Tcontrol_t         _store_queue_empty    ;
    8389  public    : Tlsq_ptr_t         _load_queue_ptr_write;
    8490  public    : Tcontrol_t         _has_immediat ;
     
    117123      _type                  = x._type         ;
    118124      _store_queue_ptr_write = x._store_queue_ptr_write;
     125      _store_queue_ptr_read  = x._store_queue_ptr_read ;
     126      _store_queue_empty     = x._store_queue_empty    ;
    119127      _load_queue_ptr_write  = x._load_queue_ptr_write ;
    120128      _has_immediat          = x._has_immediat ;
     
    157165                    << " * _type                  : " << x._type         << std::endl
    158166                    << " * _store_queue_ptr_write : " << toString(x._store_queue_ptr_write) << std::endl
     167                    << " * _store_queue_ptr_read  : " << toString(x._store_queue_ptr_read ) << std::endl
     168                    << " * _store_queue_empty     : " << toString(x._store_queue_empty    ) << std::endl
    159169                    << " * _load_queue_ptr_write  : " << toString(x._load_queue_ptr_write ) << std::endl
    160170                    << " * _has_immediat          : " << x._has_immediat << std::endl
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Read_queue/src/Read_queue_allocation.cpp

    r112 r122  
    6262      ALLOC0_SIGNAL_IN ( in_READ_QUEUE_IN_TYPE                 ,"type"                 ,Ttype_t           ,_param->_size_type            );
    6363      ALLOC0_SIGNAL_IN ( in_READ_QUEUE_IN_STORE_QUEUE_PTR_WRITE,"store_queue_ptr_write",Tlsq_ptr_t        ,_param->_size_store_queue_ptr);
     64      ALLOC0_SIGNAL_IN ( in_READ_QUEUE_IN_STORE_QUEUE_PTR_READ ,"store_queue_ptr_read" ,Tlsq_ptr_t        ,_param->_size_store_queue_ptr);
     65      ALLOC0_SIGNAL_IN ( in_READ_QUEUE_IN_STORE_QUEUE_EMPTY    ,"store_queue_empty"    ,Tcontrol_t        ,1);
    6466      ALLOC0_SIGNAL_IN ( in_READ_QUEUE_IN_LOAD_QUEUE_PTR_WRITE ,"load_queue_ptr_write" ,Tlsq_ptr_t        ,_param->_size_load_queue_ptr);
    6567      ALLOC0_SIGNAL_IN ( in_READ_QUEUE_IN_HAS_IMMEDIAT         ,"has_immediat"         ,Tcontrol_t        ,1                             );
     
    9294      ALLOC0_SIGNAL_OUT(out_READ_QUEUE_OUT_TYPE                  ,"type"                 ,Ttype_t           ,_param->_size_type             );
    9395      ALLOC0_SIGNAL_OUT(out_READ_QUEUE_OUT_STORE_QUEUE_PTR_WRITE ,"store_queue_ptr_write",Tlsq_ptr_t        , _param->_size_store_queue_ptr );
     96      ALLOC0_SIGNAL_OUT(out_READ_QUEUE_OUT_STORE_QUEUE_PTR_READ  ,"store_queue_ptr_read" ,Tlsq_ptr_t        , _param->_size_store_queue_ptr );
     97      ALLOC0_SIGNAL_OUT(out_READ_QUEUE_OUT_STORE_QUEUE_EMPTY     ,"store_queue_empty"    ,Tcontrol_t        ,1                              );
    9498      ALLOC0_SIGNAL_OUT(out_READ_QUEUE_OUT_LOAD_QUEUE_PTR_WRITE  ,"load_queue_ptr_write" ,Tlsq_ptr_t        , _param->_size_load_queue_ptr  );
    9599      ALLOC0_SIGNAL_OUT(out_READ_QUEUE_OUT_HAS_IMMEDIAT          ,"has_immediat"         ,Tcontrol_t        ,1                              );
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Read_queue/src/Read_queue_deallocation.cpp

    r112 r122  
    3838        DELETE0_SIGNAL( in_READ_QUEUE_IN_TYPE                  ,_param->_size_type            );
    3939        DELETE0_SIGNAL( in_READ_QUEUE_IN_STORE_QUEUE_PTR_WRITE ,_param->_size_store_queue_ptr );
     40        DELETE0_SIGNAL( in_READ_QUEUE_IN_STORE_QUEUE_PTR_READ  ,_param->_size_store_queue_ptr );
     41        DELETE0_SIGNAL( in_READ_QUEUE_IN_STORE_QUEUE_EMPTY     ,1                             );
    4042        DELETE0_SIGNAL( in_READ_QUEUE_IN_LOAD_QUEUE_PTR_WRITE  ,_param->_size_load_queue_ptr  );
    4143        DELETE0_SIGNAL( in_READ_QUEUE_IN_HAS_IMMEDIAT          ,1                             );
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Read_queue/src/Read_queue_genMoore.cpp

    r111 r122  
    4545    PORT_WRITE (out_READ_QUEUE_OUT_TYPE        , _queue_head->_type        );
    4646    PORT_WRITE (out_READ_QUEUE_OUT_STORE_QUEUE_PTR_WRITE, _queue_head->_store_queue_ptr_write);
     47    PORT_WRITE (out_READ_QUEUE_OUT_STORE_QUEUE_PTR_READ , _queue_head->_store_queue_ptr_read );
     48    PORT_WRITE (out_READ_QUEUE_OUT_STORE_QUEUE_EMPTY    , _queue_head->_store_queue_empty    );
    4749    if (_param->_have_port_load_queue_ptr)
    4850    PORT_WRITE (out_READ_QUEUE_OUT_LOAD_QUEUE_PTR_WRITE , _queue_head->_load_queue_ptr_write );
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Read_queue/src/Read_queue_transition.cpp

    r117 r122  
    7575            entry->_type         = PORT_READ(in_READ_QUEUE_IN_TYPE        );
    7676            entry->_store_queue_ptr_write = PORT_READ(in_READ_QUEUE_IN_STORE_QUEUE_PTR_WRITE);
     77            entry->_store_queue_ptr_read  = PORT_READ(in_READ_QUEUE_IN_STORE_QUEUE_PTR_READ );
     78            entry->_store_queue_empty     = PORT_READ(in_READ_QUEUE_IN_STORE_QUEUE_EMPTY    );
    7779            if (_param->_have_port_load_queue_ptr)
    7880            entry->_load_queue_ptr_write  = PORT_READ(in_READ_QUEUE_IN_LOAD_QUEUE_PTR_WRITE );
     
    151153        if (_queue->size()>0)
    152154          {
    153             log_printf(TRACE,Read_queue,FUNCTION,"    * [%.4d] %.2d %.2d %.2d %.4d, %.2d %.3d, %.2d %.2d, %.1d %.8x, %.1d %.1d %.4d %.1d %.8x, %.1d %.1d %.4d %.1d %.8x, %.1d %.1d %.4d %.1d %.2x, %.1d %.4d, %.1d %.4d (%s)",
     155            log_printf(TRACE,Read_queue,FUNCTION,"    * [%.4d] %.2d %.2d %.2d %.4d, %.2d %.3d, %.2d %.2d %.1d %.2d, %.1d %.8x, %.1d %.1d %.4d %.1d %.8x, %.1d %.1d %.4d %.1d %.8x, %.1d %.1d %.4d %.1d %.2x, %.1d %.4d, %.1d %.4d (%s)",
    154156                       0,
    155157
     
    163165
    164166                       _queue_head->_store_queue_ptr_write,
     167                       _queue_head->_store_queue_ptr_read ,
     168                       _queue_head->_store_queue_empty    ,
    165169                       _queue_head->_load_queue_ptr_write ,
    166170
     
    201205            for (;it!=_queue->end(); ++it)
    202206              {
    203                 log_printf(TRACE,Read_queue,FUNCTION,"    * [%.4d] %.2d %.2d %.2d %.4d, %.2d %.3d, %.2d %.2d, %.1d %.8x, %.1d   %.4d           , %.1d   %.4d           , %.1d   %.4d     , %.1d %.4d, %.1d %.4d (%s)",
     207                log_printf(TRACE,Read_queue,FUNCTION,"    * [%.4d] %.2d %.2d %.2d %.4d, %.2d %.3d, %.2d %.2d %.1d %.2d, %.1d %.8x, %.1d   %.4d           , %.1d   %.4d           , %.1d   %.4d     , %.1d %.4d, %.1d %.4d (%s)",
    204208                           i,
    205209                           
     
    213217                           
    214218                           (*it)->_store_queue_ptr_write,
     219                           (*it)->_store_queue_ptr_read ,
     220                           (*it)->_store_queue_empty    ,
    215221                           (*it)->_load_queue_ptr_write ,
    216222                           
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/include/Reservation_station.h

    r82 r122  
    7474  public    : SC_IN (Ttype_t           )    *  in_INSERT_TYPE           ;
    7575  public    : SC_IN (Tlsq_ptr_t        )    *  in_INSERT_STORE_QUEUE_PTR_WRITE;
     76  public    : SC_IN (Tlsq_ptr_t        )    *  in_INSERT_STORE_QUEUE_PTR_READ ;
     77  public    : SC_IN (Tcontrol_t        )    *  in_INSERT_STORE_QUEUE_EMPTY    ;
    7678  public    : SC_IN (Tlsq_ptr_t        )    *  in_INSERT_LOAD_QUEUE_PTR_WRITE ;
    7779  public    : SC_IN (Tcontrol_t        )    *  in_INSERT_HAS_IMMEDIAT   ;
     
    104106  public    : SC_OUT(Ttype_t           )   ** out_RETIRE_TYPE           ;
    105107  public    : SC_OUT(Tlsq_ptr_t        )   ** out_RETIRE_STORE_QUEUE_PTR_WRITE;
     108  public    : SC_OUT(Tlsq_ptr_t        )   ** out_RETIRE_STORE_QUEUE_PTR_READ ;
     109  public    : SC_OUT(Tcontrol_t        )   ** out_RETIRE_STORE_QUEUE_EMPTY    ;
    106110  public    : SC_OUT(Tlsq_ptr_t        )   ** out_RETIRE_LOAD_QUEUE_PTR_WRITE ;
    107111  public    : SC_OUT(Tcontrol_t        )   ** out_RETIRE_HAS_IMMEDIAT   ;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/include/Types.h

    r82 r122  
    2929  public    : Ttype_t            _type        ;
    3030  public    : Tlsq_ptr_t         _store_queue_ptr_write;
     31  public    : Tlsq_ptr_t         _store_queue_ptr_read ;
     32  public    : Tcontrol_t         _store_queue_empty    ;
    3133  public    : Tlsq_ptr_t         _load_queue_ptr_write ;
    3234  public    : Tcontrol_t         _has_immediat;
     
    5961                    << " * _type                  : " << toString(x._type           ) << std::endl
    6062                    << " * _store_queue_ptr_write : " << toString(x._store_queue_ptr_write) << std::endl
     63                    << " * _store_queue_ptr_read  : " << toString(x._store_queue_ptr_read ) << std::endl
     64                    << " * _store_queue_empty     : " << toString(x._store_queue_empty    ) << std::endl
    6165                    << " * _load_queue_ptr_write  : " << toString(x._load_queue_ptr_write ) << std::endl
    6266                    << " * _has_immediat          : " << toString(x._has_immediat   ) << std::endl
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/src/Reservation_station_allocation.cpp

    r112 r122  
    6464       ALLOC0_SIGNAL_IN ( in_INSERT_TYPE                 ,"type"                 ,Ttype_t           ,_param->_size_type            );
    6565       ALLOC0_SIGNAL_IN ( in_INSERT_STORE_QUEUE_PTR_WRITE,"store_queue_ptr_write",Tlsq_ptr_t        ,_param->_size_store_queue_ptr );
     66       ALLOC0_SIGNAL_IN ( in_INSERT_STORE_QUEUE_PTR_READ ,"store_queue_ptr_read" ,Tlsq_ptr_t        ,_param->_size_store_queue_ptr );
     67       ALLOC0_SIGNAL_IN ( in_INSERT_STORE_QUEUE_EMPTY    ,"store_queue_empty"    ,Tcontrol_t        ,1                             );
    6668       ALLOC0_SIGNAL_IN ( in_INSERT_LOAD_QUEUE_PTR_WRITE ,"load_queue_ptr_write" ,Tlsq_ptr_t        ,_param->_size_load_queue_ptr  );
    6769       ALLOC0_SIGNAL_IN ( in_INSERT_HAS_IMMEDIAT         ,"has_immediat"         ,Tcontrol_t        ,1                             );
     
    100102       ALLOC1_SIGNAL_OUT(out_RETIRE_TYPE                 ,"type"                 ,Ttype_t           ,_param->_size_type);
    101103       ALLOC1_SIGNAL_OUT(out_RETIRE_STORE_QUEUE_PTR_WRITE,"store_queue_ptr_write",Tlsq_ptr_t        ,_param->_size_store_queue_ptr);
     104       ALLOC1_SIGNAL_OUT(out_RETIRE_STORE_QUEUE_PTR_READ ,"store_queue_ptr_read" ,Tlsq_ptr_t        ,_param->_size_store_queue_ptr);
     105       ALLOC1_SIGNAL_OUT(out_RETIRE_STORE_QUEUE_EMPTY    ,"store_queue_empty"    ,Tcontrol_t        ,1);
    102106       ALLOC1_SIGNAL_OUT(out_RETIRE_LOAD_QUEUE_PTR_WRITE ,"load_queue_ptr_write" ,Tlsq_ptr_t        ,_param->_size_load_queue_ptr );
    103107       ALLOC1_SIGNAL_OUT(out_RETIRE_HAS_IMMEDIAT         ,"has_immediat"         ,Tcontrol_t        ,1);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/src/Reservation_station_deallocation.cpp

    r112 r122  
    4343        DELETE0_SIGNAL( in_INSERT_TYPE                 ,_param->_size_type            );
    4444        DELETE0_SIGNAL( in_INSERT_STORE_QUEUE_PTR_WRITE,_param->_size_store_queue_ptr );
     45        DELETE0_SIGNAL( in_INSERT_STORE_QUEUE_PTR_READ ,_param->_size_store_queue_ptr );
     46        DELETE0_SIGNAL( in_INSERT_STORE_QUEUE_EMPTY    ,1);
    4547        DELETE0_SIGNAL( in_INSERT_LOAD_QUEUE_PTR_WRITE ,_param->_size_load_queue_ptr  );
    4648        DELETE0_SIGNAL( in_INSERT_HAS_IMMEDIAT         ,1                             );
     
    7274        DELETE1_SIGNAL(out_RETIRE_TYPE                 ,_param->_nb_inst_retire,_param->_size_type);
    7375        DELETE1_SIGNAL(out_RETIRE_STORE_QUEUE_PTR_WRITE,_param->_nb_inst_retire,_param->_size_store_queue_ptr);
     76        DELETE1_SIGNAL(out_RETIRE_STORE_QUEUE_PTR_READ ,_param->_nb_inst_retire,_param->_size_store_queue_ptr);
     77        DELETE1_SIGNAL(out_RETIRE_STORE_QUEUE_EMPTY    ,_param->_nb_inst_retire,1);
    7478        DELETE1_SIGNAL(out_RETIRE_LOAD_QUEUE_PTR_WRITE ,_param->_nb_inst_retire,_param->_size_load_queue_ptr );
    7579        DELETE1_SIGNAL(out_RETIRE_HAS_IMMEDIAT         ,_param->_nb_inst_retire,1);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/src/Reservation_station_genMoore.cpp

    r110 r122  
    113113            PORT_WRITE(out_RETIRE_TYPE          [i],_queue[index_find]._type);
    114114            PORT_WRITE(out_RETIRE_STORE_QUEUE_PTR_WRITE [i],_queue[index_find]._store_queue_ptr_write);
     115            PORT_WRITE(out_RETIRE_STORE_QUEUE_PTR_READ  [i],_queue[index_find]._store_queue_ptr_read );
     116            PORT_WRITE(out_RETIRE_STORE_QUEUE_EMPTY     [i],_queue[index_find]._store_queue_empty    );
    115117            if (_param->_have_port_load_queue_ptr)
    116118            PORT_WRITE(out_RETIRE_LOAD_QUEUE_PTR_WRITE  [i],_queue[index_find]._load_queue_ptr_write );
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/src/Reservation_station_transition.cpp

    r118 r122  
    2626      for (uint32_t it_dump=0;it_dump<_param->_size_queue; it_dump++)   \
    2727        if (_queue_valid [it_dump])                                     \
    28           log_printf(TRACE,Reservation_station,FUNCTION,"    * [%.4d] %.2d %.2d %.2d %.4d, %.2d %.3d, %.2d %.2d, %.1d %.8x, %.4d %.1d %.8x, %.4d %.1d %.8x, %.4d %.1d %.2x, %.1d %.4d, %.1d %.4d (%s)", \
     28          log_printf(TRACE,Reservation_station,FUNCTION,"    * [%.4d] %.2d %.2d %.2d %.4d, %.2d %.3d, %.2d %.2d %.1d %.2d, %.1d %.8x, %.4d %.1d %.8x, %.4d %.1d %.8x, %.4d %.1d %.2x, %.1d %.4d, %.1d %.4d (%s)", \
    2929                     it_dump,                                           \
    3030                     _queue[it_dump]._context_id           ,            \
     
    3535                     _queue[it_dump]._operation            ,            \
    3636                     _queue[it_dump]._store_queue_ptr_write,            \
     37                     _queue[it_dump]._store_queue_ptr_read ,            \
     38                     _queue[it_dump]._store_queue_empty    ,            \
    3739                     _queue[it_dump]._load_queue_ptr_write ,            \
    3840                     _queue[it_dump]._has_immediat         ,            \
     
    6163      for (uint32_t it_dump=0;it_dump<_param->_size_queue; it_dump++)   \
    6264        if (it_dump < _queue_control->nb_elt())                         \
    63           log_printf(TRACE,Reservation_station,FUNCTION,"    * [%.4d] %.2d %.2d %.2d %.4d, %.2d %.3d, %.2d %.2d, %.1d %.8x, %.4d %.1d %.8x, %.4d %.1d %.8x, %.4d %.1d %.2x, %.1d %.4d, %.1d %.4d (%s)", \
     65          log_printf(TRACE,Reservation_station,FUNCTION,"    * [%.4d] %.2d %.2d %.2d %.4d, %.2d %.3d, %.2d %.2d %.1d %.2d, %.1d %.8x, %.4d %.1d %.8x, %.4d %.1d %.8x, %.4d %.1d %.2x, %.1d %.4d, %.1d %.4d (%s)", \
    6466                     (*_queue_control)[it_dump],                        \
    6567                     _queue[(*_queue_control)[it_dump]]._context_id           , \
     
    7072                     _queue[(*_queue_control)[it_dump]]._operation            , \
    7173                     _queue[(*_queue_control)[it_dump]]._store_queue_ptr_write, \
     74                     _queue[(*_queue_control)[it_dump]]._store_queue_ptr_read , \
     75                     _queue[(*_queue_control)[it_dump]]._store_queue_empty    , \
    7276                     _queue[(*_queue_control)[it_dump]]._load_queue_ptr_write , \
    7377                     _queue[(*_queue_control)[it_dump]]._has_immediat         , \
     
    292296            _queue[index]._type            = PORT_READ(in_INSERT_TYPE           );
    293297            _queue[index]._store_queue_ptr_write = PORT_READ(in_INSERT_STORE_QUEUE_PTR_WRITE);
     298            _queue[index]._store_queue_ptr_read  = PORT_READ(in_INSERT_STORE_QUEUE_PTR_READ );
     299            _queue[index]._store_queue_empty     = PORT_READ(in_INSERT_STORE_QUEUE_EMPTY    );
    294300            if (_param->_have_port_load_queue_ptr)
    295301            _queue[index]._load_queue_ptr_write  = PORT_READ(in_INSERT_LOAD_QUEUE_PTR_WRITE );
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/include/Read_unit.h

    r82 r122  
    7474  public    : SC_IN (Ttype_t           )    *  in_READ_UNIT_IN_TYPE                 ;
    7575  public    : SC_IN (Tlsq_ptr_t        )    *  in_READ_UNIT_IN_STORE_QUEUE_PTR_WRITE;
     76  public    : SC_IN (Tlsq_ptr_t        )    *  in_READ_UNIT_IN_STORE_QUEUE_PTR_READ ;
     77  public    : SC_IN (Tcontrol_t        )    *  in_READ_UNIT_IN_STORE_QUEUE_EMPTY    ;
    7678  public    : SC_IN (Tlsq_ptr_t        )    *  in_READ_UNIT_IN_LOAD_QUEUE_PTR_WRITE ;
    7779  public    : SC_IN (Tcontrol_t        )    *  in_READ_UNIT_IN_HAS_IMMEDIAT         ;
     
    98100  public    : SC_OUT(Ttype_t           )   ** out_READ_UNIT_OUT_TYPE                 ;
    99101  public    : SC_OUT(Tlsq_ptr_t        )   ** out_READ_UNIT_OUT_STORE_QUEUE_PTR_WRITE;
     102  public    : SC_OUT(Tlsq_ptr_t        )   ** out_READ_UNIT_OUT_STORE_QUEUE_PTR_READ ;
     103  public    : SC_OUT(Tcontrol_t        )   ** out_READ_UNIT_OUT_STORE_QUEUE_EMPTY    ;
    100104  public    : SC_OUT(Tlsq_ptr_t        )   ** out_READ_UNIT_OUT_LOAD_QUEUE_PTR_WRITE ;
    101105  public    : SC_OUT(Tcontrol_t        )   ** out_READ_UNIT_OUT_HAS_IMMEDIAT         ;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/src/Read_unit_allocation.cpp

    r112 r122  
    6868       ALLOC0_SIGNAL_IN ( in_READ_UNIT_IN_TYPE                 ,"type"                 ,Ttype_t           ,_param->_size_type         );
    6969       ALLOC0_SIGNAL_IN ( in_READ_UNIT_IN_STORE_QUEUE_PTR_WRITE,"store_queue_ptr_write",Tlsq_ptr_t        ,_param->_size_store_queue_ptr);
     70       ALLOC0_SIGNAL_IN ( in_READ_UNIT_IN_STORE_QUEUE_PTR_READ ,"store_queue_ptr_read" ,Tlsq_ptr_t        ,_param->_size_store_queue_ptr);
     71       ALLOC0_SIGNAL_IN ( in_READ_UNIT_IN_STORE_QUEUE_EMPTY    ,"store_queue_empty"    ,Tcontrol_t        ,1);
    7072       ALLOC0_SIGNAL_IN ( in_READ_UNIT_IN_LOAD_QUEUE_PTR_WRITE ,"load_queue_ptr_write" ,Tlsq_ptr_t        ,_param->_size_load_queue_ptr);
    7173       ALLOC0_SIGNAL_IN ( in_READ_UNIT_IN_HAS_IMMEDIAT         ,"has_immediat"         ,Tcontrol_t        ,1);
     
    98100       ALLOC1_SIGNAL_OUT(out_READ_UNIT_OUT_TYPE                 ,"type"                 ,Ttype_t           ,_param->_size_type            );
    99101       ALLOC1_SIGNAL_OUT(out_READ_UNIT_OUT_STORE_QUEUE_PTR_WRITE,"store_queue_ptr_write",Tlsq_ptr_t        ,_param->_size_store_queue_ptr);
     102       ALLOC1_SIGNAL_OUT(out_READ_UNIT_OUT_STORE_QUEUE_PTR_READ ,"store_queue_ptr_read" ,Tlsq_ptr_t        ,_param->_size_store_queue_ptr);
     103       ALLOC1_SIGNAL_OUT(out_READ_UNIT_OUT_STORE_QUEUE_EMPTY    ,"store_queue_empty"    ,Tcontrol_t        ,1);
    100104       ALLOC1_SIGNAL_OUT(out_READ_UNIT_OUT_LOAD_QUEUE_PTR_WRITE ,"load_queue_ptr_write" ,Tlsq_ptr_t        ,_param->_size_load_queue_ptr);
    101105       ALLOC1_SIGNAL_OUT(out_READ_UNIT_OUT_HAS_IMMEDIAT         ,"has_immediat"         ,Tcontrol_t        ,1                             );
     
    268272         _component->port_map(name, "in_READ_QUEUE_IN_TYPE"                 ,dest, "in_READ_UNIT_IN_TYPE"                 );
    269273         _component->port_map(name, "in_READ_QUEUE_IN_STORE_QUEUE_PTR_WRITE",dest, "in_READ_UNIT_IN_STORE_QUEUE_PTR_WRITE");
     274         _component->port_map(name, "in_READ_QUEUE_IN_STORE_QUEUE_PTR_READ" ,dest, "in_READ_UNIT_IN_STORE_QUEUE_PTR_READ" );
     275         _component->port_map(name, "in_READ_QUEUE_IN_STORE_QUEUE_EMPTY"    ,dest, "in_READ_UNIT_IN_STORE_QUEUE_EMPTY"    );
    270276         if (_param->_have_port_load_queue_ptr)
    271277         _component->port_map(name, "in_READ_QUEUE_IN_LOAD_QUEUE_PTR_WRITE" ,dest, "in_READ_UNIT_IN_LOAD_QUEUE_PTR_WRITE" );
     
    305311         _component->port_map(name,"out_READ_QUEUE_OUT_TYPE"                 ,dest, "in_INSERT_TYPE"                 );
    306312         _component->port_map(name,"out_READ_QUEUE_OUT_STORE_QUEUE_PTR_WRITE",dest, "in_INSERT_STORE_QUEUE_PTR_WRITE");
     313         _component->port_map(name,"out_READ_QUEUE_OUT_STORE_QUEUE_PTR_READ" ,dest, "in_INSERT_STORE_QUEUE_PTR_READ" );
     314         _component->port_map(name,"out_READ_QUEUE_OUT_STORE_QUEUE_EMPTY"    ,dest, "in_INSERT_STORE_QUEUE_EMPTY"    );
    307315         if (_param->_have_port_load_queue_ptr)
    308316         _component->port_map(name,"out_READ_QUEUE_OUT_LOAD_QUEUE_PTR_WRITE" ,dest, "in_INSERT_LOAD_QUEUE_PTR_WRITE" );
     
    429437         _component->port_map(name, "in_INSERT_TYPE"                 ,dest,"out_READ_QUEUE_OUT_TYPE"                 );
    430438         _component->port_map(name, "in_INSERT_STORE_QUEUE_PTR_WRITE",dest,"out_READ_QUEUE_OUT_STORE_QUEUE_PTR_WRITE");
     439         _component->port_map(name, "in_INSERT_STORE_QUEUE_PTR_READ" ,dest,"out_READ_QUEUE_OUT_STORE_QUEUE_PTR_READ" );
     440         _component->port_map(name, "in_INSERT_STORE_QUEUE_EMPTY"    ,dest,"out_READ_QUEUE_OUT_STORE_QUEUE_EMPTY"    );
    431441         if (_param->_have_port_load_queue_ptr)
    432442         _component->port_map(name, "in_INSERT_LOAD_QUEUE_PTR_WRITE" ,dest,"out_READ_QUEUE_OUT_LOAD_QUEUE_PTR_WRITE" );
     
    474484           _component->port_map(name,"out_RETIRE_"+toString(i)+"_TYPE"                 ,dest,"out_READ_UNIT_OUT_"+toString(i)+"_TYPE"                 );
    475485           _component->port_map(name,"out_RETIRE_"+toString(i)+"_STORE_QUEUE_PTR_WRITE",dest,"out_READ_UNIT_OUT_"+toString(i)+"_STORE_QUEUE_PTR_WRITE");
     486           _component->port_map(name,"out_RETIRE_"+toString(i)+"_STORE_QUEUE_PTR_READ" ,dest,"out_READ_UNIT_OUT_"+toString(i)+"_STORE_QUEUE_PTR_READ" );
     487           _component->port_map(name,"out_RETIRE_"+toString(i)+"_STORE_QUEUE_EMPTY"    ,dest,"out_READ_UNIT_OUT_"+toString(i)+"_STORE_QUEUE_EMPTY"    );
    476488           if (_param->_have_port_load_queue_ptr)
    477489           _component->port_map(name,"out_RETIRE_"+toString(i)+"_LOAD_QUEUE_PTR_WRITE" ,dest,"out_READ_UNIT_OUT_"+toString(i)+"_LOAD_QUEUE_PTR_WRITE" );
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Network/Read_unit_to_Execution_unit/include/Read_unit_to_Execution_unit.h

    r88 r122  
    8585  public    : SC_IN (Ttype_t           )  ***  in_READ_UNIT_OUT_TYPE                   ;//[nb_read_unit][nb_read_unit_port]
    8686  public    : SC_IN (Tlsq_ptr_t        )  ***  in_READ_UNIT_OUT_STORE_QUEUE_PTR_WRITE  ;//[nb_read_unit][nb_read_unit_port]
     87  public    : SC_IN (Tlsq_ptr_t        )  ***  in_READ_UNIT_OUT_STORE_QUEUE_PTR_READ   ;//[nb_read_unit][nb_read_unit_port]
     88  public    : SC_IN (Tcontrol_t        )  ***  in_READ_UNIT_OUT_STORE_QUEUE_EMPTY      ;//[nb_read_unit][nb_read_unit_port]
    8789  public    : SC_IN (Tlsq_ptr_t        )  ***  in_READ_UNIT_OUT_LOAD_QUEUE_PTR_WRITE   ;//[nb_read_unit][nb_read_unit_port]
    8890  public    : SC_IN (Tcontrol_t        )  ***  in_READ_UNIT_OUT_HAS_IMMEDIAT           ;//[nb_read_unit][nb_read_unit_port]
     
    106108  public    : SC_OUT(Ttype_t           )  *** out_EXECUTE_UNIT_IN_TYPE                 ;//[nb_execute_unit][nb_execute_unit_port]
    107109  public    : SC_OUT(Tlsq_ptr_t        )  *** out_EXECUTE_UNIT_IN_STORE_QUEUE_PTR_WRITE;//[nb_execute_unit][nb_execute_unit_port]
     110  public    : SC_OUT(Tlsq_ptr_t        )  *** out_EXECUTE_UNIT_IN_STORE_QUEUE_PTR_READ ;//[nb_execute_unit][nb_execute_unit_port]
     111  public    : SC_OUT(Tcontrol_t        )  *** out_EXECUTE_UNIT_IN_STORE_QUEUE_EMPTY    ;//[nb_execute_unit][nb_execute_unit_port]
    108112  public    : SC_OUT(Tlsq_ptr_t        )  *** out_EXECUTE_UNIT_IN_LOAD_QUEUE_PTR_WRITE ;//[nb_execute_unit][nb_execute_unit_port]
    109113  public    : SC_OUT(Tcontrol_t        )  *** out_EXECUTE_UNIT_IN_HAS_IMMEDIAT         ;//[nb_execute_unit][nb_execute_unit_port]
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Network/Read_unit_to_Execution_unit/src/Parameters.cpp

    r120 r122  
    5959    _num_thread_valid        = num_thread_valid    ;
    6060
     61    _nb_thread               = get_nb_thread (nb_context, nb_front_end, nb_ooo_engine);
     62
    6163    log_printf(TRACE,Read_unit_to_Execution_unit,FUNCTION,"  * table_routing [nb_read_unit][nb_execute_unit][nb_execute_unit_port]");
    6264    for (uint32_t i=0; i<_nb_read_unit; ++i)
     
    8183    _max_nb_execute_unit_port= max<uint32_t>(_nb_execute_unit_port, _nb_execute_unit);
    8284
    83     _nb_thread               = get_nb_thread (nb_context, nb_front_end, nb_ooo_engine);
    8485    _nb_load_store_unit      = 0;
    8586
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Network/Read_unit_to_Execution_unit/src/Parameters_msg_error.cpp

    r120 r122  
    6666      if (not is_type_valid(j))
    6767        for (uint32_t i=0; i<_nb_thread; i++)
    68           if (_num_thread_valid [j] and
     68          if (_num_thread_valid [i] and
    6969              (type_present [i][j]))
    7070            test.error(toString(_("The thread '%d' can execute the type's operation '%s' but this type is invalid.\n"),i,toString(j).c_str()));
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Network/Read_unit_to_Execution_unit/src/Read_unit_to_Execution_unit_allocation.cpp

    r115 r122  
    6868       _ALLOC2_SIGNAL_IN ( in_READ_UNIT_OUT_TYPE                 ,"TYPE"                 ,Ttype_t           ,_param->_size_type             ,_param->_nb_read_unit,_param->_nb_read_unit_port[it1]);
    6969       _ALLOC2_SIGNAL_IN ( in_READ_UNIT_OUT_STORE_QUEUE_PTR_WRITE,"STORE_QUEUE_PTR_WRITE",Tlsq_ptr_t        ,_param->_size_store_queue_ptr  ,_param->_nb_read_unit,_param->_nb_read_unit_port[it1]);
     70       _ALLOC2_SIGNAL_IN ( in_READ_UNIT_OUT_STORE_QUEUE_PTR_READ ,"STORE_QUEUE_PTR_READ" ,Tlsq_ptr_t        ,_param->_size_store_queue_ptr  ,_param->_nb_read_unit,_param->_nb_read_unit_port[it1]);
     71       _ALLOC2_SIGNAL_IN ( in_READ_UNIT_OUT_STORE_QUEUE_EMPTY    ,"STORE_QUEUE_EMPTY"    ,Tcontrol_t        ,1                              ,_param->_nb_read_unit,_param->_nb_read_unit_port[it1]);
    7072       _ALLOC2_SIGNAL_IN ( in_READ_UNIT_OUT_LOAD_QUEUE_PTR_WRITE ,"LOAD_QUEUE_PTR_WRITE" ,Tlsq_ptr_t        ,_param->_size_load_queue_ptr   ,_param->_nb_read_unit,_param->_nb_read_unit_port[it1]);
    7173       _ALLOC2_SIGNAL_IN ( in_READ_UNIT_OUT_HAS_IMMEDIAT         ,"HAS_IMMEDIAT"         ,Tcontrol_t        ,1                              ,_param->_nb_read_unit,_param->_nb_read_unit_port[it1]);
     
    99101       _ALLOC2_SIGNAL_OUT(out_EXECUTE_UNIT_IN_NUM_REG_RE           ,"NUM_REG_RE"           ,Tspecial_address_t,_param->_size_special_register , _param->_nb_execute_unit, _param->_nb_execute_unit_port [it1]);
    100102       _ALLOC2_SIGNAL_OUT(out_EXECUTE_UNIT_IN_STORE_QUEUE_PTR_WRITE,"STORE_QUEUE_PTR_WRITE",Tlsq_ptr_t        ,_param->_size_store_queue_ptr  , _param->_nb_execute_unit, _param->_nb_execute_unit_port [it1]);
     103       _ALLOC2_SIGNAL_OUT(out_EXECUTE_UNIT_IN_STORE_QUEUE_PTR_READ ,"STORE_QUEUE_PTR_READ" ,Tlsq_ptr_t        ,_param->_size_store_queue_ptr  , _param->_nb_execute_unit, _param->_nb_execute_unit_port [it1]);
     104       _ALLOC2_SIGNAL_OUT(out_EXECUTE_UNIT_IN_STORE_QUEUE_EMPTY    ,"STORE_QUEUE_EMPTY"    ,Tcontrol_t        ,1                              , _param->_nb_execute_unit, _param->_nb_execute_unit_port [it1]);
    101105       _ALLOC2_SIGNAL_OUT(out_EXECUTE_UNIT_IN_LOAD_QUEUE_PTR_WRITE ,"LOAD_QUEUE_PTR_WRITE" ,Tlsq_ptr_t        ,_param->_size_load_queue_ptr   , _param->_nb_execute_unit, _param->_nb_execute_unit_port [it1]);
    102106       _ALLOC2_SIGNAL_OUT(out_EXECUTE_UNIT_IN_IMMEDIAT             ,"IMMEDIAT"             ,Tgeneral_data_t   ,_param->_size_general_data     , _param->_nb_execute_unit, _param->_nb_execute_unit_port [it1]);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Network/Read_unit_to_Execution_unit/src/Read_unit_to_Execution_unit_genMealy.cpp

    r117 r122  
    8989                      PORT_WRITE(out_EXECUTE_UNIT_IN_NUM_REG_RE            [dest][port], PORT_READ(in_READ_UNIT_OUT_NUM_REG_RE            [i][j]));
    9090                      PORT_WRITE(out_EXECUTE_UNIT_IN_STORE_QUEUE_PTR_WRITE [dest][port], PORT_READ(in_READ_UNIT_OUT_STORE_QUEUE_PTR_WRITE [i][j]));
     91                      PORT_WRITE(out_EXECUTE_UNIT_IN_STORE_QUEUE_PTR_READ  [dest][port], PORT_READ(in_READ_UNIT_OUT_STORE_QUEUE_PTR_READ  [i][j]));
     92                      PORT_WRITE(out_EXECUTE_UNIT_IN_STORE_QUEUE_EMPTY     [dest][port], PORT_READ(in_READ_UNIT_OUT_STORE_QUEUE_EMPTY     [i][j]));
    9193                      if (_param->_have_port_load_queue_ptr)
    9294                      PORT_WRITE(out_EXECUTE_UNIT_IN_LOAD_QUEUE_PTR_WRITE  [dest][port], PORT_READ(in_READ_UNIT_OUT_LOAD_QUEUE_PTR_WRITE  [i][j]));
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/include/Execute_loop.h

    r97 r122  
    8181  public    : SC_IN (Ttype_t           )   **  in_EXECUTE_LOOP_IN_TYPE                 ;//[nb_read_unit]
    8282  public    : SC_IN (Tlsq_ptr_t        )   **  in_EXECUTE_LOOP_IN_STORE_QUEUE_PTR_WRITE;//[nb_read_unit]
     83  public    : SC_IN (Tlsq_ptr_t        )   **  in_EXECUTE_LOOP_IN_STORE_QUEUE_PTR_READ ;//[nb_read_unit]
     84  public    : SC_IN (Tcontrol_t        )   **  in_EXECUTE_LOOP_IN_STORE_QUEUE_EMPTY    ;//[nb_read_unit]
    8385  public    : SC_IN (Tlsq_ptr_t        )   **  in_EXECUTE_LOOP_IN_LOAD_QUEUE_PTR_WRITE ;//[nb_read_unit]
    8486  public    : SC_IN (Tcontrol_t        )   **  in_EXECUTE_LOOP_IN_HAS_IMMEDIAT         ;//[nb_read_unit]
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/src/Execute_loop_allocation.cpp

    r112 r122  
    6666       ALLOC1_SIGNAL_IN ( in_EXECUTE_LOOP_IN_TYPE                 ,"type"                 ,Ttype_t           ,_param->_size_type);         
    6767       ALLOC1_SIGNAL_IN ( in_EXECUTE_LOOP_IN_STORE_QUEUE_PTR_WRITE,"store_queue_ptr_write",Tlsq_ptr_t        ,_param->_size_store_queue_ptr);
     68       ALLOC1_SIGNAL_IN ( in_EXECUTE_LOOP_IN_STORE_QUEUE_PTR_READ ,"store_queue_ptr_read" ,Tlsq_ptr_t        ,_param->_size_store_queue_ptr);
     69       ALLOC1_SIGNAL_IN ( in_EXECUTE_LOOP_IN_STORE_QUEUE_EMPTY    ,"store_queue_empty"    ,Tcontrol_t        ,1);
    6870       ALLOC1_SIGNAL_IN ( in_EXECUTE_LOOP_IN_LOAD_QUEUE_PTR_WRITE ,"load_queue_ptr_write" ,Tlsq_ptr_t        ,_param->_size_load_queue_ptr);
    6971       ALLOC1_SIGNAL_IN ( in_EXECUTE_LOOP_IN_HAS_IMMEDIAT         ,"has_immediat"         ,Tcontrol_t        ,1);
     
    483485             PORT_MAP(_component ,src , "in_READ_UNIT_IN_TYPE"                 ,dest , "in_EXECUTE_LOOP_IN_"+toString(i)+"_TYPE"                 );
    484486             PORT_MAP(_component ,src , "in_READ_UNIT_IN_STORE_QUEUE_PTR_WRITE",dest , "in_EXECUTE_LOOP_IN_"+toString(i)+"_STORE_QUEUE_PTR_WRITE");
     487             PORT_MAP(_component ,src , "in_READ_UNIT_IN_STORE_QUEUE_PTR_READ" ,dest , "in_EXECUTE_LOOP_IN_"+toString(i)+"_STORE_QUEUE_PTR_READ" );
     488             PORT_MAP(_component ,src , "in_READ_UNIT_IN_STORE_QUEUE_EMPTY"    ,dest , "in_EXECUTE_LOOP_IN_"+toString(i)+"_STORE_QUEUE_EMPTY"    );
    485489             if (_param->_have_port_load_queue_ptr)
    486490             PORT_MAP(_component ,src , "in_READ_UNIT_IN_LOAD_QUEUE_PTR_WRITE" ,dest , "in_EXECUTE_LOOP_IN_"+toString(i)+"_LOAD_QUEUE_PTR_WRITE" );
     
    531535               COMPONENT_MAP(_component ,src ,"out_READ_UNIT_OUT_"+toString(j               )+"_STORE_QUEUE_PTR_WRITE",
    532536                                         dest, "in_READ_UNIT_OUT_"+toString(it_read_unit_out)+"_"+toString(j)+"_STORE_QUEUE_PTR_WRITE");
     537               COMPONENT_MAP(_component ,src ,"out_READ_UNIT_OUT_"+toString(j               )+"_STORE_QUEUE_PTR_READ" ,
     538                                         dest, "in_READ_UNIT_OUT_"+toString(it_read_unit_out)+"_"+toString(j)+"_STORE_QUEUE_PTR_READ" );
     539               COMPONENT_MAP(_component ,src ,"out_READ_UNIT_OUT_"+toString(j               )+"_STORE_QUEUE_EMPTY"    ,
     540                                         dest, "in_READ_UNIT_OUT_"+toString(it_read_unit_out)+"_"+toString(j)+"_STORE_QUEUE_EMPTY"    );
    533541               if (_param->_have_port_load_queue_ptr)
    534542               COMPONENT_MAP(_component ,src ,"out_READ_UNIT_OUT_"+toString(j               )+"_LOAD_QUEUE_PTR_WRITE" ,
     
    812820               COMPONENT_MAP(_component ,src , "in_EXECUTE_IN_STORE_QUEUE_PTR_WRITE",
    813821                                         dest,"out_EXECUTE_UNIT_IN_"+toString(i)+"_0_STORE_QUEUE_PTR_WRITE");
     822               COMPONENT_MAP(_component ,src , "in_EXECUTE_IN_STORE_QUEUE_PTR_READ" ,
     823                                         dest,"out_EXECUTE_UNIT_IN_"+toString(i)+"_0_STORE_QUEUE_PTR_READ" );
     824               COMPONENT_MAP(_component ,src , "in_EXECUTE_IN_STORE_QUEUE_EMPTY"    ,
     825                                         dest,"out_EXECUTE_UNIT_IN_"+toString(i)+"_0_STORE_QUEUE_EMPTY"    );
    814826               if (_param->_have_port_load_queue_ptr)
    815827               COMPONENT_MAP(_component ,src , "in_EXECUTE_IN_LOAD_QUEUE_PTR_WRITE" ,
     
    936948                 COMPONENT_MAP(_component ,src , "in_MEMORY_IN_"+toString(j)+"_STORE_QUEUE_PTR_WRITE",
    937949                                           dest,"out_EXECUTE_UNIT_IN_"+toString(i)+"_"+toString(j)+"_STORE_QUEUE_PTR_WRITE");
     950                 COMPONENT_MAP(_component ,src , "in_MEMORY_IN_"+toString(j)+"_STORE_QUEUE_PTR_READ",
     951                                           dest,"out_EXECUTE_UNIT_IN_"+toString(i)+"_"+toString(j)+"_STORE_QUEUE_PTR_READ" );
     952                 COMPONENT_MAP(_component ,src , "in_MEMORY_IN_"+toString(j)+"_STORE_QUEUE_EMPTY"    ,
     953                                           dest,"out_EXECUTE_UNIT_IN_"+toString(i)+"_"+toString(j)+"_STORE_QUEUE_EMPTY"    );
    938954                 if (_param->_have_port_load_queue_ptr)
    939955                 COMPONENT_MAP(_component ,src , "in_MEMORY_IN_"+toString(j)+"_LOAD_QUEUE_PTR_WRITE" ,
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/src/Execute_loop_deallocation.cpp

    r88 r122  
    3636        DELETE1_SIGNAL( in_EXECUTE_LOOP_IN_TYPE                 ,_param->_nb_read_unit,_param->_size_type);         
    3737        DELETE1_SIGNAL( in_EXECUTE_LOOP_IN_STORE_QUEUE_PTR_WRITE,_param->_nb_read_unit,_param->_size_store_queue_ptr);
     38        DELETE1_SIGNAL( in_EXECUTE_LOOP_IN_STORE_QUEUE_PTR_READ ,_param->_nb_read_unit,_param->_size_store_queue_ptr);
     39        DELETE1_SIGNAL( in_EXECUTE_LOOP_IN_STORE_QUEUE_EMPTY    ,_param->_nb_read_unit,1);
    3840        DELETE1_SIGNAL( in_EXECUTE_LOOP_IN_LOAD_QUEUE_PTR_WRITE ,_param->_nb_read_unit,_param->_size_load_queue_ptr);
    3941        DELETE1_SIGNAL( in_EXECUTE_LOOP_IN_HAS_IMMEDIAT         ,_param->_nb_read_unit,1);
     
    99101
    100102    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    101     delete    _component;
    102103    delete    _component_glue                        ;
     104    for (uint32_t i=0; i<_param->_nb_read_unit; i++)
     105    delete    _component_read_unit [i]               ;
    103106    delete [] _component_read_unit                   ;
     107    for (uint32_t i=0; i<_param->_nb_functionnal_unit; i++)
     108    delete    _component_functionnal_unit [i]        ;
    104109    delete [] _component_functionnal_unit            ;
     110    for (uint32_t i=0; i<_param->_nb_load_store_unit; i++)
     111    delete    _component_load_store_unit [i]         ;
    105112    delete [] _component_load_store_unit             ;
     113    for (uint32_t i=0; i<_param->_nb_write_unit; i++)
     114    delete    _component_write_unit [i]              ;
    106115    delete [] _component_write_unit                  ;
    107116    delete    _component_read_unit_to_execution_unit ;
    108117    delete    _component_execution_unit_to_write_unit;
    109118    delete    _component_register_unit               ;
     119
     120    delete    _component;
    110121   
    111122    log_printf(FUNC,Execute_loop,FUNCTION,"End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/src/Parameters.cpp

    r120 r122  
    590590    delete    _param_glue;
    591591    for (uint32_t i=0; i<_nb_read_unit; i++)
    592       delete _param_read_unit [i];
     592    delete    _param_read_unit [i];
    593593    delete [] _param_read_unit;
    594594
     
    605605    delete [] _param_load_store_unit;
    606606    for (uint32_t i=0; i<_nb_write_unit; i++)
    607       delete _param_write_unit [i];
     607    delete    _param_write_unit [i];
    608608    delete [] _param_write_unit;
    609609    delete    _param_read_unit_to_execution_unit;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/src/Context_State_transition.cpp

    r120 r122  
    1616namespace context_state {
    1717
     18#define MISS_FAST
    1819
    1920#define get_priority(x) \
     
    5354//             uint32_t x = _param->_link_context_to_decod_unit    [i];
    5455
    55             Tcounter_t inst_all = PORT_READ(in_NB_INST_COMMIT_ALL[i]) + PORT_READ(in_NB_INST_DECOD_ALL [i]);
    56 //          Tcounter_t inst_mem = PORT_READ(in_NB_INST_COMMIT_MEM[i]) + PORT_READ(in_NB_INST_DECOD_ALL [i]);
     56            Tcounter_t inst_commit_all = PORT_READ(in_NB_INST_COMMIT_ALL[i]);
     57//          Tcounter_t inst_commit_mem = PORT_READ(in_NB_INST_COMMIT_MEM[i]);
     58            Tcounter_t inst_decod_all  = PORT_READ(in_NB_INST_DECOD_ALL [i]);
     59            Tcounter_t inst_all        = inst_commit_all + inst_decod_all;
     60//          Tcounter_t inst_mem        = inst_commit_mem + inst_decod_all;
    5761
    5862            context_state_t state = reg_STATE [i];
     
    6973                  // Wait end of all instruction
    7074                  if (inst_all == 0)
     75//                if (inst_decod_all == 0)
    7176                    state = CONTEXT_STATE_KO_EXCEP_ADDR;
    7277                  break;
     
    8590                {
    8691                  // Wait end of all instruction
    87                   if (inst_all == 0)
     92//                if (inst_all == 0)
     93                  if (
     94#ifdef  MISS_FAST
     95                      inst_decod_all ==
     96#else
     97                      inst_all ==
     98#endif
     99                      0)
    88100                   
    89 //                  state = CONTEXT_STATE_OK; // @@@ TODO : make MISS fast (miss decod)
     101//                  state = CONTEXT_STATE_OK;
    90102                    state = CONTEXT_STATE_KO_MISS_BRANCH_ADDR;
    91103                  break;
     
    94106                {
    95107                  // Wait end of all instruction
    96                   if (inst_all == 0)
     108//                if (inst_all == 0)
     109                  if (
     110#ifdef  MISS_FAST
     111                      inst_decod_all ==
     112#else
     113                      inst_all ==
     114#endif
     115                      0)
    97116                    state = CONTEXT_STATE_KO_MISS_LOAD_ADDR;
    98117
     
    127146                {
    128147                  // Wait end of all instruction
    129                   if (inst_all == 0)
    130                    
     148//                if (inst_all == 0)
     149                  if (
     150#ifdef  MISS_FAST
     151                      inst_decod_all ==
     152#else
     153                      inst_all ==
     154#endif
     155                      0)
    131156//                  state = CONTEXT_STATE_OK; // @@@ TODO : make MISS fast (miss decod)
    132157                    state = CONTEXT_STATE_KO_MISS_LOAD_AND_BRANCH_ADDR;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Parameters.h

    r120 r122  
    3636  public : uint32_t   _nb_thread                          ;
    3737  public : uint32_t * _translate_num_context_to_num_thread;//[nb_context]                   
    38   public : const bool _accurate_block_predict    ;
    39   public : const bool _accurate_block_decod      ;
     38  public : const bool _always_accurate_predict   ;
     39  public : const bool _always_accurate_decod     ;
     40  public : const bool _can_accurate_predict      ;
     41  public : const bool _can_accurate_decod        ;
    4042
    4143//public : uint32_t   _size_context_id           ;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Types.h

    r119 r122  
    2525    } event_source_t;
    2626
    27   typedef enum
    28     {
    29       EVENT_STATE_OK                      , // Can predict
    30       EVENT_STATE_MISS_FLUSH_UFPT         , // in decod  stage, detect a miss  , continue to execute but flush ufpt
    31       EVENT_STATE_MISS_FLUSH_UFPT_AND_UPT , // in commit stage, detect a miss  , stop context and flush ufpt and upt
    32       EVENT_STATE_MISS_FLUSH_UPT          , // in commit stage, detect a miss  , context is stop and ufpt is flush, update RAS
    33       EVENT_STATE_EVENT_FLUSH_UFPT        , // in commit stage, detect an event, continue to execute but flush ufpt
    34       EVENT_STATE_EVENT_FLUSH_UFPT_AND_UPT, // in commit stage, detect an event, stop context and flush ufpt and upt
    35       EVENT_STATE_EVENT_FLUSH_UPT         , // in commit stage, detect an event, context is stop and ufpt is flush, update RAS
    36       EVENT_STATE_UPDATE_CONTEXT          , // prediction unit is update, send signal to context manager
    37       EVENT_STATE_WAIT_END_EVENT            // prediction unit is ok, wait the end of event (send by Context State)
    38     } event_state_t;
     27//   typedef enum
     28//     {
     29//       EVENT_STATE_OK                      , // Can predict
     30//       EVENT_STATE_MISS_FLUSH_UFPT         , // in decod  stage, detect a miss  , continue to execute but flush ufpt
     31//       EVENT_STATE_MISS_FLUSH_UFPT_AND_UPT , // in commit stage, detect a miss  , stop context and flush ufpt and upt
     32//       EVENT_STATE_MISS_FLUSH_UPT          , // in commit stage, detect a miss  , context is stop and ufpt is flush, update RAS
     33//       EVENT_STATE_EVENT_FLUSH_UFPT        , // in commit stage, detect an event, continue to execute but flush ufpt
     34//       EVENT_STATE_EVENT_FLUSH_UFPT_AND_UPT, // in commit stage, detect an event, stop context and flush ufpt and upt
     35//       EVENT_STATE_EVENT_FLUSH_UPT         , // in commit stage, detect an event, context is stop and ufpt is flush, update RAS
     36//       EVENT_STATE_UPDATE_CONTEXT          , // prediction unit is update, send signal to context manager
     37//       EVENT_STATE_WAIT_END_EVENT            // prediction unit is ok, wait the end of event (send by Context State)
     38//     } event_state_t;
     39
     40  typedef enum
     41    {
     42      UFPT_EVENT_STATE_OK                     , // Can predict
     43      UFPT_EVENT_STATE_KO_FLUSH                 // Can't predict, flush ufpt
     44    } ufpt_event_state_t;
     45
     46  typedef enum
     47    {
     48      UPT_EVENT_STATE_OK                              , // Can predict
     49      UPT_EVENT_STATE_KO_MISS_WAIT_UFPT               , // in decod  stage, detect a miss  , continue to execute but flush ufpt
     50      UPT_EVENT_STATE_KO_MISS_FLUSH_UPT               , // in commit stage, detect a miss  , context is stop and ufpt is flush, update RAS
     51      UPT_EVENT_STATE_KO_EVENT_WAIT_UFPT              , // in commit stage, detect an event, continue to execute but flush ufpt
     52      UPT_EVENT_STATE_KO_EVENT_FLUSH_UPT              , // in commit stage, detect an event, context is stop and ufpt is flush, update RAS
     53      UPT_EVENT_STATE_KO_DECODE_UPDATE_CONTEXT        , // prediction unit is update, send signal to context manager
     54      UPT_EVENT_STATE_KO_DECODE_WAIT_END_EVENT        , // prediction unit is ok, wait the end of event (send by Context State)
     55      UPT_EVENT_STATE_KO_COMMIT_UPDATE_CONTEXT        , // prediction unit is update, send signal to context manager
     56      UPT_EVENT_STATE_KO_COMMIT_WAIT_END_EVENT          // prediction unit is ok, wait the end of event (send by Context State)
     57    } upt_event_state_t;
    3958
    4059  typedef enum
     
    138157  };
    139158
    140 
    141  
    142   template<> inline std::string toString<morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::event_state_t>(const morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::event_state_t& x)
    143   {
    144     switch (x)
    145       {
    146       case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::EVENT_STATE_OK                      : return "ok"                      ; break;
    147       case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::EVENT_STATE_MISS_FLUSH_UFPT         : return "miss_flush_ufpt"         ; break;
    148       case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::EVENT_STATE_MISS_FLUSH_UFPT_AND_UPT : return "miss_flush_ufpt_and_upt" ; break;
    149       case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::EVENT_STATE_MISS_FLUSH_UPT          : return "miss_flush_upt"          ; break;
    150       case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::EVENT_STATE_EVENT_FLUSH_UPT         : return "event_flush_upt"         ; break;
    151       case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::EVENT_STATE_EVENT_FLUSH_UFPT        : return "event_flush_ufpt"        ; break;
    152       case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::EVENT_STATE_EVENT_FLUSH_UFPT_AND_UPT: return "event_flush_ufpt_and_upt"; break;
    153       case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::EVENT_STATE_UPDATE_CONTEXT          : return "update_context"          ; break;
    154       case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::EVENT_STATE_WAIT_END_EVENT          : return "wait_end_event"          ; break;
    155       default    : return ""; break;
    156       }
    157   };
     159//   template<> inline std::string toString<morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::event_state_t>(const morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::event_state_t& x)
     160//   {
     161//     switch (x)
     162//       {
     163//       case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::EVENT_STATE_OK                      : return "ok"                      ; break;
     164//       case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::EVENT_STATE_MISS_FLUSH_UFPT         : return "miss_flush_ufpt"         ; break;
     165//       case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::EVENT_STATE_MISS_FLUSH_UFPT_AND_UPT : return "miss_flush_ufpt_and_upt" ; break;
     166//       case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::EVENT_STATE_MISS_FLUSH_UPT          : return "miss_flush_upt"          ; break;
     167//       case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::EVENT_STATE_EVENT_FLUSH_UPT         : return "event_flush_upt"         ; break;
     168//       case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::EVENT_STATE_EVENT_FLUSH_UFPT        : return "event_flush_ufpt"        ; break;
     169//       case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::EVENT_STATE_EVENT_FLUSH_UFPT_AND_UPT: return "event_flush_ufpt_and_upt"; break;
     170//       case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::EVENT_STATE_UPDATE_CONTEXT          : return "update_context"          ; break;
     171//       case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::EVENT_STATE_WAIT_END_EVENT          : return "wait_end_event"          ; break;
     172//       default    : return ""; break;
     173//       }
     174//   };
    158175
    159176  template<> inline std::string toString<morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::ufpt_state_t>(const morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::ufpt_state_t& x)
     
    186203  };
    187204
     205  template<> inline std::string toString<morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::ufpt_event_state_t>(const morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::ufpt_event_state_t& x)
     206  {
     207    switch (x)
     208      {
     209      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UFPT_EVENT_STATE_OK       : return "UFPT_EVENT_STATE_OK"       ; break;
     210      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UFPT_EVENT_STATE_KO_FLUSH : return "UFPT_EVENT_STATE_KO_FLUSH" ; break;
     211      default    : return ""; break;
     212      }
     213  };
     214
     215  template<> inline std::string toString<morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::upt_event_state_t>(const morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::upt_event_state_t& x)
     216  {
     217    switch (x)
     218      {
     219      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPT_EVENT_STATE_OK                        : return "UPT_EVENT_STATE_OK"                        ; break;
     220      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPT_EVENT_STATE_KO_MISS_WAIT_UFPT         : return "UPT_EVENT_STATE_KO_MISS_WAIT_UFPT"         ; break;
     221      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPT_EVENT_STATE_KO_MISS_FLUSH_UPT         : return "UPT_EVENT_STATE_KO_MISS_FLUSH_UPT"         ; break;
     222      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPT_EVENT_STATE_KO_EVENT_WAIT_UFPT        : return "UPT_EVENT_STATE_KO_EVENT_WAIT_UFPT"        ; break;
     223      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPT_EVENT_STATE_KO_EVENT_FLUSH_UPT        : return "UPT_EVENT_STATE_KO_EVENT_FLUSH_UPT"        ; break;
     224      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPT_EVENT_STATE_KO_DECODE_UPDATE_CONTEXT  : return "UPT_EVENT_STATE_KO_DECODE_UPDATE_CONTEXT"  ; break;
     225      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPT_EVENT_STATE_KO_DECODE_WAIT_END_EVENT  : return "UPT_EVENT_STATE_KO_DECODE_WAIT_END_EVENT"  ; break;
     226      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPT_EVENT_STATE_KO_COMMIT_UPDATE_CONTEXT  : return "UPT_EVENT_STATE_KO_COMMIT_UPDATE_CONTEXT"  ; break;
     227      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPT_EVENT_STATE_KO_COMMIT_WAIT_END_EVENT  : return "UPT_EVENT_STATE_KO_COMMIT_WAIT_END_EVENT"  ; break;
     228      default    : return ""; break;
     229      }
     230  };
     231
    188232}; // end namespace morpheo             
    189233
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Update_Prediction_Table.h

    r119 r122  
    184184  private   : bool                          * reg_IS_ACCURATE                    ; //[nb_context]
    185185
    186   private   : bool                          * reg_EVENT_VAL                      ; //[nb_context]
     186  private   : ufpt_event_state_t            * reg_UFPT_EVENT_STATE               ; //[nb_context]
     187  private   : upt_event_state_t             * reg_UPT_EVENT_STATE                ; //[nb_context]
     188
     189//   private   : bool                          * reg_EVENT_VAL                      ; //[nb_context]
    187190  private   : uint32_t                      * reg_EVENT_UPT_PTR                  ; //[nb_context]
    188191  private   : bool                          * reg_EVENT_UPT_FULL                 ; //[nb_context]
    189192
    190   private   : event_state_t                 * reg_EVENT_STATE                    ; //[nb_context]
    191   private   : bool                          * reg_EVENT_IS_BRANCH                ; //[nb_context]
     193//   private   : event_state_t                 * reg_EVENT_STATE                    ; //[nb_context]
     194//   private   : bool                          * reg_EVENT_IS_BRANCH                ; //[nb_context]
    192195  private   : Tdepth_t                      * reg_EVENT_DEPTH                    ; //[nb_context]
    193196  private   : Taddress_t                    * reg_EVENT_ADDRESS_SRC              ; //[nb_context] // Address branch
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Parameters.cpp

    r120 r122  
    3434                          uint32_t * translate_num_context_to_num_thread ,//[nb_context]
    3535                          bool       is_toplevel):
    36     _accurate_block_predict (false),
    37     _accurate_block_decod   (false)
     36    _always_accurate_predict (false),
     37    _always_accurate_decod   (false),
     38    _can_accurate_predict    (true ),
     39    _can_accurate_decod      (true )
    3840  {
    3941    log_printf(FUNC,Update_Prediction_Table,FUNCTION,"Begin");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_allocation.cpp

    r120 r122  
    224224    ALLOC1(reg_UPT_EMPTY                    ,bool         ,_param->_nb_context);
    225225
    226     ALLOC1(reg_EVENT_VAL                    ,bool         ,_param->_nb_context);
     226    ALLOC1(reg_UFPT_EVENT_STATE             ,ufpt_event_state_t,_param->_nb_context);
     227    ALLOC1(reg_UPT_EVENT_STATE              ,upt_event_state_t ,_param->_nb_context);
     228
     229//     ALLOC1(reg_EVENT_VAL                    ,bool         ,_param->_nb_context);
    227230    ALLOC1(reg_EVENT_UPT_PTR                ,uint32_t     ,_param->_nb_context);
    228231    ALLOC1(reg_EVENT_UPT_FULL               ,bool         ,_param->_nb_context);
    229232
    230     ALLOC1(reg_EVENT_STATE                  ,event_state_t ,_param->_nb_context);
    231     ALLOC1(reg_EVENT_IS_BRANCH              ,bool          ,_param->_nb_context);
     233//     ALLOC1(reg_EVENT_STATE                  ,event_state_t ,_param->_nb_context);
     234//     ALLOC1(reg_EVENT_IS_BRANCH              ,bool          ,_param->_nb_context);
    232235    ALLOC1(reg_EVENT_DEPTH                  ,Tdepth_t      ,_param->_nb_context);
    233236    ALLOC1(reg_EVENT_ADDRESS_SRC            ,Taddress_t    ,_param->_nb_context);
     
    257260                                                   false,
    258261                                                   log_with_pid,
    259                                                    false);
     262                                                   true);
    260263         
    261264          branchement_log_file [i] .open(filename.c_str() ,std::ios::out | std::ios::trunc);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_deallocation.cpp

    r119 r122  
    151151        DELETE1(reg_UPT_EMPTY                    ,_param->_nb_context);
    152152       
    153         DELETE1(reg_EVENT_VAL                    ,_param->_nb_context);
     153        DELETE1(reg_UFPT_EVENT_STATE             ,_param->_nb_context);
     154        DELETE1(reg_UPT_EVENT_STATE              ,_param->_nb_context);
     155
     156//         DELETE1(reg_EVENT_VAL                    ,_param->_nb_context);
    154157        DELETE1(reg_EVENT_UPT_PTR                ,_param->_nb_context);
    155158        DELETE1(reg_EVENT_UPT_FULL               ,_param->_nb_context);
    156159
    157         DELETE1(reg_EVENT_STATE                  ,_param->_nb_context);
    158         DELETE1(reg_EVENT_IS_BRANCH              ,_param->_nb_context);
     160//         DELETE1(reg_EVENT_STATE                  ,_param->_nb_context);
     161//         DELETE1(reg_EVENT_IS_BRANCH              ,_param->_nb_context);
    159162        DELETE1(reg_EVENT_DEPTH                  ,_param->_nb_context);
    160163        DELETE1(reg_EVENT_ADDRESS_SRC            ,_param->_nb_context);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_genMealy_branch_complete.cpp

    r111 r122  
    3333        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * BRANCH_COMPLETE [%d]",i);
    3434
    35         Tcontext_t          context   = (_param->_have_port_context_id)?PORT_READ(in_BRANCH_COMPLETE_CONTEXT_ID [i]):0;
    36         Tdepth_t            depth     = (_param->_have_port_depth     )?PORT_READ(in_BRANCH_COMPLETE_DEPTH      [i]):0;
    37         Tcontrol_t          miss      = false;
    38         Tcontrol_t          take      = reg_UPDATE_PREDICTION_TABLE [context][depth]._last_take   ;
    39         Taddress_t          addr_dest = reg_UPDATE_PREDICTION_TABLE [context][depth]._address_dest;
    40         Tbranch_condition_t condition = reg_UPDATE_PREDICTION_TABLE [context][depth]._condition   ;
     35        // Read information
     36        Tcontext_t          context     = (_param->_have_port_context_id)?PORT_READ(in_BRANCH_COMPLETE_CONTEXT_ID [i]):0;
     37        Tdepth_t            depth       = (_param->_have_port_depth     )?PORT_READ(in_BRANCH_COMPLETE_DEPTH      [i]):0;
     38        Tcontrol_t          miss        = false; // init
     39        Tcontrol_t          take        = reg_UPDATE_PREDICTION_TABLE [context][depth]._last_take   ;
     40        Taddress_t          addr_dest   = reg_UPDATE_PREDICTION_TABLE [context][depth]._address_dest;
     41        Tbranch_condition_t condition   = reg_UPDATE_PREDICTION_TABLE [context][depth]._condition   ;
    4142
    4243        Tcontrol_t          no_sequence = PORT_READ(in_BRANCH_COMPLETE_NO_SEQUENCE [i]);
    43         Taddress_t          addr_good = PORT_READ(in_BRANCH_COMPLETE_ADDRESS [i]);
     44        Taddress_t          addr_good   = PORT_READ(in_BRANCH_COMPLETE_ADDRESS [i]);
    4445
    4546        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * context        : %d",context);
     
    5455        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * address_dest : %.8x",addr_dest);
    5556
     57        // Test branch condition
    5658        switch (condition)
    5759          {
     
    8082              log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * BRANCH_CONDITION_FLAG");
    8183
    82 //               Tcontrol_t take_good = not flag; // flag set = not take
    83 //               Tcontrol_t take_good = flag; // flag set = take
    8484              Tcontrol_t take_good = no_sequence;
    8585
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_genMealy_decod.cpp

    r120 r122  
    2828    if (PORT_READ(in_NRESET) != 0)
    2929      {
     30    // for each decod instruction
    3031    for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
    3132      {
    3233        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * DECOD [%d]",i);
    3334
    34         Tcontext_t    context     = (_param->_have_port_context_id)?PORT_READ(in_DECOD_CONTEXT_ID [i]):0;
    35         bool          is_accurate = _param->_accurate_block_decod or reg_IS_ACCURATE [context];
    36         event_state_t event_state = reg_EVENT_STATE [context];
    37         uint32_t      ptr_write   = reg_UPT_TOP     [context];
    38         // can continue if next slot is empty
    39         Tcontrol_t    can_continue= ((reg_UPDATE_PREDICTION_TABLE [context][(reg_UPT_TOP [context]+1)%_param->_size_upt_queue[context]]._state == UPDATE_PREDICTION_STATE_EMPTY) and
    40                                      (reg_EVENT_STATE [context] == EVENT_STATE_OK));
     35        // Read information
     36        Tcontext_t         context          = (_param->_have_port_context_id)?PORT_READ(in_DECOD_CONTEXT_ID [i]):0;
     37        bool               is_accurate      = (_param->_always_accurate_decod or
     38                                              (_param->_can_accurate_decod and reg_IS_ACCURATE [context]));
     39        upt_event_state_t  upt_event_state  = reg_UPT_EVENT_STATE  [context];
     40        ufpt_event_state_t ufpt_event_state = reg_UFPT_EVENT_STATE [context];
     41        uint32_t           ptr_write        = reg_UPT_TOP     [context]; // One branch per context per cycle
     42        uint32_t           ptr_write_next   = (ptr_write+1)%_param->_size_upt_queue[context];
     43        // Decod can continue until the next branch if next slot is empty, and no event
     44        Tcontrol_t         can_continue     = (reg_UPDATE_PREDICTION_TABLE [context][ptr_write_next]._state == UPDATE_PREDICTION_STATE_EMPTY);
    4145
    42         log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * context     : %d",context    );
    43         log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * is_accurate : %d",is_accurate);
    44         log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * event_state : %s",toString(event_state).c_str());
    45         log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * ptr_write   : %d",ptr_write  );
    46         log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * upt_state   : %s",toString(reg_UPDATE_PREDICTION_TABLE [context][ptr_write]._state).c_str());
    47         log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * can_continue: %d",can_continue);
     46        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * context          : %d",context);
     47        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * is_accurate      : %d",is_accurate);
     48        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * ufpt_event_state : %s",toString(ufpt_event_state).c_str());
     49        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * upt_event_state  : %s",toString(upt_event_state).c_str());
     50        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * ptr_write        : %d - %d",ptr_write,ptr_write_next);
     51        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * upt_state        : %s",toString(reg_UPDATE_PREDICTION_TABLE [context][ptr_write]._state).c_str());
     52        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * can_continue     : %d",can_continue);
    4853
    49         // ack :
     54        // can decod (ack) if :
    5055        //   * in all case (miss or hit), need empty slot
     56        //   * not previous event (state = ok)
    5157        //   * is_accurate
    52         //   * event_state : don't update upt
    5358        internal_DECOD_ACK           [i] = ((reg_UPDATE_PREDICTION_TABLE [context][ptr_write]._state == UPDATE_PREDICTION_STATE_EMPTY) and
    54                                             is_accurate and
    55 //                                             (
    56                                              (event_state == EVENT_STATE_OK)//  or
    57 //                                              (event_state == EVENT_STATE_MISS_FLUSH_UFPT    ) or
    58 //                                              (event_state == EVENT_STATE_UPDATE_CONTEXT))
    59                                             );
     59                                            (ufpt_event_state == UFPT_EVENT_STATE_OK) and
     60                                            (upt_event_state  == UPT_EVENT_STATE_OK ) and
     61                                            is_accurate);
    6062        internal_DECOD_UPT_PTR_WRITE [i] = ptr_write;
    6163
    62         log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * ack         : %d",internal_DECOD_ACK [i]);
     64        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * ack              : %d",internal_DECOD_ACK [i]);
    6365
    6466        PORT_WRITE(out_DECOD_ACK          [i], internal_DECOD_ACK [i]);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_genMealy_predict.cpp

    r120 r122  
    2727    if (PORT_READ(in_NRESET) != 0)
    2828      {
    29 
     29    // For each prediction
    3030    for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
    3131      {
     32        // Read information
    3233        Tcontext_t context = (_param->_have_port_context_id)?PORT_READ(in_PREDICT_CONTEXT_ID [i]):0;
    33         uint32_t   top     = reg_UFPT_TOP[context];
     34        uint32_t   top     = reg_UFPT_TOP[context]; // not multi branch prediction
    3435
    3536        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"PREDICT [%d] (genMealy)",i);
     
    4041//      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * need update : %d",reg_NB_ELT_NEED_UPDATE [context]);
    4142
     43        bool is_accurate = (_param->_always_accurate_predict or
     44                            (_param->_can_accurate_predict and reg_IS_ACCURATE [context]));
     45
     46        // Ack if :
     47        //  * no previous event (ufpt and upt is ok)
     48        //  * top slot is empty
     49        //  * is_accurate
     50        internal_PREDICT_ACK [i] = ((reg_UFPT_EVENT_STATE [context] == UFPT_EVENT_STATE_OK) and
     51                                    (reg_UPT_EVENT_STATE  [context] == UPT_EVENT_STATE_OK ) and
     52                                    (reg_UPDATE_FETCH_PREDICTION_TABLE [context][top]._state == UPDATE_FETCH_PREDICTION_STATE_EMPTY) and
     53                                    is_accurate);
     54
    4255        internal_PREDICT_UPDATE_PREDICTION_ID [i] = top;
    4356
     57        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * ACK         : %d",internal_PREDICT_ACK [i]);
     58
     59        PORT_WRITE(out_PREDICT_ACK                  [i], internal_PREDICT_ACK                  [i]);
    4460        if (_param->_have_port_depth)
    4561        PORT_WRITE(out_PREDICT_UPDATE_PREDICTION_ID [i], internal_PREDICT_UPDATE_PREDICTION_ID [i]);
    46 
    47         bool is_accurate = _param->_accurate_block_predict or reg_IS_ACCURATE[context];
    48 
    49         // Ack if :
    50         //  * slot is empty
    51         //  * no previous miss
    52         //  * is_accurate
    53         internal_PREDICT_ACK [i] = ((reg_UPDATE_FETCH_PREDICTION_TABLE [context][top]._state == UPDATE_FETCH_PREDICTION_STATE_EMPTY) and
    54                                     (reg_EVENT_STATE [context] == EVENT_STATE_OK) and
    55 //                                  (reg_UFPT_NB_UPDATE [context] == 0) and
    56                                     is_accurate);
    57 
    58 
    59         log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * ACK         : %d",internal_PREDICT_ACK [i]);
    60         PORT_WRITE(out_PREDICT_ACK [i], internal_PREDICT_ACK [i]);
    6162      }
    6263
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_genMoore.cpp

    r119 r122  
    4040        //     include ]DEPTH_MIN:DEPTH_MAX] -> speculative
    4141
    42         PORT_WRITE(out_DEPTH_VAL     [i],((reg_UPDATE_PREDICTION_TABLE [i][reg_UPT_TOP [i]]._state == UPDATE_PREDICTION_STATE_EMPTY)
    43                                           and (reg_EVENT_STATE [i] == EVENT_STATE_OK)
     42        uint32_t bottom = reg_UPT_BOTTOM [i];
     43        uint32_t top    = reg_UPT_TOP    [i];
     44        bool     empty  = reg_UPT_EMPTY [i];
     45
     46        // Depth_val is set when state is ok and the UPT[top] is empty
     47        PORT_WRITE(out_DEPTH_VAL     [i],((reg_UPDATE_PREDICTION_TABLE [i][top]._state == UPDATE_PREDICTION_STATE_EMPTY)
     48                                          and (reg_UFPT_EVENT_STATE [i] == UFPT_EVENT_STATE_OK)
     49                                          and (reg_UPT_EVENT_STATE  [i] == UPT_EVENT_STATE_OK)
    4450                                          ));
    4551        if (_param->_have_port_depth)
    4652          {
    47         PORT_WRITE(out_DEPTH_CURRENT [i], reg_UPT_TOP    [i]);
    48         PORT_WRITE(out_DEPTH_MIN     [i], reg_UPT_BOTTOM [i]);
    49         PORT_WRITE(out_DEPTH_MAX     [i], reg_UPT_TOP    [i]);
    50           }
    51         PORT_WRITE(out_DEPTH_FULL    [i], not reg_UPT_EMPTY [i] and (reg_UPT_TOP [i] == reg_UPT_BOTTOM [i]));
    52 
    53 //         bool empty = reg_UPT_EMPTY [i];
    54 //      PORT_WRITE(out_DEPTH_MAX     [i], ((empty)?reg_UPT_BOTTOM [i]:((reg_UPT_TOP [i]==0)?(_param->_size_upt_queue[i]-1):(reg_UPT_TOP [i]-1))));
     53        PORT_WRITE(out_DEPTH_CURRENT [i], top);
     54        PORT_WRITE(out_DEPTH_MIN     [i], bottom);
     55        PORT_WRITE(out_DEPTH_MAX     [i], top);
     56          }
     57        PORT_WRITE(out_DEPTH_FULL    [i], not empty and (top == bottom));
    5558      }
    5659
     
    5861    // =====[ UPDATE ]====================================================
    5962    // ===================================================================
    60 
    61     bool     retire_ras_from_ufpt [_param->_nb_context]; // event ufpt -> restore RAS, else update upt
    62     bool     retire_ras_from_upt  [_param->_nb_context]; // event upt  -> restore RAS, else restore others structure
    63 //  bool     have_event           [_param->_nb_context];
    64     bool     ufpt_update          [_param->_nb_context];
    65     bool     upt_update           [_param->_nb_context];
    66     Tdepth_t tab_ufpt_depth       [_param->_nb_context];
    67     Tdepth_t tab_upt_depth        [_param->_nb_context];
    68 
    69     for (uint32_t i=0; i<_param->_nb_context; i++)
    70       {
    71         event_state_t event_state = reg_EVENT_STATE [i];
    72 
    73         retire_ras_from_ufpt [i] = ((event_state == EVENT_STATE_MISS_FLUSH_UFPT         ) or
    74                                     (event_state == EVENT_STATE_MISS_FLUSH_UFPT_AND_UPT ) or
    75                                     (event_state == EVENT_STATE_EVENT_FLUSH_UFPT        ) or
    76                                     (event_state == EVENT_STATE_EVENT_FLUSH_UFPT_AND_UPT));
    77         retire_ras_from_upt  [i] = ((event_state == EVENT_STATE_MISS_FLUSH_UPT) or
    78                                     (event_state == EVENT_STATE_EVENT_FLUSH_UPT));
    79 
    80 //         have_event           [i] = (event_state == EVENT_STATE_EVENT_FLUSH_UPT);
    81 
    82         ufpt_update          [i] = true;
    83         upt_update           [i] = true;
    84         tab_ufpt_depth       [i] = reg_UFPT_UPDATE [i];
    85         tab_upt_depth        [i] = reg_UPT_UPDATE  [i];
    86       }
     63    {
     64      bool     flush_ufpt      [_param->_nb_context]; // event ufpt -> restore RAS, else update upt
     65      bool     flush_upt       [_param->_nb_context]; // event upt  -> restore RAS, else restore others structure
     66      bool     ufpt_can_update [_param->_nb_context];
     67      bool     upt_can_update  [_param->_nb_context];
     68      Tdepth_t tab_ufpt_depth  [_param->_nb_context];
     69      Tdepth_t tab_upt_depth   [_param->_nb_context];
     70     
     71      // Init
     72      for (uint32_t i=0; i<_param->_nb_context; i++)
     73        {
     74          ufpt_event_state_t ufpt_event_state = reg_UFPT_EVENT_STATE [i];
     75          upt_event_state_t  upt_event_state  = reg_UPT_EVENT_STATE [i];
     76         
     77          flush_ufpt      [i] = (ufpt_event_state == UFPT_EVENT_STATE_KO_FLUSH);
     78          flush_upt       [i] = ((upt_event_state == UPT_EVENT_STATE_KO_MISS_FLUSH_UPT) or
     79                                 (upt_event_state == UPT_EVENT_STATE_KO_EVENT_FLUSH_UPT));
     80          ufpt_can_update [i] = true;
     81          upt_can_update  [i] = true;
     82          tab_ufpt_depth  [i] = reg_UFPT_UPDATE [i];
     83          tab_upt_depth   [i] = reg_UPT_UPDATE  [i];
     84        }
    8785
    8886    for (uint32_t i=0; i<_param->_nb_inst_update; i++)
    8987      {
    90         Tcontext_t          context     = (reg_UPDATE_PRIORITY+i)%_param->_nb_context;
     88        Tcontext_t          context              = (reg_UPDATE_PRIORITY+i)%_param->_nb_context;
    9189
    9290        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * UPDATE [%d] (genMoore)",i);
    9391        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * context         : %d",context);
    94         log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * event_state     : %s",toString(reg_EVENT_STATE [context]).c_str());
     92        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * flush_ufpt      : %d",flush_ufpt[context]);
     93        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * flush_upt       : %d",flush_upt [context]);
    9594
    9695        Tcontrol_t          val                  = false;
    9796        Tcontrol_t          val_without_ack      = false;
    98         Tcontrol_t          miss_prediction      ;
    99         Tcontrol_t          direction_good       ;
    100         Tcontrol_t          prediction_ifetch    ;
    101         Tcontrol_t          btb_val              ;
    102         Taddress_t          btb_address_src      ;
    103         Taddress_t          btb_address_dest     ;
    104         Tbranch_condition_t btb_condition        ;
    105         Tcontrol_t          dir_val              ;
    106         Thistory_t          dir_history          ;
    107         Tcontrol_t          ras_val              ;
    108         Tcontrol_t          ras_flush            ;
    109         Tcontrol_t          ras_push             ;
    110         Taddress_t          ras_address          ;
    111         Tptr_t              ras_index            ;
     97        Tcontrol_t          miss_prediction      = 0; // not necessary init
     98        Tcontrol_t          direction_good       = 0; // not necessary init
     99        Tcontrol_t          prediction_ifetch    = 0; // not necessary init
     100        Tcontrol_t          btb_val              = 0; // not necessary init
     101        Taddress_t          btb_address_src      = 0; // not necessary init
     102        Taddress_t          btb_address_dest     = 0; // not necessary init
     103        Tbranch_condition_t btb_condition        = 0; // not necessary init
     104        Tcontrol_t          dir_val              = 0; // not necessary init
     105        Thistory_t          dir_history          = 0; // not necessary init
     106        Tcontrol_t          ras_val              = 0; // not necessary init
     107        Tcontrol_t          ras_flush            = 0; // not necessary init
     108        Tcontrol_t          ras_push             = 0; // not necessary init
     109        Taddress_t          ras_address          = 0; // not necessary init
     110        Tptr_t              ras_index            = 0; // not necessary init
    112111
    113112        // Test if update fetch prediction table need update port
    114         if (retire_ras_from_ufpt [context])
    115           {
    116             if (ufpt_update [context])
     113        if (flush_ufpt [context])
     114          {
     115            if (ufpt_can_update [context])
    117116              {
    118117                // Update Fetch Prediction Table
    119                 // An update of ufpt is to previous miss. Just restore Return Address Stack
    120                
     118                // An update of ufpt is to previous miss. Just restore Prediction_unit
     119               
     120                // Read information
    121121                Tdepth_t            depth     = tab_ufpt_depth[context];
    122122                ufpt_state_t        state     = reg_UPDATE_FETCH_PREDICTION_TABLE [context][depth]._state;
     
    131131//              val_without_ack       = not update_ras(condition);
    132132
    133                 miss_prediction       = 1;
     133                miss_prediction       = 1; // need update, also previous miss
    134134//              direction_good        = ;
    135135                prediction_ifetch     = 1;
     
    138138//              btb_address_dest      = reg_UPDATE_PREDICTION_TABLE [context][depth]._address_dest;
    139139//              btb_condition         = condition;
    140                 dir_val               = update_ras(condition);
     140                dir_val               = update_dir(condition);
    141141                dir_history           = reg_UPDATE_PREDICTION_TABLE [context][depth]._history;
    142                 // repop/ repush data -> don't corrupt ras
    143                 ras_val               = update_ras(condition);
    144                 ras_flush             = 0;
     142                ras_val               = update_ras(condition); // repop/ repush data -> don't corrupt ras
     143                ras_flush             = 0; // no ras corruption
    145144                ras_push              = push_ras(condition);
    146145                ras_address           = reg_UPDATE_FETCH_PREDICTION_TABLE [context][depth]._address_ras;
     
    153152                // Warning : don't update same entry
    154153                if (depth == reg_UFPT_BOTTOM[context])
    155                   ufpt_update [context] = false;
    156                
    157                 tab_ufpt_depth[context] = ((depth==0)?_param->_size_ufpt_queue[context]:depth)-1;
     154                  ufpt_can_update [context] = false;
     155                else
     156                  // update pointer
     157                  tab_ufpt_depth[context] = ((depth==0)?_param->_size_ufpt_queue[context]:depth)-1;
    158158              }
    159159          }
    160160        else
    161161          {
    162             if (upt_update [context])
     162            if (upt_can_update [context])
    163163              {
    164164                // Update Prediction Table
    165                
     165
     166                // Read information
    166167                Tdepth_t            depth     = tab_upt_depth[context];
    167168                upt_state_t         state     = reg_UPDATE_PREDICTION_TABLE [context][depth]._state;
     
    174175                log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * condition       : %s",toString(condition).c_str());
    175176             
    176                 Tcontrol_t          state_is_ok_ko           = ((state == UPDATE_PREDICTION_STATE_OK   ) or
    177                                                                 (state == UPDATE_PREDICTION_STATE_KO   ));
    178 //                 Tcontrol_t          state_is_event           = ((state == UPDATE_PREDICTION_STATE_KO   ) or
    179 //                                                                 (state == UPDATE_PREDICTION_STATE_EVENT)//  or
    180 //                                                                 ((have_event[context])?(state == UPDATE_PREDICTION_STATE_OK):false)
    181 //                                                                 );
    182                
    183 //                 Tcontrol_t          state_is_event_update    = state_is_event and     need_update(condition);
    184 //                 Tcontrol_t          state_is_event_no_update = state_is_event and not need_update(condition);
    185 
    186                 if (retire_ras_from_upt [context])
     177                // is the valid branch (valid branch hit, or valid branch miss)
     178                Tcontrol_t          state_is_ok_ko = ((state == UPDATE_PREDICTION_STATE_OK   ) or
     179                                                      (state == UPDATE_PREDICTION_STATE_KO   ));
     180
     181                if (not flush_upt [context])
    187182                  {
    188 //                 val                   = state_is_event_update;
    189 //                 val_without_ack       = state_is_event_no_update;
    190                 val                   = ((state == UPDATE_PREDICTION_STATE_KO   ) or
    191                                          ((state == UPDATE_PREDICTION_STATE_EVENT) and need_update(condition)));
    192                 val_without_ack       = ((state == UPDATE_PREDICTION_STATE_EVENT) and not need_update(condition));
     183                    // no event, just update predictor
     184                val                   = (state == UPDATE_PREDICTION_STATE_OK);
     185                val_without_ack       = false;
    193186                  }
    194187                else
    195188                  {
    196                 val                   = (state == UPDATE_PREDICTION_STATE_OK);
    197                 val_without_ack       = false;
     189                    // event, restore event (if need update)
     190                val                   = ( (state == UPDATE_PREDICTION_STATE_KO   ) or
     191                                         ((state == UPDATE_PREDICTION_STATE_EVENT) and     need_update(condition)));
     192                val_without_ack       = ( (state == UPDATE_PREDICTION_STATE_EVENT) and not need_update(condition));
    198193                  }                 
    199194
     
    205200                btb_address_dest      = reg_UPDATE_PREDICTION_TABLE [context][depth]._address_dest;
    206201                btb_condition         = condition;
    207                 dir_val               = // state_is_ok_ko and
    208                                         update_dir(condition); // if not ifetch, then static prediction
     202                dir_val               = ifetch and update_dir(condition); // if not ifetch, then static prediction -> history is wrong
    209203                dir_history           = reg_UPDATE_PREDICTION_TABLE [context][depth]._history     ;
    210204                ras_val               = update_ras(condition); // repop/ repush data -> don't corrupt ras
    211                 ras_flush             = (state == UPDATE_PREDICTION_STATE_KO); // miss prediction, RAS is corrupted
     205                ras_flush             = (state == UPDATE_PREDICTION_STATE_KO); // miss prediction on RAS -> RAS is corrupted
    212206                ras_push              = push_ras(condition);
    213207                // If corrupt, RAS must be flushed.
     
    218212                internal_UPDATE_FROM_UFPT [i] = false;
    219213                internal_UPDATE_DEPTH     [i] = depth;
    220                 internal_UPDATE_RAS       [i] = retire_ras_from_upt [context];
     214                internal_UPDATE_RAS       [i] = flush_upt [context];
    221215
    222216                // Warning : don't update same entry
    223                 if (retire_ras_from_upt [context])
     217                if (flush_upt [context])
    224218                  {
    225                     // Restore RAS.
     219                    // Stop condition
    226220                    if ((depth == reg_UPT_BOTTOM[context]) or not (val or val_without_ack))
    227                       upt_update [context] = false;
     221                      upt_can_update [context] = false;
    228222                   
     223                    // flush -> ptr is decrease
    229224                    tab_upt_depth[context] = (depth==0)?(_param->_size_upt_queue[context]-1):(depth-1);
    230225                  }
    231226                else
    232227                  {
     228                    // Stop condition
    233229                    if ((depth == reg_UPT_TOP [context]) or not (val or val_without_ack))
    234                       upt_update [context] = false;
     230                      upt_can_update [context] = false;
    235231                   
     232                    // flush -> ptr is increase
    236233                    tab_upt_depth[context] = (depth+1)%_param->_size_upt_queue[context];
    237234                  }
     
    273270          }
    274271      }
    275    
     272    }
     273   
    276274    // ===================================================================
    277275    // =====[ BRANCH_EVENT ]==============================================
    278276    // ===================================================================
     277
     278    // For all context ...
    279279    for (uint32_t i=0; i<_param->_nb_context; i++)
    280280      {
    281         Tcontrol_t val = (reg_EVENT_STATE [i] == EVENT_STATE_UPDATE_CONTEXT);
    282 
     281        // ... send an event if upt must be update the context
     282        Tcontrol_t val = ((reg_UPT_EVENT_STATE [i] == UPT_EVENT_STATE_KO_DECODE_UPDATE_CONTEXT) or
     283                          (reg_UPT_EVENT_STATE [i] == UPT_EVENT_STATE_KO_COMMIT_UPDATE_CONTEXT));
    283284        PORT_WRITE(out_BRANCH_EVENT_VAL              [i],val);
    284285        if (_param->_have_port_depth)
     
    291292        internal_BRANCH_EVENT_VAL [i] = val;
    292293      }
     294
    293295      }
    294296    else
    295297      {
     298        // Reset
    296299        for (uint32_t i=0; i<_param->_nb_inst_update; i++)
    297300          {
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_transition.cpp

    r120 r122  
    5151            reg_IS_ACCURATE          [i] = true;
    5252           
    53             reg_EVENT_VAL            [i] = false;
    54             reg_EVENT_STATE          [i] = EVENT_STATE_OK;
    55             reg_EVENT_IS_BRANCH      [i] = true;
     53            reg_UFPT_EVENT_STATE     [i] = UFPT_EVENT_STATE_OK;
     54            reg_UPT_EVENT_STATE      [i] = UPT_EVENT_STATE_OK;
     55
     56//             reg_EVENT_VAL            [i] = false;
     57//             reg_EVENT_STATE          [i] = EVENT_STATE_OK;
     58//             reg_EVENT_IS_BRANCH      [i] = true;
    5659          }
    5760      }
     
    7477        for (uint32_t i=0; i<_param->_nb_context; i++)
    7578          {
     79            // -----------------------------
    7680            // UPDATE_FETCH_PREDICTION_TABLE
     81            // -----------------------------
    7782            {
    7883              uint32_t bottom = reg_UFPT_BOTTOM [i];
    79              
    80               // Test if state is end
    81               if (reg_UPDATE_FETCH_PREDICTION_TABLE [i][bottom]._state == UPDATE_FETCH_PREDICTION_STATE_END)
     84              bool     end    = (reg_UPDATE_FETCH_PREDICTION_TABLE [i][bottom]._state == UPDATE_FETCH_PREDICTION_STATE_END);
     85
     86              // Test if bottom slot can be remove
     87              if (end)
    8288                {
    8389                  log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UFPT [%d][%d]",i,bottom);
    8490                  log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UFPT [%d][%d].state =  UPDATE_FETCH_PREDICTION_STATE_EMPTY",i,bottom);
    85 
     91                 
    8692                  // Free slot
    8793                  reg_UPDATE_FETCH_PREDICTION_TABLE [i][bottom]._state = UPDATE_FETCH_PREDICTION_STATE_EMPTY;
    8894                  // Update pointer
    89                   reg_UFPT_BOTTOM [i] = (bottom+1)%_param->_size_ufpt_queue[i];
     95                  bottom = (bottom+1)%_param->_size_ufpt_queue[i];
     96
     97                  reg_UFPT_BOTTOM [i] = bottom;
    9098                }
    9199            }
    92100
     101            // -----------------------
    93102            // UPDATE_PREDICTION_TABLE
     103            // -----------------------
    94104            {
    95               uint32_t      bottom      = reg_UPT_BOTTOM [i];
    96               bool          end         = (reg_UPDATE_PREDICTION_TABLE [i][bottom]._state == UPDATE_PREDICTION_STATE_END);
    97 //               bool          end_ok      = (reg_UPDATE_PREDICTION_TABLE [i][bottom]._state == UPDATE_PREDICTION_STATE_END_OK);
    98 //               bool          end_ko      = (reg_UPDATE_PREDICTION_TABLE [i][bottom]._state == UPDATE_PREDICTION_STATE_END_KO);
    99 //               event_state_t event_state = reg_EVENT_STATE [i];
    100 
    101               // Test if state is end
    102 //               if (end_ok or end_ko)
    103              
    104               log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * state is STATE_END      : %d",end);
    105               log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_UPT_BOTTOM (before) : %d",reg_UPT_BOTTOM         [i]);
    106 
    107               if (end)
     105              uint32_t bottom = reg_UPT_BOTTOM [i];
     106
     107//               if (reg_UPT_EVENT_STATE [i] == UPT_EVENT_STATE_OK)
    108108                {
     109                  bool     end    = (reg_UPDATE_PREDICTION_TABLE [i][bottom]._state == UPDATE_PREDICTION_STATE_END);
     110                 
     111                  log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_UPT_BOTTOM (before) : %d",bottom);
     112                  log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * state is STATE_END      : %d",end);
     113                 
     114                  if (end)
     115                    {
    109116#if defined(DEBUG) and defined(DEBUG_Update_Prediction_Table) and (DEBUG_Update_Prediction_Table == true)
    110                   if (reg_UPDATE_PREDICTION_TABLE [i][bottom]._retire_ok)
    111                     {
    112                       uint32_t num_thread = _param->_translate_num_context_to_num_thread [i];
    113                       branchement_log_file [num_thread]
    114                         << std::hex
    115                         << "0x" << reg_UPDATE_PREDICTION_TABLE [i][bottom]._address_src       << " "
    116                         << "0x" << reg_UPDATE_PREDICTION_TABLE [i][bottom]._address_dest      << " "
    117                         << std::dec
    118                         <<         reg_UPDATE_PREDICTION_TABLE [i][bottom]._good_take         << " - "
    119                         << "["  << simulation_cycle() << "] " << " "
    120                         <<         reg_UPDATE_PREDICTION_TABLE [i][bottom]._miss_prediction   << " "
    121                         <<         reg_UPDATE_PREDICTION_TABLE [i][bottom]._ifetch_prediction << " "
    122                         << "("  << (uint32_t)reg_UPDATE_PREDICTION_TABLE [i][bottom]._condition         << ")"
    123                         << std::endl;
     117                      if (reg_UPDATE_PREDICTION_TABLE [i][bottom]._retire_ok)
     118                        {
     119                          uint32_t num_thread = _param->_translate_num_context_to_num_thread [i];
     120                          branchement_log_file [num_thread]
     121                            << std::hex
     122                            << "0x" << reg_UPDATE_PREDICTION_TABLE [i][bottom]._address_src       << " "
     123                            << "0x" << reg_UPDATE_PREDICTION_TABLE [i][bottom]._address_dest      << " "
     124                            << std::dec
     125                            <<         reg_UPDATE_PREDICTION_TABLE [i][bottom]._good_take         << " - "
     126                            << "["  << simulation_cycle() << "] " << " "
     127                            <<         reg_UPDATE_PREDICTION_TABLE [i][bottom]._miss_prediction   << " "
     128                            <<         reg_UPDATE_PREDICTION_TABLE [i][bottom]._ifetch_prediction << " "
     129                            << "("  << (uint32_t)reg_UPDATE_PREDICTION_TABLE [i][bottom]._condition         << ")"
     130                            << std::endl;
     131                        }
     132#endif
     133                     
     134                      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UPT [%d][%d]",i,bottom);
     135                      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UPT [%d][%d]._state =  UPDATE_PREDICTION_STATE_EMPTY",i,bottom);
     136                      // Free slot
     137                      reg_UPDATE_PREDICTION_TABLE [i][bottom]._state = UPDATE_PREDICTION_STATE_EMPTY;
     138                     
     139                      // Update pointer
     140                      reg_UPT_BOTTOM [i] = (bottom+1)%_param->_size_upt_queue[i];
     141                     
     142                      // Free a slot, test if bottom pointer overtake the top pointer
     143                      if (reg_UPT_BOTTOM [i] == reg_UPT_TOP [i])
     144                        reg_UPT_EMPTY [i] = true; // free a slot
     145                     
     146                      reg_EVENT_UPT_FULL [i] = false;
    124147                    }
    125 #endif
    126                   log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UPT [%d][%d]",i,bottom);
    127                   log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UPT [%d][%d]._state =  UPDATE_PREDICTION_STATE_EMPTY",i,bottom);
    128                   // Free slot
    129                   reg_UPDATE_PREDICTION_TABLE [i][bottom]._state = UPDATE_PREDICTION_STATE_EMPTY;
    130 
    131                   // Update pointer
    132                   reg_UPT_BOTTOM [i] = (bottom+1)%_param->_size_upt_queue[i];
    133148                 
    134                   if (reg_UPT_BOTTOM [i] == reg_UPT_TOP [i])
    135                     reg_UPT_EMPTY [i] = true; // free a slot
    136 
    137 //                   if (bottom = reg_UPT_UPDATE [i])
    138 //                     reg_UPT_UPDATE [i] = reg_UPT_BOTTOM [i];
    139                 }// @@@
    140              
    141               log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_UPT_BOTTOM (after ) : %d",reg_UPT_BOTTOM         [i]);
    142               log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_EVENT_VAL           : %d",reg_EVENT_VAL     [i]);
    143               log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_EVENT_UPT_PTR       : %d",reg_EVENT_UPT_PTR [i]);
    144               log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_EVENT_UPT_FULL      : %d",reg_EVENT_UPT_FULL[i]);
    145 
    146               if (reg_EVENT_VAL [i] and (reg_EVENT_UPT_PTR [i] == bottom))
    147                 {
    148                   log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * END EVENT");
    149 
    150                   if ((reg_EVENT_IS_BRANCH [i] == false) and (reg_EVENT_UPT_FULL [i] == false))
    151                     reg_EVENT_STATE[i] = EVENT_STATE_OK;
    152 
    153                   if ((reg_EVENT_IS_BRANCH [i] == true) or (reg_EVENT_UPT_FULL [i] == false))
    154                     {
    155                   reg_EVENT_VAL       [i] = false;
    156 //                reg_EVENT_IS_BRANCH [i] = true;
    157                   reg_UPT_TOP         [i] = reg_UPT_TOP_EVENT [i];
    158                   reg_UPT_UPDATE      [i] = reg_UPT_TOP_EVENT [i];
    159                  
    160                   if (reg_UPT_BOTTOM [i] != reg_UPT_TOP [i])
    161                     reg_UPT_EMPTY [i] = false;
    162                     }
    163 
    164                   log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_UPT_TOP             : %d",reg_UPT_TOP            [i]);
    165                   log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_UPT_TOP_EVENT       : %d",reg_UPT_TOP_EVENT      [i]);
    166                   log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_UPT_UPDATE          : %d",reg_UPT_UPDATE         [i]);
    167                   log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_UPT_EMPTY           : %d",reg_UPT_EMPTY          [i]);
    168                
     149                  log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_UPT_BOTTOM (after ) : %d",reg_UPT_BOTTOM         [i]);
    169150                }
    170              
    171               if (end)
    172                 reg_EVENT_UPT_FULL [i] = false;
    173151            }
    174152          }
     
    186164
    187165        for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
     166          // Test if have a transaction
    188167          if (PORT_READ(in_PREDICT_VAL[i]) and internal_PREDICT_ACK [i])
    189168            {
    190               Tcontext_t context = (_param->_have_port_context_id)?PORT_READ(in_PREDICT_CONTEXT_ID [i]):0;
    191               uint32_t   top     = internal_PREDICT_UPDATE_PREDICTION_ID [i];
     169              // get transaction information
     170              Tcontext_t          context     = (_param->_have_port_context_id)?PORT_READ(in_PREDICT_CONTEXT_ID [i]):0;
     171              uint32_t            top         = internal_PREDICT_UPDATE_PREDICTION_ID [i];
     172              Tbranch_condition_t condition   = PORT_READ(in_PREDICT_BTB_CONDITION [i]);
     173              bool                is_accurate = (_param->_always_accurate_predict or
     174                                                 (_param->_can_accurate_predict and PORT_READ(in_PREDICT_BTB_IS_ACCURATE [i])));
     175
    192176
    193177              log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * PREDICT[%d] - Accepted",i);
    194               log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * context : %d",context);
    195               log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * top     : %d",top);
     178              log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * context     : %d",context);
     179              log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * top         : %d",top);
     180              log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * condition   : %d",condition);
     181              log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * is_accurate : %d",is_accurate);
    196182
    197183#ifdef DEBUG_TEST
     
    200186#endif
    201187
     188              // Ifetch unit have fetch an instruction bundle with a branchement.
     189              // Insert in UFPT
    202190              log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UFPT [%d][%d].state <- UPDATE_FETCH_PREDICTION_STATE_WAIT_DECOD (predict)",context,top);
    203191              reg_UPDATE_FETCH_PREDICTION_TABLE [context][top]._state        = UPDATE_FETCH_PREDICTION_STATE_WAIT_DECOD;
    204192
    205               Tbranch_condition_t condition   = PORT_READ(in_PREDICT_BTB_CONDITION [i]);
    206               bool                is_accurate = _param->_accurate_block_predict or PORT_READ(in_PREDICT_BTB_IS_ACCURATE [i]);
     193              // Write information
    207194              reg_UPDATE_FETCH_PREDICTION_TABLE [context][top]._condition    = condition;
    208195              reg_UPDATE_FETCH_PREDICTION_TABLE [context][top]._address_src  = PORT_READ(in_PREDICT_BTB_ADDRESS_SRC  [i]);
     
    214201              reg_UPDATE_FETCH_PREDICTION_TABLE [context][top]._index_ras    = PORT_READ(in_PREDICT_RAS_INDEX        [i]);
    215202
     203              // Update pointer
    216204              reg_UFPT_TOP     [context] = (top+1)%_param->_size_ufpt_queue [context];
    217 //            reg_UFPT_UPDATE  [context] = reg_UFPT_TOP [context];
     205
     206              // Test if this branchement need update
    218207              if (need_update(condition))
    219208                {
    220209                  reg_UFPT_NB_NEED_UPDATE [context] ++;
    221210                  log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_UFPT_NB_NEED_UPDATE (after) : %d",reg_UFPT_NB_NEED_UPDATE [context]);
    222 
    223211                }
    224212            }
     
    239227
    240228        for (uint32_t i=0; i<_param->_nb_inst_decod; i++)
     229          // Test if have a decod transaction
    241230          if (PORT_READ(in_DECOD_VAL[i]) and internal_DECOD_ACK [i])
    242231            {
     232              // Read information
    243233              Tcontext_t          context       = (_param->_have_port_context_id)?PORT_READ(in_DECOD_CONTEXT_ID [i]):0;
    244234              Tcontrol_t          miss_ifetch   = PORT_READ(in_DECOD_MISS_IFETCH [i]);
    245235              Tcontrol_t          miss_decod    = PORT_READ(in_DECOD_MISS_DECOD  [i]);
    246236              uint32_t            upt_ptr_write = internal_DECOD_UPT_PTR_WRITE [i];
     237              uint32_t            top_next      = (upt_ptr_write+1)%_param->_size_upt_queue [context];
    247238              Tbranch_condition_t condition  ;
    248239              Tcontrol_t          is_accurate;
     
    257248              log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * upt_ptr_write : %d",upt_ptr_write);
    258249
    259               if (miss_ifetch or miss_decod)
     250              // In decod step, two miss type :
     251              // miss_ifetch = branch is previously predict (predict interface), but it's not the good
     252              // miss_decod  = branch was not detected
     253              if (not (miss_ifetch or miss_decod))
    260254                {
     255                  // Normal case : branch is previous predicted, change state of branch
     256
     257                  // Read ufpt_ptr (send in predic step)
     258                  uint32_t ufpt_ptr_read = (_param->_have_port_depth)?PORT_READ(in_DECOD_UPDATE_PREDICTION_ID [i]):0;
     259
     260                  log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * ufpt_ptr_read : %d",ufpt_ptr_read);
     261
     262#ifdef DEBUG_TEST
     263                  if (reg_UPDATE_FETCH_PREDICTION_TABLE [context][ufpt_ptr_read]._state != UPDATE_FETCH_PREDICTION_STATE_WAIT_DECOD)
     264                    throw ERRORMORPHEO(FUNCTION,_("Decod : invalid ufpt state."));
     265#endif
     266                  // Change state
     267                  log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UFPT [%d][%d].state <- UPDATE_FETCH_PREDICTION_STATE_END (decod - hit)",context,ufpt_ptr_read);
     268                  reg_UPDATE_FETCH_PREDICTION_TABLE [context][ufpt_ptr_read]._state = UPDATE_FETCH_PREDICTION_STATE_END;
     269
     270                  // Push upt (from Pop ufpt)
     271                  condition   = reg_UPDATE_FETCH_PREDICTION_TABLE [context][ufpt_ptr_read]._condition;
     272                  is_accurate = reg_UPDATE_FETCH_PREDICTION_TABLE [context][ufpt_ptr_read]._is_accurate;
     273
     274                  reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._condition         = condition;
     275                  reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._address_src       = reg_UPDATE_FETCH_PREDICTION_TABLE [context][ufpt_ptr_read]._address_src ;
     276                  reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._address_dest      = reg_UPDATE_FETCH_PREDICTION_TABLE [context][ufpt_ptr_read]._address_dest;
     277                  reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._last_take         = reg_UPDATE_FETCH_PREDICTION_TABLE [context][ufpt_ptr_read]._last_take   ;
     278//                reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._good_take;
     279                  reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._is_accurate       = is_accurate;
     280                  reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._history           = reg_UPDATE_FETCH_PREDICTION_TABLE [context][ufpt_ptr_read]._history     ;
     281                  reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._address_ras       = reg_UPDATE_FETCH_PREDICTION_TABLE [context][ufpt_ptr_read]._address_ras ;
     282                  reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._index_ras         = reg_UPDATE_FETCH_PREDICTION_TABLE [context][ufpt_ptr_read]._index_ras   ;
     283                  reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._ifetch_prediction = true ; // prediction from ifetch
     284
     285                  // Update pointer (now, this instruction is not in ufpt)
     286                  if (need_update(condition))
     287                    {
     288                      reg_UFPT_NB_NEED_UPDATE [context] --;
     289                      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_UFPT_NB_NEED_UPDATE (after) : %d",reg_UFPT_NB_NEED_UPDATE [context]);
     290                    }
     291                }
     292              else
     293                {
     294                  // Have a miss !!!
    261295                  log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * miss !!!");
    262296
    263                   // Have a miss !!!
    264297                  condition   = PORT_READ(in_DECOD_BTB_CONDITION [i]);
    265                   is_accurate = _param->_accurate_block_decod or PORT_READ(in_DECOD_IS_ACCURATE   [i]);
    266 
    267                   // if can_continue else don't wait the end of all instruction
    268                   // can_continue = not miss_commit and the destination is accurate (know)
     298                  is_accurate = (_param->_always_accurate_decod or
     299                                 (_param->_can_accurate_decod and PORT_READ(in_DECOD_IS_ACCURATE [i])));
     300
     301                  // if can_continue, don't wait the end of all instruction
     302                  // (can_continue = not miss_commit and the destination is accurate (know))
    269303                  Tcontrol_t can_continue = is_accurate;
    270304
    271305#ifdef DEBUG_TEST
    272                   if (reg_EVENT_STATE [context] != EVENT_STATE_OK)
    273                     throw ERRORMORPHEO(FUNCTION,_("Decod : invalid event state."));
    274 #endif
    275 
    276                   // miss_ifetch = branch is previously predict, but it's not the good
    277                   //   * need flush ufpt
    278                   // miss_decod  = branch was not detected
    279                   //   * not necessary
     306                  if (reg_UPT_EVENT_STATE [context] != UPT_EVENT_STATE_OK)
     307                    throw ERRORMORPHEO(FUNCTION,_("Decod : invalid upt event state."));
     308                  if (reg_UFPT_EVENT_STATE [context] != UFPT_EVENT_STATE_OK)
     309                    throw ERRORMORPHEO(FUNCTION,_("Decod : invalid ufpt event state."));
     310#endif
     311
     312                  // miss_ifetch -> need flush ufpt
     313                  // miss_decod  -> not necessary
     314                  // if can_continue (destination is know) and direction is not take (instruction in ifetch_queue can be valid)
     315                  bool flush_ufpt = (not (can_continue and not direction and not miss_ifetch));
    280316
    281317                  log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * can_continue: %d",can_continue);
    282318                  log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * direction   : %d",direction   );
    283319                  log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * miss_ifetch : %d",miss_ifetch );
    284                   log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * change    : %d",(not (can_continue and not direction and not miss_ifetch)));
    285 
    286                   // if can_continue (destination is know) and direction is not take, don't need flush fetch_unit.
    287                   if (not (can_continue and not direction and not miss_ifetch))
     320                  log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * flush_ufpt: %d",flush_ufpt  );
     321
     322                  // Test if can continue without flushing the ufpt (and ifetch_queue)
     323                  if (flush_ufpt)
    288324                    {
    289                       if (reg_UFPT_NB_NEED_UPDATE [context] == 0)
    290                         {
    291                           // Change state
    292                           log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * EVENT [%d] <- EVENT_STATE_UPDATE_CONTEXT (decod - miss - no flush ufpt)",context);
    293                           reg_EVENT_STATE [context] = EVENT_STATE_UPDATE_CONTEXT;
    294 //                        reg_EVENT_SOURCE[context] = EVENT_SOURCE_UFPT;
    295                         }
    296                       else
    297                         {
    298                           log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * EVENT [%d] <- EVENT_STATE_MISS_FLUSH_UFPT (decod - miss - flush ufpt)",context);
    299                           reg_EVENT_STATE [context] = EVENT_STATE_MISS_FLUSH_UFPT;
    300                         }
    301 
    302                       // Flush UPFT
     325//                       // Optimisation : Test if ufpt have entry that need update prediction struction (as Return Address Stack)
     326//                       if (reg_UFPT_NB_NEED_UPDATE [context] == 0)
     327//                         {
     328//                           // Change state
     329//                           log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UPT_EVENT [%d] <- UPT_EVENT_STATE_KO_COMMIT_UPDATE_CONTEXT (decod - miss - no flush ufpt)",context);
     330//                           reg_UPT_EVENT_STATE [context] = UPT_EVENT_STATE_KO_COMMIT_UPDATE_CONTEXT;
     331
     332//                           // @@@
     333// //                           // Have an actual event ?
     334// //                           if (not reg_EVENT_VAL [context])
     335// //                             reg_EVENT_UPT_PTR  [context] = upt_ptr_write;
     336//                         }
     337//                       else
     338//                         {
     339//                           log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * EVENT [%d] <- UPT_EVENT_STATE_KO_MISS_WAIT_UFPT (decod - miss - flush ufpt)",context);
     340//                           // just wait ufpt, don't flush upt
     341//                           reg_UPT_EVENT_STATE [context] = UPT_EVENT_STATE_KO_MISS_WAIT_UFPT;
     342//                         }
     343
     344                      reg_UPT_EVENT_STATE [context] = UPT_EVENT_STATE_KO_DECODE_UPDATE_CONTEXT;
     345                      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UPT_EVENT_STATE [%d] <- %s (decod, miss)",context,toString(reg_UPT_EVENT_STATE [context]).c_str());
     346
     347                      // Need Flush UPFT
    303348                      flush_UFPT [context] = true;
    304349
    305                       reg_EVENT_IS_BRANCH       [context] = true;
     350                      // Write information
     351//                       reg_EVENT_IS_BRANCH       [context] = true;
    306352                      reg_EVENT_DEPTH           [context] = upt_ptr_write;
    307353                      reg_EVENT_ADDRESS_SRC     [context] = address_src; // delay_slot is compute in Context_State
     
    310356                      reg_EVENT_CAN_CONTINUE    [context] = can_continue;
    311357                    }
    312                  
     358                  // else can continue
     359
    313360                  // Push upt (from decod interface)
    314361                  reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._condition         = condition;
     
    323370                  reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._ifetch_prediction = false; // static prediction
    324371                }
    325               else
    326                 {
    327                   // Normal case : branch is previous predicated, change state of branch
    328                   uint32_t ufpt_ptr_read = (_param->_have_port_depth)?PORT_READ(in_DECOD_UPDATE_PREDICTION_ID [i]):0;
    329 
    330                   log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * ufpt_ptr_read : %d",ufpt_ptr_read);
    331 
    332 #ifdef DEBUG_TEST
    333                   if (reg_UPDATE_FETCH_PREDICTION_TABLE [context][ufpt_ptr_read]._state != UPDATE_FETCH_PREDICTION_STATE_WAIT_DECOD)
    334                     throw ERRORMORPHEO(FUNCTION,_("Decod : invalid ufpt state."));
    335 #endif
    336                   // Change state
    337                   log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UFPT [%d][%d].state <- UPDATE_FETCH_PREDICTION_STATE_END (decod - hit)",context,ufpt_ptr_read);
    338                   reg_UPDATE_FETCH_PREDICTION_TABLE [context][ufpt_ptr_read]._state = UPDATE_FETCH_PREDICTION_STATE_END;
    339 
    340                   // Push upt (from Pop ufpt)
    341                   condition   = reg_UPDATE_FETCH_PREDICTION_TABLE [context][ufpt_ptr_read]._condition;
    342                   is_accurate = reg_UPDATE_FETCH_PREDICTION_TABLE [context][ufpt_ptr_read]._is_accurate;
    343 
    344                   reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._condition         = condition;
    345                   reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._address_src       = reg_UPDATE_FETCH_PREDICTION_TABLE [context][ufpt_ptr_read]._address_src ;
    346                   reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._address_dest      = reg_UPDATE_FETCH_PREDICTION_TABLE [context][ufpt_ptr_read]._address_dest;
    347                   reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._last_take         = reg_UPDATE_FETCH_PREDICTION_TABLE [context][ufpt_ptr_read]._last_take   ;
    348 //                reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._good_take;
    349                   reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._is_accurate       = is_accurate;
    350                   reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._history           = reg_UPDATE_FETCH_PREDICTION_TABLE [context][ufpt_ptr_read]._history     ;
    351                   reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._address_ras       = reg_UPDATE_FETCH_PREDICTION_TABLE [context][ufpt_ptr_read]._address_ras ;
    352                   reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._index_ras         = reg_UPDATE_FETCH_PREDICTION_TABLE [context][ufpt_ptr_read]._index_ras   ;
    353                   reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._ifetch_prediction = true ; // prediction from ifetch
    354 
    355                   // Update pointer
    356                   if (need_update(condition))
    357                     {
    358                       reg_UFPT_NB_NEED_UPDATE [context] --;
    359                       log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_UFPT_NB_NEED_UPDATE (after) : %d",reg_UFPT_NB_NEED_UPDATE [context]);
    360                     }
    361                 }
    362 
    363               // All case !!!
     372
     373              // In all case !!!
    364374#ifdef DEBUG_TEST
    365375              if (reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._state != UPDATE_PREDICTION_STATE_EMPTY)
     
    369379              // Change state
    370380              log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UPT  [%d][%d].state <- UPDATE_PREDICTION_STATE_WAIT_END (decod - hit)",context,upt_ptr_write);
    371               reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._state = UPDATE_PREDICTION_STATE_WAIT_END;
     381              reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._state       = UPDATE_PREDICTION_STATE_WAIT_END;
    372382              reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._retire_ok   = false;
    373383              reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._miss_commit = false;
     
    384394             
    385395              // Update pointer
    386               reg_UPT_TOP     [context] = (upt_ptr_write+1)%_param->_size_upt_queue [context];
    387               reg_UPT_EMPTY   [context] = false;
    388 //            reg_UPT_UPDATE  [context] = reg_UPT_TOP [context];
    389 
    390 //               if (miss_ifetch or miss_decod)
    391 //                 reg_UPT_TOP_EVENT [context] = reg_UPT_TOP [context];
     396              reg_UPT_TOP     [context] = top_next;
     397              reg_UPT_EMPTY   [context] = false; // new instruction
    392398            }
    393399
     
    400406            can_continue [i] = true;
    401407
     408          // For each updated instruction
    402409          for (uint32_t i=0; i<_param->_nb_inst_update; i++)
    403410            {
    404411              Tcontext_t context   = internal_UPDATE_CONTEXT_ID [i];
    405412
     413              // Test if transaction
     414              // (an val_with_out is an update and don't need update prediction structure
    406415              if ((internal_UPDATE_VAL[i] and PORT_READ(in_UPDATE_ACK [i])) or
    407416                  (internal_UPDATE_VAL_WITHOUT_ACK [i] and can_continue [context]))
     
    413422                  log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * depth   : %d",depth);
    414423                 
     424                  upt_event_state_t upt_event_state = reg_UPT_EVENT_STATE [context];
     425
     426                  // One interface to two source :
     427                  //   * from ufpt -> newest prediction
     428                  //   * from upt  -> oldest prediction
    415429                  if (internal_UPDATE_FROM_UFPT [i])
    416430                    {
    417431                      // if free a slot, also all queue is updated
    418432                      // Last slot ?
    419 //                       if (reg_UFPT_UPDATE [context] == reg_UFPT_BOTTOM [context])
    420433                      if ((--reg_UFPT_NB_UPDATE [context])==0)
    421434                        {
    422                           switch (reg_EVENT_STATE [context])
    423                             {
    424                             case EVENT_STATE_MISS_FLUSH_UFPT         :
    425                               {
    426                                 reg_EVENT_STATE [context] = EVENT_STATE_UPDATE_CONTEXT;
    427 //                                 reg_EVENT_SOURCE[context] = EVENT_SOURCE_UFPT;
    428 
    429                                 break;
    430                               }
    431                               // impossible to have an update on ufpt and reg_upt_update>reg_upt_top
    432                             case EVENT_STATE_MISS_FLUSH_UFPT_AND_UPT : reg_EVENT_STATE [context] = EVENT_STATE_MISS_FLUSH_UPT ; break;
    433                             case EVENT_STATE_EVENT_FLUSH_UFPT        : reg_EVENT_STATE [context] = EVENT_STATE_OK             ; break;
    434                             case EVENT_STATE_EVENT_FLUSH_UFPT_AND_UPT: reg_EVENT_STATE [context] = EVENT_STATE_EVENT_FLUSH_UPT; break;
    435                             default : break;
    436                             }
     435                          log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UFPT_EVENT [%d] <- UFPT_EVENT_STATE_OK (update - end flush ufpt)",context);
     436                          reg_UFPT_EVENT_STATE    [context] = UFPT_EVENT_STATE_OK;
     437                          reg_UFPT_NB_NEED_UPDATE [context] = 0;
     438
     439//                           // Test upt event to change state
     440//                           // test if upt wait ufpt
     441//                           switch (upt_event_state)
     442//                             {
     443//                               // this case when don't need flush upt (miss decod and can continue)
     444//                             case UPT_EVENT_STATE_KO_MISS_WAIT_UFPT  : upt_event_state = UPT_EVENT_STATE_KO_COMMIT_UPDATE_CONTEXT; break;
     445//                             case UPT_EVENT_STATE_KO_EVENT_WAIT_UFPT : upt_event_state = UPT_EVENT_STATE_OK              ; break;
     446//                             default : break;
     447//                             }
     448
     449//                           reg_UPT_EVENT_STATE [context] = upt_event_state;
    437450                        }
    438451                     
     
    453466                      reg_UFPT_UPDATE [context] = ((depth==0)?_param->_size_ufpt_queue[context]:depth)-1;
    454467                      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_UFPT_UPDATE (after ) : %d",reg_UFPT_UPDATE [context]);
    455                       // Free a register that need update ?
    456                       if (need_update(reg_UPDATE_FETCH_PREDICTION_TABLE [context][depth]._condition))
    457                         {
    458                           reg_UFPT_NB_NEED_UPDATE [context] --;
    459                           log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_UFPT_NB_NEED_UPDATE (after) : %d",reg_UFPT_NB_NEED_UPDATE [context]);
    460                         }
    461468                    }
    462469                  else
     
    464471                      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * Update Prediction Table");
    465472                      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_UPT_UPDATE (before) : %d",reg_UPT_UPDATE [context]);
    466                       log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_EVENT_STATE         : %s",toString(reg_EVENT_STATE [context]).c_str());
     473                      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_UPT_EVENT_STATE     : %s",toString(upt_event_state).c_str());
    467474 
    468475                      // Change state
     
    481488#endif
    482489
    483 //                    bool have_event = ((reg_UPDATE_PREDICTION_TABLE [context][depth]._state == UPDATE_PREDICTION_STATE_KO) or
    484 //                                       (reg_UPDATE_PREDICTION_TABLE [context][depth]._state == UPDATE_PREDICTION_STATE_EVENT));
    485490#ifdef STATISTICS
    486491                      Tbranch_condition_t condition = reg_UPDATE_PREDICTION_TABLE [context][depth]._condition;
    487492#endif
    488                       bool ok     = (reg_UPDATE_PREDICTION_TABLE [context][depth]._state == UPDATE_PREDICTION_STATE_OK);
    489                       bool ko     = (reg_UPDATE_PREDICTION_TABLE [context][depth]._state == UPDATE_PREDICTION_STATE_KO);
    490 
     493                      bool ok = (reg_UPDATE_PREDICTION_TABLE [context][depth]._state == UPDATE_PREDICTION_STATE_OK);
     494                      bool ko = (reg_UPDATE_PREDICTION_TABLE [context][depth]._state == UPDATE_PREDICTION_STATE_KO);
     495
     496                      // Test if branch is valid (prediction can be incorrect)
    491497                      if (ok or ko)
    492498                        {
     
    508514                      if (ko)
    509515                        {
    510                           // Ko : wait end of all instruction
    511 //                           log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UPT  [%d][%d].state <- UPDATE_PREDICTION_STATE_END_KO_WAIT_END (update)",context,depth);
    512                          
    513 //                           reg_UPDATE_PREDICTION_TABLE [context][depth]._state = UPDATE_PREDICTION_STATE_END_KO_WAIT_END;
    514 
     516                          // Ko
    515517                          log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UPT  [%d][%d].state <- UPDATE_PREDICTION_STATE_END_KO (update)",context,depth);
    516518                         
     519                          // Wait update of context_state
    517520                          reg_UPDATE_PREDICTION_TABLE [context][depth]._state = UPDATE_PREDICTION_STATE_END_KO;
    518521
    519                           reg_EVENT_VAL      [context] = true;
    520522                          reg_EVENT_UPT_PTR  [context] = depth;
    521 //                        reg_EVENT_UPT_FULL [context] = 0;
    522 //                        reg_EVENT_UPT_FULL        [i] = (not reg_UPT_EMPTY [i] and (bottom == reg_UPT_TOP [i]));
    523 
    524523
    525524#ifdef STATISTICS
     
    530529                      else
    531530                        {
    532 //                           log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UPT  [%d][%d].state <- UPDATE_PREDICTION_STATE_END_OK (update)",context,depth);
    533 //                           reg_UPDATE_PREDICTION_TABLE [context][depth]._state = UPDATE_PREDICTION_STATE_END_OK;
     531                          // ok or event
    534532
    535533                          log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UPT  [%d][%d].state <- UPDATE_PREDICTION_STATE_END (update)",context,depth);
     
    564562//                            reg_UPT_UPDATE [context] = reg_UPT_BOTTOM[context];
    565563
    566                               if (reg_EVENT_STATE [context] == EVENT_STATE_EVENT_FLUSH_UPT)
     564                              switch (upt_event_state)
    567565                                {
    568                                   reg_EVENT_STATE [context] = EVENT_STATE_OK;
     566                                  // this case when don't need flush upt (miss decod and can continue)
     567                                case UPT_EVENT_STATE_KO_MISS_FLUSH_UPT  : upt_event_state = UPT_EVENT_STATE_KO_COMMIT_UPDATE_CONTEXT; break;
     568                                case UPT_EVENT_STATE_KO_EVENT_FLUSH_UPT :
     569                                  {
     570                                    upt_event_state = UPT_EVENT_STATE_OK;
     571                                    reg_UPT_TOP    [context] = reg_UPT_TOP_EVENT [context];
     572                                    reg_UPT_UPDATE [context] = reg_UPT_TOP_EVENT [context];
     573
     574                                    break;
     575                                  }
     576                                default : break;
    569577                                }
    570                               else
    571                                 {
    572                                   reg_EVENT_STATE [context] = EVENT_STATE_UPDATE_CONTEXT;
    573 //                                   reg_EVENT_SOURCE[context] = EVENT_SOURCE_UPT;
    574                                 }
     578                             
     579                              reg_UPT_EVENT_STATE [context] = upt_event_state;
    575580                            }
    576581                          else
    577582                            {
     583                              // else, decrease update pointer
    578584                              reg_UPT_UPDATE [context] = (((depth==0)?_param->_size_upt_queue[context]:depth)-1);
    579585                            }
     
    587593                        }
    588594                     
    589                       // Free the branch with no accurate ?
     595                      // Test if freeing the branch with no accurate ?
    590596                      if ((reg_UPDATE_PREDICTION_TABLE [context][depth]._is_accurate == false) and not ko)
    591597                        reg_IS_ACCURATE [context] = true;
    592598
    593599                      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_UPT_UPDATE (after ) : %d",reg_UPT_UPDATE[context]);
    594                       log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_EVENT_STATE         : %s",toString(reg_EVENT_STATE [context]).c_str());
     600                      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_UPT_EVENT_STATE     : %s",toString(reg_UPT_EVENT_STATE [context]).c_str());
    595601                    }
    596602                }
     
    611617        //     * update status
    612618        //   * Miss prediction :
    613         for (uint32_t i=0; i<_param->_nb_inst_branch_complete; i++)
    614           if (PORT_READ(in_BRANCH_COMPLETE_VAL[i]) and internal_BRANCH_COMPLETE_ACK [i])
    615             {
    616               Tcontext_t context   = (_param->_have_port_context_id)?PORT_READ(in_BRANCH_COMPLETE_CONTEXT_ID [i]):0;
    617               Tdepth_t   depth     = (_param->_have_port_depth     )?PORT_READ(in_BRANCH_COMPLETE_DEPTH      [i]):0;
    618               Tcontrol_t miss      = internal_BRANCH_COMPLETE_MISS_PREDICTION [i];
    619               Tcontrol_t good_take = internal_BRANCH_COMPLETE_TAKE            [i];
    620               Taddress_t good_addr = internal_BRANCH_COMPLETE_ADDRESS_DEST    [i];
    621 
    622               log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * BRANCH_COMPLETE[%d] - Accepted",i);
    623               log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * context             : %d",context);
    624               log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * depth               : %d",depth);
    625               log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * miss                : %d",miss);
    626               log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_EVENT_STATE     : %s",toString(reg_EVENT_STATE [context]).c_str());
    627              
    628               if (miss)
    629                 {
    630                   // Flush UPT
    631                   uint32_t      top                 = reg_UPT_TOP [context];
    632                   uint32_t      new_update          = ((top==0)?_param->_size_upt_queue[context]:top)-1;
    633                                                    
    634                   Taddress_t    address_src         = reg_UPDATE_PREDICTION_TABLE [context][depth]._address_src;
    635                   event_state_t event_state         = reg_EVENT_STATE [context];
    636                   upt_state_t   event_top           = reg_UPDATE_PREDICTION_TABLE [context][top]._state;
    637 
    638                   log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * event_top           : %s",toString(event_top).c_str());
    639 
    640                   bool          previous_ufpt_event = ((event_state == EVENT_STATE_MISS_FLUSH_UFPT_AND_UPT ) or
    641                                                        (event_state == EVENT_STATE_MISS_FLUSH_UFPT         ) or
    642                                                        (event_state == EVENT_STATE_EVENT_FLUSH_UFPT_AND_UPT) or
    643                                                        (event_state == EVENT_STATE_EVENT_FLUSH_UFPT        ));
    644 
    645                   bool          previous_upt_event  = (false
    646                                                        or  (event_state == EVENT_STATE_MISS_FLUSH_UFPT_AND_UPT )
    647                                                        or  (event_state == EVENT_STATE_MISS_FLUSH_UPT          )
    648                                                        or  (event_state == EVENT_STATE_EVENT_FLUSH_UFPT_AND_UPT)
    649                                                        or  (event_state == EVENT_STATE_EVENT_FLUSH_UPT         )
    650                                                        or  (event_top   == UPDATE_PREDICTION_STATE_END_KO      )
    651                                                        or  (event_top   == UPDATE_PREDICTION_STATE_KO          )
    652 //                                                     or  (event_state == EVENT_STATE_WAIT_END_EVENT          )
    653 //                                                        or ((event_state == EVENT_STATE_UPDATE_CONTEXT          )
    654 //                                                            and (reg_EVENT_SOURCE [context] == EVENT_SOURCE_UPT))
    655                                                        );
    656 //                bool          update_ras     = (new_update != depth);
    657 
    658                   log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * top                 : %d",top);
    659                   log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * new_update          : %d",new_update);
    660 //                log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * update_ras          : %d",update_ras);
    661                   log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * previous_upt_event  : %d",previous_upt_event);
    662                   log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * previous_ufpt_event : %d",previous_ufpt_event);
    663                   log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_UPT_UPDATE      : %d",reg_UPT_UPDATE [context]);
    664                          
    665                   // Have a miss !!!
    666                   // Flush UPFT
    667                   flush_UFPT [context] |= not previous_ufpt_event;
    668                  
    669                   if (reg_UPDATE_PREDICTION_TABLE [context][depth]._state == UPDATE_PREDICTION_STATE_WAIT_END)
    670                     {
    671                       for (uint32_t j=(depth+1)%_param->_size_upt_queue[context];
    672                            j!=top;
    673                            j=(j+1)%_param->_size_upt_queue[context])
    674                         {
    675                           reg_UPDATE_PREDICTION_TABLE [context][j]._state = UPDATE_PREDICTION_STATE_EVENT;
    676                           reg_UPDATE_PREDICTION_TABLE [context][j]._retire_ok = false;
    677                         }
    678                      
    679                  
    680 //                    reg_UPT_BOTTOM    [context];
    681                       reg_UPT_TOP       [context] = depth;
    682 //                    reg_UPT_TOP_EVENT [context] = top;
    683                      
    684                       if (not previous_upt_event)
    685                         {
    686                           reg_UPT_TOP_EVENT [context] = top;
    687                           reg_UPT_UPDATE    [context] = new_update;
    688                         }
    689                       else
    690                         {
    691                           // Have event. Top index this slot
    692                           reg_UPDATE_PREDICTION_TABLE [context][top]._retire_ok = false;
    693 
    694                           switch (event_top)
    695                             {
    696                             case UPDATE_PREDICTION_STATE_END_KO :
     619        {
     620          bool branch_complete_miss [_param->_nb_context];
     621          for (uint32_t i=0; i<_param->_nb_context; ++i)
     622            branch_complete_miss [i] = false;
     623
     624          for (uint32_t i=0; i<_param->_nb_inst_branch_complete; i++)
     625            if (PORT_READ(in_BRANCH_COMPLETE_VAL[i]) and internal_BRANCH_COMPLETE_ACK [i])
     626              {
     627                // Read information
     628                Tcontext_t context   = (_param->_have_port_context_id)?PORT_READ(in_BRANCH_COMPLETE_CONTEXT_ID [i]):0;
     629                Tdepth_t   depth     = (_param->_have_port_depth     )?PORT_READ(in_BRANCH_COMPLETE_DEPTH      [i]):0;
     630                Tcontrol_t miss      = internal_BRANCH_COMPLETE_MISS_PREDICTION [i];
     631                Tcontrol_t good_take = internal_BRANCH_COMPLETE_TAKE            [i];
     632                Taddress_t good_addr = internal_BRANCH_COMPLETE_ADDRESS_DEST    [i];
     633               
     634                upt_event_state_t upt_event_state  = reg_UPT_EVENT_STATE [context];
     635               
     636                log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * BRANCH_COMPLETE[%d] - Accepted",i);
     637                log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * context             : %d",context);
     638                log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * depth               : %d",depth);
     639                log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * miss                : %d",miss);
     640                log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_UPT_EVENT_STATE : %s",toString(upt_event_state).c_str());
     641               
     642                // Test if the completed branch is a speculation miss
     643                if (miss)
     644                  {
     645                    // special case : two branch complete on the same context.
     646                    // when the re order keep the order, the branch complete j is most speculative that the branch comple i if i < j
     647                    if (not branch_complete_miss [context])
     648                      {
     649                        branch_complete_miss [context] = true;
     650                        // Flush UPT
     651                        // get information
     652                        uint32_t          top                 = reg_UPT_TOP [context];
     653                        uint32_t          new_update          = ((top==0)?_param->_size_upt_queue[context]:top)-1;
     654                       
     655                        Taddress_t        address_src         = reg_UPDATE_PREDICTION_TABLE [context][depth]._address_src;
     656                        upt_state_t       event_top           = reg_UPDATE_PREDICTION_TABLE [context][top]._state;
     657                       
     658                        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * upt_event_state     : %s",toString(upt_event_state).c_str());
     659                        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * event_top           : %s",toString(event_top).c_str());
     660                       
     661                        bool              previous_ufpt_event = (reg_UFPT_EVENT_STATE [i] == UFPT_EVENT_STATE_KO_FLUSH);
     662                       
     663                       
     664                        bool              previous_upt_event  = (false
     665                                                                 or (upt_event_state == UPT_EVENT_STATE_KO_MISS_WAIT_UFPT )
     666                                                                 or (upt_event_state == UPT_EVENT_STATE_KO_MISS_FLUSH_UPT )
     667                                                                 or (upt_event_state == UPT_EVENT_STATE_KO_EVENT_WAIT_UFPT)
     668                                                                 or (upt_event_state == UPT_EVENT_STATE_KO_EVENT_FLUSH_UPT)
     669                                                                 or (event_top       == UPDATE_PREDICTION_STATE_END_KO    )
     670                                                                 or (event_top       == UPDATE_PREDICTION_STATE_KO        )
     671                                                                 );
     672                       
     673                        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * top                 : %d",top);
     674                        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * new_update          : %d",new_update);
     675                        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * previous_upt_event  : %d",previous_upt_event);
     676                        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * previous_ufpt_event : %d",previous_ufpt_event);
     677                        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_UPT_UPDATE      : %d",reg_UPT_UPDATE [context]);
     678                       
     679                        // Have a miss !!!
     680                        // Flush UPFT
     681                        flush_UFPT [context] |= not previous_ufpt_event;
     682                       
     683                        // Test if the entry wait the branchment (else, they have a previous event)
     684                        if (reg_UPDATE_PREDICTION_TABLE [context][depth]._state == UPDATE_PREDICTION_STATE_WAIT_END)
     685                          {
     686                            // All instruction between the instruction and the top is disable
     687                            for (uint32_t j=(depth+1)%_param->_size_upt_queue[context];
     688                                 j!=top;
     689                                 j=(j+1)%_param->_size_upt_queue[context])
    697690                              {
    698                                 // Have already update predictor
    699                                 reg_UPDATE_PREDICTION_TABLE [context][top]._state = UPDATE_PREDICTION_STATE_END;
    700                                 reg_UPT_UPDATE              [context] = new_update;
    701                                 break;
     691                                reg_UPDATE_PREDICTION_TABLE [context][j]._state     = UPDATE_PREDICTION_STATE_EVENT;
     692                                reg_UPDATE_PREDICTION_TABLE [context][j]._retire_ok = false; // event
    702693                              }
    703                             case UPDATE_PREDICTION_STATE_KO :
     694                           
     695                            // New top
     696                            reg_UPT_TOP       [context] = depth;
     697                           
     698                            if (not previous_upt_event)
    704699                              {
    705                                 // Doesn't have update predictor
    706                                 reg_UPDATE_PREDICTION_TABLE [context][top]._state = UPDATE_PREDICTION_STATE_EVENT;
    707                                 break;
     700                                reg_UPT_TOP_EVENT [context] = top;
     701                                reg_UPT_UPDATE    [context] = new_update;
    708702                              }
    709                             default :
     703                            else
    710704                              {
    711 //                                 reg_UPDATE_PREDICTION_TABLE [context][top]._state = UPDATE_PREDICTION_STATE_EVENT;
     705                                // Have event. Top index this slot
     706                                reg_UPDATE_PREDICTION_TABLE [context][top]._retire_ok = false;
     707                               
     708                                switch (event_top)
     709                                  {
     710                                  case UPDATE_PREDICTION_STATE_END_KO :
     711                                    {
     712                                      // Have already update predictor
     713                                      reg_UPDATE_PREDICTION_TABLE [context][top]._state = UPDATE_PREDICTION_STATE_END;
     714                                      reg_UPT_UPDATE              [context] = new_update;
     715                                      break;
     716                                    }
     717                                  case UPDATE_PREDICTION_STATE_KO :
     718                                    {
     719                                      // Doesn't have update predictor
     720                                      reg_UPDATE_PREDICTION_TABLE [context][top]._state = UPDATE_PREDICTION_STATE_EVENT;
     721                                      break;
     722                                    }
     723                                  default :
     724                                    {
     725                                      //                                 reg_UPDATE_PREDICTION_TABLE [context][top]._state = UPDATE_PREDICTION_STATE_EVENT;
    712726//                                 break;
    713 
     727                                     
    714728#ifdef DEBUG_TEST
    715                                 throw ERRORMORPHEO(FUNCTION,_("Branch complete : invalid upt state."));
    716 #endif
     729                                      throw ERRORMORPHEO(FUNCTION,_("Branch complete : invalid upt state."));
     730#endif
     731                                    }
     732                                  }
    717733                              }
    718                             }
    719                         }
    720                      
    721                       if (reg_UPT_BOTTOM [context] == reg_UPT_TOP [context])
    722                         reg_UPT_EMPTY [context] = true;
    723                      
    724                       log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UPT  [%d][%d].state <- UPDATE_PREDICTION_STATE_KO (branch_complete, ifetch hit)",context,depth);
    725                       reg_UPDATE_PREDICTION_TABLE [context][depth]._state = UPDATE_PREDICTION_STATE_KO;
    726 
    727                       log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_UFPT_NB_NEED_UPDATE [%d] : %d",context,reg_UFPT_NB_NEED_UPDATE [context]);
    728                      
    729                       if ( (reg_UFPT_NB_NEED_UPDATE [context] > 0) or
    730                            (reg_UFPT_NB_UPDATE      [context] > 0))
    731                         {
    732                           log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * EVENT [%d] <- EVENT_STATE_MISS_FLUSH_UFPT_AND_UPT (branch_complete - miss)",context);
    733                           reg_EVENT_STATE [context] = EVENT_STATE_MISS_FLUSH_UFPT_AND_UPT;
    734                         }
    735                       else
    736                         {
    737 //                        if (not previous_update_ras)
    738                           {
    739                             // have ras prediction ?
    740                             log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * EVENT [%d] <- EVENT_STATE_MISS_FLUSH_UPT (branch_complete - miss)",context);
    741734                           
    742                             reg_EVENT_STATE [context] = EVENT_STATE_MISS_FLUSH_UPT;
     735                            if (reg_UPT_BOTTOM [context] == reg_UPT_TOP [context])
     736                              reg_UPT_EMPTY [context] = true;
     737                           
     738                            log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UPT  [%d][%d].state <- UPDATE_PREDICTION_STATE_KO (branch_complete, ifetch hit)",context,depth);
     739                            reg_UPDATE_PREDICTION_TABLE [context][depth]._state = UPDATE_PREDICTION_STATE_KO;
     740                           
     741                            log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_UFPT_NB_NEED_UPDATE [%d] : %d",context,reg_UFPT_NB_NEED_UPDATE [context]);
     742                           
     743//                       if ( (reg_UFPT_NB_NEED_UPDATE [context] > 0) or
     744//                            (reg_UFPT_NB_UPDATE      [context] > 0))
     745//                         {
     746//                           log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * EVENT [%d] <- EVENT_STATE_MISS_FLUSH_UFPT_AND_UPT (branch_complete - miss)",context);
     747//                           reg_EVENT_STATE [context] = EVENT_STATE_MISS_FLUSH_UFPT_AND_UPT;
     748//                         }
     749//                       else
     750//                         {
     751// //                        if (not previous_update_ras)
     752//                           {
     753//                             // have ras prediction ?
     754//                             log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * EVENT [%d] <- EVENT_STATE_MISS_FLUSH_UPT (branch_complete - miss)",context);
     755                           
     756//                             reg_EVENT_STATE [context] = EVENT_STATE_MISS_FLUSH_UPT;
     757                           
     758//                           }
     759//                         }
     760
     761                            reg_UPT_EVENT_STATE [context] = UPT_EVENT_STATE_KO_MISS_FLUSH_UPT;
     762                            log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UPT_EVENT_STATE [%d] <- %s (branch_complete, ifetch hit)",context,toString(reg_UPT_EVENT_STATE [context]).c_str());
     763                           
     764                            //                       reg_EVENT_SOURCE          [context] = EVENT_SOURCE_UPT;
     765                           
     766                            // else no update
     767                           
     768                            //                       reg_EVENT_IS_BRANCH       [context] = true;
     769                            reg_EVENT_DEPTH           [context] = depth;
     770                            reg_EVENT_ADDRESS_SRC     [context] = address_src; // delay_slot is compute in Context_State
     771                            reg_EVENT_ADDRESS_DEST_VAL[context] = good_take;
     772                            reg_EVENT_ADDRESS_DEST    [context] = good_addr;
     773                            reg_EVENT_CAN_CONTINUE    [context] = false;
    743774                           
    744775                          }
    745                         }
    746 //                       reg_EVENT_SOURCE          [context] = EVENT_SOURCE_UPT;
    747                      
    748                       // else no update
    749                      
    750                       reg_EVENT_IS_BRANCH       [context] = true;
    751                       reg_EVENT_DEPTH           [context] = depth;
    752                       reg_EVENT_ADDRESS_SRC     [context] = address_src; // delay_slot is compute in Context_State
    753                       reg_EVENT_ADDRESS_DEST_VAL[context] = good_take;
    754                       reg_EVENT_ADDRESS_DEST    [context] = good_addr;
    755                       reg_EVENT_CAN_CONTINUE    [context] = false;
    756 
    757                     }
    758                   reg_UPDATE_PREDICTION_TABLE [context][depth]._miss_commit = true;
    759                 }
    760               else
    761                 {
     776                       
     777                        reg_UPDATE_PREDICTION_TABLE [context][depth]._miss_commit = true;
     778                      }
     779                  }
     780                else
     781                  {
    762782                  // Hit case
    763783
     
    767787// #endif
    768788
    769                   if (reg_UPDATE_PREDICTION_TABLE [context][depth]._state == UPDATE_PREDICTION_STATE_WAIT_END)
    770                     {
    771                       log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UPT  [%d][%d].state <- UPDATE_PREDICTION_STATE_OK (branch_complete, ifetch hit)",context,depth);
    772                       reg_UPDATE_PREDICTION_TABLE [context][depth]._state = UPDATE_PREDICTION_STATE_OK;
    773                     }
    774                 }
    775 
    776               log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_EVENT_STATE     : %s",toString(reg_EVENT_STATE [context]).c_str());
    777 
    778               // In all case : update good_take
    779               reg_UPDATE_PREDICTION_TABLE [context][depth]._good_take    = good_take;
    780 
    781               // Write address_dest if need read register
    782               Tbranch_condition_t condition = reg_UPDATE_PREDICTION_TABLE [context][depth]._condition;
    783              
    784               if ((condition == BRANCH_CONDITION_READ_REGISTER_WITHOUT_WRITE_STACK) or
    785                   (condition == BRANCH_CONDITION_READ_REGISTER_WITH_WRITE_STACK   ) or
    786                   (condition == BRANCH_CONDITION_READ_STACK                       ) )
    787                 reg_UPDATE_PREDICTION_TABLE [context][depth]._address_dest = good_addr;
    788             }
    789 
     789                  // In same cycle, can have a previous branch_complete
     790                    if (reg_UPDATE_PREDICTION_TABLE [context][depth]._state == UPDATE_PREDICTION_STATE_WAIT_END)
     791                      {
     792                        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UPT  [%d][%d].state <- UPDATE_PREDICTION_STATE_OK (branch_complete, ifetch hit)",context,depth);
     793                        reg_UPDATE_PREDICTION_TABLE [context][depth]._state = UPDATE_PREDICTION_STATE_OK;
     794                      }
     795                  }
     796               
     797                log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_UPT_EVENT_STATE : %s",toString(reg_UPT_EVENT_STATE [context]).c_str());
     798               
     799                // In all case : update good_take
     800                reg_UPDATE_PREDICTION_TABLE [context][depth]._good_take    = good_take;
     801               
     802                // Write address_dest if need read register
     803                Tbranch_condition_t condition = reg_UPDATE_PREDICTION_TABLE [context][depth]._condition;
     804               
     805                if ((condition == BRANCH_CONDITION_READ_REGISTER_WITHOUT_WRITE_STACK) or
     806                    (condition == BRANCH_CONDITION_READ_REGISTER_WITH_WRITE_STACK   ) or
     807                    (condition == BRANCH_CONDITION_READ_STACK                       ) )
     808                  reg_UPDATE_PREDICTION_TABLE [context][depth]._address_dest = good_addr;
     809              }
     810        }
    790811
    791812        // ===================================================================
     
    797818              log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * BRANCH_EVENT [%d] - Accepted",i);
    798819
    799               // if different : an other branch is occured
    800               if (reg_EVENT_STATE        [i] == EVENT_STATE_UPDATE_CONTEXT)
     820              upt_event_state_t upt_event_state  = reg_UPT_EVENT_STATE [i];
     821             
     822              switch (upt_event_state)
    801823                {
    802                   // Change state
    803                   log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * EVENT [%d] <- EVENT_STATE_WAIT_END_EVENT (branch_event)",i);
    804                   reg_EVENT_STATE [i] = EVENT_STATE_WAIT_END_EVENT;
     824                case UPT_EVENT_STATE_KO_DECODE_UPDATE_CONTEXT : upt_event_state = UPT_EVENT_STATE_KO_DECODE_WAIT_END_EVENT; break;
     825                case UPT_EVENT_STATE_KO_COMMIT_UPDATE_CONTEXT : upt_event_state = UPT_EVENT_STATE_KO_COMMIT_WAIT_END_EVENT; break;
     826                default : break; // an other branch is occured
    805827                }
     828
     829              reg_UPT_EVENT_STATE [i] = upt_event_state;
     830              log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_UPT_EVENT_STATE : %s (branch_event)",toString(upt_event_state).c_str());
    806831            }
    807832
     
    826851              //   * EVENT_TYPE_CSYNC              - nothing
    827852             
    828               Tevent_type_t  event_type  = PORT_READ(in_EVENT_TYPE  [i]);
     853              Tevent_type_t     event_type      = PORT_READ(in_EVENT_TYPE  [i]);
     854              upt_event_state_t upt_event_state = reg_UPT_EVENT_STATE [i];
    829855
    830856              // Test if end of miss -> all previous branch is complete
     
    837863                    log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * type  : EVENT_TYPE_BRANCH_MISS_SPECULATION");
    838864
    839 // #ifdef DEBUG_TEST
    840 //                     if (reg_EVENT_STATE [i] != EVENT_STATE_WAIT_END_EVENT)
    841 //                       throw ERRORMORPHEO(FUNCTION,_("Event : invalid event state."));
    842 // #endif
    843                     // Special case : test if event and branch_complete !
    844                     if (reg_EVENT_STATE [i] == EVENT_STATE_WAIT_END_EVENT)
     865                    switch (upt_event_state)
    845866                      {
    846                    
    847                         // Change state
    848                         log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * EVENT [%d] <- EVENT_STATE_OK (event)",i);
    849                        
    850                         reg_EVENT_STATE [i] = EVENT_STATE_OK;
    851                         reg_IS_ACCURATE [i] = true;
    852                        
    853                         Tdepth_t depth = reg_EVENT_UPT_PTR [i];
    854                        
    855                         if (reg_UPDATE_PREDICTION_TABLE [i][depth]._state == UPDATE_PREDICTION_STATE_END_KO)
    856                           {
    857                             log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UPT  [%d][%d].state <- UPDATE_PREDICTION_STATE_END (event)",i,depth);
    858                            
    859                             reg_UPDATE_PREDICTION_TABLE [i][depth]._state = UPDATE_PREDICTION_STATE_END;
    860                           }
    861                        
    862 #ifdef DEBUG_TEST
    863 //                     if (reg_UPDATE_PREDICTION_TABLE [i][depth]._state != UPDATE_PREDICTION_STATE_END_KO_WAIT_END)
    864 //                       throw ERRORMORPHEO(FUNCTION,_("Event : invalid upt event state."));
    865 //                  if (reg_UPDATE_PREDICTION_TABLE [i][depth]._state != UPDATE_PREDICTION_STATE_END_KO)
    866 //                    throw ERRORMORPHEO(FUNCTION,_("Event : invalid upt event state."));
    867 #endif
    868 
    869 //                     log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UPT  [%d][%d].state <- UPDATE_PREDICTION_STATE_END_KO (update)",i,depth);
    870                    
    871 //                     reg_UPDATE_PREDICTION_TABLE [i][depth]._state = UPDATE_PREDICTION_STATE_END_KO;
     867                      case UPT_EVENT_STATE_KO_COMMIT_WAIT_END_EVENT :
     868                        {
     869                          Tdepth_t depth = reg_EVENT_UPT_PTR [i];
     870                         
     871                          log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * depth : %d",depth);
     872                         
     873                          if (reg_UPDATE_PREDICTION_TABLE [i][depth]._state == UPDATE_PREDICTION_STATE_END_KO)
     874                            {
     875                              log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UPT  [%d][%d].state <- UPDATE_PREDICTION_STATE_END (event)",i,depth);
     876                             
     877                              reg_UPDATE_PREDICTION_TABLE [i][depth]._state = UPDATE_PREDICTION_STATE_END;
     878                            }
     879
     880                            reg_UPT_TOP    [i] = reg_UPT_TOP_EVENT [i];
     881                            reg_UPT_UPDATE [i] = reg_UPT_TOP_EVENT [i];
     882
     883                          // break; continue
     884                        }
     885                      case UPT_EVENT_STATE_KO_DECODE_WAIT_END_EVENT :
     886                        {
     887                          // Change state
     888                          log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * EVENT [%d] <- EVENT_STATE_OK (event)",i);
     889                         
     890                          upt_event_state = UPT_EVENT_STATE_OK;
     891                          reg_IS_ACCURATE [i] = true;
     892
     893                          break;
     894                        }
     895                      default : break; // an other branch is occured
    872896                      }
     897
    873898                    break;
    874899                  }
     
    893918//                                                          (event_state == EVENT_STATE_EVENT_FLUSH_UPT));
    894919
    895                     bool     find   = false; // have slot to update ???
    896                     Tdepth_t top    = bottom;
    897                     Tdepth_t update = bottom;
    898                     bool     empty  = reg_UPT_EMPTY [i];
     920                    bool     find     = false; // have slot to update ???
     921                    bool     find_top = false;
     922                    Tdepth_t top      = bottom;
     923                    Tdepth_t update   = bottom;
     924                    bool     empty    = reg_UPT_EMPTY [i];
    899925
    900926                    // flush all slot, because this event is in head of rob
     
    902928                      {
    903929                        Tdepth_t x = (bottom+j)%_param->_size_upt_queue[i];
     930
     931                        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * UPT [%d] : %s",x,toString(reg_UPDATE_PREDICTION_TABLE [i][x]._state).c_str());
    904932                       
    905933                        if ((reg_UPDATE_PREDICTION_TABLE [i][x]._state != UPDATE_PREDICTION_STATE_END) and
    906934                            (reg_UPDATE_PREDICTION_TABLE [i][x]._state != UPDATE_PREDICTION_STATE_EMPTY))
    907935                          {
     936                            log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * find at UPT[%d]",x);
     937
    908938                            find = true; // find a not empty slot
    909                             reg_UPDATE_PREDICTION_TABLE [i][x]._state = UPDATE_PREDICTION_STATE_EVENT;
     939                            reg_UPDATE_PREDICTION_TABLE [i][x]._state     = UPDATE_PREDICTION_STATE_EVENT;
    910940                            reg_UPDATE_PREDICTION_TABLE [i][x]._retire_ok = false;
    911941                            update = x;
     
    913943
    914944                        if (reg_UPDATE_PREDICTION_TABLE [i][x]._state != UPDATE_PREDICTION_STATE_EMPTY)
    915                           top = x+1;
     945                          if (not find_top)
     946                            {
     947                              top = x;
     948                              find_top = true;
     949                            }
    916950                      }
    917 
    918                     top = top%_param->_size_upt_queue[i];
    919951
    920952                    log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * find       : %d",find);
    921953                    log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * top        : %d",top);
     954                    log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * update     : %d",update);
    922955                   
    923956                    // Test if have update slot
     957                    reg_UPT_TOP_EVENT [i] = reg_UPT_TOP[i];
    924958                    if (find)
    925959                      {
    926960                        // TODO : special case : event is an exception on branch, also depth is not valid
    927961                        reg_UPT_TOP       [i] = top; // depth is again valid
    928                         reg_UPT_TOP_EVENT [i] = top;
    929962                       
    930963                        if (bottom == reg_UPT_TOP [i])
    931964                          reg_UPT_EMPTY [i] = true;
     965
     966                        reg_UPT_UPDATE [i]  = update;
    932967                      }
    933                     reg_UPT_UPDATE [i]  = update;
    934968             
    935969                    // new state :
     
    939973                    //            * ok : nothing
    940974                    //            * ko : flush upt
    941                     reg_EVENT_VAL             [i] = find;
    942                     reg_EVENT_IS_BRANCH       [i] = false;
     975//                     reg_EVENT_VAL             [i] = find;
     976//                     reg_EVENT_IS_BRANCH       [i] = false;
     977//                     reg_EVENT_UPT_PTR         [i] = ((top==0)?_param->_size_upt_queue[i]:top)-1; ///// ZE MODIF
    943978                    reg_EVENT_UPT_PTR         [i] = top;
    944979                    reg_EVENT_UPT_FULL        [i] = (not empty and (bottom == reg_UPT_TOP [i]));
     
    952987                    log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_UPT_EMPTY                    : %d",reg_UPT_EMPTY           [i]);
    953988
    954                     log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_EVENT_VAL                    : %d",reg_EVENT_VAL           [i]);
     989//                     log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_EVENT_VAL                    : %d",reg_EVENT_VAL           [i]);
    955990                    log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_EVENT_UPT_PTR                : %d",reg_EVENT_UPT_PTR       [i]);
    956991                    log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_EVENT_UPT_FULL               : %d",reg_EVENT_UPT_FULL      [i]);
     
    958993                    log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_UFPT_NB_UPDATE               : %d",reg_UFPT_NB_UPDATE      [i]);
    959994
    960                     if ( (reg_UFPT_NB_NEED_UPDATE [i] > 0) or
    961                          (reg_UFPT_NB_UPDATE      [i] > 0))
     995                    if (find)
    962996                      {
    963                         if (find)
    964                           {
    965                             log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * EVENT [%d] <- EVENT_STATE_EVENT_FLUSH_UFPT_AND_UPT (event - find)",i);
    966                             reg_EVENT_STATE [i] = EVENT_STATE_EVENT_FLUSH_UFPT_AND_UPT;
    967                           }
    968                         else
    969                           {
    970                             log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * EVENT [%d] <- EVENT_STATE_EVENT_FLUSH_UFPT (event - not find)",i);
    971 //                          reg_EVENT_VAL   [i] = false;
    972 
    973                             reg_EVENT_STATE [i] = EVENT_STATE_EVENT_FLUSH_UFPT;
    974                           }                         
     997                        // have ras prediction ?
     998                        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UPT_EVENT [%d] <- UPT_EVENT_STATE_KO_EVENT_FLUSH_UPT (event - find)",i);
     999                       
     1000                        upt_event_state = UPT_EVENT_STATE_KO_EVENT_FLUSH_UPT;
    9751001                      }
    9761002                    else
    9771003                      {
    978                         if (find)
    979                           {
    980                             // have ras prediction ?
    981                             log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * EVENT [%d] <- EVENT_STATE_EVENT_FLUSH_UPT (event - find)",i);
    982                            
    983                             reg_EVENT_STATE [i] = EVENT_STATE_EVENT_FLUSH_UPT;
    984                           }
    985                         else
    986                           {
    987                             // special case : nothing
    988                             log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * EVENT [%d] <- EVENT_STATE_EVENT_FLUSH_UPT (event - not find)",i);
    989 
    990 //                          reg_EVENT_VAL     [i] = false;
    991 
    992                             reg_EVENT_STATE [i] = EVENT_STATE_OK;
    993                           }
     1004                        // special case : nothing
     1005                        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UPT_EVENT [%d] <- UPT_EVENT_STATE_KO_EVENT_WAIT_UFPT (event - not find)",i);
     1006                       
     1007//                      reg_EVENT_VAL     [i] = false;
     1008                       
     1009                        upt_event_state = UPT_EVENT_STATE_KO_EVENT_WAIT_UFPT;
    9941010                      }
    995 
    996                     // else no update
    997                    
    998 //                     Tdepth_t depth      = (_param->_have_port_depth)?PORT_READ(in_EVENT_DEPTH [i]):0;
    999 //                     uint32_t top        = reg_UPT_TOP    [i];
    1000 //                     uint32_t bottom     = reg_UPT_BOTTOM [i];
    1001 //                     uint32_t new_update = ((top==0)?_param->_size_upt_queue[i]:top)-1;
    1002 // //                     bool     empty      = reg_UPT_EMPTY [i];
    1003 
    1004 //                     log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * top        : %d",top);
    1005 //                     log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * depth      : %d",depth);
    1006 //                     log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * new_update : %d",new_update);
    1007 
    1008 //                     event_state_t event_state         = reg_EVENT_STATE [i];
    1009 //                     bool          previous_update_ras = ((event_state == EVENT_STATE_MISS_FLUSH_UFPT_AND_UPT ) or
    1010 //                                                          (event_state == EVENT_STATE_MISS_FLUSH_UPT          ) or
    1011 //                                                          (event_state == EVENT_STATE_EVENT_FLUSH_UFPT_AND_UPT) or
    1012 //                                                          (event_state == EVENT_STATE_EVENT_FLUSH_UPT));
    1013 
    1014 //                     bool     find = false; // have slot to update ???
    1015 //                     Tdepth_t depth_new = depth;
    1016 
    1017 //                     // flush all slot, because this event is in head of rob
    1018 //                     for (uint32_t j=(depth+1)%_param->_size_upt_queue[i];
    1019 //                          //uint32_t j=bottom;
    1020 //                          j!=top;
    1021 //                          j=(j+1)%_param->_size_upt_queue[i])
    1022 //                       if ((reg_UPDATE_PREDICTION_TABLE [i][j]._state != UPDATE_PREDICTION_STATE_END) and
    1023 //                           (reg_UPDATE_PREDICTION_TABLE [i][j]._state != UPDATE_PREDICTION_STATE_EMPTY))
    1024 //                         {
    1025 //                           find = true;
    1026 //                           reg_UPDATE_PREDICTION_TABLE [i][j]._state = UPDATE_PREDICTION_STATE_EVENT;
    1027 //                           reg_UPDATE_PREDICTION_TABLE [i][j]._retire_ok = false;
    1028 //                         }
    1029 //                       else
    1030 //                         if (not find) // while state == end or empty
    1031 //                           depth_new ++;
    1032                    
    1033 //                     if ((reg_UPDATE_PREDICTION_TABLE [i][depth]._state != UPDATE_PREDICTION_STATE_END) and
    1034 //                         (reg_UPDATE_PREDICTION_TABLE [i][depth]._state != UPDATE_PREDICTION_STATE_EMPTY))
    1035 //                       {
    1036 //                         find = true;
    1037 //                         reg_UPDATE_PREDICTION_TABLE [i][depth]._state = UPDATE_PREDICTION_STATE_EVENT;
    1038 //                         reg_UPDATE_PREDICTION_TABLE [i][depth]._retire_ok = false;
    1039 
    1040 //                       }
    1041 //                     else
    1042 //                       // while state == end or empty
    1043 //                       depth = (depth_new+1)%_param->_size_upt_queue[i];
    1044 
    1045 //                     log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * find       : %d",find);
    1046 //                     log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * depth_new  : %d",depth_new);
    1047                    
    1048 //                     // Test if have update slot
    1049 //                     if (find)
    1050 //                       {
    1051 // //                         // flush all slot after the event
    1052 // //                         for (uint32_t j=(depth+1)%_param->_size_upt_queue[i];
    1053 // //                              j!=top;
    1054 // //                              j=(j+1)%_param->_size_upt_queue[i])
    1055 // //                           reg_UPDATE_PREDICTION_TABLE [i][j]._state = UPDATE_PREDICTION_STATE_EVENT;
    1056 
    1057 // //                         reg_UPDATE_PREDICTION_TABLE [i][depth]._state = UPDATE_PREDICTION_STATE_EVENT;
    1058                        
    1059 //                         // reg_UPT_BOTTOM    [i];
    1060 //                         // TODO : special case : event is an exception on branch, also depth is not valid
    1061 //                         reg_UPT_TOP       [i] = depth; // depth is again valid
    1062 //                         reg_UPT_TOP_EVENT [i] = top;
    1063                        
    1064 //                         if (bottom == reg_UPT_TOP [i])
    1065 //                           reg_UPT_EMPTY [i] = true;
    1066 //                       }
    1067 
    1068 //                     bool     full       = ((depth == top) and (top == bottom) and not reg_UPT_EMPTY [i]);
    1069 //                     bool     update_ras = find and ((top != depth) or full);
    1070                    
    1071 //                     log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * update_ras : %d",update_ras);
    1072                    
    1073 //                     if (not previous_update_ras and update_ras)
    1074 //                       reg_UPT_UPDATE [i]  = new_update;
    1075              
    1076 //                     // new state :
    1077 //                     //   * test if ufpt is empty
    1078 //                     //     * ok : flush upft and upt
    1079 //                     //     * ko : test if have previous flush upt
    1080 //                     //            * ok : nothing
    1081 //                     //            * ko : flush upt
    1082 //                     reg_EVENT_VAL     [i] = update_ras;
    1083 //                     reg_EVENT_UPT_PTR [i] = depth;
    1084 
    1085 //                     log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_UFPT_NB_NEED_UPDATE          : %d",reg_UFPT_NB_NEED_UPDATE [i]);
    1086 // //                     if (reg_UFPT_NB_NEED_UPDATE [i] > 0)
    1087 //                     if ( (reg_UFPT_NB_NEED_UPDATE [i] > 0) or
    1088 //                          (reg_UFPT_NB_UPDATE      [i] > 0))
    1089 //                       {
    1090 //                         if (update_ras)
    1091 //                           {
    1092 //                             log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * EVENT [%d] <- EVENT_STATE_EVENT_FLUSH_UFPT_AND_UPT (branch_complete - miss)",i);
    1093 //                             reg_EVENT_STATE [i] = EVENT_STATE_EVENT_FLUSH_UFPT_AND_UPT;
    1094 //                           }
    1095 //                         else
    1096 //                           {
    1097 //                             log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * EVENT [%d] <- EVENT_STATE_EVENT_FLUSH_UFPT (branch_complete - miss)",i);
    1098 // //                          reg_EVENT_VAL   [i] = false;
    1099 
    1100 //                             reg_EVENT_STATE [i] = EVENT_STATE_EVENT_FLUSH_UFPT;
    1101 //                           }                         
    1102 //                       }
    1103 //                     else
    1104 //                       {
    1105 // //                         if (not previous_update_ras)
    1106 //                         if (update_ras)
    1107 //                           {
    1108 //                             // have ras prediction ?
    1109 //                             log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * EVENT [%d] <- EVENT_STATE_EVENT_FLUSH_UPT (branch_complete - miss)",i);
    1110                            
    1111 //                             reg_EVENT_STATE [i] = EVENT_STATE_EVENT_FLUSH_UPT;
    1112 //                           }
    1113 //                         else
    1114 //                           {
    1115 //                             // special case : nothing
    1116 // //                          reg_EVENT_VAL     [i] = false;
    1117 
    1118 //                             reg_EVENT_STATE [i] = EVENT_STATE_OK;
    1119 //                           }
    1120 //                       }
    1121 
    1122 //                     // else no update
    1123                    
    1124 //                     reg_EVENT_DEPTH           [i] = depth;
    1125 // //                  reg_EVENT_ADDRESS_SRC     [i] = address_src; // delay_slot is compute in I_State
    1126 // //                  reg_EVENT_ADDRESS_DEST_VAL[i] = good_take;
    1127 // //                  reg_EVENT_ADDRESS_DEST    [i] = good_addr;
    11281011
    11291012                    break;
     
    11351018                  }
    11361019                }
     1020
     1021              reg_UPT_EVENT_STATE [i] = upt_event_state;
     1022              log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_UPT_EVENT_STATE : %s (branch_event)",toString(upt_event_state).c_str());
    11371023            }
    11381024
     
    11491035                log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_UFPT_NB_NEED_UPDATE          : %d",reg_UFPT_NB_NEED_UPDATE [i]);
    11501036
    1151               // It's to accelerate miss speculation
     1037              // It's to accelerate miss speculation -> associative access
    11521038              if (reg_UFPT_NB_NEED_UPDATE [i] == 0)
    11531039                {
     
    11571043                  reg_UFPT_BOTTOM [i] = 0;
    11581044                  reg_UFPT_TOP    [i] = 0;
    1159 //                reg_UFPT_UPDATE [i];
    11601045                }
    11611046              else
     
    11761061                    }
    11771062
    1178 //                   // TOP is next write slot : last slot is TOP-1
    1179 //                   uint32_t top = reg_UFPT_TOP [i];
    1180 //                   reg_UFPT_UPDATE    [i] = ((top==0)?_param->_size_ufpt_queue[i]:top)-1;
    1181 
    1182 //                reg_UFPT_BOTTOM    [i];
    1183 //                reg_UFPT_TOP       [i];
     1063                  // Change state
     1064                  reg_UFPT_EVENT_STATE [i] = UFPT_EVENT_STATE_KO_FLUSH;
    11841065                }
    11851066
     
    11871068
    11881069              }
     1070
     1071            // Change state on UPT
     1072            {
     1073              upt_event_state_t  upt_event_state  = reg_UPT_EVENT_STATE  [i];
     1074              ufpt_event_state_t ufpt_event_state = reg_UFPT_EVENT_STATE [i];
     1075             
     1076              // Test upt event to change state
     1077              // test if upt wait ufpt
     1078              if (ufpt_event_state == UFPT_EVENT_STATE_OK)
     1079                switch (upt_event_state)
     1080                  {
     1081                    // this case when don't need flush upt (miss decod and can continue)
     1082                  case UPT_EVENT_STATE_KO_MISS_WAIT_UFPT  : upt_event_state = UPT_EVENT_STATE_KO_COMMIT_UPDATE_CONTEXT; break;
     1083                  case UPT_EVENT_STATE_KO_EVENT_WAIT_UFPT : upt_event_state = UPT_EVENT_STATE_OK               ; break;
     1084                  default : break;
     1085                  }
     1086             
     1087              reg_UPT_EVENT_STATE [i] = upt_event_state;
     1088            }
    11891089          }
    11901090
     
    12121112      {
    12131113        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_IS_ACCURATE           : %d",reg_IS_ACCURATE        [i]);
    1214         log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_EVENT_VAL             : %d"  ,reg_EVENT_VAL             [i]);
     1114        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_EVENT_UFPT_STATE      : %s"  ,toString(reg_UFPT_EVENT_STATE [i]).c_str());
     1115        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_EVENT_UPT_STATE       : %s"  ,toString(reg_UPT_EVENT_STATE [i]).c_str());
     1116//         log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_EVENT_VAL             : %d"  ,reg_EVENT_VAL             [i]);
    12151117        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_EVENT_UPT_PTR         : %d"  ,reg_EVENT_UPT_PTR         [i]);
    12161118        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_EVENT_UPT_FULL        : %d"  ,reg_EVENT_UPT_FULL        [i]);
    1217         log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_EVENT_STATE           : %s"  ,toString(reg_EVENT_STATE [i]).c_str());
    1218         log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_EVENT_IS_BRANCH       : %d"  ,reg_EVENT_IS_BRANCH       [i]);
     1119//         log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_EVENT_IS_BRANCH       : %d"  ,reg_EVENT_IS_BRANCH       [i]);
    12191120        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_EVENT_DEPTH           : %d"  ,reg_EVENT_DEPTH           [i]);
    12201121        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_EVENT_ADDRESS_SRC     : %.8x (%.8x)",reg_EVENT_ADDRESS_SRC     [i],reg_EVENT_ADDRESS_SRC     [i]<<2);
     
    12231124        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_EVENT_CAN_CONTINUE    : %d"  ,reg_EVENT_CAN_CONTINUE    [i]);
    12241125
    1225         log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * Update_Fetch_Prediction_Table   [%d]",i);
     1126        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * Dump UFPT [%d] (Update_Fetch_Prediction_Table)",i);
    12261127        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_UFPT_BOTTOM         : %d",reg_UFPT_BOTTOM         [i]);
    12271128        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_UFPT_TOP            : %d",reg_UFPT_TOP            [i]);
     
    12461147                     );
    12471148
    1248         log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * Update_Prediction_Table   [%d]",i);
     1149        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * Dump UPT [%d] (Update_Prediction_Table)",i);
    12491150        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_UPT_BOTTOM          : %d",reg_UPT_BOTTOM         [i]);
    12501151        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_UPT_TOP             : %d",reg_UPT_TOP            [i]);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/src/Front_end_deallocation.cpp

    r112 r122  
    120120    delete    _component_glue           ;
    121121    delete    _component_context_state  ;
     122    for (uint32_t i=0; i<_param->_nb_decod_unit; i++)
     123    delete    _component_decod_unit  [i];
    122124    delete [] _component_decod_unit     ;
    123125    delete    _component_prediction_unit;
     126    for (uint32_t i=0; i<_param->_nb_context; i++)
     127    delete    _component_ifetch_unit [i];
    124128    delete [] _component_ifetch_unit    ;
    125129
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/src/Parameters.cpp

    r111 r122  
    292292    log_begin(Front_end,FUNCTION);
    293293   
    294     delete [] _param_glue           ;
    295     delete [] _param_context_state  ;
     294    delete   _param_glue           ;
     295    delete   _param_context_state  ;
    296296    for (uint32_t i=0; i<_nb_decod_unit; i++)
    297       delete [] _param_decod_unit [i];
     297    delete    _param_decod_unit [i];
    298298    delete [] _param_decod_unit     ;
    299     delete [] _param_prediction_unit;
     299    delete   _param_prediction_unit;
    300300    for (uint32_t i=0; i<_nb_context; i++)
    301       delete [] _param_ifetch_unit [i];
     301    delete    _param_ifetch_unit [i];
    302302    delete [] _param_ifetch_unit    ;
    303303
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/include/Commit_unit.h

    r121 r122  
    143143  public    : SC_IN (Tcontrol_t         ) ***  in_RETIRE_EVENT_ACK                 ;//[nb_front_end][nb_context]
    144144  public    : SC_OUT(Tevent_state_t     ) *** out_RETIRE_EVENT_STATE               ;//[nb_front_end][nb_context]
     145  public    : SC_OUT(Tcontrol_t         ) *** out_RETIRE_EVENT_FLUSH               ;//[nb_front_end][nb_context]
     146  public    : SC_OUT(Tcontrol_t         ) *** out_RETIRE_EVENT_STOP                ;//[nb_front_end][nb_context]
    145147                                                                                   
    146148    // ~~~~~[ Interface : "commit" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~         
     
    233235  private   : uint32_t                        reg_NUM_BANK_HEAD                    ;
    234236  private   : uint32_t                        reg_NUM_BANK_TAIL                    ;
     237  private   : uint32_t                        reg_NUM_PTR_TAIL                     ;
    235238  private   : uint32_t                      * reg_BANK_PTR                         ;//[nb_bank]
    236239
     
    238241  private   : Tcounter_t                   ** reg_NB_INST_COMMIT_MEM               ;//[nb_front_end][nb_context]
    239242
    240   private   : Tevent_state_t               ** reg_EVENT_STATE                      ;//[nb_front_end][nb_context]
    241   private   : bool                         ** reg_EVENT_FLUSH                      ;//[nb_front_end][nb_context]
     243  private   : Tcommit_event_state_t        ** reg_EVENT_STATE                      ;//[nb_front_end][nb_context]
     244//private   : bool                         ** reg_EVENT_FLUSH                      ;//[nb_front_end][nb_context]
    242245  private   : bool                         ** reg_EVENT_STOP                       ;//[nb_front_end][nb_context]
     246  private   : uint32_t                     ** reg_EVENT_NUM_BANK                   ;//[nb_front_end][nb_context]
     247  private   : uint32_t                     ** reg_EVENT_NUM_PTR                    ;//[nb_front_end][nb_context]
     248  private   : bool                         ** reg_EVENT_CAN_RESTART                ;//[nb_front_end][nb_context]
     249  private   : uint32_t                     ** reg_EVENT_PACKET                     ;//[nb_front_end][nb_context]
     250  private   : bool                         ** reg_EVENT_LAST                       ;//[nb_front_end][nb_context]
     251  private   : uint32_t                     ** reg_EVENT_LAST_NUM_BANK              ;//[nb_front_end][nb_context]
     252  private   : uint32_t                     ** reg_EVENT_LAST_NUM_PTR               ;//[nb_front_end][nb_context]
    243253
    244254//private   : Taddress_t                   ** reg_PC_PREVIOUS                      ;//[nb_front_end][nb_context]
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/include/Types.h

    r121 r122  
    2828    {
    2929      ROB_EMPTY                      , //
     30
    3031      ROB_BRANCH_WAIT_END            , //
    3132      ROB_BRANCH_COMPLETE            , //
    32       ROB_STORE_WAIT_HEAD_OK         , //
    33 //    ROB_STORE_WAIT_HEAD_KO         , //
    34       ROB_STORE_HEAD_OK              , //
    35       ROB_STORE_HEAD_KO              , //
     33
     34      ROB_STORE_WAIT_END_OK          , //
     35      ROB_STORE_WAIT_END_KO          , //
     36      ROB_STORE_OK                   , //
     37      ROB_STORE_KO                   , //
     38      ROB_STORE_OK_WAIT_END          , //
     39      ROB_STORE_KO_WAIT_END          , //
     40      ROB_STORE_EVENT                , //
     41
    3642      ROB_OTHER_WAIT_END             , //
    3743
     
    5056      ROB_END_EXCEPTION_WAIT_HEAD    , //
    5157      ROB_END_EXCEPTION_UPDATE       , //
    52       ROB_END_EXCEPTION                //
     58      ROB_END_EXCEPTION              , //
     59      ROB_END
     60    } rob_state_t;
    5361
    54     } rob_state_t;
     62  typedef enum
     63    {
     64      COMMIT_EVENT_STATE_NO_EVENT  ,
     65      COMMIT_EVENT_STATE_EVENT     ,
     66      COMMIT_EVENT_STATE_WAIT_DECOD,
     67      COMMIT_EVENT_STATE_WAIT_END  ,
     68      COMMIT_EVENT_STATE_END     
     69    } Tcommit_event_state_t;
     70
     71#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))))
     72
    5573
    5674  class entry_t
    5775  {
    5876  public  : rob_state_t        state                   ;
     77  public  : rob_state_t        state_old               ;
    5978  public  : uint32_t           ptr                     ;
    6079  public  : Tcontext_t         front_end_id            ;
     
    98117//public  : Tgeneral_data_t    data_commit             ; // branch's destination
    99118#ifdef DEBUG
     119  public  : Tgeneral_data_t    load_data               ;
    100120  public  : Taddress_t         address                 ;
    101121#endif
     
    121141      case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_BRANCH_WAIT_END            : return "ROB_BRANCH_WAIT_END"             ; break;
    122142      case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_BRANCH_COMPLETE            : return "ROB_BRANCH_COMPLETE"             ; break;
    123       case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_STORE_WAIT_HEAD_OK         : return "ROB_STORE_WAIT_HEAD_OK"          ; break;
    124 //    case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_STORE_WAIT_HEAD_KO         : return "ROB_STORE_WAIT_HEAD_KO"          ; break;
    125       case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_STORE_HEAD_OK              : return "ROB_STORE_HEAD_OK"               ; break;
    126       case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_STORE_HEAD_KO              : return "ROB_STORE_HEAD_KO"               ; break;
     143      case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_STORE_WAIT_END_OK          : return "ROB_STORE_WAIT_END_OK"           ; break;
     144      case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_STORE_WAIT_END_KO          : return "ROB_STORE_WAIT_END_KO"           ; break;
     145      case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_STORE_OK                   : return "ROB_STORE_OK"                    ; break;
     146      case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_STORE_KO                   : return "ROB_STORE_KO"                    ; break;
     147      case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_STORE_OK_WAIT_END          : return "ROB_STORE_OK_WAIT_END"           ; break;
     148      case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_STORE_KO_WAIT_END          : return "ROB_STORE_KO_WAIT_END"           ; break;
    127149      case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_OTHER_WAIT_END             : return "ROB_OTHER_WAIT_END"              ; break;
    128150      case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_EVENT_WAIT_END             : return "ROB_EVENT_WAIT_END"              ; break;
     
    140162      case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_END_EXCEPTION_UPDATE       : return "ROB_END_EXCEPTION_UPDATE"        ; break;
    141163      case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_END_EXCEPTION              : return "ROB_END_EXCEPTION"               ; break;
     164      case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_END                        : return "ROB_END"                         ; break;
    142165
    143166      default    : return ""      ; break;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_allocation.cpp

    r121 r122  
    141141      _ALLOC2_VALACK_IN ( in_RETIRE_EVENT_ACK               ,ACK,_param->_nb_front_end,_param->_nb_context[it1]);
    142142      _ALLOC2_SIGNAL_OUT(out_RETIRE_EVENT_STATE             ,"state"                ,Tevent_state_t    ,_param->_size_event_state           ,_param->_nb_front_end,_param->_nb_context[it1]);
     143      _ALLOC2_SIGNAL_OUT(out_RETIRE_EVENT_FLUSH             ,"flush"                ,Tcontrol_t        ,1                                   ,_param->_nb_front_end,_param->_nb_context[it1]);
     144      _ALLOC2_SIGNAL_OUT(out_RETIRE_EVENT_STOP              ,"stop"                 ,Tcontrol_t        ,1                                   ,_param->_nb_front_end,_param->_nb_context[it1]);
    143145
    144146      ALLOC2_INTERFACE_END(_param->_nb_front_end,_param->_nb_context[it1]);
     
    306308
    307309    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    308     ALLOC2(_nb_cycle_idle           ,double        ,_param->_nb_front_end,_param->_nb_context [it1]);
    309     ALLOC1(_rob                     ,std::list<entry_t*>,_param->_nb_bank);
     310    ALLOC2(_nb_cycle_idle           ,double               ,_param->_nb_front_end,_param->_nb_context [it1]);
     311    ALLOC1(_rob                     ,std::list<entry_t*>  ,_param->_nb_bank);
    310312   
    311     ALLOC1(reg_BANK_PTR             ,uint32_t      ,_param->_nb_bank);
    312 
    313     ALLOC2(reg_NB_INST_COMMIT_ALL   ,Tcounter_t    ,_param->_nb_front_end,_param->_nb_context [it1]);
    314     ALLOC2(reg_NB_INST_COMMIT_MEM   ,Tcounter_t    ,_param->_nb_front_end,_param->_nb_context [it1]);
     313    ALLOC1(reg_BANK_PTR             ,uint32_t             ,_param->_nb_bank);
     314                                                         
     315    ALLOC2(reg_NB_INST_COMMIT_ALL   ,Tcounter_t           ,_param->_nb_front_end,_param->_nb_context [it1]);
     316    ALLOC2(reg_NB_INST_COMMIT_MEM   ,Tcounter_t           ,_param->_nb_front_end,_param->_nb_context [it1]);
    315317   
    316     ALLOC2(reg_EVENT_STATE          ,Tevent_state_t,_param->_nb_front_end,_param->_nb_context [it1]);
    317     ALLOC2(reg_EVENT_FLUSH          ,bool          ,_param->_nb_front_end,_param->_nb_context [it1]);
    318     ALLOC2(reg_EVENT_STOP           ,bool          ,_param->_nb_front_end,_param->_nb_context [it1]);
    319 
    320 //  ALLOC2(reg_PC_PREVIOUS          ,Taddress_t    ,_param->_nb_front_end,_param->_nb_context [it1]);
    321     ALLOC2(reg_PC_CURRENT           ,Taddress_t    ,_param->_nb_front_end,_param->_nb_context [it1]);
    322     ALLOC2(reg_PC_CURRENT_IS_DS     ,Taddress_t    ,_param->_nb_front_end,_param->_nb_context [it1]);
    323     ALLOC2(reg_PC_CURRENT_IS_DS_TAKE,Taddress_t    ,_param->_nb_front_end,_param->_nb_context [it1]);
    324     ALLOC2(reg_PC_NEXT              ,Taddress_t    ,_param->_nb_front_end,_param->_nb_context [it1]);
     318    ALLOC2(reg_EVENT_STATE          ,Tcommit_event_state_t,_param->_nb_front_end,_param->_nb_context [it1]);
     319//  ALLOC2(reg_EVENT_FLUSH          ,bool                 ,_param->_nb_front_end,_param->_nb_context [it1]);
     320    ALLOC2(reg_EVENT_STOP           ,bool                 ,_param->_nb_front_end,_param->_nb_context [it1]);
     321    ALLOC2(reg_EVENT_NUM_BANK       ,uint32_t             ,_param->_nb_front_end,_param->_nb_context [it1]);
     322    ALLOC2(reg_EVENT_NUM_PTR        ,uint32_t             ,_param->_nb_front_end,_param->_nb_context [it1]);
     323    ALLOC2(reg_EVENT_CAN_RESTART    ,bool                 ,_param->_nb_front_end,_param->_nb_context [it1]);
     324    ALLOC2(reg_EVENT_PACKET         ,uint32_t             ,_param->_nb_front_end,_param->_nb_context [it1]);
     325    ALLOC2(reg_EVENT_LAST           ,bool                 ,_param->_nb_front_end,_param->_nb_context [it1]);
     326    ALLOC2(reg_EVENT_LAST_NUM_BANK  ,uint32_t             ,_param->_nb_front_end,_param->_nb_context [it1]);
     327    ALLOC2(reg_EVENT_LAST_NUM_PTR   ,uint32_t             ,_param->_nb_front_end,_param->_nb_context [it1]);
     328                                                         
     329//  ALLOC2(reg_PC_PREVIOUS          ,Taddress_t           ,_param->_nb_front_end,_param->_nb_context [it1]);
     330    ALLOC2(reg_PC_CURRENT           ,Taddress_t           ,_param->_nb_front_end,_param->_nb_context [it1]);
     331    ALLOC2(reg_PC_CURRENT_IS_DS     ,Taddress_t           ,_param->_nb_front_end,_param->_nb_context [it1]);
     332    ALLOC2(reg_PC_CURRENT_IS_DS_TAKE,Taddress_t           ,_param->_nb_front_end,_param->_nb_context [it1]);
     333    ALLOC2(reg_PC_NEXT              ,Taddress_t           ,_param->_nb_front_end,_param->_nb_context [it1]);
    325334      }
    326335
     
    345354      if (_param->_have_thread [i])
    346355        {
     356         
    347357          std::string filename = morpheo::filename(MORPHEO_LOG,
    348358                                                   "Instruction_flow-thread_"+toString(i),
     
    351361                                                   false,
    352362                                                   log_with_pid,
    353                                                    false);
     363                                                   true);
     364
     365          log_printf(TRACE,Commit_unit,FUNCTION,"KANE : %s",filename.c_str());
    354366         
    355           instruction_log_file [i] .open(filename.c_str() ,std::ios::out | std::ios::trunc);
     367          instruction_log_file [i].open(filename.c_str() ,std::ios::out | std::ios::trunc);
    356368        }
    357369#endif
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_deallocation.cpp

    r121 r122  
    9494        DELETE2_SIGNAL( in_RETIRE_EVENT_ACK               ,_param->_nb_front_end,_param->_nb_context[it1],1);
    9595        DELETE2_SIGNAL(out_RETIRE_EVENT_STATE             ,_param->_nb_front_end,_param->_nb_context[it1],_param->_size_event_state);
     96        DELETE2_SIGNAL(out_RETIRE_EVENT_FLUSH             ,_param->_nb_front_end,_param->_nb_context[it1],1);
     97        DELETE2_SIGNAL(out_RETIRE_EVENT_STOP              ,_param->_nb_front_end,_param->_nb_context[it1],1);
    9698
    9799        DELETE1_SIGNAL( in_COMMIT_VAL               ,_param->_nb_inst_commit,1                             );
     
    202204        DELETE2(reg_NB_INST_COMMIT_ALL   ,_param->_nb_front_end,_param->_nb_context [it1]);
    203205        DELETE2(reg_NB_INST_COMMIT_MEM   ,_param->_nb_front_end,_param->_nb_context [it1]);
     206
    204207        DELETE2(reg_EVENT_STATE          ,_param->_nb_front_end,_param->_nb_context [it1]);
    205         DELETE2(reg_EVENT_FLUSH          ,_param->_nb_front_end,_param->_nb_context [it1]);
     208//      DELETE2(reg_EVENT_FLUSH          ,_param->_nb_front_end,_param->_nb_context [it1]);
    206209        DELETE2(reg_EVENT_STOP           ,_param->_nb_front_end,_param->_nb_context [it1]);
     210        DELETE2(reg_EVENT_NUM_BANK       ,_param->_nb_front_end,_param->_nb_context [it1]);
     211        DELETE2(reg_EVENT_NUM_PTR        ,_param->_nb_front_end,_param->_nb_context [it1]);
     212        DELETE2(reg_EVENT_CAN_RESTART    ,_param->_nb_front_end,_param->_nb_context [it1]);
     213        DELETE2(reg_EVENT_PACKET         ,_param->_nb_front_end,_param->_nb_context [it1]);
     214        DELETE2(reg_EVENT_LAST           ,_param->_nb_front_end,_param->_nb_context [it1]);
     215        DELETE2(reg_EVENT_LAST_NUM_BANK  ,_param->_nb_front_end,_param->_nb_context [it1]);
     216        DELETE2(reg_EVENT_LAST_NUM_PTR   ,_param->_nb_front_end,_param->_nb_context [it1]);
     217
    207218//      DELETE2(reg_PC_PREVIOUS          ,_param->_nb_front_end,_param->_nb_context [it1]);
    208219        DELETE2(reg_PC_CURRENT           ,_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

    r117 r122  
    3030#endif
    3131    bool       can_rename_select [_param->_nb_rename_unit];
    32     bool       event_stop;
    33    
     32//     bool       event_stop;
     33   
     34//     //     Initialisation
     35//     event_stop = false; // one signal for all 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_stop |= reg_EVENT_STOP [i][j];   
     39
    3440//     Initialisation
    35     event_stop = false; // one signal for all 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_stop |= reg_EVENT_STOP [i][j];
    3941    for (uint32_t i=0; i<_param->_nb_bank; i++)
    4042      {
     
    5759//     log_printf(TRACE,Commit_unit,FUNCTION,"  * reg_NUM_BANK_TAIL : %d",reg_NUM_BANK_TAIL);
    5860
    59     if (not event_stop)
     61//     if (not event_stop)
    6062      {
    6163        std::list<generic::priority::select_t> * select_insert = _priority_insert ->select(); // same select for all insert
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_genMealy_retire.cpp

    r121 r122  
    5656
    5757        }
     58
    5859    // Scan Top of each bank
    5960    internal_BANK_RETIRE_HEAD = reg_NUM_BANK_HEAD;
     
    6263        uint32_t num_bank = (internal_BANK_RETIRE_HEAD+i)%_param->_nb_bank;
    6364
     65        // Test if have instruction
    6466        if (not _rob[num_bank].empty())
    6567          {
     
    6870            uint32_t   x     = entry->rename_unit_id;
    6971            uint32_t   y     = num_inst_retire [x];
    70        
     72            bool       bypass= false;
    7173            // test if :
    7274            //  * can retire (all previous instruction is retired)
     
    7779              {
    7880                rob_state_t state        = entry->state;
     81                Tcontext_t  front_end_id = entry->front_end_id;
     82                Tcontext_t  context_id   = entry->context_id; 
     83               
    7984                  if ((state == ROB_END_OK         ) or
    8085                      (state == ROB_END_KO         ) or
     
    8792                      Tcontrol_t         write_re       = entry->write_re;
    8893                      Tspecial_address_t num_reg_re_log = entry->num_reg_re_log;
    89                       Tcontext_t         front_end_id   = entry->front_end_id;
    90                       Tcontext_t         context_id     = entry->context_id; 
    9194                     
    9295                      // if state is ok, when write flags in the SR regsiters
     
    173176                        can_retire [x] = false;
    174177                    }
     178
     179                  bypass = ((state == ROB_END              ) or
     180                            (state == ROB_STORE_OK         ) or
     181                            (state == ROB_STORE_KO         ) or
     182                            (state == ROB_STORE_OK_WAIT_END) or
     183                            (state == ROB_STORE_KO_WAIT_END));
     184                 
     185                  uint32_t packet = ((entry->ptr << _param->_shift_num_slot) | num_bank);
     186
     187                  // if future event, don't update after this event
     188                  if (reg_EVENT_STOP [front_end_id][context_id] and
     189                      (reg_EVENT_PACKET [entry->front_end_id][entry->context_id]  == packet))
     190                    bypass = false;
    175191              }
    176192
    177193            // Retire "in-order"
    178             can_retire [x] &= retire_val [x][y];
     194            can_retire [x]  &= (retire_val [x][y] or bypass);
    179195          }
    180196      }
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_genMoore.cpp

    r118 r122  
    2828    // ===================================================================
    2929    {
    30       log_printf(TRACE,Commit_unit,FUNCTION,"  * REEXECUTE [0]");
    31 
    32       // Store instruction comming Out Of Order in Load Store Unit.
    33       // Must be executed in no speculative mode. Also, send a signal when an Store is in head of ROB
    34 
    35       Tcontrol_t val      = false;
    36       uint32_t   num_bank = reg_NUM_BANK_HEAD;
    37 
    38       if (not _rob[num_bank].empty())
     30      uint32_t nb_scan_bank = 0; // last scan bank
     31      bool     can_continue = true;
     32
     33      // for each reexecute_port
     34      for (uint32_t i=0; i<_param->_nb_inst_reexecute; ++i)
    3935        {
    40           log_printf(TRACE,Commit_unit,FUNCTION,"    * ROB is not empty");
    41           log_printf(TRACE,Commit_unit,FUNCTION,"    * num_bank      : %d",num_bank);
    42 
    43           entry_t    * entry = _rob [num_bank].front();
    44           rob_state_t  state = entry->state;
    45 
    46           // Test state
    47           val   = ((state == ROB_STORE_HEAD_OK) or
    48                    (state == ROB_STORE_HEAD_KO));
    49 
    50           log_printf(TRACE,Commit_unit,FUNCTION,"    * val           : %d",val);
    51           if (val)
     36          log_printf(TRACE,Commit_unit,FUNCTION,"  * REEXECUTE [%d]",i);
     37         
     38          // Store instruction comming Out Of Order in Load Store Unit.
     39          // Must be executed in no speculative mode. Also, send a signal when an Store is in head of ROB
     40         
     41          Tcontrol_t val = false;
     42
     43          for (uint32_t j=nb_scan_bank; j<_param->_nb_bank; j++)
    5244            {
    53               Tpacket_t packet_id = ((entry->ptr << _param->_shift_num_slot) | num_bank);
    54 
    55               log_printf(TRACE,Commit_unit,FUNCTION,"    * packet_id     : %d",packet_id);
    56          
    57               // Reexecute store
    58               if (_param->_have_port_context_id)
    59               PORT_WRITE(out_REEXECUTE_CONTEXT_ID            [0], entry->context_id           );
    60               if (_param->_have_port_front_end_id)
    61               PORT_WRITE(out_REEXECUTE_FRONT_END_ID          [0], entry->front_end_id         );
    62               if (_param->_have_port_rob_ptr  )
    63               PORT_WRITE(out_REEXECUTE_PACKET_ID             [0], packet_id                   );
    64               PORT_WRITE(out_REEXECUTE_TYPE                  [0], entry->type                 );
    65               PORT_WRITE(out_REEXECUTE_STORE_QUEUE_PTR_WRITE [0], entry->store_queue_ptr_write);
    66               PORT_WRITE(out_REEXECUTE_OPERATION             [0], (state == ROB_STORE_HEAD_OK)?OPERATION_MEMORY_STORE_HEAD_OK:OPERATION_MEMORY_STORE_HEAD_KO);
    67             }
     45              nb_scan_bank ++;
     46             
     47              // translate bank number
     48              uint32_t num_bank = (reg_NUM_BANK_HEAD+j)%_param->_nb_bank;
     49             
     50              log_printf(TRACE,Commit_unit,FUNCTION,"    * num_bank      : %d",num_bank);
     51
     52              // Test if the head of rob is not empty
     53              if (not _rob[num_bank].empty())
     54                {
     55                  log_printf(TRACE,Commit_unit,FUNCTION,"    * ROB is not empty");
     56                 
     57                  // Read state
     58                  entry_t    * entry = _rob [num_bank].front();
     59                  rob_state_t  state = entry->state;
     60                 
     61                  // Test state
     62                  //  * store is ko, send signal at store_queue
     63                  //  * store_is ok, test if in head
     64//                val   = (((state == ROB_STORE_OK) and (num_bank == (reg_NUM_BANK_HEAD))) or
     65//                          (state == ROB_STORE_KO)  or
     66//                          (state == ROB_STORE_EVENT)
     67//                          );
     68                  val   = (((state == ROB_STORE_OK) and can_continue) or
     69                            (state == ROB_STORE_KO)  or
     70                            (state == ROB_STORE_EVENT)
     71                            );
     72                 
     73                  can_continue &= ((state == ROB_STORE_OK          ) or
     74                                   (state == ROB_STORE_OK_WAIT_END ) or
     75                                   (state == ROB_END_OK_SPECULATIVE) or
     76                                   (state == ROB_END_OK            ) or
     77                                   (state == ROB_END               )
     78                                   );
     79
     80                  log_printf(TRACE,Commit_unit,FUNCTION,"    * val           : %d",val);
     81
     82                  if (val)
     83                    {
     84                      internal_REEXECUTE_NUM_BANK [i] = num_bank;
     85
     86                      Tpacket_t packet_id = ((entry->ptr << _param->_shift_num_slot) | num_bank);
     87                     
     88                      log_printf(TRACE,Commit_unit,FUNCTION,"    * packet_id     : %d",packet_id);
     89                     
     90                      // Reexecute store
     91                      if (_param->_have_port_context_id)
     92                      PORT_WRITE(out_REEXECUTE_CONTEXT_ID            [i], entry->context_id           );
     93                      if (_param->_have_port_front_end_id)
     94                      PORT_WRITE(out_REEXECUTE_FRONT_END_ID          [i], entry->front_end_id         );
     95                      if (_param->_have_port_rob_ptr  )
     96                      PORT_WRITE(out_REEXECUTE_PACKET_ID             [i], packet_id                   );
     97                      PORT_WRITE(out_REEXECUTE_TYPE                  [i], entry->type                 );
     98                      PORT_WRITE(out_REEXECUTE_STORE_QUEUE_PTR_WRITE [i], entry->store_queue_ptr_write);
     99                      PORT_WRITE(out_REEXECUTE_OPERATION             [i], (state == ROB_STORE_OK)?OPERATION_MEMORY_STORE_HEAD_OK:OPERATION_MEMORY_STORE_HEAD_KO);
     100
     101                      break; // Stop scan
     102                    }
     103                }
     104            } 
     105
     106          internal_REEXECUTE_VAL      [i] = val;
     107          PORT_WRITE(out_REEXECUTE_VAL[i], internal_REEXECUTE_VAL [i]);
    68108        }
    69  
    70       internal_REEXECUTE_VAL      [0] = val;
    71       internal_REEXECUTE_NUM_BANK [0] = num_bank;
    72      
    73       PORT_WRITE(out_REEXECUTE_VAL[0], internal_REEXECUTE_VAL [0]);
    74109    }
    75110
     
    79114    {
    80115      // Branchement must be send at the prediction unit
    81       uint32_t nb_scan_bank = 0;
     116
     117      uint32_t nb_scan_bank = 0; // last scan bank
    82118
    83119      // for each port, find a valid branchement.
    84120      for (uint32_t i=0; i<_param->_nb_inst_branch_complete; i++)
    85121        {
     122          log_printf(TRACE,Commit_unit,FUNCTION,"  * BRANCH_COMPLETE [%d]",i);
     123
    86124          Tcontrol_t  val  = false;
    87125         
     
    92130              // translate bank number
    93131              uint32_t num_bank = (reg_NUM_BANK_HEAD+j)%_param->_nb_bank;
     132
     133              log_printf(TRACE,Commit_unit,FUNCTION,"    * num_bank           : %d",num_bank);
    94134             
     135              // Test if in this bank, they have an instruction
    95136              if (not _rob [num_bank].empty())
    96137                {
     138                  log_printf(TRACE,Commit_unit,FUNCTION,"    * not empty");
     139
     140                  // Read information
    97141                  entry_t    * entry    = _rob [num_bank].front();
    98142                  rob_state_t  state    = entry->state;
    99                  
    100                   if (state == ROB_BRANCH_COMPLETE)
     143                  Tcontext_t   front_end_id = entry->front_end_id;
     144                  Tcontext_t   context_id   = entry->context_id  ;
     145
     146                  log_printf(TRACE,Commit_unit,FUNCTION,"    * front_end_id       : %d",front_end_id);
     147                  log_printf(TRACE,Commit_unit,FUNCTION,"    * context_id         : %d",context_id  );
     148
     149                  // don't complete a branch when rob manage an present event
     150                  if ((reg_EVENT_STATE [front_end_id][context_id] == COMMIT_EVENT_STATE_NO_EVENT) and
     151                      (state == ROB_BRANCH_COMPLETE))
    101152                    {
    102                       val = true;
    103                      
     153                      log_printf(TRACE,Commit_unit,FUNCTION,"    * find !!!");
     154
     155                      // test if have a future event (stop is set)
     156                      log_printf(TRACE,Commit_unit,FUNCTION,"      * reg_EVENT_STOP   : %d",reg_EVENT_STOP [front_end_id][context_id]);
     157
     158                      if (reg_EVENT_STOP [front_end_id][context_id])
     159                        {
     160                          // Have future event, can complete the branch if the event is most speculative than this branchement
     161                          // Also, need compare packet_id (is order)
     162
     163                          uint32_t _top = ((_rob[reg_NUM_BANK_HEAD].front()->ptr << _param->_shift_num_slot) | reg_NUM_BANK_HEAD);
     164                          uint32_t _old = reg_EVENT_PACKET [front_end_id][context_id];
     165                          uint32_t _new = ((entry->ptr << _param->_shift_num_slot) | num_bank);
     166
     167//                           log_printf(TRACE,Commit_unit,FUNCTION,"      * _top             : %d",_top);
     168//                           log_printf(TRACE,Commit_unit,FUNCTION,"      * _old (before)    : %d",_old);
     169//                           log_printf(TRACE,Commit_unit,FUNCTION,"      * _new (before)    : %d",_new);
     170
     171                          if (_old < _top) _old = _old+_param->_size_queue;
     172                          if (_new < _top) _new = _new+_param->_size_queue;
     173                          if (_new < _old) val = true;
     174
     175//                           log_printf(TRACE,Commit_unit,FUNCTION,"      * _old (after )    : %d",_old);
     176//                           log_printf(TRACE,Commit_unit,FUNCTION,"      * _new (after )    : %d",_new);
     177
     178                        }
     179                      else
     180                        val = true;
     181                     
     182                      log_printf(TRACE,Commit_unit,FUNCTION,"      * val              : %d",val);
     183
     184                      if (val)
     185                        {
     186                          // Have an valid branchement to complete
    104187                      internal_BRANCH_COMPLETE_NUM_BANK           [i] = num_bank;
    105188                     
     189                      if (_param->_have_port_front_end_id)
     190                      PORT_WRITE(out_BRANCH_COMPLETE_FRONT_END_ID [i],        front_end_id    );
    106191                      if (_param->_have_port_context_id)
    107                       PORT_WRITE(out_BRANCH_COMPLETE_CONTEXT_ID   [i], entry->context_id      );
    108                       if (_param->_have_port_front_end_id)
    109                       PORT_WRITE(out_BRANCH_COMPLETE_FRONT_END_ID [i], entry->front_end_id    );
     192                      PORT_WRITE(out_BRANCH_COMPLETE_CONTEXT_ID   [i],        context_id      );
    110193                      if (_param->_have_port_depth)
    111194                      PORT_WRITE(out_BRANCH_COMPLETE_DEPTH        [i], entry->depth           );
     
    114197                      PORT_WRITE(out_BRANCH_COMPLETE_NO_SEQUENCE  [i], entry->no_sequence     );
    115198                     
    116                       break;
     199                      break; // Stop scan
     200                        }
    117201                    }
    118202                }
     
    131215      internal_UPDATE_NUM_BANK = reg_NUM_BANK_HEAD;
    132216
     217      // Test if have an instruction
    133218      if (not _rob[internal_UPDATE_NUM_BANK].empty())
    134219        {
     
    138223          entry_t * entry = _rob [internal_UPDATE_NUM_BANK].front();
    139224
     225          // Test state
     226          // Update if exception or load miss
    140227          switch (entry->state)
    141228            {
     
    208295    for (uint32_t i=0; i<_param->_nb_front_end; i++)
    209296      for (uint32_t j=0; j<_param->_nb_context [i]; j++)
    210         PORT_WRITE(out_RETIRE_EVENT_STATE [i][j], reg_EVENT_STATE[i][j]);
     297        {
     298//        bool flush = reg_EVENT_FLUSH [i][j];
     299          bool flush = (((reg_EVENT_STATE [i][j] == COMMIT_EVENT_STATE_EVENT) or
     300                         (reg_EVENT_STATE [i][j] == COMMIT_EVENT_STATE_WAIT_DECOD)) and
     301                        not reg_EVENT_CAN_RESTART[i][j]);
     302
     303          PORT_WRITE(out_RETIRE_EVENT_STATE [i][j], commit_event_state_to_event_state(reg_EVENT_STATE[i][j]));
     304          PORT_WRITE(out_RETIRE_EVENT_FLUSH [i][j], flush);
     305          PORT_WRITE(out_RETIRE_EVENT_STOP  [i][j], reg_EVENT_STOP [i][j]);
     306        }
    211307
    212308    log_end(Commit_unit,FUNCTION);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_transition.cpp

    r121 r122  
    1616namespace ooo_engine {
    1717namespace commit_unit {
    18 
    1918 
    2019#undef  FUNCTION
     
    4140        reg_NUM_BANK_HEAD = 0;
    4241        reg_NUM_BANK_TAIL = 0;
     42        reg_NUM_PTR_TAIL  = 0;
    4343
    4444        // Reset counter
     
    5151              reg_NB_INST_COMMIT_MEM    [i][j] = 0;
    5252                                       
    53               reg_EVENT_STATE           [i][j] = EVENT_STATE_NO_EVENT;
    54               reg_EVENT_FLUSH           [i][j] = false;
     53              reg_EVENT_STATE           [i][j] = COMMIT_EVENT_STATE_NO_EVENT;
     54//            reg_EVENT_FLUSH           [i][j] = false;
    5555              reg_EVENT_STOP            [i][j] = false;
     56              reg_EVENT_LAST            [i][j] = false;
    5657
    5758//            reg_PC_PREVIOUS           [i][j] = (0x100-4)>>2;
     
    8081        for (uint32_t i=0; i<_param->_nb_front_end; i++)
    8182          for (uint32_t j=0; j<_param->_nb_context [i]; j++)
    82             switch (reg_EVENT_STATE [i][j])
    83               {
    84               case EVENT_STATE_EVENT    :
     83            {
     84              // Test if can_restart : (can_restart is to signal at the state than the decod_queue is empty)
     85              //   *     no previous can_restart (trap for one)
     86              //   * and decod_queue is empty
     87              //   * and have an event or have a futur event
     88              if (not reg_EVENT_CAN_RESTART [i][j] and
     89                   (PORT_READ(in_NB_INST_DECOD_ALL [i][j]) == 0) and
     90                   (reg_EVENT_STOP [i][j] or (reg_EVENT_STATE [i][j] != COMMIT_EVENT_STATE_NO_EVENT)))
     91                reg_EVENT_CAN_RESTART [i][j] = true;
     92
     93              // Test event state
     94              switch (reg_EVENT_STATE [i][j])
    8595                {
    86                   if (internal_RETIRE_EVENT_VAL [i][j] and in_RETIRE_EVENT_ACK [i][j])
    87                     reg_EVENT_STATE [i][j] = EVENT_STATE_WAITEND ;
    88                   break;
     96                case COMMIT_EVENT_STATE_EVENT    :
     97                  {
     98                    // Have an event, test if all composant have ack
     99                    if (internal_RETIRE_EVENT_VAL [i][j] and in_RETIRE_EVENT_ACK [i][j])
     100                      {
     101                        // A minor optimisation : test if wait_decod is previously empty.
     102                        if (not reg_EVENT_CAN_RESTART [i][j])
     103                          reg_EVENT_STATE [i][j] = COMMIT_EVENT_STATE_WAIT_DECOD;
     104                        else
     105                          reg_EVENT_STATE [i][j] = COMMIT_EVENT_STATE_WAIT_END;
     106                      }
     107                   
     108                    break;
     109                  }
     110                case COMMIT_EVENT_STATE_WAIT_DECOD :
     111                  {
     112                    // Wait flush of decod_queue.
     113                    // Test if can restart now
     114                    if (reg_EVENT_CAN_RESTART [i][j])
     115                      {
     116                        //reg_EVENT_FLUSH [i][j] = false;
     117
     118                        // A minor optimisation : test if the last element is already retire
     119                        if (not reg_EVENT_LAST [i][j])
     120                          reg_EVENT_STATE [i][j] = COMMIT_EVENT_STATE_WAIT_END;
     121                        else
     122                          reg_EVENT_STATE [i][j] = COMMIT_EVENT_STATE_END;
     123                      }
     124                    break;
     125                  }
     126                case COMMIT_EVENT_STATE_WAIT_END :
     127                  {
     128                    // Wait the flush of Re Order Buffer.
     129                    // Test if the last element is retire
     130                    if (reg_EVENT_LAST [i][j])
     131                      reg_EVENT_STATE [i][j] = COMMIT_EVENT_STATE_END ;
     132                   
     133                    break;
     134                  }
     135                case COMMIT_EVENT_STATE_END      :
     136                  {
     137                    // Just one cycle
     138                   
     139                    // flush of re order buffer is finish
     140                    reg_EVENT_STATE [i][j] = COMMIT_EVENT_STATE_NO_EVENT;
     141                    reg_EVENT_LAST  [i][j] = false;
     142                    break;
     143                  }
     144                  //case COMMIT_EVENT_STATE_NO_EVENT :
     145                default : break;
    89146                }
    90               case EVENT_STATE_WAITEND  :
     147            }
     148
     149        // ===================================================================
     150        // =====[ INSERT ]====================================================
     151        // ===================================================================
     152        {
     153          // variable to count instruction insert
     154          uint32_t nb_insert = 0;
     155
     156          for (uint32_t i=0; i<_param->_nb_bank; i++)
     157            {
     158              // compute first bank number
     159              uint32_t num_bank = (reg_NUM_BANK_TAIL+i)%_param->_nb_bank;
     160             
     161              if (internal_BANK_INSERT_VAL [num_bank])
    91162                {
    92                   Tcounter_t nb_inst_all = PORT_READ(in_NB_INST_DECOD_ALL [i][j]) + reg_NB_INST_COMMIT_ALL [i][j];
    93                   if (nb_inst_all == 0)
     163                  // get rename unit source and instruction.
     164                  uint32_t x = internal_BANK_INSERT_NUM_RENAME_UNIT [num_bank];
     165                  uint32_t y = internal_BANK_INSERT_NUM_INST        [num_bank];
     166                 
     167                  // Test if an instruction is valid
     168                  // (all in_order insert combinatory is in rename_unit )
     169                  if (PORT_READ(in_INSERT_VAL [x][y]))
    94170                    {
    95                       reg_EVENT_STATE [i][j] = EVENT_STATE_END;
    96                       reg_EVENT_FLUSH [i][j] = false;
    97                       //reg_EVENT_STOP  [i][j] = false;
     171                      log_printf(TRACE,Commit_unit,FUNCTION,"  * INSERT            [%d][%d]",x,y);
     172                     
     173                      // get information
     174                      Tcontext_t   front_end_id = (_param->_have_port_front_end_id)?PORT_READ(in_INSERT_FRONT_END_ID [x][y]):0;
     175                      Tcontext_t   context_id   = (_param->_have_port_context_id  )?PORT_READ(in_INSERT_CONTEXT_ID   [x][y]):0;
     176                      Ttype_t      type         = PORT_READ(in_INSERT_TYPE         [x][y]);
     177                      Toperation_t operation    = PORT_READ(in_INSERT_OPERATION    [x][y]);
     178                      bool         is_store     = is_operation_memory_store(operation);
     179                     
     180                      Texception_t exception    = PORT_READ(in_INSERT_EXCEPTION    [x][y]);
     181                      Tcontrol_t   no_execute   = PORT_READ(in_INSERT_NO_EXECUTE   [x][y]);
     182                     
     183                      log_printf(TRACE,Commit_unit,FUNCTION,"    * front_end_id   : %d",front_end_id);
     184                      log_printf(TRACE,Commit_unit,FUNCTION,"    * context_id     : %d",context_id);
     185                      log_printf(TRACE,Commit_unit,FUNCTION,"    * type           : %s",toString(type).c_str());
     186                      log_printf(TRACE,Commit_unit,FUNCTION,"    * operation      : %d",operation );
     187                      log_printf(TRACE,Commit_unit,FUNCTION,"    * exception      : %d",exception );
     188                     
     189                      // Create new entry and write information
     190                      entry_t * entry = new entry_t;
     191                      uint32_t  ptr   = reg_BANK_PTR [num_bank];
     192
     193                      entry->ptr                     = ptr;
     194                      entry->front_end_id            = front_end_id;
     195                      entry->context_id              = context_id  ;
     196                      entry->rename_unit_id          = x;
     197                      entry->depth                   = (_param->_have_port_depth)?PORT_READ(in_INSERT_DEPTH [x][y]):0;
     198                      entry->type                    = type;
     199                      entry->operation               = operation;
     200                      entry->is_delay_slot           = PORT_READ(in_INSERT_IS_DELAY_SLOT         [x][y]);
     201//                    entry->address                 = PORT_READ(in_INSERT_ADDRESS               [x][y]);
     202                      entry->exception               = exception;
     203                      entry->exception_use           = PORT_READ(in_INSERT_EXCEPTION_USE         [x][y]);
     204                      entry->use_store_queue         = (type == TYPE_MEMORY) and (    is_store) and (not no_execute);
     205                      entry->use_load_queue          = (type == TYPE_MEMORY) and (not is_store) and (not no_execute);
     206                      entry->store_queue_ptr_write   = PORT_READ(in_INSERT_STORE_QUEUE_PTR_WRITE [x][y]);
     207                      entry->load_queue_ptr_write    = (_param->_have_port_load_queue_ptr)?PORT_READ(in_INSERT_LOAD_QUEUE_PTR_WRITE [x][y]):0;
     208#ifdef DEBUG       
     209                      entry->read_ra                 = PORT_READ(in_INSERT_READ_RA               [x][y]);
     210                      entry->num_reg_ra_log          = PORT_READ(in_INSERT_NUM_REG_RA_LOG        [x][y]);
     211                      entry->num_reg_ra_phy          = PORT_READ(in_INSERT_NUM_REG_RA_PHY        [x][y]);
     212                      entry->read_rb                 = PORT_READ(in_INSERT_READ_RB               [x][y]);
     213                      entry->num_reg_rb_log          = PORT_READ(in_INSERT_NUM_REG_RB_LOG        [x][y]);
     214                      entry->num_reg_rb_phy          = PORT_READ(in_INSERT_NUM_REG_RB_PHY        [x][y]);
     215                      entry->read_rc                 = PORT_READ(in_INSERT_READ_RC               [x][y]);
     216                      entry->num_reg_rc_log          = PORT_READ(in_INSERT_NUM_REG_RC_LOG        [x][y]);
     217                      entry->num_reg_rc_phy          = PORT_READ(in_INSERT_NUM_REG_RC_PHY        [x][y]);
     218#endif               
     219                      entry->write_rd                = PORT_READ(in_INSERT_WRITE_RD              [x][y]);
     220                      entry->num_reg_rd_log          = PORT_READ(in_INSERT_NUM_REG_RD_LOG        [x][y]);
     221                      entry->num_reg_rd_phy_old      = PORT_READ(in_INSERT_NUM_REG_RD_PHY_OLD    [x][y]);
     222                      entry->num_reg_rd_phy_new      = PORT_READ(in_INSERT_NUM_REG_RD_PHY_NEW    [x][y]);
     223                      entry->write_re                = PORT_READ(in_INSERT_WRITE_RE              [x][y]);
     224                      entry->num_reg_re_log          = PORT_READ(in_INSERT_NUM_REG_RE_LOG        [x][y]);
     225                      entry->num_reg_re_phy_old      = PORT_READ(in_INSERT_NUM_REG_RE_PHY_OLD    [x][y]);
     226                      entry->num_reg_re_phy_new      = PORT_READ(in_INSERT_NUM_REG_RE_PHY_NEW    [x][y]);
     227                      entry->no_sequence             = type == TYPE_BRANCH;
     228                      entry->speculative             = true;
     229#ifdef DEBUG       
     230                      entry->address                 = PORT_READ(in_INSERT_ADDRESS               [x][y]);
     231#endif               
     232                      entry->address_next            = PORT_READ(in_INSERT_ADDRESS_NEXT          [x][y]);
     233#ifdef DEBUG       
     234                      entry->cycle_rob_in            = simulation_cycle();
     235                      entry->cycle_commit            = simulation_cycle();
     236#endif     
     237           
     238                      // Test if exception :
     239                      //  * yes : no execute instruction, wait ROB Head
     240                      //  * no  : test if no_execute (== instruction is flushed)
     241                      //          else test type
     242                      //            * BRANCH : l.j   -> branch is ended
     243                      //                       other -> wait the execution end of branchment
     244                      //            * MEMORY : store -> wait store is at head of ROB
     245                      //                       other -> wait end of instruction
     246                      //            * OTHER
     247           
     248                      {
     249                        if (exception == EXCEPTION_NONE)
     250                          {
     251                            // no_execute : l.j, l.nop, l.rfe
     252                           
     253                            log_printf(TRACE,Commit_unit,FUNCTION,"    * no_execute     : %d",no_execute);
     254                           
     255                            switch (type)
     256                              {
     257                              case TYPE_BRANCH : {entry->state=(no_execute==1)?ROB_BRANCH_COMPLETE:ROB_BRANCH_WAIT_END  ; break;}
     258                              case TYPE_MEMORY : {entry->state=(no_execute==1)?ROB_END_OK_SPECULATIVE:(entry->state=(is_store  ==1)?ROB_STORE_WAIT_END_OK:ROB_OTHER_WAIT_END); break;}
     259                              default          : {entry->state=(no_execute==1)?ROB_END_OK_SPECULATIVE:ROB_OTHER_WAIT_END; break;}
     260                              }
     261                          }
     262                        else
     263                          {
     264                            // Have an exception : wait head of ROB
     265                            // in_INSERT_NO_EXECUTE [x][y] : l.sys, l.trap
     266                           
     267                            entry->state = ROB_END_EXCEPTION_WAIT_HEAD;
     268                          }
     269                      }
     270
     271#ifdef STATISTICS
     272                      if (usage_is_set(_usage,USE_STATISTICS))
     273                        (*_stat_nb_inst_insert [x]) ++;
     274#endif
     275                   
     276                      // Push entry in rob
     277                      _rob[num_bank].push_back(entry);
     278                     
     279                      // Update counter and pointer
     280                      reg_NB_INST_COMMIT_ALL [front_end_id][context_id] ++;
     281                      if (type == TYPE_MEMORY)
     282                        reg_NB_INST_COMMIT_MEM [front_end_id][context_id] ++;
     283                     
     284
     285                      // flush = present event or future event.
     286                      //  * present event = don't can restart
     287
     288//                       bool flush = reg_EVENT_FLUSH [front_end_id][context_id];
     289
     290//                       bool flush = (((reg_EVENT_STATE [front_end_id][context_id] == COMMIT_EVENT_STATE_EVENT) or
     291//                                      (reg_EVENT_STATE [front_end_id][context_id] == COMMIT_EVENT_STATE_WAIT_DECOD)) or
     292//                                     (reg_EVENT_STOP [front_end_id][context_id]));
     293                     
     294                      // New instruction from decod_queue. Flush if :
     295                      //     * future event (instruction don't need execute because they are a previous event (miss load/branch or exception))
     296                      //     * or present_event
     297                      //   * and not can_restart (previous empty decod queue), because between the event_stop (branch_complete) and the state event (miss in head), many cycle is occured.
     298                      bool flush = ((// present event
     299                                     ((reg_EVENT_STATE [front_end_id][context_id] == COMMIT_EVENT_STATE_EVENT) or
     300                                      (reg_EVENT_STATE [front_end_id][context_id] == COMMIT_EVENT_STATE_WAIT_DECOD)) or
     301                                     // futur event
     302                                     reg_EVENT_STOP [front_end_id][context_id])
     303                                    // can't restart
     304                                    and not reg_EVENT_CAN_RESTART[front_end_id][context_id]
     305                                    );
     306
     307                      if (flush)
     308                        {
     309                          // A new invalid instruction is push in rob -> new last instruction
     310                          reg_EVENT_LAST          [front_end_id][context_id] = false;
     311                          reg_EVENT_LAST_NUM_BANK [front_end_id][context_id] = num_bank;
     312                          reg_EVENT_LAST_NUM_PTR  [front_end_id][context_id] = ptr;
     313                        }
     314                     
     315                      // Update pointer
     316                      reg_NUM_PTR_TAIL  = ptr;
     317                      reg_BANK_PTR [num_bank]  = (reg_BANK_PTR [num_bank]+1)%_param->_size_bank;
     318                      nb_insert ++;
    98319                    }
    99                   break;
    100320                }
    101               case EVENT_STATE_END      :
    102                 {
    103                   reg_EVENT_STATE [i][j] = EVENT_STATE_NO_EVENT;
    104                   break;
    105                 }
    106 //            case EVENT_STATE_NO_EVENT :
    107               default : break;
    108               }
    109 
    110         // ===================================================================
    111         // =====[ INSERT ]====================================================
    112         // ===================================================================
    113         for (uint32_t i=0; i<_param->_nb_bank; i++)
    114           if (internal_BANK_INSERT_VAL [i])
    115             {
    116               // get rename unit source and instruction.
    117               uint32_t x = internal_BANK_INSERT_NUM_RENAME_UNIT [i];
    118               uint32_t y = internal_BANK_INSERT_NUM_INST        [i];
    119 
    120               if (PORT_READ(in_INSERT_VAL [x][y]))
    121                 {
    122                   log_printf(TRACE,Commit_unit,FUNCTION,"  * INSERT            [%d][%d]",x,y);
    123 
    124                   // get information
    125                   Tcontext_t   front_end_id = (_param->_have_port_front_end_id)?PORT_READ(in_INSERT_FRONT_END_ID [x][y]):0;
    126                   Tcontext_t   context_id   = (_param->_have_port_context_id  )?PORT_READ(in_INSERT_CONTEXT_ID   [x][y]):0;
    127                   Ttype_t      type         = PORT_READ(in_INSERT_TYPE         [x][y]);
    128                   Toperation_t operation    = PORT_READ(in_INSERT_OPERATION    [x][y]);
    129                   bool         is_store     = is_operation_memory_store(operation);
    130 
    131                   Texception_t exception    = PORT_READ(in_INSERT_EXCEPTION    [x][y]);
    132                   Tcontrol_t   no_execute   = PORT_READ(in_INSERT_NO_EXECUTE   [x][y]);
    133 
    134                   log_printf(TRACE,Commit_unit,FUNCTION,"    * front_end_id   : %d",front_end_id);
    135                   log_printf(TRACE,Commit_unit,FUNCTION,"    * context_id     : %d",context_id);
    136                   log_printf(TRACE,Commit_unit,FUNCTION,"    * type           : %s",toString(type).c_str());
    137                   log_printf(TRACE,Commit_unit,FUNCTION,"    * operation      : %d",operation );
    138                   log_printf(TRACE,Commit_unit,FUNCTION,"    * exception      : %d",exception );
    139                  
    140                   // Create new entry.
    141                   entry_t * entry = new entry_t;
    142 
    143                   entry->ptr                     = reg_BANK_PTR [i];
    144                   entry->front_end_id            = front_end_id;
    145                   entry->context_id              = context_id  ;
    146                   entry->rename_unit_id          = x;
    147                   entry->depth                   = (_param->_have_port_depth)?PORT_READ(in_INSERT_DEPTH [x][y]):0;
    148                   entry->type                    = type;
    149                   entry->operation               = operation;
    150                   entry->is_delay_slot           = PORT_READ(in_INSERT_IS_DELAY_SLOT         [x][y]);
    151 //                entry->address                 = PORT_READ(in_INSERT_ADDRESS               [x][y]);
    152                   entry->exception               = exception;
    153                   entry->exception_use           = PORT_READ(in_INSERT_EXCEPTION_USE         [x][y]);
    154                   entry->use_store_queue         = (type == TYPE_MEMORY) and (    is_store) and (not no_execute);
    155                   entry->use_load_queue          = (type == TYPE_MEMORY) and (not is_store) and (not no_execute);
    156                   entry->store_queue_ptr_write   = PORT_READ(in_INSERT_STORE_QUEUE_PTR_WRITE [x][y]);
    157                   entry->load_queue_ptr_write    = (_param->_have_port_load_queue_ptr)?PORT_READ(in_INSERT_LOAD_QUEUE_PTR_WRITE [x][y]):0;
    158 #ifdef DEBUG
    159                   entry->read_ra                 = PORT_READ(in_INSERT_READ_RA               [x][y]);
    160                   entry->num_reg_ra_log          = PORT_READ(in_INSERT_NUM_REG_RA_LOG        [x][y]);
    161                   entry->num_reg_ra_phy          = PORT_READ(in_INSERT_NUM_REG_RA_PHY        [x][y]);
    162                   entry->read_rb                 = PORT_READ(in_INSERT_READ_RB               [x][y]);
    163                   entry->num_reg_rb_log          = PORT_READ(in_INSERT_NUM_REG_RB_LOG        [x][y]);
    164                   entry->num_reg_rb_phy          = PORT_READ(in_INSERT_NUM_REG_RB_PHY        [x][y]);
    165                   entry->read_rc                 = PORT_READ(in_INSERT_READ_RC               [x][y]);
    166                   entry->num_reg_rc_log          = PORT_READ(in_INSERT_NUM_REG_RC_LOG        [x][y]);
    167                   entry->num_reg_rc_phy          = PORT_READ(in_INSERT_NUM_REG_RC_PHY        [x][y]);
    168 #endif
    169                   entry->write_rd                = PORT_READ(in_INSERT_WRITE_RD              [x][y]);
    170                   entry->num_reg_rd_log          = PORT_READ(in_INSERT_NUM_REG_RD_LOG        [x][y]);
    171                   entry->num_reg_rd_phy_old      = PORT_READ(in_INSERT_NUM_REG_RD_PHY_OLD    [x][y]);
    172                   entry->num_reg_rd_phy_new      = PORT_READ(in_INSERT_NUM_REG_RD_PHY_NEW    [x][y]);
    173                   entry->write_re                = PORT_READ(in_INSERT_WRITE_RE              [x][y]);
    174                   entry->num_reg_re_log          = PORT_READ(in_INSERT_NUM_REG_RE_LOG        [x][y]);
    175                   entry->num_reg_re_phy_old      = PORT_READ(in_INSERT_NUM_REG_RE_PHY_OLD    [x][y]);
    176                   entry->num_reg_re_phy_new      = PORT_READ(in_INSERT_NUM_REG_RE_PHY_NEW    [x][y]);
    177                   entry->no_sequence             = type == TYPE_BRANCH;
    178                   entry->speculative             = true;
    179 #ifdef DEBUG
    180                   entry->address                 = PORT_READ(in_INSERT_ADDRESS               [x][y]);
    181 #endif
    182                   entry->address_next            = PORT_READ(in_INSERT_ADDRESS_NEXT          [x][y]);
    183 #ifdef DEBUG
    184                   entry->cycle_rob_in            = simulation_cycle();
    185                   entry->cycle_commit            = simulation_cycle();
    186 #endif
    187 
    188                   // Test if exception :
    189                   //  * yes : no execute instruction, wait ROB Head
    190                   //  * no  : test type
    191                   //            * BRANCH : l.j   -> branch is ended
    192                   //                       other -> wait the execution end of branchment
    193                   //            * MEMORY : store -> wait store is at head of ROB
    194                   //                       other -> wait end of instruction
    195                   //            * OTHER
    196 
    197 //                   bool       flush      = reg_EVENT_FLUSH [front_end_id][context_id];
    198 
    199 //                   log_printf(TRACE,Commit_unit,FUNCTION,"    * flush          : %d",flush);
    200 
    201 //                   if (flush)
    202 //                     {
    203 //                       entry->state    = ROB_END_MISS; // All type (branch, memory and others), because, is not execute
    204 //                     }
    205 //                   else
    206                     {
    207                       if (exception == EXCEPTION_NONE)
    208                         {
    209                           // no_execute : l.j, l.nop, l.rfe
    210                          
    211                           log_printf(TRACE,Commit_unit,FUNCTION,"    * no_execute     : %d",no_execute);
    212                          
    213                           switch (type)
    214                             {
    215                             case TYPE_BRANCH : {entry->state=(no_execute==1)?ROB_BRANCH_COMPLETE:ROB_BRANCH_WAIT_END  ; break;}
    216                             case TYPE_MEMORY : {entry->state=(no_execute==1)?ROB_END_OK_SPECULATIVE:(entry->state=(is_store  ==1)?ROB_STORE_WAIT_HEAD_OK:ROB_OTHER_WAIT_END); break;}
    217                             default          : {entry->state=(no_execute==1)?ROB_END_OK_SPECULATIVE:ROB_OTHER_WAIT_END; break;}
    218                             }
    219                         }
    220                       else
    221                         {
    222                           // Have an exception : wait head of ROB
    223                          
    224                           // in_INSERT_NO_EXECUTE [x][y] : l.sys, l.trap
    225                          
    226                           entry->state = ROB_END_EXCEPTION_WAIT_HEAD;
    227                         }
    228                     }
    229 
    230 #ifdef STATISTICS
    231                   if (usage_is_set(_usage,USE_STATISTICS))
    232                     (*_stat_nb_inst_insert [x]) ++;
    233 #endif
    234 
    235                   // Push in rob
    236                   _rob[i].push_back(entry);
    237 
    238                   // Update counter and pointer
    239                   reg_NB_INST_COMMIT_ALL [front_end_id][context_id] ++;
    240                   if (type == TYPE_MEMORY)
    241                     reg_NB_INST_COMMIT_MEM [front_end_id][context_id] ++;
    242 
    243                   reg_NUM_BANK_TAIL = (reg_NUM_BANK_TAIL+1)%_param->_nb_bank;
    244                   reg_BANK_PTR [i]  = (reg_BANK_PTR [i]+1)%_param->_size_bank;
    245                 }
    246             }
     321            }
     322          // Update pointer
     323          reg_NUM_BANK_TAIL = (reg_NUM_BANK_TAIL+nb_insert)%_param->_nb_bank;
     324        }
    247325
    248326        // ===================================================================
     
    255333#endif
    256334
     335        // For each commit instruction ...
    257336        for (uint32_t i=0; i<_param->_nb_bank; i++)
    258337          for (uint32_t j=0; j<_param->_nb_bank_access_commit; j++)
     338            // ... test if an instruction have finish this execution
    259339            if (internal_BANK_COMMIT_VAL [i][j])
    260340              {
    261                 // An instruction is executed. Change state of this instruction
    262 
     341                // An instruction is executed -> Change state of this instruction
     342
     343                // Get information
    263344                uint32_t x = internal_BANK_COMMIT_NUM_INST [i][j];
    264345
     346                // Test if instruction is valid and is enable
     347                // (can be disable if this instruction is reexecute)
    265348                if (PORT_READ(in_COMMIT_VAL [x]) and PORT_READ(in_COMMIT_WEN [x]))
    266349                  {
     
    278361                                                 
    279362                  //Toperation_t    operation    = PORT_READ(in_COMMIT_OPERATION   [x]);
    280                   //Ttype_t         type         = PORT_READ(in_COMMIT_TYPE        [x]);
     363                    Ttype_t         type         = entry->type;
     364                    Tcontrol_t      no_sequence  = PORT_READ(in_COMMIT_NO_SEQUENCE [x]);
     365
     366#if 0
     367                    if ((type == TYPE_MEMORY) and no_sequence)
     368                      continue;
     369#endif             
     370
    281371                    Texception_t    exception    = PORT_READ(in_COMMIT_EXCEPTION   [x]);
    282372
     
    286376
    287377                    // change state : test exception_use
    288                     //  * test if exception : exception and mask
    289378                   
    290379                    bool have_exception        = false;
    291380                    bool have_miss_speculation = false;
    292381
     382                    // Test if have an exception ...
    293383                    if (exception != EXCEPTION_NONE)
    294384                      {
    295                         // Test if the instruction is a load and is a miss speculation (load is commit, but they have an dependence with a previous store)
     385                        // Test if the instruction is a load and is a miss speculation
     386                        // (load is commit, but they have an dependence with a previous store -> need restart pipeline)
     387
    296388                        have_miss_speculation  = (exception == EXCEPTION_MEMORY_MISS_SPECULATION);
    297389
     390                        //  * Test if the exception generated can be trap by this exception
    298391                        switch (entry->exception_use)
    299392                          {
     
    327420                      }
    328421                   
     422                    // Next state depends of previous state
    329423                    switch (state)
    330424                      {
    331                         // Branch ...
    332                       case ROB_BRANCH_WAIT_END : {state = (have_exception)?ROB_END_EXCEPTION_WAIT_HEAD:ROB_BRANCH_COMPLETE; break;}
    333                         // Store KO
    334                       case ROB_EVENT_WAIT_END  : {state = ROB_END_KO_SPECULATIVE; break;}
    335                         // Store OK, Load and other instruction
    336                       case ROB_OTHER_WAIT_END  : {state = (have_exception)?ROB_END_EXCEPTION_WAIT_HEAD:((have_miss_speculation)?ROB_END_LOAD_MISS_SPECULATIVE:ROB_END_OK_SPECULATIVE); break;}
     425                        // Branch : if no exception, the branchement can be completed
     426                      case ROB_BRANCH_WAIT_END :
     427                        {
     428                          if (not have_exception)
     429                            state = ROB_BRANCH_COMPLETE;
     430                          else
     431                            state = ROB_END_EXCEPTION_WAIT_HEAD;
     432                          break;
     433                        }
     434                        // Previous event -> set state as execute
     435                      case ROB_STORE_KO_WAIT_END :
     436                      case ROB_EVENT_WAIT_END  :
     437                        {
     438                          state = ROB_END_KO_SPECULATIVE;
     439                          break;
     440                        }
     441                        // No previous event - Load and other instruction
     442                      case ROB_STORE_OK_WAIT_END :
     443                      case ROB_OTHER_WAIT_END  :
     444                        {
     445                          if (not have_exception)
     446                            {
     447                              if (not have_miss_speculation)
     448                                state = ROB_END_OK_SPECULATIVE;
     449                              else
     450                                state = ROB_END_LOAD_MISS_SPECULATIVE;
     451                            }
     452                          else
     453                            state = ROB_END_EXCEPTION_WAIT_HEAD;
     454                          break;
     455                        }
     456                      case ROB_STORE_WAIT_END_OK :
     457                        {
     458                          if (not have_exception)
     459                            state = ROB_STORE_OK;
     460                          else
     461                            state = ROB_STORE_EVENT;
     462                          break;
     463                        }
     464                      case ROB_STORE_WAIT_END_KO :
     465                        {
     466//                        if (not have_exception)
     467                            state = ROB_STORE_KO;
     468//                        else
     469//                             state = ROB_END_EXCEPTION_WAIT_HEAD;
     470                          break;
     471                        }
     472
     473
    337474                      default :
    338475                        {
     
    342479                      }
    343480
    344                     if ((have_exception or have_miss_speculation) and
    345                         (reg_EVENT_FLUSH [entry->front_end_id][entry->context_id] == 0))
    346                       reg_EVENT_STOP [entry->front_end_id][entry->context_id] = true;
    347 
    348                     // update Re Order Buffer
     481                    // Commit an instruction ...
     482                    // Test if have an event (miss_speculation or exception) and not manage a previous event
     483                    // if yes, this instruction would modify state machine. Also stop Re Order Buffer
     484
     485//                  bool flush = reg_EVENT_FLUSH [entry->front_end_id][entry->context_id];
     486                    bool flush = ((reg_EVENT_STATE [entry->front_end_id][entry->context_id] == COMMIT_EVENT_STATE_EVENT) or
     487                                  (reg_EVENT_STATE [entry->front_end_id][entry->context_id] == COMMIT_EVENT_STATE_WAIT_DECOD) or
     488                                  (reg_EVENT_STATE [entry->front_end_id][entry->context_id] == COMMIT_EVENT_STATE_WAIT_END));
     489                   
     490                    if ((have_exception or have_miss_speculation) and (not flush))
     491                      {
     492                        uint32_t packet = ((entry->ptr << _param->_shift_num_slot) | i);
     493                       
     494                        // test have a previous event detected (event_stop = 1)
     495                        // if yes, test if the actual event if "before (in order)" that the previous event
     496                        if (reg_EVENT_STOP [entry->front_end_id][entry->context_id])
     497                          {
     498                            // Compare packet_id (by construction instruction is insert in order by increase packet_id)
     499
     500                            uint32_t _top = ((_rob[ reg_NUM_BANK_HEAD].front()->ptr << _param->_shift_num_slot) | reg_NUM_BANK_HEAD);
     501                            uint32_t _old = reg_EVENT_PACKET [entry->front_end_id][entry->context_id];
     502                            uint32_t _new = packet;
     503                            if (_old < _top) _old = _old+_param->_size_queue;
     504                            if (_new < _top) _new = _new+_param->_size_queue;
     505                            if (_new < _old) reg_EVENT_PACKET [entry->front_end_id][entry->context_id] = packet;
     506                          }
     507                        else
     508                          reg_EVENT_PACKET [entry->front_end_id][entry->context_id] = packet;
     509                       
     510                        // have an error, stop issue instruction
     511                        reg_EVENT_STOP          [entry->front_end_id][entry->context_id] = true;
     512//                         reg_EVENT_NUM_BANK      [entry->front_end_id][entry->context_id] = i;
     513//                         reg_EVENT_NUM_PTR       [entry->front_end_id][entry->context_id] = entry->ptr;
     514
     515//                      reg_EVENT_CAN_RESTART   [entry->front_end_id][entry->context_id] = false;
     516                        reg_EVENT_LAST_NUM_BANK [entry->front_end_id][entry->context_id] = ((reg_NUM_BANK_TAIL==0)?_param->_nb_bank:reg_NUM_BANK_TAIL)-1;
     517                        reg_EVENT_LAST_NUM_PTR  [entry->front_end_id][entry->context_id] = reg_NUM_PTR_TAIL;
     518                      }
     519                   
     520                    // Update Re Order Buffer
    349521                    entry->state        = state;
    350522                    entry->exception    = exception;
    351523                    entry->flags        = PORT_READ(in_COMMIT_FLAGS       [x]);
    352                     entry->no_sequence  = PORT_READ(in_COMMIT_NO_SEQUENCE [x]);
     524                    entry->no_sequence  = no_sequence;
    353525                    // jalr, jr : address_dest is in register
    354                     if ((entry->type      == TYPE_BRANCH) and
     526                    if ((       type      == TYPE_BRANCH) and
    355527                        (entry->operation == OPERATION_BRANCH_L_JALR) and
    356528                        (entry->read_rb))
     
    358530
    359531#ifdef DEBUG
    360                   entry->cycle_commit            = simulation_cycle();
     532                    entry->load_data               = PORT_READ(in_COMMIT_ADDRESS [x]);
     533                    entry->cycle_commit            = simulation_cycle();
    361534#endif
    362535                  }
     
    368541        for (uint32_t i=0; i<_param->_nb_bank; i++)
    369542          {
     543            // Compute bank number
    370544            uint32_t num_bank = (internal_BANK_RETIRE_HEAD+i)%_param->_nb_bank;
    371545           
     546            // Test if have an request
    372547            if (internal_BANK_RETIRE_VAL [num_bank])
    373548              {
     549                // Take num instruction
    374550                uint32_t x = internal_BANK_RETIRE_NUM_RENAME_UNIT [num_bank];
    375551                uint32_t y = internal_BANK_RETIRE_NUM_INST        [num_bank];
     
    382558                  throw ERRORMORPHEO(FUNCTION,_("Retire : retire_ack must be set.\n"));
    383559#endif
     560
     561
     562#ifdef STATISTICS
     563            if (usage_is_set(_usage,USE_STATISTICS))
     564              (*_stat_nb_inst_retire [x]) ++;
    384565               
    385                 entry_t *  entry        =  _rob [num_bank].front();
    386                 rob_state_t state = entry->state;
     566#endif
    387567               
    388                 Tcontext_t front_end_id = entry->front_end_id;
    389                 Tcontext_t context_id   = entry->context_id  ;
    390                 uint32_t   num_thread   = _param->_translate_num_context_to_num_thread [front_end_id][context_id];
    391                 Ttype_t    type         = entry->type        ;
    392                 bool       retire_ok    = false;
    393 
    394                 log_printf(TRACE,Commit_unit,FUNCTION,"    * front_end_id : %d",front_end_id );
    395                 log_printf(TRACE,Commit_unit,FUNCTION,"    * context_id   : %d",context_id   );
    396                 log_printf(TRACE,Commit_unit,FUNCTION,"    * rob_ptr      : %d",((entry->ptr << _param->_shift_num_slot) | num_bank));
    397                 log_printf(TRACE,Commit_unit,FUNCTION,"    * num_thread   : %d",num_thread   );
    398                 log_printf(TRACE,Commit_unit,FUNCTION,"    * type         : %s",toString(type).c_str());
    399                 log_printf(TRACE,Commit_unit,FUNCTION,"    * state        : %s",toString(state).c_str());
    400 
    401                 if ((state == ROB_END_OK         ) or
    402 //                  (state == ROB_END_KO         ) or
    403                     (state == ROB_END_BRANCH_MISS) or
    404                     (state == ROB_END_LOAD_MISS  )//  or
    405 //                  (state == ROB_END_MISS       ) or
    406 //                  (state == ROB_END_EXCEPTION  )
    407                     )
    408                   {
    409                     log_printf(TRACE,Commit_unit,FUNCTION,"    * retire_ok");
    410 
    411                     retire_ok = true;
    412 
    413 //                  reg_PC_PREVIOUS           [front_end_id][context_id] = reg_PC_CURRENT [front_end_id][context_id];
    414                     reg_PC_CURRENT            [front_end_id][context_id] = reg_PC_NEXT    [front_end_id][context_id];
    415                     reg_PC_CURRENT_IS_DS      [front_end_id][context_id] = entry->type == TYPE_BRANCH;
    416                     reg_PC_CURRENT_IS_DS_TAKE [front_end_id][context_id] = entry->no_sequence;
    417                     reg_PC_NEXT               [front_end_id][context_id] = (entry->no_sequence)?(entry->address_next):(reg_PC_CURRENT [front_end_id][context_id]+1);
    418 
    419 //                   if (entry->address_next != reg_PC_NEXT [front_end_id][context_id])
    420 //                     throw ERRORMORPHEO(FUNCTION,toString(_("Retire : Instruction's address_next (%.8x) is different of commit_unit's address_next (%.8x)"),entry->address_next,reg_PC_NEXT [front_end_id][context_id]));
    421                   }
    422 
    423                 if ((state == ROB_END_BRANCH_MISS) or
    424                     (state == ROB_END_LOAD_MISS))
    425                     {
    426                       reg_EVENT_STATE [front_end_id][context_id] = EVENT_STATE_EVENT;
    427                       reg_EVENT_FLUSH [front_end_id][context_id] = true;
    428                       reg_EVENT_STOP  [front_end_id][context_id] = false;
    429                     }
    430                
    431 #if defined(DEBUG) and defined(DEBUG_Commit_unit) and (DEBUG_Commit_unit == true)
    432                 // log file
    433                 instruction_log_file [num_thread]
    434                   << "[" << simulation_cycle() << "] "
    435                   << std::hex
    436                   << (entry->address<<2) << " (" << (entry->address) << ") "
    437                   << std::dec
    438                   << "[" << entry->cycle_rob_in << ", " << entry->cycle_commit << "] "
    439                   << "{" << ((retire_ok)?" OK ":"!KO!") << "} "
    440                   << std::endl;
    441 #endif
    442 
    443                 // Update nb_inst
    444                 reg_NB_INST_COMMIT_ALL [front_end_id][context_id] --;
    445                 if (type == TYPE_MEMORY)
    446                   reg_NB_INST_COMMIT_MEM [front_end_id][context_id] --;
    447                
    448                 reg_NUM_BANK_HEAD = (reg_NUM_BANK_HEAD+1)%_param->_nb_bank;
    449                
    450                 delete entry;
    451                 _rob [num_bank].pop_front();
    452                
    453                 // Transaction on retire interface : reset watch dog timer.
    454                 _nb_cycle_idle [front_end_id][context_id] = 0;
    455 
    456                 // Increase stop condition
    457                 if (retire_ok)
    458                   _simulation_nb_instruction_commited [num_thread] ++;
    459 
    460 #ifdef STATISTICS
    461                 if (usage_is_set(_usage,USE_STATISTICS))
    462                   {
    463                     (*_stat_nb_inst_retire [x]) ++;
    464                    
    465                     if (retire_ok)
    466                       {
    467                         (*_stat_nb_inst_retire_ok [num_thread]) ++;
    468                         (*_stat_nb_inst_type      [type]      ) ++;
    469                       }
    470                     else
    471                       (*_stat_nb_inst_retire_ko [num_thread]) ++;
    472                   }
    473 #endif
     568                // Read information
     569                entry_t *   entry        =  _rob [num_bank].front();
     570
     571                entry->state_old = entry->state;
     572                entry->state     = ROB_END;
    474573              }
    475574          }
    476575
     576        for (uint32_t i=0; i<_param->_nb_bank; i++)
     577          {
     578            // Compute bank number
     579            bool      can_continue = false;
     580            uint32_t  num_bank = reg_NUM_BANK_HEAD;
     581           
     582            if (not _rob [num_bank].empty ())
     583              {
     584                entry_t * entry = _rob [num_bank].front();
     585               
     586                if (entry->state == ROB_END)
     587                  {
     588                    log_printf(TRACE,Commit_unit,FUNCTION,"  * RETIRE_ROB [%d]",num_bank);
     589           
     590                    can_continue = true;
     591
     592                    Tcontext_t  front_end_id = entry->front_end_id;
     593                    Tcontext_t  context_id   = entry->context_id  ;
     594                    uint32_t    num_thread   = _param->_translate_num_context_to_num_thread [front_end_id][context_id];
     595                    rob_state_t state        = entry->state_old;
     596                    Ttype_t     type         = entry->type        ;
     597                    bool        retire_ok    = false;
     598                    uint32_t    packet_id    = ((entry->ptr << _param->_shift_num_slot) | num_bank);
     599                   
     600                    log_printf(TRACE,Commit_unit,FUNCTION,"    * front_end_id : %d",front_end_id );
     601                    log_printf(TRACE,Commit_unit,FUNCTION,"    * context_id   : %d",context_id   );
     602                    log_printf(TRACE,Commit_unit,FUNCTION,"    * rob_ptr      : %d",packet_id    );
     603                    log_printf(TRACE,Commit_unit,FUNCTION,"    * num_thread   : %d",num_thread   );
     604                    log_printf(TRACE,Commit_unit,FUNCTION,"    * type         : %s",toString(type).c_str());
     605                    log_printf(TRACE,Commit_unit,FUNCTION,"    * state        : %s",toString(state).c_str());
     606                   
     607                    // Test if the instruction is valid
     608                    // (BRANCH_MISS = instruction branch is valid, but have make an invalid prediction)
     609                    // (LOAD_MISS   = instruction load   is valid, but have make an invalid result)
     610                    if ((state == ROB_END_OK         ) or
     611//                      (state == ROB_END_KO         ) or
     612                        (state == ROB_END_BRANCH_MISS) or
     613                        (state == ROB_END_LOAD_MISS  )//  or
     614//                      (state == ROB_END_MISS       ) or
     615//                      (state == ROB_END_EXCEPTION  )
     616                        )
     617                      {
     618                        log_printf(TRACE,Commit_unit,FUNCTION,"    * retire_ok");
     619                   
     620                        retire_ok = true;
     621                   
     622                        // Update PC information
     623//                      reg_PC_PREVIOUS           [front_end_id][context_id] = reg_PC_CURRENT [front_end_id][context_id];
     624                        reg_PC_CURRENT            [front_end_id][context_id] = reg_PC_NEXT    [front_end_id][context_id];
     625                        reg_PC_CURRENT_IS_DS      [front_end_id][context_id] = type == TYPE_BRANCH;
     626                        reg_PC_CURRENT_IS_DS_TAKE [front_end_id][context_id] = entry->no_sequence;
     627                        reg_PC_NEXT               [front_end_id][context_id] = (entry->no_sequence)?(entry->address_next):(reg_PC_CURRENT [front_end_id][context_id]+1);
     628                      }
     629                   
     630                    // Test if have an event
     631                    if ((state == ROB_END_BRANCH_MISS) or
     632                        (state == ROB_END_LOAD_MISS))
     633                      {
     634                          reg_EVENT_STATE         [front_end_id][context_id] = COMMIT_EVENT_STATE_EVENT;
     635//                        reg_EVENT_FLUSH         [front_end_id][context_id] = true;
     636                          reg_EVENT_STOP          [front_end_id][context_id] = false; // instruction flow can continue
     637//                        reg_EVENT_CAN_RESTART   [front_end_id][context_id] = false;
     638                          reg_EVENT_LAST          [front_end_id][context_id] = false;
     639                          // it the head !
     640                          reg_EVENT_PACKET        [front_end_id][context_id] = packet_id;
     641                   
     642                          // If event is an load_miss, many instruction can be inserted.
     643                          // -> new last instruction
     644                          if (state == ROB_END_LOAD_MISS)
     645                            {
     646                            reg_EVENT_CAN_RESTART   [front_end_id][context_id] = false;
     647                           
     648                            reg_EVENT_LAST_NUM_BANK [front_end_id][context_id] = ((reg_NUM_BANK_TAIL==0)?_param->_nb_bank:reg_NUM_BANK_TAIL)-1;
     649                            reg_EVENT_LAST_NUM_PTR  [front_end_id][context_id] = reg_NUM_PTR_TAIL;
     650                            }
     651                        }
     652                   
     653                    // Test if this instruction is the last instruction of an event
     654                    //   * need event
     655                    //   * packet id = last packet id
     656                    if ((reg_EVENT_STATE         [front_end_id][context_id] != COMMIT_EVENT_STATE_NO_EVENT) and
     657                        (reg_EVENT_LAST_NUM_BANK [front_end_id][context_id] == num_bank            ) and
     658                        (reg_EVENT_LAST_NUM_PTR  [front_end_id][context_id] == entry->ptr          ))
     659                      reg_EVENT_LAST [front_end_id][context_id] = true;
     660                   
     661                    // Update nb_inst
     662                    reg_NB_INST_COMMIT_ALL [front_end_id][context_id] --;
     663                    if (type == TYPE_MEMORY)
     664                    reg_NB_INST_COMMIT_MEM [front_end_id][context_id] --;
     665                   
     666                    // Update pointer
     667                    reg_NUM_BANK_HEAD = (num_bank+1)%_param->_nb_bank;
     668                   
     669                    // Remove entry
     670                    delete entry;
     671                    _rob [num_bank].pop_front();
     672                   
     673                    // Reset watch dog timer because have transaction on retire interface
     674                    _nb_cycle_idle [front_end_id][context_id] = 0;
     675                   
     676                    // Increase stop condition
     677                    if (retire_ok)
     678                      _simulation_nb_instruction_commited [num_thread] ++;
     679
     680#ifdef STATISTICS
     681                    if (usage_is_set(_usage,USE_STATISTICS))
     682                      {
     683                        if (retire_ok)
     684                          {
     685                            (*_stat_nb_inst_retire_ok [num_thread]) ++;
     686                            (*_stat_nb_inst_type      [type]      ) ++;
     687                          }
     688                        else
     689                          (*_stat_nb_inst_retire_ko [num_thread]) ++;
     690                      }
     691#endif
     692
     693#if defined(DEBUG) and defined(DEBUG_Commit_unit) and (DEBUG_Commit_unit == true)
     694                    {
     695                      // log file
     696                      instruction_log_file [num_thread]
     697                        << "[" << simulation_cycle() << "] "
     698                        << std::hex
     699                        << (entry->address<<2) << " (" << (entry->address) << ") "
     700                        << std::dec
     701                        << "[" << entry->cycle_rob_in << ", " << entry->cycle_commit << "] "
     702                        << "{" << ((retire_ok)?"OK":"KO") << "} ";
     703                     
     704                      if ((type == TYPE_MEMORY) and  is_operation_memory_load(entry->operation))
     705                        instruction_log_file [num_thread] << std::hex << entry->load_data << std::dec;
     706                     
     707                      instruction_log_file [num_thread] << std::endl;
     708                    }
     709#endif     
     710                  }
     711              }
     712           
     713            if (not can_continue)
     714              break; // stop scan
     715          }
     716
    477717        // ===================================================================
    478718        // =====[ REEXECUTE ]=================================================
    479719        // ===================================================================
    480         if (internal_REEXECUTE_VAL [0] and PORT_READ(in_REEXECUTE_ACK [0]))
    481           {
    482             log_printf(TRACE,Commit_unit,FUNCTION,"  * REEXECUTE         [0]");
    483 
    484             uint32_t num_bank = internal_REEXECUTE_NUM_BANK [0];
    485 
    486             entry_t    * entry = _rob [num_bank].front();
    487             rob_state_t  state = entry->state;
    488 
    489             switch (state)
    490               {
    491               case ROB_STORE_HEAD_OK : {state = ROB_OTHER_WAIT_END; break; }
    492               case ROB_STORE_HEAD_KO : {state = ROB_EVENT_WAIT_END; break; }
    493               default : {throw ERRORMORPHEO(FUNCTION,_("Reexecute : invalid state value.\n"));}
    494               }
    495 
    496             entry->state = state;
    497           }
    498 
     720        // Test if have an reexecute instruction (an store in head of rob)
     721        for (uint32_t i=0; i<_param->_nb_inst_reexecute; ++i)
     722          if (internal_REEXECUTE_VAL [i] and PORT_READ(in_REEXECUTE_ACK [i]))
     723            {
     724              log_printf(TRACE,Commit_unit,FUNCTION,"  * REEXECUTE         [%d]",i);
     725             
     726              uint32_t num_bank = internal_REEXECUTE_NUM_BANK [i];
     727             
     728              entry_t    * entry = _rob [num_bank].front();
     729              rob_state_t  state = entry->state;
     730             
     731              // Change state
     732              switch (state)
     733                {
     734                case ROB_STORE_OK    : {state = ROB_STORE_OK_WAIT_END; break; }
     735                case ROB_STORE_KO    : {state = ROB_STORE_KO_WAIT_END; break; }
     736                case ROB_STORE_EVENT : {state = ROB_EVENT_WAIT_END; break; }
     737                default : {throw ERRORMORPHEO(FUNCTION,_("Reexecute : invalid state value.\n"));}
     738                }
     739             
     740              entry->state = state;
     741            }
     742       
    499743        // ===================================================================
    500744        // =====[ BRANCH_COMPLETE ]===========================================
    501745        // ===================================================================
    502746        for (uint32_t i=0; i<_param->_nb_inst_branch_complete; i++)
     747          // Test if the prediction_unit have accept the branch complete transaction
    503748          if (internal_BRANCH_COMPLETE_VAL [i] and PORT_READ(in_BRANCH_COMPLETE_ACK [i]))
    504749            {
    505750              log_printf(TRACE,Commit_unit,FUNCTION,"  * BRANCH_COMPLETE   [%d]",i);
    506               log_printf(TRACE,Commit_unit,FUNCTION,"    * miss_prediction : %d",PORT_READ(in_BRANCH_COMPLETE_MISS_PREDICTION [i]));
    507 
     751
     752              // Read information
    508753              uint32_t num_bank = internal_BRANCH_COMPLETE_NUM_BANK [i];
    509754             
     
    516761#endif
    517762              Tcontrol_t miss = PORT_READ(in_BRANCH_COMPLETE_MISS_PREDICTION [i]);
     763
     764              log_printf(TRACE,Commit_unit,FUNCTION,"    * miss_prediction : %d",miss);
    518765             
    519766              entry->state = (miss)?ROB_END_BRANCH_MISS_SPECULATIVE:ROB_END_OK_SPECULATIVE;
    520              
    521               if (miss and (reg_EVENT_FLUSH [entry->front_end_id][entry->context_id] == 0))
    522                 reg_EVENT_STOP [entry->front_end_id][entry->context_id] = true;
    523 
    524 
    525 //               entry->state = ROB_END_OK_SPECULATIVE;
     767
     768//            bool flush = reg_EVENT_FLUSH [entry->front_end_id][entry->context_id];
     769
     770              // Branch_complete can be execute if
     771              //   * no present event
     772              //   * futur event and most not speculative that the event
     773
     774              // Also, test if in this cycle, they have not an most recently event !!!
     775              if (miss)
     776                {
     777                  uint32_t packet = ((entry->ptr << _param->_shift_num_slot) | num_bank);
     778                     
     779                  // test if this packet is before previous event
     780                  if (reg_EVENT_STOP [entry->front_end_id][entry->context_id])
     781                    {
     782                      uint32_t _top = ((_rob[ reg_NUM_BANK_HEAD].front()->ptr << _param->_shift_num_slot) | reg_NUM_BANK_HEAD);
     783                      uint32_t _old = reg_EVENT_PACKET [entry->front_end_id][entry->context_id];
     784                      uint32_t _new = packet;
     785                      if (_old < _top) _old = _old+_param->_size_queue;
     786                      if (_new < _top) _new = _new+_param->_size_queue;
     787                      if (_new < _old) reg_EVENT_PACKET [entry->front_end_id][entry->context_id] = packet;
     788                    }
     789                  else
     790                    reg_EVENT_PACKET [entry->front_end_id][entry->context_id] = packet;
     791
     792                  // In all case, stop instruction flow
     793                  reg_EVENT_STOP          [entry->front_end_id][entry->context_id] = true;
     794//                   reg_EVENT_NUM_BANK      [entry->front_end_id][entry->context_id] = num_bank;
     795//                   reg_EVENT_NUM_PTR       [entry->front_end_id][entry->context_id] = entry->ptr;
     796
     797                  reg_EVENT_CAN_RESTART   [entry->front_end_id][entry->context_id] = false;
     798
     799                  reg_EVENT_LAST_NUM_BANK [entry->front_end_id][entry->context_id] = ((reg_NUM_BANK_TAIL==0)?_param->_nb_bank:reg_NUM_BANK_TAIL)-1;
     800                  reg_EVENT_LAST_NUM_PTR  [entry->front_end_id][entry->context_id] = reg_NUM_PTR_TAIL;
     801                }
    526802            }
    527803
     
    529805        // =====[ UPDATE ]====================================================
    530806        // ===================================================================
     807        // Update when exception or load_miss
    531808        if (internal_UPDATE_VAL and PORT_READ(in_UPDATE_ACK))
    532809          {
    533810            log_printf(TRACE,Commit_unit,FUNCTION,"  * UPDATE");
    534811
     812            // Change state
    535813            entry_t * entry = _rob [internal_UPDATE_NUM_BANK].front();
    536814
     
    556834                }
    557835              }
    558 
    559836          }
    560837
     
    578855        // =====[ DEPTH - HEAD ]==============================================
    579856        // ===================================================================
    580         for (uint32_t i=0; i<_param->_nb_bank; i++)
    581           if (not _rob[i].empty())
    582             {
    583               // Scan all instruction in windows and test if instruction is speculative
    584               entry_t    * entry        = _rob [i].front();
    585              
    586               Tcontext_t   front_end_id = entry->front_end_id;
    587               Tcontext_t   context_id   = entry->context_id  ;
    588               rob_state_t  state        = entry->state;
    589               Tdepth_t     depth        = entry->depth;
    590 
    591               Tdepth_t     depth_min    = (_param->_have_port_depth)?PORT_READ(in_DEPTH_MIN[front_end_id][context_id]):0;
    592               Tdepth_t     depth_max    = (_param->_have_port_depth)?PORT_READ(in_DEPTH_MAX[front_end_id][context_id]):0;
    593               Tcontrol_t   depth_full   = PORT_READ(in_DEPTH_FULL [front_end_id][context_id]);
     857
     858        {
     859          bool EVENT_LAST [_param->_nb_front_end][_param->_max_nb_context];
     860          for (uint32_t i=0; i<_param->_nb_front_end; i++)
     861            for (uint32_t j=0; j<_param->_nb_context [i]; j++)
     862              EVENT_LAST [i][j] = reg_EVENT_LAST [i][j];
     863
     864          // Read all instruction of all top bank
     865          for (uint32_t i=0; i<_param->_nb_bank; i++)
     866            {
     867              uint32_t num_bank = (reg_NUM_BANK_HEAD+i)%_param->_nb_bank;
    594868             
    595               // is a valid instruction ?
    596               // If DEPTH_CURRENT :
    597               // equal at     DEPTH_MIN            -> not speculative
    598               // not include ]DEPTH_MIN:DEPTH_MAX] -> previous branch miss
    599               //     include ]DEPTH_MIN:DEPTH_MAX] -> speculative
    600              
    601               // All case
    602               // ....... min ...X... max ....... OK
    603               // ....... min ....... max ...X... KO
    604               // ...X... min ....... max ....... KO
    605               // ....... max ....... min ...X... OK
    606               // ...X... max ....... min ....... OK
    607               // ....... max ...X... min ....... KO
    608              
    609               bool         flush         = reg_EVENT_FLUSH [front_end_id][context_id];
    610               bool         speculative   = entry->speculative and not (depth == depth_min);
    611               Tcontrol_t   is_valid      = ((not speculative or
    612                                              (speculative and (depth_full or // all is valid
    613                                                                ((depth_min <= depth_max)? // test if depth is overflow
    614                                                                 ((depth >= depth_min) and (depth <=depth_max)):
    615                                                                 ((depth >= depth_min) or  (depth <=depth_max))))))
    616                                              and not flush);
    617 
    618 //            Tcontrol_t   is_valid      = ((depth == depth_min) and not flush);
    619 
    620               log_printf(TRACE,Commit_unit,FUNCTION,"  * HEAD              [%d]",i);
    621               log_printf(TRACE,Commit_unit,FUNCTION,"    * is_valid        : %d ((depth == depth_min) and not flush)",is_valid);
    622               log_printf(TRACE,Commit_unit,FUNCTION,"    * depth           : %d",depth    );
    623               log_printf(TRACE,Commit_unit,FUNCTION,"    * depth_min       : %d",depth_min);
    624               log_printf(TRACE,Commit_unit,FUNCTION,"    * depth_max       : %d",depth_max);
    625               log_printf(TRACE,Commit_unit,FUNCTION,"    * depth_full      : %d",depth_full);
    626               log_printf(TRACE,Commit_unit,FUNCTION,"    * flush           : %d",flush);
    627 
    628               //------------------------------------------------------
    629               // test if instruction is miss speculative
    630               //------------------------------------------------------
    631               if (not is_valid)
    632                 {
    633                   switch (state)
    634                     {
    635                     case ROB_BRANCH_WAIT_END             : {state = ROB_EVENT_WAIT_END; break;}
    636                     case ROB_BRANCH_COMPLETE             : {state = ROB_END_MISS      ; break;}
    637                     case ROB_END_BRANCH_MISS             :
    638                     case ROB_END_BRANCH_MISS_SPECULATIVE : {state = ROB_END_MISS      ; break;}
    639                     case ROB_END_LOAD_MISS_UPDATE        :
    640                     case ROB_END_LOAD_MISS               :
    641                     case ROB_END_LOAD_MISS_SPECULATIVE   : {state = ROB_END_MISS      ; break;}
    642                     case ROB_STORE_WAIT_HEAD_OK          : {state = ROB_STORE_HEAD_KO ; break;}
    643                   //case ROB_STORE_WAIT_HEAD_KO          : {state = ; break;}
    644                     case ROB_OTHER_WAIT_END              : {state = ROB_EVENT_WAIT_END; break;}
    645                     case ROB_END_OK                      :
    646                     case ROB_END_OK_SPECULATIVE          : {state = ROB_END_MISS      ; break;}
    647                     case ROB_END_KO                      :
    648                     case ROB_END_KO_SPECULATIVE          : {state = ROB_END_MISS      ; break;}
    649                     case ROB_END_EXCEPTION_UPDATE        :
    650                     case ROB_END_EXCEPTION               :
    651                     case ROB_END_EXCEPTION_WAIT_HEAD     : {state = ROB_END_MISS      ; break;}
    652                                                          
    653                       // don't change                   
    654                     case ROB_STORE_HEAD_KO               : {break;}
    655                     case ROB_EVENT_WAIT_END              : {break;}
    656                     case ROB_END_MISS                    : {break;}
    657                                                          
    658                       // can't have miss speculation     
    659                     case ROB_STORE_HEAD_OK               :
    660                     default                              :
    661                       {
    662                         throw ERRORMORPHEO(FUNCTION,toString(_("Miss Speculation : Invalide state : %s.\n"),toString(state).c_str()));
    663                         break;
    664                       }
    665                     }
    666                 }
    667              
    668               //------------------------------------------------------
    669               // test if instruction is not speculative
    670               //------------------------------------------------------
    671               entry->speculative = speculative;
    672 //            if (entry->depth == depth_min)
    673               if (not speculative)
    674                 {
    675                   switch (state)
    676                     {
    677                     case ROB_END_OK_SPECULATIVE          : {state = ROB_END_OK                 ; break;}
    678                     case ROB_END_KO_SPECULATIVE          : {state = ROB_END_KO                 ; break;}
    679                     case ROB_END_BRANCH_MISS_SPECULATIVE : {state = ROB_END_BRANCH_MISS        ; break;}
    680                     case ROB_END_LOAD_MISS_SPECULATIVE   : {state = ROB_END_LOAD_MISS_UPDATE   ; break;}
    681                     default : {break;} // else, no change
    682                   }
    683                 }
    684              
    685               //------------------------------------------------------
    686               // test if instruction is store and head
    687               //------------------------------------------------------
    688               if (i == reg_NUM_BANK_HEAD)
    689                 {
    690                   switch (state)
    691                     {
    692                     case ROB_STORE_WAIT_HEAD_OK      : {state = ROB_STORE_HEAD_OK;        break;}
    693                     case ROB_END_EXCEPTION_WAIT_HEAD : {state = ROB_END_EXCEPTION_UPDATE; break;}
    694                     default : {break;} // else, no change
    695                     }
    696                 }
    697              
    698               entry->state = state;
    699             }
    700       }
    701 
    702     // ===================================================================
    703     // =====[ OTHER ]=====================================================
    704     // ===================================================================
     869              // Test if have an instruction
     870              if (not _rob[num_bank].empty())
     871                {
     872                  // Scan all instruction in windows and test if instruction is speculative
     873                  entry_t    * entry        = _rob [num_bank].front();
     874                 
     875                  Tcontext_t   front_end_id = entry->front_end_id;
     876                  Tcontext_t   context_id   = entry->context_id  ;
     877                 
     878                  // scan while last event instruction is not retire
     879                  if (EVENT_LAST [front_end_id][context_id] == false)
     880                    {
     881                      // Read information
     882                      rob_state_t  state        = entry->state;
     883                      Tdepth_t     depth        = entry->depth;
     884                     
     885                      Tdepth_t     depth_min    = (_param->_have_port_depth)?PORT_READ(in_DEPTH_MIN[front_end_id][context_id]):0;
     886                      Tdepth_t     depth_max    = (_param->_have_port_depth)?PORT_READ(in_DEPTH_MAX[front_end_id][context_id]):0;
     887                      Tcontrol_t   depth_full   = PORT_READ(in_DEPTH_FULL [front_end_id][context_id]);
     888                     
     889                      // is a valid instruction ?
     890                      // If DEPTH_CURRENT :
     891                      // equal at     DEPTH_MIN            -> not speculative
     892                      // not include ]DEPTH_MIN:DEPTH_MAX] -> previous branch miss
     893                      //     include ]DEPTH_MIN:DEPTH_MAX] -> speculative
     894                     
     895                      // All case
     896                      // ....... min ...X... max ....... OK
     897                      // ....... min ....... max ...X... KO
     898                      // ...X... min ....... max ....... KO
     899                      // ....... max ....... min ...X... OK
     900                      // ...X... max ....... min ....... OK
     901                      // ....... max ...X... min ....... KO
     902                     
     903                      bool         flush         = ((reg_EVENT_STATE [front_end_id][context_id] == COMMIT_EVENT_STATE_EVENT) or
     904                                                    (reg_EVENT_STATE [front_end_id][context_id] == COMMIT_EVENT_STATE_WAIT_DECOD) or
     905                                                    (reg_EVENT_STATE [front_end_id][context_id] == COMMIT_EVENT_STATE_WAIT_END));
     906                      bool         speculative   = entry->speculative and not (depth == depth_min);
     907                      Tcontrol_t   is_valid      = ((not speculative or
     908                                                     (speculative and (depth_full or // all is valid
     909                                                                       ((depth_min <= depth_max)? // test if depth is overflow
     910                                                                        ((depth >= depth_min) and (depth <=depth_max)):
     911                                                                        ((depth >= depth_min) or  (depth <=depth_max))))))
     912                                                    and not flush); // no event
     913                     
     914                      //Tcontrol_t   is_valid      = ((depth == depth_min) and not flush);
     915                     
     916                      log_printf(TRACE,Commit_unit,FUNCTION,"  * HEAD              [%d] - %d",num_bank,((entry->ptr << _param->_shift_num_slot) | num_bank));
     917                     
     918                      log_printf(TRACE,Commit_unit,FUNCTION,"    * is_valid        : %d ((depth == depth_min) and not flush)",is_valid);
     919                      log_printf(TRACE,Commit_unit,FUNCTION,"    * depth           : %d",depth    );
     920                      log_printf(TRACE,Commit_unit,FUNCTION,"    * depth_min       : %d",depth_min);
     921                      log_printf(TRACE,Commit_unit,FUNCTION,"    * depth_max       : %d",depth_max);
     922                      log_printf(TRACE,Commit_unit,FUNCTION,"    * depth_full      : %d",depth_full);
     923                      log_printf(TRACE,Commit_unit,FUNCTION,"    * speculative     : %d",speculative);
     924                      log_printf(TRACE,Commit_unit,FUNCTION,"    * flush           : %d",flush);
     925                   
     926                      //------------------------------------------------------
     927                      // test if instruction is miss speculative
     928                      //------------------------------------------------------
     929                      if (not is_valid)
     930                        {
     931                          // Change state
     932                          switch (state)
     933                            {
     934                            case ROB_BRANCH_WAIT_END             : {state = ROB_EVENT_WAIT_END; break;}
     935                            case ROB_BRANCH_COMPLETE             : {state = ROB_END_MISS      ; break;}
     936                            case ROB_END_BRANCH_MISS             :
     937                            case ROB_END_BRANCH_MISS_SPECULATIVE : {state = ROB_END_MISS      ; break;}
     938                            case ROB_END_LOAD_MISS_UPDATE        :
     939                            case ROB_END_LOAD_MISS               :
     940                            case ROB_END_LOAD_MISS_SPECULATIVE   : {state = ROB_END_MISS      ; break;}
     941                            case ROB_STORE_OK                    : {state = ROB_STORE_KO      ; break;}
     942                            case ROB_STORE_WAIT_END_OK           : {state = ROB_STORE_WAIT_END_KO; break;}
     943                            case ROB_STORE_OK_WAIT_END           : {state = ROB_STORE_KO_WAIT_END; break;}
     944                            case ROB_OTHER_WAIT_END              : {state = ROB_EVENT_WAIT_END; break;}
     945                            case ROB_END_OK                      :
     946                            case ROB_END_OK_SPECULATIVE          : {state = ROB_END_MISS      ; break;}
     947                            case ROB_END_KO                      :
     948                            case ROB_END_KO_SPECULATIVE          : {state = ROB_END_MISS      ; break;}
     949                            case ROB_END_EXCEPTION_UPDATE        :
     950                            case ROB_END_EXCEPTION               :
     951                            case ROB_END_EXCEPTION_WAIT_HEAD     : {state = ROB_END_MISS      ; break;}
     952                             
     953                              // don't change state -> wait
     954                            case ROB_STORE_WAIT_END_KO           : {break;}
     955                            case ROB_STORE_KO                    : {break;}
     956                            case ROB_STORE_KO_WAIT_END           : {break;}
     957                            case ROB_STORE_EVENT                 : {break;}
     958                            case ROB_EVENT_WAIT_END              : {break;}
     959                            case ROB_END_MISS                    : {break;}
     960                            case ROB_END                         : {break;}
     961                             
     962                              // can't have miss speculation -> invalid state
     963                            default                              :
     964                              {
     965                                throw ERRORMORPHEO(FUNCTION,toString(_("Miss Speculation : Invalide state : %s.\n"),toString(state).c_str()));
     966                                break;
     967                              }
     968                            }
     969                        }
     970                     
     971                      //------------------------------------------------------
     972                      // test if instruction is not speculative
     973                      //------------------------------------------------------
     974                      entry->speculative = speculative;
     975//                    if (entry->depth == depth_min)
     976                      // test if instruction is speculative (depth != depth_min)
     977                      if (not speculative)
     978                        {
     979                          switch (state)
     980                            {
     981                            case ROB_END_OK_SPECULATIVE          : {state = ROB_END_OK                 ; break;}
     982                            case ROB_END_KO_SPECULATIVE          : {state = ROB_END_KO                 ; break;}
     983                            case ROB_END_BRANCH_MISS_SPECULATIVE : {state = ROB_END_BRANCH_MISS        ; break;}
     984                            case ROB_END_LOAD_MISS_SPECULATIVE   : {state = ROB_END_LOAD_MISS_UPDATE   ; break;}
     985                            default : {break;} // else, no change
     986                            }
     987                        }
     988                   
     989                      //------------------------------------------------------
     990                      // test if instruction wait head and is the top of rob
     991                      //------------------------------------------------------
     992                      // TODO : retire OOO
     993                      if (i == 0)
     994                        {
     995                          switch (state)
     996                            {
     997//                             case ROB_STORE_WAIT_HEAD_OK      : {state = ROB_STORE_HEAD_OK;        break;}
     998                            case ROB_END_EXCEPTION_WAIT_HEAD : {state = ROB_END_EXCEPTION_UPDATE; break;}
     999                            default : {break;} // else, no change
     1000                            }
     1001                        }
     1002                   
     1003                      // Write new state
     1004                      entry->state = state;
     1005                     
     1006                      // Test if this instruction is the last of event
     1007                      if ((reg_EVENT_STATE         [front_end_id][context_id] != COMMIT_EVENT_STATE_NO_EVENT) and
     1008                          (reg_EVENT_LAST_NUM_BANK [front_end_id][context_id] == num_bank            ) and
     1009                          (reg_EVENT_LAST_NUM_PTR  [front_end_id][context_id] == entry->ptr          ))
     1010                        {
     1011                          log_printf(TRACE,Commit_unit,FUNCTION,"  * Stop Scan !!!");
     1012                         
     1013                          EVENT_LAST [front_end_id][context_id] = true;
     1014                        }
     1015                    }
     1016                }
     1017            }
     1018        }
     1019
     1020
    7051021
    7061022#ifdef STATISTICS
     
    7091025        *(_stat_bank_nb_inst [i]) += _rob[i].size();
    7101026#endif
     1027      }
     1028
     1029    // ===================================================================
     1030    // =====[ OTHER ]=====================================================
     1031    // ===================================================================
    7111032
    7121033#if (DEBUG >= DEBUG_TRACE) and (DEBUG_Commit_unit == true)
     
    7151036      log_printf(TRACE,Commit_unit,FUNCTION,"    * num_bank_head : %d",reg_NUM_BANK_HEAD);
    7161037      log_printf(TRACE,Commit_unit,FUNCTION,"    * num_bank_tail : %d",reg_NUM_BANK_TAIL);
     1038      log_printf(TRACE,Commit_unit,FUNCTION,"    * num_ptr_tail  : %d",reg_NUM_PTR_TAIL );
    7171039     
    7181040      for (uint32_t i=0; i<_param->_nb_front_end; i++)
     
    7201042          {
    7211043            log_printf(TRACE,Commit_unit,FUNCTION,"    * [%d][%d] - %d",i,j,_param->_translate_num_context_to_num_thread [i][j]);
    722             log_printf(TRACE,Commit_unit,FUNCTION,"      * EVENT_STATE  : %s",toString(reg_EVENT_STATE [i][j]).c_str());
    723             log_printf(TRACE,Commit_unit,FUNCTION,"      * EVENT_FLUSH  : %d",reg_EVENT_FLUSH [i][j]);
    724             log_printf(TRACE,Commit_unit,FUNCTION,"      * EVENT_STOP   : %d",reg_EVENT_STOP  [i][j]);
    725             log_printf(TRACE,Commit_unit,FUNCTION,"      * NB_INST_ALL  : %d",reg_NB_INST_COMMIT_ALL[i][j]);
    726             log_printf(TRACE,Commit_unit,FUNCTION,"      * NB_INST_MEM  : %d",reg_NB_INST_COMMIT_MEM[i][j]);
    727             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]);
    728             log_printf(TRACE,Commit_unit,FUNCTION,"      * PC_NEXT      : %.8x (%.8x)",reg_PC_NEXT [i][j],reg_PC_NEXT [i][j]<<2);
     1044            log_printf(TRACE,Commit_unit,FUNCTION,"      * EVENT_STATE       : %s - %s",toString(reg_EVENT_STATE [i][j]).c_str(),toString(commit_event_state_to_event_state(reg_EVENT_STATE [i][j])).c_str());
     1045//          log_printf(TRACE,Commit_unit,FUNCTION,"      * EVENT_FLUSH       : %d",reg_EVENT_FLUSH [i][j]);
     1046            log_printf(TRACE,Commit_unit,FUNCTION,"      * EVENT_STOP        : %d",reg_EVENT_STOP  [i][j]);
     1047//             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]);
     1048            log_printf(TRACE,Commit_unit,FUNCTION,"      * EVENT_CAN_RESTART : %d",reg_EVENT_CAN_RESTART [i][j]);
     1049            log_printf(TRACE,Commit_unit,FUNCTION,"      * EVENT_PACKET      : %d",reg_EVENT_PACKET[i][j]);
     1050            log_printf(TRACE,Commit_unit,FUNCTION,"      * EVENT_LAST        : %d",reg_EVENT_LAST [i][j]);
     1051            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]);
     1052            log_printf(TRACE,Commit_unit,FUNCTION,"      * NB_INST_ALL       : %d",reg_NB_INST_COMMIT_ALL[i][j]);
     1053            log_printf(TRACE,Commit_unit,FUNCTION,"      * NB_INST_MEM       : %d",reg_NB_INST_COMMIT_MEM[i][j]);
     1054            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]);
     1055            log_printf(TRACE,Commit_unit,FUNCTION,"      * PC_NEXT           : %.8x (%.8x)",reg_PC_NEXT [i][j],reg_PC_NEXT [i][j]<<2);
    7291056          }
    7301057
     1058      std::list<entry_t*>::iterator iter [_param->_nb_bank];
    7311059      for (uint32_t i=0; i<_param->_nb_bank; i++)
    7321060        {
    7331061          uint32_t num_bank = (reg_NUM_BANK_HEAD+i)%_param->_nb_bank;
    734 
    735           log_printf(TRACE,Commit_unit,FUNCTION,"      * Bank [%d] size : %d, ptr : %d",num_bank,(int)_rob[num_bank].size(), reg_BANK_PTR [i]);
     1062//           log_printf(TRACE,Commit_unit,FUNCTION,"      * Bank [%d] size : %d, ptr : %d",num_bank,(int)_rob[num_bank].size(), reg_BANK_PTR [i]);
     1063
     1064          iter [num_bank] = _rob[num_bank].begin();
     1065        }
     1066
     1067      bool all_empty = false;
     1068      while (not all_empty)
     1069        {
     1070          all_empty = true;
    7361071         
    737           for (std::list<entry_t*>::iterator it=_rob[num_bank].begin();
    738                it!=_rob[num_bank].end();
    739                it++)
     1072          for (uint32_t i=0; i<_param->_nb_bank; i++)
    7401073            {
    741               log_printf(TRACE,Commit_unit,FUNCTION,"        [%.4d][%.4d] (%.4d) %.4d %.4d %.4d %.4d, %.3d %.3d, %.1d, %.1d %.4d, %.1d %.4d, %s",
    742                          num_bank                       ,
    743                          (*it)->ptr                     ,
    744                          (((*it)->ptr << _param->_shift_num_slot) | num_bank),
    745                          (*it)->front_end_id            ,
    746                          (*it)->context_id              ,
    747                          (*it)->rename_unit_id          ,
    748                          (*it)->depth                   ,
    749                          (*it)->type                    ,
    750                          (*it)->operation               ,
    751                          (*it)->is_delay_slot           ,
    752                          (*it)->use_store_queue         ,
    753                          (*it)->store_queue_ptr_write   ,
    754                          (*it)->use_load_queue          ,
    755                          (*it)->load_queue_ptr_write    ,
    756                          toString((*it)->state).c_str() );
    757               log_printf(TRACE,Commit_unit,FUNCTION,"                     %.1d %.2d %.6d, %.1d %.2d %.6d, %.1d %.1d %.6d, %.1d %.2d %.6d %.6d, %.1d %.1d %.6d %.6d ",
    758                          (*it)->read_ra                 ,
    759                          (*it)->num_reg_ra_log          ,
    760                          (*it)->num_reg_ra_phy          ,
    761                          (*it)->read_rb                 ,
    762                          (*it)->num_reg_rb_log          ,
    763                          (*it)->num_reg_rb_phy          ,
    764                          (*it)->read_rc                 ,
    765                          (*it)->num_reg_rc_log          ,
    766                          (*it)->num_reg_rc_phy          ,
    767                          (*it)->write_rd                ,
    768                          (*it)->num_reg_rd_log          ,
    769                          (*it)->num_reg_rd_phy_old      ,
    770                          (*it)->num_reg_rd_phy_new      ,
    771                          (*it)->write_re                ,
    772                          (*it)->num_reg_re_log          ,
    773                          (*it)->num_reg_re_phy_old      ,
    774                          (*it)->num_reg_re_phy_new      );
    775              
    776               log_printf(TRACE,Commit_unit,FUNCTION,"                     %.2d %.2d %.1d %.1d %.1d - %.8x (%.8x) %.8x (%.8x)",
    777                          (*it)->exception_use ,
    778                          (*it)->exception     ,
    779                          (*it)->flags         ,
    780                          (*it)->no_sequence   ,
    781                          (*it)->speculative   ,
    782                          (*it)->address       ,
    783                          (*it)->address<<2    ,
    784                          (*it)->address_next  ,
    785                          (*it)->address_next<<2
    786                          );
     1074              uint32_t num_bank = (reg_NUM_BANK_HEAD+i)%_param->_nb_bank;
     1075     
     1076              std::list<entry_t*>::iterator it = iter[num_bank];       
     1077              if (it != _rob[num_bank].end())
     1078                {
     1079                  all_empty = false;
     1080
     1081                  log_printf(TRACE,Commit_unit,FUNCTION,"        [%.4d][%.4d] (%.4d) %.4d %.4d %.4d %.4d, %.3d %.3d, %.1d, %.1d %.4d, %.1d %.4d, %s",
     1082                             num_bank                       ,
     1083                             (*it)->ptr                     ,
     1084                             (((*it)->ptr << _param->_shift_num_slot) | num_bank),
     1085                             (*it)->front_end_id            ,
     1086                             (*it)->context_id              ,
     1087                             (*it)->rename_unit_id          ,
     1088                             (*it)->depth                   ,
     1089                             (*it)->type                    ,
     1090                             (*it)->operation               ,
     1091                             (*it)->is_delay_slot           ,
     1092                             (*it)->use_store_queue         ,
     1093                             (*it)->store_queue_ptr_write   ,
     1094                             (*it)->use_load_queue          ,
     1095                             (*it)->load_queue_ptr_write    ,
     1096                             toString((*it)->state).c_str() );
     1097                  log_printf(TRACE,Commit_unit,FUNCTION,"                     %.1d %.2d %.6d, %.1d %.2d %.6d, %.1d %.1d %.6d, %.1d %.2d %.6d %.6d, %.1d %.1d %.6d %.6d ",
     1098                             (*it)->read_ra                 ,
     1099                             (*it)->num_reg_ra_log          ,
     1100                             (*it)->num_reg_ra_phy          ,
     1101                             (*it)->read_rb                 ,
     1102                             (*it)->num_reg_rb_log          ,
     1103                             (*it)->num_reg_rb_phy          ,
     1104                             (*it)->read_rc                 ,
     1105                             (*it)->num_reg_rc_log          ,
     1106                             (*it)->num_reg_rc_phy          ,
     1107                             (*it)->write_rd                ,
     1108                             (*it)->num_reg_rd_log          ,
     1109                             (*it)->num_reg_rd_phy_old      ,
     1110                             (*it)->num_reg_rd_phy_new      ,
     1111                             (*it)->write_re                ,
     1112                             (*it)->num_reg_re_log          ,
     1113                             (*it)->num_reg_re_phy_old      ,
     1114                             (*it)->num_reg_re_phy_new      );
     1115                 
     1116                  log_printf(TRACE,Commit_unit,FUNCTION,"                     %.2d %.2d %.1d %.1d %.1d - %.8x (%.8x) %.8x (%.8x)",
     1117                             (*it)->exception_use ,
     1118                             (*it)->exception     ,
     1119                             (*it)->flags         ,
     1120                             (*it)->no_sequence   ,
     1121                             (*it)->speculative   ,
     1122                             (*it)->address       ,
     1123                             (*it)->address<<2    ,
     1124                             (*it)->address_next  ,
     1125                             (*it)->address_next<<2
     1126                             );
     1127                 
     1128                  iter [num_bank] ++;
     1129                }
    7871130            }
    7881131        }
     
    8221165              )
    8231166          if (entry->address != reg_PC_CURRENT[entry->front_end_id][entry->context_id])
    824             throw ERRORMORPHEO(FUNCTION,toString(_("Rob top address (%x) is different of reg_PC_CURRENT[%d][%d] (%x).\n"),
     1167            throw ERRORMORPHEO(FUNCTION,toString(_("Rob top address (0x%x) is different of reg_PC_CURRENT[%d][%d] (0x%x).\n"),
    8251168                                                 entry->address,
    8261169                                                 entry->front_end_id,
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Parameters_msg_error.cpp

    r110 r122  
    4040      test.error(_("nb_bank must be a multiple of size_queue.\n"));
    4141
    42     if (_nb_inst_reexecute != 1)
    43       test.error(_("nb_inst_reexecute must be set at 1. Anothers value is unsupported.\n"));
     42//     if (_nb_inst_reexecute != 1)
     43//       test.error(_("nb_inst_reexecute must be set at 1. Anothers value is unsupported.\n"));
    4444
    4545    for (uint32_t i=0; i<_nb_front_end; ++i)
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Issue_queue/include/Issue_queue.h

    r111 r122  
    7777  public    : SC_IN (Ttype_t           )  ***  in_ISSUE_IN_TYPE                  ;//[nb_rename_unit][nb_inst_rename]
    7878  public    : SC_IN (Tlsq_ptr_t        )  ***  in_ISSUE_IN_STORE_QUEUE_PTR_WRITE ;//[nb_rename_unit][nb_inst_rename]
     79  public    : SC_IN (Tlsq_ptr_t        )  ***  in_ISSUE_IN_STORE_QUEUE_PTR_READ  ;//[nb_rename_unit][nb_inst_rename]
     80  public    : SC_IN (Tcontrol_t        )  ***  in_ISSUE_IN_STORE_QUEUE_EMPTY     ;//[nb_rename_unit][nb_inst_rename]
    7981  public    : SC_IN (Tlsq_ptr_t        )  ***  in_ISSUE_IN_LOAD_QUEUE_PTR_WRITE  ;//[nb_rename_unit][nb_inst_rename]
    8082  public    : SC_IN (Tcontrol_t        )  ***  in_ISSUE_IN_HAS_IMMEDIAT          ;//[nb_rename_unit][nb_inst_rename]
     
    100102  public    : SC_IN (Ttype_t           )   **  in_REEXECUTE_TYPE                 ;//[nb_inst_reexecute]
    101103  public    : SC_IN (Tlsq_ptr_t        )   **  in_REEXECUTE_STORE_QUEUE_PTR_WRITE;//[nb_inst_reexecute]
     104  public    : SC_IN (Tlsq_ptr_t        )   **  in_REEXECUTE_STORE_QUEUE_PTR_READ ;//[nb_inst_reexecute]
     105  public    : SC_IN (Tcontrol_t        )   **  in_REEXECUTE_STORE_QUEUE_EMPTY    ;//[nb_inst_reexecute]
    102106  public    : SC_IN (Tlsq_ptr_t        )   **  in_REEXECUTE_LOAD_QUEUE_PTR_WRITE ;//[nb_inst_reexecute]
    103107  public    : SC_IN (Tcontrol_t        )   **  in_REEXECUTE_HAS_IMMEDIAT         ;//[nb_inst_reexecute]
     
    123127  public    : SC_OUT(Ttype_t           )   ** out_ISSUE_OUT_TYPE                 ;//[nb_inst_issue]
    124128  public    : SC_OUT(Tlsq_ptr_t        )   ** out_ISSUE_OUT_STORE_QUEUE_PTR_WRITE;//[nb_inst_issue]
     129  public    : SC_OUT(Tlsq_ptr_t        )   ** out_ISSUE_OUT_STORE_QUEUE_PTR_READ ;//[nb_inst_issue]
     130  public    : SC_OUT(Tcontrol_t        )   ** out_ISSUE_OUT_STORE_QUEUE_EMPTY    ;//[nb_inst_issue]
    125131  public    : SC_OUT(Tlsq_ptr_t        )   ** out_ISSUE_OUT_LOAD_QUEUE_PTR_WRITE ;//[nb_inst_issue]
    126132  public    : SC_OUT(Tcontrol_t        )   ** out_ISSUE_OUT_HAS_IMMEDIAT         ;//[nb_inst_issue]
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Issue_queue/include/Types.h

    r111 r122  
    3333  public : Ttype_t            _type                  ;
    3434  public : Tlsq_ptr_t         _store_queue_ptr_write ;
     35  public : Tlsq_ptr_t         _store_queue_ptr_read  ;
     36  public : Tcontrol_t         _store_queue_empty     ;
    3537  public : Tlsq_ptr_t         _load_queue_ptr_write  ;
    3638  public : Tcontrol_t         _has_immediat          ;
     
    5355                    Ttype_t            type                  ,
    5456                    Tlsq_ptr_t         store_queue_ptr_write ,
     57                    Tlsq_ptr_t         store_queue_ptr_read  ,
     58                    Tcontrol_t         store_queue_empty     ,
    5559                    Tlsq_ptr_t         load_queue_ptr_write  ,
    5660                    Tcontrol_t         has_immediat          ,
     
    7377      _type                  = type                 ;
    7478      _store_queue_ptr_write = store_queue_ptr_write;
     79      _store_queue_ptr_read  = store_queue_ptr_read ;
     80      _store_queue_empty     = store_queue_empty    ;
    7581      _load_queue_ptr_write  = load_queue_ptr_write ;
    7682      _has_immediat          = has_immediat         ;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Issue_queue/src/Issue_queue_allocation.cpp

    r112 r122  
    6969      _ALLOC2_SIGNAL_IN ( in_ISSUE_IN_TYPE                 ,"type"                 ,Ttype_t           ,_param->_size_type            ,_param->_nb_rename_unit, _param->_nb_inst_rename[it1]);
    7070      _ALLOC2_SIGNAL_IN ( in_ISSUE_IN_STORE_QUEUE_PTR_WRITE,"store_queue_ptr_write",Tlsq_ptr_t        ,_param->_size_store_queue_ptr ,_param->_nb_rename_unit, _param->_nb_inst_rename[it1]);
     71      _ALLOC2_SIGNAL_IN ( in_ISSUE_IN_STORE_QUEUE_PTR_READ ,"store_queue_ptr_read" ,Tlsq_ptr_t        ,_param->_size_store_queue_ptr ,_param->_nb_rename_unit, _param->_nb_inst_rename[it1]);
     72      _ALLOC2_SIGNAL_IN ( in_ISSUE_IN_STORE_QUEUE_EMPTY    ,"store_queue_empty"    ,Tcontrol_t        ,1                             ,_param->_nb_rename_unit, _param->_nb_inst_rename[it1]);
    7173      _ALLOC2_SIGNAL_IN ( in_ISSUE_IN_LOAD_QUEUE_PTR_WRITE ,"load_queue_ptr_write" ,Tlsq_ptr_t        ,_param->_size_load_queue_ptr  ,_param->_nb_rename_unit, _param->_nb_inst_rename[it1]);
    7274      _ALLOC2_SIGNAL_IN ( in_ISSUE_IN_HAS_IMMEDIAT         ,"has_immediat"         ,Tcontrol_t        ,1                             ,_param->_nb_rename_unit, _param->_nb_inst_rename[it1]);
     
    98100      ALLOC1_SIGNAL_IN ( in_REEXECUTE_TYPE                 ,"type"                 ,Ttype_t           ,_param->_size_type            );
    99101      ALLOC1_SIGNAL_IN ( in_REEXECUTE_STORE_QUEUE_PTR_WRITE,"store_queue_ptr_write",Tlsq_ptr_t        ,_param->_size_store_queue_ptr );
     102      ALLOC1_SIGNAL_IN ( in_REEXECUTE_STORE_QUEUE_PTR_READ ,"store_queue_ptr_read" ,Tlsq_ptr_t        ,_param->_size_store_queue_ptr );
     103      ALLOC1_SIGNAL_IN ( in_REEXECUTE_STORE_QUEUE_EMPTY    ,"store_queue_empty"    ,Tcontrol_t        ,1);
    100104      ALLOC1_SIGNAL_IN ( in_REEXECUTE_LOAD_QUEUE_PTR_WRITE ,"load_queue_ptr_write" ,Tlsq_ptr_t        ,_param->_size_load_queue_ptr  );
    101105      ALLOC1_SIGNAL_IN ( in_REEXECUTE_HAS_IMMEDIAT         ,"has_immediat"         ,Tcontrol_t        ,1                             );
     
    127131      ALLOC1_SIGNAL_OUT(out_ISSUE_OUT_TYPE                 ,"type"                 ,Ttype_t           ,_param->_size_type            );
    128132      ALLOC1_SIGNAL_OUT(out_ISSUE_OUT_STORE_QUEUE_PTR_WRITE,"store_queue_ptr_write",Tlsq_ptr_t        ,_param->_size_store_queue_ptr );
     133      ALLOC1_SIGNAL_OUT(out_ISSUE_OUT_STORE_QUEUE_PTR_READ ,"store_queue_ptr_read" ,Tlsq_ptr_t        ,_param->_size_store_queue_ptr );
     134      ALLOC1_SIGNAL_OUT(out_ISSUE_OUT_STORE_QUEUE_EMPTY    ,"store_queue_empty"    ,Tcontrol_t        ,1);
    129135      ALLOC1_SIGNAL_OUT(out_ISSUE_OUT_LOAD_QUEUE_PTR_WRITE ,"load_queue_ptr_write" ,Tlsq_ptr_t        ,_param->_size_load_queue_ptr  );
    130136      ALLOC1_SIGNAL_OUT(out_ISSUE_OUT_HAS_IMMEDIAT         ,"has_immediat"         ,Tcontrol_t        ,1                             );
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Issue_queue/src/Issue_queue_deallocation.cpp

    r112 r122  
    3636        DELETE2_SIGNAL( in_ISSUE_IN_TYPE                 ,_param->_nb_rename_unit, _param->_nb_inst_rename[it1],_param->_size_type            );
    3737        DELETE2_SIGNAL( in_ISSUE_IN_STORE_QUEUE_PTR_WRITE,_param->_nb_rename_unit, _param->_nb_inst_rename[it1],_param->_size_store_queue_ptr );
     38        DELETE2_SIGNAL( in_ISSUE_IN_STORE_QUEUE_PTR_READ ,_param->_nb_rename_unit, _param->_nb_inst_rename[it1],_param->_size_store_queue_ptr );
     39        DELETE2_SIGNAL( in_ISSUE_IN_STORE_QUEUE_EMPTY    ,_param->_nb_rename_unit, _param->_nb_inst_rename[it1],1);
    3840        DELETE2_SIGNAL( in_ISSUE_IN_LOAD_QUEUE_PTR_WRITE ,_param->_nb_rename_unit, _param->_nb_inst_rename[it1],_param->_size_load_queue_ptr  );
    3941        DELETE2_SIGNAL( in_ISSUE_IN_HAS_IMMEDIAT         ,_param->_nb_rename_unit, _param->_nb_inst_rename[it1],1                             );
     
    5860        DELETE1_SIGNAL( in_REEXECUTE_TYPE                 ,_param->_nb_inst_reexecute,_param->_size_type            );
    5961        DELETE1_SIGNAL( in_REEXECUTE_STORE_QUEUE_PTR_WRITE,_param->_nb_inst_reexecute,_param->_size_store_queue_ptr );
     62        DELETE1_SIGNAL( in_REEXECUTE_STORE_QUEUE_PTR_READ ,_param->_nb_inst_reexecute,_param->_size_store_queue_ptr );
     63        DELETE1_SIGNAL( in_REEXECUTE_STORE_QUEUE_EMPTY    ,_param->_nb_inst_reexecute,1);
    6064        DELETE1_SIGNAL( in_REEXECUTE_LOAD_QUEUE_PTR_WRITE ,_param->_nb_inst_reexecute,_param->_size_load_queue_ptr  );
    6165        DELETE1_SIGNAL( in_REEXECUTE_HAS_IMMEDIAT         ,_param->_nb_inst_reexecute,1                             );
     
    8084        DELETE1_SIGNAL(out_ISSUE_OUT_TYPE                 ,_param->_nb_inst_issue,_param->_size_type            );
    8185        DELETE1_SIGNAL(out_ISSUE_OUT_STORE_QUEUE_PTR_WRITE,_param->_nb_inst_issue,_param->_size_store_queue_ptr );
     86        DELETE1_SIGNAL(out_ISSUE_OUT_STORE_QUEUE_PTR_READ ,_param->_nb_inst_issue,_param->_size_store_queue_ptr );
     87        DELETE1_SIGNAL(out_ISSUE_OUT_STORE_QUEUE_EMPTY    ,_param->_nb_inst_issue,1);
    8288        DELETE1_SIGNAL(out_ISSUE_OUT_LOAD_QUEUE_PTR_WRITE ,_param->_nb_inst_issue,_param->_size_load_queue_ptr  );
    8389        DELETE1_SIGNAL(out_ISSUE_OUT_HAS_IMMEDIAT         ,_param->_nb_inst_issue,1                             );
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Issue_queue/src/Issue_queue_function_in_order_genMealy_issue_out.cpp

    r117 r122  
    5757          PORT_WRITE(out_ISSUE_OUT_TYPE                  [index], entry->_type                 );
    5858          PORT_WRITE(out_ISSUE_OUT_STORE_QUEUE_PTR_WRITE [index], entry->_store_queue_ptr_write);
     59          PORT_WRITE(out_ISSUE_OUT_STORE_QUEUE_PTR_READ  [index], entry->_store_queue_ptr_read );
     60          PORT_WRITE(out_ISSUE_OUT_STORE_QUEUE_EMPTY     [index], entry->_store_queue_empty    );
    5961          if (_param->_have_port_load_queue_ptr)
    6062          PORT_WRITE(out_ISSUE_OUT_LOAD_QUEUE_PTR_WRITE  [index], entry->_load_queue_ptr_write );
     
    130132              PORT_WRITE(out_ISSUE_OUT_TYPE                  [index], entry->_type                 );
    131133              PORT_WRITE(out_ISSUE_OUT_STORE_QUEUE_PTR_WRITE [index], entry->_store_queue_ptr_write);
     134              PORT_WRITE(out_ISSUE_OUT_STORE_QUEUE_PTR_READ  [index], entry->_store_queue_ptr_read );
     135              PORT_WRITE(out_ISSUE_OUT_STORE_QUEUE_EMPTY     [index], entry->_store_queue_empty    );
    132136              if (_param->_have_port_load_queue_ptr)
    133137              PORT_WRITE(out_ISSUE_OUT_LOAD_QUEUE_PTR_WRITE  [index], entry->_load_queue_ptr_write );
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Issue_queue/src/Issue_queue_function_in_order_transition.cpp

    r111 r122  
    6666                                                         PORT_READ(in_ISSUE_IN_TYPE                  [i][j]),
    6767                                                         PORT_READ(in_ISSUE_IN_STORE_QUEUE_PTR_WRITE [i][j]),
     68                                                         PORT_READ(in_ISSUE_IN_STORE_QUEUE_PTR_READ  [i][j]),
     69                                                         PORT_READ(in_ISSUE_IN_STORE_QUEUE_EMPTY     [i][j]),
    6870                     (_param->_have_port_load_queue_ptr)?PORT_READ(in_ISSUE_IN_LOAD_QUEUE_PTR_WRITE  [i][j]):0,
    6971                                                         PORT_READ(in_ISSUE_IN_HAS_IMMEDIAT          [i][j]),
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Issue_queue/src/Issue_queue_function_out_of_order_genMoore.cpp

    r117 r122  
    125125                PORT_WRITE(out_ISSUE_OUT_TYPE                  [i], entry->_type                 );
    126126                PORT_WRITE(out_ISSUE_OUT_STORE_QUEUE_PTR_WRITE [i], entry->_store_queue_ptr_write);
     127                PORT_WRITE(out_ISSUE_OUT_STORE_QUEUE_PTR_READ  [i], entry->_store_queue_ptr_read );
     128                PORT_WRITE(out_ISSUE_OUT_STORE_QUEUE_EMPTY     [i], entry->_store_queue_empty    );
    127129                if (_param->_have_port_load_queue_ptr)
    128130                PORT_WRITE(out_ISSUE_OUT_LOAD_QUEUE_PTR_WRITE  [i], entry->_load_queue_ptr_write );
     
    186188                    PORT_WRITE(out_ISSUE_OUT_TYPE                  [i], entry->_type                 );
    187189                    PORT_WRITE(out_ISSUE_OUT_STORE_QUEUE_PTR_WRITE [i], entry->_store_queue_ptr_write);
     190                    PORT_WRITE(out_ISSUE_OUT_STORE_QUEUE_PTR_READ  [i], entry->_store_queue_ptr_read );
     191                    PORT_WRITE(out_ISSUE_OUT_STORE_QUEUE_EMPTY     [i], entry->_store_queue_empty    );
    188192                    if (_param->_have_port_load_queue_ptr)
    189193                    PORT_WRITE(out_ISSUE_OUT_LOAD_QUEUE_PTR_WRITE  [i], entry->_load_queue_ptr_write );
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Issue_queue/src/Issue_queue_function_out_of_order_transition.cpp

    r111 r122  
    6565                                                         PORT_READ(in_ISSUE_IN_TYPE                  [x][y]),
    6666                                                         PORT_READ(in_ISSUE_IN_STORE_QUEUE_PTR_WRITE [x][y]),
     67                                                         PORT_READ(in_ISSUE_IN_STORE_QUEUE_PTR_READ  [x][y]),
     68                                                         PORT_READ(in_ISSUE_IN_STORE_QUEUE_EMPTY     [x][y]),
    6769                     (_param->_have_port_load_queue_ptr)?PORT_READ(in_ISSUE_IN_LOAD_QUEUE_PTR_WRITE  [x][y]):0,
    6870                                                         PORT_READ(in_ISSUE_IN_HAS_IMMEDIAT          [x][y]),
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Issue_queue/src/Issue_queue_transition.cpp

    r117 r122  
    5353                                                     PORT_READ(in_REEXECUTE_TYPE                  [i]),
    5454                                                     PORT_READ(in_REEXECUTE_STORE_QUEUE_PTR_WRITE [i]),
     55                                                     PORT_READ(in_REEXECUTE_STORE_QUEUE_PTR_READ  [i]),
     56                                                     PORT_READ(in_REEXECUTE_STORE_QUEUE_EMPTY     [i]),
    5557                 (_param->_have_port_load_queue_ptr)?PORT_READ(in_REEXECUTE_LOAD_QUEUE_PTR_WRITE  [i]):0,
    5658                                                     PORT_READ(in_REEXECUTE_HAS_IMMEDIAT          [i]),
     
    119121        for (std::list<entry_t*>::iterator it=_issue_queue[i].begin();it!=_issue_queue[i].end(); ++it)
    120122          {
    121             log_printf(TRACE,Issue_queue,FUNCTION,"      [%.4d] %.2d %.2d %.4d, %.2d %.3d, %.2d %.2d, %.1d %.8x, %.1d %.4d, %.1d %.4d, %.1d %.4d, %.1d %.4d, %.1d %.4d",
     123            log_printf(TRACE,Issue_queue,FUNCTION,"      [%.4d] %.2d %.2d %.4d, %.2d %.3d, %.2d %.2d %.1d %.2d, %.1d %.8x, %.1d %.4d, %.1d %.4d, %.1d %.4d, %.1d %.4d, %.1d %.4d",
    122124                       j,
    123125                       
     
    130132                       
    131133                       (*it)->_store_queue_ptr_write,
     134                       (*it)->_store_queue_ptr_read ,
     135                       (*it)->_store_queue_empty    ,
    132136                       (*it)->_load_queue_ptr_write ,
    133137                       
     
    161165      for (std::list<entry_t*>::iterator it=_reexecute_queue.begin();it!=_reexecute_queue.end(); ++it)
    162166        {
    163           log_printf(TRACE,Issue_queue,FUNCTION,"      [%.4d] %.2d %.2d %.4d, %.2d %.3d, %.2d %.2d, %.1d %.8x, %.1d %.4d, %.1d %.4d, %.1d %.4d, %.1d %.4d, %.1d %.4d",
     167          log_printf(TRACE,Issue_queue,FUNCTION,"      [%.4d] %.2d %.2d %.4d, %.2d %.3d, %.2d %.2d %.1d %.2d, %.1d %.8x, %.1d %.4d, %.1d %.4d, %.1d %.4d, %.1d %.4d, %.1d %.4d",
    164168                     i,
    165169                     
     
    172176                     
    173177                     (*it)->_store_queue_ptr_write,
     178                     (*it)->_store_queue_ptr_read ,
     179                     (*it)->_store_queue_empty    ,
    174180                     (*it)->_load_queue_ptr_write ,
    175181                     
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/OOO_Engine_Glue/include/OOO_Engine_Glue.h

    r121 r122  
    9090  public    : SC_IN (Tgeneral_data_t    ) ***  in_INSERT_RENAME_UNIT_IMMEDIAT                  ;//[nb_rename_unit][nb_inst_insert]
    9191  public    : SC_IN (Tlsq_ptr_t         ) ***  in_INSERT_RENAME_UNIT_STORE_QUEUE_PTR_WRITE     ;//[nb_rename_unit][nb_inst_insert]
     92  public    : SC_IN (Tlsq_ptr_t         ) ***  in_INSERT_RENAME_UNIT_STORE_QUEUE_PTR_READ      ;//[nb_rename_unit][nb_inst_insert]
     93  public    : SC_IN (Tcontrol_t         ) ***  in_INSERT_RENAME_UNIT_STORE_QUEUE_EMPTY         ;//[nb_rename_unit][nb_inst_insert]
    9294  public    : SC_IN (Tlsq_ptr_t         ) ***  in_INSERT_RENAME_UNIT_LOAD_QUEUE_PTR_WRITE      ;//[nb_rename_unit][nb_inst_insert]
    9395  public    : SC_IN (Tcontrol_t         ) ***  in_INSERT_RENAME_UNIT_READ_RA                   ;//[nb_rename_unit][nb_inst_insert]
     
    136138  public    : SC_OUT(Ttype_t            ) *** out_INSERT_ISSUE_QUEUE_TYPE                      ;//[nb_rename_unit][nb_inst_insert]
    137139  public    : SC_OUT(Tlsq_ptr_t         ) *** out_INSERT_ISSUE_QUEUE_STORE_QUEUE_PTR_WRITE     ;//[nb_rename_unit][nb_inst_insert]
     140  public    : SC_OUT(Tlsq_ptr_t         ) *** out_INSERT_ISSUE_QUEUE_STORE_QUEUE_PTR_READ      ;//[nb_rename_unit][nb_inst_insert]
     141  public    : SC_OUT(Tcontrol_t         ) *** out_INSERT_ISSUE_QUEUE_STORE_QUEUE_EMPTY         ;//[nb_rename_unit][nb_inst_insert]
    138142  public    : SC_OUT(Tlsq_ptr_t         ) *** out_INSERT_ISSUE_QUEUE_LOAD_QUEUE_PTR_WRITE      ;//[nb_rename_unit][nb_inst_insert]
    139143  public    : SC_OUT(Tcontrol_t         ) *** out_INSERT_ISSUE_QUEUE_HAS_IMMEDIAT              ;//[nb_rename_unit][nb_inst_insert]
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/OOO_Engine_Glue/src/OOO_Engine_Glue.cpp

    r88 r122  
    152152                        << (*(in_INSERT_RENAME_UNIT_IMMEDIAT              [i][j]))
    153153                        << (*(in_INSERT_RENAME_UNIT_STORE_QUEUE_PTR_WRITE [i][j]))
     154                        << (*(in_INSERT_RENAME_UNIT_STORE_QUEUE_PTR_READ  [i][j]))
     155                        << (*(in_INSERT_RENAME_UNIT_STORE_QUEUE_EMPTY     [i][j]))
    154156                        << (*(in_INSERT_RENAME_UNIT_READ_RA               [i][j]))
    155157                        << (*(in_INSERT_RENAME_UNIT_NUM_REG_RA_PHY        [i][j]))
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/OOO_Engine_Glue/src/OOO_Engine_Glue_allocation.cpp

    r121 r122  
    9393      _ALLOC2_SIGNAL_IN ( in_INSERT_RENAME_UNIT_IMMEDIAT                  ,"RENAME_UNIT_IMMEDIAT"                  ,Tgeneral_data_t    ,_param->_size_general_data    ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
    9494      _ALLOC2_SIGNAL_IN ( in_INSERT_RENAME_UNIT_STORE_QUEUE_PTR_WRITE     ,"RENAME_UNIT_STORE_QUEUE_PTR_WRITE"     ,Tlsq_ptr_t         ,_param->_size_store_queue_ptr ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
     95      _ALLOC2_SIGNAL_IN ( in_INSERT_RENAME_UNIT_STORE_QUEUE_PTR_READ      ,"RENAME_UNIT_STORE_QUEUE_PTR_READ"      ,Tlsq_ptr_t         ,_param->_size_store_queue_ptr ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
     96      _ALLOC2_SIGNAL_IN ( in_INSERT_RENAME_UNIT_STORE_QUEUE_EMPTY         ,"RENAME_UNIT_STORE_QUEUE_EMPTY"         ,Tcontrol_t         ,1                             ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
    9597      _ALLOC2_SIGNAL_IN ( in_INSERT_RENAME_UNIT_LOAD_QUEUE_PTR_WRITE      ,"RENAME_UNIT_LOAD_QUEUE_PTR_WRITE"      ,Tlsq_ptr_t         ,_param->_size_load_queue_ptr  ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
    9698      _ALLOC2_SIGNAL_IN ( in_INSERT_RENAME_UNIT_READ_RA                   ,"RENAME_UNIT_READ_RA"                   ,Tcontrol_t         ,1                             ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
     
    139141      _ALLOC2_SIGNAL_OUT(out_INSERT_ISSUE_QUEUE_TYPE                      ,"ISSUE_QUEUE_TYPE"                      ,Ttype_t            ,_param->_size_type            ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
    140142      _ALLOC2_SIGNAL_OUT(out_INSERT_ISSUE_QUEUE_STORE_QUEUE_PTR_WRITE     ,"ISSUE_QUEUE_STORE_QUEUE_PTR_WRITE"     ,Tlsq_ptr_t         ,_param->_size_store_queue_ptr ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
     143      _ALLOC2_SIGNAL_OUT(out_INSERT_ISSUE_QUEUE_STORE_QUEUE_PTR_READ      ,"ISSUE_QUEUE_STORE_QUEUE_PTR_READ"      ,Tlsq_ptr_t         ,_param->_size_store_queue_ptr ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
     144      _ALLOC2_SIGNAL_OUT(out_INSERT_ISSUE_QUEUE_STORE_QUEUE_EMPTY         ,"ISSUE_QUEUE_STORE_QUEUE_EMPTY"         ,Tcontrol_t         ,1                             ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
    141145      _ALLOC2_SIGNAL_OUT(out_INSERT_ISSUE_QUEUE_LOAD_QUEUE_PTR_WRITE      ,"ISSUE_QUEUE_LOAD_QUEUE_PTR_WRITE"      ,Tlsq_ptr_t         ,_param->_size_load_queue_ptr  ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
    142146      _ALLOC2_SIGNAL_OUT(out_INSERT_ISSUE_QUEUE_HAS_IMMEDIAT              ,"ISSUE_QUEUE_HAS_IMMEDIAT"              ,Tcontrol_t         ,1                             ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/OOO_Engine_Glue/src/OOO_Engine_Glue_deallocation.cpp

    r121 r122  
    4848        DELETE2_SIGNAL( in_INSERT_RENAME_UNIT_IMMEDIAT                  ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_general_data    );
    4949        DELETE2_SIGNAL( in_INSERT_RENAME_UNIT_STORE_QUEUE_PTR_WRITE     ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_store_queue_ptr );
     50        DELETE2_SIGNAL( in_INSERT_RENAME_UNIT_STORE_QUEUE_PTR_READ      ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_store_queue_ptr );
     51        DELETE2_SIGNAL( in_INSERT_RENAME_UNIT_STORE_QUEUE_EMPTY         ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],1                             );
    5052        DELETE2_SIGNAL( in_INSERT_RENAME_UNIT_LOAD_QUEUE_PTR_WRITE      ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_load_queue_ptr  );
    5153        DELETE2_SIGNAL( in_INSERT_RENAME_UNIT_READ_RA                   ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],1                             );
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/OOO_Engine_Glue/src/OOO_Engine_Glue_genMealy_insert.cpp

    r121 r122  
    3636          Tgeneral_data_t    IMMEDIAT              = PORT_READ(in_INSERT_RENAME_UNIT_IMMEDIAT              [i][j]);
    3737          Tlsq_ptr_t         STORE_QUEUE_PTR_WRITE = PORT_READ(in_INSERT_RENAME_UNIT_STORE_QUEUE_PTR_WRITE [i][j]);
     38          Tlsq_ptr_t         STORE_QUEUE_PTR_READ  = PORT_READ(in_INSERT_RENAME_UNIT_STORE_QUEUE_PTR_READ  [i][j]);
     39          Tcontrol_t         STORE_QUEUE_EMPTY     = PORT_READ(in_INSERT_RENAME_UNIT_STORE_QUEUE_EMPTY     [i][j]);
    3840          Tlsq_ptr_t         LOAD_QUEUE_PTR_WRITE  = (_param->_have_port_load_queue_ptr)?PORT_READ(in_INSERT_RENAME_UNIT_LOAD_QUEUE_PTR_WRITE [i][j]):0;
    3941          Tcontrol_t         READ_RA               = PORT_READ(in_INSERT_RENAME_UNIT_READ_RA               [i][j]);
     
    9193          PORT_WRITE(out_INSERT_ISSUE_QUEUE_OPERATION             [i][j],OPERATION            );
    9294          PORT_WRITE(out_INSERT_ISSUE_QUEUE_STORE_QUEUE_PTR_WRITE [i][j],STORE_QUEUE_PTR_WRITE);
     95          PORT_WRITE(out_INSERT_ISSUE_QUEUE_STORE_QUEUE_PTR_READ  [i][j],STORE_QUEUE_PTR_READ );
     96          PORT_WRITE(out_INSERT_ISSUE_QUEUE_STORE_QUEUE_EMPTY     [i][j],STORE_QUEUE_EMPTY    );
    9397          if (_param->_have_port_load_queue_ptr)
    9498          PORT_WRITE(out_INSERT_ISSUE_QUEUE_LOAD_QUEUE_PTR_WRITE  [i][j],LOAD_QUEUE_PTR_WRITE );
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Reexecute_unit/include/Reexecute_unit.h

    r117 r122  
    129129  public    : SC_OUT(Ttype_t            )  ** out_REEXECUTE_TYPE                       ;//[nb_inst_reexecute]
    130130  public    : SC_OUT(Tlsq_ptr_t         )  ** out_REEXECUTE_STORE_QUEUE_PTR_WRITE      ;//[nb_inst_reexecute]
     131  public    : SC_OUT(Tlsq_ptr_t         )  ** out_REEXECUTE_STORE_QUEUE_PTR_READ       ;//[nb_inst_reexecute] //*
     132  public    : SC_OUT(Tcontrol_t         )  ** out_REEXECUTE_STORE_QUEUE_EMPTY          ;//[nb_inst_reexecute] //*
    131133  public    : SC_OUT(Tlsq_ptr_t         )  ** out_REEXECUTE_LOAD_QUEUE_PTR_WRITE       ;//[nb_inst_reexecute] //*
    132134  public    : SC_OUT(Tcontrol_t         )  ** out_REEXECUTE_HAS_IMMEDIAT               ;//[nb_inst_reexecute]
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Reexecute_unit/src/Reexecute_unit_allocation.cpp

    r117 r122  
    143143      ALLOC1_SIGNAL_OUT(out_REEXECUTE_TYPE                 ,"type"                 ,Ttype_t           ,_param->_size_type            );
    144144      ALLOC1_SIGNAL_OUT(out_REEXECUTE_STORE_QUEUE_PTR_WRITE,"store_queue_ptr_write",Tlsq_ptr_t        ,_param->_size_store_queue_ptr );
     145      ALLOC1_SIGNAL_OUT(out_REEXECUTE_STORE_QUEUE_PTR_READ ,"store_queue_ptr_read" ,Tlsq_ptr_t        ,_param->_size_store_queue_ptr );
     146      ALLOC1_SIGNAL_OUT(out_REEXECUTE_STORE_QUEUE_EMPTY    ,"store_queue_empty"    ,Tcontrol_t        ,1);
    145147      ALLOC1_SIGNAL_OUT(out_REEXECUTE_LOAD_QUEUE_PTR_WRITE ,"load_queue_ptr_write" ,Tlsq_ptr_t        ,_param->_size_load_queue_ptr  );
    146148      ALLOC1_SIGNAL_OUT(out_REEXECUTE_HAS_IMMEDIAT         ,"has_immediat"         ,Tcontrol_t        ,1                             );
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Reexecute_unit/src/Reexecute_unit_deallocation.cpp

    r117 r122  
    8383        DELETE1_SIGNAL(out_REEXECUTE_TYPE                       , _param->_nb_inst_reexecute,_param->_size_type               );
    8484        DELETE1_SIGNAL(out_REEXECUTE_STORE_QUEUE_PTR_WRITE      , _param->_nb_inst_reexecute,_param->_size_store_queue_ptr    );
     85        DELETE1_SIGNAL(out_REEXECUTE_STORE_QUEUE_PTR_READ       , _param->_nb_inst_reexecute,_param->_size_store_queue_ptr    );
     86        DELETE1_SIGNAL(out_REEXECUTE_STORE_QUEUE_EMPTY          , _param->_nb_inst_reexecute,1);
    8587        DELETE1_SIGNAL(out_REEXECUTE_LOAD_QUEUE_PTR_WRITE       , _param->_nb_inst_reexecute,_param->_size_load_queue_ptr     );
    8688        DELETE1_SIGNAL(out_REEXECUTE_HAS_IMMEDIAT               , _param->_nb_inst_reexecute,1                                );
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Reexecute_unit/src/Reexecute_unit_genMealy_reexecute.cpp

    r118 r122  
    5656            PORT_WRITE(out_REEXECUTE_TYPE                  [i],entry->type          );
    5757            PORT_WRITE(out_REEXECUTE_STORE_QUEUE_PTR_WRITE [i],0);
     58//          PORT_WRITE(out_REEXECUTE_STORE_QUEUE_PTR_READ  [i], 0);
     59//          PORT_WRITE(out_REEXECUTE_STORE_QUEUE_EMPTY     [i], 0);
    5860            PORT_WRITE(out_REEXECUTE_HAS_IMMEDIAT          [i],1);
    5961            PORT_WRITE(out_REEXECUTE_IMMEDIAT              [i],entry->data          );
     
    8284            PORT_WRITE(out_REEXECUTE_TYPE                  [i], PORT_READ(in_REEXECUTE_ROB_TYPE                    [i]));
    8385            PORT_WRITE(out_REEXECUTE_STORE_QUEUE_PTR_WRITE [i], PORT_READ(in_REEXECUTE_ROB_STORE_QUEUE_PTR_WRITE   [i]));
     86//          PORT_WRITE(out_REEXECUTE_STORE_QUEUE_PTR_READ  [i], 0);
     87//          PORT_WRITE(out_REEXECUTE_STORE_QUEUE_EMPTY     [i], 0);
    8488            PORT_WRITE(out_REEXECUTE_HAS_IMMEDIAT          [i], 0);
    8589            PORT_WRITE(out_REEXECUTE_IMMEDIAT              [i], 0);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Load_Store_pointer_unit/include/Load_Store_pointer_unit.h

    r88 r122  
    7070  public    : SC_IN (Toperation_t   )      **  in_INSERT_OPERATION            ; // [nb_inst_insert]
    7171  public    : SC_OUT(Tlsq_ptr_t     )      ** out_INSERT_STORE_QUEUE_PTR_WRITE; // [nb_inst_insert]
     72  public    : SC_OUT(Tlsq_ptr_t     )      ** out_INSERT_STORE_QUEUE_PTR_READ ; // [nb_inst_insert]
     73  public    : SC_OUT(Tcontrol_t     )      ** out_INSERT_STORE_QUEUE_EMPTY    ; // [nb_inst_insert]
    7274  public    : SC_OUT(Tlsq_ptr_t     )      ** out_INSERT_LOAD_QUEUE_PTR_WRITE ; // [nb_inst_insert]
    7375
     
    8486  public    : SC_IN (Tlsq_ptr_t     )      **  in_RETIRE_LOAD_QUEUE_PTR_WRITE ; // [nb_inst_retire]
    8587
     88    // ~~~~~[ Interface "retire_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     89  public    : SC_IN (Tcontrol_t        )  ***  in_RETIRE_EVENT_VAL            ;//[nb_front_end][nb_context]
     90  public    : SC_OUT(Tcontrol_t        )  *** out_RETIRE_EVENT_ACK            ;//[nb_front_end][nb_context]
     91  public    : SC_IN (Tevent_state_t    )  ***  in_RETIRE_EVENT_STATE          ;//[nb_front_end][nb_context]
     92
    8693    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    8794
    8895    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    89   public    : Tlsq_ptr_t                     * reg_STORE_QUEUE_PTR_WRITE; // [nb_load_store_queue]
    90   public    : bool                          ** reg_STORE_QUEUE_USE      ; // [nb_load_store_queue][size_store_queue]
    91   public    : Tlsq_ptr_t                     * reg_STORE_QUEUE_NB_USE   ; // [nb_load_store_queue]
    92   public    : Tlsq_ptr_t                     * reg_LOAD_QUEUE_PTR_WRITE ; // [nb_load_store_queue]
    93   public    : bool                          ** reg_LOAD_QUEUE_USE       ; // [nb_load_store_queue][size_load_queue]
     96  private   : Tlsq_ptr_t                     * reg_STORE_QUEUE_PTR_WRITE; // [nb_load_store_queue]
     97  private   : Tlsq_ptr_t                    ** reg_STORE_QUEUE_PTR_READ ; // [nb_front_end][nb_context]
     98  private   : bool                          ** reg_STORE_QUEUE_EMPTY    ; // [nb_front_end][nb_context]
     99  private   : bool                          ** reg_STORE_QUEUE_USE      ; // [nb_load_store_queue][size_store_queue]
     100  private   : Tlsq_ptr_t                     * reg_STORE_QUEUE_NB_USE   ; // [nb_load_store_queue]
     101  private   : Tlsq_ptr_t                     * reg_LOAD_QUEUE_PTR_WRITE ; // [nb_load_store_queue]
     102  private   : bool                          ** reg_LOAD_QUEUE_USE       ; // [nb_load_store_queue][size_load_queue]
    94103
    95104    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    96   public    : Tcontrol_t                     * internal_INSERT_ACK          ; // [nb_inst_insert]
    97   public    : operation_use_t                * internal_INSERT_OPERATION_USE; // [nb_inst_insert]
    98   public    : uint32_t                       * internal_INSERT_LSQ          ; // [nb_inst_insert]
    99   public    : Tlsq_ptr_t                     * internal_INSERT_PTR          ; // [nb_inst_insert]
     105  private   : Tcontrol_t                     * internal_INSERT_ACK          ; // [nb_inst_insert]
     106  private   : operation_use_t                * internal_INSERT_OPERATION_USE; // [nb_inst_insert]
     107  private   : uint32_t                       * internal_INSERT_LSQ          ; // [nb_inst_insert]
     108  private   : Tlsq_ptr_t                     * internal_INSERT_PTR          ; // [nb_inst_insert]
    100109
    101   public    : Tcontrol_t                     * internal_RETIRE_ACK          ; // [nb_inst_retire]
    102   public    : operation_use_t                * internal_RETIRE_OPERATION_USE; // [nb_inst_retire]
    103   public    : uint32_t                       * internal_RETIRE_LSQ          ; // [nb_inst_retire]
    104   public    : Tlsq_ptr_t                     * internal_RETIRE_PTR          ; // [nb_inst_retire]
     110  private   : Tcontrol_t                     * internal_RETIRE_ACK          ; // [nb_inst_retire]
     111  private   : operation_use_t                * internal_RETIRE_OPERATION_USE; // [nb_inst_retire]
     112  private   : uint32_t                       * internal_RETIRE_LSQ          ; // [nb_inst_retire]
     113  private   : Tlsq_ptr_t                     * internal_RETIRE_PTR          ; // [nb_inst_retire]
     114  private   : Tcontrol_t                    ** internal_RETIRE_EVENT_ACK    ;//[nb_front_end][nb_context]
    105115
    106116#endif
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Load_Store_pointer_unit/src/Load_Store_pointer_unit.cpp

    r88 r122  
    7474    if (usage_is_set(_usage,USE_SYSTEMC))
    7575      {
     76
     77        // Constant : accepted already transaction
     78        for (uint32_t i=0; i<_param->_nb_front_end; ++i)
     79          for (uint32_t j=0; j<_param->_nb_context[i]; ++j)
     80            {
     81              internal_RETIRE_EVENT_ACK [i][j] = 1;
     82             
     83              PORT_WRITE(out_RETIRE_EVENT_ACK[i][j],internal_RETIRE_EVENT_ACK [i][j]);
     84            }
     85
    7686        log_printf(INFO,Load_Store_pointer_unit,FUNCTION,"Method - transition");
    7787
     
    101111
    102112# ifdef SYSTEMCASS_SPECIFIC
    103         // List dependency information
    104         for (uint32_t i=0; i<_param->_nb_inst_insert; i++)
    105           {
    106             (*(out_INSERT_ACK                   [i])) (*( in_INSERT_VAL                   [i]));
    107             if (_param->_have_port_front_end_id)
    108             (*(out_INSERT_ACK                   [i])) (*( in_INSERT_FRONT_END_ID          [i]));
    109             if (_param->_have_port_context_id)
    110             (*(out_INSERT_ACK                   [i])) (*( in_INSERT_CONTEXT_ID            [i]));
    111             (*(out_INSERT_ACK                   [i])) (*( in_INSERT_TYPE                  [i]));
    112             (*(out_INSERT_ACK                   [i])) (*( in_INSERT_OPERATION             [i]));
     113//      // List dependency information
     114//      for (uint32_t i=0; i<_param->_nb_inst_insert; i++)
     115//        {
     116//          (*(out_INSERT_ACK                   [i])) (*( in_INSERT_VAL                   [i]));
     117//          if (_param->_have_port_front_end_id)
     118//          (*(out_INSERT_ACK                   [i])) (*( in_INSERT_FRONT_END_ID          [i]));
     119//          if (_param->_have_port_context_id)
     120//          (*(out_INSERT_ACK                   [i])) (*( in_INSERT_CONTEXT_ID            [i]));
     121//          (*(out_INSERT_ACK                   [i])) (*( in_INSERT_TYPE                  [i]));
     122//          (*(out_INSERT_ACK                   [i])) (*( in_INSERT_OPERATION             [i]));
    113123 
    114             (*(out_INSERT_STORE_QUEUE_PTR_WRITE [i])) (*( in_INSERT_VAL                   [i]));
    115             if (_param->_have_port_front_end_id)
    116             (*(out_INSERT_STORE_QUEUE_PTR_WRITE [i])) (*( in_INSERT_FRONT_END_ID          [i]));
    117             if (_param->_have_port_context_id)
    118             (*(out_INSERT_STORE_QUEUE_PTR_WRITE [i])) (*( in_INSERT_CONTEXT_ID            [i]));
    119             (*(out_INSERT_STORE_QUEUE_PTR_WRITE [i])) (*( in_INSERT_TYPE                  [i]));
    120             (*(out_INSERT_STORE_QUEUE_PTR_WRITE [i])) (*( in_INSERT_OPERATION             [i]));
     124//          (*(out_INSERT_STORE_QUEUE_PTR_WRITE [i])) (*( in_INSERT_VAL                   [i]));
     125//          if (_param->_have_port_front_end_id)
     126//          (*(out_INSERT_STORE_QUEUE_PTR_WRITE [i])) (*( in_INSERT_FRONT_END_ID          [i]));
     127//          if (_param->_have_port_context_id)
     128//          (*(out_INSERT_STORE_QUEUE_PTR_WRITE [i])) (*( in_INSERT_CONTEXT_ID            [i]));
     129//          (*(out_INSERT_STORE_QUEUE_PTR_WRITE [i])) (*( in_INSERT_TYPE                  [i]));
     130//          (*(out_INSERT_STORE_QUEUE_PTR_WRITE [i])) (*( in_INSERT_OPERATION             [i]));
    121131 
    122             if (_param->_have_port_load_queue_ptr)
    123               {
    124             (*(out_INSERT_LOAD_QUEUE_PTR_WRITE  [i])) (*( in_INSERT_VAL                   [i]));
    125             if (_param->_have_port_front_end_id)
    126             (*(out_INSERT_LOAD_QUEUE_PTR_WRITE  [i])) (*( in_INSERT_FRONT_END_ID          [i]));
    127             if (_param->_have_port_context_id)
    128             (*(out_INSERT_LOAD_QUEUE_PTR_WRITE  [i])) (*( in_INSERT_CONTEXT_ID            [i]));
    129             (*(out_INSERT_LOAD_QUEUE_PTR_WRITE  [i])) (*( in_INSERT_TYPE                  [i]));
    130             (*(out_INSERT_LOAD_QUEUE_PTR_WRITE  [i])) (*( in_INSERT_OPERATION             [i]));
    131               }
    132           }
     132//          if (_param->_have_port_load_queue_ptr)
     133//            {
     134//          (*(out_INSERT_LOAD_QUEUE_PTR_WRITE  [i])) (*( in_INSERT_VAL                   [i]));
     135//          if (_param->_have_port_front_end_id)
     136//          (*(out_INSERT_LOAD_QUEUE_PTR_WRITE  [i])) (*( in_INSERT_FRONT_END_ID          [i]));
     137//          if (_param->_have_port_context_id)
     138//          (*(out_INSERT_LOAD_QUEUE_PTR_WRITE  [i])) (*( in_INSERT_CONTEXT_ID            [i]));
     139//          (*(out_INSERT_LOAD_QUEUE_PTR_WRITE  [i])) (*( in_INSERT_TYPE                  [i]));
     140//          (*(out_INSERT_LOAD_QUEUE_PTR_WRITE  [i])) (*( in_INSERT_OPERATION             [i]));
     141//            }
     142//        }
    133143# endif
    134144
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Load_Store_pointer_unit/src/Load_Store_pointer_unit_allocation.cpp

    r112 r122  
    6767      ALLOC1_SIGNAL_IN ( in_INSERT_OPERATION            ,"operation"            ,Toperation_t,_param->_size_operation      );
    6868      ALLOC1_SIGNAL_OUT(out_INSERT_STORE_QUEUE_PTR_WRITE,"store_queue_ptr_write",Tlsq_ptr_t  ,_param->_size_store_queue_ptr);
     69      ALLOC1_SIGNAL_OUT(out_INSERT_STORE_QUEUE_PTR_READ ,"store_queue_ptr_read" ,Tlsq_ptr_t  ,_param->_size_store_queue_ptr);
     70      ALLOC1_SIGNAL_OUT(out_INSERT_STORE_QUEUE_EMPTY    ,"store_queue_empty"    ,Tcontrol_t  ,1                            );
    6971      ALLOC1_SIGNAL_OUT(out_INSERT_LOAD_QUEUE_PTR_WRITE ,"load_queue_ptr_write" ,Tlsq_ptr_t  ,_param->_size_load_queue_ptr );
    7072
     
    8082      ALLOC1_SIGNAL_IN ( in_RETIRE_FRONT_END_ID         ,"front_end_id"         ,Tcontext_t  ,_param->_size_front_end_id   );
    8183      ALLOC1_SIGNAL_IN ( in_RETIRE_CONTEXT_ID           ,"context_id"           ,Tcontext_t  ,_param->_size_context_id     );
    82 //       ALLOC1_SIGNAL_IN ( in_RETIRE_TYPE                 ,"type"                 ,Ttype_t     ,_param->_size_type           );
    83 //       ALLOC1_SIGNAL_IN ( in_RETIRE_OPERATION            ,"operation"            ,Toperation_t,_param->_size_operation      );
     84//    ALLOC1_SIGNAL_IN ( in_RETIRE_TYPE                 ,"type"                 ,Ttype_t     ,_param->_size_type           );
     85//    ALLOC1_SIGNAL_IN ( in_RETIRE_OPERATION            ,"operation"            ,Toperation_t,_param->_size_operation      );
    8486      ALLOC1_SIGNAL_IN ( in_RETIRE_USE_STORE_QUEUE      ,"use_store_queue"      ,Tcontrol_t  ,1);
    8587      ALLOC1_SIGNAL_IN ( in_RETIRE_USE_LOAD_QUEUE       ,"use_load_queue"       ,Tcontrol_t  ,1);
     
    9092    }
    9193
     94    // ~~~~~[ Interface : "retire_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     95    {
     96      ALLOC2_INTERFACE_BEGIN("retire_event", IN,NORTH, _("Retire event"), _param->_nb_front_end, _param->_nb_context[it1]);
     97
     98      _ALLOC2_VALACK_IN ( in_RETIRE_EVENT_VAL           ,VAL,_param->_nb_front_end, _param->_nb_context[it1]);
     99      _ALLOC2_VALACK_OUT(out_RETIRE_EVENT_ACK           ,ACK,_param->_nb_front_end, _param->_nb_context[it1]);
     100      _ALLOC2_SIGNAL_IN ( in_RETIRE_EVENT_STATE         ,"state"                ,Tevent_state_t    ,_param->_size_event_state, _param->_nb_front_end, _param->_nb_context[it1]);
     101
     102      ALLOC2_INTERFACE_END(_param->_nb_front_end, _param->_nb_context[it1]);
     103    }
     104
    92105    if (usage_is_set(_usage,USE_SYSTEMC))
    93106      {
    94107    ALLOC1(reg_STORE_QUEUE_PTR_WRITE     ,Tlsq_ptr_t     ,_param->_nb_load_store_queue);
     108    ALLOC2(reg_STORE_QUEUE_PTR_READ      ,Tlsq_ptr_t     ,_param->_nb_front_end, _param->_nb_context[it1]);
     109    ALLOC2(reg_STORE_QUEUE_EMPTY         ,bool           ,_param->_nb_front_end, _param->_nb_context[it1]);
    95110    ALLOC2(reg_STORE_QUEUE_USE           ,bool           ,_param->_nb_load_store_queue,_param->_size_store_queue [it1]);
    96111    ALLOC1(reg_STORE_QUEUE_NB_USE        ,Tlsq_ptr_t     ,_param->_nb_load_store_queue);
     
    107122    ALLOC1(internal_RETIRE_LSQ           ,uint32_t       ,_param->_nb_inst_retire);
    108123    ALLOC1(internal_RETIRE_PTR           ,Tlsq_ptr_t     ,_param->_nb_inst_retire);
     124
     125    ALLOC2(internal_RETIRE_EVENT_ACK     ,Tcontrol_t     ,_param->_nb_front_end,_param->_nb_context[it1]);
    109126      }
     127
    110128    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    111129
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Load_Store_pointer_unit/src/Load_Store_pointer_unit_deallocation.cpp

    r112 r122  
    3636        DELETE1_SIGNAL( in_INSERT_OPERATION            ,_param->_nb_inst_insert,_param->_size_operation      );
    3737        DELETE1_SIGNAL(out_INSERT_STORE_QUEUE_PTR_WRITE,_param->_nb_inst_insert,_param->_size_store_queue_ptr);
     38        DELETE1_SIGNAL(out_INSERT_STORE_QUEUE_PTR_READ ,_param->_nb_inst_insert,_param->_size_store_queue_ptr);
     39        DELETE1_SIGNAL(out_INSERT_STORE_QUEUE_EMPTY    ,_param->_nb_inst_insert,1);
    3840        DELETE1_SIGNAL(out_INSERT_LOAD_QUEUE_PTR_WRITE ,_param->_nb_inst_insert,_param->_size_load_queue_ptr );
    3941
     
    4951        DELETE1_SIGNAL( in_RETIRE_LOAD_QUEUE_PTR_WRITE ,_param->_nb_inst_retire,_param->_size_load_queue_ptr );
    5052
     53        DELETE2_SIGNAL( in_RETIRE_EVENT_VAL            ,_param->_nb_front_end, _param->_nb_context[it1],1);
     54        DELETE2_SIGNAL(out_RETIRE_EVENT_ACK            ,_param->_nb_front_end, _param->_nb_context[it1],1);
     55        DELETE2_SIGNAL( in_RETIRE_EVENT_STATE          ,_param->_nb_front_end, _param->_nb_context[it1],_param->_size_event_state);
     56
    5157        DELETE1(reg_STORE_QUEUE_PTR_WRITE     ,_param->_nb_load_store_queue);
     58        DELETE2(reg_STORE_QUEUE_PTR_READ      ,_param->_nb_front_end, _param->_nb_context[it1]);
     59        DELETE2(reg_STORE_QUEUE_EMPTY         ,_param->_nb_front_end, _param->_nb_context[it1]);
    5260        DELETE2(reg_STORE_QUEUE_USE           ,_param->_nb_load_store_queue,_param->_size_store_queue [it1]);
    5361        DELETE1(reg_STORE_QUEUE_NB_USE        ,_param->_nb_load_store_queue);
     
    6472        DELETE1(internal_RETIRE_LSQ           ,_param->_nb_inst_retire);
    6573        DELETE1(internal_RETIRE_PTR           ,_param->_nb_inst_retire);
     74
     75        DELETE2(internal_RETIRE_EVENT_ACK     ,_param->_nb_front_end,_param->_nb_context[it1]);
    6676      }
    6777
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Load_Store_pointer_unit/src/Load_Store_pointer_unit_genMealy_insert.cpp

    r110 r122  
    5454        Tcontrol_t ack                   = false;
    5555
    56         if ( (PORT_READ(in_INSERT_VAL  [i]) == true       ) and
    57              (PORT_READ(in_INSERT_TYPE [i]) == TYPE_MEMORY))
     56        if ((PORT_READ(in_INSERT_VAL  [i]) == true       ) and
     57            (PORT_READ(in_INSERT_TYPE [i]) == TYPE_MEMORY))
    5858          {
    5959            log_printf(TRACE,Load_Store_pointer_unit,FUNCTION,"    * type is memory");
     
    7575                uint32_t   ptr;
    7676
    77                 PORT_WRITE(out_INSERT_STORE_QUEUE_PTR_WRITE [i], STORE_QUEUE_PTR_WRITE [lsq]);
     77                PORT_WRITE(out_INSERT_STORE_QUEUE_PTR_WRITE [i],     STORE_QUEUE_PTR_WRITE [lsq]);
     78//                 PORT_WRITE(out_INSERT_STORE_QUEUE_PTR_READ  [i], ((reg_STORE_QUEUE_PTR_READ  [front_end_id][context_id]+1)%_param->_size_load_queue[lsq]));
     79                PORT_WRITE(out_INSERT_STORE_QUEUE_PTR_READ  [i], reg_STORE_QUEUE_PTR_READ  [front_end_id][context_id]);
     80                PORT_WRITE(out_INSERT_STORE_QUEUE_EMPTY     [i], reg_STORE_QUEUE_EMPTY     [front_end_id][context_id]);
    7881                if (_param->_have_port_load_queue_ptr)
    7982                PORT_WRITE(out_INSERT_LOAD_QUEUE_PTR_WRITE  [i], LOAD_QUEUE_PTR_WRITE  [lsq]);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Load_Store_pointer_unit/src/Load_Store_pointer_unit_transition.cpp

    r110 r122  
    3838              reg_LOAD_QUEUE_USE  [i][j] = false;
    3939          }
     40        for (uint32_t i=0; i<_param->_nb_front_end; ++i)
     41          for (uint32_t j=0; j<_param->_nb_context[i]; ++j)
     42            {
     43              reg_STORE_QUEUE_PTR_READ  [i][j] = 0;
     44              reg_STORE_QUEUE_EMPTY     [i][j] = true;
     45            }
    4046      }
    4147    else
     
    5662                    log_printf(TRACE,Load_Store_pointer_unit,FUNCTION,"    * use STORE_QUEUE");
    5763
     64                    Tcontext_t front_end_id = (_param->_have_port_front_end_id)?PORT_READ(in_INSERT_FRONT_END_ID [i]):0;
     65                    Tcontext_t context_id   = (_param->_have_port_context_id  )?PORT_READ(in_INSERT_CONTEXT_ID   [i]):0;
    5866                    uint32_t   lsq = internal_INSERT_LSQ [i];
    5967                    Tlsq_ptr_t ptr = internal_INSERT_PTR [i];
     
    6270                    log_printf(TRACE,Load_Store_pointer_unit,FUNCTION,"    * ptr : %d",ptr);
    6371
     72                    reg_STORE_QUEUE_EMPTY     [front_end_id][context_id] = false; // new element
    6473                    reg_STORE_QUEUE_PTR_WRITE [lsq]      = (ptr+1)%_param->_size_store_queue[lsq];
    6574                    reg_STORE_QUEUE_NB_USE    [lsq]      ++;
     
    109118                    log_printf(TRACE,Load_Store_pointer_unit,FUNCTION,"    * lsq : %d",lsq);
    110119                    log_printf(TRACE,Load_Store_pointer_unit,FUNCTION,"    * ptr : %d",ptr);
    111                    
     120       
     121                    // TODO : if ROB retire ooo context, can retire store ooo.
     122
    112123//                  reg_STORE_QUEUE_PTR_WRITE [lsq]      = ((ptr==0)?_param->_size_store_queue[lsq]:ptr)-1;
    113124                    reg_STORE_QUEUE_NB_USE    [lsq]      --;
     
    137148                }       
    138149            }
     150       
     151        for (uint32_t i=0; i<_param->_nb_front_end; ++i)
     152          for (uint32_t j=0; j<_param->_nb_context[i]; ++j)
     153            {
     154              uint32_t lsq = _param->_link_load_store_unit_with_thread[i][j];
     155                   
     156              if (PORT_READ(in_RETIRE_EVENT_STATE [i][j]) == EVENT_STATE_NO_EVENT)
     157                {
     158                  uint32_t ptr_old =  reg_STORE_QUEUE_PTR_READ[i][j];
     159                  uint32_t ptr_new = (reg_STORE_QUEUE_PTR_READ[i][j]+1)%_param->_size_store_queue[lsq];
     160
     161                  if ((reg_STORE_QUEUE_USE [lsq][ptr_old] == false) and
     162                      (reg_STORE_QUEUE_EMPTY    [i][j] == false))
     163                    {
     164                      reg_STORE_QUEUE_PTR_READ [i][j] = ptr_new;
     165                      if (ptr_new == reg_STORE_QUEUE_PTR_WRITE [lsq])
     166                      reg_STORE_QUEUE_EMPTY    [i][j] = true;
     167                    }
     168                }
     169             
     170              if (PORT_READ(in_RETIRE_EVENT_VAL[i][j]) and internal_RETIRE_EVENT_ACK [i][j])
     171                if (PORT_READ(in_RETIRE_EVENT_STATE [i][j]) == EVENT_STATE_EVENT)
     172                  {
     173                    log_printf(TRACE,Load_Store_pointer_unit,FUNCTION,"  * EVENT [%d][%d]",i,j);
     174
     175                    // reset ptr_read
     176                    reg_STORE_QUEUE_PTR_READ [i][j] = reg_STORE_QUEUE_PTR_WRITE [lsq];
     177                    reg_STORE_QUEUE_EMPTY    [i][j] = true;
     178                  }
     179            }
    139180      }
    140 
     181   
    141182    // ===================================================================
    142183    // =====[ OTHER ]=====================================================
     
    150191        {
    151192          log_printf(TRACE,Load_Store_pointer_unit,FUNCTION,"    * Load_Store_unit [%d]",i);
     193          log_printf(TRACE,Load_Store_pointer_unit,FUNCTION,"      * reg_LOAD_QUEUE_PTR_WRITE  : %d", reg_LOAD_QUEUE_PTR_WRITE [i]);
     194          log_printf(TRACE,Load_Store_pointer_unit,FUNCTION,"      * reg_LOAD_QUEUE_USE        :");
     195          for (uint32_t j=0; j<_param->_size_load_queue [i]; ++j)
     196          log_printf(TRACE,Load_Store_pointer_unit,FUNCTION,"        [%d] %d",j,reg_LOAD_QUEUE_USE [i][j]);
    152197          log_printf(TRACE,Load_Store_pointer_unit,FUNCTION,"      * reg_STORE_QUEUE_NB_USE    : %d", reg_STORE_QUEUE_NB_USE   [i]);
    153198          log_printf(TRACE,Load_Store_pointer_unit,FUNCTION,"      * reg_STORE_QUEUE_PTR_WRITE : %d", reg_STORE_QUEUE_PTR_WRITE[i]);
     
    155200          for (uint32_t j=0; j<_param->_size_store_queue [i]; ++j)
    156201          log_printf(TRACE,Load_Store_pointer_unit,FUNCTION,"        [%d] %d",j,reg_STORE_QUEUE_USE [i][j]);
    157           log_printf(TRACE,Load_Store_pointer_unit,FUNCTION,"      * reg_LOAD_QUEUE_PTR_WRITE  : %d", reg_LOAD_QUEUE_PTR_WRITE [i]);
    158           log_printf(TRACE,Load_Store_pointer_unit,FUNCTION,"      * reg_LOAD_QUEUE_USE        :");
    159           for (uint32_t j=0; j<_param->_size_load_queue [i]; ++j)
    160           log_printf(TRACE,Load_Store_pointer_unit,FUNCTION,"        [%d] %d",j,reg_LOAD_QUEUE_USE [i][j]);
    161202        }
     203      for (uint32_t i=0; i<_param->_nb_front_end; ++i)
     204        for (uint32_t j=0; j<_param->_nb_context[i]; ++j)
     205          {
     206          log_printf(TRACE,Load_Store_pointer_unit,FUNCTION,"      * reg_STORE_QUEUE_PTR_READ [%d][%d] : %d",i,j,reg_STORE_QUEUE_PTR_READ [i][j]);
     207          log_printf(TRACE,Load_Store_pointer_unit,FUNCTION,"      * reg_STORE_QUEUE_EMPTY    [%d][%d] : %d",i,j,reg_STORE_QUEUE_EMPTY    [i][j]);
     208          }
    162209    }
    163210#endif
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/include/Register_Address_Translation_unit.h

    r112 r122  
    100100  public    : SC_IN (Tgeneral_address_t)   **  in_RETIRE_NUM_REG_RD_LOG    ;//[nb_inst_retire]
    101101  public    : SC_IN (Tspecial_address_t)   **  in_RETIRE_NUM_REG_RE_LOG    ;//[nb_inst_retire]
    102   public    : SC_IN (Tgeneral_address_t)   **  in_RETIRE_NUM_REG_RD_PHY_OLD;//[nb_inst_retire]
    103   public    : SC_IN (Tspecial_address_t)   **  in_RETIRE_NUM_REG_RE_PHY_OLD;//[nb_inst_retire]
     102  public    : SC_IN (Tgeneral_address_t)   **  in_RETIRE_NUM_REG_RD_PHY_NEW;//[nb_inst_retire]
     103  public    : SC_IN (Tspecial_address_t)   **  in_RETIRE_NUM_REG_RE_PHY_NEW;//[nb_inst_retire]
    104104  public    : SC_OUT(Tcontrol_t        )   ** out_RETIRE_RESTORE_RD_PHY_OLD;//[nb_inst_retire]
    105105  public    : SC_OUT(Tcontrol_t        )   ** out_RETIRE_RESTORE_RE_PHY_OLD;//[nb_inst_retire]
     
    114114
    115115    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    116   private   : Tgeneral_address_t          *** rat_gpr;                      //[nb_front_end][nb_context][nb_general_register_logic]
     116  private   : Tgeneral_address_t          *** rat_gpr_not_speculative;      //[nb_front_end][nb_context][nb_general_register_logic]
     117  private   : Tgeneral_address_t          *** rat_gpr_speculative;          //[nb_front_end][nb_context][nb_general_register_logic]
     118  private   : bool                        *** rat_gpr_speculative_valid;    //[nb_front_end][nb_context][nb_general_register_logic]
    117119  private   : bool                        *** rat_gpr_update_table;         //[nb_front_end][nb_context][nb_general_register_logic]
    118   private   : Tspecial_address_t          *** rat_spr;                      //[nb_front_end][nb_context][nb_special_register_logic]
     120
     121  private   : Tspecial_address_t          *** rat_spr_not_speculative;      //[nb_front_end][nb_context][nb_special_register_logic]
     122  private   : Tspecial_address_t          *** rat_spr_speculative;          //[nb_front_end][nb_context][nb_special_register_logic]
     123  private   : bool                        *** rat_spr_speculative_valid;    //[nb_front_end][nb_context][nb_special_register_logic]
    119124  private   : bool                        *** rat_spr_update_table;         //[nb_front_end][nb_context][nb_special_register_logic]
    120125
     
    123128  private   : Tcontrol_t                    * internal_INSERT_ACK;          //[nb_inst_insert]
    124129  private   : Tcontrol_t                    * internal_RETIRE_ACK;          //[nb_inst_retire]
    125   public    : Tcontrol_t                   ** internal_RETIRE_EVENT_ACK    ;//[nb_front_end][nb_context]
    126 
    127   private   : bool                        *** internal_rat_gpr_update_table;         //[nb_front_end][nb_context][nb_general_register_logic]
    128   private   : bool                        *** internal_rat_spr_update_table;         //[nb_front_end][nb_context][nb_special_register_logic]
    129   public    : Tcontrol_t                    * internal_RETIRE_RESTORE_RD_PHY_OLD;//[nb_inst_retire]
    130   public    : Tcontrol_t                    * internal_RETIRE_RESTORE_RE_PHY_OLD;//[nb_inst_retire]
     130  private   : Tcontrol_t                   ** internal_RETIRE_EVENT_ACK    ;//[nb_front_end][nb_context]
     131
     132  private   : bool                        *** internal_rat_gpr_update_table;//[nb_front_end][nb_context][nb_general_register_logic]
     133  private   : bool                        *** internal_rat_spr_update_table;//[nb_front_end][nb_context][nb_special_register_logic]
     134
     135  private   : Tcontrol_t                    * internal_RETIRE_RESTORE           ;//[nb_inst_retire]
     136  private   : Tcontrol_t                    * internal_RETIRE_RESTORE_RD_PHY_OLD;//[nb_inst_retire]
     137  private   : Tcontrol_t                    * internal_RETIRE_RESTORE_RE_PHY_OLD;//[nb_inst_retire]
    131138
    132139#endif
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit.cpp

    r106 r122  
    129129                      << (*(in_RENAME_NUM_REG_RE_LOG [i]));
    130130          }
     131        for (uint32_t i=0; i<_param->_nb_front_end; ++i)
     132          for (uint32_t j=0; j<_param->_nb_context[i]; ++j)
     133            sensitive << (*(in_RETIRE_EVENT_VAL   [i][j]))
     134                      << (*(in_RETIRE_EVENT_STATE [i][j]));
    131135
    132136# ifdef SYSTEMCASS_SPECIFIC
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_allocation.cpp

    r112 r122  
    109109      ALLOC1_SIGNAL_IN ( in_RETIRE_NUM_REG_RD_LOG    ,"num_reg_rd_log"    ,Tgeneral_address_t,_param->_size_general_register_logic);
    110110      ALLOC1_SIGNAL_IN ( in_RETIRE_NUM_REG_RE_LOG    ,"num_reg_re_log"    ,Tspecial_address_t,_param->_size_special_register_logic);
    111       ALLOC1_SIGNAL_IN ( in_RETIRE_NUM_REG_RD_PHY_OLD,"num_reg_rd_phy_old",Tgeneral_address_t,_param->_size_general_register);
    112       ALLOC1_SIGNAL_IN ( in_RETIRE_NUM_REG_RE_PHY_OLD,"num_reg_re_phy_old",Tspecial_address_t,_param->_size_special_register);
     111      ALLOC1_SIGNAL_IN ( in_RETIRE_NUM_REG_RD_PHY_NEW,"num_reg_rd_phy_new",Tgeneral_address_t,_param->_size_general_register);
     112      ALLOC1_SIGNAL_IN ( in_RETIRE_NUM_REG_RE_PHY_NEW,"num_reg_re_phy_new",Tspecial_address_t,_param->_size_special_register);
    113113      ALLOC1_SIGNAL_OUT(out_RETIRE_RESTORE_RD_PHY_OLD,"restore_rd_phy_old",Tcontrol_t        ,1);
    114114      ALLOC1_SIGNAL_OUT(out_RETIRE_RESTORE_RE_PHY_OLD,"restore_re_phy_old",Tcontrol_t        ,1);
     
    136136    ALLOC2(internal_RETIRE_EVENT_ACK ,Tcontrol_t,_param->_nb_front_end,_param->_nb_context[it1]);
    137137
    138     ALLOC3(rat_gpr                      ,Tgeneral_address_t,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic);
    139     ALLOC3(rat_spr                      ,Tspecial_address_t,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic);
    140     ALLOC3(rat_gpr_update_table         ,bool              ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic);
    141     ALLOC3(rat_spr_update_table         ,bool              ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic);
    142     ALLOC3(internal_rat_gpr_update_table,bool              ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic);
    143     ALLOC3(internal_rat_spr_update_table,bool              ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic);
     138    ALLOC3(rat_gpr_not_speculative  ,Tgeneral_address_t,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic);
     139    ALLOC3(rat_gpr_speculative      ,Tgeneral_address_t,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic);
     140    ALLOC3(rat_gpr_speculative_valid,bool              ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic);
     141    ALLOC3(rat_gpr_update_table     ,bool              ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic);
     142   
     143    ALLOC3(rat_spr_not_speculative  ,Tspecial_address_t,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic);
     144    ALLOC3(rat_spr_speculative      ,Tspecial_address_t,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic);
     145    ALLOC3(rat_spr_speculative_valid,bool              ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic);
     146    ALLOC3(rat_spr_update_table     ,bool              ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic);
    144147
     148    ALLOC3(internal_rat_gpr_update_table,bool, _param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic);
     149    ALLOC3(internal_rat_spr_update_table,bool, _param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic);
     150
     151    ALLOC1(internal_RETIRE_RESTORE           ,Tcontrol_t,_param->_nb_inst_retire);
    145152    ALLOC1(internal_RETIRE_RESTORE_RD_PHY_OLD,Tcontrol_t,_param->_nb_inst_retire);
    146153    ALLOC1(internal_RETIRE_RESTORE_RE_PHY_OLD,Tcontrol_t,_param->_nb_inst_retire);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_deallocation.cpp

    r112 r122  
    6464        DELETE1_SIGNAL( in_RETIRE_NUM_REG_RD_LOG    ,_param->_nb_inst_retire,_param->_size_general_register_logic);
    6565        DELETE1_SIGNAL( in_RETIRE_NUM_REG_RE_LOG    ,_param->_nb_inst_retire,_param->_size_special_register_logic);
    66         DELETE1_SIGNAL( in_RETIRE_NUM_REG_RD_PHY_OLD,_param->_nb_inst_retire,_param->_size_general_register);
    67         DELETE1_SIGNAL( in_RETIRE_NUM_REG_RE_PHY_OLD,_param->_nb_inst_retire,_param->_size_special_register);
     66        DELETE1_SIGNAL( in_RETIRE_NUM_REG_RD_PHY_NEW,_param->_nb_inst_retire,_param->_size_general_register);
     67        DELETE1_SIGNAL( in_RETIRE_NUM_REG_RE_PHY_NEW,_param->_nb_inst_retire,_param->_size_special_register);
    6868        DELETE1_SIGNAL(out_RETIRE_RESTORE_RD_PHY_OLD,_param->_nb_inst_retire,1);
    6969        DELETE1_SIGNAL(out_RETIRE_RESTORE_RE_PHY_OLD,_param->_nb_inst_retire,1);
     
    7979        DELETE2(internal_RETIRE_EVENT_ACK              ,_param->_nb_front_end,_param->_nb_context[it1]);
    8080
    81         DELETE3(rat_gpr                      ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic);
    82         DELETE3(rat_spr                      ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic);
     81        DELETE3(rat_gpr_not_speculative      ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic);
     82        DELETE3(rat_gpr_speculative          ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic);
     83        DELETE3(rat_gpr_speculative_valid    ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic);
    8384        DELETE3(rat_gpr_update_table         ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic);
     85
     86        DELETE3(rat_spr_not_speculative      ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic);
     87        DELETE3(rat_spr_speculative          ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic);
     88        DELETE3(rat_spr_speculative_valid    ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic);
    8489        DELETE3(rat_spr_update_table         ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic);
     90
    8591        DELETE3(internal_rat_gpr_update_table,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic);
    8692        DELETE3(internal_rat_spr_update_table,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic);
    8793       
     94        DELETE1(internal_RETIRE_RESTORE           ,_param->_nb_inst_retire);
    8895        DELETE1(internal_RETIRE_RESTORE_RD_PHY_OLD,_param->_nb_inst_retire);
    8996        DELETE1(internal_RETIRE_RESTORE_RE_PHY_OLD,_param->_nb_inst_retire);
    9097      }
    9198
    92     // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
     99     // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    93100    delete    _component;
    94101
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_genMealy_rename.cpp

    r100 r122  
    2626    log_function(Register_Address_Translation_unit,FUNCTION,_name.c_str());
    2727
     28    if (PORT_READ(in_NRESET) != 0)
    2829    for (uint32_t i=0; i<_param->_nb_inst_insert; i++)
    2930      if (PORT_READ(in_RENAME_VAL [i])) // not in sensitive list : it's to have valide value to array access
     
    3334        Tcontext_t front_end_id = (_param->_have_port_front_end_id)?PORT_READ(in_RENAME_FRONT_END_ID [i]):0;
    3435        Tcontext_t context_id   = (_param->_have_port_context_id  )?PORT_READ(in_RENAME_CONTEXT_ID   [i]):0;
     36        bool       have_event   = (PORT_READ(in_RETIRE_EVENT_VAL [front_end_id][context_id]) and // always ack
     37                                   (PORT_READ(in_RETIRE_EVENT_STATE [front_end_id][context_id]) == EVENT_STATE_EVENT));
     38
    3539
    3640        log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * front_end_id       : %d",front_end_id);
    3741        log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * context_id         : %d",context_id);
     42        log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * have_event         : %d",have_event);
    3843
    3944        Tgeneral_address_t num_reg_ra_log    = PORT_READ(in_RENAME_NUM_REG_RA_LOG [i]); //%_param->_nb_general_register;
     
    4348        Tspecial_address_t num_reg_re_log    = PORT_READ(in_RENAME_NUM_REG_RE_LOG [i]); //%_param->_nb_special_register;
    4449                                           
    45         Tgeneral_address_t num_reg_ra_phy    = rat_gpr[front_end_id][context_id][num_reg_ra_log];
    46         Tgeneral_address_t num_reg_rb_phy    = rat_gpr[front_end_id][context_id][num_reg_rb_log];
    47         Tspecial_address_t num_reg_rc_phy    = rat_spr[front_end_id][context_id][num_reg_rc_log];
    48         Tgeneral_address_t num_reg_rd_phy_old= rat_gpr[front_end_id][context_id][num_reg_rd_log];
    49         Tspecial_address_t num_reg_re_phy_old= rat_spr[front_end_id][context_id][num_reg_re_log];
     50        // if rat_speculative is valid,
     51        // then read rat_speculative have the most valid alias register
     52        // else, they have an previous event, the rat_not_speculative have the valid register
     53
     54        Tgeneral_address_t num_reg_ra_phy    = (rat_gpr_speculative_valid[front_end_id][context_id][num_reg_ra_log] and not have_event)?rat_gpr_speculative[front_end_id][context_id][num_reg_ra_log]:rat_gpr_not_speculative[front_end_id][context_id][num_reg_ra_log];
     55        Tgeneral_address_t num_reg_rb_phy    = (rat_gpr_speculative_valid[front_end_id][context_id][num_reg_rb_log] and not have_event)?rat_gpr_speculative[front_end_id][context_id][num_reg_rb_log]:rat_gpr_not_speculative[front_end_id][context_id][num_reg_rb_log];
     56        Tspecial_address_t num_reg_rc_phy    = (rat_spr_speculative_valid[front_end_id][context_id][num_reg_rc_log] and not have_event)?rat_spr_speculative[front_end_id][context_id][num_reg_rc_log]:rat_spr_not_speculative[front_end_id][context_id][num_reg_rc_log];
     57        Tgeneral_address_t num_reg_rd_phy_old= (rat_gpr_speculative_valid[front_end_id][context_id][num_reg_rd_log] and not have_event)?rat_gpr_speculative[front_end_id][context_id][num_reg_rd_log]:rat_gpr_not_speculative[front_end_id][context_id][num_reg_rd_log];
     58        Tspecial_address_t num_reg_re_phy_old= (rat_spr_speculative_valid[front_end_id][context_id][num_reg_re_log] and not have_event)?rat_spr_speculative[front_end_id][context_id][num_reg_re_log]:rat_spr_not_speculative[front_end_id][context_id][num_reg_re_log];
    5059
    5160        log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_ra         : %d -> %d",num_reg_ra_log,num_reg_ra_phy    );
     
    5463        log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_rd         : %d -> %d",num_reg_rd_log,num_reg_rd_phy_old);
    5564        log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_re         : %d -> %d",num_reg_re_log,num_reg_re_phy_old);
    56        
    5765
    5866        PORT_WRITE(out_RENAME_NUM_REG_RA_PHY     [i], num_reg_ra_phy    );
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_genMealy_retire.cpp

    r112 r122  
    2626    log_function(Register_Address_Translation_unit,FUNCTION,_name.c_str());
    2727
     28    if (PORT_READ(in_NRESET) != 0)
     29      {
    2830    // Init internal update table
    2931    for (uint32_t i=0; i<_param->_nb_front_end; i++)
    3032      for (uint32_t j=0; j<_param->_nb_context[i]; j++)
    3133        {
     34          log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"  * init [%d][%d]",i,j);
     35
    3236          // An event occure
    3337          // bool event = (PORT_READ(in_RETIRE_EVENT_STATE [i][j]) != EVENT_STATE_NO_EVENT);
     
    3539                                     (PORT_READ(in_RETIRE_EVENT_STATE [i][j]) == EVENT_STATE_EVENT));
    3640
     41          log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * reset_update_table : %d",reset_update_table);
     42
    3743          // not event -> update_table == 1 -> always update
    3844          // event     -> update_table and not reset
    3945          for (uint32_t k=0; k<_param->_nb_general_register_logic; ++k)
    4046            internal_rat_gpr_update_table [i][j][k] = // not event or
    41                                                       (rat_gpr_update_table [i][j][k] and not reset_update_table);
     47                                                      (not reset_update_table and rat_gpr_update_table [i][j][k]);
    4248          for (uint32_t k=0; k<_param->_nb_special_register_logic; ++k)
    4349            internal_rat_spr_update_table [i][j][k] = // not event or
    44                                                       (rat_spr_update_table [i][j][k] and not reset_update_table);
     50                                                      (not reset_update_table and rat_spr_update_table [i][j][k]);
    4551        }
    46 
    4752
    4853    // RETIRE is in order -> also don't need test if an instruction is valid
     
    5560        Tcontrol_t retire_restore_re_phy_old = false;
    5661
    57         Tcontext_t front_end_id = (_param->_have_port_front_end_id)?PORT_READ(in_RETIRE_FRONT_END_ID [i]):0;
    58         Tcontext_t context_id   = (_param->_have_port_context_id  )?PORT_READ(in_RETIRE_CONTEXT_ID   [i]):0;
    59         Tcontrol_t restore      = (PORT_READ(in_RETIRE_EVENT_STATE [front_end_id][context_id]) != EVENT_STATE_NO_EVENT);
     62        Tcontext_t front_end_id   = (_param->_have_port_front_end_id)?PORT_READ(in_RETIRE_FRONT_END_ID [i]):0;
     63        Tcontext_t context_id     = (_param->_have_port_context_id  )?PORT_READ(in_RETIRE_CONTEXT_ID   [i]):0;
     64        Tcontrol_t retire_restore = (PORT_READ(in_RETIRE_EVENT_STATE [front_end_id][context_id]) != EVENT_STATE_NO_EVENT);
     65
     66        log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * front_end_id         : %d",front_end_id);
     67        log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * context_id           : %d",context_id  );
     68        log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * restore              : %d",retire_restore);
    6069
    6170        // Test if event -> need restore ?
    62         if (restore)
     71        if (retire_restore)
    6372          {
    64             log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * Have event");
    65             log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * front_end_id         : %d",front_end_id);
    66             log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * context_id           : %d",context_id  );
     73            log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"      * Have event");
    6774                       
    6875            // Test and update update table
     
    8794              }
    8895
    89             log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * restore_rd_phy_old   : %d",retire_restore_rd_phy_old);
    90             log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * restore_re_phy_old   : %d",retire_restore_re_phy_old);
     96            log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"      * restore_rd_phy_old   : %d",retire_restore_rd_phy_old);
     97            log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"      * restore_re_phy_old   : %d",retire_restore_re_phy_old);
    9198          }
    9299
    93         internal_RETIRE_RESTORE_RD_PHY_OLD[i] = retire_restore_rd_phy_old;
    94         internal_RETIRE_RESTORE_RE_PHY_OLD[i] = retire_restore_re_phy_old;
     100        internal_RETIRE_RESTORE            [i] = retire_restore;
     101        internal_RETIRE_RESTORE_RD_PHY_OLD [i] = retire_restore_rd_phy_old;
     102        internal_RETIRE_RESTORE_RE_PHY_OLD [i] = retire_restore_re_phy_old;
    95103             
    96         PORT_WRITE(out_RETIRE_RESTORE_RD_PHY_OLD[i], internal_RETIRE_RESTORE_RD_PHY_OLD[i]);
    97         PORT_WRITE(out_RETIRE_RESTORE_RE_PHY_OLD[i], internal_RETIRE_RESTORE_RE_PHY_OLD[i]);
    98         PORT_WRITE(out_RETIRE_RESTORE           [i], restore);
     104        PORT_WRITE(out_RETIRE_RESTORE           [i], internal_RETIRE_RESTORE            [i]);
     105        PORT_WRITE(out_RETIRE_RESTORE_RD_PHY_OLD[i], internal_RETIRE_RESTORE_RD_PHY_OLD [i]);
     106        PORT_WRITE(out_RETIRE_RESTORE_RE_PHY_OLD[i], internal_RETIRE_RESTORE_RE_PHY_OLD [i]);
     107      }
    99108      }
    100109
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_transition.cpp

    r112 r122  
    3434          for (uint32_t j=0; j<_param->_nb_context[i]; j++)
    3535            {
    36               rat_gpr [i][j][0] = 0;
     36              rat_gpr_not_speculative   [i][j][0] = 0;
     37              rat_gpr_speculative_valid [i][j][0] = false;
    3738
    3839              for (uint32_t k=1; k<_param->_nb_general_register_logic; k++)
    3940                {
    40                   rat_gpr             [i][j][k] = gpr++;
    41 //                rat_gpr_update_table[i][j][k] = 0;
     41                  rat_gpr_not_speculative    [i][j][k] = gpr++;
     42//                rat_gpr_speculative        [i][j][k] = gpr++;
     43                  rat_gpr_speculative_valid  [i][j][k] = false;
     44//                rat_gpr_update_table       [i][j][k] = false;
    4245                }
    4346              for (uint32_t k=0; k<_param->_nb_special_register_logic; k++)
    4447                {
    45                   rat_spr             [i][j][k] = spr++;
    46 //                rat_spr_update_table[i][j][k] = 0;
     48                  rat_spr_not_speculative    [i][j][k] = spr++;
     49//                rat_spr_speculative        [i][j][k] = spr++;
     50                  rat_spr_speculative_valid  [i][j][k] = false;
     51//                rat_spr_update_table       [i][j][k] = false;
    4752                }
    4853            }
     
    5358
    5459        // =====================================================
     60        // ====[ RETIRE_EVENT ]=================================
     61        // =====================================================
     62        for (uint32_t i=0; i<_param->_nb_front_end; ++i)
     63          for (uint32_t j=0; j<_param->_nb_context[i]; ++j)
     64            if (PORT_READ(in_RETIRE_EVENT_VAL [i][j]) and internal_RETIRE_EVENT_ACK [i][j])
     65              // Test if event have just occure
     66              if (PORT_READ(in_RETIRE_EVENT_STATE [i][j]) == EVENT_STATE_EVENT)
     67                {
     68                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * Reset Update Table");
     69                 
     70                  // Reset update_table and validity table
     71                  for (uint32_t k=0; k<_param->_nb_general_register_logic; k++)
     72                    {
     73                      rat_gpr_update_table      [i][j][k] = false;
     74                      rat_gpr_speculative_valid [i][j][k] = false;
     75                    }
     76                  for (uint32_t k=0; k<_param->_nb_special_register_logic; k++)
     77                    {
     78                      rat_spr_update_table      [i][j][k] = false;
     79                      rat_spr_speculative_valid [i][j][k] = false;
     80                    }
     81                }
     82
     83        // =====================================================
    5584        // ====[ INSERT ]=======================================
    5685        // =====================================================
    5786        // First : interface insert
     87        // this instruction is speculative !!!
    5888        for (uint32_t i=0; i<_param->_nb_inst_insert; i++)
    5989          // Test transaction
     
    6494              Tcontext_t front_end_id = (_param->_have_port_front_end_id)?PORT_READ(in_RENAME_FRONT_END_ID [i]):0;
    6595              Tcontext_t context_id   = (_param->_have_port_context_id  )?PORT_READ(in_RENAME_CONTEXT_ID   [i]):0;
    66 
    67               log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * front_end      : %d",front_end_id);
    68               log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * context        : %d",context_id);
     96              Tcontrol_t write_rd     = PORT_READ(in_INSERT_WRITE_RD [i]);
     97              Tcontrol_t write_re     = PORT_READ(in_INSERT_WRITE_RE [i]);
     98
     99              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * front_end          : %d",front_end_id);
     100              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * context            : %d",context_id);
    69101             
    70               // Test if write
    71               log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * write_rd       : %d",PORT_READ(in_INSERT_WRITE_RD [i]));
    72               if (PORT_READ(in_INSERT_WRITE_RD [i]) == 1)
    73                 {
    74                   log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_rd_phy : %d",PORT_READ(in_INSERT_NUM_REG_RD_PHY [i]));
    75                   rat_gpr[front_end_id][context_id][PORT_READ(in_INSERT_NUM_REG_RD_LOG [i])] = PORT_READ(in_INSERT_NUM_REG_RD_PHY [i]);
    76                 }
    77 
    78               log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * write_re       : %d",PORT_READ(in_INSERT_WRITE_RE [i]));
    79               if (PORT_READ(in_INSERT_WRITE_RE [i]) == 1)
    80                 {
    81                   log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_re_phy : %d",PORT_READ(in_INSERT_NUM_REG_RE_PHY [i]));
    82                   rat_spr[front_end_id][context_id][PORT_READ(in_INSERT_NUM_REG_RE_LOG [i])] = PORT_READ(in_INSERT_NUM_REG_RE_PHY [i]);
     102              // Test if write and modifie RAT
     103              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * write_rd           : %d",write_rd);
     104              if (write_rd == 1)
     105                {
     106                  Tgeneral_address_t num_reg_rd_log = PORT_READ(in_INSERT_NUM_REG_RD_LOG [i]);
     107                  Tgeneral_address_t num_reg_rd_phy = PORT_READ(in_INSERT_NUM_REG_RD_PHY [i]);
     108
     109                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_rd_log     : %d",num_reg_rd_log);
     110                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_rd_phy     : %d",num_reg_rd_phy);
     111
     112                  rat_gpr_speculative       [front_end_id][context_id][num_reg_rd_log] = num_reg_rd_phy;
     113                  rat_gpr_speculative_valid [front_end_id][context_id][num_reg_rd_log] = true;
     114                }
     115
     116              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * write_re           : %d",write_re);
     117              if (write_re == 1)
     118                {
     119                  Tspecial_address_t num_reg_re_log = PORT_READ(in_INSERT_NUM_REG_RE_LOG [i]);
     120                  Tspecial_address_t num_reg_re_phy = PORT_READ(in_INSERT_NUM_REG_RE_PHY [i]);
     121
     122                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_re_log     : %d",num_reg_re_log);
     123                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_re_phy     : %d",num_reg_re_phy);
     124
     125                  rat_spr_speculative       [front_end_id][context_id][num_reg_re_log] = num_reg_re_phy;
     126                  rat_spr_speculative_valid [front_end_id][context_id][num_reg_re_log] = true;
    83127                }
    84128            }
    85 
    86         // =====================================================
    87         // ====[ RETIRE_EVENT ]=================================
    88         // =====================================================
    89         for (uint32_t i=0; i<_param->_nb_front_end; ++i)
    90           for (uint32_t j=0; j<_param->_nb_context[i]; ++j)
    91             if (PORT_READ(in_RETIRE_EVENT_VAL [i][j]) and internal_RETIRE_EVENT_ACK [i][j])
    92               // Test if event have just occure
    93               if (PORT_READ(in_RETIRE_EVENT_STATE [i][j]) == EVENT_STATE_EVENT)
    94                 {
    95                   log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * Reset Update Table");
    96                  
    97                   // Reset update_table
    98                   for (uint32_t k=0; k<_param->_nb_general_register_logic; k++)
    99                     rat_gpr_update_table [i][j][k] = 0;
    100                   for (uint32_t k=0; k<_param->_nb_special_register_logic; k++)
    101                     rat_spr_update_table [i][j][k] = 0;
    102                 }
    103129
    104130        // =====================================================
     
    117143              // the retire interface became of the Re Order Buffer, also is in program sequence !
    118144
    119               Tcontext_t         front_end_id = (_param->_have_port_front_end_id)?PORT_READ(in_RETIRE_FRONT_END_ID [i]):0;
    120               Tcontext_t         context_id   = (_param->_have_port_context_id  )?PORT_READ(in_RETIRE_CONTEXT_ID   [i]):0;
    121               Tevent_state_t     event_state  = PORT_READ(in_RETIRE_EVENT_STATE [front_end_id][context_id]);
    122 
    123               log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * front_end_id : %d",front_end_id);
    124               log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * context_id   : %d",context_id);
    125               log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * event_state  : %d",event_state);
    126 
    127 //            if (event_state != EVENT_STATE_NO_EVENT)
    128 //              {
    129                   // Test if write and have not a previous update
    130                   if (PORT_READ(in_RETIRE_WRITE_RD [i]) == 1)
    131                     {
    132                       Tgeneral_address_t rd_log = PORT_READ(in_RETIRE_NUM_REG_RD_LOG [i]);
     145              Tcontext_t front_end_id = (_param->_have_port_front_end_id)?PORT_READ(in_RETIRE_FRONT_END_ID [i]):0;
     146              Tcontext_t context_id   = (_param->_have_port_context_id  )?PORT_READ(in_RETIRE_CONTEXT_ID   [i]):0;
     147              Tcontrol_t write_rd     = PORT_READ(in_RETIRE_WRITE_RD [i]);
     148              Tcontrol_t write_re     = PORT_READ(in_RETIRE_WRITE_RE [i]);
     149              Tcontrol_t restore      = internal_RETIRE_RESTORE [i];
     150
     151              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * front_end_id       : %d",front_end_id);
     152              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * context_id         : %d",context_id  );
     153              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * restore            : %d",restore     );
     154
     155              // Test if write and have not a previous update
     156              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * write_rd           : %d",write_rd);
     157              if (PORT_READ(in_RETIRE_WRITE_RD [i]) == 1)
     158                {
     159                  Tgeneral_address_t num_reg_rd_log     = PORT_READ(in_RETIRE_NUM_REG_RD_LOG     [i]);
     160
     161                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_rd_log     : %d",num_reg_rd_log    );
     162
     163                  if (not restore)
     164                    {
     165                  Tgeneral_address_t num_reg_rd_phy_new = PORT_READ(in_RETIRE_NUM_REG_RD_PHY_NEW [i]);
     166
     167                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_rd_phy_new : %d",num_reg_rd_phy_new);
     168
     169                  rat_gpr_not_speculative [front_end_id][context_id][num_reg_rd_log] = num_reg_rd_phy_new;
     170                    }
     171
     172                  Tcontrol_t         restore_rd         = internal_RETIRE_RESTORE_RD_PHY_OLD [i];
     173                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * restore_rd         : %d",restore_rd        );
    133174                     
    134                       log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * retire RD");
    135                       log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"      * rd_log       : %d",rd_log);
    136                      
    137 // #ifdef DEBUG_TEST
    138 //                       if (not (internal_RETIRE_RESTORE_RD_PHY_OLD [i] and ( (rat_gpr_update_table [front_end_id][context_id][rd_log] == 0)) and (event_state != EVENT_STATE_NO_EVENT)))
    139 //                         throw ERRORMORPHEO(FUNCTION,toString(_("restore_rd_phy_old [%d] = %d, but rat_gpr_update_table[%d][%d][%d] = %d\n"),
    140 //                                                              i,internal_RETIRE_RESTORE_RD_PHY_OLD [i],
    141 //                                                              front_end_id,context_id,rd_log,rat_gpr_update_table [front_end_id][context_id][rd_log]));
    142 // #endif
    143 
    144                       if (internal_RETIRE_RESTORE_RD_PHY_OLD [i])
    145 //                    if (rat_gpr_update_table [front_end_id][context_id][rd_log] == 0)
    146                         {                     
    147                           rat_gpr              [front_end_id][context_id][rd_log] = PORT_READ(in_RETIRE_NUM_REG_RD_PHY_OLD [i]);
    148                           rat_gpr_update_table [front_end_id][context_id][rd_log] = 1;
    149                         }
    150                     }
    151 
    152                   if (PORT_READ(in_RETIRE_WRITE_RE [i]) == 1)
    153                     {
    154                       Tspecial_address_t re_log = PORT_READ(in_RETIRE_NUM_REG_RE_LOG [i]);
    155 
    156                       log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * retire RE");
    157                       log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"      * re_log       : %d",re_log);
    158 
    159 // #ifdef DEBUG_TEST
    160 //                       if (not (internal_RETIRE_RESTORE_RE_PHY_OLD [i] and ((rat_spr_update_table [front_end_id][context_id][re_log] == 0) and (event_state != EVENT_STATE_NO_EVENT))))
    161 //                         throw ERRORMORPHEO(FUNCTION,toString(_("restore_re_phy_old [%d] = %d, but rat_spr_update_table[%d][%d][%d] = %d\n"),
    162 //                                                              i,internal_RETIRE_RESTORE_RE_PHY_OLD [i],
    163 //                                                              front_end_id,context_id,re_log,rat_spr_update_table [front_end_id][context_id][re_log]));
    164 // #endif
    165 
    166                       if (internal_RETIRE_RESTORE_RE_PHY_OLD [i])
    167 //                    if (rat_spr_update_table [front_end_id][context_id][re_log] == 0)
    168                         {                     
    169                           rat_spr              [front_end_id][context_id][re_log] = PORT_READ(in_RETIRE_NUM_REG_RE_PHY_OLD [i]);
    170                           rat_spr_update_table [front_end_id][context_id][re_log] = 1;
    171                         }
    172                     }
    173 //              }
     175                  if (restore_rd)
     176                  rat_gpr_update_table    [front_end_id][context_id][num_reg_rd_log] = true;
     177                }
     178
     179              log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * write_re           : %d",write_re);
     180              if (PORT_READ(in_RETIRE_WRITE_RE [i]) == 1)
     181                {
     182                  Tspecial_address_t num_reg_re_log     = PORT_READ(in_RETIRE_NUM_REG_RE_LOG     [i]);
     183
     184                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_re_log     : %d",num_reg_re_log    );
     185
     186                  if (not restore)
     187                    {
     188                  Tspecial_address_t num_reg_re_phy_new = PORT_READ(in_RETIRE_NUM_REG_RE_PHY_NEW [i]);
     189
     190                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * num_reg_re_phy_new : %d",num_reg_re_phy_new);
     191
     192                  rat_spr_not_speculative [front_end_id][context_id][num_reg_re_log] = num_reg_re_phy_new;
     193                    }
     194
     195                  Tcontrol_t         restore_re         = internal_RETIRE_RESTORE_RE_PHY_OLD [i];
     196                  log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"    * restore_re         : %d",restore_re        );
     197                     
     198                  if (restore_re)
     199                  rat_spr_update_table    [front_end_id][context_id][num_reg_re_log] = true;
     200                }
     201
    174202            }
    175203      }
     
    194222                      break;
    195223                    else
    196                       str+=toString("GPR[%.4d] - %.5d %.1d | ",index,rat_gpr[i][j][index],rat_gpr_update_table[i][j][index]);
     224                      str+=toString("GPR[%.4d] - %.1d %.5d (%.5d) %.1d | ",index,rat_gpr_speculative_valid [i][j][index],rat_gpr_speculative [i][j][index],rat_gpr_not_speculative [i][j][index],rat_gpr_update_table[i][j][index]);
    197225                  }
    198226                log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"      * %s",str.c_str());
     
    209237                      break;
    210238                    else
    211                       str+=toString("SPR[%.4d] - %.5d %.1d | ",index,rat_spr[i][j][index],rat_spr_update_table[i][j][index]);
     239                      str+=toString("SPR[%.4d] - %.1d %.5d (%.5d) %.1d | ",index,rat_spr_speculative_valid [i][j][index],rat_spr_speculative [i][j][index],rat_spr_not_speculative [i][j][index],rat_spr_update_table[i][j][index]);
    212240                  }
    213241                log_printf(TRACE,Register_Address_Translation_unit,FUNCTION,"      * %s",str.c_str());
     
    218246
    219247#ifdef DEBUG_TEST
    220         if (1)
     248# if 1
     249    {
     250      for (uint32_t i=0; i<_param->_nb_front_end; ++i)
     251        for (uint32_t j=0; j<_param->_nb_context[i]; ++j)
    221252          {
    222             for (uint32_t i=0; i<_param->_nb_front_end; ++i)
    223               for (uint32_t j=0; j<_param->_nb_context[i]; ++j)
    224                 {
    225                   for (uint32_t x=0; x<_param->_nb_general_register_logic; ++x)
    226                     for (uint32_t y=x+1; y<_param->_nb_general_register_logic; ++y)
    227                       if (rat_gpr[i][j][x] == rat_gpr[i][j][y])
    228                         throw ERRORMORPHEO (FUNCTION,toString(_("In RAT, rat_gpr[%d][%d][%d] == rat_gpr[%d][%d][%d] == %d"),i,j,x,i,j,y,rat_gpr[i][j][x]));
    229                   for (uint32_t x=0; x<_param->_nb_special_register_logic; ++x)
    230                     for (uint32_t y=x+1; y<_param->_nb_special_register_logic; ++y)
    231                       if (rat_spr[i][j][x] == rat_spr[i][j][y])
    232                         throw ERRORMORPHEO (FUNCTION,toString(_("In RAT, rat_spr[%d][%d][%d] == rat_spr[%d][%d][%d] == %d"),i,j,x,i,j,y,rat_spr[i][j][x]));
    233                 }
    234 
     253            for (uint32_t x=0; x<_param->_nb_general_register_logic; ++x)
     254              for (uint32_t y=x+1; y<_param->_nb_general_register_logic; ++y)
     255                {
     256                  if (rat_gpr_speculative_valid [i][j][x] and
     257                      rat_gpr_speculative_valid [i][j][y] and
     258                      (rat_gpr_speculative[i][j][x] == rat_gpr_speculative[i][j][y]))
     259                    throw ERRORMORPHEO (FUNCTION,toString(_("In RAT, rat_gpr_speculative[%d][%d][%d] == rat_gpr_speculative[%d][%d][%d] == %d"),i,j,x,i,j,y,rat_gpr_speculative[i][j][x]));
     260                  if (rat_gpr_not_speculative[i][j][x] == rat_gpr_not_speculative[i][j][y])
     261                    throw ERRORMORPHEO (FUNCTION,toString(_("In RAT, rat_gpr_not_speculative[%d][%d][%d] == rat_gpr_not_speculative[%d][%d][%d] == %d"),i,j,x,i,j,y,rat_gpr_not_speculative[i][j][x]));
     262                 
     263                }
     264            for (uint32_t x=0; x<_param->_nb_special_register_logic; ++x)
     265              for (uint32_t y=x+1; y<_param->_nb_special_register_logic; ++y)
     266                {
     267                  if(rat_spr_speculative_valid [i][j][x] and
     268                     rat_spr_speculative_valid [i][j][y] and
     269                     (rat_spr_speculative[i][j][x] == rat_spr_speculative[i][j][y]))
     270                    throw ERRORMORPHEO (FUNCTION,toString(_("In RAT, rat_spr_speculative[%d][%d][%d] == rat_spr_speculative[%d][%d][%d] == %d"),i,j,x,i,j,y,rat_spr_speculative[i][j][x]));
     271                  if (rat_spr_not_speculative[i][j][x] == rat_spr_not_speculative[i][j][y])
     272                    throw ERRORMORPHEO (FUNCTION,toString(_("In RAT, rat_spr_not_speculative[%d][%d][%d] == rat_spr_not_speculative[%d][%d][%d] == %d"),i,j,x,i,j,y,rat_spr_not_speculative[i][j][x]));
     273                 
     274                }
    235275          }
     276     
     277    }
     278# endif
    236279#endif
    237280
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/src/Register_translation_unit_allocation.cpp

    r121 r122  
    361361          PORT_MAP(_component,src , "in_RETIRE_"+toString(i)+"_NUM_REG_RE_LOG"    ,
    362362                              dest, "in_RETIRE_"+toString(i)+"_NUM_REG_RE_LOG"    );
    363           PORT_MAP(_component,src , "in_RETIRE_"+toString(i)+"_NUM_REG_RD_PHY_OLD",
    364                               dest, "in_RETIRE_"+toString(i)+"_NUM_REG_RD_PHY_OLD");
    365           PORT_MAP(_component,src , "in_RETIRE_"+toString(i)+"_NUM_REG_RE_PHY_OLD",
    366                               dest, "in_RETIRE_"+toString(i)+"_NUM_REG_RE_PHY_OLD");
     363          PORT_MAP(_component,src , "in_RETIRE_"+toString(i)+"_NUM_REG_RD_PHY_NEW",
     364                              dest, "in_RETIRE_"+toString(i)+"_NUM_REG_RD_PHY_NEW");
     365          PORT_MAP(_component,src , "in_RETIRE_"+toString(i)+"_NUM_REG_RE_PHY_NEW",
     366                              dest, "in_RETIRE_"+toString(i)+"_NUM_REG_RE_PHY_NEW");
    367367
    368368          dest = _name+"_register_translation_unit_glue";
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Rename_select/include/Rename_select.h

    r108 r122  
    125125
    126126    // ~~~~~[ Interface "retire_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    127   public    : SC_IN (Tevent_state_t    )  ***  in_RETIRE_EVENT_STATE      ;//[nb_front_end][nb_context]
     127  public    : SC_IN (Tcontrol_t        )  ***  in_RETIRE_EVENT_FLUSH      ;//[nb_front_end][nb_context]
     128  public    : SC_IN (Tcontrol_t        )  ***  in_RETIRE_EVENT_STOP       ;//[nb_front_end][nb_context]
    128129
    129130    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Rename_select/src/Rename_select.cpp

    r111 r122  
    125125        for (uint32_t i=0; i<_param->_nb_front_end; i++)
    126126          for (uint32_t j=0; j<_param->_nb_context [i]; j++)
    127             sensitive << (*(in_RETIRE_EVENT_STATE [i][j]));
     127            sensitive << (*(in_RETIRE_EVENT_FLUSH [i][j]))
     128                      << (*(in_RETIRE_EVENT_STOP  [i][j]));
    128129
    129130        for (uint32_t i=0; i<_param->_nb_inst_rename; i++)
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Rename_select/src/Rename_select_allocation.cpp

    r112 r122  
    130130      ALLOC2_INTERFACE_BEGIN("retire_event", IN,NORTH, _("Retire event"), _param->_nb_front_end, _param->_nb_context[it1]);
    131131
    132       _ALLOC2_SIGNAL_IN ( in_RETIRE_EVENT_STATE         ,"state"                ,Tevent_state_t    ,_param->_size_event_state, _param->_nb_front_end, _param->_nb_context[it1]);
     132      _ALLOC2_SIGNAL_IN ( in_RETIRE_EVENT_FLUSH         ,"flush"                ,Tcontrol_t        ,1                        , _param->_nb_front_end, _param->_nb_context[it1]);
     133      _ALLOC2_SIGNAL_IN ( in_RETIRE_EVENT_STOP          ,"stop"                 ,Tcontrol_t        ,1                        , _param->_nb_front_end, _param->_nb_context[it1]);
    133134
    134135      ALLOC2_INTERFACE_END(_param->_nb_front_end, _param->_nb_context[it1]);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Rename_select/src/Rename_select_deallocation.cpp

    r112 r122  
    8585        DELETE1_SIGNAL(out_RENAME_OUT_EXCEPTION     ,_param->_nb_inst_rename,_param->_size_exception             );
    8686
    87         DELETE2_SIGNAL( in_RETIRE_EVENT_STATE       ,_param->_nb_front_end, _param->_nb_context[it1],_param->_size_event_state);
     87        DELETE2_SIGNAL( in_RETIRE_EVENT_FLUSH       ,_param->_nb_front_end, _param->_nb_context[it1],1);
     88        DELETE2_SIGNAL( in_RETIRE_EVENT_STOP        ,_param->_nb_front_end, _param->_nb_context[it1],1);
    8889      }
    8990
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Rename_select/src/Rename_select_genMealy.cpp

    r115 r122  
    1717namespace rename_select {
    1818
     19// #define CONTINUE_ON_EVENT_STOP
    1920
    2021#undef  FUNCTION
     
    5960                PORT_READ(in_RENAME_IN_VAL[x][y]))
    6061              {
    61                 // Find !!!
    62                 val [i]    = true;
    63                 ack [x][y] = PORT_READ(in_RENAME_OUT_ACK [i]);
    6462
    6563                log_printf(TRACE,Rename_select,FUNCTION,"      * in_RENAME_OUT_ACK    : %d",PORT_READ(in_RENAME_OUT_ACK[i]));
    6664                Tcontext_t front_end_id = (_param->_have_port_front_end_id)?PORT_READ(in_RENAME_IN_FRONT_END_ID [x][y]):0;
    6765                Tcontext_t context_id   = (_param->_have_port_context_id  )?PORT_READ(in_RENAME_IN_CONTEXT_ID   [x][y]):0;
     66                Tcontrol_t stop         = PORT_READ(in_RETIRE_EVENT_STOP  [x][context_id]);
    6867
    6968                log_printf(TRACE,Rename_select,FUNCTION,"      * front_end_id         : %d",front_end_id);
    7069                log_printf(TRACE,Rename_select,FUNCTION,"      * context_id           : %d",context_id);
     70                log_printf(TRACE,Rename_select,FUNCTION,"      * stop                 : %d",stop);
    7171               
    7272                // Test if ROB is Flushed
    73                 Tevent_state_t event_state         = PORT_READ(in_RETIRE_EVENT_STATE [x][context_id]);
    74                 Tcontrol_t     have_event          = (event_state != EVENT_STATE_NO_EVENT);
    75                 Tcontrol_t     can_register_access = not have_event;
    76                 Tcontrol_t     no_execute          = (PORT_READ(in_RENAME_IN_NO_EXECUTE [x][y]) or have_event);
    77                 Tcontrol_t     read_ra             = (PORT_READ(in_RENAME_IN_READ_RA    [x][y]) and can_register_access);
    78                 Tcontrol_t     read_rb             = (PORT_READ(in_RENAME_IN_READ_RB    [x][y]) and can_register_access);
    79                 Tcontrol_t     read_rc             = (PORT_READ(in_RENAME_IN_READ_RC    [x][y]) and can_register_access);
    80                 Tcontrol_t     write_rd            = (PORT_READ(in_RENAME_IN_WRITE_RD   [x][y]) and can_register_access);
    81                 Tcontrol_t     write_re            = (PORT_READ(in_RENAME_IN_WRITE_RE   [x][y]) and can_register_access);
    82 //              Tcontrol_t     read_ra             = (PORT_READ(in_RENAME_IN_READ_RA    [x][y]));
    83 //              Tcontrol_t     read_rb             = (PORT_READ(in_RENAME_IN_READ_RB    [x][y]));
    84 //              Tcontrol_t     read_rc             = (PORT_READ(in_RENAME_IN_READ_RC    [x][y]));
    85 //              Tcontrol_t     write_rd            = (PORT_READ(in_RENAME_IN_WRITE_RD   [x][y]));
    86 //              Tcontrol_t     write_re            = (PORT_READ(in_RENAME_IN_WRITE_RE   [x][y]));
    87 
    88                 log_printf(TRACE,Rename_select,FUNCTION,"      * event_state          : %d",event_state);
    89                 log_printf(TRACE,Rename_select,FUNCTION,"      * no_execute (before)  : %d",PORT_READ(in_RENAME_IN_NO_EXECUTE [x][y]));
    90                 log_printf(TRACE,Rename_select,FUNCTION,"      * no_execute (after)   : %d",no_execute);
    91 
    92                 if (_param->_have_port_front_end_id)
    93                 PORT_WRITE(out_RENAME_OUT_FRONT_END_ID [i],front_end_id);
    94                 if (_param->_have_port_context_id)
    95                 PORT_WRITE(out_RENAME_OUT_CONTEXT_ID   [i],context_id);
    96                 if (_param->_have_port_depth)
    97                 PORT_WRITE(out_RENAME_OUT_DEPTH        [i],PORT_READ(in_RENAME_IN_DEPTH         [x][y]));
    98                 PORT_WRITE(out_RENAME_OUT_TYPE         [i],PORT_READ(in_RENAME_IN_TYPE          [x][y]));
    99                 PORT_WRITE(out_RENAME_OUT_OPERATION    [i],PORT_READ(in_RENAME_IN_OPERATION     [x][y]));
    100                 PORT_WRITE(out_RENAME_OUT_NO_EXECUTE   [i],no_execute);
    101                 PORT_WRITE(out_RENAME_OUT_IS_DELAY_SLOT[i],PORT_READ(in_RENAME_IN_IS_DELAY_SLOT [x][y]));
    102 #ifdef DEBUG
    103                 PORT_WRITE(out_RENAME_OUT_ADDRESS      [i],PORT_READ(in_RENAME_IN_ADDRESS       [x][y]));
     73#ifndef CONTINUE_ON_EVENT_STOP
     74                if (not stop)
    10475#endif
    105                 PORT_WRITE(out_RENAME_OUT_ADDRESS_NEXT [i],PORT_READ(in_RENAME_IN_ADDRESS_NEXT  [x][y]));
    106                 PORT_WRITE(out_RENAME_OUT_HAS_IMMEDIAT [i],PORT_READ(in_RENAME_IN_HAS_IMMEDIAT  [x][y]));
    107                 PORT_WRITE(out_RENAME_OUT_IMMEDIAT     [i],PORT_READ(in_RENAME_IN_IMMEDIAT      [x][y]));
    108                 PORT_WRITE(out_RENAME_OUT_READ_RA      [i],read_ra);
    109                 PORT_WRITE(out_RENAME_OUT_NUM_REG_RA   [i],PORT_READ(in_RENAME_IN_NUM_REG_RA    [x][y]));
    110                 PORT_WRITE(out_RENAME_OUT_READ_RB      [i],read_rb);
    111                 PORT_WRITE(out_RENAME_OUT_NUM_REG_RB   [i],PORT_READ(in_RENAME_IN_NUM_REG_RB    [x][y]));
    112                 PORT_WRITE(out_RENAME_OUT_READ_RC      [i],read_rc);
    113                 PORT_WRITE(out_RENAME_OUT_NUM_REG_RC   [i],PORT_READ(in_RENAME_IN_NUM_REG_RC    [x][y]));
    114                 PORT_WRITE(out_RENAME_OUT_WRITE_RD     [i],write_rd);
    115                 PORT_WRITE(out_RENAME_OUT_NUM_REG_RD   [i],PORT_READ(in_RENAME_IN_NUM_REG_RD    [x][y]));
    116                 PORT_WRITE(out_RENAME_OUT_WRITE_RE     [i],write_re);
    117                 PORT_WRITE(out_RENAME_OUT_NUM_REG_RE   [i],PORT_READ(in_RENAME_IN_NUM_REG_RE    [x][y]));
    118                 PORT_WRITE(out_RENAME_OUT_EXCEPTION_USE[i],PORT_READ(in_RENAME_IN_EXCEPTION_USE [x][y]));
    119                 PORT_WRITE(out_RENAME_OUT_EXCEPTION    [i],PORT_READ(in_RENAME_IN_EXCEPTION     [x][y]));
     76                  {
     77                    // Find !!!
     78                    val [i]    = true;
     79                    ack [x][y] = PORT_READ(in_RENAME_OUT_ACK [i]);
     80                   
     81                    Tcontrol_t     have_event          = (PORT_READ(in_RETIRE_EVENT_FLUSH [x][context_id])
     82#ifdef CONTINUE_ON_EVENT_STOP
     83                                                          or stop
     84#endif
     85                                                          );
     86                    Tcontrol_t     can_register_access = not have_event;
     87                    Tcontrol_t     no_execute          = (PORT_READ(in_RENAME_IN_NO_EXECUTE [x][y]) or have_event);
     88                    Tcontrol_t     read_ra             = (PORT_READ(in_RENAME_IN_READ_RA    [x][y]) and can_register_access);
     89                    Tcontrol_t     read_rb             = (PORT_READ(in_RENAME_IN_READ_RB    [x][y]) and can_register_access);
     90                    Tcontrol_t     read_rc             = (PORT_READ(in_RENAME_IN_READ_RC    [x][y]) and can_register_access);
     91                    Tcontrol_t     write_rd            = (PORT_READ(in_RENAME_IN_WRITE_RD   [x][y]) and can_register_access);
     92                    Tcontrol_t     write_re            = (PORT_READ(in_RENAME_IN_WRITE_RE   [x][y]) and can_register_access);
     93//                  Tcontrol_t     read_ra             = (PORT_READ(in_RENAME_IN_READ_RA    [x][y]));
     94//                  Tcontrol_t     read_rb             = (PORT_READ(in_RENAME_IN_READ_RB    [x][y]));
     95//                  Tcontrol_t     read_rc             = (PORT_READ(in_RENAME_IN_READ_RC    [x][y]));
     96//                  Tcontrol_t     write_rd            = (PORT_READ(in_RENAME_IN_WRITE_RD   [x][y]));
     97//                  Tcontrol_t     write_re            = (PORT_READ(in_RENAME_IN_WRITE_RE   [x][y]));
     98                   
     99                    log_printf(TRACE,Rename_select,FUNCTION,"      * have_event           : %d",have_event);
     100                    log_printf(TRACE,Rename_select,FUNCTION,"      * no_execute (before)  : %d",PORT_READ(in_RENAME_IN_NO_EXECUTE [x][y]));
     101                    log_printf(TRACE,Rename_select,FUNCTION,"      * no_execute (after)   : %d",no_execute);
     102                   
     103                    if (_param->_have_port_front_end_id)
     104                    PORT_WRITE(out_RENAME_OUT_FRONT_END_ID [i],front_end_id);
     105                    if (_param->_have_port_context_id)
     106                    PORT_WRITE(out_RENAME_OUT_CONTEXT_ID   [i],context_id);
     107                    if (_param->_have_port_depth)
     108                    PORT_WRITE(out_RENAME_OUT_DEPTH        [i],PORT_READ(in_RENAME_IN_DEPTH         [x][y]));
     109                    PORT_WRITE(out_RENAME_OUT_TYPE         [i],PORT_READ(in_RENAME_IN_TYPE          [x][y]));
     110                    PORT_WRITE(out_RENAME_OUT_OPERATION    [i],PORT_READ(in_RENAME_IN_OPERATION     [x][y]));
     111                    PORT_WRITE(out_RENAME_OUT_NO_EXECUTE   [i],no_execute);
     112                    PORT_WRITE(out_RENAME_OUT_IS_DELAY_SLOT[i],PORT_READ(in_RENAME_IN_IS_DELAY_SLOT [x][y]));
     113#ifdef DEBUG       
     114                    PORT_WRITE(out_RENAME_OUT_ADDRESS      [i],PORT_READ(in_RENAME_IN_ADDRESS       [x][y]));
     115#endif             
     116                    PORT_WRITE(out_RENAME_OUT_ADDRESS_NEXT [i],PORT_READ(in_RENAME_IN_ADDRESS_NEXT  [x][y]));
     117                    PORT_WRITE(out_RENAME_OUT_HAS_IMMEDIAT [i],PORT_READ(in_RENAME_IN_HAS_IMMEDIAT  [x][y]));
     118                    PORT_WRITE(out_RENAME_OUT_IMMEDIAT     [i],PORT_READ(in_RENAME_IN_IMMEDIAT      [x][y]));
     119                    PORT_WRITE(out_RENAME_OUT_READ_RA      [i],read_ra);
     120                    PORT_WRITE(out_RENAME_OUT_NUM_REG_RA   [i],PORT_READ(in_RENAME_IN_NUM_REG_RA    [x][y]));
     121                    PORT_WRITE(out_RENAME_OUT_READ_RB      [i],read_rb);
     122                    PORT_WRITE(out_RENAME_OUT_NUM_REG_RB   [i],PORT_READ(in_RENAME_IN_NUM_REG_RB    [x][y]));
     123                    PORT_WRITE(out_RENAME_OUT_READ_RC      [i],read_rc);
     124                    PORT_WRITE(out_RENAME_OUT_NUM_REG_RC   [i],PORT_READ(in_RENAME_IN_NUM_REG_RC    [x][y]));
     125                    PORT_WRITE(out_RENAME_OUT_WRITE_RD     [i],write_rd);
     126                    PORT_WRITE(out_RENAME_OUT_NUM_REG_RD   [i],PORT_READ(in_RENAME_IN_NUM_REG_RD    [x][y]));
     127                    PORT_WRITE(out_RENAME_OUT_WRITE_RE     [i],write_re);
     128                    PORT_WRITE(out_RENAME_OUT_NUM_REG_RE   [i],PORT_READ(in_RENAME_IN_NUM_REG_RE    [x][y]));
     129                    PORT_WRITE(out_RENAME_OUT_EXCEPTION_USE[i],PORT_READ(in_RENAME_IN_EXCEPTION_USE [x][y]));
     130                    PORT_WRITE(out_RENAME_OUT_EXCEPTION    [i],PORT_READ(in_RENAME_IN_EXCEPTION     [x][y]));
     131                  }
    120132              }
    121133
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Rename_unit_Glue/include/Rename_unit_Glue.h

    r115 r122  
    107107  public    : SC_OUT(Tcontrol_t        )   ** out_RETIRE_LOAD_STORE_QUEUE_POINTER_VAL           ;//[nb_inst_retire]
    108108  public    : SC_IN (Tcontrol_t        )   **  in_RETIRE_LOAD_STORE_QUEUE_POINTER_ACK           ;//[nb_inst_retire]
    109 //public    : SC_OUT(Ttype_t           )   ** out_RETIRE_LOAD_STORE_QUEUE_POINTER_TYPE          ;//[nb_inst_retire]
    110 //public    : SC_OUT(Toperation_t      )   ** out_RETIRE_LOAD_STORE_QUEUE_POINTER_OPERATION     ;//[nb_inst_retire]
    111109                                                                                               
    112110  public    : SC_OUT(Tcontrol_t        )   ** out_RETIRE_REGISTER_TRANSLATION_VAL               ;//[nb_inst_retire]
    113111  public    : SC_IN (Tcontrol_t        )   **  in_RETIRE_REGISTER_TRANSLATION_ACK               ;//[nb_inst_retire]
     112
     113    // ~~~~~[ Interface : "retire_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     114  public    : SC_IN (Tcontrol_t        )  ***  in_RETIRE_EVENT_VAL                              ;//[nb_front_end][nb_context]
     115  public    : SC_OUT(Tcontrol_t        )  *** out_RETIRE_EVENT_ACK                              ;//[nb_front_end][nb_context]
    114116                                                                                               
     117  public    : SC_OUT(Tcontrol_t        )  *** out_RETIRE_EVENT_LOAD_STORE_QUEUE_POINTER_VAL     ;//[nb_front_end][nb_context]
     118  public    : SC_IN (Tcontrol_t        )  ***  in_RETIRE_EVENT_LOAD_STORE_QUEUE_POINTER_ACK     ;//[nb_front_end][nb_context]
     119                                                                                               
     120  public    : SC_OUT(Tcontrol_t        )  *** out_RETIRE_EVENT_REGISTER_TRANSLATION_VAL         ;//[nb_front_end][nb_context]
     121  public    : SC_IN (Tcontrol_t        )  ***  in_RETIRE_EVENT_REGISTER_TRANSLATION_ACK         ;//[nb_front_end][nb_context]
     122
    115123    // ~~~~~[ Interface : "spr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                     
    116124  public    : SC_IN (Tspr_t            )  ***  in_SPR_READ_SR                                   ;//[nb_front_end][nb_context]
     
    153161                                               
    154162#ifdef SYSTEMC                                 
    155   public  : void        transition                (void);
    156 //public  : void        genMoore                  (void);
    157   public  : void        genMealy_insert_valack    (void);
    158   public  : void        genMealy_retire_valack    (void);
    159   public  : void        genMealy_insert           (void);
     163  public  : void        transition                   (void);
     164//public  : void        genMoore                     (void);
     165  public  : void        genMealy_insert_valack       (void);
     166  public  : void        genMealy_retire_valack       (void);
     167  public  : void        genMealy_retire_event_valack (void);
     168  public  : void        genMealy_insert              (void);
    160169#endif                                         
    161170
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Rename_unit_Glue/src/Rename_unit_Glue.cpp

    r115 r122  
    126126            << (*(in_RETIRE_REGISTER_TRANSLATION_ACK     [i]))
    127127            ;
     128
     129# ifdef SYSTEMCASS_SPECIFIC
     130        // List dependency information
     131# endif   
     132
     133        log_printf(INFO,Rename_unit_Glue,FUNCTION,_("<%s> : Method - genMealy_retire_event_valack"),_name.c_str());
     134
     135        SC_METHOD (genMealy_retire_event_valack);
     136        dont_initialize ();
     137//      sensitive << (*(in_CLOCK)).neg(); // don't need internal register
     138        for (uint32_t i=0; i<_param->_nb_front_end; i++)
     139          for (uint32_t j=0; j<_param->_nb_context[i]; j++)
     140            sensitive
     141              << (*(in_RETIRE_EVENT_VAL                          [i][j]))
     142              << (*(in_RETIRE_EVENT_LOAD_STORE_QUEUE_POINTER_ACK [i][j]))
     143              << (*(in_RETIRE_EVENT_REGISTER_TRANSLATION_ACK     [i][j]))
     144              ;
    128145
    129146# ifdef SYSTEMCASS_SPECIFIC
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Rename_unit_Glue/src/Rename_unit_Glue_allocation.cpp

    r115 r122  
    115115    }
    116116
     117    // ~~~~~[ Interface : "retire_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     118    {
     119      ALLOC2_INTERFACE_BEGIN("retire_event",OUT,NORTH,_("Retire_Event interface"),_param->_nb_front_end,_param->_nb_context[it1]);
     120
     121      _ALLOC2_SIGNAL_IN ( in_RETIRE_EVENT_VAL                             ,"VAL"                                  ,Tcontrol_t        ,1,_param->_nb_front_end,_param->_nb_context[it1]);
     122      _ALLOC2_SIGNAL_OUT(out_RETIRE_EVENT_ACK                             ,"ACK"                                  ,Tcontrol_t        ,1,_param->_nb_front_end,_param->_nb_context[it1]);
     123      _ALLOC2_SIGNAL_OUT(out_RETIRE_EVENT_LOAD_STORE_QUEUE_POINTER_VAL    ,"LOAD_STORE_QUEUE_POINTER_VAL"         ,Tcontrol_t        ,1,_param->_nb_front_end,_param->_nb_context[it1]);
     124      _ALLOC2_SIGNAL_IN ( in_RETIRE_EVENT_LOAD_STORE_QUEUE_POINTER_ACK    ,"LOAD_STORE_QUEUE_POINTER_ACK"         ,Tcontrol_t        ,1,_param->_nb_front_end,_param->_nb_context[it1]);
     125      _ALLOC2_SIGNAL_OUT(out_RETIRE_EVENT_REGISTER_TRANSLATION_VAL        ,"REGISTER_TRANSLATION_VAL"             ,Tcontrol_t        ,1,_param->_nb_front_end,_param->_nb_context[it1]);
     126      _ALLOC2_SIGNAL_IN ( in_RETIRE_EVENT_REGISTER_TRANSLATION_ACK        ,"REGISTER_TRANSLATION_ACK"             ,Tcontrol_t        ,1,_param->_nb_front_end,_param->_nb_context[it1]);
     127
     128      ALLOC2_INTERFACE_END(_param->_nb_front_end,_param->_nb_context[it1]);
     129    }
     130
    117131    // ~~~~~[ Interface : "spr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    118132    {
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Rename_unit_Glue/src/Rename_unit_Glue_deallocation.cpp

    r115 r122  
    7272        DELETE1_SIGNAL(out_RETIRE_REGISTER_TRANSLATION_VAL               ,_param->_nb_inst_retire,1);
    7373        DELETE1_SIGNAL( in_RETIRE_REGISTER_TRANSLATION_ACK               ,_param->_nb_inst_retire,1);
     74
     75        DELETE2_SIGNAL( in_RETIRE_EVENT_VAL                              ,_param->_nb_front_end,_param->_nb_context[it1],1);
     76        DELETE2_SIGNAL(out_RETIRE_EVENT_ACK                              ,_param->_nb_front_end,_param->_nb_context[it1],1);
     77        DELETE2_SIGNAL(out_RETIRE_EVENT_LOAD_STORE_QUEUE_POINTER_VAL     ,_param->_nb_front_end,_param->_nb_context[it1],1);
     78        DELETE2_SIGNAL( in_RETIRE_EVENT_LOAD_STORE_QUEUE_POINTER_ACK     ,_param->_nb_front_end,_param->_nb_context[it1],1);
     79        DELETE2_SIGNAL(out_RETIRE_EVENT_REGISTER_TRANSLATION_VAL         ,_param->_nb_front_end,_param->_nb_context[it1],1);
     80        DELETE2_SIGNAL( in_RETIRE_EVENT_REGISTER_TRANSLATION_ACK         ,_param->_nb_front_end,_param->_nb_context[it1],1);
    7481                                                                         
    7582        DELETE2_SIGNAL( in_SPR_READ_SR                                   ,_param->_nb_front_end,_param->_nb_context[it1],_param->_size_spr);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/include/Rename_unit.h

    r121 r122  
    114114  public    : SC_OUT(Tgeneral_data_t   )   ** out_INSERT_IMMEDIAT             ;//[nb_inst_insert]
    115115  public    : SC_OUT(Tlsq_ptr_t        )   ** out_INSERT_STORE_QUEUE_PTR_WRITE;//[nb_inst_insert]
     116  public    : SC_OUT(Tlsq_ptr_t        )   ** out_INSERT_STORE_QUEUE_PTR_READ ;//[nb_inst_insert]
     117  public    : SC_OUT(Tcontrol_t        )   ** out_INSERT_STORE_QUEUE_EMPTY    ;//[nb_inst_insert]
    116118  public    : SC_OUT(Tlsq_ptr_t        )   ** out_INSERT_LOAD_QUEUE_PTR_WRITE ;//[nb_inst_insert]
    117119  public    : SC_OUT(Tcontrol_t        )   ** out_INSERT_READ_RA              ;//[nb_inst_insert]
     
    171173  public    : SC_OUT(Tcontrol_t        )  *** out_RETIRE_EVENT_ACK            ;//[nb_front_end][nb_context]
    172174  public    : SC_IN (Tevent_state_t    )  ***  in_RETIRE_EVENT_STATE          ;//[nb_front_end][nb_context]
     175  public    : SC_IN (Tcontrol_t        )  ***  in_RETIRE_EVENT_FLUSH          ;//[nb_front_end][nb_context]
     176  public    : SC_IN (Tcontrol_t        )  ***  in_RETIRE_EVENT_STOP           ;//[nb_front_end][nb_context]
    173177
    174178    // ~~~~~[ Interface : "spr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/src/Rename_unit_allocation.cpp

    r121 r122  
    111111      ALLOC1_SIGNAL_OUT(out_INSERT_IMMEDIAT             ,"immediat"             ,Tgeneral_data_t   ,_param->_size_general_data          );
    112112      ALLOC1_SIGNAL_OUT(out_INSERT_STORE_QUEUE_PTR_WRITE,"store_queue_ptr_write",Tlsq_ptr_t        ,_param->_size_store_queue_ptr       );
     113      ALLOC1_SIGNAL_OUT(out_INSERT_STORE_QUEUE_PTR_READ ,"store_queue_ptr_read" ,Tlsq_ptr_t        ,_param->_size_store_queue_ptr       );
     114      ALLOC1_SIGNAL_OUT(out_INSERT_STORE_QUEUE_EMPTY    ,"store_queue_empty"    ,Tcontrol_t        ,1                                   );
    113115      ALLOC1_SIGNAL_OUT(out_INSERT_LOAD_QUEUE_PTR_WRITE ,"load_queue_ptr_write" ,Tlsq_ptr_t        ,_param->_size_load_queue_ptr        );
    114116      ALLOC1_SIGNAL_OUT(out_INSERT_EXCEPTION_USE        ,"exception_use"        ,Texception_t      ,_param->_size_exception_use         );
     
    180182      _ALLOC2_VALACK_OUT(out_RETIRE_EVENT_ACK           ,ACK,_param->_nb_front_end, _param->_nb_context[it1]);
    181183      _ALLOC2_SIGNAL_IN ( in_RETIRE_EVENT_STATE         ,"state"                ,Tevent_state_t    ,_param->_size_event_state, _param->_nb_front_end, _param->_nb_context[it1]);
     184      _ALLOC2_SIGNAL_IN ( in_RETIRE_EVENT_FLUSH         ,"flush"                ,Tcontrol_t        ,1                        , _param->_nb_front_end, _param->_nb_context[it1]);
     185      _ALLOC2_SIGNAL_IN ( in_RETIRE_EVENT_STOP          ,"stop"                 ,Tcontrol_t        ,1                        , _param->_nb_front_end, _param->_nb_context[it1]);
    182186
    183187      ALLOC2_INTERFACE_END(_param->_nb_front_end, _param->_nb_context[it1]);
     
    452456                                       dest,"retire_event_"+toString(i)+"_"+toString(j));
    453457#endif     
    454             PORT_MAP(_component,src , "in_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+"_STATE",
    455                                 dest, "in_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+"_STATE");
     458            PORT_MAP(_component,src , "in_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+"_FLUSH",
     459                                dest, "in_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+"_FLUSH");
     460            PORT_MAP(_component,src , "in_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+"_STOP",
     461                                dest, "in_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+"_STOP");
    456462          }
    457463    }
     
    637643        for (uint32_t j=0; j<_param->_nb_context[i]; j++)
    638644          {
    639             dest = _name;
     645            dest = _name+"_glue";
    640646           
    641647#ifdef POSITION
     
    643649                                       dest,"retire_event_"+toString(i)+"_"+toString(j));
    644650#endif     
    645             PORT_MAP(_component,src , "in_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+"_VAL"  ,
    646                                 dest, "in_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+"_VAL"  );
    647             PORT_MAP(_component,src ,"out_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+"_ACK"  ,
    648                                 dest,"out_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+"_ACK"  );
     651            COMPONENT_MAP(_component,src , "in_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+                     "_VAL"  ,
     652                                     dest,"out_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+"_REGISTER_TRANSLATION_VAL"  );
     653            COMPONENT_MAP(_component,src ,"out_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+                     "_ACK"  ,
     654                                     dest, "in_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+"_REGISTER_TRANSLATION_ACK"  );
     655
     656            dest = _name;
     657
     658#ifdef POSITION
     659            _component->interface_map (src ,"retire_event_"+toString(i)+"_"+toString(j),
     660                                       dest,"retire_event_"+toString(i)+"_"+toString(j));
     661#endif     
    649662            PORT_MAP(_component,src , "in_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+"_STATE",
    650663                                dest, "in_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+"_STATE");
     
    680693          PORT_MAP(_component,src ,"out_INSERT_"+toString(i)+"_STORE_QUEUE_PTR_WRITE",
    681694                              dest,"out_INSERT_"+toString(i)+"_STORE_QUEUE_PTR_WRITE");
     695          PORT_MAP(_component,src ,"out_INSERT_"+toString(i)+"_STORE_QUEUE_PTR_READ" ,
     696                              dest,"out_INSERT_"+toString(i)+"_STORE_QUEUE_PTR_READ" );
     697          PORT_MAP(_component,src ,"out_INSERT_"+toString(i)+"_STORE_QUEUE_EMPTY"    ,
     698                              dest,"out_INSERT_"+toString(i)+"_STORE_QUEUE_EMPTY"    );
    682699          if (_param->_have_port_load_queue_ptr)
    683700          PORT_MAP(_component,src ,"out_INSERT_"+toString(i)+"_LOAD_QUEUE_PTR_WRITE" ,
     
    746763          //// in_RETIRE_OPERATION    - glue
    747764        }
     765
     766      for (uint32_t i=0; i<_param->_nb_front_end; i++)
     767        for (uint32_t j=0; j<_param->_nb_context[i]; j++)
     768          {
     769            dest = _name+"_glue";
     770           
     771#ifdef POSITION
     772            _component->interface_map (src ,"retire_event_"+toString(i)+"_"+toString(j),
     773                                       dest,"retire_event_"+toString(i)+"_"+toString(j));
     774#endif     
     775            COMPONENT_MAP(_component,src , "in_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+                         "_VAL"  ,
     776                                     dest,"out_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+"_LOAD_STORE_QUEUE_POINTER_VAL"  );
     777            COMPONENT_MAP(_component,src ,"out_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+                         "_ACK"  ,
     778                                     dest, "in_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+"_LOAD_STORE_QUEUE_POINTER_ACK"  );
     779
     780            dest = _name;
     781           
     782#ifdef POSITION
     783            _component->interface_map (src ,"retire_event_"+toString(i)+"_"+toString(j),
     784                                       dest,"retire_event_"+toString(i)+"_"+toString(j));
     785#endif     
     786            PORT_MAP(_component,src , "in_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+"_STATE",
     787                                dest, "in_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+"_STATE");
     788          }
    748789    }
    749790
     
    844885
    845886      for (uint32_t i=0; i<_param->_nb_front_end; i++)
     887        for (uint32_t j=0; j<_param->_nb_context[i]; j++)
     888          {
     889            dest = _name;
     890           
     891#ifdef POSITION
     892            _component->interface_map (src ,"retire_event_"+toString(i)+"_"+toString(j),
     893                                       dest,"retire_event_"+toString(i)+"_"+toString(j));
     894#endif     
     895           
     896            PORT_MAP(_component,src , "in_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+"_VAL",
     897                                dest, "in_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+"_VAL");
     898            PORT_MAP(_component,src ,"out_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+"_ACK",
     899                                dest,"out_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+"_ACK");
     900
     901            //   out_RETIRE_EVENT_LOAD_STORE_QUEUE_POINTER_VAL          - load_store_pointer_unit
     902            //    in_RETIRE_EVENT_LOAD_STORE_QUEUE_POINTER_ACK          - load_store_pointer_unit
     903            //   out_RETIRE_EVENT_REGISTER_TRANSLATION_VAL              - register_translation_unit
     904            //    in_RETIRE_EVENT_REGISTER_TRANSLATION_ACK              - register_translation_unit
     905          }
     906
     907
     908      for (uint32_t i=0; i<_param->_nb_front_end; i++)
    846909        for (uint32_t j=0; j<_param->_nb_context[i]; j++)
    847910          {
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/src/Rename_unit_deallocation.cpp

    r121 r122  
    7272        DELETE1_SIGNAL(out_INSERT_IMMEDIAT             ,_param->_nb_inst_insert,_param->_size_general_data          );
    7373        DELETE1_SIGNAL(out_INSERT_STORE_QUEUE_PTR_WRITE,_param->_nb_inst_insert,_param->_size_store_queue_ptr       );
     74        DELETE1_SIGNAL(out_INSERT_STORE_QUEUE_PTR_READ ,_param->_nb_inst_insert,_param->_size_store_queue_ptr       );
     75        DELETE1_SIGNAL(out_INSERT_STORE_QUEUE_EMPTY    ,_param->_nb_inst_insert,1                                   );
    7476        DELETE1_SIGNAL(out_INSERT_LOAD_QUEUE_PTR_WRITE ,_param->_nb_inst_insert,_param->_size_load_queue_ptr        );
    7577        DELETE1_SIGNAL(out_INSERT_EXCEPTION_USE        ,_param->_nb_inst_insert,_param->_size_exception_use         );
     
    127129        DELETE2_SIGNAL(out_RETIRE_EVENT_ACK            ,_param->_nb_front_end, _param->_nb_context[it1],1);
    128130        DELETE2_SIGNAL( in_RETIRE_EVENT_STATE          ,_param->_nb_front_end, _param->_nb_context[it1],_param->_size_event_state);
     131        DELETE2_SIGNAL( in_RETIRE_EVENT_FLUSH          ,_param->_nb_front_end, _param->_nb_context[it1],1);
     132        DELETE2_SIGNAL( in_RETIRE_EVENT_STOP           ,_param->_nb_front_end, _param->_nb_context[it1],1);
    129133       
    130134        DELETE2_SIGNAL(in_SPR_READ_SR                  ,_param->_nb_front_end, _param->_nb_context[it1],_param->_size_spr);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/include/OOO_Engine.h

    r108 r122  
    105105  public    : SC_OUT(Toperation_t      )   ** out_ISSUE_OPERATION                  ;//[nb_inst_issue]
    106106  public    : SC_OUT(Tlsq_ptr_t        )   ** out_ISSUE_STORE_QUEUE_PTR_WRITE      ;//[nb_inst_issue]
     107  public    : SC_OUT(Tlsq_ptr_t        )   ** out_ISSUE_STORE_QUEUE_PTR_READ       ;//[nb_inst_issue]
     108  public    : SC_OUT(Tcontrol_t        )   ** out_ISSUE_STORE_QUEUE_EMPTY          ;//[nb_inst_issue]
    107109  public    : SC_OUT(Tlsq_ptr_t        )   ** out_ISSUE_LOAD_QUEUE_PTR_WRITE       ;//[nb_inst_issue]
    108110  public    : SC_OUT(Tcontrol_t        )   ** out_ISSUE_HAS_IMMEDIAT               ;//[nb_inst_issue]
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/src/OOO_Engine_allocation.cpp

    r121 r122  
    100100      ALLOC1_SIGNAL_OUT (out_ISSUE_OPERATION                  ,"OPERATION"                 ,Toperation_t      ,_param->_size_operation              );
    101101      ALLOC1_SIGNAL_OUT (out_ISSUE_STORE_QUEUE_PTR_WRITE      ,"STORE_QUEUE_PTR_WRITE"     ,Tlsq_ptr_t        ,_param->_size_store_queue_ptr        );
     102      ALLOC1_SIGNAL_OUT (out_ISSUE_STORE_QUEUE_PTR_READ       ,"STORE_QUEUE_PTR_READ"      ,Tlsq_ptr_t        ,_param->_size_store_queue_ptr        );
     103      ALLOC1_SIGNAL_OUT (out_ISSUE_STORE_QUEUE_EMPTY          ,"STORE_QUEUE_EMPTY"         ,Tcontrol_t        ,1                                    );
    102104      ALLOC1_SIGNAL_OUT (out_ISSUE_LOAD_QUEUE_PTR_WRITE       ,"LOAD_QUEUE_PTR_WRITE"      ,Tlsq_ptr_t        ,_param->_size_load_queue_ptr         );
    103105      ALLOC1_SIGNAL_OUT (out_ISSUE_HAS_IMMEDIAT               ,"HAS_IMMEDIAT"              ,Tcontrol_t        ,1                                    );
     
    561563            COMPONENT_MAP(_component,src ,"out_INSERT_"+toString(j)+                            "_STORE_QUEUE_PTR_WRITE",
    562564                                     dest, "in_INSERT_"+toString(i)+"_"+toString(j)+"_RENAME_UNIT_STORE_QUEUE_PTR_WRITE");
     565            COMPONENT_MAP(_component,src ,"out_INSERT_"+toString(j)+                            "_STORE_QUEUE_PTR_READ" ,
     566                                     dest, "in_INSERT_"+toString(i)+"_"+toString(j)+"_RENAME_UNIT_STORE_QUEUE_PTR_READ" );
     567            COMPONENT_MAP(_component,src ,"out_INSERT_"+toString(j)+                            "_STORE_QUEUE_EMPTY"    ,
     568                                     dest, "in_INSERT_"+toString(i)+"_"+toString(j)+"_RENAME_UNIT_STORE_QUEUE_EMPTY"    );
    563569            if (_param->_have_port_load_queue_ptr)
    564570            COMPONENT_MAP(_component,src ,"out_INSERT_"+toString(j)+                            "_LOAD_QUEUE_PTR_WRITE" ,
     
    655661          }
    656662
    657         // ~~~~~[ Interface : "spr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     663        // ~~~~~[ Interface : "retire_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    658664        {
    659665          std::vector<uint32_t>::iterator it = _param->_link_front_end_with_rename_unit[i].begin();
     
    676682                    COMPONENT_MAP(_component,src , "in_RETIRE_EVENT_"+toString(x)+"_"+toString(k)+"_STATE",
    677683                                             dest,"out_RETIRE_EVENT_"+toString(j)+"_"+toString(k)+"_STATE");
     684                    COMPONENT_MAP(_component,src , "in_RETIRE_EVENT_"+toString(x)+"_"+toString(k)+"_FLUSH",
     685                                             dest,"out_RETIRE_EVENT_"+toString(j)+"_"+toString(k)+"_FLUSH");
     686                    COMPONENT_MAP(_component,src , "in_RETIRE_EVENT_"+toString(x)+"_"+toString(k)+"_STOP",
     687                                             dest,"out_RETIRE_EVENT_"+toString(j)+"_"+toString(k)+"_STOP");
    678688                  }
    679689                x++;
     
    850860            //  out_RETIRE_NUM_REG_RE_PHY_OLD        - component_rename_unit
    851861            //  out_RETIRE_NUM_REG_RE_PHY_NEW        - component_rename_unit
    852             //  out_RETIRE_EVENT_STATE               - component_rename_unit
    853862   
    854863            //  out_RETIRE_CONTEXT_ID                - component_rename_unit
     
    872881        //  in_RETIRE_ACK         - rename_unit. in_RETIRE_ACK       
    873882        // out_RETIRE_EVENT_STATE - rename_unit.out_RETIRE_EVENT_STATE
     883        // out_RETIRE_EVENT_FLUSH - rename_unit.out_RETIRE_EVENT_FLUSH
     884        // out_RETIRE_EVENT_STOP  - rename_unit.out_RETIRE_EVENT_STOP
    874885 
    875886
     
    11501161            COMPONENT_MAP(_component,src , "in_ISSUE_IN_"+toString(i)+"_"+toString(j)+            "_STORE_QUEUE_PTR_WRITE",
    11511162                                     dest,"out_INSERT_"  +toString(i)+"_"+toString(j)+"_ISSUE_QUEUE_STORE_QUEUE_PTR_WRITE");
     1163            COMPONENT_MAP(_component,src , "in_ISSUE_IN_"+toString(i)+"_"+toString(j)+            "_STORE_QUEUE_PTR_READ" ,
     1164                                     dest,"out_INSERT_"  +toString(i)+"_"+toString(j)+"_ISSUE_QUEUE_STORE_QUEUE_PTR_READ" );
     1165            COMPONENT_MAP(_component,src , "in_ISSUE_IN_"+toString(i)+"_"+toString(j)+            "_STORE_QUEUE_EMPTY"    ,
     1166                                     dest,"out_INSERT_"  +toString(i)+"_"+toString(j)+"_ISSUE_QUEUE_STORE_QUEUE_EMPTY"    );
    11521167            if (_param->_have_port_load_queue_ptr)
    11531168            COMPONENT_MAP(_component,src , "in_ISSUE_IN_"+toString(i)+"_"+toString(j)+            "_LOAD_QUEUE_PTR_WRITE" ,
     
    12121227          COMPONENT_MAP(_component,src , "in_REEXECUTE_"+toString(i)+"_STORE_QUEUE_PTR_WRITE",
    12131228                                   dest,"out_REEXECUTE_"+toString(i)+"_STORE_QUEUE_PTR_WRITE");
     1229          COMPONENT_MAP(_component,src , "in_REEXECUTE_"+toString(i)+"_STORE_QUEUE_PTR_READ" ,
     1230                                   dest,"out_REEXECUTE_"+toString(i)+"_STORE_QUEUE_PTR_READ" );
     1231          COMPONENT_MAP(_component,src , "in_REEXECUTE_"+toString(i)+"_STORE_QUEUE_EMPTY"    ,
     1232                                   dest,"out_REEXECUTE_"+toString(i)+"_STORE_QUEUE_EMPTY"    );
    12141233          if (_param->_have_port_load_queue_ptr)
    12151234          COMPONENT_MAP(_component,src , "in_REEXECUTE_"+toString(i)+"_LOAD_QUEUE_PTR_WRITE" ,
     
    12701289          PORT_MAP(_component,src ,"out_ISSUE_OUT_"+toString(i)+"_STORE_QUEUE_PTR_WRITE",
    12711290                              dest,"out_ISSUE_"    +toString(i)+"_STORE_QUEUE_PTR_WRITE");
     1291          PORT_MAP(_component,src ,"out_ISSUE_OUT_"+toString(i)+"_STORE_QUEUE_PTR_READ" ,
     1292                              dest,"out_ISSUE_"    +toString(i)+"_STORE_QUEUE_PTR_READ" );
     1293          PORT_MAP(_component,src ,"out_ISSUE_OUT_"+toString(i)+"_STORE_QUEUE_EMPTY"    ,
     1294                              dest,"out_ISSUE_"    +toString(i)+"_STORE_QUEUE_EMPTY"    );
    12721295          if (_param->_have_port_load_queue_ptr)
    12731296          PORT_MAP(_component,src ,"out_ISSUE_OUT_"+toString(i)+"_LOAD_QUEUE_PTR_WRITE" ,
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/src/OOO_Engine_deallocation.cpp

    r112 r122  
    6363        DELETE1_SIGNAL(out_ISSUE_OPERATION                  ,_param->_nb_inst_issue,_param->_size_operation              );
    6464        DELETE1_SIGNAL(out_ISSUE_STORE_QUEUE_PTR_WRITE      ,_param->_nb_inst_issue,_param->_size_store_queue_ptr        );
     65        DELETE1_SIGNAL(out_ISSUE_STORE_QUEUE_PTR_READ       ,_param->_nb_inst_issue,_param->_size_store_queue_ptr        );
     66        DELETE1_SIGNAL(out_ISSUE_STORE_QUEUE_EMPTY          ,_param->_nb_inst_issue,1                                    );
    6567        DELETE1_SIGNAL(out_ISSUE_LOAD_QUEUE_PTR_WRITE       ,_param->_nb_inst_issue,_param->_size_load_queue_ptr         );
    6668        DELETE1_SIGNAL(out_ISSUE_HAS_IMMEDIAT               ,_param->_nb_inst_issue,1                                    );
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/src/Core_allocation.cpp

    r117 r122  
    728728            COMPONENT_MAP(_component,src ,"out_ISSUE_"                           +toString(j)+"_STORE_QUEUE_PTR_WRITE",
    729729                                     dest, "in_ISSUE_OOO_ENGINE_"+toString(i)+"_"+toString(j)+"_STORE_QUEUE_PTR_WRITE");
     730            COMPONENT_MAP(_component,src ,"out_ISSUE_"                           +toString(j)+"_STORE_QUEUE_PTR_READ" ,
     731                                     dest, "in_ISSUE_OOO_ENGINE_"+toString(i)+"_"+toString(j)+"_STORE_QUEUE_PTR_READ" );
     732            COMPONENT_MAP(_component,src ,"out_ISSUE_"                           +toString(j)+"_STORE_QUEUE_EMPTY"    ,
     733                                     dest, "in_ISSUE_OOO_ENGINE_"+toString(i)+"_"+toString(j)+"_STORE_QUEUE_EMPTY"    );
    730734            if (_param->_have_port_load_queue_ptr)
    731735            COMPONENT_MAP(_component,src ,"out_ISSUE_"                           +toString(j)+"_LOAD_QUEUE_PTR_WRITE" ,
     
    872876            COMPONENT_MAP(_component,src , "in_EXECUTE_LOOP_IN_"                   +toString(j)+"_STORE_QUEUE_PTR_WRITE",
    873877                                     dest,"out_ISSUE_EXECUTE_LOOP_"+toString(i)+"_"+toString(j)+"_STORE_QUEUE_PTR_WRITE");
     878            COMPONENT_MAP(_component,src , "in_EXECUTE_LOOP_IN_"                   +toString(j)+"_STORE_QUEUE_PTR_READ" ,
     879                                     dest,"out_ISSUE_EXECUTE_LOOP_"+toString(i)+"_"+toString(j)+"_STORE_QUEUE_PTR_READ" );
     880            COMPONENT_MAP(_component,src , "in_EXECUTE_LOOP_IN_"                   +toString(j)+"_STORE_QUEUE_EMPTY"    ,
     881                                     dest,"out_ISSUE_EXECUTE_LOOP_"+toString(i)+"_"+toString(j)+"_STORE_QUEUE_EMPTY"    );
    874882            if (_param->_have_port_load_queue_ptr)
    875883            COMPONENT_MAP(_component,src , "in_EXECUTE_LOOP_IN_"                   +toString(j)+"_LOAD_QUEUE_PTR_WRITE" ,
     
    13241332      //  in_ISSUE_OOO_ENGINE_OPERATION             - ooo_engine.out_ISSUE_OPERATION           
    13251333      //  in_ISSUE_OOO_ENGINE_STORE_QUEUE_PTR_WRITE - ooo_engine.out_ISSUE_STORE_QUEUE_PTR_WRITE
     1334      //  in_ISSUE_OOO_ENGINE_STORE_QUEUE_PTR_READ  - ooo_engine.out_ISSUE_STORE_QUEUE_PTR_READ
     1335      //  in_ISSUE_OOO_ENGINE_STORE_QUEUE_EMPTY     - ooo_engine.out_ISSUE_STORE_QUEUE_EMPTY   
    13261336      //  in_ISSUE_OOO_ENGINE_LOAD_QUEUE_PTR_WRITE  - ooo_engine.out_ISSUE_LOAD_QUEUE_PTR_WRITE
    13271337      //  in_ISSUE_OOO_ENGINE_HAS_IMMEDIAT          - ooo_engine.out_ISSUE_HAS_IMMEDIAT         
     
    13471357      // out_ISSUE_EXECUTE_LOOP_TYPE                  - execute_loop. in_EXECUTE_LOOP_IN_TYPE                 
    13481358      // out_ISSUE_EXECUTE_LOOP_STORE_QUEUE_PTR_WRITE - execute_loop. in_EXECUTE_LOOP_IN_STORE_QUEUE_PTR_WRITE
     1359      // out_ISSUE_EXECUTE_LOOP_STORE_QUEUE_PTR_READ  - execute_loop. in_EXECUTE_LOOP_IN_STORE_QUEUE_PTR_READ
     1360      // out_ISSUE_EXECUTE_LOOP_STORE_QUEUE_EMPTY     - execute_loop. in_EXECUTE_LOOP_IN_STORE_QUEUE_EMPTY   
    13491361      // out_ISSUE_EXECUTE_LOOP_LOAD_QUEUE_PTR_WRITE  - execute_loop. in_EXECUTE_LOOP_IN_LOAD_QUEUE_PTR_WRITE
    13501362      // out_ISSUE_EXECUTE_LOOP_HAS_IMMEDIAT          - execute_loop. in_EXECUTE_LOOP_IN_HAS_IMMEDIAT         
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/src/Core_deallocation.cpp

    r112 r122  
    5959    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    6060
    61     DELETE0(_component_glue);
    62     DELETE0(_component_dcache_access);
    63     DELETE0(_component_icache_access);
    64     DELETE1(_component_execute_loop, _param->_nb_execute_loop);
    65     DELETE1(_component_ooo_engine  , _param->_nb_ooo_engine);
    66     DELETE1(_component_front_end   , _param->_nb_front_end);
     61    delete    _component_glue;
     62    delete    _component_dcache_access;
     63    delete    _component_icache_access;
     64    for (uint32_t i=0; i<_param->_nb_execute_loop; ++i)
     65    delete    _component_execute_loop [i];
     66    delete [] _component_execute_loop;
     67    for (uint32_t i=0; i<_param->_nb_ooo_engine; ++i)
     68    delete    _component_ooo_engine [i];
     69    delete [] _component_ooo_engine;
     70    for (uint32_t i=0; i<_param->_nb_front_end; ++i)
     71    delete    _component_front_end [i];
     72    delete [] _component_front_end;
    6773
    6874    delete _component;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/src/Parameters.cpp

    r120 r122  
    21812181    log_begin(Core,FUNCTION);
    21822182
     2183    for (uint32_t i=0; i<_nb_front_end; ++i)
     2184    delete    _param_front_end [i];
    21832185    delete [] _param_front_end;
     2186    for (uint32_t i=0; i<_nb_ooo_engine; ++i)
     2187    delete    _param_ooo_engine [i];
    21842188    delete [] _param_ooo_engine;
     2189    for (uint32_t i=0; i<_nb_execute_loop; ++i)
     2190    delete    _param_execute_loop [i];
    21852191    delete [] _param_execute_loop;
    21862192    delete    _param_icache_access;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Allocation.h

    r115 r122  
    250250
    251251#ifdef POSITION
    252 #define ALLOC1_INTERFACE_BEGIN( name, direction, localisation, str, x1)       \
     252#define ALLOC1_INTERFACE_BEGIN( name, direction, localisation, str, x1) \
    253253  INTERFACE_PRINT(name);                                                \
    254   uint32_t iterator_1 = 0;                                              \
    255   morpheo::behavioural::Interface_fifo ** interface;                    \
     254  uint32_t iterator_1 = 0;                                              \
     255  morpheo::behavioural::Interface_fifo ** interface;                    \
    256256  {                                                                     \
    257257    std::string separator="_";                                          \
     
    264264  }
    265265#else
    266 #define ALLOC1_INTERFACE_BEGIN( name, direction, localisation, str, x1)       \
     266#define ALLOC1_INTERFACE_BEGIN( name, direction, localisation, str, x1)   \
    267267  INTERFACE_PRINT(name);                                                \
    268   const uint32_t iterator_1 = x1;                                       \
    269   morpheo::behavioural::Interface_fifo * interface [iterator_1];        \
    270   {                                                                     \
    271     std::string separator="_";                                          \
     268  uint32_t iterator_1 = 0;                                              \
     269  morpheo::behavioural::Interface_fifo ** interface;                    \
     270  {                                                                     \
     271    std::string separator="_";                                          \
     272    iterator_1 = x1;                                                    \
     273    interface = new morpheo::behavioural::Interface_fifo * [iterator_1]; \
    272274    for (uint32_t it1=0; it1<iterator_1; it1++)                         \
    273275      {                                                                 \
     
    277279#endif
    278280
    279 #define ALLOC1_INTERFACE_END(x1)
     281#define ALLOC1_INTERFACE_END(x1)                \
     282  delete [] interface;
    280283
    281284#define ALLOC1_VAL_ACK_IN( sig, name, type)                             \
     
    467470#endif
    468471
    469 #define ALLOC2_INTERFACE_END(x1, x2)                             \
     472#define ALLOC2_INTERFACE_END(x1, x2)                                    \
    470473  for (uint32_t it1=0; it1<x1; it1++)                                   \
    471     delete interface [it1];                                             \
     474    delete [] interface [it1];                                          \
    472475  delete [] interface;
    473476
     
    734737    {                                                                   \
    735738      for (uint32_t it2=0; it2<x2; it2++)                               \
    736         delete interface [it1][it2];                                    \
     739        delete [] interface [it1][it2];                                 \
    737740      delete [] interface [it1];                                        \
    738741    }                                                                   \
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Version.h

    r121 r122  
    1010#define MORPHEO_MAJOR_VERSION "0"
    1111#define MORPHEO_MINOR_VERSION "2"
    12 #define MORPHEO_REVISION      "121"
     12#define MORPHEO_REVISION      "122"
    1313#define MORPHEO_CODENAME      "Castor"
    1414
    15 #define MORPHEO_DATE_DAY      "27
    16 #define MORPHEO_DATE_MONTH    "05"
     15#define MORPHEO_DATE_DAY      "03
     16#define MORPHEO_DATE_MONTH    "06"
    1717#define MORPHEO_DATE_YEAR     "2009"
    1818
  • trunk/IPs/systemC/processor/Morpheo/Files/Instance_x1_w4_1.cfg

    r120 r122  
    127127    <parameter name="nb_execute_loop_select"                value="1" />
    128128    <parameter name="size_re_order_buffer"                  value="64"/>
    129     <parameter name="nb_re_order_buffer_bank"               value="64" />
     129    <parameter name="nb_re_order_buffer_bank"               value="16" />
    130130    <parameter name="commit_priority"                       value="1" />
    131131    <parameter name="commit_load_balancing"                 value="1" />
  • trunk/IPs/systemC/processor/Morpheo/Files/Instance_x1_w4_2.cfg

    r120 r122  
    127127    <parameter name="nb_execute_loop_select"                value="1" />
    128128    <parameter name="size_re_order_buffer"                  value="128"/>
    129     <parameter name="nb_re_order_buffer_bank"               value="64" />
     129    <parameter name="nb_re_order_buffer_bank"               value="16" />
    130130    <parameter name="commit_priority"                       value="1" />
    131131    <parameter name="commit_load_balancing"                 value="1" />
  • trunk/IPs/systemC/processor/Morpheo/Files/Morpheo.sim

    r120 r122  
    2020  <parameter  name="statistics_period"                      value="0"       />
    2121                                                           
    22   <parameter  name="simulation_nb_cycle"                    value="1000000000"/>
     22  <parameter  name="simulation_nb_cycle"                    value="1000000" />
    2323  <parameter  name="simulation_nb_instruction"              value="0"       />
    2424                                                           
  • trunk/IPs/systemC/processor/Morpheo/Files/debug.sim

    r120 r122  
    88  <parameter  name="use_vhdl_testbench_assert"              value="0"       />
    99  <parameter  name="use_position"                           value="0"       />
    10   <parameter  name="use_statistics"                         value="1"       />
     10  <parameter  name="use_statistics"                         value="0"       />
    1111  <parameter  name="use_information"                        value="0"       />
    1212  <parameter  name="use_header"                             value="0"       />
     
    2020  <parameter  name="statistics_period"                      value="0"       />
    2121                                                           
    22   <parameter  name="simulation_nb_cycle"                    value="20000"  />
     22  <parameter  name="simulation_nb_cycle"                    value="100"  />
    2323  <parameter  name="simulation_nb_instruction"              value="0"       />
    2424                                                           
    25   <parameter  name="debug_level"                            value="3"       />
    26   <parameter  name="debug_cycle_start"                      value="30"      />
    27   <parameter  name="debug_cycle_stop"                       value="50"      />
     25  <parameter  name="debug_level"                            value="0"       />
     26  <parameter  name="debug_cycle_start"                      value="8000"   />
     27  <parameter  name="debug_cycle_stop"                       value="9000"   />
    2828
    2929  <parameter  name="debug_log_file_generate"                value="0"       />
    3030  <parameter  name="debug_log_file_with_pid"                value="0"       />
    31   <parameter  name="debug_idle_cycle"                       value="200"     />
    32   <parameter  name="debug_idle_time"                        value="10"      />
     31  <parameter  name="debug_idle_cycle"                       value="100"     />
     32  <parameter  name="debug_idle_time"                        value="5"       />
    3333
    34   <component  name="Comparator"                             model="systemc" debug="1" />
    35   <component  name="Counter"                                model="systemc" debug="1" />
    36   <component  name="Divider"                                model="systemc" debug="1" />
    37   <component  name="Multiplier"                             model="systemc" debug="1" />
    38   <component  name="Priority"                               model="systemc" debug="1" />
    39   <component  name="Queue_Control"                          model="systemc" debug="1" />         
    40   <component  name="Queue"                                  model="systemc" debug="1" />
    41   <component  name="RegisterFile_Monolithic"                model="systemc" debug="1" />
    42   <component  name="RegisterFile_Multi_Banked"              model="systemc" debug="1" />
    43   <component  name="RegisterFile"                           model="systemc" debug="1" />
    44   <component  name="Select_Priority_Fixed"                  model="systemc" debug="1" />
    45   <component  name="Select"                                 model="systemc" debug="1" />
    46   <component  name="Shifter"                                model="systemc" debug="1" />
    47   <component  name="Sort"                                   model="systemc" debug="1" />
    48   <component  name="Victim_Pseudo_LRU"                      model="systemc" debug="1" />
    49   <component  name="Victim"                                 model="systemc" debug="1" />
    50   <component  name="Execute_loop_Glue"                      model="systemc" debug="1" />
    51   <component  name="Functionnal_unit"                       model="systemc" debug="1" />
    52   <component  name="Load_store_unit"                        model="systemc" debug="1" />
    53   <component  name="Read_queue"                             model="systemc" debug="1" />
    54   <component  name="Reservation_station"                    model="systemc" debug="1" />
    55   <component  name="Read_unit"                              model="systemc" debug="1" />
    56   <component  name="Execute_queue"                          model="systemc" debug="1" />
    57   <component  name="Write_queue"                            model="systemc" debug="1" />
    58   <component  name="Write_unit"                             model="systemc" debug="1" />
    59   <component  name="Execution_unit_to_Write_unit"           model="systemc" debug="1" />
    60   <component  name="Read_unit_to_Execution_unit"            model="systemc" debug="1" />
    61   <component  name="Register_unit_Glue"                     model="systemc" debug="1" />
    62   <component  name="Register_unit"                          model="systemc" debug="1" />
    63   <component  name="Execute_loop"                           model="systemc" debug="1" />
     34  <component  name="Comparator"                             model="systemc" debug="0" />
     35  <component  name="Counter"                                model="systemc" debug="0" />
     36  <component  name="Divider"                                model="systemc" debug="0" />
     37  <component  name="Multiplier"                             model="systemc" debug="0" />
     38  <component  name="Priority"                               model="systemc" debug="0" />
     39  <component  name="Queue_Control"                          model="systemc" debug="0" />         
     40  <component  name="Queue"                                  model="systemc" debug="0" />
     41  <component  name="RegisterFile_Monolithic"                model="systemc" debug="0" />
     42  <component  name="RegisterFile_Multi_Banked"              model="systemc" debug="0" />
     43  <component  name="RegisterFile"                           model="systemc" debug="0" />
     44  <component  name="Select_Priority_Fixed"                  model="systemc" debug="0" />
     45  <component  name="Select"                                 model="systemc" debug="0" />
     46  <component  name="Shifter"                                model="systemc" debug="0" />
     47  <component  name="Sort"                                   model="systemc" debug="0" />
     48  <component  name="Victim_Pseudo_LRU"                      model="systemc" debug="0" />
     49  <component  name="Victim"                                 model="systemc" debug="0" />
     50  <component  name="Execute_loop_Glue"                      model="systemc" debug="0" />
     51  <component  name="Functionnal_unit"                       model="systemc" debug="0" />
     52  <component  name="Load_store_unit"                        model="systemc" debug="0" />
     53  <component  name="Read_queue"                             model="systemc" debug="0" />
     54  <component  name="Reservation_station"                    model="systemc" debug="0" />
     55  <component  name="Read_unit"                              model="systemc" debug="0" />
     56  <component  name="Execute_queue"                          model="systemc" debug="0" />
     57  <component  name="Write_queue"                            model="systemc" debug="0" />
     58  <component  name="Write_unit"                             model="systemc" debug="0" />
     59  <component  name="Execution_unit_to_Write_unit"           model="systemc" debug="0" />
     60  <component  name="Read_unit_to_Execution_unit"            model="systemc" debug="0" />
     61  <component  name="Register_unit_Glue"                     model="systemc" debug="0" />
     62  <component  name="Register_unit"                          model="systemc" debug="0" />
     63  <component  name="Execute_loop"                           model="systemc" debug="0" />
    6464  <component  name="Commit_unit"                            model="systemc" debug="1" />
    65   <component  name="Issue_queue"                            model="systemc" debug="1" />
    66   <component  name="OOO_Engine_Glue"                        model="systemc" debug="1" />
    67   <component  name="Reexecute_unit"                         model="systemc" debug="1" />
    68   <component  name="Load_Store_pointer_unit"                model="systemc" debug="1" />
    69   <component  name="Dependency_checking_unit"               model="systemc" debug="1" />
    70   <component  name="Free_List_unit"                         model="systemc" debug="1" />
    71   <component  name="Register_Address_Translation_unit"      model="systemc" debug="1" />
    72   <component  name="Register_translation_unit_Glue"         model="systemc" debug="1" />
    73   <component  name="Stat_List_unit"                         model="systemc" debug="1" />
    74   <component  name="Register_translation_unit"              model="systemc" debug="1" />
    75   <component  name="Rename_unit_Glue"                       model="systemc" debug="1" />
    76   <component  name="Rename_select"                          model="systemc" debug="1" />
    77   <component  name="Rename_unit"                            model="systemc" debug="1" />
    78   <component  name="Special_Register_unit"                  model="systemc" debug="1" />
    79   <component  name="OOO_Engine"                             model="systemc" debug="1" />
     65  <component  name="Issue_queue"                            model="systemc" debug="0" />
     66  <component  name="OOO_Engine_Glue"                        model="systemc" debug="0" />
     67  <component  name="Reexecute_unit"                         model="systemc" debug="0" />
     68  <component  name="Load_Store_pointer_unit"                model="systemc" debug="0" />
     69  <component  name="Dependency_checking_unit"               model="systemc" debug="0" />
     70  <component  name="Free_List_unit"                         model="systemc" debug="0" />
     71  <component  name="Register_Address_Translation_unit"      model="systemc" debug="0" />
     72  <component  name="Register_translation_unit_Glue"         model="systemc" debug="0" />
     73  <component  name="Stat_List_unit"                         model="systemc" debug="0" />
     74  <component  name="Register_translation_unit"              model="systemc" debug="0" />
     75  <component  name="Rename_unit_Glue"                       model="systemc" debug="0" />
     76  <component  name="Rename_select"                          model="systemc" debug="0" />
     77  <component  name="Rename_unit"                            model="systemc" debug="0" />
     78  <component  name="Special_Register_unit"                  model="systemc" debug="0" />
     79  <component  name="OOO_Engine"                             model="systemc" debug="0" />
    8080  <component  name="Context_State"                          model="systemc" debug="1" />
    81   <component  name="Decod"                                  model="systemc" debug="1" />
    82   <component  name="Decod_queue"                            model="systemc" debug="1" />
    83   <component  name="Decod_unit"                             model="systemc" debug="1" />
    84   <component  name="Front_end_Glue"                         model="systemc" debug="1" />
    85   <component  name="Address_management"                     model="systemc" debug="1" />
    86   <component  name="Ifetch_queue"                           model="systemc" debug="1" />
    87   <component  name="Ifetch_unit_Glue"                       model="systemc" debug="1" />
    88   <component  name="Ifetch_unit"                            model="systemc" debug="1" />
    89   <component  name="Branch_Target_Buffer_Glue"              model="systemc" debug="1" />
    90   <component  name="Branch_Target_Buffer_Register"          model="systemc" debug="1" />
    91   <component  name="Branch_Target_Buffer"                   model="systemc" debug="1" />
    92   <component  name="Direction_Glue"                         model="systemc" debug="1" />
    93   <component  name="Direction"                              model="systemc" debug="1" />
    94   <component  name="Two_Level_Branch_Predictor"             model="systemc" debug="1" />
    95   <component  name="Meta_Predictor_Glue"                    model="systemc" debug="1" />
    96   <component  name="Meta_Predictor"                         model="systemc" debug="1" />
    97   <component  name="Prediction_unit_Glue"                   model="systemc" debug="1" />
    98   <component  name="Return_Address_Stack"                   model="systemc" debug="1" />
     81  <component  name="Decod"                                  model="systemc" debug="0" />
     82  <component  name="Decod_queue"                            model="systemc" debug="0" />
     83  <component  name="Decod_unit"                             model="systemc" debug="0" />
     84  <component  name="Front_end_Glue"                         model="systemc" debug="0" />
     85  <component  name="Address_management"                     model="systemc" debug="0" />
     86  <component  name="Ifetch_queue"                           model="systemc" debug="0" />
     87  <component  name="Ifetch_unit_Glue"                       model="systemc" debug="0" />
     88  <component  name="Ifetch_unit"                            model="systemc" debug="0" />
     89  <component  name="Branch_Target_Buffer_Glue"              model="systemc" debug="0" />
     90  <component  name="Branch_Target_Buffer_Register"          model="systemc" debug="0" />
     91  <component  name="Branch_Target_Buffer"                   model="systemc" debug="0" />
     92  <component  name="Direction_Glue"                         model="systemc" debug="0" />
     93  <component  name="Direction"                              model="systemc" debug="0" />
     94  <component  name="Two_Level_Branch_Predictor"             model="systemc" debug="0" />
     95  <component  name="Meta_Predictor_Glue"                    model="systemc" debug="0" />
     96  <component  name="Meta_Predictor"                         model="systemc" debug="0" />
     97  <component  name="Prediction_unit_Glue"                   model="systemc" debug="0" />
     98  <component  name="Return_Address_Stack"                   model="systemc" debug="0" />
    9999  <component  name="Update_Prediction_Table"                model="systemc" debug="1" />
    100   <component  name="Prediction_unit"                        model="systemc" debug="1" />
    101   <component  name="Front_end"                              model="systemc" debug="1" />
    102   <component  name="Icache_Access"                          model="systemc" debug="1" />
    103   <component  name="Dcache_Access"                          model="systemc" debug="1" />
    104   <component  name="Core_Glue"                              model="systemc" debug="1" />
    105   <component  name="Core"                                   model="systemc" debug="1" />
    106   <component  name="TopLevel"                               model="systemc" debug="1" />
     100  <component  name="Prediction_unit"                        model="systemc" debug="0" />
     101  <component  name="Front_end"                              model="systemc" debug="0" />
     102  <component  name="Icache_Access"                          model="systemc" debug="0" />
     103  <component  name="Dcache_Access"                          model="systemc" debug="0" />
     104  <component  name="Core_Glue"                              model="systemc" debug="0" />
     105  <component  name="Core"                                   model="systemc" debug="0" />
     106  <component  name="TopLevel"                               model="systemc" debug="0" />
    107107
    108   <component  name="Behavioural"                            model="systemc" debug="1" />
    109   <component  name="Interface"                              model="systemc" debug="1" />
    110   <component  name="Allocation"                             model="systemc" debug="1" />
     108  <component  name="Behavioural"                            model="systemc" debug="0" />
     109  <component  name="Interface"                              model="systemc" debug="0" />
     110  <component  name="Allocation"                             model="systemc" debug="0" />
    111111
    112112</parameters>
  • trunk/IPs/systemC/processor/Morpheo/Script/instruction_flow_diff.sh

    r117 r122  
    3434    # Read symbol file and take function address and function name
    3535    local -a array1_address;
     36    local -a array1_load_data;
    3637    local -i cpt1;
    3738    local -i cpt2;
     
    4546            # extract address
    4647            address1=$(echo ${line} | cut -d' ' -f2);
     48            load_data1=$(echo ${line} | cut -d' ' -f7);
    4749         
    4850            array1_address[${cpt1}]=${address1};
     51            array1_load_data[${cpt1}]=${load_data1};
    4952
    5053            cpt1=$((${cpt1}+1));
     
    5659    cpt2=1;
    5760    address1=${array1_address[${cpt1}]};
     61    load_data1=${array1_load_data[${cpt1}]};
    5862
    5963    while read line; do
     
    6771            # extract address
    6872            address2=$(echo ${line} | cut -d' ' -f2);
     73            load_data2=$(echo ${line} | cut -d' ' -f7);
    6974
    7075            # test address
    7176            if test "${address1}" != "${address2}"; then
    72                 echo "diff line ${cpt2} :";
     77                echo "diff line ${cpt2} on address:";
     78                echo "${line}";
     79                exit;
     80            fi;
     81
     82            if test "${load_data1}" != "${load_data2}"; then
     83                echo "diff line ${cpt2} on load_data:";
    7384                echo "${line}";
    7485                exit;
     
    7788            cpt1=$((${cpt1}+1));
    7889            address1=${array1_address[${cpt1}]};
     90            load_data1=${array1_load_data[${cpt1}]};
    7991
    8092        fi;
Note: See TracChangeset for help on using the changeset viewer.