Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Makefile
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Makefile	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Makefile	(revision 46)
@@ -0,0 +1,24 @@
+# 
+# $Id$
+# 
+# [ Description ]
+# 
+# Makefile
+# 
+
+#-----[ Directory ]----------------------------------------
+DIR_COMPONENT			= .
+include				$(DIR_COMPONENT)/Makefile.defs
+
+#-----[ Library ]------------------------------------------
+LIBRARY				= $(DIR_LIB)/libMeta_Predictor.a
+
+
+#-----[ include ]------------------------------------------
+
+all				:
+				@$(MAKE) all_component
+
+include                         $(DIR_MORPHEO)/Behavioural/Makefile.flags
+include				$(DIR_MORPHEO)/Behavioural/Makefile.Common
+include				$(DIR_MORPHEO)/Behavioural/Makefile.Component
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Makefile.defs
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Makefile.defs	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Makefile.defs	(revision 46)
@@ -0,0 +1,11 @@
+# 
+# $Id$
+# 
+# [ Description ]
+# 
+# Makefile
+# 
+
+#-----[ Directory ]----------------------------------------
+DIR_COMPONENT_MORPHEO		= ../../../..
+DIR_MORPHEO			= $(DIR_COMPONENT)/$(DIR_COMPONENT_MORPHEO)
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Makefile.deps
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Makefile.deps	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Makefile.deps	(revision 46)
@@ -0,0 +1,45 @@
+# 
+# $Id$
+# 
+# [ Description ]
+# 
+# Makefile
+# 
+# DIR_MORPHEO must be defined
+
+ifndef Behavioural
+include $(DIR_MORPHEO)/Behavioural/Makefile.deps
+endif
+ifndef Two_Level_Branch_Predictor
+include $(DIR_MORPHEO)/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Makefile.deps
+endif
+ifndef Meta_Predictor_Glue
+include $(DIR_MORPHEO)/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/Makefile.deps
+endif
+
+Meta_Predictor			= yes
+
+#-----[ Library ]------------------------------------------
+Meta_Predictor_LIBRARY		= 	-lMeta_Predictor			\
+					$(Meta_Predictor_Glue_LIBRARY)		\
+					$(Two_Level_Branch_Predictor_LIBRARY)	\
+					$(Behavioural_LIBRARY)	
+
+Meta_Predictor_DIR_LIBRARY	=	-L$(DIR_MORPHEO)/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/lib	\
+					$(Meta_Predictor_Glue_DIR_LIBRARY)						\
+					$(Two_Level_Branch_Predictor_DIR_LIBRARY)					\
+					$(Behavioural_DIR_LIBRARY)
+
+#-----[ Rules ]--------------------------------------------
+
+Meta_Predictor_library		: 
+				@$(MAKE) Behavioural_library
+				@$(MAKE) Meta_Predictor_Glue_library
+				@$(MAKE) Two_Level_Branch_Predictor_library
+				@$(MAKE) --directory=$(DIR_MORPHEO)/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor --makefile=Makefile 
+	
+Meta_Predictor_library_clean	: 
+				@$(MAKE) Behavioural_library_clean
+				@$(MAKE) Meta_Predictor_Glue_library_clean
+				@$(MAKE) Two_Level_Branch_Predictor_library_clean
+				@$(MAKE) --directory=$(DIR_MORPHEO)/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor --makefile=Makefile clean
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/Makefile
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/Makefile	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/Makefile	(revision 46)
@@ -0,0 +1,24 @@
+# 
+# $Id$
+# 
+# [ Description ]
+# 
+# Makefile
+# 
+
+#-----[ Directory ]----------------------------------------
+DIR_COMPONENT			= .
+include				$(DIR_COMPONENT)/Makefile.defs
+
+#-----[ Library ]------------------------------------------
+LIBRARY				= $(DIR_LIB)/libMeta_Predictor_Glue.a
+
+
+#-----[ include ]------------------------------------------
+
+all				:
+				@$(MAKE) all_component
+
+include                         $(DIR_MORPHEO)/Behavioural/Makefile.flags
+include				$(DIR_MORPHEO)/Behavioural/Makefile.Common
+include				$(DIR_MORPHEO)/Behavioural/Makefile.Component
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/Makefile.defs
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/Makefile.defs	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/Makefile.defs	(revision 46)
@@ -0,0 +1,11 @@
+# 
+# $Id$
+# 
+# [ Description ]
+# 
+# Makefile
+# 
+
+#-----[ Directory ]----------------------------------------
+DIR_COMPONENT_MORPHEO		= ../../../../..
+DIR_MORPHEO			= $(DIR_COMPONENT)/$(DIR_COMPONENT_MORPHEO)
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/Makefile.deps
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/Makefile.deps	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/Makefile.deps	(revision 46)
@@ -0,0 +1,31 @@
+# 
+# $Id$
+# 
+# [ Description ]
+# 
+# Makefile
+# 
+# DIR_MORPHEO must be defined
+
+ifndef Behavioural
+include 			$(DIR_MORPHEO)/Behavioural/Makefile.deps
+endif
+
+Meta_Predictor_Glue			= yes
+
+#-----[ Library ]------------------------------------------
+Meta_Predictor_Glue_LIBRARY		= 	-lMeta_Predictor_Glue	\
+					$(Behavioural_LIBRARY)	
+
+Meta_Predictor_Glue_DIR_LIBRARY		=	-L$(DIR_MORPHEO)/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/lib	\
+					$(Behavioural_DIR_LIBRARY)
+
+#-----[ Rules ]--------------------------------------------
+
+Meta_Predictor_Glue_library		: 
+				@$(MAKE) Behavioural_library
+				@$(MAKE) --directory=$(DIR_MORPHEO)/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue --makefile=Makefile 
+	
+Meta_Predictor_Glue_library_clean	: 
+				@$(MAKE) Behavioural_library_clean
+				@$(MAKE) --directory=$(DIR_MORPHEO)/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue --makefile=Makefile clean
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/SelfTest/Makefile
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/SelfTest/Makefile	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/SelfTest/Makefile	(revision 46)
@@ -0,0 +1,29 @@
+# 
+# $Id$
+# 
+# [ Description ]
+# 
+# Makefile
+# 
+
+#-----[ Directory ]----------------------------------------
+DIR_MORPHEO			= ../../../../../..
+
+LIBRARY				= $(Meta_Predictor_Glue_LIBRARY)
+
+DIR_LIBRARY			= $(Meta_Predictor_Glue_DIR_LIBRARY)
+
+#-----[ include ]------------------------------------------
+
+all				:
+				@$(MAKE) all_selftest
+
+library				: Meta_Predictor_Glue_library
+
+library_clean			: Meta_Predictor_Glue_library_clean
+
+include                         ../Makefile.deps
+include                         $(DIR_MORPHEO)/Behavioural/Makefile.flags
+include				$(DIR_MORPHEO)/Behavioural/Makefile.Common
+include				$(DIR_MORPHEO)/Behavioural/Makefile.Selftest
+include 			$(DIR_MORPHEO)/Behavioural/Makefile.Synthesis
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/SelfTest/config0.cfg
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/SelfTest/config0.cfg	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/SelfTest/config0.cfg	(revision 46)
@@ -0,0 +1,16 @@
+Meta_Predictor_Glue
+0	1	+1	# have_meta_predictor               
+0	1	+1	# predictor_0_have_bht              
+4	4	+1	# predictor_0_bht_size_shifter      
+1	1	+1	# predictor_0_have_pht              
+2	2	+1	# predictor_0_pht_size_counter      
+1	1	+1	# predictor_1_have_bht              
+3	3	+1	# predictor_1_bht_size_shifter      
+0	1	+1	# predictor_1_have_pht              
+4	4	+1	# predictor_1_pht_size_counter      
+1	1	+1	# predictor_2_have_bht              
+2	2	+1	# predictor_2_bht_size_shifter      
+0	1	+1	# predictor_2_have_pht              
+4	4	+1	# predictor_2_pht_size_counter      
+2	2	+1	# nb_prediction                     
+2	2	+1	# nb_branch_complete                
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/SelfTest/config1.cfg
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/SelfTest/config1.cfg	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/SelfTest/config1.cfg	(revision 46)
@@ -0,0 +1,16 @@
+Meta_Predictor_Glue
+0	1	+1	# have_meta_predictor               
+1	1	+1	# predictor_0_have_bht              
+4	4	+1	# predictor_0_bht_size_shifter      
+0	1	+1	# predictor_0_have_pht              
+2	2	+1	# predictor_0_pht_size_counter      
+0	1	+1	# predictor_1_have_bht              
+3	3	+1	# predictor_1_bht_size_shifter      
+1	1	+1	# predictor_1_have_pht              
+4	4	+1	# predictor_1_pht_size_counter      
+0	1	+1	# predictor_2_have_bht              
+2	2	+1	# predictor_2_bht_size_shifter      
+1	1	+1	# predictor_2_have_pht              
+4	4	+1	# predictor_2_pht_size_counter      
+2	2	+1	# nb_prediction                     
+2	2	+1	# nb_branch_complete                
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/SelfTest/configuration.cfg
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/SelfTest/configuration.cfg	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/SelfTest/configuration.cfg	(revision 46)
@@ -0,0 +1,16 @@
+Meta_Predictor_Glue
+0	1	+1	# have_meta_predictor               
+0	1	+1	# predictor_0_have_bht              
+4	4	+1	# predictor_0_bht_size_shifter      
+1	1	+1	# predictor_0_have_pht              
+2	2	+1	# predictor_0_pht_size_counter      
+1	1	+1	# predictor_1_have_bht              
+3	3	+1	# predictor_1_bht_size_shifter      
+0	1	+1	# predictor_1_have_pht              
+4	4	+1	# predictor_1_pht_size_counter      
+1	1	+1	# predictor_2_have_bht              
+2	2	+1	# predictor_2_bht_size_shifter      
+0	1	+1	# predictor_2_have_pht              
+4	4	+1	# predictor_2_pht_size_counter      
+1	1	+1	# nb_prediction                     
+1	1	+1	# nb_branch_complete                
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/SelfTest/include/test.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/SelfTest/include/test.h	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/SelfTest/include/test.h	(revision 46)
@@ -0,0 +1,28 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ * Test "RegisterFile"
+ */
+
+#ifdef SYSTEMC
+#include "systemc.h"
+#endif
+
+#include <string>
+#include <iostream>
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Meta_Predictor_Glue.h"
+
+using namespace std;
+using namespace morpheo;
+using namespace morpheo::behavioural;
+using namespace morpheo::behavioural::stage_1_ifetch;
+using namespace morpheo::behavioural::stage_1_ifetch::predictor;
+using namespace morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor;
+
+using namespace morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::meta_predictor_glue;
+
+void test    (string name,
+	      morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::meta_predictor_glue::Parameters param);
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/SelfTest/src/main.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/SelfTest/src/main.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/SelfTest/src/main.cpp	(revision 46)
@@ -0,0 +1,104 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/SelfTest/include/test.h"
+
+#define NB_PARAMS 15
+
+void usage (string exec)
+{
+  cerr << "<Usage> " << exec << " name_instance list_params" << endl
+       << "list_params is :" << endl
+       << " - have_meta_predictor                (bool    )" << endl
+       << " - predictor_0_have_bht               (bool    )" << endl
+       << " - predictor_0_bht_size_shifter       (uint32_t)" << endl
+       << " - predictor_0_have_pht               (bool    )" << endl
+       << " - predictor_0_pht_size_counter       (uint32_t)" << endl
+       << " - predictor_1_have_bht               (bool    )" << endl
+       << " - predictor_1_bht_size_shifter       (uint32_t)" << endl
+       << " - predictor_1_have_pht               (bool    )" << endl
+       << " - predictor_1_pht_size_counter       (uint32_t)" << endl
+       << " - predictor_2_have_bht               (bool    )" << endl
+       << " - predictor_2_bht_size_shifter       (uint32_t)" << endl
+       << " - predictor_2_have_pht               (bool    )" << endl
+       << " - predictor_2_pht_size_counter       (uint32_t)" << endl
+       << " - nb_prediction                      (uint32_t)" << endl
+       << " - nb_branch_complete                 (uint32_t)" << endl;
+
+  exit (1);
+}
+
+#ifndef SYSTEMC
+int main    (int argc, char * argv[])
+#else
+int sc_main (int argc, char * argv[])
+#endif
+{
+  if (argc != 2+NB_PARAMS)
+    usage (argv[0]);
+
+  const string   name      = argv[1];
+
+  const bool     have_meta_predictor               = atoi(argv[ 2]);
+
+  const bool     predictor_0_have_bht              = atoi(argv[ 3]);
+  const uint32_t predictor_0_bht_size_shifter      = atoi(argv[ 4]);
+  const bool     predictor_0_have_pht              = atoi(argv[ 5]);
+  const uint32_t predictor_0_pht_size_counter      = atoi(argv[ 6]);
+
+  const bool     predictor_1_have_bht              = atoi(argv[ 7]);
+  const uint32_t predictor_1_bht_size_shifter      = atoi(argv[ 8]);
+  const bool     predictor_1_have_pht              = atoi(argv[ 9]);
+  const uint32_t predictor_1_pht_size_counter      = atoi(argv[10]);
+
+  const bool     predictor_2_have_bht              = atoi(argv[11]);
+  const uint32_t predictor_2_bht_size_shifter      = atoi(argv[12]);
+  const bool     predictor_2_have_pht              = atoi(argv[13]);
+  const uint32_t predictor_2_pht_size_counter      = atoi(argv[14]);
+
+  const uint32_t nb_prediction                     = atoi(argv[15]);
+  const uint32_t nb_branch_complete                = atoi(argv[16]);
+
+  try 
+    {
+      morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::meta_predictor_glue::Parameters param (have_meta_predictor               ,
+													      predictor_0_have_bht              ,
+													      predictor_0_bht_size_shifter      ,
+													      predictor_0_have_pht              ,
+													      predictor_0_pht_size_counter      ,
+													      
+													      predictor_1_have_bht              ,
+													      predictor_1_bht_size_shifter      ,
+													      predictor_1_have_pht              ,
+													      predictor_1_pht_size_counter      ,
+													      
+													      predictor_2_have_bht              ,
+													      predictor_2_bht_size_shifter      ,
+													      predictor_2_have_pht              ,
+													      predictor_2_pht_size_counter      ,
+													      
+													      nb_prediction                     ,
+													      nb_branch_complete                );
+      
+      cout << param.print(1);
+      
+      test (name,param);
+    }
+  catch (morpheo::ErrorMorpheo & error)
+    {
+      cout << "<" << name << "> : " <<  error.what ();
+      exit (EXIT_FAILURE);
+    }
+  catch (...)
+    {
+      cerr << "<" << name << "> : This test must generate a error" << endl;
+      exit (EXIT_FAILURE);
+    }
+
+  return (EXIT_SUCCESS);
+}
+
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/SelfTest/src/test.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/SelfTest/src/test.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/SelfTest/src/test.cpp	(revision 46)
@@ -0,0 +1,486 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ * Test
+ */
+
+#define NB_ITERATION 1024
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/SelfTest/include/test.h"
+#include "Common/include/Test.h"
+
+void test (string name,
+	   morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::meta_predictor_glue::Parameters _param)
+{
+  cout << "<" << name << "> : Simulation SystemC" << endl;
+
+  Meta_Predictor_Glue * _Meta_Predictor_Glue = new Meta_Predictor_Glue (name.c_str(),
+#ifdef STATISTICS
+									morpheo::behavioural::Parameters_Statistics(5,50),
+#endif
+									_param);
+  
+#ifdef SYSTEMC
+  /*********************************************************************
+   * Déclarations des signaux
+   *********************************************************************/
+  sc_clock                         * CLOCK;
+  sc_signal<Tcontrol_t>            * NRESET;
+
+    // Interface Predict
+  sc_signal<Tcontrol_t>           ** PREDICT_PREDICTOR_0_ACK                ;
+  sc_signal<Tcontrol_t>           ** PREDICT_PREDICTOR_1_ACK                ;
+  sc_signal<Tcontrol_t>           ** PREDICT_PREDICTOR_2_ACK                ;
+  sc_signal<Tcontrol_t>           ** PREDICT_ACK                            ;
+
+  sc_signal<Tbht_history_t>       ** PREDICT_PREDICTOR_0_BHT_HISTORY        ;
+  sc_signal<Tpht_history_t>       ** PREDICT_PREDICTOR_0_PHT_HISTORY        ;
+  sc_signal<Tbht_history_t>       ** PREDICT_PREDICTOR_1_BHT_HISTORY        ;
+  sc_signal<Tpht_history_t>       ** PREDICT_PREDICTOR_1_PHT_HISTORY        ;
+  sc_signal<Tbht_history_t>       ** PREDICT_PREDICTOR_2_BHT_HISTORY        ;
+  sc_signal<Tpht_history_t>       ** PREDICT_PREDICTOR_2_PHT_HISTORY        ;
+  sc_signal<Thistory_t>           ** PREDICT_HISTORY                        ;
+  sc_signal<Tcontrol_t>           ** PREDICT_DIRECTION                      ;
+
+    // Interface Branch_complete
+  sc_signal<Tcontrol_t>           ** BRANCH_COMPLETE_VAL                    ;
+  sc_signal<Tcontrol_t>           ** BRANCH_COMPLETE_PREDICTOR_2_VAL        ;
+
+  sc_signal<Tcontrol_t>           ** BRANCH_COMPLETE_PREDICTOR_0_ACK        ;
+  sc_signal<Tcontrol_t>           ** BRANCH_COMPLETE_PREDICTOR_1_ACK        ;
+  sc_signal<Tcontrol_t>           ** BRANCH_COMPLETE_PREDICTOR_2_ACK        ;
+  sc_signal<Tcontrol_t>           ** BRANCH_COMPLETE_ACK                    ;
+
+  sc_signal<Tbht_history_t>       ** BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY;
+  sc_signal<Tpht_history_t>       ** BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY;
+  sc_signal<Tbht_history_t>       ** BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY;
+  sc_signal<Tpht_history_t>       ** BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY;
+  sc_signal<Tbht_history_t>       ** BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY;
+  sc_signal<Tpht_history_t>       ** BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY;
+  sc_signal<Thistory_t>           ** BRANCH_COMPLETE_HISTORY                ;
+  sc_signal<Tcontrol_t>           ** BRANCH_COMPLETE_DIRECTION              ;
+  sc_signal<Tcontrol_t>           ** BRANCH_COMPLETE_PREDICTOR_2_DIRECTION  ;
+  string rename;
+
+#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
+  CLOCK                             = new sc_clock ("clock", 1.0, 0.5);
+  NRESET                            = new sc_signal<Tcontrol_t> ("nreset");
+#endif  
+
+    // Interface Predict
+
+    PREDICT_PREDICTOR_0_ACK         = new sc_signal<Tcontrol_t>     * [_param._nb_prediction     ];
+    PREDICT_PREDICTOR_1_ACK         = new sc_signal<Tcontrol_t>     * [_param._nb_prediction     ];
+    PREDICT_PREDICTOR_2_ACK         = new sc_signal<Tcontrol_t>     * [_param._nb_prediction     ];
+    PREDICT_ACK                     = new sc_signal<Tcontrol_t>     * [_param._nb_prediction     ];
+    PREDICT_PREDICTOR_0_BHT_HISTORY = new sc_signal<Tbht_history_t> * [_param._nb_prediction     ];
+    PREDICT_PREDICTOR_0_PHT_HISTORY = new sc_signal<Tpht_history_t> * [_param._nb_prediction     ];
+    PREDICT_PREDICTOR_1_BHT_HISTORY = new sc_signal<Tbht_history_t> * [_param._nb_prediction     ];
+    PREDICT_PREDICTOR_1_PHT_HISTORY = new sc_signal<Tpht_history_t> * [_param._nb_prediction     ];
+    PREDICT_PREDICTOR_2_BHT_HISTORY = new sc_signal<Tbht_history_t> * [_param._nb_prediction     ];
+    PREDICT_PREDICTOR_2_PHT_HISTORY = new sc_signal<Tpht_history_t> * [_param._nb_prediction     ];
+    PREDICT_HISTORY                 = new sc_signal<Thistory_t>     * [_param._nb_prediction     ];
+    PREDICT_DIRECTION               = new sc_signal<Tcontrol_t>     * [_param._nb_prediction     ];
+
+    for (uint32_t i=0; i<_param._nb_prediction; i++)
+      {
+	rename = "PREDICT_PREDICTOR_0_ACK_"          +toString(i);
+	PREDICT_PREDICTOR_0_ACK                   [i] = new sc_signal<Tcontrol_t>     (rename.c_str());
+	rename = "PREDICT_PREDICTOR_1_ACK_"          +toString(i);
+	PREDICT_PREDICTOR_1_ACK                   [i] = new sc_signal<Tcontrol_t>     (rename.c_str());
+	rename = "PREDICT_PREDICTOR_2_ACK_"          +toString(i);
+	PREDICT_PREDICTOR_2_ACK                   [i] = new sc_signal<Tcontrol_t>     (rename.c_str());
+	rename = "PREDICT_ACK_"                    +toString(i);
+	PREDICT_ACK                               [i] = new sc_signal<Tcontrol_t>     (rename.c_str());
+	rename = "PREDICT_PREDICTOR_0_BHT_HISTORY_"+toString(i);
+	PREDICT_PREDICTOR_0_BHT_HISTORY           [i] = new sc_signal<Tbht_history_t> (rename.c_str());
+	rename = "PREDICT_PREDICTOR_0_PHT_HISTORY_"+toString(i);
+	PREDICT_PREDICTOR_0_PHT_HISTORY           [i] = new sc_signal<Tpht_history_t> (rename.c_str());
+	rename = "PREDICT_PREDICTOR_1_BHT_HISTORY_"+toString(i);
+	PREDICT_PREDICTOR_1_BHT_HISTORY           [i] = new sc_signal<Tbht_history_t> (rename.c_str());
+	rename = "PREDICT_PREDICTOR_1_PHT_HISTORY_"+toString(i);
+	PREDICT_PREDICTOR_1_PHT_HISTORY           [i] = new sc_signal<Tpht_history_t> (rename.c_str());
+	rename = "PREDICT_PREDICTOR_2_BHT_HISTORY_"+toString(i);
+	PREDICT_PREDICTOR_2_BHT_HISTORY           [i] = new sc_signal<Tbht_history_t> (rename.c_str());
+	rename = "PREDICT_PREDICTOR_2_PHT_HISTORY_"+toString(i);
+	PREDICT_PREDICTOR_2_PHT_HISTORY           [i] = new sc_signal<Tpht_history_t> (rename.c_str());
+	rename = "PREDICT_HISTORY_"                +toString(i);
+	PREDICT_HISTORY                           [i] = new sc_signal<Thistory_t>     (rename.c_str());
+    	rename = "PREDICT_DIRECTION_"              +toString(i);
+	PREDICT_DIRECTION                         [i] = new sc_signal<Tcontrol_t>     (rename.c_str());
+      }
+
+    // Interface Branch_complete
+    BRANCH_COMPLETE_VAL                     = new sc_signal<Tcontrol_t>     * [_param._nb_branch_complete     ];
+    BRANCH_COMPLETE_PREDICTOR_2_VAL         = new sc_signal<Tcontrol_t>     * [_param._nb_branch_complete     ];
+    BRANCH_COMPLETE_PREDICTOR_0_ACK         = new sc_signal<Tcontrol_t>     * [_param._nb_branch_complete     ];
+    BRANCH_COMPLETE_PREDICTOR_1_ACK         = new sc_signal<Tcontrol_t>     * [_param._nb_branch_complete     ];
+    BRANCH_COMPLETE_PREDICTOR_2_ACK         = new sc_signal<Tcontrol_t>     * [_param._nb_branch_complete     ];
+    BRANCH_COMPLETE_ACK                     = new sc_signal<Tcontrol_t>     * [_param._nb_branch_complete     ];
+    BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY = new sc_signal<Tbht_history_t> * [_param._nb_branch_complete     ];
+    BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY = new sc_signal<Tpht_history_t> * [_param._nb_branch_complete     ];
+    BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY = new sc_signal<Tbht_history_t> * [_param._nb_branch_complete     ];
+    BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY = new sc_signal<Tpht_history_t> * [_param._nb_branch_complete     ];
+    BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY = new sc_signal<Tbht_history_t> * [_param._nb_branch_complete     ];
+    BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY = new sc_signal<Tpht_history_t> * [_param._nb_branch_complete     ];
+    BRANCH_COMPLETE_HISTORY                 = new sc_signal<Thistory_t>     * [_param._nb_branch_complete     ];
+    BRANCH_COMPLETE_DIRECTION               = new sc_signal<Tcontrol_t>     * [_param._nb_branch_complete     ];
+    BRANCH_COMPLETE_PREDICTOR_2_DIRECTION   = new sc_signal<Tcontrol_t>     * [_param._nb_branch_complete     ];
+
+    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+      {
+	rename = "BRANCH_COMPLETE_VAL_"                      +toString(i);
+	BRANCH_COMPLETE_VAL                               [i] = new sc_signal<Tcontrol_t>     (rename.c_str());
+	rename = "BRANCH_COMPLETE_PREDICTOR_2_VAL_"          +toString(i);
+	BRANCH_COMPLETE_PREDICTOR_2_VAL                   [i] = new sc_signal<Tcontrol_t>     (rename.c_str());
+	rename = "BRANCH_COMPLETE_PREDICTOR_0_ACK_"          +toString(i);
+	BRANCH_COMPLETE_PREDICTOR_0_ACK                   [i] = new sc_signal<Tcontrol_t>     (rename.c_str());
+	rename = "BRANCH_COMPLETE_PREDICTOR_1_ACK_"          +toString(i);
+	BRANCH_COMPLETE_PREDICTOR_1_ACK                   [i] = new sc_signal<Tcontrol_t>     (rename.c_str());
+	rename = "BRANCH_COMPLETE_PREDICTOR_2_ACK_"          +toString(i);
+	BRANCH_COMPLETE_PREDICTOR_2_ACK                   [i] = new sc_signal<Tcontrol_t>     (rename.c_str());
+	rename = "BRANCH_COMPLETE_ACK_"                    +toString(i);
+	BRANCH_COMPLETE_ACK                               [i] = new sc_signal<Tcontrol_t>     (rename.c_str());
+	rename = "BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY_"+toString(i);
+	BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY           [i] = new sc_signal<Tbht_history_t> (rename.c_str());
+	rename = "BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY_"+toString(i);
+	BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY           [i] = new sc_signal<Tpht_history_t> (rename.c_str());
+	rename = "BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY_"+toString(i);
+	BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY           [i] = new sc_signal<Tbht_history_t> (rename.c_str());
+	rename = "BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY_"+toString(i);
+	BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY           [i] = new sc_signal<Tpht_history_t> (rename.c_str());
+	rename = "BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY_"+toString(i);
+	BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY           [i] = new sc_signal<Tbht_history_t> (rename.c_str());
+	rename = "BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY_"+toString(i);
+	BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY           [i] = new sc_signal<Tpht_history_t> (rename.c_str());
+	rename = "BRANCH_COMPLETE_HISTORY_"                +toString(i);
+	BRANCH_COMPLETE_HISTORY                           [i] = new sc_signal<Thistory_t>     (rename.c_str());
+	rename = "BRANCH_COMPLETE_DIRECTION_"              +toString(i);
+	BRANCH_COMPLETE_DIRECTION                         [i] = new sc_signal<Tcontrol_t>     (rename.c_str());
+	rename = "BRANCH_COMPLETE_PREDICTOR_2_DIRECTION_"  +toString(i);
+	BRANCH_COMPLETE_PREDICTOR_2_DIRECTION             [i] = new sc_signal<Tcontrol_t>     (rename.c_str());
+      }
+
+  /********************************************************
+   * Instanciation
+   ********************************************************/
+  
+  cout << "<" << name << "> Instanciation of _Meta_Predictor_Glue" << endl;
+  
+#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
+  (*(_Meta_Predictor_Glue->in_CLOCK))        (*(CLOCK));
+  (*(_Meta_Predictor_Glue->in_NRESET))        (*(NRESET));
+#endif
+
+    // Interface Predict
+    for (uint32_t i=0; i<_param._nb_prediction; i++)
+      {
+	if (_param._have_meta_predictor)
+	  {
+	(*(_Meta_Predictor_Glue-> in_PREDICT_PREDICTOR_0_ACK                 [i])) (*(PREDICT_PREDICTOR_0_ACK                 [i]));
+	(*(_Meta_Predictor_Glue-> in_PREDICT_PREDICTOR_1_ACK                 [i])) (*(PREDICT_PREDICTOR_1_ACK                 [i]));
+	  }									      					      
+	(*(_Meta_Predictor_Glue-> in_PREDICT_PREDICTOR_2_ACK                 [i])) (*(PREDICT_PREDICTOR_2_ACK                 [i]));
+	(*(_Meta_Predictor_Glue->out_PREDICT_ACK                             [i])) (*(PREDICT_ACK                             [i]));
+	if (_param._have_meta_predictor)
+	  {									      					      
+	if (_param._predictor_0_have_bht)
+	(*(_Meta_Predictor_Glue-> in_PREDICT_PREDICTOR_0_BHT_HISTORY         [i])) (*(PREDICT_PREDICTOR_0_BHT_HISTORY         [i]));
+	if (_param._predictor_0_have_pht)
+	(*(_Meta_Predictor_Glue-> in_PREDICT_PREDICTOR_0_PHT_HISTORY         [i])) (*(PREDICT_PREDICTOR_0_PHT_HISTORY         [i]));
+	if (_param._predictor_1_have_bht)
+	(*(_Meta_Predictor_Glue-> in_PREDICT_PREDICTOR_1_BHT_HISTORY         [i])) (*(PREDICT_PREDICTOR_1_BHT_HISTORY         [i]));
+	if (_param._predictor_1_have_pht)
+	(*(_Meta_Predictor_Glue-> in_PREDICT_PREDICTOR_1_PHT_HISTORY         [i])) (*(PREDICT_PREDICTOR_1_PHT_HISTORY         [i]));
+	  }									      					      
+	if (_param._predictor_2_have_bht)
+	(*(_Meta_Predictor_Glue-> in_PREDICT_PREDICTOR_2_BHT_HISTORY         [i])) (*(PREDICT_PREDICTOR_2_BHT_HISTORY         [i]));
+	if (_param._predictor_2_have_pht)
+	(*(_Meta_Predictor_Glue-> in_PREDICT_PREDICTOR_2_PHT_HISTORY         [i])) (*(PREDICT_PREDICTOR_2_PHT_HISTORY         [i]));
+	(*(_Meta_Predictor_Glue->out_PREDICT_HISTORY                         [i])) (*(PREDICT_HISTORY                         [i]));
+	(*(_Meta_Predictor_Glue->out_PREDICT_DIRECTION                       [i])) (*(PREDICT_DIRECTION                       [i]));
+      }
+
+    // Interface Branch_complete
+    
+    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+      {
+	if (_param._have_meta_predictor)
+	  {
+	(*(_Meta_Predictor_Glue-> in_BRANCH_COMPLETE_VAL                     [i])) (*(BRANCH_COMPLETE_VAL                     [i]));
+	(*(_Meta_Predictor_Glue->out_BRANCH_COMPLETE_PREDICTOR_2_VAL         [i])) (*(BRANCH_COMPLETE_PREDICTOR_2_VAL         [i]));
+
+	(*(_Meta_Predictor_Glue-> in_BRANCH_COMPLETE_PREDICTOR_0_ACK         [i])) (*(BRANCH_COMPLETE_PREDICTOR_0_ACK         [i]));
+	(*(_Meta_Predictor_Glue-> in_BRANCH_COMPLETE_PREDICTOR_1_ACK         [i])) (*(BRANCH_COMPLETE_PREDICTOR_1_ACK         [i]));
+	  }					
+	(*(_Meta_Predictor_Glue-> in_BRANCH_COMPLETE_PREDICTOR_2_ACK         [i])) (*(BRANCH_COMPLETE_PREDICTOR_2_ACK         [i]));
+	(*(_Meta_Predictor_Glue->out_BRANCH_COMPLETE_ACK                     [i])) (*(BRANCH_COMPLETE_ACK                     [i]));
+						
+	if (_param._have_meta_predictor)	
+	  {					
+	if (_param._predictor_0_have_bht)
+	(*(_Meta_Predictor_Glue->out_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY [i])) (*(BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY [i]));
+	if (_param._predictor_0_have_pht)
+	(*(_Meta_Predictor_Glue->out_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY [i])) (*(BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY [i]));
+	if (_param._predictor_1_have_bht)
+	(*(_Meta_Predictor_Glue->out_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY [i])) (*(BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY [i]));
+	if (_param._predictor_1_have_pht)
+	(*(_Meta_Predictor_Glue->out_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY [i])) (*(BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY [i]));
+	  }					
+	if (_param._predictor_2_have_bht)
+	(*(_Meta_Predictor_Glue->out_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY [i])) (*(BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY [i]));
+	if (_param._predictor_2_have_pht)
+	(*(_Meta_Predictor_Glue->out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY [i])) (*(BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY [i]));
+	(*(_Meta_Predictor_Glue-> in_BRANCH_COMPLETE_HISTORY                 [i])) (*(BRANCH_COMPLETE_HISTORY                 [i]));
+	if (_param._have_meta_predictor)	
+	  {
+	(*(_Meta_Predictor_Glue-> in_BRANCH_COMPLETE_DIRECTION               [i])) (*(BRANCH_COMPLETE_DIRECTION               [i]));
+	(*(_Meta_Predictor_Glue->out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION   [i])) (*(BRANCH_COMPLETE_PREDICTOR_2_DIRECTION   [i]));
+	  }
+      }
+
+  /********************************************************
+   * Simulation - Begin
+   ********************************************************/
+
+  cout << "<" << name << "> Start Simulation ............" << endl;
+  // Initialisation
+
+  const uint32_t seed = 0;
+//const uint32_t seed = static_cast<uint32_t>(time(NULL));
+
+  srand(seed);
+
+  sc_start(0);
+  cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Initialisation" << endl;
+
+  NRESET->write(0);
+  sc_start(5);
+  NRESET->write(1);
+  // No need initialisation
+
+  cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Loop of Test" << endl;
+  
+  Tcontrol_t     predict_ack                             [_param._nb_prediction];
+  Thistory_t     predict_history                         [_param._nb_prediction];
+  Tcontrol_t     predict_direction                       [_param._nb_prediction];
+	        
+  Tcontrol_t     branch_complete_predictor_2_val         [_param._nb_branch_complete];
+  Tcontrol_t     branch_complete_ack                     [_param._nb_branch_complete];
+  Tbht_history_t branch_complete_predictor_0_bht_history [_param._nb_branch_complete];
+  Tpht_history_t branch_complete_predictor_0_pht_history [_param._nb_branch_complete];
+  Tbht_history_t branch_complete_predictor_1_bht_history [_param._nb_branch_complete];
+  Tpht_history_t branch_complete_predictor_1_pht_history [_param._nb_branch_complete];
+  Tbht_history_t branch_complete_predictor_2_bht_history [_param._nb_branch_complete];
+  Tpht_history_t branch_complete_predictor_2_pht_history [_param._nb_branch_complete];
+  Tcontrol_t     branch_complete_predictor_2_direction   [_param._nb_branch_complete];
+
+  uint32_t shift_0 = 0;
+  uint32_t shift_1 = shift_0 + _param._predictor_0_bht_size_shifter;
+  uint32_t shift_2 = shift_1 + _param._predictor_0_pht_size_counter;
+  uint32_t shift_3 = shift_2 + _param._predictor_1_bht_size_shifter;
+  uint32_t shift_4 = shift_3 + _param._predictor_1_pht_size_counter;
+  uint32_t shift_5 = shift_4 + _param._predictor_2_bht_size_shifter;
+//uint32_t shift_6 = shift_5 + _param._predictor_2_pht_size_counter;
+
+  cout << "shift_0 : " << shift_0 << endl;
+  cout << "shift_1 : " << shift_1 << endl;
+  cout << "shift_2 : " << shift_2 << endl;
+  cout << "shift_3 : " << shift_3 << endl;
+  cout << "shift_4 : " << shift_4 << endl;
+  cout << "shift_5 : " << shift_5 << endl;
+
+  for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++)
+    {
+
+      for (uint32_t i=0; i<_param._nb_prediction; i++)
+	{
+	  Tcontrol_t     predictor_0_ack        , predictor_1_ack        , predictor_2_ack        ;
+	  Tpht_history_t predictor_0_pht_history, predictor_1_pht_history, predictor_2_pht_history;
+	  Tbht_history_t predictor_0_bht_history, predictor_1_bht_history, predictor_2_bht_history;
+
+	  predictor_0_ack             = not _param._have_meta_predictor or ((rand()%2) != 0);
+	  predictor_1_ack             = not _param._have_meta_predictor or ((rand()%2) != 0);
+	  predictor_2_ack             =                                    ((rand()%2) != 0);
+	  predict_ack             [i] = predictor_0_ack and predictor_1_ack and predictor_2_ack;
+
+	  PREDICT_PREDICTOR_0_ACK [i] ->write (predictor_0_ack);
+	  PREDICT_PREDICTOR_1_ACK [i] ->write (predictor_1_ack);
+	  PREDICT_PREDICTOR_2_ACK [i] ->write (predictor_2_ack);
+				      
+	  predictor_0_bht_history     = rand() % (_param._predictor_0_bht_size_shifter+1);
+	  predictor_0_pht_history     = rand() % (_param._predictor_0_pht_size_counter+1);
+	  predictor_1_bht_history     = rand() % (_param._predictor_1_bht_size_shifter+1);
+	  predictor_1_pht_history     = rand() % (_param._predictor_1_pht_size_counter+1);
+	  predictor_2_bht_history     = rand() % (_param._predictor_2_bht_size_shifter+1);
+	  predictor_2_pht_history     = rand() % (_param._predictor_2_pht_size_counter+1);
+				      
+	  predict_history         [i] = ( (predictor_0_bht_history << shift_0) |
+					  (predictor_0_pht_history << shift_1) |
+					  (predictor_1_bht_history << shift_2) |
+					  (predictor_1_pht_history << shift_3) |
+					  (predictor_2_bht_history << shift_4) |
+					  (predictor_2_pht_history << shift_5) );
+	  
+	  cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} predict         [" << i << "]" << endl
+	       << "       _2_ " << predictor_2_bht_history << " - " << predictor_2_pht_history << endl
+	       << "     _/    " << endl
+	       << "    | |-1- " << predictor_1_bht_history << " - " << predictor_1_pht_history << endl
+	       << "  --| |    " << endl
+	       << "    |_|-0- " << predictor_0_bht_history << " - " << predictor_0_pht_history << endl;
+
+
+	  Tcontrol_t predict_direction_predictor_2;
+	  
+	  if (_param._predictor_2_have_pht)
+	    predict_direction_predictor_2 = (predictor_2_pht_history & (1<<(_param._predictor_2_pht_size_counter-1))) != 0;
+	  else
+	    predict_direction_predictor_2 = (predictor_2_bht_history & (1<<(_param._predictor_2_bht_size_shifter-1))) != 0;
+
+	  if (_param._have_meta_predictor == false)
+	    predict_direction       [i] = predict_direction_predictor_2;
+	  else
+	    if (predict_direction_predictor_2 == false)
+	      if (_param._predictor_0_have_pht)
+		predict_direction       [i] = (predictor_0_pht_history & (1<<(_param._predictor_0_pht_size_counter-1))) != 0;
+	      else
+		predict_direction       [i] = (predictor_0_bht_history & (1<<(_param._predictor_0_bht_size_shifter-1))) != 0;
+	    else
+	      if (_param._predictor_1_have_pht)
+		predict_direction       [i] = (predictor_1_pht_history & (1<<(_param._predictor_1_pht_size_counter-1))) != 0;
+	      else
+		predict_direction       [i] = (predictor_1_bht_history & (1<<(_param._predictor_1_bht_size_shifter-1))) != 0;
+
+	  PREDICT_PREDICTOR_0_BHT_HISTORY [i]->write(predictor_0_bht_history);
+	  PREDICT_PREDICTOR_0_PHT_HISTORY [i]->write(predictor_0_pht_history);
+	  PREDICT_PREDICTOR_1_BHT_HISTORY [i]->write(predictor_1_bht_history);
+	  PREDICT_PREDICTOR_1_PHT_HISTORY [i]->write(predictor_1_pht_history);
+	  PREDICT_PREDICTOR_2_BHT_HISTORY [i]->write(predictor_2_bht_history);
+	  PREDICT_PREDICTOR_2_PHT_HISTORY [i]->write(predictor_2_pht_history);
+	}
+
+      for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+	{
+	  Tcontrol_t     predictor_0_ack        , predictor_1_ack        , predictor_2_ack        ;
+
+	  predictor_0_ack                             = not _param._have_meta_predictor or ((rand()%2) != 0);
+	  predictor_1_ack                             = not _param._have_meta_predictor or ((rand()%2) != 0);
+	  predictor_2_ack                             =                                    ((rand()%2) != 0);
+	  branch_complete_ack                     [i] = predictor_0_ack and predictor_1_ack and predictor_2_ack;
+
+	  BRANCH_COMPLETE_PREDICTOR_0_ACK         [i] ->write (predictor_0_ack);
+	  BRANCH_COMPLETE_PREDICTOR_1_ACK         [i] ->write (predictor_1_ack);
+	  BRANCH_COMPLETE_PREDICTOR_2_ACK         [i] ->write (predictor_2_ack);
+
+	  branch_complete_predictor_0_bht_history [i] = rand() % (1<<_param._predictor_0_bht_size_shifter);
+	  branch_complete_predictor_0_pht_history [i] = rand() % (1<<_param._predictor_0_pht_size_counter);
+	  branch_complete_predictor_1_bht_history [i] = rand() % (1<<_param._predictor_1_bht_size_shifter);
+	  branch_complete_predictor_1_pht_history [i] = rand() % (1<<_param._predictor_1_pht_size_counter);
+	  branch_complete_predictor_2_bht_history [i] = rand() % (1<<_param._predictor_2_bht_size_shifter);
+	  branch_complete_predictor_2_pht_history [i] = rand() % (1<<_param._predictor_2_pht_size_counter);
+		
+	  Thistory_t history = ((branch_complete_predictor_0_bht_history [i] << shift_0) |
+				(branch_complete_predictor_0_pht_history [i] << shift_1) |
+				(branch_complete_predictor_1_bht_history [i] << shift_2) |
+				(branch_complete_predictor_1_pht_history [i] << shift_3) |
+				(branch_complete_predictor_2_bht_history [i] << shift_4) |
+				(branch_complete_predictor_2_pht_history [i] << shift_5) );
+
+	  BRANCH_COMPLETE_HISTORY                 [i]->write (history);
+
+	  cout << "<test> [" << i << "] : " << endl
+	     << hex 
+	     << " *   " << history << endl
+	     << "   - " << branch_complete_predictor_0_bht_history [i] << endl
+	     << "   - " << branch_complete_predictor_0_pht_history [i] << endl
+	     << "   - " << branch_complete_predictor_1_bht_history [i] << endl
+	     << "   - " << branch_complete_predictor_1_pht_history [i] << endl
+	     << "   - " << branch_complete_predictor_2_bht_history [i] << endl
+	     << "   - " << branch_complete_predictor_2_pht_history [i] << endl
+	     << dec;
+
+	  Tcontrol_t direction_0 = ((_param._predictor_0_have_pht)?(branch_complete_predictor_0_pht_history [i] >> (_param._predictor_0_pht_size_counter-1)):(branch_complete_predictor_0_bht_history [i] >> (_param._predictor_0_bht_size_shifter-1)))&1;
+	  Tcontrol_t direction_1 = ((_param._predictor_1_have_pht)?(branch_complete_predictor_1_pht_history [i] >> (_param._predictor_1_pht_size_counter-1)):(branch_complete_predictor_1_bht_history [i] >> (_param._predictor_1_bht_size_shifter-1)))&1;
+	  Tcontrol_t direction_2 = ((_param._predictor_2_have_pht)?(branch_complete_predictor_2_pht_history [i] >> (_param._predictor_2_pht_size_counter-1)):(branch_complete_predictor_2_bht_history [i] >> (_param._predictor_2_bht_size_shifter-1)))&1;
+
+	  Tcontrol_t direction   = ((rand()%2) != 0);
+	  Tcontrol_t val         = ((rand()%2) != 0);
+
+	  cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} " << endl 
+	       << "  * val             : " << val << endl
+	       << "  * direction_good  : " << direction << endl
+	       << "    * direction_0   : " << direction_0 << endl
+	       << "    * direction_1   : " << direction_1 << endl
+	       << "    * direction_2   : " << direction_2 << endl;
+	  
+	  BRANCH_COMPLETE_VAL       [i] ->write (val);
+	  BRANCH_COMPLETE_DIRECTION [i] ->write (direction);
+	  
+	  if (val == 0)
+	    {
+	      branch_complete_predictor_2_val [i] = val;
+	    }
+	  else
+	    {
+	      branch_complete_predictor_2_val [i] = (direction_0 xor direction_1);
+	      if (direction_2 == 0)
+		if (direction_0 == direction)
+		  branch_complete_predictor_2_direction [i] = 0;
+		else
+		  branch_complete_predictor_2_direction [i] = 1;
+	      else
+		if (direction_1 == direction)
+		  branch_complete_predictor_2_direction [i] = 1;
+		else
+		  branch_complete_predictor_2_direction [i] = 0;
+	    }
+	}
+
+      sc_start(1);
+
+      for (uint32_t i=0; i<_param._nb_prediction; i++)
+	{
+	  TEST(Tcontrol_t    , PREDICT_ACK                             [i]->read(), predict_ack                             [i]);
+	  TEST(Tcontrol_t    , PREDICT_HISTORY                         [i]->read(), predict_history                         [i]);
+	  TEST(Tcontrol_t    , PREDICT_DIRECTION                       [i]->read(), predict_direction                       [i]);
+	}
+
+      for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+	{
+	  TEST(Tcontrol_t    , BRANCH_COMPLETE_ACK                     [i]->read(), branch_complete_ack                     [i]);
+
+	if (_param._have_meta_predictor)	
+	  {					
+	  TEST(Tcontrol_t    , BRANCH_COMPLETE_PREDICTOR_2_VAL         [i]->read(), branch_complete_predictor_2_val         [i]);
+
+	  if (branch_complete_predictor_2_val         [i])
+	  TEST(Tcontrol_t    , BRANCH_COMPLETE_PREDICTOR_2_DIRECTION   [i]->read(), branch_complete_predictor_2_direction   [i]);  
+
+	if (_param._predictor_0_have_bht)
+	  TEST(Tbht_history_t, BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY [i]->read(), branch_complete_predictor_0_bht_history [i]);
+	if (_param._predictor_0_have_pht)
+	  TEST(Tpht_history_t, BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY [i]->read(), branch_complete_predictor_0_pht_history [i]);
+	if (_param._predictor_1_have_bht)
+	  TEST(Tbht_history_t, BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY [i]->read(), branch_complete_predictor_1_bht_history [i]);
+	if (_param._predictor_1_have_pht)
+	  TEST(Tpht_history_t, BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY [i]->read(), branch_complete_predictor_1_pht_history [i]);
+	  }					
+	if (_param._predictor_2_have_bht)
+	  TEST(Tbht_history_t, BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY [i]->read(), branch_complete_predictor_2_bht_history [i]);
+	if (_param._predictor_2_have_pht)
+	  TEST(Tpht_history_t, BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY [i]->read(), branch_complete_predictor_2_pht_history [i]);
+	}
+    }
+
+  /********************************************************
+   * Simulation - End
+   ********************************************************/
+
+  cout << "<" << name << "> ............ Stop Simulation" << endl;
+
+#endif
+
+  delete _Meta_Predictor_Glue;
+}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/VERSION
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/VERSION	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/VERSION	(revision 46)
@@ -0,0 +1,1 @@
+v0.4
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/doc/Makefile
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/doc/Makefile	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/doc/Makefile	(revision 46)
@@ -0,0 +1,19 @@
+# 
+# $Id$
+# 
+# [ Description ]
+# 
+# Makefile
+# 
+
+#-----[ Directory ]----------------------------------------
+DIR_COMPONENT			= ..
+include				$(DIR_COMPONENT)/Makefile.defs
+
+#-----[ include ]------------------------------------------
+
+all				:
+				$(MAKE) all_documentation
+
+include				$(DIR_MORPHEO)/Behavioural/Makefile.Common
+include				$(DIR_MORPHEO)/Behavioural/Makefile.Documentation
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/doc/Meta_Predictor_Glue.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/doc/Meta_Predictor_Glue.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/doc/Meta_Predictor_Glue.tex	(revision 46)
@@ -0,0 +1,38 @@
+\documentclass[10pt,a4paper,twocolumn]{article}
+
+\def\dirdoc{tex}
+\def\dirschema{eps}
+
+% Package de variables d'environnement : Titre, command etc ...
+\usepackage{../../../../../../Behavioural/doc/sty/doc-style}
+\usepackage{sty/header}
+
+
+%------------------------------------------------------------------------------
+% Début document
+%------------------------------------------------------------------------------
+
+\pagestyle{empty}
+
+\begin{document}
+
+% Créez une page de titre
+\maketitle
+\thispagestyle{empty}
+
+%Table des matières et des figures
+%\tableofcontents
+%\newpage
+%\listoffigures
+
+%------------------------------------------------------------------------------
+% Ajout du corps du documents
+%------------------------------------------------------------------------------
+
+\input{tex/root}
+
+%------------------------------------------------------------------------------
+% Fin d'ajout du corps du document
+%------------------------------------------------------------------------------
+
+\end{document}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/doc/sty/header.sty
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/doc/sty/header.sty	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/doc/sty/header.sty	(revision 46)
@@ -0,0 +1,12 @@
+\def\review{YYYY/MM/DD}
+%\def\review{\number\day/\number\month/\number\year\xspace}
+
+\title{Meta\_Predictor\_Glue}
+ 
+\author{}
+
+\affiliation{}
+
+\email{}
+
+\date{\review}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/doc/tex/01_introduction.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/doc/tex/01_introduction.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/doc/tex/01_introduction.tex	(revision 46)
@@ -0,0 +1,1 @@
+\Section{Introduction}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/doc/tex/02_features.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/doc/tex/02_features.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/doc/tex/02_features.tex	(revision 46)
@@ -0,0 +1,1 @@
+\Section{Features}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/doc/tex/03_description.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/doc/tex/03_description.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/doc/tex/03_description.tex	(revision 46)
@@ -0,0 +1,1 @@
+\Section{Functional Description}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/doc/tex/04_pinout.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/doc/tex/04_pinout.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/doc/tex/04_pinout.tex	(revision 46)
@@ -0,0 +1,1 @@
+\Section{Pin out}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/doc/tex/05_parameters.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/doc/tex/05_parameters.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/doc/tex/05_parameters.tex	(revision 46)
@@ -0,0 +1,1 @@
+\Section{Parameters}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/doc/tex/06_performance.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/doc/tex/06_performance.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/doc/tex/06_performance.tex	(revision 46)
@@ -0,0 +1,1 @@
+\Section{Performance}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/doc/tex/07_details.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/doc/tex/07_details.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/doc/tex/07_details.tex	(revision 46)
@@ -0,0 +1,1 @@
+\Section{Details}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/doc/tex/08_history.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/doc/tex/08_history.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/doc/tex/08_history.tex	(revision 46)
@@ -0,0 +1,10 @@
+\Section{Revision History}
+
+\begin{tabular}{|c|c|c|}
+\hline
+Revision Date & By  & Modifications\\
+\hline
+\hline
+yyyy/mm/dd    & xxx & Initial document \\
+\hline
+\end{tabular}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/doc/tex/root.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/doc/tex/root.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/doc/tex/root.tex	(revision 46)
@@ -0,0 +1,8 @@
+\input{\dirdoc/01_introduction}
+\input{\dirdoc/02_features}
+\input{\dirdoc/03_description}
+\input{\dirdoc/04_pinout}
+\input{\dirdoc/05_parameters}
+\input{\dirdoc/06_performance}
+\input{\dirdoc/07_details}
+\input{\dirdoc/08_history}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/include/Meta_Predictor_Glue.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/include/Meta_Predictor_Glue.h	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/include/Meta_Predictor_Glue.h	(revision 46)
@@ -0,0 +1,162 @@
+#ifndef morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_meta_predictor_glue_Meta_Predictor_Glue_h
+#define morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_meta_predictor_glue_Meta_Predictor_Glue_h
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#ifdef SYSTEMC
+#include "systemc.h"
+#endif
+
+#include <iostream>
+#include "Common/include/ToString.h"
+#include "Common/include/Debug.h"
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Parameters.h"
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Types.h"
+#ifdef STATISTICS
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Statistics.h"
+#endif
+#ifdef VHDL
+#include "Behavioural/include/Vhdl.h"
+#endif
+#include "Behavioural/include/Component.h"
+
+using namespace std;
+
+namespace morpheo {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace meta_predictor_glue {
+
+
+  class Meta_Predictor_Glue 
+#if SYSTEMC
+    : public sc_module
+#endif
+  {
+    // -----[ fields ]----------------------------------------------------
+    // Parameters
+  protected : const string     _name;
+
+  protected : const Parameters _param;
+//#ifdef STATISTICS
+//  protected : const morpheo::behavioural::Parameters_Statistics _param_statistics;
+//#endif
+
+#ifdef STATISTICS
+  private   : Statistics                     * _stat;
+#endif
+
+  public    : Component                      * _component;
+  private   : Interfaces                     * _interfaces;
+
+#ifdef SYSTEMC
+    // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+    // Interface
+  public    : SC_CLOCK                      *  in_CLOCK                                  ;
+  public    : SC_IN (Tcontrol_t)            *  in_NRESET                                 ;
+
+    // Interface Predict
+  public    : SC_IN (Tcontrol_t)           **  in_PREDICT_PREDICTOR_0_ACK                ;
+  public    : SC_IN (Tcontrol_t)           **  in_PREDICT_PREDICTOR_1_ACK                ;
+  public    : SC_IN (Tcontrol_t)           **  in_PREDICT_PREDICTOR_2_ACK                ;
+  public    : SC_OUT(Tcontrol_t)           ** out_PREDICT_ACK                            ;
+
+  public    : SC_IN (Tbht_history_t)       **  in_PREDICT_PREDICTOR_0_BHT_HISTORY        ;
+  public    : SC_IN (Tpht_history_t)       **  in_PREDICT_PREDICTOR_0_PHT_HISTORY        ;
+  public    : SC_IN (Tbht_history_t)       **  in_PREDICT_PREDICTOR_1_BHT_HISTORY        ;
+  public    : SC_IN (Tpht_history_t)       **  in_PREDICT_PREDICTOR_1_PHT_HISTORY        ;
+  public    : SC_IN (Tbht_history_t)       **  in_PREDICT_PREDICTOR_2_BHT_HISTORY        ;
+  public    : SC_IN (Tpht_history_t)       **  in_PREDICT_PREDICTOR_2_PHT_HISTORY        ;
+  public    : SC_OUT(Thistory_t)           ** out_PREDICT_HISTORY                        ;
+  public    : SC_OUT(Tcontrol_t)           ** out_PREDICT_DIRECTION                      ;
+
+    // Interface Branch_complete
+  public    : SC_IN (Tcontrol_t)           **  in_BRANCH_COMPLETE_VAL                    ;
+  public    : SC_OUT(Tcontrol_t)           ** out_BRANCH_COMPLETE_PREDICTOR_2_VAL        ;
+
+  public    : SC_IN (Tcontrol_t)           **  in_BRANCH_COMPLETE_PREDICTOR_0_ACK        ;
+  public    : SC_IN (Tcontrol_t)           **  in_BRANCH_COMPLETE_PREDICTOR_1_ACK        ;
+  public    : SC_IN (Tcontrol_t)           **  in_BRANCH_COMPLETE_PREDICTOR_2_ACK        ;
+  public    : SC_OUT(Tcontrol_t)           ** out_BRANCH_COMPLETE_ACK                    ;
+
+  public    : SC_OUT(Tbht_history_t)       ** out_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY;
+  public    : SC_OUT(Tpht_history_t)       ** out_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY;
+  public    : SC_OUT(Tbht_history_t)       ** out_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY;
+  public    : SC_OUT(Tpht_history_t)       ** out_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY;
+  public    : SC_OUT(Tbht_history_t)       ** out_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY;
+  public    : SC_OUT(Tpht_history_t)       ** out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY;
+  public    : SC_IN (Thistory_t)           **  in_BRANCH_COMPLETE_HISTORY                ;
+  public    : SC_IN (Tcontrol_t)           **  in_BRANCH_COMPLETE_DIRECTION              ;
+  public    : SC_OUT(Tcontrol_t)           ** out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION  ;
+
+    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
+
+    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
+
+    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#endif
+
+    // -----[ methods ]---------------------------------------------------
+
+#ifdef SYSTEMC
+    SC_HAS_PROCESS (Meta_Predictor_Glue);
+#endif
+  public  :          Meta_Predictor_Glue              (
+#ifdef SYSTEMC
+					      sc_module_name                              name,
+#else					       
+					      string                                      name,
+#endif					       
+#ifdef STATISTICS
+					      morpheo::behavioural::Parameters_Statistics param_statistics,
+#endif
+					      Parameters                                  param );
+					       
+  public  :          Meta_Predictor_Glue              (Parameters param );
+  public  :          ~Meta_Predictor_Glue             (void);
+					       
+#ifdef SYSTEMC				       
+  private : void     allocation                (void);
+  private : void     deallocation              (void);
+				
+#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
+  public  : void     transition                       (void);
+#endif
+  public  : void     genMealy_predict_ack             (void);
+  public  : void     genMealy_predict_history         (void);
+  public  : void     genMealy_branch_complete_val     (void);
+  public  : void     genMealy_branch_complete_ack     (void);
+  public  : void     genMealy_branch_complete_history (void);
+
+#endif					       
+#ifdef STATISTICS
+  public  : string   statistics                (uint32_t depth);
+#endif
+					       
+#if VHDL				       
+  public  : void     vhdl                      (void);
+  private : void     vhdl_declaration          (Vhdl * & vhdl);
+  private : void     vhdl_body                 (Vhdl * & vhdl);
+#endif					       
+#ifdef VHDL_TESTBENCH			       
+  private : void     vhdl_testbench_transition (void);
+#endif
+  };
+
+}; // end namespace meta_predictor_glue
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/include/Parameters.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/include/Parameters.h	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/include/Parameters.h	(revision 46)
@@ -0,0 +1,90 @@
+#ifndef morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_meta_predictor_glue_Parameters_h
+#define morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_meta_predictor_glue_Parameters_h
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Common/include/Debug.h"
+#include "Behavioural/include/Parameters.h"
+#include <math.h>
+
+namespace morpheo {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace meta_predictor_glue {
+
+
+  class Parameters : public morpheo::behavioural::Parameters
+  {
+    //-----[ fields ]------------------------------------------------------------
+  public : const bool     _have_meta_predictor               ;
+
+  public : const bool     _predictor_0_have_bht              ;
+  public : const uint32_t _predictor_0_bht_size_shifter      ;
+  public : const bool     _predictor_0_have_pht              ;
+  public : const uint32_t _predictor_0_pht_size_counter      ;
+
+  public : const bool     _predictor_1_have_bht              ;
+  public : const uint32_t _predictor_1_bht_size_shifter      ;
+  public : const bool     _predictor_1_have_pht              ;
+  public : const uint32_t _predictor_1_pht_size_counter      ;
+
+  public : const bool     _predictor_2_have_bht              ;
+  public : const uint32_t _predictor_2_bht_size_shifter      ;
+  public : const bool     _predictor_2_have_pht              ;
+  public : const uint32_t _predictor_2_pht_size_counter      ;
+
+  public : const uint32_t _nb_prediction                     ;
+  public : const uint32_t _nb_branch_complete                ;
+
+  public : const uint32_t _size_history                      ;
+
+  public : const uint32_t _shift_0;
+  public : const uint32_t _shift_1;
+  public : const uint32_t _shift_2;
+  public : const uint32_t _shift_3;
+  public : const uint32_t _shift_4;
+  public : const uint32_t _shift_5;
+  public : const uint32_t _shift_6;
+
+    //-----[ methods ]-----------------------------------------------------------
+  public : Parameters  (bool     have_meta_predictor               ,
+			bool     predictor_0_have_bht              ,
+			uint32_t predictor_0_bht_size_shifter      ,
+			bool     predictor_0_have_pht              ,
+			uint32_t predictor_0_pht_size_counter      ,
+			bool     predictor_1_have_bht              ,
+			uint32_t predictor_1_bht_size_shifter      ,
+			bool     predictor_1_have_pht              ,
+			uint32_t predictor_1_pht_size_counter      ,
+			bool     predictor_2_have_bht              ,
+			uint32_t predictor_2_bht_size_shifter      ,
+			bool     predictor_2_have_pht              ,
+			uint32_t predictor_2_pht_size_counter      ,
+			uint32_t nb_prediction                     ,
+			uint32_t nb_branch_complete                );
+  public : Parameters  (Parameters & param) ;
+  public : ~Parameters () ;
+
+  public : string msg_error (void);
+
+  public :        string   print      (uint32_t depth);
+  public : friend ostream& operator<< (ostream& output_stream,
+				       morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::meta_predictor_glue::Parameters & x);
+  };
+
+}; // end namespace meta_predictor_glue
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/include/Statistics.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/include/Statistics.h	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/include/Statistics.h	(revision 46)
@@ -0,0 +1,59 @@
+#ifdef STATISTICS
+#ifndef morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_meta_predictor_glue_Statistics_h
+#define morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_meta_predictor_glue_Statistics_h
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Common/include/Debug.h"
+#include "Behavioural/include/Statistics.h"
+#include "Behavioural/include/Parameters_Statistics.h"
+//#include "Behavioural/Generic/Group/include/Statistics.h"
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Parameters.h"
+
+//using namespace morpheo::behavioural::generic::group;
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace meta_predictor_glue {
+
+
+  class Statistics : public morpheo::behavioural::Statistics
+  {
+    // -----[ fields ]----------------------------------------------------
+  private  : const Parameters                                   _parameters;
+
+    // -----[ methods ]---------------------------------------------------
+  public   : Statistics  (string                                      name                       ,
+			  morpheo::behavioural::Parameters_Statistics parameters_statistics      ,
+			  Parameters                                  parameters
+			  );
+//public   : Statistics  (Statistics & stat);
+  public   : ~Statistics () ;
+    
+  public   : string   print_body (uint32_t depth);
+  public   : string   print      (uint32_t depth);
+  public   : void     add        ();
+
+  public   : friend ostream& operator<< (ostream& output_stream,
+					 const Statistics & x);
+
+  };
+
+}; // end namespace meta_predictor_glue
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo
+
+#endif
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/include/Types.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/include/Types.h	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/include/Types.h	(revision 46)
@@ -0,0 +1,34 @@
+#ifdef SYSTEMC
+#ifndef morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_meta_predictor_glue_Type_h
+#define morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_meta_predictor_glue_Type_h
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Common/include/Types.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace meta_predictor_glue {
+
+  typedef uint32_t Thistory_t;
+  typedef uint32_t Tbht_history_t;
+  typedef uint32_t Tpht_history_t;
+  
+}; // end namespace meta_predictor_glue
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+
+#endif
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue.cpp	(revision 46)
@@ -0,0 +1,271 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Meta_Predictor_Glue.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace meta_predictor_glue {
+
+
+#ifdef SYSTEMC
+  Meta_Predictor_Glue::Meta_Predictor_Glue (sc_module_name name,
+#else
+  Meta_Predictor_Glue::Meta_Predictor_Glue (string name,
+#endif
+#ifdef STATISTICS
+			      morpheo::behavioural::Parameters_Statistics             param_statistics,
+#endif
+			      morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::meta_predictor_glue::Parameters param ):
+			      _name              (name)
+			      ,_param            (param)
+// #ifdef STATISTICS
+// 			      ,_param_statistics (param_statistics)
+// #endif
+  {
+    log_printf(FUNC,Meta_Predictor_Glue,"Meta_Predictor_Glue","Begin");
+
+    log_printf(INFO,Meta_Predictor_Glue,"Meta_Predictor_Glue","Allocation");
+    allocation ();
+
+#ifdef STATISTICS
+    log_printf(INFO,Meta_Predictor_Glue,"Meta_Predictor_Glue","Allocation of statistics");
+
+    // Allocation of statistics
+    _stat = new Statistics (static_cast<string>(_name),
+			    param_statistics          ,
+			    param);
+#endif
+
+#ifdef VHDL
+    // generate the vhdl
+    log_printf(INFO,Meta_Predictor_Glue,"Meta_Predictor_Glue","VHDL's generation");
+    vhdl();
+#endif
+
+#ifdef SYSTEMC
+#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
+    log_printf(INFO,Meta_Predictor_Glue,"Meta_Predictor_Glue","method - transition");
+
+    SC_METHOD (transition);
+    dont_initialize ();
+    sensitive_pos << *(in_CLOCK);
+#endif
+
+    log_printf(INFO,Meta_Predictor_Glue,"Meta_Predictor_Glue","method - genMealy_predict_ack");
+    SC_METHOD (genMealy_predict_ack);
+    dont_initialize ();
+    for (uint32_t i=0; i<_param._nb_prediction; i++)
+      {
+	sensitive << *(in_PREDICT_PREDICTOR_2_ACK [i]);
+	
+	if (_param._have_meta_predictor)
+	  {
+	    sensitive << *(in_PREDICT_PREDICTOR_0_ACK [i])
+		      << *(in_PREDICT_PREDICTOR_1_ACK [i]);
+	  }			           
+      }
+
+#ifdef SYSTEMCASS_SPECIFIC
+    // List dependency information
+    for (uint32_t i=0; i<_param._nb_prediction; i++)
+      {
+	(*(out_PREDICT_ACK [i])) (*(in_PREDICT_PREDICTOR_2_ACK [i]));
+	
+	if (_param._have_meta_predictor)
+	  {
+	(*(out_PREDICT_ACK [i])) (*(in_PREDICT_PREDICTOR_0_ACK [i]));
+	(*(out_PREDICT_ACK [i])) (*(in_PREDICT_PREDICTOR_1_ACK [i]));
+	  }			           
+      }
+#endif    
+
+    log_printf(INFO,Meta_Predictor_Glue,"Meta_Predictor_Glue","method - genMealy_predict_history");
+    SC_METHOD (genMealy_predict_history);
+    dont_initialize ();
+    for (uint32_t i=0; i<_param._nb_prediction; i++)
+      {
+	if (_param._predictor_2_have_bht)
+	sensitive << *(in_PREDICT_PREDICTOR_2_BHT_HISTORY [i]);
+	if (_param._predictor_2_have_pht)
+	sensitive << *(in_PREDICT_PREDICTOR_2_PHT_HISTORY [i]);
+
+	if (_param._have_meta_predictor)
+	  {
+	if (_param._predictor_1_have_bht)
+	sensitive << *(in_PREDICT_PREDICTOR_1_BHT_HISTORY [i]);
+	if (_param._predictor_1_have_pht)
+	sensitive << *(in_PREDICT_PREDICTOR_1_PHT_HISTORY [i]);
+
+	if (_param._predictor_0_have_bht)
+	sensitive << *(in_PREDICT_PREDICTOR_0_BHT_HISTORY [i]);
+	if (_param._predictor_0_have_pht)
+	sensitive << *(in_PREDICT_PREDICTOR_0_PHT_HISTORY [i]);
+	  }			           
+      }
+
+#ifdef SYSTEMCASS_SPECIFIC
+    // List dependency information
+    for (uint32_t i=0; i<_param._nb_prediction; i++)
+      {
+	if (_param._predictor_2_have_bht)
+	(*(out_PREDICT_HISTORY    [i])) (*(in_PREDICT_PREDICTOR_2_BHT_HISTORY [i]));
+	if (_param._predictor_2_have_pht)
+	(*(out_PREDICT_HISTORY    [i])) (*(in_PREDICT_PREDICTOR_2_PHT_HISTORY [i]));
+
+	if (_param._have_meta_predictor)
+	  {
+	if (_param._predictor_1_have_bht)
+	(*(out_PREDICT_HISTORY    [i])) (*(in_PREDICT_PREDICTOR_1_BHT_HISTORY [i]));
+	if (_param._predictor_1_have_pht)
+	(*(out_PREDICT_HISTORY    [i])) (*(in_PREDICT_PREDICTOR_1_PHT_HISTORY [i]));
+
+	if (_param._predictor_0_have_bht)
+	(*(out_PREDICT_HISTORY    [i])) (*(in_PREDICT_PREDICTOR_0_BHT_HISTORY [i]));
+	if (_param._predictor_0_have_pht)
+	(*(out_PREDICT_HISTORY    [i])) (*(in_PREDICT_PREDICTOR_0_PHT_HISTORY [i]));
+	  }			           
+
+	if (_param._predictor_2_have_bht)
+	(*(out_PREDICT_DIRECTION  [i])) (*(in_PREDICT_PREDICTOR_2_BHT_HISTORY [i]));
+	if (_param._predictor_2_have_pht)
+	(*(out_PREDICT_DIRECTION  [i])) (*(in_PREDICT_PREDICTOR_2_PHT_HISTORY [i]));
+
+	if (_param._have_meta_predictor)
+	  {
+	if (_param._predictor_1_have_bht)
+	(*(out_PREDICT_DIRECTION  [i])) (*(in_PREDICT_PREDICTOR_1_BHT_HISTORY [i]));
+	if (_param._predictor_1_have_pht)
+	(*(out_PREDICT_DIRECTION  [i])) (*(in_PREDICT_PREDICTOR_1_PHT_HISTORY [i]));
+
+	if (_param._predictor_0_have_bht)
+	(*(out_PREDICT_DIRECTION  [i])) (*(in_PREDICT_PREDICTOR_0_BHT_HISTORY [i]));
+	if (_param._predictor_0_have_pht)
+	(*(out_PREDICT_DIRECTION  [i])) (*(in_PREDICT_PREDICTOR_0_PHT_HISTORY [i]));
+	  }			           
+      }
+#endif    
+
+    if (_param._have_meta_predictor)
+      {
+    log_printf(INFO,Meta_Predictor_Glue,"Meta_Predictor_Glue","method - genMealy_branch_complete_val");
+    SC_METHOD (genMealy_branch_complete_val);
+    dont_initialize ();
+    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+      {
+	sensitive << *(in_BRANCH_COMPLETE_VAL       [i])
+		  << *(in_BRANCH_COMPLETE_HISTORY   [i])
+		  << *(in_BRANCH_COMPLETE_DIRECTION [i]);
+      }
+
+#ifdef SYSTEMCASS_SPECIFIC
+    // List dependency information
+    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+      {
+	(*(out_BRANCH_COMPLETE_PREDICTOR_2_VAL       [i])) (*(in_BRANCH_COMPLETE_VAL       [i]));
+	(*(out_BRANCH_COMPLETE_PREDICTOR_2_VAL       [i])) (*(in_BRANCH_COMPLETE_HISTORY   [i]));
+	(*(out_BRANCH_COMPLETE_PREDICTOR_2_VAL       [i])) (*(in_BRANCH_COMPLETE_DIRECTION [i]));
+
+	(*(out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION [i])) (*(in_BRANCH_COMPLETE_VAL       [i]));
+	(*(out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION [i])) (*(in_BRANCH_COMPLETE_HISTORY   [i]));
+	(*(out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION [i])) (*(in_BRANCH_COMPLETE_DIRECTION [i]));
+      }
+#endif    
+      }
+
+    log_printf(INFO,Meta_Predictor_Glue,"Meta_Predictor_Glue","method - genMealy_branch_complete_ack");
+    SC_METHOD (genMealy_branch_complete_ack);
+    dont_initialize ();
+    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+      {
+	sensitive << *(in_BRANCH_COMPLETE_PREDICTOR_2_ACK [i]);
+	
+	if (_param._have_meta_predictor)
+	  {
+	    sensitive << *(in_BRANCH_COMPLETE_PREDICTOR_0_ACK [i])
+		      << *(in_BRANCH_COMPLETE_PREDICTOR_1_ACK [i]);
+	  }			           
+      }
+
+#ifdef SYSTEMCASS_SPECIFIC
+    // List dependency information
+    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+      {
+	(*(out_BRANCH_COMPLETE_ACK [i])) (*(in_BRANCH_COMPLETE_PREDICTOR_2_ACK [i]));
+	
+	if (_param._have_meta_predictor)
+	  {
+	(*(out_BRANCH_COMPLETE_ACK [i])) (*(in_BRANCH_COMPLETE_PREDICTOR_0_ACK [i]));
+	(*(out_BRANCH_COMPLETE_ACK [i])) (*(in_BRANCH_COMPLETE_PREDICTOR_1_ACK [i]));
+	  }			           
+      }
+#endif    
+
+    log_printf(INFO,Meta_Predictor_Glue,"Meta_Predictor_Glue","method - genMealy_branch_complete_history");
+    SC_METHOD (genMealy_branch_complete_history);
+    dont_initialize ();
+    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+      {
+	sensitive << *(in_BRANCH_COMPLETE_HISTORY [i]);
+      }
+
+#ifdef SYSTEMCASS_SPECIFIC
+    // List dependency information
+    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+      {
+	if (_param._predictor_2_have_bht)
+	 (*(out_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY [i])) (*( in_BRANCH_COMPLETE_HISTORY    [i]));
+	if (_param._predictor_2_have_pht)
+	 (*(out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY [i])) (*( in_BRANCH_COMPLETE_HISTORY    [i]));
+		
+	if (_param._have_meta_predictor)
+	  {
+	    if (_param._predictor_1_have_bht)
+	 (*(out_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY [i])) (*( in_BRANCH_COMPLETE_HISTORY    [i]));
+	    if (_param._predictor_1_have_pht)
+	 (*(out_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY [i])) (*( in_BRANCH_COMPLETE_HISTORY    [i]));
+													   
+	    if (_param._predictor_0_have_bht)
+	 (*(out_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY [i])) (*( in_BRANCH_COMPLETE_HISTORY    [i]));
+	    if (_param._predictor_0_have_pht)
+	 (*(out_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY [i])) (*( in_BRANCH_COMPLETE_HISTORY    [i]));
+	  }			           
+      }
+#endif    
+
+#endif
+    log_printf(FUNC,Meta_Predictor_Glue,"Meta_Predictor_Glue","End");
+  };
+  
+  Meta_Predictor_Glue::~Meta_Predictor_Glue (void)
+  {
+    log_printf(FUNC,Meta_Predictor_Glue,"~Meta_Predictor_Glue","Begin");
+
+#ifdef STATISTICS
+    log_printf(INFO,Meta_Predictor_Glue,"~Meta_Predictor_Glue","Generate Statistics");
+    _stat->generate_file(statistics(0));
+    
+    delete _stat;
+#endif
+
+#ifdef SYSTEMC
+    log_printf(INFO,Meta_Predictor_Glue,"~Meta_Predictor_Glue","Dealocation");
+    deallocation ();
+#endif
+
+    log_printf(FUNC,Meta_Predictor_Glue,"~Meta_Predictor_Glue","End");
+  };
+
+}; // end namespace meta_predictor_glue
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+}; // end namespace behavioural
+}; // end namespace morpheo              
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_allocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_allocation.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_allocation.cpp	(revision 46)
@@ -0,0 +1,206 @@
+#ifdef SYSTEMC
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Meta_Predictor_Glue.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace meta_predictor_glue {
+
+
+  void Meta_Predictor_Glue::allocation (void)
+  {
+    string rename;
+
+    log_printf(FUNC,Meta_Predictor_Glue,"allocation","Begin");
+
+    _component   = new Component ();
+
+    Entity * entity = _component->set_entity (_name                 
+					     ,"Two_Level_Branch_Predictor_Glue"
+#ifdef POSITION
+					     ,COMBINATORY
+#endif
+					      );
+    
+    _interfaces = entity->set_interfaces();
+
+    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+    {
+      Interface * interface = _interfaces->set_interface(""
+#ifdef POSITION
+							 , IN  
+							 , SOUTH
+							 , "Generalist interface"
+#endif
+							 );
+      
+      in_CLOCK              = interface->set_signal_clk              ("clock" ,1,CLOCK_VHDL_NO);
+      in_NRESET             = interface->set_signal_in  <Tcontrol_t> ("nreset",1,RESET_VHDL_NO);
+    }
+
+
+    // ~~~~~[ Interface : "Predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+    if (_param._have_meta_predictor)
+      {
+     in_PREDICT_PREDICTOR_0_ACK         = new SC_IN (Tcontrol_t)     * [_param._nb_prediction     ];
+     in_PREDICT_PREDICTOR_1_ACK         = new SC_IN (Tcontrol_t)     * [_param._nb_prediction     ];
+      }			           
+     in_PREDICT_PREDICTOR_2_ACK         = new SC_IN (Tcontrol_t)     * [_param._nb_prediction     ];
+    out_PREDICT_ACK                     = new SC_OUT(Tcontrol_t)     * [_param._nb_prediction     ];
+    if (_param._have_meta_predictor)
+      {
+    if (_param._predictor_0_have_bht)
+     in_PREDICT_PREDICTOR_0_BHT_HISTORY = new SC_IN (Tbht_history_t) * [_param._nb_prediction     ];
+    if (_param._predictor_0_have_pht)
+     in_PREDICT_PREDICTOR_0_PHT_HISTORY = new SC_IN (Tpht_history_t) * [_param._nb_prediction     ];
+    if (_param._predictor_1_have_bht)
+     in_PREDICT_PREDICTOR_1_BHT_HISTORY = new SC_IN (Tbht_history_t) * [_param._nb_prediction     ];
+    if (_param._predictor_1_have_pht)
+     in_PREDICT_PREDICTOR_1_PHT_HISTORY = new SC_IN (Tpht_history_t) * [_param._nb_prediction     ];
+      }
+    if (_param._predictor_2_have_bht)
+     in_PREDICT_PREDICTOR_2_BHT_HISTORY = new SC_IN (Tbht_history_t) * [_param._nb_prediction     ];
+    if (_param._predictor_2_have_pht)
+     in_PREDICT_PREDICTOR_2_PHT_HISTORY = new SC_IN (Tpht_history_t) * [_param._nb_prediction     ];
+    out_PREDICT_HISTORY                 = new SC_OUT(Thistory_t)     * [_param._nb_prediction     ];
+    out_PREDICT_DIRECTION               = new SC_OUT(Tcontrol_t)     * [_param._nb_prediction     ];
+
+    for (uint32_t i=0; i<_param._nb_prediction; i++)
+      {
+	Interface_fifo * interface = _interfaces->set_interface("predict_"+toString(i)
+#ifdef POSITION
+								, IN  
+								, WEST
+								, "Interface Predict"
+#endif
+								);
+
+	if (_param._have_meta_predictor)
+	  {
+	 in_PREDICT_PREDICTOR_0_ACK                   [i] = interface->set_signal_in  <Tcontrol_t>     ("predictor_0_ack"        , 1);
+	 in_PREDICT_PREDICTOR_1_ACK                   [i] = interface->set_signal_in  <Tcontrol_t>     ("predictor_1_ack"        , 1);
+	  }
+	 in_PREDICT_PREDICTOR_2_ACK                   [i] = interface->set_signal_in  <Tcontrol_t>     ("predictor_2_ack"        , 1);
+	
+	out_PREDICT_ACK                               [i] = interface->set_signal_out <Tcontrol_t>     ("ack"                    , 1);
+
+	if (_param._have_meta_predictor)
+	  {
+	if (_param._predictor_0_have_bht)
+	 in_PREDICT_PREDICTOR_0_BHT_HISTORY           [i] = interface->set_signal_in  <Tbht_history_t> ("predictor_0_bht_history", _param._predictor_0_bht_size_shifter);
+	if (_param._predictor_0_have_pht)
+	 in_PREDICT_PREDICTOR_0_PHT_HISTORY           [i] = interface->set_signal_in  <Tpht_history_t> ("predictor_0_pht_history", _param._predictor_0_pht_size_counter);
+	if (_param._predictor_1_have_bht)
+	 in_PREDICT_PREDICTOR_1_BHT_HISTORY           [i] = interface->set_signal_in  <Tbht_history_t> ("predictor_1_bht_history", _param._predictor_1_bht_size_shifter);
+	if (_param._predictor_1_have_pht)
+	 in_PREDICT_PREDICTOR_1_PHT_HISTORY           [i] = interface->set_signal_in  <Tpht_history_t> ("predictor_1_pht_history", _param._predictor_1_pht_size_counter);
+	  }
+	if (_param._predictor_2_have_bht)
+	 in_PREDICT_PREDICTOR_2_BHT_HISTORY           [i] = interface->set_signal_in  <Tbht_history_t> ("predictor_2_bht_history", _param._predictor_2_bht_size_shifter);
+	if (_param._predictor_2_have_pht)
+	 in_PREDICT_PREDICTOR_2_PHT_HISTORY           [i] = interface->set_signal_in  <Tpht_history_t> ("predictor_2_pht_history", _param._predictor_2_pht_size_counter);
+	out_PREDICT_HISTORY                           [i] = interface->set_signal_out <Thistory_t>     ("history"                , _param._size_history);
+	out_PREDICT_DIRECTION                         [i] = interface->set_signal_out <Tcontrol_t>     ("direction"              , 1);
+      }
+
+    // ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+    
+    if (_param._have_meta_predictor)
+      {
+     in_BRANCH_COMPLETE_VAL                     = new SC_IN (Tcontrol_t)     * [_param._nb_branch_complete     ];
+    out_BRANCH_COMPLETE_PREDICTOR_2_VAL         = new SC_OUT(Tcontrol_t)     * [_param._nb_branch_complete     ];
+
+     in_BRANCH_COMPLETE_PREDICTOR_0_ACK         = new SC_IN (Tcontrol_t)     * [_param._nb_branch_complete     ];
+     in_BRANCH_COMPLETE_PREDICTOR_1_ACK         = new SC_IN (Tcontrol_t)     * [_param._nb_branch_complete     ];
+      }			           
+     in_BRANCH_COMPLETE_PREDICTOR_2_ACK         = new SC_IN (Tcontrol_t)     * [_param._nb_branch_complete     ];
+    out_BRANCH_COMPLETE_ACK                     = new SC_OUT(Tcontrol_t)     * [_param._nb_branch_complete     ];
+    if (_param._have_meta_predictor)
+      {
+    if (_param._predictor_0_have_bht)
+    out_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY = new SC_OUT(Tbht_history_t) * [_param._nb_branch_complete     ];
+    if (_param._predictor_0_have_pht)
+    out_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY = new SC_OUT(Tpht_history_t) * [_param._nb_branch_complete     ];
+    if (_param._predictor_1_have_bht)
+    out_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY = new SC_OUT(Tbht_history_t) * [_param._nb_branch_complete     ];
+    if (_param._predictor_1_have_pht)
+    out_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY = new SC_OUT(Tpht_history_t) * [_param._nb_branch_complete     ];
+      }
+    if (_param._predictor_2_have_bht)
+    out_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY = new SC_OUT(Tbht_history_t) * [_param._nb_branch_complete     ];
+    if (_param._predictor_2_have_pht)
+    out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY = new SC_OUT(Tpht_history_t) * [_param._nb_branch_complete     ];
+     in_BRANCH_COMPLETE_HISTORY                 = new SC_IN (Thistory_t)     * [_param._nb_branch_complete     ];
+    if (_param._have_meta_predictor)
+      {
+     in_BRANCH_COMPLETE_DIRECTION               = new SC_IN (Tcontrol_t)     * [_param._nb_branch_complete     ];
+    out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION   = new SC_OUT(Tcontrol_t)     * [_param._nb_branch_complete     ];
+      }
+    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+      {
+	Interface_fifo * interface = _interfaces->set_interface("branch_complete_"+toString(i)
+#ifdef POSITION
+								, IN  
+								, EAST
+								, "Interface branch complete"
+#endif
+								);
+
+	if (_param._have_meta_predictor)
+	  {
+	 in_BRANCH_COMPLETE_VAL                      [i] = interface->set_signal_in  <Tcontrol_t>     ("val"            , 1);
+	out_BRANCH_COMPLETE_PREDICTOR_2_VAL          [i] = interface->set_signal_out <Tcontrol_t>     ("predictor_2_val", 1);
+	 in_BRANCH_COMPLETE_PREDICTOR_0_ACK          [i] = interface->set_signal_in  <Tcontrol_t>     ("predictor_0_ack", 1);
+	 in_BRANCH_COMPLETE_PREDICTOR_1_ACK          [i] = interface->set_signal_in  <Tcontrol_t>     ("predictor_1_ack", 1);
+	  }
+	 in_BRANCH_COMPLETE_PREDICTOR_2_ACK          [i] = interface->set_signal_in  <Tcontrol_t>     ("predictor_2_ack" , 1);
+	out_BRANCH_COMPLETE_ACK                      [i] = interface->set_signal_out <Tcontrol_t>     ("ack"             , 1);
+	if (_param._have_meta_predictor)
+	  {
+	if (_param._predictor_0_have_bht)
+	out_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY  [i] = interface->set_signal_out <Tbht_history_t> ("predictor_0_bht_history" , _param._predictor_0_bht_size_shifter );
+	if (_param._predictor_0_have_pht)
+	out_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY  [i] = interface->set_signal_out <Tpht_history_t> ("predictor_0_pht_history" , _param._predictor_0_pht_size_counter);
+	if (_param._predictor_1_have_bht)
+	out_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY  [i] = interface->set_signal_out <Tbht_history_t> ("predictor_1_bht_history" , _param._predictor_1_bht_size_shifter );
+	if (_param._predictor_1_have_pht)
+	out_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY  [i] = interface->set_signal_out <Tpht_history_t> ("predictor_1_pht_history" , _param._predictor_1_pht_size_counter );
+	  }
+	if (_param._predictor_2_have_bht)
+	out_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY  [i] = interface->set_signal_out <Tbht_history_t> ("predictor_2_bht_history" , _param._predictor_2_bht_size_shifter);
+	if (_param._predictor_2_have_pht)
+	out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY  [i] = interface->set_signal_out <Tpht_history_t> ("predictor_2_pht_history" , _param._predictor_2_pht_size_counter);
+	 in_BRANCH_COMPLETE_HISTORY                  [i] = interface->set_signal_in  <Thistory_t>     ("history"                 , _param._size_history);
+	if (_param._have_meta_predictor)
+	  {
+	 in_BRANCH_COMPLETE_DIRECTION                [i] = interface->set_signal_in  <Tcontrol_t>     ("direction"             , 1);
+	out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION    [i] = interface->set_signal_out <Tcontrol_t>     ("predictor_2_direction" , 1);
+	  }
+      }
+    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
+
+#ifdef POSITION
+    _component->generate_file();
+#endif
+
+    log_printf(FUNC,Meta_Predictor_Glue,"allocation","End");
+  };
+
+}; // end namespace meta_predictor_glue
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_deallocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_deallocation.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_deallocation.cpp	(revision 46)
@@ -0,0 +1,95 @@
+#ifdef SYSTEMC
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Meta_Predictor_Glue.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace meta_predictor_glue {
+
+
+  void Meta_Predictor_Glue::deallocation (void)
+  {
+    log_printf(FUNC,Meta_Predictor_Glue,"deallocation","Begin");
+
+    delete     in_CLOCK;
+    delete     in_NRESET;
+
+    if (_param._have_meta_predictor)
+    {
+    delete []   in_PREDICT_PREDICTOR_0_ACK;
+    delete []   in_PREDICT_PREDICTOR_1_ACK;
+    }			           
+    delete []   in_PREDICT_PREDICTOR_2_ACK;
+    delete []  out_PREDICT_ACK            ;
+    if (_param._have_meta_predictor)
+    {
+    if (_param._predictor_0_have_bht)
+    delete []   in_PREDICT_PREDICTOR_0_BHT_HISTORY;
+    if (_param._predictor_0_have_pht)
+    delete []   in_PREDICT_PREDICTOR_0_PHT_HISTORY;
+    if (_param._predictor_1_have_bht)
+    delete []   in_PREDICT_PREDICTOR_1_BHT_HISTORY;
+    if (_param._predictor_1_have_pht)
+    delete []   in_PREDICT_PREDICTOR_1_PHT_HISTORY ;
+    }
+    if (_param._predictor_2_have_bht)
+    delete []   in_PREDICT_PREDICTOR_2_BHT_HISTORY ;
+    if (_param._predictor_2_have_pht)
+    delete []   in_PREDICT_PREDICTOR_2_PHT_HISTORY ;
+    delete []  out_PREDICT_HISTORY                 ;
+    delete []  out_PREDICT_DIRECTION               ;
+
+    if (_param._have_meta_predictor)
+    {
+    delete []   in_BRANCH_COMPLETE_VAL                     ;
+    delete []  out_BRANCH_COMPLETE_PREDICTOR_2_VAL         ;
+
+    delete []   in_BRANCH_COMPLETE_PREDICTOR_0_ACK         ;
+    delete []   in_BRANCH_COMPLETE_PREDICTOR_1_ACK         ;
+    }			           
+    delete []   in_BRANCH_COMPLETE_PREDICTOR_2_ACK         ;
+    delete []  out_BRANCH_COMPLETE_ACK                     ;
+    if (_param._have_meta_predictor)
+    {
+    if (_param._predictor_0_have_bht)
+    delete []  out_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY ;
+    if (_param._predictor_0_have_pht)
+    delete []  out_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY ;
+    if (_param._predictor_1_have_bht)
+    delete []  out_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY ;
+    if (_param._predictor_1_have_pht)
+    delete []  out_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY ;
+    }
+    if (_param._predictor_2_have_bht)
+    delete []  out_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY ;
+    if (_param._predictor_2_have_pht)
+    delete []  out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY ;
+    delete []   in_BRANCH_COMPLETE_HISTORY                 ;
+    if (_param._have_meta_predictor)
+      {
+    delete []   in_BRANCH_COMPLETE_DIRECTION               ;
+    delete []  out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION   ;
+      }
+    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
+    delete _component;
+
+    log_printf(FUNC,Meta_Predictor_Glue,"deallocation","End");
+  };
+
+}; // end namespace meta_predictor_glue
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_genMealy_branch_complete_ack.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_genMealy_branch_complete_ack.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_genMealy_branch_complete_ack.cpp	(revision 46)
@@ -0,0 +1,40 @@
+#ifdef SYSTEMC
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Meta_Predictor_Glue.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace meta_predictor_glue {
+
+  void Meta_Predictor_Glue::genMealy_branch_complete_ack (void)
+  {
+    log_printf(FUNC,Meta_Predictor_Glue,"genMealy_branch_complete_ack","Begin");
+    
+    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+      {
+	Tcontrol_t predictor_0_ack =  not _param._have_meta_predictor or PORT_READ(in_BRANCH_COMPLETE_PREDICTOR_0_ACK [i]);
+	Tcontrol_t predictor_1_ack =  not _param._have_meta_predictor or PORT_READ(in_BRANCH_COMPLETE_PREDICTOR_1_ACK [i]);
+	Tcontrol_t predictor_2_ack =                                     PORT_READ(in_BRANCH_COMPLETE_PREDICTOR_2_ACK [i]);
+
+	PORT_WRITE(out_BRANCH_COMPLETE_ACK [i], predictor_0_ack and predictor_1_ack and predictor_2_ack);
+      }
+
+    log_printf(FUNC,Meta_Predictor_Glue,"genMealy_branch_complete_ack","End");
+  };
+
+}; // end namespace meta_predictor_glue
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_genMealy_branch_complete_history.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_genMealy_branch_complete_history.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_genMealy_branch_complete_history.cpp	(revision 46)
@@ -0,0 +1,55 @@
+#ifdef SYSTEMC
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Meta_Predictor_Glue.h"
+#include "Common/include/BitManipulation.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace meta_predictor_glue {
+
+  void Meta_Predictor_Glue::genMealy_branch_complete_history (void)
+  {
+    log_printf(FUNC,Meta_Predictor_Glue,"genMealy_branch_complete_history","Begin");
+    
+    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+      {
+	Thistory_t     history = PORT_READ(in_BRANCH_COMPLETE_HISTORY [i]);
+
+	if (_param._have_meta_predictor)
+	  {
+	if (_param._predictor_0_have_bht) 
+	PORT_WRITE(out_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY [i], (history >> _param._shift_0) & gen_mask<Tbht_history_t>(_param._predictor_0_bht_size_shifter));
+	if (_param._predictor_0_have_pht)
+	PORT_WRITE(out_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY [i], (history >> _param._shift_1) & gen_mask<Tpht_history_t>(_param._predictor_0_pht_size_counter));
+	  }
+
+	if (_param._predictor_1_have_bht)
+	PORT_WRITE(out_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY [i], (history >> _param._shift_2) & gen_mask<Tbht_history_t>(_param._predictor_1_bht_size_shifter));
+	if (_param._predictor_1_have_pht)
+	PORT_WRITE(out_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY [i], (history >> _param._shift_3) & gen_mask<Tpht_history_t>(_param._predictor_1_pht_size_counter));
+
+	if (_param._predictor_2_have_bht)
+	PORT_WRITE(out_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY [i], (history >> _param._shift_4) & gen_mask<Tbht_history_t>(_param._predictor_2_bht_size_shifter));
+	if (_param._predictor_2_have_pht)
+	PORT_WRITE(out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY [i], (history >> _param._shift_5) & gen_mask<Tpht_history_t>(_param._predictor_2_pht_size_counter));
+      }
+
+    log_printf(FUNC,Meta_Predictor_Glue,"genMealy_branch_complete_history","End");
+  };
+
+}; // end namespace meta_predictor_glue
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_genMealy_branch_complete_val.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_genMealy_branch_complete_val.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_genMealy_branch_complete_val.cpp	(revision 46)
@@ -0,0 +1,82 @@
+#ifdef SYSTEMC
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Meta_Predictor_Glue.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace meta_predictor_glue {
+
+  void Meta_Predictor_Glue::genMealy_branch_complete_val (void)
+  {
+    log_printf(FUNC,Meta_Predictor_Glue,"genMealy_branch_complete_val","Begin");
+    
+    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+      {
+	Tcontrol_t val                   = PORT_READ(in_BRANCH_COMPLETE_VAL             [i]);
+	Thistory_t history               = PORT_READ(in_BRANCH_COMPLETE_HISTORY         [i]);
+	Tcontrol_t direction             = PORT_READ(in_BRANCH_COMPLETE_DIRECTION       [i]);
+
+	Tcontrol_t predictor_0_direction = (history>>(_param._shift_2-1))&1;
+	Tcontrol_t predictor_1_direction = (history>>(_param._shift_4-1))&1;
+// 	Tcontrol_t predictor_2_direction = (history>>(_param._shift_6-1))&1;
+
+// 	log_printf(TRACE,Meta_Predictor_Glue,"genMealy_branch_complete_val","direction_(predictor_0 %d, predictor_1 %d, predictor_2 %d, good %d)", predictor_0_direction, predictor_1_direction, predictor_2_direction, direction);
+	log_printf(TRACE,Meta_Predictor_Glue,"genMealy_branch_complete_val","direction_(predictor_0 %d, predictor_1 %d, good %d)", predictor_0_direction, predictor_1_direction, direction);
+
+	log_printf(TRACE,Meta_Predictor_Glue,"genMealy_branch_complete_val"," *  direction_0 : %d >>(%d-1)",history,_param._shift_2);
+	log_printf(TRACE,Meta_Predictor_Glue,"genMealy_branch_complete_val"," *  direction_1 : %d >>(%d-1)",history,_param._shift_4);
+	log_printf(TRACE,Meta_Predictor_Glue,"genMealy_branch_complete_val"," *  direction_2 : %d >>(%d-1)",history,_param._shift_6);
+
+	/*
+	dir_0 dir_1 dir_2 | good_dir  || next_dir_2
+	------------------+-----------++-----------
+	  0     0     0   |     0     || no change 
+	  1     0     0   |     0     ||         1 select pred_0 but miss
+	  0     1     0   |     0     ||         0 select pred_0 and hit 
+	  1     1     0   |     0     || no change
+	  0     0     1   |     0     || no change
+	  1     0     1   |     0     ||         1 select pred_1 and hit 
+	  0     1     1   |     0     ||         0 select pred_1 but miss
+	  1     1     1   |     0     || no change
+	  0     0     0   |     1     || no change
+	  1     0     0   |     1     ||         0 select pred_0 and hit 
+	  0     1     0   |     1     ||         1 select pred_0 but miss
+	  1     1     0   |     1     || no change
+	  0     0     1   |     1     || no change
+	  1     0     1   |     1     ||         0 select pred_1 but miss
+	  0     1     1   |     1     ||         1 select pred_1 and hit 
+	  1     1     1   |     1     || no change
+
+	next_dir_2 = (good_dir and dir_1) or (not good_dir and dir_0)
+	*/
+
+	Tcontrol_t branch_complete_predictor_2_val       =       val and (predictor_0_direction xor predictor_1_direction);
+	Tcontrol_t branch_complete_predictor_2_direction = ( (not direction and predictor_0_direction) or
+							     (    direction and predictor_1_direction) );
+
+	log_printf(TRACE,Meta_Predictor_Glue,"genMealy_branch_complete_val","branch_complete_predictor_2_( val %d, direction %d)",branch_complete_predictor_2_val, branch_complete_predictor_2_direction);
+
+	// Modify meta_predictor if have a branch_complete and twice prediction have not predict the same way
+									  PORT_WRITE(out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION [i], branch_complete_predictor_2_direction);
+	PORT_WRITE(out_BRANCH_COMPLETE_PREDICTOR_2_VAL       [i], branch_complete_predictor_2_val      );
+      }
+
+    log_printf(FUNC,Meta_Predictor_Glue,"genMealy_branch_complete_val","End");
+  };
+
+}; // end namespace meta_predictor_glue
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_genMealy_predict_ack.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_genMealy_predict_ack.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_genMealy_predict_ack.cpp	(revision 46)
@@ -0,0 +1,41 @@
+#ifdef SYSTEMC
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Meta_Predictor_Glue.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace meta_predictor_glue {
+
+
+  void Meta_Predictor_Glue::genMealy_predict_ack (void)
+  {
+    log_printf(FUNC,Meta_Predictor_Glue,"genMealy_predict_ack","Begin");
+    
+    for (uint32_t i=0; i<_param._nb_prediction; i++)
+      {
+	Tcontrol_t predictor_0_ack =  not _param._have_meta_predictor or PORT_READ(in_PREDICT_PREDICTOR_0_ACK [i]);
+	Tcontrol_t predictor_1_ack =  not _param._have_meta_predictor or PORT_READ(in_PREDICT_PREDICTOR_1_ACK [i]);
+	Tcontrol_t predictor_2_ack =                                     PORT_READ(in_PREDICT_PREDICTOR_2_ACK [i]);
+
+	PORT_WRITE(out_PREDICT_ACK [i], predictor_0_ack and predictor_1_ack and predictor_2_ack);
+      }
+
+    log_printf(FUNC,Meta_Predictor_Glue,"genMealy_predict_ack","End");
+  };
+
+}; // end namespace meta_predictor_glue
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_genMealy_predict_history.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_genMealy_predict_history.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_genMealy_predict_history.cpp	(revision 46)
@@ -0,0 +1,102 @@
+#ifdef SYSTEMC
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Meta_Predictor_Glue.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace meta_predictor_glue {
+
+
+  void Meta_Predictor_Glue::genMealy_predict_history (void)
+  {
+    log_printf(FUNC,Meta_Predictor_Glue,"genMealy_predict_history","Begin");
+    
+    for (uint32_t i=0; i<_param._nb_prediction; i++)
+      {
+	Thistory_t     history = 0;
+	Tpht_history_t predictor_0_pht_history  =0, predictor_1_pht_history  =0, predictor_2_pht_history  =0;
+	Tbht_history_t predictor_0_bht_history  =0, predictor_1_bht_history  =0, predictor_2_bht_history  =0;
+	Tcontrol_t     predictor_0_pht_direction=0, predictor_1_pht_direction=0, predictor_2_pht_direction=0;
+	Tcontrol_t     predictor_0_bht_direction=0, predictor_1_bht_direction=0, predictor_2_bht_direction=0;
+	Tcontrol_t     predictor_0_direction,     predictor_1_direction,     predictor_2_direction;
+	Tcontrol_t     predictor_direction;
+
+	if (_param._predictor_2_have_pht)
+	  {
+	predictor_2_pht_history   = PORT_READ(in_PREDICT_PREDICTOR_2_PHT_HISTORY [i]);
+	predictor_2_pht_direction = predictor_2_pht_history >> (_param._predictor_2_pht_size_counter-1);
+	history                  |= (predictor_2_pht_history << _param._shift_5);
+	  }
+	if (_param._predictor_2_have_bht)
+	  {
+	predictor_2_bht_history   = PORT_READ(in_PREDICT_PREDICTOR_2_BHT_HISTORY [i]);
+	predictor_2_bht_direction = predictor_2_bht_history >> (_param._predictor_2_bht_size_shifter-1);
+	history                  |= (predictor_2_bht_history << _param._shift_4);
+	  }
+
+	predictor_2_direction = (_param._predictor_2_have_pht==true)?predictor_2_pht_direction:predictor_2_bht_direction;
+
+	if (_param._have_meta_predictor)
+	  {
+	if (_param._predictor_1_have_pht)
+	  {
+	predictor_1_pht_history   = PORT_READ(in_PREDICT_PREDICTOR_1_PHT_HISTORY [i]);
+	predictor_1_pht_direction = predictor_1_pht_history >> (_param._predictor_1_pht_size_counter-1);
+	history                  |= (predictor_1_pht_history << _param._shift_3);
+	  }
+	if (_param._predictor_1_have_bht)
+	  {
+	predictor_1_bht_history   = PORT_READ(in_PREDICT_PREDICTOR_1_BHT_HISTORY [i]);
+	predictor_1_bht_direction = predictor_1_bht_history >> (_param._predictor_1_bht_size_shifter-1);
+	history                  |= (predictor_1_bht_history << _param._shift_2) ;
+	  }
+	if (_param._predictor_0_have_pht)
+	  {
+	predictor_0_pht_history   = PORT_READ(in_PREDICT_PREDICTOR_0_PHT_HISTORY [i]);
+	predictor_0_pht_direction = predictor_0_pht_history >> (_param._predictor_0_pht_size_counter-1);
+	history                  |= (predictor_0_pht_history << _param._shift_1);
+	  }
+	if (_param._predictor_0_have_bht)
+	  {
+	predictor_0_bht_history   = PORT_READ(in_PREDICT_PREDICTOR_0_BHT_HISTORY [i]);
+	predictor_0_bht_direction = predictor_0_bht_history >> (_param._predictor_0_bht_size_shifter-1);
+	history                  |= (predictor_0_bht_history << _param._shift_0);
+	  }
+
+	predictor_0_direction = (_param._predictor_0_have_pht==true)?predictor_0_pht_direction:predictor_0_bht_direction;
+	predictor_1_direction = (_param._predictor_1_have_pht==true)?predictor_1_pht_direction:predictor_1_bht_direction;
+
+	// Meta predictor : take direction of prediction_2 and select the good predictor.
+	predictor_direction   = (predictor_2_direction==0)?predictor_0_direction:predictor_1_direction;
+	
+	log_printf(TRACE,Meta_Predictor_Glue,"genMealy_predict_history","predict_direction = %d - predictor(_0 %d, _1 %d, _2 %d)",predictor_direction,predictor_0_direction,predictor_1_direction,predictor_2_direction);
+	  }
+	else
+	  {
+	predictor_direction   =  predictor_2_direction;
+	log_printf(TRACE,Meta_Predictor_Glue,"genMealy_predict_history","predict_direction = %d - predictor_2 %d",predictor_direction,predictor_2_direction);
+	  }
+
+	PORT_WRITE(out_PREDICT_DIRECTION [i], predictor_direction);
+	PORT_WRITE(out_PREDICT_HISTORY   [i], history            );
+      }
+
+    log_printf(FUNC,Meta_Predictor_Glue,"genMealy_predict_history","End");
+  };
+
+}; // end namespace meta_predictor_glue
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_statistics.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_statistics.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_statistics.cpp	(revision 46)
@@ -0,0 +1,37 @@
+#ifdef STATISTICS
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Meta_Predictor_Glue.h"
+
+namespace morpheo {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace meta_predictor_glue {
+
+
+  string Meta_Predictor_Glue::statistics (uint32_t depth)
+  {
+    log_printf(FUNC,Meta_Predictor_Glue,"statistics","Begin");
+
+    string txt = _stat->print(depth);
+    
+    log_printf(FUNC,Meta_Predictor_Glue,"statistics","End");
+
+    return txt;
+  };
+
+}; // end namespace meta_predictor_glue
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_transition.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_transition.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_transition.cpp	(revision 46)
@@ -0,0 +1,43 @@
+#ifdef SYSTEMC
+#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Meta_Predictor_Glue.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace meta_predictor_glue {
+
+
+  void Meta_Predictor_Glue::transition (void)
+  {
+    log_printf(FUNC,Meta_Predictor_Glue,"transition","Begin");
+
+#ifdef STATISTICS
+    _stat->add();
+#endif    
+
+#ifdef VHDL_TESTBENCH
+    vhdl_testbench_transition ();
+#endif
+
+    log_printf(FUNC,Meta_Predictor_Glue,"transition","End");
+  };
+
+}; // end namespace meta_predictor_glue
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_vhdl.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_vhdl.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_vhdl.cpp	(revision 46)
@@ -0,0 +1,45 @@
+#ifdef VHDL
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Meta_Predictor_Glue.h"
+#include "Behavioural/include/Vhdl.h"
+
+namespace morpheo {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace meta_predictor_glue {
+
+
+  void Meta_Predictor_Glue::vhdl (void)
+  {
+    log_printf(FUNC,Meta_Predictor_Glue,"vhdl","Begin");
+
+    Vhdl * vhdl = new Vhdl (_name);
+
+    _interfaces->set_port     (vhdl);
+    _component ->vhdl_instance(vhdl);
+
+    vhdl_declaration (vhdl);
+    vhdl_body        (vhdl);
+
+    vhdl->generate_file();
+
+    delete vhdl;
+
+    log_printf(FUNC,Meta_Predictor_Glue,"vhdl","End");
+  };
+
+}; // end namespace meta_predictor_glue
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_vhdl_body.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_vhdl_body.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_vhdl_body.cpp	(revision 46)
@@ -0,0 +1,144 @@
+#ifdef VHDL
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Meta_Predictor_Glue.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace meta_predictor_glue {
+
+
+  void Meta_Predictor_Glue::vhdl_body (Vhdl * & vhdl)
+  {
+    log_printf(FUNC,Meta_Predictor_Glue,"vhdl_body","Begin");
+    vhdl->set_body ("");
+    vhdl->set_body (" -- predict");
+    
+    for (uint32_t i=0; i<_param._nb_prediction; i++)
+      {
+	string meta_predictor_ack =  (_param._have_meta_predictor==true)?("in_PREDICT_"+toString(i)+"_PREDICTOR_0_ACK and in_PREDICT_"+toString(i)+"_PREDICTOR_1_ACK"):"'1'";
+
+	vhdl->set_body ("out_PREDICT_"+toString(i)+"_ACK         <= "+meta_predictor_ack+" and "+"in_PREDICT_"+toString(i)+"_PREDICTOR_2_ACK;");
+
+	uint32_t index=_param._size_history;
+
+
+	if (_param._predictor_2_have_pht)
+	  {
+	vhdl->set_body ("out_PREDICT_"+toString(i)+"_HISTORY"+std_logic_range(index-1,index-_param._predictor_2_pht_size_counter)+" <= in_PREDICT_"+toString(i)+"_PREDICTOR_2_PHT_HISTORY;");
+	index-= _param._predictor_2_pht_size_counter;
+	  }
+	if (_param._predictor_2_have_bht)
+	  {
+	vhdl->set_body ("out_PREDICT_"+toString(i)+"_HISTORY"+std_logic_range(index-1,index-_param._predictor_2_bht_size_shifter)+" <= in_PREDICT_"+toString(i)+"_PREDICTOR_2_BHT_HISTORY;");
+	index-= _param._predictor_2_bht_size_shifter;
+	  }
+
+	if (_param._have_meta_predictor)
+	  {
+	if (_param._predictor_1_have_pht)
+	  {
+	vhdl->set_body ("out_PREDICT_"+toString(i)+"_HISTORY"+std_logic_range(index-1,index-_param._predictor_1_pht_size_counter)+" <= in_PREDICT_"+toString(i)+"_PREDICTOR_1_PHT_HISTORY;");
+	index-= _param._predictor_1_pht_size_counter;
+	  }
+	if (_param._predictor_1_have_bht)
+	  {
+	vhdl->set_body ("out_PREDICT_"+toString(i)+"_HISTORY"+std_logic_range(index-1,index-_param._predictor_1_bht_size_shifter)+" <= in_PREDICT_"+toString(i)+"_PREDICTOR_1_BHT_HISTORY;");
+	index-= _param._predictor_1_bht_size_shifter;
+	  }
+
+ 	if (_param._predictor_0_have_pht)
+	  {
+	vhdl->set_body ("out_PREDICT_"+toString(i)+"_HISTORY"+std_logic_range(index-1,index-_param._predictor_0_pht_size_counter)+" <= in_PREDICT_"+toString(i)+"_PREDICTOR_0_PHT_HISTORY;");
+	index-= _param._predictor_0_pht_size_counter;
+	  }
+	if (_param._predictor_0_have_bht)
+	  {
+	vhdl->set_body ("out_PREDICT_"+toString(i)+"_HISTORY"+std_logic_range(index-1,index-_param._predictor_0_bht_size_shifter)+" <= in_PREDICT_"+toString(i)+"_PREDICTOR_0_BHT_HISTORY;");
+	index-= _param._predictor_0_bht_size_shifter;
+	  }
+	  }
+
+	// direction of prediction
+	vhdl->set_body ("");
+	if (_param._have_meta_predictor)
+	  vhdl->set_body ("out_PREDICT_"+toString(i)+"_DIRECTION   <= predict_"+toString(i)+"_predictor_0_direction when predict_"+toString(i)+"_predictor_2_direction='0' else predict_"+toString(i)+"_predictor_1_direction;");
+	else
+	  vhdl->set_body ("out_PREDICT_"+toString(i)+"_DIRECTION   <= predict_"+toString(i)+"_predictor_2_direction;");
+      }
+
+    // Interface - branch_complete
+
+    vhdl->set_body ("");
+    vhdl->set_body (" -- branch_complete");
+    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+      {
+	// branch_complete_predictor_2 val and directionn
+	if (_param._have_meta_predictor)
+	  {
+	vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_VAL       <= (branch_complete_"+toString(i)+"_predictor_0_direction xor branch_complete_"+toString(i)+"_predictor_1_direction) and "+"in_BRANCH_COMPLETE_"+toString(i)+"_VAL;");
+	vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_DIRECTION <= (branch_complete_"+toString(i)+"_predictor_0_direction and not in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION) or (branch_complete_"+toString(i)+"_predictor_1_direction and in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION);");
+	  }
+
+	string meta_predictor_ack =  (_param._have_meta_predictor==true)?("in_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_0_ACK and in_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_1_ACK"):"'1'";
+
+	vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_ACK                   <= "+meta_predictor_ack+" and "+"in_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_ACK;");
+
+	uint32_t index=_param._size_history;
+
+	if (_param._predictor_2_have_pht)
+	  {
+	vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_PHT_HISTORY <= in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY"+std_logic_range(index-1,index-_param._predictor_2_pht_size_counter)+";");
+	index-= _param._predictor_2_pht_size_counter;
+	  }
+	if (_param._predictor_2_have_bht)
+	  {
+	vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_BHT_HISTORY <= in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY"+std_logic_range(index-1,index-_param._predictor_2_bht_size_shifter)+";");
+	index-= _param._predictor_2_bht_size_shifter;
+	  }
+
+	if (_param._have_meta_predictor)
+	  {
+	if (_param._predictor_1_have_pht)
+	  {
+	vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_1_PHT_HISTORY <= in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY"+std_logic_range(index-1,index-_param._predictor_1_pht_size_counter)+";");
+	index-= _param._predictor_1_pht_size_counter;
+	  }
+	if (_param._predictor_1_have_bht)
+	  {
+	vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_1_BHT_HISTORY <= in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY"+std_logic_range(index-1,index-_param._predictor_1_bht_size_shifter)+";");
+	index-= _param._predictor_1_bht_size_shifter;
+	  }
+
+	if (_param._predictor_0_have_pht)
+	  {
+	vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_0_PHT_HISTORY <= in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY"+std_logic_range(index-1,index-_param._predictor_0_pht_size_counter)+";");
+	index-= _param._predictor_0_pht_size_counter;
+	  }
+	if (_param._predictor_0_have_bht)
+	  {
+	vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_0_BHT_HISTORY <= in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY"+std_logic_range(index-1,index-_param._predictor_0_bht_size_shifter)+";");
+	index-= _param._predictor_0_bht_size_shifter;
+	  }
+	  }
+      }
+
+    log_printf(FUNC,Meta_Predictor_Glue,"vhdl_body","End");
+  };
+
+}; // end namespace meta_predictor_glue
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_vhdl_declaration.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_vhdl_declaration.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_vhdl_declaration.cpp	(revision 46)
@@ -0,0 +1,75 @@
+#ifdef VHDL
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Meta_Predictor_Glue.h"
+
+namespace morpheo {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace meta_predictor_glue {
+
+
+  void Meta_Predictor_Glue::vhdl_declaration (Vhdl * & vhdl)
+  {
+    log_printf(FUNC,Meta_Predictor_Glue,"vhdl_declaration","Begin");
+
+    for (uint32_t i=0; i<_param._nb_prediction; i++)
+      {
+	if (_param._have_meta_predictor)
+	  {
+	if (_param._predictor_0_have_pht)
+	  vhdl->set_alias ("predict_"+toString(i)+"_predictor_0_direction",std_logic(1), "in_PREDICT_"+toString(i)+"_PREDICTOR_0_PHT_HISTORY",std_logic_range(_param._predictor_0_pht_size_counter-1,_param._predictor_0_pht_size_counter-1));
+	else
+	  vhdl->set_alias ("predict_"+toString(i)+"_predictor_0_direction",std_logic(1), "in_PREDICT_"+toString(i)+"_PREDICTOR_0_BHT_HISTORY",std_logic_range(_param._predictor_0_bht_size_shifter-1,_param._predictor_0_bht_size_shifter-1));
+	if (_param._predictor_1_have_pht)
+	  vhdl->set_alias ("predict_"+toString(i)+"_predictor_1_direction",std_logic(1), "in_PREDICT_"+toString(i)+"_PREDICTOR_1_PHT_HISTORY",std_logic_range(_param._predictor_1_pht_size_counter-1,_param._predictor_1_pht_size_counter-1));
+	else
+	  vhdl->set_alias ("predict_"+toString(i)+"_predictor_1_direction",std_logic(1), "in_PREDICT_"+toString(i)+"_PREDICTOR_1_BHT_HISTORY",std_logic_range(_param._predictor_1_bht_size_shifter-1,_param._predictor_1_bht_size_shifter-1));
+	  }
+
+	if (_param._predictor_2_have_pht)
+	  vhdl->set_alias ("predict_"+toString(i)+"_predictor_2_direction",std_logic(1), "in_PREDICT_"+toString(i)+"_PREDICTOR_2_PHT_HISTORY",std_logic_range(_param._predictor_2_pht_size_counter-1,_param._predictor_2_pht_size_counter-1));
+	else
+	  vhdl->set_alias ("predict_"+toString(i)+"_predictor_2_direction",std_logic(1), "in_PREDICT_"+toString(i)+"_PREDICTOR_2_BHT_HISTORY",std_logic_range(_param._predictor_2_bht_size_shifter-1,_param._predictor_2_bht_size_shifter-1));
+      }
+
+    if (_param._have_meta_predictor)
+      {
+    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+      {
+// 	if (_param._predictor_2_have_pht)
+// 	vhdl->set_alias ("branch_complete_"+toString(i)+"_predictor_2_direction",std_logic(1)," in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY",std_logic_range(_param._shift_6-1, _param._shift_6-1));
+// 	else
+// 	vhdl->set_alias ("branch_complete_"+toString(i)+"_predictor_2_direction",std_logic(1)," in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY",std_logic_range(_param._shift_5-1, _param._shift_5-1));
+
+	if (_param._predictor_1_have_pht)
+	vhdl->set_alias ("branch_complete_"+toString(i)+"_predictor_1_direction",std_logic(1)," in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY",std_logic_range(_param._shift_4-1, _param._shift_4-1));
+	else
+	vhdl->set_alias ("branch_complete_"+toString(i)+"_predictor_1_direction",std_logic(1)," in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY",std_logic_range(_param._shift_3-1, _param._shift_3-1));
+
+	if (_param._predictor_0_have_pht)
+	vhdl->set_alias ("branch_complete_"+toString(i)+"_predictor_0_direction",std_logic(1)," in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY",std_logic_range(_param._shift_2-1, _param._shift_2-1));
+	else
+	vhdl->set_alias ("branch_complete_"+toString(i)+"_predictor_0_direction",std_logic(1)," in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY",std_logic_range(_param._shift_1-1, _param._shift_1-1));
+
+      }
+      }
+
+    log_printf(FUNC,Meta_Predictor_Glue,"vhdl_declaration","End");
+  };
+
+}; // end namespace meta_predictor_glue
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_vhdl_port.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_vhdl_port.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_vhdl_port.cpp	(revision 46)
@@ -0,0 +1,100 @@
+#ifdef VHDL
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Meta_Predictor_Glue.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace meta_predictor_glue {
+
+
+  void Meta_Predictor_Glue::vhdl_port (Vhdl & vhdl)
+  {
+    log_printf(FUNC,Meta_Predictor_Glue,"vhdl_port","Begin");
+
+    for (uint32_t i=0; i<_param._nb_prediction; i++)
+      {
+	if (_param._have_meta_predictor)
+	  {
+	vhdl.set_port (" in_PREDICT_PREDICTOR_0_ACK_"+toString(i)+"                ", IN, 1);
+	vhdl.set_port (" in_PREDICT_PREDICTOR_1_ACK_"+toString(i)+"                ", IN, 1);
+	  }
+	vhdl.set_port (" in_PREDICT_PREDICTOR_2_ACK_"+toString(i)+"                ", IN, 1);
+	vhdl.set_port ("out_PREDICT_ACK_"+toString(i)+"                            ",OUT, 1);
+
+	if (_param._have_meta_predictor)
+	  {
+	if (_param._predictor_0_have_bht)
+	vhdl.set_port (" in_PREDICT_PREDICTOR_0_BHT_HISTORY_"+toString(i)+"        ", IN,_param._predictor_0_bht_size_shifter);
+	if (_param._predictor_0_have_pht)
+	vhdl.set_port (" in_PREDICT_PREDICTOR_0_PHT_HISTORY_"+toString(i)+"        ", IN,_param._predictor_0_pht_size_counter);
+	if (_param._predictor_1_have_bht)
+	vhdl.set_port (" in_PREDICT_PREDICTOR_1_BHT_HISTORY_"+toString(i)+"        ", IN,_param._predictor_1_bht_size_shifter);
+	if (_param._predictor_1_have_pht)
+	vhdl.set_port (" in_PREDICT_PREDICTOR_1_PHT_HISTORY_"+toString(i)+"        ", IN,_param._predictor_1_pht_size_counter);
+	  }
+	if (_param._predictor_2_have_bht)
+	vhdl.set_port (" in_PREDICT_PREDICTOR_2_BHT_HISTORY_"+toString(i)+"        ", IN,_param._predictor_2_bht_size_shifter);
+	if (_param._predictor_2_have_pht)
+	vhdl.set_port (" in_PREDICT_PREDICTOR_2_PHT_HISTORY_"+toString(i)+"        ", IN,_param._predictor_2_pht_size_counter);
+
+	vhdl.set_port ("out_PREDICT_HISTORY_"+toString(i)+"                        ",OUT,_param._size_history);
+	vhdl.set_port ("out_PREDICT_DIRECTION_"+toString(i)+"                      ",OUT,1);
+      }
+
+    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+      {
+	if (_param._have_meta_predictor)
+	  {
+	vhdl.set_port (" in_BRANCH_COMPLETE_VAL_"+toString(i)+"                    ", IN, 1);
+	vhdl.set_port ("out_BRANCH_COMPLETE_PREDICTOR_2_VAL_"+toString(i)+"        ",OUT, 1);
+
+	vhdl.set_port (" in_BRANCH_COMPLETE_PREDICTOR_0_ACK_"+toString(i)+"        ", IN, 1);
+	vhdl.set_port (" in_BRANCH_COMPLETE_PREDICTOR_1_ACK_"+toString(i)+"        ", IN, 1);
+	  }
+	vhdl.set_port (" in_BRANCH_COMPLETE_PREDICTOR_2_ACK_"+toString(i)+"        ", IN, 1);
+	vhdl.set_port ("out_BRANCH_COMPLETE_ACK_"+toString(i)+"                    ",OUT, 1);
+
+	if (_param._have_meta_predictor)
+	  {
+	if (_param._predictor_0_have_bht)
+	vhdl.set_port ("out_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY_"+toString(i)+"",OUT,_param._predictor_0_bht_size_shifter);
+	if (_param._predictor_0_have_pht)
+	vhdl.set_port ("out_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY_"+toString(i)+"",OUT,_param._predictor_0_pht_size_counter);
+	if (_param._predictor_1_have_bht)
+	vhdl.set_port ("out_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY_"+toString(i)+"",OUT,_param._predictor_1_bht_size_shifter);
+	if (_param._predictor_1_have_pht)
+	vhdl.set_port ("out_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY_"+toString(i)+"",OUT,_param._predictor_1_pht_size_counter);
+	  }
+	if (_param._predictor_2_have_bht)
+	vhdl.set_port ("out_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY_"+toString(i)+"",OUT,_param._predictor_2_bht_size_shifter);
+	if (_param._predictor_2_have_pht)
+	vhdl.set_port ("out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY_"+toString(i)+"",OUT,_param._predictor_2_pht_size_counter);
+
+	vhdl.set_port (" in_BRANCH_COMPLETE_HISTORY_"+toString(i)+"                ", IN,_param._size_history);
+	if (_param._have_meta_predictor)
+	  {
+	vhdl.set_port (" in_BRANCH_COMPLETE_DIRECTION_"+toString(i)+"              ", IN,1);
+	vhdl.set_port ("out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION_"+toString(i)+"  ",OUT,1);
+	  }
+      }
+
+    log_printf(FUNC,Meta_Predictor_Glue,"vhdl_port","End");
+  };
+
+}; // end namespace meta_predictor_glue
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_vhdl_testbench_label.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_vhdl_testbench_label.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_vhdl_testbench_label.cpp	(revision 46)
@@ -0,0 +1,35 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Meta_Predictor_Glue.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace meta_predictor_glue {
+
+
+  void Meta_Predictor_Glue::vhdl_testbench_label (string label)
+  {
+    log_printf(FUNC,Meta_Predictor_Glue,"vhdl_testbench_label","Begin");
+
+#ifdef VHDL_TESTBENCH
+    _vhdl_testbench->add_label(label);
+#endif
+    
+    log_printf(FUNC,Meta_Predictor_Glue,"vhdl_testbench_label","End");
+  };
+
+}; // end namespace meta_predictor_glue
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_vhdl_testbench_port.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_vhdl_testbench_port.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_vhdl_testbench_port.cpp	(revision 46)
@@ -0,0 +1,100 @@
+#ifdef VHDL_TESTBENCH
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Meta_Predictor_Glue.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace meta_predictor_glue {
+
+
+  void Meta_Predictor_Glue::vhdl_testbench_port ()
+  {
+    log_printf(FUNC,Meta_Predictor_Glue,"vhdl_testbench_port","Begin");
+
+    for (uint32_t i=0; i<_param._nb_prediction; i++)
+      {
+	if (_param._have_meta_predictor)
+	  {
+	_vhdl_testbench->set_port (" in_PREDICT_PREDICTOR_0_ACK_"+toString(i)+"                ", IN, 1);
+	_vhdl_testbench->set_port (" in_PREDICT_PREDICTOR_1_ACK_"+toString(i)+"                ", IN, 1);
+	  }
+	_vhdl_testbench->set_port (" in_PREDICT_PREDICTOR_2_ACK_"+toString(i)+"                ", IN, 1);
+	_vhdl_testbench->set_port ("out_PREDICT_ACK_"+toString(i)+"                            ",OUT, 1);
+
+	if (_param._have_meta_predictor)
+	  {
+	if (_param._predictor_0_have_bht)
+	_vhdl_testbench->set_port (" in_PREDICT_PREDICTOR_0_BHT_HISTORY_"+toString(i)+"        ", IN,_param._predictor_0_bht_size_shifter);
+	if (_param._predictor_0_have_pht)
+	_vhdl_testbench->set_port (" in_PREDICT_PREDICTOR_0_PHT_HISTORY_"+toString(i)+"        ", IN,_param._predictor_0_pht_size_counter);
+	if (_param._predictor_1_have_bht)
+	_vhdl_testbench->set_port (" in_PREDICT_PREDICTOR_1_BHT_HISTORY_"+toString(i)+"        ", IN,_param._predictor_1_bht_size_shifter);
+	if (_param._predictor_1_have_pht)
+	_vhdl_testbench->set_port (" in_PREDICT_PREDICTOR_1_PHT_HISTORY_"+toString(i)+"        ", IN,_param._predictor_1_pht_size_counter);
+	  }
+	if (_param._predictor_2_have_bht)
+	_vhdl_testbench->set_port (" in_PREDICT_PREDICTOR_2_BHT_HISTORY_"+toString(i)+"        ", IN,_param._predictor_2_bht_size_shifter);
+	if (_param._predictor_2_have_pht)
+	_vhdl_testbench->set_port (" in_PREDICT_PREDICTOR_2_PHT_HISTORY_"+toString(i)+"        ", IN,_param._predictor_2_pht_size_counter);
+
+	_vhdl_testbench->set_port ("out_PREDICT_HISTORY_"+toString(i)+"                        ",OUT,_param._size_history);
+	_vhdl_testbench->set_port ("out_PREDICT_DIRECTION_"+toString(i)+"                      ",OUT,1);
+      }
+
+    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+      {
+	if (_param._have_meta_predictor)
+	  {
+	_vhdl_testbench->set_port (" in_BRANCH_COMPLETE_VAL_"+toString(i)+"                    ", IN, 1);
+	_vhdl_testbench->set_port ("out_BRANCH_COMPLETE_PREDICTOR_2_VAL_"+toString(i)+"        ",OUT, 1);
+
+	_vhdl_testbench->set_port (" in_BRANCH_COMPLETE_PREDICTOR_0_ACK_"+toString(i)+"        ", IN, 1);
+	_vhdl_testbench->set_port (" in_BRANCH_COMPLETE_PREDICTOR_1_ACK_"+toString(i)+"        ", IN, 1);
+	  }
+	_vhdl_testbench->set_port (" in_BRANCH_COMPLETE_PREDICTOR_2_ACK_"+toString(i)+"        ", IN, 1);
+	_vhdl_testbench->set_port ("out_BRANCH_COMPLETE_ACK_"+toString(i)+"                    ",OUT, 1);
+
+	if (_param._have_meta_predictor)
+	  {
+	if (_param._predictor_0_have_bht)
+	_vhdl_testbench->set_port ("out_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY_"+toString(i)+"",OUT,_param._predictor_0_bht_size_shifter);
+	if (_param._predictor_0_have_pht)
+	_vhdl_testbench->set_port ("out_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY_"+toString(i)+"",OUT,_param._predictor_0_pht_size_counter);
+	if (_param._predictor_1_have_bht)
+	_vhdl_testbench->set_port ("out_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY_"+toString(i)+"",OUT,_param._predictor_1_bht_size_shifter);
+	if (_param._predictor_1_have_pht)
+	_vhdl_testbench->set_port ("out_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY_"+toString(i)+"",OUT,_param._predictor_1_pht_size_counter);
+	  }
+	if (_param._predictor_2_have_bht)
+	_vhdl_testbench->set_port ("out_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY_"+toString(i)+"",OUT,_param._predictor_2_bht_size_shifter);
+	if (_param._predictor_2_have_pht)
+	_vhdl_testbench->set_port ("out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY_"+toString(i)+"",OUT,_param._predictor_2_pht_size_counter);
+
+	_vhdl_testbench->set_port (" in_BRANCH_COMPLETE_HISTORY_"+toString(i)+"                ", IN,_param._size_history);
+	if (_param._have_meta_predictor)
+	  {
+	_vhdl_testbench->set_port (" in_BRANCH_COMPLETE_DIRECTION_"+toString(i)+"              ", IN,1);
+	_vhdl_testbench->set_port ("out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION_"+toString(i)+"  ",OUT,1);
+	  }
+      }
+
+    log_printf(FUNC,Meta_Predictor_Glue,"vhdl_testbench_port","End");
+  };
+
+}; // end namespace meta_predictor_glue
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_vhdl_testbench_transition.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_vhdl_testbench_transition.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_vhdl_testbench_transition.cpp	(revision 46)
@@ -0,0 +1,36 @@
+#ifdef VHDL_TESTBENCH
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Meta_Predictor_Glue.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace meta_predictor_glue {
+
+
+  void Meta_Predictor_Glue::vhdl_testbench_transition ()
+  {
+    log_printf(FUNC,Meta_Predictor_Glue,"vhdl_testbench_transition","Begin");
+
+//  sc_start(0);
+    _interfaces->testbench();
+
+    log_printf(FUNC,Meta_Predictor_Glue,"vhdl_testbench_transition","End");
+  };
+
+}; // end namespace meta_predictor_glue
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Parameters.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Parameters.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Parameters.cpp	(revision 46)
@@ -0,0 +1,119 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Parameters.h"
+
+namespace morpheo {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace meta_predictor_glue {
+
+
+  Parameters::Parameters (bool     have_meta_predictor               ,
+			  bool     predictor_0_have_bht              ,
+			  uint32_t predictor_0_bht_size_shifter      ,
+			  bool     predictor_0_have_pht              ,
+			  uint32_t predictor_0_pht_size_counter      ,
+			  bool     predictor_1_have_bht              ,
+			  uint32_t predictor_1_bht_size_shifter      ,
+			  bool     predictor_1_have_pht              ,
+			  uint32_t predictor_1_pht_size_counter      ,
+			  bool     predictor_2_have_bht              ,
+			  uint32_t predictor_2_bht_size_shifter      ,
+			  bool     predictor_2_have_pht              ,
+			  uint32_t predictor_2_pht_size_counter      ,
+			  uint32_t nb_prediction                     ,
+			  uint32_t nb_branch_complete                ) :
+    _have_meta_predictor                (have_meta_predictor               ),
+    
+    _predictor_0_have_bht               ((have_meta_predictor==false)?false:predictor_0_have_bht              ),
+    _predictor_0_bht_size_shifter       ((_predictor_0_have_bht==false)?0:predictor_0_bht_size_shifter      ),
+    _predictor_0_have_pht               ((have_meta_predictor==false)?false:predictor_0_have_pht              ),
+    _predictor_0_pht_size_counter       ((_predictor_0_have_pht==false)?0:predictor_0_pht_size_counter      ),
+
+    _predictor_1_have_bht               ((have_meta_predictor==false)?false:predictor_1_have_bht              ),
+    _predictor_1_bht_size_shifter       ((_predictor_1_have_bht==false)?0:predictor_1_bht_size_shifter      ),
+    _predictor_1_have_pht               ((have_meta_predictor==false)?false:predictor_1_have_pht              ),
+    _predictor_1_pht_size_counter       ((_predictor_1_have_pht==false)?0:predictor_1_pht_size_counter      ),
+
+    _predictor_2_have_bht               (predictor_2_have_bht              ),
+    _predictor_2_bht_size_shifter       ((_predictor_2_have_bht==false)?0:predictor_2_bht_size_shifter      ),
+    _predictor_2_have_pht               (predictor_2_have_pht              ),
+    _predictor_2_pht_size_counter       ((_predictor_2_have_pht==false)?0:predictor_2_pht_size_counter      ),
+
+    _nb_prediction                      (nb_prediction                     ),
+    _nb_branch_complete                 (nb_branch_complete                ),
+
+    _size_history                       (_predictor_0_bht_size_shifter + _predictor_0_pht_size_counter +
+					 _predictor_1_bht_size_shifter + _predictor_1_pht_size_counter +
+					 _predictor_2_bht_size_shifter + _predictor_2_pht_size_counter ),
+
+    _shift_0                            (0),
+    _shift_1                            (_shift_0 + _predictor_0_bht_size_shifter),
+    _shift_2                            (_shift_1 + _predictor_0_pht_size_counter),
+    _shift_3                            (_shift_2 + _predictor_1_bht_size_shifter),
+    _shift_4                            (_shift_3 + _predictor_1_pht_size_counter),
+    _shift_5                            (_shift_4 + _predictor_2_bht_size_shifter),
+    _shift_6                            (_shift_5 + _predictor_2_pht_size_counter)
+  {
+    log_printf(FUNC,Meta_Predictor_Glue,"Parameters","Begin");
+    test();
+    log_printf(FUNC,Meta_Predictor_Glue,"Parameters","End");
+  };
+  
+  Parameters::Parameters (Parameters & param):
+    _have_meta_predictor                (param._have_meta_predictor                ),
+
+    _predictor_0_have_bht               (param._predictor_0_have_bht               ),
+    _predictor_0_bht_size_shifter       (param._predictor_0_bht_size_shifter       ),
+    _predictor_0_have_pht               (param._predictor_0_have_pht               ),
+    _predictor_0_pht_size_counter       (param._predictor_0_pht_size_counter       ),
+
+    _predictor_1_have_bht               (param._predictor_1_have_bht               ),
+    _predictor_1_bht_size_shifter       (param._predictor_1_bht_size_shifter       ),
+    _predictor_1_have_pht               (param._predictor_1_have_pht               ),
+    _predictor_1_pht_size_counter       (param._predictor_1_pht_size_counter       ),
+
+    _predictor_2_have_bht               (param._predictor_2_have_bht               ),
+    _predictor_2_bht_size_shifter       (param._predictor_2_bht_size_shifter       ),
+    _predictor_2_have_pht               (param._predictor_2_have_pht               ),
+    _predictor_2_pht_size_counter       (param._predictor_2_pht_size_counter       ),
+
+    _nb_prediction                      (param._nb_prediction                      ),
+    _nb_branch_complete                 (param._nb_branch_complete                 ),
+
+    _size_history                       (param._size_history                       ),
+
+    _shift_0                            (param._shift_0                            ),
+    _shift_1                            (param._shift_1                            ),
+    _shift_2                            (param._shift_2                            ),
+    _shift_3                            (param._shift_3                            ),
+    _shift_4                            (param._shift_4                            ),
+    _shift_5                            (param._shift_5                            ),
+    _shift_6                            (param._shift_6                            )
+
+  {
+    log_printf(FUNC,Meta_Predictor_Glue,"Parameters","Begin");
+    test();
+    log_printf(FUNC,Meta_Predictor_Glue,"Parameters","End");
+  };
+
+  Parameters::~Parameters () 
+  {
+    log_printf(FUNC,Meta_Predictor_Glue,"~Parameters","Begin");
+    log_printf(FUNC,Meta_Predictor_Glue,"~Parameters","End");
+  };
+
+}; // end namespace meta_predictor_glue
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Parameters_msg_error.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Parameters_msg_error.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Parameters_msg_error.cpp	(revision 46)
@@ -0,0 +1,51 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Parameters.h"
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Types.h"
+#include <sstream>
+using namespace std;
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace meta_predictor_glue {
+
+
+  string Parameters::msg_error(void)
+  {
+    log_printf(FUNC,Meta_Predictor_Glue,"msg_error","Begin");
+
+    string msg = "";
+
+    // note : size_shifter and size_counter is set at 0 if not need
+    if ((8*sizeof(Thistory_t)) < _size_history)
+      {
+        msg += "  - type \"Thistory_t\" is too little to the total size of history (shifter's size and counter's size)\n";
+        msg +=  "    * predictor_0_bht_size_shifter    : " + toString(_predictor_0_bht_size_shifter) + "\n";
+        msg +=  "    * predictor_0_pht_size_counter    : " + toString(_predictor_0_pht_size_counter) + "\n";
+        msg +=  "    * predictor_1_bht_size_shifter    : " + toString(_predictor_1_bht_size_shifter) + "\n";
+        msg +=  "    * predictor_1_pht_size_counter    : " + toString(_predictor_1_pht_size_counter) + "\n";
+        msg +=  "    * predictor_2_bht_size_shifter    : " + toString(_predictor_2_bht_size_shifter) + "\n";
+        msg +=  "    * predictor_2_pht_size_counter    : " + toString(_predictor_2_pht_size_counter) + "\n";
+	msg +=  "    * Thistory_t                (bits): " + toString(8*(sizeof(Thistory_t))) + "\n";
+      }
+
+    return msg;
+
+    log_printf(FUNC,Meta_Predictor_Glue,"msg_error","End");
+  };
+
+}; // end namespace meta_predictor_glue
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Parameters_print.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Parameters_print.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Parameters_print.cpp	(revision 46)
@@ -0,0 +1,99 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Parameters.h"
+#include "Behavioural/include/XML.h"
+using namespace std;
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace meta_predictor_glue {
+
+
+  string Parameters::print (uint32_t depth)
+  {
+    log_printf(FUNC,Meta_Predictor_Glue,"print","Begin");
+
+    XML xml ("meta_predictor_glue");
+
+    xml.balise_open("meta_predictor_glue");
+
+    xml.  singleton_begin("have_meta_predictor               ");               
+    xml.    attribut("value",toString(_have_meta_predictor               ));
+    xml.  singleton_end();
+
+    xml.  singleton_begin("predictor_0_have_bht              ");        	
+    xml.    attribut("value",toString(_predictor_0_have_bht              ));
+    xml.  singleton_end();
+    xml.  singleton_begin("predictor_0_bht_size_shifter      ");	
+    xml.    attribut("value",toString(_predictor_0_bht_size_shifter      ));
+    xml.  singleton_end();
+    xml.  singleton_begin("predictor_0_have_pht              ");              
+    xml.    attribut("value",toString(_predictor_0_have_pht              ));
+    xml.  singleton_end();
+    xml.  singleton_begin("predictor_0_pht_size_counter      ");      
+    xml.    attribut("value",toString(_predictor_0_pht_size_counter      ));
+    xml.  singleton_end();
+
+    xml.  singleton_begin("predictor_1_have_bht              ");        	
+    xml.    attribut("value",toString(_predictor_1_have_bht              ));
+    xml.  singleton_end();
+    xml.  singleton_begin("predictor_1_bht_size_shifter      ");	
+    xml.    attribut("value",toString(_predictor_1_bht_size_shifter      ));
+    xml.  singleton_end();
+    xml.  singleton_begin("predictor_1_have_pht              ");              
+    xml.    attribut("value",toString(_predictor_1_have_pht              ));
+    xml.  singleton_end();
+    xml.  singleton_begin("predictor_1_pht_size_counter      ");      
+    xml.    attribut("value",toString(_predictor_1_pht_size_counter      ));
+    xml.  singleton_end();
+    
+    xml.  singleton_begin("predictor_2_have_bht              ");        	
+    xml.    attribut("value",toString(_predictor_2_have_bht              ));
+    xml.  singleton_end();
+    xml.  singleton_begin("predictor_2_bht_size_shifter      ");	
+    xml.    attribut("value",toString(_predictor_2_bht_size_shifter      ));
+    xml.  singleton_end();
+    xml.  singleton_begin("predictor_2_have_pht              ");              
+    xml.    attribut("value",toString(_predictor_2_have_pht              ));
+    xml.  singleton_end();
+    xml.  singleton_begin("predictor_2_pht_size_counter      ");      
+    xml.    attribut("value",toString(_predictor_2_pht_size_counter      ));
+    xml.  singleton_end();
+        
+    xml.  singleton_begin("nb_prediction                     ");                     
+    xml.    attribut("value",toString(_nb_prediction                     ));
+    xml.  singleton_end();
+    xml.  singleton_begin("nb_branch_complete                ");                
+    xml.    attribut("value",toString(_nb_branch_complete                ));
+    xml.  singleton_end();
+
+    xml.balise_close();
+
+    log_printf(FUNC,Meta_Predictor_Glue,"print","End");
+    
+    return xml.get_body(depth);
+  };
+
+  ostream& operator<< (ostream& output_stream ,
+		       morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::meta_predictor_glue::Parameters & x)
+  {
+    output_stream << x.print(0);
+    
+    return output_stream;
+  };
+
+}; // end namespace meta_predictor_glue
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Statistics.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Statistics.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Statistics.cpp	(revision 46)
@@ -0,0 +1,44 @@
+#ifdef STATISTICS
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Statistics.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace meta_predictor_glue {
+
+
+  Statistics::Statistics (string                                      name                       ,
+			  morpheo::behavioural::Parameters_Statistics parameters_statistics      ,
+			  Parameters                                  parameters
+			  ) :
+    morpheo::behavioural::Statistics(name                  ,
+				     parameters_statistics ),
+    _parameters(parameters)
+  {
+    log_printf(FUNC,Meta_Predictor_Glue,"Statistics","Begin");
+    log_printf(FUNC,Meta_Predictor_Glue,"Statistics","End");
+  };
+  
+  Statistics::~Statistics () 
+  { 
+    log_printf(FUNC,Meta_Predictor_Glue,"~Statistics","Begin");
+    log_printf(FUNC,Meta_Predictor_Glue,"~Statistics","End");
+  };
+
+}; // end namespace meta_predictor_glue
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Statistics_add.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Statistics_add.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Statistics_add.cpp	(revision 46)
@@ -0,0 +1,35 @@
+#ifdef STATISTICS
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Statistics.h"
+
+#include <sstream>
+using namespace std;
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace meta_predictor_glue {
+
+
+  void Statistics::add ()
+  {
+    log_printf(FUNC,Meta_Predictor_Glue,"add","Begin");
+    log_printf(FUNC,Meta_Predictor_Glue,"add","End");
+  };
+
+}; // end namespace meta_predictor_glue
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Statistics_print.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Statistics_print.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Statistics_print.cpp	(revision 46)
@@ -0,0 +1,53 @@
+#ifdef STATISTICS
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Statistics.h"
+
+#include <sstream>
+using namespace std;
+
+namespace morpheo {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace meta_predictor_glue {
+
+
+  string Statistics::print (uint32_t depth)
+  {
+    log_printf(FUNC,Meta_Predictor_Glue,"print","Begin");
+
+    string        tab = string(depth,'\t');
+    ostringstream msg;
+
+    msg << tab << "<meta_predictor_glue name=\"" << _name << "\" >" << endl
+        << print_body(depth+1) << endl
+	<< tab << "</meta_predictor_glue>" << endl;
+    
+    log_printf(FUNC,Meta_Predictor_Glue,"print","End");
+
+    return msg.str();
+  };
+
+  ostream& operator<< (ostream& output_stream ,
+		       morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::meta_predictor_glue::Statistics & x)
+  {
+    output_stream << x.print(0);
+
+    return output_stream;
+  };
+
+}; // end namespace meta_predictor_glue
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Statistics_print_body.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Statistics_print_body.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Meta_Predictor_Glue/src/Statistics_print_body.cpp	(revision 46)
@@ -0,0 +1,43 @@
+#ifdef STATISTICS
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Statistics.h"
+
+#include <sstream>
+using namespace std;
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace meta_predictor_glue {
+
+
+  string Statistics::print_body (uint32_t depth)
+  {
+    log_printf(FUNC,Meta_Predictor_Glue,"print_body","Begin");
+
+    string        tab = string(depth,'\t');
+    ostringstream msg;
+
+    msg << tab << "";
+    
+    log_printf(FUNC,Meta_Predictor_Glue,"print_body","End");
+
+    return msg.str();
+  };
+
+}; // end namespace meta_predictor_glue
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/SelfTest/Makefile
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/SelfTest/Makefile	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/SelfTest/Makefile	(revision 46)
@@ -0,0 +1,29 @@
+# 
+# $Id$
+# 
+# [ Description ]
+# 
+# Makefile
+# 
+
+#-----[ Directory ]----------------------------------------
+DIR_MORPHEO			= ../../../../..
+
+LIBRARY				= $(Meta_Predictor_LIBRARY)
+
+DIR_LIBRARY			= $(Meta_Predictor_DIR_LIBRARY)
+
+#-----[ include ]------------------------------------------
+
+all				:
+				@$(MAKE) all_selftest
+
+library				: Meta_Predictor_library
+
+library_clean			: Meta_Predictor_library_clean
+
+include                         ../Makefile.deps
+include                         $(DIR_MORPHEO)/Behavioural/Makefile.flags
+include				$(DIR_MORPHEO)/Behavioural/Makefile.Common
+include				$(DIR_MORPHEO)/Behavioural/Makefile.Selftest
+include 			$(DIR_MORPHEO)/Behavioural/Makefile.Synthesis
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/SelfTest/config-alpha_21264.cfg
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/SelfTest/config-alpha_21264.cfg	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/SelfTest/config-alpha_21264.cfg	(revision 46)
@@ -0,0 +1,26 @@
+Meta_Predictor
+1	1	+1	# have_meta_predictor               
+1	1	+1	# predictor_0_have_bht              
+10	10	+1	# predictor_0_bht_size_shifter      
+1024	1024	*2	# predictor_0_bht_nb_shifter
+1	1	+1	# predictor_0_have_pht              
+3	3	+1	# predictor_0_pht_size_counter      
+1024	1024	*2	# predictor_0_pht_nb_counter
+0	0	+1	# predictor_0_pht_size_address_share
+1	1	+1	# predictor_1_have_bht              
+12	12	+1	# predictor_1_bht_size_shifter      
+2  	2  	*2	# predictor_1_bht_nb_shifter
+1	1	+1	# predictor_1_have_pht              
+2	2	+1	# predictor_1_pht_size_counter      
+4096	4096	*2	# predictor_1_pht_nb_counter
+0	0	+1	# predictor_1_pht_size_address_share
+0	0	+1	# predictor_2_have_bht              
+4	4	+1	# predictor_2_bht_size_shifter      
+256	256	*2	# predictor_2_bht_nb_shifter
+1	1	+1	# predictor_2_have_pht              
+2	2	+1	# predictor_2_pht_size_counter      
+4096	4096	*2	# predictor_2_pht_nb_counter
+0	0	+1	# predictor_2_pht_size_address_share
+30	30	*2	# size_address
+1	1	+1	# nb_prediction                     
+1	1	+1	# nb_branch_complete                
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/SelfTest/configuration.cfg
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/SelfTest/configuration.cfg	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/SelfTest/configuration.cfg	(revision 46)
@@ -0,0 +1,26 @@
+Meta_Predictor
+1	1	+1	# have_meta_predictor               
+1	1	+1	# predictor_0_have_bht              
+10	10	+1	# predictor_0_bht_size_shifter      
+1024	1024	*2	# predictor_0_bht_nb_shifter
+1	1	+1	# predictor_0_have_pht              
+3	3	+1	# predictor_0_pht_size_counter      
+1024	1024	*2	# predictor_0_pht_nb_counter
+0	0	+1	# predictor_0_pht_size_address_share
+1	1	+1	# predictor_1_have_bht              
+12	12	+1	# predictor_1_bht_size_shifter      
+2  	2  	*2	# predictor_1_bht_nb_shifter
+1	1	+1	# predictor_1_have_pht              
+2	2	+1	# predictor_1_pht_size_counter      
+4096	4096	*2	# predictor_1_pht_nb_counter
+0	0	+1	# predictor_1_pht_size_address_share
+0	0	+1	# predictor_2_have_bht              
+4	4	+1	# predictor_2_bht_size_shifter      
+256	256	*2	# predictor_2_bht_nb_shifter
+1	1	+1	# predictor_2_have_pht              
+2	2	+1	# predictor_2_pht_size_counter      
+4096	4096	*2	# predictor_2_pht_nb_counter
+0	0	+1	# predictor_2_pht_size_address_share
+30	30	*2	# size_address
+1	1	+1	# nb_prediction                     
+1	1	+1	# nb_branch_complete                
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/SelfTest/include/test.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/SelfTest/include/test.h	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/SelfTest/include/test.h	(revision 46)
@@ -0,0 +1,26 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ * Test "RegisterFile"
+ */
+
+#ifdef SYSTEMC
+#include "systemc.h"
+#endif
+
+#include <string>
+#include <iostream>
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/include/Meta_Predictor.h"
+
+using namespace std;
+using namespace morpheo;
+using namespace morpheo::behavioural;
+using namespace morpheo::behavioural::stage_1_ifetch;
+using namespace morpheo::behavioural::stage_1_ifetch::predictor;
+using namespace morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor;
+
+void test    (string name,
+	      morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::Parameters param);
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/SelfTest/mkf.info
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/SelfTest/mkf.info	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/SelfTest/mkf.info	(revision 46)
@@ -0,0 +1,6 @@
+
+# Meta_Predictor_0
+target_dep	all	Meta_Predictor_0.ngc
+target_dep	Meta_Predictor_0.ngc	Meta_Predictor_0.prj
+target_dep	Meta_Predictor_0.prj	Meta_Predictor_0_Meta_Predictor_Glue_Pack.vhdl Meta_Predictor_0_Meta_Predictor_Glue.vhdl Meta_Predictor_0_Pack.vhdl Meta_Predictor_0_Two_Level_Branch_Predictor_2_Pack.vhdl Meta_Predictor_0_Two_Level_Branch_Predictor_2_Pattern_History_Table_Counter_Pack.vhdl Meta_Predictor_0_Two_Level_Branch_Predictor_2_Pattern_History_Table_Counter.vhdl Meta_Predictor_0_Two_Level_Branch_Predictor_2_Pattern_History_Table_Pack.vhdl Meta_Predictor_0_Two_Level_Branch_Predictor_2_Pattern_History_Table_RegisterFile_Pack.vhdl Meta_Predictor_0_Two_Level_Branch_Predictor_2_Pattern_History_Table_RegisterFile.vhdl Meta_Predictor_0_Two_Level_Branch_Predictor_2_Pattern_History_Table.vhdl Meta_Predictor_0_Two_Level_Branch_Predictor_2_Two_Level_Branch_Predictor_Glue_Pack.vhdl Meta_Predictor_0_Two_Level_Branch_Predictor_2_Two_Level_Branch_Predictor_Glue.vhdl Meta_Predictor_0_Two_Level_Branch_Predictor_2.vhdl Meta_Predictor_0.vhdl
+
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/SelfTest/src/main.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/SelfTest/src/main.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/SelfTest/src/main.cpp	(revision 46)
@@ -0,0 +1,131 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/SelfTest/include/test.h"
+
+#define NB_PARAMS 25
+
+void usage (string exec)
+{
+  cerr << "<Usage> " << exec << " name_instance list_params" << endl
+       << "list_params is :" << endl
+       << " - have_meta_predictor                (bool    )" << endl
+       << " - predictor_0_have_bht               (bool    )" << endl
+       << " - predictor_0_bht_size_shifter       (uint32_t)" << endl
+       << " - predictor_0_bht_nb_shifter         (uint32_t)" << endl
+       << " - predictor_0_have_pht               (bool    )" << endl
+       << " - predictor_0_pht_size_counter       (uint32_t)" << endl
+       << " - predictor_0_pht_nb_counter         (uint32_t)" << endl
+       << " - predictor_0_pht_size_address_share (uint32_t)" << endl
+       << " - predictor_1_have_bht               (bool    )" << endl
+       << " - predictor_1_bht_size_shifter       (uint32_t)" << endl
+       << " - predictor_1_bht_nb_shifter         (uint32_t)" << endl
+       << " - predictor_1_have_pht               (bool    )" << endl
+       << " - predictor_1_pht_size_counter       (uint32_t)" << endl
+       << " - predictor_1_pht_nb_counter         (uint32_t)" << endl
+       << " - predictor_1_pht_size_address_share (uint32_t)" << endl
+       << " - predictor_2_have_bht               (bool    )" << endl
+       << " - predictor_2_bht_size_shifter       (uint32_t)" << endl
+       << " - predictor_2_bht_nb_shifter         (uint32_t)" << endl
+       << " - predictor_2_have_pht               (bool    )" << endl
+       << " - predictor_2_pht_size_counter       (uint32_t)" << endl
+       << " - predictor_2_pht_nb_counter         (uint32_t)" << endl
+       << " - predictor_2_pht_size_address_share (uint32_t)" << endl
+       << " - size_address                       (uint32_t)" << endl
+       << " - nb_prediction                      (uint32_t)" << endl
+       << " - nb_branch_complete                 (uint32_t)" << endl;
+
+  exit (1);
+}
+
+#ifndef SYSTEMC
+int main    (int argc, char * argv[])
+#else
+int sc_main (int argc, char * argv[])
+#endif
+{
+  if (argc != 2+NB_PARAMS)
+    usage (argv[0]);
+
+  const string   name                              = argv[1];
+
+  const bool     have_meta_predictor               = atoi(argv[ 2]);
+
+  const bool     predictor_0_have_bht              = atoi(argv[ 3]);
+  const uint32_t predictor_0_bht_size_shifter      = atoi(argv[ 4]);
+  const uint32_t predictor_0_bht_nb_shifter        = atoi(argv[ 5]);
+  const bool     predictor_0_have_pht              = atoi(argv[ 6]);
+  const uint32_t predictor_0_pht_size_counter      = atoi(argv[ 7]);
+  const uint32_t predictor_0_pht_nb_counter        = atoi(argv[ 8]);
+  const uint32_t predictor_0_pht_size_address_share= atoi(argv[ 9]);
+
+  const bool     predictor_1_have_bht              = atoi(argv[10]);
+  const uint32_t predictor_1_bht_size_shifter      = atoi(argv[11]);
+  const uint32_t predictor_1_bht_nb_shifter        = atoi(argv[12]);
+  const bool     predictor_1_have_pht              = atoi(argv[13]);
+  const uint32_t predictor_1_pht_size_counter      = atoi(argv[14]);
+  const uint32_t predictor_1_pht_nb_counter        = atoi(argv[15]);
+  const uint32_t predictor_1_pht_size_address_share= atoi(argv[16]);
+
+  const bool     predictor_2_have_bht              = atoi(argv[17]);
+  const uint32_t predictor_2_bht_size_shifter      = atoi(argv[18]);
+  const uint32_t predictor_2_bht_nb_shifter        = atoi(argv[19]);
+  const bool     predictor_2_have_pht              = atoi(argv[20]);
+  const uint32_t predictor_2_pht_size_counter      = atoi(argv[21]);
+  const uint32_t predictor_2_pht_nb_counter        = atoi(argv[22]);
+  const uint32_t predictor_2_pht_size_address_share= atoi(argv[23]);
+
+  const uint32_t size_address                      = atoi(argv[24]);
+  const uint32_t nb_prediction                     = atoi(argv[25]);
+  const uint32_t nb_branch_complete                = atoi(argv[26]);
+
+  try 
+    {
+      morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::Parameters param (have_meta_predictor               ,
+											 predictor_0_have_bht              ,
+											 predictor_0_bht_size_shifter      ,
+											 predictor_0_bht_nb_shifter        ,
+											 predictor_0_have_pht              ,
+											 predictor_0_pht_size_counter      ,
+											 predictor_0_pht_nb_counter        ,
+											 predictor_0_pht_size_address_share,
+											 predictor_1_have_bht              ,
+											 predictor_1_bht_size_shifter      ,
+											 predictor_1_bht_nb_shifter        ,
+											 predictor_1_have_pht              ,
+											 predictor_1_pht_size_counter      ,
+											 predictor_1_pht_nb_counter        ,
+											 predictor_1_pht_size_address_share,
+											 predictor_2_have_bht              ,
+											 predictor_2_bht_size_shifter      ,
+											 predictor_2_bht_nb_shifter        ,
+											 predictor_2_have_pht              ,
+											 predictor_2_pht_size_counter      ,
+											 predictor_2_pht_nb_counter        ,
+											 predictor_2_pht_size_address_share,
+											 size_address                      ,
+											 nb_prediction                     ,
+											 nb_branch_complete                );
+      
+      cout << param.print(1);
+      
+      test (name,param);
+    }
+  catch (morpheo::ErrorMorpheo & error)
+    {
+      cout << "<" << name << "> : " <<  error.what ();
+      exit (EXIT_FAILURE);
+    }
+  catch (...)
+    {
+      cerr << "<" << name << "> : This test must generate a error" << endl;
+      exit (EXIT_FAILURE);
+    }
+
+  return (EXIT_SUCCESS);
+}
+
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/SelfTest/src/test.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/SelfTest/src/test.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/SelfTest/src/test.cpp	(revision 46)
@@ -0,0 +1,156 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ * Test
+ */
+
+#define NB_ITERATION 1
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/SelfTest/include/test.h"
+#include "Common/include/Test.h"
+
+void test (string name,
+	   morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::Parameters _param)
+{
+  cout << "<" << name << "> : Simulation SystemC" << endl;
+  
+  Meta_Predictor * _Meta_Predictor = new Meta_Predictor (name.c_str(),
+#ifdef STATISTICS
+							 morpheo::behavioural::Parameters_Statistics(5,50),
+#endif
+							 _param);
+  
+#ifdef SYSTEMC
+  /*********************************************************************
+   * Déclarations des signaux
+   *********************************************************************/
+  sc_clock                         * CLOCK                      ;
+  sc_signal<Tcontrol_t>            * NRESET                     ;
+
+    // Interface Predict
+  sc_signal<Tcontrol_t>           ** PREDICT_VAL                ;
+  sc_signal<Tcontrol_t>           ** PREDICT_ACK                ;
+  sc_signal<Taddress_t>           ** PREDICT_ADDRESS            ;
+  sc_signal<Thistory_t>           ** PREDICT_HISTORY            ;
+  sc_signal<Tcontrol_t>           ** PREDICT_DIRECTION          ;
+			
+    // Interface Branch_complete
+  sc_signal<Tcontrol_t>           ** BRANCH_COMPLETE_VAL        ;
+  sc_signal<Tcontrol_t>           ** BRANCH_COMPLETE_ACK        ;
+  sc_signal<Taddress_t>           ** BRANCH_COMPLETE_ADDRESS    ;
+  sc_signal<Thistory_t>           ** BRANCH_COMPLETE_HISTORY    ;
+  sc_signal<Tcontrol_t>           ** BRANCH_COMPLETE_DIRECTION  ;
+
+  string rename;
+
+  CLOCK                       = new sc_clock ("clock", 1.0, 0.5);
+  NRESET                      = new sc_signal<Tcontrol_t> ("NRESET");
+
+  PREDICT_VAL                 = new sc_signal<Tcontrol_t>     * [_param._nb_prediction     ];
+  PREDICT_ACK                 = new sc_signal<Tcontrol_t>     * [_param._nb_prediction     ];
+  PREDICT_ADDRESS             = new sc_signal<Taddress_t>     * [_param._nb_prediction     ];
+  PREDICT_HISTORY             = new sc_signal<Thistory_t>     * [_param._nb_prediction     ];
+  PREDICT_DIRECTION           = new sc_signal<Tcontrol_t>     * [_param._nb_prediction     ];
+
+  for (uint32_t i=0; i<_param._nb_prediction; i++)
+    {
+      rename = "PREDICT_VAL_"         +toString(i);
+      PREDICT_VAL                 [i] = new sc_signal<Tcontrol_t>     (rename.c_str());
+      rename = "PREDICT_ACK_"        +toString(i);
+      PREDICT_ACK                 [i] = new sc_signal<Tcontrol_t>     (rename.c_str());
+      rename = "PREDICT_ADDRESS_"     +toString(i);
+      PREDICT_ADDRESS             [i] = new sc_signal<Taddress_t>     (rename.c_str());
+      rename = "PREDICT_HISTORY_"    +toString(i);
+      PREDICT_HISTORY             [i] = new sc_signal<Thistory_t>     (rename.c_str());
+      rename = "PREDICT_DIRECTION_"  +toString(i);
+      PREDICT_DIRECTION           [i] = new sc_signal<Tcontrol_t>     (rename.c_str());
+    }
+  
+  BRANCH_COMPLETE_VAL         = new sc_signal<Tcontrol_t>     * [_param._nb_branch_complete];
+  BRANCH_COMPLETE_ACK         = new sc_signal<Tcontrol_t>     * [_param._nb_branch_complete];
+  BRANCH_COMPLETE_ADDRESS     = new sc_signal<Taddress_t>     * [_param._nb_branch_complete];
+  BRANCH_COMPLETE_HISTORY     = new sc_signal<Thistory_t>     * [_param._nb_branch_complete];
+  BRANCH_COMPLETE_DIRECTION   = new sc_signal<Tcontrol_t>     * [_param._nb_branch_complete];
+  
+  for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+    {
+      rename = "BRANCH_COMPLETE_VAL_"         +toString(i);
+      BRANCH_COMPLETE_VAL         [i] = new sc_signal<Tcontrol_t>     (rename.c_str());
+      rename = "BRANCH_COMPLETE_ACK_"        +toString(i);
+      BRANCH_COMPLETE_ACK         [i] = new sc_signal<Tcontrol_t>     (rename.c_str());
+      rename = "BRANCH_COMPLETE_ADDRESS_"     +toString(i);
+      BRANCH_COMPLETE_ADDRESS     [i] = new sc_signal<Taddress_t>     (rename.c_str());
+      rename = "BRANCH_COMPLETE_HISTORY_"     +toString(i);
+      BRANCH_COMPLETE_HISTORY     [i] = new sc_signal<Thistory_t>     (rename.c_str());
+      rename = "BRANCH_COMPLETE_DIRECTION_"   +toString(i);
+      BRANCH_COMPLETE_DIRECTION   [i] = new sc_signal<Tcontrol_t>     (rename.c_str());
+    }
+
+  /********************************************************
+   * Instanciation
+   ********************************************************/
+  
+  cout << "<" << name << "> Instanciation of _Meta_Predictor" << endl;
+  
+  (*(_Meta_Predictor->in_CLOCK ))        (*(CLOCK ));
+  (*(_Meta_Predictor->in_NRESET))        (*(NRESET));
+
+    for (uint32_t i=0; i<_param._nb_prediction; i++)
+      {
+	(*(_Meta_Predictor-> in_PREDICT_VAL                 [i]))        (*(PREDICT_VAL                 [i]));
+	(*(_Meta_Predictor->out_PREDICT_ACK                 [i]))        (*(PREDICT_ACK                 [i]));
+	(*(_Meta_Predictor-> in_PREDICT_ADDRESS             [i]))        (*(PREDICT_ADDRESS             [i]));
+	(*(_Meta_Predictor->out_PREDICT_HISTORY             [i]))        (*(PREDICT_HISTORY             [i]));
+	(*(_Meta_Predictor->out_PREDICT_DIRECTION           [i]))        (*(PREDICT_DIRECTION           [i]));
+      }
+    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+      {
+	(*(_Meta_Predictor-> in_BRANCH_COMPLETE_VAL         [i]))        (*(BRANCH_COMPLETE_VAL         [i]));
+	(*(_Meta_Predictor->out_BRANCH_COMPLETE_ACK         [i]))        (*(BRANCH_COMPLETE_ACK         [i]));
+	(*(_Meta_Predictor-> in_BRANCH_COMPLETE_ADDRESS     [i]))        (*(BRANCH_COMPLETE_ADDRESS     [i]));
+	(*(_Meta_Predictor-> in_BRANCH_COMPLETE_HISTORY     [i]))        (*(BRANCH_COMPLETE_HISTORY     [i]));
+	(*(_Meta_Predictor-> in_BRANCH_COMPLETE_DIRECTION   [i]))        (*(BRANCH_COMPLETE_DIRECTION   [i]));
+      }
+
+  /********************************************************
+   * Simulation - Begin
+   ********************************************************/
+
+  cout << "<" << name << "> Start Simulation ............" << endl;
+
+  // Initialisation
+  const uint32_t seed = 0;
+//const uint32_t seed = static_cast<uint32_t>(time(NULL));
+
+  srand(seed);
+
+  sc_start(0);
+
+  NRESET->write(0);
+  sc_start(5);
+  NRESET->write(1);
+
+  cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Initialisation" << endl;
+
+  cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Loop of Test" << endl;
+
+  for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++)
+    {
+
+      sc_start(1);
+    }
+
+  /********************************************************
+   * Simulation - End
+   ********************************************************/
+
+  cout << "Test OK" << endl;
+
+  cout << "<" << name << "> ............ Stop Simulation" << endl;
+
+#endif
+
+  delete _Meta_Predictor;
+}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/Makefile
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/Makefile	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/Makefile	(revision 46)
@@ -0,0 +1,24 @@
+# 
+# $Id$
+# 
+# [ Description ]
+# 
+# Makefile
+# 
+
+#-----[ Directory ]----------------------------------------
+DIR_COMPONENT			= .
+include				$(DIR_COMPONENT)/Makefile.defs
+
+#-----[ Library ]------------------------------------------
+LIBRARY				= $(DIR_LIB)/libBranch_History_Table.a
+
+
+#-----[ include ]------------------------------------------
+
+all				: $(LIBRARY_NEED)
+				@$(MAKE) all_component
+
+include                         $(DIR_MORPHEO)/Behavioural/Makefile.flags
+include				$(DIR_MORPHEO)/Behavioural/Makefile.Common
+include				$(DIR_MORPHEO)/Behavioural/Makefile.Component
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/Makefile.defs
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/Makefile.defs	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/Makefile.defs	(revision 46)
@@ -0,0 +1,11 @@
+# 
+# $Id$
+# 
+# [ Description ]
+# 
+# Makefile
+# 
+
+#-----[ Directory ]----------------------------------------
+DIR_COMPONENT_MORPHEO		= ../../../../../..
+DIR_MORPHEO			= $(DIR_COMPONENT)/$(DIR_COMPONENT_MORPHEO)
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/Makefile.deps
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/Makefile.deps	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/Makefile.deps	(revision 46)
@@ -0,0 +1,45 @@
+# 
+# $Id$
+# 
+# [ Description ]
+# 
+# Makefile
+# 
+# DIR_MORPHEO must be defined
+
+ifndef Behavioural
+include 			$(DIR_MORPHEO)/Behavioural/Makefile.deps
+endif
+ifndef Shifter
+include 			$(DIR_MORPHEO)/Behavioural/Generic/Shifter/Makefile.deps
+endif
+ifndef RegisterFile_Monolithic
+include 			$(DIR_MORPHEO)/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/Makefile.deps
+endif
+
+Branch_History_Table			= yes
+
+#-----[ Library ]------------------------------------------
+Branch_History_Table_LIBRARY		= 	-lBranch_History_Table	\
+						$(RegisterFile_Monolithic_LIBRARY)	\
+						$(Shifter_LIBRARY)	\
+						$(Behavioural_LIBRARY)	
+
+Branch_History_Table_DIR_LIBRARY	=	-L$(DIR_MORPHEO)/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/lib	\
+						$(RegisterFile_Monolithic_DIR_LIBRARY)	\
+						$(Shifter_DIR_LIBRARY)		\
+						$(Behavioural_DIR_LIBRARY)
+
+#-----[ Rules ]--------------------------------------------
+
+Branch_History_Table_library		: 
+					@$(MAKE) Behavioural_library
+					@$(MAKE) Shifter_library
+					@$(MAKE) RegisterFile_Monolithic_library
+					@$(MAKE) --directory=$(DIR_MORPHEO)/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table --makefile=Makefile 
+
+Branch_History_Table_library_clean	: 
+					@$(MAKE) Behavioural_library_clean
+					@$(MAKE) Shifter_library_clean
+					@$(MAKE) RegisterFile_Monolithic_library_clean
+					@$(MAKE) --directory=$(DIR_MORPHEO)/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table --makefile=Makefile clean
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/SelfTest/Makefile
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/SelfTest/Makefile	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/SelfTest/Makefile	(revision 46)
@@ -0,0 +1,29 @@
+# 
+# $Id$
+# 
+# [ Description ]
+# 
+# Makefile
+# 
+
+#-----[ Directory ]----------------------------------------
+DIR_MORPHEO			= ../../../../../../..
+
+LIBRARY				= $(Branch_History_Table_LIBRARY)
+
+DIR_LIBRARY			= $(Branch_History_Table_DIR_LIBRARY)
+
+#-----[ include ]------------------------------------------
+
+all				: library
+				@$(MAKE) all_selftest
+
+library				: Branch_History_Table_library
+
+library_clean			: Branch_History_Table_library_clean
+
+include                         ../Makefile.deps
+include                         $(DIR_MORPHEO)/Behavioural/Makefile.flags
+include				$(DIR_MORPHEO)/Behavioural/Makefile.Common
+include				$(DIR_MORPHEO)/Behavioural/Makefile.Selftest
+include                         $(DIR_MORPHEO)/Behavioural/Makefile.Synthesis
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/SelfTest/config0.cfg
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/SelfTest/config0.cfg	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/SelfTest/config0.cfg	(revision 46)
@@ -0,0 +1,5 @@
+Branch_History_Table
+2	8	*2	# size_shifter      	
+2	64	*4	# nb_shifter        
+1	1	+1	# nb_prediction     
+1	1	+1	# nb_branch_complete
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/SelfTest/config1.cfg
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/SelfTest/config1.cfg	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/SelfTest/config1.cfg	(revision 46)
@@ -0,0 +1,5 @@
+Branch_History_Table
+2	8	*2	# size_shifter      	
+2	64	*4	# nb_shifter        
+2	2	+1	# nb_prediction     
+2	2	+1	# nb_branch_complete
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/SelfTest/include/test.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/SelfTest/include/test.h	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/SelfTest/include/test.h	(revision 46)
@@ -0,0 +1,29 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ * Test "RegisterFile"
+ */
+
+#ifdef SYSTEMC
+#include "systemc.h"
+#endif
+
+#include <string>
+#include <iostream>
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Branch_History_Table.h"
+
+using namespace std;
+using namespace morpheo;
+using namespace morpheo::behavioural;
+using namespace morpheo::behavioural::stage_1_ifetch;
+using namespace morpheo::behavioural::stage_1_ifetch::predictor;
+using namespace morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor;
+using namespace morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor;
+
+using namespace morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::branch_history_table;
+
+void test   (string name,
+	     morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::branch_history_table::Parameters param);
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/SelfTest/src/main.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/SelfTest/src/main.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/SelfTest/src/main.cpp	(revision 46)
@@ -0,0 +1,47 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ * Test 0
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/SelfTest/include/test.h"
+
+#define NB_PARAMS 4
+
+void usage (string exec)
+{
+  cerr << "<Usage> " << exec << " name_instance list_params" << endl
+       << "list_params is :" << endl
+       << " - size_shifter       (unsigned int)" << endl
+       << " - nb_shifter         (unsigned int)" << endl
+       << " - nb_prediction      (unsigned int)" << endl
+       << " - nb_branch_complete (unsigned int)" << endl;
+  exit (1);
+}
+
+#ifndef SYSTEMC
+int main    (int argc, char * argv[])
+#else
+int sc_main (int argc, char * argv[])
+#endif
+{
+  if (argc != 2+NB_PARAMS)
+    usage (argv[0]);
+
+  const string   name               = argv[1];
+  const uint32_t size_shifter       = atoi(argv[2]);
+  const uint32_t nb_shifter         = atoi(argv[3]);
+  const uint32_t nb_prediction      = atoi(argv[4]);
+  const uint32_t nb_branch_complete = atoi(argv[5]);
+
+  morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::branch_history_table::Parameters param (size_shifter       ,
+																       nb_shifter         ,
+																       nb_prediction      ,
+																       nb_branch_complete );
+
+  test (name,param);
+
+  return (EXIT_SUCCESS);
+}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/SelfTest/src/test.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/SelfTest/src/test.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/SelfTest/src/test.cpp	(revision 46)
@@ -0,0 +1,190 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ * Test
+ */
+
+#define NB_ITERATION 1024
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/SelfTest/include/test.h"
+#include "Common/include/BitManipulation.h"
+#include "Common/include/Test.h"
+
+void test (string name,
+	   morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::branch_history_table::Parameters param)
+{
+  cout << "<" << name << "> : Simulation SystemC" << endl;
+
+  try 
+    {
+      cout << param.print(1);
+      param.test();
+    }
+  catch (morpheo::ErrorMorpheo & error)
+    {
+      cout << "<" << name << "> : " <<  error.what ();
+      return;
+    }
+  catch (...)
+    {
+      cerr << "<" << name << "> : This test must generate a error" << endl;
+      exit (EXIT_FAILURE);
+    }
+
+  Branch_History_Table * _Branch_History_Table = new Branch_History_Table (name.c_str(),
+#ifdef STATISTICS
+					     morpheo::behavioural::Parameters_Statistics(5,50),
+#endif
+					     param);
+  
+#ifdef SYSTEMC
+
+  /*********************************************************************
+   * Déclarations des signaux
+   *********************************************************************/
+  sc_clock                                 CLOCK ("clock", 1.0, 0.5);
+  sc_signal<Tcontrol_t>                    NRESET;
+  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];
+  
+  /********************************************************
+   * Instanciation
+   ********************************************************/
+  
+  cout << "<" << name << "> Instanciation of _Branch_History_Table" << endl;
+  
+  (*(_Branch_History_Table->in_CLOCK))        (CLOCK);
+  (*(_Branch_History_Table->in_NRESET))       (NRESET);
+
+  for (uint32_t i=0; i<param._nb_prediction; i++)
+    {
+      (*(_Branch_History_Table-> in_PREDICT_VAL     [i]))        (PREDICT_VAL     [i]);
+      (*(_Branch_History_Table->out_PREDICT_ACK     [i]))        (PREDICT_ACK     [i]);
+      (*(_Branch_History_Table-> in_PREDICT_ADDRESS [i]))        (PREDICT_ADDRESS [i]);
+      (*(_Branch_History_Table->out_PREDICT_HISTORY [i]))        (PREDICT_HISTORY [i]);
+    }
+
+  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_DIRECTION [i]))        (BRANCH_COMPLETE_DIRECTION [i]);
+    }
+
+  /********************************************************
+   * Simulation - Begin
+   ********************************************************/
+
+  cout << "<" << name << "> Start Simulation ............" << endl;
+  // Initialisation
+  sc_start(0);
+
+  srand(0);
+  //srand(time(NULL));
+
+  
+  cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Initialisation" << endl;
+
+  NRESET.write(1);
+  for (uint32_t i=0; i<param._nb_prediction; i++)
+    PREDICT_VAL         [i].write(0);
+  for (uint32_t i=0; i<param._nb_branch_complete; i++)
+    BRANCH_COMPLETE_VAL [i].write(0);
+
+  // Initialisation of Register
+  uint32_t   num_port_branch_complete = 0;
+  uint32_t   num_port_predict         = 0;
+  Taddress_t address                  = 0;
+  Thistory_t history                  = 0;
+  Thistory_t mask                     = gen_mask <Thistory_t> (param._size_shifter);
+  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_DIRECTION [0].write(0);
+
+      sc_start(1);
+      
+      if (BRANCH_COMPLETE_ACK[0].read()==1)
+	address++;
+    }
+ 
+  BRANCH_COMPLETE_VAL     [0].write(0);
+  sc_start(0);
+
+  cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Loop of Test" << endl;
+
+  for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++)
+    {
+      num_port_branch_complete = rand() % param._nb_branch_complete;
+      num_port_predict         = rand() % param._nb_prediction     ;
+      address                  = rand() % param._nb_shifter        ;
+      history                  = rand() % (1<<param._size_shifter) ;
+      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
+	   << " - 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_DIRECTION [num_port_branch_complete].write(direction);
+
+      // Wait Ack
+      do
+	{
+	  sc_start(1);
+	}
+      while (BRANCH_COMPLETE_ACK[num_port_branch_complete].read()!=1);
+
+      BRANCH_COMPLETE_VAL     [num_port_branch_complete].write(0);
+      PREDICT_VAL             [num_port_predict        ].write(1);
+      PREDICT_ADDRESS         [num_port_predict        ].write(address);
+      
+      history                  = ((history<<1)&mask)|direction;
+      
+      // Wait Ack
+      do
+	{
+	  sc_start(1);
+	}
+      while (PREDICT_ACK        [num_port_predict        ].read()!=1);
+
+      PREDICT_VAL             [num_port_predict        ].write(0);
+
+      cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} ["+toString(num_port_predict)+"]" << endl
+	   << " - history new : " << PREDICT_HISTORY [num_port_predict].read() << endl;
+
+      TEST(Thistory_t,PREDICT_HISTORY [num_port_predict].read(),history);
+
+      cout << dec;
+    }
+
+  /********************************************************
+   * Simulation - End
+   ********************************************************/
+
+  cout << "<" << name << "> ............ Stop Simulation" << endl;
+
+#endif
+
+  delete _Branch_History_Table;
+}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/VERSION
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/VERSION	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/VERSION	(revision 46)
@@ -0,0 +1,1 @@
+v0.1
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/doc/Branch_History_Table.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/doc/Branch_History_Table.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/doc/Branch_History_Table.tex	(revision 46)
@@ -0,0 +1,38 @@
+\documentclass[10pt,a4paper,twocolumn]{article}
+
+\def\dirdoc{tex}
+\def\dirschema{eps}
+
+% Package de variables d'environnement : Titre, command etc ...
+\usepackage{../../../../../../../Behavioural/doc/sty/doc-style}
+\usepackage{sty/header}
+
+
+%------------------------------------------------------------------------------
+% Début document
+%------------------------------------------------------------------------------
+
+\pagestyle{empty}
+
+\begin{document}
+
+% Créez une page de titre
+\maketitle
+\thispagestyle{empty}
+
+%Table des matières et des figures
+%\tableofcontents
+%\newpage
+%\listoffigures
+
+%------------------------------------------------------------------------------
+% Ajout du corps du documents
+%------------------------------------------------------------------------------
+
+\input{tex/root}
+
+%------------------------------------------------------------------------------
+% Fin d'ajout du corps du document
+%------------------------------------------------------------------------------
+
+\end{document}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/doc/Makefile
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/doc/Makefile	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/doc/Makefile	(revision 46)
@@ -0,0 +1,19 @@
+# 
+# $Id$
+# 
+# [ Description ]
+# 
+# Makefile
+# 
+
+#-----[ Directory ]----------------------------------------
+DIR_COMPONENT			= ..
+include				$(DIR_COMPONENT)/Makefile.defs
+
+#-----[ include ]------------------------------------------
+
+all				:
+				$(MAKE) all_documentation
+
+include				$(DIR_MORPHEO)/Behavioural/Makefile.Common
+include				$(DIR_MORPHEO)/Behavioural/Makefile.Documentation
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/doc/sty/header.sty
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/doc/sty/header.sty	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/doc/sty/header.sty	(revision 46)
@@ -0,0 +1,12 @@
+\def\review{YYYY/MM/DD}
+%\def\review{\number\day/\number\month/\number\year\xspace}
+
+\title{Branch\_History\_Table}
+ 
+\author{}
+
+\affiliation{}
+
+\email{}
+
+\date{\review}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/doc/tex/01_introduction.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/doc/tex/01_introduction.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/doc/tex/01_introduction.tex	(revision 46)
@@ -0,0 +1,1 @@
+\Section{Introduction}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/doc/tex/02_features.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/doc/tex/02_features.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/doc/tex/02_features.tex	(revision 46)
@@ -0,0 +1,1 @@
+\Section{Features}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/doc/tex/03_description.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/doc/tex/03_description.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/doc/tex/03_description.tex	(revision 46)
@@ -0,0 +1,1 @@
+\Section{Functional Description}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/doc/tex/04_pinout.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/doc/tex/04_pinout.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/doc/tex/04_pinout.tex	(revision 46)
@@ -0,0 +1,1 @@
+\Section{Pin out}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/doc/tex/05_parameters.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/doc/tex/05_parameters.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/doc/tex/05_parameters.tex	(revision 46)
@@ -0,0 +1,1 @@
+\Section{Parameters}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/doc/tex/06_performance.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/doc/tex/06_performance.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/doc/tex/06_performance.tex	(revision 46)
@@ -0,0 +1,1 @@
+\Section{Performance}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/doc/tex/07_details.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/doc/tex/07_details.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/doc/tex/07_details.tex	(revision 46)
@@ -0,0 +1,1 @@
+\Section{Details}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/doc/tex/08_history.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/doc/tex/08_history.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/doc/tex/08_history.tex	(revision 46)
@@ -0,0 +1,10 @@
+\Section{Revision History}
+
+\begin{tabular}{|c|c|c|}
+\hline
+Revision Date & By  & Modifications\\
+\hline
+\hline
+yyyy/mm/dd    & xxx & Initial document \\
+\hline
+\end{tabular}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/doc/tex/root.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/doc/tex/root.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/doc/tex/root.tex	(revision 46)
@@ -0,0 +1,8 @@
+\input{\dirdoc/01_introduction}
+\input{\dirdoc/02_features}
+\input{\dirdoc/03_description}
+\input{\dirdoc/04_pinout}
+\input{\dirdoc/05_parameters}
+\input{\dirdoc/06_performance}
+\input{\dirdoc/07_details}
+\input{\dirdoc/08_history}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Branch_History_Table.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Branch_History_Table.h	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Branch_History_Table.h	(revision 46)
@@ -0,0 +1,138 @@
+#ifndef morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_two_level_branch_predictor_branch_history_table_Branch_History_Table_h
+#define morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_two_level_branch_predictor_branch_history_table_Branch_History_Table_h
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#ifdef SYSTEMC
+#include "systemc.h"
+#endif
+
+#include "Common/include/ToString.h"
+#include "Common/include/Debug.h"
+
+// Internal structure
+#include "Behavioural/Generic/Shifter/include/Shifter.h"
+#include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/RegisterFile_Monolithic.h"
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Parameters.h"
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Types.h"
+#ifdef STATISTICS
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Statistics.h"
+#endif
+#ifdef VHDL
+#include "Behavioural/include/Vhdl.h"
+#endif
+#include "Behavioural/include/Component.h"
+
+using namespace std;
+
+namespace morpheo {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace branch_history_table {
+
+
+  class Branch_History_Table 
+#if SYSTEMC
+    : public sc_module
+#endif
+  {
+    // -----[ fields ]----------------------------------------------------
+    // Parameters
+  protected : const string     _name;
+
+  protected : const Parameters _param;
+#ifdef STATISTICS
+  protected : const morpheo::behavioural::Parameters_Statistics _param_statistics;
+#endif
+#ifdef STATISTICS
+  private   : Statistics                     * _stat;
+#endif
+
+  public    : Component                      * _component;
+  private   : Interfaces                     * _interfaces;
+
+#ifdef SYSTEMC
+    // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+    // Interface
+  public    : SC_CLOCK                      *  in_CLOCK                  ;
+  public    : SC_IN (Tcontrol_t)            *  in_NRESET                 ;
+ 
+  public    : SC_IN (Tcontrol_t)           **  in_PREDICT_VAL            ;
+  public    : SC_OUT(Tcontrol_t)           ** out_PREDICT_ACK            ;
+  public    : SC_IN (Taddress_t)           **  in_PREDICT_ADDRESS        ;
+  public    : SC_OUT(Thistory_t)           ** out_PREDICT_HISTORY        ;
+
+  public    : SC_IN (Tcontrol_t)           **  in_BRANCH_COMPLETE_VAL    ;
+  public    : SC_OUT(Tcontrol_t)           ** out_BRANCH_COMPLETE_ACK    ;
+  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_DIRECTION;
+
+    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
+
+    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#endif
+
+    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
+  public    : morpheo::behavioural::generic::shifter::Shifter           * component_Shifter     ;
+  public    : morpheo::behavioural::generic::registerfile::registerfile_monolithic::RegisterFile_Monolithic * component_RegisterFile;
+
+    // -----[ methods ]---------------------------------------------------
+
+#ifdef SYSTEMC
+    SC_HAS_PROCESS (Branch_History_Table);
+#endif					       
+  public  :          Branch_History_Table              (
+#ifdef SYSTEMC
+							sc_module_name                              name,
+#else					       
+							string                                      name,
+#endif					       
+#ifdef STATISTICS
+							morpheo::behavioural::Parameters_Statistics param_statistics,
+#endif
+							Parameters                                  param );
+					       
+  public  :          Branch_History_Table              (Parameters param );
+  public  :          ~Branch_History_Table             (void);
+					       
+#ifdef SYSTEMC				       
+  private : void     allocation                (void);
+  private : void     deallocation              (void);
+					       
+#if (defined(STATISTICS) || defined (VHDL_TESTBENCH))
+  public  : void     transition                (void);
+#endif
+#endif					       
+					       
+#ifdef STATISTICS
+  public  : string   statistics                (uint32_t depth);
+#endif
+#if VHDL				       
+  public  : void     vhdl                      (void);
+  private : void     vhdl_declaration          (Vhdl * & vhdl);
+  private : void     vhdl_body                 (Vhdl * & vhdl);
+#endif					       
+#ifdef VHDL_TESTBENCH			       
+  private : void     vhdl_testbench_transition (void);
+#endif
+  };
+
+}; // end namespace branch_history_table
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Parameters.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Parameters.h	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Parameters.h	(revision 46)
@@ -0,0 +1,61 @@
+#ifndef morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_two_level_branch_predictor_branch_history_table_Parameters_h
+#define morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_two_level_branch_predictor_branch_history_table_Parameters_h
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Common/include/Debug.h"
+#include "Behavioural/include/Parameters.h"
+// Internal structure
+#include "Behavioural/Generic/Shifter/include/Parameters.h"
+#include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/Parameters.h"
+#include <math.h>
+
+namespace morpheo {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace branch_history_table {
+
+
+  class Parameters : public morpheo::behavioural::Parameters
+  {
+    //-----[ fields ]------------------------------------------------------------
+  public : const uint32_t _size_shifter      ;
+  public : const uint32_t _nb_shifter        ;
+  public : const uint32_t _nb_prediction     ;
+  public : const uint32_t _nb_branch_complete;
+
+  public :       morpheo::behavioural::generic::shifter::Parameters      * _param_shifter;
+  public :       morpheo::behavioural::generic::registerfile::registerfile_monolithic::Parameters * _param_registerfile;
+
+    //-----[ methods ]-----------------------------------------------------------
+  public : Parameters  (uint32_t size_shifter      ,
+ 			uint32_t nb_shifter        ,
+			uint32_t nb_prediction     ,
+			uint32_t nb_branch_complete);
+  public : Parameters  (Parameters & param) ;
+  public : ~Parameters () ;
+
+  public : string msg_error (void);
+
+  public :        string   print      (uint32_t depth);
+  public : friend ostream& operator<< (ostream& output_stream,
+				       morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::branch_history_table::Parameters & x);
+  };
+
+}; // end namespace branch_history_table
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+}; // end namespace behavioural
+}; // end namespace morpheo              
+
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Statistics.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Statistics.h	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Statistics.h	(revision 46)
@@ -0,0 +1,65 @@
+#ifdef STATISTICS
+#ifndef morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_two_level_branch_predictor_branch_history_table_Statistics_h
+#define morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_two_level_branch_predictor_branch_history_table_Statistics_h
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Common/include/Debug.h"
+#include "Behavioural/include/Statistics.h"
+#include "Behavioural/include/Parameters_Statistics.h"
+#include "Behavioural/Generic/Shifter/include/Statistics.h"
+#include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/Statistics.h"
+//#include "Behavioural/Generic/Group/include/Statistics.h"
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Parameters.h"
+
+//using namespace morpheo::behavioural::generic::group;
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace branch_history_table {
+
+
+  class Statistics : public morpheo::behavioural::Statistics
+  {
+    // -----[ fields ]----------------------------------------------------
+  private  : const Parameters                                   _parameters;
+
+    // -----[ methods ]---------------------------------------------------
+  public   : Statistics  (string                                      name                       ,
+			  morpheo::behavioural::Parameters_Statistics parameters_statistics      ,
+			  Parameters                                  parameters
+			  );
+//public   : Statistics  (Statistics & stat);
+  public   : ~Statistics () ;
+
+  public   : string   print_body (uint32_t depth);
+  public   : string   print      (uint32_t depth);
+  public   : string   print      (uint32_t depth          ,
+				  string   component_stat );
+  public   : void     add        ();
+
+  public   : friend ostream& operator<< (ostream& output_stream,
+					 const Statistics & x);
+
+  };
+
+}; // end namespace branch_history_table
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo
+
+#endif
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Types.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Types.h	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Types.h	(revision 46)
@@ -0,0 +1,34 @@
+#ifdef SYSTEMC
+#ifndef morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_two_level_branch_predictor_branch_history_table_Type_h
+#define morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_two_level_branch_predictor_branch_history_table_Type_h
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Common/include/Types.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace branch_history_table {
+
+  typedef uint32_t Thistory_t;
+  typedef uint32_t Taddress_t;
+
+}; // end namespace branch_history_table
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+}; // end namespace behavioural
+}; // end namespace morpheo              
+
+#endif
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table.cpp	(revision 46)
@@ -0,0 +1,93 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Branch_History_Table.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace branch_history_table {
+
+
+#ifdef SYSTEMC
+  Branch_History_Table::Branch_History_Table (sc_module_name name,
+#else
+  Branch_History_Table::Branch_History_Table (string name,
+#endif
+#ifdef STATISTICS
+					      morpheo::behavioural::Parameters_Statistics             param_statistics,
+#endif
+					      morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::branch_history_table::Parameters param ):
+					       _name             (name)
+					      ,_param            (param)
+#ifdef STATISTICS
+					      ,_param_statistics (param_statistics)
+#endif
+  {
+
+#ifdef SYSTEMC
+    allocation ();
+#endif
+
+#ifdef STATISTICS
+    // Allocation of statistics
+    _stat = new Statistics (static_cast<string>(_name),
+			    param_statistics          ,
+			    param);
+#endif
+
+#ifdef VHDL
+    // generate the vhdl
+    vhdl();
+#endif
+
+
+#ifdef SYSTEMC
+//     // Constant
+//     for (uint32_t i=0; i<_param._nb_prediction     ; i++)
+//       PORT_WRITE(out_PREDICT_ACK         [i],1);
+//     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+//       PORT_WRITE(out_BRANCH_COMPLETE_ACK [i],1);
+
+#if (defined(STATISTICS) || defined (VHDL_TESTBENCH))
+    SC_METHOD (transition);
+    dont_initialize ();
+    sensitive_pos << *(in_CLOCK);
+#endif
+
+#ifdef SYSTEMCASS_SPECIFIC
+    // List dependency information
+#endif    
+
+#endif
+  };
+  
+  Branch_History_Table::~Branch_History_Table (void)
+  {
+#ifdef STATISTICS
+
+    _stat->generate_file(statistics(0));
+
+    delete _stat;
+#endif
+
+#ifdef SYSTEMC
+    deallocation ();
+#endif
+  };
+
+}; // end namespace branch_history_table
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_allocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_allocation.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_allocation.cpp	(revision 46)
@@ -0,0 +1,212 @@
+#ifdef SYSTEMC
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Branch_History_Table.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace branch_history_table {
+
+
+  void Branch_History_Table::allocation (void)
+  {
+    _component   = new Component ();
+
+    Entity * entity = _component->set_entity (_name                 
+					     ,"Branch_History_Table"
+#ifdef POSITION
+					     ,MIXTE                
+#endif
+					      );
+    
+    _interfaces = entity->set_interfaces();
+
+    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+    {
+      Interface * interface = _interfaces->set_interface(""
+#ifdef POSITION
+							 , IN  
+							 , SOUTH
+							 , "Generalist interface"
+#endif
+							 );
+      
+      in_CLOCK              = interface->set_signal_clk              ("clock" ,1);
+      in_NRESET             = interface->set_signal_in  <Tcontrol_t> ("nreset",1,RESET_VHDL_YES);
+    }
+
+    // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+     in_PREDICT_VAL     = new SC_IN (Tcontrol_t) * [_param._nb_prediction];
+    out_PREDICT_ACK     = new SC_OUT(Tcontrol_t) * [_param._nb_prediction];
+     in_PREDICT_ADDRESS = new SC_IN (Taddress_t) * [_param._nb_prediction];
+    out_PREDICT_HISTORY = new SC_OUT(Thistory_t) * [_param._nb_prediction];
+
+    for (uint32_t i=0; i<_param._nb_prediction; i++)
+      {
+	Interface_fifo * interface = _interfaces->set_interface("predict_"+toString(i)
+#ifdef POSITION
+								, IN  
+								, WEST
+								, "Interface Predict"
+#endif
+							   );
+
+	 in_PREDICT_VAL     [i] = interface->set_signal_valack_in        ("val"    , VAL);
+	out_PREDICT_ACK     [i] = interface->set_signal_valack_out       ("ack"    , ACK);
+	 in_PREDICT_ADDRESS [i] = interface->set_signal_in  <Taddress_t> ("address", static_cast<uint32_t>(ceil(log2(_param._nb_shifter))));
+	out_PREDICT_HISTORY [i] = interface->set_signal_out <Thistory_t> ("history", _param._size_shifter);
+      }
+
+    // ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+        in_BRANCH_COMPLETE_VAL       = new SC_IN     (Tcontrol_t) * [_param._nb_branch_complete];
+       out_BRANCH_COMPLETE_ACK       = new SC_OUT    (Tcontrol_t) * [_param._nb_branch_complete];
+        in_BRANCH_COMPLETE_ADDRESS   = new SC_IN     (Taddress_t) * [_param._nb_branch_complete];
+        in_BRANCH_COMPLETE_HISTORY   = new SC_IN     (Thistory_t) * [_param._nb_branch_complete];
+        in_BRANCH_COMPLETE_DIRECTION = new SC_IN     (Tcontrol_t) * [_param._nb_branch_complete];
+
+    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+      {
+	Interface_fifo * interface = _interfaces->set_interface("branch_complete_"+toString(i)
+#ifdef POSITION
+								, IN  
+								, EAST
+								, "Interface branch complete"
+#endif
+								);
+
+	 in_BRANCH_COMPLETE_VAL        [i] = interface->set_signal_valack_in        ("val"      , VAL);
+	out_BRANCH_COMPLETE_ACK        [i] = interface->set_signal_valack_out       ("ack"      , ACK);
+	 in_BRANCH_COMPLETE_ADDRESS    [i] = interface->set_signal_in  <Taddress_t> ("address"  , static_cast<uint32_t>(ceil(log2(_param._nb_shifter))));
+	 in_BRANCH_COMPLETE_HISTORY    [i] = interface->set_signal_in  <Thistory_t> ("history"  , _param._size_shifter);
+	 in_BRANCH_COMPLETE_DIRECTION  [i] = interface->set_signal_in  <Tcontrol_t> ("direction", 1);
+      }
+    
+    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
+    string name_component;
+
+    // =====[ component_Shifter ]=========================================    
+    
+    name_component = _name+"_Shifter";
+
+    component_Shifter = new morpheo::behavioural::generic::shifter::Shifter (name_component.c_str()
+#ifdef STATISTICS
+									     ,_param_statistics
+#endif
+									     ,*(_param._param_shifter));
+
+    _component->set_component (component_Shifter->_component
+#ifdef POSITION
+			       , 25
+			       , 25
+			       , 10
+			       , 10
+#endif
+			       );
+
+     // =====[ component_RegisterFile ]====================================    
+    
+    name_component = _name+"_RegisterFile";
+    
+    component_RegisterFile = new morpheo::behavioural::generic::registerfile::registerfile_monolithic::RegisterFile_Monolithic(name_component.c_str(),
+#ifdef STATISTICS
+															       _param_statistics            ,
+#endif
+															       *(_param._param_registerfile));
+
+    _component->set_component (component_RegisterFile->_component
+#ifdef POSITION
+			       , 75
+			       , 75
+			       , 10
+			       , 10
+#endif
+			       );
+     
+    // ~~~~~[ Component - Instanciation ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
+
+     // =====[ component_RegisterFile - Instanciation ]====================    
+
+#ifdef POSITION
+    _component->interface_map (_name+"_RegisterFile","",
+			       _name                ,"");
+#endif
+
+    _component->port_map(_name+"_RegisterFile", "in_CLOCK" , _name,"in_CLOCK" );
+    _component->port_map(_name+"_RegisterFile", "in_NRESET", _name,"in_NRESET");
+    
+    for (uint32_t i=0; i<_param._nb_prediction; i++)
+      {
+#ifdef POSITION
+	_component->interface_map (_name+"_RegisterFile","read_"   +toString(i),
+				   _name                ,"predict_"+toString(i));
+#endif
+
+ 	_component->port_map(_name+"_RegisterFile", "in_READ_"+toString(i)+"_VAL"    , _name, "in_PREDICT_"+toString(i)+"_VAL"    );
+ 	_component->port_map(_name+"_RegisterFile","out_READ_"+toString(i)+"_ACK"    , _name,"out_PREDICT_"+toString(i)+"_ACK"    );
+ 	_component->port_map(_name+"_RegisterFile", "in_READ_"+toString(i)+"_ADDRESS", _name, "in_PREDICT_"+toString(i)+"_ADDRESS");
+ 	_component->port_map(_name+"_RegisterFile","out_READ_"+toString(i)+"_DATA"   , _name,"out_PREDICT_"+toString(i)+"_HISTORY");
+      }
+    
+    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+      {
+#ifdef POSITION
+	_component->interface_map (_name+"_RegisterFile","write_"  +toString(i),
+				   _name+"_Shifter"     ,"shifter_"+toString(i));
+#endif
+
+ 	_component->port_map(_name+"_RegisterFile", "in_WRITE_"+toString(i)+"_VAL"    , _name           , "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"    );
+ 	_component->port_map(_name+"_RegisterFile","out_WRITE_"+toString(i)+"_ACK"    , _name           ,"out_BRANCH_COMPLETE_"+toString(i)+"_ACK"    );
+ 	_component->port_map(_name+"_RegisterFile", "in_WRITE_"+toString(i)+"_ADDRESS", _name           , "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS");
+ 	_component->port_map(_name+"_RegisterFile", "in_WRITE_"+toString(i)+"_DATA"   , _name+"_Shifter","out_SHIFTER_"        +toString(i)+"_DATA");
+      }
+
+    // =====[ component_Shifter - Instanciation ]=========================    
+
+#if (defined(STATISTICS) || defined (VHDL_TESTBENCH))
+
+#ifdef POSITION
+    _component->interface_map (_name+"_Shifter","",
+			       _name           ,"");
+#endif
+
+    _component->port_map(_name+"_Shifter", "in_CLOCK" , _name,"in_CLOCK" );
+    _component->port_map(_name+"_Shifter", "in_NRESET", _name,"in_NRESET");
+
+#endif
+
+    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+      {
+#ifdef POSITION
+	_component->interface_map (_name+"_Shifter","shifter_"+toString(i),
+				   _name           ,"branch_complete_"+toString(i));
+
+#endif
+
+ 	_component->port_map(_name+"_Shifter", "in_SHIFTER_" +toString(i)+"_DATA"    , _name                , "in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY");
+ 	_component->port_map(_name+"_Shifter", "in_SHIFTER_" +toString(i)+"_CARRY_IN", _name                , "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION");
+ 	_component->port_map(_name+"_Shifter", "out_SHIFTER_"+toString(i)+"_DATA"    , _name+"_RegisterFile", "in_WRITE_"+toString(i)+"_DATA");
+      }
+
+#ifdef POSITION
+    _component->generate_file();
+#endif
+  };
+
+}; // end namespace branch_history_table
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_deallocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_deallocation.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_deallocation.cpp	(revision 46)
@@ -0,0 +1,49 @@
+#ifdef SYSTEMC
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Branch_History_Table.h"
+
+namespace morpheo {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace branch_history_table {
+
+  void Branch_History_Table::deallocation (void)
+  {
+    delete     in_CLOCK;
+    delete     in_NRESET;
+
+    delete []  in_PREDICT_VAL    ;
+    delete [] out_PREDICT_ACK    ;
+    delete []  in_PREDICT_ADDRESS;
+    delete [] out_PREDICT_HISTORY;
+
+    delete []  in_BRANCH_COMPLETE_VAL    ;
+    delete [] out_BRANCH_COMPLETE_ACK    ;
+    delete []  in_BRANCH_COMPLETE_ADDRESS;
+    delete []  in_BRANCH_COMPLETE_HISTORY;
+    delete []  in_BRANCH_COMPLETE_DIRECTION;
+
+     // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
+    delete component_Shifter;
+    delete component_RegisterFile;
+    
+    delete _component;
+  };
+
+}; // end namespace branch_history_table
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_statistics.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_statistics.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_statistics.cpp	(revision 46)
@@ -0,0 +1,36 @@
+#ifdef STATISTICS
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Branch_History_Table.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace branch_history_table {
+
+
+  string Branch_History_Table::statistics (uint32_t depth)
+  {
+    return _stat->print(depth,
+			component_Shifter     ->statistics(depth+1) +
+			component_RegisterFile->statistics(depth+1) 
+			);
+  };
+
+}; // end namespace branch_history_table
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_transition.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_transition.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_transition.cpp	(revision 46)
@@ -0,0 +1,41 @@
+#ifdef SYSTEMC
+#if (defined(STATISTICS) || defined (VHDL_TESTBENCH))
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Branch_History_Table.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace branch_history_table {
+
+
+  void Branch_History_Table::transition (void)
+  {
+#ifdef STATISTICS
+    _stat->add();
+#endif    
+
+#ifdef VHDL_TESTBENCH
+    vhdl_testbench_transition ();
+#endif
+  };
+
+}; // end namespace branch_history_table
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_vhdl.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_vhdl.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_vhdl.cpp	(revision 46)
@@ -0,0 +1,44 @@
+#ifdef VHDL
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Branch_History_Table.h"
+#include "Behavioural/include/Vhdl.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace branch_history_table {
+
+
+  void Branch_History_Table::vhdl (void)
+  {
+    Vhdl * vhdl = new Vhdl (_name);
+
+    _interfaces->set_port     (vhdl);
+    _component ->vhdl_instance(vhdl);
+
+    vhdl_declaration (vhdl);
+    vhdl_body        (vhdl);
+
+    vhdl->generate_file();
+
+    delete vhdl;
+  };
+
+}; // end namespace branch_history_table
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_vhdl_body.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_vhdl_body.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_vhdl_body.cpp	(revision 46)
@@ -0,0 +1,32 @@
+#ifdef VHDL
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Branch_History_Table.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace branch_history_table {
+
+
+  void Branch_History_Table::vhdl_body (Vhdl * & vhdl)
+  {
+  };
+
+}; // end namespace branch_history_table
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_vhdl_declaration.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_vhdl_declaration.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_vhdl_declaration.cpp	(revision 46)
@@ -0,0 +1,30 @@
+#ifdef VHDL
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Branch_History_Table.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace branch_history_table {
+
+  void Branch_History_Table::vhdl_declaration (Vhdl * & vhdl)
+  {
+  };
+
+}; // end namespace branch_history_table
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_vhdl_testbench_transition.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_vhdl_testbench_transition.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_vhdl_testbench_transition.cpp	(revision 46)
@@ -0,0 +1,35 @@
+#ifdef VHDL_TESTBENCH
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Branch_History_Table.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace branch_history_table {
+
+
+  void Branch_History_Table::vhdl_testbench_transition (void)
+  {
+//     sc_start(0);
+
+    _interfaces->testbench();
+  };
+
+}; // end namespace branch_history_table
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Parameters.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Parameters.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Parameters.cpp	(revision 46)
@@ -0,0 +1,78 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Parameters.h"
+
+namespace morpheo {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace branch_history_table {
+
+
+  Parameters::Parameters (uint32_t size_shifter      ,
+ 			  uint32_t nb_shifter        ,
+			  uint32_t nb_prediction     ,
+			  uint32_t nb_branch_complete) :
+    _size_shifter       (size_shifter      ),
+    _nb_shifter         (nb_shifter        ),
+    _nb_prediction      (nb_prediction     ),
+    _nb_branch_complete (nb_branch_complete)
+  {
+    _param_shifter = new morpheo::behavioural::generic::shifter::Parameters (size_shifter       ,
+									     nb_branch_complete ,
+									     1                  ,
+									     morpheo::behavioural::generic::shifter::without_rotate     ,
+									     morpheo::behavioural::generic::shifter::internal_left_shift,
+									     morpheo::behavioural::generic::shifter::external_completion),
+    _param_registerfile = new morpheo::behavioural::generic::registerfile::registerfile_monolithic::Parameters (nb_prediction      ,
+														nb_branch_complete ,
+														nb_shifter         ,
+														size_shifter       );
+    
+    test();
+  };
+  
+  Parameters::Parameters (Parameters & param) :
+    _size_shifter       (param._size_shifter      ),
+    _nb_shifter         (param._nb_shifter        ),
+    _nb_prediction      (param._nb_prediction     ),
+    _nb_branch_complete (param._nb_branch_complete)
+  {
+    _param_shifter = new morpheo::behavioural::generic::shifter::Parameters (param._size_shifter       ,
+									     param._nb_branch_complete ,
+									     1                         ,
+									     morpheo::behavioural::generic::shifter::without_rotate     ,
+									     morpheo::behavioural::generic::shifter::internal_left_shift,
+									     morpheo::behavioural::generic::shifter::external_completion,
+									     true),
+
+    _param_registerfile = new morpheo::behavioural::generic::registerfile::registerfile_monolithic::Parameters (param._nb_prediction      ,
+														param._nb_branch_complete ,
+														param._nb_shifter         ,
+														param._size_shifter       );
+      
+
+
+    test();
+  };
+
+  Parameters::~Parameters () 
+  {
+    delete _param_shifter;
+    delete _param_registerfile;
+  };
+
+}; // end namespace branch_history_table
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+}; // end namespace behavioural
+}; // end namespace morpheo              
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Parameters_msg_error.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Parameters_msg_error.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Parameters_msg_error.cpp	(revision 46)
@@ -0,0 +1,54 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Parameters.h"
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Types.h"
+#include <sstream>
+using namespace std;
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace branch_history_table {
+
+
+  string Parameters::msg_error(void)
+  {
+    string msg = "";
+
+    if (is_positive (_size_shifter) == false)
+      {
+	msg += "  - size_shifter must be > 0\n";
+	msg += "    * size_shifter                    : " + toString(_size_shifter) + "\n";
+      }
+
+    if (is_positive (_nb_prediction) == false)
+      {
+	msg += "  - nb_prediction must be > 0\n";
+	msg += "    * nb_prediction                   : " + toString(_nb_prediction) + "\n";
+      }
+
+    if (is_positive (_nb_branch_complete) == false)
+      {
+	msg += "  - nb_branch_complete must be > 0\n";
+	msg += "    * nb_branch_complete              : " + toString(_nb_branch_complete) + "\n";
+      }
+
+    return msg;
+  };
+
+}; // end namespace branch_history_table
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Parameters_print.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Parameters_print.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Parameters_print.cpp	(revision 46)
@@ -0,0 +1,52 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Parameters.h"
+#include <sstream>
+using namespace std;
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace branch_history_table {
+
+
+  string Parameters::print (uint32_t depth)
+  {
+    string tab = string(depth,'\t');
+    ostringstream msg;
+    msg << tab << "<branch_history_table>" << endl
+	<< tab << "\t<size_shifter       value=\"" << _size_shifter       << "\" />" << endl
+ 	<< tab << "\t<nb_shifter         value=\"" << _nb_shifter         << "\" />" << endl
+	<< tab << "\t<nb_prediction      value=\"" << _nb_prediction      << "\" />" << endl
+	<< tab << "\t<nb_branch_complete value=\"" << _nb_branch_complete << "\" />" << endl;
+    msg << _param_shifter     ->print(depth+1);
+    msg << _param_registerfile->print(depth+1);
+    msg	<< tab << "</branch_history_table>" << endl;
+    
+    return msg.str();
+  };
+
+  ostream& operator<< (ostream& output_stream ,
+		       morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::branch_history_table::Parameters & x)
+  {
+    output_stream << x.print(0);
+    
+    return output_stream;
+  };
+
+}; // end namespace branch_history_table
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Statistics.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Statistics.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Statistics.cpp	(revision 46)
@@ -0,0 +1,42 @@
+#ifdef STATISTICS
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Statistics.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace branch_history_table {
+
+
+  Statistics::Statistics (string                                      name                       ,
+			  morpheo::behavioural::Parameters_Statistics parameters_statistics      ,
+			  Parameters                                  parameters
+			  ) :
+    morpheo::behavioural::Statistics(name                  ,
+				     parameters_statistics ),
+    _parameters(parameters)
+  {
+  };
+  
+  Statistics::~Statistics () 
+  { 
+  };
+
+}; // end namespace branch_history_table
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Statistics_add.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Statistics_add.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Statistics_add.cpp	(revision 46)
@@ -0,0 +1,35 @@
+#ifdef STATISTICS
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Statistics.h"
+
+#include <sstream>
+using namespace std;
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace branch_history_table {
+
+
+  void Statistics::add ()
+  {
+  };
+
+}; // end namespace branch_history_table
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Statistics_print.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Statistics_print.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Statistics_print.cpp	(revision 46)
@@ -0,0 +1,55 @@
+#ifdef STATISTICS
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Statistics.h"
+#include <sstream>
+using namespace std;
+
+namespace morpheo {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace branch_history_table {
+
+  string Statistics::print (uint32_t depth                ,
+			    string   component_statistics )
+  {
+    string        tab = string(depth,'\t');
+    ostringstream msg;
+
+    msg << tab << "<branch_history_table name=\"" << _name << "\" >" << endl
+	<< print_body(depth+1)
+	<< component_statistics
+	<< tab << "</branch_history_table>" << endl;
+    
+    return msg.str();
+  };
+
+  string Statistics::print (uint32_t depth)
+  {
+    return print(depth,"");
+  };
+
+  ostream& operator<< (ostream& output_stream ,
+		       morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::branch_history_table::Statistics & x)
+  {
+    output_stream << x.print(0);
+
+    return output_stream;
+  };
+
+}; // end namespace branch_history_table
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Statistics_print_body.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Statistics_print_body.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Statistics_print_body.cpp	(revision 46)
@@ -0,0 +1,40 @@
+#ifdef STATISTICS
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Statistics.h"
+
+#include <sstream>
+using namespace std;
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace branch_history_table {
+
+  string Statistics::print_body (uint32_t depth)
+  {
+    string        tab = string(depth,'\t');
+    ostringstream msg;
+
+    msg << tab << "";
+    
+    return msg.str();
+  };
+
+}; // end namespace branch_history_table
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Makefile
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Makefile	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Makefile	(revision 46)
@@ -0,0 +1,24 @@
+# 
+# $Id$
+# 
+# [ Description ]
+# 
+# Makefile
+# 
+
+#-----[ Directory ]----------------------------------------
+DIR_COMPONENT			= .
+include				$(DIR_COMPONENT)/Makefile.defs
+
+#-----[ Library ]------------------------------------------
+LIBRARY				= $(DIR_LIB)/libTwo_Level_Branch_Predictor.a
+
+
+#-----[ include ]------------------------------------------
+
+all				:
+				@$(MAKE) all_component
+
+include                         $(DIR_MORPHEO)/Behavioural/Makefile.flags
+include				$(DIR_MORPHEO)/Behavioural/Makefile.Common
+include				$(DIR_MORPHEO)/Behavioural/Makefile.Component
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Makefile.defs
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Makefile.defs	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Makefile.defs	(revision 46)
@@ -0,0 +1,11 @@
+# 
+# $Id$
+# 
+# [ Description ]
+# 
+# Makefile
+# 
+
+#-----[ Directory ]----------------------------------------
+DIR_COMPONENT_MORPHEO		= ../../../../..
+DIR_MORPHEO			= $(DIR_COMPONENT)/$(DIR_COMPONENT_MORPHEO)
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Makefile.deps
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Makefile.deps	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Makefile.deps	(revision 46)
@@ -0,0 +1,52 @@
+# 
+# $Id$
+# 
+# [ Description ]
+# 
+# Makefile
+# 
+# DIR_MORPHEO must be defined
+
+ifndef Behavioural
+include $(DIR_MORPHEO)/Behavioural/Makefile.deps
+endif
+ifndef Branch_History_Table
+include $(DIR_MORPHEO)/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/Makefile.deps
+endif
+ifndef Pattern_History_Table
+include $(DIR_MORPHEO)/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/Makefile.deps
+endif
+ifndef Two_Level_Branch_Predictor_Glue
+include $(DIR_MORPHEO)/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/Makefile.deps
+endif
+
+Two_Level_Branch_Predictor			= yes
+
+#-----[ Library ]------------------------------------------
+Two_Level_Branch_Predictor_LIBRARY		= 	-lTwo_Level_Branch_Predictor			\
+							$(Two_Level_Branch_Predictor_Glue_LIBRARY)	\
+							$(Branch_History_Table_LIBRARY)			\
+							$(Pattern_History_Table_LIBRARY)		\
+							$(Behavioural_LIBRARY)	
+
+Two_Level_Branch_Predictor_DIR_LIBRARY		=	-L$(DIR_MORPHEO)/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/lib	\
+							$(Two_Level_Branch_Predictor_Glue_DIR_LIBRARY)	\
+							$(Branch_History_Table_DIR_LIBRARY)		\
+							$(Pattern_History_Table_DIR_LIBRARY)		\
+							$(Behavioural_DIR_LIBRARY)
+
+#-----[ Rules ]--------------------------------------------
+
+Two_Level_Branch_Predictor_library		: 
+						@$(MAKE) Behavioural_library
+						@$(MAKE) Branch_History_Table_library
+						@$(MAKE) Pattern_History_Table_library
+						@$(MAKE) Two_Level_Branch_Predictor_Glue_library
+						@$(MAKE) --directory=$(DIR_MORPHEO)/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor --makefile=Makefile 
+	
+Two_Level_Branch_Predictor_library_clean	: 
+						@$(MAKE) Behavioural_library_clean
+						@$(MAKE) Branch_History_Table_library_clean
+						@$(MAKE) Pattern_History_Table_library_clean
+						@$(MAKE) Two_Level_Branch_Predictor_Glue_library_clean
+						@$(MAKE) --directory=$(DIR_MORPHEO)/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor --makefile=Makefile clean
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/Makefile
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/Makefile	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/Makefile	(revision 46)
@@ -0,0 +1,24 @@
+# 
+# $Id$
+# 
+# [ Description ]
+# 
+# Makefile
+# 
+
+#-----[ Directory ]----------------------------------------
+DIR_COMPONENT			= .
+include				$(DIR_COMPONENT)/Makefile.defs
+
+#-----[ Library ]------------------------------------------
+LIBRARY				= $(DIR_LIB)/libPattern_History_Table.a
+
+
+#-----[ include ]------------------------------------------
+
+all				: $(LIBRARY_NEED)
+				@$(MAKE) all_component
+
+include                         $(DIR_MORPHEO)/Behavioural/Makefile.flags
+include				$(DIR_MORPHEO)/Behavioural/Makefile.Common
+include				$(DIR_MORPHEO)/Behavioural/Makefile.Component
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/Makefile.defs
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/Makefile.defs	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/Makefile.defs	(revision 46)
@@ -0,0 +1,11 @@
+# 
+# $Id$
+# 
+# [ Description ]
+# 
+# Makefile
+# 
+
+#-----[ Directory ]----------------------------------------
+DIR_COMPONENT_MORPHEO		= ../../../../../..
+DIR_MORPHEO			= $(DIR_COMPONENT)/$(DIR_COMPONENT_MORPHEO)
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/Makefile.deps
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/Makefile.deps	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/Makefile.deps	(revision 46)
@@ -0,0 +1,45 @@
+# 
+# $Id$
+# 
+# [ Description ]
+# 
+# Makefile
+# 
+# DIR_MORPHEO must be defined
+
+ifndef Behavioural
+include 			$(DIR_MORPHEO)/Behavioural/Makefile.deps
+endif
+ifndef Counter
+include 			$(DIR_MORPHEO)/Behavioural/Generic/Counter/Makefile.deps
+endif
+ifndef RegisterFile_Monolithic
+include 			$(DIR_MORPHEO)/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/Makefile.deps
+endif
+
+Pattern_History_Table			= yes
+
+#-----[ Library ]------------------------------------------
+Pattern_History_Table_LIBRARY		= 	-lPattern_History_Table	\
+						$(RegisterFile_Monolithic_LIBRARY)	\
+						$(Counter_LIBRARY)	\
+						$(Behavioural_LIBRARY)
+
+Pattern_History_Table_DIR_LIBRARY	=	-L$(DIR_MORPHEO)/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/lib	\
+						$(RegisterFile_Monolithic_DIR_LIBRARY)	\
+						$(Counter_DIR_LIBRARY)		\
+						$(Behavioural_DIR_LIBRARY)
+
+#-----[ Rules ]--------------------------------------------
+
+Pattern_History_Table_library		: 
+					@$(MAKE) Behavioural_library
+					@$(MAKE) Counter_library
+					@$(MAKE) RegisterFile_Monolithic_library
+					@$(MAKE) --directory=$(DIR_MORPHEO)/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table --makefile=Makefile 
+	
+Pattern_History_Table_library_clean	: 
+					@$(MAKE) Behavioural_library_clean
+					@$(MAKE) Counter_library_clean
+					@$(MAKE) RegisterFile_Monolithic_library_clean
+					@$(MAKE) --directory=$(DIR_MORPHEO)/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table --makefile=Makefile clean
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/Makefile
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/Makefile	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/Makefile	(revision 46)
@@ -0,0 +1,29 @@
+# 
+# $Id$
+# 
+# [ Description ]
+# 
+# Makefile
+# 
+
+#-----[ Directory ]----------------------------------------
+DIR_MORPHEO			= ../../../../../../..
+
+LIBRARY				= $(Pattern_History_Table_LIBRARY)
+
+DIR_LIBRARY			= $(Pattern_History_Table_DIR_LIBRARY)
+
+#-----[ include ]------------------------------------------
+
+all				: library
+				@$(MAKE) all_selftest
+
+library				: Pattern_History_Table_library
+
+library_clean			: Pattern_History_Table_library_clean
+
+include                         ../Makefile.deps
+include                         $(DIR_MORPHEO)/Behavioural/Makefile.flags
+include				$(DIR_MORPHEO)/Behavioural/Makefile.Common
+include				$(DIR_MORPHEO)/Behavioural/Makefile.Selftest
+include				$(DIR_MORPHEO)/Behavioural/Makefile.Synthesis
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/config0.cfg
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/config0.cfg	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/config0.cfg	(revision 46)
@@ -0,0 +1,5 @@
+Pattern_History_Table
+2	8	*2	# size_counter      	
+2	64	*4	# nb_counter        
+1	1	+1	# nb_prediction     
+1	1	+1	# nb_branch_complete
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/config1.cfg
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/config1.cfg	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/config1.cfg	(revision 46)
@@ -0,0 +1,5 @@
+Pattern_History_Table
+2	8	*2	# size_counter      	
+2	64	*4	# nb_counter        
+2	2	+1	# nb_prediction     
+2	2	+1	# nb_branch_complete
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/configuration.cfg
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/configuration.cfg	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/configuration.cfg	(revision 46)
@@ -0,0 +1,5 @@
+Pattern_History_Table
+2	8	*2	# size_counter      	
+2	64	*4	# nb_counter        
+1	2	+1	# nb_prediction     
+1	2	+1	# nb_branch_complete
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/include/test.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/include/test.h	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/include/test.h	(revision 46)
@@ -0,0 +1,29 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ * Test "RegisterFile"
+ */
+
+#ifdef SYSTEMC
+#include "systemc.h"
+#endif
+
+#include <string>
+#include <iostream>
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Pattern_History_Table.h"
+
+using namespace std;
+using namespace morpheo;
+using namespace morpheo::behavioural;
+using namespace morpheo::behavioural::stage_1_ifetch;
+using namespace morpheo::behavioural::stage_1_ifetch::predictor;
+using namespace morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor;
+using namespace morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor;
+
+using namespace morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::pattern_history_table;
+
+void test   (string name,
+	     morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::pattern_history_table::Parameters param);
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/mkf.info
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/mkf.info	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/mkf.info	(revision 46)
@@ -0,0 +1,6 @@
+
+# Pattern_History_Table_0
+target_dep	all	Pattern_History_Table_0.ngc
+target_dep	Pattern_History_Table_0.ngc	Pattern_History_Table_0.prj
+target_dep	Pattern_History_Table_0.prj	Pattern_History_Table_0_Counter_Pack.vhdl Pattern_History_Table_0_Counter.vhdl Pattern_History_Table_0_Pack.vhdl Pattern_History_Table_0_RegisterFile_Pack.vhdl Pattern_History_Table_0_RegisterFile.vhdl Pattern_History_Table_0.vhdl
+
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/src/main.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/src/main.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/src/main.cpp	(revision 46)
@@ -0,0 +1,47 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ * Test 0
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/include/test.h"
+
+#define NB_PARAMS 4
+
+void usage (string exec)
+{
+  cerr << "<Usage> " << exec << " name_instance list_params" << endl
+       << "list_params is :" << endl
+       << " - size_counter       (unsigned int)" << endl
+       << " - nb_counter         (unsigned int)" << endl
+       << " - nb_prediction      (unsigned int)" << endl
+       << " - nb_branch_complete (unsigned int)" << endl;
+  exit (1);
+}
+
+#ifndef SYSTEMC
+int main    (int argc, char * argv[])
+#else
+int sc_main (int argc, char * argv[])
+#endif
+{
+  if (argc != 2+NB_PARAMS)
+    usage (argv[0]);
+
+  const string   name               = argv[1];
+  const uint32_t size_counter       = atoi(argv[2]);
+  const uint32_t nb_counter         = atoi(argv[3]);
+  const uint32_t nb_prediction      = atoi(argv[4]);
+  const uint32_t nb_branch_complete = atoi(argv[5]);
+
+  morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::pattern_history_table::Parameters param (size_counter       ,
+																       nb_counter         ,
+																       nb_prediction      ,
+																       nb_branch_complete );
+
+  test (name,param);
+
+  return (EXIT_SUCCESS);
+}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/src/test.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/src/test.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/src/test.cpp	(revision 46)
@@ -0,0 +1,187 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ * Test
+ */
+
+#define NB_ITERATION 512
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/include/test.h"
+#include "Common/include/Test.h"
+
+void test (string name,
+	   morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::pattern_history_table::Parameters param)
+{
+  cout << "<" << name << "> : Simulation SystemC" << endl;
+
+  try 
+    {
+      cout << param.print(1);
+      param.test();
+    }
+  catch (morpheo::ErrorMorpheo & error)
+    {
+      cout << "<" << name << "> : " <<  error.what ();
+      return;
+    }
+  catch (...)
+    {
+      cerr << "<" << name << "> : This test must generate a error" << endl;
+      exit (EXIT_FAILURE);
+    }
+  Pattern_History_Table * _Pattern_History_Table = new Pattern_History_Table (name.c_str(),
+#ifdef STATISTICS
+					     morpheo::behavioural::Parameters_Statistics(5,50),
+#endif
+					     param);
+  
+#ifdef SYSTEMC
+  /*********************************************************************
+   * Déclarations des signaux
+   *********************************************************************/
+  sc_clock                                 CLOCK ("clock", 1.0, 0.5);
+  sc_signal<Tcontrol_t>                    NRESET;
+
+  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];
+  
+  /********************************************************
+   * Instanciation
+   ********************************************************/
+  
+  cout << "<" << name << "> Instanciation of _Pattern_History_Table" << endl;
+  
+  (*(_Pattern_History_Table->in_CLOCK))        (CLOCK);
+  (*(_Pattern_History_Table->in_NRESET))       (NRESET);
+
+  for (uint32_t i=0; i<param._nb_prediction; i++)
+    {
+      (*(_Pattern_History_Table-> in_PREDICT_VAL     [i]))        (PREDICT_VAL     [i]);
+      (*(_Pattern_History_Table->out_PREDICT_ACK     [i]))        (PREDICT_ACK     [i]);
+      (*(_Pattern_History_Table-> in_PREDICT_ADDRESS [i]))        (PREDICT_ADDRESS [i]);
+      (*(_Pattern_History_Table->out_PREDICT_HISTORY [i]))        (PREDICT_HISTORY [i]);
+    }
+
+  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_DIRECTION [i]))        (BRANCH_COMPLETE_DIRECTION [i]);
+    }
+
+  /********************************************************
+   * Simulation - Begin
+   ********************************************************/
+
+  cout << "<" << name << "> Start Simulation ............" << endl;
+  // Initialisation
+
+  srand(0);
+  //srand(TIME(NULL));
+
+  sc_start(0);
+  cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Initialisation" << endl;
+  
+  NRESET.write(1);
+
+  for (uint32_t i=0; i<param._nb_prediction; i++)
+    PREDICT_VAL         [i].write(0);
+  for (uint32_t i=0; i<param._nb_branch_complete; i++)
+    BRANCH_COMPLETE_VAL [i].write(0);
+
+  // Initialisation of Register
+  uint32_t   num_port_branch_complete = 0;
+  uint32_t   num_port_predict         = 0;
+  Taddress_t address                  = 0;
+  Thistory_t history_max              = (1<<param._size_counter)-1;
+  Thistory_t history                  = 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_DIRECTION [0].write(0);
+
+      sc_start(1);
+      
+      if (BRANCH_COMPLETE_ACK[0].read()==1)
+	address++;
+    }
+ 
+  BRANCH_COMPLETE_VAL     [0].write(0);
+  sc_start(0);
+
+  cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Loop of Test" << endl;
+
+  for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++)
+    {
+      num_port_branch_complete = rand() % param._nb_branch_complete;
+      num_port_predict         = rand() % param._nb_prediction     ;
+      address                  = rand() % param._nb_counter        ;
+      history                  = rand() % (1<<param._size_counter) ;
+      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
+	   << " - 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_DIRECTION [num_port_branch_complete].write(direction);
+
+      // Wait Ack
+      do
+	{
+	  sc_start(1);
+	}
+      while (BRANCH_COMPLETE_ACK[num_port_branch_complete].read()!=1);
+
+      BRANCH_COMPLETE_VAL     [num_port_branch_complete].write(0);
+      PREDICT_VAL             [num_port_predict        ].write(1);
+      PREDICT_ADDRESS         [num_port_predict        ].write(address);
+      
+      history                  = (direction==1)?((history<history_max)?history+1:history):((history>0)?history-1:history);
+      
+      // Wait Ack
+      do
+	{
+	  sc_start(1);
+	}
+      while (PREDICT_ACK        [num_port_predict        ].read()!=1);
+
+      PREDICT_VAL             [num_port_predict        ].write(0);
+
+      cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} ["+toString(num_port_predict)+"]" << endl
+	   << " - history new : " << PREDICT_HISTORY [num_port_predict].read() << endl
+	   << dec;
+
+      TEST(Thistory_t,PREDICT_HISTORY [num_port_predict].read(),history);
+    }
+
+  /********************************************************
+   * Simulation - End
+   ********************************************************/
+
+  cout << "<" << name << "> ............ Stop Simulation" << endl;
+
+#endif
+
+  delete _Pattern_History_Table;
+}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/VERSION
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/VERSION	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/VERSION	(revision 46)
@@ -0,0 +1,1 @@
+v0.2
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/doc/Makefile
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/doc/Makefile	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/doc/Makefile	(revision 46)
@@ -0,0 +1,19 @@
+# 
+# $Id$
+# 
+# [ Description ]
+# 
+# Makefile
+# 
+
+#-----[ Directory ]----------------------------------------
+DIR_COMPONENT			= ..
+include				$(DIR_COMPONENT)/Makefile.defs
+
+#-----[ include ]------------------------------------------
+
+all				:
+				$(MAKE) all_documentation
+
+include				$(DIR_MORPHEO)/Behavioural/Makefile.Common
+include				$(DIR_MORPHEO)/Behavioural/Makefile.Documentation
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/doc/Pattern_History_Table.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/doc/Pattern_History_Table.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/doc/Pattern_History_Table.tex	(revision 46)
@@ -0,0 +1,38 @@
+\documentclass[10pt,a4paper,twocolumn]{article}
+
+\def\dirdoc{tex}
+\def\dirschema{eps}
+
+% Package de variables d'environnement : Titre, command etc ...
+\usepackage{../../../../../../../Behavioural/doc/sty/doc-style}
+\usepackage{sty/header}
+
+
+%------------------------------------------------------------------------------
+% Début document
+%------------------------------------------------------------------------------
+
+\pagestyle{empty}
+
+\begin{document}
+
+% Créez une page de titre
+\maketitle
+\thispagestyle{empty}
+
+%Table des matières et des figures
+%\tableofcontents
+%\newpage
+%\listoffigures
+
+%------------------------------------------------------------------------------
+% Ajout du corps du documents
+%------------------------------------------------------------------------------
+
+\input{tex/root}
+
+%------------------------------------------------------------------------------
+% Fin d'ajout du corps du document
+%------------------------------------------------------------------------------
+
+\end{document}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/doc/sty/header.sty
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/doc/sty/header.sty	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/doc/sty/header.sty	(revision 46)
@@ -0,0 +1,12 @@
+\def\review{YYYY/MM/DD}
+%\def\review{\number\day/\number\month/\number\year\xspace}
+
+\title{Pattern\_History\_Table}
+ 
+\author{}
+
+\affiliation{}
+
+\email{}
+
+\date{\review}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/doc/tex/01_introduction.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/doc/tex/01_introduction.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/doc/tex/01_introduction.tex	(revision 46)
@@ -0,0 +1,1 @@
+\Section{Introduction}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/doc/tex/02_features.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/doc/tex/02_features.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/doc/tex/02_features.tex	(revision 46)
@@ -0,0 +1,1 @@
+\Section{Features}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/doc/tex/03_description.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/doc/tex/03_description.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/doc/tex/03_description.tex	(revision 46)
@@ -0,0 +1,1 @@
+\Section{Functional Description}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/doc/tex/04_pinout.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/doc/tex/04_pinout.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/doc/tex/04_pinout.tex	(revision 46)
@@ -0,0 +1,1 @@
+\Section{Pin out}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/doc/tex/05_parameters.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/doc/tex/05_parameters.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/doc/tex/05_parameters.tex	(revision 46)
@@ -0,0 +1,1 @@
+\Section{Parameters}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/doc/tex/06_performance.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/doc/tex/06_performance.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/doc/tex/06_performance.tex	(revision 46)
@@ -0,0 +1,1 @@
+\Section{Performance}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/doc/tex/07_details.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/doc/tex/07_details.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/doc/tex/07_details.tex	(revision 46)
@@ -0,0 +1,1 @@
+\Section{Details}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/doc/tex/08_history.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/doc/tex/08_history.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/doc/tex/08_history.tex	(revision 46)
@@ -0,0 +1,10 @@
+\Section{Revision History}
+
+\begin{tabular}{|c|c|c|}
+\hline
+Revision Date & By  & Modifications\\
+\hline
+\hline
+yyyy/mm/dd    & xxx & Initial document \\
+\hline
+\end{tabular}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/doc/tex/root.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/doc/tex/root.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/doc/tex/root.tex	(revision 46)
@@ -0,0 +1,8 @@
+\input{\dirdoc/01_introduction}
+\input{\dirdoc/02_features}
+\input{\dirdoc/03_description}
+\input{\dirdoc/04_pinout}
+\input{\dirdoc/05_parameters}
+\input{\dirdoc/06_performance}
+\input{\dirdoc/07_details}
+\input{\dirdoc/08_history}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Parameters.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Parameters.h	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Parameters.h	(revision 46)
@@ -0,0 +1,62 @@
+#ifndef morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_two_level_branch_predictor_pattern_history_table_Parameters_h
+#define morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_two_level_branch_predictor_pattern_history_table_Parameters_h
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Common/include/Debug.h"
+#include "Behavioural/include/Parameters.h"
+// Internal structure
+#include "Behavioural/Generic/Counter/include/Parameters.h"
+#include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/Parameters.h"
+#include <math.h>
+
+namespace morpheo {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace pattern_history_table {
+
+
+  class Parameters : public morpheo::behavioural::Parameters
+  {
+    //-----[ fields ]------------------------------------------------------------
+  public : const uint32_t _size_counter      ;
+  public : const uint32_t _nb_counter        ;
+  public : const uint32_t _nb_prediction     ;
+  public : const uint32_t _nb_branch_complete;
+
+  public :       morpheo::behavioural::generic::counter::Parameters      * _param_counter;
+  public :       morpheo::behavioural::generic::registerfile::registerfile_monolithic::Parameters * _param_registerfile;
+
+    //-----[ methods ]-----------------------------------------------------------
+  public : Parameters  (uint32_t size_counter      ,
+ 			uint32_t nb_counter        ,
+			uint32_t nb_prediction     ,
+			uint32_t nb_branch_complete);
+  public : Parameters  (Parameters & param) ;
+  public : ~Parameters () ;
+
+  public : string msg_error (void);
+
+  public :        string   print      (uint32_t depth);
+  public : friend ostream& operator<< (ostream& output_stream,
+				       morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::pattern_history_table::Parameters & x);
+  };
+
+}; // end namespace pattern_history_table
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Pattern_History_Table.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Pattern_History_Table.h	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Pattern_History_Table.h	(revision 46)
@@ -0,0 +1,143 @@
+#ifndef morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_two_level_branch_predictor_pattern_history_table_Pattern_History_Table_h
+#define morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_two_level_branch_predictor_pattern_history_table_Pattern_History_Table_h
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#ifdef SYSTEMC
+#include "systemc.h"
+#endif
+
+#include <iostream>
+#include "Common/include/ToString.h"
+#include "Common/include/Debug.h"
+
+// Internal structure
+#include "Behavioural/Generic/Counter/include/Counter.h"
+#include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/RegisterFile_Monolithic.h"
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Parameters.h"
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Types.h"
+#ifdef STATISTICS
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Statistics.h"
+#endif
+#ifdef VHDL
+#include "Behavioural/include/Vhdl.h"
+#endif
+#include "Behavioural/include/Component.h"
+
+using namespace std;
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace pattern_history_table {
+
+
+  class Pattern_History_Table 
+#if SYSTEMC
+    : public sc_module
+#endif
+  {
+    // -----[ fields ]----------------------------------------------------
+    // Parameters
+  protected : const string     _name;
+
+  protected : const Parameters _param;
+#ifdef STATISTICS
+ protected : const morpheo::behavioural::Parameters_Statistics _param_statistics;
+#endif
+
+#ifdef STATISTICS
+  private   : Statistics                     * _stat;
+#endif
+
+  public    : Component                      * _component;
+  private   : Interfaces                     * _interfaces;
+
+#ifdef SYSTEMC
+    // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+    // Interface
+  public    : SC_CLOCK                      *  in_CLOCK        ;
+  public    : SC_IN (Tcontrol_t)            *  in_NRESET       ;
+
+  public    : SC_IN (Tcontrol_t)           **  in_PREDICT_VAL            ;
+  public    : SC_OUT(Tcontrol_t)           ** out_PREDICT_ACK            ;
+  public    : SC_IN (Taddress_t)           **  in_PREDICT_ADDRESS        ;
+  public    : SC_OUT(Thistory_t)           ** out_PREDICT_HISTORY        ;
+
+  public    : SC_IN (Tcontrol_t)           **  in_BRANCH_COMPLETE_VAL    ;
+  public    : SC_OUT(Tcontrol_t)           ** out_BRANCH_COMPLETE_ACK    ;
+  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_DIRECTION;
+
+    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
+
+    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  public    : SC_SIGNAL(Thistory_t)        ** signal_BRANCH_COMPLETE_HISTORY;
+#endif
+
+    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
+  public    : morpheo::behavioural::generic::counter::Counter           * component_Counter     ;
+  public    : morpheo::behavioural::generic::registerfile::registerfile_monolithic::RegisterFile_Monolithic * component_RegisterFile;
+
+    // -----[ methods ]---------------------------------------------------
+
+#ifdef SYSTEMC
+    SC_HAS_PROCESS (Pattern_History_Table);
+#endif					       
+
+  public  :          Pattern_History_Table              (
+#ifdef SYSTEMC
+							 sc_module_name                              name,
+#else					       
+							 string                                      name,
+#endif					       
+#ifdef STATISTICS
+							 morpheo::behavioural::Parameters_Statistics param_statistics,
+#endif
+							 Parameters                                  param );
+    
+  public  :          Pattern_History_Table              (Parameters param );
+  public  :          ~Pattern_History_Table             (void);
+					       
+#ifdef SYSTEMC				       
+  private : void     allocation                (void);
+  private : void     deallocation              (void);
+					       
+#if (defined(STATISTICS) || defined (VHDL_TESTBENCH))
+  public  : void     transition                (void);
+#endif
+#endif					       
+
+#ifdef STATISTICS
+  public  : string   statistics                (uint32_t depth);
+#endif
+#if VHDL				       
+  public  : void     vhdl                      (void);
+  private : void     vhdl_declaration          (Vhdl * & vhdl);
+  private : void     vhdl_body                 (Vhdl * & vhdl);
+#endif					       
+#ifdef VHDL_TESTBENCH			       
+  private : void     vhdl_testbench_transition (void);
+#endif
+  };
+
+}; // end namespace pattern_history_table
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Statistics.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Statistics.h	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Statistics.h	(revision 46)
@@ -0,0 +1,65 @@
+#ifdef STATISTICS
+#ifndef morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_two_level_branch_predictor_pattern_history_table_Statistics_h
+#define morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_two_level_branch_predictor_pattern_history_table_Statistics_h
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Common/include/Debug.h"
+#include "Behavioural/include/Statistics.h"
+#include "Behavioural/include/Parameters_Statistics.h"
+#include "Behavioural/Generic/Counter/include/Statistics.h"
+#include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/Statistics.h"
+//#include "Behavioural/Generic/Group/include/Statistics.h"
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Parameters.h"
+
+//using namespace morpheo::behavioural::generic::group;
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace pattern_history_table {
+
+
+  class Statistics : public morpheo::behavioural::Statistics
+  {
+    // -----[ fields ]----------------------------------------------------
+  private  : const Parameters                                   _parameters;
+
+    // -----[ methods ]---------------------------------------------------
+  public   : Statistics  (string                                      name                       ,
+			  morpheo::behavioural::Parameters_Statistics parameters_statistics      ,
+			  Parameters                                  parameters
+			  );
+//public   : Statistics  (Statistics & stat);
+  public   : ~Statistics () ;
+    
+  public   : string   print_body (uint32_t depth);
+  public   : string   print      (uint32_t depth);
+  public   : string   print      (uint32_t depth,
+				  string   component_stat);
+  public   : void     add        ();
+
+  public   : friend ostream& operator<< (ostream& output_stream,
+					 const Statistics & x);
+
+  };
+
+}; // end namespace pattern_history_table
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo
+
+#endif
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Types.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Types.h	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Types.h	(revision 46)
@@ -0,0 +1,34 @@
+#ifdef SYSTEMC
+#ifndef morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_two_level_branch_predictor_pattern_history_table_Type_h
+#define morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_two_level_branch_predictor_pattern_history_table_Type_h
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Common/include/Types.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace pattern_history_table {
+
+  typedef uint32_t Thistory_t;
+  typedef uint32_t Taddress_t;
+
+}; // end namespace pattern_history_table
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+}; // end namespace behavioural
+}; // end namespace morpheo              
+
+#endif
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Parameters.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Parameters.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Parameters.cpp	(revision 46)
@@ -0,0 +1,76 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Parameters.h"
+
+namespace morpheo {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace pattern_history_table {
+
+
+  Parameters::Parameters (uint32_t size_counter      ,
+ 			  uint32_t nb_counter        ,
+			  uint32_t nb_prediction     ,
+			  uint32_t nb_branch_complete) :
+    _size_counter       (size_counter      ),
+    _nb_counter         (nb_counter        ),
+    _nb_prediction      (nb_prediction     ),
+    _nb_branch_complete (nb_branch_complete)
+  {
+    log_printf(FUNC,Pattern_History_Table,"Parameters","Begin");
+
+    _param_counter      = new morpheo::behavioural::generic::counter::Parameters (size_counter       ,
+										  nb_branch_complete );
+    _param_registerfile = new morpheo::behavioural::generic::registerfile::registerfile_monolithic::Parameters (nb_prediction      ,
+														nb_branch_complete ,
+														nb_counter         ,
+														size_counter       );
+    
+
+    test();
+    log_printf(FUNC,Pattern_History_Table,"Parameters","End");
+  };
+  
+  Parameters::Parameters (Parameters & param) :
+    _size_counter       (param._size_counter      ),
+    _nb_counter         (param._nb_counter        ),
+    _nb_prediction      (param._nb_prediction     ),
+    _nb_branch_complete (param._nb_branch_complete)
+  {
+    log_printf(FUNC,Pattern_History_Table,"Parameters","Begin");
+
+    _param_counter = new morpheo::behavioural::generic::counter::Parameters (param._size_counter       ,
+									     param._nb_branch_complete );
+
+    _param_registerfile = new morpheo::behavioural::generic::registerfile::registerfile_monolithic::Parameters (param._nb_prediction      ,
+														param._nb_branch_complete ,
+														param._nb_counter         ,
+														param._size_counter       );
+    
+    test();
+    log_printf(FUNC,Pattern_History_Table,"Parameters","End");
+  };
+
+  Parameters::~Parameters () 
+  {
+    log_printf(FUNC,Pattern_History_Table,"~Parameters","Begin");
+    delete _param_counter;
+    delete _param_registerfile;
+    log_printf(FUNC,Pattern_History_Table,"~Parameters","End");
+  };
+
+}; // end namespace pattern_history_table
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+}; // end namespace behavioural
+}; // end namespace morpheo              
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Parameters_msg_error.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Parameters_msg_error.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Parameters_msg_error.cpp	(revision 46)
@@ -0,0 +1,58 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Parameters.h"
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Types.h"
+#include <sstream>
+using namespace std;
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace pattern_history_table {
+
+
+  string Parameters::msg_error(void)
+  {
+    log_printf(FUNC,Pattern_History_Table,"msg_error","Begin");
+
+    string msg = "";
+
+    if (is_positive (_size_counter) == false)
+      {
+	msg += "  - size_counter must be > 0\n";
+	msg += "    * size_counter                    : " + toString(_size_counter) + "\n";
+      }
+
+    if (is_positive (_nb_prediction) == false)
+      {
+	msg += "  - nb_prediction must be > 0\n";
+	msg += "    * nb_prediction                   : " + toString(_nb_prediction) + "\n";
+      }
+
+    if (is_positive (_nb_branch_complete) == false)
+      {
+	msg += "  - nb_branch_complete must be > 0\n";
+	msg += "    * nb_branch_complete              : " + toString(_nb_branch_complete) + "\n";
+      }
+
+    return msg;
+
+    log_printf(FUNC,Pattern_History_Table,"msg_error","End");
+  };
+
+}; // end namespace pattern_history_table
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Parameters_print.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Parameters_print.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Parameters_print.cpp	(revision 46)
@@ -0,0 +1,56 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Parameters.h"
+#include <sstream>
+using namespace std;
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace pattern_history_table {
+
+
+  string Parameters::print (uint32_t depth)
+  {
+    log_printf(FUNC,Pattern_History_Table,"print","Begin");
+
+    string tab = string(depth,'\t');
+    ostringstream msg;
+    msg << tab << "<pattern_history_table>" << endl
+	<< tab << "\t<size_counter       value=\"" << _size_counter       << "\" />" << endl
+ 	<< tab << "\t<nb_counter         value=\"" << _nb_counter         << "\" />" << endl
+	<< tab << "\t<nb_prediction      value=\"" << _nb_prediction      << "\" />" << endl
+	<< tab << "\t<nb_branch_complete value=\"" << _nb_branch_complete << "\" />" << endl;
+    msg << _param_counter     ->print(depth+1);
+    msg << _param_registerfile->print(depth+1);
+    msg << tab << "</pattern_history_table>" << endl;
+
+    log_printf(FUNC,Pattern_History_Table,"print","End");
+    
+    return msg.str();
+  };
+
+  ostream& operator<< (ostream& output_stream ,
+		       morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::pattern_history_table::Parameters & x)
+  {
+    output_stream << x.print(0);
+    
+    return output_stream;
+  };
+
+}; // end namespace pattern_history_table
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table.cpp	(revision 46)
@@ -0,0 +1,97 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Pattern_History_Table.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace pattern_history_table {
+
+
+#ifdef SYSTEMC
+  Pattern_History_Table::Pattern_History_Table (sc_module_name name,
+#else
+  Pattern_History_Table::Pattern_History_Table (string name,
+#endif
+#ifdef STATISTICS
+			      morpheo::behavioural::Parameters_Statistics             param_statistics,
+#endif
+			      morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::pattern_history_table::Parameters param ):
+			      _name              (name)
+			      ,_param            (param)
+#ifdef STATISTICS
+			      ,_param_statistics (param_statistics)
+#endif
+  {
+    log_printf(FUNC,Pattern_History_Table,"Pattern_History_Table","Begin");
+   
+#ifdef SYSTEMC
+    allocation ();
+#endif
+ 
+#ifdef STATISTICS
+    // Allocation of statistics
+    _stat = new Statistics (static_cast<string>(_name),
+			    param_statistics          ,
+			    param);
+#endif
+
+#ifdef VHDL
+    // generate the vhdl
+    vhdl();
+#endif
+
+#ifdef SYSTEMC
+//     // Constant
+//     for (uint32_t i=0; i<_param._nb_prediction     ; i++)
+//       PORT_WRITE(out_PREDICT_ACK         [i],1);
+//     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+//       PORT_WRITE(out_BRANCH_COMPLETE_ACK [i],1);
+
+#if (defined(STATISTICS) || defined (VHDL_TESTBENCH))
+    SC_METHOD (transition);
+    dont_initialize ();
+    sensitive_pos << *(in_CLOCK);
+#endif
+
+#ifdef SYSTEMCASS_SPECIFIC
+    // List dependency information
+#endif    
+
+#endif
+    log_printf(FUNC,Pattern_History_Table,"Pattern_History_Table","End");
+  };
+  
+  Pattern_History_Table::~Pattern_History_Table (void)
+  {
+    log_printf(FUNC,Pattern_History_Table,"~Pattern_History_Table","Begin");
+
+#ifdef STATISTICS
+    _stat->generate_file(statistics(0));
+    
+    delete _stat;
+#endif
+
+#ifdef SYSTEMC
+    deallocation ();
+#endif
+
+    log_printf(FUNC,Pattern_History_Table,"~Pattern_History_Table","End");
+  };
+
+}; // end namespace pattern_history_table
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_allocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_allocation.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_allocation.cpp	(revision 46)
@@ -0,0 +1,217 @@
+#ifdef SYSTEMC
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Pattern_History_Table.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace pattern_history_table {
+
+
+  void Pattern_History_Table::allocation (void)
+  {
+    log_printf(FUNC,Pattern_History_Table,"allocation","Begin");
+
+    _component   = new Component ();
+
+    Entity * entity = _component->set_entity (_name                 
+					     ,"Pattern_History_Table"
+#ifdef POSITION
+					     ,MIXTE                
+#endif
+					      );
+    
+    _interfaces = entity->set_interfaces();
+
+    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+    {
+      Interface * interface = _interfaces->set_interface(""
+#ifdef POSITION
+							 , IN  
+							 , SOUTH
+							 , "Generalist interface"
+#endif
+							 );
+      
+      in_CLOCK              = interface->set_signal_clk              ("clock" ,1);
+      in_NRESET             = interface->set_signal_in  <Tcontrol_t> ("nreset",1,RESET_VHDL_YES);
+    }
+
+    // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+     in_PREDICT_VAL     = new SC_IN (Tcontrol_t) * [_param._nb_prediction];
+    out_PREDICT_ACK     = new SC_OUT(Tcontrol_t) * [_param._nb_prediction];
+     in_PREDICT_ADDRESS = new SC_IN (Taddress_t) * [_param._nb_prediction];
+    out_PREDICT_HISTORY = new SC_OUT(Thistory_t) * [_param._nb_prediction];
+
+    for (uint32_t i=0; i<_param._nb_prediction; i++)
+      {
+	Interface_fifo * interface = _interfaces->set_interface("predict_"+toString(i)
+#ifdef POSITION
+								, IN  
+								, WEST
+								, "Interface Predict"
+#endif
+								);
+
+	 in_PREDICT_VAL     [i] = interface->set_signal_valack_in        ("val"    , VAL);
+	out_PREDICT_ACK     [i] = interface->set_signal_valack_out       ("ack"    , ACK);
+	 in_PREDICT_ADDRESS [i] = interface->set_signal_in  <Taddress_t> ("address", static_cast<uint32_t>(ceil(log2(_param._nb_counter))));
+	out_PREDICT_HISTORY [i] = interface->set_signal_out <Thistory_t> ("history", _param._size_counter);
+      }
+    
+    // ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+        in_BRANCH_COMPLETE_VAL       = new SC_IN     (Tcontrol_t) * [_param._nb_branch_complete];
+       out_BRANCH_COMPLETE_ACK       = new SC_OUT    (Tcontrol_t) * [_param._nb_branch_complete];
+        in_BRANCH_COMPLETE_ADDRESS   = new SC_IN     (Taddress_t) * [_param._nb_branch_complete];
+        in_BRANCH_COMPLETE_HISTORY   = new SC_IN     (Thistory_t) * [_param._nb_branch_complete];
+        in_BRANCH_COMPLETE_DIRECTION = new SC_IN     (Tcontrol_t) * [_param._nb_branch_complete];
+
+    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+      {
+	Interface_fifo * interface = _interfaces->set_interface("branch_complete_"+toString(i)
+#ifdef POSITION
+								, IN  
+								, EAST
+								, "Interface branch complete"
+#endif
+								);
+
+	 in_BRANCH_COMPLETE_VAL        [i] = interface->set_signal_valack_in        ("val"      , VAL);
+	out_BRANCH_COMPLETE_ACK        [i] = interface->set_signal_valack_out       ("ack"      , ACK);
+	 in_BRANCH_COMPLETE_ADDRESS    [i] = interface->set_signal_in  <Taddress_t> ("address"  , static_cast<uint32_t>(ceil(log2(_param._nb_counter))));
+	 in_BRANCH_COMPLETE_HISTORY    [i] = interface->set_signal_in  <Thistory_t> ("history"  , _param._size_counter);
+	 in_BRANCH_COMPLETE_DIRECTION  [i] = interface->set_signal_in  <Tcontrol_t> ("direction", 1);
+      }
+
+    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
+    string name_component;
+
+    // =====[ component_Counter ]=========================================    
+    
+    name_component = _name+"_Counter";
+
+    component_Counter = new morpheo::behavioural::generic::counter::Counter (name_component.c_str()
+#ifdef STATISTICS
+									     ,_param_statistics
+#endif
+									     ,*(_param._param_counter));
+
+    _component->set_component (component_Counter->_component
+#ifdef POSITION
+			       , 25
+			       , 25
+			       , 10
+			       , 10
+#endif
+			       );
+
+     // =====[ component_RegisterFile ]====================================    
+    
+    name_component = _name+"_RegisterFile";
+    
+    component_RegisterFile = new morpheo::behavioural::generic::registerfile::registerfile_monolithic::RegisterFile_Monolithic(name_component.c_str(),
+#ifdef STATISTICS
+															       _param_statistics            ,
+#endif
+															       *(_param._param_registerfile));
+
+    _component->set_component (component_RegisterFile->_component
+#ifdef POSITION
+			       , 75
+			       , 75
+			       , 10
+			       , 10
+#endif
+			       );
+     
+    // ~~~~~[ Component - Instanciation ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
+
+    // =====[ component_RegisterFile - Instanciation ]====================    
+
+#ifdef POSITION
+    _component->interface_map (_name+"_RegisterFile","",
+			       _name                ,"");
+#endif
+
+    _component->port_map(_name+"_RegisterFile", "in_CLOCK" , _name,"in_CLOCK" );
+    _component->port_map(_name+"_RegisterFile", "in_NRESET", _name,"in_NRESET");
+    
+    for (uint32_t i=0; i<_param._nb_prediction; i++)
+      {
+#ifdef POSITION
+	_component->interface_map (_name+"_RegisterFile","read_"   +toString(i),
+				   _name                ,"predict_"+toString(i));
+#endif
+
+ 	_component->port_map(_name+"_RegisterFile", "in_READ_"+toString(i)+"_VAL"    , _name, "in_PREDICT_"+toString(i)+"_VAL"    );
+ 	_component->port_map(_name+"_RegisterFile","out_READ_"+toString(i)+"_ACK"    , _name,"out_PREDICT_"+toString(i)+"_ACK"    );
+ 	_component->port_map(_name+"_RegisterFile", "in_READ_"+toString(i)+"_ADDRESS", _name, "in_PREDICT_"+toString(i)+"_ADDRESS");
+ 	_component->port_map(_name+"_RegisterFile","out_READ_"+toString(i)+"_DATA"   , _name,"out_PREDICT_"+toString(i)+"_HISTORY");
+      }
+    
+    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+      {
+#ifdef POSITION
+	_component->interface_map (_name+"_RegisterFile","write_"  +toString(i),
+				   _name+"_Counter"     ,"counter_"+toString(i));
+#endif
+
+ 	_component->port_map(_name+"_RegisterFile", "in_WRITE_"+toString(i)+"_VAL"    , _name           , "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"    );
+ 	_component->port_map(_name+"_RegisterFile","out_WRITE_"+toString(i)+"_ACK"    , _name           ,"out_BRANCH_COMPLETE_"+toString(i)+"_ACK"    );
+ 	_component->port_map(_name+"_RegisterFile", "in_WRITE_"+toString(i)+"_ADDRESS", _name           , "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS");
+ 	_component->port_map(_name+"_RegisterFile", "in_WRITE_"+toString(i)+"_DATA"   , _name+"_Counter","out_COUNTER_"        +toString(i)+"_DATA");
+      }
+
+    // =====[ component_Counter - Instanciation ]=========================    
+
+#if (defined(STATISTICS) || defined (VHDL_TESTBENCH))
+
+#ifdef POSITION
+    _component->interface_map (_name+"_Counter","",
+			       _name           ,"");
+#endif
+
+    _component->port_map(_name+"_Counter", "in_CLOCK" , _name,"in_CLOCK" );
+    _component->port_map(_name+"_Counter", "in_NRESET", _name,"in_NRESET");
+
+#endif
+
+    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+      {
+#ifdef POSITION
+	_component->interface_map (_name+"_Counter","counter_"+toString(i),
+				   _name           ,"branch_complete_"+toString(i));
+
+#endif
+
+ 	_component->port_map(_name+"_Counter", "in_COUNTER_" +toString(i)+"_DATA"    , _name                , "in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY");
+ 	_component->port_map(_name+"_Counter", "in_COUNTER_" +toString(i)+"_ADDSUB"  , _name                , "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION");
+ 	_component->port_map(_name+"_Counter", "out_COUNTER_"+toString(i)+"_DATA"    , _name+"_RegisterFile", "in_WRITE_"+toString(i)+"_DATA");
+      }
+
+#ifdef POSITION
+    _component->generate_file();
+#endif
+
+    log_printf(FUNC,Pattern_History_Table,"allocation","End");
+  };
+
+}; // end namespace pattern_history_table
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_deallocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_deallocation.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_deallocation.cpp	(revision 46)
@@ -0,0 +1,55 @@
+#ifdef SYSTEMC
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Pattern_History_Table.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace pattern_history_table {
+
+
+  void Pattern_History_Table::deallocation (void)
+  {
+    log_printf(FUNC,Pattern_History_Table,"deallocation","Begin");
+
+    delete     in_CLOCK;
+    delete     in_NRESET;
+
+    delete []  in_PREDICT_VAL    ;
+    delete [] out_PREDICT_ACK    ;
+    delete []  in_PREDICT_ADDRESS;
+    delete [] out_PREDICT_HISTORY;
+
+    delete []  in_BRANCH_COMPLETE_VAL    ;
+    delete [] out_BRANCH_COMPLETE_ACK    ;
+    delete []  in_BRANCH_COMPLETE_ADDRESS;
+    delete []  in_BRANCH_COMPLETE_HISTORY;
+    delete []  in_BRANCH_COMPLETE_DIRECTION;
+
+     // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
+    delete component_Counter;
+    delete component_RegisterFile;
+    
+    delete _component;
+
+    log_printf(FUNC,Pattern_History_Table,"deallocation","End");
+  };
+
+}; // end namespace pattern_history_table
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_statistics.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_statistics.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_statistics.cpp	(revision 46)
@@ -0,0 +1,41 @@
+#ifdef STATISTICS
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Pattern_History_Table.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace pattern_history_table {
+
+  string Pattern_History_Table::statistics (uint32_t depth)
+  {
+    log_printf(FUNC,Pattern_History_Table,"statistics","Begin");
+
+    string stat_print = _stat->print(depth,
+				     component_Counter     ->statistics(depth+1) + 
+				     component_RegisterFile->statistics(depth+1)
+				     );
+
+    log_printf(FUNC,Pattern_History_Table,"statistics","End");
+
+    return stat_print;
+      
+  };
+
+}; // end namespace pattern_history_table
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_transition.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_transition.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_transition.cpp	(revision 46)
@@ -0,0 +1,45 @@
+#ifdef SYSTEMC
+#if (defined(STATISTICS) || defined (VHDL_TESTBENCH))
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Pattern_History_Table.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace pattern_history_table {
+
+
+  void Pattern_History_Table::transition (void)
+  {
+    log_printf(FUNC,Pattern_History_Table,"transition","Begin");
+
+#ifdef STATISTICS
+    _stat->add();
+#endif    
+
+#ifdef VHDL_TESTBENCH
+    vhdl_testbench_transition ();
+#endif
+
+    log_printf(FUNC,Pattern_History_Table,"transition","End");
+  };
+
+}; // end namespace pattern_history_table
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_vhdl.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_vhdl.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_vhdl.cpp	(revision 46)
@@ -0,0 +1,49 @@
+#ifdef VHDL
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Pattern_History_Table.h"
+#include "Behavioural/include/Vhdl.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace pattern_history_table {
+
+
+  void Pattern_History_Table::vhdl (void)
+  {
+    log_printf(FUNC,Pattern_History_Table,"vhdl","Begin");
+
+    Vhdl * vhdl = new Vhdl (_name);
+
+    _interfaces->set_port     (vhdl);
+    _component ->vhdl_instance(vhdl);
+
+    vhdl_declaration (vhdl);
+    vhdl_body        (vhdl);
+
+    vhdl->generate_file();
+
+    delete vhdl;
+
+    log_printf(FUNC,Pattern_History_Table,"vhdl","End");
+
+  };
+
+}; // end namespace pattern_history_table
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_vhdl_body.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_vhdl_body.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_vhdl_body.cpp	(revision 46)
@@ -0,0 +1,42 @@
+#ifdef VHDL
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Pattern_History_Table.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace pattern_history_table {
+
+
+  void Pattern_History_Table::vhdl_body (Vhdl * & vhdl)
+  {
+    log_printf(FUNC,Pattern_History_Table,"vhdl_body","Begin");
+
+//     vhdl->set_body ("-- Output : always at '1'");
+//     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+//       vhdl->set_body ("out_BRANCH_COMPLETE_ACK_"+toString(i)+" <= '1';");
+//     for (uint32_t i=0; i<_param._nb_prediction     ; i++)
+//       vhdl->set_body ("out_PREDICT_ACK_"+toString(i)+"         <= '1';");
+//     vhdl->set_body ("");
+
+    log_printf(FUNC,Pattern_History_Table,"vhdl_body","End");
+  };
+
+}; // end namespace pattern_history_table
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_vhdl_declaration.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_vhdl_declaration.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_vhdl_declaration.cpp	(revision 46)
@@ -0,0 +1,35 @@
+#ifdef VHDL
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Pattern_History_Table.h"
+
+namespace morpheo {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace pattern_history_table {
+
+
+  void Pattern_History_Table::vhdl_declaration (Vhdl * & vhdl)
+  {
+    log_printf(FUNC,Pattern_History_Table,"vhdl_declaration","Begin");
+
+    log_printf(FUNC,Pattern_History_Table,"vhdl_declaration","End");
+  };
+
+}; // end namespace pattern_history_table
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_vhdl_testbench_transition.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_vhdl_testbench_transition.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Pattern_History_Table_vhdl_testbench_transition.cpp	(revision 46)
@@ -0,0 +1,39 @@
+#ifdef VHDL_TESTBENCH
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Pattern_History_Table.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace pattern_history_table {
+
+
+  void Pattern_History_Table::vhdl_testbench_transition ()
+  {
+    log_printf(FUNC,Pattern_History_Table,"vhdl_testbench_transition","Begin");
+
+//     sc_start(0);
+
+    _interfaces->testbench();
+
+    log_printf(FUNC,Pattern_History_Table,"vhdl_testbench_transition","End");
+  };
+
+}; // end namespace pattern_history_table
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Statistics.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Statistics.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Statistics.cpp	(revision 46)
@@ -0,0 +1,46 @@
+#ifdef STATISTICS
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Statistics.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace pattern_history_table {
+
+
+  Statistics::Statistics (string                                      name                       ,
+			  morpheo::behavioural::Parameters_Statistics parameters_statistics      ,
+			  Parameters                                  parameters
+			  ) :
+    morpheo::behavioural::Statistics(name                  ,
+				     parameters_statistics ),
+    _parameters(parameters)
+  {
+    log_printf(FUNC,Pattern_History_Table,"Statistics","Begin");
+    log_printf(FUNC,Pattern_History_Table,"Statistics","End");
+  };
+  
+  Statistics::~Statistics () 
+  { 
+    log_printf(FUNC,Pattern_History_Table,"~Statistics","Begin");
+    log_printf(FUNC,Pattern_History_Table,"~Statistics","End");
+  };
+
+}; // end namespace pattern_history_table
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Statistics_add.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Statistics_add.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Statistics_add.cpp	(revision 46)
@@ -0,0 +1,37 @@
+#ifdef STATISTICS
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Statistics.h"
+
+#include <sstream>
+using namespace std;
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace pattern_history_table {
+
+
+  void Statistics::add ()
+  {
+    log_printf(FUNC,Pattern_History_Table,"add","Begin");
+    log_printf(FUNC,Pattern_History_Table,"add","End");
+  };
+
+}; // end namespace pattern_history_table
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Statistics_print.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Statistics_print.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Statistics_print.cpp	(revision 46)
@@ -0,0 +1,69 @@
+#ifdef STATISTICS
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Statistics.h"
+
+#include <sstream>
+using namespace std;
+
+namespace morpheo {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace pattern_history_table {
+
+
+  string Statistics::print (uint32_t depth ,
+			    string component_stat)
+  {
+    log_printf(FUNC,Pattern_History_Table,"print","Begin");
+
+    string        tab = string(depth,'\t');
+    ostringstream msg;
+
+    msg << tab << "<pattern_history_table name=\"" << _name << "\" >" << endl
+        << print_body(depth+1)
+	<< component_stat
+	<< tab << "</pattern_history_table>" << endl;
+    
+    log_printf(FUNC,Pattern_History_Table,"print","End");
+
+    return msg.str();
+  };
+
+  string Statistics::print (uint32_t depth)
+  {
+    string        tab = string(depth,'\t');
+    ostringstream msg;
+
+    msg << tab << "<pattern_history_table name=\"" << _name << "\" >" << endl
+	<< print_body(depth+1) << endl
+	<< tab << "</pattern_history_table>" << endl;
+    
+    return msg.str();
+  };
+
+  ostream& operator<< (ostream& output_stream ,
+		       morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::pattern_history_table::Statistics & x)
+  {
+    output_stream << x.print(0);
+
+    return output_stream;
+  };
+
+}; // end namespace pattern_history_table
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Statistics_print_body.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Statistics_print_body.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/src/Statistics_print_body.cpp	(revision 46)
@@ -0,0 +1,45 @@
+#ifdef STATISTICS
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Statistics.h"
+
+#include <sstream>
+using namespace std;
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace pattern_history_table {
+
+
+  string Statistics::print_body (uint32_t depth)
+  {
+    log_printf(FUNC,Pattern_History_Table,"print_body","Begin");
+
+    string        tab = string(depth,'\t');
+    ostringstream msg;
+
+    msg << tab << "";
+    
+    log_printf(FUNC,Pattern_History_Table,"print_body","End");
+
+    return msg.str();
+  };
+
+}; // end namespace pattern_history_table
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/Makefile
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/Makefile	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/Makefile	(revision 46)
@@ -0,0 +1,29 @@
+# 
+# $Id$
+# 
+# [ Description ]
+# 
+# Makefile
+# 
+
+#-----[ Directory ]----------------------------------------
+DIR_MORPHEO			= ../../../../../..
+
+LIBRARY				= $(Two_Level_Branch_Predictor_LIBRARY)
+
+DIR_LIBRARY			= $(Two_Level_Branch_Predictor_DIR_LIBRARY)
+
+#-----[ include ]------------------------------------------
+
+all				:
+				@$(MAKE) all_selftest
+
+library				: Two_Level_Branch_Predictor_library
+
+library_clean			: Two_Level_Branch_Predictor_library_clean
+
+include                         ../Makefile.deps
+include                         $(DIR_MORPHEO)/Behavioural/Makefile.flags
+include				$(DIR_MORPHEO)/Behavioural/Makefile.Common
+include				$(DIR_MORPHEO)/Behavioural/Makefile.Selftest
+include				$(DIR_MORPHEO)/Behavioural/Makefile.Synthesis
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/config0.cfg
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/config0.cfg	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/config0.cfg	(revision 46)
@@ -0,0 +1,11 @@
+Two_Level_Branch_Predictor
+0	1	+1	# have_bht           
+4	4	+1	# bht_size_shifter   
+32	32	*2	# bht_nb_shifter     
+1	1	+1	# have_pht           
+8	8	+1	# pht_size_counter   
+32	32	*2	# pht_nb_counter     
+2	2	+1	# pht_size_address_share
+16	16	+1	# size_address      
+1	2	+1	# nb_prediction     
+1	2	+1	# nb_branch_complete
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/config1.cfg
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/config1.cfg	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/config1.cfg	(revision 46)
@@ -0,0 +1,11 @@
+Two_Level_Branch_Predictor
+1	1	+1	# have_bht           
+4	4	+1	# bht_size_shifter   
+32	32	*2	# bht_nb_shifter     
+0	1	+1	# have_pht           
+8	8	+1	# pht_size_counter   
+32	32	*2	# pht_nb_counter     
+2	2	+1	# pht_size_address_share
+16	16	+1	# size_address      
+1	2	+1	# nb_prediction     
+1	2	+1	# nb_branch_complete
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/include/test.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/include/test.h	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/include/test.h	(revision 46)
@@ -0,0 +1,28 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ * Test "RegisterFile"
+ */
+
+#ifdef SYSTEMC
+#include "systemc.h"
+#endif
+
+#include <string>
+#include <iostream>
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/include/Two_Level_Branch_Predictor.h"
+
+using namespace std;
+using namespace morpheo;
+using namespace morpheo::behavioural;
+using namespace morpheo::behavioural::stage_1_ifetch;
+using namespace morpheo::behavioural::stage_1_ifetch::predictor;
+using namespace morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor;
+
+using namespace morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor;
+
+void test   (string name,
+	     morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Parameters param);
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/src/main.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/src/main.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/src/main.cpp	(revision 46)
@@ -0,0 +1,83 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/include/test.h"
+
+#define NB_PARAMS 10
+
+void usage (string exec)
+{
+  cerr << "<Usage> " << exec << " name_instance list_params" << endl
+       << "list_params is :" << endl
+       << " - have_bht               (boolean     )" << endl
+       << " - bht_size_shifter       (unsigned int)" << endl
+       << " - bht_nb_shifter         (unsigned int)" << endl
+       << " - have_pht               (boolean     )" << endl
+       << " - pht_size_counter       (unsigned int)" << endl
+       << " - pht_nb_counter         (unsigned int)" << endl
+       << " - pht_size_address_share (unsigned int)" << endl
+       << " - size_address           (unsigned int)" << endl
+       << " - nb_prediction          (unsigned int)" << endl
+       << " - nb_branch_complete     (unsigned int)" << endl;
+
+  exit (1);
+}
+
+#ifndef SYSTEMC
+int main    (int argc, char * argv[])
+#else
+int sc_main (int argc, char * argv[])
+#endif
+{
+  cout << "<test0> : Classic usage" << endl;
+
+  if (argc != 2+NB_PARAMS)
+    usage (argv[0]);
+  
+  const string   name                     = argv[1];
+  const bool     have_bht                 = atoi(argv[ 2]);
+  const uint32_t bht_size_shifter         = atoi(argv[ 3]);
+  const uint32_t bht_nb_shifter           = atoi(argv[ 4]);
+  const bool     have_pht                 = atoi(argv[ 5]);
+  const uint32_t pht_size_counter         = atoi(argv[ 6]);
+  const uint32_t pht_nb_counter           = atoi(argv[ 7]);
+  const uint32_t pht_size_address_share   = atoi(argv[ 8]);
+  const uint32_t size_address             = atoi(argv[ 9]);
+  const uint32_t nb_prediction            = atoi(argv[10]);
+  const uint32_t nb_branch_complete       = atoi(argv[11]);
+
+  try 
+    {
+      morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Parameters param (have_bht               ,
+														     bht_size_shifter       ,
+														     bht_nb_shifter         ,
+														     have_pht               ,
+														     pht_size_counter       ,
+														     pht_nb_counter         ,
+														     pht_size_address_share ,
+														     size_address           ,
+														     nb_prediction          ,
+														     nb_branch_complete     );
+      
+      cout << param.print(1);
+      
+      test (name,param);
+    }
+  catch (morpheo::ErrorMorpheo & error)
+    {
+      cout << "<" << name << "> : " <<  error.what ();
+      exit (EXIT_FAILURE);
+    }
+  catch (...)
+    {
+      cerr << "<" << name << "> : This test must generate a error" << endl;
+      exit (EXIT_FAILURE);
+    }
+
+  return (EXIT_SUCCESS);
+}
+
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/src/test.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/src/test.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/src/test.cpp	(revision 46)
@@ -0,0 +1,307 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ * Test
+ */
+
+#define NB_ITERATION 512
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/SelfTest/include/test.h"
+#include "Common/include/Test.h"
+#include "Common/include/BitManipulation.h"
+void test (string name,
+	   morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Parameters param)
+{
+  cout << "<" << name << "> : Simulation SystemC" << endl;
+
+  Two_Level_Branch_Predictor * _Two_Level_Branch_Predictor = new Two_Level_Branch_Predictor (name.c_str(),
+#ifdef STATISTICS
+					     morpheo::behavioural::Parameters_Statistics(5,50),
+#endif
+					     param);
+  
+#ifdef SYSTEMC
+
+  /*********************************************************************
+   * Déclarations des signaux
+   *********************************************************************/
+  sc_clock                              *  CLOCK;
+  sc_signal<Tcontrol_t>                 *  NRESET;
+
+  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<Tbht_history_t>             *  PREDICT_BHT_HISTORY         [param._nb_prediction];
+  sc_signal<Tpht_history_t>             *  PREDICT_PHT_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<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_DIRECTION   [param._nb_branch_complete];
+
+  // Rename signal
+
+  string rename;
+
+  CLOCK  = new sc_clock              ("clock", 1.0, 0.5);
+  NRESET = new sc_signal<Tcontrol_t> ("NRESET");
+
+  for (uint32_t i=0; i<param._nb_prediction; i++)
+    {
+      rename = "PREDICT_VAL_"        +toString(i);
+      PREDICT_VAL                 [i] = new sc_signal<Tcontrol_t>     (rename.c_str());
+      rename = "PREDICT_ACK_"        +toString(i);
+      PREDICT_ACK                 [i] = new sc_signal<Tcontrol_t>     (rename.c_str());
+      rename = "PREDICT_ADDRESS_"    +toString(i);
+      PREDICT_ADDRESS             [i] = new sc_signal<Taddress_t>     (rename.c_str());
+      rename = "PREDICT_BHT_HISTORY_"+toString(i);
+      PREDICT_BHT_HISTORY         [i] = new sc_signal<Tbht_history_t> (rename.c_str());
+      rename = "PREDICT_PHT_HISTORY_"+toString(i);
+      PREDICT_PHT_HISTORY         [i] = new sc_signal<Tpht_history_t> (rename.c_str());
+    }
+  
+  for (uint32_t i=0; i<param._nb_branch_complete; i++)
+    {
+      rename = "BRANCH_COMPLETE_VAL_"        +toString(i);
+      BRANCH_COMPLETE_VAL         [i] = new sc_signal<Tcontrol_t>     (rename.c_str());
+      rename = "BRANCH_COMPLETE_ACK_"        +toString(i);
+      BRANCH_COMPLETE_ACK         [i] = new sc_signal<Tcontrol_t>     (rename.c_str());
+      rename = "BRANCH_COMPLETE_ADDRESS_"    +toString(i);
+      BRANCH_COMPLETE_ADDRESS     [i] = new sc_signal<Taddress_t>     (rename.c_str());
+      rename = "BRANCH_COMPLETE_BHT_HISTORY_"+toString(i);
+      BRANCH_COMPLETE_BHT_HISTORY [i] = new sc_signal<Tbht_history_t> (rename.c_str());
+      rename = "BRANCH_COMPLETE_PHT_HISTORY_"+toString(i);
+      BRANCH_COMPLETE_PHT_HISTORY [i] = new sc_signal<Tpht_history_t> (rename.c_str());
+      rename = "BRANCH_COMPLETE_DIRECTION_"  +toString(i);
+      BRANCH_COMPLETE_DIRECTION   [i] = new sc_signal<Tcontrol_t>     (rename.c_str());
+    }
+
+  /********************************************************
+   * Instanciation
+   ********************************************************/
+  
+  cout << "<" << name << "> Instanciation of _Two_Level_Branch_Predictor" << endl;
+  
+  (*(_Two_Level_Branch_Predictor->in_CLOCK ))        (*(CLOCK ));
+  (*(_Two_Level_Branch_Predictor->in_NRESET))        (*(NRESET));
+  
+  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++)
+      {
+	(*(_Two_Level_Branch_Predictor-> in_BRANCH_COMPLETE_VAL         [i])) (*(BRANCH_COMPLETE_VAL          [i]));
+	(*(_Two_Level_Branch_Predictor->out_BRANCH_COMPLETE_ACK         [i])) (*(BRANCH_COMPLETE_ACK          [i]));
+	(*(_Two_Level_Branch_Predictor-> in_BRANCH_COMPLETE_ADDRESS     [i])) (*(BRANCH_COMPLETE_ADDRESS      [i]));
+	if (param._have_bht)						       					
+	(*(_Two_Level_Branch_Predictor-> in_BRANCH_COMPLETE_BHT_HISTORY [i])) (*(BRANCH_COMPLETE_BHT_HISTORY  [i]));
+	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_DIRECTION   [i])) (*(BRANCH_COMPLETE_DIRECTION    [i]));
+      }
+
+  /********************************************************
+   * Simulation - Begin
+   ********************************************************/
+
+  cout << "<" << name << "> Start Simulation ............" << endl;
+  // Initialisation
+
+  const uint32_t seed = 0;
+//const uint32_t seed = static_cast<uint32_t>(time(NULL));
+
+  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);
+
+  NRESET->write(0);
+  sc_start(5);
+  NRESET->write(1);
+
+  for (uint32_t i=0; i<param._nb_prediction; i++)
+    PREDICT_VAL                  [i]->write(0);
+  for (uint32_t i=0; i<param._nb_branch_complete; i++)
+    BRANCH_COMPLETE_VAL          [i]->write(0);
+
+  cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Initialisation" << endl;
+
+  // Step 1
+  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));
+
+//       cout << "pht_size_address           : " << param._pht_size_address << endl;
+//       cout << "size_address_shift         : " << size_address_shift << endl;
+//       cout << "nb_group                   : " << nb_group           << endl;
+//       cout << "nb_reg_by_group            : " << nb_reg_by_group    << endl;
+
+      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++)
+	    {
+	      cout << "j : " << j << " on " << nb_reg_by_group << endl;
+	      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)						       					
+    {
+      // Step 1.2 -> branch_history_table
+      BRANCH_COMPLETE_BHT_HISTORY  [num_port_branch_complete]->write(0);
+      
+      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 [num_port_branch_complete]->write(i);
+
+	  sc_start(1);
+	}
+
+      // wait ackwolegde
+      while (BRANCH_COMPLETE_ACK [num_port_branch_complete] -> read() == 0)
+	{
+	  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);
+
+  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 ++)
+    {
+      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 (PREDICT_ACK [num_port_predict] -> read() == 0)
+	{
+	  sc_start(1);
+	}
+      PREDICT_ACK                  [num_port_predict        ]->write(0);
+
+      sc_start(0);
+
+      // Test
+      cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Predict (Test)   : " << endl; 
+      if (param._have_bht)
+	{
+	  cout << "\tbht_history " << PREDICT_BHT_HISTORY[num_port_predict]->read() << endl;
+	  TEST(Tbht_history_t,bht_history             ,PREDICT_BHT_HISTORY[num_port_predict]->read());
+	}
+      if (param._have_pht)
+	{
+	  cout << "\tpht_history " << PREDICT_PHT_HISTORY[num_port_predict]->read() << endl;
+	  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);
+    }
+
+  /********************************************************
+   * Simulation - End
+   ********************************************************/
+
+  cout << "<" << name << "> ............ Stop Simulation" << endl;
+
+#endif
+
+  delete _Two_Level_Branch_Predictor;
+}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/Makefile
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/Makefile	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/Makefile	(revision 46)
@@ -0,0 +1,24 @@
+# 
+# $Id$
+# 
+# [ Description ]
+# 
+# Makefile
+# 
+
+#-----[ Directory ]----------------------------------------
+DIR_COMPONENT			= .
+include				$(DIR_COMPONENT)/Makefile.defs
+
+#-----[ Library ]------------------------------------------
+LIBRARY				= $(DIR_LIB)/libTwo_Level_Branch_Predictor_Glue.a
+
+
+#-----[ include ]------------------------------------------
+
+all				: $(LIBRARY_NEED)
+				@$(MAKE) all_component
+
+include                         $(DIR_MORPHEO)/Behavioural/Makefile.flags
+include				$(DIR_MORPHEO)/Behavioural/Makefile.Common
+include				$(DIR_MORPHEO)/Behavioural/Makefile.Component
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/Makefile.defs
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/Makefile.defs	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/Makefile.defs	(revision 46)
@@ -0,0 +1,11 @@
+# 
+# $Id$
+# 
+# [ Description ]
+# 
+# Makefile
+# 
+
+#-----[ Directory ]----------------------------------------
+DIR_COMPONENT_MORPHEO		= ../../../../../..
+DIR_MORPHEO			= $(DIR_COMPONENT)/$(DIR_COMPONENT_MORPHEO)
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/Makefile.deps
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/Makefile.deps	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/Makefile.deps	(revision 46)
@@ -0,0 +1,31 @@
+# 
+# $Id$
+# 
+# [ Description ]
+# 
+# Makefile
+# 
+# DIR_MORPHEO must be defined
+
+ifndef Behavioural
+include 			$(DIR_MORPHEO)/Behavioural/Makefile.deps
+endif
+
+Two_Level_Branch_Predictor_Glue			= yes
+
+#-----[ Library ]------------------------------------------
+Two_Level_Branch_Predictor_Glue_LIBRARY		= 	-lTwo_Level_Branch_Predictor_Glue	\
+					$(Behavioural_LIBRARY)	
+
+Two_Level_Branch_Predictor_Glue_DIR_LIBRARY		=	-L$(DIR_MORPHEO)/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/lib	\
+					$(Behavioural_DIR_LIBRARY)
+
+#-----[ Rules ]--------------------------------------------
+
+Two_Level_Branch_Predictor_Glue_library		: 
+				@$(MAKE) Behavioural_library
+				@$(MAKE) --directory=$(DIR_MORPHEO)/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue --makefile=Makefile 
+	
+Two_Level_Branch_Predictor_Glue_library_clean	: 
+				@$(MAKE) Behavioural_library_clean
+				@$(MAKE) --directory=$(DIR_MORPHEO)/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue --makefile=Makefile clean
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/SelfTest/Makefile
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/SelfTest/Makefile	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/SelfTest/Makefile	(revision 46)
@@ -0,0 +1,30 @@
+# 
+# $Id$
+# 
+# [ Description ]
+# 
+# Makefile
+# 
+
+#-----[ Directory ]----------------------------------------
+DIR_MORPHEO			= ../../../../../../..
+
+LIBRARY				= $(Two_Level_Branch_Predictor_Glue_LIBRARY)
+
+DIR_LIBRARY			= $(Two_Level_Branch_Predictor_Glue_DIR_LIBRARY)
+
+#-----[ include ]------------------------------------------
+
+all				: library
+				@$(MAKE) all_selftest
+
+library				: Two_Level_Branch_Predictor_Glue_library
+
+library_clean			: Two_Level_Branch_Predictor_Glue_library_clean
+
+include                         ../Makefile.deps
+include                         $(DIR_MORPHEO)/Behavioural/Makefile.flags
+include				$(DIR_MORPHEO)/Behavioural/Makefile.Common
+include				$(DIR_MORPHEO)/Behavioural/Makefile.Selftest
+include				$(DIR_MORPHEO)/Behavioural/Makefile.Synthesis
+
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/SelfTest/config0.cfg
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/SelfTest/config0.cfg	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/SelfTest/config0.cfg	(revision 46)
@@ -0,0 +1,10 @@
+Two_Level_Branch_Predictor_Glue
+0	1	+1	# have_bht           
+11	11	+1	# bht_size_history   
+4	4	+1	# bht_size_address   
+1	1	+1	# have_pht           
+13	13	+1	# pht_size_address   
+2	2	+1	# pht_size_address_share
+16	16	+1	# size_address       
+2	2	+1	# nb_prediction      
+2	2	+1	# nb_branch_complete 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/SelfTest/config1.cfg
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/SelfTest/config1.cfg	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/SelfTest/config1.cfg	(revision 46)
@@ -0,0 +1,10 @@
+Two_Level_Branch_Predictor_Glue
+1	1	+1	# have_bht           
+11	11	+1	# bht_size_history   
+4	4	+1	# bht_size_address   
+0	1	+1	# have_pht           
+13	13	+1	# pht_size_address   
+0	2	+1	# pht_size_address_share
+16	16	+1	# size_address       
+1	2	+1	# nb_prediction      
+1	2	+1	# nb_branch_complete 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/SelfTest/configuration.cfg
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/SelfTest/configuration.cfg	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/SelfTest/configuration.cfg	(revision 46)
@@ -0,0 +1,10 @@
+Two_Level_Branch_Predictor_Glue
+1	1	+1	# have_bht           
+11	11	+1	# bht_size_history   
+4	4	+1	# bht_size_address   
+0	1	+1	# have_pht           
+13	13	+1	# pht_size_address   
+0	2	+1	# pht_size_address_share
+16	16	+1	# size_address       
+1	2	+1	# nb_prediction      
+1	2	+1	# nb_branch_complete 
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/SelfTest/include/test.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/SelfTest/include/test.h	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/SelfTest/include/test.h	(revision 46)
@@ -0,0 +1,29 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ * Test "RegisterFile"
+ */
+
+#ifdef SYSTEMC
+#include "systemc.h"
+#endif
+
+#include <string>
+#include <iostream>
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Two_Level_Branch_Predictor_Glue.h"
+
+using namespace std;
+using namespace morpheo;
+using namespace morpheo::behavioural;
+using namespace morpheo::behavioural::stage_1_ifetch;
+using namespace morpheo::behavioural::stage_1_ifetch::predictor;
+using namespace morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor;
+using namespace morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor;
+
+using namespace morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::two_level_branch_predictor_glue;
+
+void test   (string name,
+	     morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::two_level_branch_predictor_glue::Parameters param);
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/SelfTest/src/main.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/SelfTest/src/main.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/SelfTest/src/main.cpp	(revision 46)
@@ -0,0 +1,62 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/SelfTest/include/test.h"
+
+#define NB_PARAMS 9
+
+void usage (string exec)
+{
+  cerr << "<Usage> " << exec << " name_instance list_params" << endl
+       << "list_params is :" << endl
+       << " - have_bht               (boolean     )" << endl
+       << " - bht_size_history       (unsigned int)" << endl
+       << " - bht_size_address       (unsigned int)" << endl
+       << " - have_pht               (boolean     )" << endl
+       << " - pht_size_address       (unsigned int)" << endl
+       << " - pht_size_address_share (unsigned int)" << endl
+       << " - size_address           (unsigned int)" << endl
+       << " - nb_prediction          (unsigned int)" << endl
+       << " - nb_branch_complete     (unsigned int)" << endl;
+  exit (1);
+}
+
+#ifndef SYSTEMC
+int main    (int argc, char * argv[])
+#else
+int sc_main (int argc, char * argv[])
+#endif
+{
+  if (argc != 2+NB_PARAMS)
+    usage (argv[0]);
+
+  const string   name                     = argv[1];
+  const bool     have_bht                 = atoi(argv[ 2]);
+  const uint32_t bht_size_history         = atoi(argv[ 3]);
+  const uint32_t bht_size_address         = atoi(argv[ 4]);
+  const bool     have_pht                 = atoi(argv[ 5]);
+  const uint32_t pht_size_address         = atoi(argv[ 6]);
+  const uint32_t pht_size_address_share   = atoi(argv[ 7]);
+  const uint32_t size_address             = atoi(argv[ 8]);
+  const uint32_t nb_prediction            = atoi(argv[ 9]);
+  const uint32_t nb_branch_complete       = atoi(argv[10]);
+
+  morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::two_level_branch_predictor_glue::Parameters param (have_bht              ,
+																		  bht_size_history      ,
+																		  bht_size_address      ,
+																		  have_pht              ,
+																		  pht_size_address      ,
+																		  pht_size_address_share,
+																		  size_address          ,
+																		  nb_prediction         ,
+																		  nb_branch_complete    );
+
+  test (name,param);
+
+  return (EXIT_SUCCESS);
+}
+
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/SelfTest/src/test.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/SelfTest/src/test.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/SelfTest/src/test.cpp	(revision 46)
@@ -0,0 +1,251 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ * Test
+ */
+
+#define NB_ITERATION 64
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/SelfTest/include/test.h"
+#include "Common/include/BitManipulation.h"
+#include "Common/include/Test.h"
+
+void test (string name,
+	   morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::two_level_branch_predictor_glue::Parameters param)
+{
+  cout << "<" << name << "> : Simulation SystemC" << endl;
+
+  try 
+    {
+      cout << param.print(1);
+      param.test();
+    }
+  catch (morpheo::ErrorMorpheo & error)
+    {
+      cout << "<" << name << "> : " <<  error.what ();
+      return;
+    }
+  catch (...)
+    {
+      cerr << "<" << name << "> : This test must generate a error" << endl;
+      exit (EXIT_FAILURE);
+    }
+  Two_Level_Branch_Predictor_Glue * _Two_Level_Branch_Predictor_Glue = new Two_Level_Branch_Predictor_Glue (name.c_str(),
+#ifdef STATISTICS
+					     morpheo::behavioural::Parameters_Statistics(5,50),
+#endif
+					     param);
+  
+#ifdef SYSTEMC
+  /*********************************************************************
+   * Déclarations des signaux
+   *********************************************************************/
+  sc_clock                                 CLOCK ("clock", 1.0, 0.5);
+  sc_signal<Tcontrol_t>                    NRESET;
+
+  sc_signal<Tcontrol_t>                    PREDICT_BHT_ACK             [param._nb_prediction];
+  sc_signal<Tcontrol_t>                    PREDICT_PHT_ACK             [param._nb_prediction];
+  sc_signal<Tcontrol_t>                    PREDICT_ACK                 [param._nb_prediction];
+  				           
+  sc_signal<Taddress_t>                    PREDICT_ADDRESS             [param._nb_prediction];
+  sc_signal<Tbht_history_t>                PREDICT_BHT_HISTORY         [param._nb_prediction];
+  sc_signal<Taddress_t>                    PREDICT_BHT_ADDRESS         [param._nb_prediction];
+  sc_signal<Taddress_t>                    PREDICT_PHT_ADDRESS         [param._nb_prediction];
+  				           
+  sc_signal<Tcontrol_t>                    BRANCH_COMPLETE_BHT_ACK     [param._nb_branch_complete];
+  sc_signal<Tcontrol_t>                    BRANCH_COMPLETE_PHT_ACK     [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<Tbht_history_t>                BRANCH_COMPLETE_BHT_HISTORY [param._nb_branch_complete];
+  sc_signal<Taddress_t>                    BRANCH_COMPLETE_BHT_ADDRESS [param._nb_branch_complete];
+  sc_signal<Taddress_t>                    BRANCH_COMPLETE_PHT_ADDRESS [param._nb_branch_complete];
+  
+  /********************************************************
+   * Instanciation
+   ********************************************************/
+  
+  cout << "<" << name << "> Instanciation of _Two_Level_Branch_Predictor_Glue" << endl;
+  
+  (*(_Two_Level_Branch_Predictor_Glue->in_CLOCK))        (CLOCK);
+  (*(_Two_Level_Branch_Predictor_Glue->in_NRESET))       (NRESET);
+
+  for (uint32_t i=0; i<param._nb_prediction; i++)
+    {
+      if (param._have_bht)
+	{
+      (*(_Two_Level_Branch_Predictor_Glue-> in_PREDICT_BHT_ACK             [i])) (PREDICT_BHT_ACK             [i]);
+      (*(_Two_Level_Branch_Predictor_Glue->out_PREDICT_BHT_ADDRESS         [i])) (PREDICT_BHT_ADDRESS         [i]);
+	}
+      if (param._have_bht and param._have_pht)
+      (*(_Two_Level_Branch_Predictor_Glue-> in_PREDICT_BHT_HISTORY         [i])) (PREDICT_BHT_HISTORY         [i]);
+      if (param._have_pht)
+	{
+      (*(_Two_Level_Branch_Predictor_Glue-> in_PREDICT_PHT_ACK             [i])) (PREDICT_PHT_ACK             [i]);
+      (*(_Two_Level_Branch_Predictor_Glue->out_PREDICT_PHT_ADDRESS         [i])) (PREDICT_PHT_ADDRESS         [i]);
+	}
+      (*(_Two_Level_Branch_Predictor_Glue->out_PREDICT_ACK                 [i])) (PREDICT_ACK                 [i]);
+      (*(_Two_Level_Branch_Predictor_Glue-> in_PREDICT_ADDRESS             [i])) (PREDICT_ADDRESS             [i]);
+    }
+  for (uint32_t i=0; i<param._nb_branch_complete; i++)
+    {
+      if (param._have_bht)
+	{
+      (*(_Two_Level_Branch_Predictor_Glue-> in_BRANCH_COMPLETE_BHT_ACK     [i])) (BRANCH_COMPLETE_BHT_ACK     [i]);
+      (*(_Two_Level_Branch_Predictor_Glue->out_BRANCH_COMPLETE_BHT_ADDRESS [i])) (BRANCH_COMPLETE_BHT_ADDRESS [i]);
+	}
+      if (param._have_bht and param._have_pht)
+      (*(_Two_Level_Branch_Predictor_Glue-> in_BRANCH_COMPLETE_BHT_HISTORY [i])) (BRANCH_COMPLETE_BHT_HISTORY [i]);
+
+      if (param._have_pht)
+	{
+      (*(_Two_Level_Branch_Predictor_Glue-> in_BRANCH_COMPLETE_PHT_ACK     [i])) (BRANCH_COMPLETE_PHT_ACK     [i]);
+      (*(_Two_Level_Branch_Predictor_Glue->out_BRANCH_COMPLETE_PHT_ADDRESS [i])) (BRANCH_COMPLETE_PHT_ADDRESS [i]);
+	}
+      (*(_Two_Level_Branch_Predictor_Glue->out_BRANCH_COMPLETE_ACK         [i])) (BRANCH_COMPLETE_ACK         [i]);
+      (*(_Two_Level_Branch_Predictor_Glue-> in_BRANCH_COMPLETE_ADDRESS     [i])) (BRANCH_COMPLETE_ADDRESS     [i]);
+    }
+
+  /********************************************************
+   * Simulation - Begin
+   ********************************************************/
+
+  cout << "<" << name << "> Start Simulation ............" << endl;
+  // Initialisation
+
+  Tcontrol_t predict_bht_ack;
+  Tcontrol_t predict_pht_ack;
+
+  Tcontrol_t branch_complete_bht_ack;
+  Tcontrol_t branch_complete_pht_ack;
+  
+  srand(0);
+  //srand(time(NULL));
+
+  sc_start(0);
+
+  cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Initialisation" << endl;
+
+  NRESET.write(1);
+
+  cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Test ack" << endl;
+
+  for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++)
+    {
+      // Branch History Table
+      if (param._have_bht)
+	{
+	  predict_bht_ack         = (rand()%2)!=0;
+	  branch_complete_bht_ack = (rand()%2)!=0;
+
+	}
+      else
+	{
+	  predict_bht_ack         = 1;
+	  branch_complete_bht_ack = 1;
+	}
+
+      // Pattern History Table
+      if (param._have_pht)
+	{
+	  predict_pht_ack         = (rand()%2)!=0;
+	  branch_complete_pht_ack = (rand()%2)!=0;
+	}
+      else
+	{
+	  predict_pht_ack         = 1;
+	  branch_complete_pht_ack = 1;
+	}
+      
+      for (uint32_t i=0; i<param._nb_prediction;      i++)
+	{
+	  PREDICT_BHT_ACK         [i] .write(predict_bht_ack);
+	  PREDICT_PHT_ACK         [i] .write(predict_pht_ack);
+	}
+      
+      for (uint32_t i=0; i<param._nb_branch_complete; i++)
+	{
+	  BRANCH_COMPLETE_BHT_ACK [i] .write(branch_complete_bht_ack);
+	  BRANCH_COMPLETE_PHT_ACK [i] .write(branch_complete_pht_ack);
+	}
+      
+      sc_start(0);
+
+      // Test result
+      for (uint32_t i=0; i<param._nb_prediction;      i++)
+	TEST(Tcontrol_t,(predict_pht_ack & predict_bht_ack),PREDICT_ACK [i].read());
+
+      for (uint32_t i=0; i<param._nb_branch_complete;      i++)
+	TEST(Tcontrol_t,(branch_complete_pht_ack & branch_complete_bht_ack),BRANCH_COMPLETE_ACK [i].read());
+
+      sc_start(1);
+    }
+
+  Taddress_t     predict_address;
+  Tbht_history_t predict_bht_history;
+  Taddress_t     branch_complete_address;
+  Tbht_history_t branch_complete_bht_history;
+
+
+  cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} Test address" << endl;
+
+  for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++)
+    {
+      predict_address             = rand()%(1<<param._size_address    );
+      predict_bht_history         = 0;
+      branch_complete_address     = rand()%(1<<param._size_address    );
+      branch_complete_bht_history = 0;
+
+      for (uint32_t i=0; i<param._nb_prediction; i++)
+	PREDICT_ADDRESS         [i].write (predict_address);
+      for (uint32_t i=0; i<param._nb_branch_complete; i++)
+	BRANCH_COMPLETE_ADDRESS [i].write (branch_complete_address);
+
+      // Branch History Table
+      if (param._have_bht and param._have_pht)
+	{
+	  predict_bht_history         = rand()%(1<<param._bht_size_history);
+	  branch_complete_bht_history = rand()%(1<<param._bht_size_history);
+	  
+	  for (uint32_t i=0; i<param._nb_prediction; i++)
+	    PREDICT_BHT_HISTORY         [i].write(predict_bht_history);
+	  for (uint32_t i=0; i<param._nb_branch_complete; i++)
+	    BRANCH_COMPLETE_BHT_HISTORY [i].write(branch_complete_bht_history);
+	}
+
+      sc_start(0);
+
+      // Branch History Table
+      if (param._have_bht)
+	{
+	  for (uint32_t i=0; i<param._nb_prediction; i++)
+	    TEST(Taddress_t,PREDICT_BHT_ADDRESS [i].read(),(predict_address & gen_mask<Taddress_t>(param._bht_size_address)));
+
+	  for (uint32_t i=0; i<param._nb_branch_complete; i++)
+	    TEST(Taddress_t,BRANCH_COMPLETE_BHT_ADDRESS [i].read(),(branch_complete_address & gen_mask<Taddress_t>(param._bht_size_address)));
+	}
+
+      // Pattern History Table
+      if (param._have_pht)
+	{
+	  uint32_t shift = (param._have_bht==false)?0:(param._pht_size_address_shift);
+
+	  for (uint32_t i=0; i<param._nb_prediction; i++)
+	    TEST(Taddress_t,PREDICT_PHT_ADDRESS [i].read(),(((predict_address << shift) xor predict_bht_history) & gen_mask<Taddress_t>(param._pht_size_address)));
+	  for (uint32_t i=0; i<param._nb_branch_complete; i++)
+	    TEST(Taddress_t,BRANCH_COMPLETE_PHT_ADDRESS [i].read(), (((branch_complete_address << shift) xor branch_complete_bht_history) & gen_mask<Taddress_t>(param._pht_size_address)));
+	}
+
+      sc_start(1);	  
+    }
+  /********************************************************
+   * Simulation - End
+   ********************************************************/
+
+  cout << "<" << name << "> ............ Stop Simulation" << endl;
+
+#endif
+
+  delete _Two_Level_Branch_Predictor_Glue;
+}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/VERSION
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/VERSION	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/VERSION	(revision 46)
@@ -0,0 +1,1 @@
+v0.3
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/doc/Makefile
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/doc/Makefile	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/doc/Makefile	(revision 46)
@@ -0,0 +1,19 @@
+# 
+# $Id$
+# 
+# [ Description ]
+# 
+# Makefile
+# 
+
+#-----[ Directory ]----------------------------------------
+DIR_COMPONENT			= ..
+include				$(DIR_COMPONENT)/Makefile.defs
+
+#-----[ include ]------------------------------------------
+
+all				:
+				$(MAKE) all_documentation
+
+include				$(DIR_MORPHEO)/Behavioural/Makefile.Common
+include				$(DIR_MORPHEO)/Behavioural/Makefile.Documentation
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/doc/Two_Level_Branch_Predictor_Glue.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/doc/Two_Level_Branch_Predictor_Glue.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/doc/Two_Level_Branch_Predictor_Glue.tex	(revision 46)
@@ -0,0 +1,38 @@
+\documentclass[10pt,a4paper,twocolumn]{article}
+
+\def\dirdoc{tex}
+\def\dirschema{eps}
+
+% Package de variables d'environnement : Titre, command etc ...
+\usepackage{../../../../../../../Behavioural/doc/sty/doc-style}
+\usepackage{sty/header}
+
+
+%------------------------------------------------------------------------------
+% Début document
+%------------------------------------------------------------------------------
+
+\pagestyle{empty}
+
+\begin{document}
+
+% Créez une page de titre
+\maketitle
+\thispagestyle{empty}
+
+%Table des matières et des figures
+%\tableofcontents
+%\newpage
+%\listoffigures
+
+%------------------------------------------------------------------------------
+% Ajout du corps du documents
+%------------------------------------------------------------------------------
+
+\input{tex/root}
+
+%------------------------------------------------------------------------------
+% Fin d'ajout du corps du document
+%------------------------------------------------------------------------------
+
+\end{document}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/doc/sty/header.sty
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/doc/sty/header.sty	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/doc/sty/header.sty	(revision 46)
@@ -0,0 +1,12 @@
+\def\review{YYYY/MM/DD}
+%\def\review{\number\day/\number\month/\number\year\xspace}
+
+\title{Two\_Level\_Branch\_Predictor\_Glue}
+ 
+\author{}
+
+\affiliation{}
+
+\email{}
+
+\date{\review}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/doc/tex/01_introduction.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/doc/tex/01_introduction.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/doc/tex/01_introduction.tex	(revision 46)
@@ -0,0 +1,1 @@
+\Section{Introduction}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/doc/tex/02_features.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/doc/tex/02_features.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/doc/tex/02_features.tex	(revision 46)
@@ -0,0 +1,1 @@
+\Section{Features}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/doc/tex/03_description.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/doc/tex/03_description.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/doc/tex/03_description.tex	(revision 46)
@@ -0,0 +1,1 @@
+\Section{Functional Description}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/doc/tex/04_pinout.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/doc/tex/04_pinout.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/doc/tex/04_pinout.tex	(revision 46)
@@ -0,0 +1,1 @@
+\Section{Pin out}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/doc/tex/05_parameters.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/doc/tex/05_parameters.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/doc/tex/05_parameters.tex	(revision 46)
@@ -0,0 +1,1 @@
+\Section{Parameters}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/doc/tex/06_performance.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/doc/tex/06_performance.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/doc/tex/06_performance.tex	(revision 46)
@@ -0,0 +1,1 @@
+\Section{Performance}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/doc/tex/07_details.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/doc/tex/07_details.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/doc/tex/07_details.tex	(revision 46)
@@ -0,0 +1,1 @@
+\Section{Details}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/doc/tex/08_history.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/doc/tex/08_history.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/doc/tex/08_history.tex	(revision 46)
@@ -0,0 +1,10 @@
+\Section{Revision History}
+
+\begin{tabular}{|c|c|c|}
+\hline
+Revision Date & By  & Modifications\\
+\hline
+\hline
+yyyy/mm/dd    & xxx & Initial document \\
+\hline
+\end{tabular}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/doc/tex/root.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/doc/tex/root.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/doc/tex/root.tex	(revision 46)
@@ -0,0 +1,8 @@
+\input{\dirdoc/01_introduction}
+\input{\dirdoc/02_features}
+\input{\dirdoc/03_description}
+\input{\dirdoc/04_pinout}
+\input{\dirdoc/05_parameters}
+\input{\dirdoc/06_performance}
+\input{\dirdoc/07_details}
+\input{\dirdoc/08_history}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Parameters.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Parameters.h	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Parameters.h	(revision 46)
@@ -0,0 +1,68 @@
+#ifndef morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_two_level_branch_predictor_two_level_branch_predictor_glue_Parameters_h
+#define morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_two_level_branch_predictor_two_level_branch_predictor_glue_Parameters_h
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Common/include/Debug.h"
+#include "Behavioural/include/Parameters.h"
+#include <math.h>
+
+namespace morpheo {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace two_level_branch_predictor_glue {
+
+
+  class Parameters : public morpheo::behavioural::Parameters
+  {
+    //-----[ fields ]------------------------------------------------------------
+  public : const bool     _have_bht              ;
+  public : const uint32_t _bht_size_history      ;
+  public : const uint32_t _bht_size_address      ;
+  public : const bool     _have_pht              ;
+  public : const uint32_t _pht_size_address      ;
+  public : const uint32_t _pht_size_address_share;
+  public : const uint32_t _size_address          ;
+  public : const uint32_t _nb_prediction         ;
+  public : const uint32_t _nb_branch_complete    ;
+  public : const uint32_t _pht_size_address_shift;
+
+    //-----[ methods ]-----------------------------------------------------------
+  public : Parameters  (bool     have_bht              ,
+			uint32_t bht_size_history      ,
+			uint32_t bht_size_address      ,
+			bool     have_pht              ,
+			uint32_t pht_size_address      ,
+			uint32_t pht_size_address_share,
+			uint32_t size_address          ,
+			uint32_t nb_prediction         ,
+			uint32_t nb_branch_complete    );
+
+  public : Parameters  (Parameters & param) ;
+  public : ~Parameters () ;
+
+  public : string msg_error (void);
+
+  public :        string   print      (uint32_t depth);
+  public : friend ostream& operator<< (ostream& output_stream,
+				       morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::two_level_branch_predictor_glue::Parameters & x);
+  };
+
+}; // end namespace two_level_branch_predictor_glue
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Statistics.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Statistics.h	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Statistics.h	(revision 46)
@@ -0,0 +1,61 @@
+#ifdef STATISTICS
+#ifndef morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_two_level_branch_predictor_two_level_branch_predictor_glue_Statistics_h
+#define morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_two_level_branch_predictor_two_level_branch_predictor_glue_Statistics_h
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Common/include/Debug.h"
+#include "Behavioural/include/Statistics.h"
+#include "Behavioural/include/Parameters_Statistics.h"
+//#include "Behavioural/Generic/Group/include/Statistics.h"
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Parameters.h"
+
+//using namespace morpheo::behavioural::generic::group;
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace two_level_branch_predictor_glue {
+
+
+  class Statistics : public morpheo::behavioural::Statistics
+  {
+    // -----[ fields ]----------------------------------------------------
+  private  : const Parameters                                   _parameters;
+
+    // -----[ methods ]---------------------------------------------------
+  public   : Statistics  (string                                      name                       ,
+			  morpheo::behavioural::Parameters_Statistics parameters_statistics      ,
+			  Parameters                                  parameters
+			  );
+//public   : Statistics  (Statistics & stat);
+  public   : ~Statistics () ;
+    
+  public   : string   print_body (uint32_t depth);
+  public   : string   print      (uint32_t depth);
+  public   : void     add        ();
+
+  public   : friend ostream& operator<< (ostream& output_stream,
+					 const Statistics & x);
+
+  };
+
+}; // end namespace two_level_branch_predictor_glue
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo
+
+#endif
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Two_Level_Branch_Predictor_Glue.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Two_Level_Branch_Predictor_Glue.h	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Two_Level_Branch_Predictor_Glue.h	(revision 46)
@@ -0,0 +1,148 @@
+#ifndef morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_two_level_branch_predictor_two_level_branch_predictor_glue_Two_Level_Branch_Predictor_Glue_h
+#define morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_two_level_branch_predictor_two_level_branch_predictor_glue_Two_Level_Branch_Predictor_Glue_h
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#ifdef SYSTEMC
+#include "systemc.h"
+#endif
+
+#include <iostream>
+#include "Common/include/ToString.h"
+#include "Common/include/Debug.h"
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Parameters.h"
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Types.h"
+#ifdef STATISTICS
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Statistics.h"
+#endif
+#ifdef VHDL
+#include "Behavioural/include/Vhdl.h"
+#endif
+#include "Behavioural/include/Component.h"
+
+using namespace std;
+
+namespace morpheo {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace two_level_branch_predictor_glue {
+
+
+  class Two_Level_Branch_Predictor_Glue 
+#if SYSTEMC
+    : public sc_module
+#endif
+  {
+    // -----[ fields ]----------------------------------------------------
+    // Parameters
+  protected : const string     _name;
+
+  protected : const Parameters _param;
+//#ifdef STATISTICS
+//protected : const morpheo::behavioural::Parameters_Statistics _param_statistics;
+//#endif
+
+#ifdef STATISTICS
+  private   : Statistics                     * _stat;
+#endif
+
+  public    : Component                      * _component;
+  private   : Interfaces                     * _interfaces;
+
+#ifdef SYSTEMC
+    // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+    // Interface
+  public    : SC_CLOCK                      *  in_CLOCK                      ;
+  public    : SC_IN (Tcontrol_t)            *  in_NRESET                     ;
+
+  public    : SC_IN (Tcontrol_t)           **  in_PREDICT_BHT_ACK            ;
+  public    : SC_IN (Tcontrol_t)           **  in_PREDICT_PHT_ACK            ;
+  public    : SC_OUT(Tcontrol_t)           ** out_PREDICT_ACK                ;
+					   
+  public    : SC_IN (Taddress_t)           **  in_PREDICT_ADDRESS            ;
+  public    : SC_IN (Tbht_history_t)       **  in_PREDICT_BHT_HISTORY        ;
+  public    : SC_OUT(Taddress_t)           ** out_PREDICT_BHT_ADDRESS        ;
+  public    : SC_OUT(Taddress_t)           ** out_PREDICT_PHT_ADDRESS        ;
+					   
+  public    : SC_IN (Tcontrol_t)           **  in_BRANCH_COMPLETE_BHT_ACK    ;
+  public    : SC_IN (Tcontrol_t)           **  in_BRANCH_COMPLETE_PHT_ACK    ;
+  public    : SC_OUT(Tcontrol_t)           ** out_BRANCH_COMPLETE_ACK        ;
+					   
+  public    : SC_IN (Taddress_t)           **  in_BRANCH_COMPLETE_ADDRESS    ;
+  public    : SC_IN (Tbht_history_t)       **  in_BRANCH_COMPLETE_BHT_HISTORY;
+  public    : SC_OUT(Taddress_t)           ** out_BRANCH_COMPLETE_BHT_ADDRESS;
+  public    : SC_OUT(Taddress_t)           ** out_BRANCH_COMPLETE_PHT_ADDRESS;
+
+    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
+
+    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
+
+    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#endif
+
+    // -----[ methods ]---------------------------------------------------
+
+#ifdef SYSTEMC
+    SC_HAS_PROCESS (Two_Level_Branch_Predictor_Glue);
+#endif
+  public  :          Two_Level_Branch_Predictor_Glue              (
+#ifdef SYSTEMC
+								   sc_module_name                              name,
+#else					       
+								   string                                      name,
+#endif					       
+#ifdef STATISTICS
+								   morpheo::behavioural::Parameters_Statistics param_statistics,
+#endif
+								   Parameters                                  param );
+					       
+  public  :          Two_Level_Branch_Predictor_Glue              (Parameters param );
+  public  :          ~Two_Level_Branch_Predictor_Glue             (void);
+					       
+#ifdef SYSTEMC				       
+  private : void     allocation                (void);
+  private : void     deallocation              (void);
+					       
+#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
+  public  : void     transition                            (void);
+#endif						           
+  public  : void     genMealy_predict_ack                  (void);
+  public  : void     genMealy_predict_bht_address          (void);
+  public  : void     genMealy_predict_pht_address          (void);
+  public  : void     genMealy_branch_complete_ack          (void);
+  public  : void     genMealy_branch_complete_bht_address  (void);
+  public  : void     genMealy_branch_complete_pht_address  (void);
+#endif					       
+
+#ifdef STATISTICS
+  public  : string   statistics                (uint32_t depth);
+#endif
+#if VHDL				       
+  public  : void     vhdl                      (void);
+  private : void     vhdl_declaration          (Vhdl * & vhdl);
+  private : void     vhdl_body                 (Vhdl * & vhdl);
+#endif					       
+#ifdef VHDL_TESTBENCH			       
+  private : void     vhdl_testbench_transition (void);
+#endif
+  };
+
+}; // end namespace two_level_branch_predictor_glue
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Types.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Types.h	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Types.h	(revision 46)
@@ -0,0 +1,35 @@
+#ifdef SYSTEMC
+#ifndef morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_two_level_branch_predictor_two_level_branch_predictor_glue_Type_h
+#define morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_two_level_branch_predictor_two_level_branch_predictor_glue_Type_h
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Common/include/Types.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace two_level_branch_predictor_glue {
+
+  typedef uint32_t Taddress_t    ;
+  typedef uint32_t Tbht_history_t;
+
+}; // end namespace two_level_branch_predictor_glue
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+
+#endif
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Parameters.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Parameters.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Parameters.cpp	(revision 46)
@@ -0,0 +1,73 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Parameters.h"
+
+namespace morpheo {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace two_level_branch_predictor_glue {
+
+
+  Parameters::Parameters (bool     have_bht               ,
+			  uint32_t bht_size_history       ,
+			  uint32_t bht_size_address       ,
+			  bool     have_pht               ,
+			  uint32_t pht_size_address       ,
+			  uint32_t pht_size_address_share ,
+			  uint32_t size_address           ,
+			  uint32_t nb_prediction          ,
+			  uint32_t nb_branch_complete     ):
+    _have_bht                (have_bht               ),
+    _bht_size_history        (bht_size_history       ),
+    _bht_size_address        (bht_size_address       ),
+    _have_pht                (have_pht               ),
+    _pht_size_address        (pht_size_address       ),
+    _pht_size_address_share  (pht_size_address_share ),
+    _size_address            (size_address           ),
+    _nb_prediction           (nb_prediction          ),
+    _nb_branch_complete      (nb_branch_complete     ),
+    _pht_size_address_shift  (bht_size_history-pht_size_address_share)
+  {
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"Parameters","Begin");
+    test();
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"Parameters","End");
+  };
+  
+  Parameters::Parameters (Parameters & param):
+    _have_bht                (param._have_bht               ),
+    _bht_size_history        (param._bht_size_history       ),
+    _bht_size_address        (param._bht_size_address       ),
+    _have_pht                (param._have_pht               ),
+    _pht_size_address        (param._pht_size_address       ),
+    _pht_size_address_share  (param._pht_size_address_share ),
+    _size_address            (param._size_address           ),
+    _nb_prediction           (param._nb_prediction          ),
+    _nb_branch_complete      (param._nb_branch_complete     ),
+    _pht_size_address_shift  (param._pht_size_address_shift )
+  {
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"Parameters","Begin");
+    test();
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"Parameters","End");
+  };
+
+  Parameters::~Parameters () 
+  {
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"~Parameters","Begin");
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"~Parameters","End");
+  };
+
+}; // end namespace two_level_branch_predictor_glue
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+}; // end namespace behavioural
+}; // end namespace morpheo              
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Parameters_msg_error.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Parameters_msg_error.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Parameters_msg_error.cpp	(revision 46)
@@ -0,0 +1,52 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Parameters.h"
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Types.h"
+#include <sstream>
+using namespace std;
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace two_level_branch_predictor_glue {
+
+
+  string Parameters::msg_error(void)
+  {
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"msg_error","Begin");
+
+    string msg = "";
+    
+    if ((_have_bht and _have_pht) and (_pht_size_address_share >= _pht_size_address))
+      {
+	msg += "  - You can't have higher pht_size_address_share >= pht_size_address\n";
+	msg += "    * pht_size_address                : " + toString(_pht_size_address      ) + "\n";
+	msg += "    * pht_size_address_share          : " + toString(_pht_size_address_share) + "\n";
+      }
+    if ((_have_bht and _have_pht) and (_bht_size_history > _pht_size_address))
+      {
+	msg += "  - You can't have higher bht_size_history > pht_size_address\n";
+	msg += "    * bht_size_history                : " + toString(_bht_size_history      ) + "\n";
+	msg += "    * pht_size_address                : " + toString(_pht_size_address      ) + "\n";
+      }
+
+    return msg;
+
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"msg_error","End");
+  };
+
+}; // end namespace two_level_branch_predictor_glue
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+}; // end namespace behavioural
+}; // end namespace morpheo              
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Parameters_print.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Parameters_print.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Parameters_print.cpp	(revision 46)
@@ -0,0 +1,59 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Parameters.h"
+#include <sstream>
+using namespace std;
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace two_level_branch_predictor_glue {
+
+
+  string Parameters::print (uint32_t depth)
+  {
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"print","Begin");
+
+    string tab = string(depth,'\t');
+    ostringstream msg;
+    msg << tab << "<two_level_branch_predictor_glue>" << endl
+	<< tab << "\t<have_bht               value=\"" << _have_bht               << "\" />" << endl
+	<< tab << "\t<bht_size_history       value=\"" << _bht_size_history       << "\" />" << endl
+	<< tab << "\t<bht_size_address       value=\"" << _bht_size_address       << "\" />" << endl
+	<< tab << "\t<have_pht               value=\"" << _have_pht               << "\" />" << endl
+	<< tab << "\t<pht_size_address       value=\"" << _pht_size_address       << "\" />" << endl
+	<< tab << "\t<pht_size_address_share value=\"" << _pht_size_address_share << "\" /> <!-- Need " << _pht_size_address_shift << " bits to shift -->" << endl
+	<< tab << "\t<size_address           value=\"" << _size_address           << "\" />" << endl
+	<< tab << "\t<nb_prediction          value=\"" << _nb_prediction          << "\" />" << endl
+	<< tab << "\t<nb_branch_complete     value=\"" << _nb_branch_complete     << "\" />" << endl
+      	<< tab << "</two_level_branch_predictor_glue>" << endl;
+
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"print","End");
+    
+    return msg.str();
+  };
+
+  ostream& operator<< (ostream& output_stream ,
+		       morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::two_level_branch_predictor_glue::Parameters & x)
+  {
+    output_stream << x.print(0);
+    
+    return output_stream;
+  };
+
+}; // end namespace two_level_branch_predictor_glue
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Statistics.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Statistics.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Statistics.cpp	(revision 46)
@@ -0,0 +1,46 @@
+#ifdef STATISTICS
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Statistics.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace two_level_branch_predictor_glue {
+
+
+  Statistics::Statistics (string                                      name                       ,
+			  morpheo::behavioural::Parameters_Statistics parameters_statistics      ,
+			  Parameters                                  parameters
+			  ) :
+    morpheo::behavioural::Statistics(name                  ,
+				     parameters_statistics ),
+    _parameters(parameters)
+  {
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"Statistics","Begin");
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"Statistics","End");
+  };
+  
+  Statistics::~Statistics () 
+  { 
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"~Statistics","Begin");
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"~Statistics","End");
+  };
+
+}; // end namespace two_level_branch_predictor_glue
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Statistics_add.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Statistics_add.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Statistics_add.cpp	(revision 46)
@@ -0,0 +1,37 @@
+#ifdef STATISTICS
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Statistics.h"
+
+#include <sstream>
+using namespace std;
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace two_level_branch_predictor_glue {
+
+
+  void Statistics::add ()
+  {
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"add","Begin");
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"add","End");
+  };
+
+}; // end namespace two_level_branch_predictor_glue
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Statistics_print.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Statistics_print.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Statistics_print.cpp	(revision 46)
@@ -0,0 +1,55 @@
+#ifdef STATISTICS
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Statistics.h"
+
+#include <sstream>
+using namespace std;
+
+namespace morpheo {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace two_level_branch_predictor_glue {
+
+
+  string Statistics::print (uint32_t depth)
+  {
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"print","Begin");
+
+    string        tab = string(depth,'\t');
+    ostringstream msg;
+
+    msg << tab << "<two_level_branch_predictor_glue name=\"" << _name << "\" >" << endl
+        << print_body(depth+1) << endl
+	<< tab << "</two_level_branch_predictor_glue>" << endl;
+    
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"print","End");
+
+    return msg.str();
+  };
+
+  ostream& operator<< (ostream& output_stream ,
+		       morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::two_level_branch_predictor_glue::Statistics & x)
+  {
+    output_stream << x.print(0);
+
+    return output_stream;
+  };
+
+}; // end namespace two_level_branch_predictor_glue
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Statistics_print_body.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Statistics_print_body.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Statistics_print_body.cpp	(revision 46)
@@ -0,0 +1,45 @@
+#ifdef STATISTICS
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Statistics.h"
+
+#include <sstream>
+using namespace std;
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace two_level_branch_predictor_glue {
+
+
+  string Statistics::print_body (uint32_t depth)
+  {
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"print_body","Begin");
+
+    string        tab = string(depth,'\t');
+    ostringstream msg;
+
+    msg << tab << "";
+    
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"print_body","End");
+
+    return msg.str();
+  };
+
+}; // end namespace two_level_branch_predictor_glue
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue.cpp	(revision 46)
@@ -0,0 +1,205 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Two_Level_Branch_Predictor_Glue.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace two_level_branch_predictor_glue {
+
+
+#ifdef SYSTEMC
+  Two_Level_Branch_Predictor_Glue::Two_Level_Branch_Predictor_Glue (sc_module_name name,
+#else
+  Two_Level_Branch_Predictor_Glue::Two_Level_Branch_Predictor_Glue (string name,
+#endif
+#ifdef STATISTICS
+								    morpheo::behavioural::Parameters_Statistics             param_statistics,
+#endif
+								    morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::two_level_branch_predictor_glue::Parameters param ):
+								    _name              (name)
+								    ,_param            (param)
+// #ifdef STATISTICS
+//								    ,_param_statistics (param_statistics)
+// #endif
+  {
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"Two_Level_Branch_Predictor_Glue","Begin");
+
+    allocation ();
+
+#ifdef STATISTICS
+    // Allocation of statistics
+    _stat = new Statistics (static_cast<string>(_name),
+			    param_statistics          ,
+			    param);
+#endif
+
+#ifdef VHDL
+    // generate the vhdl
+    vhdl();
+#endif
+
+#ifdef SYSTEMC
+#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
+    SC_METHOD (transition);
+    dont_initialize ();
+    sensitive_pos << *(in_CLOCK);
+#endif
+
+    SC_METHOD (genMealy_predict_ack);
+    dont_initialize ();
+    sensitive_neg << *(in_CLOCK);
+    for (uint32_t i=0; i<_param._nb_prediction; i++)
+      {
+	if (_param._have_bht)
+	sensitive << (*(in_PREDICT_BHT_ACK     [i]));
+	if (_param._have_pht)
+	sensitive << (*(in_PREDICT_PHT_ACK     [i]));
+      }
+
+#ifdef SYSTEMCASS_SPECIFIC
+    // List dependency information
+    for (uint32_t i=0; i<_param._nb_prediction; i++)
+      {
+	if (_param._have_bht)
+	  (*(out_PREDICT_ACK         [i])) (*(in_PREDICT_BHT_ACK     [i]));
+	if (_param._have_pht)
+	  (*(out_PREDICT_ACK         [i])) (*(in_PREDICT_PHT_ACK     [i]));
+      }
+#endif
+    
+    if (_param._have_bht)
+      {
+	SC_METHOD (genMealy_predict_bht_address);
+	dont_initialize ();
+	sensitive_neg << *(in_CLOCK);
+	for (uint32_t i=0; i<_param._nb_prediction; i++)
+	  sensitive << (*(in_PREDICT_ADDRESS     [i]));
+	
+#ifdef SYSTEMCASS_SPECIFIC
+	// List dependency information
+	for (uint32_t i=0; i<_param._nb_prediction; i++)
+	  (*(out_PREDICT_BHT_ADDRESS [i])) (*(in_PREDICT_ADDRESS     [i]));
+#endif
+      }
+
+    if (_param._have_pht)
+      {
+	SC_METHOD (genMealy_predict_pht_address);
+	dont_initialize ();
+	sensitive_neg << *(in_CLOCK);
+	for (uint32_t i=0; i<_param._nb_prediction; i++)
+	  {
+	    if (_param._have_bht)
+	      sensitive << (*(in_PREDICT_BHT_HISTORY [i]));
+	    sensitive << (*(in_PREDICT_ADDRESS     [i]));
+	  }
+	
+#ifdef SYSTEMCASS_SPECIFIC
+	// List dependency information
+	for (uint32_t i=0; i<_param._nb_prediction; i++)
+	  {
+	    (*(out_PREDICT_PHT_ADDRESS [i])) (*(in_PREDICT_ADDRESS     [i]));
+	    if (_param._have_bht)
+	      (*(out_PREDICT_PHT_ADDRESS [i])) (*(in_PREDICT_BHT_HISTORY [i]));
+	  }
+#endif
+      }
+
+    SC_METHOD (genMealy_branch_complete_ack);
+    dont_initialize ();
+    sensitive_neg << *(in_CLOCK);
+    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+      {
+	if (_param._have_bht)
+	sensitive << (*(in_BRANCH_COMPLETE_BHT_ACK     [i]));
+	if (_param._have_pht)
+	sensitive << (*(in_BRANCH_COMPLETE_PHT_ACK     [i]));
+      }
+
+#ifdef SYSTEMCASS_SPECIFIC
+    // List dependency information
+    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+      {
+	if (_param._have_bht)
+	  (*(out_BRANCH_COMPLETE_ACK         [i])) (*(in_BRANCH_COMPLETE_BHT_ACK     [i]));
+	if (_param._have_pht)
+	  (*(out_BRANCH_COMPLETE_ACK         [i])) (*(in_BRANCH_COMPLETE_PHT_ACK     [i]));
+      }
+#endif
+    
+    if (_param._have_bht)
+      {
+	SC_METHOD (genMealy_branch_complete_bht_address);
+	dont_initialize ();
+	sensitive_neg << *(in_CLOCK);
+	for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+	  sensitive << (*(in_BRANCH_COMPLETE_ADDRESS     [i]));
+	
+#ifdef SYSTEMCASS_SPECIFIC
+	// List dependency information
+	for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+	  (*(out_BRANCH_COMPLETE_BHT_ADDRESS [i])) (*(in_BRANCH_COMPLETE_ADDRESS     [i]));
+#endif
+      }
+
+    if (_param._have_pht)
+      {
+	SC_METHOD (genMealy_branch_complete_pht_address);
+	dont_initialize ();
+	sensitive_neg << *(in_CLOCK);
+	for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+	  {
+	    if (_param._have_bht)
+	      sensitive << (*(in_BRANCH_COMPLETE_BHT_HISTORY [i]));
+	    sensitive << (*(in_BRANCH_COMPLETE_ADDRESS     [i]));
+	  }
+	
+#ifdef SYSTEMCASS_SPECIFIC
+	// List dependency information
+	for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+	  {
+	    (*(out_BRANCH_COMPLETE_PHT_ADDRESS [i])) (*(in_BRANCH_COMPLETE_ADDRESS     [i]));
+	    if (_param._have_bht)
+	      (*(out_BRANCH_COMPLETE_PHT_ADDRESS [i])) (*(in_BRANCH_COMPLETE_BHT_HISTORY [i]));
+	  }
+#endif
+      }
+
+#endif
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"Two_Level_Branch_Predictor_Glue","End");
+  };
+  
+  Two_Level_Branch_Predictor_Glue::~Two_Level_Branch_Predictor_Glue (void)
+  {
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"~Two_Level_Branch_Predictor_Glue","Begin");
+
+#ifdef STATISTICS
+    _stat->generate_file(statistics(0));
+    
+    delete _stat;
+#endif
+
+#ifdef SYSTEMC
+    deallocation ();
+#endif
+
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"~Two_Level_Branch_Predictor_Glue","End");
+  };
+
+}; // end namespace two_level_branch_predictor_glue
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_allocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_allocation.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_allocation.cpp	(revision 46)
@@ -0,0 +1,154 @@
+#ifdef SYSTEMC
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Two_Level_Branch_Predictor_Glue.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace two_level_branch_predictor_glue {
+
+
+  void Two_Level_Branch_Predictor_Glue::allocation (void)
+  {
+    string rename;
+
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"allocation","Begin");
+
+    _component   = new Component ();
+
+    Entity * entity = _component->set_entity (_name                 
+					     ,"Two_Level_Branch_Predictor_Glue"
+#ifdef POSITION
+					     ,COMBINATORY
+#endif
+					      );
+    
+    _interfaces = entity->set_interfaces();
+
+    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+    {
+      Interface * interface = _interfaces->set_interface(""
+#ifdef POSITION
+							 , IN  
+							 , SOUTH
+							 , "Generalist interface"
+#endif
+							 );
+      
+      in_CLOCK              = interface->set_signal_clk              ("clock" ,1,CLOCK_VHDL_NO);
+      in_NRESET             = interface->set_signal_in  <Tcontrol_t> ("nreset",1,RESET_VHDL_NO);
+    }
+    
+    // ~~~~~[ Interface : "Predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+    if (_param._have_bht)
+      {
+     in_PREDICT_BHT_ACK              = new SC_IN (Tcontrol_t)           * [_param._nb_prediction];
+    out_PREDICT_BHT_ADDRESS          = new SC_OUT(Taddress_t)           * [_param._nb_prediction];
+      }
+    if (_param._have_pht)
+      {
+     in_PREDICT_PHT_ACK              = new SC_IN (Tcontrol_t)           * [_param._nb_prediction];
+    out_PREDICT_PHT_ADDRESS          = new SC_OUT(Taddress_t)           * [_param._nb_prediction];
+      }
+    if (_param._have_bht and _param._have_pht)
+     in_PREDICT_BHT_HISTORY          = new SC_IN (Tbht_history_t)       * [_param._nb_prediction];
+    out_PREDICT_ACK                  = new SC_OUT(Tcontrol_t)           * [_param._nb_prediction];
+     in_PREDICT_ADDRESS              = new SC_IN (Taddress_t)           * [_param._nb_prediction];
+
+    for (uint32_t i=0; i<_param._nb_prediction; i++)
+      {
+	Interface_fifo * interface = _interfaces->set_interface("predict_"+toString(i)
+#ifdef POSITION
+								, IN  
+								, WEST
+								, "Interface Predict"
+#endif
+								);
+
+	if (_param._have_bht)
+	  {
+         in_PREDICT_BHT_ACK             [i] = interface->set_signal_in  <Tcontrol_t>     ("bht_ack"    ,1);
+        out_PREDICT_BHT_ADDRESS         [i] = interface->set_signal_out <Taddress_t>     ("bht_address",_param._bht_size_address);
+	  }
+	if (_param._have_pht)
+	  {
+         in_PREDICT_PHT_ACK             [i] = interface->set_signal_in  <Tcontrol_t>     ("pht_ack"    ,1);
+        out_PREDICT_PHT_ADDRESS         [i] = interface->set_signal_out <Taddress_t>     ("pht_address",_param._pht_size_address);
+	  }
+	if (_param._have_bht and _param._have_pht)
+         in_PREDICT_BHT_HISTORY         [i] = interface->set_signal_in  <Tbht_history_t> ("bht_history",_param._bht_size_history);
+        out_PREDICT_ACK                 [i] = interface->set_signal_out <Tcontrol_t>     ("ack"        ,1);
+         in_PREDICT_ADDRESS             [i] = interface->set_signal_in  <Taddress_t>     ("address"    ,_param._size_address);
+      }
+
+    // ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+    if (_param._have_bht)
+      {
+     in_BRANCH_COMPLETE_BHT_ACK              = new SC_IN (Tcontrol_t)           * [_param._nb_branch_complete];
+    out_BRANCH_COMPLETE_BHT_ADDRESS          = new SC_OUT(Taddress_t)           * [_param._nb_branch_complete];
+      }
+    if (_param._have_pht)
+      {
+     in_BRANCH_COMPLETE_PHT_ACK              = new SC_IN (Tcontrol_t)           * [_param._nb_branch_complete];
+    out_BRANCH_COMPLETE_PHT_ADDRESS          = new SC_OUT(Taddress_t)           * [_param._nb_branch_complete];
+      }
+    if (_param._have_bht and _param._have_pht)
+     in_BRANCH_COMPLETE_BHT_HISTORY          = new SC_IN (Tbht_history_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];
+
+    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+      {
+	Interface_fifo * interface = _interfaces->set_interface("branch_complete_"+toString(i)
+#ifdef POSITION
+								, IN  
+								, EAST
+								, "Interface branch complete"
+#endif
+								);
+	if (_param._have_bht)
+	  {
+         in_BRANCH_COMPLETE_BHT_ACK             [i] = interface->set_signal_in  <Tcontrol_t>     ("bht_ack"    ,1);
+        out_BRANCH_COMPLETE_BHT_ADDRESS         [i] = interface->set_signal_out <Taddress_t>     ("bht_address",_param._bht_size_address);
+	  }
+	if (_param._have_pht)
+	  {
+         in_BRANCH_COMPLETE_PHT_ACK             [i] = interface->set_signal_in  <Tcontrol_t>     ("pht_ack"    ,1);
+        out_BRANCH_COMPLETE_PHT_ADDRESS         [i] = interface->set_signal_out <Taddress_t>     ("pht_address",_param._pht_size_address);
+	  }
+	if (_param._have_bht and _param._have_pht)
+         in_BRANCH_COMPLETE_BHT_HISTORY         [i] = interface->set_signal_in  <Tbht_history_t> ("bht_history",_param._bht_size_history);
+
+        out_BRANCH_COMPLETE_ACK                 [i] = interface->set_signal_out <Tcontrol_t>     ("ack"        ,1);
+         in_BRANCH_COMPLETE_ADDRESS             [i] = interface->set_signal_in  <Taddress_t>     ("address"    ,_param._size_address);
+      }
+
+    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
+
+#ifdef POSITION
+    _component->generate_file();
+#endif
+
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"allocation","End");
+  };
+
+}; // end namespace two_level_branch_predictor_glue
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_deallocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_deallocation.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_deallocation.cpp	(revision 46)
@@ -0,0 +1,72 @@
+#ifdef SYSTEMC
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Two_Level_Branch_Predictor_Glue.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace two_level_branch_predictor_glue {
+
+
+  void Two_Level_Branch_Predictor_Glue::deallocation (void)
+  {
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"deallocation","Begin");
+
+    delete     in_CLOCK;
+    delete     in_NRESET;
+
+    if (_param._have_bht)
+      {
+    delete []  in_PREDICT_BHT_ACK    ;
+    delete [] out_PREDICT_BHT_ADDRESS;
+      }
+    if (_param._have_pht)
+      {
+    delete []  in_PREDICT_PHT_ACK    ;
+    delete [] out_PREDICT_PHT_ADDRESS;
+      }
+    if (_param._have_bht and _param._have_pht)
+    delete []  in_PREDICT_BHT_HISTORY;
+    
+    delete [] out_PREDICT_ACK        ;
+    delete []  in_PREDICT_ADDRESS    ;
+
+    if (_param._have_bht)
+      {
+    delete []  in_BRANCH_COMPLETE_BHT_ACK    ;
+    delete [] out_BRANCH_COMPLETE_BHT_ADDRESS;
+      }
+    if (_param._have_pht)
+      {
+    delete []  in_BRANCH_COMPLETE_PHT_ACK    ;
+    delete [] out_BRANCH_COMPLETE_PHT_ADDRESS;
+      }
+    if (_param._have_bht and _param._have_pht)
+    delete []  in_BRANCH_COMPLETE_BHT_HISTORY;
+    delete [] out_BRANCH_COMPLETE_ACK        ;
+    delete []  in_BRANCH_COMPLETE_ADDRESS    ;
+
+    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
+    delete _component;
+
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"deallocation","End");
+  };
+
+}; // end namespace two_level_branch_predictor_glue
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_genMealy_branch_complete_ack.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_genMealy_branch_complete_ack.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_genMealy_branch_complete_ack.cpp	(revision 46)
@@ -0,0 +1,43 @@
+#ifdef SYSTEMC
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Two_Level_Branch_Predictor_Glue.h"
+#include "Common/include/BitManipulation.h"
+
+namespace morpheo {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace two_level_branch_predictor_glue {
+
+  void Two_Level_Branch_Predictor_Glue::genMealy_branch_complete_ack (void)
+  {
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"genMealy_branch_complete_ack","Begin");
+
+    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+      {
+	// Ackwnolegde
+	bool bht_ack = (not _param._have_bht) or PORT_READ(in_BRANCH_COMPLETE_BHT_ACK [i]);
+	bool pht_ack = (not _param._have_pht) or PORT_READ(in_BRANCH_COMPLETE_PHT_ACK [i]);		  
+
+	PORT_WRITE (out_BRANCH_COMPLETE_ACK [i], bht_ack and pht_ack);
+      }
+
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"genMealy_branch_complete_ack","End");
+  };
+
+}; // end namespace two_level_branch_predictor_glue
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_genMealy_branch_complete_bht_address.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_genMealy_branch_complete_bht_address.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_genMealy_branch_complete_bht_address.cpp	(revision 46)
@@ -0,0 +1,43 @@
+#ifdef SYSTEMC
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Two_Level_Branch_Predictor_Glue.h"
+#include "Common/include/BitManipulation.h"
+
+namespace morpheo {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace two_level_branch_predictor_glue {
+
+  void Two_Level_Branch_Predictor_Glue::genMealy_branch_complete_bht_address (void)
+  {
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"genMealy_branch_complete_address","Begin");
+
+    if (_param._have_bht)
+      for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+	{
+	  // Address
+	  Taddress_t address = PORT_READ(in_BRANCH_COMPLETE_ADDRESS [i]);
+	  
+	  PORT_WRITE (out_BRANCH_COMPLETE_BHT_ADDRESS [i], range<Taddress_t>(_param._size_address, address, _param._bht_size_address));
+	}
+    
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"genMealy_branch_complete_address","End");
+  };
+
+}; // end namespace two_level_branch_predictor_glue
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/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/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_genMealy_branch_complete_pht_address.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_genMealy_branch_complete_pht_address.cpp	(revision 46)
@@ -0,0 +1,54 @@
+#ifdef SYSTEMC
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Two_Level_Branch_Predictor_Glue.h"
+#include "Common/include/BitManipulation.h"
+
+namespace morpheo {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace two_level_branch_predictor_glue {
+
+  void Two_Level_Branch_Predictor_Glue::genMealy_branch_complete_pht_address (void)
+  {
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"genMealy_branch_complete_address","Begin");
+
+    if (_param._have_pht)
+      for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+	{
+	  // Address
+	  Taddress_t     address = PORT_READ(in_BRANCH_COMPLETE_ADDRESS [i]);
+	  Tbht_history_t history = 0;
+	  
+	  if (_param._have_bht)
+	    {
+	      history = PORT_READ (in_BRANCH_COMPLETE_BHT_HISTORY [i]);
+	      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], pht_address);
+	}
+    
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"genMealy_branch_complete_address","End");
+  };
+
+}; // end namespace two_level_branch_predictor_glue
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_genMealy_predict_ack.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_genMealy_predict_ack.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_genMealy_predict_ack.cpp	(revision 46)
@@ -0,0 +1,43 @@
+#ifdef SYSTEMC
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Two_Level_Branch_Predictor_Glue.h"
+#include "Common/include/BitManipulation.h"
+
+namespace morpheo {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace two_level_branch_predictor_glue {
+
+  void Two_Level_Branch_Predictor_Glue::genMealy_predict_ack (void)
+  {
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"genMealy_predict_ack","Begin");
+
+    for (uint32_t i=0; i<_param._nb_prediction; i++)
+      {
+	// Ackwnolegde
+	bool bht_ack = (not _param._have_bht) or PORT_READ(in_PREDICT_BHT_ACK [i]);
+	bool pht_ack = (not _param._have_pht) or PORT_READ(in_PREDICT_PHT_ACK [i]);		  
+
+	PORT_WRITE (out_PREDICT_ACK [i], bht_ack and pht_ack);
+      }
+
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"genMealy_predict_ack","End");
+  };
+
+}; // end namespace two_level_branch_predictor_glue
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/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/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_genMealy_predict_bht_address.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_genMealy_predict_bht_address.cpp	(revision 46)
@@ -0,0 +1,44 @@
+#ifdef SYSTEMC
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Two_Level_Branch_Predictor_Glue.h"
+#include "Common/include/BitManipulation.h"
+
+namespace morpheo {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace two_level_branch_predictor_glue {
+
+  void Two_Level_Branch_Predictor_Glue::genMealy_predict_bht_address (void)
+  {
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"genMealy_predict_address","Begin");
+
+    if (_param._have_bht)
+      for (uint32_t i=0; i<_param._nb_prediction; i++)
+	{
+	  // Address
+	  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], bht_address);
+	}
+    
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"genMealy_predict_address","End");
+  };
+
+}; // end namespace two_level_branch_predictor_glue
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_genMealy_predict_pht_address.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_genMealy_predict_pht_address.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_genMealy_predict_pht_address.cpp	(revision 46)
@@ -0,0 +1,50 @@
+#ifdef SYSTEMC
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Two_Level_Branch_Predictor_Glue.h"
+#include "Common/include/BitManipulation.h"
+
+namespace morpheo {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace two_level_branch_predictor_glue {
+
+  void Two_Level_Branch_Predictor_Glue::genMealy_predict_pht_address (void)
+  {
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"genMealy_predict_address","Begin");
+
+    if (_param._have_pht)
+      for (uint32_t i=0; i<_param._nb_prediction; i++)
+	{
+	  // Address
+	  Taddress_t address = PORT_READ(in_PREDICT_ADDRESS [i]);
+	  Tbht_history_t history = 0;
+	  
+	  if (_param._have_bht)
+	    {
+	      history = PORT_READ (in_PREDICT_BHT_HISTORY [i]);
+	      address = address << _param._pht_size_address_shift;
+	    }
+	  
+	  PORT_WRITE (out_PREDICT_PHT_ADDRESS [i], (history xor address) & gen_mask<Taddress_t>(_param._pht_size_address));
+	}
+    
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"genMealy_predict_address","End");
+  };
+
+}; // end namespace two_level_branch_predictor_glue
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_statistics.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_statistics.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_statistics.cpp	(revision 46)
@@ -0,0 +1,39 @@
+#ifdef STATISTICS
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Two_Level_Branch_Predictor_Glue.h"
+
+namespace morpheo {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace two_level_branch_predictor_glue {
+
+
+  string Two_Level_Branch_Predictor_Glue::statistics (uint32_t depth)
+  {
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"statistics","Begin");
+
+    string txt = _stat->print(depth);
+    
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"statistics","End");
+
+    return txt;
+  };
+
+}; // end namespace two_level_branch_predictor_glue
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_transition.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_transition.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_transition.cpp	(revision 46)
@@ -0,0 +1,45 @@
+#ifdef SYSTEMC
+#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Two_Level_Branch_Predictor_Glue.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace two_level_branch_predictor_glue {
+
+
+  void Two_Level_Branch_Predictor_Glue::transition (void)
+  {
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"transition","Begin");
+
+#ifdef STATISTICS
+    _stat->add();
+#endif    
+
+#ifdef VHDL_TESTBENCH
+    vhdl_testbench_transition ();
+#endif
+
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"transition","End");
+  };
+
+}; // end namespace two_level_branch_predictor_glue
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_vhdl.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_vhdl.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_vhdl.cpp	(revision 46)
@@ -0,0 +1,49 @@
+#ifdef VHDL
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Two_Level_Branch_Predictor_Glue.h"
+#include "Behavioural/include/Vhdl.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace two_level_branch_predictor_glue {
+
+
+  void Two_Level_Branch_Predictor_Glue::vhdl (void)
+  {
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"vhdl","Begin");
+    
+    Vhdl * vhdl = new Vhdl (_name);
+
+    _interfaces->set_port     (vhdl);
+    _component ->vhdl_instance(vhdl);
+
+    vhdl_declaration (vhdl);
+    vhdl_body        (vhdl);
+
+    vhdl->generate_file();
+
+    delete vhdl;
+
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"vhdl","End");
+
+  };
+
+}; // end namespace two_level_branch_predictor_glue
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_vhdl_body.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_vhdl_body.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_vhdl_body.cpp	(revision 46)
@@ -0,0 +1,160 @@
+#ifdef VHDL
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Two_Level_Branch_Predictor_Glue.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace two_level_branch_predictor_glue {
+
+
+  void Two_Level_Branch_Predictor_Glue::vhdl_body (Vhdl * & vhdl)
+  {
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"vhdl_body","Begin");
+
+    vhdl->set_body ("-- ack output");
+    for (uint32_t i=0; i<_param._nb_prediction; i++)
+      {
+	string bht_ack, pht_ack;
+
+	if (_param._have_bht)
+	  bht_ack = "in_PREDICT_"+toString(i)+"_BHT_ACK";
+	else
+	  bht_ack = "'1'";
+
+	if (_param._have_pht)
+	  pht_ack = "in_PREDICT_"+toString(i)+"_PHT_ACK";
+	else
+	  pht_ack = "'1'";
+
+	vhdl->set_body ("out_PREDICT_"+toString(i)+"_ACK         <= "+bht_ack+" and "+pht_ack+";");
+      }
+
+    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+      {
+	string bht_ack, pht_ack;
+
+	if (_param._have_bht)
+	  bht_ack = "in_BRANCH_COMPLETE_"+toString(i)+"_BHT_ACK";
+	else
+	  bht_ack = "'1'";
+
+	if (_param._have_pht)
+	  pht_ack = "in_BRANCH_COMPLETE_"+toString(i)+"_PHT_ACK";
+	else
+	  pht_ack = "'1'";
+
+	vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_ACK <= "+bht_ack+" and "+pht_ack+";");
+      }
+    
+    vhdl->set_body ("");
+    vhdl->set_body ("-- address output");
+
+    for (uint32_t i=0; i<_param._nb_prediction; i++)
+      {
+	// The address is higher than the address size of bht
+	if (_param._have_bht)
+	  vhdl->set_body ("out_PREDICT_"+toString(i)+"_BHT_ADDRESS <= in_PREDICT_"+toString(i)+"_ADDRESS"+std_logic_range(_param._bht_size_address)+";");
+
+	if (_param._have_pht)
+	  {
+	    // For pht : 2 cases
+	    if (_param._have_bht)
+	      {
+		uint32_t min = 0;
+		uint32_t max = _param._pht_size_address;
+
+		// A lot of case :
+		//
+		//      pht_size_addr
+		// addr             bht_history
+		//
+		// ---------] |
+		//            |[---------
+		//
+		// -----------|----]               share
+		//            |  [-------
+		//
+		// -----------|----]            no share
+		//            |     [-----
+		//
+		
+		// Test if address is share 
+		if (_param._pht_size_address_shift > 0)
+		  {
+		    min = _param._pht_size_address_shift;
+		    vhdl->set_body ("out_PREDICT_"+toString(i)+"_PHT_ADDRESS"+std_logic_range(min) + " <=  in_PREDICT_"+toString(i)+"_BHT_HISTORY"+std_logic_range(min)+";");
+		  }
+
+		if (_param._bht_size_history < _param._pht_size_address)
+		  {
+		    max = _param._bht_size_history;
+		    vhdl->set_body ("out_PREDICT_"+toString(i)+"_PHT_ADDRESS"+std_logic_range(_param._pht_size_address-1,max) + " <=  in_PREDICT_"+toString(i)+"_ADDRESS"+std_logic_range(_param._pht_size_address-1-_param._pht_size_address_shift, _param._pht_size_address_share)+";");
+		  }
+		
+		// intersection
+		if (_param._pht_size_address_share > 0)
+		  vhdl->set_body ("out_PREDICT_"+toString(i)+"_PHT_ADDRESS"+std_logic_range(max-1,min) + " <=  in_PREDICT_"+toString(i)+"_ADDRESS"+std_logic_range(_param._pht_size_address_share-1,0)+" xor in_PREDICT_"+toString(i)+"_BHT_HISTORY"+std_logic_range(max-1,min)+";");
+	      }
+	    else
+	      vhdl->set_body ("out_PREDICT_"+toString(i)+"_PHT_ADDRESS <=  in_PREDICT_"+toString(i)+"_ADDRESS"+std_logic_range(_param._pht_size_address)+";");
+	  }
+      }
+
+    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+      {
+	// The address is higher than the address size of bht
+	if (_param._have_bht)
+	  vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_BHT_ADDRESS <= in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"+std_logic_range(_param._bht_size_address)+";");
+
+	if (_param._have_pht)
+	  {
+	    // For pht : 2 cases
+	    if (_param._have_bht)
+	      {
+		uint32_t min = 0;
+		uint32_t max = _param._pht_size_address;
+
+		// Test if address is share 
+		if (_param._pht_size_address_shift > 0)
+		  {
+		    min = _param._pht_size_address_shift;
+		    vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_PHT_ADDRESS"+std_logic_range(min) + " <=  in_BRANCH_COMPLETE_"+toString(i)+"_BHT_HISTORY"+std_logic_range(min)+";");
+		  }
+
+		if (_param._bht_size_history < _param._pht_size_address)
+		  {
+		    max = _param._bht_size_history;
+		    vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_PHT_ADDRESS"+std_logic_range(_param._pht_size_address-1,max) + " <=  in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"+std_logic_range(_param._pht_size_address-1-_param._pht_size_address_shift, _param._pht_size_address_share)+";");
+		  }
+		
+		// intersection
+		if (_param._pht_size_address_share > 0)
+		  vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_PHT_ADDRESS"+std_logic_range(max-1,min) + " <=  in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"+std_logic_range(_param._pht_size_address_share-1,0)+" xor in_BRANCH_COMPLETE_"+toString(i)+"_BHT_HISTORY"+std_logic_range(max-1,min)+";");
+	      }
+	    else
+	      vhdl->set_body ("out_BRANCH_COMPLETE_"+toString(i)+"_PHT_ADDRESS <=  in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"+std_logic_range(_param._pht_size_address)+";");
+	  }
+      }
+
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"vhdl_body","End");
+  };
+
+}; // end namespace two_level_branch_predictor_glue
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_vhdl_declaration.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_vhdl_declaration.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_vhdl_declaration.cpp	(revision 46)
@@ -0,0 +1,34 @@
+#ifdef VHDL
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Two_Level_Branch_Predictor_Glue.h"
+
+namespace morpheo {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace two_level_branch_predictor_glue {
+
+
+  void Two_Level_Branch_Predictor_Glue::vhdl_declaration (Vhdl * & vhdl)
+  {
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"vhdl_declaration","Begin");
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"vhdl_declaration","End");
+  };
+
+}; // end namespace two_level_branch_predictor_glue
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_vhdl_testbench_transition.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_vhdl_testbench_transition.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/src/Two_Level_Branch_Predictor_Glue_vhdl_testbench_transition.cpp	(revision 46)
@@ -0,0 +1,39 @@
+#ifdef VHDL_TESTBENCH
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Two_Level_Branch_Predictor_Glue.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+namespace two_level_branch_predictor_glue {
+
+
+  void Two_Level_Branch_Predictor_Glue::vhdl_testbench_transition ()
+  {
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"vhdl_testbench_transition","Begin");
+
+//     sc_start(0);
+
+    _interfaces->testbench();
+
+    log_printf(FUNC,Two_Level_Branch_Predictor_Glue,"vhdl_testbench_transition","End");
+  };
+
+}; // end namespace two_level_branch_predictor_glue
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/VERSION
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/VERSION	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/VERSION	(revision 46)
@@ -0,0 +1,1 @@
+v0.2
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/doc/Makefile
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/doc/Makefile	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/doc/Makefile	(revision 46)
@@ -0,0 +1,19 @@
+# 
+# $Id$
+# 
+# [ Description ]
+# 
+# Makefile
+# 
+
+#-----[ Directory ]----------------------------------------
+DIR_COMPONENT			= ..
+include				$(DIR_COMPONENT)/Makefile.defs
+
+#-----[ include ]------------------------------------------
+
+all				:
+				$(MAKE) all_documentation
+
+include				$(DIR_MORPHEO)/Behavioural/Makefile.Common
+include				$(DIR_MORPHEO)/Behavioural/Makefile.Documentation
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/doc/Two_Level_Branch_Predictor.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/doc/Two_Level_Branch_Predictor.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/doc/Two_Level_Branch_Predictor.tex	(revision 46)
@@ -0,0 +1,38 @@
+\documentclass[10pt,a4paper,twocolumn]{article}
+
+\def\dirdoc{tex}
+\def\dirschema{eps}
+
+% Package de variables d'environnement : Titre, command etc ...
+\usepackage{../../../../../../Behavioural/doc/sty/doc-style}
+\usepackage{sty/header}
+
+
+%------------------------------------------------------------------------------
+% Début document
+%------------------------------------------------------------------------------
+
+\pagestyle{empty}
+
+\begin{document}
+
+% Créez une page de titre
+\maketitle
+\thispagestyle{empty}
+
+%Table des matières et des figures
+%\tableofcontents
+%\newpage
+%\listoffigures
+
+%------------------------------------------------------------------------------
+% Ajout du corps du documents
+%------------------------------------------------------------------------------
+
+\input{tex/root}
+
+%------------------------------------------------------------------------------
+% Fin d'ajout du corps du document
+%------------------------------------------------------------------------------
+
+\end{document}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/doc/sty/header.sty
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/doc/sty/header.sty	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/doc/sty/header.sty	(revision 46)
@@ -0,0 +1,12 @@
+\def\review{YYYY/MM/DD}
+%\def\review{\number\day/\number\month/\number\year\xspace}
+
+\title{Two\_Level\_Branch\_Predictor}
+ 
+\author{}
+
+\affiliation{}
+
+\email{}
+
+\date{\review}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/doc/tex/01_introduction.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/doc/tex/01_introduction.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/doc/tex/01_introduction.tex	(revision 46)
@@ -0,0 +1,1 @@
+\Section{Introduction}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/doc/tex/02_features.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/doc/tex/02_features.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/doc/tex/02_features.tex	(revision 46)
@@ -0,0 +1,1 @@
+\Section{Features}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/doc/tex/03_description.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/doc/tex/03_description.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/doc/tex/03_description.tex	(revision 46)
@@ -0,0 +1,1 @@
+\Section{Functional Description}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/doc/tex/04_pinout.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/doc/tex/04_pinout.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/doc/tex/04_pinout.tex	(revision 46)
@@ -0,0 +1,1 @@
+\Section{Pin out}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/doc/tex/05_parameters.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/doc/tex/05_parameters.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/doc/tex/05_parameters.tex	(revision 46)
@@ -0,0 +1,1 @@
+\Section{Parameters}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/doc/tex/06_performance.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/doc/tex/06_performance.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/doc/tex/06_performance.tex	(revision 46)
@@ -0,0 +1,1 @@
+\Section{Performance}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/doc/tex/07_details.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/doc/tex/07_details.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/doc/tex/07_details.tex	(revision 46)
@@ -0,0 +1,1 @@
+\Section{Details}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/doc/tex/08_history.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/doc/tex/08_history.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/doc/tex/08_history.tex	(revision 46)
@@ -0,0 +1,10 @@
+\Section{Revision History}
+
+\begin{tabular}{|c|c|c|}
+\hline
+Revision Date & By  & Modifications\\
+\hline
+\hline
+yyyy/mm/dd    & xxx & Initial document \\
+\hline
+\end{tabular}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/doc/tex/root.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/doc/tex/root.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/doc/tex/root.tex	(revision 46)
@@ -0,0 +1,8 @@
+\input{\dirdoc/01_introduction}
+\input{\dirdoc/02_features}
+\input{\dirdoc/03_description}
+\input{\dirdoc/04_pinout}
+\input{\dirdoc/05_parameters}
+\input{\dirdoc/06_performance}
+\input{\dirdoc/07_details}
+\input{\dirdoc/08_history}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/include/Parameters.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/include/Parameters.h	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/include/Parameters.h	(revision 46)
@@ -0,0 +1,77 @@
+#ifndef morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_two_level_branch_predictor_Parameters_h
+#define morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_two_level_branch_predictor_Parameters_h
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Common/include/Debug.h"
+#include "Behavioural/include/Parameters.h"
+// Internal structure
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Parameters.h"
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Parameters.h"
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Parameters.h"
+#include <math.h>
+
+namespace morpheo {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+
+
+  class Parameters : public morpheo::behavioural::Parameters
+  {
+    //-----[ fields ]------------------------------------------------------------
+  public : const bool     _have_bht              ;
+  public : const uint32_t _bht_size_shifter      ;
+  public : const uint32_t _bht_nb_shifter        ;
+  public : const bool     _have_pht              ;
+  public : const uint32_t _pht_size_counter      ;
+  public : const uint32_t _pht_nb_counter        ;
+  public : const uint32_t _pht_size_address_share;
+  public : const uint32_t _size_address          ;
+  public : const uint32_t _nb_prediction         ;
+  public : const uint32_t _nb_branch_complete    ;
+    
+  public : const uint32_t _bht_size_address  ;
+  public : const uint32_t _pht_size_address  ;
+
+  public :       morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::branch_history_table ::Parameters * _param_branch_history_table;
+  public :       morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::pattern_history_table::Parameters * _param_pattern_history_table;
+  public :       morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::two_level_branch_predictor_glue::Parameters * _param_two_level_branch_predictor_glue;
+
+    //-----[ methods ]-----------------------------------------------------------
+  public : Parameters  (bool     have_bht              ,
+			uint32_t bht_size_shifter      ,
+			uint32_t bht_nb_shifter        ,
+			bool     have_pht              ,
+			uint32_t pht_size_counter      ,
+			uint32_t pht_nb_counter        ,
+			uint32_t pht_size_address_share,
+			uint32_t size_address          ,
+			uint32_t nb_prediction         ,
+			uint32_t nb_branch_complete    );
+
+  public : Parameters  (Parameters & param) ;
+  public : ~Parameters () ;
+
+  public : string msg_error (void);
+
+  public :        string   print      (uint32_t depth);
+  public : friend ostream& operator<< (ostream& output_stream,
+				       morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Parameters & x);
+  };
+
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+}; // end namespace behavioural
+}; // end namespace morpheo              
+
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/include/Statistics.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/include/Statistics.h	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/include/Statistics.h	(revision 46)
@@ -0,0 +1,66 @@
+#ifdef STATISTICS
+#ifndef morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_two_level_branch_predictor_Statistics_h
+#define morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_two_level_branch_predictor_Statistics_h
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Common/include/Debug.h"
+// Internal structure
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Statistics.h"
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Statistics.h"
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Statistics.h"
+#include "Behavioural/include/Statistics.h"
+#include "Behavioural/include/Parameters_Statistics.h"
+//#include "Behavioural/Generic/Group/include/Statistics.h"
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/include/Parameters.h"
+
+//using namespace morpheo::behavioural::generic::group;
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+
+
+  class Statistics : public morpheo::behavioural::Statistics
+  {
+    // -----[ fields ]----------------------------------------------------
+  private  : const Parameters                                   _parameters;
+
+    // -----[ methods ]---------------------------------------------------
+  public   : Statistics  (string                                      name                       ,
+			  morpheo::behavioural::Parameters_Statistics parameters_statistics      ,
+			  Parameters                                  parameters
+			  );
+//public   : Statistics  (Statistics & stat);
+  public   : ~Statistics () ;
+    
+  public   : string   print_body (uint32_t depth);
+  public   : string   print      (uint32_t depth);
+  public   : string   print      (uint32_t depth,
+				  string   component_stat
+				  );
+  public   : void     add        ();
+
+  public   : friend ostream& operator<< (ostream& output_stream,
+					 const Statistics & x);
+
+  };
+
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo
+
+#endif
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/include/Two_Level_Branch_Predictor.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/include/Two_Level_Branch_Predictor.h	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/include/Two_Level_Branch_Predictor.h	(revision 46)
@@ -0,0 +1,153 @@
+#ifndef morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_two_level_branch_predictor_Two_Level_Branch_Predictor_h
+#define morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_two_level_branch_predictor_Two_Level_Branch_Predictor_h
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#ifdef SYSTEMC
+#include "systemc.h"
+#endif
+
+#include <iostream>
+#include "Common/include/ToString.h"
+#include "Common/include/Debug.h"
+
+// Internal structure
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Branch_History_Table.h"
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Pattern_History_Table.h"
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Two_Level_Branch_Predictor_Glue.h"
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/include/Parameters.h"
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/include/Types.h"
+#ifdef STATISTICS
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/include/Statistics.h"
+#endif
+#ifdef VHDL
+#include "Behavioural/include/Vhdl.h"
+#endif
+#include "Behavioural/include/Component.h"
+
+using namespace std;
+
+namespace morpheo {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+
+
+  class Two_Level_Branch_Predictor 
+#if SYSTEMC
+    : public sc_module
+#endif
+  {
+    // -----[ fields ]----------------------------------------------------
+    // Parameters
+  protected : const string     _name;
+
+  protected : const Parameters _param;
+#ifdef STATISTICS
+ protected : const morpheo::behavioural::Parameters_Statistics _param_statistics;
+#endif
+
+#ifdef STATISTICS
+  private   : Statistics                     * _stat;
+#endif
+
+  public    : Component                      * _component;
+  private   : Interfaces                     * _interfaces;
+
+#ifdef SYSTEMC
+    // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+    // Interface
+  public    : SC_CLOCK                      *  in_CLOCK                      ;
+  public    : SC_IN (Tcontrol_t)            *  in_NRESET                     ;
+    // Interface Predict
+  public    : SC_IN (Tcontrol_t)           **  in_PREDICT_VAL                ;
+  public    : SC_OUT(Tcontrol_t)           ** out_PREDICT_ACK                ;
+  public    : SC_IN (Taddress_t)           **  in_PREDICT_ADDRESS            ;
+  public    : SC_OUT(Tbht_history_t)       ** out_PREDICT_BHT_HISTORY        ;
+  public    : SC_OUT(Tpht_history_t)       ** out_PREDICT_PHT_HISTORY        ;
+			
+    // Interface Branch_complete
+  public    : SC_IN (Tcontrol_t)           **  in_BRANCH_COMPLETE_VAL        ;
+  public    : SC_OUT(Tcontrol_t)           ** out_BRANCH_COMPLETE_ACK        ;
+  public    : SC_IN (Taddress_t)           **  in_BRANCH_COMPLETE_ADDRESS    ;
+  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_DIRECTION  ;
+
+    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
+
+    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  private   : SC_SIGNAL(Tcontrol_t)        ** signal_PREDICT_BHT_ACK            ;
+  private   : SC_SIGNAL(Tcontrol_t)        ** signal_PREDICT_PHT_ACK            ;
+  private   : SC_SIGNAL(Taddress_t)        ** signal_PREDICT_BHT_ADDRESS        ;
+  private   : SC_SIGNAL(Taddress_t)        ** signal_PREDICT_PHT_ADDRESS        ;
+
+  private   : SC_SIGNAL(Tcontrol_t)        ** signal_BRANCH_COMPLETE_BHT_ACK    ;
+  private   : SC_SIGNAL(Tcontrol_t)        ** signal_BRANCH_COMPLETE_PHT_ACK    ;
+  private   : SC_SIGNAL(Taddress_t)        ** signal_BRANCH_COMPLETE_BHT_ADDRESS; 
+  private   : SC_SIGNAL(Taddress_t)        ** signal_BRANCH_COMPLETE_PHT_ADDRESS;
+#endif
+
+    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
+  protected : morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::branch_history_table ::Branch_History_Table  * component_Branch_History_Table;
+  protected : morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::pattern_history_table::Pattern_History_Table * component_Pattern_History_Table;
+  protected : morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::two_level_branch_predictor_glue::Two_Level_Branch_Predictor_Glue * component_Two_Level_Branch_Predictor_Glue;
+
+    // -----[ methods ]---------------------------------------------------
+
+#ifdef SYSTEMC
+    SC_HAS_PROCESS (Two_Level_Branch_Predictor);
+#endif					       
+  public  :          Two_Level_Branch_Predictor              (
+#ifdef SYSTEMC
+							      sc_module_name                              name,
+#else					       
+							      string                                      name,
+#endif					       
+#ifdef STATISTICS
+							      morpheo::behavioural::Parameters_Statistics param_statistics,
+#endif
+							      Parameters                                  param );
+							      
+  public  :          Two_Level_Branch_Predictor              (Parameters param );
+  public  :          ~Two_Level_Branch_Predictor             (void);
+					       
+#ifdef SYSTEMC				       
+  private : void     allocation                (void);
+  private : void     deallocation              (void);
+					       
+#if (defined(STATISTICS) || defined (VHDL_TESTBENCH))
+  public  : void     transition                (void);
+#endif
+#endif					       
+#ifdef STATISTICS
+  public  : string   statistics                (uint32_t depth);
+#endif
+					       
+#if VHDL				       
+  public  : void     vhdl                      (void);
+  private : void     vhdl_declaration          (Vhdl * & vhdl);
+  private : void     vhdl_body                 (Vhdl * & vhdl);
+#endif					       
+#ifdef VHDL_TESTBENCH			       
+  private : void     vhdl_testbench_transition (void);
+#endif
+  };
+
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/include/Types.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/include/Types.h	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/include/Types.h	(revision 46)
@@ -0,0 +1,33 @@
+#ifdef SYSTEMC
+#ifndef morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_two_level_branch_predictor_Type_h
+#define morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_two_level_branch_predictor_Type_h
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Common/include/Types.h"
+
+namespace morpheo {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+
+  typedef uint32_t Taddress_t    ;
+  typedef uint32_t Tbht_history_t;
+  typedef uint32_t Tpht_history_t;
+
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+}; // end namespace behavioural
+}; // end namespace morpheo              
+
+#endif
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Parameters.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Parameters.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Parameters.cpp	(revision 46)
@@ -0,0 +1,129 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/include/Parameters.h"
+
+namespace morpheo {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+
+
+  Parameters::Parameters (bool     have_bht              ,
+			  uint32_t bht_size_shifter      ,
+			  uint32_t bht_nb_shifter        ,
+			  bool     have_pht              ,
+			  uint32_t pht_size_counter      ,
+			  uint32_t pht_nb_counter        ,
+			  uint32_t pht_size_address_share,
+			  uint32_t size_address          ,
+			  uint32_t nb_prediction         ,
+			  uint32_t nb_branch_complete    ) : 
+    _have_bht               (have_bht          ),
+    _bht_size_shifter       ((_have_bht == true)?bht_size_shifter:0),
+    _bht_nb_shifter         ((_have_bht == true)?bht_nb_shifter  :0),
+    _have_pht               (have_pht          ),
+    _pht_size_counter       ((_have_pht == true)?pht_size_counter:0),
+    _pht_nb_counter         ((_have_pht == true)?pht_nb_counter  :0),
+    _pht_size_address_share (((_have_bht and _have_pht) == true)?pht_size_address_share:0),
+    _size_address           (size_address      ),
+    _nb_prediction          (nb_prediction     ),
+    _nb_branch_complete     (nb_branch_complete),
+    _bht_size_address       (static_cast<uint32_t>(ceil(log2(bht_nb_shifter)))),
+    _pht_size_address       (static_cast<uint32_t>(ceil(log2(pht_nb_counter))))
+  {
+    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    ,
+																				       _nb_prediction     ,
+																				       _nb_branch_complete);
+    
+                                                     
+    _param_two_level_branch_predictor_glue = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::two_level_branch_predictor_glue::Parameters (_have_bht              ,
+																							   _bht_size_shifter      ,
+																							   _bht_size_address      ,
+																							   _have_pht              ,
+																							   _pht_size_address      ,
+																							   _pht_size_address_share,
+																							   _size_address          ,
+																							   _nb_prediction         ,
+																							   _nb_branch_complete    );
+
+    test();
+    log_printf(FUNC,Two_Level_Branch_Predictor,"Parameters","End");
+  };
+  
+  Parameters::Parameters (Parameters & param) :
+    _have_bht               (param._have_bht              ),
+    _bht_size_shifter       (param._bht_size_shifter      ),
+    _bht_nb_shifter         (param._bht_nb_shifter        ),
+    _have_pht               (param._have_pht              ),
+    _pht_size_counter       (param._pht_size_counter      ),
+    _pht_nb_counter         (param._pht_nb_counter        ),
+    _pht_size_address_share (param._pht_size_address_share),
+    _size_address           (param._size_address          ),
+    _nb_prediction          (param._nb_prediction         ),
+    _nb_branch_complete     (param._nb_branch_complete    ),
+    _bht_size_address       (param._bht_size_address      ),
+    _pht_size_address       (param._pht_size_address      )
+
+  {
+    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    ,
+																				       _nb_prediction     ,
+																				       _nb_branch_complete);
+
+    _param_two_level_branch_predictor_glue = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::two_level_branch_predictor_glue::Parameters (_have_bht              ,
+																							   _bht_size_shifter      ,
+																							   _bht_size_address      ,
+																							   _have_pht              ,
+																							   _pht_size_address      ,
+																							   _pht_size_address_share,
+																							   _size_address          ,
+																							   _nb_prediction         ,
+																							   _nb_branch_complete    );
+
+    test();
+    log_printf(FUNC,Two_Level_Branch_Predictor,"Parameters","End");
+  };
+
+  Parameters::~Parameters () 
+  {
+    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;
+    log_printf(FUNC,Two_Level_Branch_Predictor,"~Parameters","End");
+  };
+
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Parameters_msg_error.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Parameters_msg_error.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Parameters_msg_error.cpp	(revision 46)
@@ -0,0 +1,84 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/include/Parameters.h"
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/include/Types.h"
+#include <sstream>
+using namespace std;
+
+namespace morpheo {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+
+  string Parameters::msg_error(void)
+  {
+    log_printf(FUNC,Two_Level_Branch_Predictor,"msg_error","Begin");
+
+    string msg = "";
+
+    if (is_positive (_nb_prediction) == false)
+      {
+	msg += "  - nb_prediction must be > 0\n";
+	msg += "    * nb_prediction                   : " + toString(_nb_prediction) + "\n";
+      }
+
+    if (is_positive (_nb_branch_complete) == false)
+      {
+	msg += "  - nb_branch_complete must be > 0\n";
+	msg += "    * nb_branch_complete              : " + toString(_nb_branch_complete) + "\n";
+      }
+
+    if ((_have_bht or _have_pht) == false)
+      {
+	msg += "  - you have no Branch History Table and no Pattern History Table. You need a less of a BHT or a PHT\n";
+	msg += "    * have_bht                        : " + toString(_have_bht) + "\n";
+	msg += "    * have_pht                        : " + toString(_have_pht) + "\n";
+      }
+
+    if ( _have_bht and (_size_address < _bht_size_address))
+      {
+	msg += "  - the address's size must to large to the number of shifter in the Branch History Table.\n";
+	msg += "    * size_address                    : " + toString(_size_address    ) + "\n";
+	msg += "    * have_bht                        : " + toString(_have_bht        ) + "\n";
+	msg += "    * bht_size_address                : " + toString(_bht_size_address) + "\n";
+	msg += "      * bht_nb_shifter                : " + toString(_bht_nb_shifter  ) + "\n";
+      }
+
+    if (_have_pht and ( (_size_address < _pht_size_address) or
+			(_have_bht and (_pht_size_address < _bht_size_address))))
+      {
+	msg += "  - the address's size concate with shifter_out must to large to the number of counter in the Pattern History Table.\n";
+	msg += "    * size_address                    : " + toString(_size_address    ) + "\n";
+	msg += "    * have_bht                        : " + toString(_have_bht        ) + "\n";
+	msg += "    * bht_size_address                : " + toString(_bht_size_address) + "\n";
+	msg += "      * bht_nb_shifter                : " + toString(_bht_nb_shifter  ) + "\n";
+	msg += "    * have_pht                        : " + toString(_have_bht        ) + "\n";
+	msg += "    * pht_size_address                : " + toString(_pht_size_address) + "\n";
+	msg += "      * pht_nb_counter                : " + toString(_pht_nb_counter  ) + "\n";
+      }
+
+//     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;
+
+    log_printf(FUNC,Two_Level_Branch_Predictor,"msg_error","End");
+  };
+
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+}; // end namespace behavioural
+}; // end namespace morpheo              
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Parameters_print.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Parameters_print.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Parameters_print.cpp	(revision 46)
@@ -0,0 +1,62 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/include/Parameters.h"
+#include <sstream>
+using namespace std;
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+
+
+  string Parameters::print (uint32_t depth)
+  {
+    log_printf(FUNC,Two_Level_Branch_Predictor,"print","Begin");
+
+    string tab = string(depth,'\t');
+    ostringstream msg;
+    msg << tab << "<two_level_branch_predictor>" << endl
+	<< tab << "\t<have bht               value=\"" << _have_bht               << "\" /> <!-- size bht : " << _bht_size_shifter * _bht_nb_shifter << " bits -->" << endl
+	<< tab << "\t<bht_size_shifter       value=\"" << _bht_size_shifter       << "\" />" << endl
+	<< tab << "\t<bht_nb_shifter         value=\"" << _bht_nb_shifter         << "\" />" << endl
+	<< tab << "\t<have pht               value=\"" << _have_pht               << "\" /> <!-- size pht : " << _pht_size_counter * _pht_nb_counter << " bits -->" << endl
+	<< tab << "\t<pht_size_counter       value=\"" << _pht_size_counter       << "\" />" << endl
+	<< tab << "\t<pht_nb_counter         value=\"" << _pht_nb_counter         << "\" />" << endl
+	<< tab << "\t<pht_size_address_share value=\"" << _pht_size_address_share << "\" />" << endl
+	<< tab << "\t<size_address           value=\"" << _size_address           << "\" />" << endl
+	<< tab << "\t<nb_prediction          value=\"" << _nb_prediction          << "\" />" << endl
+	<< tab << "\t<nb_branch_complete     value=\"" << _nb_branch_complete     << "\" />" << endl;
+    if (_have_bht)
+    msg << _param_branch_history_table ->print(depth+1);
+    if (_have_pht)
+    msg << _param_pattern_history_table->print(depth+1);
+    msg << _param_two_level_branch_predictor_glue->print(depth+1);
+    msg << tab << "</two_level_branch_predictor>" << endl;
+
+    log_printf(FUNC,Two_Level_Branch_Predictor,"print","End");
+    
+    return msg.str();
+  };
+
+  ostream& operator<< (ostream& output_stream ,
+		       morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Parameters & x)
+  {
+    output_stream << x.print(0);
+    
+    return output_stream;
+  };
+
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+}; // end namespace behavioural
+}; // end namespace morpheo              
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Statistics.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Statistics.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Statistics.cpp	(revision 46)
@@ -0,0 +1,44 @@
+#ifdef STATISTICS
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/include/Statistics.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+
+
+  Statistics::Statistics (string                                      name                       ,
+			  morpheo::behavioural::Parameters_Statistics parameters_statistics      ,
+			  Parameters                                  parameters
+			  ) :
+    morpheo::behavioural::Statistics(name                  ,
+				     parameters_statistics ),
+    _parameters(parameters)
+  {
+    log_printf(FUNC,Two_Level_Branch_Predictor,"Statistics","Begin");
+    log_printf(FUNC,Two_Level_Branch_Predictor,"Statistics","End");
+  };
+  
+  Statistics::~Statistics () 
+  { 
+    log_printf(FUNC,Two_Level_Branch_Predictor,"~Statistics","Begin");
+    log_printf(FUNC,Two_Level_Branch_Predictor,"~Statistics","End");
+  };
+
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Statistics_add.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Statistics_add.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Statistics_add.cpp	(revision 46)
@@ -0,0 +1,35 @@
+#ifdef STATISTICS
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/include/Statistics.h"
+
+#include <sstream>
+using namespace std;
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+
+
+  void Statistics::add ()
+  {
+    log_printf(FUNC,Two_Level_Branch_Predictor,"add","Begin");
+    log_printf(FUNC,Two_Level_Branch_Predictor,"add","End");
+  };
+
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Statistics_print.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Statistics_print.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Statistics_print.cpp	(revision 46)
@@ -0,0 +1,60 @@
+#ifdef STATISTICS
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/include/Statistics.h"
+
+#include <sstream>
+using namespace std;
+
+namespace morpheo {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+
+  string Statistics::print (uint32_t depth,
+			    string   component_stat
+			    )
+  {
+    log_printf(FUNC,Two_Level_Branch_Predictor,"print","Begin");
+
+    string        tab = string(depth,'\t');
+    ostringstream msg;
+
+    msg << tab << "<two_level_branch_predictor name=\"" << _name << "\" >" << endl
+        << print_body(depth+1)
+	<< component_stat
+	<< tab << "</two_level_branch_predictor>" << endl;
+    
+    log_printf(FUNC,Two_Level_Branch_Predictor,"print","End");
+
+    return msg.str();
+  };
+
+  string Statistics::print (uint32_t depth)
+  {
+    return print(depth,"");
+  };
+
+  ostream& operator<< (ostream& output_stream ,
+		       morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Statistics & x)
+  {
+    output_stream << x.print(0);
+
+    return output_stream;
+  };
+
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Statistics_print_body.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Statistics_print_body.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Statistics_print_body.cpp	(revision 46)
@@ -0,0 +1,43 @@
+#ifdef STATISTICS
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/include/Statistics.h"
+
+#include <sstream>
+using namespace std;
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+
+
+  string Statistics::print_body (uint32_t depth)
+  {
+    log_printf(FUNC,Two_Level_Branch_Predictor,"print_body","Begin");
+
+    string        tab = string(depth,'\t');
+    ostringstream msg;
+
+    msg << tab << "";
+    
+    log_printf(FUNC,Two_Level_Branch_Predictor,"print_body","End");
+
+    return msg.str();
+  };
+
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor.cpp	(revision 46)
@@ -0,0 +1,92 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/include/Two_Level_Branch_Predictor.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+
+
+#ifdef SYSTEMC
+  Two_Level_Branch_Predictor::Two_Level_Branch_Predictor (sc_module_name name,
+#else
+  Two_Level_Branch_Predictor::Two_Level_Branch_Predictor (string name,
+#endif
+#ifdef STATISTICS
+			      morpheo::behavioural::Parameters_Statistics             param_statistics,
+#endif
+			      morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Parameters param ):
+			      _name              (name)
+			      ,_param            (param)
+#ifdef STATISTICS
+			      ,_param_statistics (param_statistics)
+#endif
+  {
+    log_printf(FUNC,Two_Level_Branch_Predictor,"Two_Level_Branch_Predictor","Begin");
+
+#ifdef SYSTEMC
+    allocation ();
+#endif
+
+#ifdef STATISTICS
+    // Allocation of statistics
+    _stat = new Statistics (static_cast<string>(_name),
+			    param_statistics          ,
+			    param);
+#endif
+
+#ifdef VHDL
+    // generate the vhdl
+    vhdl();
+#endif
+
+#ifdef SYSTEMC
+#if (defined(STATISTICS) || defined (VHDL_TESTBENCH))
+    SC_METHOD (transition);
+    dont_initialize ();
+    sensitive_pos << *(in_CLOCK);
+#endif
+
+//     SC_METHOD (genMoore);
+//     dont_initialize ();
+//     sensitive_neg << *(in_CLOCK);
+
+#ifdef SYSTEMCASS_SPECIFIC
+    // List dependency information
+#endif    
+
+#endif
+    log_printf(FUNC,Two_Level_Branch_Predictor,"Two_Level_Branch_Predictor","End");
+  };
+  
+  Two_Level_Branch_Predictor::~Two_Level_Branch_Predictor (void)
+  {
+    log_printf(FUNC,Two_Level_Branch_Predictor,"~Two_Level_Branch_Predictor","Begin");
+
+#ifdef STATISTICS
+    _stat->generate_file(statistics(0));
+    
+    delete _stat;
+#endif
+
+#ifdef SYSTEMC
+    deallocation ();
+#endif
+
+    log_printf(FUNC,Two_Level_Branch_Predictor,"~Two_Level_Branch_Predictor","End");
+  };
+
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+}; // end namespace behavioural
+}; // end namespace morpheo              
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_allocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_allocation.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_allocation.cpp	(revision 46)
@@ -0,0 +1,303 @@
+#ifdef SYSTEMC
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/include/Two_Level_Branch_Predictor.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+
+  void Two_Level_Branch_Predictor::allocation (void)
+  {
+    log_printf(FUNC,Two_Level_Branch_Predictor,"allocation","Begin");
+
+    _component   = new Component ();
+
+    Entity * entity = _component->set_entity (_name                 
+					     ,"Two_Level_Branch_Predictor"
+#ifdef POSITION
+					     ,MIXTE
+#endif
+					      );
+    
+    _interfaces = entity->set_interfaces();
+
+    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+    {
+      Interface * interface = _interfaces->set_interface(""
+#ifdef POSITION
+							 , IN  
+							 , SOUTH
+							 , "Generalist interface"
+#endif
+							 );
+      
+      in_CLOCK              = interface->set_signal_clk              ("clock" ,1);
+      in_NRESET             = interface->set_signal_in  <Tcontrol_t> ("nreset",1,RESET_VHDL_YES);
+    }
+    
+    // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+     in_PREDICT_VAL                 = new SC_IN (Tcontrol_t)     * [_param._nb_prediction     ];
+    out_PREDICT_ACK                 = new SC_OUT(Tcontrol_t)     * [_param._nb_prediction     ];
+     in_PREDICT_ADDRESS             = new SC_IN (Taddress_t)     * [_param._nb_prediction     ];
+    if (_param._have_bht)
+    out_PREDICT_BHT_HISTORY         = new SC_OUT(Tbht_history_t) * [_param._nb_prediction     ];
+    if (_param._have_pht)
+    out_PREDICT_PHT_HISTORY         = new SC_OUT(Tpht_history_t) * [_param._nb_prediction     ];
+
+    for (uint32_t i=0; i<_param._nb_prediction; i++)
+      {
+	Interface_fifo * interface = _interfaces->set_interface("predict_"+toString(i)
+#ifdef POSITION
+								, IN  
+								, WEST
+								, "Interface Predict"
+#endif
+								);
+
+	 in_PREDICT_VAL                 [i] = interface->set_signal_valack_in            ("val"    , VAL);
+	out_PREDICT_ACK                 [i] = interface->set_signal_valack_out           ("ack"    , ACK);
+	 in_PREDICT_ADDRESS             [i] = interface->set_signal_in  <Taddress_t>     ("address", _param._size_address);
+	if (_param._have_bht)
+	out_PREDICT_BHT_HISTORY         [i] = interface->set_signal_out <Tbht_history_t> ("bht_history", _param._bht_size_shifter);
+	if (_param._have_pht)
+	out_PREDICT_PHT_HISTORY         [i] = interface->set_signal_out <Tpht_history_t> ("pht_history", _param._pht_size_counter);
+      }
+
+    // ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+     in_BRANCH_COMPLETE_VAL         = new SC_IN (Tcontrol_t)     * [_param._nb_branch_complete];
+    out_BRANCH_COMPLETE_ACK         = new SC_OUT(Tcontrol_t)     * [_param._nb_branch_complete];
+     in_BRANCH_COMPLETE_ADDRESS     = new SC_IN (Taddress_t)     * [_param._nb_branch_complete];
+    if (_param._have_bht)
+     in_BRANCH_COMPLETE_BHT_HISTORY = new SC_IN (Tbht_history_t) * [_param._nb_branch_complete];
+    if (_param._have_pht)
+     in_BRANCH_COMPLETE_PHT_HISTORY = new SC_IN (Tpht_history_t) * [_param._nb_branch_complete];
+     in_BRANCH_COMPLETE_DIRECTION   = new SC_IN (Tcontrol_t)     * [_param._nb_branch_complete];
+
+    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+      {
+	Interface_fifo * interface = _interfaces->set_interface("branch_complete_"+toString(i)
+#ifdef POSITION
+								, IN  
+								, EAST
+								, "Interface branch complete"
+#endif
+								);
+
+	 in_BRANCH_COMPLETE_VAL         [i] = interface->set_signal_valack_in            ("val"        , VAL);		   
+	out_BRANCH_COMPLETE_ACK         [i] = interface->set_signal_valack_out           ("ack"        , ACK);		   
+	 in_BRANCH_COMPLETE_ADDRESS     [i] = interface->set_signal_in  <Taddress_t    > ("address"    , _param._size_address);
+	if (_param._have_bht)
+	 in_BRANCH_COMPLETE_BHT_HISTORY [i] = interface->set_signal_in  <Tbht_history_t> ("bht_history", _param._bht_size_shifter);
+	if (_param._have_pht)
+	 in_BRANCH_COMPLETE_PHT_HISTORY [i] = interface->set_signal_in  <Tpht_history_t> ("pht_history", _param._pht_size_counter);
+	 in_BRANCH_COMPLETE_DIRECTION   [i] = interface->set_signal_in  <Tcontrol_t    > ("direction"  , 1);
+      }
+
+    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
+    string name_component;
+
+    // =====[ component_Branch_History_Table ]============================    
+    if (_param._have_bht)
+      {
+	name_component = _name+"_Branch_History_Table";
+	
+	component_Branch_History_Table = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::branch_history_table ::Branch_History_Table (name_component.c_str()
+#ifdef STATISTICS
+																						       ,_param_statistics
+#endif
+																						       ,*(_param._param_branch_history_table));
+	
+	_component->set_component (component_Branch_History_Table->_component
+#ifdef POSITION
+				   , 75
+				   , 25
+				   , 10
+				   , 10
+#endif
+				   );
+      }
+    
+    // =====[ component_Pattern_History_Table ]===========================    
+    if (_param._have_pht)
+      {
+	name_component = _name+"_Pattern_History_Table";
+	
+	component_Pattern_History_Table = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::pattern_history_table ::Pattern_History_Table (name_component.c_str()
+#ifdef STATISTICS
+																							  ,_param_statistics
+#endif
+																							  ,*(_param._param_pattern_history_table));
+	
+	_component->set_component (component_Pattern_History_Table->_component
+#ifdef POSITION
+				   , 75
+				   , 75
+				   , 10
+				   , 10
+#endif
+				   );
+      }
+
+    // =====[ component_Two_Level_Branch_Predictor_Glue ]=================
+
+    name_component = _name+"_Two_Level_Branch_Predictor_Glue";
+
+    component_Two_Level_Branch_Predictor_Glue = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::two_level_branch_predictor_glue::Two_Level_Branch_Predictor_Glue (name_component.c_str()
+#ifdef STATISTICS
+																										   ,_param_statistics
+#endif
+																										   ,*(_param._param_two_level_branch_predictor_glue));
+    
+    _component->set_component (component_Two_Level_Branch_Predictor_Glue->_component
+#ifdef POSITION
+			       , 50
+			       , 75
+			       , 10
+			       , 10
+#endif
+			       );
+    
+    // ~~~~~[ Component - Instanciation ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+    // =====[ component_Branch_History_Table - Instanciation ]============
+    if (_param._have_bht)
+      {
+#ifdef POSITION
+	_component->interface_map (_name+"_Branch_History_Table","",
+				   _name                        ,"");
+#endif
+	
+	_component->port_map(_name+"_Branch_History_Table", "in_CLOCK" , _name,"in_CLOCK" );
+	_component->port_map(_name+"_Branch_History_Table", "in_NRESET", _name,"in_NRESET");
+
+	for (uint32_t i=0; i<_param._nb_prediction; i++)
+	  {
+#ifdef POSITION
+	    _component->interface_map (_name+"_Branch_History_Table","predict_"+toString(i),
+				       _name                        ,"predict_"+toString(i));
+#endif
+	    _component->port_map(_name+"_Branch_History_Table", "in_PREDICT_"+toString(i)+"_VAL"    , _name                                   , "in_PREDICT_"+toString(i)+"_VAL"        );
+	    _component->port_map(_name+"_Branch_History_Table","out_PREDICT_"+toString(i)+"_ACK"    , _name+"_Two_Level_Branch_Predictor_Glue", "in_PREDICT_"+toString(i)+"_BHT_ACK"    );
+	    _component->port_map(_name+"_Branch_History_Table", "in_PREDICT_"+toString(i)+"_ADDRESS", _name+"_Two_Level_Branch_Predictor_Glue","out_PREDICT_"+toString(i)+"_BHT_ADDRESS");
+	    _component->port_map(_name+"_Branch_History_Table","out_PREDICT_"+toString(i)+"_HISTORY", _name                                   ,"out_PREDICT_"+toString(i)+"_BHT_HISTORY");
+	  }
+	
+	for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+	  {
+#ifdef POSITION
+	    _component->interface_map (_name+"_Branch_History_Table","branch_complete_"+toString(i),
+				       _name                        ,"branch_complete_"+toString(i));
+#endif
+	    _component->port_map(_name+"_Branch_History_Table", "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"      , _name                                   , "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"          );
+	    _component->port_map(_name+"_Branch_History_Table","out_BRANCH_COMPLETE_"+toString(i)+"_ACK"      , _name+"_Two_Level_Branch_Predictor_Glue", "in_BRANCH_COMPLETE_"+toString(i)+"_BHT_ACK"      );
+	    _component->port_map(_name+"_Branch_History_Table", "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"  , _name+"_Two_Level_Branch_Predictor_Glue","out_BRANCH_COMPLETE_"+toString(i)+"_BHT_ADDRESS"  );
+	    _component->port_map(_name+"_Branch_History_Table", "in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY"  , _name                                   , "in_BRANCH_COMPLETE_"+toString(i)+"_BHT_HISTORY"  );
+	    _component->port_map(_name+"_Branch_History_Table", "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION", _name                                   , "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION"    );
+	  }
+      }
+    
+    // =====[ component_Pattern_History_Table - Instanciation ]===========
+    if (_param._have_pht)
+      {
+#ifdef POSITION
+	_component->interface_map (_name+"_Pattern_History_Table","",
+				   _name                         ,"");
+#endif
+	
+	_component->port_map(_name+"_Pattern_History_Table", "in_CLOCK" , _name,"in_CLOCK" );
+	_component->port_map(_name+"_Pattern_History_Table", "in_NRESET", _name,"in_NRESET");
+
+	for (uint32_t i=0; i<_param._nb_prediction; i++)
+	  {
+#ifdef POSITION
+	    _component->interface_map (_name+"_Pattern_History_Table","predict_"+toString(i),
+				       _name                         ,"predict_"+toString(i));
+#endif
+	    _component->port_map(_name+"_Pattern_History_Table", "in_PREDICT_"+toString(i)+"_VAL"    , _name                                   , "in_PREDICT_"+toString(i)+"_VAL"        );
+	    _component->port_map(_name+"_Pattern_History_Table","out_PREDICT_"+toString(i)+"_ACK"    , _name+"_Two_Level_Branch_Predictor_Glue", "in_PREDICT_"+toString(i)+"_PHT_ACK"    );
+	    _component->port_map(_name+"_Pattern_History_Table", "in_PREDICT_"+toString(i)+"_ADDRESS", _name+"_Two_Level_Branch_Predictor_Glue","out_PREDICT_"+toString(i)+"_PHT_ADDRESS");
+	    _component->port_map(_name+"_Pattern_History_Table","out_PREDICT_"+toString(i)+"_HISTORY", _name                                   ,"out_PREDICT_"+toString(i)+"_PHT_HISTORY");
+	  }
+
+	for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+	  {
+#ifdef POSITION
+	    _component->interface_map (_name+"_Pattern_History_Table","branch_complete_"+toString(i),
+				       _name                        ,"branch_complete_"+toString(i));
+#endif
+	    _component->port_map(_name+"_Pattern_History_Table", "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"      , _name                                   , "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"          );
+	    _component->port_map(_name+"_Pattern_History_Table","out_BRANCH_COMPLETE_"+toString(i)+"_ACK"      , _name+"_Two_Level_Branch_Predictor_Glue", "in_BRANCH_COMPLETE_"+toString(i)+"_PHT_ACK"      );
+	    _component->port_map(_name+"_Pattern_History_Table", "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"  , _name+"_Two_Level_Branch_Predictor_Glue","out_BRANCH_COMPLETE_"+toString(i)+"_PHT_ADDRESS"  );
+	    _component->port_map(_name+"_Pattern_History_Table", "in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY"  , _name                                   , "in_BRANCH_COMPLETE_"+toString(i)+"_PHT_HISTORY"  );
+	    _component->port_map(_name+"_Pattern_History_Table", "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION", _name                                   , "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION"    );
+	  }
+      }
+
+    // =====[ component_Two_Level_Branch_Predictor_Glue - Instanciation ]=
+#ifdef POSITION
+	_component->interface_map (_name+"_Two_Level_Branch_Predictor_Glue","",
+				   _name                                   ,"");
+#endif
+	_component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "in_CLOCK" , _name,"in_CLOCK" );
+	_component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "in_NRESET", _name,"in_NRESET");
+
+	for (uint32_t i=0; i<_param._nb_prediction; i++)
+	  {
+	if (_param._have_bht)
+	  {
+	_component->port_map(_name+"_Two_Level_Branch_Predictor_Glue",  "in_PREDICT_"+toString(i)+"_BHT_ACK"    , _name+"_Branch_History_Table" , "out_PREDICT_"+toString(i)+"_ACK"    );
+	_component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "out_PREDICT_"+toString(i)+"_BHT_ADDRESS", _name+"_Branch_History_Table" ,  "in_PREDICT_"+toString(i)+"_ADDRESS");
+	  }
+	if (_param._have_pht)
+	  {
+	_component->port_map(_name+"_Two_Level_Branch_Predictor_Glue",  "in_PREDICT_"+toString(i)+"_PHT_ACK"    , _name+"_Pattern_History_Table", "out_PREDICT_"+toString(i)+"_ACK"    );
+	_component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "out_PREDICT_"+toString(i)+"_PHT_ADDRESS", _name+"_Pattern_History_Table",  "in_PREDICT_"+toString(i)+"_ADDRESS");
+	  }
+	if (_param._have_bht and _param._have_pht)
+	_component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "in_PREDICT_"+toString(i)+"_BHT_HISTORY" , _name+"_Branch_History_Table" ,"out_PREDICT_"+toString(i)+"_HISTORY");
+	_component->port_map(_name+"_Two_Level_Branch_Predictor_Glue","out_PREDICT_"+toString(i)+"_ACK"         , _name                         ,"out_PREDICT_"+toString(i)+"_ACK");
+        _component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "in_PREDICT_"+toString(i)+"_ADDRESS"     , _name                         , "in_PREDICT_"+toString(i)+"_ADDRESS");
+	  }
+    
+    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+      {
+	if (_param._have_bht)
+	  {
+	_component->port_map(_name+"_Two_Level_Branch_Predictor_Glue",  "in_BRANCH_COMPLETE_"+toString(i)+"_BHT_ACK"    , _name+"_Branch_History_Table" , "out_BRANCH_COMPLETE_"+toString(i)+"_ACK"    );
+	_component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "out_BRANCH_COMPLETE_"+toString(i)+"_BHT_ADDRESS", _name+"_Branch_History_Table" ,  "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS");
+	  }
+	if (_param._have_pht)
+	  {
+	_component->port_map(_name+"_Two_Level_Branch_Predictor_Glue",  "in_BRANCH_COMPLETE_"+toString(i)+"_PHT_ACK"    , _name+"_Pattern_History_Table", "out_BRANCH_COMPLETE_"+toString(i)+"_ACK"    );
+	_component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "out_BRANCH_COMPLETE_"+toString(i)+"_PHT_ADDRESS", _name+"_Pattern_History_Table",  "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS");
+	  }
+	if (_param._have_bht and _param._have_pht)
+	_component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "in_BRANCH_COMPLETE_"+toString(i)+"_BHT_HISTORY" , _name                         , "in_BRANCH_COMPLETE_"+toString(i)+"_BHT_HISTORY");
+	_component->port_map(_name+"_Two_Level_Branch_Predictor_Glue","out_BRANCH_COMPLETE_"+toString(i)+"_ACK"         , _name                         ,"out_BRANCH_COMPLETE_"+toString(i)+"_ACK");
+        _component->port_map(_name+"_Two_Level_Branch_Predictor_Glue", "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"     , _name                         , "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS");
+      }
+#ifdef POSITION
+    _component->generate_file();
+#endif
+
+    log_printf(FUNC,Two_Level_Branch_Predictor,"allocation","End");
+  };
+  
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_deallocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_deallocation.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_deallocation.cpp	(revision 46)
@@ -0,0 +1,61 @@
+#ifdef SYSTEMC
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/include/Two_Level_Branch_Predictor.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+
+  void Two_Level_Branch_Predictor::deallocation (void)
+  {
+    log_printf(FUNC,Two_Level_Branch_Predictor,"deallocation","Begin");
+
+    delete in_CLOCK;
+    delete in_NRESET;
+
+    delete []  in_PREDICT_VAL        ;
+    delete [] out_PREDICT_ACK        ;
+    delete []  in_PREDICT_ADDRESS    ;
+    if (_param._have_bht)
+    delete [] out_PREDICT_BHT_HISTORY;
+    if (_param._have_pht)
+    delete [] out_PREDICT_PHT_HISTORY;
+
+    delete []  in_BRANCH_COMPLETE_VAL        ;
+    delete [] out_BRANCH_COMPLETE_ACK        ;
+    delete []  in_BRANCH_COMPLETE_ADDRESS    ;
+    if (_param._have_bht)
+    delete []  in_BRANCH_COMPLETE_BHT_HISTORY;
+    if (_param._have_pht)
+    delete []  in_BRANCH_COMPLETE_PHT_HISTORY;
+    delete []  in_BRANCH_COMPLETE_DIRECTION  ;
+
+    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
+
+    if (_param._have_bht)
+    delete component_Branch_History_Table ;
+    if (_param._have_pht)
+    delete component_Pattern_History_Table;
+    delete component_Two_Level_Branch_Predictor_Glue;
+    delete _component;
+
+    log_printf(FUNC,Two_Level_Branch_Predictor,"deallocation","End");
+  };
+
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_statistics.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_statistics.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_statistics.cpp	(revision 46)
@@ -0,0 +1,45 @@
+#ifdef STATISTICS
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/include/Two_Level_Branch_Predictor.h"
+
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+
+
+  string Two_Level_Branch_Predictor::statistics (uint32_t depth)
+  {
+    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,
+			      stat_component_Branch_History_Table                            +
+			      stat_component_Pattern_History_Table                           +
+			      component_Two_Level_Branch_Predictor_Glue->statistics(depth+1)
+			      );
+
+    log_printf(FUNC,Two_Level_Branch_Predictor,"statistics","End");
+
+    return txt;
+  };
+
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_transition.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_transition.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_transition.cpp	(revision 46)
@@ -0,0 +1,43 @@
+#ifdef SYSTEMC
+#if (defined(STATISTICS) || defined (VHDL_TESTBENCH))
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/include/Two_Level_Branch_Predictor.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+
+
+  void Two_Level_Branch_Predictor::transition (void)
+  {
+    log_printf(FUNC,Two_Level_Branch_Predictor,"transition","Begin");
+
+#ifdef STATISTICS
+    _stat->add();
+#endif    
+
+#ifdef VHDL_TESTBENCH
+    vhdl_testbench_transition ();
+#endif
+
+    log_printf(FUNC,Two_Level_Branch_Predictor,"transition","End");
+  };
+
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl.cpp	(revision 46)
@@ -0,0 +1,47 @@
+#ifdef VHDL
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/include/Two_Level_Branch_Predictor.h"
+#include "Behavioural/include/Vhdl.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+
+
+  void Two_Level_Branch_Predictor::vhdl (void)
+  {
+    log_printf(FUNC,Two_Level_Branch_Predictor,"vhdl","Begin");
+
+    Vhdl * vhdl = new Vhdl (_name);
+
+    _interfaces->set_port     (vhdl);
+    _component ->vhdl_instance(vhdl);
+
+    vhdl_declaration (vhdl);
+    vhdl_body        (vhdl);
+
+    vhdl->generate_file();
+
+    delete vhdl;
+
+    log_printf(FUNC,Two_Level_Branch_Predictor,"vhdl","End");
+
+  };
+
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl_body.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl_body.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl_body.cpp	(revision 46)
@@ -0,0 +1,34 @@
+#ifdef VHDL
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/include/Two_Level_Branch_Predictor.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+
+
+  void Two_Level_Branch_Predictor::vhdl_body (Vhdl * & vhdl)
+  {
+    log_printf(FUNC,Two_Level_Branch_Predictor,"vhdl_body","Begin");
+
+    
+    log_printf(FUNC,Two_Level_Branch_Predictor,"vhdl_body","End");
+  };
+
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl_declaration.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl_declaration.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl_declaration.cpp	(revision 46)
@@ -0,0 +1,33 @@
+#ifdef VHDL
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/include/Two_Level_Branch_Predictor.h"
+
+namespace morpheo {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+
+
+  void Two_Level_Branch_Predictor::vhdl_declaration (Vhdl * & vhdl)
+  {
+    log_printf(FUNC,Two_Level_Branch_Predictor,"vhdl_declaration","Begin");
+
+    log_printf(FUNC,Two_Level_Branch_Predictor,"vhdl_declaration","End");
+  };
+
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl_testbench_transition.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl_testbench_transition.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl_testbench_transition.cpp	(revision 46)
@@ -0,0 +1,37 @@
+#ifdef VHDL_TESTBENCH
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/include/Two_Level_Branch_Predictor.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+namespace two_level_branch_predictor {
+
+
+  void Two_Level_Branch_Predictor::vhdl_testbench_transition ()
+  {
+    log_printf(FUNC,Two_Level_Branch_Predictor,"vhdl_testbench_transition","Begin");
+
+//     sc_start(0);
+
+    _interfaces->testbench();
+
+    log_printf(FUNC,Two_Level_Branch_Predictor,"vhdl_testbench_transition","End");
+  };
+
+}; // end namespace two_level_branch_predictor
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/VERSION
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/VERSION	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/VERSION	(revision 46)
@@ -0,0 +1,1 @@
+v0.4
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/doc/Makefile
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/doc/Makefile	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/doc/Makefile	(revision 46)
@@ -0,0 +1,19 @@
+# 
+# $Id$
+# 
+# [ Description ]
+# 
+# Makefile
+# 
+
+#-----[ Directory ]----------------------------------------
+DIR_COMPONENT			= ..
+include				$(DIR_COMPONENT)/Makefile.defs
+
+#-----[ include ]------------------------------------------
+
+all				:
+				$(MAKE) all_documentation
+
+include				$(DIR_MORPHEO)/Behavioural/Makefile.Common
+include				$(DIR_MORPHEO)/Behavioural/Makefile.Documentation
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/doc/Meta_Predictor.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/doc/Meta_Predictor.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/doc/Meta_Predictor.tex	(revision 46)
@@ -0,0 +1,37 @@
+\documentclass[10pt,a4paper,twocolumn]{article}
+
+\def\dirdoc{tex}
+\def\dirschema{eps}
+
+% Package de variables d'environnement : Titre, command etc ...
+\usepackage{../../../../../Behavioural/doc/sty/doc-style}
+\usepackage{sty/header}
+
+%------------------------------------------------------------------------------
+% Début document
+%------------------------------------------------------------------------------
+
+\pagestyle{empty}
+
+\begin{document}
+
+% Créez une page de titre
+\maketitle
+\thispagestyle{empty}
+
+%Table des matières et des figures
+%\tableofcontents
+%\newpage
+%\listoffigures
+
+%------------------------------------------------------------------------------
+% Ajout du corps du documents
+%------------------------------------------------------------------------------
+
+\input{tex/root}
+
+%------------------------------------------------------------------------------
+% Fin d'ajout du corps du document
+%------------------------------------------------------------------------------
+
+\end{document}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/doc/sty/header.sty
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/doc/sty/header.sty	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/doc/sty/header.sty	(revision 46)
@@ -0,0 +1,12 @@
+\def\review{YYYY/MM/DD}
+%\def\review{\number\day/\number\month/\number\year\xspace}
+
+\title{Meta\_Predictor}
+ 
+\author{}
+
+\affiliation{}
+
+\email{}
+
+\date{\review}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/doc/tex/01_introduction.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/doc/tex/01_introduction.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/doc/tex/01_introduction.tex	(revision 46)
@@ -0,0 +1,1 @@
+\Section{Introduction}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/doc/tex/02_features.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/doc/tex/02_features.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/doc/tex/02_features.tex	(revision 46)
@@ -0,0 +1,1 @@
+\Section{Features}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/doc/tex/03_description.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/doc/tex/03_description.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/doc/tex/03_description.tex	(revision 46)
@@ -0,0 +1,1 @@
+\Section{Functional Description}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/doc/tex/04_pinout.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/doc/tex/04_pinout.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/doc/tex/04_pinout.tex	(revision 46)
@@ -0,0 +1,1 @@
+\Section{Pin out}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/doc/tex/05_parameters.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/doc/tex/05_parameters.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/doc/tex/05_parameters.tex	(revision 46)
@@ -0,0 +1,1 @@
+\Section{Parameters}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/doc/tex/06_performance.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/doc/tex/06_performance.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/doc/tex/06_performance.tex	(revision 46)
@@ -0,0 +1,1 @@
+\Section{Performance}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/doc/tex/07_details.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/doc/tex/07_details.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/doc/tex/07_details.tex	(revision 46)
@@ -0,0 +1,1 @@
+\Section{Details}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/doc/tex/08_history.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/doc/tex/08_history.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/doc/tex/08_history.tex	(revision 46)
@@ -0,0 +1,10 @@
+\Section{Revision History}
+
+\begin{tabular}{|c|c|c|}
+\hline
+Revision Date & By  & Modifications\\
+\hline
+\hline
+yyyy/mm/dd    & xxx & Initial document \\
+\hline
+\end{tabular}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/doc/tex/root.tex
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/doc/tex/root.tex	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/doc/tex/root.tex	(revision 46)
@@ -0,0 +1,8 @@
+\input{\dirdoc/01_introduction}
+\input{\dirdoc/02_features}
+\input{\dirdoc/03_description}
+\input{\dirdoc/04_pinout}
+\input{\dirdoc/05_parameters}
+\input{\dirdoc/06_performance}
+\input{\dirdoc/07_details}
+\input{\dirdoc/08_history}
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/include/Meta_Predictor.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/include/Meta_Predictor.h	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/include/Meta_Predictor.h	(revision 46)
@@ -0,0 +1,169 @@
+#ifndef morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_Meta_Predictor_h
+#define morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_Meta_Predictor_h
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#ifdef SYSTEMC
+#include "systemc.h"
+#endif
+
+#include <iostream>
+#include "Common/include/ToString.h"
+#include "Common/include/Debug.h"
+
+// Internal structure
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/include/Two_Level_Branch_Predictor.h"
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Meta_Predictor_Glue.h"
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/include/Parameters.h"
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/include/Types.h"
+#ifdef STATISTICS
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/include/Statistics.h"
+#endif
+#ifdef VHDL
+#include "Behavioural/include/Vhdl.h"
+#endif
+#include "Behavioural/include/Component.h"
+
+using namespace std;
+
+namespace morpheo {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+
+
+  class Meta_Predictor 
+#if SYSTEMC
+    : public sc_module
+#endif
+  {
+    // -----[ fields ]----------------------------------------------------
+    // Parameters
+  protected : const string     _name;
+
+  protected : const Parameters _param;
+#ifdef STATISTICS
+  protected : const morpheo::behavioural::Parameters_Statistics _param_statistics;
+#endif
+
+#ifdef STATISTICS
+  private   : Statistics                     * _stat;
+#endif
+
+  public    : Component                      * _component;
+  private   : Interfaces                     * _interfaces;
+
+#ifdef SYSTEMC
+    // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+    // Interface
+  public    : SC_CLOCK                      *  in_CLOCK        ;
+  public    : SC_IN (Tcontrol_t)            *  in_NRESET       ;
+
+    // Interface Predict
+  public    : SC_IN (Tcontrol_t)           **  in_PREDICT_VAL                ;
+  public    : SC_OUT(Tcontrol_t)           ** out_PREDICT_ACK                ;
+  public    : SC_IN (Taddress_t)           **  in_PREDICT_ADDRESS            ;
+  public    : SC_OUT(Thistory_t)           ** out_PREDICT_HISTORY            ;
+  public    : SC_OUT(Tcontrol_t)           ** out_PREDICT_DIRECTION          ;
+			
+    // Interface Branch_complete
+  public    : SC_IN (Tcontrol_t)           **  in_BRANCH_COMPLETE_VAL        ;
+  public    : SC_OUT(Tcontrol_t)           ** out_BRANCH_COMPLETE_ACK        ;
+  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_DIRECTION  ;
+
+    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
+  public    : morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Two_Level_Branch_Predictor * component_Two_Level_Branch_Predictor_0;
+  public    : morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Two_Level_Branch_Predictor * component_Two_Level_Branch_Predictor_1;
+  public    : morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Two_Level_Branch_Predictor * component_Two_Level_Branch_Predictor_2;
+  public    : morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::meta_predictor_glue::Meta_Predictor_Glue               * component_Meta_Predictor_Glue         ;
+
+    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
+
+    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+    // Interface Predict
+  private   : SC_SIGNAL(Tcontrol_t)        ** signal_PREDICT_PREDICTOR_0_ACK ;
+  private   : SC_SIGNAL(Tcontrol_t)        ** signal_PREDICT_PREDICTOR_1_ACK ;
+  private   : SC_SIGNAL(Tcontrol_t)        ** signal_PREDICT_PREDICTOR_2_ACK ;
+
+  private   : SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tbht_history_t) ** signal_PREDICT_PREDICTOR_0_BHT_HISTORY;
+  private   : SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tpht_history_t) ** signal_PREDICT_PREDICTOR_0_PHT_HISTORY;
+  private   : SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tbht_history_t) ** signal_PREDICT_PREDICTOR_1_BHT_HISTORY;
+  private   : SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tpht_history_t) ** signal_PREDICT_PREDICTOR_1_PHT_HISTORY;
+  private   : SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tbht_history_t) ** signal_PREDICT_PREDICTOR_2_BHT_HISTORY;
+  private   : SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tpht_history_t) ** signal_PREDICT_PREDICTOR_2_PHT_HISTORY;
+
+
+  private   : SC_SIGNAL(Tcontrol_t)        ** signal_BRANCH_COMPLETE_PREDICTOR_0_ACK ;
+  private   : SC_SIGNAL(Tcontrol_t)        ** signal_BRANCH_COMPLETE_PREDICTOR_1_ACK ;
+  private   : SC_SIGNAL(Tcontrol_t)        ** signal_BRANCH_COMPLETE_PREDICTOR_2_VAL ;
+  private   : SC_SIGNAL(Tcontrol_t)        ** signal_BRANCH_COMPLETE_PREDICTOR_2_ACK ;
+  private   : SC_SIGNAL(Tcontrol_t)        ** signal_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION;
+
+  private   : SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tbht_history_t) ** signal_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY;
+  private   : SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tpht_history_t) ** signal_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY;
+  private   : SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tbht_history_t) ** signal_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY;
+  private   : SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tpht_history_t) ** signal_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY;
+  private   : SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tbht_history_t) ** signal_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY;
+  private   : SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tpht_history_t) ** signal_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY;
+
+#endif
+
+    // -----[ methods ]---------------------------------------------------
+
+#ifdef SYSTEMC
+    SC_HAS_PROCESS (Meta_Predictor);
+#endif
+  public  :          Meta_Predictor              (
+#ifdef SYSTEMC
+					      sc_module_name                              name,
+#else					       
+					      string                                      name,
+#endif					       
+#ifdef STATISTICS
+					      morpheo::behavioural::Parameters_Statistics param_statistics,
+#endif
+					      Parameters                                  param );
+					       
+  public  :          Meta_Predictor              (Parameters param );
+  public  :          ~Meta_Predictor             (void);
+					       
+#ifdef SYSTEMC				       
+  private : void     allocation                (void);
+  private : void     deallocation              (void);
+				
+#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
+  public  : void     transition                (void);
+#endif
+#endif					       
+#ifdef STATISTICS
+  public  : string   statistics                (uint32_t depth);
+#endif
+					       
+#if VHDL				       
+  public  : void     vhdl                      (void);
+  private : void     vhdl_declaration          (Vhdl * & vhdl);
+  private : void     vhdl_body                 (Vhdl * & vhdl);
+#endif					       
+#ifdef VHDL_TESTBENCH			       
+  private : void     vhdl_testbench_transition (void);
+#endif
+  };
+
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/include/Parameters.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/include/Parameters.h	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/include/Parameters.h	(revision 46)
@@ -0,0 +1,109 @@
+#ifndef morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_Parameters_h
+#define morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_Parameters_h
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Common/include/Debug.h"
+#include "Behavioural/include/Parameters.h"
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/include/Parameters.h"
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Parameters.h"
+#include <math.h>
+
+namespace morpheo {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+
+  class Parameters : public morpheo::behavioural::Parameters
+  {
+    //-----[ fields ]------------------------------------------------------------
+  public : const bool     _have_meta_predictor               ;
+
+  public : const bool     _predictor_0_have_bht              ;
+  public : const uint32_t _predictor_0_bht_size_shifter      ;
+  public : const uint32_t _predictor_0_bht_nb_shifter        ;
+  public : const bool     _predictor_0_have_pht              ;
+  public : const uint32_t _predictor_0_pht_size_counter      ;
+  public : const uint32_t _predictor_0_pht_nb_counter        ;
+  public : const uint32_t _predictor_0_pht_size_address_share;
+
+  public : const bool     _predictor_1_have_bht              ;
+  public : const uint32_t _predictor_1_bht_size_shifter      ;
+  public : const uint32_t _predictor_1_bht_nb_shifter        ;
+  public : const bool     _predictor_1_have_pht              ;
+  public : const uint32_t _predictor_1_pht_size_counter      ;
+  public : const uint32_t _predictor_1_pht_nb_counter        ;
+  public : const uint32_t _predictor_1_pht_size_address_share;
+
+  public : const bool     _predictor_2_have_bht              ;
+  public : const uint32_t _predictor_2_bht_size_shifter      ;
+  public : const uint32_t _predictor_2_bht_nb_shifter        ;
+  public : const bool     _predictor_2_have_pht              ;
+  public : const uint32_t _predictor_2_pht_size_counter      ;
+  public : const uint32_t _predictor_2_pht_nb_counter        ;
+  public : const uint32_t _predictor_2_pht_size_address_share;
+
+  public : const uint32_t _size_address                      ;
+  public : const uint32_t _nb_prediction                     ;
+  public : const uint32_t _nb_branch_complete                ;
+
+  public : const uint32_t _size_history                      ;
+
+  public :       morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Parameters * _param_two_level_branch_predictor_0;
+  public :       morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Parameters * _param_two_level_branch_predictor_1;
+  public :       morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Parameters * _param_two_level_branch_predictor_2;
+  public :       morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::meta_predictor_glue::Parameters        * _param_meta_predictor_glue;
+
+    //-----[ methods ]-----------------------------------------------------------
+  public : Parameters  (bool     have_meta_predictor               ,
+			
+			bool     predictor_0_have_bht              ,
+			uint32_t predictor_0_bht_size_shifter      ,
+			uint32_t predictor_0_bht_nb_shifter        ,
+			bool     predictor_0_have_pht              ,
+			uint32_t predictor_0_pht_size_counter      ,
+			uint32_t predictor_0_pht_nb_counter        ,
+			uint32_t predictor_0_pht_size_address_share,
+			
+			bool     predictor_1_have_bht              ,
+			uint32_t predictor_1_bht_size_shifter      ,
+			uint32_t predictor_1_bht_nb_shifter        ,
+			bool     predictor_1_have_pht              ,
+			uint32_t predictor_1_pht_size_counter      ,
+			uint32_t predictor_1_pht_nb_counter        ,
+			uint32_t predictor_1_pht_size_address_share,
+			
+			bool     predictor_2_have_bht              ,
+			uint32_t predictor_2_bht_size_shifter      ,
+			uint32_t predictor_2_bht_nb_shifter        ,
+			bool     predictor_2_have_pht              ,
+			uint32_t predictor_2_pht_size_counter      ,
+			uint32_t predictor_2_pht_nb_counter        ,
+			uint32_t predictor_2_pht_size_address_share,
+			
+			uint32_t size_address                      ,
+			uint32_t nb_prediction                     ,
+			uint32_t nb_branch_complete                );
+  public : Parameters  (Parameters & param) ;
+  public : ~Parameters () ;
+    
+  public : string msg_error (void);
+
+  public :        string   print      (uint32_t depth);
+  public : friend ostream& operator<< (ostream& output_stream,
+				       morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::Parameters & x);
+  };
+
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+}; // end namespace behavioural
+}; // end namespace morpheo              
+
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/include/Statistics.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/include/Statistics.h	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/include/Statistics.h	(revision 46)
@@ -0,0 +1,58 @@
+#ifdef STATISTICS
+#ifndef morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_Statistics_h
+#define morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_Statistics_h
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Common/include/Debug.h"
+#include "Behavioural/include/Statistics.h"
+#include "Behavioural/include/Parameters_Statistics.h"
+//#include "Behavioural/Generic/Group/include/Statistics.h"
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/include/Parameters.h"
+
+//using namespace morpheo::behavioural::generic::group;
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+
+
+  class Statistics : public morpheo::behavioural::Statistics
+  {
+    // -----[ fields ]----------------------------------------------------
+  private  : const Parameters                                   _parameters;
+
+    // -----[ methods ]---------------------------------------------------
+  public   : Statistics  (string                                      name                       ,
+			  morpheo::behavioural::Parameters_Statistics parameters_statistics      ,
+			  Parameters                                  parameters
+			  );
+//public   : Statistics  (Statistics & stat);
+  public   : ~Statistics () ;
+    
+  public   : string   print_body (uint32_t depth);
+  public   : string   print      (uint32_t depth);
+  public   : string   print      (uint32_t depth, string component_stat);
+  public   : void     add        ();
+
+  public   : friend ostream& operator<< (ostream& output_stream,
+					 const Statistics & x);
+
+  };
+
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo
+
+#endif
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/include/Types.h
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/include/Types.h	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/include/Types.h	(revision 46)
@@ -0,0 +1,28 @@
+#ifndef morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_Type_h
+#define morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_Type_h
+
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Common/include/Types.h"
+
+namespace morpheo {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+
+  typedef uint32_t Taddress_t;
+  typedef uint32_t Thistory_t;
+
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+}; // end namespace behavioural
+}; // end namespace morpheo              
+
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Meta_Predictor.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Meta_Predictor.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Meta_Predictor.cpp	(revision 46)
@@ -0,0 +1,87 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/include/Meta_Predictor.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+
+
+#ifdef SYSTEMC
+  Meta_Predictor::Meta_Predictor (sc_module_name name,
+#else
+  Meta_Predictor::Meta_Predictor (string name,
+#endif
+#ifdef STATISTICS
+			      morpheo::behavioural::Parameters_Statistics             param_statistics,
+#endif
+			      morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::Parameters param ):
+			      _name              (name)
+			      ,_param            (param)
+#ifdef STATISTICS
+			      ,_param_statistics (param_statistics)
+#endif
+  {
+    log_printf(FUNC,Meta_Predictor,"Meta_Predictor","Begin");
+
+#ifdef SYSTEMC
+    allocation ();
+#endif
+
+#ifdef STATISTICS
+    // Allocation of statistics
+    _stat = new Statistics (static_cast<string>(_name),
+			    param_statistics          ,
+			    param);
+#endif
+
+#ifdef VHDL
+    // generate the vhdl
+    vhdl();
+#endif
+
+#ifdef SYSTEMC
+#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
+    SC_METHOD (transition);
+    dont_initialize ();
+    sensitive_pos << *(in_CLOCK);
+#endif
+
+#ifdef SYSTEMCASS_SPECIFIC
+    // List dependency information
+#endif    
+
+#endif
+    log_printf(FUNC,Meta_Predictor,"Meta_Predictor","End");
+  };
+  
+  Meta_Predictor::~Meta_Predictor (void)
+  {
+    log_printf(FUNC,Meta_Predictor,"~Meta_Predictor","Begin");
+
+#ifdef STATISTICS
+    _stat->generate_file(statistics(0));
+    
+    delete _stat;
+#endif
+
+#ifdef SYSTEMC
+    deallocation ();
+#endif
+
+    log_printf(FUNC,Meta_Predictor,"~Meta_Predictor","End");
+  };
+
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Meta_Predictor_allocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Meta_Predictor_allocation.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Meta_Predictor_allocation.cpp	(revision 46)
@@ -0,0 +1,437 @@
+#ifdef SYSTEMC
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/include/Meta_Predictor.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+
+
+  void Meta_Predictor::allocation (void)
+  {
+    log_printf(FUNC,Meta_Predictor,"allocation","Begin");
+
+    _component   = new Component ();
+
+    Entity * entity = _component->set_entity (_name                 
+					     ,"Meta_Predictor"
+#ifdef POSITION
+					     ,MIXTE
+#endif
+					      );
+    
+    _interfaces = entity->set_interfaces();
+
+    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+    {
+      Interface * interface = _interfaces->set_interface(""
+#ifdef POSITION
+							 , IN  
+							 , SOUTH
+							 , "Generalist interface"
+#endif
+							 );
+      
+      in_CLOCK              = interface->set_signal_clk              ("clock" ,1);
+      in_NRESET             = interface->set_signal_in  <Tcontrol_t> ("nreset",1,RESET_VHDL_YES);
+    }
+
+    // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+     in_PREDICT_VAL                 = new SC_IN (Tcontrol_t)     * [_param._nb_prediction     ];
+    out_PREDICT_ACK                 = new SC_OUT(Tcontrol_t)     * [_param._nb_prediction     ];
+     in_PREDICT_ADDRESS             = new SC_IN (Taddress_t)     * [_param._nb_prediction     ];
+    out_PREDICT_HISTORY             = new SC_OUT(Thistory_t)     * [_param._nb_prediction     ];
+    out_PREDICT_DIRECTION           = new SC_OUT(Tcontrol_t)     * [_param._nb_prediction     ];
+
+    for (uint32_t i=0; i<_param._nb_prediction; i++)
+      {
+	Interface_fifo * interface = _interfaces->set_interface("predict_"+toString(i)
+#ifdef POSITION
+								, IN  
+								, WEST
+								, "Interface Predict"
+#endif
+								);
+
+	 in_PREDICT_VAL                 [i] = interface->set_signal_valack_in        ("val"      , VAL);
+	out_PREDICT_ACK                 [i] = interface->set_signal_valack_out       ("ack"      , ACK);
+	 in_PREDICT_ADDRESS             [i] = interface->set_signal_in  <Taddress_t> ("address"  , _param._size_address);
+	out_PREDICT_HISTORY             [i] = interface->set_signal_out <Thistory_t> ("history"  , _param._size_history);
+	out_PREDICT_DIRECTION           [i] = interface->set_signal_out <Tcontrol_t> ("direction", 1);
+      }
+
+    // ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+     in_BRANCH_COMPLETE_VAL         = new SC_IN (Tcontrol_t)     * [_param._nb_branch_complete];
+    out_BRANCH_COMPLETE_ACK         = new SC_OUT(Tcontrol_t)     * [_param._nb_branch_complete];
+     in_BRANCH_COMPLETE_ADDRESS     = new SC_IN (Taddress_t)     * [_param._nb_branch_complete];
+     in_BRANCH_COMPLETE_HISTORY     = new SC_IN (Thistory_t)     * [_param._nb_branch_complete];
+     in_BRANCH_COMPLETE_DIRECTION   = new SC_IN (Tcontrol_t)     * [_param._nb_branch_complete];
+
+    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+      {
+	Interface_fifo * interface = _interfaces->set_interface("branch_complete_"+toString(i)
+#ifdef POSITION
+								, IN  
+								, EAST
+								, "Interface branch complete"
+#endif
+								);
+
+	 in_BRANCH_COMPLETE_VAL         [i] = interface->set_signal_valack_in        ("val"        , VAL);		   
+	out_BRANCH_COMPLETE_ACK         [i] = interface->set_signal_valack_out       ("ack"        , ACK);		   
+	 in_BRANCH_COMPLETE_ADDRESS     [i] = interface->set_signal_in  <Taddress_t> ("address"    , _param._size_address);
+	 in_BRANCH_COMPLETE_HISTORY     [i] = interface->set_signal_in  <Thistory_t> ("history"    , _param._size_history);
+	 in_BRANCH_COMPLETE_DIRECTION   [i] = interface->set_signal_in  <Tcontrol_t> ("direction"  , 1);
+      }
+
+    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+    string name_component;
+
+    // =====[ component_Meta_Predictor_Glue ]=============================
+
+    name_component = _name+"_Meta_Predictor_Glue";
+    
+    log_printf(INFO,Meta_Predictor,"allocation","Allocation : %s",name_component.c_str());
+    
+    component_Meta_Predictor_Glue = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::meta_predictor_glue::Meta_Predictor_Glue (name_component.c_str()               ,
+#ifdef STATISTICS	
+																		   _param_statistics                    ,
+#endif
+																		   *(_param._param_meta_predictor_glue));
+    
+    
+    _component->set_component (component_Meta_Predictor_Glue->_component
+#ifdef POSITION
+			       , 75
+			       , 25
+			       , 10
+			       , 10
+#endif
+			       );
+    
+
+    // =====[ component_Two_Level_Branch_Predictor_2 ]====================    
+
+    name_component = _name+"_Two_Level_Branch_Predictor_2";
+    
+    log_printf(INFO,Meta_Predictor,"allocation","Allocation : %s",name_component.c_str());
+    
+    component_Two_Level_Branch_Predictor_2 = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor ::Two_Level_Branch_Predictor (name_component.c_str()               ,
+#ifdef STATISTICS	
+																					   _param_statistics                    ,
+#endif
+																					   *(_param._param_two_level_branch_predictor_2));
+    
+
+    _component->set_component (component_Two_Level_Branch_Predictor_2->_component
+#ifdef POSITION
+			       , 75
+			       , 25
+			       , 10
+			       , 10
+#endif
+			       );
+    
+
+
+    if (_param._have_meta_predictor)
+      {
+    // =====[ component_Two_Level_Branch_Predictor_1 ]====================    
+
+    name_component = _name+"_Two_Level_Branch_Predictor_1";
+    
+    log_printf(INFO,Meta_Predictor,"allocation","Allocation : %s",name_component.c_str());
+    
+    component_Two_Level_Branch_Predictor_1 = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor ::Two_Level_Branch_Predictor (name_component.c_str()               ,
+#ifdef STATISTICS	
+																					   _param_statistics                    ,
+#endif
+																					   *(_param._param_two_level_branch_predictor_1));
+
+    _component->set_component (component_Two_Level_Branch_Predictor_1->_component
+#ifdef POSITION
+			       , 75
+			       , 25
+			       , 10
+			       , 10
+#endif
+			       );
+
+    // =====[ component_Two_Level_Branch_Predictor_0 ]====================    
+
+    name_component = _name+"_Two_Level_Branch_Predictor_0";
+    
+    log_printf(INFO,Meta_Predictor,"allocation","Allocation : %s",name_component.c_str());
+    
+    component_Two_Level_Branch_Predictor_0 = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor ::Two_Level_Branch_Predictor (name_component.c_str()               ,
+#ifdef STATISTICS	
+																					   _param_statistics                    ,
+#endif
+																					   *(_param._param_two_level_branch_predictor_0));
+    
+    _component->set_component (component_Two_Level_Branch_Predictor_0->_component
+#ifdef POSITION
+			       , 75
+			       , 25
+			       , 10
+			       , 10
+#endif
+			       );
+      
+      }
+
+    // ~~~~~[ Component - Instanciation ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+    // =====[ component_Meta_Predictor_Glue - Instanciation ]=============
+
+    name_component = _name+"_Meta_Predictor_Glue";
+
+    cout << "Instance : " << name_component << endl;
+
+#ifdef POSITION
+    _component->interface_map ("Meta_Predictor_Glue","",
+			       _name                ,"");
+#endif
+    
+    _component->port_map(name_component, "in_CLOCK" , _name,"in_CLOCK" );
+    _component->port_map(name_component, "in_NRESET", _name,"in_NRESET");
+    
+    // Interface Predict
+    for (uint32_t i=0; i<_param._nb_prediction; i++)
+      {
+#ifdef POSITION
+	_component->interface_map ("Meta_Predictor_Glue","predict_"+toString(i),
+				   _name                ,"predict_"+toString(i));
+#endif
+	
+	if (_param._have_meta_predictor)
+	  {
+	_component->port_map(name_component,  "in_PREDICT_"+toString(i)+"_PREDICTOR_0_ACK"        , _name+"_Two_Level_Branch_Predictor_0" ,"out_PREDICT_"+toString(i)+"_ACK");
+	_component->port_map(name_component,  "in_PREDICT_"+toString(i)+"_PREDICTOR_1_ACK"        , _name+"_Two_Level_Branch_Predictor_1" ,"out_PREDICT_"+toString(i)+"_ACK");
+	  }
+	_component->port_map(name_component,  "in_PREDICT_"+toString(i)+"_PREDICTOR_2_ACK"        , _name+"_Two_Level_Branch_Predictor_2" ,"out_PREDICT_"+toString(i)+"_ACK");
+	_component->port_map(name_component, "out_PREDICT_"+toString(i)+"_ACK"                    , _name , "out_PREDICT_"+toString(i)+"_ACK");
+	if (_param._have_meta_predictor)
+	  {									      		  	      
+	if (_param._predictor_0_have_bht)
+	_component->port_map(name_component,  "in_PREDICT_"+toString(i)+"_PREDICTOR_0_BHT_HISTORY", _name+"_Two_Level_Branch_Predictor_0" ,"out_PREDICT_"+toString(i)+"_BHT_HISTORY");
+	if (_param._predictor_0_have_pht)
+	_component->port_map(name_component,  "in_PREDICT_"+toString(i)+"_PREDICTOR_0_PHT_HISTORY", _name+"_Two_Level_Branch_Predictor_0" ,"out_PREDICT_"+toString(i)+"_PHT_HISTORY");
+	if (_param._predictor_1_have_bht)
+	_component->port_map(name_component,  "in_PREDICT_"+toString(i)+"_PREDICTOR_1_BHT_HISTORY", _name+"_Two_Level_Branch_Predictor_1" ,"out_PREDICT_"+toString(i)+"_BHT_HISTORY");
+	if (_param._predictor_1_have_pht)
+	_component->port_map(name_component,  "in_PREDICT_"+toString(i)+"_PREDICTOR_1_PHT_HISTORY", _name+"_Two_Level_Branch_Predictor_1" ,"out_PREDICT_"+toString(i)+"_PHT_HISTORY");
+	  }									      		  	      
+	if (_param._predictor_2_have_bht)
+	_component->port_map(name_component,  "in_PREDICT_"+toString(i)+"_PREDICTOR_2_BHT_HISTORY", _name+"_Two_Level_Branch_Predictor_2" ,"out_PREDICT_"+toString(i)+"_BHT_HISTORY");
+	if (_param._predictor_2_have_pht)
+	_component->port_map(name_component,  "in_PREDICT_"+toString(i)+"_PREDICTOR_2_PHT_HISTORY", _name+"_Two_Level_Branch_Predictor_2" ,"out_PREDICT_"+toString(i)+"_PHT_HISTORY");
+	_component->port_map(name_component, "out_PREDICT_"+toString(i)+"_HISTORY"                , _name , "out_PREDICT_"+toString(i)+"_HISTORY");
+	_component->port_map(name_component, "out_PREDICT_"+toString(i)+"_DIRECTION"              , _name , "out_PREDICT_"+toString(i)+"_DIRECTION");
+      }
+
+    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+      {
+#ifdef POSITION
+	_component->interface_map ("Meta_Predictor_Glue","branch_complete_"+toString(i),
+				   _name                ,"branch_complete_"+toString(i));
+#endif
+
+	if (_param._have_meta_predictor)
+	  {
+	_component->port_map(name_component,  "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"                     , _name , "in_BRANCH_COMPLETE_"+toString(i)+"_VAL");
+	_component->port_map(name_component, "out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_VAL"         , _name+"_Two_Level_Branch_Predictor_2",  "in_BRANCH_COMPLETE_"+toString(i)+"_VAL");
+
+	_component->port_map(name_component,  "in_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_0_ACK"         , _name+"_Two_Level_Branch_Predictor_0", "out_BRANCH_COMPLETE_"+toString(i)+"_ACK");
+	_component->port_map(name_component,  "in_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_1_ACK"         , _name+"_Two_Level_Branch_Predictor_1", "out_BRANCH_COMPLETE_"+toString(i)+"_ACK");
+	  }					
+	_component->port_map(name_component,  "in_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_ACK"         , _name+"_Two_Level_Branch_Predictor_2", "out_BRANCH_COMPLETE_"+toString(i)+"_ACK");
+	_component->port_map(name_component, "out_BRANCH_COMPLETE_"+toString(i)+"_ACK"                     , _name ,"out_BRANCH_COMPLETE_"+toString(i)+"_ACK");
+						
+	if (_param._have_meta_predictor)	
+	  {					
+	if (_param._predictor_0_have_bht)
+	_component->port_map(name_component, "out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_0_BHT_HISTORY" , _name+"_Two_Level_Branch_Predictor_0",  "in_BRANCH_COMPLETE_"+toString(i)+"_BHT_HISTORY" );
+	if (_param._predictor_0_have_pht)
+	_component->port_map(name_component, "out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_0_PHT_HISTORY" , _name+"_Two_Level_Branch_Predictor_0",  "in_BRANCH_COMPLETE_"+toString(i)+"_PHT_HISTORY" );
+	if (_param._predictor_1_have_bht)
+	_component->port_map(name_component, "out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_1_BHT_HISTORY" , _name+"_Two_Level_Branch_Predictor_1",  "in_BRANCH_COMPLETE_"+toString(i)+"_BHT_HISTORY" );
+	if (_param._predictor_1_have_pht)
+	_component->port_map(name_component, "out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_1_PHT_HISTORY" , _name+"_Two_Level_Branch_Predictor_1",  "in_BRANCH_COMPLETE_"+toString(i)+"_PHT_HISTORY" );
+	  }					
+	if (_param._predictor_2_have_bht)
+	_component->port_map(name_component, "out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_BHT_HISTORY" , _name+"_Two_Level_Branch_Predictor_2",  "in_BRANCH_COMPLETE_"+toString(i)+"_BHT_HISTORY" );
+	if (_param._predictor_2_have_pht)
+	_component->port_map(name_component, "out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_PHT_HISTORY" , _name+"_Two_Level_Branch_Predictor_2",  "in_BRANCH_COMPLETE_"+toString(i)+"_PHT_HISTORY" );
+	_component->port_map(name_component,  "in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY"                 , _name , "in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY");
+	if (_param._have_meta_predictor)	
+	  {
+	_component->port_map(name_component,  "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION"               , _name , "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION");
+	_component->port_map(name_component, "out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_DIRECTION"   , _name+"_Two_Level_Branch_Predictor_2" , "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION");
+	  }
+      }
+
+    // =====[ component_Two_Level_Branch_Predictor_2 - Instanciation ]====
+    name_component = _name+"_Two_Level_Branch_Predictor_2";
+
+    cout << "Instance : " << name_component << endl;
+
+#ifdef POSITION
+	_component->interface_map ("Two_Level_Branch_Predictor_2","",
+				   _name         ,"");
+#endif
+	
+	_component->port_map(name_component, "in_CLOCK" , _name,"in_CLOCK" );
+	_component->port_map(name_component, "in_NRESET", _name,"in_NRESET");
+
+    for (uint32_t i=0; i<_param._nb_prediction; i++)
+      {
+#ifdef POSITION
+	_component->interface_map ("Two_Level_Branch_Predictor_2","predict_"+toString(i),
+				   _name         ,"predict_"+toString(i));
+#endif
+
+	_component->port_map(name_component, "in_PREDICT_"+toString(i)+"_VAL"         , _name, "in_PREDICT_"+toString(i)+"_VAL");
+	_component->port_map(name_component,"out_PREDICT_"+toString(i)+"_ACK"         , _name+"_Meta_Predictor_Glue", "in_PREDICT_"+toString(i)+"_PREDICTOR_2_ACK");
+	_component->port_map(name_component, "in_PREDICT_"+toString(i)+"_ADDRESS"     , _name, "in_PREDICT_"+toString(i)+"_ADDRESS");
+	if (_param._predictor_2_have_bht)					       				       
+	_component->port_map(name_component,"out_PREDICT_"+toString(i)+"_BHT_HISTORY" , _name+"_Meta_Predictor_Glue", "in_PREDICT_"+toString(i)+"_PREDICTOR_2_BHT_HISTORY");
+	if (_param._predictor_2_have_pht)
+	_component->port_map(name_component,"out_PREDICT_"+toString(i)+"_PHT_HISTORY" , _name+"_Meta_Predictor_Glue", "in_PREDICT_"+toString(i)+"_PREDICTOR_2_PHT_HISTORY");
+      }
+    
+    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+      {
+#ifdef POSITION
+	_component->interface_map ("Two_Level_Branch_Predictor_2","branch_complete_"+toString(i),
+				   _name         ,"branch_complete_"+toString(i));
+#endif
+	if (_param._have_meta_predictor)
+	_component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"         , _name+"_Meta_Predictor_Glue","out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_VAL"         );
+	else
+	_component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"         , _name, "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"                     );
+	_component->port_map(name_component,"out_BRANCH_COMPLETE_"+toString(i)+"_ACK"         , _name+"_Meta_Predictor_Glue", "in_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_ACK"         );
+	_component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"     , _name, "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"                 );
+	if (_param._predictor_2_have_bht)						       					
+	_component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_BHT_HISTORY" , _name+"_Meta_Predictor_Glue","out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_BHT_HISTORY" );
+	if (_param._predictor_2_have_pht)						       					
+	_component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_PHT_HISTORY" , _name+"_Meta_Predictor_Glue","out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_PHT_HISTORY" );
+	if (_param._have_meta_predictor)
+	_component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION"   , _name+"_Meta_Predictor_Glue","out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_DIRECTION"   );
+	else
+	_component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION"   , _name, "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION"               );	 
+      }
+
+    if (_param._have_meta_predictor)
+      {
+    // =====[ component_Two_Level_Branch_Predictor_1 - Instanciation ]====
+
+    name_component = _name+"_Two_Level_Branch_Predictor_1";
+
+    cout << "Instance : " << name_component << endl;
+
+#ifdef POSITION
+	_component->interface_map ("Two_Level_Branch_Predictor_1","",
+				   _name         ,"");
+#endif
+	
+	_component->port_map(name_component, "in_CLOCK" , _name,"in_CLOCK" );
+	_component->port_map(name_component, "in_NRESET", _name,"in_NRESET");
+
+    for (uint32_t i=0; i<_param._nb_prediction; i++)
+      {
+#ifdef POSITION
+	_component->interface_map ("Two_Level_Branch_Predictor_1","predict_"+toString(i),
+				   _name         ,"predict_"+toString(i));
+#endif
+
+	_component->port_map(name_component, "in_PREDICT_"+toString(i)+"_VAL"         , _name, "in_PREDICT_"+toString(i)+"_VAL");
+	_component->port_map(name_component,"out_PREDICT_"+toString(i)+"_ACK"         , _name+"_Meta_Predictor_Glue", "in_PREDICT_"+toString(i)+"_PREDICTOR_1_ACK");
+	_component->port_map(name_component, "in_PREDICT_"+toString(i)+"_ADDRESS"     , _name, "in_PREDICT_"+toString(i)+"_ADDRESS");
+	if (_param._predictor_1_have_bht)					       				       
+	_component->port_map(name_component,"out_PREDICT_"+toString(i)+"_BHT_HISTORY" , _name+"_Meta_Predictor_Glue", "in_PREDICT_"+toString(i)+"_PREDICTOR_1_BHT_HISTORY");
+	if (_param._predictor_1_have_pht)
+	_component->port_map(name_component,"out_PREDICT_"+toString(i)+"_PHT_HISTORY" , _name+"_Meta_Predictor_Glue", "in_PREDICT_"+toString(i)+"_PREDICTOR_1_PHT_HISTORY");
+      }
+    
+    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+      {
+#ifdef POSITION
+	_component->interface_map ("Two_Level_Branch_Predictor_1","branch_complete_"+toString(i),
+				   _name         ,"branch_complete_"+toString(i));
+#endif
+	_component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"         , _name, "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"                     );
+	_component->port_map(name_component,"out_BRANCH_COMPLETE_"+toString(i)+"_ACK"         , _name+"_Meta_Predictor_Glue", "in_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_1_ACK"         );
+	_component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"     , _name, "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"                 );
+	if (_param._predictor_1_have_bht)						       					
+	_component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_BHT_HISTORY" , _name+"_Meta_Predictor_Glue","out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_1_BHT_HISTORY" );
+	if (_param._predictor_1_have_pht)						       					
+	_component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_PHT_HISTORY" , _name+"_Meta_Predictor_Glue","out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_1_PHT_HISTORY" );
+	_component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION"   , _name, "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION"               );	 
+      }
+    // =====[ component_Two_Level_Branch_Predictor_0 - Instanciation ]====
+
+    name_component = _name+"_Two_Level_Branch_Predictor_0";
+
+    cout << "Instance : " << name_component << endl;
+
+#ifdef POSITION
+	_component->interface_map ("Two_Level_Branch_Predictor_0","",
+				   _name         ,"");
+#endif
+	
+	_component->port_map(name_component, "in_CLOCK" , _name,"in_CLOCK" );
+	_component->port_map(name_component, "in_NRESET", _name,"in_NRESET");
+
+    for (uint32_t i=0; i<_param._nb_prediction; i++)
+      {
+#ifdef POSITION
+	_component->interface_map ("Two_Level_Branch_Predictor_0","predict_"+toString(i),
+				   _name         ,"predict_"+toString(i));
+#endif
+
+	_component->port_map(name_component, "in_PREDICT_"+toString(i)+"_VAL"         , _name, "in_PREDICT_"+toString(i)+"_VAL");
+	_component->port_map(name_component,"out_PREDICT_"+toString(i)+"_ACK"         , _name+"_Meta_Predictor_Glue", "in_PREDICT_"+toString(i)+"_PREDICTOR_0_ACK");
+	_component->port_map(name_component, "in_PREDICT_"+toString(i)+"_ADDRESS"     , _name, "in_PREDICT_"+toString(i)+"_ADDRESS");
+	if (_param._predictor_0_have_bht)					       				       
+	_component->port_map(name_component,"out_PREDICT_"+toString(i)+"_BHT_HISTORY" , _name+"_Meta_Predictor_Glue", "in_PREDICT_"+toString(i)+"_PREDICTOR_0_BHT_HISTORY");
+	if (_param._predictor_0_have_pht)
+	_component->port_map(name_component,"out_PREDICT_"+toString(i)+"_PHT_HISTORY" , _name+"_Meta_Predictor_Glue", "in_PREDICT_"+toString(i)+"_PREDICTOR_0_PHT_HISTORY");
+      }
+    
+    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+      {
+#ifdef POSITION
+	_component->interface_map ("Two_Level_Branch_Predictor_0","branch_complete_"+toString(i),
+				   _name         ,"branch_complete_"+toString(i));
+#endif
+	_component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"         , _name, "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"                     );
+	_component->port_map(name_component,"out_BRANCH_COMPLETE_"+toString(i)+"_ACK"         , _name+"_Meta_Predictor_Glue", "in_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_0_ACK"         );
+	_component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"     , _name, "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"                 );
+	if (_param._predictor_0_have_bht)						       					
+	_component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_BHT_HISTORY" , _name+"_Meta_Predictor_Glue","out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_0_BHT_HISTORY" );
+	if (_param._predictor_0_have_pht)						       					
+	_component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_PHT_HISTORY" , _name+"_Meta_Predictor_Glue","out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_0_PHT_HISTORY" );
+	_component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION"   , _name, "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION"               );	 
+      }
+      }
+
+    log_printf(FUNC,Meta_Predictor,"allocation","End");
+  };
+
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Meta_Predictor_deallocation.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Meta_Predictor_deallocation.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Meta_Predictor_deallocation.cpp	(revision 46)
@@ -0,0 +1,56 @@
+#ifdef SYSTEMC
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/include/Meta_Predictor.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+
+  void Meta_Predictor::deallocation (void)
+  {
+    log_printf(FUNC,Meta_Predictor,"deallocation","Begin");
+
+    delete     in_CLOCK;
+    delete     in_NRESET;
+
+    delete []  in_PREDICT_VAL        ;
+    delete [] out_PREDICT_ACK        ;
+    delete []  in_PREDICT_ADDRESS    ;
+    delete [] out_PREDICT_HISTORY    ;
+    delete [] out_PREDICT_DIRECTION  ;
+
+    delete []  in_BRANCH_COMPLETE_VAL        ;
+    delete [] out_BRANCH_COMPLETE_ACK        ;
+    delete []  in_BRANCH_COMPLETE_ADDRESS    ;
+    delete []  in_BRANCH_COMPLETE_HISTORY    ;
+    delete []  in_BRANCH_COMPLETE_DIRECTION  ;
+
+    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    
+
+    if (_param._have_meta_predictor)
+      {
+    delete component_Two_Level_Branch_Predictor_0;
+    delete component_Two_Level_Branch_Predictor_1;
+      }
+    delete component_Two_Level_Branch_Predictor_2;
+    delete component_Meta_Predictor_Glue         ;
+    delete _component;
+
+    log_printf(FUNC,Meta_Predictor,"deallocation","End");
+  };
+
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Meta_Predictor_statistics.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Meta_Predictor_statistics.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Meta_Predictor_statistics.cpp	(revision 46)
@@ -0,0 +1,44 @@
+#ifdef STATISTICS
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/include/Meta_Predictor.h"
+
+namespace morpheo {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+
+
+  string Meta_Predictor::statistics (uint32_t depth)
+  {
+    log_printf(FUNC,Meta_Predictor,"statistics","Begin");
+
+    string stat_component_Two_Level_Branch_Predictor_0 = (_param._have_meta_predictor==false)?"":component_Two_Level_Branch_Predictor_0->statistics(depth+1);
+    string stat_component_Two_Level_Branch_Predictor_1 = (_param._have_meta_predictor==false)?"":component_Two_Level_Branch_Predictor_1->statistics(depth+1);
+    string stat_component_Two_Level_Branch_Predictor_2 =                                         component_Two_Level_Branch_Predictor_2->statistics(depth+1);
+    string stat_component_Meta_Predictor_Glue          =                                         component_Meta_Predictor_Glue         ->statistics(depth+1);
+
+    string txt = _stat->print(depth,
+			      stat_component_Two_Level_Branch_Predictor_0 + 
+			      stat_component_Two_Level_Branch_Predictor_1 + 
+			      stat_component_Two_Level_Branch_Predictor_2 + 
+			      stat_component_Meta_Predictor_Glue          );
+    
+    log_printf(FUNC,Meta_Predictor,"statistics","End");
+
+    return txt;
+  };
+
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Meta_Predictor_transition.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Meta_Predictor_transition.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Meta_Predictor_transition.cpp	(revision 46)
@@ -0,0 +1,41 @@
+#ifdef SYSTEMC
+#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/include/Meta_Predictor.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+
+
+  void Meta_Predictor::transition (void)
+  {
+    log_printf(FUNC,Meta_Predictor,"transition","Begin");
+
+#ifdef STATISTICS
+    _stat->add();
+#endif    
+
+#ifdef VHDL_TESTBENCH
+    vhdl_testbench_transition ();
+#endif
+
+    log_printf(FUNC,Meta_Predictor,"transition","End");
+  };
+
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Meta_Predictor_vhdl.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Meta_Predictor_vhdl.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Meta_Predictor_vhdl.cpp	(revision 46)
@@ -0,0 +1,45 @@
+#ifdef VHDL
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/include/Meta_Predictor.h"
+#include "Behavioural/include/Vhdl.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+
+
+  void Meta_Predictor::vhdl (void)
+  {
+    log_printf(FUNC,Meta_Predictor,"vhdl","Begin");
+
+    Vhdl * vhdl = new Vhdl (_name);
+
+    _interfaces->set_port     (vhdl);
+    _component ->vhdl_instance(vhdl);
+
+    vhdl_declaration (vhdl);
+    vhdl_body        (vhdl);
+
+    vhdl->generate_file();
+
+    delete vhdl;
+
+    log_printf(FUNC,Meta_Predictor,"vhdl","End");
+
+  };
+
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Meta_Predictor_vhdl_body.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Meta_Predictor_vhdl_body.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Meta_Predictor_vhdl_body.cpp	(revision 46)
@@ -0,0 +1,31 @@
+#ifdef VHDL
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/include/Meta_Predictor.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+
+
+  void Meta_Predictor::vhdl_body (Vhdl * & vhdl)
+  {
+    log_printf(FUNC,Meta_Predictor,"vhdl_body","Begin");
+
+    log_printf(FUNC,Meta_Predictor,"vhdl_body","End");
+  };
+
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Meta_Predictor_vhdl_declaration.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Meta_Predictor_vhdl_declaration.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Meta_Predictor_vhdl_declaration.cpp	(revision 46)
@@ -0,0 +1,31 @@
+#ifdef VHDL
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/include/Meta_Predictor.h"
+
+namespace morpheo {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+
+
+  void Meta_Predictor::vhdl_declaration (Vhdl * & vhdl)
+  {
+    log_printf(FUNC,Meta_Predictor,"vhdl_declaration","Begin");
+
+    log_printf(FUNC,Meta_Predictor,"vhdl_declaration","End");
+  };
+
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Meta_Predictor_vhdl_port.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Meta_Predictor_vhdl_port.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Meta_Predictor_vhdl_port.cpp	(revision 46)
@@ -0,0 +1,52 @@
+#ifdef VHDL
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/include/Meta_Predictor.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+
+
+  void Meta_Predictor::vhdl_port (Vhdl & vhdl)
+  {
+    log_printf(FUNC,Meta_Predictor,"vhdl_port","Begin");
+
+    vhdl.set_port (" in_CLOCK ", IN, 1);
+    vhdl.set_port (" in_NRESET", IN, 1);
+
+    for (uint32_t i=0; i<_param._nb_prediction; i++)
+      {
+	vhdl.set_port (" in_PREDICT_VAL_"+toString(i)+"                ", IN, 1);
+	vhdl.set_port ("out_PREDICT_ACK_"+toString(i)+"                ",OUT, 1);
+	vhdl.set_port (" in_PREDICT_ADDRESS_"+toString(i)+"            ", IN,_param._size_address);
+	vhdl.set_port ("out_PREDICT_HISTORY_"+toString(i)+"            ",OUT,_param._size_history);
+    	vhdl.set_port ("out_PREDICT_DIRECTION_"+toString(i)+"          ",OUT,1);
+      }
+
+    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_HISTORY_"+toString(i)+"    ", IN,_param._size_history);
+	vhdl.set_port (" in_BRANCH_COMPLETE_DIRECTION_"+toString(i)+"  ", IN, 1);
+      }
+    
+    log_printf(FUNC,Meta_Predictor,"vhdl_port","End");
+  };
+
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Meta_Predictor_vhdl_testbench_label.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Meta_Predictor_vhdl_testbench_label.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Meta_Predictor_vhdl_testbench_label.cpp	(revision 46)
@@ -0,0 +1,33 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/include/Meta_Predictor.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+
+
+  void Meta_Predictor::vhdl_testbench_label (string label)
+  {
+    log_printf(FUNC,Meta_Predictor,"vhdl_testbench_label","Begin");
+
+#ifdef VHDL_TESTBENCH
+    _vhdl_testbench->add_label(label);
+#endif
+    
+    log_printf(FUNC,Meta_Predictor,"vhdl_testbench_label","End");
+  };
+
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Meta_Predictor_vhdl_testbench_port.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Meta_Predictor_vhdl_testbench_port.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Meta_Predictor_vhdl_testbench_port.cpp	(revision 46)
@@ -0,0 +1,51 @@
+#ifdef VHDL_TESTBENCH
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/include/Meta_Predictor.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+
+
+  void Meta_Predictor::vhdl_testbench_port ()
+  {
+    log_printf(FUNC,Meta_Predictor,"vhdl_testbench_port","Begin");
+
+    _vhdl_testbench->set_port (" in_NRESET", IN, 1);
+
+    for (uint32_t i=0; i<_param._nb_prediction; i++)
+      {
+	_vhdl_testbench->set_port (" in_PREDICT_VAL_"+toString(i)+"                ", IN, 1);
+	_vhdl_testbench->set_port ("out_PREDICT_ACK_"+toString(i)+"                ",OUT, 1);
+	_vhdl_testbench->set_port (" in_PREDICT_ADDRESS_"+toString(i)+"            ", IN,_param._size_address);
+	_vhdl_testbench->set_port ("out_PREDICT_HISTORY_"+toString(i)+"            ",OUT,_param._size_history);
+    	_vhdl_testbench->set_port ("out_PREDICT_DIRECTION_"+toString(i)+"          ",OUT,1);
+      }
+
+    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
+      {
+	_vhdl_testbench->set_port (" in_BRANCH_COMPLETE_VAL_"+toString(i)+"        ", IN, 1);
+	_vhdl_testbench->set_port ("out_BRANCH_COMPLETE_ACK_"+toString(i)+"        ",OUT, 1);
+	_vhdl_testbench->set_port (" in_BRANCH_COMPLETE_ADDRESS_"+toString(i)+"    ", IN,_param._size_address);
+	_vhdl_testbench->set_port (" in_BRANCH_COMPLETE_HISTORY_"+toString(i)+"    ", IN,_param._size_history);
+	_vhdl_testbench->set_port (" in_BRANCH_COMPLETE_DIRECTION_"+toString(i)+"  ", IN, 1);
+      }
+
+    log_printf(FUNC,Meta_Predictor,"vhdl_testbench_port","End");
+  };
+
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Meta_Predictor_vhdl_testbench_transition.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Meta_Predictor_vhdl_testbench_transition.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Meta_Predictor_vhdl_testbench_transition.cpp	(revision 46)
@@ -0,0 +1,35 @@
+#ifdef VHDL_TESTBENCH
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/include/Meta_Predictor.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+
+
+  void Meta_Predictor::vhdl_testbench_transition ()
+  {
+    log_printf(FUNC,Meta_Predictor,"vhdl_testbench_transition","Begin");
+
+//  sc_start(0);
+
+    _interfaces->testbench();
+
+    log_printf(FUNC,Meta_Predictor,"vhdl_testbench_transition","End");
+  };
+
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Parameters.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Parameters.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Parameters.cpp	(revision 46)
@@ -0,0 +1,251 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/include/Parameters.h"
+
+namespace morpheo {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+
+  Parameters::Parameters (bool     have_meta_predictor               ,
+			  
+			  bool     predictor_0_have_bht              ,
+			  uint32_t predictor_0_bht_size_shifter      ,
+			  uint32_t predictor_0_bht_nb_shifter        ,
+			  bool     predictor_0_have_pht              ,
+			  uint32_t predictor_0_pht_size_counter      ,
+			  uint32_t predictor_0_pht_nb_counter        ,
+			  uint32_t predictor_0_pht_size_address_share,
+			  
+			  bool     predictor_1_have_bht              ,
+			  uint32_t predictor_1_bht_size_shifter      ,
+			  uint32_t predictor_1_bht_nb_shifter        ,
+			  bool     predictor_1_have_pht              ,
+			  uint32_t predictor_1_pht_size_counter      ,
+			  uint32_t predictor_1_pht_nb_counter        ,
+			  uint32_t predictor_1_pht_size_address_share,
+			  
+			  bool     predictor_2_have_bht              ,
+			  uint32_t predictor_2_bht_size_shifter      ,
+			  uint32_t predictor_2_bht_nb_shifter        ,
+			  bool     predictor_2_have_pht              ,
+			  uint32_t predictor_2_pht_size_counter      ,
+			  uint32_t predictor_2_pht_nb_counter        ,
+			  uint32_t predictor_2_pht_size_address_share,
+			  
+			  uint32_t size_address                      ,
+			  uint32_t nb_prediction                     ,
+			  uint32_t nb_branch_complete                ):
+    _have_meta_predictor                (have_meta_predictor               ),
+
+    _predictor_0_have_bht               ((have_meta_predictor==false)?false:predictor_0_have_bht              ),
+    _predictor_0_bht_size_shifter       ((_predictor_0_have_bht==false)?0:predictor_0_bht_size_shifter      ),
+    _predictor_0_bht_nb_shifter         ((_predictor_0_have_bht==false)?0:predictor_0_bht_nb_shifter        ),
+    _predictor_0_have_pht               ((have_meta_predictor==false)?false:predictor_0_have_pht              ),
+    _predictor_0_pht_size_counter       ((_predictor_0_have_pht==false)?0:predictor_0_pht_size_counter      ),
+    _predictor_0_pht_nb_counter         ((_predictor_0_have_pht==false)?0:predictor_0_pht_nb_counter        ),
+    _predictor_0_pht_size_address_share (predictor_0_pht_size_address_share),
+
+    _predictor_1_have_bht               ((have_meta_predictor==false)?false:predictor_1_have_bht              ),
+    _predictor_1_bht_size_shifter       ((_predictor_1_have_bht==false)?0:predictor_1_bht_size_shifter      ),
+    _predictor_1_bht_nb_shifter         ((_predictor_1_have_bht==false)?0:predictor_1_bht_nb_shifter        ),
+    _predictor_1_have_pht               ((have_meta_predictor==false)?false:predictor_1_have_pht              ),
+    _predictor_1_pht_size_counter       ((_predictor_1_have_pht==false)?0:predictor_1_pht_size_counter      ),
+    _predictor_1_pht_nb_counter         ((_predictor_1_have_pht==false)?0:predictor_1_pht_nb_counter        ),
+    _predictor_1_pht_size_address_share (predictor_1_pht_size_address_share),
+
+    _predictor_2_have_bht               (predictor_2_have_bht              ),
+    _predictor_2_bht_size_shifter       ((_predictor_2_have_bht==false)?0:predictor_2_bht_size_shifter      ),
+    _predictor_2_bht_nb_shifter         ((_predictor_2_have_bht==false)?0:predictor_2_bht_nb_shifter        ),
+    _predictor_2_have_pht               (predictor_2_have_pht              ),
+    _predictor_2_pht_size_counter       ((_predictor_2_have_pht==false)?0:predictor_2_pht_size_counter      ),
+    _predictor_2_pht_nb_counter         ((_predictor_2_have_pht==false)?0:predictor_2_pht_nb_counter        ),
+    _predictor_2_pht_size_address_share (predictor_2_pht_size_address_share),
+
+    _size_address                       (size_address                      ),
+    _nb_prediction                      (nb_prediction                     ),
+    _nb_branch_complete                 (nb_branch_complete                ),
+
+    _size_history                       (_predictor_0_bht_size_shifter + _predictor_0_pht_size_counter +
+					 _predictor_1_bht_size_shifter + _predictor_1_pht_size_counter +
+					 _predictor_2_bht_size_shifter + _predictor_2_pht_size_counter )
+  {
+    log_printf(FUNC,Meta_Predictor,"Parameters","Begin");
+    
+    if (_have_meta_predictor)
+      {
+    _param_two_level_branch_predictor_0 = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Parameters (_predictor_0_have_bht              ,
+																		      _predictor_0_bht_size_shifter      ,
+																		      _predictor_0_bht_nb_shifter        ,
+																		      _predictor_0_have_pht              ,
+																		      _predictor_0_pht_size_counter      ,
+																		      _predictor_0_pht_nb_counter        ,
+																		      _predictor_0_pht_size_address_share,
+																		      _size_address                      ,
+																		      _nb_prediction                     ,
+																		      _nb_branch_complete                );
+
+    _param_two_level_branch_predictor_1 = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Parameters (_predictor_1_have_bht              ,
+																		      _predictor_1_bht_size_shifter      ,
+																		      _predictor_1_bht_nb_shifter        ,
+																		      _predictor_1_have_pht              ,
+																		      _predictor_1_pht_size_counter      ,
+																		      _predictor_1_pht_nb_counter        ,
+																		      _predictor_1_pht_size_address_share,
+																		      _size_address                      ,
+																		      _nb_prediction                     ,
+																		      _nb_branch_complete                );
+      }
+
+    _param_two_level_branch_predictor_2 = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Parameters (_predictor_2_have_bht              ,
+																		      _predictor_2_bht_size_shifter      ,
+																		      _predictor_2_bht_nb_shifter        ,
+																		      _predictor_2_have_pht              ,
+																		      _predictor_2_pht_size_counter      ,
+																		      _predictor_2_pht_nb_counter        ,
+																		      _predictor_2_pht_size_address_share,
+																		      _size_address                      ,
+																		      _nb_prediction                     ,
+																		      _nb_branch_complete                );
+
+
+    _param_meta_predictor_glue = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::meta_predictor_glue::Parameters (_have_meta_predictor               ,
+																       _predictor_0_have_bht              ,
+																       _predictor_0_bht_size_shifter      ,
+																       _predictor_0_have_pht              ,
+																       _predictor_0_pht_size_counter      ,
+																       _predictor_1_have_bht              ,
+																       _predictor_1_bht_size_shifter      ,
+																       _predictor_1_have_pht              ,
+																       _predictor_1_pht_size_counter      ,
+																       _predictor_2_have_bht              ,
+																       _predictor_2_bht_size_shifter      ,
+																       _predictor_2_have_pht              ,
+																       _predictor_2_pht_size_counter      ,
+																       _nb_prediction                     ,
+																       _nb_branch_complete                );
+
+    test();
+    
+    log_printf(FUNC,Meta_Predictor,"Parameters","End");
+  };
+  
+  Parameters::Parameters (Parameters & param):
+    _have_meta_predictor                (param._have_meta_predictor               ),
+
+    _predictor_0_have_bht               (param._predictor_0_have_bht              ),
+    _predictor_0_bht_size_shifter       (param._predictor_0_bht_size_shifter      ),
+    _predictor_0_bht_nb_shifter         (param._predictor_0_bht_nb_shifter        ),
+    _predictor_0_have_pht               (param._predictor_0_have_pht              ),
+    _predictor_0_pht_size_counter       (param._predictor_0_pht_size_counter      ),
+    _predictor_0_pht_nb_counter         (param._predictor_0_pht_nb_counter        ),
+    _predictor_0_pht_size_address_share (param._predictor_0_pht_size_address_share),
+
+    _predictor_1_have_bht               (param._predictor_1_have_bht              ),
+    _predictor_1_bht_size_shifter       (param._predictor_1_bht_size_shifter      ),
+    _predictor_1_bht_nb_shifter         (param._predictor_1_bht_nb_shifter        ),
+    _predictor_1_have_pht               (param._predictor_1_have_pht              ),
+    _predictor_1_pht_size_counter       (param._predictor_1_pht_size_counter      ),
+    _predictor_1_pht_nb_counter         (param._predictor_1_pht_nb_counter        ),
+    _predictor_1_pht_size_address_share (param._predictor_1_pht_size_address_share),
+
+    _predictor_2_have_bht               (param._predictor_2_have_bht              ),
+    _predictor_2_bht_size_shifter       (param._predictor_2_bht_size_shifter      ),
+    _predictor_2_bht_nb_shifter         (param._predictor_2_bht_nb_shifter        ),
+    _predictor_2_have_pht               (param._predictor_2_have_pht              ),
+    _predictor_2_pht_size_counter       (param._predictor_2_pht_size_counter      ),
+    _predictor_2_pht_nb_counter         (param._predictor_2_pht_nb_counter        ),
+    _predictor_2_pht_size_address_share (param._predictor_2_pht_size_address_share),
+
+    _size_address                       (param._size_address                      ),
+    _nb_prediction                      (param._nb_prediction                     ),
+    _nb_branch_complete                 (param._nb_branch_complete                ),
+    
+    _size_history                       (param._size_history                      )
+  {
+    log_printf(FUNC,Meta_Predictor,"Parameters","Begin");
+
+
+    if (_have_meta_predictor)
+      {
+    _param_two_level_branch_predictor_0 = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Parameters (_predictor_0_have_bht              ,
+																		      _predictor_0_bht_size_shifter      ,
+																		      _predictor_0_bht_nb_shifter        ,
+																		      _predictor_0_have_pht              ,
+																		      _predictor_0_pht_size_counter      ,
+																		      _predictor_0_pht_nb_counter        ,
+																		      _predictor_0_pht_size_address_share,
+																		      _size_address                      ,
+																		      _nb_prediction                     ,
+																		      _nb_branch_complete                );
+
+    _param_two_level_branch_predictor_1 = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Parameters (_predictor_1_have_bht              ,
+																		      _predictor_1_bht_size_shifter      ,
+																		      _predictor_1_bht_nb_shifter        ,
+																		      _predictor_1_have_pht              ,
+																		      _predictor_1_pht_size_counter      ,
+																		      _predictor_1_pht_nb_counter        ,
+																		      _predictor_1_pht_size_address_share,
+																		      _size_address                      ,
+																		      _nb_prediction                     ,
+																		      _nb_branch_complete                );
+      }
+
+    _param_two_level_branch_predictor_2 = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Parameters (_predictor_2_have_bht              ,
+																		      _predictor_2_bht_size_shifter      ,
+																		      _predictor_2_bht_nb_shifter        ,
+																		      _predictor_2_have_pht              ,
+																		      _predictor_2_pht_size_counter      ,
+																		      _predictor_2_pht_nb_counter        ,
+																		      _predictor_2_pht_size_address_share,
+																		      _size_address                      ,
+																		      _nb_prediction                     ,
+																		      _nb_branch_complete                );
+    
+    _param_meta_predictor_glue = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::meta_predictor_glue::Parameters (_have_meta_predictor               ,
+																       _predictor_0_have_bht              ,
+																       _predictor_0_bht_size_shifter      ,
+																       _predictor_0_have_pht              ,
+																       _predictor_0_pht_size_counter      ,
+																       _predictor_1_have_bht              ,
+																       _predictor_1_bht_size_shifter      ,
+																       _predictor_1_have_pht              ,
+																       _predictor_1_pht_size_counter      ,
+																       _predictor_2_have_bht              ,
+																       _predictor_2_bht_size_shifter      ,
+																       _predictor_2_have_pht              ,
+																       _predictor_2_pht_size_counter      ,
+																       _nb_prediction                     ,
+																       _nb_branch_complete                );
+
+    test();
+    log_printf(FUNC,Meta_Predictor,"Parameters","End");
+  };
+
+  Parameters::~Parameters () 
+  {
+    log_printf(FUNC,Meta_Predictor,"~Parameters","Begin");
+
+    if (_have_meta_predictor)
+      {
+    delete _param_two_level_branch_predictor_0;
+    delete _param_two_level_branch_predictor_1;
+      }
+    delete _param_two_level_branch_predictor_2;
+    delete _param_meta_predictor_glue;
+
+    log_printf(FUNC,Meta_Predictor,"~Parameters","End");
+  };
+
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Parameters_msg_error.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Parameters_msg_error.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Parameters_msg_error.cpp	(revision 46)
@@ -0,0 +1,49 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/include/Parameters.h"
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/include/Types.h"
+#include <sstream>
+using namespace std;
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+
+
+  string Parameters::msg_error(void)
+  {
+    log_printf(FUNC,Meta_Predictor,"msg_error","Begin");
+
+    string msg = "";
+
+    // note : size_shifter and size_counter is set at 0 if not need
+    if ((8*sizeof(Thistory_t)) < _size_history)
+      {
+        msg += "  - type \"Thistory_t\" is too little to the total size of history (shifter's size and counter's size)\n";
+        msg +=  "    * predictor_0_bht_size_shifter    : " + toString(_predictor_0_bht_size_shifter) + "\n";
+        msg +=  "    * predictor_0_pht_size_counter    : " + toString(_predictor_0_pht_size_counter) + "\n";
+        msg +=  "    * predictor_1_bht_size_shifter    : " + toString(_predictor_1_bht_size_shifter) + "\n";
+        msg +=  "    * predictor_1_pht_size_counter    : " + toString(_predictor_1_pht_size_counter) + "\n";
+        msg +=  "    * predictor_2_bht_size_shifter    : " + toString(_predictor_2_bht_size_shifter) + "\n";
+        msg +=  "    * predictor_2_pht_size_counter    : " + toString(_predictor_2_pht_size_counter) + "\n";
+	msg +=  "    * Thistory_t                (bits): " + toString(8*(sizeof(Thistory_t))) + "\n";
+      }
+
+    return msg;
+
+    log_printf(FUNC,Meta_Predictor,"msg_error","End");
+  };
+
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Parameters_print.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Parameters_print.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Parameters_print.cpp	(revision 46)
@@ -0,0 +1,145 @@
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/include/Parameters.h"
+#include "Behavioural/include/XML.h"
+using namespace std;
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+
+
+  string Parameters::print (uint32_t depth)
+  {
+    log_printf(FUNC,Meta_Predictor,"print","Begin");
+
+    uint32_t size_predictor_0 = _predictor_0_bht_size_shifter*_predictor_0_bht_nb_shifter+_predictor_0_pht_size_counter*_predictor_0_pht_nb_counter;
+    uint32_t size_predictor_1 = _predictor_1_bht_size_shifter*_predictor_1_bht_nb_shifter+_predictor_1_pht_size_counter*_predictor_1_pht_nb_counter;
+    uint32_t size_predictor_2 = _predictor_2_bht_size_shifter*_predictor_2_bht_nb_shifter+_predictor_2_pht_size_counter*_predictor_2_pht_nb_counter;
+    uint32_t size_predictor   = size_predictor_0+size_predictor_1+size_predictor_2;
+
+    XML xml ("meta_predictor");
+    xml.balise_open("meta_predictor");
+
+    xml.  text("");
+    xml.  comment("size predictor   : "+toString(size_predictor  )+" bits");
+    xml.  comment("size predictor_0 : "+toString(size_predictor_0)+" bits");
+    xml.  comment("size predictor_1 : "+toString(size_predictor_1)+" bits");
+    xml.  comment("size predictor_2 : "+toString(size_predictor_2)+" bits");
+    xml.  text("");
+
+    xml.  singleton_begin("have_meta_predictor               ");               
+    xml.    attribut("value",toString(_have_meta_predictor               ));
+    xml.  singleton_end();
+
+    xml.  singleton_begin("predictor_0_have_bht              ");        	
+    xml.    attribut("value",toString(_predictor_0_have_bht              ));
+    xml.  singleton_end();
+    xml.  singleton_begin("predictor_0_bht_size_shifter      ");	
+    xml.    attribut("value",toString(_predictor_0_bht_size_shifter      ));
+    xml.  singleton_end();
+    xml.  singleton_begin("predictor_0_bht_nb_shifter        ");        
+    xml.    attribut("value",toString(_predictor_0_bht_nb_shifter        ));
+    xml.  singleton_end();
+    xml.  singleton_begin("predictor_0_have_pht              ");              
+    xml.    attribut("value",toString(_predictor_0_have_pht              ));
+    xml.  singleton_end();
+    xml.  singleton_begin("predictor_0_pht_size_counter      ");      
+    xml.    attribut("value",toString(_predictor_0_pht_size_counter      ));
+    xml.  singleton_end();
+    xml.  singleton_begin("predictor_0_pht_nb_counter        ");        
+    xml.    attribut("value",toString(_predictor_0_pht_nb_counter        ));
+    xml.  singleton_end();
+    xml.  singleton_begin("predictor_0_pht_size_address_share");
+    xml.    attribut("value",toString(_predictor_0_pht_size_address_share));
+    xml.  singleton_end();
+
+    xml.  singleton_begin("predictor_1_have_bht              ");        	
+    xml.    attribut("value",toString(_predictor_1_have_bht              ));
+    xml.  singleton_end();
+    xml.  singleton_begin("predictor_1_bht_size_shifter      ");	
+    xml.    attribut("value",toString(_predictor_1_bht_size_shifter      ));
+    xml.  singleton_end();
+    xml.  singleton_begin("predictor_1_bht_nb_shifter        ");        
+    xml.    attribut("value",toString(_predictor_1_bht_nb_shifter        ));
+    xml.  singleton_end();
+    xml.  singleton_begin("predictor_1_have_pht              ");              
+    xml.    attribut("value",toString(_predictor_1_have_pht              ));
+    xml.  singleton_end();
+    xml.  singleton_begin("predictor_1_pht_size_counter      ");      
+    xml.    attribut("value",toString(_predictor_1_pht_size_counter      ));
+    xml.  singleton_end();
+    xml.  singleton_begin("predictor_1_pht_nb_counter        ");        
+    xml.    attribut("value",toString(_predictor_1_pht_nb_counter        ));
+    xml.  singleton_end();
+    xml.  singleton_begin("predictor_1_pht_size_address_share");
+    xml.    attribut("value",toString(_predictor_1_pht_size_address_share));
+    xml.  singleton_end();
+    
+    xml.  singleton_begin("predictor_2_have_bht              ");        	
+    xml.    attribut("value",toString(_predictor_2_have_bht              ));
+    xml.  singleton_end();
+    xml.  singleton_begin("predictor_2_bht_size_shifter      ");	
+    xml.    attribut("value",toString(_predictor_2_bht_size_shifter      ));
+    xml.  singleton_end();
+    xml.  singleton_begin("predictor_2_bht_nb_shifter        ");        
+    xml.    attribut("value",toString(_predictor_2_bht_nb_shifter        ));
+    xml.  singleton_end();
+    xml.  singleton_begin("predictor_2_have_pht              ");              
+    xml.    attribut("value",toString(_predictor_2_have_pht              ));
+    xml.  singleton_end();
+    xml.  singleton_begin("predictor_2_pht_size_counter      ");      
+    xml.    attribut("value",toString(_predictor_2_pht_size_counter      ));
+    xml.  singleton_end();
+    xml.  singleton_begin("predictor_2_pht_nb_counter        ");        
+    xml.    attribut("value",toString(_predictor_2_pht_nb_counter        ));
+    xml.  singleton_end();
+    xml.  singleton_begin("predictor_2_pht_size_address_share");
+    xml.    attribut("value",toString(_predictor_2_pht_size_address_share));
+    xml.  singleton_end();
+        
+    xml.  singleton_begin("size_address                      ");                      
+    xml.    attribut("value",toString(_size_address          ));
+    xml.  singleton_end();
+    xml.  singleton_begin("nb_prediction                     ");                     
+    xml.    attribut("value",toString(_nb_prediction         ));
+    xml.  singleton_end();
+    xml.  singleton_begin("nb_branch_complete                ");                
+    xml.    attribut("value",toString(_nb_branch_complete    ));
+    xml.  singleton_end();
+    
+    if (_have_meta_predictor)
+      {
+    xml.  text(_param_two_level_branch_predictor_0->print(depth+1));
+    xml.  text(_param_two_level_branch_predictor_1->print(depth+1));
+      }
+    xml.  text(_param_two_level_branch_predictor_2->print(depth+1));
+    xml.  text(_param_meta_predictor_glue         ->print(depth+1));
+
+    xml.balise_close();
+
+    log_printf(FUNC,Meta_Predictor,"print","End");
+    
+    return xml.get_body(depth);
+  };
+
+  ostream& operator<< (ostream& output_stream ,
+		       morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::Parameters & x)
+  {
+    output_stream << x.print(0);
+    
+    return output_stream;
+  };
+
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+}; // end namespace behavioural
+}; // end namespace morpheo              
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Statistics.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Statistics.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Statistics.cpp	(revision 46)
@@ -0,0 +1,42 @@
+#ifdef STATISTICS
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/include/Statistics.h"
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+
+
+  Statistics::Statistics (string                                      name                       ,
+			  morpheo::behavioural::Parameters_Statistics parameters_statistics      ,
+			  Parameters                                  parameters
+			  ) :
+    morpheo::behavioural::Statistics(name                  ,
+				     parameters_statistics ),
+    _parameters(parameters)
+  {
+    log_printf(FUNC,Meta_Predictor,"Statistics","Begin");
+    log_printf(FUNC,Meta_Predictor,"Statistics","End");
+  };
+  
+  Statistics::~Statistics () 
+  { 
+    log_printf(FUNC,Meta_Predictor,"~Statistics","Begin");
+    log_printf(FUNC,Meta_Predictor,"~Statistics","End");
+  };
+
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Statistics_add.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Statistics_add.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Statistics_add.cpp	(revision 46)
@@ -0,0 +1,33 @@
+#ifdef STATISTICS
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/include/Statistics.h"
+
+#include <sstream>
+using namespace std;
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+
+
+  void Statistics::add ()
+  {
+    log_printf(FUNC,Meta_Predictor,"add","Begin");
+    log_printf(FUNC,Meta_Predictor,"add","End");
+  };
+
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Statistics_print.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Statistics_print.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Statistics_print.cpp	(revision 46)
@@ -0,0 +1,58 @@
+#ifdef STATISTICS
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/include/Statistics.h"
+
+#include <sstream>
+using namespace std;
+
+namespace morpheo {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+
+
+  string Statistics::print (uint32_t depth,
+			    string   component_stat)
+  {
+    log_printf(FUNC,Meta_Predictor,"print","Begin");
+
+    string        tab = string(depth,'\t');
+    ostringstream msg;
+
+    msg << tab << "<meta_predictor name=\"" << _name << "\" >" << endl
+        << print_body(depth+1) << endl
+	<< component_stat
+	<< tab << "</meta_predictor>" << endl;
+    
+    log_printf(FUNC,Meta_Predictor,"print","End");
+
+    return msg.str();
+  };
+
+  string Statistics::print (uint32_t depth)
+  {
+    return print(depth,"");
+  };
+
+  ostream& operator<< (ostream& output_stream ,
+		       morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::Statistics & x)
+  {
+    output_stream << x.print(0);
+
+    return output_stream;
+  };
+
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Statistics_print_body.cpp
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Statistics_print_body.cpp	(revision 46)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Meta_Predictor/src/Statistics_print_body.cpp	(revision 46)
@@ -0,0 +1,41 @@
+#ifdef STATISTICS
+/*
+ * $Id$
+ *
+ * [ Description ]
+ * 
+ */
+
+#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/include/Statistics.h"
+
+#include <sstream>
+using namespace std;
+
+namespace morpheo                    {
+namespace behavioural {
+namespace stage_1_ifetch {
+namespace predictor {
+namespace meta_predictor {
+
+
+  string Statistics::print_body (uint32_t depth)
+  {
+    log_printf(FUNC,Meta_Predictor,"print_body","Begin");
+
+    string        tab = string(depth,'\t');
+    ostringstream msg;
+
+    msg << tab << "";
+    
+    log_printf(FUNC,Meta_Predictor,"print_body","End");
+
+    return msg.str();
+  };
+
+}; // end namespace meta_predictor
+}; // end namespace predictor
+}; // end namespace stage_1_ifetch
+
+}; // end namespace behavioural
+}; // end namespace morpheo              
+#endif
