Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/SelfTest/src/test.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/SelfTest/src/test.cpp	(revision 23)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/SelfTest/src/test.cpp	(revision 42)
@@ -96,5 +96,4 @@
 
   
-  _Branch_History_Table->vhdl_testbench_label("Initialisation");
   cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Initialisation" << endl;
 
@@ -129,10 +128,8 @@
   sc_start(0);
 
-  _Branch_History_Table->vhdl_testbench_label("Loop of Test");
   cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Loop of Test" << endl;
 
   for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++)
     {
-      _Branch_History_Table->vhdl_testbench_label("Iteration "+toString(iteration));
       num_port_branch_complete = rand() % param._nb_branch_complete;
       num_port_predict         = rand() % param._nb_prediction     ;
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Branch_History_Table.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Branch_History_Table.h	(revision 23)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Branch_History_Table.h	(revision 42)
@@ -27,7 +27,5 @@
 #include "Behavioural/include/Vhdl.h"
 #endif
-#ifdef VHDL_TESTBENCH
-#include "Behavioural/include/Vhdl_Testbench.h"
-#endif
+#include "Behavioural/include/Component.h"
 
 using namespace std;
@@ -59,7 +57,6 @@
 #endif
 
-#ifdef VHDL_TESTBENCH
-  private   : Vhdl_Testbench                 * _vhdl_testbench;
-#endif
+  public    : Component                      * _component;
+  private   : Interfaces                     * _interfaces;
 
 #ifdef SYSTEMC
@@ -83,5 +80,4 @@
 
     // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-  public    : SC_SIGNAL(Thistory_t)        ** signal_BRANCH_COMPLETE_HISTORY;
 #endif
 
@@ -118,20 +114,17 @@
 #endif					       
 					       
-#if VHDL				       
-  public  : void     vhdl                      (void);
-  private : void     vhdl_port                 (Vhdl & vhdl);
-  private : void     vhdl_type                 (Vhdl & vhdl);
-  private : void     vhdl_signal               (Vhdl & vhdl);
-  private : void     vhdl_body                 (Vhdl & vhdl);
-#endif					       
 #ifdef STATISTICS
   public  : string   statistics                (uint32_t depth);
 #endif
-					       
+#if VHDL				       
+  public  : void     vhdl                      (void);
+  private : void     vhdl_port                 (Vhdl * & vhdl);
+  private : void     vhdl_type                 (Vhdl * & vhdl);
+  private : void     vhdl_signal               (Vhdl * & vhdl);
+  private : void     vhdl_body                 (Vhdl * & vhdl);
+#endif					       
 #ifdef VHDL_TESTBENCH			       
-  private : void     vhdl_testbench_port       (void);
   private : void     vhdl_testbench_transition (void);
 #endif
-  public  : void     vhdl_testbench_label      (string label);
   };
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table.cpp	(revision 23)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table.cpp	(revision 42)
@@ -32,4 +32,9 @@
 #endif
   {
+
+#ifdef SYSTEMC
+    allocation ();
+#endif
+
 #ifdef STATISTICS
     // Allocation of statistics
@@ -39,13 +44,4 @@
 #endif
 
-#ifdef VHDL_TESTBENCH
-    // Creation of a testbench
-    //  -> port
-    //  -> clock's signals
-    _vhdl_testbench = new Vhdl_Testbench (_name);
-    vhdl_testbench_port           ();
-    _vhdl_testbench->set_clock    ("in_CLOCK",true);
-#endif
-
 #ifdef VHDL
     // generate the vhdl
@@ -53,7 +49,6 @@
 #endif
 
+
 #ifdef SYSTEMC
-    allocation ();
-
 //     // Constant
 //     for (uint32_t i=0; i<_param._nb_prediction     ; i++)
@@ -77,10 +72,4 @@
   Branch_History_Table::~Branch_History_Table (void)
   {
-#ifdef VHDL_TESTBENCH
-    // generate the test bench
-    _vhdl_testbench->generate_file();
-    delete _vhdl_testbench;
-#endif
-
 #ifdef STATISTICS
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_allocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_allocation.cpp	(revision 23)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_allocation.cpp	(revision 42)
@@ -20,9 +20,30 @@
   void Branch_History_Table::allocation (void)
   {
-    string rename;
-
-     in_CLOCK           = new SC_CLOCK           ("in_CLOCK");
-     in_NRESET          = new SC_IN (Tcontrol_t) ("in_NRESET");
-
+    _component   = new Component ();
+
+    Entity * entity = _component->set_entity (_name                 
+					     ,"Branch_History_Table"
+#ifdef POSITION
+					     ,MIXTE                
+#endif
+					      );
+    
+    _interfaces = entity->set_interfaces();
+
+    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+    {
+      Interface * interface = _interfaces->set_interface(""
+#ifdef POSITION
+							 , IN  
+							 , SOUTH
+							 , "Generalist interface"
+#endif
+							 );
+      
+      in_CLOCK              = interface->set_signal_clk              ("clock" ,1);
+      in_NRESET             = interface->set_signal_in  <Tcontrol_t> ("nreset",1,RESET_VHDL_YES);
+    }
+
+    // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      in_PREDICT_VAL     = new SC_IN (Tcontrol_t) * [_param._nb_prediction];
     out_PREDICT_ACK     = new SC_OUT(Tcontrol_t) * [_param._nb_prediction];
@@ -32,71 +53,65 @@
     for (uint32_t i=0; i<_param._nb_prediction; i++)
       {
-	rename = "in_PREDICT_VAL["     +toString(i)+"]";
-	 in_PREDICT_VAL     [i] = new SC_IN (Tcontrol_t) (rename.c_str());
-
-	rename = "out_PREDICT_ACK["    +toString(i)+"]";
-	out_PREDICT_ACK     [i] = new SC_OUT(Tcontrol_t) (rename.c_str());
-
-	rename = "in_PREDICT_ADDRESS["+toString(i)+"]";
-	 in_PREDICT_ADDRESS [i] = new SC_IN (Taddress_t) (rename.c_str());
-
-	rename = "out_PREDICT_HISTORY["+toString(i)+"]";
-	out_PREDICT_HISTORY [i] = new SC_OUT(Thistory_t) (rename.c_str());
-      }
-
-        in_BRANCH_COMPLETE_VAL     = new SC_IN     (Tcontrol_t) * [_param._nb_branch_complete];
-       out_BRANCH_COMPLETE_ACK     = new SC_OUT    (Tcontrol_t) * [_param._nb_branch_complete];
-        in_BRANCH_COMPLETE_ADDRESS = new SC_IN     (Taddress_t) * [_param._nb_branch_complete];
-        in_BRANCH_COMPLETE_HISTORY = new SC_IN     (Thistory_t) * [_param._nb_branch_complete];
-        in_BRANCH_COMPLETE_DIRECTION= new SC_IN     (Tcontrol_t) * [_param._nb_branch_complete];
-    signal_BRANCH_COMPLETE_HISTORY = new SC_SIGNAL (Thistory_t) * [_param._nb_branch_complete];
+	Interface_fifo * interface = _interfaces->set_interface("predict_"+toString(i)
+#ifdef POSITION
+								, IN  
+								, WEST
+								, "Interface Predict"
+#endif
+							   );
+
+	 in_PREDICT_VAL     [i] = interface->set_signal_valack_in        ("val"    , VAL);
+	out_PREDICT_ACK     [i] = interface->set_signal_valack_out       ("ack"    , ACK);
+	 in_PREDICT_ADDRESS [i] = interface->set_signal_in  <Taddress_t> ("address", static_cast<uint32_t>(ceil(log2(_param._nb_shifter))));
+	out_PREDICT_HISTORY [i] = interface->set_signal_out <Thistory_t> ("history", _param._size_shifter);
+      }
+
+    // ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+        in_BRANCH_COMPLETE_VAL       = new SC_IN     (Tcontrol_t) * [_param._nb_branch_complete];
+       out_BRANCH_COMPLETE_ACK       = new SC_OUT    (Tcontrol_t) * [_param._nb_branch_complete];
+        in_BRANCH_COMPLETE_ADDRESS   = new SC_IN     (Taddress_t) * [_param._nb_branch_complete];
+        in_BRANCH_COMPLETE_HISTORY   = new SC_IN     (Thistory_t) * [_param._nb_branch_complete];
+        in_BRANCH_COMPLETE_DIRECTION = new SC_IN     (Tcontrol_t) * [_param._nb_branch_complete];
 
     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
       {
-	 rename = "in_BRANCH_COMPLETE_VAL["    +toString(i)+"]";
-	  in_BRANCH_COMPLETE_VAL     [i] = new SC_IN (Tcontrol_t) (rename.c_str());
-
-	 rename = "out_BRANCH_COMPLETE_ACK["   +toString(i)+"]";
-	 out_BRANCH_COMPLETE_ACK     [i] = new SC_OUT(Tcontrol_t) (rename.c_str());
-
-	 rename = "in_BRANCH_COMPLETE_ADDRESS["+toString(i)+"]";
-	  in_BRANCH_COMPLETE_ADDRESS [i] = new SC_IN (Taddress_t) (rename.c_str());
-
-	 rename = "in_BRANCH_COMPLETE_HISTORY["+toString(i)+"]";
-	  in_BRANCH_COMPLETE_HISTORY [i] = new SC_IN (Thistory_t) (rename.c_str());
-
-	 rename = "in_BRANCH_COMPLETE_DIRECTION["    +toString(i)+"]";
-	  in_BRANCH_COMPLETE_DIRECTION[i] = new SC_IN (Tcontrol_t) (rename.c_str());
-
-	 rename = "signal_BRANCH_COMPLETE_HISTORY["+toString(i)+"]";
-	 signal_BRANCH_COMPLETE_HISTORY [i] = new SC_SIGNAL (Thistory_t) (rename.c_str());
-
+	Interface_fifo * interface = _interfaces->set_interface("branch_complete_"+toString(i)
+#ifdef POSITION
+								, IN  
+								, EAST
+								, "Interface branch complete"
+#endif
+								);
+
+	 in_BRANCH_COMPLETE_VAL        [i] = interface->set_signal_valack_in        ("val"      , VAL);
+	out_BRANCH_COMPLETE_ACK        [i] = interface->set_signal_valack_out       ("ack"      , ACK);
+	 in_BRANCH_COMPLETE_ADDRESS    [i] = interface->set_signal_in  <Taddress_t> ("address"  , static_cast<uint32_t>(ceil(log2(_param._nb_shifter))));
+	 in_BRANCH_COMPLETE_HISTORY    [i] = interface->set_signal_in  <Thistory_t> ("history"  , _param._size_shifter);
+	 in_BRANCH_COMPLETE_DIRECTION  [i] = interface->set_signal_in  <Tcontrol_t> ("direction", 1);
       }
     
     // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
     string name_component;
+
     // =====[ component_Shifter ]=========================================    
     
     name_component = _name+"_Shifter";
 
-    component_Shifter = new morpheo::behavioural::generic::shifter::Shifter (name_component.c_str(),
+    component_Shifter = new morpheo::behavioural::generic::shifter::Shifter (name_component.c_str()
 #ifdef STATISTICS
-									     _param_statistics             ,
-#endif
-									     *(_param._param_shifter)      );
-    
-    
-    // Instantiation
-#if (defined(STATISTICS) || defined (VHDL_TESTBENCH))
-    (*(component_Shifter->in_CLOCK))        (*(in_CLOCK));
-#endif
-
-    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
-      {
-	(*(component_Shifter-> in_SHIFTER_DATA       [i]))    (*(    in_BRANCH_COMPLETE_HISTORY  [i]));
-	(*(component_Shifter-> in_SHIFTER_CARRY_IN   [i]))    (*(    in_BRANCH_COMPLETE_DIRECTION[i]));
-	(*(component_Shifter->out_SHIFTER_DATA       [i]))    (*(signal_BRANCH_COMPLETE_HISTORY  [i]));
-      }
-    
+									     ,_param_statistics
+#endif
+									     ,*(_param._param_shifter));
+
+    _component->set_component (component_Shifter->_component
+#ifdef POSITION
+			       , 25
+			       , 25
+			       , 10
+			       , 10
+#endif
+			       );
+
      // =====[ component_RegisterFile ]====================================    
     
@@ -105,27 +120,85 @@
     component_RegisterFile = new morpheo::behavioural::generic::registerfile::registerfile_monolithic::RegisterFile_Monolithic(name_component.c_str(),
 #ifdef STATISTICS
-											    _param_statistics            ,
-#endif
-											    *(_param._param_registerfile));
+															       _param_statistics            ,
+#endif
+															       *(_param._param_registerfile));
+
+    _component->set_component (component_RegisterFile->_component
+#ifdef POSITION
+			       , 75
+			       , 75
+			       , 10
+			       , 10
+#endif
+			       );
      
-    // Instantiation
-    (*(component_RegisterFile->in_CLOCK ))       (*(in_CLOCK ));
-    (*(component_RegisterFile->in_NRESET))       (*(in_NRESET));
+    // ~~~~~[ Component - Instanciation ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
+
+     // =====[ component_RegisterFile - Instanciation ]====================    
+
+#ifdef POSITION
+    _component->interface_map (_name+"_RegisterFile","",
+			       _name                ,"");
+#endif
+
+    _component->port_map(_name+"_RegisterFile", "in_CLOCK" , _name,"in_CLOCK" );
+    _component->port_map(_name+"_RegisterFile", "in_NRESET", _name,"in_NRESET");
     
     for (uint32_t i=0; i<_param._nb_prediction; i++)
       {
-	(*(component_RegisterFile-> in_READ_VAL      [i])) (*( in_PREDICT_VAL      [i]));
-	(*(component_RegisterFile->out_READ_ACK      [i])) (*(out_PREDICT_ACK      [i]));
-	(*(component_RegisterFile-> in_READ_ADDRESS  [i])) (*( in_PREDICT_ADDRESS  [i]));
-	(*(component_RegisterFile->out_READ_DATA     [i])) (*(out_PREDICT_HISTORY  [i]));    
+#ifdef POSITION
+	_component->interface_map (_name+"_RegisterFile","read_"   +toString(i),
+				   _name                ,"predict_"+toString(i));
+#endif
+
+ 	_component->port_map(_name+"_RegisterFile", "in_READ_"+toString(i)+"_VAL"    , _name, "in_PREDICT_"+toString(i)+"_VAL"    );
+ 	_component->port_map(_name+"_RegisterFile","out_READ_"+toString(i)+"_ACK"    , _name,"out_PREDICT_"+toString(i)+"_ACK"    );
+ 	_component->port_map(_name+"_RegisterFile", "in_READ_"+toString(i)+"_ADDRESS", _name, "in_PREDICT_"+toString(i)+"_ADDRESS");
+ 	_component->port_map(_name+"_RegisterFile","out_READ_"+toString(i)+"_DATA"   , _name,"out_PREDICT_"+toString(i)+"_HISTORY");
       }
     
     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
       {
-	(*(component_RegisterFile-> in_WRITE_VAL     [i])) (*(    in_BRANCH_COMPLETE_VAL      [i]));
-	(*(component_RegisterFile->out_WRITE_ACK     [i])) (*(   out_BRANCH_COMPLETE_ACK      [i]));
-	(*(component_RegisterFile-> in_WRITE_ADDRESS [i])) (*(    in_BRANCH_COMPLETE_ADDRESS  [i]));
-	(*(component_RegisterFile-> in_WRITE_DATA    [i])) (*(signal_BRANCH_COMPLETE_HISTORY  [i]));    
-      }
+#ifdef POSITION
+	_component->interface_map (_name+"_RegisterFile","write_"  +toString(i),
+				   _name+"_Shifter"     ,"shifter_"+toString(i));
+#endif
+
+ 	_component->port_map(_name+"_RegisterFile", "in_WRITE_"+toString(i)+"_VAL"    , _name           , "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"    );
+ 	_component->port_map(_name+"_RegisterFile","out_WRITE_"+toString(i)+"_ACK"    , _name           ,"out_BRANCH_COMPLETE_"+toString(i)+"_ACK"    );
+ 	_component->port_map(_name+"_RegisterFile", "in_WRITE_"+toString(i)+"_ADDRESS", _name           , "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS");
+ 	_component->port_map(_name+"_RegisterFile", "in_WRITE_"+toString(i)+"_DATA"   , _name+"_Shifter","out_SHIFTER_"        +toString(i)+"_DATA");
+      }
+
+    // =====[ component_Shifter - Instanciation ]=========================    
+
+#if (defined(STATISTICS) || defined (VHDL_TESTBENCH))
+
+#ifdef POSITION
+    _component->interface_map (_name+"_Shifter","",
+			       _name           ,"");
+#endif
+
+    _component->port_map(_name+"_Shifter", "in_CLOCK" , _name,"in_CLOCK" );
+    _component->port_map(_name+"_Shifter", "in_NRESET", _name,"in_NRESET");
+
+#endif
+
+    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+      {
+#ifdef POSITION
+	_component->interface_map (_name+"_Shifter","shifter_"+toString(i),
+				   _name           ,"branch_complete_"+toString(i));
+
+#endif
+
+ 	_component->port_map(_name+"_Shifter", "in_SHIFTER_" +toString(i)+"_DATA"    , _name                , "in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY");
+ 	_component->port_map(_name+"_Shifter", "in_SHIFTER_" +toString(i)+"_CARRY_IN", _name                , "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION");
+ 	_component->port_map(_name+"_Shifter", "out_SHIFTER_"+toString(i)+"_DATA"    , _name+"_RegisterFile", "in_WRITE_"+toString(i)+"_DATA");
+      }
+
+#ifdef POSITION
+    _component->generate_file();
+#endif
   };
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_deallocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_deallocation.cpp	(revision 23)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_deallocation.cpp	(revision 42)
@@ -19,37 +19,23 @@
   void Branch_History_Table::deallocation (void)
   {
-    delete in_CLOCK;
-    delete in_NRESET;
+    delete     in_CLOCK;
+    delete     in_NRESET;
 
-    for (uint32_t i=0; i<_param._nb_prediction; i++)
-      {
-	delete  in_PREDICT_VAL     [i];
-	delete out_PREDICT_ACK     [i];
-	delete  in_PREDICT_ADDRESS [i];
-	delete out_PREDICT_HISTORY [i];
-      }
+    delete []  in_PREDICT_VAL    ;
+    delete [] out_PREDICT_ACK    ;
+    delete []  in_PREDICT_ADDRESS;
+    delete [] out_PREDICT_HISTORY;
 
-    delete  in_PREDICT_VAL    ;
-    delete out_PREDICT_ACK    ;
-    delete  in_PREDICT_ADDRESS;
-    delete out_PREDICT_HISTORY;
-
-     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
-       {
-	 delete  in_BRANCH_COMPLETE_VAL     [i];
-	 delete out_BRANCH_COMPLETE_ACK     [i];
-	 delete  in_BRANCH_COMPLETE_ADDRESS [i];
-	 delete  in_BRANCH_COMPLETE_HISTORY [i];
-	 delete  in_BRANCH_COMPLETE_DIRECTION[i];
-       }
-    delete  in_BRANCH_COMPLETE_VAL    ;
-    delete out_BRANCH_COMPLETE_ACK    ;
-    delete  in_BRANCH_COMPLETE_ADDRESS;
-    delete  in_BRANCH_COMPLETE_HISTORY;
-    delete  in_BRANCH_COMPLETE_DIRECTION;
+    delete []  in_BRANCH_COMPLETE_VAL    ;
+    delete [] out_BRANCH_COMPLETE_ACK    ;
+    delete []  in_BRANCH_COMPLETE_ADDRESS;
+    delete []  in_BRANCH_COMPLETE_HISTORY;
+    delete []  in_BRANCH_COMPLETE_DIRECTION;
 
      // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
     delete component_Shifter;
     delete component_RegisterFile;
+    
+    delete _component;
   };
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_vhdl.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_vhdl.cpp	(revision 23)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_vhdl.cpp	(revision 42)
@@ -21,9 +21,9 @@
   void Branch_History_Table::vhdl (void)
   {
-    Vhdl vhdl (_name);
+    Vhdl * vhdl = new Vhdl (_name);
 
-    vhdl.set_library_work (_name + "_Pack");
-    vhdl.set_library_work (_name + "_RegisterFile_Pack");
-    vhdl.set_library_work (_name + "_Shifter_Pack");
+    vhdl->set_library_work (_name + "_Pack");
+    vhdl->set_library_work (_name + "_RegisterFile_Pack");
+    vhdl->set_library_work (_name + "_Shifter_Pack");
 
     vhdl_port   (vhdl);
@@ -32,5 +32,7 @@
     vhdl_body   (vhdl);
 
-    vhdl.generate_file();
+    vhdl->generate_file();
+
+    delete vhdl;
   };
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_vhdl_body.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_vhdl_body.cpp	(revision 23)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_vhdl_body.cpp	(revision 42)
@@ -18,12 +18,12 @@
 
 
-  void Branch_History_Table::vhdl_body (Vhdl & vhdl)
+  void Branch_History_Table::vhdl_body (Vhdl * & vhdl)
   {
-//     vhdl.set_body ("-- Output : always at '1'");
+//     vhdl->set_body ("-- Output : always at '1'");
 //     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
-//       vhdl.set_body ("out_BRANCH_COMPLETE_ACK_"+toString(i)+" <= '1';");
+//       vhdl->set_body ("out_BRANCH_COMPLETE_ACK_"+toString(i)+" <= '1';");
 //     for (uint32_t i=0; i<_param._nb_prediction     ; i++)
-//       vhdl.set_body ("out_PREDICT_ACK_"+toString(i)+"         <= '1';");
-//     vhdl.set_body ("");
+//       vhdl->set_body ("out_PREDICT_ACK_"+toString(i)+"         <= '1';");
+//     vhdl->set_body ("");
 
     list<string> list_port_map;
@@ -31,31 +31,31 @@
     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
       {
-	vhdl.set_body_component_port_map (list_port_map," in_SHIFTER_DATA_"+toString(i)+"     ","    in_BRANCH_COMPLETE_HISTORY_"+toString(i));
-	vhdl.set_body_component_port_map (list_port_map," in_SHIFTER_CARRY_IN_"+toString(i)+" ","    in_BRANCH_COMPLETE_DIRECTION_"+toString(i)    );
-	vhdl.set_body_component_port_map (list_port_map,"out_SHIFTER_DATA_"+toString(i)+"     ","signal_BRANCH_COMPLETE_HISTORY_"+toString(i));
+	vhdl->set_body_component_port_map (list_port_map," in_SHIFTER_"+toString(i)+"_DATA     ","    in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY"  );
+	vhdl->set_body_component_port_map (list_port_map," in_SHIFTER_"+toString(i)+"_CARRY_IN ","    in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION");
+	vhdl->set_body_component_port_map (list_port_map,"out_SHIFTER_"+toString(i)+"_DATA     ","signal_BRANCH_COMPLETE_"+toString(i)+"_HISTORY"  );
       }
 
-    vhdl.set_body_component ("component_Shifter",_name+"_Shifter",list_port_map);
+    vhdl->set_body_component ("component_Shifter",_name+"_Shifter",list_port_map);
 
     list_port_map.clear();
-    vhdl.set_body_component_port_map (list_port_map,"in_CLOCK","in_CLOCK");
-    vhdl.set_body_component_port_map (list_port_map,"in_NRESET","in_NRESET");
+    vhdl->set_body_component_port_map (list_port_map,"in_CLOCK","in_CLOCK");
+    vhdl->set_body_component_port_map (list_port_map,"in_NRESET","in_NRESET");
 
     for (uint32_t i=0; i<_param._nb_prediction; i++)
       {
-	vhdl.set_body_component_port_map (list_port_map," in_READ_VAL_"+toString(i)+"     "," in_PREDICT_VAL_"+toString(i));
-	vhdl.set_body_component_port_map (list_port_map,"out_READ_ACK_"+toString(i)+"     ","out_PREDICT_ACK_"+toString(i));
-	vhdl.set_body_component_port_map (list_port_map," in_READ_ADDRESS_"+toString(i)+" "," in_PREDICT_ADDRESS_"+toString(i));
-	vhdl.set_body_component_port_map (list_port_map,"out_READ_DATA_"+toString(i)+"    ","out_PREDICT_HISTORY_"+toString(i));    
+	vhdl->set_body_component_port_map (list_port_map," in_READ_"+toString(i)+"_VAL     "," In_PREDICT_"+toString(i)+"_VAL");
+	vhdl->set_body_component_port_map (list_port_map,"out_READ_"+toString(i)+"_ACK     ","out_PREDICT_"+toString(i)+"_ACK");
+	vhdl->set_body_component_port_map (list_port_map," in_READ_"+toString(i)+"_ADDRESS "," in_PREDICT_"+toString(i)+"_ADDRESS");
+	vhdl->set_body_component_port_map (list_port_map,"out_READ_"+toString(i)+"_DATA    ","out_PREDICT_"+toString(i)+"_HISTORY");
       }
     
     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
       {
-	vhdl.set_body_component_port_map (list_port_map," in_WRITE_VAL_"+toString(i)+"    ","    in_BRANCH_COMPLETE_VAL_"+toString(i)+"");
-	vhdl.set_body_component_port_map (list_port_map,"out_WRITE_ACK_"+toString(i)+"    ","   out_BRANCH_COMPLETE_ACK_"+toString(i)+"");
-	vhdl.set_body_component_port_map (list_port_map," in_WRITE_ADDRESS_"+toString(i)+"","    in_BRANCH_COMPLETE_ADDRESS_"+toString(i));
-	vhdl.set_body_component_port_map (list_port_map," in_WRITE_DATA_"+toString(i)+"   ","signal_BRANCH_COMPLETE_HISTORY_"+toString(i));
+	vhdl->set_body_component_port_map (list_port_map," in_WRITE_"+toString(i)+"_VAL    ","    in_BRANCH_COMPLETE_"+toString(i)+"_VAL");
+	vhdl->set_body_component_port_map (list_port_map,"out_WRITE_"+toString(i)+"_ACK    ","   out_BRANCH_COMPLETE_"+toString(i)+"_ACK");
+	vhdl->set_body_component_port_map (list_port_map," in_WRITE_"+toString(i)+"_ADDRESS","    in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS");
+	vhdl->set_body_component_port_map (list_port_map," in_WRITE_"+toString(i)+"_DATA   ","signal_BRANCH_COMPLETE_"+toString(i)+"_HISTORY");
       }
-    vhdl.set_body_component ("component_RegisterFile",_name+"_RegisterFile",list_port_map);
+    vhdl->set_body_component ("component_RegisterFile",_name+"_RegisterFile",list_port_map);
   };
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_vhdl_port.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_vhdl_port.cpp	(revision 23)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_vhdl_port.cpp	(revision 42)
@@ -18,24 +18,7 @@
 
 
-  void Branch_History_Table::vhdl_port (Vhdl & vhdl)
+  void Branch_History_Table::vhdl_port (Vhdl * & vhdl)
   {
-    vhdl.set_port (" in_CLOCK" , IN, 1);
-    vhdl.set_port (" in_NRESET", IN, 1);
-    
-    for (uint32_t i=0; i<_param._nb_prediction; i++)
-      {
-	vhdl.set_port(" in_PREDICT_VAL_"+toString(i)+"               ", IN, 1);
-	vhdl.set_port("out_PREDICT_ACK_"+toString(i)+"               ",OUT, 1);
-	vhdl.set_port(" in_PREDICT_ADDRESS_"+toString(i)+"           ", IN, static_cast<uint32_t>(ceil(log2(_param._nb_shifter))));
-	vhdl.set_port("out_PREDICT_HISTORY_"+toString(i)+"           ",OUT, _param._size_shifter);
-      }
-     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
-       {
-	 vhdl.set_port (" in_BRANCH_COMPLETE_VAL_"+toString(i)+"      ", IN, 1);
-	 vhdl.set_port ("out_BRANCH_COMPLETE_ACK_"+toString(i)+"      ",OUT, 1);
-	 vhdl.set_port (" in_BRANCH_COMPLETE_ADDRESS_"+toString(i)+"  ", IN, static_cast<uint32_t>(ceil(log2(_param._nb_shifter))));
-	 vhdl.set_port (" in_BRANCH_COMPLETE_HISTORY_"+toString(i)+"  ", IN, _param._size_shifter);
-	 vhdl.set_port (" in_BRANCH_COMPLETE_DIRECTION_"+toString(i)+"", IN, 1);
-       }
+    _interfaces->set_port(vhdl);
   };
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_vhdl_signal.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_vhdl_signal.cpp	(revision 23)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_vhdl_signal.cpp	(revision 42)
@@ -17,8 +17,8 @@
 namespace branch_history_table {
 
-  void Branch_History_Table::vhdl_signal (Vhdl & vhdl)
+  void Branch_History_Table::vhdl_signal (Vhdl * & vhdl)
   {
     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
-      vhdl.set_signal  ("signal_BRANCH_COMPLETE_HISTORY_"+toString(i), _param._size_shifter);
+      vhdl->set_signal  ("signal_BRANCH_COMPLETE_"+toString(i)+"_HISTORY", _param._size_shifter);
   };
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_vhdl_testbench_label.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_vhdl_testbench_label.cpp	(revision 23)
+++ 	(revision )
@@ -1,31 +1,0 @@
-/*
- * $Id$
- *
- * [ Description ]
- * 
- */
-
-#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Branch_History_Table.h"
-
-namespace morpheo                    {
-namespace behavioural {
-namespace stage_1_ifetch {
-namespace predictor {
-namespace meta_predictor {
-namespace two_level_branch_predictor {
-namespace branch_history_table {
-
-  void Branch_History_Table::vhdl_testbench_label (string label)
-  {
-#ifdef VHDL_TESTBENCH
-    _vhdl_testbench->add_label(label);
-#endif
-  };
-
-}; // end namespace branch_history_table
-}; // end namespace two_level_branch_predictor
-}; // end namespace meta_predictor
-}; // end namespace predictor
-}; // end namespace stage_1_ifetch
-}; // end namespace behavioural
-}; // end namespace morpheo              
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_vhdl_testbench_port.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_vhdl_testbench_port.cpp	(revision 23)
+++ 	(revision )
@@ -1,47 +1,0 @@
-#ifdef VHDL_TESTBENCH
-/*
- * $Id$
- *
- * [ Description ]
- * 
- */
-
-#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Branch_History_Table.h"
-
-namespace morpheo                    {
-namespace behavioural {
-namespace stage_1_ifetch {
-namespace predictor {
-namespace meta_predictor {
-namespace two_level_branch_predictor {
-namespace branch_history_table {
-
-  void Branch_History_Table::vhdl_testbench_port (void)
-  {
-    _vhdl_testbench->set_port (" in_NRESET", IN, 1);
-    for (uint32_t i=0; i<_param._nb_prediction; i++)
-      {
-	_vhdl_testbench->set_port (" in_PREDICT_VAL_"+toString(i)+"               ", IN, 1);
-	_vhdl_testbench->set_port ("out_PREDICT_ACK_"+toString(i)+"               ",OUT, 1);
-	_vhdl_testbench->set_port (" in_PREDICT_ADDRESS_"+toString(i)+"           ", IN, static_cast<uint32_t>(ceil(log2(_param._nb_shifter))));
-	_vhdl_testbench->set_port ("out_PREDICT_HISTORY_"+toString(i)+"           ",OUT, _param._size_shifter);
-      }
-
-     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
-       {
-	 _vhdl_testbench->set_port (" in_BRANCH_COMPLETE_VAL_"+toString(i)+"      ", IN, 1);
-	 _vhdl_testbench->set_port ("out_BRANCH_COMPLETE_ACK_"+toString(i)+"      ",OUT, 1);
-	 _vhdl_testbench->set_port (" in_BRANCH_COMPLETE_ADDRESS_"+toString(i)+"  ", IN, static_cast<uint32_t>(ceil(log2(_param._nb_shifter))));
-	 _vhdl_testbench->set_port (" in_BRANCH_COMPLETE_HISTORY_"+toString(i)+"  ", IN, _param._size_shifter);
-	 _vhdl_testbench->set_port (" in_BRANCH_COMPLETE_DIRECTION_"+toString(i)+"", IN, 1);
-       }
-  };
-
-}; // end namespace branch_history_table
-}; // end namespace two_level_branch_predictor
-}; // end namespace meta_predictor
-}; // end namespace predictor
-}; // end namespace stage_1_ifetch
-}; // end namespace behavioural
-}; // end namespace morpheo              
-#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_vhdl_testbench_transition.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_vhdl_testbench_transition.cpp	(revision 23)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_vhdl_testbench_transition.cpp	(revision 42)
@@ -20,35 +20,7 @@
   void Branch_History_Table::vhdl_testbench_transition (void)
   {
-    // In order with file Branch_History_Table_vhdl_testbench_port.cpp
-#ifndef SYSTEMCASS_SPECIFIC
-    sc_cycle(0);
-#endif    
+    sc_start(0);
 
-    _vhdl_testbench->add_input  (PORT_READ( in_NRESET));
-
-    for (uint32_t i=0; i<_param._nb_prediction; i++)
-      {
-	_vhdl_testbench->add_input  (PORT_READ( in_PREDICT_VAL     [i]));
-	_vhdl_testbench->add_output (PORT_READ(component_RegisterFile->out_READ_ACK  [i]));
-	_vhdl_testbench->add_input  (PORT_READ( in_PREDICT_ADDRESS [i]));
-	_vhdl_testbench->add_output (PORT_READ(component_RegisterFile->out_READ_DATA [i]));
-      //_vhdl_testbench->add_output (PORT_READ(out_PREDICT_HISTORY [i]));
-      }
-
-     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
-       {
-	 _vhdl_testbench->add_input  (PORT_READ( in_BRANCH_COMPLETE_VAL     [i]));
-	 _vhdl_testbench->add_output (PORT_READ(component_RegisterFile->out_WRITE_ACK [i]));
-	 _vhdl_testbench->add_input  (PORT_READ( in_BRANCH_COMPLETE_ADDRESS [i]));
-	 _vhdl_testbench->add_input  (PORT_READ( in_BRANCH_COMPLETE_HISTORY [i]));
-	 _vhdl_testbench->add_input  (PORT_READ( in_BRANCH_COMPLETE_DIRECTION[i]));
-       }
-    
-    // add_test :
-    //  - True  : the cycle must be compare with the output of systemC
-    //  - False : no test
-    _vhdl_testbench->add_test(true);
-
-    _vhdl_testbench->new_cycle (); // always at the end
+    _interfaces->testbench();
   };
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_vhdl_type.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_vhdl_type.cpp	(revision 23)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_vhdl_type.cpp	(revision 42)
@@ -18,5 +18,5 @@
 
 
-  void Branch_History_Table::vhdl_type (Vhdl & vhdl)
+  void Branch_History_Table::vhdl_type (Vhdl * & vhdl)
   {
   };
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/configuration.cfg
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/configuration.cfg	(revision 23)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/configuration.cfg	(revision 42)
@@ -1,5 +1,5 @@
 Pattern_History_Table
-2	8	*2	# size_counter      	
-2	64	*4	# nb_counter        
-1	2	+1	# nb_prediction     
-1	2	+1	# nb_branch_complete
+8	8	*2	# size_counter      	
+64	64	*4	# nb_counter        
+2	2	+1	# nb_prediction     
+2	2	+1	# nb_branch_complete
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/mkf.info
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/mkf.info	(revision 23)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/mkf.info	(revision 42)
@@ -0,0 +1,6 @@
+
+# Pattern_History_Table_0
+target_dep	all	Pattern_History_Table_0.ngc
+target_dep	Pattern_History_Table_0.ngc	Pattern_History_Table_0.prj
+target_dep	Pattern_History_Table_0.prj	Pattern_History_Table_0_Counter_Pack.vhdl Pattern_History_Table_0_Counter.vhdl Pattern_History_Table_0_Pack.vhdl Pattern_History_Table_0_RegisterFile_Pack.vhdl Pattern_History_Table_0_RegisterFile.vhdl Pattern_History_Table_0.vhdl
+
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/src/test.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/src/test.cpp	(revision 23)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/src/test.cpp	(revision 42)
@@ -7,5 +7,5 @@
  */
 
-#define NB_ITERATION 1024
+#define NB_ITERATION 512
 
 #include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/include/test.h"
@@ -93,5 +93,4 @@
 
   sc_start(0);
-  _Pattern_History_Table->vhdl_testbench_label("Initialisation");
   cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Initialisation" << endl;
   
@@ -127,10 +126,8 @@
   sc_start(0);
 
-  _Pattern_History_Table->vhdl_testbench_label("Loop of Test");
   cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Loop of Test" << endl;
 
   for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++)
     {
-      _Pattern_History_Table->vhdl_testbench_label("Iteration "+toString(iteration));
       num_port_branch_complete = rand() % param._nb_branch_complete;
       num_port_predict         = rand() % param._nb_prediction     ;
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Pattern_History_Table.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Pattern_History_Table.h	(revision 23)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Pattern_History_Table.h	(revision 42)
@@ -29,7 +29,5 @@
 #include "Behavioural/include/Vhdl.h"
 #endif
-#ifdef VHDL_TESTBENCH
-#include "Behavioural/include/Vhdl_Testbench.h"
-#endif
+#include "Behavioural/include/Component.h"
 
 using namespace std;
@@ -62,7 +60,6 @@
 #endif
 
-#ifdef VHDL_TESTBENCH
-  private   : Vhdl_Testbench                 * _vhdl_testbench;
-#endif
+  public    : Component                      * _component;
+  private   : Interfaces                     * _interfaces;
 
 #ifdef SYSTEMC
@@ -125,17 +122,12 @@
   public  : string   statistics                (uint32_t depth);
 #endif
-					       
 #if VHDL				       
   public  : void     vhdl                      (void);
-  private : void     vhdl_port                 (Vhdl & vhdl);
-  private : void     vhdl_declaration          (Vhdl & vhdl);
-  private : void     vhdl_body                 (Vhdl & vhdl);
+  private : void     vhdl_declaration          (Vhdl * & vhdl);
+  private : void     vhdl_body                 (Vhdl * & vhdl);
 #endif					       
-					       
 #ifdef VHDL_TESTBENCH			       
-  private : void     vhdl_testbench_port       (void);
   private : void     vhdl_testbench_transition (void);
 #endif
-  public  : void     vhdl_testbench_label      (string label);
   };
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table.cpp	(revision 23)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table.cpp	(revision 42)
@@ -33,5 +33,9 @@
   {
     log_printf(FUNC,Pattern_History_Table,"Pattern_History_Table","Begin");
-    
+   
+#ifdef SYSTEMC
+    allocation ();
+#endif
+ 
 #ifdef STATISTICS
     // Allocation of statistics
@@ -39,13 +43,4 @@
 			    param_statistics          ,
 			    param);
