Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/SelfTest/include/test.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/SelfTest/include/test.h	(revision 88)
+++ 	(revision )
@@ -1,27 +1,0 @@
-/*
- * $Id$
- *
- * [ Description ]
- * 
- * Test "RegisterFile"
- */
-
-#ifdef SYSTEMC
-#include "systemc.h"
-#endif
-
-#define NB_ITERATION  1
-#define CYCLE_MAX     (1024*NB_ITERATION)
-
-#include "Common/include/Test.h"
-#include "Common/include/Time.h"
-#include "Behavioural/@DIRECTORY/include/@COMPONENT.h"
-
-using namespace std;
-using namespace morpheo;
-using namespace morpheo::behavioural;
-@NAMESPACE_USING
-using namespace morpheo::behavioural::@NAMESPACE_USE;
-
-void test    (string name,
-	      morpheo::behavioural::@NAMESPACE_USE::Parameters * param);
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/SelfTest/include/top.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/SelfTest/include/top.h	(revision 113)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/SelfTest/include/top.h	(revision 113)
@@ -0,0 +1,59 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ * Test "@COMPONENT"
+ */
+
+#ifdef SYSTEMC
+#include "systemc.h"
+#endif
+
+#define NB_ITERATION  1
+#define CYCLE_MAX     (1024*NB_ITERATION)
+
+#include "Common/include/Test.h"
+#include "Common/include/Time.h"
+#include "Behavioural/@DIRECTORY/include/@COMPONENT.h"
+
+using namespace std;
+using namespace morpheo;
+using namespace morpheo::behavioural;
+@NAMESPACE_USING
+using namespace morpheo::behavioural::@NAMESPACE_USE;
+
+SC_MODULE(top)
+{
+#ifdef SYSTEMC
+ private: sc_clock               *  in_CLOCK ;
+ private: sc_signal<Tcontrol_t>  *  in_NRESET;
+#endif
+
+ private: std::string name;
+ private: Tusage_t _usage;
+ private: morpheo::behavioural::@NAMESPACE_USE::Parameters * _param;
+#ifdef STATISTICS
+ private: morpheo::behavioural::Parameters_Statistics * _param_stat;
+#endif
+ private: @COMPONENT * component;
+
+ private: void usage
+    (
+#ifdef MTI_SYSTEMC
+     int argc, const char * const * argv
+#else
+     int argc, char * argv[]
+#endif
+     );
+ private: void allocation   (void);
+ private: void deallocation (void);
+ public : void test         (void);
+
+#ifdef MTI_SYSTEMC
+  SC_CTOR(top::top);
+#else
+ public : top (sc_module_name module_name,int argc, char * argv[]);
+#endif
+ public : ~top(void);
+};
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/SelfTest/src/main.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/SelfTest/src/main.cpp	(revision 88)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/SelfTest/src/main.cpp	(revision 113)
@@ -6,45 +6,26 @@
  */
 
-#include "Behavioural/@DIRECTORY/SelfTest/include/test.h"
+#include "Behavioural/@DIRECTORY/SelfTest/include/top.h"
 
