Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Network/Execution_unit_to_Write_unit/SelfTest/src/main.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Network/Execution_unit_to_Write_unit/SelfTest/src/main.cpp	(revision 81)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Network/Execution_unit_to_Write_unit/SelfTest/src/main.cpp	(revision 88)
@@ -14,17 +14,18 @@
   err (_("<Usage> %s name_instance list_params.\n"),argv[0]);
   err (_("list_params is :\n"));
-  err (_("  * nb_execute_unit                                (uint32_t)\n"));
-  err (_("  * nb_write_unit                                  (uint32_t)\n"));
-  err (_("  * nb_context                                     (uint32_t)\n"));
-  err (_("  * nb_front_end                                   (uint32_t)\n"));
-  err (_("  * nb_ooo_engine                                  (uint32_t)\n"));
-  err (_("  * nb_packet                                      (uint32_t)\n"));
-  err (_("  * size_general_data                              (uint32_t)\n"));
-  err (_("  * size_special_data                              (uint32_t)\n"));
-  err (_("  * nb_general_register                            (uint32_t)\n"));
-  err (_("  * nb_special_register                            (uint32_t)\n"));
-  err (_("  * priority                                       (uint32_t)\n"));
-  err (_("  * table_routing [nb_execute_unit][nb_write_unit] (bool    )\n"));
-  err (_("  * table_thread  [nb_write_unit][nb_thread]       (bool    )\n"));
+  err (_("  * nb_execute_unit                                                      (uint32_t)\n"));
+  err (_("  * nb_execute_unit_port [nb_execute_unit]                               (uint32_t)\n"));
+  err (_("  * nb_write_unit                                                        (uint32_t)\n"));
+  err (_("  * nb_context                                                           (uint32_t)\n"));
+  err (_("  * nb_front_end                                                         (uint32_t)\n"));
+  err (_("  * nb_ooo_engine                                                        (uint32_t)\n"));
+  err (_("  * nb_packet                                                            (uint32_t)\n"));
+  err (_("  * size_general_data                                                    (uint32_t)\n"));
+  err (_("  * size_special_data                                                    (uint32_t)\n"));
+  err (_("  * nb_general_register                                                  (uint32_t)\n"));
+  err (_("  * nb_special_register                                                  (uint32_t)\n"));
+  err (_("  * priority                                                             (uint32_t)\n"));
+  err (_("  * table_routing [nb_execute_unit][nb_execute_unit_port][nb_write_unit] (bool    )\n"));
+  err (_("  * table_thread  [nb_write_unit][nb_thread]                             (bool    )\n"));
 
   exit (1);
@@ -43,30 +44,46 @@
 
   const string   name      =      argv[x++];
-  uint32_t    _nb_execute_unit      = atoi(argv[x++]);
-  uint32_t    _nb_write_unit        = atoi(argv[x++]);
-  uint32_t    _nb_context           = atoi(argv[x++]);
-  uint32_t    _nb_front_end         = atoi(argv[x++]);
-  uint32_t    _nb_ooo_engine        = atoi(argv[x++]);
-  uint32_t    _nb_packet            = atoi(argv[x++]);
-  uint32_t    _size_general_data    = atoi(argv[x++]);
-  uint32_t    _size_special_data    = atoi(argv[x++]);
-  uint32_t    _nb_general_register  = atoi(argv[x++]);
-  uint32_t    _nb_special_register  = atoi(argv[x++]);
+  uint32_t    _nb_execute_unit      = fromString<uint32_t>(argv[x++]);
+
+  if (static_cast<uint32_t>(argc) <= 2+NB_PARAMS+_nb_execute_unit)
+    usage (argc, argv);
+
+  uint32_t    _sum_execute_unit_port = 0;
+  uint32_t *  _nb_execute_unit_port = new uint32_t [_nb_execute_unit];
+  for (uint32_t i=0; i<_nb_execute_unit; i++)
+    {
+      _nb_execute_unit_port [i] = fromString<uint32_t>(argv[x++]);
+      _sum_execute_unit_port += _nb_execute_unit_port [i];
+    }
+
+  uint32_t    _nb_write_unit        = fromString<uint32_t>(argv[x++]);
+  uint32_t    _nb_context           = fromString<uint32_t>(argv[x++]);
+  uint32_t    _nb_front_end         = fromString<uint32_t>(argv[x++]);
+  uint32_t    _nb_ooo_engine        = fromString<uint32_t>(argv[x++]);
+  uint32_t    _nb_packet            = fromString<uint32_t>(argv[x++]);
+  uint32_t    _size_general_data    = fromString<uint32_t>(argv[x++]);
+  uint32_t    _size_special_data    = fromString<uint32_t>(argv[x++]);
+  uint32_t    _nb_general_register  = fromString<uint32_t>(argv[x++]);
+  uint32_t    _nb_special_register  = fromString<uint32_t>(argv[x++]);
   Tpriority_t _priority             = fromString<Tpriority_t>(argv[x++]);
 
   uint32_t    _nb_thread            = get_nb_thread(_nb_context, _nb_front_end, _nb_ooo_engine);
 
