Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter_genMealy.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter_genMealy.cpp	(revision 2)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter_genMealy.cpp	(revision 3)
@@ -21,19 +21,24 @@
     for (uint32_t i=0; i<_param._nb_port; i++)
       {
-	Tdata_t data = PORT_READ(in_COUNTER_DATA [i]);
+	Tcontrol_t addsub  = PORT_READ(in_COUNTER_ADDSUB [i]);
+	Tdata_t    data_in = PORT_READ(in_COUNTER_DATA   [i]);
+	Tdata_t    data_out= data_in;
+	log_printf(TRACE,Counter,"genMealy","before : %d %s = %d",data_in,((addsub==1)?"++":"--"),data_out);
 
 	// Staturate counter
-	if (PORT_READ(in_COUNTER_ADDSUB [i]) == 1)
+	if (addsub == 1)
 	  {
-	    if (data < _param._data_max)
-	      data ++;
+	    if (data_out < _param._data_max)
+	      data_out++;
 	  }
 	else
 	  {
-	    if (data > 0)
-	      data --;
+	    if (data_out > 0)
+	      data_out--;
 	  }
 
-	PORT_WRITE(out_COUNTER_DATA[i], data);
+	log_printf(TRACE,Counter,"genMealy","after   : %d %s = %d",data_in,((addsub==1)?"++":"--"),data_out);
+    
+	PORT_WRITE(out_COUNTER_DATA[i], data_out);
       }
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Parameters_print.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Parameters_print.cpp	(revision 2)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Parameters_print.cpp	(revision 3)
@@ -7,5 +7,5 @@
 
 #include "Behavioural/Generic/Counter/include/Parameters.h"
-#include <sstream>
+#include "Behavioural/include/XML.h"
 using namespace std;
 
@@ -20,14 +20,18 @@
     log_printf(FUNC,Counter,"print","Begin");
 
-    string tab = string(depth,'\t');
-    ostringstream msg;
-    msg << tab << "<counter>" << endl
-	<< tab << "\t<size_data value=\"" << _size_data << "\" />" << endl
-	<< tab << "\t<nb_port   value=\"" << _nb_port   << "\" />" << endl
-	<< tab << "</counter>" << endl;
+    XML xml ("counter");
+
+    xml.balise_open("counter");
+    xml.  singleton_begin("size_data");
+    xml.    attribut("value",toString(_size_data));
+    xml.  singleton_end();
+    xml.  singleton_begin("nb_port  ");
+    xml.    attribut("value",toString(_nb_port));
+    xml.  singleton_end();
+    xml.balise_close();
 
     log_printf(FUNC,Counter,"print","End");
     
-    return msg.str();
+    return xml.get_body(depth);
   };
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/RegisterFile_genMealy_read.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/RegisterFile_genMealy_read.cpp	(revision 2)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/RegisterFile_genMealy_read.cpp	(revision 3)
@@ -27,10 +27,14 @@
  	if ( PORT_READ(in_READ_ENABLE[i]) == 1)
  	  {
-	    log_printf(TRACE,Register_File,"genMealy_read","Read  [%d] : Have transaction, Reg[%d] -> %x",i,PORT_READ(in_READ_ADDRESS[i]),REGISTER_READ(reg_DATA[PORT_READ(in_READ_ADDRESS[i])]));
+	    Taddress_t address = PORT_READ(in_READ_ADDRESS[i]);
+	    Tdata_t    data    = REGISTER_READ(reg_DATA[address]);
+
+	    log_printf(TRACE,Register_File,"genMealy_read","[%d] -> %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data));
+
 #ifdef STATISTICS
 	    _stat_nb_read ++;
 #endif    
 	    // Write in registerFile
-	    PORT_WRITE(out_READ_DATA[i],REGISTER_READ(reg_DATA[PORT_READ(in_READ_ADDRESS[i])]));
+	    PORT_WRITE(out_READ_DATA[i],data);
  	  }
 	else
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/RegisterFile_transition.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/RegisterFile_transition.cpp	(revision 2)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/RegisterFile_transition.cpp	(revision 3)
@@ -26,6 +26,4 @@
  	if ( PORT_READ(in_WRITE_ENABLE[i]) == true)
  	  {
-	    log_printf(TRACE,Register_File,"transition","Write [%d] : Have transaction, Reg[%d] <- %x",i,PORT_READ(in_WRITE_ADDRESS[i]),PORT_READ(in_WRITE_DATA   [i]));
-	    
 #ifdef STATISTICS
 	    _stat_nb_write ++;
@@ -35,4 +33,6 @@
 	    Tdata_t    data    = PORT_READ(in_WRITE_DATA   [i]);
 	    
+	    log_printf(TRACE,Register_File,"transition","[%d] <- %.8x",static_cast<uint32_t>(address),static_cast<uint32_t>(data));
+
 	    // Write in registerFile
 	    REGISTER_WRITE(reg_DATA[address],data);
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.Common
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.Common	(revision 2)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.Common	(revision 3)
@@ -34,4 +34,5 @@
 TR				= tr
 UPPERtoLOWER			= $(TR) [:lower:] [:upper:]
+
 #-----[ Compilation ]--------------------------------------
 
@@ -61,14 +62,11 @@
 XX_systemcass			= -rdynamic				\
 				  -ansi                       		\
-   	                	  -Wno-long-long              		\
-	   			  -DCHECK_MULTIWRITING2REGISTER
-
-#                                  -DNONAME_RENAME
+   	                	  -Wno-long-long
 
 XX_systemcass_deps		= $(XX_systemcass)
 
 EXEC_PARAMS_systemc		= 
-EXEC_PARAMS_systemcass 		= 
-EXEC_PARAMS_systemcass_deps     = --p
+EXEC_PARAMS_systemcass 		= --nobanner 
+EXEC_PARAMS_systemcass_deps     = --nobanner --p
 
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.Selftest
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.Selftest	(revision 2)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.Selftest	(revision 3)
@@ -142,6 +142,5 @@
 					*.vhdl			\
 					*.stat			\
-					.libs			\
-					code*			\
+					generated_by_systemcass \
 					core*
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.Synthesis
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.Synthesis	(revision 2)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.Synthesis	(revision 3)
@@ -64,5 +64,5 @@
 
 $(DIR_LOG)/%.vhdl_sim.log	: $(DIR_VHDL)/%.vhdl $(DIR_LOG)/%.vhdl.log
-				@$(ECHO) "VHDL's Simulation  : $*"
+				@$(ECHO) "VHDL's Simulation: $*"
 				@$(VSIM) "$(DIR_WORK).`$(BASENAME) $* |$(UPPERtoLOWER)`" > $@
 				declare -i count=`$(GREP) -ch "Test KO" $@`;		\
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.defs
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.defs	(revision 2)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.defs	(revision 3)
@@ -16,8 +16,9 @@
 #-----[ Flags ]--------------------------------------------
 FLAGS				=	-DSYSTEMC		\
+					-DCONFIGURATION		\
 					-DSTATISTICS 		\
 					-DVHDL			\
-					-DVHDL_TESTBENCH	\
-					-DDEBUG=DEBUG_ALL
+					-DVHDL_TESTBENCH
+# 					-DDEBUG=DEBUG_TRACE
 
 # Flags :
@@ -25,4 +26,5 @@
 # VHDL                          - To generate a vhdl's    model
 # SYSTEMC                       - To generate a systemc's model
+# CONFIGURATION			- To generate a configuration file (it's input of viewer)
 # STATISTICS     (need SYSTEMC) - In the simulation, generate a statistics's file
 # VHDL_TESTBENCH (need SYSTEMC) - In the simulation, generate two testbench's file (input and ouput) to validate the vhdl's model
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/VERSION
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/VERSION	(revision 2)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/VERSION	(revision 3)
@@ -1,1 +1,1 @@
-v0.3
+v0.4
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/Parameters_print.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/Parameters_print.cpp	(revision 2)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/src/Parameters_print.cpp	(revision 3)
@@ -7,5 +7,5 @@
 
 #include "Behavioural/@DIRECTORY/include/Parameters.h"
-#include <sstream>
+#include "Behavioural/include/XML.h"
 using namespace std;
 
@@ -18,12 +18,18 @@
     log_printf(FUNC,@COMPONENT,"print","Begin");
 
-    string tab = string(depth,'\t');
-    ostringstream msg;
-    msg << tab << "<@COMPONENT_LOWER>" << endl
-	<< tab << "</@COMPONENT_LOWER>" << endl;
+    XML xml ("@COMPONENT_LOWER");
+
+    xml.balise_open("@COMPONENT_LOWER");
+//  xml.  singleton_begin("size_data");
+//  xml.    attribut("value",toString(_size_data));
+//  xml.  singleton_end();
+//  xml.  singleton_begin("nb_port  ");
+//  xml.    attribut("value",toString(_nb_port));
+//  xml.  singleton_end();
+    xml.balise_close();
 
     log_printf(FUNC,@COMPONENT,"print","End");
     
-    return msg.str();
+    return xml.get_body(depth);
   };
 
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 2)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/SelfTest/src/test.cpp	(revision 3)
@@ -46,14 +46,14 @@
    *********************************************************************/
   sc_clock                                 CLOCK ("clock", 1.0, 0.5);
