Index: trunk/IPs/systemC/Environment/src/Environment.cpp
===================================================================
--- trunk/IPs/systemC/Environment/src/Environment.cpp	(revision 81)
+++ trunk/IPs/systemC/Environment/src/Environment.cpp	(revision 88)
@@ -1,3 +1,5 @@
 #include "../include/Environment.h"
+
+using namespace morpheo;
 
 namespace environment {
@@ -60,6 +62,4 @@
 
 
-
-
     for (uint32_t i=0; i<param->nb_entity; i++)
       {
@@ -79,4 +79,8 @@
     read_dram[0] = new char [max_data_size/8];
     write_dram   = new char [max_data_size/8];
+    context_stop = new bool [param->nb_entity];
+    for (uint32_t i=0; i<param->nb_entity; ++i)
+      context_stop [i] = false;
+    nb_context_stop = 0;
 
     // Port 
Index: trunk/IPs/systemC/Environment/src/Environment_genMoore.cpp
===================================================================
--- trunk/IPs/systemC/Environment/src/Environment_genMoore.cpp	(revision 81)
+++ trunk/IPs/systemC/Environment/src/Environment_genMoore.cpp	(revision 88)
@@ -1,3 +1,5 @@
 #include "../include/Environment.h"
+
+using namespace morpheo;
 
 namespace environment {
Index: trunk/IPs/systemC/Environment/src/Environment_simulation_end.cpp
===================================================================
--- trunk/IPs/systemC/Environment/src/Environment_simulation_end.cpp	(revision 88)
+++ trunk/IPs/systemC/Environment/src/Environment_simulation_end.cpp	(revision 88)
@@ -0,0 +1,10 @@
+#include "../include/Environment.h"
+
+namespace environment {
+
+  bool Environment::simulation_end(void)
+  {
+    return (nb_context_stop >= param->nb_entity);
+  }
+
+};
Index: trunk/IPs/systemC/Environment/src/Environment_stop.cpp
===================================================================
--- trunk/IPs/systemC/Environment/src/Environment_stop.cpp	(revision 88)
+++ trunk/IPs/systemC/Environment/src/Environment_stop.cpp	(revision 88)
@@ -0,0 +1,17 @@
+#include "../include/Environment.h"
+
+namespace environment {
+
+  void Environment::stop(uint32_t num_context)
+  {
+    if (context_stop [num_context] == false)
+      {
+        context_stop [num_context] = true;
+        nb_context_stop ++;
+	
+        if (nb_context_stop >= param->nb_entity)
+          sc_stop();
+      }
+  }
+
+};
Index: trunk/IPs/systemC/Environment/src/Environment_transition.cpp
===================================================================
--- trunk/IPs/systemC/Environment/src/Environment_transition.cpp	(revision 81)
+++ trunk/IPs/systemC/Environment/src/Environment_transition.cpp	(revision 88)
@@ -1,3 +1,5 @@
 #include "../include/Environment.h"
+
+using namespace morpheo;
 
 namespace environment {
@@ -43,7 +45,7 @@
 		Ticache_context_t context   = ICACHE_REQ_CONTEXT_ID [i][j]->read();// TODO : test presence
 		Ticache_packet_t  packet    = ICACHE_REQ_PACKET_ID  [i][j]->read();// TODO : test presence
-		Ticache_address_t address   = ICACHE_REQ_ADDRESS    [i][j]->read();
+		Ticache_address_t address   = ICACHE_REQ_ADDRESS    [i][j]->read()<<2;
 		Ticache_type_t    type      = ICACHE_REQ_TYPE       [i][j]->read();
-		uint32_t          size      = param->iaccess_size_address [i]/8;
+		uint32_t          size      = (param->iaccess_size_address [i]+2)/8;
 
 		_cout(ENVIRONMENT," * information\n");
@@ -67,5 +69,5 @@
 		    (entity.segment->getType() == data::TYPE_TARGET_MEMORY))
 		  {
-		    _cout(ENVIRONMENT, " * OK !\n");
+		    _cout(ENVIRONMENT," * OK !\n");
 		    bus_error = false;
 		    uncached  = entity.segment->getUncached();
@@ -73,10 +75,10 @@
 		    if (must_read == true) // Test if must read the ram
 		      {
-			_cout(ENVIRONMENT, "   * must read\n");
+			_cout(ENVIRONMENT,"   * must read\n");
 			// Read all instruction
 			for (unsigned int k=0; k<param->iaccess_nb_instruction[i]; k++)
 			  {
 			    uint32_t addr = address+k*(size);
-			    _cout(ENVIRONMENT, "   * addr : %.8x\n",addr);
+                            _cout(ENVIRONMENT,"   * addr    : %.8x\n",addr);
 
 			    bus_error |= !component_data->read(addr,size,read_iram[k]);
@@ -84,5 +86,12 @@
 			    // Swap if endienness is different
 			    if (endianness::isSameEndianness(context) == false) 
-			      read_iram[k] = endianness::swapBytes(read_iram[k],size,size);
+                              {
+                                read_iram[k] = endianness::swapBytes(read_iram[k],size,size);
+                              }
+
+                            _cout(ENVIRONMENT,"   * inst    :");
+                            for (int32_t cpt=(param->iaccess_size_instruction[context]/8)-1; cpt>=0; --cpt)
+                              _cout(ENVIRONMENT, "%.2x",0xff&static_cast<uint32_t>(read_iram[k][cpt]));
+                            _cout(ENVIRONMENT, "\n");
 			  }
 		      }
@@ -241,14 +250,7 @@
 				       ,static_cast<uint32_t>((wdata>> 0)&0xff)
 				       );
+
+                                stop (context);
 			    
-// 				if (context_stop [context] == false)
-// 				  {
-// 				    context_stop [context] = true;
-// 				    nb_context_stop ++;
-				    
-// 				    if (nb_context_stop >= nb_context)
-// 				      sc_stop();
-// 				  }
-
 				break;
 			      }
@@ -387,5 +389,5 @@
 				  {
 				    // Decomposition en groupe octect
-				    Tdcache_data_t result = (Tdcache_data_t)(component_sim2os->result);
+				    Tdcache_data_t result = static_cast<Tdcache_data_t>(reinterpret_cast<uint64_t>(component_sim2os->result));
 				    _cout(ENVIRONMENT,"<sim2os> result      : %x\n",result);
 				    
@@ -494,5 +496,4 @@
 		    component_buffer_drsp [i]->push(latence,rsp);
 		  }
-
 	      }
 	//=============================================================================