-#endif
-
-#ifdef VHDL_TESTBENCH
-    // Creation of a testbench
-    //  -> port
-    //  -> clock's signals
-    _vhdl_testbench = new Vhdl_Testbench (_name);
-    vhdl_testbench_port           ();
-    _vhdl_testbench->set_clock    ("in_CLOCK",true);
 #endif
 
@@ -56,6 +51,4 @@
 
 #ifdef SYSTEMC
-    allocation ();
-
 //     // Constant
 //     for (uint32_t i=0; i<_param._nb_prediction     ; i++)
@@ -82,10 +75,4 @@
     log_printf(FUNC,Pattern_History_Table,"~Pattern_History_Table","Begin");
 
-#ifdef VHDL_TESTBENCH
-    // generate the test bench
-    _vhdl_testbench->generate_file();
-    delete _vhdl_testbench;
-#endif
-
 #ifdef STATISTICS
     _stat->generate_file(statistics(0));
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_allocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_allocation.cpp	(revision 23)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_allocation.cpp	(revision 42)
@@ -20,11 +20,32 @@
   void Pattern_History_Table::allocation (void)
   {
-    string rename;
-
     log_printf(FUNC,Pattern_History_Table,"allocation","Begin");
 
-    in_CLOCK  = new SC_CLOCK           ("in_CLOCK");
-    in_NRESET = new SC_IN (Tcontrol_t) ("in_NRESET");
-
+    _component   = new Component ();
+
+    Entity * entity = _component->set_entity (_name                 
+					     ,"Pattern_History_Table"
+#ifdef POSITION
+					     ,MIXTE                
+#endif
+					      );
+    
+    _interfaces = entity->set_interfaces();
+
+    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+    {
+      Interface * interface = _interfaces->set_interface(""
+#ifdef POSITION
+							 , IN  
+							 , SOUTH
+							 , "Generalist interface"
+#endif
+							 );
+      
+      in_CLOCK              = interface->set_signal_clk              ("clock" ,1);
+      in_NRESET             = interface->set_signal_in  <Tcontrol_t> ("nreset",1,RESET_VHDL_YES);
+    }
+
+    // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      in_PREDICT_VAL     = new SC_IN (Tcontrol_t) * [_param._nb_prediction];
     out_PREDICT_ACK     = new SC_OUT(Tcontrol_t) * [_param._nb_prediction];
@@ -34,16 +55,19 @@
     for (uint32_t i=0; i<_param._nb_prediction; i++)
       {
-	rename = "in_PREDICT_VAL["     +toString(i)+"]";
-	 in_PREDICT_VAL     [i] = new SC_IN (Tcontrol_t) (rename.c_str());
-
-	rename = "out_PREDICT_ACK["    +toString(i)+"]";
-	out_PREDICT_ACK     [i] = new SC_OUT(Tcontrol_t) (rename.c_str());
-
-	rename = "in_PREDICT_ADDRESS["+toString(i)+"]";
-	 in_PREDICT_ADDRESS [i] = new SC_IN (Taddress_t) (rename.c_str());
-
-	rename = "out_PREDICT_HISTORY["+toString(i)+"]";
-	out_PREDICT_HISTORY [i] = new SC_OUT(Thistory_t) (rename.c_str());
-      }
+	Interface_fifo * interface = _interfaces->set_interface("predict_"+toString(i)
+#ifdef POSITION
+								, IN  
+								, WEST
+								, "Interface Predict"
+#endif
+								);
+
+	 in_PREDICT_VAL     [i] = interface->set_signal_valack_in        ("val"    , VAL);
+	out_PREDICT_ACK     [i] = interface->set_signal_valack_out       ("ack"    , ACK);
+	 in_PREDICT_ADDRESS [i] = interface->set_signal_in  <Taddress_t> ("address", static_cast<uint32_t>(ceil(log2(_param._nb_counter))));
+	out_PREDICT_HISTORY [i] = interface->set_signal_out <Thistory_t> ("history", _param._size_counter);
+      }
+    
+    // ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
         in_BRANCH_COMPLETE_VAL       = new SC_IN     (Tcontrol_t) * [_param._nb_branch_complete];
@@ -52,82 +76,131 @@
         in_BRANCH_COMPLETE_HISTORY   = new SC_IN     (Thistory_t) * [_param._nb_branch_complete];
         in_BRANCH_COMPLETE_DIRECTION = new SC_IN     (Tcontrol_t) * [_param._nb_branch_complete];