-  sc_signal<Tcontrol_t>                    PREDICT_VAL             [param._nb_prediction];
-  sc_signal<Tcontrol_t>                    PREDICT_ACK             [param._nb_prediction];
-  sc_signal<Taddress_t>                    PREDICT_ADDRESS         [param._nb_prediction];
-  sc_signal<Thistory_t>                    PREDICT_HISTORY         [param._nb_prediction];
-				           
-  sc_signal<Tcontrol_t>                    BRANCH_COMPLETE_VAL     [param._nb_branch_complete];
-  sc_signal<Tcontrol_t>                    BRANCH_COMPLETE_ACK     [param._nb_branch_complete];
-  sc_signal<Taddress_t>                    BRANCH_COMPLETE_ADDRESS [param._nb_branch_complete];
-  sc_signal<Thistory_t>                    BRANCH_COMPLETE_HISTORY [param._nb_branch_complete];
-  sc_signal<Tcontrol_t>                    BRANCH_COMPLETE_HIT     [param._nb_branch_complete];
+  sc_signal<Tcontrol_t>                    PREDICT_VAL               [param._nb_prediction];
+  sc_signal<Tcontrol_t>                    PREDICT_ACK               [param._nb_prediction];
+  sc_signal<Taddress_t>                    PREDICT_ADDRESS           [param._nb_prediction];
+  sc_signal<Thistory_t>                    PREDICT_HISTORY           [param._nb_prediction];
+				           			     
+  sc_signal<Tcontrol_t>                    BRANCH_COMPLETE_VAL       [param._nb_branch_complete];
+  sc_signal<Tcontrol_t>                    BRANCH_COMPLETE_ACK       [param._nb_branch_complete];
+  sc_signal<Taddress_t>                    BRANCH_COMPLETE_ADDRESS   [param._nb_branch_complete];
+  sc_signal<Thistory_t>                    BRANCH_COMPLETE_HISTORY   [param._nb_branch_complete];
+  sc_signal<Tcontrol_t>                    BRANCH_COMPLETE_DIRECTION [param._nb_branch_complete];
   
   /********************************************************
@@ -75,9 +75,9 @@
   for (uint32_t i=0; i<param._nb_branch_complete; i++)
     {
-      (*(_Branch_History_Table-> in_BRANCH_COMPLETE_VAL     [i]))        (BRANCH_COMPLETE_VAL     [i]);
-      (*(_Branch_History_Table->out_BRANCH_COMPLETE_ACK     [i]))        (BRANCH_COMPLETE_ACK     [i]);
-      (*(_Branch_History_Table-> in_BRANCH_COMPLETE_ADDRESS [i]))        (BRANCH_COMPLETE_ADDRESS [i]);
-      (*(_Branch_History_Table-> in_BRANCH_COMPLETE_HISTORY [i]))        (BRANCH_COMPLETE_HISTORY [i]);
-      (*(_Branch_History_Table-> in_BRANCH_COMPLETE_HIT     [i]))        (BRANCH_COMPLETE_HIT     [i]);
+      (*(_Branch_History_Table-> in_BRANCH_COMPLETE_VAL       [i]))        (BRANCH_COMPLETE_VAL       [i]);
+      (*(_Branch_History_Table->out_BRANCH_COMPLETE_ACK       [i]))        (BRANCH_COMPLETE_ACK       [i]);
+      (*(_Branch_History_Table-> in_BRANCH_COMPLETE_ADDRESS   [i]))        (BRANCH_COMPLETE_ADDRESS   [i]);
+      (*(_Branch_History_Table-> in_BRANCH_COMPLETE_HISTORY   [i]))        (BRANCH_COMPLETE_HISTORY   [i]);
+      (*(_Branch_History_Table-> in_BRANCH_COMPLETE_DIRECTION [i]))        (BRANCH_COMPLETE_DIRECTION [i]);
     }
 
@@ -108,12 +108,12 @@
   Thistory_t history                  = 0;
   Thistory_t mask                     = gen_mask <Thistory_t> (param._size_shifter);
-  Tcontrol_t hit                      = 0;
+  Tcontrol_t direction                = 0;
 
   while (address<param._nb_shifter)
     {
-      BRANCH_COMPLETE_VAL     [0].write(1);
-      BRANCH_COMPLETE_ADDRESS [0].write(address);
-      BRANCH_COMPLETE_HISTORY [0].write(0);
-      BRANCH_COMPLETE_HIT     [0].write(0);
+      BRANCH_COMPLETE_VAL       [0].write(1);
+      BRANCH_COMPLETE_ADDRESS   [0].write(address);
+      BRANCH_COMPLETE_HISTORY   [0].write(0);
+      BRANCH_COMPLETE_DIRECTION [0].write(0);
 
       sc_start(1);
@@ -136,16 +136,16 @@
       address                  = rand() % param._nb_shifter        ;
       history                  = rand() % (1<<param._size_shifter) ;
-      hit                      = rand() % 2;
+      direction                = rand() % 2;
 
       cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} ["+toString(num_port_branch_complete)+"]" << endl
 	   << hex
-	   << " - address     : " << address << endl
-	   << " - history old : " << history << endl
-	   << " - hit         : " << hit     << endl;
+	   << " - address     : " << address  << endl
+	   << " - history old : " << history  << endl
+	   << " - direction   : " << direction<< endl;
 
-      BRANCH_COMPLETE_VAL     [num_port_branch_complete].write(1);
-      BRANCH_COMPLETE_ADDRESS [num_port_branch_complete].write(address);
-      BRANCH_COMPLETE_HISTORY [num_port_branch_complete].write(history);
-      BRANCH_COMPLETE_HIT     [num_port_branch_complete].write(hit);
+      BRANCH_COMPLETE_VAL       [num_port_branch_complete].write(1);
+      BRANCH_COMPLETE_ADDRESS   [num_port_branch_complete].write(address);
+      BRANCH_COMPLETE_HISTORY   [num_port_branch_complete].write(history);
+      BRANCH_COMPLETE_DIRECTION [num_port_branch_complete].write(direction);
 
       // Wait Ack
@@ -160,5 +160,5 @@
       PREDICT_ADDRESS         [num_port_predict        ].write(address);
       
-      history                  = ((history<<1)&mask)|hit;
+      history                  = ((history<<1)&mask)|direction;
       
       // Wait Ack
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 2)
+++ 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 3)
@@ -78,5 +78,5 @@
   public    : SC_IN (Taddress_t)           **  in_BRANCH_COMPLETE_ADDRESS;
   public    : SC_IN (Thistory_t)           **  in_BRANCH_COMPLETE_HISTORY;
-  public    : SC_IN (Tcontrol_t)           **  in_BRANCH_COMPLETE_HIT    ;
+  public    : SC_IN (Tcontrol_t)           **  in_BRANCH_COMPLETE_DIRECTION;
 
     // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
@@ -87,6 +87,6 @@
 
     // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
-  protected : morpheo::behavioural::generic::shifter::Shifter           * component_Shifter     ;
-  protected : morpheo::behavioural::generic::registerfile::RegisterFile * component_RegisterFile;
+  public    : morpheo::behavioural::generic::shifter::Shifter           * component_Shifter     ;
+  public    : morpheo::behavioural::generic::registerfile::RegisterFile * component_RegisterFile;
 
     // -----[ methods ]---------------------------------------------------
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 2)
+++ 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 3)
@@ -48,5 +48,5 @@
         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_HIT     = new SC_IN     (Tcontrol_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];
 
@@ -65,6 +65,6 @@
 	  in_BRANCH_COMPLETE_HISTORY [i] = new SC_IN (Thistory_t) (rename.c_str());
 
-	 rename = "in_BRANCH_COMPLETE_HIT["    +toString(i)+"]";
-	  in_BRANCH_COMPLETE_HIT     [i] = new SC_IN (Tcontrol_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)+"]";
@@ -93,7 +93,7 @@
     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_HIT     [i]));
-	(*(component_Shifter->out_SHIFTER_DATA       [i]))    (*(signal_BRANCH_COMPLETE_HISTORY [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]));
       }
     
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 2)
+++ 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 3)
@@ -40,5 +40,5 @@
 	 delete  in_BRANCH_COMPLETE_ADDRESS [i];
 	 delete  in_BRANCH_COMPLETE_HISTORY [i];
-	 delete  in_BRANCH_COMPLETE_HIT     [i];
+	 delete  in_BRANCH_COMPLETE_DIRECTION[i];
        }
     delete  in_BRANCH_COMPLETE_VAL    ;
@@ -46,5 +46,5 @@
     delete  in_BRANCH_COMPLETE_ADDRESS;
     delete  in_BRANCH_COMPLETE_HISTORY;
-    delete  in_BRANCH_COMPLETE_HIT    ;
+    delete  in_BRANCH_COMPLETE_DIRECTION;
 
      // ~~~~~[ 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_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 2)
+++ 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 3)
@@ -32,10 +32,9 @@
       {
 	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_HIT_"+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 ("component_Shifter",_name+"_Shifter",list_port_map);
-
 
     list_port_map.clear();
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 2)
+++ 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 3)
@@ -24,16 +24,16 @@
     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);
+	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_HIT_"+toString(i)+"    ", IN, 1);
+	 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);
        }
   };
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 2)
+++ 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 3)
@@ -17,5 +17,4 @@
 namespace branch_history_table {
 
-
   void Branch_History_Table::vhdl_signal (Vhdl & vhdl)
   {
@@ -29,5 +28,4 @@
 }; // 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 2)
+++ 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 3)
@@ -21,17 +21,17 @@
     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);
+	_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_HIT_"+toString(i)+"    ", IN, 1);
+	 _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);
        }
   };
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 2)
+++ 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 3)
@@ -40,5 +40,5 @@
 	 _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_HIT     [i]));
+	 _vhdl_testbench->add_input  (PORT_READ( in_BRANCH_COMPLETE_DIRECTION[i]));
        }
     
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 2)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/src/test.cpp	(revision 3)
@@ -43,14 +43,14 @@
    *********************************************************************/
   sc_clock                                 CLOCK ("clock", 1.0, 0.5);
