Index: trunk/IPs/systemC/Environment/src/Environment_transition.cpp
===================================================================
--- trunk/IPs/systemC/Environment/src/Environment_transition.cpp	(revision 114)
+++ trunk/IPs/systemC/Environment/src/Environment_transition.cpp	(revision 117)
@@ -52,10 +52,10 @@
 		uint32_t          size      = (param->iaccess_size_address [i]+2)/8;
 
-		_cout(ENVIRONMENT," * information\n");
-		_cout(ENVIRONMENT,"   * context : %d\n" ,static_cast<uint32_t>(context));
-		_cout(ENVIRONMENT,"   * packet  : %d\n" ,static_cast<uint32_t>(packet ));
-		_cout(ENVIRONMENT,"   * address : %.x\n",static_cast<uint32_t>(address));
-		_cout(ENVIRONMENT,"   * type    : %d\n" ,static_cast<uint32_t>(type   ));
-		_cout(ENVIRONMENT,"   * size    : %d\n" ,static_cast<uint32_t>(size   ));
+		_cout(ENVIRONMENT,"  * information\n");
+		_cout(ENVIRONMENT,"    * context : %d\n" ,static_cast<uint32_t>(context));
+		_cout(ENVIRONMENT,"    * packet  : %d\n" ,static_cast<uint32_t>(packet ));
+		_cout(ENVIRONMENT,"    * address : %.x\n",static_cast<uint32_t>(address));
+		_cout(ENVIRONMENT,"    * type    : %d\n" ,static_cast<uint32_t>(type   ));
+		_cout(ENVIRONMENT,"    * size    : %d\n" ,static_cast<uint32_t>(size   ));
 
 		// search the entity
@@ -72,5 +72,5 @@
 		    (entity.segment->getType() == data::TYPE_TARGET_MEMORY))
 		  {
-		    _cout(ENVIRONMENT," * OK !\n");
+		    _cout(ENVIRONMENT,"  * OK !\n");
 		    bus_error = false;
 		    uncached  = entity.segment->getUncached();
@@ -78,10 +78,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]);
@@ -93,8 +93,8 @@
                               }
 
-                            _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");
+                            _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]));
+                            __cout(ENVIRONMENT, "\n");
 			  }
 		      }
@@ -102,8 +102,8 @@
 		else
 		  {
-		    _cout(ENVIRONMENT, " * KO !\n");
-		    _cout(ENVIRONMENT, "   * present : %d\n",entity.present);
+		    _cout(ENVIRONMENT, "  * KO !\n");
+		    _cout(ENVIRONMENT, "    * present : %d\n",entity.present);
 		    if (entity.present)
-		    _cout(ENVIRONMENT, "   * type    : %d must be data::TYPE_TARGET_MEMORY (%d)\n",entity.segment->getType(), data::TYPE_TARGET_MEMORY);
+		    _cout(ENVIRONMENT, "    * type    : %d must be data::TYPE_TARGET_MEMORY (%d)\n",entity.segment->getType(), data::TYPE_TARGET_MEMORY);
 		      
 		    // entity is not present, or is present but is not a memory : have a bus error
@@ -121,19 +121,19 @@
 							    cache_type.direction);
 		