-  if (static_cast<uint32_t>(argc) != 2+NB_PARAMS+(_nb_write_unit*_nb_execute_unit)+(_nb_write_unit*_nb_thread))
+  if (static_cast<uint32_t>(argc) != 2+NB_PARAMS+_nb_execute_unit+(_nb_write_unit*_sum_execute_unit_port)+(_nb_write_unit*_nb_thread))
     usage (argc, argv);
   
-  bool ** _table_routing;
-  bool ** _table_thread ;
+  bool *** _table_routing;
+  bool  ** _table_thread ;
   
-  _table_routing = new bool * [_nb_execute_unit];
+  _table_routing = new bool ** [_nb_execute_unit];
   for (uint32_t i=0; i<_nb_execute_unit; i++)
     {
-      _table_routing [i] = new bool [_nb_write_unit];
-      for (uint32_t j=0; j<_nb_write_unit; j++)
-	_table_routing [i][j] = atoi(argv[x++]);
+      _table_routing [i] = new bool * [_nb_execute_unit_port [i]];
+      for (uint32_t j=0; j<_nb_execute_unit_port [i]; j++)
+	{
+	  _table_routing [i][j] = new bool [_nb_write_unit];
+	  for (uint32_t k=0; k<_nb_write_unit; k++)
+	    _table_routing [i][j][k] = fromString<bool>(argv[x++]);
+	}
     }
 
@@ -77,11 +94,13 @@
 
       for (uint32_t j=0; j<_nb_thread; j++)
-	_table_thread [i][j] = atoi(argv[x++]);
+	_table_thread [i][j] = fromString<bool>(argv[x++]);
     }
 
+  int _return = EXIT_SUCCESS;
   try 
     {
       morpheo::behavioural::core::multi_execute_loop::execute_loop::network::execution_unit_to_write_unit::Parameters * param = new morpheo::behavioural::core::multi_execute_loop::execute_loop::network::execution_unit_to_write_unit::Parameters
 	(_nb_execute_unit      ,
+	 _nb_execute_unit_port ,
 	 _nb_write_unit        ,
 	 _nb_context           ,
@@ -95,8 +114,9 @@
 	 _priority             ,
 	 _table_routing        ,
-	 _table_thread 
+	 _table_thread         ,
+         true //is_toplevel
 	 );
       
-      msg(_("%s"),param->print(1).c_str());
+      msg(_("%s"),param->print(0).c_str());
       
       test (name,param);
@@ -104,11 +124,19 @@
   catch (morpheo::ErrorMorpheo & error)
     {
-      msg (_("<%s> : %s.\n"),name.c_str(), error.what ());
-      exit (EXIT_FAILURE);
+      msg (_("<%s> :\n%s"),name.c_str(), error.what ());
+      _return = EXIT_FAILURE;
     }
-  catch (...)
+  
+  try 
     {
-      err (_("<%s> : This test must generate a error.\n"),name.c_str());
-      exit (EXIT_FAILURE);
+      if (_return == EXIT_SUCCESS)
+	TEST_OK("Execution_unit_to_Write_unit : no error");
+      else
+	TEST_KO("Execution_unit_to_Write_unit : a lot of error");
+    }
+  catch (morpheo::ErrorMorpheo & error)
+    {
+//       msg (_("<%s> :\n%s"),name.c_str(), error.what ());
+      _return = EXIT_FAILURE;
     }
 