-  sc_signal<Tcontrol_t>                    PREDICT_VAL             [param._nb_prediction];
-  sc_signal<Tcontrol_t>                    PREDICT_ACK             [param._nb_prediction];
-  sc_signal<Taddress_t>                    PREDICT_ADDRESS         [param._nb_prediction];
-  sc_signal<Thistory_t>                    PREDICT_HISTORY         [param._nb_prediction];
-				           
-  sc_signal<Tcontrol_t>                    BRANCH_COMPLETE_VAL     [param._nb_branch_complete];
-  sc_signal<Tcontrol_t>                    BRANCH_COMPLETE_ACK     [param._nb_branch_complete];
-  sc_signal<Taddress_t>                    BRANCH_COMPLETE_ADDRESS [param._nb_branch_complete];
-  sc_signal<Thistory_t>                    BRANCH_COMPLETE_HISTORY [param._nb_branch_complete];
-  sc_signal<Tcontrol_t>                    BRANCH_COMPLETE_HIT     [param._nb_branch_complete];
+  sc_signal<Tcontrol_t>                    PREDICT_VAL               [param._nb_prediction];
+  sc_signal<Tcontrol_t>                    PREDICT_ACK               [param._nb_prediction];
+  sc_signal<Taddress_t>                    PREDICT_ADDRESS           [param._nb_prediction];
+  sc_signal<Thistory_t>                    PREDICT_HISTORY           [param._nb_prediction];
+				           			     
+  sc_signal<Tcontrol_t>                    BRANCH_COMPLETE_VAL       [param._nb_branch_complete];
+  sc_signal<Tcontrol_t>                    BRANCH_COMPLETE_ACK       [param._nb_branch_complete];
+  sc_signal<Taddress_t>                    BRANCH_COMPLETE_ADDRESS   [param._nb_branch_complete];
+  sc_signal<Thistory_t>                    BRANCH_COMPLETE_HISTORY   [param._nb_branch_complete];
+  sc_signal<Tcontrol_t>                    BRANCH_COMPLETE_DIRECTION [param._nb_branch_complete];
   
   /********************************************************
@@ -72,9 +72,9 @@
   for (uint32_t i=0; i<param._nb_branch_complete; i++)
     {
-      (*(_Pattern_History_Table-> in_BRANCH_COMPLETE_VAL     [i]))        (BRANCH_COMPLETE_VAL     [i]);
-      (*(_Pattern_History_Table->out_BRANCH_COMPLETE_ACK     [i]))        (BRANCH_COMPLETE_ACK     [i]);
-      (*(_Pattern_History_Table-> in_BRANCH_COMPLETE_ADDRESS [i]))        (BRANCH_COMPLETE_ADDRESS [i]);
-      (*(_Pattern_History_Table-> in_BRANCH_COMPLETE_HISTORY [i]))        (BRANCH_COMPLETE_HISTORY [i]);
-      (*(_Pattern_History_Table-> in_BRANCH_COMPLETE_HIT     [i]))        (BRANCH_COMPLETE_HIT     [i]);
+      (*(_Pattern_History_Table-> in_BRANCH_COMPLETE_VAL       [i]))        (BRANCH_COMPLETE_VAL       [i]);
+      (*(_Pattern_History_Table->out_BRANCH_COMPLETE_ACK       [i]))        (BRANCH_COMPLETE_ACK       [i]);
+      (*(_Pattern_History_Table-> in_BRANCH_COMPLETE_ADDRESS   [i]))        (BRANCH_COMPLETE_ADDRESS   [i]);
+      (*(_Pattern_History_Table-> in_BRANCH_COMPLETE_HISTORY   [i]))        (BRANCH_COMPLETE_HISTORY   [i]);
+      (*(_Pattern_History_Table-> in_BRANCH_COMPLETE_DIRECTION [i]))        (BRANCH_COMPLETE_DIRECTION [i]);
     }
 
@@ -105,12 +105,12 @@
   Thistory_t history_max              = (1<<param._size_counter)-1;
   Thistory_t history                  = 0;
-  Tcontrol_t hit                      = 0;
+  Tcontrol_t direction                = 0;
 
   while (address<param._nb_counter)
     {
-      BRANCH_COMPLETE_VAL     [0].write(1);
-      BRANCH_COMPLETE_ADDRESS [0].write(address);
-      BRANCH_COMPLETE_HISTORY [0].write(0);
-      BRANCH_COMPLETE_HIT     [0].write(0);
+      BRANCH_COMPLETE_VAL       [0].write(1);
+      BRANCH_COMPLETE_ADDRESS   [0].write(address);
+      BRANCH_COMPLETE_HISTORY   [0].write(0);
+      BRANCH_COMPLETE_DIRECTION [0].write(0);
 
       sc_start(1);
@@ -133,16 +133,16 @@
       address                  = rand() % param._nb_counter        ;
       history                  = rand() % (1<<param._size_counter) ;
-      hit                      = rand() % 2;
+      direction                = rand() % 2;
 
       cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} ["+toString(num_port_branch_complete)+"]" << endl
 	   << hex
-	   << " - address     : " << address << endl
-	   << " - history old : " << history << endl
-	   << " - hit         : " << hit     << endl;
+	   << " - address     : " << address   << endl
+	   << " - history old : " << history   << endl
+	   << " - direction   : " << direction << endl;
 
-      BRANCH_COMPLETE_VAL     [num_port_branch_complete].write(1);
-      BRANCH_COMPLETE_ADDRESS [num_port_branch_complete].write(address);
-      BRANCH_COMPLETE_HISTORY [num_port_branch_complete].write(history);
-      BRANCH_COMPLETE_HIT     [num_port_branch_complete].write(hit);
+      BRANCH_COMPLETE_VAL       [num_port_branch_complete].write(1);
+      BRANCH_COMPLETE_ADDRESS   [num_port_branch_complete].write(address);
+      BRANCH_COMPLETE_HISTORY   [num_port_branch_complete].write(history);
+      BRANCH_COMPLETE_DIRECTION [num_port_branch_complete].write(direction);
 
       // Wait Ack
@@ -157,5 +157,5 @@
       PREDICT_ADDRESS         [num_port_predict        ].write(address);
       
-      history                  = (hit==1)?((history<history_max)?history+1:history):((history>0)?history-1:history);
+      history                  = (direction==1)?((history<history_max)?history+1:history):((history>0)?history-1:history);
       
       // Wait Ack
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 2)
+++ 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 3)
@@ -80,5 +80,5 @@
   public    : SC_IN (Taddress_t)           **  in_BRANCH_COMPLETE_ADDRESS;
   public    : SC_IN (Thistory_t)           **  in_BRANCH_COMPLETE_HISTORY;
-  public    : SC_IN (Tcontrol_t)           **  in_BRANCH_COMPLETE_HIT    ;
+  public    : SC_IN (Tcontrol_t)           **  in_BRANCH_COMPLETE_DIRECTION;
 
     // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
@@ -89,6 +89,6 @@
 
     // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
-  protected : morpheo::behavioural::generic::counter::Counter           * component_Counter     ;
-  protected : morpheo::behavioural::generic::registerfile::RegisterFile * component_RegisterFile;
+  public    : morpheo::behavioural::generic::counter::Counter           * component_Counter     ;
+  public    : morpheo::behavioural::generic::registerfile::RegisterFile * component_RegisterFile;
 
     // -----[ methods ]---------------------------------------------------
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 2)
+++ 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 3)
@@ -46,10 +46,10 @@
       }
 
-        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_HIT     = new SC_IN     (Tcontrol_t) * [_param._nb_branch_complete];
-    signal_BRANCH_COMPLETE_HISTORY = new SC_SIGNAL (Thistory_t) * [_param._nb_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];
+    signal_BRANCH_COMPLETE_HISTORY   = new SC_SIGNAL (Thistory_t) * [_param._nb_branch_complete];
 
     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
@@ -67,6 +67,6 @@
 	  in_BRANCH_COMPLETE_HISTORY [i] = new SC_IN (Thistory_t) (rename.c_str());
 
-	 rename = "in_BRANCH_COMPLETE_HIT["    +toString(i)+"]";
-	  in_BRANCH_COMPLETE_HIT     [i] = new SC_IN (Tcontrol_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)+"]";
@@ -95,7 +95,7 @@
     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_HIT     [i]));
-	(*(component_Counter->out_COUNTER_DATA       [i]))    (*(signal_BRANCH_COMPLETE_HISTORY [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]));
       }
     
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 2)
+++ 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 3)
@@ -39,9 +39,9 @@
      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_HIT     [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    ;
@@ -49,5 +49,5 @@
     delete  in_BRANCH_COMPLETE_ADDRESS;
     delete  in_BRANCH_COMPLETE_HISTORY;
-    delete  in_BRANCH_COMPLETE_HIT    ;
+    delete  in_BRANCH_COMPLETE_DIRECTION;
 
      // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
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 2)
+++ 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 3)
@@ -34,5 +34,5 @@
       {
 	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_HIT_"+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));
       }
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 2)
+++ 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 3)
@@ -26,16 +26,16 @@
     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);
+	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_HIT_"+toString(i)+"    ", IN, 1);
+	 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);
        }
 
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 2)
+++ 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 3)
@@ -24,17 +24,17 @@
     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_HIT_"+toString(i)+"    ", IN, 1);
+	_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);
        }
 
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 2)
+++ 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 3)
@@ -41,12 +41,11 @@
      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(out_BRANCH_COMPLETE_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_HIT     [i]));
+	 _vhdl_testbench->add_input  (PORT_READ( in_BRANCH_COMPLETE_VAL      [i]));
+	 _vhdl_testbench->add_output (PORT_READ(out_BRANCH_COMPLETE_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
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/Makefile
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/Makefile	(revision 2)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/Makefile	(revision 3)
@@ -26,4 +26,4 @@
 include                         $(DIR_MORPHEO)/Behavioural/Makefile.defs
 include				$(DIR_MORPHEO)/Behavioural/Makefile.Common
+include				$(DIR_MORPHEO)/Behavioural/Makefile.Selftest
 include				$(DIR_MORPHEO)/Behavioural/Makefile.Synthesis
-include				$(DIR_MORPHEO)/Behavioural/Makefile.Selftest
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/configuration.cfg
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/configuration.cfg	(revision 2)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/configuration.cfg	(revision 3)
@@ -1,10 +1,10 @@
 Two_Level_Branch_Predictor
 1	1	+1	# have_bht           
-6	6	+1	# bht_size_shifter   
+6	8	+1	# bht_size_shifter   
 64	64	*2	# bht_nb_shifter     
-1	1	+1	# have_pht           
+0	1	+1	# have_pht           
 4	4	+1	# pht_size_counter   
-256	256	+2	# pht_nb_counter     
-2	2	+1	# pht_size_address_share
+256	512	*2	# pht_nb_counter     
+0	2	+1	# pht_size_address_share
 16	16	+1	# size_address      
 1	1	+1	# nb_prediction     
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/mkf.info
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/mkf.info	(revision 2)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/mkf.info	(revision 3)
@@ -0,0 +1,6 @@
+
+# Two_Level_Branch_Predictor_0
+target_dep	all	Two_Level_Branch_Predictor_0.ngc
+target_dep	Two_Level_Branch_Predictor_0.ngc	Two_Level_Branch_Predictor_0.prj
+target_dep	Two_Level_Branch_Predictor_0.prj	Two_Level_Branch_Predictor_0_Branch_History_Table_Pack.vhdl Two_Level_Branch_Predictor_0_Branch_History_Table_RegisterFile_Pack.vhdl Two_Level_Branch_Predictor_0_Branch_History_Table_RegisterFile.vhdl Two_Level_Branch_Predictor_0_Branch_History_Table_Shifter_Pack.vhdl Two_Level_Branch_Predictor_0_Branch_History_Table_Shifter.vhdl Two_Level_Branch_Predictor_0_Branch_History_Table.vhdl Two_Level_Branch_Predictor_0_Pack.vhdl Two_Level_Branch_Predictor_0_Pattern_History_Table_Counter_Pack.vhdl Two_Level_Branch_Predictor_0_Pattern_History_Table_Counter.vhdl Two_Level_Branch_Predictor_0_Pattern_History_Table_Pack.vhdl Two_Level_Branch_Predictor_0_Pattern_History_Table_RegisterFile_Pack.vhdl Two_Level_Branch_Predictor_0_Pattern_History_Table_RegisterFile.vhdl Two_Level_Branch_Predictor_0_Pattern_History_Table.vhdl Two_Level_Branch_Predictor_0_Two_Level_Branch_Predictor_Glue_Pack.vhdl Two_Level_Branch_Predictor_0_Two_Level_Branch_Predictor_Glue.vhdl Two_Level_Branch_Predictor_0.vhdl
+
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/src/test.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/src/test.cpp	(revision 2)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/src/test.cpp	(revision 3)
@@ -7,9 +7,9 @@
  */
 
