Index: 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
===================================================================
--- 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	(revision 62)
+++ 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	(revision 71)
@@ -24,5 +24,5 @@
 #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Parameters.h"
 #ifdef STATISTICS
-#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Statistics.h"
+#include "Behavioural/include/Stat.h"
 #endif
 #include "Behavioural/include/Component.h"
@@ -54,10 +54,30 @@
 
   protected : const Parameters * _param;
-//#ifdef STATISTICS
-//  protected : const morpheo::behavioural::Parameters_Statistics * _param_statistics;
-//#endif
-
-#ifdef STATISTICS
-  private   : Statistics                     * _stat;
+
+#ifdef STATISTICS
+  private   : Stat                           * _stat;
+
+  private   : counter_t                      * _stat_use_store_queue;
+  private   : counter_t                      * _stat_use_load_queue;
+  private   : counter_t                      * _stat_use_speculative_access_queue;
+
+  private   : counter_t                      * _stat_average_use_store_queue;
+  private   : counter_t                      * _stat_average_use_load_queue;
+  private   : counter_t                      * _stat_average_use_speculative_access_queue;
+
+  private   : counter_t                      * _stat_percent_use_store_queue;
+  private   : counter_t                      * _stat_percent_use_load_queue;
+  private   : counter_t                      * _stat_percent_use_speculative_access_queue;
+
+//   private   : counter_t                      * _stat_nb_load_miss_speculation;
+//   private   : counter_t                      * _stat_nb_head_ko;
+
+//   private   : counter_t                      * _stat_nb_inst_load;
+//   private   : counter_t                      * _stat_nb_inst_store;
+//   private   : counter_t                      * _stat_nb_inst_lock;
+//   private   : counter_t                      * _stat_nb_inst_prefetch;
+//   private   : counter_t                      * _stat_nb_inst_invalid;
+//   private   : counter_t                      * _stat_nb_inst_flush;
+//   private   : counter_t                      * _stat_nb_inst_sync;
 #endif
 
@@ -75,4 +95,6 @@
   public    : SC_OUT(Tcontrol_t        )    * out_MEMORY_IN_ACK         ;
   public    : SC_IN (Tcontext_t        )    *  in_MEMORY_IN_CONTEXT_ID  ;
+  public    : SC_IN (Tcontext_t        )    *  in_MEMORY_IN_FRONT_END_ID;
+  public    : SC_IN (Tcontext_t        )    *  in_MEMORY_IN_OOO_ENGINE_ID;
   public    : SC_IN (Tpacket_t         )    *  in_MEMORY_IN_PACKET_ID   ;
   public    : SC_IN (Toperation_t      )    *  in_MEMORY_IN_OPERATION   ;
@@ -84,5 +106,5 @@
   public    : SC_IN (Tgeneral_data_t   )    *  in_MEMORY_IN_DATA_RB     ; // data        (store)
 //public    : SC_IN (Tspecial_data_t   )    *  in_MEMORY_IN_DATA_RC     ;
-  public    : SC_IN (Tcontrol_t        )    *  in_MEMORY_IN_WRITE_RD    ; // = (operation==load)
+//public    : SC_IN (Tcontrol_t        )    *  in_MEMORY_IN_WRITE_RD    ; // = (operation==load)
   public    : SC_IN (Tgeneral_address_t)    *  in_MEMORY_IN_NUM_REG_RD  ; // destination (load)
 //public    : SC_IN (Tcontrol_t        )    *  in_MEMORY_IN_WRITE_RE    ;
@@ -93,4 +115,6 @@
   public    : SC_IN (Tcontrol_t        )    *  in_MEMORY_OUT_ACK       ;
   public    : SC_OUT(Tcontext_t        )    * out_MEMORY_OUT_CONTEXT_ID;
+  public    : SC_OUT(Tcontext_t        )    * out_MEMORY_OUT_FRONT_END_ID;
+  public    : SC_OUT(Tcontext_t        )    * out_MEMORY_OUT_OOO_ENGINE_ID;
   public    : SC_OUT(Tpacket_t         )    * out_MEMORY_OUT_PACKET_ID ;
   public    : SC_OUT(Tcontrol_t        )    * out_MEMORY_OUT_WRITE_RD  ; // = (operation==load)
@@ -109,5 +133,4 @@
   public    : SC_OUT(Tdcache_address_t )    * out_DCACHE_REQ_ADDRESS   ;
   public    : SC_OUT(Tdcache_type_t    )    * out_DCACHE_REQ_TYPE      ;
