Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/SelfTest/configuration.cfg
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/SelfTest/configuration.cfg	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/SelfTest/configuration.cfg	(revision 71)
@@ -1,10 +1,12 @@
 Load_store_unit
-2	2	*2	# store_size_queue       
+3	3	*2	# store_size_queue       
 2	2	*2	# load_size_queue        
 2	2	*2	# size_speculative_access_queue
 2	2	+1	# nb_port_check
 2	2	+1	# speculative_load       {none,access,commit,bypass}
-2	2	*2	# nb_context             
-16	16	*2	# nb_packet              
+2	2	*2	# nb_context             1	1	*2	
+2	2	*2	# nb_front_end		 1	1	*2	
+2	2	*2	# nb_ooo_engine          1	1	*2	
+64	64	*2	# nb_packet              
 32	32	*2	# size_general_data      
 32	32	*2	# nb_general_register    
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/SelfTest/include/Cache.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/SelfTest/include/Cache.h	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/SelfTest/include/Cache.h	(revision 71)
@@ -0,0 +1,128 @@
+#ifndef CACHE_H
+#define CACHE_H
+
+#include "Common/include/BitManipulation.h"
+#include "Common/include/Debug.h"
+#include "Common/include/Log2.h"
+#include "Common/include/Test.h"
+#include "Behavioural/include/Constants.h"
+#include "Behavioural/include/Types.h"
+#include <list>
+
+//================================================================={Cache_t}
+
+typedef int32_t cycle_t;
+
+typedef struct 
+{
+  cycle_t                               _cycle     ;
+  morpheo::behavioural::Tcontext_t      _context_id;
+  morpheo::behavioural::Tpacket_t       _packet_id ;
+  morpheo::behavioural::Tdcache_data_t  _rdata     ;
+  morpheo::behavioural::Tdcache_error_t _error     ;
+} cache_rsp_t;
+
+class Cache_t
+{
+private : const uint32_t    _miss_rate;
+private : const uint32_t    _miss_penality;
+private : list<cache_rsp_t> _list_respons;
+					 
+public  : Cache_t (uint32_t miss_rate, uint32_t miss_penality):
+  _miss_rate     (miss_rate    ),
+  _miss_penality (miss_penality)
+  {
+//     srand(0);
+
+    if (miss_rate > 100)
+      throw morpheo::ErrorMorpheo(_("Miss_rate can be higher than 100"));
+  }
+
+public  : ~Cache_t (void)
+  {
+  }
+
+public  : void push (morpheo::behavioural::Tcontext_t      context_id,
+		     morpheo::behavioural::Tpacket_t       packet_id ,
+		     morpheo::behavioural::Tdcache_data_t  rdata     ,
+		     morpheo::behavioural::Tdcache_error_t error     )
+  {
+    cycle_t cycle = ((static_cast<uint32_t>(rand())%100)<_miss_rate)?_miss_penality:1;
+
+    cache_rsp_t rsp;
+
+    rsp._cycle      = cycle     ;
+    rsp._context_id = context_id;
+    rsp._packet_id  = packet_id ;
+    rsp._rdata      = rdata     ;
+    rsp._error      = error     ;
+
+    // find good place
+    list<cache_rsp_t>::iterator i;
+    for(i = _list_respons.begin(); (i != _list_respons.end()) and (i->_cycle<=cycle); i++);
+
+    _list_respons.insert(i,rsp);
+  }
+
+public  : void pop (void)
+  {
+    _list_respons.pop_front();
+  }
+
+public  : cache_rsp_t front (void)
+  {
+    return _list_respons.front();
+  }
+
+public  : bool have_rsp (void)
+  {
+    return (not _list_respons.empty()) and (_list_respons.front()._cycle <= 0);
+  }
+
+public  : void end_cycle (void)
+  {
+    for(list<cache_rsp_t>::iterator i = _list_respons.begin(); i != _list_respons.end(); i++)
+      {
+	i->_cycle --;
+      }
+  }
+
+public  : void print (void)
+  {
+    for(list<cache_rsp_t>::iterator i = _list_respons.begin(); i != _list_respons.end(); i++)
+      {
+	std::cout << "{" << i->_cycle << "}\t" 
+		  << i->_context_id << " - "
+		  << i->_packet_id  << " - "
+		  << i->_rdata      << " - "
+		  << i->_error      << std::endl;
+	  
+      }
+  }
+};
+
+inline void test_Cache_t (void)
+{
+  
+  Cache_t * cache = new Cache_t (30,12);
+
+  uint32_t cpt = 0;
+  for (uint32_t i=0; i<10; i++)
+    {
+      for (uint32_t j=0; j<5; j++)
+	cache->push(0,cpt++,0,0);
+
+      for (uint32_t j=0; j<3; j++)
+	if (cache->have_rsp())
+	  {
+	    std::cout << "pop : " << cache->front()._packet_id << std::endl;
+	    cache->pop();
+	  }
+      cache->print();
+      cache->end_cycle();
+    }
+
+  delete cache;
+}
+
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/SelfTest/include/Memory.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/SelfTest/include/Memory.h	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/SelfTest/include/Memory.h	(revision 71)
@@ -0,0 +1,335 @@
+#ifndef MEMORY_H
+#define MEMORY_H
+
+#include <list>
+#include "systemc.h"
+#include "Common/include/BitManipulation.h"
+#include "Common/include/Debug.h"
+#include "Common/include/Log2.h"
+#include "Common/include/Test.h"
+#include "Behavioural/include/Constants.h"
+#include "Behavioural/include/Types.h"
+
+//================================================================{Memory_t}
+typedef struct 
+{
+  double                                  _cycle   ;
+  uint32_t                                _context ;
+  morpheo::behavioural::Tdcache_address_t _address ;
+  morpheo::behavioural::Tdcache_type_t    _type    ;
+  morpheo::behavioural::Tdcache_data_t    _data_old;
+  morpheo::behavioural::Tdcache_data_t    _data_new;
+} trace_memory_t;
+
+class Memory_t
+{
+private : const uint32_t          _nb_context;
+private : const uint32_t          _nb_word   ;
+private : const uint32_t          _size_word ;
+private : const uint32_t          _shift_addr;
+private : const morpheo::behavioural::Tdcache_address_t _mask_addr ;
+private :       morpheo::behavioural::Tdcache_data_t ** _data      ;
+  
+private : std::list<trace_memory_t> _trace_memory;
+
+public  : Memory_t (uint32_t nb_context, 
+		    uint32_t nb_word, 
+		    uint32_t size_word):
+  _nb_context   (nb_context),
+  _nb_word      (nb_word   ),
+  _size_word    (size_word ),
+  _shift_addr   (morpheo::log2(size_word/8)),
+  _mask_addr    (morpheo::gen_mask<morpheo::behavioural::Tdcache_address_t>(_shift_addr))
+  {
+    _data = new morpheo::behavioural::Tdcache_data_t * [nb_context];
+    
+    for (uint32_t i=0; i<nb_context; i++)
+      {
+	_data [i] = new morpheo::behavioural::Tdcache_data_t [nb_word];
+	
+	// random data
+	for (uint32_t j=0; j<nb_word; j++)
+	  _data [i][j] = static_cast<morpheo::behavioural::Tdcache_data_t>(rand());
+      }
+
+    cout << "=====[ Memory's information ]" << endl
+	 << "  * _nb_context : " << _nb_context << endl
+	 << "  * _nb_word    : " << _nb_word    << endl
+	 << "  * _size_word  : " << _size_word  << endl
+	 << "  * _shift_addr : " << _shift_addr << endl
+	 << "  * _mask_addr  : " << hex << _mask_addr << dec << endl;
+  }
+
+public  : ~Memory_t (void)
+  {
+    delete [] _data;
+  }
+
+public  : morpheo::behavioural::Tdcache_data_t access (uint32_t          context, 
+						       morpheo::behavioural::Tdcache_address_t address,
+						       morpheo::behavioural::Tdcache_type_t    type,
+						       morpheo::behavioural::Tdcache_data_t    data)
+  {
+    cout << "<Memory::access>" << endl
+	 << " * context : " << context << endl
+	 << " * address : " << hex << address << dec << endl
+	 << " * type    : " << type << endl
+	 << " * wdata   : " << hex << data << dec << endl;
+
+    morpheo::behavioural::Tdcache_data_t rdata;
+
+    if (type == DCACHE_LOAD)
+      rdata = read  (context, address, type);
+    else
+      if ((type == DCACHE_STORE_8 ) or
+	  (type == DCACHE_STORE_16) or
+	  (type == DCACHE_STORE_32) or
+	  (type == DCACHE_STORE_64) )
+	rdata = write (context, address, type, data);
+      else
+	rdata = other (context, address, type);
+
+    cout << " * rdata   : " << hex << rdata << dec << endl;
+
+    return rdata;
+  }
+
+public  : morpheo::behavioural::Tdcache_data_t read_lsq (uint32_t          context,
+							 morpheo::behavioural::Tdcache_address_t address,
+							 morpheo::behavioural::Tdcache_type_t    type)
+  {
+    if (context>_nb_context)
+      TEST_KO("<Memory_t::read> nb context is too high");
+
+    morpheo::behavioural::Tdcache_address_t LSB = address &  _mask_addr;
+    morpheo::behavioural::Tdcache_address_t MSB = address >> _shift_addr;
+
+    if (MSB >_nb_word)
+      TEST_KO("<Memory_t::read> address is too high : %8.x", address);
+    
+    morpheo::behavioural::Tdcache_data_t data = _data [context][MSB] >> (LSB<<3);
+
+    switch (type)
+      {
+      case OPERATION_MEMORY_LOAD_8_Z  : 
+      case OPERATION_MEMORY_LOAD_16_Z : 
+      case OPERATION_MEMORY_LOAD_32_Z : 
+      case OPERATION_MEMORY_LOAD_64_Z : 
+      case OPERATION_MEMORY_LOAD_8_S  : 
+      case OPERATION_MEMORY_LOAD_16_S : 
+      case OPERATION_MEMORY_LOAD_32_S : 
+      case OPERATION_MEMORY_LOAD_64_S : return morpheo::extend<morpheo::behavioural::Tdcache_data_t>(_size_word,data, is_operation_memory_load_signed(type),memory_size(type));
+      default : TEST_KO("<Memory_t::read_lsq> invalide type"); return data;
+      }
+  }
+
+private : morpheo::behavioural::Tdcache_data_t read (uint32_t context,
+						     morpheo::behavioural::Tdcache_address_t address,
+						     morpheo::behavioural::Tdcache_type_t type)
+  {
+    // Address's Read must be aligned
+
+    if ((address & _mask_addr) != 0)
+      TEST_KO("<Memory_t::read> Address is not aligned");
+
+    if (context>_nb_context)
+      TEST_KO("<Memory_t::read> nb context is too high");
+
+    morpheo::behavioural::Tdcache_address_t MSB = address >> _shift_addr;
+
+    if (MSB >_nb_word)
+      TEST_KO("<Memory_t::read> address is too high");
+
+    morpheo::behavioural::Tdcache_data_t rdata = _data [context][MSB];
+    trace_memory_t trace;
+
+    trace._cycle    = sc_simulation_time();
+    trace._context  = context;
+    trace._address  = address;
+    trace._type     = type;
+    trace._data_old = rdata;
+    trace._data_new = rdata;
+
+    _trace_memory.push_back(trace);
+    
+    return rdata;
+  }
+
+private : morpheo::behavioural::Tdcache_data_t write (uint32_t context, 
+						      morpheo::behavioural::Tdcache_address_t address,
+						      morpheo::behavioural::Tdcache_type_t type,
+						      morpheo::behavioural::Tdcache_data_t data)
+  {
+    cout << "   * write" << endl;
+
+    if (context>_nb_context)
+      TEST_KO("<Memory_t::read> nb context is too high");
+
+    if (address>_nb_word)
+      TEST_KO("<Memory_t::read> address is too high");
+
+    morpheo::behavioural::Tdcache_address_t LSB = address &  _mask_addr;
+    morpheo::behavioural::Tdcache_address_t MSB = address >> _shift_addr;
+
+    cout << hex
+	 << "     * LSB         : " << LSB << endl
+	 << "     * MSB         : " << MSB << endl
+	 << dec;
+  
+    morpheo::behavioural::Tdcache_data_t data_old    = _data [context][MSB];
+
+    // exemple to size_word = 32b
+    // LSB index_min
+    // 0   0
+    // 1   8
+    // 2   16
+    // 3   24
+
+    uint32_t memory_size = ((type==DCACHE_STORE_16)?MEMORY_SIZE_16:
+			    ((type==DCACHE_STORE_32)?MEMORY_SIZE_32:
+			     ((type==DCACHE_STORE_64 )?MEMORY_SIZE_64:MEMORY_SIZE_8)));
+
+    uint32_t index_min = LSB<<3; // *8
+    uint32_t index_max = index_min+memory_size;
+
+    cout << "     * type        : " << type << endl
+	 << "     * memory_size : " << memory_size << endl
+	 << "     * index_min   : " << index_min << endl
+	 << "     * index_max   : " << index_max << endl;
+    
+    morpheo::behavioural::Tdcache_data_t data_insert = data<<index_min; // the data is aligned at LSB
+
+//     cout << "read :" << endl
+// 	 << " * context     : " << context << endl
+// 	 << hex		    
+// 	 << " * address     : " << address << endl
+// 	 << "   * LSB       : " << LSB       << endl
+// 	 << "   * MSB       : " << MSB       << endl
+// 	 << dec
+// 	 << "   * index_min : " << index_min << endl
+// 	 << "   * index_max : " << index_max << endl
+// 	 << " * type        : " << type    << endl;
+
+    if (index_max > _size_word)
+      TEST_KO("<Memory_t::read> illegal value of index_max : %d, size_word is %d.",index_max,_size_word);
+
+    morpheo::behavioural::Tdcache_data_t data_new = morpheo::insert<morpheo::behavioural::Tdcache_data_t>(data_old, data_insert, index_max-1, index_min);
+
+    _data [context][MSB] = data_new;
+    
+    cout << hex
+	 << "     * data_old    : " << data_old << endl
+	 << "     * data_new    : " << data_new << endl
+	 << dec;
+
+
+    trace_memory_t trace;
+
+    trace._cycle    = sc_simulation_time();
+    trace._context  = context;
+    trace._address  = address;
+    trace._type     = type;
+    trace._data_old = data_old;
+    trace._data_new = data_new;
+
+    _trace_memory.push_back(trace);
+  
+    return data_old;
+  }
+
+private : morpheo::behavioural::Tdcache_data_t other (uint32_t context,
+						      morpheo::behavioural::Tdcache_address_t address,
+						      morpheo::behavioural::Tdcache_type_t type)
+  {
+    trace_memory_t trace;
+
+    trace._cycle    = sc_simulation_time();
+    trace._context  = context;
+    trace._address  = address;
+    trace._type     = type;
+    trace._data_old = 0;
+    trace._data_new = 0;
+
+    _trace_memory.push_back(trace);
+
+    return 0;
+  }
+
+public : void trace (void)
+  {
+    for (std::list<trace_memory_t>::iterator i=_trace_memory.begin(); i!= _trace_memory.end(); i++)
+      {
+	std::cout << "{" << i->_cycle << "}\t"
+		  << i->_context << " - ";
+
+	switch(i->_type)
+	  {
+	  case DCACHE_LOAD            : std::cout << "DCACHE_LOAD           "; break;
+	  case DCACHE_LOCK            : std::cout << "DCACHE_LOCK           "; break;
+	  case DCACHE_INVALIDATE      : std::cout << "DCACHE_INVALIDATE     "; break;
+	  case DCACHE_PREFETCH        : std::cout << "DCACHE_PREFETCH       "; break;
+	  case DCACHE_FLUSH           : std::cout << "DCACHE_FLUSH          "; break;
+	  case DCACHE_SYNCHRONIZATION : std::cout << "DCACHE_SYNCHRONIZATION"; break;
+	  case DCACHE_STORE_8         : std::cout << "DCACHE_STORE_8        "; break;
+	  case DCACHE_STORE_16        : std::cout << "DCACHE_STORE_16       "; break;
+	  case DCACHE_STORE_32        : std::cout << "DCACHE_STORE_32       "; break;
+	  case DCACHE_STORE_64        : std::cout << "DCACHE_STORE_64       "; break;
+	  }
+	std::cout << " - "
+		  << hex
+		  << i->_address << " : "
+		  << i->_data_old << " -> "
+		  << i->_data_new << std::endl
+		  << hex;
+      }
+  }
+};
+
+inline void test_Memory_t (void)
+{
+  const uint32_t _nb_context =   4;
+  const uint32_t _size_word  =  32;
+  const uint32_t _nb_word    = 100; 
+  
+  Memory_t * memory = new Memory_t (_nb_context, _nb_word, _size_word);
+  
+  memory -> access (2, 0x10, DCACHE_STORE_32, 0xdeadbeef);
+  memory -> access (2, 0x14, DCACHE_STORE_16, 0xdada5678);
+  memory -> access (2, 0x16, DCACHE_STORE_16, 0xbead1234);
+  memory -> access (2, 0x18, DCACHE_STORE_8 , 0x45675681);
+  memory -> access (2, 0x19, DCACHE_STORE_8 , 0x1f311219);
+  memory -> access (2, 0x1a, DCACHE_STORE_8 , 0x2e075607);
+  memory -> access (2, 0x1b, DCACHE_STORE_8 , 0x19811221);
+  
+  TEST(morpheo::behavioural::Tdcache_data_t, memory -> access (2, 0x10, DCACHE_LOAD, 0), 0xdeadbeef);
+  TEST(morpheo::behavioural::Tdcache_data_t, memory -> access (2, 0x14, DCACHE_LOAD, 0), 0x12345678);
+  TEST(morpheo::behavioural::Tdcache_data_t, memory -> access (2, 0x18, DCACHE_LOAD, 0), 0x21071981);
+
+  TEST(morpheo::behavioural::Tdcache_data_t, memory -> read_lsq (2, 0x10, OPERATION_MEMORY_LOAD_8_Z ), 0x000000ef);
+  TEST(morpheo::behavioural::Tdcache_data_t, memory -> read_lsq (2, 0x10, OPERATION_MEMORY_LOAD_8_S ), 0xffffffef);
+  TEST(morpheo::behavioural::Tdcache_data_t, memory -> read_lsq (2, 0x10, OPERATION_MEMORY_LOAD_16_Z), 0x0000beef);
+  TEST(morpheo::behavioural::Tdcache_data_t, memory -> read_lsq (2, 0x10, OPERATION_MEMORY_LOAD_16_S), 0xffffbeef);
+  TEST(morpheo::behavioural::Tdcache_data_t, memory -> read_lsq (2, 0x10, OPERATION_MEMORY_LOAD_32_Z), 0xdeadbeef);
+  TEST(morpheo::behavioural::Tdcache_data_t, memory -> read_lsq (2, 0x10, OPERATION_MEMORY_LOAD_32_S), 0xdeadbeef);
+
+  TEST(morpheo::behavioural::Tdcache_data_t, memory -> read_lsq (2, 0x12, OPERATION_MEMORY_LOAD_8_Z ), 0x000000ad);
+  TEST(morpheo::behavioural::Tdcache_data_t, memory -> read_lsq (2, 0x12, OPERATION_MEMORY_LOAD_8_S ), 0xffffffad);
+  TEST(morpheo::behavioural::Tdcache_data_t, memory -> read_lsq (2, 0x12, OPERATION_MEMORY_LOAD_16_Z), 0x0000dead);
+  TEST(morpheo::behavioural::Tdcache_data_t, memory -> read_lsq (2, 0x12, OPERATION_MEMORY_LOAD_16_S), 0xffffdead);
+
+  TEST(morpheo::behavioural::Tdcache_data_t, memory -> read_lsq (2, 0x14, OPERATION_MEMORY_LOAD_8_Z ), 0x00000078);
+  TEST(morpheo::behavioural::Tdcache_data_t, memory -> read_lsq (2, 0x14, OPERATION_MEMORY_LOAD_8_S ), 0x00000078);
+  TEST(morpheo::behavioural::Tdcache_data_t, memory -> read_lsq (2, 0x18, OPERATION_MEMORY_LOAD_16_Z), 0x00001981);
+  TEST(morpheo::behavioural::Tdcache_data_t, memory -> read_lsq (2, 0x18, OPERATION_MEMORY_LOAD_16_S), 0x00001981);
+  TEST(morpheo::behavioural::Tdcache_data_t, memory -> read_lsq (2, 0x18, OPERATION_MEMORY_LOAD_32_Z), 0x21071981);
+  TEST(morpheo::behavioural::Tdcache_data_t, memory -> read_lsq (2, 0x18, OPERATION_MEMORY_LOAD_32_S), 0x21071981);
+
+  TEST(morpheo::behavioural::Tdcache_data_t, memory -> read_lsq (2, 0x1a, OPERATION_MEMORY_LOAD_8_Z ), 0x00000007);
+  TEST(morpheo::behavioural::Tdcache_data_t, memory -> read_lsq (2, 0x1a, OPERATION_MEMORY_LOAD_8_S ), 0x00000007);
+  TEST(morpheo::behavioural::Tdcache_data_t, memory -> read_lsq (2, 0x1a, OPERATION_MEMORY_LOAD_16_Z), 0x00002107);
+  TEST(morpheo::behavioural::Tdcache_data_t, memory -> read_lsq (2, 0x1a, OPERATION_MEMORY_LOAD_16_S), 0x00002107);
+
+  delete memory;
+}
+
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/SelfTest/include/MemoryRequest.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/SelfTest/include/MemoryRequest.h	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/SelfTest/include/MemoryRequest.h	(revision 71)
@@ -0,0 +1,139 @@
+#ifndef MEMORYREQUEST_H
+#define MEMORYREQUEST_H
+
+#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Load_store_unit.h"
+
+//========================================================={MemoryRequest_t}
+class MemoryRequest_t
+{
+public : double                                   _cycle                ;
+public : morpheo::behavioural::Tcontext_t         _context_id           ;
+public : morpheo::behavioural::Tcontext_t         _front_end_id         ;
+public : morpheo::behavioural::Tcontext_t         _ooo_engine_id        ;
+public : morpheo::behavioural::Tpacket_t          _packet_id            ;
+public : morpheo::behavioural::Toperation_t       _operation            ;
+public : morpheo::behavioural::Ttype_t            _type                 ;
+public : morpheo::behavioural::Tlsq_ptr_t         _store_queue_ptr_write;
+public : morpheo::behavioural::Tlsq_ptr_t         _load_queue_ptr_write ;
+public : morpheo::behavioural::Tgeneral_data_t    _immediat             ;
+public : morpheo::behavioural::Tgeneral_data_t    _data_ra              ;
+public : morpheo::behavioural::Tgeneral_data_t    _data_rb              ;
+public : morpheo::behavioural::Tcontrol_t         _write_rd             ;
+public : morpheo::behavioural::Tgeneral_address_t _num_reg_rd           ;
+public : bool                                     _write_spec_ko        ;
+public : bool                                     _previous_load_speculative;
+public : morpheo::behavioural::Tgeneral_data_t    _data_wait            ;
+
+  MemoryRequest_t (void) 
+  {
+    _cycle                 = 0;
+    _context_id            = 0;
+    _front_end_id          = 0;
+    _ooo_engine_id         = 0;
+    _packet_id             = 0;
+    _operation             = 0;
+    _type                  = 0;
+    _store_queue_ptr_write = 0;
+    _load_queue_ptr_write  = 0;
+    _immediat              = 0;
+    _data_ra               = 0;
+    _data_rb               = 0;
+    _write_rd              = 0;
+    _num_reg_rd            = 0;
+    _write_spec_ko         = 0;
+    _previous_load_speculative = 0;
+    _data_wait             = 0;
+  };
+
+  MemoryRequest_t (double             cycle                ,
+		   morpheo::behavioural::Tcontext_t         context_id           ,
+		   morpheo::behavioural::Tcontext_t         front_end_id         ,
+		   morpheo::behavioural::Tcontext_t         ooo_engine_id        ,
+		   morpheo::behavioural::Tpacket_t          packet_id            ,
+		   morpheo::behavioural::Toperation_t       operation            ,
+		   morpheo::behavioural::Ttype_t            type                 ,
+		   morpheo::behavioural::Tlsq_ptr_t         store_queue_ptr_write,
+		   morpheo::behavioural::Tlsq_ptr_t         load_queue_ptr_write ,
+		   morpheo::behavioural::Tgeneral_data_t    immediat             ,
+		   morpheo::behavioural::Tgeneral_data_t    data_ra              ,
+		   morpheo::behavioural::Tgeneral_data_t    data_rb              ,
+		   morpheo::behavioural::Tcontrol_t         write_rd             ,
+		   morpheo::behavioural::Tgeneral_address_t num_reg_rd           ,
+		   bool                                     write_spec_ko        ,
+		   morpheo::behavioural::Tgeneral_data_t    data_wait=0)
+  {
+    _cycle                 = cycle                ;
+    _context_id            = context_id           ;
+    _front_end_id          = front_end_id         ;
+    _ooo_engine_id         = ooo_engine_id        ;
+    _packet_id             = packet_id            ;
+    _operation             = operation            ;
+    _type                  = type                 ;
+    _store_queue_ptr_write = store_queue_ptr_write;
+    _load_queue_ptr_write  = load_queue_ptr_write ;
+    _immediat              = immediat             ;
+    _data_ra               = data_ra              ;
+    _data_rb               = data_rb              ;
+    _write_rd              = write_rd             ;
+    _num_reg_rd            = num_reg_rd           ;
+    _write_spec_ko         = write_spec_ko        ;
+    _previous_load_speculative = 0;
+    _data_wait             = data_wait            ;
+  }
+
+  void modif (double             cycle                ,
+	      morpheo::behavioural::Tcontext_t         context_id           ,
+	      morpheo::behavioural::Tcontext_t         front_end_id         ,
+	      morpheo::behavioural::Tcontext_t         ooo_engine_id        ,
+	      morpheo::behavioural::Tpacket_t          packet_id            ,
+	      morpheo::behavioural::Toperation_t       operation            ,
+	      morpheo::behavioural::Ttype_t            type                 ,
+	      morpheo::behavioural::Tlsq_ptr_t         store_queue_ptr_write,
+	      morpheo::behavioural::Tlsq_ptr_t         load_queue_ptr_write ,
+	      morpheo::behavioural::Tgeneral_data_t    immediat             ,
+	      morpheo::behavioural::Tgeneral_data_t    data_ra              ,
+	      morpheo::behavioural::Tgeneral_data_t    data_rb              ,
+	      morpheo::behavioural::Tcontrol_t         write_rd             ,
+	      morpheo::behavioural::Tgeneral_address_t num_reg_rd           ,
+	      bool                                     write_spec_ko        ,
+	      morpheo::behavioural::Tgeneral_data_t    data_wait=0          )
+  {
+    _cycle                 = cycle                ;
+    _context_id            = context_id           ;
+    _front_end_id          = front_end_id         ;
+    _ooo_engine_id         = ooo_engine_id        ;
+    _packet_id             = packet_id            ;
+    _operation             = operation            ;
+    _type                  = type                 ;
+    _store_queue_ptr_write = store_queue_ptr_write;
+    _load_queue_ptr_write  = load_queue_ptr_write ;
+    _immediat              = immediat             ;
+    _data_ra               = data_ra              ;
+    _data_rb               = data_rb              ;
+    _write_rd              = write_rd             ;
+    _num_reg_rd            = num_reg_rd           ;
+    _write_spec_ko         = write_spec_ko        ;
+    _previous_load_speculative = 0;
+    _data_wait             = data_wait            ;
+  }
+
+  bool operator< (const MemoryRequest_t & right) const 
+  {
+    return _cycle > right._cycle; 
+  }
+
+  friend std::ostream& operator<<(std::ostream & os, const MemoryRequest_t & x)
+  {
+    return os << "<" << morpheo::toString(x._cycle) << "> : "
+	      << "{" << morpheo::toString(static_cast<uint32_t>(x._packet_id)) << "}" << endl
+	      << "\t * context / front_end / ooo_engine  : " << morpheo::toString(static_cast<uint32_t>(x._context_id   )) << " - " << morpheo::toString(static_cast<uint32_t>(x._front_end_id )) << " - " << morpheo::toString(static_cast<uint32_t>(x._ooo_engine_id)) << endl
+	      << "\t * operation  / type / write_spec_ko : " << morpheo::toString(static_cast<uint32_t>(x._operation)) << " " << morpheo::toString(static_cast<uint32_t>(x._type)) << " " << morpheo::toString(static_cast<uint32_t>(x._write_spec_ko)) << endl
+	      << "\t * ptr_write store/load              : " << morpheo::toString(static_cast<uint32_t>(x._store_queue_ptr_write)) << " " << morpheo::toString(static_cast<uint32_t>(x._load_queue_ptr_write)) << endl
+	      << "\t * immediat / data_ra / data_rb      : " << morpheo::toString(static_cast<uint32_t>(x._immediat)) << " - " << morpheo::toString(static_cast<uint32_t>(x._data_ra)) << " - " << morpheo::toString(static_cast<uint32_t>(x._data_rb)) << endl
+	      << "\t * write_rd / num_reg_rd             : " << morpheo::toString(static_cast<uint32_t>(x._write_rd)) << " " << morpheo::toString(static_cast<uint32_t>(x._num_reg_rd)) << endl
+	      << "\t * data_wait                         : " << morpheo::toString(static_cast<uint32_t>(x._data_wait)) << endl;
+  }
+
+};
+
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/SelfTest/include/test.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/SelfTest/include/test.h	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/SelfTest/include/test.h	(revision 71)
@@ -7,4 +7,13 @@
  */
 
+
+#include "Common/include/Time.h"
+
+#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/SelfTest/include/MemoryRequest.h"
+#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/SelfTest/include/Memory.h"
+
+#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/SelfTest/include/Cache.h"
+#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Load_store_unit.h"
+
 #ifdef SYSTEMC
 #include "systemc.h"
@@ -13,7 +22,4 @@
 #include <string>
 #include <iostream>
-#include <sys/time.h>
-
-#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Load_store_unit.h"
 
 using namespace std;
@@ -25,39 +31,8 @@
 using namespace morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit;
 using namespace morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit;
-
 using namespace morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit;
 
-void test    (string name,
+void test1   (string name,
 	      morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::Parameters * param);
 
-class Time 
-{
-private : timeval time_begin;
-// private : timeval time_end;
-  
-public  : Time ()
-  {
-    gettimeofday(&time_begin     ,NULL);
-  };
-
-public  : ~Time ()
-  {
-    cout << *this;
-  };
-
-public  : friend ostream& operator<< (ostream& output_stream,
-				      const Time & x)
-  {
-    timeval time_end;
-    
-    gettimeofday(&time_end       ,NULL);
-    
-    uint32_t nb_cycles = static_cast<uint32_t>(sc_simulation_time());
-
-    double average = static_cast<double>(nb_cycles) / static_cast<double>(time_end.tv_sec-x.time_begin.tv_sec);
-    
-    output_stream << nb_cycles << "\t(" << average << " cycles / seconds )" << endl;
-
-    return output_stream;
-  }
-};
+void test2   (void);
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/SelfTest/src/main.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/SelfTest/src/main.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/SelfTest/src/main.cpp	(revision 71)
@@ -8,5 +8,7 @@
 #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/SelfTest/include/test.h"
 
-#define NB_PARAMS 11
+#define number_of_test 2
+
+#define NB_PARAMS 13
 
 void usage (int argc, char * argv[])
@@ -20,4 +22,6 @@
        << " - speculative_load        (uint32_t)" << endl
        << " - nb_context              (uint32_t)" << endl
+       << " - nb_front_end            (uint32_t)" << endl
+       << " - nb_ooo_engine           (uint32_t)" << endl
        << " - nb_packet               (uint32_t)" << endl
        << " - size_general_data       (uint32_t)" << endl
@@ -40,52 +44,94 @@
 #endif
 {
-  if (argc != 2+NB_PARAMS)
-    usage (argc, argv);
+  switch (number_of_test)
+    {
+    case 1 :
+      {
+	
+	if (argc != 2+NB_PARAMS)
+	  usage (argc, argv);
+	
+	uint32_t x=1;
+	
+	const string              name                     = argv[x++];
+	const uint32_t            _size_store_queue        = atoi(argv[x++]);
+	const uint32_t            _size_load_queue         = atoi(argv[x++]);
+	const uint32_t            _size_speculative_access_queue = atoi(argv[x++]);
+	const uint32_t            _nb_port_check           = atoi(argv[x++]);
+	const Tspeculative_load_t _speculative_load        = fromString<Tspeculative_load_t>(argv[x++]);
+	const uint32_t            _nb_context              = atoi(argv[x++]);
+	const uint32_t            _nb_front_end            = atoi(argv[x++]);
+	const uint32_t            _nb_ooo_engine           = atoi(argv[x++]);
+	const uint32_t            _nb_packet               = atoi(argv[x++]);
+	const uint32_t            _size_general_data       = atoi(argv[x++]);
+	const uint32_t            _nb_general_register     = atoi(argv[x++]);
+	const uint32_t            _nb_operation            = atoi(argv[x++]);
+	const uint32_t            _nb_type                 = atoi(argv[x++]);
+	
+	try 
+	  {
+	    morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::Parameters * param = new morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::Parameters
+	      (
+	       _size_store_queue       ,
+	       _size_load_queue        ,
+	       _size_speculative_access_queue,
+	       _nb_port_check          ,
+	       _speculative_load       ,
+	       _nb_context             ,
+	       _nb_front_end           ,
+	       _nb_ooo_engine          ,
+	       _nb_packet              ,
+	       _size_general_data      ,
+	       _nb_general_register    ,
+	       _nb_operation           ,
+	       _nb_type                
+	       );
+	    
+	    cout << param->print(1);
+	    
+	    test1 (name,param);
+	    
+	  }
+	catch (morpheo::ErrorMorpheo & error)
+	  {
+	    cout << "<" << name << "> : " <<  error.what ();
+	    exit (EXIT_FAILURE);
+	  }
+	catch (...)
+	  {
+	    cerr << "<" << name << "> : This test must generate a error" << endl;
+	    exit (EXIT_FAILURE);
+	  }
+	
+	break;
+      }
+    case 2 :
+      {
+	try 
+	  {
+	    test2 ();
+	  }
+	catch (morpheo::ErrorMorpheo & error)
+	  {
+	    cout << error.what ();
+	    exit (EXIT_FAILURE);
+	  }
+	catch (...)
+	  {
+	    cerr << "This test must generate a error" << endl;
+	    exit (EXIT_FAILURE);
+	  }
+	
+	break;
+      }
+    default :
+      {
+	std::cerr << "Invalid number of test" << std::endl;
+	exit (EXIT_FAILURE);
 
-  const string              name                     = argv[1];
-  const uint32_t            _size_store_queue        = atoi(argv[ 2]);
-  const uint32_t            _size_load_queue         = atoi(argv[ 3]);
-  const uint32_t            _size_speculative_access_queue = atoi(argv[ 4]);
-  const uint32_t            _nb_port_check           = atoi(argv[ 5]);
-  const Tspeculative_load_t _speculative_load        = fromString<Tspeculative_load_t>(argv[ 6]);
-  const uint32_t            _nb_context              = atoi(argv[ 7]);
-  const uint32_t            _nb_packet               = atoi(argv[ 8]);
-  const uint32_t            _size_general_data       = atoi(argv[ 9]);
-  const uint32_t            _nb_general_register     = atoi(argv[10]);
-  const uint32_t            _nb_operation            = atoi(argv[11]);
-  const uint32_t            _nb_type                 = atoi(argv[12]);
-
-  try 
-    {
-      morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::Parameters * param = new morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::Parameters
-	(
-	 _size_store_queue       ,
-	 _size_load_queue        ,
-	 _size_speculative_access_queue,
-	 _nb_port_check          ,
-	 _speculative_load       ,
-	 _nb_context             ,
-	 _nb_packet              ,
-	 _size_general_data      ,
-	 _nb_general_register    ,
-	 _nb_operation           ,
-	 _nb_type                
-        );
-      
-      cout << param->print(1);
-      
-      test (name,param);
+	break;
+      }
     }
-  catch (morpheo::ErrorMorpheo & error)
-    {
-      cout << "<" << name << "> : " <<  error.what ();
-      exit (EXIT_FAILURE);
-    }
-  catch (...)
-    {
-      cerr << "<" << name << "> : This test must generate a error" << endl;
-      exit (EXIT_FAILURE);
-    }
-
+  
   return (EXIT_SUCCESS);
 }
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/SelfTest/src/test.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/SelfTest/src/test.cpp	(revision 70)
+++ 	(revision )
@@ -1,760 +1,0 @@
-/*
- * $Id$
- *
- * [ Description ]
- * 
- * Test
- */
-
-#include <queue>
-#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/SelfTest/include/test.h"
-#include "Common/include/Test.h"
-#include "Common/include/BitManipulation.h"
-
-#define NB_ITERATION  1
-#define CYCLE_MAX     (128*NB_ITERATION)
-
-#define LABEL(str)                                                                       \
-{                                                                                        \
-  cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} " << str << endl; \
-} while(0)
-
-static uint32_t cycle = 0;
-
-#define SC_START(cycle_offset)                                          \
-do                                                                      \
-{                                                                       \
-/*cout << "SC_START (begin)" << endl;*/                                 \
-                                                                        \
-  uint32_t cycle_current = static_cast<uint32_t>(sc_simulation_time()); \
-  if (cycle_current != cycle)                                           \
-    {                                                                   \
-      cycle = cycle_current;                                            \
-      cout << "##########[ cycle "<< cycle << " ]" << endl;             \
-    }                                                                   \
-                                                                        \
-  if (cycle_current > CYCLE_MAX)                                        \
-    {                                                                   \
-      TEST_KO("Maximal cycles Reached");                                \
-    }                                                                   \
-  sc_start(cycle_offset);                                               \
-/*cout << "SC_START (end  )" << endl;*/                                 \
-} while(0)
-
-
-
-//========================================================={MemoryRequest_t}
-class MemoryRequest_t
-{
-public : double             _cycle                ;
-public : Tcontext_t         _context_id           ;
-public : Tpacket_t          _packet_id            ;
-public : Toperation_t       _operation            ;
-public : Ttype_t            _type                 ;
-public : Tlsq_ptr_t         _store_queue_ptr_write;
-public : Tlsq_ptr_t         _load_queue_ptr_write ;
-public : Tgeneral_data_t    _immediat             ;
-public : Tgeneral_data_t    _data_ra              ;
-public : Tgeneral_data_t    _data_rb              ;
-public : Tcontrol_t         _write_rd             ;
-public : Tgeneral_address_t _num_reg_rd           ;
-public : bool               _write_spec_ko        ;
-
-  MemoryRequest_t (void) 
-  {
-    _cycle                 = 0;
-    _context_id            = 0;
-    _packet_id             = 0;
-    _operation             = 0;
-    _type                  = 0;
-    _store_queue_ptr_write = 0;
-    _load_queue_ptr_write  = 0;
-    _immediat              = 0;
-    _data_ra               = 0;
-    _data_rb               = 0;
-    _write_rd              = 0;
-    _num_reg_rd            = 0;
-    _write_spec_ko         = 0;
-  };
-
-  MemoryRequest_t (double             cycle                ,
-		   Tcontext_t         context_id           ,
-		   Tpacket_t          packet_id            ,
-		   Toperation_t       operation            ,
-		   Ttype_t            type                 ,
-		   Tlsq_ptr_t         store_queue_ptr_write,
-		   Tlsq_ptr_t         load_queue_ptr_write ,
-		   Tgeneral_data_t    immediat             ,
-		   Tgeneral_data_t    data_ra              ,
-		   Tgeneral_data_t    data_rb              ,
-		   Tcontrol_t         write_rd             ,
-		   Tgeneral_address_t num_reg_rd           ,
-		   bool               write_spec_ko        )
-  {
-    _cycle                 = cycle                ;
-    _context_id            = context_id           ;
-    _packet_id             = packet_id            ;
-    _operation             = operation            ;
-    _type                  = type                 ;
-    _store_queue_ptr_write = store_queue_ptr_write;
-    _load_queue_ptr_write  = load_queue_ptr_write ;
-    _immediat              = immediat             ;
-    _data_ra               = data_ra              ;
-    _data_rb               = data_rb              ;
-    _write_rd              = write_rd             ;
-    _num_reg_rd            = num_reg_rd           ;
-    _write_spec_ko         = write_spec_ko        ;
-  }
-
-  void modif (double             cycle                ,
-	      Tcontext_t         context_id           ,
-	      Tpacket_t          packet_id            ,
-	      Toperation_t       operation            ,
-	      Ttype_t            type                 ,
-	      Tlsq_ptr_t         store_queue_ptr_write,
-	      Tlsq_ptr_t         load_queue_ptr_write ,
-	      Tgeneral_data_t    immediat             ,
-	      Tgeneral_data_t    data_ra              ,
-	      Tgeneral_data_t    data_rb              ,
-	      Tcontrol_t         write_rd             ,
-	      Tgeneral_address_t num_reg_rd           ,
-	      bool               write_spec_ko        )
-  {
-    _cycle                 = cycle                ;
-    _context_id            = context_id           ;
-    _packet_id             = packet_id            ;
-    _operation             = operation            ;
-    _type                  = type                 ;
-    _store_queue_ptr_write = store_queue_ptr_write;
-    _load_queue_ptr_write  = load_queue_ptr_write ;
-    _immediat              = immediat             ;
-    _data_ra               = data_ra              ;
-    _data_rb               = data_rb              ;
-    _write_rd              = write_rd             ;
-    _num_reg_rd            = num_reg_rd           ;
-    _write_spec_ko         = write_spec_ko        ;
-  }
-
-  bool operator< (const MemoryRequest_t & right) const 
-  {
-    return _cycle > right._cycle; 
-  }
-
-  friend ostream& operator<<(ostream &, const MemoryRequest_t &);
-};
-
-ostream & operator << (ostream& os, const MemoryRequest_t & x) 
-{
-  return os << "<" << toString(x._cycle) << "> : "
-	    << "{" << toString(static_cast<uint32_t>(x._packet_id)) << "}" << endl
-	    << "\t * context_id                        : " << toString(static_cast<uint32_t>(x._context_id)) << endl
-	    << "\t * operation  / type / write_spec_ko : " << toString(static_cast<uint32_t>(x._operation)) << " " << toString(static_cast<uint32_t>(x._type)) << " " << toString(static_cast<uint32_t>(x._write_spec_ko)) << endl
-	    << "\t * ptr_write store/load              : " << toString(static_cast<uint32_t>(x._store_queue_ptr_write)) << " " << toString(static_cast<uint32_t>(x._load_queue_ptr_write)) << endl
-	    << "\t * immediat / data_ra / data_rb      : " << toString(static_cast<uint32_t>(x._immediat)) << " - " << toString(static_cast<uint32_t>(x._data_ra)) << " - " << toString(static_cast<uint32_t>(x._data_rb)) << endl
-	    << "\t * write_rd / num_reg_rd             : " << toString(static_cast<uint32_t>(x._write_rd)) << " " << toString(static_cast<uint32_t>(x._num_reg_rd)) << endl;
-}
-
-//================================================================{Memory_t}
-class Memory_t
-{
-private : const uint32_t    _nb_context;
-private : const uint32_t    _nb_word   ;
-private : const uint32_t    _size_data ;
-private : const Tdcache_address_t _mask_addr ;
-private : Tdcache_data_t ** _data;
-  
-public  : Memory_t (uint32_t nb_context, 
-		    uint32_t nb_word, 
-		    uint32_t size_data):
-  _nb_context   (nb_context),
-  _nb_word      (nb_word   ),
-  _size_data    (size_data ),
-  _mask_addr    (gen_mask<Tdcache_address_t>(static_cast<uint32_t>(log2(ceil(static_cast<double>(size_data))))))
-  {
-    _data = new Tdcache_data_t * [nb_context];
-    
-    for (uint32_t i=0; i<nb_context; i++)
-      {
-	_data [i] = new Tdcache_data_t [nb_word];
-	
-	for (uint32_t j=0; j<nb_word; j++)
-	  _data [i][j] = rand()%(size_data);
-      }
-  }
-
-public  : ~Memory_t (void)
-  {
-    delete [] _data;
-  }
-
-public  : Tdcache_data_t access (uint32_t          context, 
-				 Tdcache_address_t address,
-				 Tdcache_type_t    type,
-				 Tdcache_data_t    data)
-  {
-    return 0;
-  }
-
-public  : Tdcache_data_t read (uint32_t          context,
-			       Tdcache_address_t address,
-			       Tdcache_type_t    type)
-  {
-    // Address's Read must be aligned
-
-    if ((address & _mask_addr) != 0)
-      TEST_KO("<Memory_t::read> Address is not aligned");
-
-    if (context>_nb_context)
-      TEST_KO("<Memory_t::read> nb context is too high");
-
-    if (address>_nb_word)
-      TEST_KO("<Memory_t::read> address is too high");
-    
-    return _data [context][address];
-  }
-
-public  : void write (uint32_t          context, 
-		      Tdcache_address_t address,
-		      Tdcache_type_t    type,
-		      Tdcache_data_t    data)
-  {
-    if (context>_nb_context)
-      TEST_KO("<Memory_t::read> nb context is too high");
-
-    if (address>_nb_word)
-      TEST_KO("<Memory_t::read> address is too high");
-
-    Tdcache_address_t LSB = address &  _mask;
-    Tdcache_address_t MSB = address & ~_mask;
-  
-    Tdcache_data_t write_data = data;
-    Tdcache_data_t read_data  = _data [context][MSB];
-
-    // exemple to size_data = 32b
-    // LSB index_min
-    // 0   0
-    // 1   8
-    // 2   16
-    // 3   24
-    uint32_t index_min = LSB<<3;
-    uint32_t index_max = index_min;
-    // index max, dependant of access's size
-
-    switch (type)
-      {
-
-
-      }
-  }
-};
-
-//===================================================================={test}
-void test (string name,
-	   morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::Parameters * _param)
-{
-  cout << "<" << name << "> : Simulation SystemC" << endl;
-
-#ifdef STATISTICS
-  morpheo::behavioural::Parameters_Statistics * _parameters_statistics = new morpheo::behavioural::Parameters_Statistics (5,50);
-#endif
-
-  Load_store_unit * _Load_store_unit = new Load_store_unit (name.c_str(),
-#ifdef STATISTICS
-					     _parameters_statistics,
-#endif
-					     _param);
-  
-#ifdef SYSTEMC
-  /*********************************************************************
-   * Déclarations des signaux
-   *********************************************************************/
-  string rename = "";
-
-  sc_clock                               * in_CLOCK  = new sc_clock ("clock", 1.0, 0.5);
-  sc_signal<Tcontrol_t>                  * in_NRESET = new sc_signal<Tcontrol_t> ("NRESET");
-
-  sc_signal<Tcontrol_t        > *   in_MEMORY_IN_VAL                   = new sc_signal<Tcontrol_t        > (rename.c_str());
-  sc_signal<Tcontrol_t        > *  out_MEMORY_IN_ACK                   = new sc_signal<Tcontrol_t        > (rename.c_str());
-  sc_signal<Tcontext_t        > *   in_MEMORY_IN_CONTEXT_ID            = new sc_signal<Tcontext_t        > (rename.c_str());
-  sc_signal<Tpacket_t         > *   in_MEMORY_IN_PACKET_ID             = new sc_signal<Tpacket_t         > (rename.c_str());
-  sc_signal<Toperation_t      > *   in_MEMORY_IN_OPERATION             = new sc_signal<Toperation_t      > (rename.c_str());
-  sc_signal<Ttype_t           > *   in_MEMORY_IN_TYPE                  = new sc_signal<Ttype_t           > (rename.c_str());
-  sc_signal<Tlsq_ptr_t        > *   in_MEMORY_IN_STORE_QUEUE_PTR_WRITE = new sc_signal<Tlsq_ptr_t        > (rename.c_str());
-  sc_signal<Tlsq_ptr_t        > *   in_MEMORY_IN_LOAD_QUEUE_PTR_WRITE  = new sc_signal<Tlsq_ptr_t        > (rename.c_str());
-//sc_signal<Tcontrol_t        > *   in_MEMORY_IN_HAS_IMMEDIAT          = new sc_signal<Tcontrol_t        > (rename.c_str());
-  sc_signal<Tgeneral_data_t   > *   in_MEMORY_IN_IMMEDIAT              = new sc_signal<Tgeneral_data_t   > (rename.c_str());
-  sc_signal<Tgeneral_data_t   > *   in_MEMORY_IN_DATA_RA               = new sc_signal<Tgeneral_data_t   > (rename.c_str());
-  sc_signal<Tgeneral_data_t   > *   in_MEMORY_IN_DATA_RB               = new sc_signal<Tgeneral_data_t   > (rename.c_str());
-//sc_signal<Tspecial_data_t   > *   in_MEMORY_IN_DATA_RC               = new sc_signal<Tspecial_data_t   > (rename.c_str());
-  sc_signal<Tcontrol_t        > *   in_MEMORY_IN_WRITE_RD              = new sc_signal<Tcontrol_t        > (rename.c_str());
-  sc_signal<Tgeneral_address_t> *   in_MEMORY_IN_NUM_REG_RD            = new sc_signal<Tgeneral_address_t> (rename.c_str());
-//sc_signal<Tcontrol_t        > *   in_MEMORY_IN_WRITE_RE              = new sc_signal<Tcontrol_t        > (rename.c_str());
-//sc_signal<Tspecial_address_t> *   in_MEMORY_IN_NUM_REG_RE            = new sc_signal<Tspecial_address_t> (rename.c_str());
-
-  sc_signal<Tcontrol_t	      > *  out_MEMORY_OUT_VAL        = new sc_signal<Tcontrol_t	 >(rename.c_str());
-  sc_signal<Tcontrol_t	      > *   in_MEMORY_OUT_ACK        = new sc_signal<Tcontrol_t	 >(rename.c_str());
-  sc_signal<Tcontext_t        > *  out_MEMORY_OUT_CONTEXT_ID = new sc_signal<Tcontext_t        >(rename.c_str());
-  sc_signal<Tpacket_t         > *  out_MEMORY_OUT_PACKET_ID  = new sc_signal<Tpacket_t         >(rename.c_str());
-  sc_signal<Toperation_t      > *  out_MEMORY_OUT_OPERATION  = new sc_signal<Toperation_t      >(rename.c_str());
-  sc_signal<Ttype_t           > *  out_MEMORY_OUT_TYPE       = new sc_signal<Ttype_t           >(rename.c_str());
-  sc_signal<Tcontrol_t        > *  out_MEMORY_OUT_WRITE_RD   = new sc_signal<Tcontrol_t        >(rename.c_str());
-  sc_signal<Tgeneral_address_t> *  out_MEMORY_OUT_NUM_REG_RD = new sc_signal<Tgeneral_address_t>(rename.c_str());
-  sc_signal<Tgeneral_data_t   > *  out_MEMORY_OUT_DATA_RD    = new sc_signal<Tgeneral_data_t   >(rename.c_str());
-//sc_signal<Tcontrol_t        > *  out_MEMORY_OUT_WRITE_RE   = new sc_signal<Tcontrol_t        >(rename.c_str());
-//sc_signal<Tspecial_address_t> *  out_MEMORY_OUT_NUM_REG_RE = new sc_signal<Tspecial_address_t>(rename.c_str());
-//sc_signal<Tspecial_data_t   > *  out_MEMORY_OUT_DATA_RE    = new sc_signal<Tspecial_data_t   >(rename.c_str());
-  sc_signal<Texception_t      > *  out_MEMORY_OUT_EXCEPTION  = new sc_signal<Texception_t      >(rename.c_str());
-
-  sc_signal<Tcontrol_t        > * out_DCACHE_REQ_VAL        = new sc_signal<Tcontrol_t        >(rename.c_str());
-  sc_signal<Tcontrol_t        > *  in_DCACHE_REQ_ACK        = new sc_signal<Tcontrol_t        >(rename.c_str());
-  sc_signal<Tcontext_t        > * out_DCACHE_REQ_CONTEXT_ID = new sc_signal<Tcontext_t        >(rename.c_str());
-  sc_signal<Tpacket_t         > * out_DCACHE_REQ_PACKET_ID  = new sc_signal<Tpacket_t         >(rename.c_str());
-  sc_signal<Tdcache_address_t > * out_DCACHE_REQ_ADDRESS    = new sc_signal<Tdcache_address_t >(rename.c_str());
-  sc_signal<Tdcache_type_t    > * out_DCACHE_REQ_TYPE       = new sc_signal<Tdcache_type_t    >(rename.c_str());
-  sc_signal<Tcontrol_t        > * out_DCACHE_REQ_UNCACHED   = new sc_signal<Tcontrol_t        >(rename.c_str());
-  sc_signal<Tdcache_data_t    > * out_DCACHE_REQ_WDATA      = new sc_signal<Tdcache_data_t    >(rename.c_str());
-  
-  sc_signal<Tcontrol_t        > *  in_DCACHE_RSP_VAL        = new sc_signal<Tcontrol_t        >(rename.c_str());
-  sc_signal<Tcontrol_t        > * out_DCACHE_RSP_ACK        = new sc_signal<Tcontrol_t        >(rename.c_str());
-  sc_signal<Tcontext_t        > *  in_DCACHE_RSP_CONTEXT_ID = new sc_signal<Tcontext_t        >(rename.c_str());
-  sc_signal<Tpacket_t         > *  in_DCACHE_RSP_PACKET_ID  = new sc_signal<Tpacket_t         >(rename.c_str());
-  sc_signal<Tdcache_data_t    > *  in_DCACHE_RSP_RDATA      = new sc_signal<Tdcache_data_t    >(rename.c_str());
-  sc_signal<Tdcache_error_t   > *  in_DCACHE_RSP_ERROR      = new sc_signal<Tdcache_error_t   >(rename.c_str());
-  
-  sc_signal<Tcontrol_t        > ** out_BYPASS_MEMORY_VAL        = new sc_signal<Tcontrol_t        > * [_param->_size_load_queue];
-  sc_signal<Tcontext_t        > ** out_BYPASS_MEMORY_CONTEXT_ID = new sc_signal<Tcontext_t        > * [_param->_size_load_queue];
-  sc_signal<Tgeneral_address_t> ** out_BYPASS_MEMORY_NUM_REG    = new sc_signal<Tgeneral_address_t> * [_param->_size_load_queue];
-  sc_signal<Tgeneral_data_t   > ** out_BYPASS_MEMORY_DATA       = new sc_signal<Tgeneral_data_t   > * [_param->_size_load_queue];
-    
-    for (uint32_t i=0; i<_param->_size_load_queue; i++)
-      {
-	out_BYPASS_MEMORY_VAL        [i] = new sc_signal<Tcontrol_t        >;
-	out_BYPASS_MEMORY_CONTEXT_ID [i] = new sc_signal<Tcontext_t        >;
-	out_BYPASS_MEMORY_NUM_REG    [i] = new sc_signal<Tgeneral_address_t>;
-	out_BYPASS_MEMORY_DATA       [i] = new sc_signal<Tgeneral_data_t   >;
-      }
-  
-  /********************************************************
-   * Instanciation
-   ********************************************************/
-  
-  cout << "<" << name << "> Instanciation of _Load_store_unit" << endl;
-  
-  (*(_Load_store_unit->in_CLOCK))        (*(in_CLOCK));
-  (*(_Load_store_unit->in_NRESET))       (*(in_NRESET));
-
-  (*(_Load_store_unit-> in_MEMORY_IN_VAL                  ))(*( in_MEMORY_IN_VAL                  ));
-  (*(_Load_store_unit->out_MEMORY_IN_ACK                  ))(*(out_MEMORY_IN_ACK                  ));
-  (*(_Load_store_unit-> in_MEMORY_IN_CONTEXT_ID           ))(*( in_MEMORY_IN_CONTEXT_ID           ));
-  (*(_Load_store_unit-> in_MEMORY_IN_PACKET_ID            ))(*( in_MEMORY_IN_PACKET_ID            ));
-  (*(_Load_store_unit-> in_MEMORY_IN_OPERATION            ))(*( in_MEMORY_IN_OPERATION            ));
-  (*(_Load_store_unit-> in_MEMORY_IN_STORE_QUEUE_PTR_WRITE))(*( in_MEMORY_IN_STORE_QUEUE_PTR_WRITE));
-  (*(_Load_store_unit-> in_MEMORY_IN_LOAD_QUEUE_PTR_WRITE ))(*( in_MEMORY_IN_LOAD_QUEUE_PTR_WRITE ));
-//(*(_Load_store_unit-> in_MEMORY_IN_HAS_IMMEDIAT         ))(*( in_MEMORY_IN_HAS_IMMEDIAT         ));
-  (*(_Load_store_unit-> in_MEMORY_IN_IMMEDIAT             ))(*( in_MEMORY_IN_IMMEDIAT             ));
-  (*(_Load_store_unit-> in_MEMORY_IN_DATA_RA              ))(*( in_MEMORY_IN_DATA_RA              ));
-  (*(_Load_store_unit-> in_MEMORY_IN_DATA_RB              ))(*( in_MEMORY_IN_DATA_RB              ));
-//(*(_Load_store_unit-> in_MEMORY_IN_DATA_RC              ))(*( in_MEMORY_IN_DATA_RC              ));
-  (*(_Load_store_unit-> in_MEMORY_IN_WRITE_RD             ))(*( in_MEMORY_IN_WRITE_RD             ));
-  (*(_Load_store_unit-> in_MEMORY_IN_NUM_REG_RD           ))(*( in_MEMORY_IN_NUM_REG_RD           ));
-//(*(_Load_store_unit-> in_MEMORY_IN_WRITE_RE             ))(*( in_MEMORY_IN_WRITE_RE             ));
-//(*(_Load_store_unit-> in_MEMORY_IN_NUM_REG_RE           ))(*( in_MEMORY_IN_NUM_REG_RE           ));
-  
-  (*(_Load_store_unit->out_MEMORY_OUT_VAL        ))(*(out_MEMORY_OUT_VAL        ));
-  (*(_Load_store_unit-> in_MEMORY_OUT_ACK        ))(*( in_MEMORY_OUT_ACK        ));
-  (*(_Load_store_unit->out_MEMORY_OUT_CONTEXT_ID ))(*(out_MEMORY_OUT_CONTEXT_ID ));
-  (*(_Load_store_unit->out_MEMORY_OUT_PACKET_ID  ))(*(out_MEMORY_OUT_PACKET_ID  ));
-  (*(_Load_store_unit->out_MEMORY_OUT_WRITE_RD   ))(*(out_MEMORY_OUT_WRITE_RD   ));
-  (*(_Load_store_unit->out_MEMORY_OUT_NUM_REG_RD ))(*(out_MEMORY_OUT_NUM_REG_RD ));
-  (*(_Load_store_unit->out_MEMORY_OUT_DATA_RD    ))(*(out_MEMORY_OUT_DATA_RD    ));
-//(*(_Load_store_unit->out_MEMORY_OUT_WRITE_RE   ))(*(out_MEMORY_OUT_WRITE_RE   ));
-//(*(_Load_store_unit->out_MEMORY_OUT_NUM_REG_RE ))(*(out_MEMORY_OUT_NUM_REG_RE ));
-//(*(_Load_store_unit->out_MEMORY_OUT_DATA_RE    ))(*(out_MEMORY_OUT_DATA_RE    ));
-  (*(_Load_store_unit->out_MEMORY_OUT_EXCEPTION  ))(*(out_MEMORY_OUT_EXCEPTION  ));
-
-  (*(_Load_store_unit->out_DCACHE_REQ_VAL       ))(*(out_DCACHE_REQ_VAL       ));
-  (*(_Load_store_unit-> in_DCACHE_REQ_ACK       ))(*( in_DCACHE_REQ_ACK       ));
-  (*(_Load_store_unit->out_DCACHE_REQ_CONTEXT_ID))(*(out_DCACHE_REQ_CONTEXT_ID));
-  (*(_Load_store_unit->out_DCACHE_REQ_PACKET_ID ))(*(out_DCACHE_REQ_PACKET_ID ));
-  (*(_Load_store_unit->out_DCACHE_REQ_ADDRESS   ))(*(out_DCACHE_REQ_ADDRESS   ));
-  (*(_Load_store_unit->out_DCACHE_REQ_TYPE      ))(*(out_DCACHE_REQ_TYPE      ));
-  (*(_Load_store_unit->out_DCACHE_REQ_UNCACHED  ))(*(out_DCACHE_REQ_UNCACHED  ));
-  (*(_Load_store_unit->out_DCACHE_REQ_WDATA     ))(*(out_DCACHE_REQ_WDATA     ));
-
-  (*(_Load_store_unit-> in_DCACHE_RSP_VAL       ))(*( in_DCACHE_RSP_VAL       ));
-  (*(_Load_store_unit->out_DCACHE_RSP_ACK       ))(*(out_DCACHE_RSP_ACK       ));
-  (*(_Load_store_unit-> in_DCACHE_RSP_CONTEXT_ID))(*( in_DCACHE_RSP_CONTEXT_ID));
-  (*(_Load_store_unit-> in_DCACHE_RSP_PACKET_ID ))(*( in_DCACHE_RSP_PACKET_ID ));
-  (*(_Load_store_unit-> in_DCACHE_RSP_RDATA     ))(*( in_DCACHE_RSP_RDATA     ));
-  (*(_Load_store_unit-> in_DCACHE_RSP_ERROR     ))(*( in_DCACHE_RSP_ERROR     ));
-
-  if (_param->_speculative_load == SPECULATIVE_LOAD_BYPASS)
-    {
-      for (uint32_t i=0; i<_param->_size_load_queue; i++)
-	{
-	  (*(_Load_store_unit->out_BYPASS_MEMORY_VAL        [i]))(*(out_BYPASS_MEMORY_VAL        [i]));
-	  (*(_Load_store_unit->out_BYPASS_MEMORY_CONTEXT_ID [i]))(*(out_BYPASS_MEMORY_CONTEXT_ID [i]));
-	  (*(_Load_store_unit->out_BYPASS_MEMORY_NUM_REG    [i]))(*(out_BYPASS_MEMORY_NUM_REG    [i]));
-	  (*(_Load_store_unit->out_BYPASS_MEMORY_DATA       [i]))(*(out_BYPASS_MEMORY_DATA       [i]));
-	}
-    }
-  cout << "<" << name << "> Start Simulation ............" << endl;
-  Time * _time = new Time();
-
-  /********************************************************
-   * Simulation - Begin
-   ********************************************************/
-
-  // Initialisation
-
-  const uint32_t seed = 0;
-//const uint32_t seed = static_cast<uint32_t>(time(NULL));
-
-  srand(seed);
-
-  const uint32_t     nb_request   = _param->_nb_packet;
-  const uint32_t     nb_word      = nb_request;
-
-//const int32_t      percent_transaction_memory_in  = 100;
-  const int32_t      percent_transaction_memory_out = 100;
-  const int32_t      percent_transaction_dcache     = 100;
-
-  const int32_t      percent_exception              =   5;
-  const int32_t      percent_type_load              =   0;
-  const int32_t      percent_type_store             = 100;
-  const int32_t      percent_miss_spec              =   0;
-
-  if ((percent_type_load  +
-       percent_type_store ) > 100)
-    TEST_KO("sum of percent_type > 100");
-
-  const int32_t      seuil_type_load    = percent_type_load;
-  const int32_t      seuil_type_store   = percent_type_store+percent_type_load;
-
-  uint32_t           nb_request_memory_in ;
-  uint32_t           nb_request_memory_out;
-  uint32_t           nb_request_dcache    ;
-
-  MemoryRequest_t                 tab_request  [nb_request];
-  priority_queue<MemoryRequest_t> fifo_request;
-
-  // emulation of cache
-  Tdcache_data_t     cache_data                [_param->_nb_context][nb_word];
-
-  SC_START(0);
-
-  LABEL("Initialisation");
-
-  // emulate a memory
-  for (uint32_t i=0; i<_param->_nb_context; i++)
-    for (uint32_t j=0; j<nb_word; j++)
-      cache_data [i][j] = rand()%(1<<_param->_size_general_data);
-
-  in_MEMORY_IN_VAL ->write(0);
-  in_MEMORY_OUT_ACK->write(0);
-  in_DCACHE_REQ_ACK->write(0);
-  in_DCACHE_RSP_VAL->write(0);
-
-  in_NRESET        ->write(0);
-  SC_START(5);
-  in_NRESET        ->write(5);
-
-  LABEL("Loop of Test");
-
-  for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++)
-    {
-      LABEL("Iteration "+toString(iteration));
-
-      LABEL("Structure's initialisation");
-
-      nb_request_memory_in  = 0;
-      nb_request_memory_out = 0;
-      nb_request_dcache     = 0;
-      
-      // Fill the request_queue
-      
-      Tlsq_ptr_t         store_queue_ptr_write = 0;
-      Tlsq_ptr_t         load_queue_ptr_write  = 0;
-
-      bool               store_queue_use [_param->_size_store_queue];
-      bool               load_queue_use  [_param->_size_load_queue ];
-
-      for (uint32_t i=0; i<_param->_size_store_queue; i++)
-	store_queue_use [i] = false;
-      for (uint32_t i=0; i<_param->_size_load_queue ; i++)
-	load_queue_use  [i] = false;
-
-      double             current_cycle = sc_simulation_time();
-      double             cycle_min     = current_cycle;
-
-      LABEL("Fifo request initialisation");
-      // Init fifo_request
-      for (uint32_t i=0; i<nb_request; i++)
-	{
-	  double             cycle;
-	  Tcontext_t         context_id                = rand () % _param->_nb_context;
-	  Tpacket_t          packet_id                 = i;
-	  Tlsq_ptr_t         store_queue_ptr_write_old = store_queue_ptr_write;
-	  Tlsq_ptr_t         load_queue_ptr_write_old  = load_queue_ptr_write ;
-	  Toperation_t       operation;
-	  
-	  int32_t            percent = rand()%100;
-
-	  uint32_t           size_queue;
-	 
-	  if (percent <= seuil_type_load)
-	    {
-// 	      LABEL(" * LOAD");
-	      operation            = OPERATION_MEMORY_LOAD_16_S;
-	      size_queue           = _param->_size_load_queue;
-	      load_queue_ptr_write = (load_queue_ptr_write+1) % (size_queue);
-	    }
-	  else
-	    {
-	      if (percent <= seuil_type_store)
-		{
-// 		  LABEL(" * STORE");
-		  operation             = OPERATION_MEMORY_STORE_16;
-		  size_queue            = _param->_size_store_queue;
-		  store_queue_ptr_write = (store_queue_ptr_write+1) % (size_queue);
-		}
-	      else
-		{
-// 		  LABEL(" * OTHERS");
-		  operation            = OPERATION_MEMORY_PREFETCH;
-		  size_queue           = _param->_size_load_queue;
-		  load_queue_ptr_write = (load_queue_ptr_write+1) % (size_queue);
-		}
-	    }
-
-	  cycle      = cycle_min;
-	  cycle_min ++;
-
-	  Ttype_t            type                  = TYPE_MEMORY;
-	  Tgeneral_data_t    address               = rand()%(nb_word);
-	  Tgeneral_data_t    offset                = rand()%(nb_word);
-
-	  percent = rand()%100;
-	  if (percent > percent_exception) 
-	    address = address & (not mask_memory_access(operation));
-
-	  if (offset > address) // max
-	    offset  = address;
-
-	  Tgeneral_data_t    immediat              = offset;
-	  Tgeneral_data_t    data_ra               = address - offset;
-	  Tgeneral_data_t    data_rb               = rand()%(1<<_param->_size_general_data);
-	  Tcontrol_t         write_rd              = 0;
-	  Tgeneral_address_t num_reg_rd            = 0;
-	  bool               write_spec_ko         = ((rand()%100)<percent_miss_spec);
-
-	  tab_request [i].modif(cycle                ,
-				context_id           ,
-				packet_id            ,
-				operation            ,
-				type                 ,
-				store_queue_ptr_write_old,
-				load_queue_ptr_write_old ,
-				immediat             ,
-				data_ra              ,
-				data_rb              ,
-				write_rd             ,
-				num_reg_rd           ,
-				write_spec_ko
-				);
-
-	  cout << tab_request [i] << endl;
-	
-	  fifo_request.push(tab_request [i]);
-
-	  double cycle_head = 0;
-
-	  if (is_operation_memory_store(operation))
-	    {
-	      cycle_head = cycle_min;
-	      cycle_min ++;
-
-	      cout << "         * Write head : " << toString(cycle_head) 
-		   << endl
-		   << endl;
-	      
-	      fifo_request.push(MemoryRequest_t(cycle_head,
-						context_id,
-						packet_id,
-						(write_spec_ko==true)?OPERATION_MEMORY_STORE_HEAD_KO:OPERATION_MEMORY_STORE_HEAD_OK,
-						type,
-						store_queue_ptr_write_old,
-						0,
-						0,
-						0,
-						0,
-						0,
-						0,
-						write_spec_ko));
-	    }
-  	}
-        
-      LABEL("Simulation of this iteration ...");
-    
-      while (nb_request_memory_out < nb_request)
-	{
-	  // ***** MEMORY_IN *****
-
-	  // memory_in_val depends of three factors :
-	  //  1) request's fifo is not empty ?
-	  //  2) the slot destination is free ?
-	  //  3) The head of request's fifo can be issue : the number of cycle is more than current cycle
-
-	  bool can_execute = false;
-
-	  if (is_operation_memory_store(fifo_request.top()._operation))
-	    can_execute = (not store_queue_use [fifo_request.top()._store_queue_ptr_write]) or is_operation_memory_store_head(fifo_request.top()._operation);
-	  else
-	    can_execute = not load_queue_use  [fifo_request.top()._load_queue_ptr_write];
-	  
-	  in_MEMORY_IN_VAL ->write((not fifo_request.empty()) and 
-				   can_execute                and 
-				   (sc_simulation_time() >= fifo_request.top()._cycle));
-
-	  in_MEMORY_IN_CONTEXT_ID           ->write (fifo_request.top()._context_id           );
-	  in_MEMORY_IN_PACKET_ID            ->write (fifo_request.top()._packet_id            );
-	  in_MEMORY_IN_OPERATION            ->write (fifo_request.top()._operation            );
-	  in_MEMORY_IN_TYPE                 ->write (fifo_request.top()._type                 );
-	  in_MEMORY_IN_STORE_QUEUE_PTR_WRITE->write (fifo_request.top()._store_queue_ptr_write);
-   	  in_MEMORY_IN_LOAD_QUEUE_PTR_WRITE ->write (fifo_request.top()._load_queue_ptr_write );
-	  in_MEMORY_IN_IMMEDIAT             ->write (fifo_request.top()._immediat             );
-	  in_MEMORY_IN_DATA_RA              ->write (fifo_request.top()._data_ra              );
-	  in_MEMORY_IN_DATA_RB              ->write (fifo_request.top()._data_rb              );
-	  in_MEMORY_IN_WRITE_RD             ->write (fifo_request.top()._write_rd             );
-	  in_MEMORY_IN_NUM_REG_RD           ->write (fifo_request.top()._num_reg_rd           );
-
-	  in_MEMORY_OUT_ACK->write((rand()%100)<percent_transaction_memory_out);
-
-	  // ***** DCACHE_REQ *****
-	  in_DCACHE_REQ_ACK->write((rand()%100)<percent_transaction_dcache);
-
-	  SC_START(0);
-  
-	  SC_START(1);
-
-	  LABEL("MEMORY_IN  : "+toString(in_MEMORY_IN_VAL ->read())+" - "+toString(out_MEMORY_IN_ACK ->read()));
-	  LABEL("  * fifo_request.empty                     : "+toString(fifo_request.empty()));
-	  LABEL("  * fifo_request.top.cycle                 : "+toString(fifo_request.top()._cycle));
-	  LABEL("  * fifo_request.top.store_queue_ptr_write : "+toString(static_cast<uint32_t>(fifo_request.top()._store_queue_ptr_write)));
-	  LABEL("  * fifo_request.top.load_queue_ptr_write  : "+toString(static_cast<uint32_t>(fifo_request.top()._load_queue_ptr_write)));
-	  LABEL("  * fifo_request.top.operation             : "+toString(static_cast<uint32_t>(fifo_request.top()._operation           )));
-	  LABEL("  * can_execute                            : "+toString(can_execute));
-
-	  if ( in_MEMORY_IN_VAL ->read() and out_MEMORY_IN_ACK ->read())
-	    {
-	      LABEL(" * Accepted MEMORY_IN  : " + toString(nb_request_memory_in));
-	      cout << fifo_request.top();
-
-	      if (is_operation_memory_store(fifo_request.top()._operation))
-		{
-		  if (not is_operation_memory_store_head(fifo_request.top()._operation))
-		    store_queue_use [fifo_request.top()._store_queue_ptr_write] = true;
-		}
-	      else
-		load_queue_use [fifo_request.top()._load_queue_ptr_write] = true;
-
-	      fifo_request.pop();
-	      
-	      nb_request_memory_in ++;
-	    }
-
-	  LABEL("MEMORY_OUT : "+toString(out_MEMORY_OUT_VAL->read())+" - "+toString(in_MEMORY_OUT_ACK ->read()));
-	  if (out_MEMORY_OUT_VAL->read() and  in_MEMORY_OUT_ACK->read())
-	    {
-	      LABEL(" * Accepted MEMORY_OUT : " + toString(static_cast<uint32_t>(out_MEMORY_OUT_PACKET_ID->read())));
-
-	      if (is_operation_memory_store(tab_request[out_MEMORY_OUT_PACKET_ID->read()]._operation))
-		store_queue_use [tab_request[out_MEMORY_OUT_PACKET_ID->read()]._store_queue_ptr_write] = false;
-	      else
-		load_queue_use  [tab_request[out_MEMORY_OUT_PACKET_ID->read()]._load_queue_ptr_write] = false;
-
-	      nb_request_memory_out ++;
-	    }
-
-	  LABEL("DCACHE_REQ : "+toString(out_DCACHE_REQ_VAL->read())+" - "+toString(in_DCACHE_REQ_ACK ->read()));
-	  if (out_DCACHE_REQ_VAL->read() and  in_DCACHE_REQ_ACK->read())
-	    {
-	      LABEL(" * Accepted DCACHE_REQ : " + toString(static_cast<uint32_t>(out_DCACHE_REQ_PACKET_ID->read())));
-
-	      // test type : send or not a respons !
-	    }
-
-	}
-    }
-  
-  /********************************************************
-   * Simulation - End
-   ********************************************************/
-
-  TEST_OK ("End of Simulation");
-  delete _time;
-  cout << "<" << name << "> ............ Stop Simulation" << endl;
-
-  delete     in_CLOCK;
-  delete     in_NRESET;
-
-  delete     in_MEMORY_IN_VAL                  ;
-  delete    out_MEMORY_IN_ACK                  ;
-  delete     in_MEMORY_IN_CONTEXT_ID           ;
-  delete     in_MEMORY_IN_PACKET_ID            ;
-  delete     in_MEMORY_IN_OPERATION            ;
-  delete     in_MEMORY_IN_TYPE                 ;
-  delete     in_MEMORY_IN_STORE_QUEUE_PTR_WRITE;
-  delete     in_MEMORY_IN_LOAD_QUEUE_PTR_WRITE ;
-//delete     in_MEMORY_IN_HAS_IMMEDIAT         ;
-  delete     in_MEMORY_IN_IMMEDIAT             ;
-  delete     in_MEMORY_IN_DATA_RA              ;
-  delete     in_MEMORY_IN_DATA_RB              ;
-//delete     in_MEMORY_IN_DATA_RC              ;
-  delete     in_MEMORY_IN_WRITE_RD             ;
-  delete     in_MEMORY_IN_NUM_REG_RD           ;
-//delete     in_MEMORY_IN_WRITE_RE             ;
-//delete     in_MEMORY_IN_NUM_REG_RE           ;
-
-  delete    out_MEMORY_OUT_VAL       ;
-  delete     in_MEMORY_OUT_ACK       ;
-  delete    out_MEMORY_OUT_CONTEXT_ID;
-  delete    out_MEMORY_OUT_PACKET_ID ;
-  delete    out_MEMORY_OUT_OPERATION ;
-  delete    out_MEMORY_OUT_TYPE      ;
-  delete    out_MEMORY_OUT_WRITE_RD  ;
-  delete    out_MEMORY_OUT_NUM_REG_RD;
-  delete    out_MEMORY_OUT_DATA_RD   ;
-//delete    out_MEMORY_OUT_WRITE_RE  ;
-//delete    out_MEMORY_OUT_NUM_REG_RE;
-//delete    out_MEMORY_OUT_DATA_RE   ;
-  delete    out_MEMORY_OUT_EXCEPTION ;
-
-  delete    out_DCACHE_REQ_VAL       ;
-  delete     in_DCACHE_REQ_ACK       ;
-  delete    out_DCACHE_REQ_CONTEXT_ID;
-  delete    out_DCACHE_REQ_PACKET_ID ;
-  delete    out_DCACHE_REQ_ADDRESS   ;
-  delete    out_DCACHE_REQ_TYPE      ;
-  delete    out_DCACHE_REQ_UNCACHED  ;
-  delete    out_DCACHE_REQ_WDATA     ;
-
-  delete     in_DCACHE_RSP_VAL       ;
-  delete    out_DCACHE_RSP_ACK       ;
-  delete     in_DCACHE_RSP_CONTEXT_ID;
-  delete     in_DCACHE_RSP_PACKET_ID ;
-  delete     in_DCACHE_RSP_RDATA     ;
-  delete     in_DCACHE_RSP_ERROR     ;
-
-  delete [] out_BYPASS_MEMORY_VAL       ;
-  delete [] out_BYPASS_MEMORY_CONTEXT_ID;
-  delete [] out_BYPASS_MEMORY_NUM_REG   ;
-  delete [] out_BYPASS_MEMORY_DATA      ;
-
-#endif
-
-  delete _Load_store_unit;
-#ifdef STATISTICS
-  delete _parameters_statistics;
-#endif
-}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/SelfTest/src/test1.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/SelfTest/src/test1.cpp	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/SelfTest/src/test1.cpp	(revision 71)
@@ -0,0 +1,738 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ * Test
+ */
+
+#include <queue>
+#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/SelfTest/include/test.h"
+
+#define NB_ITERATION  1
+#define CYCLE_MAX     (1024*NB_ITERATION)
+
+#define LABEL(str)							\
+  {									\
+    cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} " << str << endl; \
+  } while(0)
+
+#define SC_START(cycle_offset)						\
+  do									\
+    {									\
+      /*cout << "SC_START (begin)" << endl;*/				\
+									\
+      uint32_t cycle_current = static_cast<uint32_t>(sc_simulation_time()); \
+      if (cycle_offset != 0)						\
+	{								\
+	  cout << "##########[ cycle "<< cycle_current+cycle_offset << " ]" << endl; \
+	}								\
+									\
+      if (cycle_current > CYCLE_MAX)					\
+	{								\
+	  TEST_KO("Maximal cycles Reached");				\
+	}								\
+      sc_start(cycle_offset);						\
+      /*cout << "SC_START (end  )" << endl;*/				\
+    } while(0)
+
+
+//===================================================================={test}
+void test1 (string name,
+	   morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::Parameters * _param)
+{
+  cout << "<" << name << "> : Simulation SystemC" << endl;
+
+#ifdef STATISTICS
+  morpheo::behavioural::Parameters_Statistics * _parameters_statistics = new morpheo::behavioural::Parameters_Statistics (5,0);
+#endif
+
+  Load_store_unit * _Load_store_unit = new Load_store_unit (name.c_str(),
+#ifdef STATISTICS
+							    _parameters_statistics,
+#endif
+							    _param);
+  
+#ifdef SYSTEMC
+  /*********************************************************************
+   * Déclarations des signaux
+   *********************************************************************/
+  string rename = "";
+
+  sc_clock                               * in_CLOCK  = new sc_clock ("clock", 1.0, 0.5);
+  sc_signal<Tcontrol_t>                  * in_NRESET = new sc_signal<Tcontrol_t> ("NRESET");
+
+  sc_signal<Tcontrol_t        > *   in_MEMORY_IN_VAL                   = new sc_signal<Tcontrol_t        > (rename.c_str());
+  sc_signal<Tcontrol_t        > *  out_MEMORY_IN_ACK                   = new sc_signal<Tcontrol_t        > (rename.c_str());
+  sc_signal<Tcontext_t        > *   in_MEMORY_IN_CONTEXT_ID            = new sc_signal<Tcontext_t        > (rename.c_str());
+  sc_signal<Tcontext_t        > *   in_MEMORY_IN_FRONT_END_ID          = new sc_signal<Tcontext_t        > (rename.c_str());
+  sc_signal<Tcontext_t        > *   in_MEMORY_IN_OOO_ENGINE_ID         = new sc_signal<Tcontext_t        > (rename.c_str());
+  sc_signal<Tpacket_t         > *   in_MEMORY_IN_PACKET_ID             = new sc_signal<Tpacket_t         > (rename.c_str());
+  sc_signal<Toperation_t      > *   in_MEMORY_IN_OPERATION             = new sc_signal<Toperation_t      > (rename.c_str());
+  sc_signal<Ttype_t           > *   in_MEMORY_IN_TYPE                  = new sc_signal<Ttype_t           > (rename.c_str());
+  sc_signal<Tlsq_ptr_t        > *   in_MEMORY_IN_STORE_QUEUE_PTR_WRITE = new sc_signal<Tlsq_ptr_t        > (rename.c_str());
+  sc_signal<Tlsq_ptr_t        > *   in_MEMORY_IN_LOAD_QUEUE_PTR_WRITE  = new sc_signal<Tlsq_ptr_t        > (rename.c_str());
+  //sc_signal<Tcontrol_t        > *   in_MEMORY_IN_HAS_IMMEDIAT          = new sc_signal<Tcontrol_t        > (rename.c_str());
+  sc_signal<Tgeneral_data_t   > *   in_MEMORY_IN_IMMEDIAT              = new sc_signal<Tgeneral_data_t   > (rename.c_str());
+  sc_signal<Tgeneral_data_t   > *   in_MEMORY_IN_DATA_RA               = new sc_signal<Tgeneral_data_t   > (rename.c_str());
+  sc_signal<Tgeneral_data_t   > *   in_MEMORY_IN_DATA_RB               = new sc_signal<Tgeneral_data_t   > (rename.c_str());
+  //sc_signal<Tspecial_data_t   > *   in_MEMORY_IN_DATA_RC               = new sc_signal<Tspecial_data_t   > (rename.c_str());
+//   sc_signal<Tcontrol_t        > *   in_MEMORY_IN_WRITE_RD              = new sc_signal<Tcontrol_t        > (rename.c_str());
+  sc_signal<Tgeneral_address_t> *   in_MEMORY_IN_NUM_REG_RD            = new sc_signal<Tgeneral_address_t> (rename.c_str());
+  //sc_signal<Tcontrol_t        > *   in_MEMORY_IN_WRITE_RE              = new sc_signal<Tcontrol_t        > (rename.c_str());
+  //sc_signal<Tspecial_address_t> *   in_MEMORY_IN_NUM_REG_RE            = new sc_signal<Tspecial_address_t> (rename.c_str());
+
+  sc_signal<Tcontrol_t	      > *  out_MEMORY_OUT_VAL           = new sc_signal<Tcontrol_t	  >(rename.c_str());
+  sc_signal<Tcontrol_t	      > *   in_MEMORY_OUT_ACK           = new sc_signal<Tcontrol_t	  >(rename.c_str());
+  sc_signal<Tcontext_t        > *  out_MEMORY_OUT_CONTEXT_ID    = new sc_signal<Tcontext_t        >(rename.c_str());
+  sc_signal<Tcontext_t        > *  out_MEMORY_OUT_FRONT_END_ID  = new sc_signal<Tcontext_t        >(rename.c_str());
+  sc_signal<Tcontext_t        > *  out_MEMORY_OUT_OOO_ENGINE_ID = new sc_signal<Tcontext_t        >(rename.c_str());
+  sc_signal<Tpacket_t         > *  out_MEMORY_OUT_PACKET_ID     = new sc_signal<Tpacket_t         >(rename.c_str());
+  sc_signal<Tcontrol_t        > *  out_MEMORY_OUT_WRITE_RD      = new sc_signal<Tcontrol_t        >(rename.c_str());
+  sc_signal<Tgeneral_address_t> *  out_MEMORY_OUT_NUM_REG_RD    = new sc_signal<Tgeneral_address_t>(rename.c_str());
+  sc_signal<Tgeneral_data_t   > *  out_MEMORY_OUT_DATA_RD       = new sc_signal<Tgeneral_data_t   >(rename.c_str());
+  //sc_signal<Tcontrol_t        > *  out_MEMORY_OUT_WRITE_RE      = new sc_signal<Tcontrol_t        >(rename.c_str());
+  //sc_signal<Tspecial_address_t> *  out_MEMORY_OUT_NUM_REG_RE    = new sc_signal<Tspecial_address_t>(rename.c_str());
+  //sc_signal<Tspecial_data_t   > *  out_MEMORY_OUT_DATA_RE       = new sc_signal<Tspecial_data_t   >(rename.c_str());
+  sc_signal<Texception_t      > *  out_MEMORY_OUT_EXCEPTION     = new sc_signal<Texception_t      >(rename.c_str());
+
+  sc_signal<Tcontrol_t        > * out_DCACHE_REQ_VAL        = new sc_signal<Tcontrol_t        >(rename.c_str());
+  sc_signal<Tcontrol_t        > *  in_DCACHE_REQ_ACK        = new sc_signal<Tcontrol_t        >(rename.c_str());
+  sc_signal<Tcontext_t        > * out_DCACHE_REQ_CONTEXT_ID = new sc_signal<Tcontext_t        >(rename.c_str());
+  sc_signal<Tpacket_t         > * out_DCACHE_REQ_PACKET_ID  = new sc_signal<Tpacket_t         >(rename.c_str());
+  sc_signal<Tdcache_address_t > * out_DCACHE_REQ_ADDRESS    = new sc_signal<Tdcache_address_t >(rename.c_str());
+  sc_signal<Tdcache_type_t    > * out_DCACHE_REQ_TYPE       = new sc_signal<Tdcache_type_t    >(rename.c_str());
+  sc_signal<Tdcache_data_t    > * out_DCACHE_REQ_WDATA      = new sc_signal<Tdcache_data_t    >(rename.c_str());
+  
+  sc_signal<Tcontrol_t        > *  in_DCACHE_RSP_VAL        = new sc_signal<Tcontrol_t        >(rename.c_str());
+  sc_signal<Tcontrol_t        > * out_DCACHE_RSP_ACK        = new sc_signal<Tcontrol_t        >(rename.c_str());
+  sc_signal<Tcontext_t        > *  in_DCACHE_RSP_CONTEXT_ID = new sc_signal<Tcontext_t        >(rename.c_str());
+  sc_signal<Tpacket_t         > *  in_DCACHE_RSP_PACKET_ID  = new sc_signal<Tpacket_t         >(rename.c_str());
+  sc_signal<Tdcache_data_t    > *  in_DCACHE_RSP_RDATA      = new sc_signal<Tdcache_data_t    >(rename.c_str());
+  sc_signal<Tdcache_error_t   > *  in_DCACHE_RSP_ERROR      = new sc_signal<Tdcache_error_t   >(rename.c_str());
+  
+  sc_signal<Tcontrol_t        > ** out_BYPASS_MEMORY_VAL           = new sc_signal<Tcontrol_t        > * [_param->_size_load_queue];
+  sc_signal<Tcontext_t        > ** out_BYPASS_MEMORY_OOO_ENGINE_ID = new sc_signal<Tcontext_t        > * [_param->_size_load_queue];
+  sc_signal<Tgeneral_address_t> ** out_BYPASS_MEMORY_NUM_REG       = new sc_signal<Tgeneral_address_t> * [_param->_size_load_queue];
+  sc_signal<Tgeneral_data_t   > ** out_BYPASS_MEMORY_DATA          = new sc_signal<Tgeneral_data_t   > * [_param->_size_load_queue];
+    
+  for (uint32_t i=0; i<_param->_size_load_queue; i++)
+    {
+      out_BYPASS_MEMORY_VAL           [i] = new sc_signal<Tcontrol_t        >(rename.c_str());
+      out_BYPASS_MEMORY_OOO_ENGINE_ID [i] = new sc_signal<Tcontext_t        >(rename.c_str());
+      out_BYPASS_MEMORY_NUM_REG       [i] = new sc_signal<Tgeneral_address_t>(rename.c_str());
+      out_BYPASS_MEMORY_DATA          [i] = new sc_signal<Tgeneral_data_t   >(rename.c_str());
+    }
+  
+  /********************************************************
+   * Instanciation
+   ********************************************************/
+  
+  cout << "<" << name << "> Instanciation of _Load_store_unit" << endl;
+  
+  (*(_Load_store_unit->in_CLOCK))        (*(in_CLOCK));
+  (*(_Load_store_unit->in_NRESET))       (*(in_NRESET));
+
+  (*(_Load_store_unit-> in_MEMORY_IN_VAL                  ))(*( in_MEMORY_IN_VAL                  ));
+  (*(_Load_store_unit->out_MEMORY_IN_ACK                  ))(*(out_MEMORY_IN_ACK                  ));
+  if (_param->_have_port_context_id)
+    (*(_Load_store_unit-> in_MEMORY_IN_CONTEXT_ID           ))(*( in_MEMORY_IN_CONTEXT_ID           ));
+  if (_param->_have_port_front_end_id)
+    (*(_Load_store_unit-> in_MEMORY_IN_FRONT_END_ID         ))(*( in_MEMORY_IN_FRONT_END_ID         ));
+  if (_param->_have_port_ooo_engine_id)
+    (*(_Load_store_unit-> in_MEMORY_IN_OOO_ENGINE_ID        ))(*( in_MEMORY_IN_OOO_ENGINE_ID        ));
+  if (_param->_have_port_packet_id)
+    (*(_Load_store_unit-> in_MEMORY_IN_PACKET_ID            ))(*( in_MEMORY_IN_PACKET_ID            ));
+  (*(_Load_store_unit-> in_MEMORY_IN_OPERATION            ))(*( in_MEMORY_IN_OPERATION            ));
+  (*(_Load_store_unit-> in_MEMORY_IN_STORE_QUEUE_PTR_WRITE))(*( in_MEMORY_IN_STORE_QUEUE_PTR_WRITE));
+  (*(_Load_store_unit-> in_MEMORY_IN_LOAD_QUEUE_PTR_WRITE ))(*( in_MEMORY_IN_LOAD_QUEUE_PTR_WRITE ));
+  //(*(_Load_store_unit-> in_MEMORY_IN_HAS_IMMEDIAT         ))(*( in_MEMORY_IN_HAS_IMMEDIAT         ));
+  (*(_Load_store_unit-> in_MEMORY_IN_IMMEDIAT             ))(*( in_MEMORY_IN_IMMEDIAT             ));
+  (*(_Load_store_unit-> in_MEMORY_IN_DATA_RA              ))(*( in_MEMORY_IN_DATA_RA              ));
+  (*(_Load_store_unit-> in_MEMORY_IN_DATA_RB              ))(*( in_MEMORY_IN_DATA_RB              ));
+  //(*(_Load_store_unit-> in_MEMORY_IN_DATA_RC              ))(*( in_MEMORY_IN_DATA_RC              ));
+//   (*(_Load_store_unit-> in_MEMORY_IN_WRITE_RD             ))(*( in_MEMORY_IN_WRITE_RD             ));
+  (*(_Load_store_unit-> in_MEMORY_IN_NUM_REG_RD           ))(*( in_MEMORY_IN_NUM_REG_RD           ));
+  //(*(_Load_store_unit-> in_MEMORY_IN_WRITE_RE             ))(*( in_MEMORY_IN_WRITE_RE             ));
+  //(*(_Load_store_unit-> in_MEMORY_IN_NUM_REG_RE           ))(*( in_MEMORY_IN_NUM_REG_RE           ));
+  
+  (*(_Load_store_unit->out_MEMORY_OUT_VAL           ))(*(out_MEMORY_OUT_VAL           ));
+  (*(_Load_store_unit-> in_MEMORY_OUT_ACK           ))(*( in_MEMORY_OUT_ACK           ));
+  if (_param->_have_port_context_id)
+    (*(_Load_store_unit->out_MEMORY_OUT_CONTEXT_ID    ))(*(out_MEMORY_OUT_CONTEXT_ID    ));
+  if (_param->_have_port_front_end_id)
+    (*(_Load_store_unit->out_MEMORY_OUT_FRONT_END_ID  ))(*(out_MEMORY_OUT_FRONT_END_ID  ));
+  if (_param->_have_port_ooo_engine_id)
+    (*(_Load_store_unit->out_MEMORY_OUT_OOO_ENGINE_ID ))(*(out_MEMORY_OUT_OOO_ENGINE_ID ));
+  if (_param->_have_port_packet_id)
+    (*(_Load_store_unit->out_MEMORY_OUT_PACKET_ID     ))(*(out_MEMORY_OUT_PACKET_ID     ));
+  (*(_Load_store_unit->out_MEMORY_OUT_WRITE_RD      ))(*(out_MEMORY_OUT_WRITE_RD      ));
+  (*(_Load_store_unit->out_MEMORY_OUT_NUM_REG_RD    ))(*(out_MEMORY_OUT_NUM_REG_RD    ));
+  (*(_Load_store_unit->out_MEMORY_OUT_DATA_RD       ))(*(out_MEMORY_OUT_DATA_RD       ));
+  //(*(_Load_store_unit->out_MEMORY_OUT_WRITE_RE      ))(*(out_MEMORY_OUT_WRITE_RE      ));
+  //(*(_Load_store_unit->out_MEMORY_OUT_NUM_REG_RE    ))(*(out_MEMORY_OUT_NUM_REG_RE    ));
+  //(*(_Load_store_unit->out_MEMORY_OUT_DATA_RE       ))(*(out_MEMORY_OUT_DATA_RE       ));
+  (*(_Load_store_unit->out_MEMORY_OUT_EXCEPTION     ))(*(out_MEMORY_OUT_EXCEPTION     ));
+
+  (*(_Load_store_unit->out_DCACHE_REQ_VAL       ))(*(out_DCACHE_REQ_VAL       ));
+  (*(_Load_store_unit-> in_DCACHE_REQ_ACK       ))(*( in_DCACHE_REQ_ACK       ));
+  if (_param->_have_port_dcache_context_id)
+    (*(_Load_store_unit->out_DCACHE_REQ_CONTEXT_ID))(*(out_DCACHE_REQ_CONTEXT_ID));
+  (*(_Load_store_unit->out_DCACHE_REQ_PACKET_ID ))(*(out_DCACHE_REQ_PACKET_ID ));
+  (*(_Load_store_unit->out_DCACHE_REQ_ADDRESS   ))(*(out_DCACHE_REQ_ADDRESS   ));
+  (*(_Load_store_unit->out_DCACHE_REQ_TYPE      ))(*(out_DCACHE_REQ_TYPE      ));
+  (*(_Load_store_unit->out_DCACHE_REQ_WDATA     ))(*(out_DCACHE_REQ_WDATA     ));
+
+  (*(_Load_store_unit-> in_DCACHE_RSP_VAL       ))(*( in_DCACHE_RSP_VAL       ));
+  (*(_Load_store_unit->out_DCACHE_RSP_ACK       ))(*(out_DCACHE_RSP_ACK       ));
+  if (_param->_have_port_dcache_context_id)
+    (*(_Load_store_unit-> in_DCACHE_RSP_CONTEXT_ID))(*( in_DCACHE_RSP_CONTEXT_ID));
+  (*(_Load_store_unit-> in_DCACHE_RSP_PACKET_ID ))(*( in_DCACHE_RSP_PACKET_ID ));
+  (*(_Load_store_unit-> in_DCACHE_RSP_RDATA     ))(*( in_DCACHE_RSP_RDATA     ));
+  (*(_Load_store_unit-> in_DCACHE_RSP_ERROR     ))(*( in_DCACHE_RSP_ERROR     ));
+
+  if (_param->_speculative_load == SPECULATIVE_LOAD_BYPASS)
+    {
+      for (uint32_t i=0; i<_param->_size_load_queue; i++)
+	{
+	  (*(_Load_store_unit->out_BYPASS_MEMORY_VAL           [i]))(*(out_BYPASS_MEMORY_VAL           [i]));
+	  if (_param->_have_port_ooo_engine_id)    
+	    (*(_Load_store_unit->out_BYPASS_MEMORY_OOO_ENGINE_ID [i]))(*(out_BYPASS_MEMORY_OOO_ENGINE_ID [i]));
+	  (*(_Load_store_unit->out_BYPASS_MEMORY_NUM_REG       [i]))(*(out_BYPASS_MEMORY_NUM_REG       [i]));
+	  (*(_Load_store_unit->out_BYPASS_MEMORY_DATA          [i]))(*(out_BYPASS_MEMORY_DATA          [i]));
+	}
+    }
+  cout << "<" << name << "> Start Simulation ............" << endl;
+  Time * _time = new Time();
+
+  /********************************************************
+   * Simulation - Begin
+   ********************************************************/
+
+  // Initialisation
+
+  const uint32_t seed = 0;
+  //const uint32_t seed = static_cast<uint32_t>(time(NULL));
+
+  srand(seed);
+
+  const uint32_t     nb_request   = _param->_nb_packet;
+  const uint32_t     nb_word      = nb_request;
+
+  //const int32_t      percent_transaction_memory_in  = 100;
+  const int32_t      percent_transaction_memory_out =  75;
+  const int32_t      percent_transaction_dcache     =  75;
+
+  const int32_t      percent_exception              =   0;
+  const int32_t      percent_type_load              =   0;
+  const int32_t      percent_type_store             =  50;
+  const int32_t      percent_miss_spec              =  20;
+  
+  const uint32_t     miss_rate                      =  10;
+  const uint32_t     miss_penality                  =   5;
+
+  if ((percent_type_load  +
+       percent_type_store ) > 100)
+    TEST_KO("sum of percent_type > 100");
+
+  const int32_t      seuil_type_load    = percent_type_load;
+  const int32_t      seuil_type_store   = percent_type_store+percent_type_load;
+
+  uint32_t           nb_request_memory_in ;
+  uint32_t           nb_request_memory_out;
+  uint32_t           nb_request_dcache    ;
+
+  MemoryRequest_t                 tab_request  [nb_request];
+  priority_queue<MemoryRequest_t> fifo_request;
+
+  // emulation of memory
+  Memory_t                      * _memory = new Memory_t (1<<_param->_size_dcache_context_id, nb_word, _param->_size_general_data);
+  Cache_t                       * _cache  = new Cache_t  (miss_rate, miss_penality);
+
+
+  SC_START(0);
+
+  LABEL("Initialisation");
+
+  in_MEMORY_IN_VAL ->write(0);
+  in_MEMORY_OUT_ACK->write(0);
+  in_DCACHE_REQ_ACK->write(0);
+  in_DCACHE_RSP_VAL->write(0);
+
+  in_NRESET        ->write(0);
+  SC_START(5);
+  in_NRESET        ->write(5);
+
+  LABEL("Loop of Test");
+
+  try 
+    {
+      for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++)
+	{
+	  LABEL("Iteration "+toString(iteration));
+
+	  LABEL("Structure's initialisation");
+
+	  nb_request_memory_in  = 0;
+	  nb_request_memory_out = 0;
+	  nb_request_dcache     = 0;
+      
+	  // Fill the request_queue
+      
+	  Tlsq_ptr_t         store_queue_ptr_write = 0;
+	  Tlsq_ptr_t         load_queue_ptr_write  = 0;
+
+	  bool               store_queue_use [_param->_size_store_queue];
+	  uint32_t           nb_store_slot_use = 0;
+	  bool               load_queue_use  [_param->_size_load_queue ];
+
+	  for (uint32_t i=0; i<_param->_size_store_queue; i++)
+	    store_queue_use [i] = false;
+	  for (uint32_t i=0; i<_param->_size_load_queue ; i++)
+	    load_queue_use  [i] = false;
+
+	  double             current_cycle = sc_simulation_time();
+	  double             cycle_min     = current_cycle;
+
+	  Toperation_t       operation_store [4] = {OPERATION_MEMORY_STORE_8,
+						    OPERATION_MEMORY_STORE_16,
+						    OPERATION_MEMORY_STORE_32,
+						    OPERATION_MEMORY_STORE_64};
+
+	  Toperation_t       operation_load  [8] = {OPERATION_MEMORY_LOAD_8_Z,
+						    OPERATION_MEMORY_LOAD_8_S,
+						    OPERATION_MEMORY_LOAD_16_Z,
+						    OPERATION_MEMORY_LOAD_16_S,
+						    OPERATION_MEMORY_LOAD_32_Z,
+						    OPERATION_MEMORY_LOAD_32_S,
+						    OPERATION_MEMORY_LOAD_64_Z,
+						    OPERATION_MEMORY_LOAD_64_S};
+
+	  Toperation_t       operation_other [5] = {OPERATION_MEMORY_LOCK           ,
+						    OPERATION_MEMORY_INVALIDATE     ,
+						    OPERATION_MEMORY_PREFETCH       ,
+						    OPERATION_MEMORY_FLUSH          ,
+						    OPERATION_MEMORY_SYNCHRONIZATION};
+
+
+	  const uint32_t nb_operation_store =   (log2(_param->_size_general_data/8)+1);
+	  const uint32_t nb_operation_load  = 2*(log2(_param->_size_general_data/8)+1);
+	  const uint32_t nb_operation_other = 5;
+
+	  LABEL("Fifo request initialisation");
+	  // Init fifo_request
+	  for (uint32_t i=0; i<nb_request; i++)
+	    {
+	      double       cycle;
+	      Tcontext_t   context_id                = 0;
+	      Tcontext_t   front_end_id              = 0;
+	      Tcontext_t   ooo_engine_id             = rand () % _param->_nb_ooo_engine;
+	      Tpacket_t    packet_id                 = i;
+	      Tlsq_ptr_t   store_queue_ptr_write_old = store_queue_ptr_write;
+	      Tlsq_ptr_t   load_queue_ptr_write_old  = load_queue_ptr_write ;
+	      Toperation_t operation;
+	  
+	      int32_t      percent = rand()%100;
+
+	      uint32_t     size_queue;
+	 
+	      if (percent < seuil_type_load)
+		{
+		  LABEL(" * LOAD");
+		  operation            = operation_load[(rand()%nb_operation_load)];
+		  size_queue           = _param->_size_load_queue;
+		  load_queue_ptr_write = (load_queue_ptr_write+1) % (size_queue);
+		}
+	      else
+		{
+		  if (percent < seuil_type_store)
+		    {
+		      LABEL(" * STORE");
+		  
+		  
+		      operation             = operation_store[(rand()%nb_operation_store)];
+		      size_queue            = _param->_size_store_queue;
+		      store_queue_ptr_write = (store_queue_ptr_write+1) % (size_queue);
+		    }
+		  else
+		    {
+		      LABEL(" * OTHERS");
+		      operation            = operation_other[(rand()%nb_operation_other)];
+		      // 		  operation            = operation_other[4];
+		      size_queue           = _param->_size_load_queue;
+		      load_queue_ptr_write = (load_queue_ptr_write+1) % (size_queue);
+		    }
+		}
+
+	      cycle = cycle_min;
+	      cycle_min ++;
+
+	      Ttype_t            type    = TYPE_MEMORY;
+	      Tgeneral_data_t    address = rand()%(nb_word);
+	      Tgeneral_data_t    offset  = rand()%(nb_word);
+
+	      // LABEL ("Address step 1 : "+toString(address)+" - "+toString(offset));
+
+	      percent = rand()%100;
+	      if (percent > percent_exception) 
+		address = address & (~ mask_memory_access(operation));
+	  
+	      // LABEL ("Address step 2 : "+toString(address)+" - mask : "+toString((~ mask_memory_access(operation))));
+
+	      if (offset > address) // max
+		offset  = address;
+
+	      Tgeneral_data_t    immediat      = offset;
+	      Tgeneral_data_t    data_ra       = address - offset;
+
+	      // LABEL ("Address step 3 : "+toString(address)+", "+toString(data_ra)+" - "+toString(immediat));
+	  
+	      Tgeneral_data_t    data_rb       = static_cast<Tgeneral_data_t>(rand());
+	      Tcontrol_t         write_rd      = 0;
+	      Tgeneral_address_t num_reg_rd    = 0;
+	      bool               write_spec_ko = is_operation_memory_store(operation) and ((rand()%100)<percent_miss_spec);
+
+	      tab_request [i].modif(cycle                    ,
+				    context_id               ,
+				    front_end_id             ,
+				    ooo_engine_id            ,
+				    packet_id                ,
+				    operation                ,
+				    type                     ,
+				    store_queue_ptr_write_old,
+				    load_queue_ptr_write_old ,
+				    immediat                 ,
+				    data_ra                  ,
+				    data_rb                  ,
+				    write_rd                 ,
+				    num_reg_rd               ,
+				    write_spec_ko);
+
+	      cout << tab_request [i] << endl;
+	
+	      fifo_request.push(tab_request [i]);
+
+	      double cycle_head = 0;
+
+	      if (is_operation_memory_store(operation))
+		{
+		  cycle_head = cycle_min;
+		  cycle_min ++;
+
+		  cout << "         * Write head : " << toString(cycle_head) 
+		       << endl
+		       << endl;
+	      
+		  fifo_request.push(MemoryRequest_t(cycle_head,
+						    context_id,
+						    front_end_id,
+						    ooo_engine_id,
+						    packet_id,
+						    (write_spec_ko==true)?OPERATION_MEMORY_STORE_HEAD_KO:OPERATION_MEMORY_STORE_HEAD_OK,
+						    type,
+						    store_queue_ptr_write_old,
+						    0,
+						    0,
+						    0,
+						    0,
+						    0,
+						    0,
+						    write_spec_ko));
+		}
+	    }
+        
+	  LABEL("Simulation of this iteration ...");
+    
+	  while (nb_request_memory_out < nb_request)
+	    {
+	      cout << "*********************************************" << endl;
+	      cout << "Dump STORE_QUEUE_USE : " << endl;
+	      cout << " use " << nb_store_slot_use << endl;
+	      for (uint32_t i=0; i<_param->_size_store_queue; i++)
+		cout << "  [" << i << "] " << store_queue_use [i] << endl;
+	      cout << "Dump LOAD_QUEUE_USE : " << endl;
+	      for (uint32_t i=0; i<_param->_size_load_queue ; i++)
+		cout << "  [" << i << "] " << load_queue_use [i] << endl;
+	      cout << "*********************************************" << endl;
+
+
+	      // ***** MEMORY_IN *****
+
+	      // memory_in_val depends of three factors :
+	      //  1) request's fifo is not empty ?
+	      //  2) the slot destination is free ?
+	      //  3) The head of request's fifo can be issue : the number of cycle is more than current cycle
+
+	      bool can_execute = false;
+
+	      if (is_operation_memory_store(fifo_request.top()._operation))
+		can_execute = (not store_queue_use [fifo_request.top()._store_queue_ptr_write] and (nb_store_slot_use < _param->_size_store_queue-1)) or is_operation_memory_store_head(fifo_request.top()._operation);
+	      else
+		can_execute = not load_queue_use  [fifo_request.top()._load_queue_ptr_write];
+	  
+	      in_MEMORY_IN_VAL ->write((not fifo_request.empty()) and 
+				       can_execute                and 
+				       (sc_simulation_time() >= fifo_request.top()._cycle));
+
+	      if (_param->_have_port_context_id)
+		in_MEMORY_IN_CONTEXT_ID           ->write (fifo_request.top()._context_id           );
+	      if (_param->_have_port_front_end_id)
+		in_MEMORY_IN_FRONT_END_ID         ->write (fifo_request.top()._front_end_id         );
+	      if (_param->_have_port_ooo_engine_id)
+		in_MEMORY_IN_OOO_ENGINE_ID        ->write (fifo_request.top()._ooo_engine_id        );
+	      if (_param->_have_port_packet_id)
+		in_MEMORY_IN_PACKET_ID            ->write (fifo_request.top()._packet_id            );
+	      in_MEMORY_IN_OPERATION            ->write (fifo_request.top()._operation            );
+	      in_MEMORY_IN_TYPE                 ->write (fifo_request.top()._type                 );
+	      in_MEMORY_IN_STORE_QUEUE_PTR_WRITE->write (fifo_request.top()._store_queue_ptr_write);
+	      in_MEMORY_IN_LOAD_QUEUE_PTR_WRITE ->write (fifo_request.top()._load_queue_ptr_write );
+	      in_MEMORY_IN_IMMEDIAT             ->write (fifo_request.top()._immediat             );
+	      in_MEMORY_IN_DATA_RA              ->write (fifo_request.top()._data_ra              );
+	      in_MEMORY_IN_DATA_RB              ->write (fifo_request.top()._data_rb              );
+// 	      in_MEMORY_IN_WRITE_RD             ->write (fifo_request.top()._write_rd             );
+	      in_MEMORY_IN_NUM_REG_RD           ->write (fifo_request.top()._num_reg_rd           );
+
+	      in_MEMORY_OUT_ACK->write((rand()%100)<percent_transaction_memory_out);
+
+	      // ***** DCACHE_REQ *****
+	      in_DCACHE_REQ_ACK->write((rand()%100)<percent_transaction_dcache);
+
+	      // ***** DCACHE_RSP *****
+	      bool have_rsp = _cache->have_rsp ();
+	      in_DCACHE_RSP_VAL->write(have_rsp);
+
+	      if (have_rsp)
+		{
+		  in_DCACHE_RSP_CONTEXT_ID->write(_cache->front()._context_id);
+		  in_DCACHE_RSP_PACKET_ID ->write(_cache->front()._packet_id );
+		  in_DCACHE_RSP_RDATA     ->write(_cache->front()._rdata     );
+		  in_DCACHE_RSP_ERROR     ->write(_cache->front()._error     );
+		}
+
+	      SC_START(0);
+
+	      LABEL("MEMORY_IN  : "+toString(in_MEMORY_IN_VAL ->read())+" - "+toString(out_MEMORY_IN_ACK ->read()));
+	      LABEL("  * fifo_request.empty                     : "+toString(fifo_request.empty()));
+	      LABEL("  * fifo_request.top.cycle                 : "+toString(fifo_request.top()._cycle));
+	      LABEL("  * fifo_request.top.store_queue_ptr_write : "+toString(static_cast<uint32_t>(fifo_request.top()._store_queue_ptr_write)));
+	      LABEL("  * fifo_request.top.load_queue_ptr_write  : "+toString(static_cast<uint32_t>(fifo_request.top()._load_queue_ptr_write)));
+	      LABEL("  * fifo_request.top.operation             : "+toString(static_cast<uint32_t>(fifo_request.top()._operation           )));
+	      LABEL("  * can_execute                            : "+toString(can_execute));
+
+	      if ( in_MEMORY_IN_VAL ->read() and out_MEMORY_IN_ACK ->read())
+		{
+		  LABEL(" * Accepted MEMORY_IN  : " + toString(nb_request_memory_in));
+		  cout << fifo_request.top();
+
+		  if (is_operation_memory_store(fifo_request.top()._operation))
+		    {
+		      if (not is_operation_memory_store_head(fifo_request.top()._operation))
+			{
+			  store_queue_use [fifo_request.top()._store_queue_ptr_write] = true;
+			  nb_store_slot_use ++;
+			}
+		    }
+		  else
+		    load_queue_use [fifo_request.top()._load_queue_ptr_write] = true;
+
+		  fifo_request.pop();
+	      
+		  nb_request_memory_in ++;
+		}
+
+	      LABEL("MEMORY_OUT : "+toString(out_MEMORY_OUT_VAL->read())+" - "+toString(in_MEMORY_OUT_ACK ->read()));
+	      if (out_MEMORY_OUT_VAL->read() and  in_MEMORY_OUT_ACK->read())
+		{
+		  Tpacket_t  packet_id = out_MEMORY_OUT_PACKET_ID->read();
+
+		  LABEL(" * Accepted MEMORY_OUT : " + toString(packet_id));
+
+		  if (is_operation_memory_store(tab_request[packet_id]._operation))
+		    {
+		      store_queue_use [tab_request[packet_id]._store_queue_ptr_write] = false;
+		      nb_store_slot_use --;
+		    }
+		  else
+		    load_queue_use  [tab_request[packet_id]._load_queue_ptr_write] = false;
+
+		  nb_request_memory_out ++;
+
+		  // a lot of test
+		  TEST(Tcontext_t        , out_MEMORY_OUT_CONTEXT_ID   ->read(), tab_request[packet_id]._context_id   );
+		  TEST(Tcontext_t        , out_MEMORY_OUT_FRONT_END_ID ->read(), tab_request[packet_id]._front_end_id );
+		  TEST(Tcontext_t        , out_MEMORY_OUT_OOO_ENGINE_ID->read(), tab_request[packet_id]._ooo_engine_id);
+		  TEST(Tpacket_t         , out_MEMORY_OUT_PACKET_ID    ->read(), tab_request[packet_id]._packet_id    );
+		  TEST(Tcontrol_t        , out_MEMORY_OUT_WRITE_RD     ->read(), tab_request[packet_id]._write_rd     );
+		  TEST(Tgeneral_address_t, out_MEMORY_OUT_NUM_REG_RD   ->read(), tab_request[packet_id]._num_reg_rd   );
+
+		  Tgeneral_data_t address = tab_request[packet_id]._data_ra + tab_request[packet_id]._immediat;
+		  if (address != (address & (~ mask_memory_access(tab_request[packet_id]._operation))))
+		    TEST(Texception_t      , out_MEMORY_OUT_EXCEPTION    ->read(), EXCEPTION_MEMORY_ALIGNMENT);
+		  else
+		    {
+		      if (tab_request[packet_id]._write_spec_ko)
+			TEST(Texception_t, out_MEMORY_OUT_EXCEPTION    ->read(), EXCEPTION_MEMORY_MISS_SPECULATION);
+		      else
+			{
+			  TEST(Texception_t, out_MEMORY_OUT_EXCEPTION    ->read(), EXCEPTION_MEMORY_NONE);
+
+			  if (is_operation_memory_load(tab_request[packet_id]._operation))
+			    {
+			      Tgeneral_data_t read_lsq = _memory->read_lsq (((tab_request[packet_id]._ooo_engine_id<<(_param->_size_context_id + _param->_size_front_end_id )) |
+									     (tab_request[packet_id]._front_end_id <<(_param->_size_context_id)) |
+									     (tab_request[packet_id]._context_id)),
+									    (tab_request[packet_id]._immediat +
+									     tab_request[packet_id]._data_ra), 
+									    tab_request[packet_id]._operation);
+			      cout << "MEMORY_OUT is a LOAD" << endl
+				   << "  * operation       : " << tab_request[packet_id]._operation << endl
+				   << std::hex
+				   << "  * address         : " << (tab_request[packet_id]._immediat +
+								   tab_request[packet_id]._data_ra) << endl
+				   << "  * read_lsq        : " << read_lsq << endl
+				   << "  * memory_out_data : " << out_MEMORY_OUT_DATA_RD->read() << endl
+				   << std::dec;
+			  
+// 			      TEST(Tgeneral_data_t   , out_MEMORY_OUT_DATA_RD->read(), read_lsq);
+			    }
+			}
+		    }
+		}
+
+	      LABEL("DCACHE_REQ : "+toString(out_DCACHE_REQ_VAL->read())+" - "+toString(in_DCACHE_REQ_ACK ->read()));
+	      if (out_DCACHE_REQ_VAL->read() and  in_DCACHE_REQ_ACK->read())
+		{
+		  Tcontext_t   context_id;
+		  Tpacket_t    packet_id ; 
+		  if (_param->_have_port_dcache_context_id)
+		    context_id = out_DCACHE_REQ_CONTEXT_ID->read();
+		  else
+		    context_id = 0;
+
+		  packet_id  = (out_DCACHE_REQ_PACKET_ID ->read())>>1;
+	      
+		  LABEL(" * Accepted DCACHE_REQ : " + toString(packet_id));
+
+// 		  TEST(Tcontext_t       ,out_DCACHE_REQ_CONTEXT_ID->read(),((tab_request[packet_id]._ooo_engine_id<<(_param->_size_context_id + _param->_size_front_end_id )) |
+// 									    (tab_request[packet_id]._front_end_id <<(_param->_size_context_id)) |
+// 									    (tab_request[packet_id]._context_id)));
+// 		  TEST(Tdcache_address_t,out_DCACHE_REQ_ADDRESS   ->read(),(tab_request[packet_id]._immediat +
+// 									    tab_request[packet_id]._data_ra) );
+// 		  TEST(Tdcache_type_t   ,out_DCACHE_REQ_TYPE      ->read(), operation_to_dcache_type(operation));
+		  
+// 		  if (is_operation_memory_store(operation))
+// 		    TEST(Tdcache_data_t   ,out_DCACHE_REQ_WDATA     ->read(),tab_request[packet_id]._data_rb);
+
+		  Tdcache_data_t rdata = _memory->access (context_id, out_DCACHE_REQ_ADDRESS->read(), out_DCACHE_REQ_TYPE->read(), out_DCACHE_REQ_WDATA->read());
+
+		  // test type : send or not a respons !
+		  LABEL("   * rdata : " + toString(rdata));
+
+		  if ((out_DCACHE_REQ_TYPE->read() == DCACHE_SYNCHRONIZATION) or
+		      (out_DCACHE_REQ_TYPE->read() == DCACHE_LOAD))
+		    {
+		      LABEL("     * have_dcache_rsp");
+		  
+		      _cache->push (context_id,
+				    out_DCACHE_REQ_PACKET_ID ->read(),
+				    rdata     ,
+				    0);
+		    }
+		}
+
+	      LABEL("DCACHE_RSP : "+toString(in_DCACHE_RSP_VAL->read())+" - "+toString(out_DCACHE_RSP_ACK ->read()));
+	      if (in_DCACHE_RSP_VAL->read() and out_DCACHE_RSP_ACK->read())
+		{
+		  _cache->pop();
+		}
+
+	      _cache->end_cycle();
+
+	      SC_START(1);
+	    }
+	}
+    }
+  catch (morpheo::ErrorMorpheo & error)
+    {
+      _memory->trace();
+      throw (error);
+    }
+
+  _memory->trace();
+
+  
+  /********************************************************
+   * Simulation - End
+   ********************************************************/
+
+  TEST_OK ("End of Simulation");
+  delete _time;
+  cout << "<" << name << "> ............ Stop Simulation" << endl;
+
+  delete     in_CLOCK;
+  delete     in_NRESET;
+
+  delete     in_MEMORY_IN_VAL         ;
+  delete    out_MEMORY_IN_ACK         ;
+  delete     in_MEMORY_IN_CONTEXT_ID  ;
+  delete     in_MEMORY_IN_FRONT_END_ID  ;
+  delete     in_MEMORY_IN_OOO_ENGINE_ID  ;
+  delete     in_MEMORY_IN_PACKET_ID   ;
+  delete     in_MEMORY_IN_OPERATION   ;
+  delete     in_MEMORY_IN_STORE_QUEUE_PTR_WRITE;
+  delete     in_MEMORY_IN_LOAD_QUEUE_PTR_WRITE ;
+  //delete     in_MEMORY_IN_HAS_IMMEDIAT;
+  delete     in_MEMORY_IN_IMMEDIAT    ;
+  delete     in_MEMORY_IN_DATA_RA     ;
+  delete     in_MEMORY_IN_DATA_RB     ;
+  //delete     in_MEMORY_IN_DATA_RC     ;
+//   delete     in_MEMORY_IN_WRITE_RD    ;
+  delete     in_MEMORY_IN_NUM_REG_RD  ;
+  //delete     in_MEMORY_IN_WRITE_RE    ;
+  //delete     in_MEMORY_IN_NUM_REG_RE  ;
+    
+  delete    out_MEMORY_OUT_VAL       ;
+  delete     in_MEMORY_OUT_ACK       ;
+  delete    out_MEMORY_OUT_CONTEXT_ID;
+  delete    out_MEMORY_OUT_FRONT_END_ID;
+  delete    out_MEMORY_OUT_OOO_ENGINE_ID;
+  delete    out_MEMORY_OUT_PACKET_ID ;
+  delete    out_MEMORY_OUT_WRITE_RD  ;
+  delete    out_MEMORY_OUT_NUM_REG_RD;
+  delete    out_MEMORY_OUT_DATA_RD   ;
+  //delete    out_MEMORY_OUT_WRITE_RE  ;
+  //delete    out_MEMORY_OUT_NUM_REG_RE;
+  //delete    out_MEMORY_OUT_DATA_RE   ;
+  delete    out_MEMORY_OUT_EXCEPTION ;
+  
+  delete    out_DCACHE_REQ_VAL       ;
+  delete     in_DCACHE_REQ_ACK       ;
+  delete    out_DCACHE_REQ_CONTEXT_ID;
+  delete    out_DCACHE_REQ_PACKET_ID ;
+  delete    out_DCACHE_REQ_ADDRESS   ;
+  delete    out_DCACHE_REQ_TYPE      ;
+  delete    out_DCACHE_REQ_WDATA     ;
+  
+  delete     in_DCACHE_RSP_VAL       ;
+  delete    out_DCACHE_RSP_ACK       ;
+  delete     in_DCACHE_RSP_CONTEXT_ID;
+  delete     in_DCACHE_RSP_PACKET_ID ;
+  delete     in_DCACHE_RSP_RDATA     ;
+  delete     in_DCACHE_RSP_ERROR     ;
+  
+  if (_param->_speculative_load == SPECULATIVE_LOAD_BYPASS)
+    {
+      delete [] out_BYPASS_MEMORY_VAL       ;
+      delete [] out_BYPASS_MEMORY_OOO_ENGINE_ID;
+      delete [] out_BYPASS_MEMORY_NUM_REG   ;
+      delete [] out_BYPASS_MEMORY_DATA      ;
+    }
+#endif
+
+  delete _Load_store_unit;
+  delete _memory;
+  delete _cache;
+#ifdef STATISTICS
+  delete _parameters_statistics;
+#endif
+}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/SelfTest/src/test2.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/SelfTest/src/test2.cpp	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/SelfTest/src/test2.cpp	(revision 71)
@@ -0,0 +1,780 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ * Test
+ */
+
+#include <queue>
+#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/SelfTest/include/test.h"
+
+#define CYCLE_MAX     1024
+
+#define LABEL(str)							\
+  {									\
+    cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} " << str << endl; \
+  } while(0)
+
+#define SC_START(cycle_offset)						\
+  do									\
+    {									\
+      /*cout << "SC_START (begin)" << endl;*/				\
+									\
+      uint32_t cycle_current = static_cast<uint32_t>(sc_simulation_time()); \
+      if (cycle_offset != 0)						\
+	{								\
+	  cout << "##########[ cycle "<< cycle_current+cycle_offset << " ]" << endl; \
+	}								\
+									\
+      if (cycle_current > CYCLE_MAX)					\
+	{								\
+	  TEST_KO("Maximal cycles Reached");				\
+	}								\
+      sc_start(cycle_offset);						\
+      /*cout << "SC_START (end  )" << endl;*/				\
+    } while(0)
+
+
+//===================================================================={test}
+void test2 (void)
+{
+  std::string name = "Test_Load_store_queue_manual";
+
+  cout << "<" << name << "> : Simulation SystemC" << endl;
+
+
+  morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::Parameters * _param = new morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::Parameters
+	(
+	 4,  //_size_store_queue       
+	 4,  //_size_load_queue        
+	 2,  //_size_speculative_access_queue
+	 2,  //_nb_port_check          
+	 SPECULATIVE_LOAD_COMMIT,  //_speculative_load       
+	 1,  //_nb_context             
+	 1,  //_nb_front_end           
+	 2,  //_nb_ooo_engine          
+	 128,//_nb_packet              
+	 32, //_size_general_data      
+	 64, //_nb_general_register    
+	 4,  //_nb_operation           
+	 4   //_nb_type                
+        );
+
+#ifdef STATISTICS
+  morpheo::behavioural::Parameters_Statistics * _parameters_statistics = new morpheo::behavioural::Parameters_Statistics (5,0);
+#endif
+
+  Load_store_unit * _Load_store_unit = new Load_store_unit (name.c_str(),
+#ifdef STATISTICS
+							    _parameters_statistics,
+#endif
+							    _param);
+  
+#ifdef SYSTEMC
+  /*********************************************************************
+   * Déclarations des signaux
+   *********************************************************************/
+  string rename = "";
+
+  sc_clock                               * in_CLOCK  = new sc_clock ("clock", 1.0, 0.5);
+  sc_signal<Tcontrol_t>                  * in_NRESET = new sc_signal<Tcontrol_t> ("NRESET");
+
+  sc_signal<Tcontrol_t        > *   in_MEMORY_IN_VAL                   = new sc_signal<Tcontrol_t        > (rename.c_str());
+  sc_signal<Tcontrol_t        > *  out_MEMORY_IN_ACK                   = new sc_signal<Tcontrol_t        > (rename.c_str());
+  sc_signal<Tcontext_t        > *   in_MEMORY_IN_CONTEXT_ID            = new sc_signal<Tcontext_t        > (rename.c_str());
+  sc_signal<Tcontext_t        > *   in_MEMORY_IN_FRONT_END_ID          = new sc_signal<Tcontext_t        > (rename.c_str());
+  sc_signal<Tcontext_t        > *   in_MEMORY_IN_OOO_ENGINE_ID         = new sc_signal<Tcontext_t        > (rename.c_str());
+  sc_signal<Tpacket_t         > *   in_MEMORY_IN_PACKET_ID             = new sc_signal<Tpacket_t         > (rename.c_str());
+  sc_signal<Toperation_t      > *   in_MEMORY_IN_OPERATION             = new sc_signal<Toperation_t      > (rename.c_str());
+  sc_signal<Ttype_t           > *   in_MEMORY_IN_TYPE                  = new sc_signal<Ttype_t           > (rename.c_str());
+  sc_signal<Tlsq_ptr_t        > *   in_MEMORY_IN_STORE_QUEUE_PTR_WRITE = new sc_signal<Tlsq_ptr_t        > (rename.c_str());
+  sc_signal<Tlsq_ptr_t        > *   in_MEMORY_IN_LOAD_QUEUE_PTR_WRITE  = new sc_signal<Tlsq_ptr_t        > (rename.c_str());
+  //sc_signal<Tcontrol_t        > *   in_MEMORY_IN_HAS_IMMEDIAT          = new sc_signal<Tcontrol_t        > (rename.c_str());
+  sc_signal<Tgeneral_data_t   > *   in_MEMORY_IN_IMMEDIAT              = new sc_signal<Tgeneral_data_t   > (rename.c_str());
+  sc_signal<Tgeneral_data_t   > *   in_MEMORY_IN_DATA_RA               = new sc_signal<Tgeneral_data_t   > (rename.c_str());
+  sc_signal<Tgeneral_data_t   > *   in_MEMORY_IN_DATA_RB               = new sc_signal<Tgeneral_data_t   > (rename.c_str());
+  //sc_signal<Tspecial_data_t   > *   in_MEMORY_IN_DATA_RC               = new sc_signal<Tspecial_data_t   > (rename.c_str());
+//   sc_signal<Tcontrol_t        > *   in_MEMORY_IN_WRITE_RD              = new sc_signal<Tcontrol_t        > (rename.c_str());
+  sc_signal<Tgeneral_address_t> *   in_MEMORY_IN_NUM_REG_RD            = new sc_signal<Tgeneral_address_t> (rename.c_str());
+  //sc_signal<Tcontrol_t        > *   in_MEMORY_IN_WRITE_RE              = new sc_signal<Tcontrol_t        > (rename.c_str());
+  //sc_signal<Tspecial_address_t> *   in_MEMORY_IN_NUM_REG_RE            = new sc_signal<Tspecial_address_t> (rename.c_str());
+
+  sc_signal<Tcontrol_t	      > *  out_MEMORY_OUT_VAL           = new sc_signal<Tcontrol_t	  >(rename.c_str());
+  sc_signal<Tcontrol_t	      > *   in_MEMORY_OUT_ACK           = new sc_signal<Tcontrol_t	  >(rename.c_str());
+  sc_signal<Tcontext_t        > *  out_MEMORY_OUT_CONTEXT_ID    = new sc_signal<Tcontext_t        >(rename.c_str());
+  sc_signal<Tcontext_t        > *  out_MEMORY_OUT_FRONT_END_ID  = new sc_signal<Tcontext_t        >(rename.c_str());
+  sc_signal<Tcontext_t        > *  out_MEMORY_OUT_OOO_ENGINE_ID = new sc_signal<Tcontext_t        >(rename.c_str());
+  sc_signal<Tpacket_t         > *  out_MEMORY_OUT_PACKET_ID     = new sc_signal<Tpacket_t         >(rename.c_str());
+  sc_signal<Tcontrol_t        > *  out_MEMORY_OUT_WRITE_RD      = new sc_signal<Tcontrol_t        >(rename.c_str());
+  sc_signal<Tgeneral_address_t> *  out_MEMORY_OUT_NUM_REG_RD    = new sc_signal<Tgeneral_address_t>(rename.c_str());
+  sc_signal<Tgeneral_data_t   > *  out_MEMORY_OUT_DATA_RD       = new sc_signal<Tgeneral_data_t   >(rename.c_str());
+  //sc_signal<Tcontrol_t        > *  out_MEMORY_OUT_WRITE_RE      = new sc_signal<Tcontrol_t        >(rename.c_str());
+  //sc_signal<Tspecial_address_t> *  out_MEMORY_OUT_NUM_REG_RE    = new sc_signal<Tspecial_address_t>(rename.c_str());
+  //sc_signal<Tspecial_data_t   > *  out_MEMORY_OUT_DATA_RE       = new sc_signal<Tspecial_data_t   >(rename.c_str());
+  sc_signal<Texception_t      > *  out_MEMORY_OUT_EXCEPTION     = new sc_signal<Texception_t      >(rename.c_str());
+
+  sc_signal<Tcontrol_t        > * out_DCACHE_REQ_VAL        = new sc_signal<Tcontrol_t        >(rename.c_str());
+  sc_signal<Tcontrol_t        > *  in_DCACHE_REQ_ACK        = new sc_signal<Tcontrol_t        >(rename.c_str());
+  sc_signal<Tcontext_t        > * out_DCACHE_REQ_CONTEXT_ID = new sc_signal<Tcontext_t        >(rename.c_str());
+  sc_signal<Tpacket_t         > * out_DCACHE_REQ_PACKET_ID  = new sc_signal<Tpacket_t         >(rename.c_str());
+  sc_signal<Tdcache_address_t > * out_DCACHE_REQ_ADDRESS    = new sc_signal<Tdcache_address_t >(rename.c_str());
+  sc_signal<Tdcache_type_t    > * out_DCACHE_REQ_TYPE       = new sc_signal<Tdcache_type_t    >(rename.c_str());
+  sc_signal<Tdcache_data_t    > * out_DCACHE_REQ_WDATA      = new sc_signal<Tdcache_data_t    >(rename.c_str());
+  
+  sc_signal<Tcontrol_t        > *  in_DCACHE_RSP_VAL        = new sc_signal<Tcontrol_t        >(rename.c_str());
+  sc_signal<Tcontrol_t        > * out_DCACHE_RSP_ACK        = new sc_signal<Tcontrol_t        >(rename.c_str());
+  sc_signal<Tcontext_t        > *  in_DCACHE_RSP_CONTEXT_ID = new sc_signal<Tcontext_t        >(rename.c_str());
+  sc_signal<Tpacket_t         > *  in_DCACHE_RSP_PACKET_ID  = new sc_signal<Tpacket_t         >(rename.c_str());
+  sc_signal<Tdcache_data_t    > *  in_DCACHE_RSP_RDATA      = new sc_signal<Tdcache_data_t    >(rename.c_str());
+  sc_signal<Tdcache_error_t   > *  in_DCACHE_RSP_ERROR      = new sc_signal<Tdcache_error_t   >(rename.c_str());
+  
+  sc_signal<Tcontrol_t        > ** out_BYPASS_MEMORY_VAL           = new sc_signal<Tcontrol_t        > * [_param->_size_load_queue];
+  sc_signal<Tcontext_t        > ** out_BYPASS_MEMORY_OOO_ENGINE_ID = new sc_signal<Tcontext_t        > * [_param->_size_load_queue];
+  sc_signal<Tgeneral_address_t> ** out_BYPASS_MEMORY_NUM_REG       = new sc_signal<Tgeneral_address_t> * [_param->_size_load_queue];
+  sc_signal<Tgeneral_data_t   > ** out_BYPASS_MEMORY_DATA          = new sc_signal<Tgeneral_data_t   > * [_param->_size_load_queue];
+    
+  for (uint32_t i=0; i<_param->_size_load_queue; i++)
+    {
+      out_BYPASS_MEMORY_VAL           [i] = new sc_signal<Tcontrol_t        >(rename.c_str());
+      out_BYPASS_MEMORY_OOO_ENGINE_ID [i] = new sc_signal<Tcontext_t        >(rename.c_str());
+      out_BYPASS_MEMORY_NUM_REG       [i] = new sc_signal<Tgeneral_address_t>(rename.c_str());
+      out_BYPASS_MEMORY_DATA          [i] = new sc_signal<Tgeneral_data_t   >(rename.c_str());
+    }
+  
+  /********************************************************
+   * Instanciation
+   ********************************************************/
+  
+  cout << "<" << name << "> Instanciation of _Load_store_unit" << endl;
+  
+  (*(_Load_store_unit->in_CLOCK))        (*(in_CLOCK));
+  (*(_Load_store_unit->in_NRESET))       (*(in_NRESET));
+
+  (*(_Load_store_unit-> in_MEMORY_IN_VAL                  ))(*( in_MEMORY_IN_VAL                  ));
+  (*(_Load_store_unit->out_MEMORY_IN_ACK                  ))(*(out_MEMORY_IN_ACK                  ));
+  if (_param->_have_port_context_id)
+    (*(_Load_store_unit-> in_MEMORY_IN_CONTEXT_ID           ))(*( in_MEMORY_IN_CONTEXT_ID           ));
+  if (_param->_have_port_front_end_id)
+    (*(_Load_store_unit-> in_MEMORY_IN_FRONT_END_ID         ))(*( in_MEMORY_IN_FRONT_END_ID         ));
+  if (_param->_have_port_ooo_engine_id)
+    (*(_Load_store_unit-> in_MEMORY_IN_OOO_ENGINE_ID        ))(*( in_MEMORY_IN_OOO_ENGINE_ID        ));
+  if (_param->_have_port_packet_id)
+    (*(_Load_store_unit-> in_MEMORY_IN_PACKET_ID            ))(*( in_MEMORY_IN_PACKET_ID            ));
+  (*(_Load_store_unit-> in_MEMORY_IN_OPERATION            ))(*( in_MEMORY_IN_OPERATION            ));
+  (*(_Load_store_unit-> in_MEMORY_IN_STORE_QUEUE_PTR_WRITE))(*( in_MEMORY_IN_STORE_QUEUE_PTR_WRITE));
+  (*(_Load_store_unit-> in_MEMORY_IN_LOAD_QUEUE_PTR_WRITE ))(*( in_MEMORY_IN_LOAD_QUEUE_PTR_WRITE ));
+  //(*(_Load_store_unit-> in_MEMORY_IN_HAS_IMMEDIAT         ))(*( in_MEMORY_IN_HAS_IMMEDIAT         ));
+  (*(_Load_store_unit-> in_MEMORY_IN_IMMEDIAT             ))(*( in_MEMORY_IN_IMMEDIAT             ));
+  (*(_Load_store_unit-> in_MEMORY_IN_DATA_RA              ))(*( in_MEMORY_IN_DATA_RA              ));
+  (*(_Load_store_unit-> in_MEMORY_IN_DATA_RB              ))(*( in_MEMORY_IN_DATA_RB              ));
+  //(*(_Load_store_unit-> in_MEMORY_IN_DATA_RC              ))(*( in_MEMORY_IN_DATA_RC              ));
+//   (*(_Load_store_unit-> in_MEMORY_IN_WRITE_RD             ))(*( in_MEMORY_IN_WRITE_RD             ));
+  (*(_Load_store_unit-> in_MEMORY_IN_NUM_REG_RD           ))(*( in_MEMORY_IN_NUM_REG_RD           ));
+  //(*(_Load_store_unit-> in_MEMORY_IN_WRITE_RE             ))(*( in_MEMORY_IN_WRITE_RE             ));
+  //(*(_Load_store_unit-> in_MEMORY_IN_NUM_REG_RE           ))(*( in_MEMORY_IN_NUM_REG_RE           ));
+  
+  (*(_Load_store_unit->out_MEMORY_OUT_VAL           ))(*(out_MEMORY_OUT_VAL           ));
+  (*(_Load_store_unit-> in_MEMORY_OUT_ACK           ))(*( in_MEMORY_OUT_ACK           ));
+  if (_param->_have_port_context_id)
+    (*(_Load_store_unit->out_MEMORY_OUT_CONTEXT_ID    ))(*(out_MEMORY_OUT_CONTEXT_ID    ));
+  if (_param->_have_port_front_end_id)
+    (*(_Load_store_unit->out_MEMORY_OUT_FRONT_END_ID  ))(*(out_MEMORY_OUT_FRONT_END_ID  ));
+  if (_param->_have_port_ooo_engine_id)
+    (*(_Load_store_unit->out_MEMORY_OUT_OOO_ENGINE_ID ))(*(out_MEMORY_OUT_OOO_ENGINE_ID ));
+  if (_param->_have_port_packet_id)
+    (*(_Load_store_unit->out_MEMORY_OUT_PACKET_ID     ))(*(out_MEMORY_OUT_PACKET_ID     ));
+  (*(_Load_store_unit->out_MEMORY_OUT_WRITE_RD      ))(*(out_MEMORY_OUT_WRITE_RD      ));
+  (*(_Load_store_unit->out_MEMORY_OUT_NUM_REG_RD    ))(*(out_MEMORY_OUT_NUM_REG_RD    ));
+  (*(_Load_store_unit->out_MEMORY_OUT_DATA_RD       ))(*(out_MEMORY_OUT_DATA_RD       ));
+  //(*(_Load_store_unit->out_MEMORY_OUT_WRITE_RE      ))(*(out_MEMORY_OUT_WRITE_RE      ));
+  //(*(_Load_store_unit->out_MEMORY_OUT_NUM_REG_RE    ))(*(out_MEMORY_OUT_NUM_REG_RE    ));
+  //(*(_Load_store_unit->out_MEMORY_OUT_DATA_RE       ))(*(out_MEMORY_OUT_DATA_RE       ));
+  (*(_Load_store_unit->out_MEMORY_OUT_EXCEPTION     ))(*(out_MEMORY_OUT_EXCEPTION     ));
+
+  (*(_Load_store_unit->out_DCACHE_REQ_VAL       ))(*(out_DCACHE_REQ_VAL       ));
+  (*(_Load_store_unit-> in_DCACHE_REQ_ACK       ))(*( in_DCACHE_REQ_ACK       ));
+  if (_param->_have_port_dcache_context_id)
+    (*(_Load_store_unit->out_DCACHE_REQ_CONTEXT_ID))(*(out_DCACHE_REQ_CONTEXT_ID));
+  (*(_Load_store_unit->out_DCACHE_REQ_PACKET_ID ))(*(out_DCACHE_REQ_PACKET_ID ));
+  (*(_Load_store_unit->out_DCACHE_REQ_ADDRESS   ))(*(out_DCACHE_REQ_ADDRESS   ));
+  (*(_Load_store_unit->out_DCACHE_REQ_TYPE      ))(*(out_DCACHE_REQ_TYPE      ));
+  (*(_Load_store_unit->out_DCACHE_REQ_WDATA     ))(*(out_DCACHE_REQ_WDATA     ));
+
+  (*(_Load_store_unit-> in_DCACHE_RSP_VAL       ))(*( in_DCACHE_RSP_VAL       ));
+  (*(_Load_store_unit->out_DCACHE_RSP_ACK       ))(*(out_DCACHE_RSP_ACK       ));
+  if (_param->_have_port_dcache_context_id)
+    (*(_Load_store_unit-> in_DCACHE_RSP_CONTEXT_ID))(*( in_DCACHE_RSP_CONTEXT_ID));
+  (*(_Load_store_unit-> in_DCACHE_RSP_PACKET_ID ))(*( in_DCACHE_RSP_PACKET_ID ));
+  (*(_Load_store_unit-> in_DCACHE_RSP_RDATA     ))(*( in_DCACHE_RSP_RDATA     ));
+  (*(_Load_store_unit-> in_DCACHE_RSP_ERROR     ))(*( in_DCACHE_RSP_ERROR     ));
+
+  if (_param->_speculative_load == SPECULATIVE_LOAD_BYPASS)
+    {
+      for (uint32_t i=0; i<_param->_size_load_queue; i++)
+	{
+	  (*(_Load_store_unit->out_BYPASS_MEMORY_VAL           [i]))(*(out_BYPASS_MEMORY_VAL           [i]));
+	  if (_param->_have_port_ooo_engine_id)    
+	    (*(_Load_store_unit->out_BYPASS_MEMORY_OOO_ENGINE_ID [i]))(*(out_BYPASS_MEMORY_OOO_ENGINE_ID [i]));
+	  (*(_Load_store_unit->out_BYPASS_MEMORY_NUM_REG       [i]))(*(out_BYPASS_MEMORY_NUM_REG       [i]));
+	  (*(_Load_store_unit->out_BYPASS_MEMORY_DATA          [i]))(*(out_BYPASS_MEMORY_DATA          [i]));
+	}
+    }
+  cout << "<" << name << "> Start Simulation ............" << endl;
+  Time * _time = new Time();
+
+  /********************************************************
+   * Simulation - Begin
+   ********************************************************/
+
+  // Initialisation
+
+  const uint32_t seed = 0;
+  //const uint32_t seed = static_cast<uint32_t>(time(NULL));
+
+  srand(seed);
+
+  const int32_t      percent_transaction_memory_out = 100;
+  const int32_t      percent_transaction_dcache     = 100;
+  const uint32_t     miss_rate                      =   0;
+  const uint32_t     miss_penality                  =   0;
+
+  uint32_t           nb_request_memory_out=0;
+
+  MemoryRequest_t                 tab_request  [_param->_nb_packet];
+  priority_queue<MemoryRequest_t> fifo_request;
+
+  const uint32_t     size_memory = 0x100;
+  // emulation of memory
+  Memory_t                      * _memory = new Memory_t (1<<_param->_size_dcache_context_id, size_memory, _param->_size_general_data);
+  Cache_t                       * _cache  = new Cache_t  (miss_rate, miss_penality);
+
+  SC_START(0);
+
+  LABEL("Initialisation");
+
+  in_MEMORY_IN_VAL ->write(0);
+  in_MEMORY_OUT_ACK->write(0);
+  in_DCACHE_REQ_ACK->write(0);
+  in_DCACHE_RSP_VAL->write(0);
+
+  in_NRESET        ->write(0);
+  SC_START(5);
+  in_NRESET        ->write(5);
+
+  LABEL("Loop of Test");
+
+  try 
+    {
+	  LABEL("Structure's initialisation");
+
+	  bool               store_queue_use [_param->_size_store_queue];
+	  uint32_t           nb_store_slot_use = 0;
+	  bool               load_queue_use  [_param->_size_load_queue ];
+
+	  for (uint32_t i=0; i<_param->_size_store_queue; i++)
+	    store_queue_use [i] = false;
+	  for (uint32_t i=0; i<_param->_size_load_queue ; i++)
+	    load_queue_use  [i] = false;
+
+	  
+	  //--------------------------------------------------------------------------------------------------------------
+	  //                    c  c f o p  o                              t           s l i     d     d          w n w 
+	  //                    y  o r o a  p                              y           t o m     a     a          r u r 
+	  //                    c  n o o c  e                              p           o a m     t     t          i m i 
+	  //                    l  t n _ k  r                              e           r d e     a     a          t _ t 
+	  //                    e  e t e e  a                                          e _ d     _     _          e r e  
+	  //                       x _ n t  t                                          _ p i     r     r          _ _ _
+	  //                       t e g _  i                                          p t a     a     b          r g s
+	  //                       _ n i i  o                                          t r t                      d _ p 
+	  //                       i d n d  n                                          r _                          r e 
+	  //                       d _ e                                               _ w                          d c 
+	  //                         i _                                               w r                            _ 
+	  //                         d i                                               r i                            k 
+	  //                           d                                               i t                            o 
+	  //                                                                           t e                              
+	  //                                                                           e                               
+	  //                                                                                                        
+	  tab_request[ 0].modif( 5,0,0,0, 0,OPERATION_MEMORY_STORE_32     ,TYPE_MEMORY,0,0,0x0  ,0x10 ,0xdead1234,0,0,0);
+
+	  tab_request[ 1].modif(10,0,0,0, 0,OPERATION_MEMORY_STORE_HEAD_OK,TYPE_MEMORY,0,0,0x0  ,0x0  ,0x0       ,0,0,0);
+
+	  // READ 32b 
+	  tab_request[ 2].modif(12,0,0,0, 2,OPERATION_MEMORY_LOAD_32_Z    ,TYPE_MEMORY,1,0,0x10 ,0x0  ,0x0       ,1,1,0,0xdead1234);
+	  tab_request[ 3].modif(13,0,0,0, 3,OPERATION_MEMORY_LOAD_32_S    ,TYPE_MEMORY,1,1,0x10 ,0x0  ,0x0       ,1,2,0,0xdead1234);
+
+	  // READ 16b 
+	  tab_request[ 4].modif(14,0,0,0, 4,OPERATION_MEMORY_LOAD_16_Z    ,TYPE_MEMORY,1,2,0x10 ,0x0  ,0x0       ,1,3,0,0x00001234);
+	  tab_request[ 5].modif(15,0,0,0, 5,OPERATION_MEMORY_LOAD_16_Z    ,TYPE_MEMORY,1,3,0x12 ,0x0  ,0x0       ,1,4,0,0x0000dead);
+	  tab_request[ 6].modif(16,0,0,0, 6,OPERATION_MEMORY_LOAD_16_S    ,TYPE_MEMORY,1,0,0x10 ,0x0  ,0x0       ,1,5,0,0x00001234);
+	  tab_request[ 7].modif(17,0,0,0, 7,OPERATION_MEMORY_LOAD_16_S    ,TYPE_MEMORY,1,1,0x12 ,0x0  ,0x0       ,1,6,0,0xffffdead);
+
+	  // READ  8b 
+	  tab_request[ 8].modif(18,0,0,0, 8,OPERATION_MEMORY_LOAD_8_Z     ,TYPE_MEMORY,1,0,0x10 ,0x0  ,0x0       ,1,7,0,0x00000034);
+	  tab_request[ 9].modif(19,0,0,0, 9,OPERATION_MEMORY_LOAD_8_Z     ,TYPE_MEMORY,1,1,0x11 ,0x0  ,0x0       ,1,8,0,0x00000012);
+	  tab_request[10].modif(20,0,0,0,10,OPERATION_MEMORY_LOAD_8_Z     ,TYPE_MEMORY,1,2,0x12 ,0x0  ,0x0       ,1,9,0,0x000000ad);
+	  tab_request[11].modif(21,0,0,0,11,OPERATION_MEMORY_LOAD_8_Z     ,TYPE_MEMORY,1,3,0x13 ,0x0  ,0x0       ,1,1,0,0x000000de);
+	  tab_request[12].modif(22,0,0,0,12,OPERATION_MEMORY_LOAD_8_S     ,TYPE_MEMORY,1,0,0x10 ,0x0  ,0x0       ,1,2,0,0x00000034);
+	  tab_request[13].modif(23,0,0,0,13,OPERATION_MEMORY_LOAD_8_S     ,TYPE_MEMORY,1,1,0x11 ,0x0  ,0x0       ,1,3,0,0x00000012);
+	  tab_request[14].modif(24,0,0,0,14,OPERATION_MEMORY_LOAD_8_S     ,TYPE_MEMORY,1,2,0x12 ,0x0  ,0x0       ,1,4,0,0xffffffad);
+	  tab_request[15].modif(25,0,0,0,15,OPERATION_MEMORY_LOAD_8_S     ,TYPE_MEMORY,1,3,0x13 ,0x0  ,0x0       ,1,5,0,0xffffffde);
+
+	  // STORE 16b
+	  tab_request[16].modif(30,0,0,0,16,OPERATION_MEMORY_STORE_16     ,TYPE_MEMORY,1,0,0x20 ,0x0  ,0xffffabcd,0,0,0);
+	  tab_request[17].modif(31,0,0,0,17,OPERATION_MEMORY_STORE_16     ,TYPE_MEMORY,2,0,0x22 ,0x0  ,0xffffdcba,0,0,0);
+	  tab_request[18].modif(35,0,0,0,18,OPERATION_MEMORY_STORE_HEAD_OK,TYPE_MEMORY,1,0,0x0  ,0x0  ,0x0       ,0,0,0);
+	  tab_request[19].modif(36,0,0,0,19,OPERATION_MEMORY_STORE_HEAD_OK,TYPE_MEMORY,2,0,0x0  ,0x0  ,0x0       ,0,0,0);
+	  tab_request[20].modif(40,0,0,0,20,OPERATION_MEMORY_LOAD_32_Z    ,TYPE_MEMORY,3,0,0x20 ,0x0  ,0x0       ,1,0,0,0xdcbaabcd);
+
+	  // STORE  8b and head / valid out order
+	  tab_request[21].modif(50,0,0,0,21,OPERATION_MEMORY_STORE_8      ,TYPE_MEMORY,3,0,0x1  ,0x4  ,0xffffff56,0,0,0);
+	  tab_request[22].modif(55,0,0,0,22,OPERATION_MEMORY_STORE_HEAD_OK,TYPE_MEMORY,3,0,0x1  ,0x0  ,0x0       ,0,0,0);
+	  tab_request[23].modif(48,0,0,0,23,OPERATION_MEMORY_STORE_8      ,TYPE_MEMORY,0,0,0x0  ,0x4  ,0xffffff78,0,0,0);
+	  tab_request[24].modif(43,0,0,0,24,OPERATION_MEMORY_STORE_HEAD_OK,TYPE_MEMORY,0,0,0x0  ,0x0  ,0x0       ,0,0,0);
+	  tab_request[25].modif(47,0,0,0,25,OPERATION_MEMORY_STORE_8      ,TYPE_MEMORY,1,0,0x3  ,0x4  ,0xffffff12,0,0,0);
+	  tab_request[26].modif(49,0,0,0,26,OPERATION_MEMORY_STORE_HEAD_OK,TYPE_MEMORY,1,0,0x0  ,0x0  ,0x0       ,0,0,0);
+	  tab_request[27].modif(57,0,0,0,27,OPERATION_MEMORY_STORE_8      ,TYPE_MEMORY,2,0,0x2  ,0x4  ,0xffffff34,0,0,0);
+	  tab_request[28].modif(44,0,0,0,28,OPERATION_MEMORY_STORE_HEAD_OK,TYPE_MEMORY,2,0,0x0  ,0x0  ,0x0       ,0,0,0);
+	  tab_request[29].modif(70,0,0,0,29,OPERATION_MEMORY_LOAD_32_Z    ,TYPE_MEMORY,3,1,0x2  ,0x2  ,0x0       ,1,0,0,0x12345678);
+
+	  // CHECK - with a store not present, store format is >=
+	  tab_request[30].modif(180,0,0,0,30,OPERATION_MEMORY_STORE_32     ,TYPE_MEMORY,3,0,0x0  ,0x30 ,0x21071981,0,0,0);
+	  tab_request[31].modif(179,0,0,0,31,OPERATION_MEMORY_STORE_HEAD_OK,TYPE_MEMORY,3,0,0x0  ,0x0  ,0x0       ,0,0,0);
+	  tab_request[32].modif(173,0,0,0,32,OPERATION_MEMORY_LOAD_32_Z    ,TYPE_MEMORY,0,2,0x0  ,0x30 ,0x0       ,1,0,0,0x21071981);
+	  tab_request[33].modif(174,0,0,0,33,OPERATION_MEMORY_LOAD_16_Z    ,TYPE_MEMORY,0,3,0x0  ,0x30 ,0x0       ,1,0,0,0x00001981);
+	  tab_request[34].modif(175,0,0,0,34,OPERATION_MEMORY_LOAD_16_Z    ,TYPE_MEMORY,0,0,0x0  ,0x32 ,0x0       ,1,0,0,0x00002107);
+	  tab_request[35].modif(176,0,0,0,35,OPERATION_MEMORY_LOAD_8_S     ,TYPE_MEMORY,0,1,0x0  ,0x31 ,0x0       ,1,0,0,0x00000019);
+
+	  // CHECK - with a store not present, multiple store and format is different
+	  tab_request[36].modif(200,0,0,0,36,OPERATION_MEMORY_STORE_32     ,TYPE_MEMORY,0,0,0x0  ,0x40 ,0xffffffff,0,0,0);
+	  tab_request[37].modif(200,0,0,0,37,OPERATION_MEMORY_STORE_HEAD_OK,TYPE_MEMORY,0,0,0x0  ,0x0  ,0x0       ,0,0,0);
+	  tab_request[38].modif(220,0,0,0,38,OPERATION_MEMORY_STORE_16     ,TYPE_MEMORY,1,0,0x0  ,0x42 ,0xbaba    ,0,0,0);
+	  tab_request[39].modif(245,0,0,0,39,OPERATION_MEMORY_STORE_HEAD_OK,TYPE_MEMORY,1,0,0x0  ,0x0  ,0x0       ,0,0,0);
+	  tab_request[40].modif(224,0,0,0,40,OPERATION_MEMORY_STORE_8      ,TYPE_MEMORY,2,0,0x0  ,0x42 ,0xbe      ,0,0,0);
+	  tab_request[41].modif(240,0,0,0,41,OPERATION_MEMORY_STORE_HEAD_OK,TYPE_MEMORY,2,0,0x0  ,0x0  ,0x0       ,0,0,0);
+	  tab_request[42].modif(228,0,0,0,42,OPERATION_MEMORY_STORE_16     ,TYPE_MEMORY,3,0,0x0  ,0x40 ,0xf00d    ,0,0,0);
+	  tab_request[43].modif(235,0,0,0,43,OPERATION_MEMORY_STORE_HEAD_OK,TYPE_MEMORY,3,0,0x0  ,0x0  ,0x0       ,0,0,0);
+	  tab_request[44].modif(210,0,0,0,44,OPERATION_MEMORY_LOAD_32_Z    ,TYPE_MEMORY,0,2,0x0  ,0x40 ,0x0       ,1,0,0,0xbabef00d);
+	  tab_request[45].modif(211,0,0,0,45,OPERATION_MEMORY_LOAD_32_Z    ,TYPE_MEMORY,2,3,0x0  ,0x40 ,0x0       ,1,0,0,0xbabaffff);
+	  tab_request[46].modif(212,0,0,0,46,OPERATION_MEMORY_LOAD_32_Z    ,TYPE_MEMORY,3,0,0x0  ,0x40 ,0x0       ,1,0,0,0xbabeffff);
+	  tab_request[47].modif(213,0,0,0,47,OPERATION_MEMORY_LOAD_8_S     ,TYPE_MEMORY,3,1,0x0  ,0x42 ,0x0       ,1,0,0,0xffffffbe);
+
+
+	  // CHECK - with different ooo_engine_id
+	  tab_request[48].modif(300,0,0,0,48,OPERATION_MEMORY_STORE_32     ,TYPE_MEMORY,0,0,0x0  ,0x0  ,0xdad1900d,0,0,0);
+	  tab_request[49].modif(300,0,0,0,49,OPERATION_MEMORY_STORE_HEAD_OK,TYPE_MEMORY,0,0,0x0  ,0x0  ,0x0       ,0,0,0);
+	  tab_request[50].modif(300,0,0,1,50,OPERATION_MEMORY_STORE_32     ,TYPE_MEMORY,1,0,0x0  ,0x0  ,0x55508570,0,0,0);
+	  tab_request[51].modif(300,0,0,1,51,OPERATION_MEMORY_STORE_HEAD_OK,TYPE_MEMORY,1,0,0x0  ,0x0  ,0x0       ,0,0,0);
+
+
+	  tab_request[52].modif(320,0,0,0,52,OPERATION_MEMORY_LOAD_16_S    ,TYPE_MEMORY,2,2,0x0  ,0x2  ,0x0       ,1,0,0,0xffffdad1);
+	  tab_request[53].modif(321,0,0,1,53,OPERATION_MEMORY_LOAD_16_S    ,TYPE_MEMORY,2,3,0x0  ,0x0  ,0x0       ,1,0,0,0xffff8570);
+
+
+	  // with a little exception
+	  tab_request[54].modif(330,0,0,1,54,OPERATION_MEMORY_STORE_16     ,TYPE_MEMORY,2,0,0x0  ,0x0  ,0xffff6996,0,0,1);
+	  tab_request[55].modif(340,0,0,1,55,OPERATION_MEMORY_STORE_HEAD_KO,TYPE_MEMORY,2,0,0x0  ,0x0  ,0x0       ,0,0,0);
+	  tab_request[56].modif(322,0,0,1,56,OPERATION_MEMORY_LOAD_8_Z     ,TYPE_MEMORY,3,0,0x0  ,0x1  ,0x0       ,1,0,0,0x00000069); // they are a bypass (because, the cpu go in exception handler ... load is not use)
+	  tab_request[57].modif(350,0,0,1,57,OPERATION_MEMORY_LOAD_32_Z    ,TYPE_MEMORY,3,1,0x0  ,0x0  ,0x0       ,1,0,0,0x55508570); // the memory have not change
+
+
+	  // multiple event
+	  //   * store : miss_spec and aligment, priority : miss_spec > aligment
+	  //   * load  : miss_spec and aligment, priority : miss_spec > aligment
+	  tab_request[58].modif(410,0,0,0,58,OPERATION_MEMORY_STORE_32     ,TYPE_MEMORY,3,0,0x0  ,0x1  ,0x0       ,0,0,1);
+	  tab_request[59].modif(415,0,0,0,59,OPERATION_MEMORY_STORE_HEAD_KO,TYPE_MEMORY,3,0,0x0  ,0x0  ,0x0       ,0,0,0);
+
+	  tab_request[60].modif(430,0,0,0,60,OPERATION_MEMORY_LOAD_32_Z    ,TYPE_MEMORY,0,2,0x0  ,0x0  ,0x0       ,1,0,0,0xdad1900d);
+	  tab_request[61].modif(400,0,0,0,61,OPERATION_MEMORY_LOAD_32_Z    ,TYPE_MEMORY,0,3,0x0  ,0x3  ,0x0       ,1,0,0); // miss_spec and alignment
+	  tab_request[62].modif(450,0,0,0,62,OPERATION_MEMORY_LOAD_32_Z    ,TYPE_MEMORY,0,0,0x0  ,size_memory  ,0x0       ,1,0,0); // bus error and alignement
+	  tab_request[63].modif(460,0,0,0,63,OPERATION_MEMORY_LOAD_32_Z    ,TYPE_MEMORY,0,1,0x0  ,size_memory+1,0x0       ,1,0,0); // bus error and alignement
+
+
+	  
+	  tab_request[64].modif(500,0,0,0,64,OPERATION_MEMORY_STORE_32     ,TYPE_MEMORY,0,0,0x0  ,size_memory  ,0x0       ,0,0,0); // bus error
+	  tab_request[65].modif(505,0,0,0,65,OPERATION_MEMORY_STORE_HEAD_OK,TYPE_MEMORY,0,0,0x0  ,0x0          ,0x0       ,0,0,0);
+	  tab_request[66].modif(550,0,0,0,65,OPERATION_MEMORY_LOAD_32_Z    ,TYPE_MEMORY,1,0,0x0  ,0x0          ,0x0       ,1,0,0,0x55508570); // just to wait the dcache_rsp
+
+	  const uint32_t nb_request = 64;//_param->_nb_packet;
+        
+	  for (uint32_t i=0; i<nb_request; i++)
+	    {
+	      std::cout << tab_request [i] << std::endl;
+	      fifo_request.push(tab_request [i]);
+	    }
+	  LABEL("Simulation ...");
+    
+	  while (nb_request_memory_out < nb_request)
+	    {
+	      cout << "*********************************************" << endl;
+	      cout << "Dump STORE_QUEUE_USE : " << endl;
+	      cout << " use " << nb_store_slot_use << endl;
+	      for (uint32_t i=0; i<_param->_size_store_queue; i++)
+		cout << "  [" << i << "] " << store_queue_use [i] << endl;
+	      cout << "Dump LOAD_QUEUE_USE : " << endl;
+	      for (uint32_t i=0; i<_param->_size_load_queue ; i++)
+		cout << "  [" << i << "] " << load_queue_use [i] << endl;
+	      cout << "*********************************************" << endl;
+
+
+	      // ***** MEMORY_IN *****
+
+	      // memory_in_val depends of three factors :
+	      //  1) request's fifo is not empty ?
+	      //  2) the slot destination is free ?
+	      //  3) The head of request's fifo can be issue : the number of cycle is more than current cycle
+
+	      bool can_execute = false;
+
+	      if (not fifo_request.empty())
+		{
+		  can_execute = sc_simulation_time() >= fifo_request.top()._cycle;
+		  if (is_operation_memory_store(fifo_request.top()._operation))
+		    can_execute &= (not store_queue_use [fifo_request.top()._store_queue_ptr_write] and (nb_store_slot_use < _param->_size_store_queue-1)) or is_operation_memory_store_head(fifo_request.top()._operation);
+		  else
+		    can_execute &= not load_queue_use  [fifo_request.top()._load_queue_ptr_write];
+		}
+	      in_MEMORY_IN_VAL ->write(can_execute);
+	
+	      if (not fifo_request.empty())
+		{
+		  if (_param->_have_port_context_id)
+		    in_MEMORY_IN_CONTEXT_ID           ->write (fifo_request.top()._context_id           );
+		  if (_param->_have_port_front_end_id)
+		    in_MEMORY_IN_FRONT_END_ID         ->write (fifo_request.top()._front_end_id         );
+		  if (_param->_have_port_ooo_engine_id)
+		    in_MEMORY_IN_OOO_ENGINE_ID        ->write (fifo_request.top()._ooo_engine_id        );
+		  if (_param->_have_port_packet_id)
+		    in_MEMORY_IN_PACKET_ID            ->write (fifo_request.top()._packet_id            );
+		  in_MEMORY_IN_OPERATION            ->write (fifo_request.top()._operation            );
+		  in_MEMORY_IN_TYPE                 ->write (fifo_request.top()._type                 );
+		  in_MEMORY_IN_STORE_QUEUE_PTR_WRITE->write (fifo_request.top()._store_queue_ptr_write);
+		  in_MEMORY_IN_LOAD_QUEUE_PTR_WRITE ->write (fifo_request.top()._load_queue_ptr_write );
+		  in_MEMORY_IN_IMMEDIAT             ->write (fifo_request.top()._immediat             );
+		  in_MEMORY_IN_DATA_RA              ->write (fifo_request.top()._data_ra              );
+		  in_MEMORY_IN_DATA_RB              ->write (fifo_request.top()._data_rb              );
+// 		  in_MEMORY_IN_WRITE_RD             ->write (fifo_request.top()._write_rd             );
+		  in_MEMORY_IN_NUM_REG_RD           ->write (fifo_request.top()._num_reg_rd           );
+		}
+	      in_MEMORY_OUT_ACK->write((rand()%100)<percent_transaction_memory_out);
+
+	      // ***** DCACHE_REQ *****
+	      in_DCACHE_REQ_ACK->write((rand()%100)<percent_transaction_dcache);
+
+	      // ***** DCACHE_RSP *****
+	      bool have_rsp = _cache->have_rsp ();
+	      in_DCACHE_RSP_VAL->write(have_rsp);
+
+	      if (have_rsp)
+		{
+		  in_DCACHE_RSP_CONTEXT_ID->write(_cache->front()._context_id);
+		  in_DCACHE_RSP_PACKET_ID ->write(_cache->front()._packet_id );
+		  in_DCACHE_RSP_RDATA     ->write(_cache->front()._rdata     );
+		  in_DCACHE_RSP_ERROR     ->write(_cache->front()._error     );
+		}
+
+	      SC_START(0);
+
+	      LABEL("MEMORY_IN  : "+toString(in_MEMORY_IN_VAL ->read())+" - "+toString(out_MEMORY_IN_ACK ->read()));
+	      if ( in_MEMORY_IN_VAL ->read() and out_MEMORY_IN_ACK ->read())
+		{
+		  Tpacket_t  packet_id = in_MEMORY_IN_PACKET_ID->read();
+
+		  LABEL(" * Accepted MEMORY_IN  : " + toString(packet_id));
+		  cout << fifo_request.top();
+
+		  if (is_operation_memory_store(fifo_request.top()._operation))
+		    {
+		      if (not is_operation_memory_store_head(fifo_request.top()._operation))
+			{
+			  store_queue_use [fifo_request.top()._store_queue_ptr_write] = true;
+			  nb_store_slot_use ++;
+			}
+		    }
+		  else
+		    load_queue_use [fifo_request.top()._load_queue_ptr_write] = true;
+
+		  fifo_request.pop();
+		}
+
+	      LABEL("MEMORY_OUT : "+toString(out_MEMORY_OUT_VAL->read())+" - "+toString(in_MEMORY_OUT_ACK ->read()));
+	      if (out_MEMORY_OUT_VAL->read() and  in_MEMORY_OUT_ACK->read())
+		{
+		  Tpacket_t  packet_id = out_MEMORY_OUT_PACKET_ID->read();
+
+		  LABEL(" * Accepted MEMORY_OUT : " + toString(packet_id));
+
+		  if (is_operation_memory_store(tab_request[packet_id]._operation))
+		    {
+		      store_queue_use [tab_request[packet_id]._store_queue_ptr_write] = false;
+		      nb_store_slot_use --;
+		      nb_request_memory_out +=2;
+
+		    }
+		  else
+		    {
+		      if (not (out_MEMORY_OUT_EXCEPTION->read() == EXCEPTION_MEMORY_LOAD_SPECULATIVE))
+			{
+			  nb_request_memory_out ++;
+
+			  load_queue_use  [tab_request[packet_id]._load_queue_ptr_write] = false;
+			}
+		      else
+			{
+			  std::cout << "seth - have a load_speculative." << std::endl;
+			  tab_request[packet_id]._write_spec_ko = (out_MEMORY_OUT_DATA_RD->read() != tab_request[packet_id]._data_wait);
+			  tab_request[packet_id]._previous_load_speculative = 1;
+			}
+		    }
+		  
+		  std::cout << "kane - nb_request_memory_out : " << nb_request_memory_out << std::endl;
+
+		  // a lot of test
+		  TEST(Tpacket_t         , out_MEMORY_OUT_PACKET_ID    ->read(), tab_request[packet_id]._packet_id    );
+		  TEST(Tcontext_t        , out_MEMORY_OUT_CONTEXT_ID   ->read(), tab_request[packet_id]._context_id   );
+		  TEST(Tcontext_t        , out_MEMORY_OUT_FRONT_END_ID ->read(), tab_request[packet_id]._front_end_id );
+		  TEST(Tcontext_t        , out_MEMORY_OUT_OOO_ENGINE_ID->read(), tab_request[packet_id]._ooo_engine_id);
+
+		  if (is_operation_memory_load (tab_request[packet_id]._operation))
+		    {
+		      TEST(Tgeneral_address_t, out_MEMORY_OUT_NUM_REG_RD   ->read(), tab_request[packet_id]._num_reg_rd   );
+		    }
+
+		  Tgeneral_data_t address         = tab_request[packet_id]._data_ra + tab_request[packet_id]._immediat;
+
+		  bool            error_alignment = (address != (address & (~ mask_memory_access(tab_request[packet_id]._operation))));
+		  bool            berr            = (address >= size_memory);
+		  Texception_t    exception       = out_MEMORY_OUT_EXCEPTION->read();
+
+		  if (is_operation_memory_store(tab_request[packet_id]._operation))
+		    {
+		      TEST(Tcontrol_t        , out_MEMORY_OUT_WRITE_RD     ->read(), 0);
+
+		      // store.
+		      // prioritary : miss_speculation > aligmnent > DBERR
+		      
+			  bool test_result_ko = false;
+			  
+			  if (tab_request[packet_id]._write_spec_ko)
+			    {
+			      TEST(Texception_t, exception, EXCEPTION_MEMORY_MISS_SPECULATION);
+			    }
+			  else
+			    if (error_alignment)
+			      {
+				TEST(Texception_t, exception, EXCEPTION_MEMORY_ALIGNMENT);
+				test_result_ko = true;
+			      }
+			    else
+			      if (berr)
+				{
+				  // TODO NOT SUPPORTED
+// 				  TEST(Texception_t, exception, EXCEPTION_MEMORY_BUS_ERROR);
+
+				  //test_result_ko = true;
+				}
+			      else
+				{
+				  TEST(Texception_t, exception, EXCEPTION_MEMORY_NONE);
+				}
+			  // In all case : test data
+			  if (test_result_ko)
+			    {
+			      TEST(Tgeneral_data_t   , out_MEMORY_OUT_DATA_RD->read(), address);
+			    }
+		    }
+		  else
+		    {
+		      // load
+		      // prioritary : miss_speculation > aligmnent > DBERR
+		      
+		      bool is_load = is_operation_memory_load(tab_request[packet_id]._operation);
+
+		      if (not (out_MEMORY_OUT_EXCEPTION->read() == EXCEPTION_MEMORY_LOAD_SPECULATIVE))
+			{
+			  bool test_result_ko = false;
+			  
+			  if (tab_request[packet_id]._write_spec_ko)
+			    {
+			      // IS A LOAD :D
+			      TEST(Texception_t, exception, EXCEPTION_MEMORY_MISS_SPECULATION);
+			      TEST(Tcontrol_t, out_MEMORY_OUT_WRITE_RD->read(), 1);
+			    }
+			  else
+			    if (error_alignment)
+			      {
+				TEST(Texception_t, exception, EXCEPTION_MEMORY_ALIGNMENT);
+				TEST(Tcontrol_t, out_MEMORY_OUT_WRITE_RD->read(), is_load);
+				test_result_ko = true;
+			      }
+			    else
+			      if (berr)
+				{
+				  TEST(Texception_t, exception, EXCEPTION_MEMORY_BUS_ERROR);
+				  TEST(Tcontrol_t  , out_MEMORY_OUT_WRITE_RD->read(), is_load);
+				  test_result_ko = true;
+				}
+			      else
+				{
+				  TEST(Texception_t, exception, EXCEPTION_MEMORY_NONE);
+				  TEST(Tcontrol_t  , out_MEMORY_OUT_WRITE_RD->read(), is_load and not tab_request[packet_id]._previous_load_speculative);
+				}
+			  // In all case : test data
+			  if (test_result_ko)
+			    {
+			      TEST(Tgeneral_data_t   , out_MEMORY_OUT_DATA_RD->read(), address);
+			    }
+			  else
+			    {
+			      TEST(Tgeneral_data_t   , out_MEMORY_OUT_DATA_RD->read(), tab_request[packet_id]._data_wait);
+			    }
+			}
+		      else
+			{
+			  TEST(Tcontrol_t        , out_MEMORY_OUT_WRITE_RD     ->read(), 1);
+			}
+		    }
+		}
+
+	      LABEL("DCACHE_REQ : "+toString(out_DCACHE_REQ_VAL->read())+" - "+toString(in_DCACHE_REQ_ACK ->read()));
+	      if (out_DCACHE_REQ_VAL->read() and  in_DCACHE_REQ_ACK->read())
+		{
+		  Tcontext_t        context_id;
+		  Tpacket_t         packet_id ; 
+		  Tdcache_address_t address = out_DCACHE_REQ_ADDRESS->read();
+		  Tdcache_data_t    rdata;
+		  Tdcache_error_t   error = 0;
+		  if (_param->_have_port_dcache_context_id)
+		    context_id = out_DCACHE_REQ_CONTEXT_ID->read();
+		  else
+		    context_id = 0;
+
+		  packet_id  = (out_DCACHE_REQ_PACKET_ID ->read())>>1;
+	      
+		  LABEL(" * Accepted DCACHE_REQ : " + toString(packet_id));
+
+		  if (address >= size_memory)
+		    {
+		      // Bus error
+		      error = 1;
+		      rdata = address; // convention : cache return the address fautive !
+		    }
+		  else
+		    {
+		      rdata = _memory->access (context_id, address, out_DCACHE_REQ_TYPE->read(), out_DCACHE_REQ_WDATA->read());
+		      LABEL("   * rdata : " + toString(rdata));
+		    }
+
+		  // test type : send or not a respons !
+		  if ((out_DCACHE_REQ_TYPE->read() == DCACHE_SYNCHRONIZATION) or
+		      (out_DCACHE_REQ_TYPE->read() == DCACHE_LOAD) or
+		      ((error == 1) and ((out_DCACHE_REQ_TYPE->read() == DCACHE_STORE_8 ) or
+					 (out_DCACHE_REQ_TYPE->read() == DCACHE_STORE_16) or
+					 (out_DCACHE_REQ_TYPE->read() == DCACHE_STORE_32) or
+					 (out_DCACHE_REQ_TYPE->read() == DCACHE_STORE_64) )))
+		    {
+		      LABEL("     * have_dcache_rsp");
+		  
+		      _cache->push (context_id,
+				    out_DCACHE_REQ_PACKET_ID ->read(),
+				    rdata,
+				    error);
+		    }
+		}
+
+	      LABEL("DCACHE_RSP : "+toString(in_DCACHE_RSP_VAL->read())+" - "+toString(out_DCACHE_RSP_ACK ->read()));
+	      if (in_DCACHE_RSP_VAL->read() and out_DCACHE_RSP_ACK->read())
+		{
+		  _cache->pop();
+		}
+
+	      _cache->end_cycle();
+
+	      SC_START(1);
+	    }
+    }
+  catch (morpheo::ErrorMorpheo & error)
+    {
+      _memory->trace();
+      throw (error);
+    }
+
+  _memory->trace();
+
+  
+  /********************************************************
+   * Simulation - End
+   ********************************************************/
+
+  TEST_OK ("End of Simulation");
+  delete _time;
+  cout << "<" << name << "> ............ Stop Simulation" << endl;
+
+  delete     in_CLOCK;
+  delete     in_NRESET;
+
+  delete     in_MEMORY_IN_VAL         ;
+  delete    out_MEMORY_IN_ACK         ;
+  delete     in_MEMORY_IN_CONTEXT_ID  ;
+  delete     in_MEMORY_IN_FRONT_END_ID  ;
+  delete     in_MEMORY_IN_OOO_ENGINE_ID  ;
+  delete     in_MEMORY_IN_PACKET_ID   ;
+  delete     in_MEMORY_IN_OPERATION   ;
+  delete     in_MEMORY_IN_STORE_QUEUE_PTR_WRITE;
+  delete     in_MEMORY_IN_LOAD_QUEUE_PTR_WRITE ;
+  //delete     in_MEMORY_IN_HAS_IMMEDIAT;
+  delete     in_MEMORY_IN_IMMEDIAT    ;
+  delete     in_MEMORY_IN_DATA_RA     ;
+  delete     in_MEMORY_IN_DATA_RB     ;
+  //delete     in_MEMORY_IN_DATA_RC     ;
+//   delete     in_MEMORY_IN_WRITE_RD    ;
+  delete     in_MEMORY_IN_NUM_REG_RD  ;
+  //delete     in_MEMORY_IN_WRITE_RE    ;
+  //delete     in_MEMORY_IN_NUM_REG_RE  ;
+    
+  delete    out_MEMORY_OUT_VAL       ;
+  delete     in_MEMORY_OUT_ACK       ;
+  delete    out_MEMORY_OUT_CONTEXT_ID;
+  delete    out_MEMORY_OUT_FRONT_END_ID;
+  delete    out_MEMORY_OUT_OOO_ENGINE_ID;
+  delete    out_MEMORY_OUT_PACKET_ID ;
+  delete    out_MEMORY_OUT_WRITE_RD  ;
+  delete    out_MEMORY_OUT_NUM_REG_RD;
+  delete    out_MEMORY_OUT_DATA_RD   ;
+  //delete    out_MEMORY_OUT_WRITE_RE  ;
+  //delete    out_MEMORY_OUT_NUM_REG_RE;
+  //delete    out_MEMORY_OUT_DATA_RE   ;
+  delete    out_MEMORY_OUT_EXCEPTION ;
+  
+  delete    out_DCACHE_REQ_VAL       ;
+  delete     in_DCACHE_REQ_ACK       ;
+  delete    out_DCACHE_REQ_CONTEXT_ID;
+  delete    out_DCACHE_REQ_PACKET_ID ;
+  delete    out_DCACHE_REQ_ADDRESS   ;
+  delete    out_DCACHE_REQ_TYPE      ;
+  delete    out_DCACHE_REQ_WDATA     ;
+  
+  delete     in_DCACHE_RSP_VAL       ;
+  delete    out_DCACHE_RSP_ACK       ;
+  delete     in_DCACHE_RSP_CONTEXT_ID;
+  delete     in_DCACHE_RSP_PACKET_ID ;
+  delete     in_DCACHE_RSP_RDATA     ;
+  delete     in_DCACHE_RSP_ERROR     ;
+  
+  if (_param->_speculative_load == SPECULATIVE_LOAD_BYPASS)
+    {
+      delete [] out_BYPASS_MEMORY_VAL       ;
+      delete [] out_BYPASS_MEMORY_OOO_ENGINE_ID;
+      delete [] out_BYPASS_MEMORY_NUM_REG   ;
+      delete [] out_BYPASS_MEMORY_DATA      ;
+    }
+#endif
+
+  delete _Load_store_unit;
+  delete _memory;
+  delete _cache;
+#ifdef STATISTICS
+  delete _parameters_statistics;
+#endif
+  delete _param;
+}
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 70)
+++ 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 70)
+++ 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 70)
+++ 	(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 70)
+++ 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;
+    }
+
   };
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Load_store_unit.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Load_store_unit.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Load_store_unit.cpp	(revision 71)
@@ -31,7 +31,4 @@
 			      _name              (name)
 			      ,_param            (param)
-// #ifdef STATISTICS
-// 			      ,_param_statistics (param_statistics)
-// #endif
   {
     log_printf(FUNC,Load_store_unit,FUNCTION,"Begin");
@@ -46,8 +43,5 @@
     log_printf(INFO,Load_store_unit,FUNCTION,"Allocation of statistics");
 
-    // Allocation of statistics
-    _stat = new Statistics (static_cast<string>(_name),
-			    param_statistics          ,
-			    param);
+    statistics_declaration(param_statistics);
 #endif
 
@@ -81,4 +75,9 @@
 	}
       }
+
+    log_printf(INFO,Load_store_unit,FUNCTION,"Constant affectation");
+
+    internal_DCACHE_RSP_ACK = 1;
+    PORT_WRITE(out_DCACHE_RSP_ACK, 1);
 
     log_printf(INFO,Load_store_unit,FUNCTION,"Method - transition");
@@ -147,6 +146,4 @@
     log_printf(INFO,Load_store_unit,FUNCTION,"Generate Statistics file");
 
-    _stat->generate_file(statistics(0));
-    
     delete _stat;
 #endif
Index: 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
===================================================================
--- 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	(revision 70)
+++ 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	(revision 71)
@@ -64,8 +64,15 @@
    in_MEMORY_IN_VAL                   = interface->set_signal_valack_in        (VAL);
   out_MEMORY_IN_ACK                   = interface->set_signal_valack_out       (ACK);
-   in_MEMORY_IN_CONTEXT_ID            = interface->set_signal_in  <Tcontext_t        > ("context_id"  ,_param->_size_context_id       );
-   in_MEMORY_IN_PACKET_ID             = interface->set_signal_in  <Tpacket_t         > ("packet_id"   ,_param->_size_packet_id       );
+
+  if (_param->_have_port_context_id)
+   in_MEMORY_IN_CONTEXT_ID            = interface->set_signal_in  <Tcontext_t        > ("context_id"   ,_param->_size_context_id       );
+  if (_param->_have_port_front_end_id)
+   in_MEMORY_IN_FRONT_END_ID          = interface->set_signal_in  <Tcontext_t        > ("front_end_id" ,_param->_size_front_end_id     );
+  if (_param->_have_port_ooo_engine_id)
+   in_MEMORY_IN_OOO_ENGINE_ID         = interface->set_signal_in  <Tcontext_t        > ("ooo_engine_id",_param->_size_ooo_engine_id    );
+  if (_param->_have_port_packet_id)
+   in_MEMORY_IN_PACKET_ID             = interface->set_signal_in  <Tpacket_t         > ("packet_id"    ,_param->_size_packet_id       );
    in_MEMORY_IN_OPERATION             = interface->set_signal_in  <Toperation_t      > ("operation"   ,_param->_size_operation        );
-   in_MEMORY_IN_STORE_QUEUE_PTR_WRITE = interface->set_signal_in  <Tlsq_ptr_t        > ("store_queue_ptr_write" ,_param->_size_address_store_queue);
+   in_MEMORY_IN_STORE_QUEUE_PTR_WRITE = interface->set_signal_in  <Tlsq_ptr_t        > ("store_queue_ptr_write" ,_param->_size_address_store_queue+1); // +1 cf load_queue usage
    in_MEMORY_IN_LOAD_QUEUE_PTR_WRITE  = interface->set_signal_in  <Tlsq_ptr_t        > ("load_queue_ptr_write"  ,_param->_size_address_load_queue );
 // in_MEMORY_IN_HAS_IMMEDIAT          = interface->set_signal_in  <Tcontrol_t        > ("has_immediat",1                              );
@@ -74,5 +81,5 @@
    in_MEMORY_IN_DATA_RB               = interface->set_signal_in  <Tgeneral_data_t   > ("data_rb"     ,_param->_size_general_data     );
 // in_MEMORY_IN_DATA_RC               = interface->set_signal_in  <Tspecial_data_t   > ("data_rc"     ,_param->_size_special_data     );
-   in_MEMORY_IN_WRITE_RD              = interface->set_signal_in  <Tcontrol_t        > ("write_rd"    ,1                              );
+//    in_MEMORY_IN_WRITE_RD              = interface->set_signal_in  <Tcontrol_t        > ("write_rd"    ,1                              );
    in_MEMORY_IN_NUM_REG_RD            = interface->set_signal_in  <Tgeneral_address_t> ("num_reg_rd"  ,1                              );
 // in_MEMORY_IN_WRITE_RE              = interface->set_signal_in  <Tcontrol_t        > ("write_re"    ,1                              );
@@ -90,15 +97,21 @@
 							      );
 
-      out_MEMORY_OUT_VAL         = interface->set_signal_valack_out(VAL);
-       in_MEMORY_OUT_ACK         = interface->set_signal_valack_in (ACK);
-      out_MEMORY_OUT_CONTEXT_ID  = interface->set_signal_out <Tcontext_t        > ("context_id"  ,_param->_size_context_id       );
-      out_MEMORY_OUT_PACKET_ID   = interface->set_signal_out <Tpacket_t         > ("packet_id"   ,_param->_size_packet_id        );
-      out_MEMORY_OUT_WRITE_RD    = interface->set_signal_out <Tcontrol_t        > ("write_rd"    ,1                              );
-      out_MEMORY_OUT_NUM_REG_RD  = interface->set_signal_out <Tgeneral_address_t> ("num_reg_rd"  ,_param->_size_general_register );
-      out_MEMORY_OUT_DATA_RD     = interface->set_signal_out <Tgeneral_data_t   > ("data_rd"     ,_param->_size_general_data     );
-//    out_MEMORY_OUT_WRITE_RE    = interface->set_signal_out <Tcontrol_t        > ("write_rd"    ,1                              );
-//    out_MEMORY_OUT_NUM_REG_RE  = interface->set_signal_out <Tspecial_address_t> ("num_reg_re"  ,_param->_size_general_register );
-//    out_MEMORY_OUT_DATA_RE     = interface->set_signal_out <Tspecial_data_t   > ("data_re"     ,_param->_size_general_data     );
-      out_MEMORY_OUT_EXCEPTION   = interface->set_signal_out <Texception_t      > ("exception"   ,_param->_size_exception        );
+      out_MEMORY_OUT_VAL           = interface->set_signal_valack_out(VAL);
+       in_MEMORY_OUT_ACK           = interface->set_signal_valack_in (ACK);
+      if (_param->_have_port_context_id)       
+      out_MEMORY_OUT_CONTEXT_ID    = interface->set_signal_out <Tcontext_t        > ("context_id"    ,_param->_size_context_id       );
+      if (_param->_have_port_front_end_id)     
+      out_MEMORY_OUT_FRONT_END_ID  = interface->set_signal_out <Tcontext_t        > ("front_end_id"  ,_param->_size_front_end_id     );
+      if (_param->_have_port_ooo_engine_id)    
+      out_MEMORY_OUT_OOO_ENGINE_ID = interface->set_signal_out <Tcontext_t        > ("ooo_engine_id" ,_param->_size_ooo_engine_id    );
+      if (_param->_have_port_packet_id)       
+      out_MEMORY_OUT_PACKET_ID     = interface->set_signal_out <Tpacket_t         > ("packet_id"     ,_param->_size_packet_id        );
+      out_MEMORY_OUT_WRITE_RD      = interface->set_signal_out <Tcontrol_t        > ("write_rd"      ,1                              );
+      out_MEMORY_OUT_NUM_REG_RD    = interface->set_signal_out <Tgeneral_address_t> ("num_reg_rd"    ,_param->_size_general_register );
+      out_MEMORY_OUT_DATA_RD       = interface->set_signal_out <Tgeneral_data_t   > ("data_rd"       ,_param->_size_general_data     );
+//    out_MEMORY_OUT_WRITE_RE      = interface->set_signal_out <Tcontrol_t        > ("write_rd"      ,1                              );
+//    out_MEMORY_OUT_NUM_REG_RE    = interface->set_signal_out <Tspecial_address_t> ("num_reg_re"    ,_param->_size_general_register );
+//    out_MEMORY_OUT_DATA_RE       = interface->set_signal_out <Tspecial_data_t   > ("data_re"       ,_param->_size_general_data     );
+      out_MEMORY_OUT_EXCEPTION     = interface->set_signal_out <Texception_t      > ("exception"     ,_param->_size_exception        );
 
     }
@@ -116,9 +129,9 @@
       out_DCACHE_REQ_VAL        = interface->set_signal_valack_out(VAL);
        in_DCACHE_REQ_ACK        = interface->set_signal_valack_in (ACK);
-      out_DCACHE_REQ_CONTEXT_ID = interface->set_signal_out <Tcontext_t        > ("context_id",_param->_size_context_id  );
-      out_DCACHE_REQ_PACKET_ID  = interface->set_signal_out <Tpacket_t         > ("packet_id" ,_param->_size_packet_id   );
+       if (_param->_have_port_dcache_context_id)
+      out_DCACHE_REQ_CONTEXT_ID = interface->set_signal_out <Tcontext_t        > ("context_id",_param->_size_dcache_context_id  );
+      out_DCACHE_REQ_PACKET_ID  = interface->set_signal_out <Tpacket_t         > ("packet_id" ,_param->_size_dcache_packet_id   );
       out_DCACHE_REQ_ADDRESS    = interface->set_signal_out <Tdcache_address_t > ("address"   ,_param->_size_dcache_address);
       out_DCACHE_REQ_TYPE       = interface->set_signal_out <Tdcache_type_t    > ("type"      ,_param->_size_dcache_type );
-      out_DCACHE_REQ_UNCACHED   = interface->set_signal_out <Tcontrol_t        > ("uncached"  ,1);
       out_DCACHE_REQ_WDATA      = interface->set_signal_out <Tdcache_data_t    > ("wdata"     ,_param->_size_general_data);
     }
@@ -135,6 +148,7 @@
        in_DCACHE_RSP_VAL        = interface->set_signal_valack_in (VAL);
       out_DCACHE_RSP_ACK        = interface->set_signal_valack_out(ACK);
-       in_DCACHE_RSP_CONTEXT_ID = interface->set_signal_in  <Tcontext_t     > ("context_id",_param->_size_context_id  );
-       in_DCACHE_RSP_PACKET_ID  = interface->set_signal_in  <Tpacket_t      > ("packet_id" ,_param->_size_packet_id   );
+       if (_param->_have_port_dcache_context_id)
+       in_DCACHE_RSP_CONTEXT_ID = interface->set_signal_in  <Tcontext_t     > ("context_id",_param->_size_dcache_context_id  );
+       in_DCACHE_RSP_PACKET_ID  = interface->set_signal_in  <Tpacket_t      > ("packet_id" ,_param->_size_dcache_packet_id   );
        in_DCACHE_RSP_RDATA      = interface->set_signal_in  <Tdcache_data_t > ("rdata"     ,_param->_size_general_data);
        in_DCACHE_RSP_ERROR      = interface->set_signal_in  <Tdcache_error_t> ("error"     ,_param->_size_dcache_error);
@@ -144,8 +158,9 @@
     if (_param->_speculative_load == SPECULATIVE_LOAD_BYPASS)
       {
-	out_BYPASS_MEMORY_VAL        = new SC_OUT(Tcontrol_t        ) * [_param->_size_load_queue];
-	out_BYPASS_MEMORY_CONTEXT_ID = new SC_OUT(Tcontext_t        ) * [_param->_size_load_queue];
-	out_BYPASS_MEMORY_NUM_REG    = new SC_OUT(Tgeneral_address_t) * [_param->_size_load_queue];
-	out_BYPASS_MEMORY_DATA       = new SC_OUT(Tgeneral_data_t   ) * [_param->_size_load_queue];
+	out_BYPASS_MEMORY_VAL          = new SC_OUT(Tcontrol_t        ) * [_param->_size_load_queue];
+	if (_param->_have_port_ooo_engine_id)    
+	out_BYPASS_MEMORY_OOO_ENGINE_ID= new SC_OUT(Tcontext_t        ) * [_param->_size_load_queue];
+	out_BYPASS_MEMORY_NUM_REG      = new SC_OUT(Tgeneral_address_t) * [_param->_size_load_queue];
+	out_BYPASS_MEMORY_DATA         = new SC_OUT(Tgeneral_data_t   ) * [_param->_size_load_queue];
 	
 	for (uint32_t i=0; i<_param->_size_load_queue; i++)
@@ -159,8 +174,9 @@
 								    );
 	    
-	    out_BYPASS_MEMORY_VAL        [i] = interface->set_signal_valack_out(VAL);
-	    out_BYPASS_MEMORY_CONTEXT_ID [i] = interface->set_signal_out <Tcontext_t        > ("context_id", _param->_size_context_id);
-	    out_BYPASS_MEMORY_NUM_REG    [i] = interface->set_signal_out <Tgeneral_address_t> ("num_reg"   , _param->_size_general_register);
-	    out_BYPASS_MEMORY_DATA       [i] = interface->set_signal_out <Tgeneral_data_t   > ("data"      , _param->_size_general_data);
+	    out_BYPASS_MEMORY_VAL           [i] = interface->set_signal_valack_out(VAL);
+	    if (_param->_have_port_ooo_engine_id)
+	    out_BYPASS_MEMORY_OOO_ENGINE_ID [i] = interface->set_signal_out <Tcontext_t        > ("ooo_engine_id", _param->_size_ooo_engine_id);
+	    out_BYPASS_MEMORY_NUM_REG       [i] = interface->set_signal_out <Tgeneral_address_t> ("num_reg"      , _param->_size_general_register);
+	    out_BYPASS_MEMORY_DATA          [i] = interface->set_signal_out <Tgeneral_data_t   > ("data"         , _param->_size_general_data);
 	  }
       }
Index: 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
===================================================================
--- 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	(revision 70)
+++ 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	(revision 71)
@@ -35,5 +35,11 @@
     delete     in_MEMORY_IN_VAL         ;
     delete    out_MEMORY_IN_ACK         ;
+    if (_param->_have_port_context_id)
     delete     in_MEMORY_IN_CONTEXT_ID  ;
+    if (_param->_have_port_front_end_id)
+    delete     in_MEMORY_IN_FRONT_END_ID  ;
+    if (_param->_have_port_ooo_engine_id)
+    delete     in_MEMORY_IN_OOO_ENGINE_ID  ;
+    if (_param->_have_port_packet_id)
     delete     in_MEMORY_IN_PACKET_ID   ;
     delete     in_MEMORY_IN_OPERATION   ;
@@ -45,5 +51,5 @@
     delete     in_MEMORY_IN_DATA_RB     ;
 //  delete     in_MEMORY_IN_DATA_RC     ;
-    delete     in_MEMORY_IN_WRITE_RD    ;
+//  delete     in_MEMORY_IN_WRITE_RD    ;
     delete     in_MEMORY_IN_NUM_REG_RD  ;
 //  delete     in_MEMORY_IN_WRITE_RE    ;
@@ -52,5 +58,11 @@
     delete    out_MEMORY_OUT_VAL       ;
     delete     in_MEMORY_OUT_ACK       ;
+    if (_param->_have_port_context_id)
     delete    out_MEMORY_OUT_CONTEXT_ID;
+    if (_param->_have_port_front_end_id)
+    delete    out_MEMORY_OUT_FRONT_END_ID;
+    if (_param->_have_port_ooo_engine_id)
+      delete    out_MEMORY_OUT_OOO_ENGINE_ID;
+    if (_param->_have_port_packet_id)
     delete    out_MEMORY_OUT_PACKET_ID ;
     delete    out_MEMORY_OUT_WRITE_RD  ;
@@ -64,13 +76,14 @@
     delete    out_DCACHE_REQ_VAL       ;
     delete     in_DCACHE_REQ_ACK       ;
+    if (_param->_have_port_dcache_context_id)
     delete    out_DCACHE_REQ_CONTEXT_ID;
     delete    out_DCACHE_REQ_PACKET_ID ;
     delete    out_DCACHE_REQ_ADDRESS   ;
     delete    out_DCACHE_REQ_TYPE      ;
-    delete    out_DCACHE_REQ_UNCACHED  ;
     delete    out_DCACHE_REQ_WDATA     ;
     
     delete     in_DCACHE_RSP_VAL       ;
     delete    out_DCACHE_RSP_ACK       ;
+    if (_param->_have_port_dcache_context_id)
     delete     in_DCACHE_RSP_CONTEXT_ID;
     delete     in_DCACHE_RSP_PACKET_ID ;
@@ -81,5 +94,6 @@
       {
 	delete [] out_BYPASS_MEMORY_VAL       ;
-	delete [] out_BYPASS_MEMORY_CONTEXT_ID;
+	if (_param->_have_port_ooo_engine_id)    
+	delete [] out_BYPASS_MEMORY_OOO_ENGINE_ID;
 	delete [] out_BYPASS_MEMORY_NUM_REG   ;
 	delete [] out_BYPASS_MEMORY_DATA      ;
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Load_store_unit_end_cycle.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Load_store_unit_end_cycle.cpp	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Load_store_unit_end_cycle.cpp	(revision 71)
@@ -0,0 +1,49 @@
+#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Load_store_unit.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace core {
+namespace multi_execute_loop {
+namespace execute_loop {
+namespace multi_execute_unit {
+namespace execute_unit {
+namespace load_store_unit {
+
+
+#undef  FUNCTION
+#define FUNCTION "Load_store_unit::end_cycle"
+  void Load_store_unit::end_cycle ()
+  {
+    log_printf(FUNC,Load_store_unit,FUNCTION,"Begin");
+
+#ifdef STATISTICS
+    _stat->end_cycle();
+#endif    
+
+#ifdef VHDL_TESTBENCH
+    // Evaluation before read the ouput signal
+//  sc_start(0);
+    _interfaces->testbench();
+#endif
+
+    log_printf(FUNC,Load_store_unit,FUNCTION,"End");
+  };
+
+}; // 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
Index: 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_genMealy_insert.cpp
===================================================================
--- 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_genMealy_insert.cpp	(revision 70)
+++ 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_genMealy_insert.cpp	(revision 71)
@@ -26,13 +26,8 @@
     log_printf(FUNC,Load_store_unit,FUNCTION,"Begin");
 
-    // ~~~~~[ Output "memory_in" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-    if (is_operation_memory_store(PORT_READ(in_MEMORY_IN_OPERATION)) == true)
-      {
-	internal_MEMORY_IN_ACK = 1;
-      }
-    else
-      {
-	internal_MEMORY_IN_ACK = not _speculative_access_queue_control->full();
-      }
+    // ~~~~~[ Output "memory_in" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+    // store queue is never full (pointer is manage by rename stage)
+    internal_MEMORY_IN_ACK = is_operation_memory_store(PORT_READ(in_MEMORY_IN_OPERATION)) or not _speculative_access_queue_control->full();
 
     PORT_WRITE(out_MEMORY_IN_ACK, internal_MEMORY_IN_ACK);
Index: 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
===================================================================
--- 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	(revision 70)
+++ 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	(revision 71)
@@ -28,45 +28,103 @@
     // ~~~~~[ Interface "memory_out" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-    Tcontext_t         memory_out_context_id = 0;
-    Tpacket_t          memory_out_packet_id  = 0;
-    Tcontrol_t         memory_out_write_rd   = 0;
-    Tgeneral_address_t memory_out_num_reg_rd = 0;
-    Tgeneral_data_t    memory_out_data_rd    = 0;
-//  Tcontrol_t         memory_out_write_re   = 0;
-//  Tspecial_address_t memory_out_num_reg_re = 0;
-//  Tspecial_data_t    memory_out_data_re    = 0;
-    Texception_t       memory_out_exception  = 0;
-
-    internal_MEMORY_OUT_VAL          = 0;
+    Tcontext_t         memory_out_context_id    = 0;
+    Tcontext_t         memory_out_front_end_id  = 0;
+    Tcontext_t         memory_out_ooo_engine_id = 0;
+    Tpacket_t          memory_out_packet_id     = 0;
+    Tcontrol_t         memory_out_write_rd      = 0;
+    Tgeneral_address_t memory_out_num_reg_rd    = 0;
+    Tgeneral_data_t    memory_out_data_rd       = 0;
+//  Tcontrol_t         memory_out_write_re      = 0;
+//  Tspecial_address_t memory_out_num_reg_re    = 0;
+//  Tspecial_data_t    memory_out_data_re       = 0;
+    Texception_t       memory_out_exception     = 0;
+
+    internal_MEMORY_OUT_VAL = 0;
 
     // Test store and load queue
-    // TODO : il faut d'abord tester si un elment de l'access queue n'est pas commitable !!!!!!!
-
-    // Test an store must be commited.
-    if (_store_queue [internal_MEMORY_STORE_QUEUE_PTR_READ]._state == STORE_QUEUE_COMMIT)
-      {
-	internal_MEMORY_OUT_VAL          = 1;
-	internal_MEMORY_OUT_SELECT_QUEUE = SELECT_STORE_QUEUE;
+
+    log_printf(TRACE,Load_store_unit,FUNCTION,"genMoore : Test MEMORY_OUT");
+
+    log_printf(TRACE,Load_store_unit,FUNCTION,"  * Load  queue");
+    for (internal_MEMORY_OUT_PTR=0; internal_MEMORY_OUT_PTR<_param->_size_load_queue; internal_MEMORY_OUT_PTR++)
+//     for (uin32_t i=0; (i<_param->_size_load_queue) and not (find_load); i++)
+      {
+// 	internal_MEMORY_OUT_PTR = (reg_LOAD_QUEUE_PTR_READ+1)%_param->_size_load_queue;
+	internal_MEMORY_OUT_VAL = ((_load_queue[internal_MEMORY_OUT_PTR]._state == LOAD_QUEUE_COMMIT_CHECK) or
+				   (_load_queue[internal_MEMORY_OUT_PTR]._state == LOAD_QUEUE_COMMIT));
 	
-	memory_out_context_id= _store_queue [internal_MEMORY_STORE_QUEUE_PTR_READ]._context_id;
-	memory_out_packet_id = _store_queue [internal_MEMORY_STORE_QUEUE_PTR_READ]._packet_id ;
-//	memory_out_write_rd  
-//	memory_out_num_reg_rd
-//	memory_out_data_rd   
-	memory_out_exception = _store_queue [internal_MEMORY_STORE_QUEUE_PTR_READ]._exception;
-      }
-
+	if (internal_MEMORY_OUT_VAL)
+	  {
+	    log_printf(TRACE,Load_store_unit,FUNCTION,"    * find : %d",internal_MEMORY_OUT_PTR);
+	    internal_MEMORY_OUT_SELECT_QUEUE = (_load_queue[internal_MEMORY_OUT_PTR]._state == LOAD_QUEUE_COMMIT_CHECK)?SELECT_LOAD_QUEUE_SPECULATIVE:SELECT_LOAD_QUEUE;
+	    
+	    memory_out_context_id    = _load_queue [internal_MEMORY_OUT_PTR]._context_id;
+	    memory_out_front_end_id  = _load_queue [internal_MEMORY_OUT_PTR]._front_end_id;
+	    memory_out_ooo_engine_id = _load_queue [internal_MEMORY_OUT_PTR]._ooo_engine_id;
+	    memory_out_packet_id     = _load_queue [internal_MEMORY_OUT_PTR]._packet_id ;
+	    memory_out_write_rd      = _load_queue [internal_MEMORY_OUT_PTR]._write_rd  ;
+	    memory_out_num_reg_rd    = _load_queue [internal_MEMORY_OUT_PTR]._num_reg_rd;
+
+	    Tdcache_data_t data_old = _load_queue [internal_MEMORY_OUT_PTR]._rdata;
+	    Tdcache_data_t data_new = extend<Tdcache_data_t>(_param->_size_general_data,
+							     data_old >> _load_queue [internal_MEMORY_OUT_PTR]._shift,
+							     _load_queue [internal_MEMORY_OUT_PTR]._is_load_signed,
+							     _load_queue [internal_MEMORY_OUT_PTR]._access_size);
+	    log_printf(TRACE,Load_store_unit,FUNCTION,"    * data : %.8x",data_new);
+	    log_printf(TRACE,Load_store_unit,FUNCTION,"      * rdata        : %.8x",_load_queue [internal_MEMORY_OUT_PTR]._rdata);
+	    log_printf(TRACE,Load_store_unit,FUNCTION,"      * shift        : %d",_load_queue [internal_MEMORY_OUT_PTR]._shift);
+	    log_printf(TRACE,Load_store_unit,FUNCTION,"      * signed?      : %d",_load_queue [internal_MEMORY_OUT_PTR]._is_load_signed);
+	    log_printf(TRACE,Load_store_unit,FUNCTION,"      * access_size  : %d",_load_queue [internal_MEMORY_OUT_PTR]._access_size);
+
+	    Texception_t exception      = _load_queue [internal_MEMORY_OUT_PTR]._exception;
+	    bool         have_exception = ((exception != EXCEPTION_MEMORY_NONE) and
+					   (exception != EXCEPTION_MEMORY_MISS_SPECULATION));
+
+	    // if exception, rdata content the address of load, else content read data.
+	    memory_out_data_rd       = (have_exception)?data_old:data_new;
+	    memory_out_exception     = (_load_queue[internal_MEMORY_OUT_PTR]._state == LOAD_QUEUE_COMMIT_CHECK)?EXCEPTION_MEMORY_LOAD_SPECULATIVE:exception;
+
+	    break; // we have find a entry !!! stop the search
+	  }
+      }
+
+    if (not internal_MEMORY_OUT_VAL)
+      {
+	log_printf(TRACE,Load_store_unit,FUNCTION,"  * Store queue");
+	if (_store_queue [reg_STORE_QUEUE_PTR_READ]._state == STORE_QUEUE_COMMIT)
+	  {
+	    log_printf(TRACE,Load_store_unit,FUNCTION,"    * find : %d",reg_STORE_QUEUE_PTR_READ);
+
+	    internal_MEMORY_OUT_VAL          = 1;
+	    internal_MEMORY_OUT_SELECT_QUEUE = SELECT_STORE_QUEUE;
+	    
+	    memory_out_context_id    = _store_queue [reg_STORE_QUEUE_PTR_READ]._context_id;
+	    memory_out_front_end_id  = _store_queue [reg_STORE_QUEUE_PTR_READ]._front_end_id;
+	    memory_out_ooo_engine_id = _store_queue [reg_STORE_QUEUE_PTR_READ]._ooo_engine_id;
+	    memory_out_packet_id     = _store_queue [reg_STORE_QUEUE_PTR_READ]._packet_id ;
+//          memory_out_write_rd  	 
+//          memory_out_num_reg_rd	 
+	    memory_out_data_rd       = _store_queue [reg_STORE_QUEUE_PTR_READ]._address; // to the exception
+	    memory_out_exception     = _store_queue [reg_STORE_QUEUE_PTR_READ]._exception;
+	  }
+      }
     // write output
-    PORT_WRITE(out_MEMORY_OUT_VAL       , internal_MEMORY_OUT_VAL);
-
-    PORT_WRITE(out_MEMORY_OUT_CONTEXT_ID, memory_out_context_id);
-    PORT_WRITE(out_MEMORY_OUT_PACKET_ID , memory_out_packet_id );
-    PORT_WRITE(out_MEMORY_OUT_WRITE_RD  , memory_out_write_rd  );
-    PORT_WRITE(out_MEMORY_OUT_NUM_REG_RD, memory_out_num_reg_rd);
-    PORT_WRITE(out_MEMORY_OUT_DATA_RD   , memory_out_data_rd   );
-//  PORT_WRITE(out_MEMORY_OUT_WRITE_RE  , memory_out_write_re  );
-//  PORT_WRITE(out_MEMORY_OUT_NUM_REG_RE, memory_out_num_reg_re);
-//  PORT_WRITE(out_MEMORY_OUT_DATA_RE   , memory_out_data_re   );
-    PORT_WRITE(out_MEMORY_OUT_EXCEPTION , memory_out_exception );
+    PORT_WRITE(out_MEMORY_OUT_VAL          , internal_MEMORY_OUT_VAL);
+
+    if (_param->_have_port_context_id)
+    PORT_WRITE(out_MEMORY_OUT_CONTEXT_ID   , memory_out_context_id   );
+    if (_param->_have_port_front_end_id)
+    PORT_WRITE(out_MEMORY_OUT_FRONT_END_ID , memory_out_front_end_id );
+    if (_param->_have_port_ooo_engine_id)
+    PORT_WRITE(out_MEMORY_OUT_OOO_ENGINE_ID, memory_out_ooo_engine_id);
+    if (_param->_have_port_packet_id)
+    PORT_WRITE(out_MEMORY_OUT_PACKET_ID    , memory_out_packet_id    );
+    PORT_WRITE(out_MEMORY_OUT_WRITE_RD     , memory_out_write_rd     );
+    PORT_WRITE(out_MEMORY_OUT_NUM_REG_RD   , memory_out_num_reg_rd   );
+    PORT_WRITE(out_MEMORY_OUT_DATA_RD      , memory_out_data_rd      );
+//  PORT_WRITE(out_MEMORY_OUT_WRITE_RE     , memory_out_write_re     );
+//  PORT_WRITE(out_MEMORY_OUT_NUM_REG_RE   , memory_out_num_reg_re   );
+//  PORT_WRITE(out_MEMORY_OUT_DATA_RE      , memory_out_data_re      );
+    PORT_WRITE(out_MEMORY_OUT_EXCEPTION    , memory_out_exception    );
 
     // ~~~~~[ Interface "dache_req" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -76,33 +134,71 @@
     Tdcache_address_t dcache_req_address   ;
     Tdcache_type_t    dcache_req_type      ;
-    Tcontrol_t        dcache_req_uncached  ;
     Tdcache_data_t    dcache_req_wdata     ;
 
-    internal_DCACHE_REQ_VAL          = 0;
+    log_printf(TRACE,Load_store_unit,FUNCTION,"genMoore : Test DCACHE_REQ");
+
+    internal_DCACHE_REQ_VAL = 0;
+
+    internal_SPECULATIVE_ACCESS_QUEUE_PTR_READ = (*_speculative_access_queue_control)[0];
 
     // Test store and load queue
-
-    // TODO : il faut d'abord tester si un elment de l'access queue n'est pas commitable !!!!!!!
-
-    // Test an store must be commited.
-    if (_store_queue [internal_MEMORY_STORE_QUEUE_PTR_READ]._state == STORE_QUEUE_VALID_NO_SPECULATIVE)
-      {
+    if (_speculative_access_queue [internal_SPECULATIVE_ACCESS_QUEUE_PTR_READ]._state == SPECULATIVE_ACCESS_QUEUE_WAIT_CACHE)
+      {
+	log_printf(TRACE,Load_store_unit,FUNCTION," * speculative_access_queue[%d]",internal_SPECULATIVE_ACCESS_QUEUE_PTR_READ);
+
 	internal_DCACHE_REQ_VAL          = 1;
-	internal_DCACHE_REQ_SELECT_QUEUE = SELECT_STORE_QUEUE;
-
-	dcache_req_context_id = _store_queue [internal_MEMORY_STORE_QUEUE_PTR_READ]._context_id;
-	dcache_req_packet_id  = _store_queue [internal_MEMORY_STORE_QUEUE_PTR_READ]._packet_id ;
-	dcache_req_address    = _store_queue [internal_MEMORY_STORE_QUEUE_PTR_READ]._address   ;
-	dcache_req_type       = _store_queue [internal_MEMORY_STORE_QUEUE_PTR_READ]._dcache_type;
-	dcache_req_uncached   = _store_queue [internal_MEMORY_STORE_QUEUE_PTR_READ]._uncached  ;
-	dcache_req_wdata      = _store_queue [internal_MEMORY_STORE_QUEUE_PTR_READ]._wdata     ;
+	internal_DCACHE_REQ_SELECT_QUEUE = SELECT_LOAD_QUEUE_SPECULATIVE;
+
+	if (_param->_have_port_dcache_context_id)
+	  {
+	    Tcontext_t context_id    = _speculative_access_queue [internal_SPECULATIVE_ACCESS_QUEUE_PTR_READ]._context_id;
+	    Tcontext_t front_end_id  = _speculative_access_queue [internal_SPECULATIVE_ACCESS_QUEUE_PTR_READ]._front_end_id;
+	    Tcontext_t ooo_engine_id = _speculative_access_queue [internal_SPECULATIVE_ACCESS_QUEUE_PTR_READ]._ooo_engine_id;
+	    
+	    dcache_req_context_id = ((ooo_engine_id<<(_param->_size_context_id + _param->_size_front_end_id )) |
+				     (front_end_id <<(_param->_size_context_id)) |
+				     (context_id));
+	  }
+
+	dcache_req_packet_id  = DCACHE_REQ_IS_LOAD(_speculative_access_queue [internal_SPECULATIVE_ACCESS_QUEUE_PTR_READ]._load_queue_ptr_write);
+	dcache_req_address    = _speculative_access_queue [internal_SPECULATIVE_ACCESS_QUEUE_PTR_READ]._address & _param->_mask_address_msb;
+	dcache_req_type       = operation_to_dcache_type(_speculative_access_queue [internal_SPECULATIVE_ACCESS_QUEUE_PTR_READ]._operation);
+#ifdef SYSTEMC_VHDL_COMPATIBILITY
+	dcache_req_wdata      = 0;
+#endif
+      }
+    else
+      {
+	// Test an store must be commited.
+	if (_store_queue [reg_STORE_QUEUE_PTR_READ]._state == STORE_QUEUE_VALID_NO_SPECULATIVE)
+	  {
+	    internal_DCACHE_REQ_VAL          = 1;
+	    internal_DCACHE_REQ_SELECT_QUEUE = SELECT_STORE_QUEUE;
+	    
+	    if (_param->_have_port_dcache_context_id)
+	      {
+		Tcontext_t context_id    = _store_queue [reg_STORE_QUEUE_PTR_READ]._context_id;
+		Tcontext_t front_end_id  = _store_queue [reg_STORE_QUEUE_PTR_READ]._front_end_id;
+		Tcontext_t ooo_engine_id = _store_queue [reg_STORE_QUEUE_PTR_READ]._ooo_engine_id;
+		
+		dcache_req_context_id = ((ooo_engine_id<<(_param->_size_context_id + _param->_size_front_end_id )) |
+					 (front_end_id <<(_param->_size_context_id)) |
+					 (context_id));
+	      }
+
+	    // FIXME : il peut avoir plusieurs store avec le même paquet_id ... pour l'instant pas très grave car pas de retour (enfin seul les bus error sont des retours)
+	    dcache_req_packet_id  = DCACHE_REQ_IS_STORE(reg_STORE_QUEUE_PTR_READ);
+	    dcache_req_address    = _store_queue [reg_STORE_QUEUE_PTR_READ]._address   ;
+	    dcache_req_type       = operation_to_dcache_type(_store_queue [reg_STORE_QUEUE_PTR_READ]._operation);
+	    dcache_req_wdata      = _store_queue [reg_STORE_QUEUE_PTR_READ]._wdata     ;
+	  }
       }
 
     PORT_WRITE(out_DCACHE_REQ_VAL       , internal_DCACHE_REQ_VAL);
+    if (_param->_have_port_dcache_context_id)
     PORT_WRITE(out_DCACHE_REQ_CONTEXT_ID, dcache_req_context_id);
     PORT_WRITE(out_DCACHE_REQ_PACKET_ID , dcache_req_packet_id );
     PORT_WRITE(out_DCACHE_REQ_ADDRESS   , dcache_req_address   );
     PORT_WRITE(out_DCACHE_REQ_TYPE      , dcache_req_type      );
-    PORT_WRITE(out_DCACHE_REQ_UNCACHED  , dcache_req_uncached  );
     PORT_WRITE(out_DCACHE_REQ_WDATA     , dcache_req_wdata     );
     
Index: 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
===================================================================
--- 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	(revision 70)
+++ 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	(revision 71)
@@ -1,4 +1,3 @@
 #ifdef SYSTEMC
-//#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
 /*
  * $Id$
@@ -30,6 +29,7 @@
 	// Reset : clear all queue
 	_speculative_access_queue_control->clear();
-	internal_MEMORY_STORE_QUEUE_PTR_READ = 0;
-	internal_MEMORY_LOAD_QUEUE_PTR_READ  = 0;
+
+	reg_STORE_QUEUE_PTR_READ = 0;
+	reg_LOAD_QUEUE_CHECK_PRIORITY  = 0;
 
 	for (uint32_t i=0; i< _param->_size_store_queue             ; i++)
@@ -44,4 +44,212 @@
     else
       {
+	//================================================================
+	// Interface "PORT_CHECK"
+	//================================================================
+	
+	// Plusieurs moyens de faire la verification de dépendance entre les loads et les stores.
+	//  1) un load ne peut vérifier qu'un store par cycle. Dans ce cas port_check <= size_load_queue
+	//  2) un load tente de vérifier le maximum de store par cycle. Dans ce cas ce n'est pas du pointeur d'écriture qu'il lui faut mais un vecteur de bit indiquant quel store à déjà été testé. De plus il faut un bit indiquant qu'il y a un match mais que ce n'est pas forcément le premier.
+
+	// solution 1)
+ 	log_printf(TRACE,Load_store_unit,FUNCTION,"CHECK");
+	for (uint32_t i=0, nb_check=0; (nb_check<_param->_nb_port_check) and (i<_param->_size_load_queue); i++)
+	  {
+	    uint32_t index_load = (i + reg_LOAD_QUEUE_CHECK_PRIORITY)%_param->_size_load_queue;
+	    
+	    if (((_load_queue[index_load]._state == LOAD_QUEUE_WAIT_CHECK)   or
+		 (_load_queue[index_load]._state == LOAD_QUEUE_COMMIT_CHECK) or
+		 (_load_queue[index_load]._state == LOAD_QUEUE_CHECK)) and
+		is_operation_memory_load(_load_queue[index_load]._operation))
+	      {
+		log_printf(TRACE,Load_store_unit,FUNCTION,"  * Find a load : %d",index_load);
+
+		nb_check++; // use one port
+
+		// find a entry that it need a check
+
+		Tlsq_ptr_t index_store  = _load_queue[index_load]._store_queue_ptr_write;
+		bool       end_check    = false;
+		bool       change_state = false;
+		bool       next         = false;
+
+		// At the first store queue empty, stop check.
+		// Explication :
+		//  * rename logic keep a empty case in the store queue (also size_store_queue > 1)
+		//  * when a store is out of store queue, also it was in head of re order buffer. Also, they are none previous load.
+
+		log_printf(TRACE,Load_store_unit,FUNCTION,"    * index_store : %d",index_store);
+		if (index_store == reg_STORE_QUEUE_PTR_READ)
+		  {
+		    log_printf(TRACE,Load_store_unit,FUNCTION,"      * index_store == reg_STORE_QUEUE_PTR_READ");
+		    end_check    = true;
+		    change_state = true;
+		  }
+		else
+		  {
+		    log_printf(TRACE,Load_store_unit,FUNCTION,"      * index_store != reg_STORE_QUEUE_PTR_READ");
+
+		    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
+
+		    log_printf(TRACE,Load_store_unit,FUNCTION,"      * index_store : %d",index_store);
+		    
+		    switch (_store_queue[index_store]._state)
+		      {
+		      case STORE_QUEUE_VALID_NO_SPECULATIVE : 
+		      case STORE_QUEUE_COMMIT :
+		      case STORE_QUEUE_VALID_SPECULATIVE :
+			{
+			  
+			  log_printf(TRACE,Load_store_unit,FUNCTION,"      * store have a valid entry");
+			  
+			  // TODO : MMU - nous considérons que les adresses sont physique
+			  bool test_thread_id = true;
+			  
+			  // Test thread id.
+			  if (_param->_have_port_context_id)
+			    test_thread_id &= (_load_queue[index_load]._context_id    == _store_queue[index_store]._context_id);
+			  if (_param->_have_port_front_end_id)
+			    test_thread_id &= (_load_queue[index_load]._front_end_id  == _store_queue[index_store]._front_end_id);
+			  if (_param->_have_port_ooo_engine_id)
+			    test_thread_id &= (_load_queue[index_load]._ooo_engine_id == _store_queue[index_store]._ooo_engine_id);
+			  
+			  if (test_thread_id)
+			    {
+			      log_printf(TRACE,Load_store_unit,FUNCTION,"        * load and store is the same thread.");
+			      // the load and store are in the same thread. Now, we must test address.
+			      Tdcache_address_t load_addr  = _load_queue [index_load ]._address;
+			      Tdcache_address_t store_addr = _store_queue[index_store]._address;
+			      
+			      log_printf(TRACE,Load_store_unit,FUNCTION,"          * load_addr                     : %.8x.",load_addr );
+			      log_printf(TRACE,Load_store_unit,FUNCTION,"          * store_addr                    : %.8x.",store_addr);
+			      log_printf(TRACE,Load_store_unit,FUNCTION,"          * load_addr  & mask_address_msb : %.8x.",load_addr  & _param->_mask_address_msb);
+			      log_printf(TRACE,Load_store_unit,FUNCTION,"          * store_addr & mask_address_msb : %.8x.",store_addr & _param->_mask_address_msb);
+			      // Test if the both address target the same word
+			      if ((load_addr  & _param->_mask_address_msb) == 
+				  (store_addr & _param->_mask_address_msb))
+				{
+				  log_printf(TRACE,Load_store_unit,FUNCTION,"            * address_msb is the same.");
+				  // all case - [] : store, () : load
+				  // (1) store_max >= load_max and store_min <= load_min  ...[...(...)...]... Ok - inclusion in store
+				  // (2) store_min >  load_max                            ...[...]...(...)... Ok - no conflit
+				  // (3) store_max <  load_min                            ...(...)...[...]... Ok - no conflit
+				  // (4) store_max <  load_max and store_min >  load_min  ...(...[...]...)... Ko - inclusion in load
+				  // (5) store_max >= load_max and store_min >  load_min  ...[...(...]...)... Ko - conflit
+				  // (6) store_max <  load_max and store_min <= load_min  ...(...[...)...]... Ko - conflit
+				  // but :
+				  // load in the cache is a word !
+				  // the mask can be make when the load is commited. Also, the rdata content a full word.
+				  // the only case is (4)
+				  
+				  Tgeneral_data_t load_data  = _load_queue [index_load ]._rdata  ;
+				  Tgeneral_data_t store_data = _store_queue[index_store]._wdata  ;
+				  
+				  log_printf(TRACE,Load_store_unit,FUNCTION,"              * load_data  (init) : %.8x",load_data);
+				  log_printf(TRACE,Load_store_unit,FUNCTION,"              * store_data (init) : %.8x",store_data);
+				  uint32_t store_num_byte_min = (store_addr & _param->_mask_address_lsb);
+				  uint32_t store_num_byte_max = store_num_byte_min+(1<<memory_access(_store_queue[index_store]._operation));
+				  log_printf(TRACE,Load_store_unit,FUNCTION,"            * store_num_byte_min : %d",store_num_byte_min);
+				  log_printf(TRACE,Load_store_unit,FUNCTION,"            * store_num_byte_max : %d",store_num_byte_max);
+				  log_printf(TRACE,Load_store_unit,FUNCTION,"            * check_hit          : %x",_load_queue[index_load]._check_hit);
+				  log_printf(TRACE,Load_store_unit,FUNCTION,"            * check_hit_byte     : %x",_load_queue[index_load]._check_hit_byte);
+				  // The bypass is checked byte per byte
+				  for (uint32_t byte=store_num_byte_min; byte<store_num_byte_max; byte ++)
+				    {
+				      uint32_t mask  = 1<<byte;
+				      uint32_t index = byte<<3;
+				      log_printf(TRACE,Load_store_unit,FUNCTION,"              * byte  : %d",byte);
+				      log_printf(TRACE,Load_store_unit,FUNCTION,"              * mask  : %d",mask);
+				      log_printf(TRACE,Load_store_unit,FUNCTION,"              * index : %d",index);
+				      // Accept the bypass if they had not a previous bypass with an another store 
+				      if ((_load_queue[index_load]._check_hit_byte&mask)==0)
+					{
+					  log_printf(TRACE,Load_store_unit,FUNCTION,"              * bypass !!!");
+					  log_printf(TRACE,Load_store_unit,FUNCTION,"                * rdata_old : %.8x", load_data);
+					  load_data = insert<Tdcache_data_t>(load_data, store_data, index+8-1, index);
+					  _load_queue[index_load]._check_hit_byte |= mask;
+					  _load_queue[index_load]._check_hit       = 1;
+					  change_state = true;
+
+					  log_printf(TRACE,Load_store_unit,FUNCTION,"                * rdata_new : %.8x", load_data);
+					}
+				    }
+
+				  _load_queue[index_load]._rdata = load_data;
+
+				  log_printf(TRACE,Load_store_unit,FUNCTION,"            * check_hit          : %x",_load_queue[index_load]._check_hit);
+				  log_printf(TRACE,Load_store_unit,FUNCTION,"            * check_hit_byte     : %x",_load_queue[index_load]._check_hit_byte);
+
+				  log_printf(TRACE,Load_store_unit,FUNCTION,"            * mask_end_check     : %x",(-1& _param->_mask_address_lsb));
+				  // The check is finish if all bit is set
+				  end_check = (_load_queue[index_load]._check_hit_byte == MASK_CHECK_BYTE_HIT);
+				}
+			    }
+			  
+			  next = true;
+			  break;
+			}
+		      case STORE_QUEUE_EMPTY :
+		      case STORE_QUEUE_NO_VALID_NO_SPECULATIVE :
+			{
+			  log_printf(TRACE,Load_store_unit,FUNCTION,"      * store have an invalid entry");
+			  break;
+			}
+		      }
+		  }
+
+		if (next)
+		  {
+		    log_printf(TRACE,Load_store_unit,FUNCTION,"              * next");
+// 		    if (_load_queue[index_load]._store_queue_ptr_write == 0)
+// 		      _load_queue[index_load]._store_queue_ptr_write = _param->_size_store_queue-1;
+// 		    else
+// 		      _load_queue[index_load]._store_queue_ptr_write --;
+		    _load_queue[index_load]._store_queue_ptr_write = index_store; // because the index store have be decrease
+
+		    // 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"
+		    if (index_store == reg_STORE_QUEUE_PTR_READ)
+		      {
+			end_check    = true;
+			change_state = true;
+		      }
+		  }
+
+		if (change_state)
+		  {
+		    log_printf(TRACE,Load_store_unit,FUNCTION,"              * change_state");
+
+		    switch (_load_queue[index_load]._state)
+		      {
+		      case LOAD_QUEUE_WAIT_CHECK   : _load_queue[index_load]._state = LOAD_QUEUE_WAIT  ; break;
+		      case LOAD_QUEUE_COMMIT_CHECK : 
+			{
+			  if (end_check)
+			    _load_queue[index_load]._state = LOAD_QUEUE_COMMIT; 
+			  else
+			    _load_queue[index_load]._state = LOAD_QUEUE_CHECK;
+			  break;
+			}
+		      case LOAD_QUEUE_CHECK        : 
+			{
+			  if (end_check)
+			    _load_queue[index_load]._state     = LOAD_QUEUE_COMMIT;
+			  // check find a bypass. A speculative load have been committed : report a speculation miss.
+			  if (_load_queue[index_load]._check_hit != 0)
+			    {
+			      _load_queue[index_load]._exception = EXCEPTION_MEMORY_MISS_SPECULATION;
+			      _load_queue[index_load]._write_rd  = 1; // write the good result
+			    }
+			  
+			  break;
+			}
+		      default : break;
+		      }
+		    log_printf(TRACE,Load_store_unit,FUNCTION,"                * new state : %d",_load_queue[index_load]._state);
+		    log_printf(TRACE,Load_store_unit,FUNCTION,"                * exception : %d",_load_queue[index_load]._exception);
+		  }
+	      }
+	    // else : don't use a port
+	  }
+	
 	//================================================================
 	// Interface "MEMORY_IN"
@@ -117,33 +325,40 @@
 		  case STORE_QUEUE_NO_VALID_NO_SPECULATIVE :
 		    {
-// 		      if (is_operation_memory_store_head(operation) == false)
-// 			{
-			  new_state = STORE_QUEUE_VALID_NO_SPECULATIVE;
-
-			  // Test if have a new exception (priority : miss_speculation)
-			  if ((old_exception == EXCEPTION_MEMORY_NONE) and
-			      (exception_alignement == true))
-			    new_exception = EXCEPTION_MEMORY_ALIGNMENT;
-
-			  update_info = true;
-			  break;
-// 			}
+#ifdef DEBUG_TEST
+		      if (is_operation_memory_store_head(operation) == true)
+			throw ErrorMorpheo(_("Transaction in memory_in's interface, actual state of store_queue is \"STORE_QUEUE_NO_VALID_NO_SPECULATIVE\", also a previous store_head have been receiveid. But this operation is a store_head."));
+#endif
+		      // Test if have a new exception (priority : miss_speculation)
+		      if ((exception_alignement == true) and (old_exception == EXCEPTION_MEMORY_NONE))
+			new_exception = EXCEPTION_MEMORY_ALIGNMENT;
+		      
+		      if (new_exception != EXCEPTION_MEMORY_NONE)
+			new_state = STORE_QUEUE_COMMIT;
+		      else
+			new_state = STORE_QUEUE_VALID_NO_SPECULATIVE;
+		      
+		      update_info = true;
+		      break;
 		    }
 		  case STORE_QUEUE_VALID_SPECULATIVE       :
 		    {
-// 		      if (is_operation_memory_store_head(operation) == true)
-// 			{
-			  new_state = STORE_QUEUE_VALID_NO_SPECULATIVE;
-
-			  if (operation == OPERATION_MEMORY_STORE_HEAD_KO)
-			    new_exception = EXCEPTION_MEMORY_MISS_SPECULATION;
-
-			  break;
-// 			}
+#ifdef DEBUG_TEST
+		      if (is_operation_memory_store_head(operation) == false)
+			throw ErrorMorpheo(_("Transaction in memory_in's interface, actual state of store_queue is \"STORE_QUEUE_VALID_SPECULATIVE\", also a previous access with register and address have been receiveid. But this operation is a not store_head."));
+#endif
+		      if (operation == OPERATION_MEMORY_STORE_HEAD_KO)
+			new_exception = EXCEPTION_MEMORY_MISS_SPECULATION; // great prioritary
+		      
+		      if (new_exception != EXCEPTION_MEMORY_NONE)
+			new_state = STORE_QUEUE_COMMIT;
+		      else
+			new_state = STORE_QUEUE_VALID_NO_SPECULATIVE;
+		      
+		      break;
 		    }
 		  case STORE_QUEUE_VALID_NO_SPECULATIVE    :
 		  case STORE_QUEUE_COMMIT                  :
 		    {
-		      ErrorMorpheo("<Load_store_unit::function_speculative_load_commit_transition> Invalid state and operation");
+		      throw ErrorMorpheo("<Load_store_unit::function_speculative_load_commit_transition> Invalid state and operation");
 		    }
 		  }
@@ -156,12 +371,14 @@
 		    log_printf(TRACE,Load_store_unit,FUNCTION,"   * Update information");
 
-		    _store_queue [index]._context_id           = PORT_READ(in_MEMORY_IN_CONTEXT_ID  );
-		    _store_queue [index]._packet_id            = PORT_READ(in_MEMORY_IN_PACKET_ID   );
-		    _store_queue [index]._dcache_type          = operation_to_dcache_type(operation);
-		    _store_queue [index]._uncached             = 0; // is the MMU that have this info
+		    _store_queue [index]._context_id           = (not _param->_have_port_context_id   )?0:PORT_READ(in_MEMORY_IN_CONTEXT_ID);
+		    _store_queue [index]._front_end_id         = (not _param->_have_port_front_end_id )?0:PORT_READ(in_MEMORY_IN_FRONT_END_ID);
+		    _store_queue [index]._ooo_engine_id        = (not _param->_have_port_ooo_engine_id)?0:PORT_READ(in_MEMORY_IN_OOO_ENGINE_ID);
+		    _store_queue [index]._packet_id            = (not _param->_have_port_packet_id    )?0:PORT_READ(in_MEMORY_IN_PACKET_ID   );
+		    _store_queue [index]._operation            = operation;
 		    _store_queue [index]._load_queue_ptr_write = PORT_READ(in_MEMORY_IN_LOAD_QUEUE_PTR_WRITE);
 		    _store_queue [index]._address              = address;
-		    _store_queue [index]._wdata                = PORT_READ(in_MEMORY_IN_DATA_RB     );
-//                  _store_queue [index]._write_rd             = PORT_READ(in_MEMORY_IN_WRITE_RD    );
+
+		    // reordering data
+		    _store_queue [index]._wdata                = duplicate<Tgeneral_data_t>(_param->_size_general_data,PORT_READ(in_MEMORY_IN_DATA_RB), memory_size(operation), 0);
 //                  _store_queue [index]._num_reg_rd           = PORT_READ(in_MEMORY_IN_NUM_REG_RD  );
 		  }
@@ -169,16 +386,43 @@
 	    else
 	      {
-// 		// ====================================
-// 		// ===== SPECULATIVE_ACCESS_QUEUE =====
-// 		// ====================================
-
-// 		// In speculative access queue, they are many type's request
-// 		log_printf(TRACE,Load_store_unit,FUNCTION,"speculative_access_queue");
-// 		log_printf(TRACE,Load_store_unit,FUNCTION," * PUSH");
-		
-// 		// Write in reservation station
-// 		uint32_t index = _speculative_access_queue_control->push();
-		
-// 		log_printf(TRACE,Load_store_unit,FUNCTION,"   * index         : %d",index);
+		// ====================================
+		// ===== SPECULATIVE_ACCESS_QUEUE =====
+		// ====================================
+
+		// In speculative access queue, they are many type's request
+		log_printf(TRACE,Load_store_unit,FUNCTION,"speculative_access_queue");
+		log_printf(TRACE,Load_store_unit,FUNCTION," * PUSH");
+		
+		// Write in reservation station
+		uint32_t     index = _speculative_access_queue_control->push();
+
+		log_printf(TRACE,Load_store_unit,FUNCTION,"   * index : %d", index);
+
+		Texception_t exception;
+
+		if (exception_alignement == true)
+		  exception = EXCEPTION_MEMORY_ALIGNMENT;
+		else
+		  exception = EXCEPTION_MEMORY_NONE;
+				
+		// if exception, don't access at the cache
+		// NOTE : type "other" (lock, invalidate, flush and sync) can't make an alignement exception (access is equivalent at a 8 bits)
+		_speculative_access_queue [index]._state                = (exception == EXCEPTION_MEMORY_NONE)?SPECULATIVE_ACCESS_QUEUE_WAIT_CACHE:SPECULATIVE_ACCESS_QUEUE_WAIT_LOAD_QUEUE;
+		_speculative_access_queue [index]._context_id           = (not _param->_have_port_context_id   )?0:PORT_READ(in_MEMORY_IN_CONTEXT_ID);
+		_speculative_access_queue [index]._front_end_id         = (not _param->_have_port_front_end_id )?0:PORT_READ(in_MEMORY_IN_FRONT_END_ID);
+		_speculative_access_queue [index]._ooo_engine_id        = (not _param->_have_port_ooo_engine_id)?0:PORT_READ(in_MEMORY_IN_OOO_ENGINE_ID);
+		_speculative_access_queue [index]._packet_id            = (not _param->_have_port_packet_id    )?0:PORT_READ(in_MEMORY_IN_PACKET_ID);
+
+		_speculative_access_queue [index]._operation            = operation;
+		_speculative_access_queue [index]._load_queue_ptr_write = PORT_READ(in_MEMORY_IN_LOAD_QUEUE_PTR_WRITE);
+		_speculative_access_queue [index]._store_queue_ptr_write= PORT_READ(in_MEMORY_IN_STORE_QUEUE_PTR_WRITE);
+		_speculative_access_queue [index]._address              = address;
+		// NOTE : is operation is a load, then they are a result and must write in the register file
+		_speculative_access_queue [index]._write_rd             = is_operation_memory_load(operation);
+		_speculative_access_queue [index]._num_reg_rd           = PORT_READ(in_MEMORY_IN_NUM_REG_RD  );
+
+		_speculative_access_queue [index]._exception            = exception;
+		
+		log_printf(TRACE,Load_store_unit,FUNCTION,"   * index         : %d",index);
 	      }
 	  }
@@ -191,4 +435,6 @@
             (PORT_READ(in_MEMORY_OUT_ACK) == 1))
           {
+	    log_printf(TRACE,Load_store_unit,FUNCTION,"MEMORY_OUT transaction");
+
 	    switch (internal_MEMORY_OUT_SELECT_QUEUE)
 	      {
@@ -199,14 +445,40 @@
 		  // =======================
 		  
+		  log_printf(TRACE,Load_store_unit,FUNCTION," * store_queue [%d]",reg_STORE_QUEUE_PTR_READ);
+	    
 		  // Entry flush and increase the read pointer
-		  
-		  _store_queue [internal_MEMORY_STORE_QUEUE_PTR_READ]._state = STORE_QUEUE_EMPTY;
-		  
-		  internal_MEMORY_STORE_QUEUE_PTR_READ = (internal_MEMORY_STORE_QUEUE_PTR_READ+1)%_param->_size_store_queue;
+		  _store_queue [reg_STORE_QUEUE_PTR_READ]._state = STORE_QUEUE_EMPTY;
+		  
+		  reg_STORE_QUEUE_PTR_READ = (reg_STORE_QUEUE_PTR_READ+1)%_param->_size_store_queue;
 
 		  break;
 		}
 	      case SELECT_LOAD_QUEUE :
+		{
+		  // ======================
+		  // ===== LOAD_QUEUE =====
+		  // ======================
+		  
+		  log_printf(TRACE,Load_store_unit,FUNCTION," * load_queue  [%d]",internal_MEMORY_OUT_PTR);
+		  
+		  // Entry flush and increase the read pointer
+		  
+		  _load_queue [internal_MEMORY_OUT_PTR]._state = LOAD_QUEUE_EMPTY;
+		  
+		  // reg_LOAD_QUEUE_PTR_READ = (reg_LOAD_QUEUE_PTR_READ+1)%_param->_size_load_queue;
+
+		  break;
+		}
 	      case SELECT_LOAD_QUEUE_SPECULATIVE :
+		{
+		  log_printf(TRACE,Load_store_unit,FUNCTION," * load_queue  [%d] (speculative)",internal_MEMORY_OUT_PTR);
+		  
+		  _load_queue [internal_MEMORY_OUT_PTR]._state    = LOAD_QUEUE_CHECK;
+		  // NOTE : a speculative load write in the register file.
+		  // if the speculation is a miss, write_rd is re set at 1.
+		  _load_queue [internal_MEMORY_OUT_PTR]._write_rd = 0;
+		  break;
+		}
+
 		break;
 	      }
@@ -216,7 +488,11 @@
 	// Interface "DCACHE_REQ"
 	//================================================================
+	bool load_queue_push = (_speculative_access_queue [internal_SPECULATIVE_ACCESS_QUEUE_PTR_READ]._state == SPECULATIVE_ACCESS_QUEUE_WAIT_LOAD_QUEUE);
+
         if ((    internal_DCACHE_REQ_VAL  == 1) and
             (PORT_READ(in_DCACHE_REQ_ACK) == 1))
           {
+	    log_printf(TRACE,Load_store_unit,FUNCTION,"DCACHE_REQ");
+
 	    switch (internal_DCACHE_REQ_SELECT_QUEUE)
 	      {
@@ -229,25 +505,202 @@
 		  // Entry flush and increase the read pointer
 		  
-		  _store_queue [internal_MEMORY_STORE_QUEUE_PTR_READ]._state = STORE_QUEUE_COMMIT;
-
+		  _store_queue [reg_STORE_QUEUE_PTR_READ]._state = STORE_QUEUE_COMMIT;
+
+		  break;
+		}
+	      case SELECT_LOAD_QUEUE_SPECULATIVE :
+		{
+		  // =========================================
+		  // ===== SELECT_LOAD_QUEUE_SPECULATIVE =====
+		  // =========================================
+
+		  load_queue_push = true;
 		  break;
 		}
 	      case SELECT_LOAD_QUEUE :
-	      case SELECT_LOAD_QUEUE_SPECULATIVE :
+		{
+		  throw ErrorMorpheo(_("Invalid selection"));
+		  break;
+		}
+
 		break;
 	      }
 	  }
 
+	if (load_queue_push)
+	  {
+	    Tlsq_ptr_t   ptr_write = _speculative_access_queue[internal_SPECULATIVE_ACCESS_QUEUE_PTR_READ]._load_queue_ptr_write;
+	    Toperation_t operation = _speculative_access_queue[internal_SPECULATIVE_ACCESS_QUEUE_PTR_READ]._operation;
+	    Texception_t exception = _speculative_access_queue[internal_SPECULATIVE_ACCESS_QUEUE_PTR_READ]._exception;
+	    bool         have_exception = (exception != EXCEPTION_MEMORY_NONE);
+	    
+	    
+	    if (have_exception)
+	      _load_queue [ptr_write]._state = LOAD_QUEUE_COMMIT;
+	    else
+	      {
+		if (have_dcache_rsp(operation))
+		  {
+		    // load and synchronisation
+		    if (must_check(operation))
+		      {
+			// load
+			_load_queue [ptr_write]._state = LOAD_QUEUE_WAIT_CHECK;
+		      }
+		    else
+		      {
+			// synchronisation
+			_load_queue [ptr_write]._state = LOAD_QUEUE_WAIT;
+		      }
+		  }
+		else
+		  {
+		    // lock, prefecth, flush and invalidate
+		    _load_queue [ptr_write]._state = LOAD_QUEUE_COMMIT;
+		  }
+	      }
+
+	    Tdcache_address_t address        = _speculative_access_queue [internal_SPECULATIVE_ACCESS_QUEUE_PTR_READ]._address;
+	    Tdcache_address_t address_lsb    = (address & _param->_mask_address_lsb);
+	    Tdcache_address_t check_hit_byte = gen_mask_not<Tdcache_address_t>(address_lsb+memory_access(operation)+1,address_lsb);
+	    _load_queue [ptr_write]._context_id        = _speculative_access_queue [internal_SPECULATIVE_ACCESS_QUEUE_PTR_READ]._context_id           ;
+	    _load_queue [ptr_write]._front_end_id      = _speculative_access_queue [internal_SPECULATIVE_ACCESS_QUEUE_PTR_READ]._front_end_id         ;
+	    _load_queue [ptr_write]._ooo_engine_id     = _speculative_access_queue [internal_SPECULATIVE_ACCESS_QUEUE_PTR_READ]._ooo_engine_id        ;
+	    _load_queue [ptr_write]._packet_id         = _speculative_access_queue [internal_SPECULATIVE_ACCESS_QUEUE_PTR_READ]._packet_id            ;
+	    _load_queue [ptr_write]._operation         = operation;
+	    _load_queue [ptr_write]._store_queue_ptr_write = _speculative_access_queue [internal_SPECULATIVE_ACCESS_QUEUE_PTR_READ]._store_queue_ptr_write;
+	    _load_queue [ptr_write]._address           = address;
+	    _load_queue [ptr_write]._check_hit_byte    = check_hit_byte;
+	    _load_queue [ptr_write]._check_hit         = 0;
+	    _load_queue [ptr_write]._shift             = address<<3;
+	    _load_queue [ptr_write]._is_load_signed    = is_operation_memory_load_signed(operation);
+	    _load_queue [ptr_write]._access_size       = memory_size(operation);
+	    // NOTE : if have an exception, must write in register, because a depend instruction wait the load data.
+	    _load_queue [ptr_write]._write_rd          = _speculative_access_queue [internal_SPECULATIVE_ACCESS_QUEUE_PTR_READ]._write_rd             ;
+	    
+	    _load_queue [ptr_write]._num_reg_rd        = _speculative_access_queue [internal_SPECULATIVE_ACCESS_QUEUE_PTR_READ]._num_reg_rd           ;
+	    _load_queue [ptr_write]._exception         = exception;
+	    _load_queue [ptr_write]._rdata             = address; // to the exception
+	    
+	    log_printf(TRACE,Load_store_unit,FUNCTION,"  * speculative_access_queue");
+	    log_printf(TRACE,Load_store_unit,FUNCTION,"    * POP[%d]",(*_speculative_access_queue_control)[0]);
+	    
+	    _speculative_access_queue [(*_speculative_access_queue_control)[0]]._state = SPECULATIVE_ACCESS_QUEUE_EMPTY;
+	    
+	    _speculative_access_queue_control->pop();
+	  }
+
+	//================================================================
+	// Interface "DCACHE_RSP"
+	//================================================================
+        if ((PORT_READ(in_DCACHE_RSP_VAL)== 1) and
+            (    internal_DCACHE_RSP_ACK == 1))
+          {
+	    log_printf(TRACE,Load_store_unit,FUNCTION,"DCACHE_RSP");
+
+	    // don't use context_id : because there are one queue for all thread
+	    //Tcontext_t      context_id = PORT_READ(in_DCACHE_RSP_CONTEXT_ID); 
+	    Tpacket_t       packet_id  = PORT_READ(in_DCACHE_RSP_PACKET_ID );
+	    Tdcache_data_t  rdata      = PORT_READ(in_DCACHE_RSP_RDATA     );
+	    Tdcache_error_t error      = PORT_READ(in_DCACHE_RSP_ERROR     );
+
+	    log_printf(TRACE,Load_store_unit,FUNCTION," * original packet_id : %d", packet_id);
+	    
+	    if (DCACHE_RSP_IS_LOAD(packet_id) == 1)
+	      {
+		packet_id >>= 1;
+
+		log_printf(TRACE,Load_store_unit,FUNCTION," * packet is a LOAD  : %d", packet_id);
+ 
+
+#ifdef DEBUG_TEST
+		if (not have_dcache_rsp(_load_queue [packet_id]._operation))
+		  throw ErrorMorpheo(_("Receive of respons, but the corresponding operation don't wait a respons."));
+#endif
+		
+		
+		if (error != 0)
+		  {
+		    log_printf(TRACE,Load_store_unit,FUNCTION," * have a bus error !!!");
+
+		    _load_queue [packet_id]._exception = EXCEPTION_MEMORY_BUS_ERROR;
+		    _load_queue [packet_id]._state     = LOAD_QUEUE_COMMIT;
+		  }
+		else
+		  {
+		    log_printf(TRACE,Load_store_unit,FUNCTION," * have no bus error.");
+		    log_printf(TRACE,Load_store_unit,FUNCTION,"   * previous state : %d.",_load_queue [packet_id]._state);
+
+		    // FIXME : convention : if bus error, the cache return the fautive address !
+		    // But, the load's address is aligned !
+		    _load_queue [packet_id]._rdata = rdata;
+		
+		    switch (_load_queue [packet_id]._state)
+		      {
+		      case LOAD_QUEUE_WAIT_CHECK : _load_queue [packet_id]._state = LOAD_QUEUE_COMMIT_CHECK; break;
+		      case LOAD_QUEUE_WAIT       : _load_queue [packet_id]._state = LOAD_QUEUE_COMMIT      ; break;
+		      default : throw ErrorMorpheo(_("Illegal state (dcache_rsp).")); break;
+		      }
+		  }
+	      }
+	    else
+	      {
+		log_printf(TRACE,Load_store_unit,FUNCTION," * packet is a STORE");
+		
+		// TODO : les stores ne génére pas de réponse sauf quand c'est un bus error !!!
+		throw ERRORMORPHEO(FUNCTION,_("dcache_rsp : no respons to a write. (TODO : manage bus error to the store operation.)"));
+	      }
+	    
+	  }
+	
+	// this register is to manage the priority of check -> Round robin
+	reg_LOAD_QUEUE_CHECK_PRIORITY = (reg_LOAD_QUEUE_CHECK_PRIORITY+1)%_param->_size_load_queue;
+	
+	
 #if DEBUG>=DEBUG_TRACE
 	// ***** dump store queue
-	cout << "Dump store queue" << endl
-	     << "ptr_read : " << toString(static_cast<uint32_t>(internal_MEMORY_STORE_QUEUE_PTR_READ)) << endl;
+	cout << "Dump STORE_QUEUE :" << endl
+	     << "ptr_read : " << toString(static_cast<uint32_t>(reg_STORE_QUEUE_PTR_READ)) << endl;
 	
 	for (uint32_t i=0; i<_param->_size_store_queue; i++)
 	  {
-	    uint32_t j = (internal_MEMORY_STORE_QUEUE_PTR_READ+i)%_param->_size_store_queue;
+	    uint32_t j = (reg_STORE_QUEUE_PTR_READ+i)%_param->_size_store_queue;
 	    cout << "{" << j << "}" << endl
 		 << _store_queue[j] << endl;
 	  }
+
+	// ***** dump speculative_access queue
+	cout << "Dump SPECULATIVE_ACCESS_QUEUE :" << endl;
+	
+	for (uint32_t i=0; i<_param->_size_speculative_access_queue; i++)
+	  {
+	    uint32_t j = (*_speculative_access_queue_control)[i];
+	    cout << "{" << j << "}" << endl
+		 << _speculative_access_queue[j] << endl;
+	  }
+
+	// ***** dump load queue
+	cout << "Dump LOAD_QUEUE :" << endl
+	     << "ptr_read_check_priority : " << toString(static_cast<uint32_t>(reg_LOAD_QUEUE_CHECK_PRIORITY)) << endl;
+	
+	for (uint32_t i=0; i<_param->_size_load_queue; i++)
+	  {
+	    uint32_t j = i;
+	    cout << "{" << j << "}" << endl
+		 << _load_queue[j] << endl;
+	  }
+	
+#endif
+	
+#ifdef STATISTICS
+	for (uint32_t i=0; i<_param->_size_store_queue; i++)
+	  if (_store_queue[i]._state != STORE_QUEUE_EMPTY)
+	    (*_stat_use_store_queue) ++;
+	for (uint32_t i=0; i<_param->_size_speculative_access_queue; i++)
+	  if (_speculative_access_queue[i]._state != SPECULATIVE_ACCESS_QUEUE_EMPTY)
+	    (*_stat_use_speculative_access_queue) ++;
+	for (uint32_t i=0; i<_param->_size_load_queue; i++)
+	  if (_load_queue[i]._state != LOAD_QUEUE_EMPTY)
+	    (*_stat_use_load_queue) ++;
 #endif
       }
@@ -266,3 +719,2 @@
 }; // 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/src/Load_store_unit_statistics.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Load_store_unit_statistics.cpp	(revision 70)
+++ 	(revision )
@@ -1,43 +1,0 @@
-#ifdef STATISTICS
-/*
- * $Id$
- *
- * [ Description ]
- * 
- */
-
-#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Load_store_unit.h"
-
-namespace morpheo {
-namespace behavioural {
-namespace core {
-namespace multi_execute_loop {
-namespace execute_loop {
-namespace multi_execute_unit {
-namespace execute_unit {
-namespace load_store_unit {
-
-
-#undef  FUNCTION
-#define FUNCTION "Load_store_unit::statistics"
-  string Load_store_unit::statistics (uint32_t depth)
-  {
-    log_printf(FUNC,Load_store_unit,FUNCTION,"Begin");
-
-    string txt = _stat->print(depth);
-    
-    log_printf(FUNC,Load_store_unit,FUNCTION,"End");
-
-    return txt;
-  };
-
-}; // 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
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Load_store_unit_statistics_declaration.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Load_store_unit_statistics_declaration.cpp	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Load_store_unit_statistics_declaration.cpp	(revision 71)
@@ -0,0 +1,63 @@
+#ifdef STATISTICS
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Load_store_unit.h"
+
+namespace morpheo {
+namespace behavioural {
+namespace core {
+namespace multi_execute_loop {
+namespace execute_loop {
+namespace multi_execute_unit {
+namespace execute_unit {
+namespace load_store_unit {
+
+
+#undef  FUNCTION
+#define FUNCTION "Load_store_unit::statistics_declaration"
+  void Load_store_unit::statistics_declaration (morpheo::behavioural::Parameters_Statistics * param_statistics)
+  {
+    log_printf(FUNC,Load_store_unit,FUNCTION,"Begin");
+
+    _stat = new Stat (static_cast<std::string>(_name),
+		      "Load_store_unit",
+		      param_statistics);
+
+    _stat_use_store_queue                      = _stat->create_variable("use_store_queue");
+    _stat_use_load_queue                       = _stat->create_variable("use_load_queue");
+    _stat_use_speculative_access_queue         = _stat->create_variable("use_speculative_access_queue");
+
+    _stat_average_use_store_queue              = _stat->create_counter("average_use_store_queue"              , "", "Average by cycle of the store_queue occupation ");
+    _stat_average_use_load_queue               = _stat->create_counter("average_use_load_queue"               , "", "Average by cycle of the load_queue occupation");
+    _stat_average_use_speculative_access_queue = _stat->create_counter("average_use_speculative_access_queue" , "", "Average by cycle of the speculative_access_queue occupation");
+
+    _stat_percent_use_store_queue              = _stat->create_counter("percent_use_store_queue"              , "%", "Percent of store_queue usage");
+    _stat_percent_use_load_queue               = _stat->create_counter("percent_use_load_queue"               , "%", "Percent of load_queue usage");
+    _stat_percent_use_speculative_access_queue = _stat->create_counter("percent_use_speculative_access_queue" , "%", "Percent of speculative_access_queue usage");
+
+    _stat->create_expr("average_use_store_queue"             , "/ use_store_queue              cycle", false);
+    _stat->create_expr("average_use_load_queue"              , "/ use_load_queue               cycle", false);
+    _stat->create_expr("average_use_speculative_access_queue", "/ use_speculative_access_queue cycle", false);
+
+    _stat->create_expr("percent_use_store_queue"              , "/ * average_use_store_queue              100 " + toString(_param->_size_store_queue             ), false);
+    _stat->create_expr("percent_use_load_queue"               , "/ * average_use_load_queue               100 " + toString(_param->_size_load_queue              ), false);
+    _stat->create_expr("percent_use_speculative_access_queue" , "/ * average_use_speculative_access_queue 100 " + toString(_param->_size_speculative_access_queue), false);
+
+    log_printf(FUNC,Load_store_unit,FUNCTION,"End");
+  };
+
+}; // 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
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Load_store_unit_statistics_print.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Load_store_unit_statistics_print.cpp	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Load_store_unit_statistics_print.cpp	(revision 71)
@@ -0,0 +1,43 @@
+#ifdef STATISTICS
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Load_store_unit.h"
+
+namespace morpheo {
+namespace behavioural {
+namespace core {
+namespace multi_execute_loop {
+namespace execute_loop {
+namespace multi_execute_unit {
+namespace execute_unit {
+namespace load_store_unit {
+
+
+#undef  FUNCTION
+#define FUNCTION "Load_store_unit::statistics_print"
+  string Load_store_unit::statistics_print (uint32_t depth)
+  {
+    log_printf(FUNC,Load_store_unit,FUNCTION,"Begin");
+
+    string txt = _stat->print(depth);
+    
+    log_printf(FUNC,Load_store_unit,FUNCTION,"End");
+
+    return txt;
+  };
+
+}; // 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
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Load_store_unit_transition.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Load_store_unit_transition.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Load_store_unit_transition.cpp	(revision 71)
@@ -28,10 +28,6 @@
     (this->*function_transition) ();
 
-#ifdef STATISTICS
-    _stat->add();
-#endif    
-
-#ifdef VHDL_TESTBENCH
-    vhdl_testbench_transition ();
+#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
+    end_cycle ();
 #endif
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Load_store_unit_vhdl_testbench_transition.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Load_store_unit_vhdl_testbench_transition.cpp	(revision 70)
+++ 	(revision )
@@ -1,44 +1,0 @@
-#ifdef VHDL_TESTBENCH
-/*
- * $Id$
- *
- * [ Description ]
- * 
- */
-
-#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Load_store_unit.h"
-
-namespace morpheo                    {
-namespace behavioural {
-namespace core {
-namespace multi_execute_loop {
-namespace execute_loop {
-namespace multi_execute_unit {
-namespace execute_unit {
-namespace load_store_unit {
-
-
-#undef  FUNCTION
-#define FUNCTION "Load_store_unit::vhdl_testbench_transition"
-  void Load_store_unit::vhdl_testbench_transition ()
-  {
-    log_printf(FUNC,Load_store_unit,FUNCTION,"Begin");
-
-    // Evaluation before read the ouput signal
-//     sc_start(0);
-
-    _interfaces->testbench();
-
-    log_printf(FUNC,Load_store_unit,FUNCTION,"End");
-  };
-
-}; // 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
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Parameters.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Parameters.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Parameters.cpp	(revision 71)
@@ -22,8 +22,10 @@
   Parameters::Parameters (uint32_t            size_store_queue       ,
 			  uint32_t            size_load_queue        ,
+			  uint32_t            size_speculative_access_queue,
 			  uint32_t            nb_port_check          ,
-			  uint32_t            size_speculative_access_queue,
 			  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      ,
@@ -38,4 +40,6 @@
     _speculative_load        (speculative_load       ),
     _nb_context              (nb_context             ),
+    _nb_front_end            (nb_front_end           ),
+    _nb_ooo_engine           (nb_ooo_engine          ),
     _nb_packet               (nb_packet              ),
     _size_general_data       (size_general_data      ),
@@ -44,13 +48,26 @@
     _nb_type                 (nb_type                ),
     
-    _size_address_store_queue              (static_cast<uint32_t>(ceil(log2(size_store_queue             )))),
-    _size_address_load_queue               (static_cast<uint32_t>(ceil(log2(size_load_queue              )))),
-    _size_address_speculative_access_queue (static_cast<uint32_t>(ceil(log2(size_speculative_access_queue)))),
+    _size_address_store_queue              (log2(size_store_queue             )),
+    _size_address_load_queue               (log2(size_load_queue              )),
+    _size_address_speculative_access_queue (log2(size_speculative_access_queue)),
 
-    _size_context_id         (static_cast<uint32_t>(ceil(log2(nb_context         )))),
-    _size_packet_id          (static_cast<uint32_t>(ceil(log2(nb_packet          )))),
-    _size_general_register   (static_cast<uint32_t>(ceil(log2(nb_general_register)))),
-    _size_operation          (static_cast<uint32_t>(ceil(log2(nb_operation       )))),
-    _size_type               (static_cast<uint32_t>(ceil(log2(nb_type            ))))  
+    _size_context_id         (log2(nb_context         )),
+    _size_front_end_id       (log2(nb_front_end       )),
+    _size_ooo_engine_id      (log2(nb_ooo_engine      )),
+    _size_packet_id          (log2(nb_packet          )),
+    _size_general_register   (log2(nb_general_register)),
+    _size_operation          (log2(nb_operation       )),
+    _size_type               (log2(nb_type            )),
+    _size_dcache_context_id  (_size_context_id + _size_front_end_id + _size_ooo_engine_id),
+    _size_dcache_packet_id   ((log2((size_store_queue>size_load_queue)?size_store_queue:size_load_queue))+1),
+
+    _have_port_context_id        (_size_context_id   >0),
+    _have_port_front_end_id      (_size_front_end_id >0),
+    _have_port_ooo_engine_id     (_size_ooo_engine_id>0),
+    _have_port_packet_id         (_size_packet_id    >0),
+    _have_port_dcache_context_id (_size_dcache_context_id>0),
+
+    _mask_address_lsb            (gen_mask<Tdcache_address_t>(log2(size_general_data/8))),
+    _mask_address_msb            (gen_mask<Tdcache_address_t>(size_general_data) << log2(size_general_data/8))
   {
     log_printf(FUNC,Load_store_unit,FUNCTION,"Begin");
@@ -68,4 +85,6 @@
     _speculative_load        (param._speculative_load       ),
     _nb_context              (param._nb_context             ),
+    _nb_front_end            (param._nb_front_end           ),
+    _nb_ooo_engine           (param._nb_ooo_engine          ),
     _nb_packet               (param._nb_packet              ),
     _size_general_data       (param._size_general_data      ),
@@ -78,9 +97,23 @@
     _size_address_speculative_access_queue (param._size_address_speculative_access_queue),
 
-    _size_context_id         (param._nb_context             ),
-    _size_packet_id          (param._nb_packet              ),
-    _size_general_register   (param._nb_general_register    ),
-    _size_operation          (param._nb_operation           ),
-    _size_type               (param._nb_type                )
+    _size_context_id         (param._size_context_id        ),
+    _size_front_end_id       (param._size_front_end_id      ),
+    _size_ooo_engine_id      (param._size_ooo_engine_id     ),
+    _size_packet_id          (param._size_packet_id         ),
+    _size_general_register   (param._size_general_register  ),
+    _size_operation          (param._size_operation         ),
+    _size_type               (param._size_type              ),
+    _size_dcache_context_id  (param._size_dcache_context_id ),
+    _size_dcache_packet_id   (param._size_dcache_packet_id  ),
+
+    _have_port_context_id    (param._have_port_context_id   ),
+    _have_port_front_end_id  (param._have_port_front_end_id ),
+    _have_port_ooo_engine_id (param._have_port_ooo_engine_id),
+    _have_port_packet_id     (param._have_port_packet_id    ),
+
+    _have_port_dcache_context_id(param._have_port_dcache_context_id),
+
+    _mask_address_lsb        (param._mask_address_lsb),
+    _mask_address_msb        (param._mask_address_msb)
   {
     log_printf(FUNC,Load_store_unit,FUNCTION,"Begin");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Parameters_msg_error.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Parameters_msg_error.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Parameters_msg_error.cpp	(revision 71)
@@ -8,5 +8,4 @@
 #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Parameters.h"
 #include <sstream>
-using namespace std;
 
 namespace morpheo                    {
@@ -22,9 +21,9 @@
 #undef  FUNCTION
 #define FUNCTION "Load_store_unit::msg_error"
-  string Parameters::msg_error(void)
+  std::string Parameters::msg_error(void)
   {
     log_printf(FUNC,Load_store_unit,FUNCTION,"Begin");
     
-    string msg = "";
+    std::string msg = "";
 
     switch (_speculative_load)
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Parameters_print.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Parameters_print.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Parameters_print.cpp	(revision 71)
@@ -8,5 +8,4 @@
 #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Parameters.h"
 #include "Behavioural/include/XML.h"
-using namespace std;
 
 namespace morpheo                    {
@@ -22,5 +21,5 @@
 #undef  FUNCTION
 #define FUNCTION "Load_store_unit::print"
-  string Parameters::print (uint32_t depth)
+  std::string Parameters::print (uint32_t depth)
   {
     log_printf(FUNC,Load_store_unit,FUNCTION,"Begin");
@@ -29,15 +28,17 @@
 
     xml.balise_open("load_store_unit");
-    xml.singleton_begin("size_store_queue       "); xml.attribut("value",toString(_size_store_queue       )); xml.singleton_end();
-    xml.singleton_begin("size_load_queue        "); xml.attribut("value",toString(_size_load_queue        )); xml.singleton_end();
+    xml.singleton_begin("size_store_queue             "); xml.attribut("value",toString(_size_store_queue             )); xml.singleton_end();
+    xml.singleton_begin("size_load_queue              "); xml.attribut("value",toString(_size_load_queue              )); xml.singleton_end();
     xml.singleton_begin("size_speculative_access_queue"); xml.attribut("value",toString(_size_speculative_access_queue)); xml.singleton_end();
-    xml.singleton_begin("nb_port_check          "); xml.attribut("value",toString(_nb_port_check          )); xml.singleton_end();
-    xml.singleton_begin("speculative_load       "); xml.attribut("value",toString(_speculative_load       )); xml.singleton_end();
-    xml.singleton_begin("nb_context             "); xml.attribut("value",toString(_nb_context             )); xml.singleton_end();
-    xml.singleton_begin("nb_packet              "); xml.attribut("value",toString(_nb_packet              )); xml.singleton_end();
-    xml.singleton_begin("size_general_data      "); xml.attribut("value",toString(_size_general_data      )); xml.singleton_end();
-    xml.singleton_begin("nb_general_register    "); xml.attribut("value",toString(_nb_general_register    )); xml.singleton_end();
-    xml.singleton_begin("nb_operation           "); xml.attribut("value",toString(_nb_operation           )); xml.singleton_end();
-    xml.singleton_begin("nb_type                "); xml.attribut("value",toString(_nb_type                )); xml.singleton_end();
+    xml.singleton_begin("nb_port_check                "); xml.attribut("value",toString(_nb_port_check                )); xml.singleton_end();
+    xml.singleton_begin("speculative_load             "); xml.attribut("value",toString(_speculative_load             )); xml.singleton_end();
+    xml.singleton_begin("nb_context                   "); xml.attribut("value",toString(_nb_context                   )); xml.singleton_end();
+    xml.singleton_begin("nb_front_end                 "); xml.attribut("value",toString(_nb_front_end                 )); xml.singleton_end();
+    xml.singleton_begin("nb_ooo_engine                "); xml.attribut("value",toString(_nb_ooo_engine                )); xml.singleton_end();
+    xml.singleton_begin("nb_packet                    "); xml.attribut("value",toString(_nb_packet                    )); xml.singleton_end();
+    xml.singleton_begin("size_general_data            "); xml.attribut("value",toString(_size_general_data            )); xml.singleton_end();
+    xml.singleton_begin("nb_general_register          "); xml.attribut("value",toString(_nb_general_register          )); xml.singleton_end();
+    xml.singleton_begin("nb_operation                 "); xml.attribut("value",toString(_nb_operation                 )); xml.singleton_end();
+    xml.singleton_begin("nb_type                      "); xml.attribut("value",toString(_nb_type                      )); xml.singleton_end();
     xml.balise_close();
 
@@ -49,5 +50,5 @@
 #undef  FUNCTION
 #define FUNCTION "Load_store_unit::operator<<"
-  ostream& operator<< (ostream& output_stream ,
+  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/src/Statistics.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Statistics.cpp	(revision 70)
+++ 	(revision )
@@ -1,52 +1,0 @@
-#ifdef STATISTICS
-/*
- * $Id$
- *
- * [ Description ]
- * 
- */
-
-#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Statistics.h"
-
-namespace morpheo                    {
-namespace behavioural {
-namespace core {
-namespace multi_execute_loop {
-namespace execute_loop {
-namespace multi_execute_unit {
-namespace execute_unit {
-namespace load_store_unit {
-
-
-#undef  FUNCTION
-#define FUNCTION "Load_store_unit::Statistics"
-  Statistics::Statistics (string                                        name                       ,
-			  morpheo::behavioural::Parameters_Statistics * parameters_statistics      ,
-			  Parameters                                  * parameters
-			  ) :
-    morpheo::behavioural::Statistics(name                  ,
-				     parameters_statistics ),
-    _parameters(parameters)
-  {
-    log_printf(FUNC,Load_store_unit,FUNCTION,"Begin");
-    log_printf(FUNC,Load_store_unit,FUNCTION,"End");
-  };
-  
-#undef  FUNCTION
-#define FUNCTION "Load_store_unit::~Statistics"
-  Statistics::~Statistics () 
-  { 
-    log_printf(FUNC,Load_store_unit,FUNCTION,"Begin");
-    log_printf(FUNC,Load_store_unit,FUNCTION,"End");
-  };
-
-}; // 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
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Statistics_add.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Statistics_add.cpp	(revision 70)
+++ 	(revision )
@@ -1,41 +1,0 @@
-#ifdef STATISTICS
-/*
- * $Id$
- *
- * [ Description ]
- * 
- */
-
-#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Statistics.h"
-
-#include <sstream>
-using namespace std;
-
-namespace morpheo                    {
-namespace behavioural {
-namespace core {
-namespace multi_execute_loop {
-namespace execute_loop {
-namespace multi_execute_unit {
-namespace execute_unit {
-namespace load_store_unit {
-
-
-#undef  FUNCTION
-#define FUNCTION "Load_store_unit::add"
-  void Statistics::add ()
-  {
-    log_printf(FUNC,Load_store_unit,FUNCTION,"Begin");
-    log_printf(FUNC,Load_store_unit,FUNCTION,"End");
-  };
-
-}; // 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
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Statistics_print.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Statistics_print.cpp	(revision 70)
+++ 	(revision )
@@ -1,65 +1,0 @@
-#ifdef STATISTICS
-/*
- * $Id$
- *
- * [ Description ]
- * 
- */
-
-#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Statistics.h"
-
-#include <sstream>
-using namespace std;
-
-namespace morpheo {
-namespace behavioural {
-namespace core {
-namespace multi_execute_loop {
-namespace execute_loop {
-namespace multi_execute_unit {
-namespace execute_unit {
-namespace load_store_unit {
-
-
-#undef  FUNCTION
-#define FUNCTION "Load_store_unit::print"
-  string Statistics::print (uint32_t depth)
-  {
-    log_printf(FUNC,Load_store_unit,FUNCTION,"Begin");
-
-    string        tab = string(depth,'\t');
-    ostringstream msg;
-
-    msg << tab << "<load_store_unit name=\"" << _name << "\" >" << endl
-        << print_body(depth+1) << endl
-	<< tab << "</load_store_unit>" << endl;
-    
-    log_printf(FUNC,Load_store_unit,FUNCTION,"End");
-
-    return msg.str();
-  };
-
-#undef  FUNCTION
-#define FUNCTION "Load_store_unit::operator<<"
-  ostream& operator<< (ostream& output_stream ,
-		       morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::Statistics & x)
-  {
-    log_printf(FUNC,Load_store_unit,FUNCTION,"Begin");
-
-    output_stream << x.print(0);
-
-    log_printf(FUNC,Load_store_unit,FUNCTION,"End");
-
-    return output_stream;
-  };
-
-}; // 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
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Statistics_print_body.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Statistics_print_body.cpp	(revision 70)
+++ 	(revision )
@@ -1,49 +1,0 @@
-#ifdef STATISTICS
-/*
- * $Id$
- *
- * [ Description ]
- * 
- */
-
-#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Statistics.h"
-
-#include <sstream>
-using namespace std;
-
-namespace morpheo                    {
-namespace behavioural {
-namespace core {
-namespace multi_execute_loop {
-namespace execute_loop {
-namespace multi_execute_unit {
-namespace execute_unit {
-namespace load_store_unit {
-
-
-#undef  FUNCTION
-#define FUNCTION "Load_store_unit::print_body"
-  string Statistics::print_body (uint32_t depth)
-  {
-    log_printf(FUNC,Load_store_unit,FUNCTION,"Begin");
-
-    string        tab = string(depth,'\t');
-    ostringstream msg;
-
-    msg << tab << "";
-    
-    log_printf(FUNC,Load_store_unit,FUNCTION,"End");
-
-    return msg.str();
-  };
-
-}; // 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
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/SelfTest/configuration_min.cfg
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/SelfTest/configuration_min.cfg	(revision 70)
+++ 	(revision )
@@ -1,17 +1,0 @@
-Reservation_station
-1	16	*2	# size_queue    
-1	1	*4	# nb_inst_retire
-1	1	*4	# nb_context         
-1	1	*4	# nb_front_end       
-1	1	*4	# nb_ooo_engine
-256	256	*2	# nb_packet          
-16	16	+1	# size_general_data  
-16	16	+1	# size_special_data  
-8	8	*2	# nb_general_register
-8	8	+1	# nb_special_register
-4	4	+1	# nb_operation       
-4	4	+1	# nb_type            
-1	1	*2	# nb_gpr_write
-1	1	*2	# nb_spr_write
-0	0	*2	# nb_bypass_write 
-0	0	*2	# nb_bypass_memory
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/SelfTest/configuration_multi_port_bypass_memory.cfg
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/SelfTest/configuration_multi_port_bypass_memory.cfg	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/SelfTest/configuration_multi_port_bypass_memory.cfg	(revision 71)
@@ -6,8 +6,8 @@
 4	4	*4	# nb_ooo_engine
 64 	64 	*2	# nb_packet          
-16	16	+1	# size_general_data  
-16	16	+1	# size_special_data  
-8 	8 	*2	# nb_general_register
-8 	8 	+1	# nb_special_register
+32	32	+1	# size_general_data  
+2 	2 	+1	# size_special_data  
+256	256	*2	# nb_general_register
+32	32	+1	# nb_special_register
 8	8	+1	# nb_operation       
 4	4	+1	# nb_type            
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/SelfTest/configuration_multi_port_bypass_write.cfg
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/SelfTest/configuration_multi_port_bypass_write.cfg	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/SelfTest/configuration_multi_port_bypass_write.cfg	(revision 71)
@@ -6,8 +6,8 @@
 4	4	*4	# nb_ooo_engine
 64 	64 	*2	# nb_packet          
-16	16	+1	# size_general_data  
-16	16	+1	# size_special_data  
-8 	8 	*2	# nb_general_register
-8 	8 	+1	# nb_special_register
+32	32	+1	# size_general_data  
+2 	2 	+1	# size_special_data  
+256	256	*2	# nb_general_register
+32	32	+1	# nb_special_register
 8	8	+1	# nb_operation       
 4	4	+1	# nb_type            
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/SelfTest/configuration_multi_port_retire2.cfg
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/SelfTest/configuration_multi_port_retire2.cfg	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/SelfTest/configuration_multi_port_retire2.cfg	(revision 71)
@@ -6,8 +6,8 @@
 4	4	*4	# nb_ooo_engine
 64 	64 	*2	# nb_packet          
-16	16	+1	# size_general_data  
-16	16	+1	# size_special_data  
-8 	8 	*2	# nb_general_register
-8 	8 	+1	# nb_special_register
+32	32	+1	# size_general_data  
+2 	2 	+1	# size_special_data  
+256	256	*2	# nb_general_register
+32	32	+1	# nb_special_register
 8	8	+1	# nb_operation       
 4	4	+1	# nb_type            
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/SelfTest/configuration_multi_port_retire4.cfg
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/SelfTest/configuration_multi_port_retire4.cfg	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/SelfTest/configuration_multi_port_retire4.cfg	(revision 71)
@@ -6,8 +6,8 @@
 4	4	*4	# nb_ooo_engine
 64 	64 	*2	# nb_packet          
-16	16	+1	# size_general_data  
-16	16	+1	# size_special_data  
-8 	8 	*2	# nb_general_register
-8 	8 	+1	# nb_special_register
+32	32	+1	# size_general_data  
+2 	2 	+1	# size_special_data  
+256	256	*2	# nb_general_register
+32	32	+1	# nb_special_register
 8	8	+1	# nb_operation       
 4	4	+1	# nb_type            
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/SelfTest/configuration_multi_port_write.cfg
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/SelfTest/configuration_multi_port_write.cfg	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/SelfTest/configuration_multi_port_write.cfg	(revision 71)
@@ -6,8 +6,8 @@
 4	4	*4	# nb_ooo_engine
 64 	64 	*2	# nb_packet          
-16	16	+1	# size_general_data  
-16	16	+1	# size_special_data  
-8 	8 	*2	# nb_general_register
-8 	8 	+1	# nb_special_register
+32	32	+1	# size_general_data  
+2 	2 	+1	# size_special_data  
+256	256	*2	# nb_general_register
+32	32	+1	# nb_special_register
 8	8	+1	# nb_operation       
 4	4	+1	# nb_type            
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/SelfTest/src/test.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/SelfTest/src/test.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/SelfTest/src/test.cpp	(revision 71)
@@ -32,7 +32,11 @@
       exit (EXIT_FAILURE);
     }
+#ifdef STATISTICS
+  morpheo::behavioural::Parameters_Statistics * param_stat = new morpheo::behavioural::Parameters_Statistics (5,50);
+#endif
+
   Counter * _Counter = new Counter (name.c_str(),
 #ifdef STATISTICS
-				    morpheo::behavioural::Parameters_Statistics(5,50),
+				    param_stat,
 #endif
 				    param);
@@ -119,5 +123,5 @@
 	  TEST(Tdata_t,DATA_OUT [i].read(),data_out [i]);
 	   
-	  cout << dec << endl;
+	  cout << std::dec << endl;
 	}
       
@@ -136,3 +140,7 @@
 
   delete _Counter;
+#ifdef STATISTICS
+  delete param_stat;
+#endif
+
 }
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/include/Counter.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/include/Counter.h	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/include/Counter.h	(revision 71)
@@ -20,5 +20,5 @@
 #include "Behavioural/Generic/Counter/include/Types.h"
 #ifdef STATISTICS
-#include "Behavioural/Generic/Counter/include/Statistics.h"
+#include "Behavioural/include/Stat.h"
 #endif
 #ifdef VHDL
@@ -44,10 +44,7 @@
 
   protected : const Parameters _param;
-//#ifdef STATISTICS
-//  protected : const morpheo::behavioural::Parameters_Statistics _param_statistics;
-//#endif
 
 #ifdef STATISTICS
-  private   : Statistics                     * _stat;
+  private   : Stat                           * _stat;
 #endif
 
@@ -81,5 +78,5 @@
 #endif					       
 #ifdef STATISTICS
-					   morpheo::behavioural::Parameters_Statistics param_statistics,
+					   morpheo::behavioural::Parameters_Statistics * param_statistics,
 #endif
 					   Parameters                                  param );
@@ -98,5 +95,6 @@
 #endif					       
 #ifdef STATISTICS
-  public  : string   statistics                (uint32_t depth);
+  public  : void     statistics_declaration    (morpheo::behavioural::Parameters_Statistics * param_statistics);
+  public  : string   statistics_print          (uint32_t depth);
 #endif
 					       
@@ -108,6 +106,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/Generic/Counter/include/Statistics.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/include/Statistics.h	(revision 70)
+++ 	(revision )
@@ -1,55 +1,0 @@
-#ifdef STATISTICS
-#ifndef morpheo_behavioural_generic_counter_Statistics_h
-#define morpheo_behavioural_generic_counter_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/Generic/Counter/include/Parameters.h"
-
-//using namespace morpheo::behavioural::generic::group;
-
-namespace morpheo                    {
-namespace behavioural {
-namespace generic {
-namespace counter {
-
-
-  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 counter
-}; // end namespace generic
-
-}; // end namespace behavioural
-}; // end namespace morpheo
-
-#endif
-#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter.cpp	(revision 71)
@@ -20,12 +20,9 @@
 #endif
 #ifdef STATISTICS
-			      morpheo::behavioural::Parameters_Statistics             param_statistics,
+			      morpheo::behavioural::Parameters_Statistics * param_statistics,
 #endif
 			      morpheo::behavioural::generic::counter::Parameters param ):
 			      _name              (name)
 			      ,_param            (param)
-// #ifdef STATISTICS
-// 			      ,_param_statistics (param_statistics)
-// #endif
   {
     log_printf(FUNC,Counter,"Counter","Begin");
@@ -37,7 +34,5 @@
 #ifdef STATISTICS
     // Allocation of statistics
-    _stat = new Statistics (static_cast<string>(_name),
-			    param_statistics          ,
-			    param);
+    statistics_declaration(param_statistics);
 #endif
 
@@ -82,6 +77,4 @@
 
 #ifdef STATISTICS
-    _stat->generate_file(statistics(0));
-    
     delete _stat;
 #endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter_end_cycle.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter_end_cycle.cpp	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter_end_cycle.cpp	(revision 71)
@@ -0,0 +1,38 @@
+#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Generic/Counter/include/Counter.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace generic {
+namespace counter {
+
+
+  void Counter::end_cycle ()
+  {
+    log_printf(FUNC,Counter,"end_cycle","Begin");
+
+#ifdef STATISTICS
+    _stat->end_cycle();
+#endif    
+
+#ifdef VHDL_TESTBENCH
+    // Evaluation before read the ouput signal
+//  sc_start(0);
+    _interfaces->testbench();
+#endif
+
+    log_printf(FUNC,Counter,"end_cycle","End");
+  };
+
+}; // end namespace counter
+}; // end namespace generic
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter_statistics.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter_statistics.cpp	(revision 70)
+++ 	(revision )
@@ -1,32 +1,0 @@
-#ifdef STATISTICS
-/*
- * $Id$
- *
- * [ Description ]
- * 
- */
-
-#include "Behavioural/Generic/Counter/include/Counter.h"
-
-namespace morpheo                    {
-namespace behavioural {
-namespace generic {
-namespace counter {
-
-  string Counter::statistics (uint32_t depth)
-  {
-    log_printf(FUNC,Counter,"statistics","Begin");
-
-    string txt = _stat->print(depth);
-
-    log_printf(FUNC,Counter,"statistics","End");
-
-    return txt;
-  };
-
-}; // end namespace counter
-}; // end namespace generic
-
-}; // end namespace behavioural
-}; // end namespace morpheo              
-#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter_statistics_declaration.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter_statistics_declaration.cpp	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter_statistics_declaration.cpp	(revision 71)
@@ -0,0 +1,34 @@
+#ifdef STATISTICS
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Generic/Counter/include/Counter.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace generic {
+namespace counter {
+
+#undef  FUNCTION
+#define FUNCTION "Counter::statistics_declaration"
+  void Counter::statistics_declaration (morpheo::behavioural::Parameters_Statistics * param_statistics)
+  {
+    log_printf(FUNC,Counter,FUNCTION,"Begin");
+
+    _stat = new Stat (static_cast<string>(_name),
+		      "Counter",
+		      param_statistics);
+    
+    log_printf(FUNC,Counter,FUNCTION,"End");
+  };
+
+}; // end namespace counter
+}; // end namespace generic
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter_statistics_print.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter_statistics_print.cpp	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter_statistics_print.cpp	(revision 71)
@@ -0,0 +1,34 @@
+#ifdef STATISTICS
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Generic/Counter/include/Counter.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace generic {
+namespace counter {
+
+#undef  FUNCTION
+#define FUNCTION "Counter::statistics_print"
+  string Counter::statistics_print (uint32_t depth)
+  {
+    log_printf(FUNC,Counter,FUNCTION,"Begin");
+
+    string txt = _stat->print(depth);
+    
+    log_printf(FUNC,Counter,FUNCTION,"End");
+
+    return txt;
+  };
+
+}; // end namespace counter
+}; // end namespace generic
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter_transition.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter_transition.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter_transition.cpp	(revision 71)
@@ -20,11 +20,5 @@
     log_printf(FUNC,Counter,"transition","Begin");
 
-#ifdef STATISTICS
-    _stat->add();
-#endif    
-
-#ifdef VHDL_TESTBENCH
-    vhdl_testbench_transition ();
-#endif
+    end_cycle();
 
     log_printf(FUNC,Counter,"transition","End");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter_vhdl_testbench_transition.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter_vhdl_testbench_transition.cpp	(revision 70)
+++ 	(revision )
@@ -1,33 +1,0 @@
-#ifdef VHDL_TESTBENCH
-/*
- * $Id$
- *
- * [ Description ]
- * 
- */
-
-#include "Behavioural/Generic/Counter/include/Counter.h"
-
-namespace morpheo                    {
-namespace behavioural {
-namespace generic {
-namespace counter {
-
-
-  void Counter::vhdl_testbench_transition ()
-  {
-    log_printf(FUNC,Counter,"vhdl_testbench_transition","Begin");
-
-//     sc_start(0);
-
-    _interfaces->testbench();
-
-    log_printf(FUNC,Counter,"vhdl_testbench_transition","End");
-  };
-
-}; // end namespace counter
-}; // end namespace generic
-
-}; // end namespace behavioural
-}; // end namespace morpheo              
-#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Statistics.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Statistics.cpp	(revision 70)
+++ 	(revision )
@@ -1,40 +1,0 @@
-#ifdef STATISTICS
-/*
- * $Id$
- *
- * [ Description ]
- * 
- */
-
-#include "Behavioural/Generic/Counter/include/Statistics.h"
-
-namespace morpheo                    {
-namespace behavioural {
-namespace generic {
-namespace counter {
-
-
-  Statistics::Statistics (string                                      name                       ,
-			  morpheo::behavioural::Parameters_Statistics parameters_statistics      ,
-			  Parameters                                  parameters
-			  ) :
-    morpheo::behavioural::Statistics(name                  ,
-				     parameters_statistics ),
-    _parameters(parameters)
-  {
-    log_printf(FUNC,Counter,"Statistics","Begin");
-    log_printf(FUNC,Counter,"Statistics","End");
-  };
-  
-  Statistics::~Statistics () 
-  { 
-    log_printf(FUNC,Counter,"~Statistics","Begin");
-    log_printf(FUNC,Counter,"~Statistics","End");
-  };
-
-}; // end namespace counter
-}; // end namespace generic
-
-}; // end namespace behavioural
-}; // end namespace morpheo              
-#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Statistics_add.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Statistics_add.cpp	(revision 70)
+++ 	(revision )
@@ -1,31 +1,0 @@
-#ifdef STATISTICS
-/*
- * $Id$
- *
- * [ Description ]
- * 
- */
-
-#include "Behavioural/Generic/Counter/include/Statistics.h"
-
-#include <sstream>
-using namespace std;
-
-namespace morpheo                    {
-namespace behavioural {
-namespace generic {
-namespace counter {
-
-
-  void Statistics::add ()
-  {
-    log_printf(FUNC,Counter,"add","Begin");
-    log_printf(FUNC,Counter,"add","End");
-  };
-
-}; // end namespace counter
-}; // end namespace generic
-
-}; // end namespace behavioural
-}; // end namespace morpheo              
-#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Statistics_print.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Statistics_print.cpp	(revision 70)
+++ 	(revision )
@@ -1,49 +1,0 @@
-#ifdef STATISTICS
-/*
- * $Id$
- *
- * [ Description ]
- * 
- */
-
-#include "Behavioural/Generic/Counter/include/Statistics.h"
-
-#include <sstream>
-using namespace std;
-
-namespace morpheo {
-namespace behavioural {
-namespace generic {
-namespace counter {
-
-
-  string Statistics::print (uint32_t depth)
-  {
-    log_printf(FUNC,Counter,"print","Begin");
-
-    string        tab = string(depth,'\t');
-    ostringstream msg;
-
-    msg << tab << "<counter name=\"" << _name << "\" >" << endl
-        << print_body(depth+1)
-	<< tab << "</counter>" << endl;
-    
-    log_printf(FUNC,Counter,"print","End");
-
-    return msg.str();
-  };
-
-  ostream& operator<< (ostream& output_stream ,
-		       morpheo::behavioural::generic::counter::Statistics & x)
-  {
-    output_stream << x.print(0);
-
-    return output_stream;
-  };
-
-}; // end namespace counter
-}; // end namespace generic
-
-}; // end namespace behavioural
-}; // end namespace morpheo              
-#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Statistics_print_body.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Statistics_print_body.cpp	(revision 70)
+++ 	(revision )
@@ -1,39 +1,0 @@
-#ifdef STATISTICS
-/*
- * $Id$
- *
- * [ Description ]
- * 
- */
-
-#include "Behavioural/Generic/Counter/include/Statistics.h"
-
-#include <sstream>
-using namespace std;
-
-namespace morpheo                    {
-namespace behavioural {
-namespace generic {
-namespace counter {
-
-
-  string Statistics::print_body (uint32_t depth)
-  {
-    log_printf(FUNC,Counter,"print_body","Begin");
-
-    string        tab = string(depth,'\t');
-    ostringstream msg;
-
-    msg << tab << "";
-    
-    log_printf(FUNC,Counter,"print_body","End");
-
-    return msg.str();
-  };
-
-}; // end namespace counter
-}; // end namespace generic
-
-}; // end namespace behavioural
-}; // end namespace morpheo              
-#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/Makefile.deps
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/Makefile.deps	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/Makefile.deps	(revision 71)
@@ -13,15 +13,10 @@
 include 			$(DIR_MORPHEO)/Behavioural/Makefile.deps
 endif
-ifndef Group
-include 			$(DIR_MORPHEO)/Behavioural/Generic/Group/Makefile.deps
-endif
 
 #-----[ Library ]------------------------------------------
 RegisterFile_Monolithic_LIBRARY		= 	-lRegisterFile_Monolithic		\
-					$(Group_LIBRARY)	\
 					$(Behavioural_LIBRARY)	
 
 RegisterFile_Monolithic_DIR_LIBRARY	=	-L$(DIR_MORPHEO)/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/lib	\
-					$(Group_DIR_LIBRARY)					\
 					$(Behavioural_DIR_LIBRARY)	
 
@@ -31,5 +26,4 @@
 				@\
 				$(MAKE)  Behavioural_library; \
-				$(MAKE)  Group_library; \
 				$(MAKE) --directory=$(DIR_MORPHEO)/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic --makefile=Makefile;
 	
@@ -37,4 +31,3 @@
 				@\
 				$(MAKE)  Behavioural_library_clean; \
-				$(MAKE)  Group_library_clean; \
 				$(MAKE) --directory=$(DIR_MORPHEO)/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic --makefile=Makefile clean;
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/SelfTest/src/test.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/SelfTest/src/test.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/SelfTest/src/test.cpp	(revision 71)
@@ -34,5 +34,5 @@
 
 #ifdef STATISTICS
-  morpheo::behavioural::Parameters_Statistics * _param_stat = new morpheo::behavioural::Parameters_Statistics (5,1000);
+  morpheo::behavioural::Parameters_Statistics * _param_stat = new morpheo::behavioural::Parameters_Statistics (5,100);
 #endif
   RegisterFile_Monolithic * registerfile = new RegisterFile_Monolithic (name.c_str()
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/RegisterFile_Monolithic.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/RegisterFile_Monolithic.h	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/RegisterFile_Monolithic.h	(revision 71)
@@ -21,5 +21,5 @@
 #include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/Types.h"
 #ifdef STATISTICS
-#include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/Statistics.h"
+#include "Behavioural/include/Stat.h"
 #endif
 #include "Behavioural/include/Component.h"
@@ -51,8 +51,12 @@
 
 #ifdef STATISTICS
-  private   : Statistics                     * _stat;
+  private   : Stat                           * _stat;
     
-  private   : uint32_t                         _stat_nb_read;
-  private   : uint32_t                         _stat_nb_write;
+  private   : counter_t                      * _stat_nb_read;
+  private   : counter_t                      * _stat_nb_write;
+  private   : counter_t                      * _stat_average_read ;
+  private   : counter_t                      * _stat_average_write;
+  private   : counter_t                      * _stat_percent_use_read ;
+  private   : counter_t                      * _stat_percent_use_write;
 #endif
 
@@ -123,6 +127,8 @@
 
 #ifdef STATISTICS
-  public  : string  statistics                 (uint32_t depth);
+  public  : void     statistics_declaration    (morpheo::behavioural::Parameters_Statistics * param_statistics);
+  public  : string   statistics_print          (uint32_t depth);
 #endif					       
+
 #if VHDL				       
   private : void     vhdl                      (void);
@@ -131,7 +137,5 @@
 #endif					       
 					       
-#ifdef VHDL_TESTBENCH			       
-  private : void     vhdl_testbench_transition (void);
-#endif
+  private : void     end_cycle                 (void);
 
   };
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/Statistics.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/Statistics.h	(revision 70)
+++ 	(revision )
@@ -1,60 +1,0 @@
-#ifdef STATISTICS
-#ifndef morpheo_behavioural_generic_registerfile_registerfile_monolithic_Statistics_h
-#define morpheo_behavioural_generic_registerfile_registerfile_monolithic_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/Generic/RegisterFile/RegisterFile_Monolithic/include/Parameters.h"
-
-using namespace morpheo::behavioural::generic::group;
-
-namespace morpheo                    {
-namespace behavioural                {
-namespace generic                    {
-namespace registerfile               {
-namespace registerfile_monolithic    {
-
-  class Statistics : public morpheo::behavioural::Statistics
-  {
-    // -----[ fields ]----------------------------------------------------
-  private  : const Parameters                                 * _parameters;
-  private  : morpheo::behavioural::generic::group::Parameters * _param_port_read;
-  private  : morpheo::behavioural::generic::group::Parameters * _param_port_write;
-  private  : morpheo::behavioural::generic::group::Statistics * _stat_port_read;
-  private  : morpheo::behavioural::generic::group::Statistics * _stat_port_write;
-
-    // -----[ 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        (uint32_t nb_read,
-				  uint32_t nb_write);
-
-  public   : friend ostream& operator<< (ostream& output_stream,
-					 const Statistics & x);
-
-  };
-
-}; // end namespace registerfile_monolithic
-}; // end namespace registerfile 
-}; // end namespace generic
-}; // end namespace behavioural
-}; // end namespace morpheo
-
-#endif
-#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic.cpp	(revision 71)
@@ -37,7 +37,5 @@
 
 #ifdef STATISTICS
-    _stat = new Statistics (static_cast<string>(_name),
-			    param_statistics          ,
-			    param);
+    statistics_declaration(param_statistics);
 #endif
 
@@ -71,5 +69,5 @@
 	  }
 	
-#  ifdef SYSTEMCASS_SPECIFIC
+# ifdef SYSTEMCASS_SPECIFIC
 	// List dependency information
 	for (uint32_t i=0; i<_param->_nb_port_read; i++)
@@ -86,5 +84,5 @@
 	      (*(out_READ_WRITE_RDATA [i])) (*( in_READ_WRITE_ADDRESS [i]));
 	  }
-#  endif    
+# endif    
 	
 	for (uint32_t i=0; i<_param->_nb_port_read       ; i++)
@@ -105,5 +103,4 @@
     if (_usage & USE_STATISTICS)
       {
-	_stat->generate_file(statistics(0));
 	delete _stat;
       }
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_end_cycle.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_end_cycle.cpp	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_end_cycle.cpp	(revision 71)
@@ -0,0 +1,38 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/RegisterFile_Monolithic.h"
+
+namespace morpheo                    {
+namespace behavioural                {
+namespace generic                    {
+namespace registerfile               {
+namespace registerfile_monolithic    {
+
+  void RegisterFile_Monolithic::end_cycle (void)
+  {
+    log_printf(FUNC,RegisterFile,"end_cycle","Begin");
+
+#ifdef STATISTICS
+    _stat->end_cycle();
+#endif    
+
+#ifdef VHDL_TESTBENCH
+    // Evaluation before read the ouput signal
+    
+//  sc_start(0);
+    _interfaces->testbench();
+#endif
+
+    log_printf(FUNC,RegisterFile,"end_cycle","End");
+  };
+
+}; // end namespace registerfile_monolithic
+}; // end namespace registerfile 
+}; // end namespace generic
+}; // end namespace behavioural          
+}; // end namespace morpheo              
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_genMealy_read.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_genMealy_read.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_genMealy_read.cpp	(revision 71)
@@ -19,8 +19,4 @@
     log_printf(FUNC,RegisterFile,"genMealy_read","Begin");
 
-#ifdef STATISTICS
-    _stat_nb_read = 0;
-#endif    
-
     for (uint32_t i=0; i<_param->_nb_port_read; i++)
       {
@@ -38,5 +34,5 @@
 
 #ifdef STATISTICS
-	    _stat_nb_read ++;
+	    (*_stat_nb_read) ++;
 #endif    
 	    // Write in registerFile
@@ -68,10 +64,4 @@
 
 	    log_printf(TRACE,RegisterFile,"genMealy_read","[%d] -> %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data));
-
-#ifdef STATISTICS
-	    _stat_nb_read ++;
-#endif    
-	    // Write in registerFile
-	    
  	  }
 	else
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_statistics.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_statistics.cpp	(revision 70)
+++ 	(revision )
@@ -1,27 +1,0 @@
-#ifdef STATISTICS
-/*
- * $Id$
- *
- * [ Description ]
- * 
- */
-
-#include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/RegisterFile_Monolithic.h"
-
-namespace morpheo                    {
-namespace behavioural                {
-namespace generic                    {
-namespace registerfile               {
-namespace registerfile_monolithic    {
-
-  string RegisterFile_Monolithic::statistics (uint32_t depth)
-  {
-    return _stat->print(depth);
-  };
-
-}; // end namespace registerfile_monolithic
-}; // end namespace registerfile 
-}; // end namespace generic
-}; // end namespace behavioural          
-}; // end namespace morpheo              
-#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_statistics_declaration.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_statistics_declaration.cpp	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_statistics_declaration.cpp	(revision 71)
@@ -0,0 +1,45 @@
+#ifdef STATISTICS
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/RegisterFile_Monolithic.h"
+
+namespace morpheo                    {
+namespace behavioural                {
+namespace generic                    {
+namespace registerfile               {
+namespace registerfile_monolithic    {
+
+  void RegisterFile_Monolithic::statistics_declaration (morpheo::behavioural::Parameters_Statistics * param_statistics)
+  {
+    _stat = new Stat (static_cast<string>(_name),
+		      "RegisterFile_Monolithic",
+		      param_statistics);
+
+    _stat_nb_read           = _stat->create_variable("nb_read" );
+    _stat_nb_write          = _stat->create_variable("nb_write");
+    
+    _stat_average_read      = _stat->create_counter("average_read" , "", "Average read by cycle");
+    _stat_average_write     = _stat->create_counter("average_write", "", "Average write by cycle");
+
+    _stat_percent_use_read  = _stat->create_counter("percent_use_read" , "%", "Read port usage");
+    _stat_percent_use_write = _stat->create_counter("percent_use_write", "%", "Write port usage");
+
+    _stat->create_expr("average_read" , "/ nb_read  cycle", false);
+    _stat->create_expr("average_write", "/ nb_write cycle", false);
+
+    _stat->create_expr("percent_use_read" , "/ * average_read  100 " + toString(_param->_nb_port_read +_param->_nb_port_read_write), false);
+    _stat->create_expr("percent_use_write", "/ * average_write 100 " + toString(_param->_nb_port_write+_param->_nb_port_read_write), false);
+
+  };
+
+}; // end namespace registerfile_monolithic
+}; // end namespace registerfile 
+}; // end namespace generic
+}; // end namespace behavioural          
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_statistics_print.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_statistics_print.cpp	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_statistics_print.cpp	(revision 71)
@@ -0,0 +1,27 @@
+#ifdef STATISTICS
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/RegisterFile_Monolithic.h"
+
+namespace morpheo                    {
+namespace behavioural                {
+namespace generic                    {
+namespace registerfile               {
+namespace registerfile_monolithic    {
+
+  string RegisterFile_Monolithic::statistics_print (uint32_t depth)
+  {
+    return _stat->print(depth);
+  };
+
+}; // end namespace registerfile_monolithic
+}; // end namespace registerfile 
+}; // end namespace generic
+}; // end namespace behavioural          
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_transition.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_transition.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_transition.cpp	(revision 71)
@@ -17,7 +17,4 @@
   {
     log_printf(FUNC,RegisterFile,"transition","Begin");
-#ifdef STATISTICS
-    _stat_nb_write = 0;
-#endif    
 
     for (uint32_t i=0; i<_param->_nb_port_write; i++)
@@ -27,5 +24,5 @@
  	  {
 #ifdef STATISTICS
-	    _stat_nb_write ++;
+	    (*_stat_nb_write) ++;
 #endif    
 
@@ -47,32 +44,41 @@
       {
 	// Have a read_write?
- 	if ( (PORT_READ(in_READ_WRITE_VAL[i]) == true) and
-	     (PORT_READ(in_READ_WRITE_RW [i]) == RW_WRITE))
- 	  {
+ 	if (PORT_READ(in_READ_WRITE_VAL[i]) == true)
+	  {
+	    if (PORT_READ(in_READ_WRITE_RW [i]) == RW_WRITE)
+	      {
 #ifdef STATISTICS
-	    _stat_nb_write ++;
+		(*_stat_nb_write) ++;
 #endif    
-
-	    Taddress_t address;
-	    if (_param->_have_port_address)
-	      address = PORT_READ(in_READ_WRITE_ADDRESS[i]);
+		
+		Taddress_t address;
+		if (_param->_have_port_address)
+		  address = PORT_READ(in_READ_WRITE_ADDRESS[i]);
+		else
+		  address = 0;
+		Tdata_t    data    = PORT_READ(in_READ_WRITE_WDATA  [i]);
+		
+		log_printf(TRACE,RegisterFile,"transition","[%d] <- %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data));
+		
+		// Write in registerFile
+		REGISTER_WRITE(reg_DATA[address],data);
+	      }
+#ifdef STATISTICS
 	    else
-	      address = 0;
-	    Tdata_t    data    = PORT_READ(in_READ_WRITE_WDATA  [i]);
-	    
-	    log_printf(TRACE,RegisterFile,"transition","[%d] <- %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data));
-
-	    // Write in registerFile
-	    REGISTER_WRITE(reg_DATA[address],data);
- 	  }
+	      {
+		(*_stat_nb_read) ++;
+	      }
+#endif    
+	  }
       }
 
 #ifdef STATISTICS
-    _stat->add(_stat_nb_read,_stat_nb_write);
+    for (uint32_t i=0; i<_param->_nb_port_read; i++)
+      if ( PORT_READ(in_READ_VAL [i]) == 1)
+	(*_stat_nb_read) ++;
 #endif    
 
-#ifdef VHDL_TESTBENCH
-    vhdl_testbench_transition ();
-#endif
+    end_cycle();
+
     log_printf(FUNC,RegisterFile,"transition","End");
   };
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_vhdl_testbench_transition.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_vhdl_testbench_transition.cpp	(revision 70)
+++ 	(revision )
@@ -1,30 +1,0 @@
-#ifdef VHDL_TESTBENCH
-/*
- * $Id$
- *
- * [ Description ]
- * 
- */
-
-#include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/RegisterFile_Monolithic.h"
-
-namespace morpheo                    {
-namespace behavioural                {
-namespace generic                    {
-namespace registerfile               {
-namespace registerfile_monolithic    {
-
-  void RegisterFile_Monolithic::vhdl_testbench_transition (void)
-  {
-    // Evaluation before read the ouput signal
-    
-//  sc_start(0);
-    _interfaces->testbench();
-  };
-
-}; // end namespace registerfile_monolithic
-}; // end namespace registerfile 
-}; // end namespace generic
-}; // end namespace behavioural          
-}; // end namespace morpheo              
-#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/Statistics.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/Statistics.cpp	(revision 70)
+++ 	(revision )
@@ -1,56 +1,0 @@
-#ifdef STATISTICS
-/*
- * $Id$
- *
- * [ Description ]
- * 
- */
-
-#include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/Statistics.h"
-
-namespace morpheo                    {
-namespace behavioural                {
-namespace generic                    {
-namespace registerfile               {
-namespace registerfile_monolithic    {
-
-  Statistics::Statistics (string                                        name                       ,
-			  morpheo::behavioural::Parameters_Statistics * parameters_statistics      ,
-			  Parameters                                  * parameters
-			  ) :
-    morpheo::behavioural::Statistics(name                  ,
-				     parameters_statistics ),
-    _parameters(parameters)
-  {
-    _param_port_read = new morpheo::behavioural::generic::group::Parameters(_parameters->_nb_port_read);
-    _stat_port_read  = new morpheo::behavioural::generic::group::Statistics (name + "_port_read"   ,
-									     parameters_statistics ,
-									     _param_port_read);
-
-    _param_port_write = new morpheo::behavioural::generic::group::Parameters(_parameters->_nb_port_write);
-    _stat_port_write  = new morpheo::behavioural::generic::group::Statistics (name + "_port_write"   ,
-									     parameters_statistics ,
-									     _param_port_write);
-  };
-  
-  //   Statistics::Statistics (Statistics & stat) :
-  // 		       _nb_port_read      (param._nb_port_read ),
-  // 		       _nb_port_write     (param._nb_port_write),
-  // 		       _nb_word           (param._nb_word      ),
-  // 		       _size_word         (param._size_word    )
-  //     { };
-  
-  Statistics::~Statistics () 
-  { 
-    delete _param_port_read;
-    delete _param_port_write;
-    delete _stat_port_read ;
-    delete _stat_port_write;
-  };
-
-}; // end namespace registerfile_monolithic
-}; // end namespace registerfile
-}; // end namespace generic
-}; // end namespace behavioural          
-}; // end namespace morpheo              
-#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/Statistics_add.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/Statistics_add.cpp	(revision 70)
+++ 	(revision )
@@ -1,32 +1,0 @@
-#ifdef STATISTICS
-/*
- * $Id$
- *
- * [ Description ]
- * 
- */
-
-#include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/Statistics.h"
-
-#include <sstream>
-using namespace std;
-
-namespace morpheo                    {
-namespace behavioural                {
-namespace generic                    {
-namespace registerfile               {
-namespace registerfile_monolithic    {
-
-  void Statistics::add (uint32_t nb_read,
-			uint32_t nb_write)
-  {
-    _stat_port_read ->add(nb_read );
-    _stat_port_write->add(nb_write);
-  };
-
-}; // end namespace registerfile_monolithic
-}; // end namespace registerfile
-}; // end namespace generic
-}; // end namespace behavioural          
-}; // end namespace morpheo              
-#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/Statistics_print.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/Statistics_print.cpp	(revision 70)
+++ 	(revision )
@@ -1,45 +1,0 @@
-#ifdef STATISTICS
-/*
- * $Id$
- *
- * [ Description ]
- * 
- */
-
-#include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/Statistics.h"
-
-#include <sstream>
-using namespace std;
-
-namespace morpheo                    {
-namespace behavioural                {
-namespace generic                    {
-namespace registerfile               {
-namespace registerfile_monolithic    {
-
-  string Statistics::print (uint32_t depth)
-  {
-    string        tab = string(depth,'\t');
-    ostringstream msg;
-
-    msg << tab << "<registerfile_monolithic name=\"" << _name << "\" >" << endl
-	<< print_body(depth+1)
-	<< tab << "</RegisterFile_Monolithic>" << endl;
-    
-    return msg.str();
-  };
-
-  ostream& operator<< (ostream& output_stream ,
-		       morpheo::behavioural::generic::registerfile::registerfile_monolithic::Statistics & x)
-  {
-    output_stream << x.print(0);
-
-    return output_stream;
-  };
-
-}; // end namespace registerfile_monolithic
-}; // end namespace registerfile
-}; // end namespace generic
-}; // end namespace behavioural          
-}; // end namespace morpheo              
-#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/Statistics_print_body.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/Statistics_print_body.cpp	(revision 70)
+++ 	(revision )
@@ -1,36 +1,0 @@
-#ifdef STATISTICS
-/*
- * $Id$
- *
- * [ Description ]
- * 
- */
-
-#include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/Statistics.h"
-
-#include <sstream>
-using namespace std;
-
-namespace morpheo                    {
-namespace behavioural                {
-namespace generic                    {
-namespace registerfile               {
-namespace registerfile_monolithic    {
-
-  string Statistics::print_body (uint32_t depth)
-  {
-    string        tab = string(depth,'\t');
-    ostringstream msg;
-
-    msg << _stat_port_read ->print(depth+1);
-    msg << _stat_port_write->print(depth+1);
-    
-    return msg.str();
-  };
-
-}; // end namespace registerfile_monolithic
-}; // end namespace registerfile
-}; // end namespace generic
-}; // end namespace behavioural          
-}; // end namespace morpheo              
-#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.Component
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.Component	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.Component	(revision 71)
@@ -9,5 +9,5 @@
 #-----[ Rules ]--------------------------------------------
 .PRECIOUS			: $(DIR_LIB)/%.a
-.NOPARALLEL			: clean help
+#.NOTPARALLEL			: clean help
 
 all_component			: test_env $(DIR_OBJ) $(DIR_LIB) $(OBJECTS) $(HEADERS)
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.Selftest
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.Selftest	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.Selftest	(revision 71)
@@ -27,5 +27,5 @@
 #-----[ Rules ]--------------------------------------------
 .PRECIOUS			: $(DIR_BIN)/%.x $(DIR_LOG)/%.exec.log
-.NOPARALLEL			: clean clean_all help
+#.NOTPARALLEL			: clean clean_all help
 
 all_selftest   			: test_env $(DIR_OBJ) $(DIR_BIN) $(DIR_LOG)
@@ -181,5 +181,5 @@
 				@\
 				$(MAKE) common_help  ; \
-				$(MAKE) synthesis_help;\  
+				$(MAKE) synthesis_help;\
 				$(MAKE) selftest_help;
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.deps
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.deps	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.deps	(revision 71)
@@ -10,28 +10,27 @@
 Behavioural			= yes
 
-#ifndef Behavioural
-#include $(DIR_MORPHEO)/Behavioural/Makefile.deps
-#endif
+ifndef Common
+include $(DIR_MORPHEO)/Common/Makefile.deps
+endif
 
 #-----[ Library ]------------------------------------------
 Behavioural_LIBRARY		= 	-lBehavioural				
 
-#					$(Common_LIBRARY)
-
 Behavioural_DIR_LIBRARY		=	-L$(DIR_MORPHEO)/Behavioural/lib
 
-#					$(Common_DIR_LIBRARY)
+Behavioural_DEPENDENCIES	=	Common_library
+
+Behavioural_CLEAN        	=	Common_library_clean
+
 
 #-----[ Rules ]--------------------------------------------
 
-Behavioural_library		:
+#.NOTPARALLEL			: Behavioural_library Behavioural_library_clean
+
+Behavioural_library		: $(Behavioural_DEPENDENCIES)
 				@\
 				$(MAKE) --directory=$(DIR_MORPHEO)/Behavioural --makefile=Makefile ;
-
-#				@$(MAKE) Common_library
 	
-Behavioural_library_clean	:
+Behavioural_library_clean	: $(Behavioural_CLEAN)
 				@\
 				$(MAKE) --directory=$(DIR_MORPHEO)/Behavioural --makefile=Makefile clean;
-
-#				@$(MAKE) Common_library_clean
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.flags
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.flags	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.flags	(revision 71)
@@ -19,7 +19,8 @@
   					-DVHDL_TESTBENCH	\
 					-DVHDL_TESTBENCH_ASSERT	\
+					-DSTATISTICS 		\
 					-DDEBUG=DEBUG_TRACE
 #
-#					-DSTATISTICS 		\
+#
 #					-DCONFIGURATION  	\
 #					-DPOSITION       	\
@@ -34,2 +35,3 @@
 # POSITION                             - To generate a position's files     (it's input of viewer)
 # CONFIGURATION		               - To generate a configuration's file (it's input of viewer and generator)
+# NO_TRANSLATE			       - No translate message
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/Makefile
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/Makefile	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/Makefile	(revision 71)
@@ -2,18 +2,18 @@
 # $Id$
 # 
-# [ Description ]
+# [ Description ]
 # 
 # Makefile
 # 
 
-#-----[ Directory ]----------------------------------------
+#-----[ Directory ]----------------------------------------
 DIR_COMPONENT			= ./
 include				$(DIR_COMPONENT)/Makefile.defs
 
-#-----[ Library ]------------------------------------------
+#-----[ Library ]------------------------------------------
 LIBRARY				= $(DIR_LIB)/lib@COMPONENT.a
 
 
-#-----[ include ]------------------------------------------
+#-----[ include ]------------------------------------------
 
 all				:
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/Makefile.defs
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/Makefile.defs	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/Makefile.defs	(revision 71)
@@ -2,10 +2,10 @@
 # $Id$
 # 
-# [ Description ]
+# [ Description ]
 # 
 # Makefile
 # 
 
-#-----[ Directory ]----------------------------------------
+#-----[ Directory ]----------------------------------------
 DIR_COMPONENT_MORPHEO		= @DIR_MORPHEO
 DIR_MORPHEO			= $(DIR_COMPONENT)/$(DIR_COMPONENT_MORPHEO)
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/Makefile.deps
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/Makefile.deps	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/Makefile.deps	(revision 71)
@@ -2,5 +2,5 @@
 # $Id$
 # 
-# [ Description ]
+# [ Description ]
 # 
 # Makefile
@@ -14,5 +14,5 @@
 endif
 
-#-----[ Library ]------------------------------------------
+#-----[ Library ]------------------------------------------
 @COMPONENT_LIBRARY		= 	-l@COMPONENT	\
 					$(Behavioural_LIBRARY)	
@@ -25,5 +25,5 @@
 @COMPONENT_CLEAN        	=	Behavioural_library_clean
 
-#-----[ Rules ]--------------------------------------------
+#-----[ Rules ]--------------------------------------------
 
 .NOTPARALLEL			: @COMPONENT_library @COMPONENT_library_clean
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/SelfTest/Makefile
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/SelfTest/Makefile	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/SelfTest/Makefile	(revision 71)
@@ -2,10 +2,10 @@
 # $Id$
 # 
-# [ Description ]
+# [ Description ]
 # 
 # Makefile
 # 
 
-#-----[ Directory ]----------------------------------------
+#-----[ Directory ]----------------------------------------
 DIR_COMPONENT			= ../
 include				$(DIR_COMPONENT)/Makefile.defs
@@ -15,5 +15,5 @@
 DIR_LIBRARY			= $(@COMPONENT_DIR_LIBRARY)
 
-#-----[ include ]------------------------------------------
+#-----[ include ]------------------------------------------
 
 all				:
@@ -24,5 +24,5 @@
 library_clean			: @COMPONENT_library_clean
 
-include                         ../Makefile.deps
+include                         $(DIR_COMPONENT)/Makefile.deps
 include                         $(DIR_MORPHEO)/Behavioural/Makefile.flags
 include				$(DIR_MORPHEO)/Behavioural/Makefile.Common
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/SelfTest/include/test.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/SelfTest/include/test.h	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/SelfTest/include/test.h	(revision 71)
@@ -15,4 +15,5 @@
 #include <sys/time.h>
 
+#include "Common/include/Time.h"
 #include "Behavioural/@DIRECTORY/include/@COMPONENT.h"
 
@@ -25,34 +26,2 @@
 void test    (string name,
 	      morpheo::behavioural::@NAMESPACE_USE::Parameters * param);
-
-class Time 
-{
-private : timeval time_begin;
-// private : timeval time_end;
-  
-public  : Time ()
-  {
-    gettimeofday(&time_begin     ,NULL);
-  };
-
-public  : ~Time ()
-  {
-    cout << *this;
-  };
-
-public  : friend ostream& operator<< (ostream& output_stream,
-				      const Time & x)
-  {
-    timeval time_end;
-    
-    gettimeofday(&time_end       ,NULL);
-    
-    uint32_t nb_cycles = static_cast<uint32_t>(sc_simulation_time());
-
-    double average = static_cast<double>(nb_cycles) / static_cast<double>(time_end.tv_sec-x.time_begin.tv_sec);
-    
-    output_stream << nb_cycles << "\t(" << average << " cycles / seconds )" << endl;
-
-    return output_stream;
-  }
-};
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/SelfTest/src/main.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/SelfTest/src/main.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/SelfTest/src/main.cpp	(revision 71)
@@ -12,13 +12,6 @@
 void usage (int argc, char * argv[])
 {
-  cerr << "<Usage> " << argv[0] << " name_instance list_params" << endl
-       << "list_params is :" << endl
-//     << " - size_data     (unsigned int)" << endl
-//     << " - nb_port       (unsigned int)" << endl;
-       << "" << endl;
-
-  for (int i=0; i<argc; i++)
-    cerr << argv[i] << " ";
-  cerr << endl;
+  err (_("<Usage> %s name_instance list_params.\n"),argv[0]);
+  err (_("list_params is :\n"));
 
   exit (1);
@@ -47,5 +40,5 @@
         );
       
-      cout << param->print(1);
+      msg(_("%s"),param->print(1).c_str()):
       
       test (name,param);
@@ -53,10 +46,11 @@
   catch (morpheo::ErrorMorpheo & error)
     {
-      cout << "<" << name << "> : " <<  error.what ();
+      msg (_("<%s> : %s.\n"),name, error.what ());
       exit (EXIT_FAILURE);
     }
   catch (...)
     {
-      cerr << "<" << name << "> : This test must generate a error" << endl;
+      
+      err (_("<%s> : This test must generate a error.\n"),name);
       exit (EXIT_FAILURE);
     }
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/SelfTest/src/test.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/SelfTest/src/test.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/SelfTest/src/test.cpp	(revision 71)
@@ -13,35 +13,34 @@
 #define CYCLE_MAX     (128*NB_ITERATION)
 
-#define LABEL(str)                                                                       \
-{                                                                                        \
-  cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} " << str << endl; \
+#define LABEL(str)							\
+  {									\
+  msg (_("{%d} %s\n"),static_cast<uint32_t>(sc_simulation_time()),str);	\
 } while(0)
 
-static uint32_t cycle = 0;
-
-#define SC_START(cycle_offset)                                          \
-do                                                                      \
-{                                                                       \
-/*cout << "SC_START (begin)" << endl;*/                                 \
-                                                                        \
-  uint32_t cycle_current = static_cast<uint32_t>(sc_simulation_time()); \
-  if (cycle_current != cycle)                                           \
-    {                                                                   \
-      cycle = cycle_current;                                            \
-      cout << "##########[ cycle "<< cycle << " ]" << endl;             \
-    }                                                                   \
-                                                                        \
-  if (cycle_current > CYCLE_MAX)                                        \
-    {                                                                   \
-      TEST_KO("Maximal cycles Reached");                                \
-    }                                                                   \
-  sc_start(cycle_offset);                                               \
-/*cout << "SC_START (end  )" << endl;*/                                 \
-} while(0)
+#define SC_START(cycle_offset)                                                       \
+  do									             \
+    {									             \
+      /*cout << "SC_START (begin)" << endl;*/				             \
+									             \
+      uint32_t cycle_current = static_cast<uint32_t>(sc_simulation_time());          \
+      if (cycle_offset != 0)						             \
+	{								             \
+	  cout << "##########[ cycle "<< cycle_current+cycle_offset << " ]" << endl; \
+	}								             \
+									             \
+      if (cycle_current > CYCLE_MAX)					             \
+	{								             \
+	  TEST_KO("Maximal cycles Reached");				             \
+	}								             \
+									             \
+      sc_start(cycle_offset);						             \
+									             \
+      /*cout << "SC_START (end  )" << endl;*/				             \
+    } while(0)
 
 void test (string name,
 	   morpheo::behavioural::@NAMESPACE_USE::Parameters * _param)
 {
-  cout << "<" << name << "> : Simulation SystemC" << endl;
+  msg(_("<%s> : Simulation SystemC.\n"),name.c_str());
 
 #ifdef STATISTICS
@@ -68,11 +67,12 @@
    ********************************************************/
   
-  cout << "<" << name << "> Instanciation of _@COMPONENT" << endl;
-  
+  msg(_("<%s> : Instanciation of _@COMPONENT.\n"),name.c_str());
+
   (*(_@COMPONENT->in_CLOCK))        (*(in_CLOCK));
   (*(_@COMPONENT->in_NRESET))       (*(in_NRESET));
 
 
-  cout << "<" << name << "> Start Simulation ............" << endl;
+  msg(_("<%s> : Start Simulation ............\n"),name.c_str());
+    
   Time * _time = new Time();
 
@@ -111,5 +111,6 @@
   TEST_OK ("End of Simulation");
   delete _time;
-  cout << "<" << name << "> ............ Stop Simulation" << endl;
+
+  msg(_("<%s> : ............ Stop Simulation\n"),name.c_str());
 
   delete in_CLOCK;
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/include/New_Component.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/include/New_Component.h	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/include/New_Component.h	(revision 71)
@@ -5,5 +5,5 @@
  * $Id$
  *
- * [ Description ]
+ * [ Description ]
  * 
  */
@@ -20,5 +20,5 @@
 #include "Behavioural/@DIRECTORY/include/Parameters.h"
 #ifdef STATISTICS
-#include "Behavioural/@DIRECTORY/include/Statistics.h"
+#include "Behavioural/include/Stat.h"
 #endif
 #include "Behavioural/include/Component.h"
@@ -27,6 +27,4 @@
 #endif
 #include "Behavioural/include/Usage.h"
-
-using namespace std;
 
 namespace morpheo {
@@ -40,16 +38,12 @@
 #endif
   {
-    // -----[ fields ]----------------------------------------------------
+    // -----[ fields ]----------------------------------------------------
     // Parameters
-  protected : const string       _name;
+  protected : const std::string  _name;
   protected : const Parameters * _param;
   private   : const Tusage_t     _usage;
 
-//#ifdef STATISTICS
-//  protected : const morpheo::behavioural::Parameters_Statistics * _param_statistics;
-//#endif
-
 #ifdef STATISTICS
-  private   : Statistics                     * _stat;
+  private   : Stat                           * _stat;
 #endif
 
@@ -58,17 +52,17 @@
 
 #ifdef SYSTEMC
-    // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+    // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     // Interface
   public    : SC_CLOCK                      *  in_CLOCK        ;
   public    : SC_IN (Tcontrol_t)            *  in_NRESET       ;
 
-    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
+    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
 
-    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
+    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
 
-    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #endif
 
-    // -----[ methods ]---------------------------------------------------
+    // -----[ Methods ]---------------------------------------------------
 
 #ifdef SYSTEMC
@@ -80,5 +74,5 @@
    sc_module_name                                name,
 #else					       
-   string                                        name,
+   std::string                                   name,
 #endif					       
 #ifdef STATISTICS
@@ -99,5 +93,6 @@
 #endif					       
 #ifdef STATISTICS
-  public  : string   statistics                (uint32_t depth);
+  public  : void        statistics_declaration    (morpheo::behavioural::Parameters_Statistics * param_statistics);
+  public  : std::string statistics_print          (uint32_t depth);
 #endif
 					       
@@ -108,5 +103,7 @@
 #endif					       
 					       
+#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
   private : void     end_cycle                 (void);
+#endif
   };
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/include/Statistics.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/include/Statistics.h	(revision 70)
+++ 	(revision )
@@ -1,51 +1,0 @@
-#ifdef STATISTICS
-#ifndef morpheo_behavioural_@DEFINE_Statistics_h
-#define morpheo_behavioural_@DEFINE_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/@DIRECTORY/include/Parameters.h"
-
-//using namespace morpheo::behavioural::generic::group;
-
-namespace morpheo                    {
-namespace behavioural {
-@NAMESPACE_BEGIN
-
-  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);
-
-  };
-
-@NAMESPACE_END
-}; // end namespace behavioural
-}; // end namespace morpheo
-
-#endif
-#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/New_Component.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/New_Component.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/New_Component.cpp	(revision 71)
@@ -30,7 +30,4 @@
     ,_param            (param)
     ,_usage            (usage)
-// #ifdef STATISTICS
-// 			      ,_param_statistics (param_statistics)
-// #endif
   {
     log_printf(FUNC,@COMPONENT,FUNCTION,"Begin");
@@ -43,9 +40,6 @@
       {	
 	log_printf(INFO,@COMPONENT,FUNCTION,"Allocation of statistics");
-	
-	// Allocation of statistics
-	_stat = new Statistics (static_cast<string>(_name),
-				param_statistics          ,
-				param);
+
+	statistics_declaration(param_statistics);
       }
 #endif
@@ -90,5 +84,4 @@
 	log_printf(INFO,@COMPONENT,FUNCTION,"Generate Statistics file");
 	
-	_stat->generate_file(statistics(0));
 	delete _stat;
       }
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/New_Component_end_cycle.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/New_Component_end_cycle.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/New_Component_end_cycle.cpp	(revision 71)
@@ -1,6 +1,7 @@
+#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
 /*
  * $Id$
  *
- * [ Description ]
+ * [ Description ]
  * 
  */
@@ -19,5 +20,5 @@
 
 #ifdef STATISTICS
-    _stat->add();
+    _stat->end_cycle();
 #endif    
 
@@ -34,2 +35,3 @@
 }; // end namespace behavioural
 }; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/New_Component_statistics.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/New_Component_statistics.cpp	(revision 70)
+++ 	(revision )
@@ -1,31 +1,0 @@
-#ifdef STATISTICS
-/*
- * $Id$
- *
- * [ Description ]
- * 
- */
-
-#include "Behavioural/@DIRECTORY/include/@COMPONENT.h"
-
-namespace morpheo {
-namespace behavioural {
-@NAMESPACE_BEGIN
-
-#undef  FUNCTION
-#define FUNCTION "@COMPONENT::statistics"
-  string @COMPONENT::statistics (uint32_t depth)
-  {
-    log_printf(FUNC,@COMPONENT,FUNCTION,"Begin");
-
-    string txt = _stat->print(depth);
-    
-    log_printf(FUNC,@COMPONENT,FUNCTION,"End");
-
-    return txt;
-  };
-
-@NAMESPACE_END
-}; // end namespace behavioural
-}; // end namespace morpheo              
-#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/New_Component_statistics_declaration.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/New_Component_statistics_declaration.cpp	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/New_Component_statistics_declaration.cpp	(revision 71)
@@ -0,0 +1,31 @@
+#ifdef STATISTICS
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/@DIRECTORY/include/@COMPONENT.h"
+
+namespace morpheo {
+namespace behavioural {
+@NAMESPACE_BEGIN
+
+#undef  FUNCTION
+#define FUNCTION "@COMPONENT::statistics_declaration"
+  void @COMPONENT::statistics_declaration (morpheo::behavioural::Parameters_Statistics * param_statistics)
+  {
+    log_printf(FUNC,@COMPONENT,FUNCTION,"Begin");
+
+    _stat = new Stat (static_cast<string>(_name),
+		      "@COMPONENT",
+		      param_statistics);
+    
+    log_printf(FUNC,@COMPONENT,FUNCTION,"End");
+  };
+
+@NAMESPACE_END
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/New_Component_statistics_print.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/New_Component_statistics_print.cpp	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/New_Component_statistics_print.cpp	(revision 71)
@@ -0,0 +1,31 @@
+#ifdef STATISTICS
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/@DIRECTORY/include/@COMPONENT.h"
+
+namespace morpheo {
+namespace behavioural {
+@NAMESPACE_BEGIN
+
+#undef  FUNCTION
+#define FUNCTION "@COMPONENT::statistics_print"
+  std::string @COMPONENT::statistics_print (uint32_t depth)
+  {
+    log_printf(FUNC,@COMPONENT,FUNCTION,"Begin");
+
+    std::string txt = _stat->print(depth);
+    
+    log_printf(FUNC,@COMPONENT,FUNCTION,"End");
+
+    return txt;
+  };
+
+@NAMESPACE_END
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/New_Component_transition.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/New_Component_transition.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/New_Component_transition.cpp	(revision 71)
@@ -20,5 +20,7 @@
     log_printf(FUNC,@COMPONENT,FUNCTION,"Begin");
 
+#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
     end_cycle ();
+#endif
 
     log_printf(FUNC,@COMPONENT,FUNCTION,"End");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/Parameters_msg_error.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/Parameters_msg_error.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/Parameters_msg_error.cpp	(revision 71)
@@ -9,5 +9,4 @@
 #include "Behavioural/@DIRECTORY/include/Parameters.h"
 #include <sstream>
-using namespace std;
 
 namespace morpheo                    {
@@ -17,9 +16,9 @@
 #undef  FUNCTION
 #define FUNCTION "@COMPONENT::msg_error"
-  string Parameters::msg_error(void)
+  std::string Parameters::msg_error(void)
   {
     log_printf(FUNC,@COMPONENT,FUNCTION,"Begin");
 
-    string msg = "";
+    std::string msg = "";
 
     return msg;
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/Parameters_print.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/Parameters_print.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/Parameters_print.cpp	(revision 71)
@@ -8,5 +8,4 @@
 #include "Behavioural/@DIRECTORY/include/Parameters.h"
 #include "Behavioural/include/XML.h"
-using namespace std;
 
 namespace morpheo                    {
@@ -16,5 +15,5 @@
 #undef  FUNCTION
 #define FUNCTION "@COMPONENT::print"
-  string Parameters::print (uint32_t depth)
+  std::string Parameters::print (uint32_t depth)
   {
     log_printf(FUNC,@COMPONENT,FUNCTION,"Begin");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/Statistics.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/Statistics.cpp	(revision 70)
+++ 	(revision )
@@ -1,40 +1,0 @@
-#ifdef STATISTICS
-/*
- * $Id$
- *
- * [ Description ]
- * 
- */
-
-#include "Behavioural/@DIRECTORY/include/Statistics.h"
-
-namespace morpheo                    {
-namespace behavioural {
-@NAMESPACE_BEGIN
-
-#undef  FUNCTION
-#define FUNCTION "@COMPONENT::Statistics"
-  Statistics::Statistics (string                                        name                       ,
-			  morpheo::behavioural::Parameters_Statistics * parameters_statistics      ,
-			  Parameters                                  * parameters
-			  ) :
-    morpheo::behavioural::Statistics(name                  ,
-				     parameters_statistics ),
-    _parameters(parameters)
-  {
-    log_printf(FUNC,@COMPONENT,FUNCTION,"Begin");
-    log_printf(FUNC,@COMPONENT,FUNCTION,"End");
-  };
-  
-#undef  FUNCTION
-#define FUNCTION "@COMPONENT::~Statistics"
-  Statistics::~Statistics () 
-  { 
-    log_printf(FUNC,@COMPONENT,FUNCTION,"Begin");
-    log_printf(FUNC,@COMPONENT,FUNCTION,"End");
-  };
-
-@NAMESPACE_END
-}; // end namespace behavioural
-}; // end namespace morpheo              
-#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/Statistics_add.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/Statistics_add.cpp	(revision 70)
+++ 	(revision )
@@ -1,29 +1,0 @@
-#ifdef STATISTICS
-/*
- * $Id$
- *
- * [ Description ]
- * 
- */
-
-#include "Behavioural/@DIRECTORY/include/Statistics.h"
-
-#include <sstream>
-using namespace std;
-
-namespace morpheo                    {
-namespace behavioural {
-@NAMESPACE_BEGIN
-
-#undef  FUNCTION
-#define FUNCTION "@COMPONENT::add"
-  void Statistics::add ()
-  {
-    log_printf(FUNC,@COMPONENT,FUNCTION,"Begin");
-    log_printf(FUNC,@COMPONENT,FUNCTION,"End");
-  };
-
-@NAMESPACE_END
-}; // end namespace behavioural
-}; // end namespace morpheo              
-#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/Statistics_print.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/Statistics_print.cpp	(revision 70)
+++ 	(revision )
@@ -1,53 +1,0 @@
-#ifdef STATISTICS
-/*
- * $Id$
- *
- * [ Description ]
- * 
- */
-
-#include "Behavioural/@DIRECTORY/include/Statistics.h"
-
-#include <sstream>
-using namespace std;
-
-namespace morpheo {
-namespace behavioural {
-@NAMESPACE_BEGIN
-
-#undef  FUNCTION
-#define FUNCTION "@COMPONENT::print"
-  string Statistics::print (uint32_t depth)
-  {
-    log_printf(FUNC,@COMPONENT,FUNCTION,"Begin");
-
-    string        tab = string(depth,'\t');
-    ostringstream msg;
-
-    msg << tab << "<@COMPONENT_LOWER name=\"" << _name << "\" >" << endl
-        << print_body(depth+1) << endl
-	<< tab << "</@COMPONENT_LOWER>" << endl;
-    
-    log_printf(FUNC,@COMPONENT,FUNCTION,"End");
-
-    return msg.str();
-  };
-
-#undef  FUNCTION
-#define FUNCTION "@COMPONENT::operator<<"
-  ostream& operator<< (ostream& output_stream ,
-		       morpheo::behavioural::@NAMESPACE_USE::Statistics & x)
-  {
-    log_printf(FUNC,@COMPONENT,FUNCTION,"Begin");
-
-    output_stream << x.print(0);
-
-    log_printf(FUNC,@COMPONENT,FUNCTION,"End");
-
-    return output_stream;
-  };
-
-@NAMESPACE_END
-}; // end namespace behavioural
-}; // end namespace morpheo              
-#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/Statistics_print_body.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/Statistics_print_body.cpp	(revision 70)
+++ 	(revision )
@@ -1,37 +1,0 @@
-#ifdef STATISTICS
-/*
- * $Id$
- *
- * [ Description ]
- * 
- */
-
-#include "Behavioural/@DIRECTORY/include/Statistics.h"
-
-#include <sstream>
-using namespace std;
-
-namespace morpheo                    {
-namespace behavioural {
-@NAMESPACE_BEGIN
-
-#undef  FUNCTION
-#define FUNCTION "@COMPONENT::print_body"
-  string Statistics::print_body (uint32_t depth)
-  {
-    log_printf(FUNC,@COMPONENT,FUNCTION,"Begin");
-
-    string        tab = string(depth,'\t');
-    ostringstream msg;
-
-    msg << tab << "";
-    
-    log_printf(FUNC,@COMPONENT,FUNCTION,"End");
-
-    return msg.str();
-  };
-
-@NAMESPACE_END
-}; // end namespace behavioural
-}; // end namespace morpheo              
-#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Component.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Component.h	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Component.h	(revision 71)
@@ -21,6 +21,4 @@
 #include "Common/include/Debug.h"
 #include "Behavioural/include/Usage.h"
-
-using namespace std;
 
 namespace morpheo              {
@@ -53,11 +51,11 @@
   public    :                       ~Component        ();
 
-  public    : Entity *              set_entity        (string        name   
-						       ,string        type  
+  public    : Entity *              set_entity        (std::string        name   
+						       ,std::string        type  
 #ifdef POSITION
 						       ,schema_t      schema
 #endif
 						       );
-  private   : string                get_entity        (void);
+  private   : std::string                get_entity        (void);
 
   public    : void                  set_component     (Component * component
@@ -71,8 +69,8 @@
 						       );
 
-  private   : string                get_component     (void);
+  private   : std::string                get_component     (void);
 
-  private   : Entity *              find_entity       (string name);
-//private   : Interface *           find_interface    (string   name  , 
+  private   : Entity *              find_entity       (std::string name);
+//private   : Interface *           find_interface    (std::string   name  , 
 //						       Entity * entity);
 
@@ -85,18 +83,18 @@
 						       Signal * signal_productor);
 
-  public    : void                  port_map          (string component_src ,
-						       string port_src      ,
-						       string component_dest,
-						       string port_dest    );
-  public    : void                  port_map          (string component_src ,
-						       string port_src      );
+  public    : void                  port_map          (std::string component_src ,
+						       std::string port_src      ,
+						       std::string component_dest,
+						       std::string port_dest    );
+  public    : void                  port_map          (std::string component_src ,
+						       std::string port_src      );
 
   public    : bool                  test_map          (void);
 
 #ifdef POSITION
-  public    : void                  interface_map     (string component_src ,
-						       string port_dest,
-						       string component_dest,
-						       string port_dest     );
+  public    : void                  interface_map     (std::string component_src ,
+						       std::string port_dest,
+						       std::string component_dest,
+						       std::string port_dest     );
 
   public    : XML                   toXML             (void);
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Configuration_Parameters.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Configuration_Parameters.h	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Configuration_Parameters.h	(revision 71)
@@ -15,5 +15,4 @@
 #include "Common/include/ErrorMorpheo.h"
 #include "Common/include/ToString.h"
-using namespace std;
 
 namespace morpheo     {
@@ -24,26 +23,26 @@
     // -----[ fields ]----------------------------------------------------
     // Constant
-  public   : const string    _name   ;
+  public   : const std::string    _name   ;
   public   : const uint32_t  _value  ;
   public   : const uint32_t  _min    ;
   public   : const uint32_t  _max    ;
-  public   : const string    _step   ;
+  public   : const std::string    _step   ;
   public   : const uint32_t  _default;
   public   : const uint32_t  _level  ;
-  public   : const string    _comment;
+  public   : const std::string    _comment;
 
     // -----[ methods ]---------------------------------------------------
-  public   :                 Configuration_Parameters  (string   name   ,
+  public   :                 Configuration_Parameters  (std::string   name   ,
 							uint32_t value  ,
 							uint32_t min    ,
 							uint32_t max    ,
-							string   step   ,
+							std::string   step   ,
 							uint32_t value_default,
 							uint32_t level  ,
-							string   comment);
+							std::string   comment);
   public   :                 ~Configuration_Parameters ();
 
     // methods to print and test parameters_configuration
-  public   : string          print                      (uint32_t depth);
+  public   : std::string          print                      (uint32_t depth);
   public   : friend ostream& operator<<                 (ostream& output_stream,
 							 morpheo::behavioural::Configuration_Parameters & x);
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Constants.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Constants.h	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Constants.h	(revision 71)
@@ -11,4 +11,5 @@
 
   //-------------------------------------------------------[ Memory ]-----
+#define OPERATION_MEMORY_LOAD                    0x0      // 000_0000
 #define OPERATION_MEMORY_LOAD_8_Z                0x0      // 000_0000
 #define OPERATION_MEMORY_LOAD_16_Z               0x20     // 010_0000
@@ -55,4 +56,10 @@
 	 (x == OPERATION_MEMORY_STORE_HEAD_KO))
 
+#define is_operation_memory_load_signed(x)      \
+        ((x == OPERATION_MEMORY_LOAD_8_S ) or	\
+	 (x == OPERATION_MEMORY_LOAD_16_S) or	\
+	 (x == OPERATION_MEMORY_LOAD_32_S) or	\
+	 (x == OPERATION_MEMORY_LOAD_64_S) )
+
 #define MEMORY_ACCESS_8                          0x0
 #define MEMORY_ACCESS_16                         0x1
@@ -60,8 +67,24 @@
 #define MEMORY_ACCESS_64                         0x3
 
+#define MEMORY_SIZE_8                            8 
+#define MEMORY_SIZE_16                           16
+#define MEMORY_SIZE_32                           32
+#define MEMORY_SIZE_64                           64
+
 #define MASK_MEMORY_ACCESS_8                     0x0
 #define MASK_MEMORY_ACCESS_16                    0x1
 #define MASK_MEMORY_ACCESS_32                    0x3
 #define MASK_MEMORY_ACCESS_64                    0x7
+
+#define memory_size(x)                                                           \
+	(((x==OPERATION_MEMORY_LOAD_16_Z)or					 \
+	   (x==OPERATION_MEMORY_LOAD_16_S)or					 \
+	   (x==OPERATION_MEMORY_STORE_16 ))?MEMORY_SIZE_16:			 \
+	  (((x==OPERATION_MEMORY_LOAD_32_Z)or					 \
+	    (x==OPERATION_MEMORY_LOAD_32_S)or					 \
+	    (x==OPERATION_MEMORY_STORE_32 ))?MEMORY_SIZE_32:			 \
+	   (((x==OPERATION_MEMORY_LOAD_64_Z)or					 \
+	     (x==OPERATION_MEMORY_LOAD_64_S)or					 \
+	     (x==OPERATION_MEMORY_STORE_64 ))?MEMORY_SIZE_64:MEMORY_SIZE_8)))
 
 #define memory_access(x)                                                         \
@@ -86,5 +109,4 @@
 	     (x==OPERATION_MEMORY_LOAD_64_S)or					 \
 	     (x==OPERATION_MEMORY_STORE_64 ))?MASK_MEMORY_ACCESS_64:MASK_MEMORY_ACCESS_8)))
-
     
   //====================================================[ Exception ]=====
@@ -131,23 +153,23 @@
 #define EXCEPTION_MEMORY_BUS_ERROR               0x4  // Access at a invalid physical address
 #define EXCEPTION_MEMORY_MISS_SPECULATION        0x5  // Load miss speculation
+#define EXCEPTION_MEMORY_LOAD_SPECULATIVE        0x6  // The load is speculative : write in register file, but don't commit
 
   //==================================================[ dcache_type ]=====
-#  define DCACHE_LOAD                    0x0      // 0000
-#  define DCACHE_LOCK                    0x1      // 0001
-#  define DCACHE_INVALIDATE              0x2      // 0010
-#  define DCACHE_PREFETCH                0x3      // 0011
-//#define DCACHE_                        0x4      // 0100
-//#define DCACHE_                        0x5      // 0101
-#  define DCACHE_FLUSH                   0x6      // 0110
-#  define DCACHE_SYNCHRONIZATION         0x7      // 0111
-
-#  define DCACHE_STORE_8                 0x8      // 1000
-#  define DCACHE_STORE_16                0x9      // 1001
-#  define DCACHE_STORE_32                0xa      // 1010
-#  define DCACHE_STORE_64                0xb      // 1011
-//#define DCACHE_                        0xc      // 1100
-//#define DCACHE_                        0xd      // 1101
-//#define DCACHE_                        0xe      // 1110
-//#define DCACHE_                        0xf      // 1111
+#  define DCACHE_LOAD                    0x0 // 0000
+#  define DCACHE_LOCK                    0x1 // 0001
+#  define DCACHE_INVALIDATE              0x2 // 0010
+#  define DCACHE_PREFETCH                0x3 // 0011
+//#define DCACHE_                        0x4 // 0100
+//#define DCACHE_                        0x5 // 0101
+#  define DCACHE_FLUSH                   0x6 // 0110
+#  define DCACHE_SYNCHRONIZATION         0x7 // 0111
+#  define DCACHE_STORE_8                 0x8 // 1000
+#  define DCACHE_STORE_16                0x9 // 1001
+#  define DCACHE_STORE_32                0xa // 1010
+#  define DCACHE_STORE_64                0xb // 1011
+//#define DCACHE_                        0xc // 1100
+//#define DCACHE_                        0xd // 1101
+//#define DCACHE_                        0xe // 1110
+//#define DCACHE_                        0xf // 1111
 
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Debug_component.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Debug_component.h	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Debug_component.h	(revision 71)
@@ -21,9 +21,9 @@
 #define         DEBUG_Multi_Execute_unit                          false
 #define           DEBUG_Execute_unit                              false
-#define             DEBUG_Load_store_unit                         false
+#define             DEBUG_Load_store_unit                         true 
 #define         DEBUG_Multi_Read_unit				  false
 #define           DEBUG_Read_unit				  false
 #define             DEBUG_Read_queue                              false
-#define             DEBUG_Reservation_station                     true 
+#define             DEBUG_Reservation_station                     false
 #define         DEBUG_Register_unit				  false
 #define           DEBUG_Register_unit_Glue			  false
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Entity.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Entity.h	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Entity.h	(revision 71)
@@ -20,6 +20,4 @@
 #include "Behavioural/include/Usage.h"
 
-using namespace std;
-
 namespace morpheo              {
 namespace behavioural          {
@@ -28,6 +26,6 @@
   {
     // -----[ fields ]----------------------------------------------------
-  private   : const string          _name         ;
-  private   : const string          _type         ;
+  private   : const std::string          _name         ;
+  private   : const std::string          _type         ;
 #ifdef POSITION
   private   : const schema_t        _schema       ;
@@ -38,5 +36,5 @@
 
 #ifdef POSITION
-  private   : string                _comment      ;
+  private   : std::string                _comment      ;
 
   private   :       bool            _is_map       ;
@@ -48,6 +46,6 @@
 
     // -----[ methods ]---------------------------------------------------
-  public    :                       Entity            ( string        name   
-						       ,string        type   
+  public    :                       Entity            ( std::string        name   
+						       ,std::string        type   
 #ifdef POSITION
 						       ,schema_t      schema 
@@ -58,17 +56,17 @@
   public    :                       ~Entity           ();
 
-  public    : string                get_name          (void);
-  public    : string                get_type          (void);
+  public    : std::string                get_name          (void);
+  public    : std::string                get_type          (void);
 
 #ifdef POSITION
-  public    : void                  set_comment       (string comment);
-  private   : string                get_comment       (void          );
+  public    : void                  set_comment       (std::string comment);
+  private   : std::string                get_comment       (void          );
 #endif
   public    : Interfaces *          set_interfaces    (void);
-  private   : string                get_interfaces    (void);
+  private   : std::string                get_interfaces    (void);
   public    : Interfaces *          get_interfaces_list(void);
 
-  public    : Interface  *          find_interface    (string name);
-  public    : Signal     *          find_signal       (string name);
+  public    : Interface  *          find_interface    (std::string name);
+  public    : Signal     *          find_signal       (std::string name);
   public    : bool                  find_signal       (Signal * signal);
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Environnement.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Environnement.h	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Environnement.h	(revision 71)
@@ -18,2 +18,6 @@
 #  define SYSTEMC_VHDL_COMPATIBILITY
 #endif
+
+#if (defined(DEBUG))
+#  define DEBUG_TEST
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interface.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interface.h	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interface.h	(revision 71)
@@ -28,6 +28,4 @@
 #include "Behavioural/include/Usage.h"
 
-using namespace std;
-
 namespace morpheo              {
 namespace behavioural          {
@@ -36,5 +34,5 @@
   {
     // -----[ fields ]----------------------------------------------------
-  protected : const string          _name         ;
+  protected : const std::string          _name         ;
 #ifdef POSITION
   protected : const direction_t     _direction    ;
@@ -44,5 +42,5 @@
 
 #ifdef POSITION
-  protected :       string          _comment      ;
+  protected :       std::string          _comment      ;
 #endif
 
@@ -60,5 +58,5 @@
     
     // -----[ methods ]---------------------------------------------------
-  public    :                       Interface            (string         name        
+  public    :                       Interface            (std::string         name        
 #ifdef POSITION
 							  ,direction_t    direction   
@@ -71,20 +69,20 @@
   public    :                       ~Interface           ();
 
-  public    : string                get_name             ();
-
-#ifdef POSITION
-  public    : void                  set_comment          (string comment);
-  protected : string                get_comment          (void          );
-#endif
-
-  protected : string                signal_name          (string      name_interface,
-							  string      name_signal   ,
+  public    : std::string                get_name             ();
+
+#ifdef POSITION
+  public    : void                  set_comment          (std::string comment);
+  protected : std::string                get_comment          (void          );
+#endif
+
+  protected : std::string                signal_name          (std::string      name_interface,
+							  std::string      name_signal   ,
 							  direction_t direction     );
 
-  public    : Signal *              find_signal          (string name);
+  public    : Signal *              find_signal          (std::string name);
   public    : bool                  find_signal          (Signal * signal);
 
-  protected : string                get_signal           (void);
-  public    : Signal *              set_signal           (string          name     ,
+  protected : std::string                get_signal           (void);
+  public    : Signal *              set_signal           (std::string          name     ,
 							  direction_t     direction,
 							  uint32_t        size     ,
@@ -93,5 +91,5 @@
 
 #ifdef SYSTEMC
-  public    : sc_in_clk *           set_signal_clk       (string          name     ,
+  public    : sc_in_clk *           set_signal_clk       (std::string          name     ,
 							  uint32_t        size     ,
 							  presence_port_t presence_port=CLOCK_VHDL_YES)
@@ -122,5 +120,5 @@
 
   public    : template <typename T>
-              sc_in <T> *           set_signal_in       (string          name     ,
+              sc_in <T> *           set_signal_in       (std::string          name     ,
 							 uint32_t        size     ,
 							 presence_port_t presence_port=PORT_VHDL_YES_TESTBENCH_YES)
@@ -151,5 +149,5 @@
 
   public    : template <typename T>
-              sc_out <T> *          set_signal_out      (string          name     ,
+              sc_out <T> *          set_signal_out      (std::string          name     ,
 							 uint32_t        size     ,
 							 presence_port_t presence_port=PORT_VHDL_YES_TESTBENCH_YES)
@@ -180,5 +178,5 @@
 
   public    : template <typename T>
-              sc_signal <T> *       set_signal_internal (string   name,
+              sc_signal <T> *       set_signal_internal (std::string   name,
 							 uint32_t size)
     {
@@ -209,5 +207,5 @@
 #  ifdef VHDL_TESTBENCH
   public    : void                  set_signal           (Vhdl * & vhdl);
-  public    : void                  get_signal           (list<string> * & list_signal);
+  public    : void                  get_signal           (list<std::string> * & list_signal);
 #  endif
 #endif
@@ -220,13 +218,13 @@
   public    : void                  testbench_cycle      (void);
   public    : void                  testbench_body       (Vhdl           * & vhdl          ,
-							  string             counter_name  ,
-							  string             reset_name    );
-  public    : string                testbench_test       (Vhdl           * & vhdl        ,
-							  string             counter_name,
-							  string             reset_name);
-  public    : string                testbench_test_ok    (Vhdl           * & vhdl        );
-  protected : string                testbench_test_name   (Vhdl           * & vhdl);
-  protected : string                testbench_test_ok_name(Vhdl           * & vhdl);
-  protected : string                testbench_test_transaction_name(Vhdl           * & vhdl);
+							  std::string             counter_name  ,
+							  std::string             reset_name    );
+  public    : std::string                testbench_test       (Vhdl           * & vhdl        ,
+							  std::string             counter_name,
+							  std::string             reset_name);
+  public    : std::string                testbench_test_ok    (Vhdl           * & vhdl        );
+  protected : std::string                testbench_test_name   (Vhdl           * & vhdl);
+  protected : std::string                testbench_test_ok_name(Vhdl           * & vhdl);
+  protected : std::string                testbench_test_transaction_name(Vhdl           * & vhdl);
 #endif
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interfaces.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interfaces.h	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Interfaces.h	(revision 71)
@@ -20,5 +20,4 @@
 #include "Behavioural/include/Usage.h"
 
-using namespace std;
 
 namespace morpheo              {
@@ -28,15 +27,15 @@
   {
     // -----[ fields ]----------------------------------------------------
-  private   : const string               _name;
+  private   : const std::string               _name;
   private   : const Tusage_t             _usage;
   private   : list<Interface_fifo*>    * _list_interface;
 
     // -----[ methods ]---------------------------------------------------
-  public    :                       Interfaces            (string name, 
+  public    :                       Interfaces            (std::string name, 
 							   Tusage_t usage=USE_ALL);
   public    :                       Interfaces            (const Interfaces & interfaces);
   public    :                       ~Interfaces           ();
 
-  public    : Interface_fifo *      set_interface         (string         name        
+  public    : Interface_fifo *      set_interface         (std::string         name        
 #ifdef POSITION
 							   ,direction_t    direction   
@@ -45,10 +44,10 @@
 							   );
 #ifdef POSITION
-  public    : Interface_fifo *      set_interface         (string         name        ,
+  public    : Interface_fifo *      set_interface         (std::string         name        ,
 							   direction_t    direction   ,
 							   localisation_t localisation,
-							   string         comment     );
+							   std::string         comment     );
 #endif
-  private   : string                get_interface         (void);
+  private   : std::string                get_interface         (void);
   public    :list<Interface_fifo*>* get_interface_list    (void);
 
@@ -56,5 +55,5 @@
   public    : void                  set_port              (Vhdl           * & vhdl          );
 #  ifdef VHDL_TESTBENCH
-  private   : void                  get_signal            (list<string>   * & list_signal   );
+  private   : void                  get_signal            (list<std::string>   * & list_signal   );
   private   : void                  set_signal            (Vhdl           * & vhdl          );
 #  endif
@@ -67,11 +66,11 @@
   private   : void                  testbench_generate_file (void);
   public    : void                  testbench             (void);
-  private   : string                testbench_body        (Vhdl           * & vhdl          ,
-							   string             counter_name  ,
-							   string             reset_name    );
+  private   : std::string                testbench_body        (Vhdl           * & vhdl          ,
+							   std::string             counter_name  ,
+							   std::string             reset_name    );
 #endif
 
-  public    : Interface_fifo  *     find_interface        (string name);
-  public    : Signal          *     find_signal           (string name);
+  public    : Interface_fifo  *     find_interface        (std::string name);
+  public    : Signal          *     find_signal           (std::string name);
   public    : bool                  find_signal           (Signal * signal);
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Parameters.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Parameters.h	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Parameters.h	(revision 71)
@@ -18,6 +18,4 @@
 #include "Common/include/Debug.h"
 
-using namespace std;
-
 namespace morpheo     {
 namespace behavioural {
@@ -37,6 +35,6 @@
 	
     // methods to print and test parameters
-  public   : virtual string   print                 (uint32_t depth) = 0;
-  public   : virtual string   msg_error             (void) = 0;
+  public   : virtual std::string   print                 (uint32_t depth) = 0;
+  public   : virtual std::string   msg_error             (void) = 0;
 
     // methods to generate configuration file
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Parameters_Statistics.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Parameters_Statistics.h	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Parameters_Statistics.h	(revision 71)
@@ -12,5 +12,4 @@
 #include "Common/include/Debug.h"
 #include <stdint.h>
-using namespace std;
 
 namespace morpheo              {
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Signal.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Signal.h	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Signal.h	(revision 71)
@@ -26,6 +26,4 @@
 #include "Common/include/ToString.h"
 #include "Common/include/Debug.h"
-
-using namespace std;
 
 namespace morpheo              {
@@ -53,5 +51,5 @@
 
     // -----[ fields ]----------------------------------------------------
-  private   : const string          _name          ;
+  private   : const std::string          _name          ;
   private   : const direction_t     _direction     ;
   private   : const presence_port_t _presence_port ;
@@ -68,9 +66,9 @@
 
 #ifdef VHDL_TESTBENCH
-  private   : list<string>        * _list_value    ;
+  private   : list<std::string>        * _list_value    ;
 #endif
 
     // -----[ methods ]---------------------------------------------------
-  public    :                   Signal          (string          name          ,
+  public    :                   Signal          (std::string          name          ,
 						 direction_t     direction     ,
 						 uint32_t        size          ,
@@ -79,5 +77,5 @@
   public    :                   ~Signal         ();
 
-  public    : string            get_name                (void);
+  public    : std::string            get_name                (void);
   public    : uint32_t          get_size                (void);
   public    : void              set_size                (uint32_t size);
@@ -184,10 +182,10 @@
 
   public    : void              set_signal      (Vhdl * & vhdl);
-  public    : void              get_name_vhdl   (list<string> * & list_signal);
+  public    : void              get_name_vhdl   (list<std::string> * & list_signal);
 
   public    : void              testbench        (void);
   public    : void              testbench_body   (Vhdl           * & vhdl          ,
-						  string             counter_name  ,
-						  string             reset_name    );
+						  std::string             counter_name  ,
+						  std::string             reset_name    );
   public    : void              testbench_test_ok(Vhdl           * & vhdl          );
 #  endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Stat.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Stat.h	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Stat.h	(revision 71)
@@ -0,0 +1,98 @@
+#ifdef STATISTICS
+#ifndef morpheo_behavioural_Stat_h
+#define morpheo_behavioural_Stat_h
+
+#include "Behavioural/include/Parameters_Statistics.h"
+#include "Behavioural/include/Stat_type.h"
+#include "Behavioural/include/Stat_binary_tree.h"
+#include "Behavioural/include/XML.h"
+#include "Common/include/ErrorMorpheo.h"
+#include "Common/include/Message.h"
+
+#ifdef SYSTEMC
+#include "systemc.h"
+#endif
+
+#include <stdint.h>
+#include <string>
+#include <map>
+#include <list>
+#include <iostream>
+
+namespace morpheo {
+  namespace behavioural {
+
+    typedef double cycle_t;
+  
+    typedef struct 
+    {
+      counter_type_t type;
+      counter_t *    counter;
+      std::string    name;
+      std::string    unit;
+      std::string    description;
+      std::list<counter_t> save_counter;
+    } var_t;
+  
+    typedef struct 
+    {
+      bool               each_cycle;
+      counter_t        * variable;
+      Stat_binary_tree * expression;
+    } expr_t;
+
+    class Stat
+    {
+      const std::string              _name_instance;
+      const std::string              _name_component;
+      const cycle_t                  _nb_cycle_before_begin;
+      const cycle_t                  _period;
+      const bool                     _save_periodic;
+      // Tableau des variables
+      std::map<std::string, var_t> * _list_operand;
+      // Liste chaîné des expressions
+      std::list<expr_t>            * _list_expr;
+
+      counter_t                    * _cycle;
+
+    public :                     Stat            (std::string name_instance,
+						  std::string name_component,
+						  Parameters_Statistics * param);
+
+    public :                     Stat            (std::string name_instance,
+						  std::string name_component,
+						  cycle_t nb_cycle_before_begin=0,
+						  cycle_t period=0);
+    public :                    ~Stat            (void);
+     
+    public  : counter_t *        create_variable (std::string varname);
+    public  : counter_t *        create_counter  (std::string varname,
+						  std::string unit,
+						  std::string description);
+    private : counter_t *        alloc_operand   (counter_type_t type,
+						  std::string varname,
+						  std::string unit,
+						  std::string description);
+    public  : void               create_expr     (std::string varname,
+						  std::string expr,
+						  bool each_cycle=true);
+
+    private : Stat_binary_tree * string2tree     (std::string expr);
+
+    public  : void               end_cycle       (void);
+    private : void               end_simulation  (void);
+    private : void               test_and_save   (bool force_save=false);
+    private : void               eval_exprs      (bool only_each_cycle=true);
+    private : void               eval_expr       (expr_t expr);
+      
+    private : bool               is_valid_var    (std::string expr);
+
+    private : void               generate_file   (void);
+
+    public  : std::string        print           (uint32_t depth=0);
+    };
+
+  };
+};
+#endif
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Stat_binary_tree.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Stat_binary_tree.h	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Stat_binary_tree.h	(revision 71)
@@ -0,0 +1,62 @@
+#ifdef STATISTICS
+#ifndef morpheo_behavioural_Stat_binary_tree_h
+#define morpheo_behavioural_Stat_binary_tree_h
+
+#include "Behavioural/include/Stat_type.h"
+#include "Common/include/ErrorMorpheo.h"
+#include "Common/include/Message.h"
+#include <string>
+#include <map>
+#include <list>
+#include <iostream>
+
+namespace morpheo {
+namespace behavioural {
+
+  typedef enum {VARIABLE, CONSTANT, OPERATOR_UNARY, OPERATOR_BINARY} data_type_t;
+
+  typedef union 
+  {
+    counter_t   cst;
+    counter_t * var;
+    operator_t  op;
+  } data_t;
+
+class Stat_binary_tree
+  {
+    // arbre binaire
+    private : Stat_binary_tree * _root;
+    private : Stat_binary_tree * _left;
+    private : Stat_binary_tree * _right;
+    private : data_type_t        _data_type;
+    private : data_t             _data;
+    
+    /*     private :  Stat_binary_tree (data_type_t data_type, data_t data); */
+    public  :  Stat_binary_tree (counter_t   cst);
+    public  :  Stat_binary_tree (counter_t * var);
+    public  :  Stat_binary_tree (operator_t  op );
+  
+    public  : ~Stat_binary_tree (void);
+    
+    private : void               insert_tree (Stat_binary_tree * tree);
+    public  : Stat_binary_tree * insert_tree (counter_t   cst);
+    public  : Stat_binary_tree * insert_tree (counter_t * var);
+    public  : Stat_binary_tree * insert_tree (operator_t  op );
+
+    public  : Stat_binary_tree * goto_top_level (void);
+    public  : Stat_binary_tree * goto_next_root (void);
+
+    public  : bool      valid    (void);
+
+    public  : counter_t eval     (void);
+
+    private : counter_t val_tree (void);
+    private : counter_t val_leaf (void);
+    private : bool      is_leaf  (void);
+
+//     public  : friend std::ostream& operator<< (std::ostream&, const morpheo::Stat_binary_tree &);
+  };
+};
+};
+#endif
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Stat_type.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Stat_type.h	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Stat_type.h	(revision 71)
@@ -0,0 +1,24 @@
+#ifdef STATISTICS
+#ifndef morpheo_behavioural_Stat_type_h
+#define morpheo_behavioural_Stat_type_h
+
+#include <string>
+#include <map>
+#include <utility>
+
+namespace morpheo {
+namespace behavioural {
+
+  typedef enum{TYPE_VARIABLE, TYPE_COUNTER} counter_type_t;
+
+  typedef double counter_t ;
+
+  typedef enum{add, sub, mul, div, inc, dec} operator_t;
+
+//typedef std::pair<operator_t, std::string> pair_operator_string_t;
+//typedef std::pair<std::string, operator_t> pair_string_operator_t;
+
+};
+};
+#endif
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Statistics.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Statistics.h	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Statistics.h	(revision 71)
@@ -18,6 +18,4 @@
 #include "Common/include/Percent.h"
 
-using namespace std;
-
 namespace morpheo              {
 namespace behavioural          {
@@ -26,5 +24,5 @@
   {
     // -----[ fields ]----------------------------------------------------
-  protected : const string                  _name;
+  protected : const std::string                  _name;
   protected : const Parameters_Statistics * _parameters_statistics;
 
@@ -33,5 +31,5 @@
 
     // -----[ methods ]---------------------------------------------------
-  public    :                  Statistics          (string                  name                 ,
+  public    :                  Statistics          (std::string                  name                 ,
 						    Parameters_Statistics * parameters_statistics);
   public    : virtual          ~Statistics         ();
@@ -40,7 +38,7 @@
   protected : uint32_t         compute_cycle_end   (uint32_t num_statistics, uint32_t nb_cycle);
 
-  public    : virtual string   print_body          (uint32_t depth) = 0;
-  public    : virtual string   print               (uint32_t depth) = 0;
-  public    : void             generate_file       (string   stat );
+  public    : virtual std::string   print_body          (uint32_t depth) = 0;
+  public    : virtual std::string   print               (uint32_t depth) = 0;
+  public    : void             generate_file       (std::string   stat );
   public    : void             generate_file       (void);
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Vhdl.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Vhdl.h	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Vhdl.h	(revision 71)
@@ -20,129 +20,127 @@
 #include "Common/include/ErrorMorpheo.h"
 
-using namespace std;
+namespace morpheo              {
+  namespace behavioural          {
 
-namespace morpheo              {
-namespace behavioural          {
+    std::string std_logic        (uint32_t size);
+    std::string std_logic_conv   (uint32_t size, std::string   value);
+    std::string std_logic_conv   (uint32_t size, uint32_t value);
+    std::string std_logic_range  (uint32_t size, uint32_t max , uint32_t min  );
+    std::string std_logic_range  (uint32_t max , uint32_t min  );
+    std::string std_logic_range  (uint32_t size);
+    std::string std_logic_others (uint32_t size, uint32_t cst  );
 
-  string std_logic        (uint32_t size);
-  string std_logic_conv   (uint32_t size, string   value);
-  string std_logic_conv   (uint32_t size, uint32_t value);
-  string std_logic_range  (uint32_t size, uint32_t max , uint32_t min  );
-  string std_logic_range  (uint32_t max , uint32_t min  );
-  string std_logic_range  (uint32_t size);
-  string std_logic_others (uint32_t size, uint32_t cst  );
+    class Vhdl
+    {
+      // -----[ fields ]----------------------------------------------------
+    private   : const std::string     _name                         ;
 
-  class Vhdl
-  {
-    // -----[ fields ]----------------------------------------------------
-  private   : const string     _name                         ;
+    private   : std::list<std::string>     _list_library_work            ;
+    private   : std::list<std::string>     _list_signal                  ;
+    private   : std::list<std::string>     _list_type                    ;
+    private   : std::list<std::string>     _list_alias                   ;
+    private   : std::list<std::string>     _list_port                    ;
+    private   : std::list<std::string>     _list_body                    ;
 
-  private   : list<string>     _list_library_work            ;
-  private   : list<string>     _list_signal                  ;
-  private   : list<string>     _list_type                    ;
-  private   : list<string>     _list_alias                   ;
-  private   : list<string>     _list_port                    ;
-  private   : list<string>     _list_body                    ;
-    
-    // -----[ methods ]---------------------------------------------------
-  public    :                  Vhdl                        (string name);
-  public    :                  ~Vhdl                       ();
-						           
-  public    : void             generate_file               (void);
-  public    : void             generate_file               (bool generate_package,
-							    bool generate_model  );
+      // -----[ methods ]---------------------------------------------------
+    public    :                  Vhdl                        (std::string name);
+    public    :                  ~Vhdl                       ();
 
-  private   : void             generate_file_package       (void);
-  private   : void             generate_file_model         (void);
-  
-  private   : string           get_package                 (uint32_t    depth                 ,
-							    string      filename              ,
-							    string      package_name          ,
-							    string      entity_name           );
-  private   : string           get_model                   (uint32_t    depth                 ,
-							    string      filename              ,
-							    string      entity_name           ,
-							    string      architecture_name     );
-  private   : string           get_header                  (uint32_t    depth                 ,
-							    string      filename              );
-  private   : string           get_entity                  (uint32_t    depth                 ,
-							    string      name                  );
-  private   : string           get_architecture            (uint32_t    depth                 , 
-							    string      name                  ,
-							    string      entity_name           );
-  private   : string           get_component               (uint32_t    depth                 ,
-							    string      name                  );
+    public    : void             generate_file               (void);
+    public    : void             generate_file               (bool generate_package,
+							      bool generate_model  );
 
-  private   : string           get_port                    (uint32_t    depth                 );
-  public    : void             set_port                    (string      name                  ,
-							    direction_t direction             ,
-							    string      type                  );
-  public    : void             set_port                    (string      name                  ,
-							    direction_t direction             ,
-							    uint32_t    size                  );
-  private   : string           get_signal                  (uint32_t    depth                 );
-  public    : void             set_signal                  (string      name                  ,
-							    string      type                  );
-  public    : void             set_signal                  (string      name                  ,
-							    uint32_t    signal                );
-  public    : void             set_signal                  (string      name                  ,
-							    string      type                  ,
-							    string      init                  );
-  public    : void             set_signal                  (string      name                  ,
-							    uint32_t    size                  ,
-							    string      init                  );
-  public    : void             set_signal                  (string      name                  ,
-							    uint32_t    size                  ,
-							    uint32_t    init                  );
-  public    : void             set_constant                (string      name                  ,
-							    string      type                  ,
-							    string      init                  );
-  public    : void             set_constant                (string      name                  ,
-							    uint32_t    size                  ,
-							    string      init                  );
-  public    : void             set_constant                (string      name                  ,
-							    uint32_t    size                  ,
-							    uint32_t    init                  );
+    private   : void             generate_file_package       (void);
+    private   : void             generate_file_model         (void);
 
-  private   : string           get_type                    (uint32_t    depth                 );
-  public    : void             set_type                    (string      name                  ,
-							    string      type                  );
-  private   : string           get_alias                   (uint32_t    depth                 );
-  public    : void             set_alias                   (string      name1                 ,
-							    string      type1                 ,
-							    string      name2                 ,
-							    string      range2                );
-  public    : void             set_alias                   (string      name1                 ,
-							    uint32_t    size1                 ,
-							    string      name2                 ,
-							    string      range2                );
+    private   : std::string           get_package                 (uint32_t    depth                 ,
+								   std::string      filename              ,
+								   std::string      package_name          ,
+								   std::string      entity_name           );
+    private   : std::string           get_model                   (uint32_t    depth                 ,
+								   std::string      filename              ,
+								   std::string      entity_name           ,
+								   std::string      architecture_name     );
+    private   : std::string           get_header                  (uint32_t    depth                 ,
+								   std::string      filename              );
+    private   : std::string           get_entity                  (uint32_t    depth                 ,
+								   std::string      name                  );
+    private   : std::string           get_architecture            (uint32_t    depth                 , 
+								   std::string      name                  ,
+								   std::string      entity_name           );
+    private   : std::string           get_component               (uint32_t    depth                 ,
+								   std::string      name                  );
 
-  public    : string           get_list                    (list<string> liste                ,
-							    uint32_t     depth                ,
-							    string       separator            ,
-							    bool         last_separator       );
-  public    : void             set_list                    (list<string> & liste              ,
-							    string         text               );
+    private   : std::string           get_port                    (uint32_t    depth                 );
+    public    : void             set_port                    (std::string      name                  ,
+							      direction_t direction             ,
+							      std::string      type                  );
+    public    : void             set_port                    (std::string      name                  ,
+							      direction_t direction             ,
+							      uint32_t    size                  );
+    private   : std::string           get_signal                  (uint32_t    depth                 );
+    public    : void             set_signal                  (std::string      name                  ,
+							      std::string      type                  );
+    public    : void             set_signal                  (std::string      name                  ,
+							      uint32_t    signal                );
+    public    : void             set_signal                  (std::string      name                  ,
+							      std::string      type                  ,
+							      std::string      init                  );
+    public    : void             set_signal                  (std::string      name                  ,
+							      uint32_t    size                  ,
+							      std::string      init                  );
+    public    : void             set_signal                  (std::string      name                  ,
+							      uint32_t    size                  ,
+							      uint32_t    init                  );
+    public    : void             set_constant                (std::string      name                  ,
+							      std::string      type                  ,
+							      std::string      init                  );
+    public    : void             set_constant                (std::string      name                  ,
+							      uint32_t    size                  ,
+							      std::string      init                  );
+    public    : void             set_constant                (std::string      name                  ,
+							      uint32_t    size                  ,
+							      uint32_t    init                  );
 
-  private   : string           get_body                    (uint32_t       depth              );
-  public    : void             set_body                    (string         text               );
+    private   : std::string           get_type                    (uint32_t    depth                 );
+    public    : void             set_type                    (std::string      name                  ,
+							      std::string      type                  );
+    private   : std::string           get_alias                   (uint32_t    depth                 );
+    public    : void             set_alias                   (std::string      name1                 ,
+							      std::string      type1                 ,
+							      std::string      name2                 ,
+							      std::string      range2                );
+    public    : void             set_alias                   (std::string      name1                 ,
+							      uint32_t    size1                 ,
+							      std::string      name2                 ,
+							      std::string      range2                );
 
-  public    : void             set_body_component          (string         name_instance      ,
-							    string         name_component     ,
-							    list<string>   list_port_map      );
-  public    : void             set_body_component_port_map (list<string> & list_port_map      ,
-							    string         name_port          ,
-							    uint32_t       size_port          ,
-							    string         name_signal        ,
-							    uint32_t       size_signal        );
+    public    : std::string           get_list                    (std::list<std::string> liste                ,
+								   uint32_t     depth                ,
+								   std::string       separator            ,
+								   bool         last_separator       );
+    public    : void             set_list                    (std::list<std::string> & liste              ,
+							      std::string         text               );
 
-  private   : string           get_library_ieee            (uint32_t    depth                 );
-  private   : string           get_library_work            (uint32_t    depth                 );
-  public    : void             set_library_work            (string      package_name          );
+    private   : std::string           get_body                    (uint32_t       depth              );
+    public    : void             set_body                    (std::string         text               );
 
-  private   : string           direction_toString          (direction_t direction);
-  };
+    public    : void        set_body_component          (std::string         name_instance      ,
+							 std::string         name_component     ,
+							 std::list<std::string>   list_port_map      );
+    public    : void        set_body_component_port_map (std::list<std::string> & list_port_map      ,
+							 std::string         name_port          ,
+							 uint32_t       size_port          ,
+							 std::string         name_signal        ,
+							 uint32_t       size_signal        );
 
-}; // end namespace behavioural          
+    private   : std::string get_library_ieee            (uint32_t    depth                 );
+    private   : std::string get_library_work            (uint32_t    depth                 );
+    public    : void        set_library_work            (std::string      package_name          );
+
+    private   : std::string direction_toString          (direction_t direction);
+    };
+
+  }; // end namespace behavioural          
 }; // end namespace morpheo              
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/XML.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/XML.h	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/XML.h	(revision 71)
@@ -16,6 +16,4 @@
 #include "Common/include/Debug.h"
 
-using namespace std;
-
 namespace morpheo     {
 namespace behavioural {
@@ -25,37 +23,37 @@
   {
     // -----[ fields ]----------------------------------------------------
-  private  : const string     _name              ;
-  private  : string           _filename_extension;
-  private  : string           _body              ;
-  private  : list<string>     _list_balise_name  ;
+  private  : const std::string     _name              ;
+  private  : std::string           _filename_extension;
+  private  : std::string           _body              ;
+  private  : std::list<std::string>     _list_balise_name  ;
 
     // -----[ methods ]---------------------------------------------------
-  public   :                  XML                 (string name);
+  public   :                  XML                 (std::string name);
   public   :                  ~XML                (void);
 	
-  public   : bool             balise_open         (string name); // no attribut
-  public   : bool             balise_open_begin   (string name);
+  public   : bool             balise_open         (std::string name); // no attribut
+  public   : bool             balise_open_begin   (std::string name);
   public   : bool             balise_open_end     (void);      
   public   : bool             balise_close        (void);      
-  public   : bool             singleton           (string name); // no attribut
-  public   : bool             singleton_begin     (string name);
+  public   : bool             singleton           (std::string name); // no attribut
+  public   : bool             singleton_begin     (std::string name);
   public   : bool             singleton_end       (void);
-  public   : bool             attribut            (string name, string value);
+  public   : bool             attribut            (std::string name, std::string value);
   public   : bool             insert_XML          (XML    xml );
 
-  public   : void             filename_extension  (string extension);
+  public   : void             filename_extension  (std::string extension);
   public   : void             generate_file       (void);
-  public   : void             generate_file       (string encoding);
-  public   : string           get_body            (void);
-  public   : string           get_body            (uint32_t depth);
+  public   : void             generate_file       (std::string encoding);
+  public   : std::string           get_body            (void);
+  public   : std::string           get_body            (uint32_t depth);
 
-  public   : bool             comment             (string text);
-  public   : bool             text                (string text);
+  public   : bool             comment             (std::string text);
+  public   : bool             text                (std::string text);
 					          
-  private  : string           indent              (uint32_t depth );
-  private  : string           indent              (void);
+  private  : std::string           indent              (uint32_t depth );
+  private  : std::string           indent              (void);
   private  : uint32_t         depth               (void);
 					          
-  private  : void             header              (string encoding);
+  private  : void             header              (std::string encoding);
   };
 }; // end namespace behavioural          
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Parameters_test.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Parameters_test.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Parameters_test.cpp	(revision 71)
@@ -17,5 +17,5 @@
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
-    string msg = msg_error();
+    std::string msg = msg_error();
     
     if (msg.length() != 0)
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat.cpp	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat.cpp	(revision 71)
@@ -0,0 +1,64 @@
+#ifdef STATISTICS
+#include "Behavioural/include/Stat.h"
+
+namespace morpheo {
+namespace behavioural {
+
+  Stat::Stat (std::string name_instance,
+	      std::string name_component,
+	      Parameters_Statistics * param):
+    _name_instance         (name_instance),
+    _name_component        (name_component),
+    _nb_cycle_before_begin (static_cast<cycle_t>(param->_nb_cycle_before_begin)),
+    _period                (static_cast<cycle_t>(param->_period_save)),
+    _save_periodic         (_period>0)
+  {
+    _list_operand  = new std::map<std::string, var_t>;
+    _list_expr     = new std::list<expr_t>;
+
+    _cycle         = create_variable("cycle");
+    *_cycle        = 0; // for the first period
+  }
+
+  Stat::Stat (std::string name_instance,
+	      std::string name_component,
+	      cycle_t nb_cycle_before_begin,
+	      cycle_t period):
+    _name_instance         (name_instance),
+    _name_component        (name_component),
+    _nb_cycle_before_begin (nb_cycle_before_begin),
+    _period                (period),
+    _save_periodic         (period>0)
+  {
+    _list_operand  = new std::map<std::string, var_t>;
+    _list_expr     = new std::list<expr_t>;
+
+    _cycle         = create_variable("cycle");
+    *_cycle        = 0; // for the first period
+  }
+
+  Stat::~Stat (void)
+  {
+    generate_file();
+
+    // parcourir la liste et desallouer les counters
+    for (std::map<std::string, var_t>::iterator i=_list_operand->begin();
+	 i!= _list_operand->end();
+	 ++i)
+      {
+	delete i->second.counter;
+      }
+    delete _list_operand;
+
+    // parcourir la liste et desallouer les arbres
+    for (std::list<expr_t>::iterator i=_list_expr->begin();
+	 i!= _list_expr->end();
+	 ++i)
+      {
+	delete i->expression;
+      }
+    delete _list_expr;
+  }
+};
+};
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_alloc_operand.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_alloc_operand.cpp	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_alloc_operand.cpp	(revision 71)
@@ -0,0 +1,29 @@
+#ifdef STATISTICS
+#include "Behavioural/include/Stat.h"
+
+namespace morpheo {
+namespace behavioural {
+  counter_t * Stat::alloc_operand (counter_type_t type, std::string varname, std::string unit, std::string description)
+  {
+    if (not is_valid_var (varname))
+      throw(ERRORMORPHEO("Stat::alloc_operand",_("Variable is not valid.")));
+
+    counter_t * counter = new counter_t;
+    var_t       var;
+
+    var.counter     = counter;
+    var.type        = type;
+    var.name        = varname;
+    var.unit        = unit;
+    var.description = description;
+
+    // insertion dans la table
+    (*_list_operand) [varname] = var;
+
+    *counter        = 0;
+    
+    return counter;
+  }
+};
+};
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_binary_tree.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_binary_tree.cpp	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_binary_tree.cpp	(revision 71)
@@ -0,0 +1,72 @@
+#ifdef STATISTICS
+#include "Behavioural/include/Stat_binary_tree.h"
+
+namespace morpheo {
+namespace behavioural {
+//   static pair_operator_string_t operator2string [] = {std::make_pair(add,"+" ),
+// 						      std::make_pair(sub,"-" ),
+// 						      std::make_pair(mul,"*" ),
+// 						      std::make_pair(div,"/" ),
+// 						      std::make_pair(inc,"++"),
+// 						      std::make_pair(dec,"--")};
+
+// Stat_binary_tree:: Stat_binary_tree (data_type_t data_type, data_t data)
+//   {
+//     _valid_left  = false;
+//     _valid_right = false;
+//     _data_type   = data_type;
+//     _data        = data;
+//   }
+  
+  Stat_binary_tree:: Stat_binary_tree (counter_t   cst)
+  {
+    _root  = NULL;
+    _left  = NULL;
+    _right = NULL;
+
+    data_t data;
+    data.cst = cst;
+    _data_type   = CONSTANT;
+    _data        = data;
+
+//     Stat_binary_tree(CONSTANT, data);
+  }
+  
+  Stat_binary_tree:: Stat_binary_tree (counter_t * var)
+  {
+    _root  = NULL;
+    _left  = NULL;
+    _right = NULL;
+
+    data_t data;
+    data.var   = var;
+    _data_type = VARIABLE;
+    _data      = data;
+
+//     Stat_binary_tree(VARIABLE, data);
+  }
+
+  Stat_binary_tree:: Stat_binary_tree (operator_t  op)
+  {
+    _root  = NULL;
+    _left  = NULL;
+    _right = NULL;
+
+    data_t data;
+    data.op    = op;
+    _data_type = ((op == inc) or (op == dec))?OPERATOR_UNARY:OPERATOR_BINARY;
+    _data      = data;
+
+  }
+
+  Stat_binary_tree::~Stat_binary_tree (void)
+  {
+    if (_left  != NULL)
+      delete _left;
+    if (_right != NULL)
+      delete _right;
+  }
+
+};
+};
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_binary_tree_eval.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_binary_tree_eval.cpp	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_binary_tree_eval.cpp	(revision 71)
@@ -0,0 +1,15 @@
+#ifdef STATISTICS
+#include "Behavioural/include/Stat_binary_tree.h"
+
+namespace morpheo {
+namespace behavioural {  
+  counter_t Stat_binary_tree::eval (void)
+  {
+    if (is_leaf ())
+      return val_leaf();
+    else
+      return val_tree();
+  }
+};  
+};
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_binary_tree_goto_next_root.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_binary_tree_goto_next_root.cpp	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_binary_tree_goto_next_root.cpp	(revision 71)
@@ -0,0 +1,25 @@
+#ifdef STATISTICS
+#include "Behavioural/include/Stat_binary_tree.h"
+
+namespace morpheo {
+namespace behavioural {
+  Stat_binary_tree * Stat_binary_tree::goto_next_root (void)
+  {
+    if ((_data_type == OPERATOR_BINARY) and 
+	((_left  == NULL ) or
+	 (_right == NULL )))
+      return this;
+    
+    if ((_data_type == OPERATOR_UNARY) and
+	((_left  == NULL )))
+      return this;
+
+    if (_root == NULL)
+      throw(ERRORMORPHEO("Stat_binary_tree::goto_next_root",_("Invalid root.")));
+
+    return _root->goto_next_root();
+  }
+
+};
+};
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_binary_tree_goto_top_level.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_binary_tree_goto_top_level.cpp	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_binary_tree_goto_top_level.cpp	(revision 71)
@@ -0,0 +1,18 @@
+#ifdef STATISTICS
+#include "Behavioural/include/Stat_binary_tree.h"
+
+namespace morpheo {
+namespace behavioural {
+  Stat_binary_tree * Stat_binary_tree::goto_top_level (void)
+  {
+    Stat_binary_tree * tree = this;
+
+    while (tree->_root != NULL)
+      tree = tree->_root;
+
+    return tree;
+  }
+
+};
+};
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_binary_tree_insert_tree.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_binary_tree_insert_tree.cpp	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_binary_tree_insert_tree.cpp	(revision 71)
@@ -0,0 +1,41 @@
+#ifdef STATISTICS
+#include "Behavioural/include/Stat_binary_tree.h"
+
+namespace morpheo {
+namespace behavioural {
+
+  void Stat_binary_tree::insert_tree  (Stat_binary_tree * tree)
+  {
+    tree->_root = this;
+
+    if (_left == NULL)
+      _left = tree;
+    else
+      if (_right == NULL)
+	_right = tree;
+      else
+	throw(ERRORMORPHEO("Stat_binary_tree::insert_tree",_("This root is full (left and right don't NULL).")));
+  }
+
+  Stat_binary_tree * Stat_binary_tree::insert_tree (counter_t   cst)
+  {
+    Stat_binary_tree * tree = new Stat_binary_tree (cst);
+    insert_tree (tree);
+    return (tree);
+  }
+
+  Stat_binary_tree * Stat_binary_tree::insert_tree (counter_t * var)
+  {
+    Stat_binary_tree * tree = new Stat_binary_tree (var);
+    insert_tree (tree);
+    return (tree);
+  }
+  Stat_binary_tree * Stat_binary_tree::insert_tree (operator_t  op )
+  {
+    Stat_binary_tree * tree = new Stat_binary_tree (op);
+    insert_tree (tree);
+    return (tree);
+  }
+};
+};
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_binary_tree_is_leaf.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_binary_tree_is_leaf.cpp	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_binary_tree_is_leaf.cpp	(revision 71)
@@ -0,0 +1,12 @@
+#ifdef STATISTICS
+#include "Behavioural/include/Stat_binary_tree.h"
+
+namespace morpheo {
+namespace behavioural {  
+  bool      Stat_binary_tree::is_leaf  (void)
+  {
+    return ((_left == NULL) and (_right == NULL));
+  }
+};
+};
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_binary_tree_val_leaf.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_binary_tree_val_leaf.cpp	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_binary_tree_val_leaf.cpp	(revision 71)
@@ -0,0 +1,21 @@
+#ifdef STATISTICS
+#include "Behavioural/include/Stat_binary_tree.h"
+
+namespace morpheo {
+namespace behavioural {  
+  counter_t Stat_binary_tree::val_leaf (void)
+  {
+    if (_data_type == CONSTANT)
+      {
+	return _data.cst;
+      }
+    if (_data_type == VARIABLE)
+      {
+	return *(_data.var);
+      }
+    
+    throw(ERRORMORPHEO("Stat_binary_tree::val_leaf",_("Invalid leaf.")));
+  }
+};  
+};
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_binary_tree_val_tree.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_binary_tree_val_tree.cpp	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_binary_tree_val_tree.cpp	(revision 71)
@@ -0,0 +1,23 @@
+#ifdef STATISTICS
+#include "Behavioural/include/Stat_binary_tree.h"
+
+namespace morpheo {
+namespace behavioural {  
+  counter_t Stat_binary_tree::val_tree    (void)
+  {
+    switch (_data.op)
+      {
+      case add : return _left->eval() + _right->eval();
+      case sub : return _left->eval() - _right->eval();
+      case mul : return _left->eval() * _right->eval();
+      case div : return _left->eval() / _right->eval();
+      case inc : return _left->eval() + 1;
+      case dec : return _left->eval() - 1;
+      default : throw(ERRORMORPHEO("Stat_binary_tree::val_tree",_("Unknow operator.")));
+      }
+    
+    return 0;
+  }
+};  
+};
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_binary_tree_valid.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_binary_tree_valid.cpp	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_binary_tree_valid.cpp	(revision 71)
@@ -0,0 +1,28 @@
+#ifdef STATISTICS
+#include "Behavioural/include/Stat_binary_tree.h"
+
+namespace morpheo {
+namespace behavioural {
+  bool Stat_binary_tree::valid (void)
+  {
+    if ((_data_type == VARIABLE) or
+	(_data_type == CONSTANT))
+      return ((_left  == NULL) and
+	      (_right == NULL) );
+
+    if (_data_type == OPERATOR_UNARY)
+      return ((_right == NULL) and
+	      (_left  != NULL) and
+	      (_left->valid()));
+
+    if (_data_type == OPERATOR_BINARY)
+      return ((_left  != NULL ) and
+	      (_left ->valid()) and
+	      (_right != NULL ) and
+	      (_right->valid()));
+
+    return false;
+  }
+};
+};
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_create_counter.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_create_counter.cpp	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_create_counter.cpp	(revision 71)
@@ -0,0 +1,13 @@
+#ifdef STATISTICS
+#include "Behavioural/include/Stat.h"
+
+namespace morpheo {
+namespace behavioural {
+  counter_t * Stat::create_counter (std::string varname, std::string unit, std::string description)
+  {
+    return alloc_operand (TYPE_COUNTER, varname, unit, description);
+  }
+
+};
+};
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_create_expr.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_create_expr.cpp	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_create_expr.cpp	(revision 71)
@@ -0,0 +1,21 @@
+#ifdef STATISTICS
+#include "Behavioural/include/Stat.h"
+
+namespace morpheo {
+namespace behavioural {
+  void        Stat::create_expr     (std::string varname, std::string expr, bool each_cycle)
+  {
+    if (is_valid_var (varname))
+      throw(ERRORMORPHEO("Stat::create_expr",_("Variable is not valid.")));
+    
+    expr_t expression;
+
+    expression.variable   = (*_list_operand) [varname].counter;
+    expression.expression = string2tree(expr);
+    expression.each_cycle = each_cycle;
+
+    _list_expr->push_back(expression);
+  }
+};
+};
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_create_variable.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_create_variable.cpp	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_create_variable.cpp	(revision 71)
@@ -0,0 +1,12 @@
+#ifdef STATISTICS
+#include "Behavioural/include/Stat.h"
+
+namespace morpheo {
+namespace behavioural {  
+  counter_t * Stat::create_variable (std::string varname)
+  {
+    return alloc_operand (TYPE_VARIABLE, varname, "", "variable : " + varname);
+  }
+};
+};
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_end_cycle.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_end_cycle.cpp	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_end_cycle.cpp	(revision 71)
@@ -0,0 +1,21 @@
+#ifdef STATISTICS
+#include "Behavioural/include/Stat.h"
+
+namespace morpheo {
+namespace behavioural {  
+  void Stat::end_cycle (void)
+  {
+    cycle_t _cycle_sum = sc_simulation_time();
+
+    if (_cycle_sum >= _nb_cycle_before_begin)
+      {
+	(*_cycle) ++;
+
+	eval_exprs(true);
+
+	test_and_save(false);
+      }
+  }
+};  
+};
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_end_simulation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_end_simulation.cpp	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_end_simulation.cpp	(revision 71)
@@ -0,0 +1,12 @@
+#ifdef STATISTICS
+#include "Behavioural/include/Stat.h"
+
+namespace morpheo {
+namespace behavioural {  
+  void Stat::end_simulation (void)
+  {
+    test_and_save(true); // force la sauvegarde
+  }
+};  
+};
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_eval_expr.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_eval_expr.cpp	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_eval_expr.cpp	(revision 71)
@@ -0,0 +1,12 @@
+#ifdef STATISTICS
+#include "Behavioural/include/Stat.h"
+
+namespace morpheo {
+namespace behavioural {
+  void        Stat::eval_expr       (expr_t expr)
+  {
+    (*expr.variable) = expr.expression->eval();
+  }
+};  
+};
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_eval_exprs.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_eval_exprs.cpp	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_eval_exprs.cpp	(revision 71)
@@ -0,0 +1,19 @@
+#ifdef STATISTICS
+#include "Behavioural/include/Stat.h"
+
+namespace morpheo {
+namespace behavioural {  
+  void Stat::eval_exprs (bool only_each_cycle)
+  {
+    // parcourir la liste et desallouer les counters
+    for (std::list<expr_t>::iterator i=_list_expr->begin();
+	 i!= _list_expr->end();
+	 ++i)
+      {
+	if (i->each_cycle == only_each_cycle)
+	  eval_expr (*i);
+      }
+  }
+};  
+};
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_generate_file.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_generate_file.cpp	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_generate_file.cpp	(revision 71)
@@ -0,0 +1,33 @@
+#ifdef STATISTICS
+#include "Behavioural/include/Stat.h"
+
+namespace morpheo {
+namespace behavioural {  
+
+  void Stat::generate_file (void)
+  {
+    std::string body = print(1);
+
+    cycle_t _cycle_sum = sc_simulation_time();
+
+    morpheo::behavioural::XML * xml = new morpheo::behavioural::XML (_name_instance);
+
+    xml->balise_open_begin("statistics");
+    xml->attribut("nb_cycle_before_begin",toString(_nb_cycle_before_begin));
+    xml->attribut("period",toString(_period));
+    xml->attribut("nb_cycle_simulation",toString(_cycle_sum));
+    xml->attribut("nb_cycle_statistics",toString(_cycle_sum-_nb_cycle_before_begin));
+    xml->balise_open_end();
+
+    xml->text (body);
+
+    xml->balise_close();
+
+    xml->filename_extension ("stat");
+    xml->generate_file();
+
+    delete xml;
+  }
+};  
+};
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_is_valid_var.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_is_valid_var.cpp	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_is_valid_var.cpp	(revision 71)
@@ -0,0 +1,16 @@
+#ifdef STATISTICS
+#include "Behavioural/include/Stat.h"
+
+namespace morpheo {
+namespace behavioural {
+  
+  bool        Stat::is_valid_var    (std::string var)
+  {
+    // est ce que le nom de variable est valide
+    // est ce que ce nom n'a pas déjà été utilisé
+    return (_list_operand->find(var) == _list_operand->end());
+  }
+
+};
+};
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_print.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_print.cpp	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_print.cpp	(revision 71)
@@ -0,0 +1,77 @@
+#ifdef STATISTICS
+#include "Behavioural/include/Stat.h"
+
+namespace morpheo {
+namespace behavioural {  
+
+  std::string Stat::print (uint32_t depth)
+  {
+    end_simulation(); 
+
+    cycle_t _cycle_sum = sc_simulation_time();
+
+    morpheo::behavioural::XML xml (_name_instance);
+
+    xml.balise_open_begin(_name_component);
+    xml.attribut("name",_name_instance);
+    xml.balise_open_end();
+
+    // Test special case
+    if (_cycle_sum < _nb_cycle_before_begin)
+      {
+	xml.comment(_("Number of cycle is less than the number minimal"));
+      }
+    else
+      {
+	bool stop = false;
+	cycle_t nb_cycle_min;
+	cycle_t nb_cycle_max = _nb_cycle_before_begin-1;
+	for (cycle_t period=0; stop==false; period++)
+	  {
+	    std::map<std::string, var_t>::iterator operand=_list_operand->begin();
+
+	    if (operand->second.save_counter.size()==0)
+	      throw(ERRORMORPHEO("Stat::generate_file",_("Queue 'save_counter' is empty.")));
+
+	    bool last = operand->second.save_counter.size()==1;
+
+	    nb_cycle_min  = nb_cycle_max+1;
+
+	    if (last)
+	      nb_cycle_max = static_cast<cycle_t>(_cycle_sum);
+	    else
+	      nb_cycle_max += _period;
+
+	    xml.balise_open_begin("period");
+	    xml.attribut("number",toString(period));
+	    xml.attribut("nb_cycle_min",toString(nb_cycle_min));
+	    xml.attribut("nb_cycle_max",toString(nb_cycle_max));
+	    xml.balise_open_end();
+	    
+	    for (;
+		 operand!= _list_operand->end();
+		 ++operand)
+	      {
+		if (operand->second.type == TYPE_COUNTER)
+		  {
+		    xml.singleton_begin(operand->second.name);
+		    xml.attribut("value",toString(operand->second.save_counter.front()));
+		    xml.attribut("unit",operand->second.unit);
+		    xml.attribut("description",operand->second.description);
+		    xml.singleton_end();
+		  }
+		operand->second.save_counter.pop_front();
+	      }
+
+	    xml.balise_close();
+	    
+	    stop = last;
+	  }
+      }
+    xml.balise_close();
+
+    return xml.get_body(depth);
+  }
+};  
+};
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_string2tree.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_string2tree.cpp	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_string2tree.cpp	(revision 71)
@@ -0,0 +1,134 @@
+#ifdef STATISTICS
+#include "Behavioural/include/Stat.h"
+
+namespace morpheo {
+namespace behavioural {
+
+#define string2operator(x) (x=="+")?add:((x=="-")?sub:((x=="*")?mul:((x=="/" )?div:((x=="++")?inc:dec))))
+
+  Stat_binary_tree * Stat::string2tree     (std::string expr)
+  {
+    std::cout << "expr : " << expr << std::endl;
+
+    const std::string delims  (" ");          // délimiteur : " "
+    const std::string numbers ("0123456789"); // délimiteur : " "
+    std::string::size_type index_begin, index_end;
+
+    Stat_binary_tree * tree = NULL;
+
+    index_begin = expr.find_first_not_of(delims);
+
+    while (index_begin != std::string::npos)
+      {
+	index_end = expr.find_first_of(delims, index_begin);
+
+	if (index_end == std::string::npos)
+	  {
+	    index_end = expr.length();
+	  }
+	
+	std::string str = expr.substr(index_begin, index_end-index_begin);
+	
+	// 3 possibilités :
+	//  * operator
+	//  * constante
+	//  * variable
+	{
+	  // Test constantes
+	  std::string::size_type index = str.find_first_not_of(numbers);
+	  if (index  == std::string::npos)
+	    {
+// 	      std::cout << " * c'est une constante." << std::endl; 
+
+	      if (tree==NULL)
+		tree = new Stat_binary_tree (atoi(str.c_str()));
+	      else
+		tree = tree->insert_tree (atoi(str.c_str()));
+	    }
+	  else
+	    {
+	      // Test variables
+	      std::map<std::string, var_t>::iterator it = _list_operand->find(str);
+	      if (it != _list_operand->end())
+		{
+// 		  std::cout << " * c'est une variable." << std::endl; 
+
+		  if (tree==NULL)
+		    tree = new Stat_binary_tree (it->second.counter);
+		  else
+		    tree = tree->insert_tree (it->second.counter);
+		}
+	      else
+		{
+		  if ((str == "+") or
+		      (str == "-") or
+		      (str == "*") or
+		      (str == "/"))
+		    {
+// 		      std::cout << " * c'est un operator à 2 opérandes." << std::endl; 
+		      
+// 		      if (tree==NULL)
+// 			tree = new Stat_binary_tree (morpheo::string2operator[str].second);
+// 		      else
+// 			tree->insert_tree (morpheo::string2operator[str].second);
+		      if (tree==NULL)
+			tree = new Stat_binary_tree (string2operator(str));
+		      else
+			tree = tree->insert_tree (string2operator(str));
+		    }
+		  else
+		    {
+		      if ((str == "++") or
+			  (str == "--"))
+			{
+// 			  std::cout << " * c'est un operator à 1 opérande." << std::endl; 
+
+// 			  if (tree==NULL)
+// 			    tree = new Stat_binary_tree (string2operator[str.c_str()]);
+// 			  else
+// 			    tree->insert_tree (string2operator[str.c_str()]);
+
+			  if (tree==NULL)
+			    tree = new Stat_binary_tree (string2operator(str));
+			  else
+			    tree = tree->insert_tree (string2operator(str));
+			  
+			}
+		      else
+			{
+// 			  std::cout << " * c'est autre chose." << std::endl; 
+			  str = "expression '"+str+"' doesn't a constant, a declarated variable or an operator.";
+			  throw(ERRORMORPHEO("Stat::string2tree",_(str.c_str())));
+			}
+		    }
+		}
+	    }
+	}
+
+	index_begin = expr.find_first_not_of(delims, index_end);
+
+	if (index_begin != std::string::npos)
+	  tree = tree->goto_next_root();
+      }
+
+    if (tree == NULL)
+      throw (ERRORMORPHEO("Stat::string2tree",_("the tree generated is empty.")));
+
+//     std::cout << "<Stat::string2tree> goto_top_level" << std::endl;
+
+    tree = tree->goto_top_level();
+
+//     std::cout << "<Stat::string2tree> valid" << std::endl;
+
+    if (not tree->valid())
+      throw (ERRORMORPHEO("Stat::string2tree",_("the tree generated is invalid.")));
+
+//     std::cout << "<Stat::string2tree> End" << std::endl;
+
+    return tree;
+
+  }
+  
+};
+};
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_test_and_save.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_test_and_save.cpp	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_test_and_save.cpp	(revision 71)
@@ -0,0 +1,24 @@
+#ifdef STATISTICS
+#include "Behavioural/include/Stat.h"
+
+namespace morpheo {
+namespace behavioural {  
+  void Stat::test_and_save (bool force_save)
+  {
+    if ((_save_periodic and ((*_cycle)==_period)) or force_save)
+      {
+	eval_exprs(false); // evalue les expression non periodique au cycle
+	
+	for (std::map<std::string, var_t>::iterator i=_list_operand->begin();
+	     i!= _list_operand->end();
+	     ++i)
+	  {
+	    // save and reset !
+	    i->second.save_counter.push_back(*(i->second.counter));
+	    *(i->second.counter) = 0;
+	  }
+      }
+  }
+};  
+};
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Statistics.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Statistics.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Statistics.cpp	(revision 71)
@@ -15,5 +15,5 @@
 #undef  FUNCTION
 #define FUNCTION "Statistics::Statistics"
-  Statistics::Statistics  (string                  name                 ,
+  Statistics::Statistics  (std::string                  name                 ,
 			   Parameters_Statistics * parameters_statistics):
     _name                  (name                 ),
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Statistics_generate_file.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Statistics_generate_file.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Statistics_generate_file.cpp	(revision 71)
@@ -12,5 +12,4 @@
 #include <sstream>
 #include <fstream>
-using namespace std;
 
 namespace morpheo              {
@@ -19,15 +18,15 @@
 #undef  FUNCTION
 #define FUNCTION "Statistics::generate_file"
-  void Statistics::generate_file(string stat)
+  void Statistics::generate_file(std::string stat)
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
 
-    ostringstream filename;
+    std::stringstream filename;
     filename << _name << ".stat";
 
-    cout << "Generate file \""<< filename.str() << "\"" << endl;
+    std::cout << "Generate file \""<< filename.str() << "\"" << std::endl;
 
-    ofstream file;
-    file.open(filename.str().c_str(),ios::out | ios::trunc);
+    std::ofstream file;
+    file.open(filename.str().c_str(),std::ios::out | std::ios::trunc);
 
     time_t current_time;
@@ -35,10 +34,10 @@
 
     // print header
-    file << "<!-- "                                                    << endl
-	 << "\tfile        : " << filename.str()                       << endl
+    file << "<!-- "                                                    << std::endl
+	 << "\tfile        : " << filename.str()                       << std::endl
 	 << "\tdate        : " << ctime (&current_time )
-	 << "\tcomment     : it's a autogenerated file : don't modify" << endl
-	 << "-->"                                                      << endl
-	 <<                                                               endl;
+	 << "\tcomment     : it's a autogenerated file : don't modify" << std::endl
+	 << "-->"                                                      << std::endl
+	 <<                                                               std::endl;
 	 
     file << stat;
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl.cpp	(revision 71)
@@ -15,5 +15,5 @@
 #undef  FUNCTION
 #define FUNCTION "Vhdl::Vhdl"
-  Vhdl::Vhdl  (string                name):
+  Vhdl::Vhdl  (std::string name):
     _name   (name)
   {
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_direction_toString.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_direction_toString.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_direction_toString.cpp	(revision 71)
@@ -11,5 +11,4 @@
 
 #include <sstream>
-using namespace std;
 
 namespace morpheo              {
@@ -18,9 +17,9 @@
 #undef  FUNCTION
 #define FUNCTION "Vhdl::direction_toString"
-  string Vhdl::direction_toString (direction_t direction)
+  std::string Vhdl::direction_toString (direction_t direction)
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
 
-    string _return;
+    std::string _return;
     switch (direction)
       {
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_generate_file_model.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_generate_file_model.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_generate_file_model.cpp	(revision 71)
@@ -11,5 +11,4 @@
 #include <sstream>
 #include <fstream>
-using namespace std;
 
 namespace morpheo              {
@@ -20,14 +19,14 @@
     log_printf(FUNC,Behavioural,"generate_file_model","Begin");
 
-    string filename = _name + ".vhdl";
+    std::string filename = _name + ".vhdl";
     
     log_printf(TRACE,Behavioural,"generate_file_model","print %s",filename.c_str());
-    cout << "Generate file \""<< filename << "\"" << endl;
+    std::cout << "Generate file \""<< filename << "\"" << std::endl;
 
     log_printf(TRACE,Behavioural,"generate_file_model","declaration");
-    ofstream file;
+    std::ofstream file;
 
     log_printf(TRACE,Behavioural,"generate_file_model","open file");
-    file.open(filename.c_str(),ios::out | ios::trunc);
+    file.open(filename.c_str(),std::ios::out | std::ios::trunc);
 
     log_printf(TRACE,Behavioural,"generate_file_model","get model");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_generate_file_package.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_generate_file_package.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_generate_file_package.cpp	(revision 71)
@@ -11,5 +11,4 @@
 #include <sstream>
 #include <fstream>
-using namespace std;
 
 namespace morpheo              {
@@ -20,11 +19,11 @@
     log_printf(FUNC,Behavioural,"generate_file_package","Begin");
 
-    string name     = _name + "_Pack";
-    string filename =  name + ".vhdl";
+    std::string name     = _name + "_Pack";
+    std::string filename =  name + ".vhdl";
 
-    cout << "Generate file \""<< filename << "\"" << endl;
+    std::cout << "Generate file \""<< filename << "\"" << std::endl;
 
-    ofstream file;
-    file.open(filename.c_str(),ios::out | ios::trunc);
+    std::ofstream file;
+    file.open(filename.c_str(),std::ios::out | std::ios::trunc);
 
     file << get_package (0,filename, name, _name);
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_alias.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_alias.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_alias.cpp	(revision 71)
@@ -11,5 +11,4 @@
 
 #include <sstream>
-using namespace std;
 
 namespace morpheo              {
@@ -18,8 +17,8 @@
 #undef  FUNCTION
 #define FUNCTION "Vhdl::get_alias"
-  string Vhdl::get_alias (uint32_t depth)
+  std::string Vhdl::get_alias (uint32_t depth)
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
-    string _return = get_list(_list_alias, depth, ";", true);
+    std::string _return = get_list(_list_alias, depth, ";", true);
     log_printf(FUNC,Behavioural,FUNCTION,"End");
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_architecture.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_architecture.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_architecture.cpp	(revision 71)
@@ -11,5 +11,4 @@
 
 #include <sstream>
-using namespace std;
 
 namespace morpheo              {
@@ -18,20 +17,20 @@
 #undef  FUNCTION
 #define FUNCTION "Vhdl::get_architecture"
-  string Vhdl::get_architecture (uint32_t depth      ,
-				 string   name       ,
-				 string   entity_name)
+  std::string Vhdl::get_architecture (uint32_t depth      ,
+				 std::string   name       ,
+				 std::string   entity_name)
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
 
-    string        tab = string(depth,'\t');
-    ostringstream text;
+    std::string        tab = std::string(depth,'\t');
+    std::ostringstream text;
 
-    text << tab << "architecture " << name << " of " << entity_name << " is" << endl
-	 << tab << get_type     (depth+1)                                    << endl
-	 << tab << get_signal   (depth+1)                                    << endl
-	 << tab << get_alias    (depth+1)                                    << endl
-	 << tab << "begin"                                                   << endl
-	 << tab << get_body     (depth+1)                                    << endl
-	 << tab << "end " << name << ";"                                     << endl;
+    text << tab << "architecture " << name << " of " << entity_name << " is" << std::endl
+	 << tab << get_type     (depth+1)                                    << std::endl
+	 << tab << get_signal   (depth+1)                                    << std::endl
+	 << tab << get_alias    (depth+1)                                    << std::endl
+	 << tab << "begin"                                                   << std::endl
+	 << tab << get_body     (depth+1)                                    << std::endl
+	 << tab << "end " << name << ";"                                     << std::endl;
 
     log_printf(FUNC,Behavioural,FUNCTION,"End");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_body.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_body.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_body.cpp	(revision 71)
@@ -11,5 +11,4 @@
 
 #include <sstream>
-using namespace std;
 
 namespace morpheo              {
@@ -18,8 +17,8 @@
 #undef  FUNCTION
 #define FUNCTION "Vhdl::get_body"
-  string Vhdl::get_body (uint32_t depth)
+  std::string Vhdl::get_body (uint32_t depth)
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
-    string _return = get_list(_list_body,depth,"",true);
+    std::string _return = get_list(_list_body,depth,"",true);
     log_printf(FUNC,Behavioural,FUNCTION,"End");
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_component.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_component.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_component.cpp	(revision 71)
@@ -11,5 +11,4 @@
 
 #include <sstream>
-using namespace std;
 
 namespace morpheo              {
@@ -18,20 +17,20 @@
 #undef  FUNCTION
 #define FUNCTION "Vhdl::get_component"
-  string Vhdl::get_component(uint32_t depth,
-			     string   name)
+  std::string Vhdl::get_component(uint32_t depth,
+			     std::string   name)
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
 
-    string        tab = string(depth,'\t');
-    ostringstream text;
+    std::string        tab = std::string(depth,'\t');
+    std::ostringstream text;
 
-    text <<                                      endl
-	 << tab << "component " << name       << endl;
+    text <<                                      std::endl
+	 << tab << "component " << name       << std::endl;
     if (_list_port.empty() == false)
-      text << tab << "\tport ("                 << endl
-	   << tab << get_port(depth+1)          << endl
-	   << tab << "\t     );"                << endl;
-    text << tab << "end component;"           << endl;
-  
+      text << tab << "\tport ("                 << std::endl
+	   << tab << get_port(depth+1)          << std::endl
+	   << tab << "\t     );"                << std::endl;
+    text << tab << "end component;"           << std::endl;
+    
     log_printf(FUNC,Behavioural,FUNCTION,"End");
     return text.str();
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_entity.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_entity.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_entity.cpp	(revision 71)
@@ -11,5 +11,4 @@
 
 #include <sstream>
-using namespace std;
 
 namespace morpheo              {
@@ -18,21 +17,21 @@
 #undef  FUNCTION
 #define FUNCTION "Vhdl::get_entity"
-  string Vhdl::get_entity(uint32_t depth,
-			  string   name)
+  std::string Vhdl::get_entity(uint32_t depth,
+			       std::string   name)
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
 
-    string        tab = string(depth,'\t');
-    ostringstream text;
+    std::string        tab = std::string(depth,'\t');
+    std::ostringstream text;
 
-    text <<                                      endl
-	 << tab << "entity " << name << " is" << endl;
-
+    text <<                                      std::endl
+	 << tab << "entity " << name << " is" << std::endl;
+    
     if (_list_port.empty() == false)
-      text << tab << "\tport ("                 << endl
-	   << tab << get_port(depth+1)          << endl
-	   << tab << "\t     );"                << endl;
+      text << tab << "\tport ("                 << std::endl
+	   << tab << get_port(depth+1)          << std::endl
+	   << tab << "\t     );"                << std::endl;
     
-    text << tab << "end " << name << ";"      << endl;
+    text << tab << "end " << name << ";"      << std::endl;
     
     log_printf(FUNC,Behavioural,FUNCTION,"End");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_header.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_header.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_header.cpp	(revision 71)
@@ -11,5 +11,4 @@
 #include <time.h>
 #include <sstream>
-using namespace std;
 
 namespace morpheo              {
@@ -18,20 +17,20 @@
 #undef  FUNCTION
 #define FUNCTION "Vhdl::get_header"
-  string Vhdl::get_header(uint32_t depth,
-			  string   filename)
+  std::string Vhdl::get_header(uint32_t depth,
+			  std::string   filename)
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
 
-    string        tab = string(depth,'\t');
-    ostringstream text;
+    std::string        tab = std::string(depth,'\t');
+    std::ostringstream text;
 
     time_t current_time;
     time (&current_time);
 
-    text << tab << "-------------------------------------------------------------------------------" << endl
-	 << tab << "-- file      : " << filename                                                     << endl
+    text << tab << "-------------------------------------------------------------------------------" << std::endl
+	 << tab << "-- file      : " << filename                                                     << std::endl
 	 << tab << "-- date      : " << ctime (&current_time )
-	 << tab << "-- comment   : it's a autogenerated file : don't modify"                         << endl
-	 << tab << "-------------------------------------------------------------------------------" << endl;
+	 << tab << "-- comment   : it's a autogenerated file : don't modify"                         << std::endl
+	 << tab << "-------------------------------------------------------------------------------" << std::endl;
     
     log_printf(FUNC,Behavioural,FUNCTION,"End");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_library_ieee.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_library_ieee.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_library_ieee.cpp	(revision 71)
@@ -11,5 +11,4 @@
 
 #include <sstream>
-using namespace std;
 
 namespace morpheo              {
@@ -18,21 +17,21 @@
 #undef  FUNCTION
 #define FUNCTION "Vhdl::get_library_ieee"
-  string Vhdl::get_library_ieee (uint32_t depth)
+  std::string Vhdl::get_library_ieee (uint32_t depth)
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
 
-    string        tab = string(depth,'\t');
-    ostringstream text;
+    std::string        tab = std::string(depth,'\t');
+    std::ostringstream text;
 
-    text << tab                                       << endl
-	 << tab << "library ieee;"                    << endl
-         << tab << "use ieee.numeric_bit.all;"        << endl
-         << tab << "use ieee.numeric_std.all;"        << endl
-	 << tab << "use ieee.std_logic_1164.all;"     << endl
-         << tab << "use ieee.std_logic_arith.all;"    << endl
-         << tab << "use ieee.std_logic_misc.all;"     << endl
-         << tab << "--use ieee.std_logic_signed.all;"   << endl
-         << tab << "use ieee.std_logic_unsigned.all;" << endl
-         << tab << "--use ieee.std_logic_textio.all;"   << endl;
+    text << tab                                       << std::endl
+	 << tab << "library ieee;"                    << std::endl
+         << tab << "use ieee.numeric_bit.all;"        << std::endl
+         << tab << "use ieee.numeric_std.all;"        << std::endl
+	 << tab << "use ieee.std_logic_1164.all;"     << std::endl
+         << tab << "use ieee.std_logic_arith.all;"    << std::endl
+         << tab << "use ieee.std_logic_misc.all;"     << std::endl
+         << tab << "--use ieee.std_logic_signed.all;" << std::endl
+         << tab << "use ieee.std_logic_unsigned.all;" << std::endl
+         << tab << "--use ieee.std_logic_textio.all;" << std::endl;
       
     log_printf(FUNC,Behavioural,FUNCTION,"End");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_library_work.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_library_work.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_library_work.cpp	(revision 71)
@@ -11,5 +11,4 @@
 
 #include <sstream>
-using namespace std;
 
 namespace morpheo              {
@@ -18,15 +17,15 @@
 #undef  FUNCTION
 #define FUNCTION "Vhdl::get_library_work"
-  string Vhdl::get_library_work (uint32_t depth)
+  std::string Vhdl::get_library_work (uint32_t depth)
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
 
-    list<string>::iterator i   = _list_library_work.begin();
-    string                 tab = string(depth,'\t');
-    ostringstream          text;
+    std::list<std::string>::iterator i   = _list_library_work.begin();
+    std::string                 tab = std::string(depth,'\t');
+    std::ostringstream          text;
 
     if (i != _list_library_work.end())
-      text << tab                    << endl
-	   << tab << "library work;" << endl
+      text << tab                    << std::endl
+	   << tab << "library work;" << std::endl
 	   << get_list(_list_library_work,depth,";",true);
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_list.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_list.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_list.cpp	(revision 71)
@@ -11,5 +11,4 @@
 
 #include <sstream>
-using namespace std;
 
 namespace morpheo              {
@@ -18,16 +17,16 @@
 #undef  FUNCTION
 #define FUNCTION "Vhdl::get_list"
-  string Vhdl::get_list (list<string> liste                ,
-			 uint32_t     depth                ,
-			 string       separator            ,
-			 bool         last_separator       )
+  std::string Vhdl::get_list (std::list<std::string> liste                ,
+			      uint32_t     depth                ,
+			      std::string       separator            ,
+			      bool         last_separator       )
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
 
-    list<string>::iterator i     = liste.begin();
-    bool                   empty = liste.empty();
+    std::list<std::string>::iterator i     = liste.begin();
+    bool                             empty = liste.empty();
 
-    string                 tab   = string(depth,'\t');
-    ostringstream          text;
+    std::string                 tab   = std::string(depth,'\t');
+    std::ostringstream          text;
 
     if (not empty)
@@ -42,5 +41,5 @@
 	while (i != liste.end())
 	  {
-	    text << separator << endl;
+	    text << separator << std::endl;
 	    text << tab << *i;
 	    ++i;
@@ -48,5 +47,5 @@
 	
 	if (last_separator)
-	  text << separator << endl;
+	  text << separator << std::endl;
       }
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_model.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_model.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_model.cpp	(revision 71)
@@ -11,24 +11,23 @@
 
 #include <sstream>
-using namespace std;
 
 namespace morpheo              {
 namespace behavioural          {
   
-  string Vhdl::get_model(uint32_t depth            ,
-			 string   filename         ,
-			 string   entity_name      ,
-			 string   architecture_name)
+  std::string Vhdl::get_model(uint32_t depth            ,
+			 std::string   filename         ,
+			 std::string   entity_name      ,
+			 std::string   architecture_name)
   {
     log_printf(FUNC,Behavioural,"get_model","Begin");
 
-    string        tab = string(depth,'\t');
-    ostringstream text;
+    std::string        tab = std::string(depth,'\t');
+    std::ostringstream text;
 
-    text << tab << get_header       (depth,filename)                      << endl
-	 << tab << get_library_ieee (depth)                               << endl
-	 << tab << get_library_work (depth)                               << endl
-	 << tab << get_entity       (depth,entity_name)                   << endl
-	 << tab << get_architecture (depth,architecture_name,entity_name) << endl;
+    text << tab << get_header       (depth,filename)                      << std::endl
+	 << tab << get_library_ieee (depth)                               << std::endl
+	 << tab << get_library_work (depth)                               << std::endl
+	 << tab << get_entity       (depth,entity_name)                   << std::endl
+	 << tab << get_architecture (depth,architecture_name,entity_name) << std::endl;
     
     log_printf(FUNC,Behavioural,"get_model","End");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_package.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_package.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_package.cpp	(revision 71)
@@ -11,5 +11,4 @@
 
 #include <sstream>
-using namespace std;
 
 namespace morpheo              {
@@ -18,19 +17,19 @@
 #undef  FUNCTION
 #define FUNCTION "Vhdl::get_package"
-  string Vhdl::get_package(uint32_t depth       ,
-			   string   filename    ,
-			   string   package_name,
-			   string   entity_name )
+  std::string Vhdl::get_package(uint32_t depth       ,
+			   std::string   filename    ,
+			   std::string   package_name,
+			   std::string   entity_name )
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
 
-    string        tab = string(depth,'\t');
-    ostringstream text;
+    std::string        tab = std::string(depth,'\t');
+    std::ostringstream text;
 
-    text << tab << get_header       (depth,filename)                      << endl
-	 << tab << get_library_ieee (depth)                               << endl
-	 << tab << "package " << package_name << " is"                    << endl
-	 << tab << get_component    (depth+1,entity_name)                 << endl
-	 << tab << "end " << package_name << ";"                          << endl;
+    text << tab << get_header       (depth,filename)                      << std::endl
+	 << tab << get_library_ieee (depth)                               << std::endl
+	 << tab << "package " << package_name << " is"                    << std::endl
+	 << tab << get_component    (depth+1,entity_name)                 << std::endl
+	 << tab << "end " << package_name << ";"                          << std::endl;
 
     log_printf(FUNC,Behavioural,FUNCTION,"End");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_port.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_port.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_port.cpp	(revision 71)
@@ -11,5 +11,4 @@
 
 #include <sstream>
-using namespace std;
 
 namespace morpheo              {
@@ -18,8 +17,8 @@
 #undef  FUNCTION
 #define FUNCTION "Vhdl::get_port"
-  string Vhdl::get_port (uint32_t depth)
+  std::string Vhdl::get_port (uint32_t depth)
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
-    string _return = get_list (_list_port, depth, ";", false);    
+    std::string _return = get_list (_list_port, depth, ";", false);    
     log_printf(FUNC,Behavioural,FUNCTION,"End");
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_signal.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_signal.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_signal.cpp	(revision 71)
@@ -11,5 +11,4 @@
 
 #include <sstream>
-using namespace std;
 
 namespace morpheo              {
@@ -18,8 +17,8 @@
 #undef  FUNCTION
 #define FUNCTION "Vhdl::get_signal"
-  string Vhdl::get_signal (uint32_t depth)
+  std::string Vhdl::get_signal (uint32_t depth)
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
-    string _return = get_list (_list_signal, depth, ";", true);
+    std::string _return = get_list (_list_signal, depth, ";", true);
     log_printf(FUNC,Behavioural,FUNCTION,"End");
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_type.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_type.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_type.cpp	(revision 71)
@@ -11,5 +11,4 @@
 
 #include <sstream>
-using namespace std;
 
 namespace morpheo              {
@@ -18,8 +17,8 @@
 #undef  FUNCTION
 #define FUNCTION "Vhdl::get_type"
-  string Vhdl::get_type (uint32_t depth)
+  std::string Vhdl::get_type (uint32_t depth)
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
-    string _return = get_list (_list_type, depth, ";", true);
+    std::string _return = get_list (_list_type, depth, ";", true);
     log_printf(FUNC,Behavioural,FUNCTION,"End");
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_alias.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_alias.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_alias.cpp	(revision 71)
@@ -11,5 +11,4 @@
 
 #include <sstream>
-using namespace std;
 
 namespace morpheo              {
@@ -18,8 +17,8 @@
 #undef  FUNCTION
 #define FUNCTION "Vhdl::set_alias"
-  void Vhdl::set_alias (string      name1 ,
-			string      type1 ,
-			string      name2 ,
-			string      range2)
+  void Vhdl::set_alias (std::string      name1 ,
+			std::string      type1 ,
+			std::string      name2 ,
+			std::string      range2)
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
@@ -28,8 +27,8 @@
   };
 
-  void Vhdl::set_alias (string      name1 ,
+  void Vhdl::set_alias (std::string      name1 ,
 			uint32_t    size1 ,
-			string      name2 ,
-			string      range2)
+			std::string      name2 ,
+			std::string      range2)
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_body.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_body.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_body.cpp	(revision 71)
@@ -11,5 +11,4 @@
 
 #include <sstream>
-using namespace std;
 
 namespace morpheo              {
@@ -18,5 +17,5 @@
 #undef  FUNCTION
 #define FUNCTION "Vhdl::set_body"
-  void Vhdl::set_body (string      text     )
+  void Vhdl::set_body (std::string      text     )
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_body_component.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_body_component.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_body_component.cpp	(revision 71)
@@ -11,5 +11,4 @@
 
 #include <sstream>
-using namespace std;
 
 namespace morpheo              {
@@ -18,7 +17,7 @@
 #undef  FUNCTION
 #define FUNCTION "Vhdl::set_body_component"
-  void Vhdl::set_body_component (string         name_instance      ,
-				 string         name_component     ,
-				 list<string>   list_port_map      )
+  void Vhdl::set_body_component (std::string         name_instance      ,
+				 std::string         name_component     ,
+				 std::list<std::string>   list_port_map      )
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_body_component_port_map.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_body_component_port_map.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_body_component_port_map.cpp	(revision 71)
@@ -11,5 +11,4 @@
 
 #include <sstream>
-using namespace std;
 
 namespace morpheo              {
@@ -18,8 +17,8 @@
 #undef  FUNCTION
 #define FUNCTION "Vhdl::set_body_component_port_map"
-  void Vhdl::set_body_component_port_map (list<string> & list_port_map      ,
-					  string         name_port          ,
+  void Vhdl::set_body_component_port_map (std::list<std::string> & list_port_map      ,
+					  std::string         name_port          ,
 					  uint32_t       size_port          ,
-					  string         name_signal        ,
+					  std::string         name_signal        ,
 					  uint32_t       size_signal        )
   {
@@ -29,5 +28,5 @@
       throw (ErrorMorpheo ("<Vhdl::set_body_component_port_map> size of port '"+name_port+"' ("+toString(size_port)+") is greater than size of signal '"+name_signal+"' ("+toString(size_signal)+")."));
 
-    string str_size = "";
+    std::string str_size = "";
 
     // test if size is different (possible if multi write
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_constant.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_constant.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_constant.cpp	(revision 71)
@@ -11,5 +11,4 @@
 
 #include <sstream>
-using namespace std;
 
 namespace morpheo              {
@@ -18,7 +17,7 @@
 #undef  FUNCTION
 #define FUNCTION "Vhdl::set_constant"
-  void Vhdl::set_constant (string      name     ,
-			   string      type     ,
-			   string      init)
+  void Vhdl::set_constant (std::string      name     ,
+			   std::string      type     ,
+			   std::string      init)
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
@@ -27,7 +26,7 @@
   };
 
-  void Vhdl::set_constant (string      name     ,
+  void Vhdl::set_constant (std::string      name     ,
 			   uint32_t    size     ,
-			   string      init)
+			   std::string      init)
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
@@ -36,5 +35,5 @@
   };
 
-  void Vhdl::set_constant (string      name     ,
+  void Vhdl::set_constant (std::string      name     ,
 			   uint32_t    size     ,
 			   uint32_t    init)
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_library_work.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_library_work.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_library_work.cpp	(revision 71)
@@ -11,5 +11,4 @@
 
 #include <sstream>
-using namespace std;
 
 namespace morpheo              {
@@ -18,5 +17,5 @@
 #undef  FUNCTION
 #define FUNCTION "Vhdl::set_library_work"
-  void Vhdl::set_library_work (string      package_name)
+  void Vhdl::set_library_work (std::string      package_name)
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_list.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_list.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_list.cpp	(revision 71)
@@ -11,5 +11,4 @@
 
 #include <sstream>
-using namespace std;
 
 namespace morpheo              {
@@ -18,6 +17,6 @@
 #undef  FUNCTION
 #define FUNCTION "Vhdl::set_list"
-  void Vhdl::set_list (list<string> & liste,
-		       string         text )
+  void Vhdl::set_list (std::list<std::string> & liste,
+		       std::string         text )
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_port.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_port.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_port.cpp	(revision 71)
@@ -11,5 +11,4 @@
 
 #include <sstream>
-using namespace std;
 
 namespace morpheo              {
@@ -18,7 +17,7 @@
 #undef  FUNCTION
 #define FUNCTION "Vhdl::set_port"
-  void Vhdl::set_port (string      name     ,
+  void Vhdl::set_port (std::string      name     ,
 		       direction_t direction,
-		       string      type     )
+		       std::string      type     )
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
@@ -27,5 +26,5 @@
   };
 
-  void Vhdl::set_port (string      name     ,
+  void Vhdl::set_port (std::string      name     ,
 		       direction_t direction,
 		       uint32_t    size     )
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_signal.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_signal.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_signal.cpp	(revision 71)
@@ -11,5 +11,4 @@
 
 #include <sstream>
-using namespace std;
 
 namespace morpheo              {
@@ -19,6 +18,6 @@
 #define FUNCTION "Vhdl::set_signal"
 
-  void Vhdl::set_signal (string      name     ,
-			 string      type     )
+  void Vhdl::set_signal (std::string      name     ,
+			 std::string      type     )
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
@@ -27,5 +26,5 @@
   };
 
-  void Vhdl::set_signal (string      name     ,
+  void Vhdl::set_signal (std::string      name     ,
 			 uint32_t    size     )
   {
@@ -35,7 +34,7 @@
   }
 
-  void Vhdl::set_signal (string      name     ,
-			 string      type     ,
-			 string      init)
+  void Vhdl::set_signal (std::string      name     ,
+			 std::string      type     ,
+			 std::string      init)
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
@@ -44,7 +43,7 @@
   };
 
-  void Vhdl::set_signal (string      name     ,
+  void Vhdl::set_signal (std::string      name     ,
 			 uint32_t    size     ,
-			 string      init     )
+			 std::string      init     )
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
@@ -52,5 +51,5 @@
     log_printf(FUNC,Behavioural,FUNCTION,"End");
   };
-  void Vhdl::set_signal (string      name     ,
+  void Vhdl::set_signal (std::string      name     ,
 			 uint32_t    size     ,
 			 uint32_t    init     )
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_type.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_type.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_type.cpp	(revision 71)
@@ -11,5 +11,4 @@
 
 #include <sstream>
-using namespace std;
 
 namespace morpheo              {
@@ -18,6 +17,6 @@
 #undef  FUNCTION
 #define FUNCTION "Vhdl::set_type"
-  void Vhdl::set_type (string      name     ,
-		       string      type     )
+  void Vhdl::set_type (std::string      name     ,
+		       std::string      type     )
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_std_logic.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_std_logic.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_std_logic.cpp	(revision 71)
@@ -16,9 +16,9 @@
 #undef  FUNCTION
 #define FUNCTION "Vhdl::std_logic"
-  string std_logic (uint32_t size)
+  std::string std_logic (uint32_t size)
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
 
-    string type;
+    std::string type;
 
     if (size == 1)
@@ -34,9 +34,9 @@
 #undef  FUNCTION
 #define FUNCTION "Vhdl::std_logic_conv"
-  string std_logic_conv (uint32_t size, string value)
+  std::string std_logic_conv (uint32_t size, std::string value)
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
 
-    string conv;
+    std::string conv;
 
     if (size == 1)
@@ -50,9 +50,8 @@
   };
 
-  string std_logic_conv (uint32_t size, uint32_t value)
+  std::string std_logic_conv (uint32_t size, uint32_t value)
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
-    cout << toString(value) << endl;
-    string _return = std_logic_conv(size,toString(value));
+    std::string _return = std_logic_conv(size,toString(value));
     log_printf(FUNC,Behavioural,FUNCTION,"End");
 
@@ -62,8 +61,8 @@
 #undef  FUNCTION
 #define FUNCTION "Vhdl::std_logic_range"
-  string std_logic_range (uint32_t size, uint32_t max, uint32_t min)
+  std::string std_logic_range (uint32_t size, uint32_t max, uint32_t min)
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
-    string type;
+    std::string type;
 
     if (size < 2)
@@ -80,8 +79,8 @@
   };
 
-  string std_logic_range (uint32_t max, uint32_t min)
+  std::string std_logic_range (uint32_t max, uint32_t min)
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
-    string type;
+    std::string type;
 
     if (max == 0)
@@ -98,8 +97,8 @@
   };
 
-  string std_logic_range (uint32_t size)
+  std::string std_logic_range (uint32_t size)
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
-    string _return = std_logic_range(size-1,0);
+    std::string _return = std_logic_range(size-1,0);
     log_printf(FUNC,Behavioural,FUNCTION,"End");
 
@@ -109,9 +108,9 @@
 #undef  FUNCTION
 #define FUNCTION "Vhdl::std_logic_others"
-  string std_logic_others (uint32_t size, uint32_t cst  )
+  std::string std_logic_others (uint32_t size, uint32_t cst  )
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
 
-    string _return;
+    std::string _return;
 
     if (size < 2)
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML.cpp	(revision 71)
@@ -13,5 +13,5 @@
 #undef  FUNCTION
 #define FUNCTION "XML::XML"
-  XML::XML  (string name) :
+  XML::XML  (std::string name) :
     _name (name)
   {
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_attribut.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_attribut.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_attribut.cpp	(revision 71)
@@ -13,5 +13,5 @@
 #undef  FUNCTION
 #define FUNCTION "XML::attribut"
-  bool XML::attribut (string name, string value)
+  bool XML::attribut (std::string name, std::string value)
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_balise_close.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_balise_close.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_balise_close.cpp	(revision 71)
@@ -16,5 +16,5 @@
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
-    string name=*(_list_balise_name.begin());
+    std::string name=*(_list_balise_name.begin());
 
     _list_balise_name.pop_front();
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_balise_open.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_balise_open.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_balise_open.cpp	(revision 71)
@@ -13,5 +13,5 @@
 #undef  FUNCTION
 #define FUNCTION "XML::balise_open"
-  bool XML::balise_open (string name)
+  bool XML::balise_open (std::string name)
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_balise_open_begin.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_balise_open_begin.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_balise_open_begin.cpp	(revision 71)
@@ -13,5 +13,5 @@
 #undef  FUNCTION
 #define FUNCTION "XML::balise_open_begin"
-  bool XML::balise_open_begin (string name)
+  bool XML::balise_open_begin (std::string name)
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_comment.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_comment.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_comment.cpp	(revision 71)
@@ -13,5 +13,5 @@
 #undef  FUNCTION
 #define FUNCTION "XML::comment"
-  bool XML::comment (string texte)
+  bool XML::comment (std::string texte)
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_filename_extension.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_filename_extension.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_filename_extension.cpp	(revision 71)
@@ -8,5 +8,4 @@
 #include "Behavioural/include/XML.h"
 #include <fstream>
-using namespace std;
 
 namespace morpheo              {
@@ -15,5 +14,5 @@
 #undef  FUNCTION
 #define FUNCTION "XML::filename_extension"
-  void XML::filename_extension (string extension)
+  void XML::filename_extension (std::string extension)
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_generate_file.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_generate_file.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_generate_file.cpp	(revision 71)
@@ -8,5 +8,4 @@
 #include "Behavioural/include/XML.h"
 #include <fstream>
-using namespace std;
 
 namespace morpheo              {
@@ -15,5 +14,5 @@
 #undef  FUNCTION
 #define FUNCTION "XML::generate_file"
-  void XML::generate_file (string encoding)
+  void XML::generate_file (std::string encoding)
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
@@ -21,11 +20,10 @@
     header (encoding);
 
-    string name     = _name;
-    string filename =  name + "." + _filename_extension;
+    std::string filename =  _name + "." + _filename_extension;
 
-    cout << "Generate file \""<< filename << "\"" << endl;
+    std::cout << "Generate file \""<< filename << "\"" << std::endl;
 
-    ofstream file;
-    file.open(filename.c_str(),ios::out | ios::trunc);
+    std::ofstream file;
+    file.open(filename.c_str(),std::ios::out | std::ios::trunc);
 
     file << get_body();
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_get_body.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_get_body.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_get_body.cpp	(revision 71)
@@ -13,5 +13,5 @@
 #undef  FUNCTION
 #define FUNCTION "XML::get_body"
-  string XML::get_body (void)
+  std::string XML::get_body (void)
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
@@ -20,12 +20,12 @@
   };
 
-  string XML::get_body (uint32_t depth)
+  std::string XML::get_body (uint32_t depth)
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
 
-    string body       = _body;
-    string tabulation = indent(depth);
+    std::string body       = _body;
+    std::string tabulation = indent(depth);
 
-    body.insert(0,tabulation);
+//     body.insert(0,tabulation);
     for (size_t pos=body.find('\n',0); pos<body.length()-1; pos=body.find('\n',++pos))
       body.insert(++pos,tabulation);
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_header.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_header.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_header.cpp	(revision 71)
@@ -13,8 +13,26 @@
 #undef  FUNCTION
 #define FUNCTION "XML::header"
-  void XML::header (string encoding)
+  void XML::header (std::string encoding)
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
-    _body = "<?xml version=\"1.0\" encoding=\""+encoding+"\" ?>\n" + _body;
+
+    time_t current_time;
+    time (&current_time);
+
+    std::string str_time = ctime (&current_time );
+
+    std::string str;
+
+    str  = "<?xml version=\"1.0\" encoding=\""+encoding+"\" ?>\n";
+    str += "\n";
+    str += "<!--\n";
+    str += "\tFile        : " + _name+"."+_filename_extension + "\n";
+    str += "\tDate        : " + str_time +"\n";
+    str += "\tComment     : it's a autogenerated file : don't modify\n";
+    str += "-->\n";
+    str += "\n";
+
+    _body = str + _body;
+
     log_printf(FUNC,Behavioural,FUNCTION,"End");
   };
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_indent.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_indent.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_indent.cpp	(revision 71)
@@ -13,8 +13,8 @@
 #undef  FUNCTION
 #define FUNCTION "XML::indent"
-  string XML::indent (uint32_t depth)
+  std::string XML::indent (uint32_t depth)
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
-    string _return = string(depth,'\t');
+    std::string _return = std::string(depth,'\t');
     log_printf(FUNC,Behavioural,FUNCTION,"End");
 
@@ -22,8 +22,8 @@
   };
 
-  string XML::indent (void)
+  std::string XML::indent (void)
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
-    string _return = indent(depth());
+    std::string _return = indent(depth());
     log_printf(FUNC,Behavioural,FUNCTION,"End");
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_singleton.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_singleton.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_singleton.cpp	(revision 71)
@@ -13,5 +13,5 @@
 #undef  FUNCTION
 #define FUNCTION "XML::singleton"
-  bool XML::singleton (string name)
+  bool XML::singleton (std::string name)
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_singleton_begin.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_singleton_begin.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_singleton_begin.cpp	(revision 71)
@@ -13,5 +13,5 @@
 #undef  FUNCTION
 #define FUNCTION "XML::singleton_begin"
-  bool XML::singleton_begin (string name)
+  bool XML::singleton_begin (std::string name)
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_text.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_text.cpp	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_text.cpp	(revision 71)
@@ -13,5 +13,5 @@
 #undef  FUNCTION
 #define FUNCTION "XML::text"
-  bool XML::text (string text)
+  bool XML::text (std::string text)
   {
     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
Index: trunk/IPs/systemC/processor/Morpheo/Common/Makefile
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Common/Makefile	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Common/Makefile	(revision 71)
@@ -2,17 +2,17 @@
 # $Id$
 # 
-# [ Description ]
+# [ Description ]
 # 
 # Makefile
 # 
 
-#-----[ Directory ]----------------------------------------
+#-----[ Directory ]----------------------------------------
 DIR_COMPONENT                   = ./
 include                         $(DIR_COMPONENT)/Makefile.defs
 
-#-----[ Library ]------------------------------------------
+#-----[ Library ]------------------------------------------
 LIBRARY				= $(DIR_LIB)/libCommon.a
 
-#-----[ include ]------------------------------------------
+#-----[ include ]------------------------------------------
 
 all				: $(LIBRARY_NEED)
Index: trunk/IPs/systemC/processor/Morpheo/Common/Makefile.defs
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Common/Makefile.defs	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Common/Makefile.defs	(revision 71)
@@ -2,8 +2,8 @@
 # $Id$
 # 
-# [ Description ]
+# [ Description ]
 # 
 
-#-----[ Directory ]----------------------------------------
+#-----[ Directory ]----------------------------------------
 DIR_COMPONENT_MORPHEO           = ..
 DIR_MORPHEO                     = $(DIR_COMPONENT)/$(DIR_COMPONENT_MORPHEO)
Index: trunk/IPs/systemC/processor/Morpheo/Common/Makefile.deps
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Common/Makefile.deps	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Common/Makefile.deps	(revision 71)
@@ -2,5 +2,5 @@
 # $Id$
 # 
-# [ Description ]
+# [ Description ]
 # 
 # Makefile
@@ -10,14 +10,23 @@
 Common			= 	yes
 
-#-----[ Library ]------------------------------------------
+#-----[ Library ]------------------------------------------
 Common_LIBRARY		= 	-lCommon
 
 Common_DIR_LIBRARY	=	-L$(DIR_MORPHEO)/Common/lib
 
-#-----[ Rules ]--------------------------------------------
+Common_DEPENDENCIES	=
 
-Common_library		:
-				@$(MAKE) --directory=$(DIR_MORPHEO)/Common --makefile=Makefile 
+Common_CLEAN        	=
+
+
+#-----[ Rules ]--------------------------------------------
+
+#.NOTPARALLEL		: Common_library Common_library_clean
+
+Common_library		: $(Common_DEPENDENCIES)
+			@\
+			$(MAKE) --directory=$(DIR_MORPHEO)/Common --makefile=Makefile 
 	
-Common_library_clean	:
-				@$(MAKE) --directory=$(DIR_MORPHEO)/Common --makefile=Makefile clean
+Common_library_clean	: $(Common_CLEAN)
+			@\
+			$(MAKE) --directory=$(DIR_MORPHEO)/Common --makefile=Makefile clean
Index: trunk/IPs/systemC/processor/Morpheo/Common/include/BitManipulation.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Common/include/BitManipulation.h	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Common/include/BitManipulation.h	(revision 71)
@@ -11,9 +11,10 @@
 #include <stdint.h>
 #include <iostream>
-using namespace std;
 
 namespace morpheo              {
 
+  //............................................................................
   // gen_mask ..................................................................
+  //............................................................................
   
   template <typename T>
@@ -29,20 +30,36 @@
   };
 
+  template <typename T>
+  T gen_mask       (uint32_t index_max, uint32_t index_min) 
+  { 
+    return  (gen_mask<T>(index_max-index_min+1)<<index_min);
+  };
+
+  template <typename T>
+  T gen_mask_not   (uint32_t index_max, uint32_t index_min) 
+  { 
+    return ~(gen_mask<T>(index_max-index_min+1)<<index_min);
+  };
+
+  //............................................................................
   // mask, mask_not ............................................................
-  template <typename T>
-  T mask           (uint32_t data, uint32_t index_max, uint32_t index_min)  
-  {
-    return     (gen_mask<T>(index_max-index_min+1)<<index_min) & data;
-  }
-
-  template <typename T>
-  T mask_not       (uint32_t data, uint32_t index_max, uint32_t index_min)  
-  {
-    return (~(gen_mask<T>(index_max-index_min+1)<<index_min)) & data;
-  }
-
+  //............................................................................
+  template <typename T>
+  T mask           (T data, uint32_t index_max, uint32_t index_min)  
+  {
+    return gen_mask    <T>(index_max,index_min) & data;
+  }
+
+  template <typename T>
+  T mask_not       (T data, uint32_t index_max, uint32_t index_min)  
+  {
+    return gen_mask_not<T>(index_max,index_min) & data;
+  }
+
+  //............................................................................
   // shift_left_logic, shift_right_logic .......................................
-  template <typename T>
-  T shift_logic_left (uint32_t size, uint32_t data, uint32_t value)  
+  //............................................................................
+  template <typename T>
+  T shift_logic_left (uint32_t size, T data, T value)  
   {
     T mask = gen_mask<T> (size);
@@ -52,5 +69,5 @@
 
   template <typename T>
-  T shift_logic_right (uint32_t size, uint32_t data, uint32_t value)  
+  T shift_logic_right (uint32_t size, T data, T value)  
   {
     T mask = gen_mask<T> (size);
@@ -59,7 +76,9 @@
   }
 
+  //............................................................................
   // shift_logic ...............................................................
-  template <typename T>
-  T shift_logic      (uint32_t size, uint32_t data, uint32_t value, bool is_direction_left)
+  //............................................................................
+  template <typename T>
+  T shift_logic      (uint32_t size, T data, T value, bool is_direction_left)
   {
     if (is_direction_left == true)
@@ -69,7 +88,9 @@
   }
 
+  //............................................................................
   // shift_left_arithmetic, shift_right_arithmetic .............................
-  template <typename T>
-  T shift_arithmetic_left (uint32_t size, uint32_t data, uint32_t value)  
+  //............................................................................
+  template <typename T>
+  T shift_arithmetic_left (uint32_t size, T data, T value)  
   {
     bool carry = (data&1) != 0;
@@ -89,5 +110,5 @@
 
   template <typename T>
-  T shift_arithmetic_right (uint32_t size, uint32_t data, uint32_t value)  
+  T shift_arithmetic_right (uint32_t size, T data, T value)  
   {
     bool carry = (data&(1<<(size-1))) != 0;
@@ -105,7 +126,9 @@
   }
 
+  //............................................................................
   // shift_arithmetic ..........................................................
-  template <typename T>
-  T shift_arithmetic      (uint32_t size, uint32_t data, uint32_t value, bool is_direction_left)
+  //............................................................................
+  template <typename T>
+  T shift_arithmetic      (uint32_t size, T data, T value, bool is_direction_left)
   {
     if (is_direction_left == true)
@@ -115,7 +138,9 @@
   }
 
+  //............................................................................
   // shift .....................................................................
-  template <typename T>
-  T shift            (uint32_t size, uint32_t data, uint32_t value, bool is_direction_left, bool is_shift_arithmetic)
+  //............................................................................
+  template <typename T>
+  T shift            (uint32_t size, T data, T value, bool is_direction_left, bool is_shift_arithmetic)
   {
     if (is_shift_arithmetic == true)
@@ -125,8 +150,9 @@
   }
 
+  //............................................................................
   // rotate_left, rotate_right .................................................
-
-  template <typename T>
-  T rotate_left    (uint32_t size, uint32_t data, uint32_t value)  
+  //............................................................................
+  template <typename T>
+  T rotate_left    (uint32_t size, T data, T value)  
   {
     T mask        = gen_mask<T> (size);
@@ -137,5 +163,5 @@
 
   template <typename T>
-  T rotate_right    (uint32_t size, uint32_t data, uint32_t value)  
+  T rotate_right    (uint32_t size, T data, T value)  
   {
     T mask        = gen_mask<T> (size);
@@ -145,7 +171,9 @@
   }
 
+  //............................................................................
   // rotate ....................................................................
-  template <typename T>
-  T rotate         (uint32_t size, uint32_t data, uint32_t value, bool is_direction_left)  
+  //............................................................................
+  template <typename T>
+  T rotate         (uint32_t size, T data, T value, bool is_direction_left)  
   {
     if (is_direction_left == true)
@@ -155,7 +183,9 @@
   }
 
+  //............................................................................
   // range .....................................................................
-  template <typename T>
-  T range          (uint32_t data, uint32_t index_max, uint32_t index_min)  
+  //............................................................................
+  template <typename T>
+  T range          (T data, uint32_t index_max, uint32_t index_min)  
   {
     return gen_mask<T>(index_max-index_min+1) & (data << index_min);
@@ -163,8 +193,56 @@
 
   template <typename T>
-  T range          (uint32_t data, uint32_t nb_bits)  
+  T range          (T data, uint32_t nb_bits)  
   {
     return gen_mask<T>(nb_bits) & data;
   }
+
+  //............................................................................
+  // insert ....................................................................
+  //............................................................................
+  template <typename T>
+  T insert         (T data_old, T data_new, uint32_t index_max, uint32_t index_min)  
+  {
+    return (mask<T>(data_new,index_max,index_min) | mask_not<T>(data_old,index_max,index_min));
+  }
+
+  //............................................................................
+  // extend ....................................................................
+  //............................................................................
+  template <typename T>
+  T extend         (uint32_t size, T data, bool extend_with_sign, uint32_t nb_bits_keep)
+  {
+    if (size < nb_bits_keep)
+      return data;
+
+    if (extend_with_sign and ((data>>(nb_bits_keep-1))&1))
+      return data | (mask<T>(gen_mask<T>(size),size-1, nb_bits_keep));
+    else
+      return data & (mask<T>(gen_mask<T>(size),nb_bits_keep-1, 0));
+  }
+
+  //............................................................................
+  // duplicate..................................................................
+  //............................................................................
+
+  template <typename T>
+  T duplicate (uint32_t size, T data_src, uint32_t nb_bits, uint32_t index_min)
+  {
+    T data_duplicate = mask<T>((data_src)>>index_min, nb_bits-1, 0);
+    T data_dest      = 0;
+    
+    for (uint32_t i=0; i < size; i+=nb_bits)
+      data_dest |= (data_duplicate<<i);
+    
+    return data_dest;
+  }
+
+  template <typename T>
+  T duplicate (uint32_t size, T data_src, uint32_t nb_bits)
+  {
+    return duplicate<T> (size,data_src,nb_bits,0);
+  }
+
+
 }; // end namespace morpheo              
 
Index: trunk/IPs/systemC/processor/Morpheo/Common/include/ChangeCase.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Common/include/ChangeCase.h	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Common/include/ChangeCase.h	(revision 71)
@@ -12,9 +12,7 @@
 #include <stdint.h>
 
-using namespace std;
-
 namespace morpheo              {
   
-  inline void UpperCase(string& S)
+  inline void UpperCase(std::string& S)
   {
     uint32_t n = S.size();
@@ -27,5 +25,5 @@
   }
   
-  inline void LowerCase(string& S)
+  inline void LowerCase(std::string& S)
   {
     uint32_t n = S.size();
Index: trunk/IPs/systemC/processor/Morpheo/Common/include/Debug.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Common/include/Debug.h	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Common/include/Debug.h	(revision 71)
@@ -2,4 +2,5 @@
 #define DEBUG_H
 
+#include "Common/include/Message.h"
 #include "Behavioural/include/Debug_component.h"
 #include <stdio.h>
@@ -8,5 +9,4 @@
 #include <sstream>
 #include <string>
-using namespace std;
 
 // Debug's Level :
@@ -29,35 +29,35 @@
 //Debug
 #  define log_printf(level, component, func, str... )                   \
-do                                                                      \
-{                                                                       \
-    if ( (DEBUG == DEBUG_ALL ) or                                       \
-         (DEBUG_ ## level == DEBUG_NONE) or                             \
-         (( DEBUG_ ## level     <= DEBUG) and                           \
-          ( DEBUG_ ## component == true )) )                            \
-      {                                                                 \
-        if (DEBUG >= DEBUG_ALL )                                        \
-          {                                                             \
-            switch (DEBUG_ ## level)                                    \
-            {                                                           \
-	    case DEBUG_NONE  : fprintf(stdout,"(none       ) "); break; \
-	    case DEBUG_INFO  : fprintf(stdout,"(information) "); break; \
-	    case DEBUG_TRACE : fprintf(stdout,"(trace      ) "); break; \
-	    case DEBUG_FUNC  : fprintf(stdout,"(function   ) "); break; \
-	    case DEBUG_ALL   : fprintf(stdout,"(all        ) "); break; \
-	    default          : fprintf(stdout,"(undefine   ) "); break; \
-	    }                                                           \
-          }                                                             \
-        fprintf(stdout,"<%s> ",func);                                   \
-        if (DEBUG >= DEBUG_FUNC)                                        \
-        {                                                               \
-          fprintf(stdout,"In file %s, ",__FILE__);                      \
-          fprintf(stdout,"at line %d, ",__LINE__);                      \
-        }                                                               \
-        fprintf(stdout,": ");                                           \
-        fprintf(stdout,str);                                            \
-        fprintf(stdout,"\n");                                           \
-        fflush (stdout);                                                \
-      }                                                                 \
-} while(0)
+  do									\
+    {									\
+      if ((DEBUG == DEBUG_ALL ) or					\
+	  (DEBUG_ ## level == DEBUG_NONE) or				\
+	  (( DEBUG_ ## level     <= DEBUG) and				\
+	   ( DEBUG_ ## component == true )) )				\
+	{								\
+	  if (DEBUG >= DEBUG_ALL )					\
+	    {								\
+	      switch (DEBUG_ ## level)					\
+		{							\
+		case DEBUG_NONE  : msg(_("(none       ) ")); break;	\
+		case DEBUG_INFO  : msg(_("(information) ")); break;	\
+		case DEBUG_TRACE : msg(_("(trace      ) ")); break;	\
+		case DEBUG_FUNC  : msg(_("(function   ) ")); break;	\
+		case DEBUG_ALL   : msg(_("(all        ) ")); break;	\
+		default          : msg(_("(undefine   ) ")); break;	\
+		}							\
+	    }								\
+	  msg(_("<%s> "),func);						\
+	  if (DEBUG >= DEBUG_FUNC)					\
+	    {								\
+	      msg(_("In file %s, "),__FILE__);				\
+	      msg(_("at line %d, "),__LINE__);				\
+	    }								\
+	  msg(_(": "));							\
+	  msg(str);							\
+	  msg(_("\n"));							\
+	  fflush (stdout);						\
+	}								\
+    } while(0)
 
 #else
Index: trunk/IPs/systemC/processor/Morpheo/Common/include/ErrorMorpheo.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Common/include/ErrorMorpheo.h	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Common/include/ErrorMorpheo.h	(revision 71)
@@ -5,23 +5,31 @@
  * $Id$
  *
- * [ Description ]
+ * [ Description ]
  * 
  */
 
+#include "ToString.h"
 #include <iostream>
 #include <exception>
 
-using namespace std;
-
 namespace morpheo              {
 
-  class ErrorMorpheo : public exception 
+#define ERRORMORPHEO(funcname,msg) ErrorMorpheo(funcname,msg,__LINE__,__FILE__)
+
+  class ErrorMorpheo : public std::exception 
   {
     // -----[ fields ]----------------------------------------------------
-  private : string _msg;
+  private : std::string _msg;
     
     // -----[ methods ]---------------------------------------------------
-  public  :             ErrorMorpheo  ()           throw() { _msg = "Exception detected ...";}
-  public  :             ErrorMorpheo  (string msg) throw() { _msg = msg;}
+  public  :             ErrorMorpheo  ()                throw() {_msg="Exception detected ...";}
+  public  :             ErrorMorpheo  (std::string msg) throw() {_msg=msg;}
+  public  :             ErrorMorpheo  (std::string funcname,
+				       std::string msg     ,
+				       int         line    ,
+				       std::string file    ) throw() 
+    { 
+      _msg = "<"+funcname+"> at line " + toString(line) + ", in file " + file + " : "+msg;
+    }
   public  :             ~ErrorMorpheo (void)       throw() {}
   public  : const char* what          ()    const  throw() { return ( _msg.c_str() );}
@@ -29,14 +37,14 @@
   };
 
-  class TestMorpheo : public exception 
+  class TestMorpheo : public std::exception 
   {
     // -----[ fields ]----------------------------------------------------
-  private : string _msg;
+  private : std::string _msg;
     
     // -----[ methods ]---------------------------------------------------
-  public  :             TestMorpheo   ()           throw() { _msg = "Test error ...";}
-  public  :             TestMorpheo   (string msg) throw() { _msg = msg;}
-  public  :             ~TestMorpheo  (void)       throw() {}
-  public  : const char* what          ()    const  throw() { return ( _msg.c_str() );}
+  public  :             TestMorpheo   ()                throw() {_msg="Test error ...";}
+  public  :             TestMorpheo   (std::string msg) throw() {_msg=msg;}
+  public  :             ~TestMorpheo  (void)            throw() {}
+  public  : const char* what          ()    const       throw() { return ( _msg.c_str() );}
   };
 
Index: trunk/IPs/systemC/processor/Morpheo/Common/include/Log2.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Common/include/Log2.h	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Common/include/Log2.h	(revision 71)
@@ -11,5 +11,4 @@
 #include <stdint.h>
 #include <math.h>
-using namespace std;
 
 namespace morpheo              {
Index: trunk/IPs/systemC/processor/Morpheo/Common/include/Message.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Common/include/Message.h	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Common/include/Message.h	(revision 71)
@@ -1,13 +1,27 @@
+#ifndef MESSAGE_H
+#define MESSAGE_H
 /*
  * $Id$
  *
- * [ Description ]
+ * [ Description ]
  * 
  * Routine of Test
  */
 
-namespace morpheo    {
+#include <stdio.h>
+#include <string.h>
+#include <libintl.h>
 
-#define cerr_msg   cerr << "<" << __FILE__ << "> line " << __LINE__ << " : "
-  
+namespace morpheo {
+
+#ifdef NO_TRANSLATION
+# define _(String) (String)
+#else
+# define _(String) gettext (String)
+#endif
+
+#define msg(arg...) fprintf(stdout,arg);
+#define err(arg...) fprintf(stderr,arg);
+
 }; // end namespace morpheo
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Common/include/Test.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Common/include/Test.h	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Common/include/Test.h	(revision 71)
@@ -5,6 +5,7 @@
 #include <sstream>
 #include <stdint.h>
+#include "Common/include/Message.h"
 #include "Common/include/ErrorMorpheo.h"
-using namespace std;
+#include "Common/include/ToString.h"
 
 //-----[ Routine de test ]---------------------------------------
@@ -12,12 +13,12 @@
 static uint32_t num_test;
 
-void test_ko_error (void)
+inline void test_ko_error (void)
 {
-  string msg = "Test ko : error in test \""+toString(num_test)+"\"";
-  throw (ErrorMorpheo (msg));
+  string msg = "Test ko : error in test \""+morpheo::toString(num_test)+"\"";
+  throw (morpheo::ErrorMorpheo (msg));
 }
   
 template <class T>
-void test_ko (char * file, uint32_t line, T exp1, T exp2)
+inline void test_ko (char * file, uint32_t line, T exp1, T exp2)
 {
   cerr << "[" << num_test << "] : Test KO"
@@ -27,11 +28,11 @@
        << "   - Line : " << line                      << endl
        << " * Expression is different"                << endl
-       << "   - exp1 : "+toString(exp1)               << endl
-       << "   - exp2 : "+toString(exp2)               << endl;
+       << "   - exp1 : "+morpheo::toString(exp1)               << endl
+       << "   - exp2 : "+morpheo::toString(exp2)               << endl;
 
   test_ko_error ();
 };
 
-void test_ko (char * file, uint32_t line)
+inline void test_ko (char * file, uint32_t line)
 {
   cerr << "[" << num_test << "] : Test KO"
@@ -44,19 +45,15 @@
 };
 
-void test_ok ()
+inline void test_ok ()
 {
-  cout << "[" << num_test << "] : Test OK"            << endl;
+  msg (_("[%d] : Test OK\n"), num_test);
 
   num_test ++;
 };
 
-void test_ok (char * file, uint32_t line)
+inline void test_ok (char * file, uint32_t line)
 {
-  cout << "[" << num_test << "] : Test OK"
-       << "\tline " << line                           << endl
-//     << " * Localisation"                           << endl
-//     << "   - File : " << file                      << endl
-//     << "   - Line : " << line                      << endl
-    ;
+  msg (_("[%d] : Test OK\n"), num_test);
+  msg (_("\tline %d\n"), line);
 
   num_test ++;
@@ -64,15 +61,9 @@
 
 template <class T>
-void test_ok (char * file, uint32_t line, T exp)
+inline void test_ok (char * file, uint32_t line, T exp)
 {
-  cout << "[" << num_test << "] : Test OK"
-       << "\tline " << line                           
-       << "\tvalue : " << toString(exp)               << endl
-//     << " * Localisation"                           << endl
-//     << "   - File : " << file                      << endl
-//     << "   - Line : " << line                      << endl
-//     << " * Expression"                             << endl
-//     << "   - exp  : "+toString(exp)                << endl
-    ;
+  msg (_("[%d] : Test OK\n"), num_test);
+  msg (_("\tline %d\n"), line);
+  msg (_("\tvalue %s\n"), (morpheo::toString(exp)).c_str());
 
   num_test ++;
@@ -80,5 +71,5 @@
 
 template <class T>
-void test(char * file, uint32_t line, T exp1, T exp2)
+inline void test(char * file, uint32_t line, T exp1, T exp2)
 {
   if (exp1 != exp2)
Index: trunk/IPs/systemC/processor/Morpheo/Common/include/Time.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Common/include/Time.h	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Common/include/Time.h	(revision 71)
@@ -0,0 +1,44 @@
+#ifndef TIME_H
+#define TIME_H
+
+#ifdef SYSTEMC
+#include "systemc.h"
+#endif
+
+#include <string>
+#include <iostream>
+#include <sys/time.h>
+
+class Time 
+{
+private : timeval time_begin;
+// private : timeval time_end;
+  
+public  : Time ()
+  {
+    gettimeofday(&time_begin     ,NULL);
+  };
+
+public  : ~Time ()
+  {
+    std::cout << *this;
+  };
+
+public  : friend std::ostream& operator<< (std::ostream& output_stream,
+					   const Time & x)
+  {
+    timeval time_end;
+    
+    gettimeofday(&time_end       ,NULL);
+    
+    uint32_t nb_cycles = static_cast<uint32_t>(sc_simulation_time());
+
+    double average = static_cast<double>(nb_cycles) / static_cast<double>(time_end.tv_sec-x.time_begin.tv_sec);
+    
+    output_stream << nb_cycles << "\t(" << average << " cycles / seconds )" << std::endl;
+
+    return output_stream;
+  }
+};
+
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Common/include/ToString.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Common/include/ToString.h	(revision 70)
+++ trunk/IPs/systemC/processor/Morpheo/Common/include/ToString.h	(revision 71)
@@ -17,13 +17,9 @@
 #include <limits>
 
-using std::setprecision ; 
-using std::ostringstream ; 
-using std::boolalpha ;
-
 namespace morpheo              {
   
   template<typename T> inline std::string toString             (const T& x)
   {
-    ostringstream out("");
+    std::ostringstream out("");
     out << x;
     return out.str();
@@ -32,5 +28,5 @@
   template<>           inline std::string toString<bool>       (const bool& x)
   {
-    ostringstream out("");
+    std::ostringstream out("");
     //out << boolalpha << x;
     out << x;
@@ -41,6 +37,6 @@
   {
     const int sigdigits = std::numeric_limits<float>::digits10;
-    ostringstream out("");
-    out << setprecision(sigdigits) << x;
+    std::ostringstream out("");
+    out << std::setprecision(sigdigits) << x;
     return out.str();
   }
@@ -49,6 +45,6 @@
   {
     const int sigdigits = std::numeric_limits<double>::digits10;
-    ostringstream out("");
-    out << setprecision(sigdigits) << x;
+    std::ostringstream out("");
+    out << std::setprecision(sigdigits) << x;
     return out.str();
   }
@@ -57,6 +53,6 @@
   {
     const int sigdigits = std::numeric_limits<long double>::digits10;
-    ostringstream out("");
-    out << setprecision(sigdigits) << x;
+    std::ostringstream out("");
+    out << std::setprecision(sigdigits) << x;
     return out.str();
   }
@@ -64,5 +60,5 @@
 //   template<>           inline std::string toString< int8_t>       (const int8_t& x)
 //   {
-//     ostringstream out("");
+//     std::ostringstream out("");
 //     out << x;
 //     return out.str();
@@ -71,5 +67,5 @@
 //   template<>           inline std::string toString<uint8_t>       (const uint8_t& x)
 //   {
-//     ostringstream out("");
+//     std::ostringstream out("");
 //     out << x;
 //     return out.str();
@@ -78,5 +74,5 @@
 //   template<>           inline std::string toString< int16_t>      (const int16_t& x)
 //   {
-//     ostringstream out("");
+//     std::ostringstream out("");
 //     out << x;
 //     return out.str();
@@ -85,5 +81,5 @@
 //   template<>           inline std::string toString<uint16_t>      (const uint16_t& x)
 //   {
-//     ostringstream out("");
+//     std::ostringstream out("");
 //     out << x;
 //     return out.str();
@@ -92,5 +88,5 @@
 //   template<>           inline std::string toString< int32_t>      (const int32_t& x)
 //   {
-//     ostringstream out("");
+//     std::ostringstream out("");
 //     out << x;
 //     return out.str();
@@ -99,5 +95,5 @@
 //   template<>           inline std::string toString<uint32_t>      (const uint32_t& x)
 //   {
-//     ostringstream out("");
+//     std::ostringstream out("");
 //     out << x;
 //     return out.str();
Index: trunk/IPs/systemC/processor/Morpheo/Script/xilinx_extract_info.sh
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Script/xilinx_extract_info.sh	(revision 71)
+++ trunk/IPs/systemC/processor/Morpheo/Script/xilinx_extract_info.sh	(revision 71)
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+for i in *.fpga.log; do
+
+    echo "===== $i";
+    grep "Number of Slice Registers" $i;
+    grep "Number used as Logic"      $i;
+    grep "Number used as Memory"     $i;
+    grep "Maximum Frequency"         $i;
+done