-#define NB_ITERATION 1
+#define NB_ITERATION 512
 
 #include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/include/test.h"
 #include "Include/Test.h"
-
+#include "Include/BitManipulation.h"
 void test (string name,
 	   morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Parameters param)
@@ -28,5 +28,5 @@
    * Déclarations des signaux
    *********************************************************************/
-  sc_clock                              *  CLOCK ("clock", 1.0, 0.5);
+  sc_clock                              *  CLOCK;
 
   sc_signal<Tcontrol_t>                 *  PREDICT_VAL                 [param._nb_prediction];
@@ -41,5 +41,5 @@
   sc_signal<Tbht_history_t>             *  BRANCH_COMPLETE_BHT_HISTORY [param._nb_branch_complete];
   sc_signal<Tpht_history_t>             *  BRANCH_COMPLETE_PHT_HISTORY [param._nb_branch_complete];
-  sc_signal<Tcontrol_t>                 *  BRANCH_COMPLETE_HIT         [param._nb_branch_complete];
+  sc_signal<Tcontrol_t>                 *  BRANCH_COMPLETE_DIRECTION   [param._nb_branch_complete];
 
   // Rename signal
@@ -75,6 +75,6 @@
       rename = "BRANCH_COMPLETE_PHT_HISTORY_"+toString(i);
       BRANCH_COMPLETE_PHT_HISTORY [i] = new sc_signal<Tpht_history_t> (rename.c_str());
-      rename = "BRANCH_COMPLETE_HIT_"        +toString(i);
-      BRANCH_COMPLETE_HIT         [i] = new sc_signal<Tcontrol_t>     (rename.c_str());
+      rename = "BRANCH_COMPLETE_DIRECTION_"  +toString(i);
+      BRANCH_COMPLETE_DIRECTION   [i] = new sc_signal<Tcontrol_t>     (rename.c_str());
     }
 
@@ -86,15 +86,15 @@
   
   (*(_Two_Level_Branch_Predictor->in_CLOCK))        (*(CLOCK));
-
-    for (uint32_t i=0; i<param._nb_prediction; i++)
-      {
-	(*(_Two_Level_Branch_Predictor-> in_PREDICT_VAL                 [i])) (*(PREDICT_VAL                  [i]));
-	(*(_Two_Level_Branch_Predictor->out_PREDICT_ACK                 [i])) (*(PREDICT_ACK                  [i]));
-	(*(_Two_Level_Branch_Predictor-> in_PREDICT_ADDRESS             [i])) (*(PREDICT_ADDRESS              [i]));
-	if (param._have_bht)						       				       
-	(*(_Two_Level_Branch_Predictor->out_PREDICT_BHT_HISTORY         [i])) (*(PREDICT_BHT_HISTORY          [i]));
-	if (param._have_pht)						       				       
-	(*(_Two_Level_Branch_Predictor->out_PREDICT_PHT_HISTORY         [i])) (*(PREDICT_PHT_HISTORY          [i]));
-      }
+  
+  for (uint32_t i=0; i<param._nb_prediction; i++)
+    {
+      (*(_Two_Level_Branch_Predictor-> in_PREDICT_VAL                 [i])) (*(PREDICT_VAL                  [i]));
+      (*(_Two_Level_Branch_Predictor->out_PREDICT_ACK                 [i])) (*(PREDICT_ACK                  [i]));
+      (*(_Two_Level_Branch_Predictor-> in_PREDICT_ADDRESS             [i])) (*(PREDICT_ADDRESS              [i]));
+      if (param._have_bht)						       				       
+      (*(_Two_Level_Branch_Predictor->out_PREDICT_BHT_HISTORY         [i])) (*(PREDICT_BHT_HISTORY          [i]));
+      if (param._have_pht)
+      (*(_Two_Level_Branch_Predictor->out_PREDICT_PHT_HISTORY         [i])) (*(PREDICT_PHT_HISTORY          [i]));
+    }
 
     for (uint32_t i=0; i<param._nb_branch_complete; i++)
@@ -105,7 +105,7 @@
 	if (param._have_bht)						       					
 	(*(_Two_Level_Branch_Predictor-> in_BRANCH_COMPLETE_BHT_HISTORY [i])) (*(BRANCH_COMPLETE_BHT_HISTORY  [i]));
-	if (param._have_bht)						       					
+	if (param._have_pht)						       					
 	(*(_Two_Level_Branch_Predictor-> in_BRANCH_COMPLETE_PHT_HISTORY [i])) (*(BRANCH_COMPLETE_PHT_HISTORY  [i]));
-	(*(_Two_Level_Branch_Predictor-> in_BRANCH_COMPLETE_HIT         [i])) (*(BRANCH_COMPLETE_HIT          [i]));
+	(*(_Two_Level_Branch_Predictor-> in_BRANCH_COMPLETE_DIRECTION   [i])) (*(BRANCH_COMPLETE_DIRECTION    [i]));
       }
 
@@ -121,4 +121,9 @@
 
   srand(seed);
+
+  const uint32_t   num_port_predict         = rand()%param._nb_prediction;
+  const uint32_t   num_port_branch_complete = rand()%param._nb_branch_complete;
+  const Taddress_t address                  = rand()%param._size_address;
+        Tcontrol_t direction;
 
   sc_start(0);
@@ -133,10 +138,48 @@
 
   // Step 1
-  BRANCH_COMPLETE_VAL          [0]->write(1);
-  BRANCH_COMPLETE_HIT          [0]->write(0);
+  BRANCH_COMPLETE_VAL          [num_port_branch_complete]->write(1);
+  BRANCH_COMPLETE_DIRECTION    [num_port_branch_complete]->write(0);
+
+  if (param._have_pht)						       					
+    {
+      // Step 1.1 -> pattern_history_table
+
+      // Step 1.1.1 compute number of group.
+      uint32_t size_address_shift=0;
+
+      if (param._have_bht)
+	size_address_shift=param._param_two_level_branch_predictor_glue->_pht_size_address_shift;
+
+      uint32_t nb_group        = (1<<size_address_shift);
+      uint32_t nb_reg_by_group = (1<<(param._pht_size_address-size_address_shift));
+
+      _Two_Level_Branch_Predictor->vhdl_testbench_label("Init pht");
+      cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Init pht" << endl;
+      
+      BRANCH_COMPLETE_PHT_HISTORY  [num_port_branch_complete]->write(0);
+
+      // Step 1.1.2 for all group ...
+      for (uint32_t i=0; i<nb_group; i++)
+	{
+	  if (param._have_bht)
+	    BRANCH_COMPLETE_BHT_HISTORY  [num_port_branch_complete]->write(i);
+
+	  for (uint32_t j=0; j<nb_reg_by_group; j++)
+	    {
+	      BRANCH_COMPLETE_ADDRESS [num_port_branch_complete]->write(j);
+	      
+	      sc_start(1);
+
+	      // wait ackwolegde
+	      while (BRANCH_COMPLETE_ACK [num_port_branch_complete] -> read() == 0)
+		sc_start(1);
+	    }
+	}
+    }
 
   if (param._have_bht)						       					
     {
-      BRANCH_COMPLETE_BHT_HISTORY  [0]->write(0);
+      // Step 1.2 -> branch_history_table
+      BRANCH_COMPLETE_BHT_HISTORY  [num_port_branch_complete]->write(0);
       
       _Two_Level_Branch_Predictor->vhdl_testbench_label("Init bht");
@@ -145,5 +188,5 @@
       for (uint32_t i=0; i<param._bht_nb_shifter; i++)
 	{
-	  BRANCH_COMPLETE_ADDRESS [0]->write(i);
+	  BRANCH_COMPLETE_ADDRESS [num_port_branch_complete]->write(i);
 
 	  sc_start(1);
@@ -151,39 +194,82 @@
 
       // wait ackwolegde
-      while (BRANCH_COMPLETE_ACK [0] -> read() == 0)
+      while (BRANCH_COMPLETE_ACK [num_port_branch_complete] -> read() == 0)
 	sc_start(1);
     }
 
-  if (param._have_pht)						       					
-    {
-      BRANCH_COMPLETE_BHT_HISTORY  [0]->write(0);
-      BRANCH_COMPLETE_PHT_HISTORY  [0]->write(0);
-      
-      _Two_Level_Branch_Predictor->vhdl_testbench_label("Init bht");
-      cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Init bht" << endl;
-      
-      for (uint32_t i=0; i<param._bht_nb_shifter; i++)
-	{
-	  BRANCH_COMPLETE_ADDRESS [0]->write(i);
-
-	  sc_start(1);
-	}
+  // Step 2
+  BRANCH_COMPLETE_VAL          [num_port_branch_complete]->write(0);
+  PREDICT_ADDRESS              [num_port_predict        ]->write(address);
+  BRANCH_COMPLETE_ADDRESS      [num_port_branch_complete]->write(address);
+
+  _Two_Level_Branch_Predictor->vhdl_testbench_label("Loop of Test");
+  cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Loop of Test" << endl
+       << " * predict_address : " << hex << address << dec << endl;
+  
+  // A lot of prediction
+  Tbht_history_t bht_history = 0;
+  Tpht_history_t pht_history [1<<param._bht_size_shifter];
+  
+  for (uint32_t i=0; i<static_cast<uint32_t>(1<<param._bht_size_shifter); i++)
+    pht_history [i] = 0;
+
+  for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++)
+    {
+      _Two_Level_Branch_Predictor->vhdl_testbench_label("Iteration "+toString(iteration));
+
+      cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Predict          : bht_history " << bht_history << " - pht_history " << pht_history[bht_history] << endl; 
+
+      // Ask a new prediction
+      PREDICT_VAL                  [num_port_predict        ]->write(1);
+
+      sc_start(1);
 
       // wait ackwolegde
-      while (BRANCH_COMPLETE_ACK [0] -> read() == 0)
+      while (PREDICT_ACK [num_port_predict] -> read() == 0)
 	sc_start(1);
-    }
-
-
-
-  // Step 2
-  _Two_Level_Branch_Predictor->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 ++)
-    {
-      _Two_Level_Branch_Predictor->vhdl_testbench_label("Iteration "+toString(iteration));
+      PREDICT_ACK                  [num_port_predict        ]->write(0);
+
+      sc_start(0);
+
+      // Test
+      if (param._have_bht)
+      TEST(Tbht_history_t,bht_history             ,PREDICT_BHT_HISTORY[num_port_predict]->read());
+      if (param._have_pht)
+      TEST(Tpht_history_t,pht_history[bht_history],PREDICT_PHT_HISTORY[num_port_predict]->read());
+
+      // update
+      direction = ((rand()%2)==1);
+
+      BRANCH_COMPLETE_VAL          [num_port_branch_complete]->write(1);
+      if (param._have_bht)
+      BRANCH_COMPLETE_BHT_HISTORY  [num_port_branch_complete]->write(bht_history             );
+
+
+      if (param._have_pht)
+      BRANCH_COMPLETE_PHT_HISTORY  [num_port_branch_complete]->write(pht_history[bht_history]);
+      BRANCH_COMPLETE_DIRECTION    [num_port_branch_complete]->write(direction);
+
+      if (param._have_pht)
+      if (direction == 0)
+	{
+	  if (pht_history[bht_history] > 0)
+	    pht_history[bht_history] --;
+	}
+      else
+	{
+	  if (pht_history[bht_history] < (static_cast<Tpht_history_t>(1<<param._pht_size_counter)-1))
+	    pht_history[bht_history] ++;
+	}
+
+      if (param._have_bht)
+      bht_history              = (((bht_history) << 1) | direction) & gen_mask<Tbht_history_t>(param._bht_size_shifter);
 
       sc_start(1);
+
+      // wait ackwolegde
+      while (BRANCH_COMPLETE_ACK [num_port_branch_complete] -> read() == 0)
+	sc_start(1);
+
+      BRANCH_COMPLETE_VAL          [num_port_branch_complete]->write(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.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 2)
+++ 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 3)
@@ -47,5 +47,5 @@
     _vhdl_testbench = new Vhdl_Testbench (_name);
     vhdl_testbench_port           ();