-  public    : SC_OUT(Tcontrol_t        )    * out_DCACHE_REQ_UNCACHED  ;
   public    : SC_OUT(Tdcache_data_t    )    * out_DCACHE_REQ_WDATA     ;
 
@@ -122,5 +145,5 @@
     // ~~~~~[ Interface "bypass_memory" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   public    : SC_OUT(Tcontrol_t        )   ** out_BYPASS_MEMORY_VAL       ;
-  public    : SC_OUT(Tcontext_t        )   ** out_BYPASS_MEMORY_CONTEXT_ID;
+  public    : SC_OUT(Tcontext_t        )   ** out_BYPASS_MEMORY_OOO_ENGINE_ID;
   public    : SC_OUT(Tgeneral_address_t)   ** out_BYPASS_MEMORY_NUM_REG   ;
   public    : SC_OUT(Tgeneral_data_t   )   ** out_BYPASS_MEMORY_DATA      ;
@@ -144,12 +167,17 @@
 
     // Registers
-  public    : Tlsq_ptr_t                      internal_MEMORY_STORE_QUEUE_PTR_READ;
-  public    : Tlsq_ptr_t                      internal_MEMORY_LOAD_QUEUE_PTR_READ ;
+  public    : Tlsq_ptr_t                      reg_STORE_QUEUE_PTR_READ;
+//public    : Tlsq_ptr_t                      reg_LOAD_QUEUE_PTR_READ ;
+  public    : Tlsq_ptr_t                      reg_LOAD_QUEUE_CHECK_PRIORITY ;
 
     // signal
+  public    : Tlsq_ptr_t                      internal_SPECULATIVE_ACCESS_QUEUE_PTR_READ ;
+
   private   : Tcontrol_t                      internal_MEMORY_IN_ACK;
   private   : Tcontrol_t                      internal_MEMORY_OUT_VAL;
   private   : Tselect_queue_t                 internal_MEMORY_OUT_SELECT_QUEUE;
-
+  public    : Tlsq_ptr_t                      internal_MEMORY_OUT_PTR;
+
+  private   : Tcontrol_t                      internal_DCACHE_RSP_ACK;
   private   : Tcontrol_t                      internal_DCACHE_REQ_VAL;
   private   : Tselect_queue_t                 internal_DCACHE_REQ_SELECT_QUEUE;
@@ -190,6 +218,8 @@
   public  : void     function_speculative_load_commit_genMealy_retire (void);
 #endif					       
-#ifdef STATISTICS
-  public  : string   statistics                (uint32_t depth);
+
+#ifdef STATISTICS
+  public  : void     statistics_declaration    (morpheo::behavioural::Parameters_Statistics * param_statistics);
+  public  : string   statistics_print          (uint32_t depth);
 #endif
 					       
@@ -200,6 +230,6 @@
 #endif					       
 					       
-#ifdef VHDL_TESTBENCH			       
-  private : void     vhdl_testbench_transition (void);
+#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
+  private : void     end_cycle                 (void);
 #endif
   };
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Parameters.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Parameters.h	(revision 62)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Parameters.h	(revision 71)
@@ -12,4 +12,5 @@
 #include "Common/include/Debug.h"
 #include "Behavioural/include/Parameters.h"
+#include "Common/include/BitManipulation.h"
 #include <math.h>
 
@@ -33,4 +34,6 @@
 //public : const uint32_t            _nb_cache_port                ;
   public : const uint32_t            _nb_context                   ;
+  public : const uint32_t            _nb_front_end                 ;
+  public : const uint32_t            _nb_ooo_engine                ;
   public : const uint32_t            _nb_packet                    ;
   public : const uint32_t            _size_general_data            ;
@@ -43,8 +46,21 @@
   public : const uint32_t            _size_address_speculative_access_queue;
   public : const uint32_t            _size_context_id                      ;
+  public : const uint32_t            _size_front_end_id                    ;
+  public : const uint32_t            _size_ooo_engine_id                   ;
   public : const uint32_t            _size_packet_id                       ;
   public : const uint32_t            _size_general_register                ;
   public : const uint32_t            _size_operation                       ;
   public : const uint32_t            _size_type                            ;