-    signal_BRANCH_COMPLETE_HISTORY   = new SC_SIGNAL (Thistory_t) * [_param._nb_branch_complete];
 
     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
       {
-	 rename = "in_BRANCH_COMPLETE_VAL["    +toString(i)+"]";
-	  in_BRANCH_COMPLETE_VAL     [i] = new SC_IN (Tcontrol_t) (rename.c_str());
-
-	 rename = "out_BRANCH_COMPLETE_ACK["   +toString(i)+"]";
-	 out_BRANCH_COMPLETE_ACK     [i] = new SC_OUT(Tcontrol_t) (rename.c_str());
-
-	 rename = "in_BRANCH_COMPLETE_ADDRESS["+toString(i)+"]";
-	  in_BRANCH_COMPLETE_ADDRESS [i] = new SC_IN (Taddress_t) (rename.c_str());
-
-	 rename = "in_BRANCH_COMPLETE_HISTORY["+toString(i)+"]";
-	  in_BRANCH_COMPLETE_HISTORY [i] = new SC_IN (Thistory_t) (rename.c_str());
-
-	 rename = "in_BRANCH_COMPLETE_DIRECTION["    +toString(i)+"]";
-	  in_BRANCH_COMPLETE_DIRECTION [i] = new SC_IN (Tcontrol_t) (rename.c_str());
-
-	 rename = "signal_BRANCH_COMPLETE_HISTORY["+toString(i)+"]";
-	 signal_BRANCH_COMPLETE_HISTORY [i] = new SC_SIGNAL (Thistory_t) (rename.c_str());
-
-      }
-    
+	Interface_fifo * interface = _interfaces->set_interface("branch_complete_"+toString(i)
+#ifdef POSITION
+								, IN  
+								, EAST
+								, "Interface branch complete"
+#endif
+								);
+
+	 in_BRANCH_COMPLETE_VAL        [i] = interface->set_signal_valack_in        ("val"      , VAL);
+	out_BRANCH_COMPLETE_ACK        [i] = interface->set_signal_valack_out       ("ack"      , ACK);
+	 in_BRANCH_COMPLETE_ADDRESS    [i] = interface->set_signal_in  <Taddress_t> ("address"  , static_cast<uint32_t>(ceil(log2(_param._nb_counter))));
+	 in_BRANCH_COMPLETE_HISTORY    [i] = interface->set_signal_in  <Thistory_t> ("history"  , _param._size_counter);
+	 in_BRANCH_COMPLETE_DIRECTION  [i] = interface->set_signal_in  <Tcontrol_t> ("direction", 1);
+      }
+
     // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
     string name_component;
+
     // =====[ component_Counter ]=========================================    
     
     name_component = _name+"_Counter";
 
-    component_Counter = new morpheo::behavioural::generic::counter::Counter (name_component.c_str(),
+    component_Counter = new morpheo::behavioural::generic::counter::Counter (name_component.c_str()
 #ifdef STATISTICS
-									     _param_statistics             ,
-#endif
-									     *(_param._param_counter)      );
-    
-    
-    // Instantiation
+									     ,_param_statistics
+#endif
+									     ,*(_param._param_counter));
+
+    _component->set_component (component_Counter->_component
+#ifdef POSITION
+			       , 25
+			       , 25
+			       , 10
+			       , 10
+#endif
+			       );
+
+     // =====[ component_RegisterFile ]====================================    
+    
+    name_component = _name+"_RegisterFile";
+    
+    component_RegisterFile = new morpheo::behavioural::generic::registerfile::registerfile_monolithic::RegisterFile_Monolithic(name_component.c_str(),
+#ifdef STATISTICS
+															       _param_statistics            ,
+#endif
+															       *(_param._param_registerfile));
+
+    _component->set_component (component_RegisterFile->_component
+#ifdef POSITION
+			       , 75
+			       , 75
+			       , 10
+			       , 10
+#endif
+			       );
+     
+    // ~~~~~[ Component - Instanciation ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
+
+    // =====[ component_RegisterFile - Instanciation ]====================    
+
+#ifdef POSITION
+    _component->interface_map (_name+"_RegisterFile","",
+			       _name                ,"");
+#endif
+
+    _component->port_map(_name+"_RegisterFile", "in_CLOCK" , _name,"in_CLOCK" );
+    _component->port_map(_name+"_RegisterFile", "in_NRESET", _name,"in_NRESET");
+    
+    for (uint32_t i=0; i<_param._nb_prediction; i++)
+      {
+#ifdef POSITION
+	_component->interface_map (_name+"_RegisterFile","read_"   +toString(i),
+				   _name                ,"predict_"+toString(i));
+#endif
+
+ 	_component->port_map(_name+"_RegisterFile", "in_READ_"+toString(i)+"_VAL"    , _name, "in_PREDICT_"+toString(i)+"_VAL"    );
+ 	_component->port_map(_name+"_RegisterFile","out_READ_"+toString(i)+"_ACK"    , _name,"out_PREDICT_"+toString(i)+"_ACK"    );
+ 	_component->port_map(_name+"_RegisterFile", "in_READ_"+toString(i)+"_ADDRESS", _name, "in_PREDICT_"+toString(i)+"_ADDRESS");
+ 	_component->port_map(_name+"_RegisterFile","out_READ_"+toString(i)+"_DATA"   , _name,"out_PREDICT_"+toString(i)+"_HISTORY");
+      }
+    
+    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+      {
+#ifdef POSITION
+	_component->interface_map (_name+"_RegisterFile","write_"  +toString(i),
+				   _name+"_Counter"     ,"counter_"+toString(i));
+#endif
+
+ 	_component->port_map(_name+"_RegisterFile", "in_WRITE_"+toString(i)+"_VAL"    , _name           , "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"    );
+ 	_component->port_map(_name+"_RegisterFile","out_WRITE_"+toString(i)+"_ACK"    , _name           ,"out_BRANCH_COMPLETE_"+toString(i)+"_ACK"    );
+ 	_component->port_map(_name+"_RegisterFile", "in_WRITE_"+toString(i)+"_ADDRESS", _name           , "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS");
+ 	_component->port_map(_name+"_RegisterFile", "in_WRITE_"+toString(i)+"_DATA"   , _name+"_Counter","out_COUNTER_"        +toString(i)+"_DATA");
+      }
+
+    // =====[ component_Counter - Instanciation ]=========================    
+
 #if (defined(STATISTICS) || defined (VHDL_TESTBENCH))
-    (*(component_Counter->in_CLOCK))        (*(in_CLOCK));
+
+#ifdef POSITION
+    _component->interface_map (_name+"_Counter","",
+			       _name           ,"");
+#endif
+
+    _component->port_map(_name+"_Counter", "in_CLOCK" , _name,"in_CLOCK" );
+    _component->port_map(_name+"_Counter", "in_NRESET", _name,"in_NRESET");
+
 #endif
 
     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
       {
-	(*(component_Counter-> in_COUNTER_DATA       [i]))    (*(    in_BRANCH_COMPLETE_HISTORY   [i]));
-	(*(component_Counter-> in_COUNTER_ADDSUB     [i]))    (*(    in_BRANCH_COMPLETE_DIRECTION [i]));
-	(*(component_Counter->out_COUNTER_DATA       [i]))    (*(signal_BRANCH_COMPLETE_HISTORY   [i]));
-      }
-    
-     // =====[ component_RegisterFile ]====================================    
-    
-    name_component = _name+"_RegisterFile";
-    
-    component_RegisterFile = new morpheo::behavioural::generic::registerfile::registerfile_monolithic::RegisterFile_Monolithic (name_component.c_str(),
-#ifdef STATISTICS
-																_param_statistics            ,
-#endif
-																*(_param._param_registerfile));
-    
-    // Instantiation
-    (*(component_RegisterFile->in_CLOCK))        (*(in_CLOCK));
-    (*(component_RegisterFile->in_NRESET))       (*(in_NRESET));
-
-    for (uint32_t i=0; i<_param._nb_prediction; i++)
-      {
-	(*(component_RegisterFile-> in_READ_VAL      [i])) (*( in_PREDICT_VAL      [i]));
-	(*(component_RegisterFile->out_READ_ACK      [i])) (*(out_PREDICT_ACK      [i]));
-	(*(component_RegisterFile-> in_READ_ADDRESS  [i])) (*( in_PREDICT_ADDRESS  [i]));
-	(*(component_RegisterFile->out_READ_DATA     [i])) (*(out_PREDICT_HISTORY  [i]));    
-      }
-    
-    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
-      {
-	(*(component_RegisterFile-> in_WRITE_VAL     [i])) (*(    in_BRANCH_COMPLETE_VAL      [i]));
-	(*(component_RegisterFile->out_WRITE_ACK     [i])) (*(   out_BRANCH_COMPLETE_ACK      [i]));
-	(*(component_RegisterFile-> in_WRITE_ADDRESS [i])) (*(    in_BRANCH_COMPLETE_ADDRESS  [i]));
-	(*(component_RegisterFile-> in_WRITE_DATA    [i])) (*(signal_BRANCH_COMPLETE_HISTORY  [i]));    
-      }
+#ifdef POSITION
+	_component->interface_map (_name+"_Counter","counter_"+toString(i),
+				   _name           ,"branch_complete_"+toString(i));
+
+#endif
+
+ 	_component->port_map(_name+"_Counter", "in_COUNTER_" +toString(i)+"_DATA"    , _name                , "in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY");
+ 	_component->port_map(_name+"_Counter", "in_COUNTER_" +toString(i)+"_ADDSUB"  , _name                , "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION");
+ 	_component->port_map(_name+"_Counter", "out_COUNTER_"+toString(i)+"_DATA"    , _name+"_RegisterFile", "in_WRITE_"+toString(i)+"_DATA");
+      }
+
+#ifdef POSITION
+    _component->generate_file();
+#endif
 
     log_printf(FUNC,Pattern_History_Table,"allocation","End");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_deallocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_deallocation.cpp	(revision 23)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_deallocation.cpp	(revision 42)
@@ -22,37 +22,23 @@
     log_printf(FUNC,Pattern_History_Table,"deallocation","Begin");
 
-    delete in_CLOCK;
-    delete in_NRESET;
+    delete     in_CLOCK;
+    delete     in_NRESET;
 
-    for (uint32_t i=0; i<_param._nb_prediction; i++)
-      {
-	delete  in_PREDICT_VAL     [i];
-	delete out_PREDICT_ACK     [i];
-	delete  in_PREDICT_ADDRESS [i];
-	delete out_PREDICT_HISTORY [i];
-      }
+    delete []  in_PREDICT_VAL    ;
+    delete [] out_PREDICT_ACK    ;
+    delete []  in_PREDICT_ADDRESS;
+    delete [] out_PREDICT_HISTORY;
 
-    delete  in_PREDICT_VAL    ;
-    delete out_PREDICT_ACK    ;
-    delete  in_PREDICT_ADDRESS;
-    delete out_PREDICT_HISTORY;
-
-     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
-       {
-	 delete  in_BRANCH_COMPLETE_VAL       [i];
-	 delete out_BRANCH_COMPLETE_ACK       [i];
-	 delete  in_BRANCH_COMPLETE_ADDRESS   [i];
-	 delete  in_BRANCH_COMPLETE_HISTORY   [i];
-	 delete  in_BRANCH_COMPLETE_DIRECTION [i];
-       }
-    delete  in_BRANCH_COMPLETE_VAL    ;
-    delete out_BRANCH_COMPLETE_ACK    ;
-    delete  in_BRANCH_COMPLETE_ADDRESS;
-    delete  in_BRANCH_COMPLETE_HISTORY;
-    delete  in_BRANCH_COMPLETE_DIRECTION;
+    delete []  in_BRANCH_COMPLETE_VAL    ;
+    delete [] out_BRANCH_COMPLETE_ACK    ;
+    delete []  in_BRANCH_COMPLETE_ADDRESS;
+    delete []  in_BRANCH_COMPLETE_HISTORY;
+    delete []  in_BRANCH_COMPLETE_DIRECTION;
 
      // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
     delete component_Counter;
     delete component_RegisterFile;
+    
+    delete _component;
 
     log_printf(FUNC,Pattern_History_Table,"deallocation","End");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_vhdl.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_vhdl.cpp	(revision 23)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_vhdl.cpp	(revision 42)
@@ -22,15 +22,16 @@
   {
     log_printf(FUNC,Pattern_History_Table,"vhdl","Begin");
-    Vhdl vhdl (_name);
+    Vhdl * vhdl = new Vhdl (_name);
 
-    vhdl.set_library_work (_name + "_Pack");
-    vhdl.set_library_work (_name + "_RegisterFile_Pack");
-    vhdl.set_library_work (_name + "_Counter_Pack");
+    _interfaces->set_port(vhdl);
+    _component->vhdl_instance(vhdl);
 
-    vhdl_port        (vhdl);
     vhdl_declaration (vhdl);
     vhdl_body        (vhdl);
 
-    vhdl.generate_file();
+    vhdl->generate_file();
+
+    delete vhdl;
+
     log_printf(FUNC,Pattern_History_Table,"vhdl","End");
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_vhdl_body.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_vhdl_body.cpp	(revision 23)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_vhdl_body.cpp	(revision 42)
@@ -18,46 +18,14 @@
 
 
-  void Pattern_History_Table::vhdl_body (Vhdl & vhdl)
+  void Pattern_History_Table::vhdl_body (Vhdl * & vhdl)
   {
     log_printf(FUNC,Pattern_History_Table,"vhdl_body","Begin");
 
-//     vhdl.set_body ("-- Output : always at '1'");
+//     vhdl->set_body ("-- Output : always at '1'");
 //     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
-//       vhdl.set_body ("out_BRANCH_COMPLETE_ACK_"+toString(i)+" <= '1';");
+//       vhdl->set_body ("out_BRANCH_COMPLETE_ACK_"+toString(i)+" <= '1';");
 //     for (uint32_t i=0; i<_param._nb_prediction     ; i++)
-//       vhdl.set_body ("out_PREDICT_ACK_"+toString(i)+"         <= '1';");
-//     vhdl.set_body ("");
-
-    list<string> list_port_map;
-
-    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
-      {
-	vhdl.set_body_component_port_map (list_port_map," in_COUNTER_DATA_"+toString(i)+"     ","    in_BRANCH_COMPLETE_HISTORY_"+toString(i));
-	vhdl.set_body_component_port_map (list_port_map," in_COUNTER_ADDSUB_"+toString(i)+"   ","    in_BRANCH_COMPLETE_DIRECTION_"+toString(i)    );
-	vhdl.set_body_component_port_map (list_port_map,"out_COUNTER_DATA_"+toString(i)+"     ","signal_BRANCH_COMPLETE_HISTORY_"+toString(i));
-      }
-    vhdl.set_body_component ("component_Counter",_name+"_Counter",list_port_map);
-
-
-    list_port_map.clear();
-    vhdl.set_body_component_port_map (list_port_map,"in_CLOCK ","in_CLOCK ");
-    vhdl.set_body_component_port_map (list_port_map,"in_NRESET","in_NRESET");
-
-    for (uint32_t i=0; i<_param._nb_prediction; i++)
-      {
-	vhdl.set_body_component_port_map (list_port_map," in_READ_VAL_"+toString(i)+"     "," in_PREDICT_VAL_"+toString(i));
-	vhdl.set_body_component_port_map (list_port_map,"out_READ_ACK_"+toString(i)+"     ","out_PREDICT_ACK_"+toString(i));
-	vhdl.set_body_component_port_map (list_port_map," in_READ_ADDRESS_"+toString(i)+" "," in_PREDICT_ADDRESS_"+toString(i));
-	vhdl.set_body_component_port_map (list_port_map,"out_READ_DATA_"+toString(i)+"    ","out_PREDICT_HISTORY_"+toString(i));    
-      }
-    
-    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
-      {
-	vhdl.set_body_component_port_map (list_port_map," in_WRITE_VAL_"+toString(i)+"    ","    in_BRANCH_COMPLETE_VAL_"+toString(i)+"");
-	vhdl.set_body_component_port_map (list_port_map,"out_WRITE_ACK_"+toString(i)+"    ","   out_BRANCH_COMPLETE_ACK_"+toString(i)+"");
-	vhdl.set_body_component_port_map (list_port_map," in_WRITE_ADDRESS_"+toString(i)+"","    in_BRANCH_COMPLETE_ADDRESS_"+toString(i));
-	vhdl.set_body_component_port_map (list_port_map," in_WRITE_DATA_"+toString(i)+"   ","signal_BRANCH_COMPLETE_HISTORY_"+toString(i));
-      }
-    vhdl.set_body_component ("component_RegisterFile",_name+"_RegisterFile",list_port_map);
+//       vhdl->set_body ("out_PREDICT_ACK_"+toString(i)+"         <= '1';");
+//     vhdl->set_body ("");
 
     log_printf(FUNC,Pattern_History_Table,"vhdl_body","End");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_vhdl_port.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_vhdl_port.cpp	(revision 23)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_vhdl_port.cpp	(revision 42)
@@ -18,29 +18,12 @@
 
 
-  void Pattern_History_Table::vhdl_port (Vhdl & vhdl)
-  {
-    log_printf(FUNC,Pattern_History_Table,"vhdl_port","Begin");
+//   void Pattern_History_Table::vhdl_port (Vhdl * & vhdl)
+//   {
+//     log_printf(FUNC,Pattern_History_Table,"vhdl_port","Begin");
 
-    vhdl.set_port (" in_CLOCK" , IN, 1);
-    vhdl.set_port (" in_NRESET", IN, 1);
+//     _interfaces->set_port(vhdl);
 
-    for (uint32_t i=0; i<_param._nb_prediction; i++)
-      {
-	vhdl.set_port(" in_PREDICT_VAL_"+toString(i)+"               ", IN, 1);
-	vhdl.set_port("out_PREDICT_ACK_"+toString(i)+"               ",OUT, 1);
-	vhdl.set_port(" in_PREDICT_ADDRESS_"+toString(i)+"           ", IN, static_cast<uint32_t>(ceil(log2(_param._nb_counter))));
-	vhdl.set_port("out_PREDICT_HISTORY_"+toString(i)+"           ",OUT, _param._size_counter);
-      }
-     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
-       {
-	 vhdl.set_port (" in_BRANCH_COMPLETE_VAL_"+toString(i)+"      ", IN, 1);
-	 vhdl.set_port ("out_BRANCH_COMPLETE_ACK_"+toString(i)+"      ",OUT, 1);
-	 vhdl.set_port (" in_BRANCH_COMPLETE_ADDRESS_"+toString(i)+"  ", IN, static_cast<uint32_t>(ceil(log2(_param._nb_counter))));
-	 vhdl.set_port (" in_BRANCH_COMPLETE_HISTORY_"+toString(i)+"  ", IN, _param._size_counter);
-	 vhdl.set_port (" in_BRANCH_COMPLETE_DIRECTION_"+toString(i)+"", IN, 1);
-       }
-
-    log_printf(FUNC,Pattern_History_Table,"vhdl_port","End");
-  };
+//     log_printf(FUNC,Pattern_History_Table,"vhdl_port","End");
+//   };
 
 }; // end namespace pattern_history_table
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_vhdl_signal.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_vhdl_signal.cpp	(revision 23)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_vhdl_signal.cpp	(revision 42)
@@ -18,10 +18,7 @@
 
 
-  void Pattern_History_Table::vhdl_declaration (Vhdl & vhdl)
+  void Pattern_History_Table::vhdl_declaration (Vhdl * & vhdl)
   {
     log_printf(FUNC,Pattern_History_Table,"vhdl_declaration","Begin");
-
-    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
-      vhdl.set_signal  ("signal_BRANCH_COMPLETE_HISTORY_"+toString(i), _param._size_counter);
 
     log_printf(FUNC,Pattern_History_Table,"vhdl_declaration","End");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_vhdl_testbench_label.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_vhdl_testbench_label.cpp	(revision 23)
+++ 	(revision )
@@ -1,33 +1,0 @@
-/*
- * $Id$
- *
- * [ Description ]
- * 
- */
-
-#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Pattern_History_Table.h"
-
-namespace morpheo                    {
-namespace behavioural {
-namespace stage_1_ifetch {
-namespace predictor {
-namespace meta_predictor {
-namespace two_level_branch_predictor {
-namespace pattern_history_table {
-
-
-  void Pattern_History_Table::vhdl_testbench_label (string label)
-  {
-#ifdef VHDL_TESTBENCH
-    _vhdl_testbench->add_label(label);
-#endif
-  };
-
-}; // end namespace pattern_history_table
-}; // end namespace two_level_branch_predictor
-}; // end namespace meta_predictor
-}; // end namespace predictor
-}; // end namespace stage_1_ifetch
-
-}; // end namespace behavioural
-}; // end namespace morpheo              
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_vhdl_testbench_port.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_vhdl_testbench_port.cpp	(revision 23)
+++ 	(revision )
@@ -1,54 +1,0 @@
-#ifdef VHDL_TESTBENCH
-/*
- * $Id$
- *
- * [ Description ]
- * 
- */
-
-#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Pattern_History_Table.h"
-
-namespace morpheo                    {
-namespace behavioural {
-namespace stage_1_ifetch {
-namespace predictor {
-namespace meta_predictor {
-namespace two_level_branch_predictor {
-namespace pattern_history_table {
-
-
-  void Pattern_History_Table::vhdl_testbench_port ()
-  {
-    log_printf(FUNC,Pattern_History_Table,"vhdl_testbench_port","Begin");
-
-    _vhdl_testbench->set_port (" in_NRESET", IN, 1);
-
-    for (uint32_t i=0; i<_param._nb_prediction; i++)
-      {
-	_vhdl_testbench->set_port (" in_PREDICT_VAL_"+toString(i)+"              ", IN, 1);
-	_vhdl_testbench->set_port ("out_PREDICT_ACK_"+toString(i)+"              ",OUT, 1);
-	_vhdl_testbench->set_port (" in_PREDICT_ADDRESS_"+toString(i)+"          ", IN, static_cast<uint32_t>(ceil(log2(_param._nb_counter))));
-	_vhdl_testbench->set_port ("out_PREDICT_HISTORY_"+toString(i)+"          ",OUT, _param._size_counter);
-      }										  
-										  
-     for (uint32_t i=0; i<_param._nb_branch_complete; i++)			  
-       {									  
-	 _vhdl_testbench->set_port (" in_BRANCH_COMPLETE_VAL_"+toString(i)+"      ", IN, 1);
-	 _vhdl_testbench->set_port ("out_BRANCH_COMPLETE_ACK_"+toString(i)+"      ",OUT, 1);
-	 _vhdl_testbench->set_port (" in_BRANCH_COMPLETE_ADDRESS_"+toString(i)+"  ", IN, static_cast<uint32_t>(ceil(log2(_param._nb_counter))));
-	 _vhdl_testbench->set_port (" in_BRANCH_COMPLETE_HISTORY_"+toString(i)+"  ", IN, _param._size_counter);
-	 _vhdl_testbench->set_port (" in_BRANCH_COMPLETE_DIRECTION_"+toString(i)+"", IN, 1);
-       }
-
-    log_printf(FUNC,Pattern_History_Table,"vhdl_testbench_port","End");
-  };
-
-}; // end namespace pattern_history_table
-}; // end namespace two_level_branch_predictor
-}; // end namespace meta_predictor
-}; // end namespace predictor
-}; // end namespace stage_1_ifetch
-
-}; // end namespace behavioural
-}; // end namespace morpheo              
-#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_vhdl_testbench_transition.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_vhdl_testbench_transition.cpp	(revision 23)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_vhdl_testbench_transition.cpp	(revision 42)
@@ -22,38 +22,7 @@
     log_printf(FUNC,Pattern_History_Table,"vhdl_testbench_transition","Begin");
 
-#ifndef SYSTEMCASS_SPECIFIC
-    sc_cycle(0);
-#endif    
+    sc_start(0);
 
-    // In order with file Pattern_History_Table_vhdl_testbench_port.cpp
-    // Warning : if a output depend of a subcomponent, take directly the port of subcomponent
-    // (because we have no control on the ordonnancer's policy)
-
-    _vhdl_testbench->add_input  (PORT_READ( in_NRESET));
-
-    for (uint32_t i=0; i<_param._nb_prediction; i++)
-      {
-	_vhdl_testbench->add_input  (PORT_READ( in_PREDICT_VAL     [i]));
-	_vhdl_testbench->add_output (PORT_READ(component_RegisterFile->out_READ_ACK  [i]));
-	_vhdl_testbench->add_input  (PORT_READ( in_PREDICT_ADDRESS [i]));
-	_vhdl_testbench->add_output (PORT_READ(component_RegisterFile->out_READ_DATA [i]));
-      //_vhdl_testbench->add_output (PORT_READ(out_PREDICT_HISTORY [i]));
-      }
-
-     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
-       {
-	 _vhdl_testbench->add_input  (PORT_READ( in_BRANCH_COMPLETE_VAL      [i]));
-	 _vhdl_testbench->add_output (PORT_READ(component_RegisterFile->out_WRITE_ACK [i]));
-	 _vhdl_testbench->add_input  (PORT_READ( in_BRANCH_COMPLETE_ADDRESS  [i]));
-	 _vhdl_testbench->add_input  (PORT_READ( in_BRANCH_COMPLETE_HISTORY  [i]));
-	 _vhdl_testbench->add_input  (PORT_READ( in_BRANCH_COMPLETE_DIRECTION[i]));
-       }
-        
-    // add_test :
-    //  - True  : the cycle must be compare with the output of systemC
-    //  - False : no test
-    _vhdl_testbench->add_test(true);
-
-    _vhdl_testbench->new_cycle (); // always at the end
+    _interfaces->testbench();
 
     log_printf(FUNC,Pattern_History_Table,"vhdl_testbench_transition","End");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/SelfTest/src/test.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/SelfTest/src/test.cpp	(revision 23)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/SelfTest/src/test.cpp	(revision 42)
@@ -44,4 +44,5 @@
    *********************************************************************/
   sc_clock                                 CLOCK ("clock", 1.0, 0.5);
+  sc_signal<Tcontrol_t>                    NRESET;
 
   sc_signal<Tcontrol_t>                    PREDICT_BHT_ACK             [param._nb_prediction];
@@ -68,7 +69,6 @@
   cout << "<" << name << "> Instanciation of _Two_Level_Branch_Predictor_Glue" << endl;
   
-#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
   (*(_Two_Level_Branch_Predictor_Glue->in_CLOCK))        (CLOCK);
-#endif
+  (*(_Two_Level_Branch_Predictor_Glue->in_NRESET))       (NRESET);
 
   for (uint32_t i=0; i<param._nb_prediction; i++)
@@ -125,15 +125,13 @@
 
   sc_start(0);
-  _Two_Level_Branch_Predictor_Glue->vhdl_testbench_label("Initialisation");
+
   cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Initialisation" << endl;
 
-
-  _Two_Level_Branch_Predictor_Glue->vhdl_testbench_label("Test ack");
+  NRESET.write(1);
+
   cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Test ack" << endl;
 
   for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++)
     {
-      _Two_Level_Branch_Predictor_Glue->vhdl_testbench_label("Iteration "+toString(iteration));
-
       // Branch History Table
       if (param._have_bht)
@@ -191,11 +189,8 @@
 
 
-  _Two_Level_Branch_Predictor_Glue->vhdl_testbench_label("Test address");
   cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Test address" << endl;
 
   for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++)
     {
-      _Two_Level_Branch_Predictor_Glue->vhdl_testbench_label("Iteration "+toString(iteration));
-      
       predict_address             = rand()%(1<<param._size_address    );
       predict_bht_history         = 0;
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Two_Level_Branch_Predictor_Glue.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Two_Level_Branch_Predictor_Glue.h	(revision 23)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Two_Level_Branch_Predictor_Glue.h	(revision 42)
@@ -25,7 +25,5 @@
 #include "Behavioural/include/Vhdl.h"
 #endif
-#ifdef VHDL_TESTBENCH
-#include "Behavioural/include/Vhdl_Testbench.h"
-#endif
+#include "Behavioural/include/Component.h"
 
 using namespace std;
@@ -58,7 +56,6 @@
 #endif
 
-#ifdef VHDL_TESTBENCH
-  private   : Vhdl_Testbench                 * _vhdl_testbench;
-#endif
+  public    : Component                      * _component;
+  private   : Interfaces                     * _interfaces;
 
 #ifdef SYSTEMC
@@ -66,4 +63,5 @@
     // Interface
   public    : SC_CLOCK                      *  in_CLOCK                      ;
+  public    : SC_IN (Tcontrol_t)            *  in_NRESET                     ;
 
   public    : SC_IN (Tcontrol_t)           **  in_PREDICT_BHT_ACK            ;
@@ -129,17 +127,13 @@
   public  : string   statistics                (uint32_t depth);
 #endif
-					       
 #if VHDL				       
   public  : void     vhdl                      (void);
-  private : void     vhdl_port                 (Vhdl & vhdl);
-  private : void     vhdl_declaration          (Vhdl & vhdl);
-  private : void     vhdl_body                 (Vhdl & vhdl);
+  private : void     vhdl_port                 (Vhdl * & vhdl);
+  private : void     vhdl_declaration          (Vhdl * & vhdl);
+  private : void     vhdl_body                 (Vhdl * & vhdl);
 #endif					       
-					       
 #ifdef VHDL_TESTBENCH			       
-  private : void     vhdl_testbench_port       (void);
   private : void     vhdl_testbench_transition (void);
 #endif
-  public  : void     vhdl_testbench_label      (string label);
   };
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue.cpp	(revision 23)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue.cpp	(revision 42)
@@ -34,4 +34,8 @@
     log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"Two_Level_Branch_Predictor_Glue","Begin");
 