-    _vhdl_testbench->set_clock    ("in_CLOCK",true);
+    _vhdl_testbench->set_clock    ("in_CLOCK",false);
 #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_genMealy_branch_complete_pht_address.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_genMealy_branch_complete_pht_address.cpp	(revision 2)
+++ 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_genMealy_branch_complete_pht_address.cpp	(revision 3)
@@ -26,5 +26,5 @@
 	{
 	  // Address
-	  Taddress_t address = PORT_READ(in_BRANCH_COMPLETE_ADDRESS [i]);
+	  Taddress_t     address = PORT_READ(in_BRANCH_COMPLETE_ADDRESS [i]);
 	  Tbht_history_t history = 0;
 	  
@@ -34,6 +34,10 @@
 	      address = address << _param._pht_size_address_shift;
 	    }
+
+	  Taddress_t     pht_address = (history ^ address) & gen_mask<Taddress_t>(_param._pht_size_address);
+
+	  log_printf(TRACE,Two_Level_Branch_Predictor_Glue,"genMealy_branch_complete_address","out_BRANCH_COMPLETE_PHT_ADDRESS [%d]= %.8x xor %.8x<<%d = %.8x",i,history,PORT_READ(in_BRANCH_COMPLETE_ADDRESS [i]),_param._pht_size_address_shift, pht_address);
 	  
-	  PORT_WRITE (out_BRANCH_COMPLETE_PHT_ADDRESS [i], (history xor address) & gen_mask<Taddress_t>(_param._pht_size_address));
+	  PORT_WRITE (out_BRANCH_COMPLETE_PHT_ADDRESS [i], pht_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_genMealy_predict_bht_address.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_genMealy_predict_bht_address.cpp	(revision 2)
+++ 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_genMealy_predict_bht_address.cpp	(revision 3)
@@ -26,7 +26,8 @@
 	{
 	  // Address
-	  Taddress_t address = PORT_READ(in_PREDICT_ADDRESS [i]);
+	  Taddress_t     address = PORT_READ(in_PREDICT_ADDRESS [i]);
+	  Taddress_t bht_address = range<Taddress_t>(_param._size_address, address, _param._bht_size_address);
 	  
-	  PORT_WRITE (out_PREDICT_BHT_ADDRESS [i], range<Taddress_t>(_param._size_address, address, _param._bht_size_address));
+	  PORT_WRITE (out_PREDICT_BHT_ADDRESS [i], bht_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_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 2)
+++ 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 3)
@@ -21,6 +21,4 @@
   {
     log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"vhdl_port","Begin");
-
-    vhdl.set_port (" in_CLOCK" , IN, 1);
 
     for (uint32_t i=0; i<_param._nb_prediction; i++)
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 2)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/include/Two_Level_Branch_Predictor.h	(revision 3)
@@ -84,5 +84,5 @@
   public    : SC_IN (Tbht_history_t)       **  in_BRANCH_COMPLETE_BHT_HISTORY;
   public    : SC_IN (Tpht_history_t)       **  in_BRANCH_COMPLETE_PHT_HISTORY;
-  public    : SC_IN (Tcontrol_t)           **  in_BRANCH_COMPLETE_HIT        ;
+  public    : SC_IN (Tcontrol_t)           **  in_BRANCH_COMPLETE_DIRECTION  ;
 
     // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
@@ -93,5 +93,4 @@
   private   : SC_SIGNAL(Taddress_t)        ** signal_PREDICT_BHT_ADDRESS        ;
   private   : SC_SIGNAL(Taddress_t)        ** signal_PREDICT_PHT_ADDRESS        ;
-  private   : SC_SIGNAL(Tbht_history_t)    ** signal_PREDICT_BHT_HISTORY        ;
 
   private   : SC_SIGNAL(Tcontrol_t)        ** signal_BRANCH_COMPLETE_BHT_ACK    ;
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Parameters.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Parameters.cpp	(revision 2)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Parameters.cpp	(revision 3)
@@ -32,5 +32,5 @@
     _pht_size_counter       ((_have_pht == true)?pht_size_counter:0),
     _pht_nb_counter         ((_have_pht == true)?pht_nb_counter  :0),
-    _pht_size_address_share (pht_size_address_share),
+    _pht_size_address_share (((_have_bht and _have_pht) == true)?pht_size_address_share:0),
     _size_address           (size_address      ),
     _nb_prediction          (nb_prediction     ),
@@ -41,8 +41,10 @@
     log_printf(FUNC,Two_Level_Branch_Predictor,"Parameters","Begin");
     
+    if (_have_bht)
     _param_branch_history_table  = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::branch_history_table ::Parameters (_bht_size_shifter  ,
 																				       _bht_nb_shifter    ,
 																				       _nb_prediction     ,
 																				       _nb_branch_complete);
+    if (_have_pht)
     _param_pattern_history_table = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::pattern_history_table::Parameters (_pht_size_counter  ,
 																				       _pht_nb_counter    ,
@@ -82,8 +84,10 @@
     log_printf(FUNC,Two_Level_Branch_Predictor,"Parameters","Begin");
 
+    if (_have_bht)
     _param_branch_history_table  = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::branch_history_table ::Parameters (_bht_size_shifter  ,
 																				       _bht_nb_shifter    ,
 																				       _nb_prediction     ,
 																				       _nb_branch_complete);
+    if (_have_pht)
     _param_pattern_history_table = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::pattern_history_table::Parameters (_pht_size_counter  ,
 																				       _pht_nb_counter    ,
@@ -109,5 +113,7 @@
     log_printf(FUNC,Two_Level_Branch_Predictor,"~Parameters","Begin");
 
+    if (_have_bht)
     delete _param_branch_history_table;
+    if (_have_pht)
     delete _param_pattern_history_table;
     delete _param_two_level_branch_predictor_glue;
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Parameters_msg_error.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Parameters_msg_error.cpp	(revision 2)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Parameters_msg_error.cpp	(revision 3)
@@ -65,4 +65,11 @@
       }
 
+//     if ( not _have_bht and (_pht_size_address_share != 0))
+//     {
+// 	msg += "  - you have no Branch History Table but size_address_share is > 0\n";
+// 	msg += "    * have_bht                        : " + toString(_have_bht              ) + "\n";
+// 	msg += "    * pht_size_address_share          : " + toString(_pht_size_address_share) + "\n";
+//     }
+
     return msg;
 
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 2)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_allocation.cpp	(revision 3)
@@ -35,5 +35,4 @@
     signal_PREDICT_BHT_ACK          = new SC_SIGNAL(Tcontrol_t)     * [_param._nb_prediction];
     signal_PREDICT_BHT_ADDRESS      = new SC_SIGNAL(Taddress_t)     * [_param._nb_prediction];
-    signal_PREDICT_BHT_HISTORY      = new SC_SIGNAL(Tbht_history_t) * [_param._nb_prediction];
       }
     if (_param._have_pht)
@@ -45,5 +44,5 @@
     for (uint32_t i=0; i<_param._nb_prediction; i++)
       {
-	rename = " in_PREDICT_VAL_"        +toString(i);
+	rename = "in_PREDICT_VAL_"         +toString(i);
 	 in_PREDICT_VAL                 [i] = new SC_IN (Tcontrol_t)     (rename.c_str());
 
@@ -51,5 +50,5 @@
 	out_PREDICT_ACK                 [i] = new SC_OUT(Tcontrol_t)     (rename.c_str());
 
-	rename = " in_PREDICT_ADDRESS_"    +toString(i);
+	rename = "in_PREDICT_ADDRESS_"     +toString(i);
 	 in_PREDICT_ADDRESS             [i] = new SC_IN (Taddress_t)     (rename.c_str());
 
@@ -73,7 +72,4 @@
 	rename = "signal_PREDICT_BHT_ADDRESS_"+toString(i);
 	signal_PREDICT_BHT_ADDRESS      [i] = new SC_SIGNAL(Taddress_t)     (rename.c_str());
-
-	rename = "signal_PREDICT_BHT_HISTORY_"+toString(i);
-	signal_PREDICT_BHT_HISTORY      [i] = new SC_SIGNAL(Tbht_history_t) (rename.c_str());
 	  }
 