+  public : const uint32_t            _size_dcache_context_id               ;
+  public : const uint32_t            _size_dcache_packet_id                ;
+
+  public : const bool                _have_port_context_id                 ;
+  public : const bool                _have_port_front_end_id               ;
+  public : const bool                _have_port_ooo_engine_id              ;
+  public : const bool                _have_port_packet_id                  ;
+  public : const bool                _have_port_dcache_context_id          ;
+
+  public : const Tdcache_address_t   _mask_address_lsb                     ;
+  public : const Tdcache_address_t   _mask_address_msb                     ;
 
     //-----[ methods ]-----------------------------------------------------------
@@ -55,4 +71,6 @@
 			Tspeculative_load_t speculative_load       ,
 			uint32_t            nb_context             ,
+			uint32_t            nb_front_end           ,
+			uint32_t            nb_ooo_engine          ,
 			uint32_t            nb_packet              ,
 			uint32_t            size_general_data      ,
@@ -65,9 +83,9 @@
   public : ~Parameters () ;
 
-  public : string msg_error (void);
+  public : std::string msg_error (void);
 
-  public :        string   print      (uint32_t depth);
-  public : friend ostream& operator<< (ostream& output_stream,
-				       morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::Parameters & x);
+  public :        std::string   print      (uint32_t depth);
+  public : friend std::ostream& operator<< (std::ostream& output_stream,
+					    morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::Parameters & x);
   };
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Statistics.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Statistics.h	(revision 62)
+++ 	(revision )
@@ -1,63 +1,0 @@
-#ifdef STATISTICS
-#ifndef morpheo_behavioural_core_multi_execute_loop_execute_loop_multi_execute_unit_execute_unit_load_store_unit_Statistics_h
-#define morpheo_behavioural_core_multi_execute_loop_execute_loop_multi_execute_unit_execute_unit_load_store_unit_Statistics_h
-
-/*
- * $Id$
- *
- * [ Description ]
- * 
- */
-
-#include "Common/include/Debug.h"
-#include "Behavioural/include/Statistics.h"
-#include "Behavioural/include/Parameters_Statistics.h"
-//#include "Behavioural/Generic/Group/include/Statistics.h"
-#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Parameters.h"
-
-//using namespace morpheo::behavioural::generic::group;
-
-namespace morpheo                    {
-namespace behavioural {
-namespace core {
-namespace multi_execute_loop {
-namespace execute_loop {
-namespace multi_execute_unit {
-namespace execute_unit {
-namespace load_store_unit {
-
-
-  class Statistics : public morpheo::behavioural::Statistics
-  {
-    // -----[ fields ]----------------------------------------------------
-  private  : const Parameters                                 * _parameters;
-
-    // -----[ methods ]---------------------------------------------------
-  public   : Statistics  (string                                        name                       ,
-			  morpheo::behavioural::Parameters_Statistics * parameters_statistics      ,
-			  Parameters                                  * parameters
-			  );
-//public   : Statistics  (Statistics & stat);
-  public   : ~Statistics () ;
-    
-  public   : string   print_body (uint32_t depth);
-  public   : string   print      (uint32_t depth);
-  public   : void     add        ();
-
-  public   : friend ostream& operator<< (ostream& output_stream,
-					 const Statistics & x);
-
-  };
-
-}; // end namespace load_store_unit
-}; // end namespace execute_unit
-}; // end namespace multi_execute_unit
-}; // end namespace execute_loop
-}; // end namespace multi_execute_loop
-}; // end namespace core
-
-}; // end namespace behavioural
-}; // end namespace morpheo
-
-#endif
-#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Types.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Types.h	(revision 62)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Types.h	(revision 71)
@@ -13,4 +13,5 @@
 #include "Common/include/FromString.h"
 #include "Common/include/ErrorMorpheo.h"