+#ifdef SYSTEMC
+    allocation ();
+#endif
+
 #ifdef STATISTICS
     // Allocation of statistics
@@ -41,13 +45,4 @@
 #endif
 
-#ifdef VHDL_TESTBENCH
-    // Creation of a testbench
-    //  -> port
-    //  -> clock's signals
-    _vhdl_testbench = new Vhdl_Testbench (_name);
-    vhdl_testbench_port           ();
-    _vhdl_testbench->set_clock    ("in_CLOCK",false);
-#endif
-
 #ifdef VHDL
     // generate the vhdl
@@ -56,6 +51,4 @@
 
 #ifdef SYSTEMC
-    allocation ();
-
 #if defined(STATISTICS) or defined(VHDL_TESTBENCH)
     SC_METHOD (transition);
@@ -192,10 +185,4 @@
     log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"~Two_Level_Branch_Predictor_Glue","Begin");
 
-#ifdef VHDL_TESTBENCH
-    // generate the test bench
-    _vhdl_testbench->generate_file();
-    delete _vhdl_testbench;
-#endif
-
 #ifdef STATISTICS
     _stat->generate_file(statistics(0));
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_allocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_allocation.cpp	(revision 23)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_allocation.cpp	(revision 42)
@@ -24,8 +24,30 @@
     log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"allocation","Begin");
 
-#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
-    in_CLOCK  = new SC_CLOCK           ("in_CLOCK");
+    _component   = new Component ();
+
+    Entity * entity = _component->set_entity (_name                 
+					     ,"Two_Level_Branch_Predictor_Glue"
+#ifdef POSITION
+					     ,COMBINATORY
 #endif
+					      );
     
+    _interfaces = entity->set_interfaces();
+
+    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+    {
+      Interface * interface = _interfaces->set_interface(""
+#ifdef POSITION
+							 , IN  
+							 , SOUTH
+							 , "Generalist interface"
+#endif
+							 );
+      
+      in_CLOCK              = interface->set_signal_clk              ("clock" ,1,CLOCK_VHDL_NO);
+      in_NRESET             = interface->set_signal_in  <Tcontrol_t> ("nreset",1,RESET_VHDL_NO);
+    }
+    
+    // ~~~~~[ Interface : "Predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     if (_param._have_bht)
       {
@@ -45,31 +67,29 @@
     for (uint32_t i=0; i<_param._nb_prediction; i++)
       {
+	Interface_fifo * interface = _interfaces->set_interface("predict_"+toString(i)
+#ifdef POSITION
+								, IN  
+								, WEST
+								, "Interface Predict"
+#endif
+								);
+
 	if (_param._have_bht)
 	  {
-	rename = " in_PREDICT_BHT_ACK_"    +toString(i);
-         in_PREDICT_BHT_ACK             [i] = new SC_IN (Tcontrol_t)     (rename.c_str());
-
-	rename = "out_PREDICT_BHT_ADDRESS_"+toString(i);
-        out_PREDICT_BHT_ADDRESS         [i] = new SC_OUT(Taddress_t)     (rename.c_str());
+         in_PREDICT_BHT_ACK             [i] = interface->set_signal_in  <Tcontrol_t>     ("bht_ack"    ,1);
+        out_PREDICT_BHT_ADDRESS         [i] = interface->set_signal_out <Taddress_t>     ("bht_address",_param._bht_size_address);
 	  }
 	if (_param._have_pht)
 	  {
-        rename = " in_PREDICT_PHT_ACK_"    +toString(i);
-         in_PREDICT_PHT_ACK             [i] = new SC_IN (Tcontrol_t)     (rename.c_str());
-        
-	rename = "out_PREDICT_PHT_ADDRESS_"+toString(i);
-        out_PREDICT_PHT_ADDRESS         [i] = new SC_OUT(Taddress_t)     (rename.c_str());
+         in_PREDICT_PHT_ACK             [i] = interface->set_signal_in  <Tcontrol_t>     ("pht_ack"    ,1);
+        out_PREDICT_PHT_ADDRESS         [i] = interface->set_signal_out <Taddress_t>     ("pht_address",_param._pht_size_address);
 	  }
 	if (_param._have_bht and _param._have_pht)
-	  {
-	rename = " in_PREDICT_BHT_HISTORY_"+toString(i);
-         in_PREDICT_BHT_HISTORY         [i] = new SC_IN (Tbht_history_t) (rename.c_str());
-	  }
-        rename = "out_PREDICT_ACK_"        +toString(i);
-        out_PREDICT_ACK                 [i] = new SC_OUT(Tcontrol_t)     (rename.c_str());
-        
-        rename = " in_PREDICT_ADDRESS_"    +toString(i);
-         in_PREDICT_ADDRESS             [i] = new SC_IN (Taddress_t)     (rename.c_str());
+         in_PREDICT_BHT_HISTORY         [i] = interface->set_signal_in  <Tbht_history_t> ("bht_history",_param._bht_size_history);
+        out_PREDICT_ACK                 [i] = interface->set_signal_out <Tcontrol_t>     ("ack"        ,1);
+         in_PREDICT_ADDRESS             [i] = interface->set_signal_in  <Taddress_t>     ("address"    ,_param._size_address);
       }
+
+    // ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
     if (_param._have_bht)
@@ -91,33 +111,33 @@
     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
       {
+	Interface_fifo * interface = _interfaces->set_interface("branch_complete_"+toString(i)
+#ifdef POSITION
+								, IN  
+								, EAST
+								, "Interface branch complete"
+#endif
+								);
 	if (_param._have_bht)
 	  {
-	rename = " in_BRANCH_COMPLETE_BHT_ACK_"    +toString(i);
-         in_BRANCH_COMPLETE_BHT_ACK             [i] = new SC_IN (Tcontrol_t)     (rename.c_str());
-        
-        rename = "out_BRANCH_COMPLETE_BHT_ADDRESS_"+toString(i);
-        out_BRANCH_COMPLETE_BHT_ADDRESS         [i] = new SC_OUT(Taddress_t)     (rename.c_str());
+         in_BRANCH_COMPLETE_BHT_ACK             [i] = interface->set_signal_in  <Tcontrol_t>     ("bht_ack"    ,1);
+        out_BRANCH_COMPLETE_BHT_ADDRESS         [i] = interface->set_signal_out <Taddress_t>     ("bht_address",_param._bht_size_address);
 	  }
 	if (_param._have_pht)
 	  {
-        rename = " in_BRANCH_COMPLETE_PHT_ACK_"    +toString(i);
-         in_BRANCH_COMPLETE_PHT_ACK             [i] = new SC_IN (Tcontrol_t)     (rename.c_str());
-
-        rename = "out_BRANCH_COMPLETE_PHT_ADDRESS_"+toString(i);
-        out_BRANCH_COMPLETE_PHT_ADDRESS         [i] = new SC_OUT(Taddress_t)     (rename.c_str());
+         in_BRANCH_COMPLETE_PHT_ACK             [i] = interface->set_signal_in  <Tcontrol_t>     ("pht_ack"    ,1);
+        out_BRANCH_COMPLETE_PHT_ADDRESS         [i] = interface->set_signal_out <Taddress_t>     ("pht_address",_param._pht_size_address);
 	  }
 	if (_param._have_bht and _param._have_pht)
-	  {
-        rename = " in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i);
-         in_BRANCH_COMPLETE_BHT_HISTORY         [i] = new SC_IN (Tbht_history_t) (rename.c_str());
-	  }
-        rename = "out_BRANCH_COMPLETE_ACK_"        +toString(i);
-        out_BRANCH_COMPLETE_ACK                 [i] = new SC_OUT(Tcontrol_t)     (rename.c_str());
-        
-        rename = " in_BRANCH_COMPLETE_ADDRESS_"    +toString(i);
-         in_BRANCH_COMPLETE_ADDRESS             [i] = new SC_IN (Taddress_t)     (rename.c_str());
+         in_BRANCH_COMPLETE_BHT_HISTORY         [i] = interface->set_signal_in  <Tbht_history_t> ("bht_history",_param._bht_size_history);
+
+        out_BRANCH_COMPLETE_ACK                 [i] = interface->set_signal_out <Tcontrol_t>     ("ack"        ,1);
+         in_BRANCH_COMPLETE_ADDRESS             [i] = interface->set_signal_in  <Taddress_t>     ("address"    ,_param._size_address);
       }
 
     // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
+
+#ifdef POSITION
+    _component->generate_file();
+#endif
 
     log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"allocation","End");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_deallocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_deallocation.cpp	(revision 23)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_deallocation.cpp	(revision 42)
@@ -22,72 +22,40 @@
     log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"deallocation","Begin");
 
-    delete in_CLOCK;
+    delete     in_CLOCK;
+    delete     in_NRESET;
 
-    for (uint32_t i=0; i<_param._nb_prediction; i++)
-      {
-	if (_param._have_bht)
-	  {
-        delete  in_PREDICT_BHT_ACK             [i];
-        delete out_PREDICT_BHT_ADDRESS         [i];
-	  }
-	if (_param._have_pht)
-	  {
-        delete  in_PREDICT_PHT_ACK             [i];
-        delete out_PREDICT_PHT_ADDRESS         [i];
-	  }
-	if (_param._have_bht and _param._have_pht)
-        delete  in_PREDICT_BHT_HISTORY         [i];
-        delete out_PREDICT_ACK                 [i];
-        delete  in_PREDICT_ADDRESS             [i];
-      }
     if (_param._have_bht)
       {
-    delete  in_PREDICT_BHT_ACK    ;
-    delete out_PREDICT_BHT_ADDRESS;
+    delete []  in_PREDICT_BHT_ACK    ;
+    delete [] out_PREDICT_BHT_ADDRESS;
       }
     if (_param._have_pht)
       {
-    delete  in_PREDICT_PHT_ACK    ;
-    delete out_PREDICT_PHT_ADDRESS;
+    delete []  in_PREDICT_PHT_ACK    ;
+    delete [] out_PREDICT_PHT_ADDRESS;
       }
     if (_param._have_bht and _param._have_pht)
-    delete  in_PREDICT_BHT_HISTORY;
+    delete []  in_PREDICT_BHT_HISTORY;
     
-    delete out_PREDICT_ACK        ;
-    delete  in_PREDICT_ADDRESS    ;
+    delete [] out_PREDICT_ACK        ;
+    delete []  in_PREDICT_ADDRESS    ;
 
-    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
-      {
-	if (_param._have_bht)
-	  {
-        delete  in_BRANCH_COMPLETE_BHT_ACK             [i];
-        delete out_BRANCH_COMPLETE_BHT_ADDRESS         [i];
-	  }
-	if (_param._have_pht)
-	  {
-        delete  in_BRANCH_COMPLETE_PHT_ACK             [i];
-        delete out_BRANCH_COMPLETE_PHT_ADDRESS         [i];
-	  }
-	if (_param._have_bht and _param._have_pht)
-	delete  in_BRANCH_COMPLETE_BHT_HISTORY         [i];
-        delete out_BRANCH_COMPLETE_ACK                 [i];
-        delete  in_BRANCH_COMPLETE_ADDRESS             [i];
-      }
     if (_param._have_bht)
       {
-    delete  in_BRANCH_COMPLETE_BHT_ACK    ;
-    delete out_BRANCH_COMPLETE_BHT_ADDRESS;
+    delete []  in_BRANCH_COMPLETE_BHT_ACK    ;
+    delete [] out_BRANCH_COMPLETE_BHT_ADDRESS;
       }
     if (_param._have_pht)
       {
-    delete  in_BRANCH_COMPLETE_PHT_ACK    ;
-    delete out_BRANCH_COMPLETE_PHT_ADDRESS;
+    delete []  in_BRANCH_COMPLETE_PHT_ACK    ;
+    delete [] out_BRANCH_COMPLETE_PHT_ADDRESS;
       }
     if (_param._have_bht and _param._have_pht)
-    delete  in_BRANCH_COMPLETE_BHT_HISTORY;
-    delete out_BRANCH_COMPLETE_ACK        ;
-    delete  in_BRANCH_COMPLETE_ADDRESS    ;
+    delete []  in_BRANCH_COMPLETE_BHT_HISTORY;
+    delete [] out_BRANCH_COMPLETE_ACK        ;
+    delete []  in_BRANCH_COMPLETE_ADDRESS    ;
 
     // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
+    delete _component;
 
     log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"deallocation","End");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_vhdl.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_vhdl.cpp	(revision 23)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_vhdl.cpp	(revision 42)
@@ -22,7 +22,8 @@
   {
     log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"vhdl","Begin");
-    Vhdl vhdl (_name);
+    
+    Vhdl * vhdl = new Vhdl (_name);
 
-    vhdl.set_library_work (_name + "_Pack");
+    vhdl->set_library_work (_name + "_Pack");
 
     vhdl_port        (vhdl);
@@ -30,5 +31,8 @@
     vhdl_body        (vhdl);
 
-    vhdl.generate_file();
+    vhdl->generate_file();
+
+    delete vhdl;
+
     log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"vhdl","End");
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_vhdl_body.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_vhdl_body.cpp	(revision 23)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_vhdl_body.cpp	(revision 42)
@@ -18,9 +18,9 @@
 
 
-  void Two_Level_Branch_Predictor_Glue::vhdl_body (Vhdl & vhdl)
+  void Two_Level_Branch_Predictor_Glue::vhdl_body (Vhdl * & vhdl)
   {
     log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"vhdl_body","Begin");
 
-    vhdl.set_body ("-- ack output");
+    vhdl->set_body ("-- ack output");
     for (uint32_t i=0; i<_param._nb_prediction; i++)
       {
@@ -28,14 +28,14 @@
 
 	if (_param._have_bht)
-	  bht_ack = "in_PREDICT_BHT_ACK_"+toString(i);
+	  bht_ack = "in_PREDICT_"+toString(i)+"_BHT_ACK";
 	else
 	  bht_ack = "'1'";
 
 	if (_param._have_pht)
-	  pht_ack = "in_PREDICT_PHT_ACK_"+toString(i);
+	  pht_ack = "in_PREDICT_"+toString(i)+"_PHT_ACK";
 	else
 	  pht_ack = "'1'";
 
-	vhdl.set_body ("out_PREDICT_ACK_"+toString(i)+"         <= "+bht_ack+" and "+pht_ack+";");
+	vhdl->set_body ("out_PREDICT_"+toString(i)+"_ACK         <= "+bht_ack+" and "+pht_ack+";");
       }
 