@@ -95,5 +91,5 @@
     if (_param._have_pht)
      in_BRANCH_COMPLETE_PHT_HISTORY = new SC_IN (Tpht_history_t) * [_param._nb_branch_complete];
-     in_BRANCH_COMPLETE_HIT         = new SC_IN (Tcontrol_t)     * [_param._nb_branch_complete];
+     in_BRANCH_COMPLETE_DIRECTION   = new SC_IN (Tcontrol_t)     * [_param._nb_branch_complete];
     if (_param._have_bht)
       {
@@ -109,5 +105,5 @@
     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
       {
-	rename = " in_BRANCH_COMPLETE_VAL_"        +toString(i);
+	rename = "in_BRANCH_COMPLETE_VAL_"         +toString(i);
 	 in_BRANCH_COMPLETE_VAL         [i] = new SC_IN (Tcontrol_t)     (rename.c_str());
 
@@ -115,19 +111,19 @@
 	out_BRANCH_COMPLETE_ACK         [i] = new SC_OUT(Tcontrol_t)     (rename.c_str());
 
-	rename = " in_BRANCH_COMPLETE_ADDRESS_"    +toString(i);
+	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);
+    	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_bht)
-	  {
-	rename = " in_BRANCH_COMPLETE_PHT_HISTORY_"+toString(i);
+	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_HIT_"        +toString(i);
-	 in_BRANCH_COMPLETE_HIT         [i] = new SC_IN (Tcontrol_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)
 	  {
@@ -155,4 +151,6 @@
       {
 	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()               ,
@@ -170,14 +168,14 @@
 	    (*(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]))    (*(signal_PREDICT_BHT_HISTORY  [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_HIT     [i]))    (*(    in_BRANCH_COMPLETE_HIT         [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]));
 	  }
       }
@@ -187,4 +185,6 @@
       {
 	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()               ,
@@ -207,71 +207,70 @@
 	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_HIT     [i]))    (*(    in_BRANCH_COMPLETE_HIT         [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 ]===========================    
-    if (_param._have_pht)
-      {
-	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()               ,
+    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
+																										   _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));
+    (*(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)
-	      {
+    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)								   							  
-	      {											   										  
+	  }											   										  
+	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])) (*(signal_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)
-	      {
+	  }											   										  
+	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)							   					       	  
-	      {										   					       				  
+	  }										   					       				  
+	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)					   					  
-	      {										   					       				  
+	  }										   					       				  
+	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_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
 }; // end namespace meta_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 2)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_deallocation.cpp	(revision 3)
@@ -35,5 +35,4 @@
 	delete signal_PREDICT_BHT_ACK          [i];
 	delete signal_PREDICT_BHT_ADDRESS      [i];
-	delete signal_PREDICT_BHT_HISTORY      [i];
 	  }
 	if (_param._have_pht)
@@ -56,5 +55,4 @@
     delete signal_PREDICT_BHT_ACK    ;
     delete signal_PREDICT_BHT_ADDRESS;
-    delete signal_PREDICT_BHT_HISTORY;
       }
     if (_param._have_pht)
@@ -71,7 +69,7 @@
 	if (_param._have_bht)
 	delete  in_BRANCH_COMPLETE_BHT_HISTORY [i];
-	if (_param._have_bht)
+	if (_param._have_pht)
 	delete  in_BRANCH_COMPLETE_PHT_HISTORY [i];
-	delete  in_BRANCH_COMPLETE_HIT         [i];
+	delete  in_BRANCH_COMPLETE_DIRECTION   [i];
 	if (_param._have_bht)
 	  {
@@ -93,5 +91,5 @@
     if (_param._have_pht)
     delete  in_BRANCH_COMPLETE_PHT_HISTORY;
-    delete  in_BRANCH_COMPLETE_HIT        ;
+    delete  in_BRANCH_COMPLETE_DIRECTION  ;
     if (_param._have_bht)
       {
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_statistics.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_statistics.cpp	(revision 2)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_statistics.cpp	(revision 3)
@@ -22,7 +22,10 @@
     log_printf(FUNC,Two_Level_Branch_Predictor,"statistics","Begin");
 
+    string stat_component_Branch_History_Table  = (_param._have_bht==false)?"":component_Branch_History_Table  ->statistics(depth+1);
+    string stat_component_Pattern_History_Table = (_param._have_pht==false)?"":component_Pattern_History_Table ->statistics(depth+1);
+
     string txt = _stat->print(depth,
-			      component_Branch_History_Table           ->statistics(depth+1) +
-			      component_Pattern_History_Table          ->statistics(depth+1) +
+			      stat_component_Branch_History_Table                            +
+			      stat_component_Pattern_History_Table                           +
 			      component_Two_Level_Branch_Predictor_Glue->statistics(depth+1)
 			      );
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 2)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl.cpp	(revision 3)
@@ -24,5 +24,10 @@
 
     vhdl.set_library_work (_name + "_Pack");
-
+    if (_param._have_bht)
+    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_port        (vhdl);
     vhdl_declaration (vhdl);
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 2)
+++ 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 3)
@@ -20,5 +20,107 @@
   {
     log_printf(FUNC,Two_Level_Branch_Predictor,"vhdl_body","Begin");
-    vhdl.set_body ("");
+
+    list<string> list_port_map;
+
+    if (_param._have_bht)
+      {
+	list_port_map.clear();
+
+	vhdl.set_body_component_port_map (list_port_map,"in_CLOCK","in_CLOCK");
+
+	for (uint32_t i=0; i<_param._nb_prediction; i++)
+	  {
+	    vhdl.set_body_component_port_map (list_port_map," in_PREDICT_VAL_"+toString(i)+"              ","    in_PREDICT_VAL_"+toString(i));
+	    vhdl.set_body_component_port_map (list_port_map,"out_PREDICT_ACK_"+toString(i)+"              ","signal_PREDICT_BHT_ACK_"+toString(i));
+	    vhdl.set_body_component_port_map (list_port_map," in_PREDICT_ADDRESS_"+toString(i)+"          ","signal_PREDICT_BHT_ADDRESS_"+toString(i));
+	    vhdl.set_body_component_port_map (list_port_map,"out_PREDICT_HISTORY_"+toString(i)+"          ","signal_PREDICT_BHT_HISTORY_"+toString(i));
+	  }
+	
+	for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+	  {
+	    vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_VAL_"+toString(i)+"      ","    in_BRANCH_COMPLETE_VAL_"+toString(i));
+	    vhdl.set_body_component_port_map (list_port_map,"out_BRANCH_COMPLETE_ACK_"+toString(i)+"      ","signal_BRANCH_COMPLETE_BHT_ACK_"+toString(i));
+	    vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_ADDRESS_"+toString(i)+"  ","signal_BRANCH_COMPLETE_BHT_ADDRESS_"+toString(i));
+	    vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_HISTORY_"+toString(i)+"  ","    in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i));
+	    vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_DIRECTION_"+toString(i)+"","    in_BRANCH_COMPLETE_DIRECTION_"+toString(i));
+	  }
+	
+	vhdl.set_body_component ("component_Branch_History_Table",_name+"_Branch_History_Table",list_port_map);
+      }
+
+    if (_param._have_pht)
+      {
+	list_port_map.clear();
+
+	vhdl.set_body_component_port_map (list_port_map,"in_CLOCK","in_CLOCK");
+
+	for (uint32_t i=0; i<_param._nb_prediction; i++)
+	  {
+	    vhdl.set_body_component_port_map (list_port_map," in_PREDICT_VAL_"+toString(i)+"              ","    in_PREDICT_VAL_"+toString(i));
+	    vhdl.set_body_component_port_map (list_port_map,"out_PREDICT_ACK_"+toString(i)+"              ","signal_PREDICT_PHT_ACK_"+toString(i));
+	    vhdl.set_body_component_port_map (list_port_map," in_PREDICT_ADDRESS_"+toString(i)+"          ","signal_PREDICT_PHT_ADDRESS_"+toString(i));
+	    vhdl.set_body_component_port_map (list_port_map,"out_PREDICT_HISTORY_"+toString(i)+"          ","   out_PREDICT_PHT_HISTORY_"+toString(i));
+	  }
+	
+	for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+	  {
+	    vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_VAL_"+toString(i)+"      ","    in_BRANCH_COMPLETE_VAL_"+toString(i));
+	    vhdl.set_body_component_port_map (list_port_map,"out_BRANCH_COMPLETE_ACK_"+toString(i)+"      ","signal_BRANCH_COMPLETE_PHT_ACK_"+toString(i));
+	    vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_ADDRESS_"+toString(i)+"  ","signal_BRANCH_COMPLETE_PHT_ADDRESS_"+toString(i));
+	    vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_HISTORY_"+toString(i)+"  ","    in_BRANCH_COMPLETE_PHT_HISTORY_"+toString(i));
+	    vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_DIRECTION_"+toString(i)+"","    in_BRANCH_COMPLETE_DIRECTION_"+toString(i));
+	  }
+	
+	vhdl.set_body_component ("component_Pattern_History_Table",_name+"_Pattern_History_Table",list_port_map);
+      }
+
+    list_port_map.clear();
+    
+    for (uint32_t i=0; i<_param._nb_prediction; i++)
+      {
+	if (_param._have_bht)
+	  {
+	vhdl.set_body_component_port_map (list_port_map," in_PREDICT_BHT_ACK_"+toString(i)+"            ","signal_PREDICT_BHT_ACK_"+toString(i));
+	vhdl.set_body_component_port_map (list_port_map,"out_PREDICT_BHT_ADDRESS_"+toString(i)+"        ","signal_PREDICT_BHT_ADDRESS_"+toString(i));
+	  }											   										  
+	if (_param._have_pht)								   							  
+	  {											   										  
+	vhdl.set_body_component_port_map (list_port_map," in_PREDICT_PHT_ACK_"+toString(i)+"            ","signal_PREDICT_PHT_ACK_"+toString(i));
+	vhdl.set_body_component_port_map (list_port_map,"out_PREDICT_PHT_ADDRESS_"+toString(i)+"        ","signal_PREDICT_PHT_ADDRESS_"+toString(i));
+	  }											   										  
+	if (_param._have_bht and _param._have_pht)						   					  
+	  {											   										  
+	vhdl.set_body_component_port_map (list_port_map," in_PREDICT_BHT_HISTORY_"+toString(i)+"        ","signal_PREDICT_BHT_HISTORY_"+toString(i));
+	  }											   										  
+	vhdl.set_body_component_port_map (list_port_map,"out_PREDICT_ACK_"+toString(i)+"                ","   out_PREDICT_ACK_"+toString(i));
+	vhdl.set_body_component_port_map (list_port_map," in_PREDICT_ADDRESS_"+toString(i)+"            ","    in_PREDICT_ADDRESS_"+toString(i));
+      }
+    
+    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+      {
+	if (_param._have_bht)
+	  {
+	vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_BHT_ACK_"+toString(i)+"    ","signal_BRANCH_COMPLETE_BHT_ACK_"+toString(i));
+	vhdl.set_body_component_port_map (list_port_map,"out_BRANCH_COMPLETE_BHT_ADDRESS_"+toString(i)+"","signal_BRANCH_COMPLETE_BHT_ADDRESS_"+toString(i));
+	  }										   					       				  
+	if (_param._have_pht)
+	  {
+	vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_PHT_ACK_"+toString(i)+"    ","signal_BRANCH_COMPLETE_PHT_ACK_"+toString(i));
+	vhdl.set_body_component_port_map (list_port_map,"out_BRANCH_COMPLETE_PHT_ADDRESS_"+toString(i)+"","signal_BRANCH_COMPLETE_PHT_ADDRESS_"+toString(i));
+	  }										   					       				  
+	if (_param._have_bht and _param._have_pht)
+	  {
+        vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i)+"","    in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i));
+	  }										   					       				  
+	vhdl.set_body_component_port_map (list_port_map,"out_BRANCH_COMPLETE_ACK_"+toString(i)+"        ","   out_BRANCH_COMPLETE_ACK_"+toString(i));
+	vhdl.set_body_component_port_map (list_port_map," in_BRANCH_COMPLETE_ADDRESS_"+toString(i)+"    ","    in_BRANCH_COMPLETE_ADDRESS_"+toString(i));
+      }
+
+    vhdl.set_body_component ("component_Two_Level_Branch_Predictor_Glue",_name+"_Two_Level_Branch_Predictor_Glue",list_port_map);
+
+    if (_param._have_bht)
+      for (uint32_t i=0; i<_param._nb_prediction; i++)
+	vhdl.set_body("out_PREDICT_BHT_HISTORY_"+toString(i)+" <= signal_PREDICT_BHT_HISTORY_"+toString(i)+";");
+    
     log_printf(FUNC,Two_Level_Branch_Predictor,"vhdl_body","End");
   };
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 2)
+++ 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 3)
@@ -20,4 +20,33 @@
   {
     log_printf(FUNC,Two_Level_Branch_Predictor,"vhdl_declaration","Begin");
+
+    for (uint32_t i=0; i<_param._nb_prediction; i++)
+      {
+	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);
+	  }
+	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);
+	  }
+      }
+
+    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+      {
+	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);
+	  }
+	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);
+	  }
+      }
     log_printf(FUNC,Two_Level_Branch_Predictor,"vhdl_declaration","End");
   };
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 2)
+++ 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 3)
@@ -16,5 +16,4 @@
 namespace two_level_branch_predictor {
 
-
   void Two_Level_Branch_Predictor::vhdl_port (Vhdl & vhdl)
   {
@@ -25,23 +24,23 @@
     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);
+	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,static_cast<uint32_t>(ceil(log2(_param._bht_nb_shifter))));
+	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,static_cast<uint32_t>(ceil(log2(_param._pht_nb_counter))));
+    	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);
+	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,static_cast<uint32_t>(ceil(log2(_param._bht_nb_shifter))));
-	if (_param._have_bht)
-	vhdl.set_port (" in_BRANCH_COMPLETE_PHT_HISTORY_"+toString(i), IN,static_cast<uint32_t>(ceil(log2(_param._pht_nb_counter))));
-	vhdl.set_port (" in_BRANCH_COMPLETE_HIT_"        +toString(i), IN, 1);
+    	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);
       }
 
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 2)
+++ 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 3)
@@ -27,7 +27,7 @@
 	_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,static_cast<uint32_t>(ceil(log2(_param._bht_nb_shifter))));
