Index: trunk/IPs/systemC/Environment/src/Environment_genMoore.cpp
===================================================================
--- trunk/IPs/systemC/Environment/src/Environment_genMoore.cpp	(revision 123)
+++ trunk/IPs/systemC/Environment/src/Environment_genMoore.cpp	(revision 124)
@@ -30,38 +30,44 @@
 	//-----------------------------------------------------------------------------
 	{
+          // init
 	  for (uint32_t j = 0; j < param->icache_dedicated_nb_port [i]; j ++)
+            icache_rsp_val [i][j] = 0;
+
+	  for (uint32_t j = 0; j+1 < component_buffer_irsp [i]->nb_slot_use(); j ++)
       	    {
 	      // Test the number of element in the respons's buffer
-      	      if (j >= component_buffer_irsp [i]->nb_slot_use())
-      		{
-		  icache_rsp_val [i][j] = 0; // No respons
-      		}
-      	      else
-      		{
-		  queue::slot_t<irsp_t*> slot = component_buffer_irsp [i]->read(j);
+              
+              queue::slot_t<irsp_t*> slot = component_buffer_irsp [i]->read(j);
+              
+              uint32_t port = slot._data->port;
+              
+              bool val = ((slot._delay == 0) and (icache_rsp_val [i][port] == 0));
+
+              _cout(ENVIRONMENT, "buffer_irsp [%d][%d] - delay %d - port %d\n",i,j,slot._delay,port);
+
+              
+              if (val)
+                {
+                  _cout(ENVIRONMENT, "ICACHE_RSP [%d][%d] - respons valid\n",i,port);
+                  
+                  icache_rsp_val        [i][port] = 1;
+                                
+                  ICACHE_RSP_CONTEXT_ID [i][port]->write(slot._data->trdid); // TODO : test if exist
+                  ICACHE_RSP_PACKET_ID  [i][port]->write(slot._data->pktid); // TODO : test if exist
+                  ICACHE_RSP_ERROR      [i][port]->write(slot._data->error);
 		  
-		  bool val = (slot._delay == 0);
-
-		  icache_rsp_val [i][j] = (val); // respons if have a result
-
-		  if (val)
-		    {
-		      ICACHE_RSP_CONTEXT_ID [i][j]->write(slot._data->trdid); // TODO : test if exist
-		      ICACHE_RSP_PACKET_ID  [i][j]->write(slot._data->pktid); // TODO : test if exist
-		      ICACHE_RSP_ERROR      [i][j]->write(slot._data->error);
-		      
-		      for (uint32_t k = 0; k < param->iaccess_nb_instruction[i]; k ++)
-			{
-			  Ticache_instruction_t data = 0;
-			  
-			  atoi (slot._data->data[k], data, param->iaccess_size_instruction[i]/8);
-			  
-			  ICACHE_RSP_INSTRUCTION [i][j][k]->write(data);
-			}
-		    }
-		}
-
-	      ICACHE_RSP_VAL [i][j]->write (icache_rsp_val [i][j]);
-      	    }
+                  for (uint32_t k = 0; k < param->iaccess_nb_instruction[i]; k ++)
+                    {
+                      Ticache_instruction_t data = 0;
+                      
+                      atoi (slot._data->data[k], data, param->iaccess_size_instruction[i]/8);
+                      
+                      ICACHE_RSP_INSTRUCTION [i][port][k]->write(data);
+                    }
+                }
+            }
+          
+	  for (uint32_t j = 0; j < param->icache_dedicated_nb_port [i]; j ++)
+            ICACHE_RSP_VAL [i][j]->write (icache_rsp_val [i][j]);
 	}
 	