@@ -45,18 +45,18 @@
 
 	if (_param._have_bht)
-	  bht_ack = "in_BRANCH_COMPLETE_BHT_ACK_"+toString(i);
+	  bht_ack = "in_BRANCH_COMPLETE_"+toString(i)+"_BHT_ACK";
 	else
 	  bht_ack = "'1'";
 
 	if (_param._have_pht)
-	  pht_ack = "in_BRANCH_COMPLETE_PHT_ACK_"+toString(i);
+	  pht_ack = "in_BRANCH_COMPLETE_"+toString(i)+"_PHT_ACK";
 	else
 	  pht_ack = "'1'";
 
-	vhdl.set_body ("out_BRANCH_COMPLETE_ACK_"+toString(i)+" <= "+bht_ack+" and "+pht_ack+";");
+	vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_ACK <= "+bht_ack+" and "+pht_ack+";");
       }
     
-    vhdl.set_body ("");
-    vhdl.set_body ("-- address output");
+    vhdl->set_body ("");
+    vhdl->set_body ("-- address output");
 
     for (uint32_t i=0; i<_param._nb_prediction; i++)
@@ -64,5 +64,5 @@
 	// The address is higher than the address size of bht
 	if (_param._have_bht)
-	  vhdl.set_body ("out_PREDICT_BHT_ADDRESS_"+toString(i)+" <= in_PREDICT_ADDRESS_"+toString(i)+std_logic_range(_param._bht_size_address)+";");
+	  vhdl->set_body ("out_PREDICT_"+toString(i)+"_BHT_ADDRESS <= in_PREDICT_"+toString(i)+"_ADDRESS"+std_logic_range(_param._bht_size_address)+";");
 
 	if (_param._have_pht)
@@ -93,5 +93,5 @@
 		  {
 		    min = _param._pht_size_address_shift;
-		    vhdl.set_body ("out_PREDICT_PHT_ADDRESS_"+toString(i)+std_logic_range(min) + " <=  in_PREDICT_BHT_HISTORY_"+toString(i)+std_logic_range(min)+";");
+		    vhdl->set_body ("out_PREDICT_"+toString(i)+"_PHT_ADDRESS"+std_logic_range(min) + " <=  in_PREDICT_"+toString(i)+"_BHT_HISTORY"+std_logic_range(min)+";");
 		  }
 
@@ -99,13 +99,13 @@
 		  {
 		    max = _param._bht_size_history;
-		    vhdl.set_body ("out_PREDICT_PHT_ADDRESS_"+toString(i)+std_logic_range(_param._pht_size_address-1,max) + " <=  in_PREDICT_ADDRESS_"+toString(i)+std_logic_range(_param._pht_size_address-1-_param._pht_size_address_shift, _param._pht_size_address_share)+";");
+		    vhdl->set_body ("out_PREDICT_"+toString(i)+"_PHT_ADDRESS"+std_logic_range(_param._pht_size_address-1,max) + " <=  in_PREDICT_"+toString(i)+"_ADDRESS"+std_logic_range(_param._pht_size_address-1-_param._pht_size_address_shift, _param._pht_size_address_share)+";");
 		  }
 		
 		// intersection
 		if (_param._pht_size_address_share > 0)
-		  vhdl.set_body ("out_PREDICT_PHT_ADDRESS_"+toString(i)+std_logic_range(max-1,min) + " <=  in_PREDICT_ADDRESS_"+toString(i)+std_logic_range(_param._pht_size_address_share-1,0)+" xor in_PREDICT_BHT_HISTORY_"+toString(i)+std_logic_range(max-1,min)+";");
+		  vhdl->set_body ("out_PREDICT_"+toString(i)+"_PHT_ADDRESS"+std_logic_range(max-1,min) + " <=  in_PREDICT_"+toString(i)+"_ADDRESS"+std_logic_range(_param._pht_size_address_share-1,0)+" xor in_PREDICT_"+toString(i)+"_BHT_HISTORY"+std_logic_range(max-1,min)+";");
 	      }
 	    else
-	      vhdl.set_body ("out_PREDICT_PHT_ADDRESS_"+toString(i)+" <=  in_PREDICT_ADDRESS_"+toString(i)+std_logic_range(_param._pht_size_address)+";");
+	      vhdl->set_body ("out_PREDICT_"+toString(i)+"_PHT_ADDRESS <=  in_PREDICT_"+toString(i)+"_ADDRESS"+std_logic_range(_param._pht_size_address)+";");
 	  }
       }
@@ -115,5 +115,5 @@
 	// The address is higher than the address size of bht
 	if (_param._have_bht)
-	  vhdl.set_body ("out_BRANCH_COMPLETE_BHT_ADDRESS_"+toString(i)+" <= in_BRANCH_COMPLETE_ADDRESS_"+toString(i)+std_logic_range(_param._bht_size_address)+";");
+	  vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_BHT_ADDRESS <= in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"+std_logic_range(_param._bht_size_address)+";");
 
 	if (_param._have_pht)
@@ -129,5 +129,5 @@
 		  {
 		    min = _param._pht_size_address_shift;
-		    vhdl.set_body ("out_BRANCH_COMPLETE_PHT_ADDRESS_"+toString(i)+std_logic_range(min) + " <=  in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i)+std_logic_range(min)+";");
+		    vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_PHT_ADDRESS"+std_logic_range(min) + " <=  in_BRANCH_COMPLETE_"+toString(i)+"_BHT_HISTORY"+std_logic_range(min)+";");
 		  }
 
@@ -135,13 +135,13 @@
 		  {
 		    max = _param._bht_size_history;
-		    vhdl.set_body ("out_BRANCH_COMPLETE_PHT_ADDRESS_"+toString(i)+std_logic_range(_param._pht_size_address-1,max) + " <=  in_BRANCH_COMPLETE_ADDRESS_"+toString(i)+std_logic_range(_param._pht_size_address-1-_param._pht_size_address_shift, _param._pht_size_address_share)+";");
+		    vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_PHT_ADDRESS"+std_logic_range(_param._pht_size_address-1,max) + " <=  in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"+std_logic_range(_param._pht_size_address-1-_param._pht_size_address_shift, _param._pht_size_address_share)+";");
 		  }
 		
 		// intersection
 		if (_param._pht_size_address_share > 0)
-		  vhdl.set_body ("out_BRANCH_COMPLETE_PHT_ADDRESS_"+toString(i)+std_logic_range(max-1,min) + " <=  in_BRANCH_COMPLETE_ADDRESS_"+toString(i)+std_logic_range(_param._pht_size_address_share-1,0)+" xor in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i)+std_logic_range(max-1,min)+";");
+		  vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_PHT_ADDRESS"+std_logic_range(max-1,min) + " <=  in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"+std_logic_range(_param._pht_size_address_share-1,0)+" xor in_BRANCH_COMPLETE_"+toString(i)+"_BHT_HISTORY"+std_logic_range(max-1,min)+";");
 	      }
 	    else
-	      vhdl.set_body ("out_BRANCH_COMPLETE_PHT_ADDRESS_"+toString(i)+" <=  in_BRANCH_COMPLETE_ADDRESS_"+toString(i)+std_logic_range(_param._pht_size_address)+";");
+	      vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_PHT_ADDRESS <=  in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"+std_logic_range(_param._pht_size_address)+";");
 	  }
       }
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_vhdl_declaration.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_vhdl_declaration.cpp	(revision 23)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_vhdl_declaration.cpp	(revision 42)
@@ -18,5 +18,5 @@
 
 
-  void Two_Level_Branch_Predictor_Glue::vhdl_declaration (Vhdl & vhdl)
+  void Two_Level_Branch_Predictor_Glue::vhdl_declaration (Vhdl * & vhdl)
   {
     log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"vhdl_declaration","Begin");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_vhdl_port.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_vhdl_port.cpp	(revision 23)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_vhdl_port.cpp	(revision 42)
@@ -18,44 +18,9 @@
 
 
-  void Two_Level_Branch_Predictor_Glue::vhdl_port (Vhdl & vhdl)
+  void Two_Level_Branch_Predictor_Glue::vhdl_port (Vhdl * & vhdl)
   {
     log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"vhdl_port","Begin");
 
-    for (uint32_t i=0; i<_param._nb_prediction; i++)
-      {
-	if (_param._have_bht)
-	  {
-	vhdl.set_port (" in_PREDICT_BHT_ACK_"    +toString(i), IN, 1);
-	vhdl.set_port ("out_PREDICT_BHT_ADDRESS_"+toString(i),OUT,_param._bht_size_address);
-	  }
-	if (_param._have_bht and _param._have_pht)
-	vhdl.set_port (" in_PREDICT_BHT_HISTORY_"+toString(i), IN,_param._bht_size_history);
-	if (_param._have_pht)
-	  {
-        vhdl.set_port (" in_PREDICT_PHT_ACK_"    +toString(i), IN, 1);
-	vhdl.set_port ("out_PREDICT_PHT_ADDRESS_"+toString(i),OUT,_param._pht_size_address);
-	  }
-	
-        vhdl.set_port ("out_PREDICT_ACK_"        +toString(i),OUT, 1);
-        vhdl.set_port (" in_PREDICT_ADDRESS_"    +toString(i), IN,_param._size_address);
-      }
-
-    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
-      {
-	if (_param._have_bht)
-	  {
-	vhdl.set_port (" in_BRANCH_COMPLETE_BHT_ACK_"    +toString(i), IN, 1);
-        vhdl.set_port ("out_BRANCH_COMPLETE_BHT_ADDRESS_"+toString(i),OUT,_param._bht_size_address);
-	  }
-	if (_param._have_bht and _param._have_pht)
-	vhdl.set_port (" in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i), IN,_param._bht_size_history);
-        if (_param._have_pht)
-	  {
-        vhdl.set_port (" in_BRANCH_COMPLETE_PHT_ACK_"    +toString(i), IN, 1);
-        vhdl.set_port ("out_BRANCH_COMPLETE_PHT_ADDRESS_"+toString(i),OUT,_param._pht_size_address);
-	  }
-        vhdl.set_port ("out_BRANCH_COMPLETE_ACK_"        +toString(i),OUT, 1);
-        vhdl.set_port (" in_BRANCH_COMPLETE_ADDRESS_"    +toString(i), IN,_param._size_address);
-      }
+    _interfaces->set_port(vhdl);
 
     log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"vhdl_port","End");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_vhdl_testbench_label.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_vhdl_testbench_label.cpp	(revision 23)
+++ 	(revision )
@@ -1,33 +1,0 @@
-/*
- * $Id$
- *
- * [ Description ]
- * 
- */
-
-#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Two_Level_Branch_Predictor_Glue.h"
-
-namespace morpheo                    {
-namespace behavioural {
-namespace stage_1_ifetch {
-namespace predictor {
-namespace meta_predictor {
-namespace two_level_branch_predictor {
-namespace two_level_branch_predictor_glue {
-
-
-  void Two_Level_Branch_Predictor_Glue::vhdl_testbench_label (string label)
-  {
-#ifdef VHDL_TESTBENCH
-    _vhdl_testbench->add_label(label);
-#endif
-  };
-
-}; // end namespace two_level_branch_predictor_glue
-}; // end namespace two_level_branch_predictor
-}; // end namespace meta_predictor
-}; // end namespace predictor
-}; // end namespace stage_1_ifetch
-
-}; // end namespace behavioural
-}; // end namespace morpheo              
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_vhdl_testbench_port.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_vhdl_testbench_port.cpp	(revision 23)
+++ 	(revision )
@@ -1,71 +1,0 @@
-#ifdef VHDL_TESTBENCH
-/*
- * $Id$
- *
- * [ Description ]
- * 
- */
-
-#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Two_Level_Branch_Predictor_Glue.h"
-
-namespace morpheo                    {
-namespace behavioural {
-namespace stage_1_ifetch {
-namespace predictor {
-namespace meta_predictor {
-namespace two_level_branch_predictor {
-namespace two_level_branch_predictor_glue {
-
-
-  void Two_Level_Branch_Predictor_Glue::vhdl_testbench_port ()
-  {
-    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"vhdl_testbench_port","Begin");
-
-    for (uint32_t i=0; i<_param._nb_prediction; i++)
-      {
-	if (_param._have_bht)
-	  {
-	_vhdl_testbench->set_port (" in_PREDICT_BHT_ACK_"    +toString(i), IN, 1);
-	_vhdl_testbench->set_port ("out_PREDICT_BHT_ADDRESS_"+toString(i),OUT,_param._bht_size_address);
-	  }
-	if (_param._have_bht and _param._have_pht)
-	_vhdl_testbench->set_port (" in_PREDICT_BHT_HISTORY_"+toString(i), IN,_param._bht_size_history);
-	if (_param._have_pht)
-	  {
-        _vhdl_testbench->set_port (" in_PREDICT_PHT_ACK_"    +toString(i), IN, 1);
-	_vhdl_testbench->set_port ("out_PREDICT_PHT_ADDRESS_"+toString(i),OUT,_param._pht_size_address);
-	  }
-        _vhdl_testbench->set_port ("out_PREDICT_ACK_"        +toString(i),OUT, 1);
-        _vhdl_testbench->set_port (" in_PREDICT_ADDRESS_"    +toString(i), IN,_param._size_address);
-      }
-
-    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
-      {
-	if (_param._have_bht)
-	  {
-	_vhdl_testbench->set_port (" in_BRANCH_COMPLETE_BHT_ACK_"    +toString(i), IN, 1);
-        _vhdl_testbench->set_port ("out_BRANCH_COMPLETE_BHT_ADDRESS_"+toString(i),OUT,_param._bht_size_address);
-	  }
-	if (_param._have_bht and _param._have_pht)
-	_vhdl_testbench->set_port (" in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i), IN,_param._bht_size_history);
-        if (_param._have_pht)
-	  {
-        _vhdl_testbench->set_port (" in_BRANCH_COMPLETE_PHT_ACK_"    +toString(i), IN, 1);
-        _vhdl_testbench->set_port ("out_BRANCH_COMPLETE_PHT_ADDRESS_"+toString(i),OUT,_param._pht_size_address);
-	  }
-        _vhdl_testbench->set_port ("out_BRANCH_COMPLETE_ACK_"        +toString(i),OUT, 1);
-        _vhdl_testbench->set_port (" in_BRANCH_COMPLETE_ADDRESS_"    +toString(i), IN,_param._size_address);
-      }
-
-    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"vhdl_testbench_port","End");
-  };
-
-}; // end namespace two_level_branch_predictor_glue
-}; // end namespace two_level_branch_predictor
-}; // end namespace meta_predictor
-}; // end namespace predictor
-}; // end namespace stage_1_ifetch
-
-}; // end namespace behavioural
-}; // end namespace morpheo              
-#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_vhdl_testbench_transition.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_vhdl_testbench_transition.cpp	(revision 23)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_vhdl_testbench_transition.cpp	(revision 42)
@@ -22,54 +22,7 @@
     log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"vhdl_testbench_transition","Begin");
 
-#ifndef SYSTEMCASS_SPECIFIC
-    sc_cycle(0);
-#endif    
+    sc_start(0);
 
-    // In order with file Two_Level_Branch_Predictor_Glue_vhdl_testbench_port.cpp
-    // Warning : if a output depend of a subcomponent, take directly the port of subcomponent
-    // (because we have no control on the ordonnancer's policy)
-
-//     _vhdl_testbench->add_input (PORT_READ( in_NRESET));
-    for (uint32_t i=0; i<_param._nb_prediction; i++)
-      {
-	if (_param._have_bht)
-	  {
-	_vhdl_testbench->add_input  (PORT_READ( in_PREDICT_BHT_ACK      [i]));
-	_vhdl_testbench->add_output (PORT_READ(out_PREDICT_BHT_ADDRESS  [i]));
-	  }
-	if (_param._have_bht and _param._have_pht)
-	_vhdl_testbench->add_input  (PORT_READ( in_PREDICT_BHT_HISTORY  [i]));
-	if (_param._have_pht)
-	  {
-        _vhdl_testbench->add_input  (PORT_READ( in_PREDICT_PHT_ACK      [i]));
-	_vhdl_testbench->add_output (PORT_READ(out_PREDICT_PHT_ADDRESS  [i]));
-	  }
-        _vhdl_testbench->add_output (PORT_READ(out_PREDICT_ACK          [i]));
-        _vhdl_testbench->add_input  (PORT_READ( in_PREDICT_ADDRESS      [i]));
-      }
-
-    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
-      {
-	if (_param._have_bht)
-	  {
-	_vhdl_testbench->add_input  (PORT_READ( in_BRANCH_COMPLETE_BHT_ACK      [i]));
-        _vhdl_testbench->add_output (PORT_READ(out_BRANCH_COMPLETE_BHT_ADDRESS  [i]));
-	  }
-	if (_param._have_bht and _param._have_pht)
-	_vhdl_testbench->add_input  (PORT_READ( in_BRANCH_COMPLETE_BHT_HISTORY  [i]));
-        if (_param._have_pht)
-	  {
-        _vhdl_testbench->add_input  (PORT_READ( in_BRANCH_COMPLETE_PHT_ACK      [i]));
-        _vhdl_testbench->add_output (PORT_READ(out_BRANCH_COMPLETE_PHT_ADDRESS  [i]));
-	  }
-        _vhdl_testbench->add_output (PORT_READ(out_BRANCH_COMPLETE_ACK          [i]));
-        _vhdl_testbench->add_input  (PORT_READ( in_BRANCH_COMPLETE_ADDRESS      [i]));
-      }
-    // add_test :
-    //  - True  : the cycle must be compare with the output of systemC
-    //  - False : no test
-    _vhdl_testbench->add_test(true);
-
-    _vhdl_testbench->new_cycle (); // always at the end
+    _interfaces->testbench();
 
     log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"vhdl_testbench_transition","End");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/include/Two_Level_Branch_Predictor.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/include/Two_Level_Branch_Predictor.h	(revision 23)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/include/Two_Level_Branch_Predictor.h	(revision 42)
@@ -30,7 +30,5 @@
 #include "Behavioural/include/Vhdl.h"
 #endif
-#ifdef VHDL_TESTBENCH
-#include "Behavioural/include/Vhdl_Testbench.h"
-#endif
+#include "Behavioural/include/Component.h"
 
 using namespace std;
@@ -62,7 +60,6 @@
 #endif
 
-#ifdef VHDL_TESTBENCH
-  private   : Vhdl_Testbench                 * _vhdl_testbench;
-#endif
+  public    : Component                      * _component;
+  private   : Interfaces                     * _interfaces;
 
 #ifdef SYSTEMC
@@ -138,14 +135,11 @@
 #if VHDL				       
   public  : void     vhdl                      (void);
-  private : void     vhdl_port                 (Vhdl & vhdl);
-  private : void     vhdl_declaration          (Vhdl & vhdl);
-  private : void     vhdl_body                 (Vhdl & vhdl);
+  private : void     vhdl_port                 (Vhdl * & vhdl);
+  private : void     vhdl_declaration          (Vhdl * & vhdl);
+  private : void     vhdl_body                 (Vhdl * & vhdl);
 #endif					       
-					       
 #ifdef VHDL_TESTBENCH			       
-  private : void     vhdl_testbench_port       (void);
   private : void     vhdl_testbench_transition (void);
 #endif
-  public  : void     vhdl_testbench_label      (string label);
   };
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor.cpp	(revision 23)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor.cpp	(revision 42)
@@ -33,4 +33,8 @@
     log_printf(FUNC,Two_Level_Branch_Predictor,"Two_Level_Branch_Predictor","Begin");
 
+#ifdef SYSTEMC
+    allocation ();
+#endif
+
 #ifdef STATISTICS
     // Allocation of statistics
@@ -38,13 +42,4 @@
 			    param_statistics          ,
 			    param);
-#endif
-
-#ifdef VHDL_TESTBENCH
-    // Creation of a testbench
-    //  -> port
-    //  -> clock's signals
-    _vhdl_testbench = new Vhdl_Testbench (_name);
-    vhdl_testbench_port           ();
-    _vhdl_testbench->set_clock    ("in_CLOCK",true);
 #endif
 
@@ -55,6 +50,4 @@
 
 #ifdef SYSTEMC
-    allocation ();
-
 #if (defined(STATISTICS) || defined (VHDL_TESTBENCH))
     SC_METHOD (transition);
@@ -79,10 +72,4 @@
     log_printf(FUNC,Two_Level_Branch_Predictor,"~Two_Level_Branch_Predictor","Begin");
 
-#ifdef VHDL_TESTBENCH
-    // generate the test bench
-    _vhdl_testbench->generate_file();
-    delete _vhdl_testbench;
-#endif
-
 #ifdef STATISTICS
     _stat->generate_file(statistics(0));
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_allocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_allocation.cpp	(revision 23)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_allocation.cpp	(revision 42)
@@ -22,6 +22,30 @@
     log_printf(FUNC,Two_Level_Branch_Predictor,"allocation","Begin");
 
-     in_CLOCK  = new SC_CLOCK           ("in_CLOCK");
-     in_NRESET = new SC_IN (Tcontrol_t) ("in_NRESET");
+    _component   = new Component ();
+
+    Entity * entity = _component->set_entity (_name                 
+					     ,"Two_Level_Branch_Predictor"
+#ifdef POSITION
+					     ,MIXTE
+#endif
+					      );
+    
+    _interfaces = entity->set_interfaces();
+
+    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+    {
+      Interface * interface = _interfaces->set_interface(""
+#ifdef POSITION
+							 , IN  
+							 , SOUTH
+							 , "Generalist interface"
+#endif
+							 );
+      
+      in_CLOCK              = interface->set_signal_clk              ("clock" ,1);
+      in_NRESET             = interface->set_signal_in  <Tcontrol_t> ("nreset",1,RESET_VHDL_YES);
+    }
+    
+    // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
      in_PREDICT_VAL                 = new SC_IN (Tcontrol_t)     * [_param._nb_prediction     ];