+	_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,static_cast<uint32_t>(ceil(log2(_param._pht_nb_counter))));
+    	_vhdl_testbench->set_port ("out_PREDICT_PHT_HISTORY_"+toString(i),OUT,_param._pht_size_counter);
       }
 
@@ -38,8 +38,8 @@
 	_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,static_cast<uint32_t>(ceil(log2(_param._bht_nb_shifter))));
-	if (_param._have_bht)
-	_vhdl_testbench->set_port (" in_BRANCH_COMPLETE_PHT_HISTORY_"+toString(i), IN,static_cast<uint32_t>(ceil(log2(_param._pht_nb_counter))));
-	_vhdl_testbench->set_port (" in_BRANCH_COMPLETE_HIT_"        +toString(i), IN, 1);
+    	_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);
       }
 
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 2)
+++ 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 3)
@@ -29,26 +29,31 @@
     // (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(out_PREDICT_ACK                 [i]));
-	_vhdl_testbench->add_input (PORT_READ( in_PREDICT_ADDRESS             [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(out_PREDICT_BHT_HISTORY         [i]));
+	_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(out_PREDICT_PHT_HISTORY         [i]));
+	_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(out_BRANCH_COMPLETE_ACK         [i]));
-	_vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_ADDRESS     [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_bht)
-	_vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_PHT_HISTORY [i]));
-	_vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_HIT         [i]));
+	_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]));
       }
     
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Configuration_Parameters.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Configuration_Parameters.h	(revision 3)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Configuration_Parameters.h	(revision 3)
@@ -0,0 +1,54 @@
+#ifndef morpheo_behavioural_Configuration_Parameters_h
+#define morpheo_behavioural_Configuration_Parameters_h
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include <stdint.h>
+#include <iostream>
+#include "Behavioural/include/XML.h"
+#include "Include/ErrorMorpheo.h"
+#include "Include/ToString.h"
+using namespace std;
+
+namespace morpheo     {
+namespace behavioural {
+
+  class Configuration_Parameters
+  {
+    // -----[ fields ]----------------------------------------------------
+    // Constant
+  public   : const string    _name   ;
+  public   : const uint32_t  _value  ;
+  public   : const uint32_t  _min    ;
+  public   : const uint32_t  _max    ;
+  public   : const string    _step   ;
+  public   : const uint32_t  _default;
+  public   : const uint32_t  _level  ;
+  public   : const string    _comment;
+
+    // -----[ methods ]---------------------------------------------------
+  public   :                 Configuration_Parameters  (string   name   ,
+							uint32_t value  ,
+							uint32_t min    ,
+							uint32_t max    ,
+							string   step   ,
+							uint32_t value_default,
+							uint32_t level  ,
+							string   comment);
+  public   :                 ~Configuration_Parameters ();
+
+    // methods to print and test parameters_configuration
+  public   : string          print                      (uint32_t depth);
+  public   : friend ostream& operator<<                 (ostream& output_stream,
+							 morpheo::behavioural::Configuration_Parameters & x);
+  };
+
+}; // end namespace behavioural          
+}; // end namespace morpheo              
+
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Debug_component.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Debug_component.h	(revision 2)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Debug_component.h	(revision 3)
@@ -5,7 +5,7 @@
 
 // Behavioural/Generic/
-#define DEBUG_Counter                                     false
+#define DEBUG_Counter                                     false 
 #define DEBUG_Group                                       false