+#include <ostream>
 
 namespace morpheo {
@@ -23,4 +24,11 @@
 namespace load_store_unit {
 
+#define DCACHE_REQ_IS_LOAD(x)   (x<<1)
+#define DCACHE_REQ_IS_STORE(x) ((x<<1)|1)
+
+#define DCACHE_RSP_IS_LOAD(x)  ((x&1)==0)
+#define DCACHE_RSP_IS_STORE(x) ((x&1)==1)
+
+
   typedef enum 
     {
@@ -44,5 +52,5 @@
   typedef enum
     {
-      STORE_QUEUE_EMPTY                    //entry is empty
+      STORE_QUEUE_EMPTY                   //entry is empty
       ,STORE_QUEUE_NO_VALID_NO_SPECULATIVE //entry is the top of rob, and operation isn't arrive
       ,STORE_QUEUE_VALID_SPECULATIVE       //entry is arrive and wait the top of rob
@@ -55,9 +63,10 @@
   public    : Tstore_queue_state_t _state               ;
   public    : Tcontext_t           _context_id          ;
+  public    : Tcontext_t           _front_end_id        ;
+  public    : Tcontext_t           _ooo_engine_id       ;
   public    : Tpacket_t            _packet_id           ;
-  public    : Tdcache_type_t       _dcache_type         ;
-  public    : Tcontrol_t           _uncached            ;
+  public    : Toperation_t         _operation           ;
   public    : Tlsq_ptr_t           _load_queue_ptr_write;
-  public    : Tdcache_data_t       _address             ;
+  public    : Tdcache_address_t    _address             ;
   public    : Tgeneral_data_t      _wdata               ;
 //public    : Tcontrol_t           _write_rd            ;
@@ -65,11 +74,16 @@
   public    : Texception_t         _exception           ;
 
-    friend ostream & operator << (ostream& os, const Tstore_queue_entry_t & x) 
-    {
-      return os << " * state                   : " << x._state << endl
-		<< "   * packet   - context_id : " << toString(static_cast<uint32_t>(x._packet_id           )) << " - " << toString(static_cast<uint32_t>(x._context_id)) << endl
-		<< "   * type     - uncached   : " << toString(static_cast<uint32_t>(x._dcache_type         )) << " - " << toString(static_cast<uint32_t>(x._uncached  )) << endl
-		<< "   * load_ptr - execption  : " << toString(static_cast<uint32_t>(x._load_queue_ptr_write)) << " - " << toString(static_cast<uint32_t>(x._exception )) << endl
-		<< "   * address  - wdata      : " << toString(static_cast<uint32_t>(x._address             )) << " - " << toString(static_cast<uint32_t>(x._wdata     )) << endl;
+    friend std::ostream & operator << (std::ostream& os, const Tstore_queue_entry_t & x) 
+    {
+      return os << " * state                               : " << x._state << std::endl
+		<< "   * packet                            : " << toString(x._packet_id) << std::endl
+		<< "   * context, front_end, ooo_engine_id : " << toString(x._context_id) << " - " << toString(x._front_end_id) << " - " << toString(x._ooo_engine_id) << std::endl
+		<< "   * operation                         : " << toString(x._operation) << std::endl
+		<< "   * load_ptr                          : " << toString(x._load_queue_ptr_write) << std::endl
+		<< "   * exception                         : " << toString(x._exception) << std::endl
+		<< std::hex
+		<< "   * address                           : " << toString(x._address)<< std::endl
+		<< "   * wdata                             : " << toString(x._wdata) << std::endl
+		<< std::dec;
     }
   };
@@ -92,15 +106,28 @@
   public    : Tspeculative_access_queue_state_t  _state                ;
   public    : Tcontext_t                         _context_id           ;
+  public    : Tcontext_t                         _front_end_id         ;
+  public    : Tcontext_t                         _ooo_engine_id        ;
   public    : Tpacket_t                          _packet_id            ;
-  public    : Taccess_t                          _access               ;
-  public    : Tcontrol_t                         _uncached             ;
-  public    : Tcontrol_t                         _sign_extension       ;
+  public    : Toperation_t                       _operation            ;
   public    : Tlsq_ptr_t                         _load_queue_ptr_write ;
   public    : Tlsq_ptr_t                         _store_queue_ptr_write;
   public    : Tdcache_address_t                  _address              ;
-  public    : Tgeneral_data_t                    _rdata                ;
   public    : Tcontrol_t                         _write_rd             ;
   public    : Tgeneral_address_t                 _num_reg_rd           ;
   public    : Texception_t                       _exception            ;
+
+    friend std::ostream & operator << (std::ostream& os, const Tspeculative_access_queue_entry_t & x)
+    {
+      return os << " * state                               : " << x._state << std::endl
+		<< "   * packet                            : " << toString(x._packet_id) << std::endl
+		<< "   * context, front_end, ooo_engine_id : " << toString(x._context_id) << " - " << toString(x._front_end_id) << " - " << toString(x._ooo_engine_id) << std::endl
+		<< "   * operation                         : " << toString(x._operation) << std::endl
+		<< "   * load, store ptr_write             : " << toString(x._load_queue_ptr_write) << " - " << toString(x._store_queue_ptr_write) << std::endl
+		<< "   * exception                         : " << toString(x._exception) << std::endl
+		<< std::hex
+		<< "   * address                           : " << toString(x._address)<< std::endl
+		<< std::dec
+		<< "   * write_rd, num_reg_rd              : " << toString(x._write_rd) << " - " << toString(x._num_reg_rd)<< std::endl;
+    }
   };
 
@@ -109,4 +136,17 @@
   // ----------------------------------------------------------
 
+  //                                   HAVE_DCACHE_RSP MUST_CHECK STD::DECOD_BARRIER
+  // OPERATION_MEMORY_LOAD             X               X          -
+  // OPERATION_MEMORY_LOCK             -               -          -
+  // OPERATION_MEMORY_INVALIDATE       -               -          X
+  // OPERATION_MEMORY_PREFETCH         -               -          -
+  // OPERATION_MEMORY_FLUSH            -               -          X
+  // OPERATION_MEMORY_SYNCHRONIZATION  X               -          X
+  
+#define have_dcache_rsp(x) (is_operation_memory_load(x) or (x==OPERATION_MEMORY_SYNCHRONIZATION))
+#define must_check(x)      (is_operation_memory_load(x))
+
+#define      MASK_CHECK_BYTE_HIT    0xff // 1111_1111
+  
   typedef enum
     {
@@ -121,16 +161,38 @@
   class Tload_queue_entry_t
   {
-  public    : Tload_queue_state_t  _state               ;
-  public    : Tcontext_t           _context_id          ;
-  public    : Tpacket_t            _packet_id           ;
-  public    : Taccess_t            _access              ;
-  public    : Tcontrol_t           _uncached            ;
-  public    : Tcontrol_t           _sign_extension      ;
+  public    : Tload_queue_state_t  _state            ;
+  public    : Tcontext_t           _context_id       ;
+  public    : Tcontext_t           _front_end_id     ;
+  public    : Tcontext_t           _ooo_engine_id    ;
+  public    : Tpacket_t            _packet_id        ;
+  public    : Toperation_t         _operation        ;
   public    : Tlsq_ptr_t           _store_queue_ptr_write;
-  public    : Tdcache_address_t    _address             ;
-  public    : Tgeneral_data_t      _rdata               ;
-  public    : Tcontrol_t           _write_rd            ;
-  public    : Tgeneral_address_t   _num_reg_rd          ;
-  public    : Texception_t         _exception           ;
+  public    : Tdcache_address_t    _address          ;
+  public    : Tdcache_address_t    _check_hit_byte   ; 
+  public    : Tcontrol_t           _check_hit        ;
+  public    : Tdcache_address_t    _shift            ;
+  public    : Tcontrol_t           _is_load_signed   ;
+  public    : Taccess_t            _access_size      ;
+  public    : Tgeneral_data_t      _rdata            ;
+  public    : Tcontrol_t           _write_rd         ;
+  public    : Tgeneral_address_t   _num_reg_rd       ;
+  public    : Texception_t         _exception        ;
+
+    friend std::ostream & operator << (std::ostream& os, const Tload_queue_entry_t & x)
+    {
+      return os << " * state                               : " << x._state << std::endl
+		<< "   * packet                            : " << toString(x._packet_id) << std::endl
+		<< "   * context, front_end, ooo_engine_id : " << toString(x._context_id) << " - " << toString(x._front_end_id) << " - " << toString(x._ooo_engine_id) << std::endl
+		<< "   * operation                         : " << toString(x._operation) << std::endl
+		<< "   * store_queue_ptr_write             : " << toString(x._store_queue_ptr_write) << std::endl
+		<< "   * exception                         : " << toString(x._exception) << std::endl
+		<< "   * check_hit, check_hit_byte         : " << toString(x._check_hit) << " - " << toString(x._check_hit_byte) << std::endl
+		<< std::hex
+		<< "   * address                           : " << toString(x._address)<< std::endl
+		<< "   * rdata                             : " << toString(x._rdata) << std::endl
+		<< std::dec
+		<< "   * write_rd, num_reg_rd              : " << toString(x._write_rd) << " - " << toString(x._num_reg_rd)<< std::endl;
+    }
+
   };
 