@@ -32,56 +56,25 @@
     if (_param._have_pht)
     out_PREDICT_PHT_HISTORY         = new SC_OUT(Tpht_history_t) * [_param._nb_prediction     ];
-    if (_param._have_bht)
-      {
-    signal_PREDICT_BHT_ACK          = new SC_SIGNAL(Tcontrol_t)     * [_param._nb_prediction];
-    signal_PREDICT_BHT_ADDRESS      = new SC_SIGNAL(Taddress_t)     * [_param._nb_prediction];
-      }
-    if (_param._have_pht)
-      {
-    signal_PREDICT_PHT_ACK          = new SC_SIGNAL(Tcontrol_t)     * [_param._nb_prediction];
-    signal_PREDICT_PHT_ADDRESS      = new SC_SIGNAL(Taddress_t)     * [_param._nb_prediction];
-      }
 
     for (uint32_t i=0; i<_param._nb_prediction; i++)
       {
-	rename = "in_PREDICT_VAL_"         +toString(i);
-	 in_PREDICT_VAL                 [i] = new SC_IN (Tcontrol_t)     (rename.c_str());
-
-	rename = "out_PREDICT_ACK_"        +toString(i);
-	out_PREDICT_ACK                 [i] = new SC_OUT(Tcontrol_t)     (rename.c_str());
-
-	rename = "in_PREDICT_ADDRESS_"     +toString(i);
-	 in_PREDICT_ADDRESS             [i] = new SC_IN (Taddress_t)     (rename.c_str());
-
+	Interface_fifo * interface = _interfaces->set_interface("predict_"+toString(i)
+#ifdef POSITION
+								, IN  
+								, WEST
+								, "Interface Predict"
+#endif
+								);
+
+	 in_PREDICT_VAL                 [i] = interface->set_signal_valack_in            ("val"    , VAL);
+	out_PREDICT_ACK                 [i] = interface->set_signal_valack_out           ("ack"    , ACK);
+	 in_PREDICT_ADDRESS             [i] = interface->set_signal_in  <Taddress_t>     ("address", _param._size_address);
 	if (_param._have_bht)
-	  {
-	rename = "out_PREDICT_BHT_HISTORY_"+toString(i);
-	out_PREDICT_BHT_HISTORY         [i] = new SC_OUT(Tbht_history_t) (rename.c_str());
-	  }
-
+	out_PREDICT_BHT_HISTORY         [i] = interface->set_signal_out <Tbht_history_t> ("bht_history", _param._bht_size_shifter);
 	if (_param._have_pht)
-	  {
-    	rename = "out_PREDICT_PHT_HISTORY_"+toString(i);
-	out_PREDICT_PHT_HISTORY         [i] = new SC_OUT(Tpht_history_t) (rename.c_str());
-	  }
-
-	if (_param._have_bht)
-	  {
-	rename = "signal_PREDICT_BHT_ACK_"    +toString(i);
-	signal_PREDICT_BHT_ACK          [i] = new SC_SIGNAL(Tcontrol_t)     (rename.c_str());
-
-	rename = "signal_PREDICT_BHT_ADDRESS_"+toString(i);
-	signal_PREDICT_BHT_ADDRESS      [i] = new SC_SIGNAL(Taddress_t)     (rename.c_str());
-	  }
-
-	if (_param._have_pht)
-	  {
-	rename = "signal_PREDICT_PHT_ACK_"    +toString(i);
-	signal_PREDICT_PHT_ACK          [i] = new SC_SIGNAL(Tcontrol_t)     (rename.c_str());
-
-	rename = "signal_PREDICT_PHT_ADDRESS_"+toString(i);
-	signal_PREDICT_PHT_ADDRESS      [i] = new SC_SIGNAL(Taddress_t)     (rename.c_str());
-	  }
-      }
+	out_PREDICT_PHT_HISTORY         [i] = interface->set_signal_out <Tpht_history_t> ("pht_history", _param._pht_size_counter);
+      }
+
+    // ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
      in_BRANCH_COMPLETE_VAL         = new SC_IN (Tcontrol_t)     * [_param._nb_branch_complete];
@@ -93,54 +86,15 @@
      in_BRANCH_COMPLETE_PHT_HISTORY = new SC_IN (Tpht_history_t) * [_param._nb_branch_complete];
      in_BRANCH_COMPLETE_DIRECTION   = new SC_IN (Tcontrol_t)     * [_param._nb_branch_complete];
-    if (_param._have_bht)
-      {
-    signal_BRANCH_COMPLETE_BHT_ACK     = new SC_SIGNAL(Tcontrol_t) * [_param._nb_branch_complete];
-    signal_BRANCH_COMPLETE_BHT_ADDRESS = new SC_SIGNAL(Taddress_t) * [_param._nb_branch_complete]; 
-      }
-    if (_param._have_pht)
-      {
-    signal_BRANCH_COMPLETE_PHT_ACK     = new SC_SIGNAL(Tcontrol_t) * [_param._nb_branch_complete];
-    signal_BRANCH_COMPLETE_PHT_ADDRESS = new SC_SIGNAL(Taddress_t) * [_param._nb_branch_complete]; 
-      }
 
     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
       {
-	rename = "in_BRANCH_COMPLETE_VAL_"         +toString(i);
-	 in_BRANCH_COMPLETE_VAL         [i] = new SC_IN (Tcontrol_t)     (rename.c_str());
-
-	rename = "out_BRANCH_COMPLETE_ACK_"        +toString(i);
-	out_BRANCH_COMPLETE_ACK         [i] = new SC_OUT(Tcontrol_t)     (rename.c_str());
-
-	rename = "in_BRANCH_COMPLETE_ADDRESS_"     +toString(i);
-	 in_BRANCH_COMPLETE_ADDRESS     [i] = new SC_IN (Taddress_t)     (rename.c_str());
-
+	 in_BRANCH_COMPLETE_VAL         [i] = new interface->set_signal_valack_in            ("val"        , VAL);		   
+	out_BRANCH_COMPLETE_ACK         [i] = new interface->set_signal_valack_out           ("ack"        , ACK);		   
+	 in_BRANCH_COMPLETE_ADDRESS     [i] = new interface->set_signal_in  <Taddress_t    > ("address"    , _param._size_address);
 	if (_param._have_bht)
-	  {
-    	rename = "in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i);
-	 in_BRANCH_COMPLETE_BHT_HISTORY [i] = new SC_IN (Tbht_history_t) (rename.c_str());
-	  }
+	 in_BRANCH_COMPLETE_BHT_HISTORY [i] = new interface->set_signal_in  <Tbht_history_t> ("bht_history", _param._bht_size_shifter);
 	if (_param._have_pht)
-	  {
-	rename = "in_BRANCH_COMPLETE_PHT_HISTORY_"+toString(i);
-	 in_BRANCH_COMPLETE_PHT_HISTORY [i] = new SC_IN (Tpht_history_t) (rename.c_str());
-	  }
-	rename = "in_BRANCH_COMPLETE_DIRECTION_"  +toString(i);
-	 in_BRANCH_COMPLETE_DIRECTION   [i] = new SC_IN (Tcontrol_t)     (rename.c_str());
-	if (_param._have_bht)
-	  {
-	rename = "signal_BRANCH_COMPLETE_BHT_ACK_"    +toString(i);
-	signal_BRANCH_COMPLETE_BHT_ACK     [i] = new SC_SIGNAL(Tcontrol_t) (rename.c_str());
-
-	rename = "signal_BRANCH_COMPLETE_BHT_ADDRESS_"+toString(i); 
-	signal_BRANCH_COMPLETE_BHT_ADDRESS [i] = new SC_SIGNAL(Taddress_t) (rename.c_str()); 
-	  }
-	if (_param._have_pht)
-	  {
-	rename = "signal_BRANCH_COMPLETE_PHT_ACK_"    +toString(i);
-	signal_BRANCH_COMPLETE_PHT_ACK     [i] = new SC_SIGNAL(Tcontrol_t) (rename.c_str());
-
-	rename = "signal_BRANCH_COMPLETE_PHT_ADDRESS_"+toString(i); 
-	signal_BRANCH_COMPLETE_PHT_ADDRESS [i] = new SC_SIGNAL(Taddress_t) (rename.c_str()); 
-	  }
+	 in_BRANCH_COMPLETE_PHT_HISTORY [i] = new interface->set_signal_in  <Tpht_history_t> ("pht_history", _param._pht_size_counter);
+	 in_BRANCH_COMPLETE_DIRECTION   [i] = new interface->set_signal_in  <Tcontrol_t    > ("direction"  , 1);
       }
 
@@ -152,35 +106,21 @@
       {
 	name_component = _name+"_Branch_History_Table";
-
-	log_printf(INFO,Two_Level_Branch_Predictor,"allocation","Allocation : %s",name_component.c_str());
-	
-	component_Branch_History_Table = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::branch_history_table ::Branch_History_Table (name_component.c_str()               ,
+	
+	component_Branch_History_Table = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::branch_history_table ::Branch_History_Table (name_component.c_str()
 #ifdef STATISTICS
-																						       _param_statistics                    ,
-#endif
-																						       *(_param._param_branch_history_table));
-	
-	// Instantiation
-	(*(component_Branch_History_Table->in_CLOCK ))        (*(in_CLOCK ));
-	(*(component_Branch_History_Table->in_NRESET))        (*(in_NRESET));
-
-	for (uint32_t i=0; i<_param._nb_prediction; i++)
-	  {
-	    (*(component_Branch_History_Table-> in_PREDICT_VAL             [i]))    (*(    in_PREDICT_VAL          [i]));
-	    (*(component_Branch_History_Table->out_PREDICT_ACK             [i]))    (*(signal_PREDICT_BHT_ACK      [i]));
-	    (*(component_Branch_History_Table-> in_PREDICT_ADDRESS         [i]))    (*(signal_PREDICT_BHT_ADDRESS  [i]));
-	    (*(component_Branch_History_Table->out_PREDICT_HISTORY         [i]))    (*(   out_PREDICT_BHT_HISTORY  [i]));
-	  }
-	
-	for (uint32_t i=0; i<_param._nb_branch_complete; i++)
-	  {
-	    (*(component_Branch_History_Table-> in_BRANCH_COMPLETE_VAL       [i]))    (*(    in_BRANCH_COMPLETE_VAL         [i]));
-	    (*(component_Branch_History_Table->out_BRANCH_COMPLETE_ACK       [i]))    (*(signal_BRANCH_COMPLETE_BHT_ACK     [i]));
-	    (*(component_Branch_History_Table-> in_BRANCH_COMPLETE_ADDRESS   [i]))    (*(signal_BRANCH_COMPLETE_BHT_ADDRESS [i]));
-	    (*(component_Branch_History_Table-> in_BRANCH_COMPLETE_HISTORY   [i]))    (*(    in_BRANCH_COMPLETE_BHT_HISTORY [i]));
-	    (*(component_Branch_History_Table-> in_BRANCH_COMPLETE_DIRECTION [i]))    (*(    in_BRANCH_COMPLETE_DIRECTION   [i]));
-	  }
-      }
-
+																						       ,_param_statistics
+#endif
+																						       ,*(_param._param_counter));
+	
+	_component->set_component (component_Branch_History_Table->_component
+#ifdef POSITION
+				   , 75
+				   , 25
+				   , 10
+				   , 10
+#endif
+				   );
+      }
+    
     // =====[ component_Pattern_History_Table ]===========================    
     if (_param._have_pht)
@@ -188,68 +128,140 @@
 	name_component = _name+"_Pattern_History_Table";
 	
-	log_printf(INFO,Two_Level_Branch_Predictor,"allocation","Allocation : %s",name_component.c_str());
-	
-	component_Pattern_History_Table = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::pattern_history_table::Pattern_History_Table (name_component.c_str()               ,
+	component_Pattern_History_Table = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::pattern_history_table ::Pattern_History_Table (name_component.c_str()
 #ifdef STATISTICS
-																							 _param_statistics                    ,
-#endif
-																							 *(_param._param_pattern_history_table));
-	
-	// Instantiation
-	(*(component_Pattern_History_Table->in_CLOCK))        (*(in_CLOCK));
-	(*(component_Pattern_History_Table->in_NRESET))       (*(in_NRESET));
-	
+																							  ,_param_statistics
+#endif
+																							  ,*(_param._param_counter));
+	
+	_component->set_component (component_Pattern_History_Table->_component
+#ifdef POSITION
+				   , 75
+				   , 75
+				   , 10
+				   , 10
+#endif
+				   );
+      }
+
+    // =====[ component_Two_Level_Branch_Predictor_Glue ]=================
+
+    name_component = _name+"_Two_Level_Branch_Predictor_Glue";
+
+    component_Two_Level_Branch_Predictor_Glue = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::two_level_branch_predictor_glue::Two_Level_Branch_Predictor_Glue (name_component.c_str()
+#ifdef STATISTICS
+																										   ,_param_statistics
+#endif
+																										   ,*(_param._param_counter));
+    
+    _component->set_component (component_Pattern_History_Table->_component
+#ifdef POSITION
+			       , 50
+			       , 75
+			       , 10
+			       , 10
+#endif
+			       );
+    
+    // ~~~~~[ Component - Instanciation ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+    
+    // =====[ component_Branch_History_Table - Instanciation ]============
+    if (_param._have_bht)
+      {
+#ifdef POSITION
+	_component->interface_map (_name+"_Branch_History_Table","",
+				   _name                        ,"");
+#endif
+	
+	_component->port_map(_name+"_Branch_History_Table", "in_CLOCK" , _name,"in_CLOCK" );
+	_component->port_map(_name+"_Branch_History_Table", "in_NRESET", _name,"in_NRESET");
+
 	for (uint32_t i=0; i<_param._nb_prediction; i++)
 	  {
-	    (*(component_Pattern_History_Table-> in_PREDICT_VAL             [i]))    (*(    in_PREDICT_VAL          [i]));
-	    (*(component_Pattern_History_Table->out_PREDICT_ACK             [i]))    (*(signal_PREDICT_PHT_ACK      [i]));
-	    (*(component_Pattern_History_Table-> in_PREDICT_ADDRESS         [i]))    (*(signal_PREDICT_PHT_ADDRESS  [i]));
-	    (*(component_Pattern_History_Table->out_PREDICT_HISTORY         [i]))    (*(   out_PREDICT_PHT_HISTORY  [i]));
+#ifdef POSITION
+	    _component->interface_map (_name+"_Branch_History_Table","predict_"+toString(i),
+				       _name                        ,"predict_"+toString(i));
+#endif
+	    _component->port_map(_name+"_Branch_History_Table", "in_PREDICT_"+toString(i)+"_VAL"    , _name                                   , "in_PREDICT_"+toString(i)+"_VAL"        );
+	    _component->port_map(_name+"_Branch_History_Table","out_PREDICT_"+toString(i)+"_ACK"    , _name+"_Two_Level_Branch_Predictor_Glue", "in_PREDICT_"+toString(i)+"_BHT_ACK"    );
+	    _component->port_map(_name+"_Branch_History_Table", "in_PREDICT_"+toString(i)+"_ADDRESS", _name+"_Two_Level_Branch_Predictor_Glue","out_PREDICT_"+toString(i)+"_BHT_ADDRESS");
+	    _component->port_map(_name+"_Branch_History_Table","out_PREDICT_"+toString(i)+"_HISTORY", _name                                   ,"out_PREDICT_"+toString(i)+"_BHT_HISTORY");
 	  }
 	
 	for (uint32_t i=0; i<_param._nb_branch_complete; i++)
 	  {
-	    (*(component_Pattern_History_Table-> in_BRANCH_COMPLETE_VAL       [i]))    (*(    in_BRANCH_COMPLETE_VAL         [i]));
-	    (*(component_Pattern_History_Table->out_BRANCH_COMPLETE_ACK       [i]))    (*(signal_BRANCH_COMPLETE_PHT_ACK     [i]));
-	    (*(component_Pattern_History_Table-> in_BRANCH_COMPLETE_ADDRESS   [i]))    (*(signal_BRANCH_COMPLETE_PHT_ADDRESS [i]));
-	    (*(component_Pattern_History_Table-> in_BRANCH_COMPLETE_HISTORY   [i]))    (*(    in_BRANCH_COMPLETE_PHT_HISTORY [i]));
-	    (*(component_Pattern_History_Table-> in_BRANCH_COMPLETE_DIRECTION [i]))    (*(    in_BRANCH_COMPLETE_DIRECTION   [i]));
-	  }
-      }
-
-    // =====[ component_Two_Level_Branch_Predictor_Glue ]===========================    
-    name_component = _name+"_Two_Level_Branch_Predictor_Glue";
-    
-    log_printf(INFO,Two_Level_Branch_Predictor,"allocation","Allocation : %s",name_component.c_str());
-    
-    component_Two_Level_Branch_Predictor_Glue = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::two_level_branch_predictor_glue::Two_Level_Branch_Predictor_Glue (name_component.c_str()               ,
-#ifdef STATISTICS
-																										   _param_statistics                    ,
-#endif
-																										   *(_param._param_two_level_branch_predictor_glue));
-    
-    // Instantiation
-#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
-    (*(component_Two_Level_Branch_Predictor_Glue->in_CLOCK))        (*(in_CLOCK));
-#endif	
-    for (uint32_t i=0; i<_param._nb_prediction; i++)
-      {
+#ifdef POSITION
+	    _component->interface_map (_name+"_Branch_History_Table","branch_complete_"+toString(i),
+				       _name                        ,"branch_complete_"+toString(i));
+#endif
+	    _component->port_map(_name+"_Branch_History_Table", "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"      , _name                                   , "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"          );
+	    _component->port_map(_name+"_Branch_History_Table","out_BRANCH_COMPLETE_"+toString(i)+"_ACK"      , _name+"_Two_Level_Branch_Predictor_Glue", "in_BRANCH_COMPLETE_"+toString(i)+"_BHT_ACK"      );
+	    _component->port_map(_name+"_Branch_History_Table", "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"  , _name+"_Two_Level_Branch_Predictor_Glue","out_BRANCH_COMPLETE_"+toString(i)+"_BHT_ADDRESS"  );
+	    _component->port_map(_name+"_Branch_History_Table", "in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY"  , _name                                   , "in_BRANCH_COMPLETE_"+toString(i)+"_BHT_HISTORY"  );
+	    _component->port_map(_name+"_Branch_History_Table", "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION", _name                                   , "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION"    );
+	  }
+      }
+    
+    // =====[ component_Pattern_History_Table - Instanciation ]===========
+    if (_param._have_pht)
+      {
+#ifdef POSITION
+	_component->interface_map (_name+"_Pattern_History_Table","",
+				   _name                         ,"");
+#endif
+	
+	_component->port_map(_name+"_Pattern_History_Table", "in_CLOCK" , _name,"in_CLOCK" );
+	_component->port_map(_name+"_Pattern_History_Table", "in_NRESET", _name,"in_NRESET");
+
+	for (uint32_t i=0; i<_param._nb_prediction; i++)
+	  {
+#ifdef POSITION
+	    _component->interface_map (_name+"_Pattern_History_Table","predict_"+toString(i),
+				       _name                         ,"predict_"+toString(i));
+#endif
+	    _component->port_map(_name+"_Pattern_History_Table", "in_PREDICT_"+toString(i)+"_VAL"    , _name                                   , "in_PREDICT_"+toString(i)+"_VAL"        );
+	    _component->port_map(_name+"_Pattern_History_Table","out_PREDICT_"+toString(i)+"_ACK"    , _name+"_Two_Level_Branch_Predictor_Glue", "in_PREDICT_"+toString(i)+"_PHT_ACK"    );
+	    _component->port_map(_name+"_Pattern_History_Table", "in_PREDICT_"+toString(i)+"_ADDRESS", _name+"_Two_Level_Branch_Predictor_Glue","out_PREDICT_"+toString(i)+"_PHT_ADDRESS");
+	    _component->port_map(_name+"_Pattern_History_Table","out_PREDICT_"+toString(i)+"_HISTORY", _name                                   ,"out_PREDICT_"+toString(i)+"_PHT_HISTORY");
+	  }
+	
+	for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+	  {
+#ifdef POSITION
+	    _component->interface_map (_name+"_Pattern_History_Table","branch_complete_"+toString(i),
+				       _name                        ,"branch_complete_"+toString(i));
+#endif
+	    _component->port_map(_name+"_Pattern_History_Table", "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"      , _name                                   , "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"          );
+	    _component->port_map(_name+"_Pattern_History_Table","out_BRANCH_COMPLETE_"+toString(i)+"_ACK"      , _name+"_Two_Level_Branch_Predictor_Glue", "in_BRANCH_COMPLETE_"+toString(i)+"_PHT_ACK"      );
+	    _component->port_map(_name+"_Pattern_History_Table", "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"  , _name+"_Two_Level_Branch_Predictor_Glue","out_BRANCH_COMPLETE_"+toString(i)+"_PHT_ADDRESS"  );
+	    _component->port_map(_name+"_Pattern_History_Table", "in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY"  , _name                                   , "in_BRANCH_COMPLETE_"+toString(i)+"_PHT_HISTORY"  );
+	    _component->port_map(_name+"_Pattern_History_Table", "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION", _name                                   , "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION"    );
+	  }
+      }
+
+    // =====[ component_Two_Level_Branch_Predictor_Glue - Instanciation ]=
+#ifdef POSITION
+	_component->interface_map (_name+"_Two_Level_Branch_Predictor_Glue","",
+				   _name                                   ,"");
+#endif
+	_component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "in_CLOCK" , _name,"in_CLOCK" );
+	_component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "in_NRESET", _name,"in_NRESET");
+
+	for (uint32_t i=0; i<_param._nb_prediction; i++)
+	  {
 	if (_param._have_bht)
 	  {
-	    (*(component_Two_Level_Branch_Predictor_Glue-> in_PREDICT_BHT_ACK             [i])) (*(signal_PREDICT_BHT_ACK              [i]));
-	    (*(component_Two_Level_Branch_Predictor_Glue->out_PREDICT_BHT_ADDRESS         [i])) (*(signal_PREDICT_BHT_ADDRESS          [i]));
-	  }											   										  
-	if (_param._have_pht)								   							  
-	  {											   										  
-	    (*(component_Two_Level_Branch_Predictor_Glue-> in_PREDICT_PHT_ACK             [i])) (*(signal_PREDICT_PHT_ACK              [i]));
-	    (*(component_Two_Level_Branch_Predictor_Glue->out_PREDICT_PHT_ADDRESS         [i])) (*(signal_PREDICT_PHT_ADDRESS          [i]));
-	  }											   										  
-	if (_param._have_bht and _param._have_pht)						   					  
-	  {											   										  
-	    (*(component_Two_Level_Branch_Predictor_Glue-> in_PREDICT_BHT_HISTORY         [i])) (*(   out_PREDICT_BHT_HISTORY          [i]));
-	  }											   										  
-	(*(component_Two_Level_Branch_Predictor_Glue->out_PREDICT_ACK                 [i])) (*(   out_PREDICT_ACK                  [i]));
-	(*(component_Two_Level_Branch_Predictor_Glue-> in_PREDICT_ADDRESS             [i])) (*(    in_PREDICT_ADDRESS              [i]));
-      }
+	_component->port_map(_name+"_Two_Level_Branch_Predictor_Glue",  "in_PREDICT_"+toString(i)+"_BHT_ACK"    , _name+"_Branch_History_Table" , "out_PREDICT_"+toString(i)+"_BHT_ACK"    );
+	_component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "out_PREDICT_"+toString(i)+"_BHT_ADDRESS", _name+"_Branch_History_Table" ,  "in_PREDICT_"+toString(i)+"_BHT_ADDRESS");
+	  }
+	if (_param._have_pht)
+	  {
+	_component->port_map(_name+"_Two_Level_Branch_Predictor_Glue",  "in_PREDICT_"+toString(i)+"_PHT_ACK"    , _name+"_Pattern_History_Table", "out_PREDICT_"+toString(i)+"_PHT_ACK"    );
+	_component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "out_PREDICT_"+toString(i)+"_PHT_ADDRESS", _name+"_Pattern_History_Table",  "in_PREDICT_"+toString(i)+"_PHT_ADDRESS");
+	  }
+	if (_param._have_bht and _param._have_pht)
+	_component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "in_PREDICT_"+toString(i)+"_BHT_HISTORY" , _name                         , "in_PREDICT_"+toString(i)+"_BHT_HISTORY");
+	_component->port_map(_name+"_Two_Level_Branch_Predictor_Glue","out_PREDICT_"+toString(i)+"_ACK"         , _name                         ,"out_PREDICT_"+toString(i)+"_ACK");
+        _component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "in_PREDICT_"+toString(i)+"_ADDRESS"     , _name                         , "in_PREDICT_"+toString(i)+"_ADDRESS");
+	  }
     
     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