-#define NB_PARAMS 0
+#ifndef MTI_SYSTEMC
+# ifndef SYSTEMC
+int main    (int argc, char * argv[])
+# else
+int sc_main (int argc, char * argv[])
+# endif
+{
+  int _return = EXIT_SUCCESS;
 
-void usage (int argc, char * argv[])
-{
-  err (_("<Usage> %s name_instance list_params.\n"),argv[0]);
-  err (_("list_params is :\n"));
-  err (_(" *  ()\n"));
-
-  exit (1);
-}
-
-#ifndef SYSTEMC
-int main    (int argc, char * argv[])
-#else
-int sc_main (int argc, char * argv[])
-#endif
-{
-  if (argc != static_cast<int>(2+NB_PARAMS))
-    usage (argc, argv);
-
-  uint32_t x = 1;
-
-  string name = argv[x++];
-
-  int _return = EXIT_SUCCESS;
   try 
     {
-      morpheo::behavioural::@NAMESPACE_USE::Parameters * param = new morpheo::behavioural::@NAMESPACE_USE::Parameters
-	(
-         true //is_toplevel
-        );
-      
-      msg(_("%s"),param->print(0).c_str());
-      
-      test (name,param);
+      top * my_top = new top ("my_top",argc,argv);
+
+      my_top->test();
+
+      delete my_top;
     }
   catch (morpheo::ErrorMorpheo & error)
     {
-      msg (_("<%s> :\n%s"),name.c_str(), error.what ());
+      msgError(_("%s\n"),error.what ());
       _return = EXIT_FAILURE;
     }
@@ -59,8 +40,9 @@
   catch (morpheo::ErrorMorpheo & error)
     {
-//       msg (_("<%s> :\n%s"),name.c_str(), error.what ());
+//    msgError(_("<%s> :\n%s"),name.c_str(), error.what ());
       _return = EXIT_FAILURE;
     }
 
-  return (_return);
+  return _return;
 }
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/SelfTest/src/test.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/SelfTest/src/test.cpp	(revision 88)
+++ 	(revision )
@@ -1,113 +1,0 @@
-/*
- * $Id$
- *
- * [ Description ]
- * 
- * Test
- */
-
-#include "Behavioural/@DIRECTORY/SelfTest/include/test.h"
-#include "Behavioural/include/Allocation.h"
-
-void test (string name,
-	   morpheo::behavioural::@NAMESPACE_USE::Parameters * _param)
-{
-  msg(_("<%s> : Simulation SystemC.\n"),name.c_str());
-
-  if (setlocale (LC_ALL, "") == NULL)
-    msg(_("setlocale ko.\n"));
-
-#ifdef STATISTICS
-  morpheo::behavioural::Parameters_Statistics * _parameters_statistics = new morpheo::behavioural::Parameters_Statistics (5,CYCLE_MAX);
-#endif
-
-  Tusage_t _usage = USE_ALL;
-
-//   _usage = usage_unset(_usage,USE_SYSTEMC              );
-//   _usage = usage_unset(_usage,USE_VHDL                 );
-//   _usage = usage_unset(_usage,USE_VHDL_TESTBENCH       );
-//   _usage = usage_unset(_usage,USE_VHDL_TESTBENCH_ASSERT);
-//   _usage = usage_unset(_usage,USE_POSITION             );
-//   _usage = usage_unset(_usage,USE_STATISTICS           );
-//   _usage = usage_unset(_usage,USE_INFORMATION          );
-
-  @COMPONENT * _@COMPONENT = new @COMPONENT 
-    (name.c_str(),
-#ifdef STATISTICS
-     _parameters_statistics,
-#endif
-     _param,
-     _usage);
-  
-#ifdef SYSTEMC
-  if (usage_is_set(_usage,USE_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");
-  
-  /********************************************************
-   * Instanciation
-   ********************************************************/
-  
-  msg(_("<%s> : Instanciation of _@COMPONENT.\n"),name.c_str());
-
-  (*(_@COMPONENT->in_CLOCK))        (*(in_CLOCK));
-  (*(_@COMPONENT->in_NRESET))       (*(in_NRESET));
-
-
-  msg(_("<%s> : Start Simulation ............\n"),name.c_str());
-    
-  Time * _time = new Time();
-
-  /********************************************************
-   * Simulation - Begin
-   ********************************************************/
-
-  // Initialisation
-
-  const uint32_t seed = 0;
-//const uint32_t seed = static_cast<uint32_t>(time(NULL));
-
-  srand(seed);
-
-  SC_START(0);
-  LABEL("Initialisation");
-
-  LABEL("Reset");
-  in_NRESET->write(0);
-  SC_START(5);
-  in_NRESET->write(1);  
-
-  LABEL("Loop of Test");
-
-  for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++)
-    {
-      LABEL("Iteration %d",iteration);
-
-      SC_START(1);
-    }
-
-  /********************************************************
-   * Simulation - End
-   ********************************************************/
-
-  TEST_OK ("End of Simulation");
-  delete _time;
-
-  msg(_("<%s> : ............ Stop Simulation\n"),name.c_str());
-
-  delete in_CLOCK;
-  delete in_NRESET;
-    }
-#endif
-
-  delete _@COMPONENT;
-#ifdef STATISTICS
-  delete _parameters_statistics;
-#endif
-}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/SelfTest/src/top.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/SelfTest/src/top.cpp	(revision 113)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/SelfTest/src/top.cpp	(revision 113)
@@ -0,0 +1,57 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/@DIRECTORY/SelfTest/include/top.h"
+#include "Behavioural/include/Selftest.h"
+
+#define NB_PARAMS 0
+
+#ifdef MTI_SYSTEMC
+SC_MODULE_EXPORT(top);
+#endif
+
+#ifdef MTI_SYSTEMC
+SC_CTOR(top::top)
+#else
+top::top (sc_module_name module_name, int argc, char * argv[])
+#endif
+{
+#ifdef MTI_SYSTEMC
+  // accessing command-line arguments with modelsim
+  int argc;
+  const char * const * argv;
+
+  argc = sc_argc ();
+  argv = sc_argv ();
+#endif
+
+  if (argc != 2+NB_PARAMS)
+    usage (argc, argv);
+
+  uint32_t x=1;
+  SELFTEST0(name,string,argv,x);
+
+  _param = new morpheo::behavioural::@NAMESPACE_USE::Parameters
+    (
+     true
+     );
+  
+  // msg(_("%s"),_param.print(0).c_str());
+  
+  // Allocation component
+  allocation ();
+  
+#ifdef MTI_SYSTEMC
+  SC_THREAD(test);
+#endif
+}
+
+top::~top (void)
+{
+  deallocation ();
+  delete _param;
+}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/SelfTest/src/top_allocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/SelfTest/src/top_allocation.cpp	(revision 113)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/SelfTest/src/top_allocation.cpp	(revision 113)
@@ -0,0 +1,77 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ * Test
+ */
+
+#include "Behavioural/@DIRECTORY/SelfTest/include/top.h"
+#include "Behavioural/include/Allocation.h"
+
+void top::allocation (void)
+{
+  if (setlocale (LC_ALL, "") == NULL)
+    msgWarning(_("setlocale ko.\n"));
+
+  try 
+    {
+      _param->test();
+    }
+  catch (morpheo::ErrorMorpheo & error)
+    {
+      msgError(_("<%s> : %s"),name.c_str(),error.what());
+      return;
+    }
+  catch (...)
+    {
+      msgError(_("<%s> : This test must generate a error"),name.c_str());
+      exit (EXIT_FAILURE);
+    }
+
+  _usage = USE_ALL;
+//   _usage = usage_unset(_usage,USE_SYSTEMC              );
+//   _usage = usage_unset(_usage,USE_VHDL                 );
+//   _usage = usage_unset(_usage,USE_VHDL_TESTBENCH       );
+//   _usage = usage_unset(_usage,USE_VHDL_TESTBENCH_ASSERT);
+//   _usage = usage_unset(_usage,USE_POSITION             );
+//   _usage = usage_unset(_usage,USE_STATISTICS           );
+//   _usage = usage_unset(_usage,USE_INFORMATION          );
+
+#ifdef STATISTICS
+  if (usage_is_set(_usage,USE_STATISTICS))
+  _param_stat = new morpheo::behavioural::Parameters_Statistics (5,CYCLE_MAX);
+#endif
+
+  component = new @COMPONENT 
+    (name.c_str(),
+#ifdef STATISTICS
+     _param_stat,
+#endif
+     _param,
+     _usage
+     );
+  
+#ifdef SYSTEMC
+  if (usage_is_set(_usage,USE_SYSTEMC))
+    {
+  /*********************************************************************
+   * Déclarations des signaux
+   *********************************************************************/
+  msgInformation(_("<%s> : Create signal.\n"),name.c_str());
+
+  in_CLOCK  = new sc_clock ("clock", TIME_PERIOD, TIME_UNIT, 0.5); //name,period,time_unit,duty_cycle
+
+  ALLOC0_SC_SIGNAL( in_NRESET        ," in_NRESET        ",Tcontrol_t);
+  
+  /********************************************************
+   * Instanciation
+   ********************************************************/
+  
+  msgInformation(_("<%s> : Instanciation of _@COMPONENT.\n"),name.c_str());
+
+  INSTANCE0_SC_SIGNAL(component, in_CLOCK         );
+  INSTANCE0_SC_SIGNAL(component, in_NRESET        );
+    }
+#endif
+}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/SelfTest/src/top_deallocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/SelfTest/src/top_deallocation.cpp	(revision 113)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/SelfTest/src/top_deallocation.cpp	(revision 113)
@@ -0,0 +1,22 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ * Test
+ */
+#include "Behavioural/@DIRECTORY/SelfTest/include/top.h"
+#include "Behavioural/include/Allocation.h"
+
+void top::deallocation (void)
+{
+#ifdef SYSTEMC
+  delete             in_CLOCK;
+  DELETE0_SC_SIGNAL( in_NRESET);
+#endif
+
+  delete component;
+#ifdef STATISTICS
+  delete _param_stat;
+#endif
+}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/SelfTest/src/top_test.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/SelfTest/src/top_test.cpp	(revision 113)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/SelfTest/src/top_test.cpp	(revision 113)
@@ -0,0 +1,61 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ * Test
+ */
+
+#include "Behavioural/@DIRECTORY/SelfTest/include/top.h"
+#include "Behavioural/include/Allocation.h"
+
+void top::test (void)
+{
+#ifdef SYSTEMC
+  if (usage_is_set(_usage,USE_SYSTEMC))
+    {
+      msgInformation(_("<%s> : Start Simulation ............\n"),name.c_str());
+      
+      Time * _time = new Time();
+      
+      /********************************************************
+       * Simulation - Begin
+       ********************************************************/
+      
+      // Initialisation
+      
+      const uint32_t seed = 0;
+    //const uint32_t seed = static_cast<uint32_t>(time(NULL));
+      
+      srand(seed);
+      
+      SC_CYCLE(0);
+      LABEL("Initialisation");
+      
+      LABEL("Reset");
+      in_NRESET->write(0);
+      SC_CYCLE(5);
+      in_NRESET->write(1);  
+      
+      LABEL("Loop of Test");
+      
+      for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++)
+        {
+          LABEL("Iteration %d",iteration);
+          
+          SC_CYCLE(1);
+        }
+      
+      /********************************************************
+       * Simulation - End
+       ********************************************************/
+      
+      TEST_OK ("");
+      
+      sc_stop();
+      delete _time;
+      
+      msgInformation(_("<%s> : ............ Stop Simulation\n"),name.c_str());
+    }
+#endif
+}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/SelfTest/src/top_usage.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/SelfTest/src/top_usage.cpp	(revision 113)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/SelfTest/src/top_usage.cpp	(revision 113)
@@ -0,0 +1,24 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/@DIRECTORY/SelfTest/include/top.h"
+
+void top::usage 
+(
+#ifdef MTI_SYSTEMC
+ int argc, const char * const * argv
+#else
+ int argc, char * argv[]
+#endif
+ )
+{
+  msgError (_("<Usage> %s name_instance list_params.\n"),argv[0]);
+  msgError (_("list_params is :\n"));
+  msgError (_(" *  ()\n"));
+
+  exit (1);
+}