-		_cout(ENVIRONMENT, "   * latence : %d\n",latence);
+		_cout(ENVIRONMENT, "    * latence : %d\n",latence);
 		
 		// If is a respons -> compute the latence and push in the write_buffer
 		if (must_ack or (must_ack_on_error and bus_error))
 		  {
-		    _cout(ENVIRONMENT, " * must ack\n");
+		    _cout(ENVIRONMENT, "  * must ack\n");
 		    
 		    if (bus_error == true)
 		      {
-                        _cout(ENVIRONMENT,"  * Icache : have a bus error\n");
-                        _cout(ENVIRONMENT,"    * entity     : %d\n",i);
-                        _cout(ENVIRONMENT,"    * port       : %d\n",j);
-                        _cout(ENVIRONMENT,"    * req_addr   : %x\n",address);
-                        _cout(ENVIRONMENT,"    * req_trdid  : %d\n",context);
-                        _cout(ENVIRONMENT,"    * req_pktid  : %d\n",packet );
+                        _cout(ENVIRONMENT,"   * Icache : have a bus error\n");
+                        _cout(ENVIRONMENT,"     * entity     : %d\n",i);
+                        _cout(ENVIRONMENT,"     * port       : %d\n",j);
+                        _cout(ENVIRONMENT,"     * req_addr   : %x\n",address);
+                        _cout(ENVIRONMENT,"     * req_trdid  : %d\n",context);
+                        _cout(ENVIRONMENT,"     * req_pktid  : %d\n",packet );
 
 			// Write in instruction [0] the bad address (only 32bit ....)
@@ -142,5 +142,5 @@
 			    
 		    // Simplification : the size of a line is a multiple of size_iword (no test)
-		    _cout(ENVIRONMENT, "   * push in buffer_irsp[%d]\n",i);
+		    _cout(ENVIRONMENT, "    * push in buffer_irsp[%d]\n",i);
 
 		    irsp_t * rsp = new irsp_t(context,
@@ -153,5 +153,5 @@
 		  }
 
-		_cout(ENVIRONMENT, " * End request\n");
+		_cout(ENVIRONMENT, "  * End request\n");
 	      }
 
@@ -172,10 +172,10 @@
 		uint32_t          size      = param->daccess_size_data [i]/8;
 
-		_cout(ENVIRONMENT," * information\n");
-		_cout(ENVIRONMENT,"   * context : %d\n" ,static_cast<uint32_t>(context));
-		_cout(ENVIRONMENT,"   * packet  : %d\n" ,static_cast<uint32_t>(packet ));
-		_cout(ENVIRONMENT,"   * address : %.x\n",static_cast<uint32_t>(address));
-		_cout(ENVIRONMENT,"   * type    : %d\n" ,static_cast<uint32_t>(type   ));
-		_cout(ENVIRONMENT,"   * size    : %d\n" ,static_cast<uint32_t>(size   ));
+		_cout(ENVIRONMENT,"  * information\n");
+		_cout(ENVIRONMENT,"    * context : %d\n" ,static_cast<uint32_t>(context));
+		_cout(ENVIRONMENT,"    * packet  : %d\n" ,static_cast<uint32_t>(packet ));
+		_cout(ENVIRONMENT,"    * address : %.x\n",static_cast<uint32_t>(address));
+		_cout(ENVIRONMENT,"    * type    : %d\n" ,static_cast<uint32_t>(type   ));
+		_cout(ENVIRONMENT,"    * size    : %d\n" ,static_cast<uint32_t>(size   ));
 
 		bool              uncached  = false;
@@ -230,5 +230,5 @@
 			  uint32_t num_tty   = (address - entity.segment->getBase())>>4;
 			  uint32_t num_print = ((address>>2) & 0x3);
-			  _cout(ENVIRONMENT," * TYPE_TARGET_TTY : num_tty : %d, num_print : %d\n",num_tty, num_print);
+			  _cout(true,"  * TYPE_TARGET_TTY : num_tty : %d, num_print : %d\n",num_tty, num_print);
 			  
 			  switch (num_print)
@@ -243,5 +243,7 @@
 			    case 1 : // STOP
 			      {
-				printf("\n\t***** [ stop    ] Time : %.10d - Address : %.8x - Wdata[31:0] : %.2x%.2x%.2x%.2x         *****\n"
+                                _cout(true,"\n");
+                                _cout(true,"***********************************************************************************************\n");
+				_cout(true,"***** [ STOP    ] Time : %.10d - Address : %.8x - Wdata[31:0] : %.2x%.2x%.2x%.2x         *****\n"
 				       ,static_cast<uint32_t>(sc_simulation_time())
 				       ,static_cast<uint32_t>(address		  )
@@ -251,9 +253,8 @@
 				       ,static_cast<uint32_t>((wdata>> 0)&0xff)
 				       );
-
-                                if (wdata == 0)
-                                  std::cout << STR_OK << std::endl;
-                                else
-                                  std::cout << STR_KO << std::endl;
+                                _cout(true,"***********************************************************************************************\n");
+                                _cout(true,"\n");
+                                _cout(true,"%s\n",(wdata == 0)?STR_OK:STR_KO);
+                                _cout(true,"\n");
 
                                 stop (context);
@@ -263,5 +264,7 @@
 			    case 2 : // PRINT
 			      {
-				printf("\n\t----- [ print   ] Time : %.10d - Address : %.8x - Wdata[31:0] : %.2x%.2x%.2x%.2x         -----\n"
+                                _cout(true,"\n");
+                                _cout(true,"-----------------------------------------------------------------------------------------------\n");
+				_cout(true,"----- [ PRINT   ] Time : %.10d - Address : %.8x - Wdata[31:0] : %.2x%.2x%.2x%.2x         -----\n"
 				       ,static_cast<uint32_t>(sc_simulation_time())
 				       ,static_cast<uint32_t>(address		  )
@@ -271,4 +274,6 @@
 				       ,static_cast<uint32_t>((wdata>> 0)&0xff)
 				       );
+                                _cout(true,"-----------------------------------------------------------------------------------------------\n");
+                                _cout(true,"\n");
 				
 				break;
@@ -276,5 +281,5 @@
 			    default :
 			      {
-				printf("[address : %.8x] tty %d, reg %d don't exist\n",static_cast<uint32_t>(address),num_tty,num_print);
+				_cout(true,"[address : %.8x] tty %d, reg %d don't exist\n",static_cast<uint32_t>(address),num_tty,num_print);
 				bus_error = true;
 			      }
@@ -288,18 +293,13 @@
 		      case data::TYPE_TARGET_MEMORY  : 
 			{
-			  _cout(ENVIRONMENT,"MEMORY\n");
-			  _cout(ENVIRONMENT,"access : %x\n",address);
+			  _cout(ENVIRONMENT,"  * TYPE_TARGET_MEMORY\n");
+			  _cout(ENVIRONMENT,"    * access : %x\n",address);
 
 			  if (must_read == true)
 			    {
 			      // Read
-			      _cout(ENVIRONMENT," * Read  (%d bytes)\n",size);
+			      _cout(ENVIRONMENT,"    * Read  (%d bytes)\n",size);
 			      bus_error |= !component_data->read(address,nb_bytes,read_dram[0]); // always read a complete word
 
-			      _cout(ENVIRONMENT," * Rdata : ");
-			      for (uint32_t i=0; i<nb_bytes; i++)
-				_cout(ENVIRONMENT,"%.2x",0xff&static_cast<uint32_t>(read_dram[0][i]));
-			      _cout(ENVIRONMENT,".\n");
-			      
 			      // Multiple copy
 			      for (unsigned int it_size_data = nb_bytes; it_size_data < size; it_size_data+=nb_bytes)
@@ -314,6 +314,6 @@
 			    {
 			      // Write
-			      _cout(ENVIRONMENT," * Write (%d bytes)\n",size);
-			      _cout(ENVIRONMENT," * Wdata : %x\n",wdata);
+			      _cout(ENVIRONMENT,"    * Write (%d bytes)\n",size);
+			      _cout(ENVIRONMENT,"    * Wdata : %x\n",wdata);
 			      itoa<Tdcache_data_t>(wdata,write_dram,nb_bytes);
 
@@ -329,4 +329,6 @@
 		      case data::TYPE_TARGET_RAMLOCK :
 			{
+			  _cout(ENVIRONMENT,"  * TYPE_TARGET_RAMLOCK\n");
+
 			  // Access is on a byte, else error
 			  if (nb_bytes != 1)
@@ -338,4 +340,7 @@
 			  uint32_t num_ramlock           = (address - entity.segment->getBase()); // Char access
 			  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);
 
 			  // No test : because out of range
@@ -361,4 +366,6 @@
 		      case data::TYPE_TARGET_SIM2OS  :
 			{
+			  _cout(ENVIRONMENT,"  * TYPE_TARGET_SIM2OS\n");
+
 			  // Mapping :
 			  // [0]  number of service - Wonly - A write in this register lunch the execution of service
@@ -368,4 +375,6 @@
 
 			  uint32_t num_reg = (address - entity.segment->getBase())>>2;
+
+			  _cout(ENVIRONMENT,"    * num_reg : %d\n",num_reg);
 			  
 			  switch (num_reg)
@@ -380,5 +389,5 @@
 				else
 				  {
-				    _cout(ENVIRONMENT,"<sim2os> service     : %x\n",wdata);
+				    _cout(ENVIRONMENT,"    * service     : %x\n",wdata);
 				    component_sim2os->execute(sim2os::int2service(static_cast<uint32_t>(wdata)));
 				  }
@@ -396,5 +405,5 @@
 				    // Decomposition en groupe octect
 				    Tdcache_data_t result = static_cast<Tdcache_data_t>(reinterpret_cast<uint64_t>(component_sim2os->result));
-				    _cout(ENVIRONMENT,"<sim2os> result      : %x\n",result);
+				    _cout(ENVIRONMENT,"    * result      : %x\n",result);
 				    
 				    itoa<Tdcache_data_t>(result,read_dram[0],size);
@@ -413,5 +422,5 @@
 				    // Decomposition en groupe octect
 				    Tdcache_data_t error = (Tdcache_data_t)component_sim2os->error;
-				    _cout(ENVIRONMENT,"<sim2os> error       : %x\n",error);
+				    _cout(ENVIRONMENT,"    * error       : %x\n",error);
 				    
 				    itoa<Tdcache_data_t>(error,read_dram[0],size);
@@ -429,5 +438,5 @@
 				  else
 				    {
-				      _cout(ENVIRONMENT,"<sim2os> argument[%d] : %x\n",num_reg-1,wdata);
+				      _cout(ENVIRONMENT,"    * argument[%d] : %x\n",num_reg-1,wdata);
 				      component_sim2os->parameter(num_reg-2,(void *)wdata);
 				    }
@@ -480,14 +489,19 @@
 		    if (bus_error == true)
 		      {
-			_cout(ENVIRONMENT,"  * Dcache : have a bus error\n");
-			_cout(ENVIRONMENT,"    * entity     : %d\n",i);
-			_cout(ENVIRONMENT,"    * port       : %d\n",j);
-			_cout(ENVIRONMENT,"    * req_addr   : 0x%x\n",address);
-			_cout(ENVIRONMENT,"    * req_trdid  : %d\n",context);
-			_cout(ENVIRONMENT,"    * req_pktid  : %d\n",packet );
+			_cout(ENVIRONMENT,"   * Dcache : have a bus error\n");
+			_cout(ENVIRONMENT,"     * entity     : %d\n",i);
+			_cout(ENVIRONMENT,"     * port       : %d\n",j);
+			_cout(ENVIRONMENT,"     * req_addr   : 0x%x\n",address);
+			_cout(ENVIRONMENT,"     * req_trdid  : %d\n",context);
+			_cout(ENVIRONMENT,"     * req_pktid  : %d\n",packet );
 
 			// Write in data [0] the bad address (32bit or 64bits    )
 			itoa<Tdcache_data_t>(address,read_dram[0],param->daccess_size_data[i]/8);
 		      }
+
+                    _cout(ENVIRONMENT,"     * Rdata : ");
+                    for (uint32_t i=0; i<nb_bytes; i++)
+                      __cout(ENVIRONMENT,"%.2x",0xff&static_cast<uint32_t>(read_dram[0][i]));
+                    _cout(ENVIRONMENT,".\n");
 		    
 		    // Simplification : the size of a line is a multiple of size_iword (no test)
@@ -501,4 +515,5 @@
 		  }
 	      }
+
 	//=============================================================================
 	//===== [ OTHERS ]=============================================================
@@ -523,8 +538,4 @@
 // 	    {
 // 	      // Test if transaction
-// // 	      cout << "[" << i << "]"
-// // 		   << "[" << j   << "] "
-// // 		   << "dreq_val : " << DCACHE [i][j].REQ_VAL.read() << " "
-// // 		   << "dreq_ack : " << dreq_ack [i][j] << endl;
 
 // 	      if ( (DCACHE [i][j].REQ_VAL.read() && dreq_ack [i][j]) == false)
@@ -600,5 +611,5 @@
 // 			case 1 : // STOP
 // 			  {
-// 			    printf("\n\t***** [ stop    ] Time : %.10d - Address : %.8x - Wdata[31:0] : %.2x%.2x%.2x%.2x         *****\n"
+// 			    cout("\n\t***** [ stop    ] Time : %.10d - Address : %.8x - Wdata[31:0] : %.2x%.2x%.2x%.2x         *****\n"
 // 				   ,(unsigned int)sc_simulation_time()
 // 				   ,(unsigned int)addr
@@ -624,5 +635,5 @@
 // 			case 2 : // PRINT
 // 			  {
-// 			    printf("\n\t----- [ print   ] Time : %.10d - Address : %.8x - Wdata[31:0] : %.2x%.2x%.2x%.2x         -----\n"
+// 			    cout("\n\t----- [ print   ] Time : %.10d - Address : %.8x - Wdata[31:0] : %.2x%.2x%.2x%.2x         -----\n"
 // 				   ,(unsigned int)sc_simulation_time()
 // 				   ,(unsigned int)addr
@@ -637,5 +648,5 @@
 // 			default :
 // 			  {
-// 			    printf("<%s> : [address : %.8x] tty %d, reg %d don't exist\n",NAME,(unsigned int)addr,num_tty,num_print);
+// 			    cout("<%s> : [address : %.8x] tty %d, reg %d don't exist\n",NAME,(unsigned int)addr,num_tty,num_print);
 // 			    exit(1);
 // 			  }
@@ -667,9 +678,9 @@
 
 // 		      /*
-// 		      printf("Access ramlock   ( %d )\n" ,(uint32_t)sc_simulation_time());
-// 		      printf(" * addr          : %.8x\n" ,(uint32_t)addr);
-// 		      printf(" * trdid         : %d\n"   ,(uint32_t)DCACHE[i][j].REQ_TRDID.read());
-// 		      printf(" * r/w           : %d/%d\n",must_read,must_write);
-// 		      printf(" * val           : %d\n"   ,(uint32_t)read_dram[0]);
+// 		      cout("Access ramlock   ( %d )\n" ,(uint32_t)sc_simulation_time());
+// 		      cout(" * addr          : %.8x\n" ,(uint32_t)addr);
+// 		      cout(" * trdid         : %d\n"   ,(uint32_t)DCACHE[i][j].REQ_TRDID.read());
+// 		      cout(" * r/w           : %d/%d\n",must_read,must_write);
+// 		      cout(" * val           : %d\n"   ,(uint32_t)read_dram[0]);
 // 		      */
 // 		      break;
@@ -696,5 +707,5 @@
 // 			    else
 // 			      {
-// 				printf("<sim2os> service     : %.8x\n",(uint32_t)wdata);
+// 				cout("<sim2os> service     : %.8x\n",(uint32_t)wdata);
 // 				component_sim2os->execute(int2service((uint32_t)wdata));
 // 			      }
@@ -712,5 +723,5 @@
 // 				// Decomposition en groupe octect
 // 				uint32_t result = (uint32_t) component_sim2os->result;
-// 				printf("<sim2os> result      : %.8x (%d)\n",result,result);
+// 				cout("<sim2os> result      : %.8x (%d)\n",result,result);
 				
 // 				read_dram = itoa(result,read_dram,SIZE_DDATA/8);
@@ -729,5 +740,5 @@
 // 				// Decomposition en groupe octect
 // 				uint32_t error = (uint32_t) component_sim2os->error;
-// 				printf("<sim2os> error       : %.8x\n",error);
+// 				cout("<sim2os> error       : %.8x\n",error);
 // 				read_dram = itoa(error ,read_dram,SIZE_DDATA/8);
 // 			      }
@@ -744,5 +755,5 @@
 // 			      {
 // 				uint32_t data = (uint32_t)wdata;
-// 				printf("<sim2os> argument[%d] : %.8x\n",num_reg-1,data);
+// 				cout("<sim2os> argument[%d] : %.8x\n",num_reg-1,data);
 // 				component_sim2os->parameter(num_reg-2,(void *)data);
 // 			      }
@@ -793,5 +804,5 @@
 // 		{
 // 		  if (bus_error == true)
-// 		    cout << "Dcache : have a bus error" << endl;
+// 		    cout("Dcache : have a bus error");
 // 		  component_buffer_drsp [i]->push(latence,
 // 							   Entry((uint32_t)DCACHE [i][j].REQ_TRDID.read() ,