@@ -257,22 +269,314 @@
 	if (_param._have_bht)
 	  {
-	    (*(component_Two_Level_Branch_Predictor_Glue-> in_BRANCH_COMPLETE_BHT_ACK     [i])) (*(signal_BRANCH_COMPLETE_BHT_ACK      [i]));
-	    (*(component_Two_Level_Branch_Predictor_Glue->out_BRANCH_COMPLETE_BHT_ADDRESS [i])) (*(signal_BRANCH_COMPLETE_BHT_ADDRESS  [i]));
-	  }										   					       				  
-	if (_param._have_pht)							   					       	  
-	  {										   					       				  
-	    (*(component_Two_Level_Branch_Predictor_Glue-> in_BRANCH_COMPLETE_PHT_ACK     [i])) (*(signal_BRANCH_COMPLETE_PHT_ACK      [i]));
-	    (*(component_Two_Level_Branch_Predictor_Glue->out_BRANCH_COMPLETE_PHT_ADDRESS [i])) (*(signal_BRANCH_COMPLETE_PHT_ADDRESS  [i]));
-	  }										   					       				  
-	if (_param._have_bht and _param._have_pht)					   					  
-	  {										   					       				  
-	    (*(component_Two_Level_Branch_Predictor_Glue-> in_BRANCH_COMPLETE_BHT_HISTORY [i])) (*(    in_BRANCH_COMPLETE_BHT_HISTORY  [i]));
-	  }										   					       				  
-	(*(component_Two_Level_Branch_Predictor_Glue->out_BRANCH_COMPLETE_ACK         [i])) (*(   out_BRANCH_COMPLETE_ACK          [i]));
-	(*(component_Two_Level_Branch_Predictor_Glue-> in_BRANCH_COMPLETE_ADDRESS     [i])) (*(    in_BRANCH_COMPLETE_ADDRESS      [i]));
+	_component->port_map(_name+"_Two_Level_Branch_Predictor_Glue",  "in_BRANCH_COMPLETE_"+toString(i)+"_BHT_ACK"    , _name+"_Branch_History_Table" , "out_BRANCH_COMPLETE_"+toString(i)+"_BHT_ACK"    );
+	_component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "out_BRANCH_COMPLETE_"+toString(i)+"_BHT_ADDRESS", _name+"_Branch_History_Table" ,  "in_BRANCH_COMPLETE_"+toString(i)+"_BHT_ADDRESS");
+	  }
+	if (_param._have_pht)
+	  {
+	_component->port_map(_name+"_Two_Level_Branch_Predictor_Glue",  "in_BRANCH_COMPLETE_"+toString(i)+"_PHT_ACK"    , _name+"_Pattern_History_Table", "out_BRANCH_COMPLETE_"+toString(i)+"_PHT_ACK"    );
+	_component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "out_BRANCH_COMPLETE_"+toString(i)+"_PHT_ADDRESS", _name+"_Pattern_History_Table",  "in_BRANCH_COMPLETE_"+toString(i)+"_PHT_ADDRESS");
+	  }
+	if (_param._have_bht and _param._have_pht)
+	_component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "in_BRANCH_COMPLETE_"+toString(i)+"_BHT_HISTORY" , _name                         , "in_BRANCH_COMPLETE_"+toString(i)+"_BHT_HISTORY");
+	_component->port_map(_name+"_Two_Level_Branch_Predictor_Glue","out_BRANCH_COMPLETE_"+toString(i)+"_ACK"         , _name                         ,"out_BRANCH_COMPLETE_"+toString(i)+"_ACK");
+        _component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"     , _name                         , "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS");
       }
   
+#ifdef POSITION
+    _component->generate_file();
+#endif
+
     log_printf(FUNC,Two_Level_Branch_Predictor,"allocation","End");
   };
+
+
+
+
+
+
+
+//   void Two_Level_Branch_Predictor::allocation (void)
+//   {
+//     string rename;
+
+//     log_printf(FUNC,Two_Level_Branch_Predictor,"allocation","Begin");
+
+//     _component   = new Component ();
+
+//     Entity * entity = _component->set_entity (_name                 
+// #ifdef POSITION
+// 					     ,"Two_Level_Branch_Predictor"
+// 					     ,MIXTE
+// #endif
+// 					      );
+    
+//     _interfaces = entity->set_interfaces();
+
+//     // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//     {
+//       Interface * interface = _interfaces->set_interface(""
+// #ifdef POSITION
+// 							 , IN  
+// 							 , SOUTH
+// 							 , "Generalist interface"
+// #endif
+// 							 );
+      
+//       in_CLOCK              = interface->set_signal_clk              ("clock" ,1);
+//       in_NRESET             = interface->set_signal_in  <Tcontrol_t> ("nreset",1,RESET_VHDL_YES);
+//     }
+    
+//     // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+//      in_PREDICT_VAL                 = new SC_IN (Tcontrol_t)     * [_param._nb_prediction     ];
+//     out_PREDICT_ACK                 = new SC_OUT(Tcontrol_t)     * [_param._nb_prediction     ];
+//      in_PREDICT_ADDRESS             = new SC_IN (Taddress_t)     * [_param._nb_prediction     ];
+//     if (_param._have_bht)
+//     out_PREDICT_BHT_HISTORY         = new SC_OUT(Tbht_history_t) * [_param._nb_prediction     ];
+//     if (_param._have_pht)
+//     out_PREDICT_PHT_HISTORY         = new SC_OUT(Tpht_history_t) * [_param._nb_prediction     ];
+// //     if (_param._have_bht)
+// //       {
+// //     signal_PREDICT_BHT_ACK          = new SC_SIGNAL(Tcontrol_t)     * [_param._nb_prediction];
+// //     signal_PREDICT_BHT_ADDRESS      = new SC_SIGNAL(Taddress_t)     * [_param._nb_prediction];
+// //       }
+// //     if (_param._have_pht)
+// //       {
+// //     signal_PREDICT_PHT_ACK          = new SC_SIGNAL(Tcontrol_t)     * [_param._nb_prediction];
+// //     signal_PREDICT_PHT_ADDRESS      = new SC_SIGNAL(Taddress_t)     * [_param._nb_prediction];
+// //       }
+
+//     for (uint32_t i=0; i<_param._nb_prediction; i++)
+//       {
+// 	rename = "in_PREDICT_VAL_"         +toString(i);
+// 	 in_PREDICT_VAL                 [i] = new SC_IN (Tcontrol_t)     (rename.c_str());
+
+// 	rename = "out_PREDICT_ACK_"        +toString(i);
+// 	out_PREDICT_ACK                 [i] = new SC_OUT(Tcontrol_t)     (rename.c_str());
+
+// 	rename = "in_PREDICT_ADDRESS_"     +toString(i);
+// 	 in_PREDICT_ADDRESS             [i] = new SC_IN (Taddress_t)     (rename.c_str());
+
+// 	if (_param._have_bht)
+// 	  {
+// 	rename = "out_PREDICT_BHT_HISTORY_"+toString(i);
+// 	out_PREDICT_BHT_HISTORY         [i] = new SC_OUT(Tbht_history_t) (rename.c_str());
+// 	  }
+
+// 	if (_param._have_pht)
+// 	  {
+//     	rename = "out_PREDICT_PHT_HISTORY_"+toString(i);
+// 	out_PREDICT_PHT_HISTORY         [i] = new SC_OUT(Tpht_history_t) (rename.c_str());
+// 	  }
+
+// // 	if (_param._have_bht)
+// // 	  {
+// // 	rename = "signal_PREDICT_BHT_ACK_"    +toString(i);
+// // 	signal_PREDICT_BHT_ACK          [i] = new SC_SIGNAL(Tcontrol_t)     (rename.c_str());
+
+// // 	rename = "signal_PREDICT_BHT_ADDRESS_"+toString(i);
+// // 	signal_PREDICT_BHT_ADDRESS      [i] = new SC_SIGNAL(Taddress_t)     (rename.c_str());
+// // 	  }
+
+// // 	if (_param._have_pht)
+// // 	  {
+// // 	rename = "signal_PREDICT_PHT_ACK_"    +toString(i);
+// // 	signal_PREDICT_PHT_ACK          [i] = new SC_SIGNAL(Tcontrol_t)     (rename.c_str());
+
+// // 	rename = "signal_PREDICT_PHT_ADDRESS_"+toString(i);
+// // 	signal_PREDICT_PHT_ADDRESS      [i] = new SC_SIGNAL(Taddress_t)     (rename.c_str());
+// // 	  }
+//       }
+
+//      in_BRANCH_COMPLETE_VAL         = new SC_IN (Tcontrol_t)     * [_param._nb_branch_complete];
+//     out_BRANCH_COMPLETE_ACK         = new SC_OUT(Tcontrol_t)     * [_param._nb_branch_complete];
+//      in_BRANCH_COMPLETE_ADDRESS     = new SC_IN (Taddress_t)     * [_param._nb_branch_complete];
+//     if (_param._have_bht)
+//      in_BRANCH_COMPLETE_BHT_HISTORY = new SC_IN (Tbht_history_t) * [_param._nb_branch_complete];
+//     if (_param._have_pht)
+//      in_BRANCH_COMPLETE_PHT_HISTORY = new SC_IN (Tpht_history_t) * [_param._nb_branch_complete];
+//      in_BRANCH_COMPLETE_DIRECTION   = new SC_IN (Tcontrol_t)     * [_param._nb_branch_complete];
+// //     if (_param._have_bht)
+// //       {
+// //     signal_BRANCH_COMPLETE_BHT_ACK     = new SC_SIGNAL(Tcontrol_t) * [_param._nb_branch_complete];
+// //     signal_BRANCH_COMPLETE_BHT_ADDRESS = new SC_SIGNAL(Taddress_t) * [_param._nb_branch_complete]; 
+// //       }
+// //     if (_param._have_pht)
+// //       {
+// //     signal_BRANCH_COMPLETE_PHT_ACK     = new SC_SIGNAL(Tcontrol_t) * [_param._nb_branch_complete];
+// //     signal_BRANCH_COMPLETE_PHT_ADDRESS = new SC_SIGNAL(Taddress_t) * [_param._nb_branch_complete]; 
+// //       }
+
+//     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+//       {
+// 	rename = "in_BRANCH_COMPLETE_VAL_"         +toString(i);
+// 	 in_BRANCH_COMPLETE_VAL         [i] = new SC_IN (Tcontrol_t)     (rename.c_str());
+
+// 	rename = "out_BRANCH_COMPLETE_ACK_"        +toString(i);
+// 	out_BRANCH_COMPLETE_ACK         [i] = new SC_OUT(Tcontrol_t)     (rename.c_str());
+
+// 	rename = "in_BRANCH_COMPLETE_ADDRESS_"     +toString(i);
+// 	 in_BRANCH_COMPLETE_ADDRESS     [i] = new SC_IN (Taddress_t)     (rename.c_str());
+
+// 	if (_param._have_bht)
+// 	  {
+//     	rename = "in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i);
+// 	 in_BRANCH_COMPLETE_BHT_HISTORY [i] = new SC_IN (Tbht_history_t) (rename.c_str());
+// 	  }
+// 	if (_param._have_pht)
+// 	  {
+// 	rename = "in_BRANCH_COMPLETE_PHT_HISTORY_"+toString(i);
+// 	 in_BRANCH_COMPLETE_PHT_HISTORY [i] = new SC_IN (Tpht_history_t) (rename.c_str());
+// 	  }
+// 	rename = "in_BRANCH_COMPLETE_DIRECTION_"  +toString(i);
+// 	 in_BRANCH_COMPLETE_DIRECTION   [i] = new SC_IN (Tcontrol_t)     (rename.c_str());
+// // 	if (_param._have_bht)
+// // 	  {
+// // 	rename = "signal_BRANCH_COMPLETE_BHT_ACK_"    +toString(i);
+// // 	signal_BRANCH_COMPLETE_BHT_ACK     [i] = new SC_SIGNAL(Tcontrol_t) (rename.c_str());
+
+// // 	rename = "signal_BRANCH_COMPLETE_BHT_ADDRESS_"+toString(i); 
+// // 	signal_BRANCH_COMPLETE_BHT_ADDRESS [i] = new SC_SIGNAL(Taddress_t) (rename.c_str()); 
+// // 	  }
+// // 	if (_param._have_pht)
+// // 	  {
+// // 	rename = "signal_BRANCH_COMPLETE_PHT_ACK_"    +toString(i);
+// // 	signal_BRANCH_COMPLETE_PHT_ACK     [i] = new SC_SIGNAL(Tcontrol_t) (rename.c_str());
+
+// // 	rename = "signal_BRANCH_COMPLETE_PHT_ADDRESS_"+toString(i); 
+// // 	signal_BRANCH_COMPLETE_PHT_ADDRESS [i] = new SC_SIGNAL(Taddress_t) (rename.c_str()); 
+// // 	  }
+//       }
+
+//     // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
+//     string name_component;
+
+//     // =====[ component_Branch_History_Table ]============================    
+//     if (_param._have_bht)
+//       {
+// 	name_component = _name+"_Branch_History_Table";
+
+// 	log_printf(INFO,Two_Level_Branch_Predictor,"allocation","Allocation : %s",name_component.c_str());
+	
+// 	component_Branch_History_Table = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::branch_history_table ::Branch_History_Table (name_component.c_str()               ,
+// #ifdef STATISTICS
+// 																						       _param_statistics                    ,
+// #endif
+// 																						       *(_param._param_branch_history_table));
+	
+// 	// Instantiation
+// 	(*(component_Branch_History_Table->in_CLOCK ))        (*(in_CLOCK ));
+// 	(*(component_Branch_History_Table->in_NRESET))        (*(in_NRESET));
+
+// 	for (uint32_t i=0; i<_param._nb_prediction; i++)
+// 	  {
+// 	    (*(component_Branch_History_Table-> in_PREDICT_VAL             [i]))    (*(    in_PREDICT_VAL          [i]));
+// 	    (*(component_Branch_History_Table->out_PREDICT_ACK             [i]))    (*(signal_PREDICT_BHT_ACK      [i]));
+// 	    (*(component_Branch_History_Table-> in_PREDICT_ADDRESS         [i]))    (*(signal_PREDICT_BHT_ADDRESS  [i]));
+// 	    (*(component_Branch_History_Table->out_PREDICT_HISTORY         [i]))    (*(   out_PREDICT_BHT_HISTORY  [i]));
+// 	  }
+	
+// 	for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+// 	  {
+// 	    (*(component_Branch_History_Table-> in_BRANCH_COMPLETE_VAL       [i]))    (*(    in_BRANCH_COMPLETE_VAL         [i]));
+// 	    (*(component_Branch_History_Table->out_BRANCH_COMPLETE_ACK       [i]))    (*(signal_BRANCH_COMPLETE_BHT_ACK     [i]));
+// 	    (*(component_Branch_History_Table-> in_BRANCH_COMPLETE_ADDRESS   [i]))    (*(signal_BRANCH_COMPLETE_BHT_ADDRESS [i]));
+// 	    (*(component_Branch_History_Table-> in_BRANCH_COMPLETE_HISTORY   [i]))    (*(    in_BRANCH_COMPLETE_BHT_HISTORY [i]));
+// 	    (*(component_Branch_History_Table-> in_BRANCH_COMPLETE_DIRECTION [i]))    (*(    in_BRANCH_COMPLETE_DIRECTION   [i]));
+// 	  }
+//       }
+
+//     // =====[ component_Pattern_History_Table ]===========================    
+//     if (_param._have_pht)
+//       {
+// 	name_component = _name+"_Pattern_History_Table";
+	
+// 	log_printf(INFO,Two_Level_Branch_Predictor,"allocation","Allocation : %s",name_component.c_str());
+	
+// 	component_Pattern_History_Table = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::pattern_history_table::Pattern_History_Table (name_component.c_str()               ,
+// #ifdef STATISTICS
+// 																							 _param_statistics                    ,
+// #endif
+// 																							 *(_param._param_pattern_history_table));
+	
+// 	// Instantiation
+// 	(*(component_Pattern_History_Table->in_CLOCK))        (*(in_CLOCK));
+// 	(*(component_Pattern_History_Table->in_NRESET))       (*(in_NRESET));
+	
+// 	for (uint32_t i=0; i<_param._nb_prediction; i++)
+// 	  {
+// 	    (*(component_Pattern_History_Table-> in_PREDICT_VAL             [i]))    (*(    in_PREDICT_VAL          [i]));
+// 	    (*(component_Pattern_History_Table->out_PREDICT_ACK             [i]))    (*(signal_PREDICT_PHT_ACK      [i]));
+// 	    (*(component_Pattern_History_Table-> in_PREDICT_ADDRESS         [i]))    (*(signal_PREDICT_PHT_ADDRESS  [i]));
+// 	    (*(component_Pattern_History_Table->out_PREDICT_HISTORY         [i]))    (*(   out_PREDICT_PHT_HISTORY  [i]));
+// 	  }
+	
+// 	for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+// 	  {
+// 	    (*(component_Pattern_History_Table-> in_BRANCH_COMPLETE_VAL       [i]))    (*(    in_BRANCH_COMPLETE_VAL         [i]));
+// 	    (*(component_Pattern_History_Table->out_BRANCH_COMPLETE_ACK       [i]))    (*(signal_BRANCH_COMPLETE_PHT_ACK     [i]));
+// 	    (*(component_Pattern_History_Table-> in_BRANCH_COMPLETE_ADDRESS   [i]))    (*(signal_BRANCH_COMPLETE_PHT_ADDRESS [i]));
+// 	    (*(component_Pattern_History_Table-> in_BRANCH_COMPLETE_HISTORY   [i]))    (*(    in_BRANCH_COMPLETE_PHT_HISTORY [i]));
+// 	    (*(component_Pattern_History_Table-> in_BRANCH_COMPLETE_DIRECTION [i]))    (*(    in_BRANCH_COMPLETE_DIRECTION   [i]));
+// 	  }
+//       }
+
+//     // =====[ component_Two_Level_Branch_Predictor_Glue ]===========================    
+//     name_component = _name+"_Two_Level_Branch_Predictor_Glue";
+    
+//     log_printf(INFO,Two_Level_Branch_Predictor,"allocation","Allocation : %s",name_component.c_str());
+    
+//     component_Two_Level_Branch_Predictor_Glue = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::two_level_branch_predictor_glue::Two_Level_Branch_Predictor_Glue (name_component.c_str()               ,
+// #ifdef STATISTICS
+// 																										   _param_statistics                    ,
+// #endif
+// 																										   *(_param._param_two_level_branch_predictor_glue));
+    
+//     // Instantiation
+// #if defined(STATISTICS) or defined(VHDL_TESTBENCH)
+//     (*(component_Two_Level_Branch_Predictor_Glue->in_CLOCK))        (*(in_CLOCK));
+// #endif	
+//     for (uint32_t i=0; i<_param._nb_prediction; i++)
+//       {
+// 	if (_param._have_bht)
+// 	  {
+// 	    (*(component_Two_Level_Branch_Predictor_Glue-> in_PREDICT_BHT_ACK             [i])) (*(signal_PREDICT_BHT_ACK              [i]));
+// 	    (*(component_Two_Level_Branch_Predictor_Glue->out_PREDICT_BHT_ADDRESS         [i])) (*(signal_PREDICT_BHT_ADDRESS          [i]));
+// 	  }											   										  
+// 	if (_param._have_pht)								   							  
+// 	  {											   										  
+// 	    (*(component_Two_Level_Branch_Predictor_Glue-> in_PREDICT_PHT_ACK             [i])) (*(signal_PREDICT_PHT_ACK              [i]));
+// 	    (*(component_Two_Level_Branch_Predictor_Glue->out_PREDICT_PHT_ADDRESS         [i])) (*(signal_PREDICT_PHT_ADDRESS          [i]));
+// 	  }											   										  
+// 	if (_param._have_bht and _param._have_pht)						   					  
+// 	  {											   										  
+// 	    (*(component_Two_Level_Branch_Predictor_Glue-> in_PREDICT_BHT_HISTORY         [i])) (*(   out_PREDICT_BHT_HISTORY          [i]));
+// 	  }											   										  
+// 	(*(component_Two_Level_Branch_Predictor_Glue->out_PREDICT_ACK                 [i])) (*(   out_PREDICT_ACK                  [i]));
+// 	(*(component_Two_Level_Branch_Predictor_Glue-> in_PREDICT_ADDRESS             [i])) (*(    in_PREDICT_ADDRESS              [i]));
+//       }
+    
+//     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+//       {
+// 	if (_param._have_bht)
+// 	  {
+// 	    (*(component_Two_Level_Branch_Predictor_Glue-> in_BRANCH_COMPLETE_BHT_ACK     [i])) (*(signal_BRANCH_COMPLETE_BHT_ACK      [i]));
+// 	    (*(component_Two_Level_Branch_Predictor_Glue->out_BRANCH_COMPLETE_BHT_ADDRESS [i])) (*(signal_BRANCH_COMPLETE_BHT_ADDRESS  [i]));
+// 	  }										   					       				  
+// 	if (_param._have_pht)							   					       	  
+// 	  {										   					       				  
+// 	    (*(component_Two_Level_Branch_Predictor_Glue-> in_BRANCH_COMPLETE_PHT_ACK     [i])) (*(signal_BRANCH_COMPLETE_PHT_ACK      [i]));
+// 	    (*(component_Two_Level_Branch_Predictor_Glue->out_BRANCH_COMPLETE_PHT_ADDRESS [i])) (*(signal_BRANCH_COMPLETE_PHT_ADDRESS  [i]));
+// 	  }										   					       				  
+// 	if (_param._have_bht and _param._have_pht)					   					  
+// 	  {										   					       				  
+// 	    (*(component_Two_Level_Branch_Predictor_Glue-> in_BRANCH_COMPLETE_BHT_HISTORY [i])) (*(    in_BRANCH_COMPLETE_BHT_HISTORY  [i]));
+// 	  }										   					       				  
+// 	(*(component_Two_Level_Branch_Predictor_Glue->out_BRANCH_COMPLETE_ACK         [i])) (*(   out_BRANCH_COMPLETE_ACK          [i]));
+// 	(*(component_Two_Level_Branch_Predictor_Glue-> in_BRANCH_COMPLETE_ADDRESS     [i])) (*(    in_BRANCH_COMPLETE_ADDRESS      [i]));
+//       }
+  
+//     log_printf(FUNC,Two_Level_Branch_Predictor,"allocation","End");
+//   };
   
 }; // end namespace two_level_branch_predictor
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_deallocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_deallocation.cpp	(revision 23)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_deallocation.cpp	(revision 42)
@@ -23,84 +23,20 @@
     delete in_NRESET;
 