-#define DEBUG_Register_File                               false
+#define DEBUG_Register_File                               false 
 #define DEBUG_Shifter                                     false
 // Behavioural/Generic/Select/
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/XML.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/include/XML.h	(revision 2)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/include/XML.h	(revision 3)
@@ -23,17 +23,11 @@
   class XML
   {
-    typedef enum {_none     ,
-		  _balise   ,
-		  _singleton,
-		  _comment  } balise_t;
-    
     // -----[ fields ]----------------------------------------------------
-  private  : const string     _filename        ;
+  private  : const string     _name            ;
   private  : string           _body            ;
   private  : list<string>     _list_balise_name;
-    
+
     // -----[ methods ]---------------------------------------------------
-  public   :                  XML                 (string filename);
-  public   :                  XML                 (string filename, string encoding);
+  public   :                  XML                 (string name);
   public   :                  ~XML                (void);
 	
@@ -47,4 +41,9 @@
   public   : bool             attribut            (string name, string value);
 
+  public   : void             generate_file       (void);
+  public   : void             generate_file       (string encoding);
+  public   : string           get_body            (void);
+  public   : string           get_body            (uint32_t depth);
+
   public   : bool             comment             (string text);
   public   : bool             text                (string text);
@@ -55,7 +54,4 @@
 					          
   private  : void             header              (string encoding);
-					          
-  public   : void             generate_file       (void);
-  public   : string           get_body            (void);
   };
 }; // end namespace behavioural          
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Configuration_Parameters.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Configuration_Parameters.cpp	(revision 3)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Configuration_Parameters.cpp	(revision 3)
@@ -0,0 +1,41 @@
+#ifdef CONFIGURATION
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/include/Configuration_Parameters.h"
+
+namespace morpheo              {
+namespace behavioural          {
+    
+  Configuration_Parameters::Configuration_Parameters  (string   name   ,
+						       uint32_t value  ,
+						       uint32_t min    ,
+						       uint32_t max    ,
+						       string   step   ,
+						       uint32_t value_default,
+						       uint32_t level  ,
+						       string   comment):
+    _name    (name         ),
+    _value   (value        ),
+    _min     (min          ),
+    _max     (max          ),
+    _step    (step         ),
+    _default (value_default),
+    _level   (level        ),
+    _comment (comment      )
+  {
+    if ((value<min) or (value>max))
+      throw (ErrorMorpheo ("Parameters \""+name+"\" is out of bound : "+toString(value)+" not include in ["+toString(min)+":"+toString(max)+"]"));
+  };
+    
+  Configuration_Parameters::~Configuration_Parameters () 
+  {
+  };
+
+}; // end namespace behavioural          
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Configuration_Parameters_print.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Configuration_Parameters_print.cpp	(revision 3)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Configuration_Parameters_print.cpp	(revision 3)
@@ -0,0 +1,44 @@
+#ifdef CONFIGURATION
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/include/Configuration_Parameters.h"
+
+
+namespace morpheo              {
+namespace behavioural          {
+
+  string Configuration_Parameters::print (uint32_t depth)
+  {
+    XML * xml = new XML (_name);
+    
+    xml->balise_open_begin("generic");
+    xml->  attribut("name"   ,         _name  );
+    xml->  attribut("value"  ,toString(_value));
+    xml->  attribut("min"    ,toString(_min  ));
+    xml->  attribut("max"    ,toString(_max  ));
+    xml->  attribut("step"   ,         _step  );
+    xml->  attribut("default",toString(_value));
+    xml->  attribut("level"  ,toString(_level));
+    xml->balise_open_end  ();
+    xml->  text  (_comment);
+    xml->balise_close();
+    
+    return xml->get_body(depth);
+  };
+  
+  ostream& operator<< (ostream& output_stream,
+		       morpheo::behavioural::Configuration_Parameters & x)
+  {
+    output_stream << x.print(0);
+
+    return output_stream;
+  };
+
+}; // end namespace behavioural          
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML.cpp	(revision 2)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML.cpp	(revision 3)
@@ -11,15 +11,7 @@
 namespace behavioural          {
 
-  XML::XML  (string filename) :
-    _filename (filename)
+  XML::XML  (string name) :
+    _name (name)
   {
-    header ("UTF-8");
-  };
-
-  XML::XML  (string filename,
-	     string encoding) :
-    _filename (filename)
-  {
-    header(encoding);
   };
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_balise_open_end.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_balise_open_end.cpp	(revision 2)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_balise_open_end.cpp	(revision 3)
@@ -13,5 +13,5 @@
   bool XML::balise_open_end (void)
   {
-    _body += ">\n";
+    _body += " >\n";
 
     return true;
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_generate_file.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_generate_file.cpp	(revision 2)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_generate_file.cpp	(revision 3)
@@ -7,10 +7,30 @@
 
 #include "Behavioural/include/XML.h"
+#include <fstream>
+using namespace std;
 
 namespace morpheo              {
 namespace behavioural          {
 
+  void XML::generate_file (string encoding)
+  {
+    header (encoding);
+
+    string name     = _name;
+    string filename =  name + ".xml";
+
+    cout << "Generate file \""<< filename << "\"" << endl;
+
+    ofstream file;
+    file.open(filename.c_str(),ios::out | ios::trunc);
+
+    file << get_body();
+
+    file.close();
+  };
+
   void XML::generate_file (void)
   {
+    generate_file("UTF-8");
   };
 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_get_body.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_get_body.cpp	(revision 2)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_get_body.cpp	(revision 3)
@@ -16,4 +16,16 @@
   };
 
+  string XML::get_body (uint32_t depth)
+  {
+    string body       = _body;
+    string tabulation = indent(depth);
+
+    body.insert(0,tabulation);
+    for (size_t pos=body.find('\n',0); pos<body.length()-1; pos=body.find('\n',++pos))
+      body.insert(++pos,tabulation);
+
+    return body;
+  };
+
 }; // end namespace behavioural          
 }; // end namespace morpheo              
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_header.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_header.cpp	(revision 2)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_header.cpp	(revision 3)
@@ -13,5 +13,5 @@
   void XML::header (string encoding)
   {
-    _body += "<?xml version=\"1.0\" encoding=\""+encoding+"\"?>\n";
+    _body = "<?xml version=\"1.0\" encoding=\""+encoding+"\" ?>\n" + _body;
   };
 
Index: trunk/IPs/systemC/processor/Morpheo/Documentation/Source/Makefile
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Documentation/Source/Makefile	(revision 2)
+++ trunk/IPs/systemC/processor/Morpheo/Documentation/Source/Makefile	(revision 3)
@@ -29,4 +29,5 @@
 DIR_SCHEMA		= Schema
 DIR_SCHEMA_EPS		= Schema_eps
+DIR_SCHEMA_JPG		= Schema_jpg
 DIR_TEX			= Source
 
@@ -69,4 +70,5 @@
 # Commands to generate all documents
 FIG2EPS			= fig2dev -L eps
+EPS2JPG			= convert -quality 100
 LATEX     		= latex
 BIBTEX    		= bibtex
@@ -84,5 +86,5 @@
 #--------------------------------------------------------------------------------
 .PHONY 			: all clean view help doc doc_all new delete
-.SECONDARY 		: $(DVI_FILES) $(PS_FILES) $(PDF_FILES) $(EPS_FILES) $(DIR_SCHEMA_EPS)
+.SECONDARY 		: $(DVI_FILES) $(PS_FILES) $(PDF_FILES) $(EPS_FILES) $(DIR_SCHEMA_EPS) $(DIR_SCHEMA_JPG)
 
 all 			: help
@@ -392,20 +394,26 @@
 			@$(MKDIR) $@
 
+$(DIR_SCHEMA_JPG)	:
+			@$(ECHO) "Make directory       : $@"
+			@$(MKDIR) $@
+
 $(DIR_TEX)       	:
 			@$(ECHO) "Make directory       : $@"
 			@$(MKDIR) $@
 
-$(DIR_SCHEMA_EPS)/%.eps	: $(DIR_SCHEMA)/%.eps $(DIR_SCHEMA_EPS)
+$(DIR_SCHEMA_EPS)/%.eps	: $(DIR_SCHEMA)/%.eps $(DIR_SCHEMA_EPS) $(DIR_SCHEMA_JPG)
 			@$(ECHO) "Generate   files     : $*.eps"
 			@$(CP) $(DIR_SCHEMA)/$*.eps $(DIR_SCHEMA_EPS)
-
-$(DIR_SCHEMA_EPS)/%.eps	: $(DIR_SCHEMA)/%.fig $(DIR_SCHEMA_EPS)
+			@$(EPS2JPG) $@ $(DIR_SCHEMA_JPG)/$*.jpg
+
+$(DIR_SCHEMA_EPS)/%.eps	: $(DIR_SCHEMA)/%.fig $(DIR_SCHEMA_EPS) $(DIR_SCHEMA_JPG)
 			@$(ECHO) "Generate   files     : $*.eps"
 			@$(FIG2EPS) $< $@
-
-$(DIR_SCHEMA_EPS)/%.eps	: $(DIR_GRAPH)/%.p    $(DIR_SCHEMA_EPS)
+			@$(EPS2JPG) $@ $(DIR_SCHEMA_JPG)/$*.jpg
+
+$(DIR_SCHEMA_EPS)/%.eps	: $(DIR_GRAPH)/%.p    $(DIR_SCHEMA_EPS) $(DIR_SCHEMA_JPG)
 			@$(ECHO) "Generate   files     : $*.eps"
 			@$(CD) $(DIR_GRAPH); $(GNUPLOT) $*.p
-
+			@$(EPS2JPG) $@ $(DIR_SCHEMA_JPG)/$*.jpg
 
 #--------------------------------------------------------------------------------
@@ -415,5 +423,5 @@
 clean			:
 			@$(ECHO) "Delete     temporary files              "$(PWD)
-			@$(RM) $(DIR_SCHEMA_EPS)  $(DIR_TEX) $(DIR_PACKAGE)/*.aux
+			@$(RM) $(DIR_SCHEMA_EPS) $(DIR_SCHEMA_JPG)  $(DIR_TEX) $(DIR_PACKAGE)/*.aux
 			@$(RM) $(DVI_FILES) $(PS_FILES) $(PDF_FILES)
 			@$(MAKE) clean_rec DIR_CLEAN=.  
Index: trunk/IPs/systemC/processor/Morpheo/Include/Debug.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Include/Debug.h	(revision 2)
+++ trunk/IPs/systemC/processor/Morpheo/Include/Debug.h	(revision 3)
@@ -43,5 +43,5 @@
         fprintf(stdout,"In file %s, ",__FILE__);                                      \
         fprintf(stdout,"at line %d, ",__LINE__);                                      \
-        fprintf(stdout,"in function \"%s\" : ",func);                                \
+        fprintf(stdout,"in function \"%s\" : ",func);                                 \
         fprintf(stdout,str);                                                          \
         fprintf(stdout,"\n");                                                         \
Index: trunk/IPs/systemC/processor/Morpheo/Include/ErrorMorpheo.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Include/ErrorMorpheo.h	(revision 2)
+++ trunk/IPs/systemC/processor/Morpheo/Include/ErrorMorpheo.h	(revision 3)
@@ -29,4 +29,16 @@
   };
 
+  class TestMorpheo : public exception 
+  {
+    // -----[ fields ]----------------------------------------------------
+  private : string _msg;
+    
+    // -----[ methods ]---------------------------------------------------
+  public  :             TestMorpheo   ()           throw() { _msg = "Test error ...";}
+  public  :             TestMorpheo   (string msg) throw() { _msg = msg;}
+  public  :             ~TestMorpheo  (void)       throw() {}
+  public  : const char* what          ()    const  throw() { return ( _msg.c_str() );}
+  };
+
 }; // end namespace morpheo              
 
Index: trunk/IPs/systemC/processor/Morpheo/Include/Test.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Include/Test.h	(revision 2)
+++ trunk/IPs/systemC/processor/Morpheo/Include/Test.h	(revision 3)
@@ -5,4 +5,5 @@
 #include <sstream>
 #include <stdint.h>
+#include "Include/ErrorMorpheo.h"
 using namespace std;
 
@@ -14,13 +15,13 @@
 void test_ko (T exp1, T exp2, char * file, uint32_t line)
 {
-  cout << "{" << num_test << "} : Test KO" << endl
-       << " * Localisation"                << endl
-       << "   - File : " << file           << endl
-       << "   - Line : " << line           << endl
-       << " * Expression is different "    << endl
-       << "   - exp1 : " << exp1           << endl
-       << "   - exp2 : " << exp2           << endl;
-
-  exit (line);
+  string msg = ("{"+toString(num_test)+"} : Test KO\n" +
+		" * Localisation\n"                    +
+		"   - File : "+file+"\n"               +
+		"   - Line : "+toString(line)+"\n"     +
+		" * Expression is different\n"         +
+		"   - exp1 : "+toString(exp1)+"\n"     +
+		"   - exp2 : "+toString(exp2)+"\n");
+  
+  throw (ErrorMorpheo (msg));
 };
 