@@ -103,4 +109,6 @@
 		  if (val)
 		    {
+                      _cout(ENVIRONMENT, "DCACHE_RSP [%d][%d] - respons valid\n",i,j);
+
 		      DCACHE_RSP_CONTEXT_ID [i][j]->write(slot._data->trdid); // TODO : test if exist
 		      DCACHE_RSP_PACKET_ID  [i][j]->write(slot._data->pktid); // TODO : test if exist
Index: trunk/IPs/systemC/Environment/src/Environment_transition.cpp
===================================================================
--- trunk/IPs/systemC/Environment/src/Environment_transition.cpp	(revision 123)
+++ trunk/IPs/systemC/Environment/src/Environment_transition.cpp	(revision 124)
@@ -44,5 +44,5 @@
 	    if (ICACHE_REQ_VAL [i][j]->read() and icache_req_ack [i][j])
 	      {
-		_cout(ENVIRONMENT, "ICACHE_REQ [%d] : Transaction accepted\n",i);
+		_cout(ENVIRONMENT, "ICACHE_REQ [%d][%d] : Transaction accepted\n",i,j);
 
 		Ticache_context_t context   = ICACHE_REQ_CONTEXT_ID [i][j]->read();// TODO : test presence
@@ -83,5 +83,5 @@
 			  {
 			    uint32_t addr = address+k*(size);
-                            _cout(ENVIRONMENT,"    * addr    : %.8x\n",addr);
+                            _cout(ENVIRONMENT,"    * addr    : %.8x - ",addr);
 
 			    bus_error |= !component_data->read(addr,size,read_iram[k]);
@@ -93,5 +93,5 @@
                               }
 
-                            _cout(ENVIRONMENT,"    * inst    :");
+                            //_cout(ENVIRONMENT,"    * inst    : ");
                             for (int32_t cpt=(param->iaccess_size_instruction[i]/8)-1; cpt>=0; --cpt)
                               __cout(ENVIRONMENT, "%.2x",0xff&static_cast<uint32_t>(read_iram[k][cpt]));
@@ -144,5 +144,6 @@
 		    _cout(ENVIRONMENT, "    * push in buffer_irsp[%d]\n",i);
 
-		    irsp_t * rsp = new irsp_t(context,
+		    irsp_t * rsp = new irsp_t(j,
+                                              context,
 					      packet,
 					      param->iaccess_nb_instruction[i],
@@ -163,5 +164,5 @@
 	    if (DCACHE_REQ_VAL [i][j]->read() and dcache_req_ack [i][j])
 	      {
-		_cout(ENVIRONMENT, "DCACHE_REQ [%d] : Transaction accepted\n",i);
+		_cout(ENVIRONMENT, "DCACHE_REQ [%d][%d] : Transaction accepted\n",i,j);
 
 		Tdcache_context_t context   = DCACHE_REQ_CONTEXT_ID [i][j]->read();// TODO : test presence
@@ -339,8 +340,13 @@
 
 			  uint32_t num_ramlock           = (address - entity.segment->getBase()); // Char access
+			  uint32_t num_lock              = num_ramlock % (param->daccess_size_data [i]/8);
 			  uint32_t num_component_ramlock = entity.segment->getIndex();
 
-			  _cout(ENVIRONMENT,"    * num_ramlock           : %d\n",num_ramlock          );
-			  _cout(ENVIRONMENT,"    * num_component_ramlock : %d\n",num_component_ramlock);
+// 			  _cout(ENVIRONMENT,"    * num_ramlock           : %d\n",num_ramlock          );
+// 			  _cout(ENVIRONMENT,"    * num_lock              : %d\n",num_lock             );
+// 			  _cout(ENVIRONMENT,"    * num_component_ramlock : %d\n",num_component_ramlock);
+			  _cout(true,"    * num_ramlock           : %d\n",num_ramlock          );
+			  _cout(true,"    * num_lock              : %d\n",num_lock             );
+			  _cout(true,"    * num_component_ramlock : %d\n",num_component_ramlock);
 
 			  // No test : because out of range
@@ -352,9 +358,12 @@
 
 			  memset (read_dram[0],0,size);
-			  
+
 			  if (must_read == true)
-			    read_dram [0][0] = static_cast<char>(component_ramlock [num_component_ramlock]->read (num_ramlock));
+			    read_dram [0][num_lock] = static_cast<char>(component_ramlock [num_component_ramlock]->read (num_ramlock));
 			  if (must_write == true)
-			    read_dram [0][0] = static_cast<char>(component_ramlock [num_component_ramlock]->write(num_ramlock));
+			    read_dram [0][num_lock] = static_cast<char>(component_ramlock [num_component_ramlock]->write(num_ramlock));
+
+			  _cout(true,"    * lock                  : %d\n",(int)read_dram [0][num_lock]);
+// 			  _cout(ENVIRONMENT,"    * lock                  : %d\n",(int)read_dram [0][num_lock]);
 			  
 			  break;
@@ -506,5 +515,6 @@
 		    
 		    // Simplification : the size of a line is a multiple of size_iword (no test)
-		    drsp_t * rsp = new drsp_t(context,
+		    drsp_t * rsp = new drsp_t(j,
+                                              context,
 					      packet,
 					      1,