-    for (uint32_t i=0; i<_param._nb_prediction; i++)
-      {
-	delete  in_PREDICT_VAL                 [i];
-	delete out_PREDICT_ACK                 [i];
-	delete  in_PREDICT_ADDRESS             [i];
-	if (_param._have_bht)
-	delete out_PREDICT_BHT_HISTORY         [i];
-	if (_param._have_pht)
-	delete out_PREDICT_PHT_HISTORY         [i];
-	if (_param._have_bht)
-	  {
-	delete signal_PREDICT_BHT_ACK          [i];
-	delete signal_PREDICT_BHT_ADDRESS      [i];
-	  }
-	if (_param._have_pht)
-	  {
-	delete signal_PREDICT_PHT_ACK          [i];
-	delete signal_PREDICT_PHT_ADDRESS      [i];
-	  }
+    delete []  in_PREDICT_VAL        ;
+    delete [] out_PREDICT_ACK        ;
+    delete []  in_PREDICT_ADDRESS    ;
+    if (_param._have_bht)
+    delete [] out_PREDICT_BHT_HISTORY;
+    if (_param._have_pht)
+    delete [] out_PREDICT_PHT_HISTORY;
 
-      }
-
-    delete  in_PREDICT_VAL        ;
-    delete out_PREDICT_ACK        ;
-    delete  in_PREDICT_ADDRESS    ;
+    delete []  in_BRANCH_COMPLETE_VAL        ;
+    delete [] out_BRANCH_COMPLETE_ACK        ;
+    delete []  in_BRANCH_COMPLETE_ADDRESS    ;
     if (_param._have_bht)
-    delete out_PREDICT_BHT_HISTORY;
+    delete []  in_BRANCH_COMPLETE_BHT_HISTORY;
     if (_param._have_pht)
-    delete out_PREDICT_PHT_HISTORY;
-    if (_param._have_bht)
-      {
-    delete signal_PREDICT_BHT_ACK    ;
-    delete signal_PREDICT_BHT_ADDRESS;
-      }
-    if (_param._have_pht)
-      {
-    delete signal_PREDICT_PHT_ACK    ;
-    delete signal_PREDICT_PHT_ADDRESS;
-      }
-
-    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
-      {
-	delete  in_BRANCH_COMPLETE_VAL         [i];
-	delete out_BRANCH_COMPLETE_ACK         [i];
-	delete  in_BRANCH_COMPLETE_ADDRESS     [i];
-	if (_param._have_bht)
-	delete  in_BRANCH_COMPLETE_BHT_HISTORY [i];
-	if (_param._have_pht)
-	delete  in_BRANCH_COMPLETE_PHT_HISTORY [i];
-	delete  in_BRANCH_COMPLETE_DIRECTION   [i];
-	if (_param._have_bht)
-	  {
-	delete signal_BRANCH_COMPLETE_BHT_ACK     [i];
-	delete signal_BRANCH_COMPLETE_BHT_ADDRESS [i]; 
-	  }
-	if (_param._have_pht)
-	  {
-	delete signal_BRANCH_COMPLETE_PHT_ACK     [i];
-	delete signal_BRANCH_COMPLETE_PHT_ADDRESS [i]; 
-	  }
-      }
-
-    delete  in_BRANCH_COMPLETE_VAL        ;
-    delete out_BRANCH_COMPLETE_ACK        ;
-    delete  in_BRANCH_COMPLETE_ADDRESS    ;
-    if (_param._have_bht)
-    delete  in_BRANCH_COMPLETE_BHT_HISTORY;
-    if (_param._have_pht)
-    delete  in_BRANCH_COMPLETE_PHT_HISTORY;
-    delete  in_BRANCH_COMPLETE_DIRECTION  ;
-    if (_param._have_bht)
-      {
-    delete signal_BRANCH_COMPLETE_BHT_ACK    ;
-    delete signal_BRANCH_COMPLETE_BHT_ADDRESS; 
-      }
-    if (_param._have_pht)
-      {
-    delete signal_BRANCH_COMPLETE_PHT_ACK    ;
-    delete signal_BRANCH_COMPLETE_PHT_ADDRESS; 
-      }
+    delete []  in_BRANCH_COMPLETE_PHT_HISTORY;
+    delete []  in_BRANCH_COMPLETE_DIRECTION  ;
 
     // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
@@ -111,4 +47,5 @@
     delete component_Pattern_History_Table;
     delete component_Two_Level_Branch_Predictor_Glue;
+    delete _component;
 
     log_printf(FUNC,Two_Level_Branch_Predictor,"deallocation","End");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl.cpp	(revision 23)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl.cpp	(revision 42)
@@ -21,12 +21,12 @@
   {
     log_printf(FUNC,Two_Level_Branch_Predictor,"vhdl","Begin");
-    Vhdl vhdl (_name);
+    Vhdl * vhdl = new Vhdl (_name);
 
-    vhdl.set_library_work (_name + "_Pack");
+    vhdl->set_library_work (_name + "_Pack");
     if (_param._have_bht)
-    vhdl.set_library_work (_name + "_Branch_History_Table_Pack");
+    vhdl->set_library_work (_name + "_Branch_History_Table_Pack");
     if (_param._have_pht)
-    vhdl.set_library_work (_name + "_Pattern_History_Table_Pack");
-    vhdl.set_library_work (_name + "_Two_Level_Branch_Predictor_Glue_Pack");
+    vhdl->set_library_work (_name + "_Pattern_History_Table_Pack");
+    vhdl->set_library_work (_name + "_Two_Level_Branch_Predictor_Glue_Pack");
     
     vhdl_port        (vhdl);
@@ -34,5 +34,8 @@
     vhdl_body        (vhdl);
 
-    vhdl.generate_file();
+    vhdl->generate_file();
+
+    delete vhdl;
+
     log_printf(FUNC,Two_Level_Branch_Predictor,"vhdl","End");
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl_body.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl_body.cpp	(revision 23)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl_body.cpp	(revision 42)
@@ -17,5 +17,5 @@
 
 
-  void Two_Level_Branch_Predictor::vhdl_body (Vhdl & vhdl)
+  void Two_Level_Branch_Predictor::vhdl_body (Vhdl * & vhdl)
   {
     log_printf(FUNC,Two_Level_Branch_Predictor,"vhdl_body","Begin");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl_declaration.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl_declaration.cpp	(revision 23)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl_declaration.cpp	(revision 42)
@@ -17,5 +17,5 @@
 
 
-  void Two_Level_Branch_Predictor::vhdl_declaration (Vhdl & vhdl)
+  void Two_Level_Branch_Predictor::vhdl_declaration (Vhdl * & vhdl)
   {
     log_printf(FUNC,Two_Level_Branch_Predictor,"vhdl_declaration","Begin");
@@ -25,12 +25,12 @@
 	if (_param._have_bht)
 	  {
-	vhdl.set_signal  ("signal_PREDICT_BHT_ACK_"+toString(i), 1);
-	vhdl.set_signal  ("signal_PREDICT_BHT_ADDRESS_"+toString(i), _param._bht_size_address);
-	vhdl.set_signal  ("signal_PREDICT_BHT_HISTORY_"+toString(i), _param._bht_size_shifter);
+	vhdl->set_signal  ("signal_PREDICT_BHT_ACK_"+toString(i), 1);
+	vhdl->set_signal  ("signal_PREDICT_BHT_ADDRESS_"+toString(i), _param._bht_size_address);
+	vhdl->set_signal  ("signal_PREDICT_BHT_HISTORY_"+toString(i), _param._bht_size_shifter);
 	  }
 	if (_param._have_pht)
 	  {
-	vhdl.set_signal  ("signal_PREDICT_PHT_ACK_"+toString(i), 1);
-	vhdl.set_signal  ("signal_PREDICT_PHT_ADDRESS_"+toString(i), _param._pht_size_address);
+	vhdl->set_signal  ("signal_PREDICT_PHT_ACK_"+toString(i), 1);
+	vhdl->set_signal  ("signal_PREDICT_PHT_ADDRESS_"+toString(i), _param._pht_size_address);
 	  }
       }
@@ -40,11 +40,11 @@
 	if (_param._have_bht)
 	  {
-	vhdl.set_signal  ("signal_BRANCH_COMPLETE_BHT_ACK_"+toString(i), 1);
-	vhdl.set_signal  ("signal_BRANCH_COMPLETE_BHT_ADDRESS_"+toString(i), _param._bht_size_address);
+	vhdl->set_signal  ("signal_BRANCH_COMPLETE_BHT_ACK_"+toString(i), 1);
+	vhdl->set_signal  ("signal_BRANCH_COMPLETE_BHT_ADDRESS_"+toString(i), _param._bht_size_address);
 	  }
 	if (_param._have_pht)
 	  {
-	vhdl.set_signal  ("signal_BRANCH_COMPLETE_PHT_ACK_"+toString(i), 1);
-	vhdl.set_signal  ("signal_BRANCH_COMPLETE_PHT_ADDRESS_"+toString(i), _param._pht_size_address);
+	vhdl->set_signal  ("signal_BRANCH_COMPLETE_PHT_ACK_"+toString(i), 1);
+	vhdl->set_signal  ("signal_BRANCH_COMPLETE_PHT_ADDRESS_"+toString(i), _param._pht_size_address);
 	  }
       }
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl_port.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl_port.cpp	(revision 23)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl_port.cpp	(revision 42)
@@ -16,33 +16,9 @@
 namespace two_level_branch_predictor {
 
-  void Two_Level_Branch_Predictor::vhdl_port (Vhdl & vhdl)
+  void Two_Level_Branch_Predictor::vhdl_port (Vhdl * & vhdl)
   {
     log_printf(FUNC,Two_Level_Branch_Predictor,"vhdl_port","Begin");
 
-    vhdl.set_port (" in_CLOCK ", IN, 1);
-    vhdl.set_port (" in_NRESET", IN, 1);
-
-    for (uint32_t i=0; i<_param._nb_prediction; i++)
-      {
-	vhdl.set_port (" in_PREDICT_VAL_"+toString(i)+"                ", IN, 1);
-	vhdl.set_port ("out_PREDICT_ACK_"+toString(i)+"                ",OUT, 1);
-	vhdl.set_port (" in_PREDICT_ADDRESS_"+toString(i)+"            ", IN,_param._size_address);
-	if (_param._have_bht)
-	vhdl.set_port ("out_PREDICT_BHT_HISTORY_"+toString(i)+"        ",OUT,_param._bht_size_shifter);
-	if (_param._have_pht)
-    	vhdl.set_port ("out_PREDICT_PHT_HISTORY_"+toString(i)+"        ",OUT,_param._pht_size_counter);
-      }
-
-    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
-      {
-	vhdl.set_port (" in_BRANCH_COMPLETE_VAL_"+toString(i)+"        ", IN, 1);
-	vhdl.set_port ("out_BRANCH_COMPLETE_ACK_"+toString(i)+"        ",OUT, 1);
-	vhdl.set_port (" in_BRANCH_COMPLETE_ADDRESS_"+toString(i)+"    ", IN,_param._size_address);
-	if (_param._have_bht)
-    	vhdl.set_port (" in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i)+"", IN,_param._bht_size_shifter);
-	if (_param._have_pht)
-	vhdl.set_port (" in_BRANCH_COMPLETE_PHT_HISTORY_"+toString(i)+"", IN,_param._pht_size_counter);
-	vhdl.set_port (" in_BRANCH_COMPLETE_DIRECTION_"+toString(i)+"  ", IN, 1);
-      }
+    _interfaces->set_port(vhdl);
 
     log_printf(FUNC,Two_Level_Branch_Predictor,"vhdl_port","End");
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl_testbench_label.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl_testbench_label.cpp	(revision 23)
+++ 	(revision )
@@ -1,31 +1,0 @@
-/*
- * $Id$
- *
- * [ Description ]
- * 
- */
-
-#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/include/Two_Level_Branch_Predictor.h"
-
-namespace morpheo                    {
-namespace behavioural {
-namespace stage_1_ifetch {
-namespace predictor {
-namespace meta_predictor {
-namespace two_level_branch_predictor {
-
-
-  void Two_Level_Branch_Predictor::vhdl_testbench_label (string label)
-  {
-#ifdef VHDL_TESTBENCH
-    _vhdl_testbench->add_label(label);
-#endif
-  };
-
-}; // end namespace two_level_branch_predictor
-}; // end namespace meta_predictor
-}; // end namespace predictor
-}; // end namespace stage_1_ifetch
-
-}; // end namespace behavioural
-}; // end namespace morpheo              
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl_testbench_port.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl_testbench_port.cpp	(revision 23)
+++ 	(revision )
@@ -1,58 +1,0 @@
-#ifdef VHDL_TESTBENCH
-/*
- * $Id$
- *
- * [ Description ]
- * 
- */
-
-#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/include/Two_Level_Branch_Predictor.h"
-
-namespace morpheo                    {
-namespace behavioural {
-namespace stage_1_ifetch {
-namespace predictor {
-namespace meta_predictor {
-namespace two_level_branch_predictor {
-
-
-  void Two_Level_Branch_Predictor::vhdl_testbench_port ()
-  {
-    log_printf(FUNC,Two_Level_Branch_Predictor,"vhdl_testbench_port","Begin");
-
-    _vhdl_testbench->set_port (" in_NRESET", IN, 1);
-
-    for (uint32_t i=0; i<_param._nb_prediction; i++)
-      {
-	_vhdl_testbench->set_port (" in_PREDICT_VAL_"        +toString(i), IN, 1);
-	_vhdl_testbench->set_port ("out_PREDICT_ACK_"        +toString(i),OUT, 1);
-	_vhdl_testbench->set_port (" in_PREDICT_ADDRESS_"    +toString(i), IN,_param._size_address);
-	if (_param._have_bht)
-	_vhdl_testbench->set_port ("out_PREDICT_BHT_HISTORY_"+toString(i),OUT,_param._bht_size_shifter);
-	if (_param._have_pht)
-    	_vhdl_testbench->set_port ("out_PREDICT_PHT_HISTORY_"+toString(i),OUT,_param._pht_size_counter);
-      }
-
-    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
-      {
-	_vhdl_testbench->set_port (" in_BRANCH_COMPLETE_VAL_"        +toString(i), IN, 1);
-	_vhdl_testbench->set_port ("out_BRANCH_COMPLETE_ACK_"        +toString(i),OUT, 1);
-	_vhdl_testbench->set_port (" in_BRANCH_COMPLETE_ADDRESS_"    +toString(i), IN,_param._size_address);
-	if (_param._have_bht)
-    	_vhdl_testbench->set_port (" in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i), IN,_param._bht_size_shifter);
-	if (_param._have_pht)
-	_vhdl_testbench->set_port (" in_BRANCH_COMPLETE_PHT_HISTORY_"+toString(i), IN,_param._pht_size_counter);
-	_vhdl_testbench->set_port (" in_BRANCH_COMPLETE_DIRECTION_"  +toString(i), IN, 1);
-      }
-
-    log_printf(FUNC,Two_Level_Branch_Predictor,"vhdl_testbench_port","End");
-  };
-
-}; // end namespace two_level_branch_predictor
-}; // end namespace meta_predictor
-}; // end namespace predictor
-}; // end namespace stage_1_ifetch
-
-}; // end namespace behavioural
-}; // end namespace morpheo              
-#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl_testbench_transition.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl_testbench_transition.cpp	(revision 23)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl_testbench_transition.cpp	(revision 42)
@@ -21,49 +21,7 @@
     log_printf(FUNC,Two_Level_Branch_Predictor,"vhdl_testbench_transition","Begin");
 
-#ifndef SYSTEMCASS_SPECIFIC
-    sc_cycle(0);
-#endif    
+    sc_start(0);
 
-    _vhdl_testbench->add_input (PORT_READ( in_NRESET));
-    
-    // In order with file Two_Level_Branch_Predictor_vhdl_testbench_port.cpp
-    // Warning : if a output depend of a subcomponent, take directly the port of subcomponent
-    // (because we have no control on the ordonnancer's policy)
-
-    for (uint32_t i=0; i<_param._nb_prediction; i++)
-      {
-	_vhdl_testbench->add_input (PORT_READ( in_PREDICT_VAL                          [i]));
-	_vhdl_testbench->add_output(PORT_READ(component_Two_Level_Branch_Predictor_Glue->
-					      out_PREDICT_ACK                          [i]));
-	_vhdl_testbench->add_input (PORT_READ( in_PREDICT_ADDRESS                      [i]));
-	if (_param._have_bht)
-	_vhdl_testbench->add_output(PORT_READ(component_Branch_History_Table           ->
-					      component_RegisterFile                   ->
-					      out_READ_DATA                            [i]));
-	if (_param._have_pht)
-	_vhdl_testbench->add_output(PORT_READ(component_Pattern_History_Table          ->
-					      component_RegisterFile                   ->
-					      out_READ_DATA                            [i]));
-      }
-
-    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
-      {
-	_vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_VAL                  [i]));
-	_vhdl_testbench->add_output(PORT_READ(component_Two_Level_Branch_Predictor_Glue->
-					      out_BRANCH_COMPLETE_ACK                  [i]));
-	_vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_ADDRESS              [i]));
-	if (_param._have_bht)
-	_vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_BHT_HISTORY          [i]));
-	if (_param._have_pht)
-	_vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_PHT_HISTORY          [i]));
-	_vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_DIRECTION            [i]));
-      }
-    
-    // add_test :
-    //  - True  : the cycle must be compare with the output of systemC
-    //  - False : no test
-    _vhdl_testbench->add_test(true);
-
-    _vhdl_testbench->new_cycle (); // always at the end
+    _interfaces->testbench();
 
     log_printf(FUNC,Two_Level_Branch_Predictor,"vhdl_testbench_transition","End");
